Resolves: rhbz#1077780 crash on loading .docx

Change-Id: I92670b9c46a2c745ba47c6dcc1b4dd672942cf59
Reviewed-on: https://gerrit.libreoffice.org/8742
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
Hopefully fix Windows HiDPI toolbar layout bug

On Windows HiDPI, toolbar buttons are cut off. This may fix the problem.

Here is a screenshot:
http://i.imgur.com/NADAvYi.png

I can't prove this fixes anything on Windows because I can't see this
on Linux and don't really understand the surrounding code. On the other
hand, it is easy to prove this is reasonable code.

Change-Id: I69c19ad46844bead942ce63883d163cb9d0690c9
Reviewed-on: https://gerrit.libreoffice.org/8637
Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
(cherry picked from commit 509441038ab95dd3a60efd1b6c302bf22bfbc631)
Reviewed-on: https://gerrit.libreoffice.org/8743
Reviewed-by: Keith Curtis <keithcu@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
fdo#76402: Handle range reference expansion in named ranges.

Change-Id: I8314260fc7588f0a0230ab63cc600fa887a8479d
(cherry picked from commit 8582db191b5c88c72e5b16c89a024f897a95a6f1)
Reviewed-on: https://gerrit.libreoffice.org/8751
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Eike Rathke <erack@redhat.com>
fdo#62155 - don't crash if we can't create an instance of a calc addin.

Change-Id: I478d7777949683a91e7adf9fa6b54e9d01ced676
Reviewed-on: https://gerrit.libreoffice.org/8770
Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Revert "rhbz#1075124: writerfilter: fix tables with negative left margin"

It appears that this was just a workaround that incidentally worked.
Making the negative value even larger (in abs value) doesn't seem to make
a difference for MSO, but LO fails again. A proper fix (better workaround?)
will follow.

This reverts commit 2e558f32ef79948858723b9781fbd388850b462b.

Change-Id: I56fd5e9d7ce9aa178f7e508f8e7ac3bc0ff2b971
Reviewed-on: https://gerrit.libreoffice.org/8763
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
apparently some table .docx properties shouldn't be < 0

Somewhat related to 10b4da63e3143108ba75891e9e98fdaa2f7953ab , a similar
doc has negative value inside w:tblCellMar, which MSO seems to ignore
(altering the value has no visible effect), so ignore it as well.

Change-Id: I846e9b55fea0d4e66f03ce615584516360b8b7dd
Reviewed-on: https://gerrit.libreoffice.org/8764
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
cp#1000044 DOC import: fProtEnabled means document is not totally read-only

Reading the spec, it seems that we have two cases here:

- if lKeyProtDoc is set and fProtEnabled is 1, then editing forms is
  allowed
- if lKeyProtDoc is set, but fProtEnabled is 0, then the document is
  totally read-only

So in the first case avoid the SetModifyPasswordHash() call to allow
form field editing.

Change-Id: Id0c48e8eb4bde75c5520a7b108fcfada51148faf
(cherry picked from commit 8757bea2e88c6e349e1fe98d8e9695d7b9c6179e)
Reviewed-on: https://gerrit.libreoffice.org/8762
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
write (no)wrap of text only for custom shapes to .pptx (fdo#71961)

Apparently checking the TextWordWrap property in DrawingML::WriteText()
gives false by default for objects that do not have it set, which happens
to be everything except for custom shapes, which seem to be the only ones
to actually obey it. So all normal text would be exported as nowrap to .pptx
and read back as custom shape that has non-wrapping text.

I tried to make the property return true (which is what it should be in practice),
but that appears to be an exercise in futility, or I'm not mad enough to follow
the complicated property sets and whatnot. So just write it out only for custom
shapes. UNO purists, if any, are welcome to change the dynamic_cast to something
UNO-better if they manage without an ambiguous base class error.

Conflicts:
	sd/qa/unit/import-tests.cxx

Change-Id: I3ed906285fde88d902ac9c801986a82a7515638b
Reviewed-on: https://gerrit.libreoffice.org/8774
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Related: #i124516# handle bad surrogate pairs gracefully on Windows

When running into invalid Unicode surrogate pairs the text layout code on
Windows ran into massive problems like crashes. This change detects the
situation of an invalid surrogate pair and falls back to treat it as
a simple character instead of requesting a complex glyph fallback.

(cherry picked from commit 913f1fc4b1362f6e91595af5ae10c4cba79fd355)

Change-Id: I2988f4b64061d0a5df211f6f0f04b1f235fcd6a5
(cherry picked from commit 67688d3118b1a361d5dbdaa78e918815c163d75c)
Resolves: #i124467# add check for image data offset...

against stream length, some further checks

(cherry picked from commit 9ceda6fa56d31af717cc2c0c7572cf53cdc47af1)

Conflicts:
	vcl/source/gdi/dibtools.cxx

(cherry picked from commit f7799c9317cc3187ae8aaedc36f829d478a59e77)

Conflicts:
	vcl/source/gdi/dibtools.cxx

Change-Id: I8993b91ef4fa951e7bae702b0d056996015245ba
fdo#50672 Escape underscores in menus for unity

Change-Id: Ibb4647c1ff6c2858fea888efae975e8e5c5011e2
Reviewed-on: https://gerrit.libreoffice.org/8773
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-on: https://gerrit.libreoffice.org/8783
Resolves: #i124453# check if the resulting polygon...

has already exceeded the number of points (2^16) that can be handled by a tools
polygon

(cherry picked from commit 804e547d70552fd64e1344d538427f8898824b43)

Change-Id: I437a84493e264f7b650561599170e831da20c9aa
(cherry picked from commit a9582c05f854cad02710178ab7fa79498573269e)
fdo#75109 librelogo: fix localized procedures

Change-Id: Ia6edb02b871a41828758ba5fd5376c811c4084cc
rhbz#1080196: Delete the destination first then paste.

Deleting in-between pasting was causing the block iterators to become
invalid when the deletion took place, which resulted in a segfault.

Also cleaned up the bits about handling filtered rows.  It was using the
old row flag which is empty these days (so it never would have worked).
Plus we do bail out earlier if the destination contains a filtered row.

Change-Id: I78d3ee8bce1647c1c8685f92a3df3c38cc014811
(cherry picked from commit 2ec45841b97a994ef9dca854e142598a063877fd)
Reviewed-on: https://gerrit.libreoffice.org/8786
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Eike Rathke <erack@redhat.com>
fdo#76778 fix wildcard support in File Open dialog

Change-Id: Ifbdf6847ddecc7848828247655e729dfe2299b30
Reviewed-on: https://gerrit.libreoffice.org/8791
Reviewed-by: Matúš Kukan <matus.kukan@collabora.com>
Tested-by: Matúš Kukan <matus.kukan@collabora.com>
Resolves: fdo#76802 error msg in Web Page Wizard dialog

Change-Id: I0fa0537a8726bbda182dea8c3a9014d77973edea
Reviewed-on: https://gerrit.libreoffice.org/8797
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Resolves: #i124085# disabled CF_DIBV5...

(no advantages but some problems), increased png support

(cherry picked from commit c991f7cae8dcb306cb0d1f32bc5fcd8ea0a1ea81)

Change-Id: I52bef1295b32eb3692a0428c96edd0c55287f34a
Reviewed-on: https://gerrit.libreoffice.org/8784
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Resolves: #i124085# improved support for PNG clipboard format on windows

(cherry picked from commit 3bd259ce52b15e968302ecca39f72d06af66e301)

Change-Id: Ie9b677d8948912b372a13353cd82a2f5e2f1cf49
Reviewed-on: https://gerrit.libreoffice.org/8785
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Resolves: #i124555# restore stream position after Seek to end of stream

(cherry picked from commit 61efddf5ab8cd318e022ca1ac817ba0879a55e23)

Conflicts:
	vcl/source/gdi/dibtools.cxx

(cherry picked from commit cc1a7748c867716966b6a38e75f89df5d92ee104)

Conflicts:
	vcl/source/gdi/dibtools.cxx

Change-Id: Ie6c0aeab5988b68954a0bdd460317ac9539d8a5f
valgrind: Conditional jump or move depends on uninitialised value

(cherry picked from commit e3dad060929de9beeeed2978f1b1427a91152073)

Conflicts:
	vcl/source/gdi/metaact.cxx

Change-Id: Ia0b22f7c394d1c2387d1cad7e3d99c79eaeca81a