summaryrefslogtreecommitdiff
path: root/writerfilter
AgeCommit message (Collapse)AuthorFilesLines
2020-05-10use compact namespace syntaxNoel Grandin9-22/+19
mostly done using git grep -wl namespace | xargs -P 8 perl -i -pe 's/namespace\s*([\w:]+)\s*\{\s*namespace\s*/namespace \1::/g' Change-Id: Ic53dbaf443cf81fb8940155f2582a7128d829e6d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93406 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-05-10new loplugin:simplifypointertoboolNoel Grandin30-167/+165
Change-Id: Iff68e8f379614a6ab6a6e0d1bad18e70bc76d76a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91907 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-05-09tdf#94628: sw: allow setting for bullet for outline paragraphsVasily Melenchuk1-16/+12
Paragraphs in outline (having style "Header XXX") can also be a part of list and have custom bullets. Simplified code of SwXNumberingRules::SetPropertiesToNumFormat(): do not check for properties special for outline/chapters and removed redundant data shuffle with local maps. Change-Id: I1fa7f8f5359acee1d5aa62d9700641490bb91b6c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93672 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2020-05-07writerfilter: remove unused xCrsrJustin Luth1-2/+1
This looks like copy/paste code. xCrsr isn't really used, and I hardly doubt that it needs to verify that a Crsr can exist in order to ensure that the dummy paragraph is really created. In fact, even checking for xTextAppend.is() shouldn't be necessary because before this it was being used without checking. But since I myself am a copy/paste programmer, and I see lots of examples where this is tested in similar situations, I leave it as it is just to be safe. Change-Id: Ie45d4bc9d0e1cf0a0d7602b83962805165c3b85d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93413 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2020-05-06tdf#122342 DOCX import: fix bottom auto margin in listsLászló Németh1-0/+15
at paragraph style based numbering. See also commit 1bf7f6a1a50ee9f24a3687240fe6ae390b905a6b (tdf#106690 DOCX import: fix automatic spacing before/after numbered para block). Change-Id: I532181019ca97a86475c9bb0a1eea1c836705bab Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93581 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
2020-05-06tdf#108493 DOCX import: fix hanging indent of listsLászló Németh1-3/+16
when its value comes from the numbering style, but the left indentation is overwritten by paragraph settings. The problem caused by that these settings are not independent in Writer core. Change-Id: I5d6759bb215b82dfcaa5cbd3e191ac7ea8a8bb00 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93478 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
2020-05-05writerfilter: cleanup out-of-order xText <-> xCrsrJustin Luth1-9/+6
This looks mostly like copy/paste proliferation of a pointless test for xText after it has already been used. Since this has already been working for years, there is no point in testing if xText.is(), since it would have crashed if it wasn't during the xCrsr definition. Change-Id: I6a032c0bdc7bb587f223f191623a2e3885d444bb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93412 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2020-05-05tdf#132320 writerfilter: fix typo in factoryimpl_ns.pyMiklos Vajna1-1/+1
Regression from 821ab16a1fb0353397914131ab559685d12b92b7 (writerfilter: convert factoryimpl_ns to Python, 2014-07-27), this was probably unnoticed so far, because writerfilter/qa/ooxml/watch-generated-code.sh says the end result is the same with or without this. Change-Id: I570c411c26a399db1df94b56eebce83fe716ae57 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93440 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-05-04tdf#132514 DOCX import: fix lost table style with footerLászló Németh7-18/+36
Table paragraphs collected for table style processing were mixed when both body text and footer contain tables, i.e. clearing paragraph vector at processing the first table resulted missing paragraph vector and table style processing for the other one. Now tables in footer, also nested tables collect their paragraphs in separated table paragraph vectors. Regression from commit 6c5da2cd7af5c2d90e4d8e9635ba8c9989c87923 (tdf#119054 DOCX: fix not table style based bottom margin). Change-Id: Ib8568d8379cfb7da869120cdc7fe12895252d661 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93415 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
2020-05-01improve loplugin:makesharedNoel Grandin1-1/+1
to find places where we are converting stuff to unique_ptr instead of using std::make_shared. As a bonus, this tends to find places where we are using shared_ptr where we can instead be using unique_ptr avoiding the locking overhead. Change-Id: I1b57bbc4a6c766b48bba8e25a55161800e149f62 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93207 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-04-29sw from-bottom relative orientation: add DOCX filterMiklos Vajna1-0/+4
The OOXML equivalent is <wp:positionV relativeFrom="bottomMargin">, and the position is typically a negative number (i.e. the position is the offset between the top of the shape and the top of the top or bottom margin; not the distance and it's always the top of some margin). Change-Id: Ia979bc8bfaa37d29b0947c4408335e0a80c05880 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93172 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2020-04-29tdf#121525 OOXML import: fix formula alignmentAttila Bakos7-8/+114
Formula alignment was not handled at all. Now "oMathPara", "oMathParaPr" elements and m:jc attribute are handled using paragraph alignment, as a workaround. Co-author: Tibor Nagy Change-Id: I71546755492e0f9187c77f5324bada6f3c68f0dc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91435 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2020-04-28move the castToFastAttributeList functionNoel Grandin1-12/+12
to the slightly higher namespace, to make it easy and more readable to use directly in a for-loop-range expression. And make it return a reference rather than a pointer, since it is never allowed to be nullptr. Change-Id: I15d0b32493ef65cfc601b247c272b318f1eadfd8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93049 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-04-27tdf#116883: sw: support for lists level format stringVasily Melenchuk4-66/+14
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>
2020-04-27DOCX import: handle <wp:positionH relativeFrom="insideMargin">Miklos Vajna5-2/+31
This is the same as page, but it is from-left on odd pages and from-right on even pages, i.e. our "mirror on even pages" mode. Change-Id: I018e0ac165a3d802f64cfc314d5c5f58da3cb580 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92965 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2020-04-27Extract getting default locale for filters into separate unotools functionMike Kaganski1-15/+4
Change-Id: Ic97b1a4507d5629963f360147ecc20eb10f5d391 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92957 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-04-27Make upcasting css::uno::Reference ctor require complete typesStephan Bergmann1-0/+2
The main reason for the "home-grown" UpCast introduced with 904b3d1fceee5827076758ed2a81f80cb73493ca "Up-cast conversion constructor for css::uno::Reference" in 2013 was probably that we could not yet rely on C++11 std::is_base_of back then. A (welcome) side effect was that the derived class could be incomplete. However, specializations of UpCast relying on whether or not T2 is incomplete are obviously an ODR violation if the type is incomplete in some TUs and complete (and derived from T1) in others. And even if UpCast had internal linkage, it would still be brittle that its behavior depends on the completeness of T2 at the point of the template's instantiation, and not necessarily at the point of use. That means we should better base that ctor on std::is_base_of (which we can do now since 39a1edd6fec902ef378acce8af42c4d7fba280d0 "Make css::uno::Reference upcast ctor LIBO_INTERNAL_ONLY"), which causes a compilation error at least on Clang and GCC if the completeness requirements are not met. This change fixes all the cases where types need to be complete now, plus any resulting loplugin:referencecasting warnings ("the source reference is already a subtype of the destination reference"). Change-Id: Ieb9e3552e90adbf2c5a5af933dcb872e20661a2f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92950 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-04-27Don't convert OUString to char*Mike Kaganski1-3/+2
Change-Id: I3bfcc6fedb782b12be1fb1d42981756287f29f82 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92956 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-04-26update pchesCaolán McNamara1-1/+5
Change-Id: I83a61da7dda6c72552eecd377f1c3744c92a797e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92909 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-04-24loplugin:unusedmethodsNoel Grandin1-1/+0
Change-Id: Ieec5099a8ce9fa3f07e36be244071efc1b101cf7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92803 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-04-23Fix typosAndrea Gelmini1-1/+1
Change-Id: I6c9fe715c0d188d3970027fcb63c6c039c957fd9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92733 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2020-04-22tdf#108496: DOCX: redesign of override in listsVasily Melenchuk3-4/+18
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>
2020-04-22writerfilter: document WrapPolygonMiklos Vajna1-0/+1
Change-Id: I39ef69269a3fafa188b44e741274ec770de463a9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92657 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-04-22uiobject.hxx only needs forward declaresCaolán McNamara1-9/+3
and update pches accordingly Change-Id: I411712532fd85961bffe6678416fcdc1d9c7f53d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92617 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-04-21tdf#131446 DOCX import: restrict IncreasedAnchoredObjectSpacing furtherMiklos Vajna1-0/+22
Regression from commit 8b73bafbc18acb4dd8911d2f2de8158d98eb6144 (tdf#115719 DOCX import: increase paragraph spacing for anchored objects, 2018-02-14), this is another case where the workaround for the Word layout bug is not needed. tdf115719.docx and tdf115719b.docx are tweaked to have <wp:anchor ... behindDoc="1"> for 1 shape, as the original bugdoc has it. This allows us to render both the tdf#115719 and tdf#131446 bug documents the same way as Word does. Change-Id: I0c3f197c3360882cd64f8dcf286c6051dc11d674 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92599 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-04-19tdf#132185: field command does not necessarily end with spaceMike Kaganski1-1/+8
Change-Id: I5a5e54fb42e20855b75af7ab523465a032ab46e1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92504 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2020-04-17Move Word compat option where it belongsSamuel Mehrbrodt1-0/+1
Change-Id: I6b28c6782f22190b7b22b11361c200d68d672aea Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92347 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-04-17loplugin:buriedassign in tools..xmloffNoel Grandin2-5/+17
Change-Id: I31df6c4fd82c6f6d15bbe5228e92e5171cacba51 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92410 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-04-15writerfilter: DOCX import: import w:noLeading as AddExternalLeadingMichael Stahl3-0/+14
Change-Id: I3d7fa2984975205d284575c60c6c47284b00c4a0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92209 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2020-04-15Revert "NFC writerfilter: remove pointless asserts"Justin Luth2-0/+7
This reverts commit 708f95b87410c640f0e9e22892f4a71194631cd9. Stephan said I have it all backwards. Asserts are primarily "documentation", and there is no point in asserting something if you aren't going to accept it as true, at least not without any other qualifying remarks etc. So a simple "assert(p)" should never be followed by "if(p)". These asserts basically show that "yes, I'm using this pointer without checking on purpose, and not as an oversight." Change-Id: I7350b627a2acf027d1a6d5b33ea272050d23ce6b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92059 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2020-04-14tdf#131321 writerfilter: ApplyNumberingStyleNameToParaStyles()Justin Luth7-0/+57
Prior to this commit, numbering on paragraph styles was lost on import. This didn't affect layout at all, but it did affect user editing. DOCX: export already was fine, just import was missing. RTF: export is explicitly ignored for non-paragraphs, (ParaNumRule_Impl), so I am ignoring RTF, since this fix is meaningless unless both import and export are working. This is a bit tricky because styles.xml is loaded before numbering.xml, so the names are not known until after numbering.xml has finished. So this helper function runs at the end of the numbering.xml import process. Several existing unit tests nicely confirmed a few things. -tdf95377.docx: numId 0 overrides an inherited numbering -chtoutline.docx proves that outlineLevel styles are exempt. -fdo61343.docx actually has nothing in numbering.xml, so it is possible to have a numbering with no name. Of course, it is a really messed up document, too... Change-Id: I270a581f08704c2595d861ce5c5b546f9d6ba6b6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92058 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-04-13NFC writerfilter numbering: remove redundant codeJustin Luth2-9/+2
Remove duplicated StyleSheetImport section, and redundant valid pointer check. Change-Id: I468733fc627fbdbebb2daf7087ce9e65158751df Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92065 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org>
2020-04-11Removed duplicated includeAndrea Gelmini1-1/+0
Change-Id: I7863aedccbf22a0958f407b8f3aefe7ed997f9b0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91812 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2020-04-11NFC writerfilter: remove pointless assertsJustin Luth2-10/+1
In an age where GDB (or whatever other platform debugger you prefer) is easy to use, there is no point in asserting something that is going to crash anyway, is there? Asserting is only good in these cases if you follow it using an _if_ statement. Noel informed me that it can also be used to silence false positive coverity warnings. Change-Id: I5a5cb7a22019768ec2807f6918d4a8ebb51194de Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92049 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-04-10writerfilter: simplify ListDef::GetStyleNameJustin Luth2-6/+5
A simple lookup of the list's stylename has no need for a styleId. That is only used during the naming of the style, in which case both id and styletable are needed. Let's not be confusing and just create a separate function to simply return m_StyleName. Change-Id: Ib0303a45d6154988f27c37d2c1470b0529d6c762 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92035 Tested-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Justin Luth <justin_luth@sil.org>
2020-04-10tdf#132001 DOCX import: fix crash: redline in floating tableLászló Németh1-4/+16
Copying redlines to frame text was failed in tables inside frames. Skip these redlines temporarily. Regression from commit e8bae67b3dbcc90ace8264b6b1aefaf0ce459aba (tdf#125894: DOCX: import tracked changes in frames). Change-Id: I4f3ca2e95fb2e7637f8cf8dca1088a7727bcf98d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91985 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
2020-04-09pyuno,*: kill Python 2 support with fireMichael Stahl7-7/+0
Python 2 support was retained for use with --enable-python=system on RHEL7 and SLES. The time has arrived to remove it. Some .py files that were imported from third parties are not changed to enable easier replacement with updated versions if necessary. solenv/gdb should continue to support Python 2. bin/get-bugzilla-attachments-by-mimetype requires Python 2 to access Launchpad. Change-Id: I26414ae8e9f8402c90336af82020135685694217 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91697 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2020-04-08tdf#131959 DOCX: import tblInd from table styleLászló Németh2-0/+23
to fix left table indent when direct formatting doesn't overwrite the table style. Note: The imported values are adjusted correctly according to the differences in calculation of table indent positions. See commit d2db4bc9507653a46fdea282d41b9683910a072f (tdf#119760 docx: table starts at left, not mid-border). Change-Id: Ieb6f078b3bd3605d538f2eedb7a5030784a738b3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91765 Tested-by: Jenkins Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2020-04-08simplify QNameToStringNoel Grandin7-89/+25
no need for it to be a class, and no need for the data to be allocated at runtime Change-Id: I80bca34b2af221534eae5a6e90de369fa29037e4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91878 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-04-07tdf#131819 DOCX import: fix fixed size nested tableLászló Németh1-0/+6
Auto width nested table with fixed width cells is imported as fixed width table to keep the original cell widths, which define the width of the table, too. Partial revert of commit bed818c5d5e92a0b189f25e18495fc205d949128 (tdf#104876 writerfilter: m_bTableSizeTypeInserted = false here). Change-Id: If58c58a792853e1084ff1d8f9bf6ef74a593b1bd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91764 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
2020-04-07tdf#119038 DOCX: fix FollowTextFlow handlingAttila Bakos3-52/+21
This fix also a clean-up for the following commits: ad8857dab30e099a0cf6ec18d184a6c836b33317 (tdf#130120 DOCX: export o:allowincell) 14ad64270e4fbca3c24da6f55f260b1fb229556a (tdf#129888 DOCX shape import: handle o:allowincell) 10f29d8bf05d44ca8bc11d34d1294ec17f8ac0f1 (tdf#87569 tdf#109411 DOCX import: fix shape anchor in tables) where these patches ignored the option "Follow text flow" and there was no possibility to switch this setting on GUI. Now this is handled on GUI as well by replacing the grab-bag with UNO property "IsFollowingTextFlow". The tdf#119038 bug also fixed. Note: Unit tests for the commits mentioned above were modified for testing the new property, so new tests were not added. Change-Id: Ie35c6e280f8b33d8535ca4cd9749f110f9d592ee Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90753 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2020-04-07tdf#119760 docx: table starts at left, not mid-borderJustin Luth1-4/+9
related to compatibilityMode = 15; the new export default. In Word 2013+, it appears that the table starts immediately, and then the border is added. In Writer, the table is considered to start mid-border. So that difference needs to be emulated by adjusting the table margin. The same appears to be true for nested tables. Negative margins appear to just be ignored for nested tables, and Word's UI does not accept a negative value. I modified the existing table-position-15.docx slightly (in Word 2016), just to remove spacing between the caption and the table so that it would be easy to visually compare the table position. One slight difference is that WORD seems to add a small "margin" to the the paragraph shading area - don't let that throw you off. The existing unit test enforced settings that didn't match how Word 2013 was showing the files, despite being written to test exactly that. I assume the author was focusing more on OLDER versions of Word and didn't care too much about the NEW version. A man after my own heart. MISC: -I removed my earlier TODO which was just plain wrong. -the ambiguous make::any caused me untold problems, so I made it unambiguous by moving it into a variable. Change-Id: I0685ab74777f1def2841c7d18ff1cdaf2753f47b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91608 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-04-07loplugin:unusedvariableplus in writerfilterNoel Grandin3-3/+0
Change-Id: Idd0fd88dc55df6e916291d173c8f6fc1219fc111 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91783 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-04-03fix wrong variable checked in AddTblStylePrNoel Grandin1-1/+1
regression from commit 4c3ba3a413be7339115ea5e6edc825a8434cd345 Date: Sat Jul 26 17:17:27 2014 +0100 fdo#75757: Remove inheritance from std::map. found by my new unusedvariableplus loplugin Change-Id: Ica9a3ade207698ac7af76e010fbb9e6bdd0dc227 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91631 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-04-02NFC ww8/writerfilter: comment fixes and general code cleanupJustin Luth1-1/+1
1.) Confusing to set a default in the CTOR head, and then change it in the body. 2.) fix spelling 3.) clarify somewhat misleading comments. Change-Id: Icb19a8838f1f01310b2dacc8cef7d9f0c67f3e75 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91275 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org>
2020-04-02tdf#131594: switch line numbering off if w:countBy="0"Xisco Fauli1-10/+15
See https://bugs.documentfoundation.org/show_bug.cgi?id=131594#c0 for more info Change-Id: Ic57826eb5a440e83cea1d9bde5e9144727e3b6df Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91141 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-04-01tdf#120852 writerfilter: support read-only docProtectionJustin Luth3-0/+14
Setting the document to LoadReadonly nicely does not prompt the user to "press this button to edit". That is what we would generally want when Read-Only is enforced, so lets use that. The user can easily enter edit mode via the edit menu, if they want to temporarily override the protection, which seems natural and discoverable enough. There is a File menu - Properties - Security option that manages the LoadReadonly setting in LO. If the user turns that off, then export will also cancel enforcement of the readOnly grabbag item. The situation where read-only was not enforced before, but now is enforced by LO, is handled by _MarkAsFinal, so that case is ignored. In other words, there was no point in adding a WriterWantsToProtectReadOnly flag. See tdf#107690 for _MarkAsFinal fix. I had started going down the wrong patch of being innovative with boolean &=, not realizing that it now always evaluated the right side. Remove that bad example for other cut-and-pasters. In the end, this logic is much easier to understand anyway. Change-Id: Id26b283078a5fd62d662a26a96cfc461e0ba8459 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90323 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-04-01Remove unused includeMiklos Vajna1-0/+4
Change-Id: Ifa3b50b6b31b4a8e8babf7695339848f6730bf11 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91458 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-03-31RTF import: reset writerfilter bit even if the import failsMiklos Vajna2-7/+12
The old code did not handle when e.g. a lang::WrappedTargetRuntimeException is thrown between the set and unset. The DOCX import had the same problem. Change-Id: I7336d08057a875db985e8b647b320abd97c6eb81 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91381 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-03-25tdf#106843 docxexport: don't write double docProtectJustin Luth1-0/+3
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>