fdo#68983: Revert "remove #if 0 block (from ...

... af34774d260a68fc02cd78ba90dd8d4afaf1a2a4)"

This reverts commit cbd1a89676f39135ed2e9c47d20475b2053289b9.

Conflicts:
	basic/source/uno/namecont.cxx

Change-Id: I665f2e875c6b339ad718ca53fd0e54328efaeaff
(cherry picked from commit 0e21019e0d61911b4c0ddef07691e9f9f6384cba)
Reviewed-on: https://gerrit.libreoffice.org/9435
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Revert "fdo#67685 open xSourceLibrariesStor only when needed"

This reverts commit fc9080a0c60f263d00eb71111fcda72b3c0a2ebb.

This bug was apparently introduced by
af34774d260a68fc02cd78ba90dd8d4afaf1a2a4, which will be reverted
in the next commit.

Change-Id: I81ccb5bf9cc7e29fbf1e66d02f38268ee1fd1d0c
(cherry picked from commit 5ca4b9d51046b9b6a36b91c9abd0cc1e7c04b480)
Reviewed-on: https://gerrit.libreoffice.org/9436
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
fdo#68983: basic: if the library is not loaded fully, copy source storage

Also fixes fdo#42899 and fdo#67685 in a different way; the previous fix
for fdo#42899 caused the problem with password-protected libraries for
which the password is not known: only the binary representation of the
BAISC module was stored, not the source code; by simply copying from the
source storage the problem can be avoided.

It would be possible to ask for the password when storing, but that
would not work when non-interactive (called via API).

An alternative fix would be to pass in the
SfxObjectShell::IsSetModifyEnabled() flag and actually reset the BASIC
library's modify flag correctly, but that requires adding a
parameter to XStorageBasedLibraryContainer::storeLibrariesToStorage().

(regression from af34774d260a68fc02cd78ba90dd8d4afaf1a2a4 )

(cherry picked from commit 5246fa262450f686674850c53df666422f441c86)

Conflicts:
	basic/source/inc/namecont.hxx
	basic/source/inc/scriptcont.hxx
	basic/source/uno/namecont.cxx
	sw/CppunitTest_sw_macros_test.mk

sw: use xsec_xmlsec.windows on WNT
(cherry picked from commit 3e69b7bcd3e4a9cb1a29360c905e7fba96365999)

Change-Id: I4701401f35171139fc2fe8d225d13d4e533091a0
Reviewed-on: https://gerrit.libreoffice.org/9437
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Fix order of function pointers

Change-Id: Ic1bae7fcebfaf35b62aecd86ed8b3a70fae3e4d3
(cherry picked from commit c8945b3fb850985794efcb8afbbdc2f5985d7088)
Reviewed-on: https://gerrit.libreoffice.org/9440
Tested-by: Michael Stahl <mstahl@redhat.com>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
fdo#78742: SfxFilterMatcher: respect requested document service if set

sfx2::DocumentInserter::CreateMediumList() creates a SfxFilterMatcher
that should match Writer filters only, but actually Calc filters may be
returned; check that the document service matches.

(regression from 3da8f3680556e0163f660a0a159930337c8c32ff)

Change-Id: I6208d38c1110355105aa5d1ffa1b57142193a4d7
(cherry picked from commit 805fd1ca343d6295b8114a24cc29bdac332f266d)
Reviewed-on: https://gerrit.libreoffice.org/9404
Reviewed-by: Kohei Yoshida <libreoffice@kohei.us>
Tested-by: Kohei Yoshida <libreoffice@kohei.us>
MSWord uses \xb for linebreaks in DB fields (bnc#878854)

Change-Id: I9b1e4f8dc44d3f6f41e395f6e5f3c1fdeff52441
(cherry picked from commit d4a19c4098f4556f05666ed92a85c6138b4f769a)
Signed-off-by: Andras Timar <andras.timar@collabora.com>
fdo#78903: Don't broadcast prematurely during cell deletion.

We need to wait until all the affected cells get marked dirty at the
end of the deletion process.

Change-Id: I49618fcc386ec2209f5f0267d50257ecb8dd21d1
(cherry picked from commit cb167ac784f9b16944da4494b65e56b2a5b66bb7)
Reviewed-on: https://gerrit.libreoffice.org/9443
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Eike Rathke <erack@redhat.com>
fdo#79011: Properly implement the search results dialog as modeless.

It's unfortunate that adding a modeless dialog is such a pain.  But we
still need to implemenet this properly else we'll leak at best, or end
up with tons of weird bugs at worst.

(cherry picked from commit 81c492ef18b04cc283561018d69818cbca7f83ef)

Conflicts:
	sc/inc/sc.hrc
	sc/sdi/cellsh.sdi
	sc/sdi/scalc.sdi
	sc/source/ui/view/cellsh1.cxx
	sc/source/ui/view/tabvwsh.cxx

Reviewed-on: https://gerrit.libreoffice.org/9451
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Eike Rathke <erack@redhat.com>

Conflicts:
	sc/source/ui/view/cellsh1.cxx

Change-Id: Ie03260f288fad76f994d0ca6a8b1feeade299ffd
fdo#76824: Proper way to parse cell address strings.

Be aware of the variable address convention.

Change-Id: I37ca38758f055e7799cadefafda61174ea3cbf9c
(cherry picked from commit 653e4adddfc80aeb91c1d21c18e95b3986c85c54)
Reviewed-on: https://gerrit.libreoffice.org/9454
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Eike Rathke <erack@redhat.com>
do not store invalid date acceptance patterns in configuration

(cherry picked from commit e0480c81a956751e48f8ef36a41c3062c1bed345)

Conflicts:
	cui/source/options/optgdlg.cxx

Change-Id: I78cd8b304db2243fd105d4b13421b6ea0347e042
Reviewed-on: https://gerrit.libreoffice.org/9453
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Resolves: fdo#79137  Crash in oox::vml::InputStream::updateBuffer

bt shows:
Program received signal SIGSEGV, Segmentation fault.
0x00002aaadba213fb in oox::vml::InputStream::updateBuffer (this=0x8d7fd80) at /home/julien/compile-libreoffice/libreoffice/oox/source/vml/vmlinputstream.cxx:339
339	    while( (mnBufferPos >= maBuffer.getLength()) && !mxTextStrm->isEOF() )
(gdb) bt
0x00002aaadba213fb in oox::vml::InputStream::updateBuffer (this=0x8d7fd80) at /home/julien/compile-libreoffice/libreoffice/oox/source/vml/vmlinputstream.cxx:339
0x00002aaadba21048 in oox::vml::InputStream::available (this=0x8d7fd80) at /home/julien/compile-libreoffice/libreoffice/oox/source/vml/vmlinputstream.cxx:326
0x00002aaacf5a0249 in sax_fastparser::FastSaxParserImpl::parseStream (this=0x89aea30, maStructSource=...)
at /home/julien/compile-libreoffice/libreoffice/sax/source/fastparser/fastparser.cxx:810

Indeed, mxTextStrm is invalid, so let's test its validity in InputStream constructor

Cherry-picked from 372d5d74ad8cfb9b69dc20557359c4a2c1597b57

Change-Id: Ifed79603e33b64d11eb07656df17824b7f98058f
Reviewed-on: https://gerrit.libreoffice.org/9466
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
CustomAnimationCreateDialog: select previously set misc animation

Regression from 9695f38ca4ab26b40524f2eade98c45f0360131d.

Change-Id: I8777fd8fa3e31c67b6645044d262fd4c5f645634
(cherry picked from commit dd1f8ac3575a929e71b39d5f7043be057ebaa727)
Reviewed-on: https://gerrit.libreoffice.org/9480
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
fdo#77454: fix WW8 import/export of negative image crop

The negative crop values were imported as large positive values, which
caused the image to be rendered with 1 pixel width after commit
2e5167528f7566dd9b000e50fc1610b7bf99132a.

(cherry picked from commit 6d431ffb682d0e64b75b6267f369822ff0b0617e)

Conflicts:
	sw/qa/extras/ww8export/ww8export.cxx

Change-Id: I0e01b9d9a05d90e868699832085a06ba5aab7e54
Reviewed-on: https://gerrit.libreoffice.org/9470
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
fdo#64047: n#863021: Add set-all language menu.

Problems:
* Doesn't reset the spell error markers
* Modifies only at object level
* Currently has only setting for 'all text'
* Maybe provide a current slide only option?

Change-Id: I4695423fed3ed9422185b23803eedd12ef434bea
(cherry picked from commit 0833f4046a1afa77aeed97a131c5325c44be1bb3)
Signed-off-by: Andras Timar <andras.timar@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/9314
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Resolves: fdo#79139 Crash in SwDropCapCache::CalcFontSize

Minimum of nMaxFontHeight must be at least 1

Cherry-picked from 06afd4067f7bc321d7dd0a4e8c235b0b21e3d49a

Change-Id: I35462fc069c7026958e597c2e0605345ed009c91
Reviewed-on: https://gerrit.libreoffice.org/9458
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
fdo#79008 Crash: File getting crash while saving in LO

File is getting crashed while saving in LO, as it tries
to access the value of vector after erasing that value.
Code changed to access the vector value first and
then erase that value from vector.

Change-Id: I29369b7582fdbd7363d0e6fdae091a30c79a747d
Reviewed-on: https://gerrit.libreoffice.org/9433
Tested-by: Michael Stahl <mstahl@redhat.com>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
(cherry picked from commit ed3fd76b65b2a281effea55b8a55101a8b740aec)

Conflicts:
	sw/qa/extras/ooxmlexport/ooxmlexport.cxx
fdo#78900 RTF import: allow \dpxsize inside \dptxbxtext

Previously we assumed that they always appear under \do directly.

Change-Id: Ie3a978da856986f604a3815d6127abb4191323c0
(cherry picked from commit 21c11ffe254612ac46aa891addacb0024d5b93f0)
Reviewed-on: https://gerrit.libreoffice.org/9488
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
bnc#863018 WW8 import: fix upper margin of multi-page floating table

A vert orient position was already handled in case a floating table was
imported as a TextFrame, but in case we didn't do that, the vert orient
position was simply lost.

Fix this by importing it as the upper margin of the table (assuming that
the position is relative from the anchor position).

(cherry picked from commit 3755c87d0426a499d4755e82d8fbc77caa240764)

Conflicts:
	sw/qa/extras/ww8import/ww8import.cxx

Change-Id: I3e96f3068605fd6313dfb3e55483e1bce6c063a5
Reviewed-on: https://gerrit.libreoffice.org/9487
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
various situations where graphic go missing on save

Resolves: #i114361# provide and accept changed URL...

of embedded graphic file during save (ODF export)

(cherry picked from commit a90c007908eb3f66e28a9ea525729065db652b6f)

Conflicts:
	sw/inc/ndgrf.hxx
	sw/source/core/graphic/ndgrf.cxx
	sw/source/core/unocore/unoframe.cxx
	sw/source/filter/xml/xmltexte.cxx
	xmloff/source/draw/shapeexport2.cxx

(cherry picked from commit 192abfb36b8a4859879fcb49326d59ed62083c8d)

Conflicts:
	sw/inc/ndgrf.hxx

Change-Id: I9d4a02af2561467fe1a66f036b55d6dcf2429986

Resolves: #i124946# only apply new embedded stream name...

for a graphic, if is already has one.

- needed correction for the fix made for issue #i114361#

(cherry picked from commit 23a4bd91ceb89e5e0a2413f80fc987db106a0bc9)

Conflicts:
	sw/inc/ndgrf.hxx
	sw/source/core/graphic/ndgrf.cxx
	sw/source/filter/xml/xmltexte.cxx

(cherry picked from commit 05e07167e422caf58d23ff883edda30acc3ba88d)

Conflicts:
	sw/inc/ndgrf.hxx
	sw/source/core/graphic/ndgrf.cxx

Change-Id: Ia9771932ae5b380ccae9b0a3cbb79d41f5d9bdb8

Resolves: #i124966# keep picture format information

- <GfxLink> instance - also for the reading of preview picture data

in order to avoid trouble on save in case that the preview data equals the
picture data

(cherry picked from commit d6af1b601bb8fe2569d17e01505f67e1becc9366)

Conflicts:
	svx/source/svdraw/svdograf.cxx

(cherry picked from commit 597ae8dd9c28ee370874b219d594fa1c105f2c72)

Conflicts:
	svx/source/svdraw/svdograf.cxx

Change-Id: Ifecb07b4d5d33d593502fccd6f21644893027d2d
Reviewed-on: https://gerrit.libreoffice.org/9456
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
fix build-break on windows

ae95cdd2a1708a8e9e114dd9bcf577f57f1f5af3 introduced a check, and did put
it outside of a #if !defined(WNT) block...

Change-Id: Id200c6f3161d0c6c611e0b1c293adbd060579cd7