summaryrefslogtreecommitdiff
path: root/oox
AgeCommit message (Collapse)Author
2020-01-14loplugin:finalclasses in ooxNoel Grandin
Change-Id: I5d69ed1ba551a51b3a8124d5b9f0e565023e7404 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86743 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-14tdf#128304 export TB_RL writing mode as eaVirtMark Hung
and import eaVirt to TextWritingMode instead of TextPreRotateAngle (-90) degree of CustomShapeGeometry. CJK text in TB_RL writing mode are upright in Writer. It corresponds to eaVirt by its defintion. Change-Id: I2a8bc6676ad6af06b06e023adaa2f201a028d426 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86637 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-01-14tdf#129516 DOCX import: fix incorrect z-order with textboxesMiklos Vajna
Commit 3272c1eb5563f3bda2caa24f32b1018372622109 (related tdf#100074: prepare group shapes text input via writerfilter, 2018-10-01) tweaked the oox code, so that later it'll be able to call back to writerfilter to parse group shape text. That makes sense, but it also removed the reset of the group shape context, which means that two subsequent group shapes are now imported as a single group shape with a merged child list. Reset the group shape context again when writerfilter asks for the XShape from oox. If this causes a problem for the above scenario later, then it could be considered to handle this in ShapeContextHandler::endFastElement(). Change-Id: I14f7f0bab2c66c8430313d5b2daffe3160a58c27 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86712 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-01-13cid#1457613 Unchecked return valueCaolán McNamara
Change-Id: I327f735a25fd3d33d571523a8c120b786d9c36ea Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86658 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-01-13tdf#88205 Adapt uses of css::uno::Sequence to use initializer_list ctorMesut Çifci
Change-Id: I1c1e7b42211c51f572698efd3135e388f8fb2979 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86648 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-01-13cid#1457617 Unchecked return valueCaolán McNamara
Change-Id: I2ca1d1718b725b8a940d6500fcdc4aad21489524 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86659 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-01-12cid#1457617 Unchecked return valueCaolán McNamara
Change-Id: Iff33ff608256ac9d6d8037e512f5669448909e18 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86625 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-01-12cid#1457613 silence Unchecked return valueCaolán McNamara
Change-Id: I034031dba1a67347c59ce7f17e96c795990dd39e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86624 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-01-10tdf#129857 Chart OOXML export: fix deleted legend entriesTünde Tóth
The legend showed deleted legend entries too after export. Change-Id: I872654d6e4d3f385c468b7fde03d39e233692fa1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86161 Reviewed-by: László Németh <nemeth@numbertext.org> Tested-by: László Németh <nemeth@numbertext.org>
2020-01-10tdf#129859 XLSX import: don't show deleted legend entriesTünde Tóth
by adding a new feature to disable selected data points in pie charts. Fixing also tdf#129858 by deleting the correct legend entry in bar charts. Change-Id: Iaaf3a864e9404b8b6d3e2affbb366e18d0f4b43e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86160 Reviewed-by: László Németh <nemeth@numbertext.org> Tested-by: László Németh <nemeth@numbertext.org>
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-10oox: add missing nullptr checksXisco Fauli
See http://crashreport.libreoffice.org/stats/signature/oox::drawingml::chart::PlotAreaConverter::convertFromModel(oox::drawingml::chart::View3DModel%20&) Regression from 11473832b5717cb3222ce72baee885bc9e8e2386 Change-Id: I6cf08582fb384203ca1ce5736b88b85c11ff56da Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86483 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-01-08Remove some unused includesMiklos Vajna
Change-Id: Icc451b72fd0b4181a082f2ee2b85b82765bd0c31 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86385 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-01-07Fix typoAndrea Gelmini
Change-Id: If2db5c423c10b4de1c03de1c1b98bb8f6d8a0a53 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86339 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2020-01-07tdf#107604 Handle predefined table styles.Gülşah Köse
Handle table styles that we have just style-id and have not corresponding style defination in tableStyle.xml Change-Id: Id06f5508d5eb1330b5bac1634c520c3066c09139 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86068 Tested-by: Jenkins Reviewed-by: Andras Timar <andras.timar@collabora.com>
2020-01-06tdf#129708 speed-up: check if we could create outline instead of creation of itSerge Krot
Change-Id: I0629b4e6ccae4ab9be0142fe39c627f2f9a8f5ea Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86199 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2020-01-06Removed redundant semicolonsAndrea Gelmini
Change-Id: Ife14b8c3f7d121deb390deb5f405dd42d3016acf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86156 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-01-01tdf#125444 Percentage as custom chart labelTamas Bunth
Support importing ooxml charts with a field of type "PERCENTAGE" as custom label. Change-Id: Ie8931f77e3b6199d98635422d11d776e675f6e5c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86067 Tested-by: Jenkins Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2019-12-29Typo: rParagraphDefaulsVector-> rParagraphDefaultsVectorJulien Nabet
Change-Id: Ia7c87cfe3028b8fb50f6157b7f43823df976be61 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/85949 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-12-28Revert "tdf#46037: remove configurationhelper in oox/vbaproject"Julien Nabet
This reverts commit 276a90c6b3fb046df13ae85dcdec5f28f23ee527. Reason for revert: as requested here https://gerrit.libreoffice.org/c/core/+/85759 Change-Id: Ib6a1cedf758deadff4e8949e8ecf35d25565dcc7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/85927 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2019-12-26No need to pass string literals as char* hereMike Kaganski
The point is creating OUString from ASCII anyway Change-Id: I9b1e96c41bc13d924bd6194812a7230e2dd6ab78 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/85830 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-12-23Fix typoAndrea Gelmini
Change-Id: I3482df53126f94f8ffd9a37f7fc2a2ce0ab45ed3 Reviewed-on: https://gerrit.libreoffice.org/85739 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-12-23tdf#46037: remove configurationhelper in oox/vbaprojectJulien Nabet
Change-Id: I431216749e70f531a26432cb25909ff3c7fb3de5 Reviewed-on: https://gerrit.libreoffice.org/85715 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-12-20CppunitTest_oox_drawingml: remove unneeded includesMiklos Vajna
Change-Id: I33c524a3991fc3de226ebee3cc98ced18fb74886 Reviewed-on: https://gerrit.libreoffice.org/85547 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-12-19sal_Char->char in oox..registryNoel Grandin
Change-Id: Icc7f2a32696c30317c1ee77ef39d682d5f5a80b9 Reviewed-on: https://gerrit.libreoffice.org/85512 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-12-17tdf#129143 FILESAVE: PPTX: bullets have a black border after RTNoel Grandin
Revert "no need to use AlphaMask in DrawingML::WriteParagraphNumbering" This reverts commit 126818d293982e578dfb4d977ee0ea64a1cff0de. Change-Id: I7326e7dbf2f00629ca5d08cff680e68c679f321a Reviewed-on: https://gerrit.libreoffice.org/85258 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-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-12Remove some redundant user-provided dtorsStephan Bergmann
...which silences various -Wdeprecated-copy-dtor warnings from Clang 10 trunk about copy functions being implicitly defined as non-deleted even though the class has a user-declared dtor Change-Id: I3409d403c3c709de4ad94eccbc2d7869e41847cc Reviewed-on: https://gerrit.libreoffice.org/85032 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-12-12tdf#121991 Chart OOXML import: fix deleted legend entriesTünde Tóth
The legend showed deleted legend entries too. Change-Id: I1e205cdfc4262c73d2bb189237d6bc316781931d Reviewed-on: https://gerrit.libreoffice.org/84516 Reviewed-by: László Németh <nemeth@numbertext.org> Tested-by: László Németh <nemeth@numbertext.org>
2019-12-06tdf#127237 fix table background color in Impress importnd101
When the background color is set at the table level in PPTX, instead of at cell level, the background color fails to show up in Impress. Change-Id: I2838e5b56e4a2414494ee99c0f8975b7256ac6dc Reviewed-on: https://gerrit.libreoffice.org/78377 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-12-03Simplify a bit use of LabelPlacementParam (oox/chartexport)Julien Nabet
Change-Id: I940be544577d8955959d4b8c89feaa08f99e544a Reviewed-on: https://gerrit.libreoffice.org/84272 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-12-03tdf#128429 VML import: let mso-layout-flow-alt:bottom-to-top imply verticalMiklos Vajna
Normally layout flow is set to vertical to denote TBRL, and then optionally there is a layout flow alt to denote BTLR, but the bugdoc shows that the first may be missing. So map to BTLR even in case only the alt layout flow is found in the file. Change-Id: I06fce738fca9aedc0de90ccebda3a24e99425326 Reviewed-on: https://gerrit.libreoffice.org/84275 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-12-01Introduce o3tl::optional as an alias for std::optionalStephan Bergmann
...with a boost::optional fallback for Xcode < 10 (as std::optional is only available starting with Xcode 10 according to <https://en.cppreference.com/w/cpp/compiler_support>, and our baseline for iOS and macOS is still Xcode 9.3 according to README.md). And mechanically rewrite all code to use o3tl::optional instead of boost::optional. One immediate benefit is that disabling -Wmaybe-uninitialized for GCC as per fed7c3deb3f4ec81f78967c2d7f3c4554398cb9d "Slience bogus -Werror=maybe-uninitialized" should no longer be necessary (and whose check happened to no longer trigger for GCC 10 trunk, even though that compiler would still emit bogus -Wmaybe-uninitialized for uses of boost::optional under --enable-optimized, which made me ponder whether this switch from boost::optional to std::optional would be a useful thing to do; I keep that configure.ac check for now, though, and will only remove it in a follow up commit). Another longer-term benefit is that the code is now already in good shape for an eventual switch to std::optional (a switch we would have done anyway once we no longer need to support Xcode < 10). Only desktop/qa/desktop_lib/test_desktop_lib.cxx heavily uses boost::property_tree::ptree::get_child_optional returning boost::optional, so let it keep using boost::optional for now. After a number of preceding commits have paved the way for this change, this commit is completely mechanical, done with > git ls-files -z | grep -vz -e '^bin/find-unneeded-includes$' -e '^configure.ac$' -e '^desktop/qa/desktop_lib/test_desktop_lib.cxx$' -e '^dictionaries$' -e '^external/' -e '^helpcontent2$' -e '^include/IwyuFilter_include.yaml$' -e '^sc/IwyuFilter_sc.yaml$' -e '^solenv/gdb/boost/optional.py$' -e '^solenv/vs/LibreOffice.natvis$' -e '^translations$' -e '\.svg$' | xargs -0 sed -i -E -e 's|\<boost(/optional)?/optional\.hpp\>|o3tl/optional.hxx|g' -e 's/\<boost(\s*)::(\s*)(make_)?optional\>/o3tl\1::\2\3optional/g' -e 's/\<boost(\s*)::(\s*)none\>/o3tl\1::\2nullopt/g' (before committing include/o3tl/optional.hxx, and relying on some GNU features). It excludes some files where mention of boost::optional et al should apparently not be changed (and the sub-repo directory stubs). It turned out that all uses of boost::none across the code base were in combination with boost::optional, so had all to be rewritten as o3tl::nullopt. Change-Id: Ibfd9f4b3d5a8aee6e6eed310b988c4e5ffd8b11b Reviewed-on: https://gerrit.libreoffice.org/84128 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-11-30Rewrite uses of boost::optionalStephan Bergmann
...to only use functions that are also available for std::optional (in preparation for changing from boost::optional to std::optional): * uses of get are replaced with operator * or operator -> * uses of is_initialized are replaced with operator bool * uses of reset with an argument are replace with operator = (All of the replacements are also available for boost::optional "since forever", so this change should not break builds against old --with-system-boost. An alternative replacement for is_initialized would have been has_value, but that is only available since Boost 1.68.) Change-Id: I532687b6a5ee37dab28befb8e0eb05c22cbecf0f Reviewed-on: https://gerrit.libreoffice.org/84124 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-11-30Assign bool directly to boost::optional<bool>Stephan Bergmann
...instead of going via boost::optional<sal_Bool>. (In preparation of replacing boost::optional with std::optional, which doesn't support implicit conversion from std::optional<sal_Bool> to std::optional<bool>.) Change-Id: I5dd74dd1c6346c99bd3e2a9b1156c9fce56db77c Reviewed-on: https://gerrit.libreoffice.org/84116 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-11-28tdf#113198 set default shape paragraph alignment..Tamas Bunth
to center when importing oox document. Using MS Office, the default aligment of a (text) paragraph inside a shape is centered. Change-Id: Id9bcaaab109df65f4124f733b2cfee438e82b79b Reviewed-on: https://gerrit.libreoffice.org/83193 Tested-by: Jenkins Reviewed-by: Tamás Bunth <btomi96@gmail.com>
2019-11-27tdf#127090 Export textbox rotation attribute.Gülşah Köse
In case "rotated textbox in a custom shape" handle draw:text-rotate-angle attribute while exporting ODP to PPTX. Change-Id: I13b99da586af5e77e51a7cc93a751ab21bed7170 Reviewed-on: https://gerrit.libreoffice.org/83888 Tested-by: Jenkins Reviewed-by: Gülşah Köse <gulsah.kose@collabora.com>
2019-11-26Remove some unused includesMiklos Vajna
Change-Id: Ia24c806f227570f7a000e85eece75c9d02d25a4b Reviewed-on: https://gerrit.libreoffice.org/83782 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2019-11-26nipick followup: add TOOLS_WARN_EXCEPTION to empty try-catchJustin Luth
followup for tdf#128153 docx/VML: apply style properties to shape text Change-Id: I2e1a057cfacb610d294ed106879af89482637a3a Reviewed-on: https://gerrit.libreoffice.org/83721 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-11-25tdf#118776: pptx import: draw char noFill as transparentXisco Fauli
The problem is that LibreOffice doesn't have the property fill=none for text Change-Id: I0c7c62be102e05729f0b2cf09d95e208694b1d2b Reviewed-on: https://gerrit.libreoffice.org/80743 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-11-24cppcheck: performing init in init list (oox, package, sal, sax)Julien Nabet
Change-Id: I77e28f02516ab25ff6680970dc13d52cfa90eac1 Reviewed-on: https://gerrit.libreoffice.org/83620 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-11-22tdf#128952 Set the position of shape for 180 deg.Gülşah Köse
If the rotation value is 180, 540, 900... degree with mirror pShape->GetRotateAngle() returns 0. In that control 0 means no rotation but that is not true. For that cases (180, 540, 900) after the angle conversition GetRotateAngle() returns 0. We should recalculate the position for 0 too. Change-Id: I14e981235b2d6cd8382d4c9e151bccd2e73a3fd9 Reviewed-on: https://gerrit.libreoffice.org/83468 Tested-by: Jenkins Reviewed-by: Gülşah Köse <gulsah.kose@collabora.com>
2019-11-22make some classes module-privateNoel Grandin
Change-Id: If7303a082e06f6937fca911c578a40475546cda2 Reviewed-on: https://gerrit.libreoffice.org/83442 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
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-22tdf#128153 docx/VML: apply style properties to shape textJustin Luth
This replaces LO 4.3 commit 8766011bccfd0f12f8dd77d2f94eb16e2e8c3471 DOCX import: set document-level font size default based on default para style ...and is needed for tdf#118947, since bogus DEFAULT_VALUEs really hinder determining what a table style should override. Shape text should inherit the font size from the style that is specified. In many cases, it will not be specified, and therefore the default style was appropriate, but in cases where a style IS specified, then of course use that fontsize ... and every other character and paragraph property. HOWEVER, I only added the properties used in vml import for now, and I skipped asian/complex fontnames since VML only handles CharHeight, and not CharHeightAsian/Complex. -note: this does not affect direct formatting - it just sets default value at the shape level, not at the paragraph level. So far I have only looked at DOCX:VML - which satisfies the unit tests. There are other codepaths that lead to PushShapeContext though, and this should be easy to expand to other import situations. I've tried lots of asserts to find unit tests that should be modified, and so far they all seemed to point to VML - although round-tripping doesn't use VML and still requires at minimum the CharHeight property to be overridden, so limiting non-VML to that to maintain backward compatibility, and reduce regression footprint. Since we have to emulate here (since paragraph styles are not supported on Draw text), a perfect solution cannot possibly be found - specifically in cases where multiple paragraphs exist in one shape with different styles applied, or where some pararaphs apply a paragraph property and others do not. Compromise 1: For ambiguous paragraph styles, fallback to the default paragraph style. Rationale: Normally, most styles inherit from default and only change a couple of properties. So MOST of the properties will match the normal style. The chances that the default style will be correct are more likely than that some other random default would be. -note: no existing unit tests were ambiguous Compromise 2: Ideally, each paragraph could report whether it had DIRECT formatting, and the paragraphs could be walked through instead of the shapes. But I don't think that is reasonably possible in this SyncProperties situation. At first I had a grabbag framework setup that monitored when a paragraph property was set, and then skipped applying that property. But I later noticed that the PropertyState for paragraph properties actually did seem to reflect that - which is a better solution if it works properly. Regression potential: -for VML: should be limited to non-charheight properties where the default style sets some weird default, and an ambiguous style sets it back to the program default. Prior to this patch, the default style value wouldn't apply. On the flip side (and more likely scenario), non-ambiguous cases will use the correct value and look more like MSWord, as seen in many existing unit tests that now use corrected fonts. -for non-VML: should be none since I limit it to only CharHeight which was previously emulated by changing the program default. Change-Id: I8f1fb7ed01f990dbf998ebe04064c2645a68e1aa Reviewed-on: https://gerrit.libreoffice.org/81365 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-11-21oox: add PPTX import/export for semi-transparent shape textMiklos Vajna
And start a drawingml test suite in oox, so the test and the tested code is close to each other (just like how it's done in chart2/ already). Change-Id: I9a2810691f12604d240e4394e6a5ff4e7f52f1c1 Reviewed-on: https://gerrit.libreoffice.org/83412 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2019-11-21tdf#123774 OOXML chart export: keep digits of percentages of data points Balazs Varga
by exporting PercentageNumberFormat, checking the "Label" format directly and taking the respective number format based on that. Note: also fix the "LinkNumberFormatToSource" property. If we create a pie chart with data labels and set the "Show value as number" or "Show value as percentage" and check on/off "Source format", this move is not set the property in the XPropertySet. Because of this, it fixes also the export of correct value of "link-data-style-to-source" property into ODS files. But this patch doesn't fix the export of old ODS files to OOXML, because they contain wrong (always true) "link-data-style-to-source" value. Change-Id: I4098a245dec5bf35cde20c9ccb79aca726230118 Reviewed-on: https://gerrit.libreoffice.org/82703 Reviewed-by: László Németh <nemeth@numbertext.org> Tested-by: László Németh <nemeth@numbertext.org>
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-11-16oox: avoid control freeze on exceptionVasily Melenchuk
If exception happens somewhere in exportDocument() or later, document controls could be remain locked and later cause crash due to missing exception handler. Use scope guard to avoid this problem on exception. (cherry picked from commit ce684e7d06fc37ac6b672f5676e6113fcf41a03e) Change-Id: I1ce4e487833ddc4b1f1b708f3a7e10bb299ef354 Reviewed-on: https://gerrit.libreoffice.org/80752 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2019-11-16tdf#128820: use wps namespace for simple text shapesMike Kaganski
Without that, simple text shapes inside groups were written in <pic:wsp> elements, with many child elements also having pic:: prefix. Change-Id: I114cf3499e03aa5ca042211d7b134aaf5b0e7fbf Reviewed-on: https://gerrit.libreoffice.org/82980 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>