summaryrefslogtreecommitdiff
path: root/xmloff
AgeCommit message (Collapse)Author
2020-01-28New loplugin:unsignedcompareStephan Bergmann
"Find explicit casts from signed to unsigned integer in comparison against unsigned integer, where the cast is presumably used to avoid warnings about signed vs. unsigned comparisons, and could thus be replaced with o3tl::make_unsigned for clairty." (compilerplugins/clang/unsignedcompare.cxx) o3tl::make_unsigned requires its argument to be non-negative, and there is a chance that some original code like static_cast<sal_uInt32>(n) >= c used the explicit cast to actually force a (potentially negative) value of sal_Int32 to be interpreted as an unsigned sal_uInt32, rather than using the cast to avoid a false "signed vs. unsigned comparison" warning in a case where n is known to be non-negative. It appears that restricting this plugin to non- equality comparisons (<, >, <=, >=) and excluding equality comparisons (==, !=) is a useful heuristic to avoid such false positives. The only remainging false positive I found was 0288c8ffecff4956a52b9147d441979941e8b87f "Rephrase cast from sal_Int32 to sal_uInt32". But which of course does not mean that there were no further false positivies that I missed. So this commit may accidentally introduce some false hits of the assert in o3tl::make_unsigned. At least, it passed a full (Linux ASan+UBSan --enable-dbgutil) `make check && make screenshot`. It is by design that o3tl::make_unsigned only accepts signed integer parameter types (and is not defined as a nop for unsigned ones), to avoid unnecessary uses which would in general be suspicious. But the STATIC_ARRAY_SELECT macro in include/oox/helper/helper.hxx is used with both signed and unsigned types, so needs a little oox::detail::make_unsigned helper function for now. (The ultimate fix being to get rid of the macro in the first place.) Change-Id: Ia4adc9f44c70ad1dfd608784cac39ee922c32175 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87556 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-01-24xmloff: create XMLImpressClipboardExport instances with an uno constructorMiklos Vajna
See tdf#74608 for motivation. Change-Id: Idab3996986eb38ff8b1a3765f9bf005229271728 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87294 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-01-23loplugin:unusedmethodsNoel Grandin
Change-Id: Ic2212a502bbd42217934884f4fce49f6f8d4765c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87236 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-23tdf#130133: fix wrong values for attribute chart:regression-type in ODF 1.2Julien Nabet
"polynomial" and "moving-average" Change-Id: I5d07d0315555e8b72ea721a35a2205a8223ed294 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87226 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2020-01-22use fastparser for XMLFontStylesContextNoel Grandin
Change-Id: I7b273cdc0f90f2a8c9527d1f19fed97672a74741 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87175 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-22Convert reportdesign to fastparserNoel Grandin
Change-Id: I0703344aad4ca6c72e494160b019c13e24cc843a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87160 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-21use more FastParser in SvXMLStylesContextNoel Grandin
Change-Id: I05c7314739246a864b16723c13bd8fbb4ef725e7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87146 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-21use more FastParser in ScXMLChangeInfoContextNoel Grandin
had to hack the token constant generating process a little because we have two tokens that only differ in "-" vs "_" Change-Id: I0744d697918d28cca0c92b83ecfd37c1ae9d2bae Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87138 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-21Use FastParser in XMLDocumentSettingsContextNoel Grandin
and flatten the pImpl data Change-Id: I8d817cd2af0a3855d10dbfaa580c3379119d5067 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87126 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-21Use FastParser in SdXMLBodyContextNoel Grandin
Change-Id: I1070ca2351f7bfb2e0c10ba6e876ebcf2cae0ce0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87118 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-21use FastParser in SdXMLMasterStylesContextNoel Grandin
Change-Id: I9fb57f4bf97e3aa67bcdd55f5e98ebcddaaf9e4b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87082 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-21use FastParser in XMLScriptContextNoel Grandin
Change-Id: I7c5f5b77a78307c556ee5718480346ed3dd159fc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87075 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-20return nullptr from CreateChildContext methods in subclassesNoel Grandin
the calling class handles this nicely, and also tells us when we are not handling some part of the XML file Change-Id: Ib64a704bc96bb4d6eff2d57116d62c9c15e25c6b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87073 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-19inline some Create methodsNoel Grandin
to make it easier to follow the flow of logic through the context classes Change-Id: I914c04dd0aa8148f9ff1be4ea86e83ff67d8bb76 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87039 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-19tdf#129883 Section links are lost on save and reloadNoel Grandin
Revert "convert XMLSectionSourceImportContext to FastParser APIs" This reverts commit ccdcc25a085299bda45bc5ea4b3594e856f2d315. THis was one of my earliest fastparser attempts before I properly understood the weirde workings of the SvImportXML stuff. Change-Id: I729467cb513740d36c0483eb6f8c84ffa4cab578 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87038 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-17tdf#98584 Correct import draw:transform values skewY and matrixRegina Henschel
Covers tdf#98583 and tdf#98565 too. TRBaseGeomety (API) uses for skewX the same angle orientation as written to file. But that results in mathematically wrong matrices. Change sign where needed. Vertical shearing is converted and written to file by LO as sequence rotation * shear horizontal * scale. Same should happen on reading. Because LO does not write skewY itself, I have used the angle orientation, that was used in OOo1.1.5 and that is used in Scribus 1.5.4. Import generates a transformation matrix from the draw:transform attribute. That is a mathematically correct matrix. It is applied to the shape via TRSetBaseGeometry. But that uses a wrong sign in the shear angle. Therefore conversion of mathematical matrix to TRBaseGeometry matrix is needed. The draw:transform attribute can generate a scaling, which needs to be applied on top of the scaling made from svg:width and svg:height. Such happens on import of skewY() and might happen with matrix(). SdrPathObject puts scaling form svg:width and svg:height directly into the coordinates of its points. It had ignored any additional scaling. I have add a part to detect and apply it. Change-Id: I7636b9feec432cf403e7c6ef8dbd6a769793d144 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86244 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Reviewed-by: Regina Henschel <rb.henschel@t-online.de>
2020-01-17xmloff: create DrawingLayerExport instances with an uno constructorMiklos Vajna
See tdf#74608 for motivation. Change-Id: I1bb8e649cab67a2df4e40277758a47259f65a6c6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86946 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-01-16return nullptr from Create*Context methods in nullptr subclassesNoel Grandin
the calling class handles this nicely, and also tells us when we are not handling some part of the XML file Change-Id: Ic51a42b9d2dec96243e7f83b528d7455d4bc0504 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86906 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-16fix XMLVersionListImport fast-parserNoel Grandin
AddAtIndex does not seem to play nice with the fast-parser stuff Change-Id: Iea64566b595e952b8bdf767f51c0c1813f0abb6f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86902 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-15use FastParser for SchXMLImportNoel Grandin
Change-Id: Ib43f109dce8226d29b19c141010e4480147933ad Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86825 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-14use FastParser APIs in SvxXMLXTableImportNoel Grandin
Change-Id: I744943bdcdecc10219898d23038eb5d0c2dfb5d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/85479 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-13convert this warning to SAL_INFO for nowNoel Grandin
too noisy until I've done more conversion Change-Id: I1afe653683f12edc4516a40f609e6c1dc749c9e9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86676 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-13convert dbaccess to FastParser APIsNoel Grandin
Noting that I use "& TOKEN_MASK" a lot because we can be dealing with either NAMESPACE_DB or NAMESPACE_DB_OASIS. Change-Id: I5ca0aac61e37dc903bb998a43b73b48df22e55fd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86655 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-10use more std::make_sharedNoel Grandin
found using 'git grep', I tried using clang-tidy, but it only successfully found a tiny fraction of these Change-Id: I61c7d85105ff7a911722750e759d6641d578da33 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86526 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-10xmloff: create AnimationsImport instances with an uno constructorMiklos Vajna
See tdf#74608 for motivation. Change-Id: I36a70b0657c4648a9f5cf69d67d4da4508099587 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86503 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-01-09convert XMLAutoTextEventImport to FastParser APIsNoel Grandin
Change-Id: If0249a9987a42c700f994073bc649774ae84f510 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86477 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-08ofz#19933 Null-dereference READCaolán McNamara
since... commit e1383444c6d00f5d0b1d507670517f45988b9cc7 Date: Tue Jan 7 13:01:41 2020 +0200 extract some common code from ImportContext classes which reduces code bloat, and lets us log when elements are ignored Change-Id: I873d14c07b8f2c62f7b1f4c7dc05c566fb35f458 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86437 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-08make ODBFilter return a fast contextNoel Grandin
And (*) use the fast parser already inside ODBFilter (*) pass around ODBFilter explicitly to make the code easier to read Change-Id: Ib0dd24e530b32b5edb94f150390df1e405c3efb9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86248 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-07extract some common code from ImportContext classesNoel Grandin
which reduces code bloat, and lets us log when elements are ignored Change-Id: I5ca12bc1fcbfa3bea49ebde819fd80bd233a96a0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86338 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-02tdf#123206 Add test: import custom-label-fieldTamas Bunth
Add test for deprecated custom-label-field attribute of the data-point element. Change-Id: I9a7619898fa72900323e5b41728d2146c14203e3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86103 Tested-by: Jenkins Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2020-01-01tdf#123206 Store custom label as chart:data-labelTamas Bunth
Use the chart:data-label element instead of using the loext:custom-label-field attribute. chart:data-label stores can be a child of chart:data-point and it may contain a text:o element for holding one or more paragraphs of custom label text. This commit aims to export and import chart:data-label with paragraphs put into different text:span elements. These span elements may hold a text:style-name attribute in order to achieve formatted text. This structure is already in the ODF format. Change-Id: I0bea7ce1a16af9c47b33555e18545bdaae7e95ca Reviewed-on: https://gerrit.libreoffice.org/c/core/+/85659 Tested-by: Jenkins Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2019-12-26use more TOOLS_WARN_EXCEPTIONNoel Grandin
so we get more useful log messages when stuff goes wrong Change-Id: Ia55db7ab1a4d79b0f281673fbbb06c61745fa89e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/85829 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-12-25sal_Char->char in xmloff..xmlsecurityNoel Grandin
Change-Id: I292d699ce1de10ca9341525161f5da2592102ff7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/85778 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-12-23tdf#129520 xmloff: fix ODF import of multi-paragraph fieldmarkMichael Stahl
The problem is that inserting PARAGRAPH_BREAK also calls AppendTextNode() internally, not SplitNode(). (regression from 6eb1c2304d257d16858b7b51cad63f1dc2bde88b) Change-Id: I2d33819a973c956ea04925458c904ce36ccb55a3 Reviewed-on: https://gerrit.libreoffice.org/85627 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2019-12-22loplugin:finalclasses in xmloffNoel Grandin
Change-Id: I389824999e8e24c27e5d6f36180ae0fd8032c482 Reviewed-on: https://gerrit.libreoffice.org/85699 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-12-21convert XMLSectionSourceDDEImportContext to FastParser APINoel Grandin
Change-Id: I4a2ca35d75a352d5f2b763114de9e9151125f001 Reviewed-on: https://gerrit.libreoffice.org/85648 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-12-21convert XMLSectionSourceImportContext to FastParser APIsNoel Grandin
Change-Id: I488d0e521a445055a33a7972d78005047b2c5b2f Reviewed-on: https://gerrit.libreoffice.org/85647 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-12-21remove unnecessary CreateChildContext methodsNoel Grandin
that do the same as the base class method Change-Id: I5048edf9d5fa40bb4ebdd96d9b13c303fb061945 Reviewed-on: https://gerrit.libreoffice.org/85646 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-12-20add checks to optional fields in SvXMLImportContextNoel Grandin
so when I convert ImportContext to FastParser APIs I don't accidentally rely on data that is not there Change-Id: If4700c7902e11f98a57542943f6a198822689df8 Reviewed-on: https://gerrit.libreoffice.org/85622 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-12-13loplugin:expandablemethodsNoel Grandin
Change-Id: I333d91ea5ce78c82e9bb107f934614efc7bfb8f7 Reviewed-on: https://gerrit.libreoffice.org/85078 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-12-06tdf#121658 Add option to not hyphenate words in CAPSSamuel Mehrbrodt
* Add checkbox to pagraph dialog * Store property in paragraph model * Move docx import/export from grabbag to paragraph model * Add ODF import/export * Add ODF unit test * Add layout test Change-Id: Id4e7c5a0ad145c042f862995d227c31ae2aa0abd Reviewed-on: https://gerrit.libreoffice.org/83979 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2019-12-06xmloff: create XMLDrawExportOasis instances with an uno constructorMiklos Vajna
See tdf#74608 for motivation. Change-Id: Id8cad1ed02b5fee93184e17ebf80435c01aa3618 Reviewed-on: https://gerrit.libreoffice.org/84583 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-12-03remove some useless comment linesNoel Grandin
which merely announce that the next declaration is a class Change-Id: Ifdb1398bcd99816b13e0b3769b46d0562bfbc1dc Reviewed-on: https://gerrit.libreoffice.org/84229 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-11-29tdf#123206 Import/Export chart custom label textTamas Bunth
OOX import supports custom label texts in chart diagrams (produced by e.g. double clicking on a data label, and write custom text), but - since embedded objects are exported and imported to odf right after migration - it is not displayed in case of a Writer document. In order to make it work, we have to support custom label text in the odf structure. This commit only allows the import/export of pure text, it should be improved to store and load formatted string. A new XML token is added, which currently refers to an attribute of the chart:data-point tag. If we want to store formatted string, something more clever has to be done. Change-Id: I80c4a3a0dbcf59f1dc732d795fb716da318411cb Reviewed-on: https://gerrit.libreoffice.org/80156 Tested-by: Jenkins Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2019-11-28NFC tdf#120412 cleanup: use DFLT_ESC_* moreJustin Luth
and all of the comment references to 14400% are no longer accurate, so they were removed. Change-Id: Ic958cc240e4898e914958fc32d09e2bb9478f197 Reviewed-on: https://gerrit.libreoffice.org/83845 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org>
2019-11-26xmloff,sw: fix handling of invalid attribute with multiple ':'Michael Stahl
ooo53770-1.odt contains an invalid attribute style:style:use-optimal-row-height, which was round-tripped as an unknown attribute, triggering the assert in CheckValidName(). This reveals a confusing mess of SvXMLNamespaceMap::GetKeyByAttrName functions. The bCache flag for one of them was accidentally inverted in commit 78f0d15893c56d7368ddd7ded4e70f2a3bb9d2f4 "loplugin:constantparam in xmloff/" There are basically 2 use cases for this: * XML element and attribute names, which are XML QName and contain at most 1 ':' * XML attribute values, which are namespace-prefixed and may contain any number of ':' in the "local" part of the value Because caching is explicitly disabled for Calc formulas, just resolve the inconsistent bCache by always caching element and attribute names, and never caching attribute values, so we need just 1 flag. Change-Id: I363ea2229d0bf5c7199d61b0fee0d9f168911bfa Reviewed-on: https://gerrit.libreoffice.org/83619 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-11-26tdf#128985: ODP: Style text directions revert to RTL on save and re-openTamás Zolnai
First we need to check duplicate writing modes and then ignore the defult LR_TB writing mode. Change-Id: I166141abd6286fc48c095ef92751e420fb197b3e Reviewed-on: https://gerrit.libreoffice.org/83785 Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com> Tested-by: Tamás Zolnai <tamas.zolnai@collabora.com>
2019-11-26cppcheck: performing init in init list (sw/vcl/xmloff)Julien Nabet
Change-Id: I8e6c77847e1c2ec386c27c34b75160f4a44da2fe Reviewed-on: https://gerrit.libreoffice.org/83717 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-11-25Remove 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>
2019-11-22Extend loplugin:external to warn about classesStephan Bergmann
...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>