summaryrefslogtreecommitdiff
path: root/sw/source/filter/xml/xmlimp.cxx
AgeCommit message (Collapse)Author
2021-02-15loplugin:referencecasting in swNoel
Change-Id: Ie923fc8baaa26938378407f6e5f3c50b2cea7cca Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110815 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-02-11Remove unneeded breaksAndrea Gelmini
Extending this: https://gerrit.libreoffice.org/c/core/+/110512 Change-Id: I1066aac690fe297a557352266f3405ae29ed4593 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110522 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-02-05Make sanitiseMm100ToTwip simpler and more correctMike Kaganski
The result's absolute value is always smaller than n. Returning an uncorrected value taken from reversing multiplication and division order when intermediate value would overflow is better than arbitrary constant. Also further deduplicate Twips <-> 100th-mm conversion, and make sure they all are in a single header. Using conversion implementation that handles negatives correctly improves accuracy, as seen in unit tests; e.g. in testPictureEffectPreservation (the original doc had "dir" equal to "8100000", while we tested that it was "8076614" after roundtrip). Change-Id: Icd027af6238a9f45f916f53f8684506cc959e696 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110433 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-01-15tdf#138544 sw LoadUserSettings: default ConsiderTextWrapOnObjPosJustin Luth
This is the fifth and final patch in the series. When you start a new document, Writer compat setting "Consider wrapping style when positioning objects" is off. Now, when saving and reloading it with LoadUserSettings disabled, it is still the program default of "off", instead of "on". Change-Id: I3e3b4cb6c48dad35b258a898990d7fadfd3048db Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108549 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org>
2021-01-14tdf#138544 sw LoadUserSettings: default EmptyDbFieldHidesParaJustin Luth
This is the fourth patch in the series. When you start a new document, Writer compat setting "Hide paragraphs of database fields with an empty value" is on. Now, when saving and reloading it with LoadUserSettings disabled, it is still the program default of "on", instead of "off". This one was a bit different because it didn't initialize in the standard way. // for some properties we don't want to use the application // default if they're missing. So we watch for them in the loop // below, and set them if not found So I'm changing it to match the standard way, and adding the now familiar clause to cover the case when the LoadUserSettings is disabled. Change-Id: I979b01340000056567a4baa9ace27f9f9d15e9b4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108548 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org>
2021-01-13tdf#138544 sw LoadUserSettings: default SubtractFlysAnchoredAtFlysJustin Luth
This is the third patch in the series. When you start a new document, Writer compat setting "Tolerate white lines of PDF page backgrounds for compatibility with old documents" is off. Now, when saving and reloading it with LoadUserSettings disabled, it is still the program default of "off", instead of "on". Change-Id: I06869600f0d75c9d5457372d56e39750ff5b3dae Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108547 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org>
2021-01-12tdf#138544 sw LoadUserSettings: default DoNotJustifyLinesWithManualBreakJustin Luth
This is the second patch in the series. When you start a new document, Writer compat setting "Expand word space on lines with manual breaks in justified paragraphs" is on. Now, when saving and reloading it with LoadUserSettings disabled, it is still the program default of "on", instead of "off". So this one is slightly more dangerous because it will prevent setting old behaviours for MULTIPLE settings which are not listed in the UI. (Anything that trusts that ConsiderWrapOnObjPos to indicate a very old document.) The fact that we are explicitly not loading ConsiderWrapOnObjPos from the document should not imply that this document is an old one. At this far point away from StarOffice 8, it is probably safer to assume the document is new, not old. P.S. I'm pretty sure the reset of ExpandWordSpace was a complete error during a refactor. (At that point, it was the only item that defaulted to true.) The only scenario I can imagine is that at one point in time, ExpandWordSpace was not part of the SvtCompatibilityOptions, and so this would add it. But now it certainly is one of the options, and so this pointless pre-init is simply overwritten. Change-Id: Ibe160099839bcf40d5659f7d5246854c7c4fb5e8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108546 Tested-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-01-07tdf#138544 sw LoadUserSettings: default PrinterIndependentLayoutJustin Luth
I hope I understand this correctly. In Options - Load/Save - General, there is option "Load user-specific settings with the document" (default = true). Turning this off seems to simply mean, don't read the settings in Options - LibreOffice Writer - Compatibility from the document. The assumption I guess is that this would instead use system defaults. (Well, actually the user can "modify" these and "set as default".) Well, that wasn't quite true in a few cases, like this one. The general logic says "if the setting is not specified in the doc, set to some old behaviour". And that makes sense. Of course there is no setting in old documents - the concept didn't exist yet. But when we explicitly exclude these user-enforceable compat items, do we really want to force old behaviour instead of current behaviour? And if the user has actually modified these defaults, do we want to ignore the user's settings? I doubt it. So here is the first patch. When you start a new document, Writer compat setting "Use printer metrics for document formatting" is off. Now, when saving and reloading it with LoadUserSettings disabled, it is still the program default of "off", instead of "on". And if the user modifies it to always be on, it will still turn on - so no regression there. Change-Id: I13b236852da843ce72be16d79e2fdace1550523c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108545 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-12-29Missing last para style when inserting text from odt file tdf#138879Georgy Litvinov
Change-Id: Ief235e98f3de02350b6403a1ea8ecf6361571789 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108285 Tested-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-12-07loplugin:unusedmethodsNoel
Change-Id: Ib51fd610c5188fe95872d509f004ae88f38c5417 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107351 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-12-07convert SvXMLImport to fastparser, drop slowparser pathsNoel Grandin
Change-Id: I0f880a7680373043fecf083cdf4de8b0bb7041a2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103775 Tested-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-12-01OSL_FAIL.*exception -> TOOLS_WARN_EXCEPTIONNoel
Change-Id: I6800e23ead2767d245d5da71d2d40e0f8a6d7e1f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106859 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-11-22fastparser in SwXMLDocContext_ImplNoel Grandin
Change-Id: I21fa16d473660e06b73a75964f3317b13e2e05e2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106359 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-11-19fastparser in TokenContextNoel
Change-Id: I12c2af505d4bf19d94fb127cda2403f0b6618b07 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106159 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-11-02make SvXMLImport capable of mixing fast- and slow- contexts adhocNoel
so I can convert even *ImportContext subclasses in the middle of a context stack, and thus break the cyclic dependency nature of the writer import. and adjust the xmlimport loplugin for the new rules. As a consequence of the loplugin:xmlimport's checking, we remove a bunch of now unnecessary overrides of startFastElement. Change-Id: I97464522ede8ec5e345e928cdafa4b18364b1b80 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104730 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-10-20use tools::Long in swNoel
Change-Id: I44be72b3a9b14823ec37a3c799cffb4fb4d6e1de Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104527 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-10-10tdf#132289 missing styles when inserting file with listSerge Krot
Change-Id: I444997a6cc55cfe287f4c610f538f2f54803646c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104085 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2020-10-05sw: ODF import: convert the simplest sub-tables to rowspan tablesMichael Stahl
Before OOo 2.3, CWS swnewtable, Writer represented complex table structures as sub-tables, i.e. <table:table table:is-sub-table="true">. Try to convert these to the modern rowspan tables, which export to non-ODF formats much easier. There are some cases where the result is going to look different, or where further work is required to adapt other things in the document; leave these alone for now. Change-Id: I6a6c497089ef886826484d2d723bf57c72f95b14 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103773 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2020-10-02ODT import: copy direct para formatting for first para in insert modeMiklos Vajna
It was inconsistent that we copied the paragraph style, but not the direct paragraph formatting from the to-be-deleted first inserted node to the last-before-insertion node. Change-Id: Ie5161c6314d7c1a71599bfe4eeafd3398450bd77 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103864 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2020-09-30SwPaM::GetDoc can return a reference insteadCaolán McNamara
and remove discovered redundant null checks Change-Id: Iac8ad7821d9acfcc9550a96402c02ac248f16f2d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103672 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-09-24tdf#134782 sw: split AddParaSpacingToTableCells flag in 2Michael Stahl
commit 3cccdabf19a99fd3f657985c1822436d7679df2b "extend AddParaSpacingToTableCells with line spacing" changed how the ADD_PARA_SPACING_TO_TABLE_CELLS compat flag works, to improve interop with Word. This commit splits out the change as a separate new compat flag ADD_PARA_LINE_SPACING_TO_TABLE_CELLS ("AddParaLineSpacingToTableCells"), to preserve compatibility with ODT documents that were produced by LO < 6.4 (via SwXMLImport::SetConfigurationSettings()). New documents and WW8/RTF/DOCX import have both flags enabled. The combination false/true is invalid, and treated as equivalent to false/false. Change-Id: Ida20df8fe4a8192a714f91da95345f9726fd7d98 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103317 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2020-08-31tdf#104596 sw layout: wrap in header only if bLayoutInCellJustin Luth
This patch depends on tdf#77794's 7.1 commit 7cc353df4f0993228984fcda3efb2c9181dddafb. For more details about the issue in general, see the verbose comments in this bug's previous 7.1 commit e4635544b816d1ca27bd1ebba60f51444b0a898e. This patch is related to CompatibilityMode < 15. Unfortunately, the previous patch didn't work with older Word 2010 versions of the file, which _shouldn't_ wrap non-LayoutInCell table-anchored flies. Unfortunately, now that different behaviour is necessary for different Word compat levels, it no longer allows a nice way for Writer to handle this natively. So since it would be very unlikely for a user to create a document like this (since the necessary "keep inside text boundaries" is off by default in Writer, but is forced on by definition in Word 2013+), I'm removing the compatibility flag I added in 7.1, and its related unit test. [To do this natively would probably require enabling the IsFollowingTextFlow property by default in SW. That sounds very dangerous since this property is not restricted to IsInTable layout situations. This property has been around since at least LO 3.5.] Change-Id: I70da016cb68f515924ed6c17085bf73a9e1c5492 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100684 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-08-14rename xmlnmspe -> xmlnamespaceNoel Grandin
Change-Id: I8fdf9833dede6f4c9ba4bbb76b9ab9b6b419f155 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100722 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-07-17tdf#104596 sw COMPAT layout: wrap in header for in-table fliesJustin Luth
You might have noticed that text in header/footers will not wrap around fly frames, but just run underneath, regardless of the wrap settings. Strange, eh? [This is also true in footnotes.] In an ancient effort to be compatible with MS strangeness, OOo decided to do this as well for interoperability reasons. http://openoffice.org/specs/writer/compatibility/adjust-text-wrapping.sxw Apparently, flies in tables are exempt from that rule in MSO, so this patch adds that exemption. TABLE EXEMPTION IS AN EXPERIMENTAL ASSUMPTION BASED ON VISUAL OBSERVATION FROM THIS BUG REPORT. IT IS NOT BASED ON DOCUMENTATION. I did look in DOC and DOCX manuals, and did a google search, but found nothing. A compat variable keeps older ODT files no-wrap, so that we don't break layout of existing documents. This variable is only read in the ODT import filter. If it doesn't exist for ODT, it is set to false. By default it is true, so it automatically is enabled for anything that doesn't modify it in its import filter, including all DOC/DOCX/RTF etc, and newly created ODT documents. In other words, allowing wrapping in the header for table-anchors is the new default behaviour unless an import filter turns it off. Headers/footers are the most common example. I also tested with footnotes, and found that Word 2016 does wrap in that case as well, even though the UI only allows AS_CHAR anchoring. FYI: Allowing wrapping at ALL times can be set with the Writer compatibility option "Use OpenOffice.org 1.1 text wrapping around objects". Change-Id: I9ad0c82df4af794079cce86fad9e401ea4575e59 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92378 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org>
2020-07-02Upcoming improved loplugin:staticanonymous -> redundantstatic: swStephan Bergmann
Change-Id: Id4e6e18b1fce848972e67ca519cbf23eab7cd109 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97701 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-04-30Revert "Convert TokenContext to fastparser APIs"Noel Grandin
This reverts commit b7bfe6ae08f5b214f2d03d70a40b66c894c0b659. Reason for revert: I missed some call-sites which means this is not going to work properly, which also means we don't have any tests for this functionality :-( Change-Id: Ie340a5e2331609258e79176c3dd12249ad46ba7b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93134 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-04-29Convert TokenContext to fastparser APIsNoel Grandin
Change-Id: Ib40e2f3d37c52b03f2ecbd67aaeed9605e644fea Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93163 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-02-26new loplugin:xmlimportNoel Grandin
to help me maintain the invariants when updating code to use the FastParser APIs. One weird invariant is that you need to override startFastElement or the createFastChildContext will not get called. Not all of these changes are probably necessary - some of the classes are never constructured themselves, only their subclasses are constructed, and their subclasses maintain the invariants, but it is just easier to scatter a few more startFastElement around Change-Id: I3f70fb5a1e44c311cf4926fa7b0fcda605709eac Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89473 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-02-15convert XML_STYLE_FAMILY to scoped enumNoel Grandin
Change-Id: I5335b0190a2f5a8111993c0c9c224c8a6a8f0cfb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88723 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-02-02tdf#129568 Rename Default Style to Default Paragraph/Page/Table Styleayhanyalcinsoy
Change-Id: I21672c9b78e52c3c9b2687cb2c0ab21dcf67f19a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86538 Tested-by: Jenkins Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org> Tested-by: Heiko Tietze <heiko.tietze@documentfoundation.org> Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com>
2020-01-22use fastparser in SwXMLBodyContext_ImplNoel Grandin
Change-Id: I0745fb6eb0a46b1c564cd0f1c596aed5206549b1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87181 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
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-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 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 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-15use more FastParser in SwXMLImportNoel Grandin
Change-Id: I27207e1ac00d783296deb9b0309b7b62cb5a15eb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86837 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-09Improve loplugin:redundantcast for sal_Int... vs. ::sal_Int...Stephan Bergmann
Change-Id: I1548a76fdc03afee68f1e5c01bc665e616f2edf2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86501 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
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>
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-20tdf#42949 Fix IWYU warnings in sw/source/filter/*/*cxxGabor Kelemen
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I87263017cb0802c9f5ca21d630bf3701b9c5e73a Reviewed-on: https://gerrit.libreoffice.org/85167 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.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>
2019-11-20Use initializer list for unordered_set hereMichael Weghorn
Change-Id: I9099308834d7bf463bd92c07edc86b8e0aa1fe84 Reviewed-on: https://gerrit.libreoffice.org/82785 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2019-11-20Load "PrintTextPlaceholder" and "PrintHiddenText" based on configMichael Weghorn
While looking at tdf#118263, I realized that the "PrintTextPlaceholder" and "PrintHiddenText" attributes are unconditionally taken from the settings.xml when opening a document. All of the other options related to what content to print in "File" -> "Printer Settings" -> "Options" are (not) taken from the document based on whether the "Load user-specific settings with the document" option is enabled or not (in "Tools" -> "Options" -> "Load/Save" -> "General"). I didn't find a reason why those two should be handled differently, so also add them to the list of options not to load from the document if the above option is disabled. Change-Id: Id7e4810c10f4809650eab1f20a2caaf6881bf23d Reviewed-on: https://gerrit.libreoffice.org/82784 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2019-11-17Extend loplugin:external to warn about enumsStephan Bergmann
To mitigate the dangers of silently breaking ADL when moving enums into unnamed namespaces (see the commit message of 206b5b2661be37efdff3c6aedb6f248c4636be79 "New loplugin:external"), note all functions that are affected. (The plan is to extend loplugin:external further to also warn about classes and class templates, and the code to identify affected functions already takes that into account, so some parts of that code are not actually relevant for enums.) But it appears that none of the functions that are actually affected by the changes in this commit relied on being found through ADL, so no adaptions were necessary for them. (clang::DeclContext::collectAllContexts is non-const, which recursively means that External's Visit... functions must take non-const Decl*. Which required compilerplugins/clang/sharedvisitor/analyzer.cxx to be generalized to support such Visit... functions with non-const Decl* parameters.) Change-Id: Ia215291402bf850d43defdab3cff4db5b270d1bd Reviewed-on: https://gerrit.libreoffice.org/83001 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-10-20loplugin:virtualdead unused param in RedlineAdjustStartNodeCursorNoel Grandin
Change-Id: Ic8eaad705b0cf8289035f7eee3ad01439fc24ee7 Reviewed-on: https://gerrit.libreoffice.org/81155 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-09-23tdf#39593 use getUnoTunnelImplementationArkadiy Illarionov
Change-Id: I78eb67913a568c610e38e5002f914773c4906dfd Reviewed-on: https://gerrit.libreoffice.org/79350 Tested-by: Jenkins Reviewed-by: Arkadiy Illarionov <qarkai@gmail.com>
2019-08-23tdf#39593 extract UnoTunnelId comparison to template functionArkadiy Illarionov
Change-Id: Ia2b5dea273c8de7b8c54e74780193a8d4cba7b45 Reviewed-on: https://gerrit.libreoffice.org/73874 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-08-15loplugin:sequenceloop in swNoel Grandin
Change-Id: Icda7c89b396e5607ca847c0a8393cb27a2d50c6c Reviewed-on: https://gerrit.libreoffice.org/77530 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-08-12Fix typosAndrea Gelmini
"its" Change-Id: I02c660e46964270376a66210fdb5f1b1985ce5b6 Reviewed-on: https://gerrit.libreoffice.org/77255 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-08-03Fix typosAndrea Gelmini
Change-Id: Ia6a6d93bade801fab77bfba701b64a905328c695 Reviewed-on: https://gerrit.libreoffice.org/76774 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>