summaryrefslogtreecommitdiff
path: root/writerfilter
AgeCommit message (Collapse)AuthorFilesLines
2020-05-28Make loplugin:simplifypointertobool handle parenthesized expressionsStephan Bergmann4-9/+9
...as discussed as an open TODO in the commit message of fe6cce01c88d045a1fcf09acf049c34c22299b02 "Fix loplugin:simplifypointertobool for libstdc++ std::shared_ptr". The necessary changes across the code base have been done fully automatically with the rewriting plugin on Linux. (All those changes apparently involve uses of macro arguments wrapped in parentheses in the macro body, but always in conditionally-converted-to-bool contexts. In other contexts, such automatic rewriting would add the "bool" to the macro body, which would be wrong in general, but we apparently get away with that sloppy coding for now.) The parenExprs_ stack that fe6cce01c88d045a1fcf09acf049c34c22299b02 had introduced to treat such (then-undetected, it had turned out) parenthesized cases now turns out to not be needed after all. Change-Id: I2021f61c2e2805be7e18b38edf8744d186cac3cb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95010 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-05-27tdf#78352: docx import: allow tab at left indent for listVasily Melenchuk1-0/+2
Looks like first tab stop for list bullets is at left paragraph boundry. Luckely there is a compatibility option for this. Change-Id: Iea4bd2b51912746dbd4722ff61eeb2e9293cab31 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94559 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2020-05-27Remove some unused includesMiklos Vajna1-1/+1
Change-Id: Id5a31185faf2a3a13b6ea266e058a7df41d44423 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94890 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-05-26Fix loplugin:simplifypointertobool for libstdc++ std::shared_ptrStephan Bergmann2-2/+2
...where the get member function is defined on a std::__shared_ptr base class, so loplugin:simplifypointertobool used to miss those until now. (While e.g. using libc++ on macOS found those cases.) 366d08f2f6d4de922f6099c62bb81b49d89e0a68 "new loplugin:simplifypointertobool" was mistaken in breaking isSmartPointerType(const clang::Type* t) out of isSmartPointerType(const Expr* e); c874294ad9fb178df47c66875bfbdec466e39763 "Fix detection of std::unique_ptr/shared_ptr in loplugin:redundantpointerops" had introduced that indivisible two-step algorithm on purpose. The amount of additional hits (on Linux) apparently asked for turning loplugin:simplifypointertobool into a rewriting plugin. Which in turn showed that the naive adivce to just "drop the get()" is not sufficient in places that are not contextually converted to bool, as those places need to be wrapped in a bool(...) functional cast now. If the expression was already wrapped in parentheses, those could be reused as part of the functional cast, but implementing that showed that such cases are not yet found at all by the existing loplugin:simplifypointertobool. Lets leave that TODO for another commit. Besides the changes to compilerplugins/ itself, this change has been generated fully automatically with the rewriting plugin on Linux. Change-Id: I83107d6f634fc9ac232986f49044d7017df83e2a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94888 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Jenkins
2020-05-26tdf#133030: DOCX export: fix formula alignment - part 3Attila Bakos1-1/+1
Follow-up of commit 1237acf9851f8b12d1ccd929e2aa8b184c06d552 (tdf#132811 DOCX: fix formula alignment – part 2) Co-authored-by: Tibor Nagy (NISZ) Change-Id: I5466649a2aa6b7ffdb0def723f79dfbecdf1495f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93665 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2020-05-25NFC writerfilter: reorganize and re-use variablesJustin Luth1-10/+10
My previous patch for tdf#133000 modified the code flow a bit. I kept these "formatting" changes separate so that they wouldn't interfere in understanding the functional code changes (which is very important for this extremely fragile numbering code). In this patch, I relocate two lines to group them with their logically similar counterpart and the variables that control it. I also got really confused by one of my earlier code comments which seems to be completely wrong or at best misleading, so I modified it to be what I think is much more accurate. Change-Id: I3ab0bbfab436f70f81adc4af6db4c5b6c9eca8b0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94367 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org>
2020-05-25tdf#107119 DOCX import: fix parallel text wrap around framesTibor Nagy1-2/+3
It was imported as "optimal page wrap" instead of parallel one, resulting different page layout depending on the distance of the frame object from the page margins. Co-authored-by: Attila Bakos (NISZ) Change-Id: I0db65c224f537bfd4f95ee073743a3d17d9e0e4d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94576 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2020-05-25tdf#133000 writerfilter: apply non-contradictory num-styleJustin Luth3-6/+29
This fixes 7.0 regression exposed by tdf#131321's commit 35fc5ef0a759884b24ed8b83cd05702a0fab64cc This patch version heavily depends on recent changes, but could easily be adapted to older ways. (See previous versions in gerrit.) Because LO can now find the numbering rule through the para-style definition, it doesn't bother creating it as a direct paragraph property anymore. So that "directness" has to be specified during the import. This problem manifested itself in two ways. 1.) In SW, the direct numbering was lost and it simply inherits from the para-style. If numbering is now turned off in the para-style, then the paragraph loses it too. 2.) Because the numbering was considered to be defined by the paragraph style, the para-style-indents had higher priority than the numbering-indents. When numbering is defined directly on the paragraph, it has higher priority than the para-style-indents. Change-Id: I04c3944de8a91d9f253791fbd05d6324a8b7a9da Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94365 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org>
2020-05-24inline some use-once typedefsNoel Grandin1-4/+1
Change-Id: Idddba2f3fd05265b08dbc88edb6152d34a166052 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94730 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-05-22writerfilter: pStyle no longer defines PROP_NUMBERING_STYLE_NAMEJustin Luth1-2/+0
This is legacy code. Previously, this could be added every time pStyle was defined. So a pStyle might have copied its numbering style-name to the paragraph before the numId was processed. But now the copying only runs at ::finishParagraph, so now nothing writes a PROP_NUMBERING_STYLE_NAME before numId is processed. Obsoleted by commit cc1c9c7484d97167021301f32c3397124c4d79f5 Introduced by commit e7ab4bb6b0e83f01148ffff41e8c5eaa0c5ba0a4 Change-Id: I6220106d16a531e61eadc8205f1d6b30db3af907 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94594 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org>
2020-05-21use for-range on Sequence in testtools..xmloffNoel Grandin2-6/+5
Change-Id: I05b02a2f8b4b9091c7de0f7e98409d5b608ed250 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94610 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-05-21tdf#133052: DOCX import: fix top auto margin of subitemsLászló Németh1-9/+3
(nested lists) and other items of lists, when auto margin is defined by paragraph style, and list items have got w:numPr. Follow-up of commit 162d74ae7a53eb1cde738f0a7558f297b8162f7a (tdf#132807 DOCX import: fix top auto margin in lists). Change-Id: I4cf470173fa367ac07e15dc901b0e202178c9fc4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94588 Tested-by: Jenkins Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2020-05-20writerfilter: clang-format these filesMiklos Vajna10-222/+171
I added these files more or less recently and they have long lines. Use clang-format to break at a sane column limit. (And I now promise I won't remove more files from the clang-format blacklist for a while.) Change-Id: I7eae945defe67fa19c4bd9f4789d7918bb45bf9a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94585 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2020-05-18tdf#131963: regression from fix for tdf#92472Julien Nabet1-1/+1
tdf#92472 DOCX import: fix checkbox size set by direct formatting at beginning of paragraphs. Follow-up of the commit 22ad4d69d771708f28a2d9e137cfd43ac846cf3a (tdf#121045 DOCX import: fix checkbox size in table). See bt here: https://bugs.documentfoundation.org/attachment.cgi?id=160936 Change-Id: I9868679a46de54519250ab6f9d501a04a414b88e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94385 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
2020-05-17Fix typosAndrea Gelmini1-2/+2
Change-Id: I3ecb671165ba65baaf304e7afec097209c8c88d8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94384 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2020-05-17tdf#120394: docx import: support for w:styleLinkVasily Melenchuk2-16/+28
Previous implementation for w:numStyleLink was referring just ordinal styles, but there can be another abstract list marked with w:styleLink which should be used in given context. Change-Id: Ic5d4fe8bfd41b19e2f65d74defb6961e38ec9a9d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94332 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2020-05-14DOCX export: fix interaction between the crop and the wrap polygon of imageMiklos Vajna2-3/+5
If the wrap polygon is influenced by crop at import time, we need to do the opposite at export time. Do this for RTF and DOCX, where there is matching import code in writerfilter/, leave DOC alone for now. Test this by changing testFdo76803 into an export test, then seeing how the first point's Y position fails and fixing up the exporter, so we get back the old good value. Change-Id: Ieef18aad3c76f7945c7348201b07bcb27a4cd48d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94246 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2020-05-14Fix typosAndrea Gelmini1-2/+2
Change-Id: I244b5d92f945d504027a54f52e110d6dc99d7b3c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93964 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2020-05-13DOCX import: fix interaction between the crop and the wrap polygon of imagesMiklos Vajna6-0/+67
Word first applies the crop, then applies the wrap polygon on the remaining visible part of the image. Writer applies the crop on the original bitmap, and even has explicit code to make sure the uncropped bitmap is used for the wrap polygon, see how SwFlyFrame::GetContour() calls SwNoTextFrame::GetGrfArea(), which will extend the resulting size based on cropping. Fix the problem by moving and scaling the wrap polygon, so it ends up where it would in Word. Also adapt testFdo76803, which had a similar crop+wrap polygon case, but the different there is quite small. Change-Id: Iab2adaa81a33eb04e1806b17ed129ac50f5d2aa3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94149 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2020-05-13tdf#132807 DOCX import: fix top auto margin in listsLászló Németh1-5/+14
at paragraph style based numbering. See also commit 99b2d53346d4b01b491cd1f7fae3304ac0572e12 (tdf#132802 DOCX import: fix list bottom auto margins). Change-Id: I6bfea3ace5c94f9d45267e309a21ac8a97c20a37 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94111 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
2020-05-12tdf#132811 DOCX: fix formula alignment – part 2Attila Bakos4-49/+17
Formula are aligned inline again, but in the right position, fixing both import and export. This partially reverts commit 8b613c4603047dc24aa9b03fb49f4fe1b65af2a3 (tdf#121525 OOXML import: fix formula alignment). Co-author: Tibor Nagy (NISZ) Change-Id: If5c13db749fe5c3b1aee754b47dabc9fabd7ebb9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93631 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2020-05-12tdf#132802 DOCX import: fix list bottom auto marginsLászló Németh1-27/+26
of the last list item, when its numbering based on the paragraph style. Before tables, table rows and before paragraphs without numbering or with different numbering list items got a regression from commit 9a132c8fab7d4d70b91e5ed92429c70a0466afcb (tdf#122342 DOCX import: fix bottom auto margin in lists) Change-Id: I23c73d94569e785ec780d708d983764534e356c2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93973 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
2020-05-12tdf#112287 DOCX frame import: fix default vAnchorTibor Nagy1-1/+1
Vertical frame alignment was calculated from above margin instead of the bottom one, resulting bad positions, when vAnchor wasn't defined. Co-author: Attila Bakos (NISZ) Change-Id: I81bcf53ec826d5dcc9790c661d784b507d9ababc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93556 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2020-05-12fix "NFC writerfilter numbering: remove redundant code"Justin Luth4-8/+2
Earlier, in LO 7.0, I made an error in commit dbd98ebe9f90cedb41a90375688b200c35dd8928, where I failed to notice the difference between setLineId and setNumId, and removed setNumId as what I thought was duplicate code. (Thanks for pointing that out Mike Kaganski!) Reviewing the relevant code, setNumId seems to effectively be redundant after all. Removing it and just using the LineId value. There is a slight difference in the code flow, since numId was only set if the list didn't exist, but that appears to be irrelevant. Lists are not parsed/created until after styles are finished, so !pList.get() is implied by IsStyleSheetImport(). Change-Id: I2575966c8f1781bb278c787a2928d2b459867940 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92125 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-05-12tdf#127778 DOCX import: fix unexpected heading on non-first page ...Miklos Vajna1-9/+0
... 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). Change-Id: I4bbf7271f3a437e8432399bd1e32e9d24190a501 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94013 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-05-11tdf#95189: docx import: apply list ovverride only onceVasily Melenchuk2-2/+11
List overrides should be applied only once on first list with override appearance in document. Next reference to this list should not override again and reset list numbering. Change-Id: I7a24398d5980ca97a74fa8ad09d91ac9adff15ca Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93894 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2020-05-11tdf#132754: DOCX import: changed default list start nubmerVasily Melenchuk1-1/+3
Default value for list numbering startAt is zero. If it is not proveded numbering starts from this value. Change-Id: I2cf7be9063e7bfb8b72d6ba77fcd9507e33bb848 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93899 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
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>