summaryrefslogtreecommitdiff
path: root/writerfilter/source/filter
AgeCommit message (Collapse)AuthorFilesLines
8 daysmove writerfilter inside swNoel Grandin2-587/+0
writerfilter wants to convert incoming RTF and OOXML files into writer's document model. But it currently has to do so by manipulating the limited subset that we expose through the UNO API. This is both slower and less accurate than having access to the full document model. So move it inside, and then we can strip out various hacks, and optimise imports. Change-Id: Ie1114d28130ef5f9a786531bc552cb8ee7768015 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165953 Tested-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2024-04-09tdf#88214 sw: text formatting: adapt empty line at end of para to WordMichael Stahl1-0/+1
For an empty line at the end of an empty paragraph, Writer already uses any existing text attribute in the paragraph, see for example testEmptyTrailingSpans. For an empty line at the end of a non-empty paragraph, Writer text formatting uses only paragraph attributes, ignoring any text attributes, whereas the UI will display the attributes from the text attributes (such as font height) if you move the cursor there. Word uses text attributes also in this case, so adapt the inconsistent Writer behaviour: text formatting now uses text attributes too. Apparently this can be achieved by calling SeekAndChgBefore() instead of SeekAndChg(). Add another compat flag "ApplyTextAttrToEmptyLineAtEndOfParagraph" to preserve the formatting of existing ODF documents. Adapt test document fdo74110.docx, it has a line break with "Angsana New" font. Change-Id: I0863d3077e419404194b47110e4ad2bdda3d11c4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165887 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2024-01-28Related: tdf#159382 Naming is hard: make initial monster shorterMike Kaganski1-1/+1
Rename "NoSpaceAfterHangingFootnoteNumbering" and friends to "NoGapAfterNoteNumber". This is cleaner, no less descriprive. Change-Id: I87d3103e4ddfc05e5604eaa4fe707b1fd5711aae Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162654 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2024-01-27tdf#159382: introduce a Word compat flag for hanging footnote number spacingMike Kaganski1-0/+1
The new 'NoSpaceAfterHangingFootnoteNumbering' compatibility option is false for ODF documents by default. Word file format filters set it to true. Its purpose is to avoid extra spacing between the footnote number and its text, when the paragraph has hanging first line, as in MS Word. Change-Id: I42d9353865498137ab99e1d2c031f5b207cbc220 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162603 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-10-24tdf#155040 sw floattable, RTF: fix table is overlapped by subsequent inline oneMiklos Vajna1-1/+0
The document had overlapping text on load since commit 05425f73bfa41d3f7591461e2ad0beb4fafc39b4 (sw floatable: teach the RTF import about SwFormatFlySplit, 2023-04-21). Interestingly the DOCX equivalent was fine, there the inline table is shifted down, below the floating table, so the overlap doesn't happen. Fix the problem by moving the AddVerticalFrameOffsets=true code from the DOCX filter to the shared dmapper, because RTF needs the same. See commit 50223ea6e212b60b7d33839c2753c5601fb50f95 (tdf#98987 sw: add AddVerticalFrameOffsets compat mode, 2016-03-31) for more details about this compat flag. It was already enabled for DOC, too. Change-Id: I948b179c9ec5fa24377014b0e86826568c417b6f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158372 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2023-10-20sw floattable: remove now unused FloattableNomargins compat flagMiklos Vajna1-1/+0
This was noop since commit 626fe9ab5ebebc4ef36e35f4aa597c03a3564d22 (tdf#157573 sw floattable: fix incorrect lack of left margin after table, 2023-10-18). Change-Id: I89a197313ac4ffbcff9bbff534e5411085282ac8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158237 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2023-06-09tdf#152046 Revert "tdf#100680 sw DOCX compatibility: fix wrap of as_char flys"Justin Luth1-1/+0
This reverts 7.4 commit 41b012767feb8552b60a68c7be18d80c403304bf, The premiss of the commit is that as-char flies needed to be handled differently, and yet at the spot where it was implemented, we have no idea whether we are even dealing with an as-char fly!!! As this bug report report shows, it affects paragraphy that don't have any fly whatsoever, let alone an as-char fly. Change-Id: I2fedb2d610093933081e861a16a25de2f2716258 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152778 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com>
2023-06-04Use getXWeak in writerfilterMike Kaganski2-6/+4
Change-Id: I3e0e68c44750f30bd1998c79dc74a13f2c9ade9b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150886 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-01-13tdf#152952 sw: don't hyphenate URLs by defaultMichael Stahl1-0/+1
New compatibility flag HyphenateURLs, disabled by default for Word interop and enabled for old ODT documents. Change-Id: I1496819599deb5ed0fd736698d269ab9a22167fe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145415 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2022-08-18Move tools/diagnose_ex.h to comphelper/diagnose_ex.hxxStephan Bergmann2-2/+2
...so that its TOOLS_WARN_EXCEPTION can be used in comphelper/source/misc/logging.cxx in a follow-up commit. (And while at it, rename from diangose_ex.h to the more appropriate diagnose_ex.hxx. The comphelper module is sufficiently low-level for this immediate use case, so use that at least for now; o3tl might be even more suitable but doesn't have a Library until now. Also, for the immediate use case it would have sufficed to only break DbgGetCaughtException, exceptionToString, TOOLS_WARN_EXCEPTION, TOOLS_WARN_EXCEPTION_IF, and TOOLS_INFO_EXCEPTION out of include/tools/diagnose_ex.h into an additional new include/comphelper/diagnose_ex.hxx, but its probably easier overall to just move the complete include file as is.) Change-Id: I9f3222d4ccf1a9ac29d7eb9ba1530d53e2affaee Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138451 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-08-17tdf#150200 tdf#150438 sw, DOCX: fix drop cap dash, quotation etc.László Németh1-0/+1
In drop cap layout, set smaller size for all glyphs positioned over the baseline, e.g. dashes (dash, en-dash, em-dash, figure dash), bullet, asterisks and quotation marks by extending the bounding box of the glyph to the baseline, like MSO does. Add "DropCapPunctuation", a new default compatibility option for this. Only old ODT files loads the old layout (which was partially broken: e.g. dashes were too long, often missing from the drop cap area or the drop cap was disabled). New ODT and imported DOCX documents use the new default layout for better typesetting and interoperability. Change-Id: I3aba0727fd15f6edb9245e31f523e12f407d189e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138356 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2022-05-02Just use Any ctor instead of makeAny in writerfilterStephan Bergmann2-30/+30
Change-Id: I3db5381c5dc72f0498171d9e61479ae6763312bc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133708 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-04-28tdf#100680 sw DOCX compatibility: fix wrap of as_char flysAttila Bakos (NISZ)1-0/+1
New DOCX compatibility flag "WordLikeWrapForAsCharFlys" has been introduced which true in case of importing DOCX documents. It modifies the wrapping of long words with as_char anchored flys anchored into the same line, resulting e.g. correct import of poor man's header lines drawn by using underline characters under an image. Note: this example was imported as a broken header line: half of it was there after the left aligned image in the same line, and after the line break, only the other half under the image. Change-Id: I9474900ef778bcf5ddc9d95f39d536d67015f3b2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132571 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2022-03-31tdf#116358: rtf import: "keep with next" also affects table rowsVasily Melenchuk1-1/+0
Like in DOCX for RTF there is exactly same behavior for paragraphs inside cells. They do affect table breaking over the pages. So: 1) Enable "TableRowKeep" doc setting for RTF documents. 2) Do not ignore \keepn token for paragraphs in tables. Change-Id: I11e45ca9114c792b8cdbeb77dd51359717129651 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132305 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-11-08use more OUStringLiteral in MediaDescriptorNoel Grandin2-5/+5
Change-Id: I0567d103db8db401c737fed98483912a39352929 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124835 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-09-07Avoid repeating the return type from the declarationMiklos Vajna1-1/+1
Change-Id: I0dce02d10b8c74e80f5672e2dd580b6837ba3291 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121732 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-08-10Revert "tdf#58521 DOCX import: enable ContinuousEndnotes compat flag"Xisco Fauli1-1/+0
This reverts commit f9982c24066d6dd2f938cc20176af0f196bc018f. Reason for revert: tdf#143456 shows there are layout problems with this compatibility option This was reverted in libreoffice-7-2 branch only. See 43d2b3bbacdd6bbe24149ed33c54a180d74c77e4. Instead, this should have been reverted in master first, and the cherry-pick the revert to libreoffice-7-2 Change-Id: I3a29b77289ef1445fdf4886b32861f6d8e79de21 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120150 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2021-08-10Revert "tdf#58521 Enable ContinuousEndnotes compat option for RTF too"Xisco Fauli1-0/+1
This reverts commit 892488b64f09190896d5a14e3f555ca91b3449e3. Reason for revert: tdf#143456 shows there are layout problems with this compatibility option This was reverted in libreoffice-7-2 branch only. See 43d2b3bbacdd6bbe24149ed33c54a180d74c77e4. Instead, this should have been reverted in master first, and the cherry-picked the revert to libreoffice-7-2 Change-Id: I3c06001f3f3faeaa4a05a7c9ebd2e175e88ededa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120232 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Xisco Fauli <xiscofauli@libreoffice.org>
2021-07-15writerfilter: improve comments around compat flagsMiklos Vajna1-1/+1
Make it more explicit which list is shared and which list is DOCX-only. See <https://gerrit.libreoffice.org/c/core/+/118960/3#message-09a4a96aa2d09e2182dac80bb4857a875155fff9>. Change-Id: I287dfe799eb8597ca0a8ad65ec677d8da79bf1e4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118966 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-07-15tdf#58521 Enable ContinuousEndnotes compat option for RTF tooGabor Kelemen1-1/+0
Now it's used in RTF, DOC and DOCX import consistently. Change-Id: I062a5fbbdf6ee0ef4d3c86a09ce50ac3d588fae5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118960 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-07-13tdf#58521 DOCX import: enable ContinuousEndnotes compat flagGabor Kelemen1-0/+1
like Writer for DOC import and MSO do to avoid to start endnotes on a new page. Change-Id: I37d54f189e7aa1f4d0ac829b6af0c03aec64b9f2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118541 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2021-06-09NFC compat cleanup: no need to specify default TabOverflowJustin Luth1-1/+0
This really confused me because it lead me to think that this was something done for MS compatibility. Well, that is only true in an off-handed way. LibreOffice itself was changed to work similarly to MS Word. So there is nothing special about how DOC or DOCX/RTF are handled. Since the compat settings are not saved or loaded into MS Formats (i.e. it just takes the default value), and since on an ODT save it also will just save with the proper default value, there is no need to specify "TabOverflow = true" in non-ODT import filters. Only ooxmlexport16 has a unit test that reacts if tabOverflow is false. That one is mine and it indicates that the document would be better if tabOverflow was off, so there are no examples of how tabOverflow improves a doc. Change-Id: I97c25154108bc1ca0fcd3dfcff66fea0ea2bca7e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116741 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org>
2021-06-09Fix typosAndrea Gelmini1-1/+1
Change-Id: I3539edf26a793f89d38f3df376002f4ed4295343 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116869 Tested-by: Jenkins Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
2021-06-08tdf#142404 DOCX c15: add compat flag TabOverSpacingJustin Luth1-0/+5
DOCX in 2013 (compatibilityMode 15) no longer supports TabOverMargin (i.e. the text margin), but it does a similar kind of thing if the tab goes into the spacing-after of a paragraph. So add a compat flag to handle this in-between kind of situation. I grepped -i "tab_*over_*margin" to see if I was missing anything. Decimal/Center proved to be only tabOverMargin. IsInSect shouldn't matter since it fits inside the printing range. The other places where I didn't insert TabOverSpacing didn't seem relevant based on a code read. Tab-after-tab still doesn't work great, but what we have is already a massive house of cards that will just collapse if changed. No real provision for handling tabs-over-paragraph-end. -auto-tabs are created instead of "beyond nMyRight" tab, unless it is the first tab defined. -doesn't allow auto-tabs to fill the remaining space. But on the other hand, MS Word's implementation of tabs follows some kind of incomprehensible bizarre logic, so just ignore the tabs completely, please. Change-Id: I3723107b29ec3e287ea8661544711c13eee3ca48 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116667 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-06-01tdf#142404 DOCX c15: TabOverMargin no longer true in 2013+Justin Luth1-1/+0
When compatibilityMode is 15, TabOverMargin no longer seems to apply. This is a dramatic visual change in docx that I didn't find any documentation about, but the visual change is obvious enough proof. LibreOffice started saving DOCX as c15 mode in 7.0. [P.S. related TabOverflow also seems to be false with c15, but it acts differently than what LO's tabOverflow code does. That was discussed in a different patch and seems to be a dead end, so I'm ignoring that aspect. Way too many complications and effects on LO native mode.] Change-Id: I5a0a6d695d6825444cf6a362a81803f306e6c6e3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116337 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-05-04tdf#138782 DOCX import: fix frame positions of old docsAttila Bakos (NISZ)1-1/+0
by limiting AddFrameOffsets compatibility option for docs created by MSO 2010 or older. Likely regression from commit 355d25eac764713f4d52eac801ade6e2ff1deab0 (n#779627: added quite some compat options from the ww8 filter on writerfilter). This patch fixes several bugs, which were collected as duplicates by Gábor Kelemen. Change-Id: I106e90c4bf00bb0b6a8986615cb3ad9c4828d5b3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114476 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2020-12-29loplugin:stringviewparam: operator +Stephan Bergmann1-1/+1
Change-Id: I044dd21b63d7eb03224675584fa143009c6b6008 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108418 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-09-24tdf#134782 sw: split AddParaSpacingToTableCells flag in 2Michael Stahl1-0/+1
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>
2020-05-26Fix loplugin:simplifypointertobool for libstdc++ std::shared_ptrStephan Bergmann1-1/+1
...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-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-24ofz#21168 sw,writerfilter: limit writerfilter hack to writerfilterCaolán McNamara2-0/+19
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>
2020-03-05Remove some unused includesMiklos Vajna1-1/+0
Change-Id: I808b7e3f6b580ee6f1876aa06038b5741d7ff6a2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90001 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-03-04comphelper: allow simple ad-hoc measuring with ProfileZonesMiklos Vajna1-4/+0
And then remove the manual measuring from the RTF import. Sample output: comphelper::ProfileZone: RtfFilter::filter finished in 180 ms Change-Id: I85e2e12d82ff491a2991a41e5a6f6d1410e12363 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89905 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-01-24loplugin:makeshared in svgio..writerperfectNoel Grandin1-2/+2
Change-Id: I0f8de0f78c7a8fb78d47ee5dfed09019b4eb5288 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87357 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-11-25Turn on clang-format for these filesMiklos Vajna2-109/+108
I (tried to) keep these files consistent locally with astyle in the past, switching to clang-format makes sure that the recent problem with introducing inconsistencies with automatic loplugin rewrites doesn't happen again. Change-Id: I86def0d13a1d16f8cedb7cf9927a48ce14c2b3bf Reviewed-on: https://gerrit.libreoffice.org/83690 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2019-11-22Extend loplugin:external to warn about classesStephan Bergmann2-0/+8
...following up on 314f15bff08b76bf96acf99141776ef64d2f1355 "Extend loplugin:external to warn about enums". Cases where free functions were moved into an unnamed namespace along with a class, to not break ADL, are in: filter/source/svg/svgexport.cxx sc/source/filter/excel/xelink.cxx sc/source/filter/excel/xilink.cxx svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx All other free functions mentioning moved classes appear to be harmless and not give rise to (silent, even) ADL breakage. (One remaining TODO in compilerplugins/clang/external.cxx is that derived classes are not covered by computeAffectedTypes, even though they could also be affected by ADL-breakage--- but don't seem to be in any acutal case across the code base.) For friend declarations using elaborate type specifiers, like class C1 {}; class C2 { friend class C1; }; * If C2 (but not C1) is moved into an unnamed namespace, the friend declaration must be changed to not use an elaborate type specifier (i.e., "friend C1;"; see C++17 [namespace.memdef]/3: "If the name in a friend declaration is neither qualified nor a template-id and the declaration is a function or an elaborated-type-specifier, the lookup to determine whether the entity has been previously declared shall not consider any scopes outside the innermost enclosing namespace.") * If C1 (but not C2) is moved into an unnamed namespace, the friend declaration must be changed too, see <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71882> "elaborated-type-specifier friend not looked up in unnamed namespace". Apart from that, to keep changes simple and mostly mechanical (which should help avoid regressions), out-of-line definitions of class members have been left in the enclosing (named) namespace. But explicit specializations of class templates had to be moved into the unnamed namespace to appease <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92598> "explicit specialization of template from unnamed namespace using unqualified-id in enclosing namespace". Also, accompanying declarations (of e.g. typedefs or static variables) that could arguably be moved into the unnamed namespace too have been left alone. And in some cases, mention of affected types in blacklists in other loplugins needed to be adapted. And sc/qa/unit/mark_test.cxx uses a hack of including other .cxx, one of which is sc/source/core/data/segmenttree.cxx where e.g. ScFlatUInt16SegmentsImpl is not moved into an unnamed namespace (because it is declared in sc/inc/segmenttree.hxx), but its base ScFlatSegmentsImpl is. GCC warns about such combinations with enabled-by-default -Wsubobject-linkage, but "The compiler doesn’t give this warning for types defined in the main .C file, as those are unlikely to have multiple definitions." (<https://gcc.gnu.org/onlinedocs/gcc-9.2.0/gcc/Warning-Options.html>) The warned-about classes also don't have multiple definitions in the given test, so disable the warning when including the .cxx. Change-Id: Ib694094c0d8168be68f8fe90dfd0acbb66a3f1e4 Reviewed-on: https://gerrit.libreoffice.org/83239 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-09-25Revert "tdf#117988 writerfilter: IgnoreTabsAndBlanksForLineCalculation"Justin Luth1-1/+1
This reverts LO 6.2 commit 49ddaad2f3ba4e17e1e41e94824fb94468d2b680. tdf#127617 proves it simply was not the correct solution. I replaced the unit test document with one that clearly demonstrates that spaces/tabs should NOT be used in line height calculations. Example document tested with Office 2003, 2010, 2016. Change-Id: I2833384a017526d665adef0cae968bc4aef0dd94 Reviewed-on: https://gerrit.libreoffice.org/79473 Reviewed-by: Justin Luth <justin_luth@sil.org> Tested-by: Justin Luth <justin_luth@sil.org>
2019-07-31Improved loplugin:stringconstant (now that GCC 7 supports it): writerfilterStephan Bergmann2-2/+2
Change-Id: I79a920d7f2d46f17fa14394120a7cb872013eec9 Reviewed-on: https://gerrit.libreoffice.org/76626 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-06-18loplugin:logexceptionnicely in writerfilterNoel Grandin1-2/+3
Change-Id: Ie01d0e6af6af0cfeb46cdde38f52ab068b64db6b Reviewed-on: https://gerrit.libreoffice.org/74284 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-05-13fix wrong SET/QUERY flags passed to uno::ReferenceNoel Grandin2-2/+2
By creating deleted methods for the wrong calls. Avoids the compiler needing to construct a temporary Change-Id: I3b8c648d6bb22d22827bf74f21ea5a2a17fc0f6a Reviewed-on: https://gerrit.libreoffice.org/72103 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-03-25We can simply use DBG_UTIL now after efc29fbb6d458f5fd3660a36e2ff1592608fcbacTor Lillqvist1-1/+1
Change-Id: I74cce2d3fb4661ea9a44d0b166ca98dfade53056 Reviewed-on: https://gerrit.libreoffice.org/69604 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-02-19pretty up logging of exceptionsNoel Grandin1-1/+2
Add exceptionToString() and getCaughtExceptionAsString() methods in tools. Use the new methods in DbgUnhandledException() Add special-case case code for most of the exceptions that contain extra fields, so all of the relevant data ends up in the log Change-Id: I376f6549b4d7bd480202f8bff17a454657c75ece Reviewed-on: https://gerrit.libreoffice.org/67857 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-12-14sw: support for saving into .dotx fileVasily Melenchuk1-2/+8
Template format now supported not only for import, but for export too. Change-Id: I9fb9da14c4d6466b6979fa37fb2c0359ce5 Reviewed-on: https://gerrit.libreoffice.org/64947 Tested-by: Jenkins Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de>
2018-07-27tdf#117988 writerfilter: IgnoreTabsAndBlanksForLineCalculationJustin Luth1-1/+1
Introduced in LO 4.0 in a mass copy of compat settings in commit 355d25eac764713f4d52eac801ade6e2ff1deab0 Change-Id: I0d95941ff2815a43e571be1a6a0dbab1d12185d6 Reviewed-on: https://gerrit.libreoffice.org/57991 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-07-12Add missing sal/log.hxx headersGabor Kelemen2-0/+3
rtl/string.hxx and rtl/ustring.hxx both unnecessarily #include <sal/log.hxx> (and don't make use of it themselves), but many other files happen to depend on it. This is a continuation of commit 6ff2d84ade299cb3d14d4110e4cf1a4b8070c030 to be able to remove those unneeded includes. This commit adds missing headers to every file found by: grep -FwL sal/log.hxx $(git grep -Elw 'SAL_INFO|SAL_INFO_IF|SAL_WARN|SAL_WARN_IF|SAL_DETAIL_LOG_STREAM|SAL_WHERE|SAL_STREAM|SAL_DEBUG') to directories w* x* Change-Id: I27bff44da3d34d24262031c7489e755311599bc5 Reviewed-on: https://gerrit.libreoffice.org/57307 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-07-10tdf#79877 perf loading docx file, writerfilter/ improvementsNoel Grandin1-2/+1
this improves load time by 20%. We switch from shared_ptr to tools::SvRef to manage the objects I noticed some double inheritance like this: DomainMapper LoggedProperties Properties SvRefBase LoggedTable Table SvRefBase so to be safe I made all the ref-count-base-class inheritance virtual. Change-Id: Ia3de9733f5c6966e8171f43d083dcc087040b8cd Reviewed-on: https://gerrit.libreoffice.org/57022 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-10pass SvStream around by std::unique_ptrNoel Grandin1-2/+2
and give utl::OStreamWrapper a new constructor so that it knows it is taking ownership of the SvStream, which appears to fix several leaks Change-Id: Idcbcca9b81a4f0345fd8b8c8a2f4e84213686a6b Reviewed-on: https://gerrit.libreoffice.org/57187 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-06-08look for unnecessary calls to Reference::is() after an UNO_QUERY_THROWNoel Grandin2-6/+0
Since the previous call would throw if there was nothing to be assigned to the value. Idea from tml. Used the following script to find places: git grep -A3 -n UNO_QUERY_THROW | grep -B3 -F 'is()' Change-Id: I36ba7b00bcd014bdf16c0455ab91056f82194969 Reviewed-on: https://gerrit.libreoffice.org/55417 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tor Lillqvist <tml@collabora.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-05-25Improve re-throwing of UNO exceptionsNoel Grandin2-5/+8
(*) if we are already throwing a Wrapped*Exception, get the exception using cppu::getCaughtexception. (*) when catching and then immediately throwing UNO exceptions, use cppu::getCaughtException to prevent exception slicing (*) if we are going to catch an exception and then immediately throw a RuntimeException, rather throw a WrappedTargetRuntimeException and preserve the original exception information. Change-Id: Ia7a501a50ae0e6f4d05186333c8517fdcb17d558 Reviewed-on: https://gerrit.libreoffice.org/54692 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-02-14oox: move putPropertiesToDocumentGrabBag to XmlFilterBaseAshod Nakashian1-34/+2
Change-Id: Ic3cbabc420c7856682b889528043563622997c14 Reviewed-on: https://gerrit.libreoffice.org/49235 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>