summaryrefslogtreecommitdiff
path: root/oox/source
AgeCommit message (Collapse)Author
2023-10-20Extended loplugin:ostr: Automatic rewrite O[U]StringLiteral: ooxStephan Bergmann
Change-Id: Ic5bcb44fbe56804e23bcdfd039a77c010858ca02 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158206 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-10-11tdf#51510 Blurry QR code after save/reload (docx)Darshan-upadhyay1110
- without GfxLinkType::NativeSvg CASE in writeToStorage method by default QR svg changes to low resolution image type and that is the why QR got blurry in doc or docx format - added svg option when we change from odt to doc or docx format Change-Id: I74aec0619992c1f455cc9cbf3c19e352c3037e04 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157264 Reviewed-by: Szymon Kłos <szymon.klos@collabora.com> Tested-by: Szymon Kłos <szymon.klos@collabora.com> (cherry picked from commit 1d7dc53f19d188ae12603ca3cd526eb0a5016cf4) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157729 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-10-11Delete OUString UTF-16 string literal ctor/assignment opStephan Bergmann
...that have been made unused by 7ef3d937415185ef66e32dd3043783eddcd03db5 "loplugin:ostr: Rewrite some uses of O[U]String to use ""_ostr/u""_ustr literals". (And which means we can remove the relevant code from that plugin again.) (This also found a handful of remaining uses that had been hard for the plugin to discover, along the lines of > std::map<OUString, int> m = {{u"foo", 0}}; being represented by a > DeclStmt 0xdaca578 <line:103:5, col:50> > `-VarDecl 0xdac9150 <col:5, col:49> col:29 s11 'std::map<OUString, int>':'std::map<rtl::OUString, int>' cinit destroyed > `-ExprWithCleanups 0xdaca548 <col:35, col:49> 'std::map<OUString, int>':'std::map<rtl::OUString, int>' > `-CXXConstructExpr 0xdaca508 <col:35, col:49> 'std::map<OUString, int>':'std::map<rtl::OUString, int>' 'void (initializer_list<value_type>, const std::less<rtl::OUString> &, const allocator_type &)' list std::initializer_list > |-CXXStdInitializerListExpr 0xdaca480 <col:35, col:49> 'initializer_list<value_type>':'std::initializer_list<std::pair<const rtl::OUString, int>>' > | `-MaterializeTemporaryExpr 0xdaca468 <col:35, col:49> 'const std::pair<const rtl::OUString, int>[1]' xvalue > | `-CXXBindTemporaryExpr 0xdaca448 <col:35, col:49> 'const std::pair<const rtl::OUString, int>[1]' (CXXTemporary 0xdaca448) > | `-InitListExpr 0xdac9df0 <col:35, col:49> 'const std::pair<const rtl::OUString, int>[1]' > | `-CXXConstructExpr 0xdaca408 <col:36, col:48> 'const std::pair<const rtl::OUString, int>' 'void (const char16_t (&)[4], int &&) noexcept(_S_nothrow_constructible<const char16_t (&)[4], int>())' list > | |-StringLiteral 0xdac91b8 <col:38> 'const char16_t[4]' lvalue u"foo" > | `-MaterializeTemporaryExpr 0xdaca3f0 <col:46> 'int' xvalue > | `-IntegerLiteral 0xdac91d8 <col:46> 'int' 0 > |-CXXDefaultArgExpr 0xdaca498 <<invalid sloc>> 'const std::less<rtl::OUString>':'const std::less<rtl::OUString>' lvalue > `-CXXDefaultArgExpr 0xdaca4b8 <<invalid sloc>> 'const allocator_type':'const std::allocator<std::pair<const rtl::OUString, int>>' lvalue Clang AST.) Change-Id: I496fe9d4d5e1a033cb7b27b4e04b303f8ddbed4a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157756 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-10-07tdf#156902 Do not set glow on group shape in importRegina Henschel
Currently a group is not able to use glow. But in MS Office it is possible. When we try to set glow at the group, we produce an exception and no children are imported. So for now the patch prevents setting glow. Change-Id: Ifa7245ebf3c38f8685239c2b62eefccd35aab870 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157679 Tested-by: Jenkins Reviewed-by: Regina Henschel <rb.henschel@t-online.de>
2023-10-07loplugin:ostr: automatic rewriteStephan Bergmann
Change-Id: I2d09b2b83e1b50493ec88d0b2c323a83c0c86395 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157647 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Jenkins
2023-10-04tdf#155512: oox: ppt: fix import master slidesHenry Castro
Import all master slides according to the relationship with slide layouts. Adjust unit test values: SdOOXMLExportTest2::testTdf106867 I do not know why those values change since importing embedded video source code was not touched SdOOXMLExportTest2::testAccentColor The accent6 is a constant value. Signed-off-by: Henry Castro <hcastro@collabora.com> Change-Id: Ic7c70d2c4ce30a7f2d2d1cf22604f1119a66f5f7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157387 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> (cherry picked from commit 08ed103d734ebf65202dc097c7bb0990573f8fd1) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157532 Tested-by: Jenkins
2023-10-04tdf#157289 normalize ellipse bounding box in oox exportRegina Henschel
The predefined geometry of a circular arrow shape has bottom-right vertex first and then top-left vertex of the bounding box of the ellipse. We now use the normalized rectangle to calculate the radii of the ellipse. Before this patch the calculation had resulted in negative radii. Because the ODF standard only states, '(x1, y1) and (x2, y2) define the bounding box of an ellipse.', but not which vertices to use, the fix is not made in changing the geometry of the circular arrow. Instead the export is changed to use the normalized rectangle. That is more general and will cover other shape types too. Especially non-primivite shapes might use other vertices than top-left and bottom-right to determine the ellipse. Change-Id: Ica859c9adc508a6517e30f111cd54518ec9929a9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157526 Tested-by: Jenkins Reviewed-by: Regina Henschel <rb.henschel@t-online.de>
2023-10-03tdf#155512: oox: ppt: abstraction "importMasterSlide"Henry Castro
Signed-off-by: Henry Castro <hcastro@collabora.com> Change-Id: Icfe8e3abbada7f728b2ad1f8e300a688f51d8f75 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157386 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> (cherry picked from commit 84ac58c37fffa0c8b6d55c70009515d013ad65b4) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157468 Tested-by: Jenkins
2023-09-25oox: remove returning sRelId and rename WriteImageTomaž Vajngerl
Rename WriteImage -> writeGraphicToStorage to make it more clear what the method does. Remove returning the rel ID string in some methods that write the graphic into the stream (or the call chain), as it is never used later on, so it is better to not return it if it is not used (it could be abused). Change-Id: I78558671b82aedb34bd0f37bf7781c47ebf1cf5c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157235 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-09-19oox: change frozen::make_set to "conventional" frozen::set constructionTomaž Vajngerl
Fixes compile issue with bisect repo started with commit: b839c09760919d4f4a21ed1819885b5385f27e31 (https://gerrit.libreoffice.org/c/core/+/157003) Log: /home/tdf/lode/bibisect/core242/oox/source/export/shapes.cxx:622:2: error: no matching function for call to ‘make_set<std::u16string_view>(<brace-enclosed initializer list>)’ }); ^ In file included from /home/tdf/lode/bibisect/core242/oox/source/export/shapes.cxx:90:0: /home/tdf/lode/bibisect/core242/workdir/UnpackedTarball/frozen/include/frozen/set.h:223:16: note: candidate: template<class T> constexpr auto frozen::make_set(frozen::bits::ignored_arg) constexpr auto make_set(bits::ignored_arg = {}/* for consistency with the initializer below for N = 0*/) { ^~~~~~~~ /home/tdf/lode/bibisect/core242/workdir/UnpackedTarball/frozen/include/frozen/set.h:223:16: note: template argument deduction/substitution failed: /home/tdf/lode/bibisect/core242/oox/source/export/shapes.cxx:622:2: note: cannot convert ‘{"b\000l\000o\000c\000k\000-\000a\000r\000c\000\000", "r\000e\000c\000t\000a\000n\000g\000l\000e\000\000", "e\000l\000l\000i\000p\000s\000e\000\000", "r\000i\000n\000g\000\000", "c\000a\000n\000\000", "c\000u\000b\000e\000\000", "p\000a\000p\000e\000r\000\000", "f\000r\000a\000m\000e\000\000", "f\000o\000r\000b\000i\000d\000d\000e\000n\000\000", "s\000m\000i\000l\000e\000y\000\000", "s\000u\000n\000\000", "f\000l\000o\000w\000e\000r\000\000", "b\000r\000a\000c\000k\000e\000t\000-\000p\000a\000i\000r\000\000", "b\000r\000a\000c\000e\000-\000p\000a\000i\000r\000\000", "q\000u\000a\000d\000-\000b\000e\000v\000e\000l\000\000", "r\000o\000u\000n\000d\000-\000r\000e\000c\000t\000a\000n\000g\000u\000l\000a\000r\000-\000c\000a\000l\000l\000o\000u\000t\000\000", "r\000e\000c\000t\000a\000n\000g\000u\000l\000a\000r\000-\000c\000a\000l\000l\000o\000u\000t\000\000", "r\000o\000u\000n\000d\000-\000c\000a\000l\000l\000o\000u\000t\000\000", "c\000l\000o\000u\000d\000-\000c\000a\000l\000l\000o\000u\000t\000\000", "l\000i\000n\000e\000-\000c\000a\000l\000l\000o\000u\000t\000-\0001\000\000", "l\000i\000n\000e\000-\000c\000a\000l\000l\000o\000u\000t\000-\0002\000\000", "l\000i\000n\000e\000-\000c\000a\000l\000l\000o\000u\000t\000-\0003\000\000", "p\000a\000p\000e\000r\000\000", "v\000e\000r\000t\000i\000c\000a\000l\000-\000s\000c\000r\000o\000l\000l\000\000", "h\000o\000r\000i\000z\000o\000n\000t\000a\000l\000-\000s\000c\000r\000o\000l\000l\000\000", "m\000s\000o\000-\000s\000p\000t\0003\0004\000\000", "m\000s\000o\000-\000s\000p\000t\0007\0005\000\000", "m\000s\000o\000-\000s\000p\000t\0001\0006\0004\000\000", "m\000s\000o\000-\000s\000p\000t\0001\0008\0000\000\000", "f\000l\000o\000w\000c\000h\000a\000r\000t\000-\000p\000r\000o\000c\000e\000s\000s\000\000", "f\000l\000o\000w\000c\000h\000a\000r\000t\000-\000a\000l\000t\000e\000r\000n\000a\000t\000e\000-\000p\000r\000o\000c\000e\000s\000s\000\000", "f\000l\000o\000w\000c\000h\000a\000r\000t\000-\000d\000e\000c\000i\000s\000i\000o\000n\000\000", "f\000l\000o\000w\000c\000h\000a\000r\000t\000-\000d\000a\000t\000a\000\000", "f\000l\000o\000w\000c\000h\000a\000r\000t\000-\000p\000r\000e\000d\000e\000f\000i\000n\000e\000d\000-\000p\000r\000o\000c\000e\000s\000s\000\000", "f\000l\000o\000w\000c\000h\000a\000r\000t\000-\000i\000n\000t\000e\000r\000n\000a\000l\000-\000s\000t\000o\000r\000a\000g\000e\000\000", "f\000l\000o\000w\000c\000h\000a\000r\000t\000-\000d\000o\000c\000u\000m\000e\000n\000t\000\000", "f\000l\000o\000w\000c\000h\000a\000r\000t\000-\000m\000u\000l\000t\000i\000d\000o\000c\000u\000m\000e\000n\000t\000\000", "f\000l\000o\000w\000c\000h\000a\000r\000t\000-\000t\000e\000r\000m\000i\000n\000a\000t\000o\000r\000\000", "f\000l\000o\000w\000c\000h\000a\000r\000t\000-\000p\000r\000e\000p\000a\000r\000a\000t\000i\000o\000n\000\000", "f\000l\000o\000w\000c\000h\000a\000r\000t\000-\000m\000a\000n\000u\000a\000l\000-\000i\000n\000p\000u\000t\000\000", "f\000l\000o\000w\000c\000h\000a\000r\000t\000-\000m\000a\000n\000u\000a\000l\000-\000o\000p\000e\000r\000a\000t\000i\000o\000n\000\000", "f\000l\000o\000w\000c\000h\000a\000r\000t\000-\000c\000o\000n\000n\000e\000c\000t\000o\000r\000\000", "f\000l\000o\000w\000c\000h\000a\000r\000t\000-\000o\000f\000f\000-\000p\000a\000g\000e\000-\000c\000o\000n\000n\000e\000c\000t\000o\000r\000\000", "f\000l\000o\000w\000c\000h\000a\000r\000t\000-\000c\000a\000r\000d\000\000", "f\000l\000o\000w\000c\000h\000a\000r\000t\000-\000p\000u\000n\000c\000h\000e\000d\000-\000t\000a\000p\000e\000\000", "f\000l\000o\000w\000c\000h\000a\000r\000t\000-\000s\000u\000m\000m\000i\000n\000g\000-\000j\000u\000n\000c\000t\000i\000o\000n\000\000", "f\000l\000o\000w\000c\000h\000a\000r\000t\000-\000o\000r\000\000", "f\000l\000o\000w\000c\000h\000a\000r\000t\000-\000c\000o\000l\000l\000a\000t\000e\000\000", "f\000l\000o\000w\000c\000h\000a\000r\000t\000-\000s\000o\000r\000t\000\000", "f\000l\000o\000w\000c\000h\000a\000r\000t\000-\000e\000x\000t\000r\000a\000c\000t\000\000", "f\000l\000o\000w\000c\000h\000a\000r\000t\000-\000m\000e\000r\000g\000e\000\000", "f\000l\000o\000w\000c\000h\000a\000r\000t\000-\000s\000t\000o\000r\000e\000d\000-\000d\000a\000t\000a\000\000", "f\000l\000o\000w\000c\000h\000a\000r\000t\000-\000d\000e\000l\000a\000y\000\000", "f\000l\000o\000w\000c\000h\000a\000r\000t\000-\000s\000e\000q\000u\000e\000n\000t\000i\000a\000l\000-\000a\000c\000c\000e\000s\000s\000\000", "f\000l\000o\000w\000c\000h\000a\000r\000t\000-\000m\000a\000g\000n\000e\000t\000i\000c\000-\000d\000i\000s\000k\000\000", "f\000l\000o\000w\000c\000h\000a\000r\000t\000-\000d\000i\000r\000e\000c\000t\000-\000a\000c\000c\000e\000s\000s\000-\000s\000t\000o\000r\000a\000g\000e\000\000", "f\000l\000o\000w\000c\000h\000a\000r\000t\000-\000d\000i\000s\000p\000l\000a\000y\000\000"}’ (type ‘<brace-enclosed initializer list>’) to type ‘frozen::bits::ignored_arg’ }); ^ In file included from /home/tdf/lode/bibisect/core242/oox/source/export/shapes.cxx:90:0: /home/tdf/lode/bibisect/core242/workdir/UnpackedTarball/frozen/include/frozen/set.h:228:16: note: candidate: template<class T, long unsigned int N> constexpr auto frozen::make_set(const T (&)[N]) constexpr auto make_set(const T (&args)[N]) { ^~~~~~~~ /home/tdf/lode/bibisect/core242/workdir/UnpackedTarball/frozen/include/frozen/set.h:228:16: note: template argument deduction/substitution failed: /home/tdf/lode/bibisect/core242/oox/source/export/shapes.cxx:622:2: note: mismatched types ‘std::basic_string_view<char16_t>’ and ‘const char16_t*’ }); ^ In file included from /home/tdf/lode/bibisect/core242/oox/source/export/shapes.cxx:90:0: /home/tdf/lode/bibisect/core242/workdir/UnpackedTarball/frozen/include/frozen/set.h:233:16: note: candidate: template<class T, long unsigned int N> constexpr auto frozen::make_set(const std::array<_Tp, _Nm>&) constexpr auto make_set(std::array<T, N> const &args) { ^~~~~~~~ /home/tdf/lode/bibisect/core242/workdir/UnpackedTarball/frozen/include/frozen/set.h:233:16: note: template argument deduction/substitution failed: /home/tdf/lode/bibisect/core242/oox/source/export/shapes.cxx:622:2: note: couldn't deduce template parameter ‘N’ }); ^ In file included from /home/tdf/lode/bibisect/core242/oox/source/export/shapes.cxx:90:0: /home/tdf/lode/bibisect/core242/workdir/UnpackedTarball/frozen/include/frozen/set.h:238:16: note: candidate: template<class T, class Compare, long unsigned int N> constexpr auto frozen::make_set(const T (&)[N], const Compare&) constexpr auto make_set(const T (&args)[N], Compare const& compare = Compare{}) { ^~~~~~~~ /home/tdf/lode/bibisect/core242/workdir/UnpackedTarball/frozen/include/frozen/set.h:238:16: note: template argument deduction/substitution failed: /home/tdf/lode/bibisect/core242/oox/source/export/shapes.cxx:622:2: note: mismatched types ‘std::basic_string_view<char16_t>’ and ‘const char16_t*’ }); ^ In file included from /home/tdf/lode/bibisect/core242/oox/source/export/shapes.cxx:90:0: /home/tdf/lode/bibisect/core242/workdir/UnpackedTarball/frozen/include/frozen/set.h:243:16: note: candidate: template<class T, class Compare, long unsigned int N> constexpr auto frozen::make_set(const std::array<T, N>&, const Compare&) constexpr auto make_set(std::array<T, N> const &args, Compare const& compare = Compare{}) { ^~~~~~~~ /home/tdf/lode/bibisect/core242/workdir/UnpackedTarball/frozen/include/frozen/set.h:243:16: note: template argument deduction/substitution failed: /home/tdf/lode/bibisect/core242/oox/source/export/shapes.cxx:622:2: note: couldn't deduce template parameter ‘Compare’ }); ^ /home/tdf/lode/bibisect/core242/oox/source/export/shapes.cxx:630:2: error: no matching function for call to ‘make_set<std::u16string_view>(<brace-enclosed initializer list>)’ }); ^ In file included from /home/tdf/lode/bibisect/core242/oox/source/export/shapes.cxx:90:0: /home/tdf/lode/bibisect/core242/workdir/UnpackedTarball/frozen/include/frozen/set.h:223:16: note: candidate: template<class T> constexpr auto frozen::make_set(frozen::bits::ignored_arg) constexpr auto make_set(bits::ignored_arg = {}/* for consistency with the initializer below for N = 0*/) { ^~~~~~~~ /home/tdf/lode/bibisect/core242/workdir/UnpackedTarball/frozen/include/frozen/set.h:223:16: note: template argument deduction/substitution failed: /home/tdf/lode/bibisect/core242/oox/source/export/shapes.cxx:630:2: note: cannot convert ‘{"h\000e\000a\000r\000t\000\000", "p\000u\000z\000z\000l\000e\000\000", "c\000o\000l\000-\0006\0000\000d\000a\0008\0004\0006\0000\000\000", "c\000o\000l\000-\0005\0000\0002\000a\000d\0004\0000\0000\000\000"}’ (type ‘<brace-enclosed initializer list>’) to type ‘frozen::bits::ignored_arg’ }); ^ In file included from /home/tdf/lode/bibisect/core242/oox/source/export/shapes.cxx:90:0: /home/tdf/lode/bibisect/core242/workdir/UnpackedTarball/frozen/include/frozen/set.h:228:16: note: candidate: template<class T, long unsigned int N> constexpr auto frozen::make_set(const T (&)[N]) constexpr auto make_set(const T (&args)[N]) { ^~~~~~~~ /home/tdf/lode/bibisect/core242/workdir/UnpackedTarball/frozen/include/frozen/set.h:228:16: note: template argument deduction/substitution failed: /home/tdf/lode/bibisect/core242/oox/source/export/shapes.cxx:630:2: note: mismatched types ‘std::basic_string_view<char16_t>’ and ‘const char16_t*’ }); ^ In file included from /home/tdf/lode/bibisect/core242/oox/source/export/shapes.cxx:90:0: /home/tdf/lode/bibisect/core242/workdir/UnpackedTarball/frozen/include/frozen/set.h:233:16: note: candidate: template<class T, long unsigned int N> constexpr auto frozen::make_set(const std::array<_Tp, _Nm>&) constexpr auto make_set(std::array<T, N> const &args) { ^~~~~~~~ /home/tdf/lode/bibisect/core242/workdir/UnpackedTarball/frozen/include/frozen/set.h:233:16: note: template argument deduction/substitution failed: /home/tdf/lode/bibisect/core242/oox/source/export/shapes.cxx:630:2: note: couldn't deduce template parameter ‘N’ }); ^ In file included from /home/tdf/lode/bibisect/core242/oox/source/export/shapes.cxx:90:0: /home/tdf/lode/bibisect/core242/workdir/UnpackedTarball/frozen/include/frozen/set.h:238:16: note: candidate: template<class T, class Compare, long unsigned int N> constexpr auto frozen::make_set(const T (&)[N], const Compare&) constexpr auto make_set(const T (&args)[N], Compare const& compare = Compare{}) { ^~~~~~~~ /home/tdf/lode/bibisect/core242/workdir/UnpackedTarball/frozen/include/frozen/set.h:238:16: note: template argument deduction/substitution failed: /home/tdf/lode/bibisect/core242/oox/source/export/shapes.cxx:630:2: note: mismatched types ‘std::basic_string_view<char16_t>’ and ‘const char16_t*’ }); ^ In file included from /home/tdf/lode/bibisect/core242/oox/source/export/shapes.cxx:90:0: /home/tdf/lode/bibisect/core242/workdir/UnpackedTarball/frozen/include/frozen/set.h:243:16: note: candidate: template<class T, class Compare, long unsigned int N> constexpr auto frozen::make_set(const std::array<T, N>&, const Compare&) constexpr auto make_set(std::array<T, N> const &args, Compare const& compare = Compare{}) { ^~~~~~~~ /home/tdf/lode/bibisect/core242/workdir/UnpackedTarball/frozen/include/frozen/set.h:243:16: note: template argument deduction/substitution failed: /home/tdf/lode/bibisect/core242/oox/source/export/shapes.cxx:630:2: note: couldn't deduce template parameter ‘Compare’ }); ^ make[1]: *** [/home/tdf/lode/bibisect/core242/solenv/gbuild/LinkTarget.mk:340: /home/tdf/lode/bibisect/core242/workdir/CxxObject/oox/source/export/shapes.o] Error 1 Change-Id: Ie2d4dbe05df89578e5f86c4d2ef8367a563e3942 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157024 Tested-by: Tomaž Vajngerl <quikee@gmail.com> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-09-18oox: some more conversions to frozen map and setTomaž Vajngerl
Change-Id: Ibe557006ee4393a2cfa2cb600744ca5ba7090ca7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157003 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-09-16oox: use frozen unordered_map for mapping the name string to tokenTomaž Vajngerl
Change-Id: Ib1f7d28509a1bc2680ad66b2cb1bf0ed35315f58 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156975 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-09-08tdf#156649: oox: correct import alphaModFix for custom shapesSarper Akdemir
alphaModFix should be imported into PROP_FillTransparency for custom shapes. Change-Id: I19621e424a64b097d5e6881877d60de253be636d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156660 Tested-by: Jenkins Reviewed-by: Sarper Akdemir <sarper.akdemir.extern@allotropia.de>
2023-09-01various theme and complex color related fixesTomaž Vajngerl
Most of changes are a results of code reviews. Added comments and clarifications, removed unneeded methods, renamed variables to be more clear, protection against nullptr dereference,... Change-Id: Iae2b6abfa90b3bbd3f28328ca7fcf429765cbe9d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156203 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-08-30tdf#156835 - FILEOPEN XLSX: add SHA-384 encryption support for ooxml importBalazs Varga
Password protected file with SHA-384 encryption does not open before this patch. Change-Id: I482233f788b8e9da210ad6d2a6c4ece18d05d248 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156282 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
2023-08-30tdf#156829 PPTX import: fix connector regression at missing glue pointsTibor Nagy
Glue points weren't imported if the custom shape type is "non-primitive", resulting broken line connectors, moreover broken graphic design, as attached to the original bug report. ~Regression from commit cbf66ec3e60d07efb7c3cceed9b4f0fb4f0510c8 "tdf#89449 PPTX import: fix line connectors". Change-Id: I9908a23f8e6997bc1384aaeb3e8ba43c08d20d42 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156171 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2023-08-29supplement setting SYMBOL encoded charset with SymbolFont flagCaolán McNamara
as well as using the well-known symbol font names Change-Id: I2d0eb28ca89a74ae467f29a1173807b3b83bf4a0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156234 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-08-29pptx using Wingdings didn't fallback to OpenSymbolCaolán McNamara
<a:sym typeface="Wingdings" pitchFamily="2" charset="2"/> ^ The charset indicating that it was symbol encoded wasn't applied. There are quite a few uses of GetFontData so make this an optional request and only apply it right now to the problematic case. Change-Id: Ie1c4b9ac38c2bf5f0867d64eddea853a6dd05aad Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156230 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-08-28new loplugin:optionalboolNoel Grandin
which warns against using the 'operator bool' conversion of std::optional<bool> which can lead to interesting bugs The bugs that this plugin have been submitted independantly, so this change is just using has_value() in relevant places. Change-Id: I259b837feeecddcb8cd1d7e5db1e85bf505907cb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155978 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-08-27Change theme location to SdrModel and SdrPage (master page only)Tomaž Vajngerl
In Writer and Calc we only have one theme per document, so the theme can be stored inside the SdrModel. For Imporess/Draw the theme is defined per master page, so it needs to be stored on the master page. This changes the implementation to reflect that. In addition refactor all the usages in writer and calc to get and set the theme to SdrModel, when needed and rename the methods on the SdrPageProperties from {Get,Set}Theme to {get,set}Theme. Change-Id: I0cc3b332c029c28d15f8cda748c578c2a54a5c61 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156128 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-08-25tdf#150316 Fix missing first line indent in pptx exportSamuel Mehrbrodt
Change-Id: Ib2cac800b151823b77e44831100c2de9bbda8a16 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156107 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
2023-08-25Revert "use more Reference::query instead of UNO_QUERY_THROW"Noel Grandin
This reverts commit 7fc6063914432d58d86cfcbd728d967e7c86ebfd. sberg noticed that there is a difference now: there's a subtle difference now, in that if y was null originally, it would have thrown a (caught) exception, whereas now it will crash in the y.query<X>() call. Change-Id: Idbb5a08d635d15b5ca63f4822eddf05fb0a5afa0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156002 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-08-25Resolves tdf#155926 - Rename "Line Style 9"Heiko Tietze
Sparse dash Change-Id: Ia676358ea0de4437dd2e5f210b26a4e97f8d8758 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156090 Tested-by: Jenkins Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
2023-08-21move BGradient to awt::Gradient2 UNO conversion into docmodelTomaž Vajngerl
This is needed because the module dependencies are an issues if the conversion is done in basegfx. The bigger issue will come when the ComplexColor conversion will be done as basegfx can't depend on docmodel because of circular dependencies. The BGradient is also more suitable for docmodel anyway as the previously it was part of the model and is not a basic (gfx) type - however this doesn't move the whole BGradient into docmodel yet. Change-Id: Id91ce52232f89f00e09b451c13da36e2854ae14b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155674 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-08-18tdf#151134 Always write inset properties when exporting placeholder shapesSamuel Mehrbrodt
The default value works for text boxes, but not for these special presentation placeholder objects - here the values need to be written explicitly. Change-Id: Id606bd5e6b63dee2fd3b385435ce13ecec63b5f1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155838 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
2023-08-18use more Reference::query instead of UNO_QUERY_THROWNoel Grandin
since querying with exceptions is consideably more expensive Change-Id: I968a9a40766b2abb0d3058549b0ed44011fd5716 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155791 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-08-16tdf#153012: import chart's c:clrMapOvr elementMike Kaganski
Otherwise, a wrong mapping could be used, e.g. from slide. Change-Id: I8b0fcebcd21ac2bab8b7f58d0c24753d2eca02c7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155748 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-08-15Simplify and improve conversionMike Kaganski
Using o3tl::convert makes sure that rounding is correct, which shows in the improved unit test, that now doesn't need different values before and after roundtrip. Change-Id: If46e27300bc199e89c0abf0ea4d0cd825024aeb2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155728 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-08-15ComplexColor various clean-up and (trivial) refactoringsTomaž Vajngerl
Don't allow access to member variables of ComplexColor and makes them private. Needs a lot of changes. Change "scheme" to "theme" to be more consistent. In LO we usually call the "theme color" what is usually refered to as "scheme color" in OOXML, where it is sometimes refered to as "scheme" and other times as theme color. Remove ThemeColor class which was replaced with CmplexColor some time ago. Remove un-needed includes and un-needed components. Use isValidThemeColor in many places where we check that the ComplexColor is of "Theme" type and that ThemeColorType is set to a valid value. Change-Id: I325595fa65b8e56a4707e9d22acc6330aac28961 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155359 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-08-15tdf#153008: srcRect may have some members negativeMike Kaganski
The overly strict check (implying that all members must be non-negative, to perform the crop) excluded valid cases where some of the members were negative, and some positive. Change-Id: I629689bdccedf9e37632a9fe14654778c0f14a6f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155717 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-08-11move setting properties into note comments from oox to scCaolán McNamara
no change in behavior intended, the SdrCaption doesn't support the skipped conditions Change-Id: Id909ae4ed115c1ad3398d2a62c6432ff1dfde453 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155585 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-08-11split ShapeBase::convertShapeProperties into two partsCaolán McNamara
Change-Id: I62f42e54c776f15ea83c5fc861bb4f4ff899e891 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155584 Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-08-11refactor to return the position to be set by the caller insteadCaolán McNamara
no change in behavior intended Change-Id: I32043bdf1d29521d8503df315fa786236e272f7d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155580 Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
2023-08-11reduce noise in debug logsNoel Grandin
Only set this property if the object supports it Change-Id: If3adf76bbab5393e20a685b1af5016624c28fa79 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155583 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-08-07pptx: import ellipse shape correctlySzymon Kłos
Preset geometry "ellipse" was ignored: <a:prstGeom prst="ellipse"> Don't change service name to com.sun.star.presentation.OutlinerShape it should stay CustomShape to be correctly shown as an ellipse. Added next case: XML_body subtype in Layout and Slide mode. This is continuation for: commit 6df267780c4d41b41101c1be0a954b2f16ee8012 tdf#132557: PPTX import: Workaround for slide footer shape presets Signed-off-by: Szymon Kłos <szymon.klos@collabora.com> Change-Id: Ifb914c58203a1ad533f9cc9b1857a48983354de6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155015 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Henry Castro <hcastro@collabora.com> (cherry picked from commit e63a9553c022a9976d59113938df068f9d2b5d6c) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155233 Tested-by: Jenkins
2023-08-05Rename setRGB to createRGB to make it less misleadingMike Kaganski
Somehow I overlooked completely, that there already is a non-static setRGB. Thanks Miklos and Tomaž for the heads up! Change-Id: If20018a317d90e0a6297950dff201671316aacad Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155353 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-08-04Rename ComplexColor::RGB to setRGB, to avoid conflict with Windows defineMike Kaganski
Affects Windows' no-pch builds. Change-Id: Ifff401df40854f59760bd398c156a8837b528efe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155340 Tested-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-08-04oox: default first line indent is 0Szymon Kłos
When First Line Indent was defined in paragraph properties Impress remembered that value and applied for the next paragraph. Let's set it to default value (0) if property is not set explicitly. Change-Id: I3b075fab594fce64d953553634a49b9769c9341c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155336 Tested-by: Jenkins Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
2023-08-04pptx: import shape text from master pageSzymon Kłos
If shape has custom text defined in master page but no text itself - don't prefer placeholder text but text from master page. Change-Id: Id4f7aeca0e74ecd8565905cd656a182c1195fa30 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154980 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Henry Castro <hcastro@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155335 Tested-by: Szymon Kłos <szymon.klos@collabora.com> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
2023-08-04oox: don't use master style by defaultSzymon Kłos
By default a shape with empty type attribute in placeholder tag: <p:ph/> will get subtype = XML_obj (oox/source/drawingml/shapecontext.cxx:81) When it is not referencing any master style shape by idx attribute we shouldn't use master list style to be compatible with MSO. Change-Id: Ib695b695885892dbe659e70a28daff1799c5f50e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155232 Tested-by: Jenkins Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
2023-08-02sc: theme color support for sparklines + ODF & OOXML import/exportTomaž Vajngerl
This changes Sparkline colors to use complex colors instead and adds Sparkline theme color import and export support for ODF and OOXML. Change-Id: I58edd525d50f95199bd4fe7825afb51aaa7fc091 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155113 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-07-06tdf#141058 oox,sw: OOXML import/export of decorative on shapesMichael Stahl
Also add a test for PPTX (using the oox filters), and add a SdrObject to the testTdf143311 for DOCX (using the writerfilter/docxsdrexport). Change-Id: Iccee46c0d30316c33c0947b117e2604c96fa0182 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154137 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2023-07-05oox: fix crash in lcl_GetGluePointIdXisco Fauli
See https://crashreport.libreoffice.org/stats/signature/static%20long%20oox::drawingml::lcl_GetGluePointId(const%20class%20com::sun::star::uno::Reference%3Ccom::sun::star::drawing::XShape%3E%20&%20const,%20long) Regression from b7c542b5085374f1d031183cb86ceeefcf24964d "tdf#154363 sd: fix line connectors regression of mirrored shapes" Change-Id: I926d32f5b68582df588c28a800b0ec10e7e3e19f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154021 Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com> Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2023-07-04loplugin:constantparamNoel Grandin
Change-Id: Iee554baae7239c9bf0ac35cab6ff235a88dc29a1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153973 Tested-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-06-29oox: convert Excel tint value into LumOff and LumModTomaž Vajngerl
tint value can be converted into LumOff and LumMod values, so we don't need a special Excel case for calculating the final color. Change-Id: I0725c06f9df6a37a309ea5d17b183e4100a228f0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153716 Tested-by: Tomaž Vajngerl <quikee@gmail.com> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-06-28tdf155903 DOCX export: fix corrupt file with embedded mediaTünde Tóth
Regression from commit bc72514f90d90e1ab3fed8167663e835edf03508 "tdf#53970 PPTX: fix export of embedded media files". Change-Id: I04521227346817d91f720b1f6a77beb7f4a01f83 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153619 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org> Tested-by: Jenkins
2023-06-28Simplify a bitMike Kaganski
Change-Id: Iad2564853a2a0d74cd526b1574e421e121fd6986 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153644 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-06-27loplugin:stringstatic look for more stringsNoel Grandin
that can be initialised at compile-time instead of runtime Change-Id: I08d516fdc13a3a79f93c079f89ac44cbc7a1ed71 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153620 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-06-26new loplugin:constexprliteralNoel Grandin
OUStringLiteral should be declared constexpr, to enforce that it is initialised at compile-time and not runtime. This seems to make a different at least on Visual Studio Change-Id: I1698f5fa22ddb480347c2f4d444530c2e0e88d92 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153499 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-06-25oox: map color transforms direct to create model::TransformTomaž Vajngerl
Change-Id: I82382f8d0936e90218fefe889ea5bfdd04c3e82b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153507 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>