fdo#75026: Sometimes we need to update grid view while not being active.

For example when "jumping to mark" in the non-active window triggered by
hyperlink in the active one.  The jump-to-mark command gets dispatched before
the new window is officially activated.

Change-Id: I4e9c126b061ee3af4440e36d1ba6d796eb1c3539
(cherry picked from commit 52cc88d6191ba0c4b6477e5c4b9c5d0f0228030d)
Reviewed-on: https://gerrit.libreoffice.org/9068
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Resolves: fdo#75525 out by one error

(cherry picked from commit 12984e46704f1e55f76b210cf65217e54662dc26)

Conflicts:
	starmath/source/dialog.cxx

Change-Id: I0171d2a79b6b015fa2f01d78228e901005017fb0
Reviewed-on: https://gerrit.libreoffice.org/9066
Reviewed-by: Kohei Yoshida <libreoffice@kohei.us>
Tested-by: Kohei Yoshida <libreoffice@kohei.us>
fdo#75665: Truncate string when clipped on screen.

This improves performance of text layouting by HarfBuzz for very long strings.
HarfBuzz's layout algorithm appears to be more expensive than ICU's.

(cherry picked from commit 087a79db1272858f107656c5ca3c6efb45680986)
(cherry picked from commit 6fa4d31d6a7e363285f22d4c0012521d10073652)
(cherry picked from commit 8e50a6c7b1cb9481cce42c71ff07e921fb4292d0)
(cherry picked from commit 21fc47e115530780ad45ae64e8076dc5e9fedb5e)

Conflicts:
	sc/inc/scopetools.hxx
	sc/source/core/tool/scopetools.cxx
	sc/source/ui/view/output2.cxx

Change-Id: Ic9738b7b8f0f1a29c51c83b147763118939b90ef
Reviewed-on: https://gerrit.libreoffice.org/9057
Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
fdo#74555: Avoid excessive calls to GetPreviewCellStyle().

GetOptimalHeight() gets called *all the time* and is very performance
sensitive.  Let's not do an expensive operation such as GetPreviewCellStyle()
which slows down pretty much everything else after the non-default font is
applied.

Change-Id: I5d5b2e706dd5dd98173044642b98ccaedd9536f0
(cherry picked from commit 947177a5cb79e03a415d9c3d1203420c874d2b35)
Reviewed-on: https://gerrit.libreoffice.org/9074
Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
fdo#74687: Undo & redo of format-only changes don't need broadcasting.

Also discovered that the undo path was broadcasting twice.  Let's only
do it once.

Change-Id: I169f1659aecb1eb78be3a497e244f79c5883e50f
(cherry picked from commit 1d1fbbe81b4435765d3f69c6bcae2840dc629912)
Reviewed-on: https://gerrit.libreoffice.org/9075
Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
missing header include

Change-Id: I5bb1f1f5a457d4d390318fc793b15df078423c8c
Resolves: fdo#76916 'User paths' is missing in tab MotionMotion Paths tab

(cherry picked from commit 8b9858b0aeae8bfb3af6dd8fcfce6cecdb9b8fab)

Conflicts:
	sd/source/ui/animations/CustomAnimationCreateDialog.cxx

Change-Id: I38deeae3135badde23b9d454d548193af654caab
Reviewed-on: https://gerrit.libreoffice.org/9076
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
fdo#74697 Add Bluez 5 support for impress remote.

This time we:
 - Don't break SAL_WARN with an fprintf like syntax.
 - Replace DBUS_TYPE_UNIX_FD with it's definition 'h' as we might
   be building on dbus-glib versions that do not support it (however
   presumably anyone running bluez 5 will have a dbus version that is
   new enough to support this, i.e. purely a build-time issue).
 - Remove various C++11'isms.

Change-Id: I736cad2122cd3789a5c7fb62c39e409d41fc1e32
Reviewed-on: https://gerrit.libreoffice.org/8924
Tested-by: Andrzej Hunt <andrzej.hunt@collabora.com>
Reviewed-by: Andrzej Hunt <andrzej.hunt@collabora.com>
(cherry picked from commit b15666fd7582729c75bd0dd1bd0cb5d7c5a77f0c)
Reviewed-on: https://gerrit.libreoffice.org/8931
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
limit the range shrinking in charts to really large ranges, fdo#70609,

Also improves the situation for fdo#55697.

It is just the fist step to a better algorithm.

Change-Id: I15de1ca6604e585fcf5690f0d903c757d641e765
Reviewed-on: https://gerrit.libreoffice.org/9078
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
fdo#77342: sw: fix copy/paste of footnote cross references

The fix for sequence fields broke the footnote references some more;
simplify it by handling the footnotes in the same way as the sequence
fields, and not remapping GetExp fields for which the corresponding
SetExp field / footnote is missing.

Also, don't do any remapping when the target is a clipboard document, to
prevent modifying the source document.

(regression from bb665affbd8870652ade3951d626d76e99143f67)

(cherry picked from commit cbfcb837fb06a14daf5281ae13fc1886328cee6f)

Conflicts:
	sw/source/core/fields/reffld.cxx

Change-Id: If1be1e1d9742182a4085bbbff53e26a8fa8665b8
Reviewed-on: https://gerrit.libreoffice.org/9085
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
zero various members

(cherry picked from commit 9de20d1eb046f7bb92d893408206b91a9c054e2e)

Conflicts:
	filter/Module_filter.mk
	filter/source/graphicfilter/ipcx/ipcx.cxx
	filter/source/graphicfilter/itiff/itiff.cxx

Change-Id: Iad6948fdf6eb60f86d764783b72a4fe7f5642e40
Reviewed-on: https://gerrit.libreoffice.org/9082
Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Resolves: rhbz#1086714 overlarge pixmap

(cherry picked from commit f31ac2405bbd0755fb14daa6cb84d7bb7d84c492)

Conflicts:
	canvas/source/cairo/cairo_xlib_cairo.cxx
	vcl/unx/x11/xlimits.cxx

Change-Id: I015308406a43e6b039059a5e35316d59745d0a48
Reviewed-on: https://gerrit.libreoffice.org/9083
Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
coverity#1202882 Dereference before null check

Change-Id: Ie61df08c11b687c0b4a3ae212b3f9a6c95171396
(cherry picked from commit c152349f69acfb6bb873ed1cd12ca1b6dc325f1f)
Reviewed-on: https://gerrit.libreoffice.org/9095
Tested-by: Andrzej Hunt <andrzej.hunt@collabora.com>
Reviewed-by: Andrzej Hunt <andrzej.hunt@collabora.com>
handle strange brightness+contrast adjustment from msoffice (fdo#38410)

LO uses basically the formula "newpixel=(oldpixel-128)*contrast+128+brightness",
i.e. contrast is applied first. It looks like there's no "oficial" formula for this,
so a formula that applies brightness first would be ok too. MSO for some weird reason
apparently uses a formula that applies half of brightness before contrast and
half afterwards (insert funny political correctness or compromise joke here).
While the result is the same like with the LO formula if only either brightness
or contrast is adjusted, the result is different if both are involved. Just modify
the image using the MSO algorithm if this is the case.

Conflicts:
	filter/source/msfilter/msdffimp.cxx
	include/vcl/bitmap.hxx
	include/vcl/bitmapex.hxx
	include/vcl/gdimtf.hxx
	vcl/source/gdi/bitmap3.cxx
	vcl/source/gdi/bitmapex.cxx
	vcl/source/gdi/gdimtf.cxx

Change-Id: I55fe8f395832685b90f024cf2f58b0797c1ba588
Reviewed-on: https://gerrit.libreoffice.org/9099
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
every even numbered print job is reported as failed

because of.
bool bSuccess;
...
bSuccess &= ...endSpool(...);

in PspSalPrinter::StartJob

was...

endSpool return value is effectively success flag, not job ID

(cherry picked from commit e6323214830895d1c76ec44ee53990bf577fbda2)

Change-Id: I5b96eeff80ca29f0f8f24ee6da7a2ca76cbb05ce
Reviewed-on: https://gerrit.libreoffice.org/9093
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
Related: rhbz#1088625 PresenterPaintManager seen as NULL

Change-Id: I3b7ba51d48ebc5f9304f6125de0595d41d50ad4d
(cherry picked from commit 42dd5615429e6273e9169a4bd941ad56fec1e6f6)
Reviewed-on: https://gerrit.libreoffice.org/9094
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
fdo#75735 RTF import: fix COW when writing a nested structure

Regression from a48e2fd9049797110b3b2505c363557284987ca8 (fdo#44736 -
convert RTFSprms to a copy-on-write structure., 2012-12-07)

(cherry picked from commit 6b6e4d471c2954d34d280398ed1c986d7fb27ae1)

Conflicts:
	writerfilter/source/rtftok/rtfsprm.hxx

Change-Id: I2538f440e29cef6d40db2ea914e4afcbfe411890
Reviewed-on: https://gerrit.libreoffice.org/9100
Tested-by: David Tardon <dtardon@redhat.com>
Reviewed-by: David Tardon <dtardon@redhat.com>
prevent KDE/Qt from interfering with the session manager

I occassionally get lockups in IceProcessMessages() called from QtCore,
I'm actually not exactly sure why, as theoretically two connections
from one app shouldn't be a problem, but since LO does its own
session handling, there's no need to the KDE/Qt code to be involved,
so prevent it from connecting to the session manager altogether.

Change-Id: Iebe20d4cb5403e5fea8bd5d8c1f69b62d1c2907b
(cherry picked from commit 71f2aff7a56cef4e133abad3c2e447c76c5ee1fe)
Reviewed-on: https://gerrit.libreoffice.org/9079
Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com>
Tested-by: Maxim Monastirsky <momonasmon@gmail.com>
fdo#77603 new wildcard in autocorrection: .* instead of *

(cherry picked from commit 022e351c2431e0260220a51a54d576f49f789ebc)

Conflicts:

	editeng/source/misc/svxacorr.cxx

Change-Id: I04700e742239c97de39cf502fd8b0845b03c4e3a
handle properly page breaks even if a page contains only a frame (fdo#55381)

The test document has 4 pages which only contain frames, first 3 pages
(sections) have <p> block with <framePr> and another <p> with just <sectPr>,
and the second paragraph would be removed, thus there would be no nodes on which
to actually set the page style and they would be set on nodes for the previous
page, overwriting its page style. The last page does not have its own <p>
at all, so it needs to be faked.

The changes in finishParagraph() are because of e.g. the comments-nested.odt
sw test, which there causes exception because of unknown property ParaStyleName
(comments do not use those it seems) and the code is skipped over (which
is probably a bug on its own, but it's unrelated to this change otherwise).

Change-Id: I9d37f992407a9b649c710d2a031ec4447fb11771