fdo#37960 fix shift+click to select multiple drawings

I simply didn't get the logic behind calling GotoNextFly(). It caused
not only this bug. For example Ctrl+click on a background text frame
did not select the text frame, but an image on the previous page.

Change-Id: I85ccbbda2f324de55417d6199b4abe79e59bf295
Reviewed-on: https://gerrit.libreoffice.org/12132
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
bnc#893791 XLS export: external sheet references on Linux/OSX

The commit solves two problems.
1. Make sure we save absolute paths on Linux/OSX
2. Make sure we don't save invalid XLS (VirtualPath longer than 255 chars)
The first problem has always been there, so after a few load/save cycles
an XLS with reference to other XLS on a Unix-like file system became
invalid, and only LibreOffice could open it, Excel could not. These
broken XLS files can be repaired by saving after this patch, however,
the original reference will remain broken.

(cherry picked from commit 3f5251675eeeeae56ea282fdeb09dbc53ce4aae6)

Conflicts:
	sc/qa/unit/subsequent_export-test.cxx

Change-Id: I8f575acb1d560d539c1da61a1afdaac3f0c13977
Reviewed-on: https://gerrit.libreoffice.org/12099
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Resolves: rhbz#1146169 a11y frames label dies before frame

Change-Id: I2bc45dcb92b8e68bf4ae4df72c0fbd4e3b535604
Reviewed-on: https://gerrit.libreoffice.org/12142
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
fdo#82859 RTF import: don't try to set CustomShapeGeometry on a TextFrame

(cherry picked from commit 6b7239855d8babdc1bcc7742f79ce2df64d1e476)

Conflicts:
	writerfilter/source/rtftok/rtfsdrimport.cxx

Change-Id: I687fa609559f0484fe6bb804265243de154c3760
Reviewed-on: https://gerrit.libreoffice.org/12122
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
fdo#82859 RTF import: fillColor is unsigned

Otherwise ARGB 0xFFFFFFFF would turn into black.

(cherry picked from commit 04ea7b24ec1b5a027efa0b850f2bc3ac7116c52e)

Change-Id: I690f34d888ca9a013e8ce1af2c7ef8ed88ee28b0
Reviewed-on: https://gerrit.libreoffice.org/12153
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
fdo#71248 Excel VBA: ActiveDocument is not tracking currently selected Doc

Change-Id: I86606646206ec26e2822a6e27888537d44351b7b
Reviewed-on: https://gerrit.libreoffice.org/11725
Reviewed-by: Samuel Mehrbrodt <s.mehrbrodt@gmail.com>
Tested-by: Samuel Mehrbrodt <s.mehrbrodt@gmail.com>
(cherry picked from commit 4108bd9b7a41eaa0f3bf8b8173f27f57e009ee34)
Reviewed-on: https://gerrit.libreoffice.org/11827
Reviewed-by: Muthu Subramanian K <muthusuba@gmail.com>
fdo#79602: sw: fix text formatting of proportional line space < 100%

SwTxtFormatter::CalcRealHeight(): Apply the special treatment of < 100%
line space shrinking the Height() of the line only to the first line
in a paragraph; the subsequent ones are shrunk again (to the square of
the desired proportion) 30 lines later.

Also set the Ascent of the line, as the wrong base-line causes the lower
part of the line to be clipped.

(regression from 42532d42bfcdb12df86376cda009e8e315a82153)

(cherry picked from commit 4e223fab04279c3583689e69fa1342966e81de36)

Conflicts:
	sw/source/core/text/itrform2.cxx

Change-Id: I0424396263293deaa318c80eedc2237cdb01b22b
Reviewed-on: https://gerrit.libreoffice.org/12156
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
fdo#79602: sw: add new compatibiltiy flag PropLineSpacingShrinksFirstLine

This is enabled by default, to get the new formatting where the first
line of a paragraph is shrunk if a proportional line spacing < 100% is
applied; existing OOo documents get the previous (before LO 3.3)
formatting.  Since the formatting in LO releases is broken anyway, it
does not matter much which way documents written by old LO get
formatted.

(cherry picked from commit 9605763e3dc8c85137787c77c31e8639553a35ed)

Conflicts:
	sw/source/filter/ww8/ww8par.cxx

Change-Id: I0952f568a933c137bd03070759989cac3517d8b9
Reviewed-on: https://gerrit.libreoffice.org/12157
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
fdo#85215: Ensure that formula broadcasting works after sort.

When the reference update on sort is turned off.

Change-Id: I547dd1525a638dd447fe331e22583af4a7947308
(cherry picked from commit 1eb82c78a223d9a0b2bb5c3f5c129c1ee8bdf303)
Reviewed-on: https://gerrit.libreoffice.org/12113
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
fdo#82858 RTF export: fix "none" line style of TextFrames

Regression from commit 9e6a5b94e00f0054b058dbb42c2c0b6c75236c9d
(RtfAttributeOutput::FormatBox: export line{Color,Width} shape
properties, 2013-04-15), in case lineColor is written, but there is no
border style, then an explicit fLine=0 property is needed, otherwise a
black border shows up.

(cherry picked from commit f824b1b575dbdb2bc515656a66cbb94764031a44)

Change-Id: I6d6eedbc8d3ee4bee0f2aadb51a376c7734c6640
Reviewed-on: https://gerrit.libreoffice.org/12185
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Tested-by: Michael Stahl <mstahl@redhat.com>
sw: fix windows build

Change-Id: I24aedc513897579b3f3c3bf9884183a67b93cd39
fdo#82076 RTF import: handle footnote in table cell

(cherry picked from commit 956c3ff3d43e1b181f7c91518edee1c7c4dc2a0a)

Change-Id: I69def7936c320e93db5d4504922d52346caaf9cf
Reviewed-on: https://gerrit.libreoffice.org/12242
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Tested-by: Michael Stahl <mstahl@redhat.com>
fdo#85282: Correct adjustment of range reference on delete & shift.

Change-Id: I6e01c160f77599dfa4a2e55b60e23d256184c822
(cherry picked from commit c3c16d5b74fb5707691283538a969a03c2f918b0)
Reviewed-on: https://gerrit.libreoffice.org/12111
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Eike Rathke <erack@redhat.com>
CppunitTest_sw_rtfexport: fix windows build

Change-Id: I79d4e46abe289b3d9c1f0a2eec2a29045891cae3
Resolves: fdo#68347 fix word count with recorded changes

also see fdo#46757

a) We need to ignore redline-deleted text, but count redline-added text
b) each block of text is denoted by its end position in the model
   and where that maps to in the view so a hidden portion
   should record its end point not its starting point, and a non-hidden
   deleted portion should always record its end point
c) when mapping a model position to the view we take the offset of
   the model pos arg from the block end and use that to offset the
   mapped block-end view pos to get the final view pos. But for
   hidden portions that won't make a whole lot of sense, and
   end up offsetting into prior portions, so map all positions within a
   hidden portion to the same block-end view pos

add regression tests for these cases

(cherry picked from commit fa430e6b4e6f5d096bdf59db26e5d7393ca2297b)

Conflicts:
	sw/qa/core/uwriter.cxx

Change-Id: I45c76bba47fd430bc3bccb5f919502660d415d9e
Reviewed-on: https://gerrit.libreoffice.org/12219
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Tested-by: Michael Stahl <mstahl@redhat.com>
fix bnc#624546 (fdo#83733) slide pane cut/copy/paste in outline view

Problem:
When I'm in outline mode, if I select a slide in the left slide preview
pane, ctrl-c, then select another slide I would like it after and hit
ctrl-v; it refuses to cut/paste.

Analysis:
This issue is due to the fact that the outline view always grabs focus
when activated and a view is activated whenever is pushed to the
sfx shell stack even if it is not the new top-most active view shell
(see `ViewShellManager`, `SfxViewShell`, `SfxDispacther`).

Solution:
Make the `OutlineViewShell` grabs focus only if it is the top-most
active view shell.

Rationale:
When `OutlineViewShell::Activate` is invoked, instead of removing
the focus grabbing action completely, we check if the
`OutlineViewShell` instance is the the top-most view shell and
perform the focus grabbing action only in such a case. This change
required to have also the `DrawViewShell` grabbing focus on
activation (only when it is the top-most view shell). In order to
implement this solution I needed to add a new method (and data
member) to the `ViewShellManager` class. I named it
`GetTopViewShell`. This method returns a pointer to the top-most
active view shell of the internal stack. The returned pointer is
updated in the `UpdateShellStack` method, before the sfx shell
stack is updated.

For more details see :
https://gist.github.com/mcecchetti/15b3ebc505d6582ea0db

(cherry picked from commit 967a386bccb15b99915a1e878e42450fbe9a2d0e)
Signed-off-by: Andras Timar <andras.timar@collabora.com>

Conflicts:
	sd/source/ui/view/ViewShellManager.cxx

Change-Id: I619a406864f50f0e62dee3fcb9ac5d46e3d48272
bnc#636128 DOC filter: fix handling of FFData.cch

(cherry picked from commit dfa26e6d489a2c5bd79652450a9f27343008d37f)
(cherry picked from commit 2ad1f195b875f2c1052c8ffab79602b9f6871ccb)

Change-Id: Ia1a3a4ef5e61d8ed2a3bde689f3d2101525efc46
Reviewed-on: https://gerrit.libreoffice.org/12257
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
fdo#82430: MSVC build: disable a few more cases of SSE2 in externals

(cherry picked from commit c79d2dbe3a75e3376a5997444b6a3a5f947da107)

Conflicts:
	external/icu/ExternalProject_icu.mk

Change-Id: I8f0db23d1f9ba6b9fc3c8b64b32822ba8166428f
Reviewed-on: https://gerrit.libreoffice.org/12247
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
fdo#85403 broadcast changes after TextToColumn

Regression introduced with 3d869cda8db03820dea8c4ba463eb155d05e933b for
fdo#74014

Change-Id: Ie8ca1e7c15609aaf80b4ecbb6ccffc30a3f79f0a
(cherry picked from commit 99cfc0f8a321c3fd3ef1a49d669ebc5744dbf606)
Reviewed-on: https://gerrit.libreoffice.org/12216
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
fdo#85812: RTF import: fix run type in new groups

Apparently the run type resets to LTR in a new group.

(regression from fc49c052dbdbb5ab3b0a02a13143705f769b9662)

(cherry picked from commit 88d3f9e4cf64e4ef037063b26ddf347fd42d8d84)

fdo#85812: RTF import: better fix for run type in new groups

Apparently Word treats \ltrch \rtlch differently from
\loch \hich \dbch when groups are opened.

Change-Id: I257712521e8e77fa66e76857489797ecc675506e
(cherry picked from commit a9a9718bb1f64318429562ecdaa3d3763d9e2f4a)
Reviewed-on: https://gerrit.libreoffice.org/12269
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>