summaryrefslogtreecommitdiff
path: root/sw/source/filter
AgeCommit message (Collapse)Author
2021-01-25ofz#26943 detect if FormatOfJustInsertedApo was deletedCaolán McNamara
move FrameDeleteWatch for reuse in the doc filter Change-Id: I6e53549a837968cb738b5188e8670dd3e38a9c0e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105264 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit 2a7a62c09582ec24247022a94e929610d141a4c9)
2021-01-25ofz#26619 detect if SwFrameFormat deleted during importCaolán McNamara
Change-Id: I5dc778e44dcb670353e83037a5a5d469fa437186 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104853 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit 7ae9e8b6ba35dec2c556f6fac4034cd9bb1111a1)
2021-01-25ofz#26480 validate WW8PLCFpcd is sorted like WW8PLCF doesCaolán McNamara
Change-Id: I11393c730986585aeea229ebeec6417e4a0578d9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104510 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit 7f55db80c6fe42c162bbf51404e638a66b6ae9ab)
2021-01-21tdf#135014 sw: fix crash exporting numbering to DOCXMichael Stahl
It can happen that the default SwNumRule of a SwList isn't used by anything directly, but there are other SwNumRule associated with that SwList and then the DOCX export needs to export it as an abstract numbering definition. (regression from 632ee9aae6d5f3cf08b6d6b2789310c20db713b7) Change-Id: I6b1851980464aaa95bf731a60b7d11ab91cec7b6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109303 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> (cherry picked from commit cd1c9f5167e797807d6726219f06190657f58372) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109335 Reviewed-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit e0be320cc790856df4d9a102d15de08aa16217fa) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109336 Tested-by: Michael Stahl <michael.stahl@allotropia.de>
2020-10-27tdf#136983 partial revert NFC ww8 cleanup: remove unused variablesJustin Luth
This is a partial revert of LO 6.2 commit 2ec0cf500222aef55d02df80154b47fbb92970c9 I can't think of any excuse for how I possibly missed that xDocProps was being defined/used outside of this clause. Just plain stupid and blind. The good news is that the create and modified date still seem to be getting saved somehow/somewhere. So it isn't the disaster that it looks like it could have been. Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103565 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org> (cherry picked from commit 1086654d6e8cc22f1f99195668db3f305437e570) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104495 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> (cherry picked from commit 19b8ded3ae18dd4070a3e21d7b980782a27e5547) Change-Id: I72ef56fa50b9e92e4ce687b132b1919cfae6c1f6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104497 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-10-14tdf#132289 missing styles when inserting file with listSerge Krot
Change-Id: I444997a6cc55cfe287f4c610f538f2f54803646c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104085 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104319 Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2020-09-28Merge branch 'libreoffice-6-4'Michael Weghorn
into distro/lhm/libreoffice-6-4+backports Change-Id: Id89f295a3e669a51da822c09a759165dfc79dc6f
2020-09-25tdf#134782 sw: split AddParaSpacingToTableCells flag in 2Michael Stahl
commit 3cccdabf19a99fd3f657985c1822436d7679df2b "extend AddParaSpacingToTableCells with line spacing" changed how the ADD_PARA_SPACING_TO_TABLE_CELLS compat flag works, to improve interop with Word. This commit splits out the change as a separate new compat flag ADD_PARA_LINE_SPACING_TO_TABLE_CELLS ("AddParaLineSpacingToTableCells"), to preserve compatibility with ODT documents that were produced by LO < 6.4 (via SwXMLImport::SetConfigurationSettings()). New documents and WW8/RTF/DOCX import have both flags enabled. The combination false/true is invalid, and treated as equivalent to false/false. Change-Id: Ida20df8fe4a8192a714f91da95345f9726fd7d98 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103317 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de> (cherry picked from commit 38aa699f265c17548769aaa4f20e1ae35d18f202) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103359 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2020-09-23tdf#135942: avoid collecting autostyles during writing themMike Kaganski
This modifies the container over which iteration is performed. Additionally, make sure that all nested table autostyles are collected on the first phase. Change-Id: I74c0bb1aaacad095226c21e6bf51cc8668133bb3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101096 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> (cherry picked from commit f0286ad82465152b29bba01ab2edeb97291397fa) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101069 Reviewed-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit 0273675e7dde577077ccca17571846a0942f2630) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102311 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2020-09-11Merge branch 'libreoffice-6-4'Michael Weghorn
into distro/lhm/libreoffice-6-4+backports Change-Id: Ib3030257fb7c4eec5b910c0b49332be0dd8fa854
2020-09-10tdf#135950 crash in format->character with selected text in tableCaolán McNamara
Change-Id: I66e36a638d040d2a38ac234383d6f314a2ff4d88 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102310 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2020-09-10tdf#124470: Split export of table autostyles out from collection phaseMike Kaganski
This allows to call collectAutoStyles where required (e.g. when enumerating used fonts), without side effect of writing table styles XML inside the call, out of place. Change-Id: Ida05e373eb8502590c43e2b0e85c3b0c1107c551 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100153 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> (cherry picked from commit 35021cd56b3b4e38035804087f215c80085564be) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100221 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org> Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100274
2020-08-28tdf#131801: sw: support of style references in ListAutoFormatVasily Melenchuk
ListAutoFormat property did support char attributes, but not style references ("CharStyleName"). It is important for correct formatting of pilcrow symbol or list format in some DOCX scenarios. Export to DOCX already works, but not to RTF/DOC. Change-Id: I1bf23d1e45fcc213adcf9aa6f404be803919fbee Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100893 Tested-by: Michael Stahl <michael.stahl@cib.de> Reviewed-by: Michael Stahl <michael.stahl@cib.de> (cherry picked from commit c77b9c349f0a48392d8cb7a49532844b2cafb5ba) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101560 Tested-by: Jenkins
2020-08-27tdf#135973: DOCX export: improved list override supportVasily Melenchuk
Removed remains of old override support which are not working now. Partial refactoring and fixing for listid and overrides detection. Change-Id: I1f94a09b7d51fcc3300b056d6d9e8ea6367a4446 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101238 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101438 Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2020-08-24ofz#25169 insertion into set might find a duplicateCaolán McNamara
in which case pImpRec is deleted and pImpRecTmp is invalid Change-Id: I2a273a436ebd88cb53e329bbcb4f171dda6ed840 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101155 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2020-08-17sw: MS Word export: don't insert section breaks in field instructionsMichael Stahl
MSWordExportBase::NeedTextNodeSplit() simply uses the soft-page-break positions to potentially insert section breaks - but now that Writer can display field instructions, it's quite silly to insert section breaks inside them. Change-Id: Ie57e6281a0287aac36984e5467920852db19a8ad Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100661 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de> (cherry picked from commit 68cc91cd2c461b7062c3f3b89b2c677e41c9a8d4) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100690 Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-07-17tdf#77962 ww8import: 0x4xxx sprms are always 2 byteJustin Luth
SPRA(bytes) | SGC (property type) | A | ISPMD XXX X XX X X XXXX XXXX Focusing on the SPRA meaning: 0 is Operand is a ToggleOperand (which is 1 byte in size). 1 is Operand is 1 byte. 2 is Operand is 2 bytes. 3 is Operand is 4 bytes. 4 is Operand is 2 bytes. 5 is Operand is 2 bytes. 6 is Operand is of variable length. 7 is Operand is 3 bytes. Thus every 0x4xxx and 0x5xxx are 2 bytes sprmCIcoBi = SPRM_CHR(0x60, 1, spra::operand_2b_2); // 0x4A60 and thus it must be defined everywhere as 2 bytes. Wrongly "fixed" from 0 to 1 by commit bf24cca78e3c95d7a07e2073802c1540faec6920 Author: Caolán McNamara on Wed Dec 4 08:56:32 2002 +0000 #105926# some bidi properties with incorrect cached len Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98911 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org> (cherry picked from commit 56b04e40ab72b6333ce278ba2980650f5272025f) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98845 Change-Id: Ic30df735ed325a508ef3c7220d9b06878af248a5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98932 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-07-16tdf#134618 sw: WW8 import: don't insert fieldmark for SHAPE fieldMichael Stahl
Follow DomainMapper_Impl::CloseFieldCommand() and just don't waste effort creating a fieldmark that doesn't provide any benefit. This should avoid any fieldmark related problems introduced in e511a0ca5dde6d731bb126bbfe21768867890102..d9030ad6298e2f49ee63489d6158ea6ad23c0111 Change-Id: I6688dcda1e3b41ac648f3d69740f05d34bb46191 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98542 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de> (cherry picked from commit 4e0aa38afd674f5ad16b4bc3222dc393543ad915) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98469 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2020-07-16tdf#134618 sw: DOCX export: fix order of as-char and at-char fly...Michael Stahl
...at same position. The problem is that in this case the as-char fly was written before the at-char fly but the positioning of the at-char fly can be relative to its character position, i.e. before the as-char fly. Apparently as-char flys are written in DocxAttributeOutput::EndRunProperties() via WritePostponedDMLDrawing(), wheras at-char flys are written earlier, in SwWW8AttrIter::OutFlys() via DocxAttributeOutput::OutputFlyFrame_Impl(). So this undoes the swap that these undergo via the magic of the mark stack. Change-Id: I83a72bb2affbf321fc4dea4e7fb37bdb43cea2e7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98543 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de> (cherry picked from commit 7b156d37cfc92292323694ec064fe51ae57b3257) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98633 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2020-07-10tdf#60684: graphic type content must correspond with graphic type extensionJulien Nabet
Change-Id: I8075b1b44aa400268b4022decb2a56770c81d83b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98239 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr> (cherry picked from commit 7272a2edf113f29edeb8987ce649f85b776d9d23) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98456 Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
2020-07-08ofz#23961 pad back to original lengthCaolán McNamara
in case of multi-byte input encoding resulting in a shorter output string than input Change-Id: Ieb4bb7b5f4551ca22e87c573233f083901f3d3c0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98273 Tested-by: Jenkins Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
2020-07-07tdf#134264 writerfilter: fix DOCX->DOC of ADDRESSBLOCK fieldMichael Stahl
... and other unsupported ones; the problem was that the field got exported with ww::eUNKNOWN = 1, which can't be imported again. Move the ww8 eField enum to include/ so it can be used from writerfilter. (regression from e511a0ca5dde6d731bb126bbfe21768867890102..d9030ad6298e2f49ee63489d6158ea6ad23c0111) Change-Id: I19193392d62fdf0bba01fac2516bafe9fdfa5a99 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98221 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de> (cherry picked from commit ae2e8202407e82c9b14f0cc307742561f8c6e530) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98244 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2020-07-02Merge branch 'libreoffice-6-4'Thorsten Behrens
into distro/lhm/libreoffice-6-4+backports Conflicts: writerfilter/qa/cppunittests/dmapper/GraphicImport.cxx
2020-06-18tdf#128195 Keep spacing below last paragraph in header (docx)Samuel Mehrbrodt
Add a layout compat option to keep the spacing below the last paragraph in the header in doc/docx files Change-Id: I259511183a8252e04d9951357dbdd4f4832523ec Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94577 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> (cherry picked from commit 9b5805d1ef2b9e9c4e8f389c069807bf4489ea95) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96337 Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-06-12tdf#83309: docx import: allow for lists tabstop at zero positionVasily Melenchuk
Zero position is valid value for tabstop, but previously it was treated as "no tab stop defined". Right now writer distinguishes tab stop at zero postion and no tab stop. Change-Id: Ie32da3d36a263644ba85a882029a8b29ae0501c8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95132 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> (cherry picked from commit d2e428d1abb9f2907c0b87d55830e8742f8209b9) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95561 (cherry picked from commit a380a06c1872091e8fa8c810e95a8e1d5dfe1820) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96178
2020-06-12tdf#120394: DOCX list import: simplify zero width space hackVasily Melenchuk
Since introducion of list format string hack with creation of zero-width-space can be much more simple. It was being used to indicate existing, but empty list label suffix to avoid stripping down numbering. Change-Id: I9a0c6047f806b2c656ef5dbab0c6b38200818bd2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94383 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95346
2020-06-09tdf#133604 sw: DOCX export: put CH_TXT_ATR_FORMELEMENT in its own runMichael Stahl
Commit b03fefcc4dbdfee3b9eeb5fa0e586dd12ddcd3d2 ought to have fixed this but didn't; the run following the CH_TXT_ATR_FORMELEMENT still ended up inside the field result. But when importing that into Writer, it appeared correct; Word shows the problem. (regression from 94e0b8407b02d76b27324b8b08012eb024aca9e9) Change-Id: I1fc1328223353422a83d403e8f790d156dbec4e9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95843 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de> (cherry picked from commit 7f2908b83a39bbb6fa648d6815265ad203f86ddc) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95882 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2020-06-05Merge branch 'libreoffice-6-4'Michael Weghorn
into distro/lhm/libreoffice-6-4+backports Change-Id: I7e055931d800686b9ffe67678c5df42239a5d067
2020-06-05tdf#120394: list format string can be emptyVasily Melenchuk
We need to distunguish when we have list format string, but it is empty (no level text will be diplayed) or it does not exist at all, so we need to fallback to old prefix-suffix syntax. Change-Id: Ifd4ccd5a676db86c39d2ef48e91d191d92b9b2a0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94322 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> (cherry picked from commit d8329149394e4e5758a9e293b0162db050379a4e) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95413
2020-06-04Merge branch 'libreoffice-6-4' intoMichael Weghorn
distro/lhm/libreoffice-6-4+backports Change-Id: I6c4e4dc74df1a1ce0455526a067c5286534922be
2020-05-26Revert "tdf#104017 DOC export: be less aggressive with merging page styles"Justin Luth
This reverts LO 6.3.4 commit 5d1709a7c4184eb31cfc4c2d3acadff3a4a68189, which tdf#133334 shows is wrong. How this made it past QA is a mystery to me. There should be lots of examples. Change-Id: I17be6e4bab44057f4535d4728825e12d068b65d2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94782 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.com> (cherry picked from commit 42a37f8ce27ad8fca222f50b712a8fed52dbda95) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94683
2020-05-23tdf#103602 xmloff,sw: ODF 1.3 import: PageStyle with drawing-page styleMichael Stahl
Associate a style of family "drawing-page" with a style:master-page. This fixes the small part of the draw:fill attribute problem that is covered by OFFICE-3937 in ODF 1.3. This is the import part. Change-Id: I4c86fa24c36407b64ce33f0890e5da8c26c5292a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93670 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de> (cherry picked from commit 4e98ba4ba5c17ab8ae1170662af645b9d2bfde84) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94587 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2020-05-19tdf#127778 DOCX import: fix unexpected heading on non-first page ...Miklos Vajna
... when the first page has a heading Regression from commit 17e51f427b3f0cec74ac8e0a1b3f51189006ae6f (DOCX import: first page header should always set default headers as well, 2014-11-21), the problem is around how to split a first + follow page style on import, and then do the opposite on export. This is described using a single section in OOXML, but Writer has 2 page styles for this (unlike in case of the DOC filter). This means the header margin has to be taken from one of these page styles. The above commit tweaked the import, so the follow page style has the wanted header margin, but this leads to incorrect layout. Fix the problem by tweaking the export instead: it has random access to the doc model, so it can take the header margin from the first page style if needed, and then the import side can be reverted, leading to correct layout. Also remove some leftover debug code in test/, which was added in commit 5352d45dd4a04f8f02cf7f6ad4169126d3b3586a (convert AnimationImport to fast-parser APIs, 2020-02-18). (cherry picked from commit 51534ac2b9747975945acb6a1e1ba5cc6d73f5c2) Conflicts: sw/qa/extras/ooxmlexport/ooxmlexport6.cxx Change-Id: I4bbf7271f3a437e8432399bd1e32e9d24190a501 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94193 Tested-by: Jenkins Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
2020-05-18Merge branch 'libreoffice-6-4'Michael Weghorn
into distro/lhm/libreoffice-6-4+backports Change-Id: I6861987a5897fa12bf962d4274f1ce52c3efa05e
2020-05-15Remove some redundantly user-declared copy ctors and assignment opsStephan Bergmann
...that trigger -Werror,-Wdeprecated-copy ("definition of implicit copy {constructor, assignment operator} for ... is deprecated beause it has a user-declared copy {assignment operator, constructor}") new in recent Clang 10 trunk (and which apparently warns about more cases then its GCC counterpart, for which we already adapted the code in the past, see e.g. the various "-Werror=deprecated-copy (GCC trunk towards GCC 9)" commits) Change-Id: Ie37bd820e6c0c05c74e1a862bb1d4ead5fb7cc9c Reviewed-on: https://gerrit.libreoffice.org/83698 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93694 Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-05-14tdf#132766: DOCX export: always try to set bullet font for listVasily Melenchuk
There are some problems with bullet if we use MS Wingdigs bullets and do not specify Symbol font for it. It shiuld be either UTF-8 or Symbol, but not mixture of both. Change-Id: Ie4a6f7e8fee6cfab21a18fc080f33d1bff455dd9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93846 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94158
2020-05-07Merge branch 'libreoffice-6-4' into distro/lhm/libreoffice-6-4+backportsMichael Weghorn
Conflicts: writerfilter/qa/cppunittests/dmapper/GraphicImport.cxx Change-Id: I2e0b84875a10a1255d88d54a3c5857c3e5832521
2020-05-05tdf#116883: sw: support for lists level format stringVasily Melenchuk
Multilevel lists are more flexible in case of DOCX. There is supported custom format for any level in DOCX unlike in LO and ODT where we are limited only with prefix and suffix for hardcoded list levels separated by dot. At the same time DOCX can have lists not only "1.2.3.4", but "1/2/3/4" or even "1!2>3)4" and such format can vary on each list level. Here is basic implementation for list format as a core feature for all documents and old way (prefix-suffix + ".") is left as fallback. Practically its usage is currently implemented only in DOCX import/export. Some RTF/OOXML unittests were redesigned: since we are not creating prefix/suffix for these formats conditions should be checked in a different way. Change-Id: I1ec58bcc5874d4fa19aee6a1f42bf1671d853b14 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92106 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93125 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Change-Id: Ia8f066913a2565559d81f3caabeba24b29c09052 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93456
2020-05-05tdf#108496: DOCX: redesign of override in listsVasily Melenchuk
List level overrides are not just about numbering, it is about numbering restart. Thus some changes to DOCX import/export were added. Improved support for several lists referring the same abstract list, especially in situation when one list have overrides. In addition some export cleanup is made: less unnecessary list duplications, less level overrides when no properties were changed. Change-Id: Ic7a69bc2e3080b39f5205cb90b46d14247abf305 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92412 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Change-Id: I35937449bd563eacceb3753e62b9ff7245f12b89 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92739 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93455
2020-04-14tdf#104565 DOCX drawing object export: fix arrow positionsSzabolcs
Saving some arrows from ODT to DOCX scattered them around their correct position. This happened because of a function that recalculates the position of drawing objects when they are rotated, according to the rotation. It turns out we don't have to do this with lines and such. Co-Author: Balázs Regényi Change-Id: Iea6a34d15003cacc27a8030cb73511aba39225f6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90989 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org> (cherry picked from commit 08a11f8fe19560b000c62da00d7425b4f500d605) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92166 Tested-by: Jenkins Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
2020-04-02tdf#131304 .docx: flag new files as MS Word 2019 native modeJustin Luth
compatibilityMode = 15: [Word 2013/2016/2019] Up till now, documents that were exported into the docx format were treated by default as native Word 2007 format, since no compatibilityMode setting was provided. (Don't worry, we still round-trip existing older values. This patch only affects non-docx >>= .docx export.) Ultimately, this change is for the benefit of MS Word. It has no practical effect for LO. NOTE: This patch depends on previous commit 53f099c842d39266a0b4786a1af3db5628746634 which sets an appropriate value for existing .docx files. This scary change shouldn't actually be all that scary, since we already round-trip native 2019 files, without any complaint from Word or our users. The biggest change is that Word 2010 users might not be able to open NEW files perfectly. But Microsoft has already been doing that to them since 2013. By the time LO 7.0 hits stable version, it will have been months since 2010 has reached end-of-life. The vast majority of documents will still open perfectly for them. Plus, if a Word 2010 user does modify our new document, we will drop back down to their level. A nice, clear explanation of what compatibilityMode does is at howtogeek.com/256269/what-is-compatibility-mode-in-microsoft-office/ The MAIN CHANGE is that MS WORD has been DE-ACTIVATING features when it notices that it is SHARING the document with OLD_VERSION users. So Word is limiting what it will do for the BENEFIT OF THE OTHER USER while collaborating. There are a few instances where layout is affected by compatiblityMode. For example, tdf#123116 wants compat=15 so that Word will nicely layout an oversized table-row. tdf#131121 wants it too. By changing to compat=15, we can help Word take advantage of some fixes since docx 1.0, and avoid having to write new logic to export to old formats as well as new. Unfortunately, documentation on what layout changes are expected has not been identified yet. But in 7 years we should have run into most of them already... well maybe no. Change-Id: I1ce016618a680b9842fa6828c9e87cc6b677a557 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90455 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com> (cherry picked from commit f25985c55541cbbc9a4fc79e660592d3d0485196) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90920 Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2020-04-01sw: DOCX export: avoid section breaks in text framesMichael Stahl
The problem is that if Word reads a w:sectPr that is inside a w:textbox and has a w:headerReference, then Word throws a confusing error reporting a location inside the headerN.xml file and refuses to open the file. It looks like Word doesn't actually support sections inside text frames, although it doesn't complain if the section break doesn't contain a header/footer reference. The WW8 export appears to avoid this by checking that TXT_MAINTEXT == m_nTextTyp and skipping sections otherwise, but the m_nTextTyp doesn't change when exporting a text frame in DOCX case, so let's change that. Possibly this makes m_bFlyFrameGraphic variable redundant, not sure about that. Change-Id: If862b226254983bb608bbce180f4aa2f41721273 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91421 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de> (cherry picked from commit 0dd48d1a9a716456ff1ebe67e19881ad2f56939b) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91397 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2020-04-01sw: DOCX export: avoid section breaks in text frames harderMichael Stahl
Follow-up to 0dd48d1a9a716456ff1ebe67e19881ad2f56939b - in another document, the sectPr is written from DocxAttributeOutput::StartParagraphProperties(), which lacks a check that it's in the body text. Change-Id: Ia3b56f40a7457f072735a0e09205089a0c5f4584 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91429 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de> (cherry picked from commit 38be440dbe8a706052182d06bb1ae95abdd06fcc) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91399 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2020-03-31sw: DOCX export: ignore linked image with invalid URLMichael Stahl
Word 2013 refuses to open DOCX files with image urls that contain %5C (encoded '\') in path or query (fragment is not a problem). Just don't export such images, they won't work anyway. Change-Id: Iae918791beb8532e76b4f29d49eba6fe0eda8aa8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91204 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de> (cherry picked from commit 65284c03757f70478f04aedd4ed7f4062a7c5516) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91179 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2020-03-26ofz#21385 SwFltAnchor FrameFormat deletedCaolán McNamara
Change-Id: If2beeb112c98d65355714f0946001d3738eddded Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91090 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de> (cherry picked from commit dbf6468764879ef05fc2492b82a31299668c27b4) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91114
2020-03-25tdf#106843 docxexport: don't write double docProtectJustin Luth
regression from LO 6.4 commit 2756ed9317e3474003c11ffe7d1e2f087c1412bf Change-Id: Iaf32974c7282d11bcd9572ed75cf1233ad3f0008 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90321 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.com> (cherry picked from commit b2471b8ab62abaa7f0c2c8342b4fa61c18f013c6) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90953 Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
2020-03-25ofz#21168 sw,writerfilter: limit writerfilter hack to writerfilterCaolán McNamara
The problem is that at the end of WW8 import, a delete redline is inserted that ends up calling DeleteAndJoin from inside AppendRedline(). A fly is anchored AT_CHAR at (node 46, offset 0) and the deletion goes from (node 46, offset 0) to (node 48, offset 13) hence the special case check in IsDestroyFrameAnchoredAtChar() for the IsInReading() prevents it from being deleted, and then its anchor is still registered at the node 46 when it gets deleted. So try to restrict the WriterfilterHack to writerfilter, so it won't affect WW8 import. Unfortunately this is far less obvious than expected, because import can happen for creating a new file, in which case it's all done via UNO in writerfilter, or when inserting into an existing file, in which case SwReader::Read() is used. The SwDocShell's pMedium can't be used becuse in insert file case it will be the loaded file, not the inserted file. There isn't any obvious alternative to adding a silly UNO property for the writerfilter to use. Change-Id: Ia7fdc9bb1925202f6692ebee6e4b6b1fe50e5345 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90384 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit c4dab726caaa73be9f9c731312080143b0a0b89d) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90951
2020-03-10sw: DOCX export: fix bookmark inside sdtDropDownMichael Stahl
Word refuses to open a document that has a w:bookmarkEnd inside w:sdtContent but with no text content following it. It turns out that the bookmark position is wrong anyway, it should end before the text according to Writer's model. It shouldn't make a difference whether the end is inside the sdtContent or preceding the SDT, so write the text content of the SDT from the EndField_Impl(). Another idea would be to move the writing of bookmarks in EndRun() before the StartField_Impl() but who knows what that would break. (regression from d55b26a093bdbced08985dbc7113190b52a8bc66) Change-Id: I476c0829814b061d80811cc6817923ee06013a26 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90100 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de> (cherry picked from commit 1f5af453b5994c9e8ccd0756882b98715c75114b) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90030 Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-03-10sw: DOCX export: fix first-line indent of list itemsMichael Stahl
The problem is that since CVS import, if a SwTextNode has a first-line indent and is in a list or outline that has LABEL_WIDTH_AND_POSITION mode, then MSWordExportBase::OutputTextNode() will throw away the node's first-line indent and overwrite it with the numbering's. Experiments indicate that adding the numbering's value to the node's value fixes most cases, but RTL still doesn't work in many cases. Change-Id: I9707f475dac4e501642ebaf51c0117107fd34a3b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89634 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de> (cherry picked from commit 74e3c95b9b628a0b326790b62b4e378a12d02997) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89642 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-03-03tdf#101710 Fix invalid style:data-style-name attributeMaxim Monastirsky
There were two problems with this attribute: 1. It was written in style:table-cell-properties instead of in style:style. 2. It was referencing a number format id, instead of a style name. Moreover, the data style wasn't even exported as part of office:styles (if at all). Both import and export were affected. For export, it was easily possible to reuse some related stuff from Calc, so that stuff was moved into xmloff and used from there (there are no logic changes for Calc). For import, loading of the invalid attribute was kept for compat reasons. Although it's only useful for automatic number formats, as the data styles weren't exported properly anyway (e.g. see the document attached in bugzilla). Conflicts: sw/qa/extras/odfexport/odfexport.cxx sw/source/filter/xml/xmlfmt.cxx xmloff/source/table/XMLTableExport.cxx Change-Id: I8b70ad205972fada6f3845837d6ed5928d7d6406 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89551 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de> (cherry picked from commit 59ace23c367f83491a37e844d16f7d716eff6346) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89774