summaryrefslogtreecommitdiff
path: root/sw/source/filter/xml/xmlimpit.cxx
AgeCommit message (Collapse)AuthorFilesLines
2024-01-27ITEM: Cleanup some Pool stuff with DefaultsArmin Le Grand (allotropia)1-1/+1
Sorted out some methods at ItemPool which process Defaults to make more clear what is going on and what which method is doing. Change-Id: I2568d3e03d0a56a14b6fe4e04521e1a8e22c000b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162643 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2023-12-20cid#1545835 COPY_INSTEAD_OF_MOVECaolán McNamara1-2/+2
and cid#1545830 COPY_INSTEAD_OF_MOVE cid#1545798 COPY_INSTEAD_OF_MOVE cid#1545784 COPY_INSTEAD_OF_MOVE cid#1545753 COPY_INSTEAD_OF_MOVE cid#1545752 COPY_INSTEAD_OF_MOVE cid#1545672 COPY_INSTEAD_OF_MOVE Change-Id: Iaf2f77cb27ae0ea1585416a0c500f7c50d04e3fb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161007 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-02-24tdf#78510 sw,cui: split SvxLRSpaceItem for SwTextNode, SwTextFormatCollMichael Stahl1-0/+8
Leave editengine and non-paragraph usages of SvxLRSpaceItem as-is for now. Add new items RES_MARGIN_LEFT etc., order them so that paragraphs can have 3 consecutive items RES_MARGIN_FIRSTLINE..RES_MARGIN_RIGHT and non-paragraphs also have 2-4 consecutive items RES_MARGIN_RIGHT..RES_MARGIN_LEFT (only the 3 paragraph ones are actually used now). The HTML import filter is particularly annoying because it parses CSS stuff into SfxItemSets without knowing where the items will be applied, so it can't know whether to create SvxLeftMarginItem or SvxTextLeftMarginItem... the split items are created in ParseCSS1_* functions and then converted later if necessary. WW8 import has some weird code as well, SwWW8ImplReader::Read_LR() creates 3 items and then something wants to set every item on its own so SwWW8FltControlStack::SetAttrInDoc() turned out rather weird. Convert the paragraph dialog to handle the split items (by mapping them to SID_ATTR_PARA_FIRSTLINESPACE/SID_ATTR_PARA_LEFTSPACE/ SID_ATTR_PARA_RIGHTSPACE), but the SvxRuler looks a bit more confusing so convert in sw shells for now and leave that for later (also unclear if changing these slot items like SID_ATTR_PARA_LRSPACE breaks any ABIs?). Change-Id: I40431821868fd3e1cceba121b5539ff9ae6befbc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147024 Tested-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2022-09-14tdf#149551 use 'WritingMode' instead of TextPreRotateAngleRegina Henschel1-0/+7
Commit 7e23cbdbb6ec0247a29ed8a8f744c01e10963ea0 changed the code so, that TextPreRotateAngle is used to track ooxml vert attribute. This patch changes it so, that the style attribute WritingMode is used. Now text direction can be written in 'writing-mode' attribute in the graphic properties in ODF, same for shapes as for frames. The needed conversion from WritingMode BT-LR and TB_LR90 to TextPreRotateAngle for rendering of text in custom shapes is now in one place in class SdrObjectCustomshape. The shape edit engine cannot yet render it itself. Some unit tests are adapted to use WritingMode property instead of TextPreRotateAngle. The value text::WritingMode2::TB_RL90 is introduced, corresponding to vert='vert' and textDirection='tbRl' or ='rl' in OOXML. It is used for frames too, so that the original text direction is preserved and vert='eaVert' can be distinguished from vert='vert'. TextPreRotateAngle is currently still used in SmartArt import for 'upr' and 'grav' and in emulating 'upright' but no longer to emulate text direction. Change-Id: Idc4339bbfc3592fe90b154d75e2c404a1fa30856 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138813 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-08-12clang-tidy modernize-pass-by-value in swNoel Grandin1-2/+2
Change-Id: I9a3b33595e34a264baeede33672a0c090ae85157 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138134 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-06-02std::move SfxPoolItem into SfxItemSet where possibleNoel Grandin1-1/+1
found with the help of a temporary loplugin (which i have put into the store/ folder) Change-Id: Ide40d09bef6993ace50039a8fd0439b7e29c09a6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135288 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-05-27tdf#60382 sw xmloff: import/export tracked table/row deletionLászló Németh1-0/+17
to OpenDocument format using <style:table-row-properties loext:text-changes-only="false"/> Rename also com::sun::star::text::TextTableRow::IsNotTracked to com::sun::star::text::TextTableRow::HasTextChangesOnly. Follow-up to commit 05366b8e6683363688de8708a3d88cf144c7a2bf "tdf#60382 sw offapi: add change tracking of table/row deletion". Change-Id: Iefb0d4095af0983fdd15697d5b80073d18d21bd7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116212 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
2021-05-21sw: replace most static_cast<sal_uInt16>() calls with o3tl::narrowing()Miklos Vajna1-14/+14
o3tl::narrowing() is a better way to handle this, as that way the integer conversion is still implicit, which allows detecting integer truncation at runtime (with suitable compiler flags). Change-Id: I499abda3be6943e8c111c56df390e72939586221 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115948 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-01-16make the Color constructors explicitly specify transparencyNoel1-3/+2
to reduce the churn, we leave the existing constructor in place, and add a clang plugin to detect when the value passed to the existing constructor may contain transparency/alpha data. i.e. we leave expressions like Color(0xffffff) alone, but warn about any non-constant expression, and any expression like Color(0xff000000) Change-Id: Id2ce58e08882d9b7bd0b9f88eca97359dcdbcc8c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109362 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-01-12transparency->alpha in tools::ColorNoel1-2/+2
this just changes the Get/Set methods, the constructor and internal representation of Color is not changed. Change-Id: Idb6e07cc08bbaa5bd55b6bd4b585e648aef507b6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109074 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-12-21use std::u16string_view in SvXMLTokenEnumeratorNoel1-5/+5
Change-Id: I1194441063047637adc20c8e37bb717fdb787714 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108073 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-09-30loplugin:reducevarscope in swNoel1-1/+1
Change-Id: Ifed7220c6acf7049b2985f1911a806b37a54d794 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103646 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-09-26Fix typoAndrea Gelmini1-1/+1
Change-Id: I508a3ce14e8f02bd51055cc22ff29f44c522b7ec Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103467 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2020-09-10crashtesting ooo97840-2.odt assert in SvXMLAttrCollection::AddAttrNoel Grandin1-2/+5
because of empty namespace and prefix Change-Id: I5710e15c38fa5d22ca2dc7c875c2d9b1076fa93d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102365 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-09-08fix crashtest ooo53770-1.odtNoel Grandin1-2/+7
Change-Id: I0a3a63e8c4146c2f8a9ac6593774e6e4d9f5b8ba Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102201 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-09-03Fix crashtest fdo77855.odtNoel Grandin1-1/+9
regression from commit commit 9814c1f2edf56ecc0f31001db9234ef335488879 use fastparser in SvXMLPropertySetContext subclasses and add some asserts to find the problems earlier. Change-Id: Ief64f813f2ef7ec005f682713dadb1be47cbcd15 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101998 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-08-27use fastparser in CreateTableItemImportContextNoel Grandin1-20/+72
Change-Id: I172274089ef4cf669102cea020ee3135e86ef6ff Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101390 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-08-26remove always true conditonNoel Grandin1-2/+2
Change-Id: Ifc75e7361f67b716fcfc3ed8e55fbb4b2e126ae5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101421 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-08-14rename nmspmap.hxx -> namespacemap.hxxNoel Grandin1-1/+1
we're not in DOS anymore, Dorothy Change-Id: I79926e0d694163940ba7ebf20419724dd0a486f5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100721 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-07-02Upcoming improved loplugin:staticanonymous -> redundantstatic: swStephan Bergmann1-1/+1
Change-Id: Id4e6e18b1fce848972e67ca519cbf23eab7cd109 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97701 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-02-04rename Set/GetTextFirstLineOfst->Set/GetTextFirstLineOffsetNoel Grandin1-1/+1
Change-Id: Iaeb3c17fe157dec82cd70991122c08ee1e215752 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87955 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-12-20tdf#42949 Fix IWYU warnings in sw/source/filter/*/*cxxGabor Kelemen1-4/+0
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-12-11convert SwFrameSize to scoped enumNoel Grandin1-5/+5
Change-Id: I7e1e641ff180035c7dcefdcfdd185eadbae32142 Reviewed-on: https://gerrit.libreoffice.org/84850 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-11-26xmloff,sw: fix handling of invalid attribute with multiple ':'Michael Stahl1-1/+1
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-22Extend loplugin:external to warn about classesStephan Bergmann1-0/+4
...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-10-18loplugin:virtualdead unused param in SvXMLImportItemMapper::handleSpecialItemNoel Grandin1-4/+2
Change-Id: Ie1a8fdafb64f6374ae9108dbb47592b044703cc9 Reviewed-on: https://gerrit.libreoffice.org/81008 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-02-13sw btlr writing mode: implement ODF filterMiklos Vajna1-8/+21
An easy way would be to just extend aXML_WritingDirection_Enum, but then we would write the new attribute value to a non-extension namespace. So special case the new attribute value during both import and export (and only for table cells as a start). Change-Id: I431bf99693c4a3452e91f241bd2f0fcfc72c68fd Reviewed-on: https://gerrit.libreoffice.org/67770 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2019-01-14use unique_ptr in XMLPropertyHandlerFactory::CreatePropertyHandlerNoel Grandin1-10/+5
Change-Id: Idb33e3a23b7e6001b2c549875a16b475d3ecd470 Reviewed-on: https://gerrit.libreoffice.org/66186 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-19Removed duplicated includesAndrea Gelmini1-1/+0
Change-Id: Idd6a5e84d93016f97745e6d9b99e4f79f7614ea7 Reviewed-on: https://gerrit.libreoffice.org/63554 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2018-11-19tdf#42949 Fix IWYU warnings in include/vcl/[ab]*Gabor Kelemen1-0/+1
Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: If18c80fc64e55d797953e24e40e5d5e62bd9c625 Reviewed-on: https://gerrit.libreoffice.org/63453 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2018-11-16entirity of writer rebuilding when vcl widget headers changeCaolán McNamara1-0/+1
which seems a bit excessive Change-Id: If0ab5a33bfbbd399e270f3e140c9d44d843985aa Reviewed-on: https://gerrit.libreoffice.org/63422 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-10-26use unique_ptr when Clone()'ing PoolItemsNoel Grandin1-12/+4
and fix a handful of small leaks in the process Change-Id: I876e12ff5305f9dda84532d4182fb91657d6fa0c Reviewed-on: https://gerrit.libreoffice.org/62389 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-06-22teach useuniqueptr loplugin about calling delete on a paramNoel Grandin1-24/+16
which is often a useful indicator that the callers can be made to use std::unique_ptr Change-Id: Idb1745d1f58dbcf389c9f60f1a5728d7d092ade5 Reviewed-on: https://gerrit.libreoffice.org/56238 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-03-07use more Color in swNoel Grandin1-3/+1
Change-Id: I51d575c40228bbd2ff384f12da33c1cd8bda2dda Reviewed-on: https://gerrit.libreoffice.org/50800 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-03-07Move BackGraphicURL property & friends to BackGraphic + fixesTomaž Vajngerl1-11/+0
This moves BackGraphicURL, HeaderGraphicURL, FooterGraphicURL and ParaBackGraphicURL properties to BackGraphic, HeaderBackGraphic, FooterBackGraphic and ParaBackGraphic. With this the property type changes from String to XGraphic. This change also fixes a bunch of test failures, changes the tests to use the new properties and the correct type, changes the import and export filters like xmloff and oox, to make the tests happy. Change-Id: Ie66097514203c6dc36ab27420faf265322e9279e Reviewed-on: https://gerrit.libreoffice.org/50760 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2018-02-20drop Color::SetColor(ColorData) in favour of operator=Noel Grandin1-1/+1
first stage of getting rid of ColorData Change-Id: I5e4e95eb958722814c43c8d1ebfef17ad18c29ec Reviewed-on: https://gerrit.libreoffice.org/49997 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-01-26USHRT_MAX -> SAL_MAX_UINT16Stephan Bergmann1-2/+2
The check against USHRT_MAX and the mismatching cast to sal_uInt16 in the following SetWidth call were like that ever since the code first shows up in 57941a2dfdb461a2444a0ab84076db8423c46ca7 "#86004# removed SfxPoolItem::importXML, exportXML, equalsXML". Change-Id: Icd63d5b66765fc2391898a9d47a228407b9d5744 Reviewed-on: https://gerrit.libreoffice.org/48631 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-01-12More loplugin:cstylecast: swStephan Bergmann1-14/+14
auto-rewrite with <https://gerrit.libreoffice.org/#/c/47798/> "Enable loplugin:cstylecast for some more cases" plus solenv/clang-format/reformat-formatted-files Change-Id: I0f49d21dfdf82742f11b27709f74294feb1e419e
2017-10-23loplugin:includeform: swStephan Bergmann1-6/+6
Change-Id: Ifc3c4c31a31ee7189eeab6f1af30b94d64f2f92a
2017-08-17remove UL/L suffixes from integer constants on the RHS of expressionsNoel Grandin1-1/+1
Change-Id: I899a8126c9d971601fea6c77eca165718aea0ac5 Reviewed-on: https://gerrit.libreoffice.org/41237 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-08-06loplugin:constparams in sw part6Noel Grandin1-1/+1
Change-Id: Ic82946cf9be50d9d9c43338b86dfb700ce5b354c Reviewed-on: https://gerrit.libreoffice.org/40786 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-21de-hrc various thingsCaolán McNamara1-1/+1
e.g. helpid[s].hrc -> helpids.h and insert include guards where missing move "ordinary" defines into .hxx files remove .hrc entries that are used as arguments to dialog factory when a dedicated method can be added instead Change-Id: I792fb8eb0adfaa63cf354e6e57401fc943e9196e
2017-06-05clang-tidy performance-unnecessary-value-paramNoel Grandin1-1/+2
Change-Id: I6ed8c54c7c45931d91709cc818f2483c70197192 Reviewed-on: https://gerrit.libreoffice.org/38400 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-04-06loplugin:singlevalfieldsNoel Grandin1-2/+3
Change-Id: Ia681765aa1da5c80a3dbe91b7376af841a9c9ec1 Reviewed-on: https://gerrit.libreoffice.org/36145 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-03-23loplugins:redundantcast teach it about c-style typedef castsNoel Grandin1-2/+2
Change-Id: I1ac11a2481c0f4d8be1e1fd7c7637ac0ece3d65c Reviewed-on: https://gerrit.libreoffice.org/35558 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-03-14sw: fix Android -Werror=maybe-uninitializedMiklos Vajna1-1/+1
Change-Id: Ia9e10c7f2243a964863f2315bc74872f988c00e4
2017-03-13templatize SvXMLEnumMapEntryNoel Grandin1-9/+9
in preparation for "scoped UNO enums". This is a little hacky: In order to limit the scope of this change, the templated SvXMLEnumMapEntry struct actually has a fixed size field, and we cast it to SvXMLEnumMapEntry<sal_uInt16>* in various places, to avoid carrying the type param around. Change-Id: Idfbc5561303c557598dd5564b7a7259ae5261d83 Reviewed-on: https://gerrit.libreoffice.org/34987 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-03-08convert SvxShadowLocation to scoped enumNoel Grandin1-6/+6
Change-Id: Ie51995579312328538263172cd3173641df89bca Reviewed-on: https://gerrit.libreoffice.org/34965 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-02-28tdf#77111 sw: add unit test, fix getting PageNumberOffset propertyMichael Stahl1-0/+3
There are 2 places where the style:page-number attribute is handled, in XMLNumberWithAutoInsteadZeroPropHdl (for paragraphs) and SvXMLExportItemMapper/SvXMLImportItemMapper (for tables) Apparently for the paragraph case, 0 was never written to mean "auto", this happened only for tables (see 7edaf190e2b18fe5dd9b7dd8d8e7e24b2ff26520). The test reveals that SwXParagraph::Impl::GetSinglePropertyValue_Impl() was kinda broken by 7d9bb549d498d6beed2c4050c402d09643febdfa, which converts void values of "short" properties to short(0), wrongly assuming that the Any contains a long. (Fortunately this is then mapped to "auto" in XMLNumberWithAutoInsteadZeroPropHdl.) Change-Id: I3dc6d5533ac96955440b1589f1999d06750101af
2017-02-27tdf#77111 odt import: treat PAGEDESC_PAGENUMOFFSET==0 as autoJustin Luth1-1/+1
Ever since 2010 commit 7edaf190 zeroes have been saved as XML_AUTO. Ever since 2014 commit c2ccd20c, a numoffset of zero is no longer considered to be auto (for MS compatibility) but is still treated as auto during xml export. Thus, any older documents that had been saved with a zero should still xml import as auto instead of as 0. Change-Id: I1a0df32a8e2f1b30b2bedbf4c9bb07ebec239637 Reviewed-on: https://gerrit.libreoffice.org/33267 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>