summaryrefslogtreecommitdiff
path: root/oox
AgeCommit message (Collapse)Author
2022-09-07cid#1500419 rearrange to silence Use after freeCaolán McNamara
Change-Id: I4529306d94c88ba6572f108f512f1521c849246c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139536 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-09-06tdf#147021 Use std::size() instead of SAL_N_ELEMENTS() macroRadhey Parekh
Change-Id: Ic9009eda963f922fc4d2e75a5002026eda63a7aa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138686 Tested-by: Jenkins Reviewed-by: Hossein <hossein@libreoffice.org>
2022-09-05Simplify by using replace instead of replaceAt in 2 loops in oox/scJulien Nabet
I grouped these because one has a reference with the other Change-Id: I9bbd87951e2f945dfd20d54d16ea7d9291d74f62 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139369 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-09-05tdf#149670 fix color change api and adjust tolerance for ooxmlSarper Akdemir
It appears at the start of Graphic::colorChange aBmpColorFrom & aBmpColorTo gets initialized with wrong colors. Instead of {R,G,B}, they get initialized with {B,G,R}. Instead of bitshifting use the ::Color constructor so that it is initialized correctly. For ooxml import adapt tolerance values of the image format in an attempt to get similar results on how the results appear in PowerPoint. Change-Id: I1fa901691512de82936dba0e47158b7e0ca2223e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139203 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-09-04Fix comment, formulabase.cxx has been moved in sc/source/filter/oox since 2012Julien Nabet
(precisely since 8ada1cd2846e5e60ad63250c68ddea3a9356546f) Change-Id: I0be868233325ab5b92e35af14c3d9f77ee3edecb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139368 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2022-08-31Fix typoAndrea Gelmini
Change-Id: I1cbdfec2c6340a8305fd249ff8112e2d8e0ffdfb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139102 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2022-08-31tdf#144092 pptx export: export endParaRPr for empty shape & cellsSarper Akdemir
Alters ShapeExport::WriteTextBox so that when it is called with an empty text (on PPTX export) an attempt to export empty text's char properties (stored in the Shape or Cell's properties directly) made on ShapeExport::WriteText. These properties are exported into endParaRPr. Implementing this caused some tests that contain connector shapes fail with XML schema validation errors, therefore disabled export of txBody inside cxnSp tags. Also adds a unit test that checks roundtrip of empty shape or cell's endParaRPr. Change-Id: I3e3feda802f42560fa7fecc9c0b1afe73a900a84 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138960 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-08-31tdf#144092 pptx import: correct table height during importSarper Akdemir
It appears PowerPoint can export rows of a table with row heights that is less than the minimum height (for that row). And also export the total table height wrong with it. If PowerPoint imports such a table, those rows are individually expanded to the minimum height. (Also increasing the table's total height) In Impress import we calculate table height by adding up individual row heights. Table layouting code depends on the table height being correct. This is why rows with less than minimum height lead to layouting problems. To compensate for this, while importing tables, layouting is skipped until the table height is updated with the corrected height. The correct height is calculated by layouting the table without fitting to an area (i.e with bFit = false). Change-Id: I79187882470a4e285b45bca1eabb469a084067f5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138652 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-08-29tdf#144092 pptx import: fix import of empty cell and shape text propertiesSarper Akdemir
For table cells and shapes without any text, text properties weren't correctly imported. Both the master styles and properties defined in the endParaRPr were ignored. It appears the current implementation does attempt to import those in TextParagraph::insertAt(...), after the attempt they end up in the TextRange('s nodes) but they are ignored. This commit implements a fix by: If the cell or shape has no text, the text properties are also pushed into the shape or cell's propset directly Change-Id: Ie425b3e9a73937a2503e47322e25f37ed9a2a6be Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138651 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-08-25oox: avoid unnecessary value parameterMiklos Vajna
This parameter is copied for each invocation but only used as a const reference; make it a const reference. Change-Id: Iff80fb1b8d2374b93eca718b932659aca8142713 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138775 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-08-18Move tools/diagnose_ex.h to comphelper/diagnose_ex.hxxStephan Bergmann
...so that its TOOLS_WARN_EXCEPTION can be used in comphelper/source/misc/logging.cxx in a follow-up commit. (And while at it, rename from diangose_ex.h to the more appropriate diagnose_ex.hxx. The comphelper module is sufficiently low-level for this immediate use case, so use that at least for now; o3tl might be even more suitable but doesn't have a Library until now. Also, for the immediate use case it would have sufficed to only break DbgGetCaughtException, exceptionToString, TOOLS_WARN_EXCEPTION, TOOLS_WARN_EXCEPTION_IF, and TOOLS_INFO_EXCEPTION out of include/tools/diagnose_ex.h into an additional new include/comphelper/diagnose_ex.hxx, but its probably easier overall to just move the complete include file as is.) Change-Id: I9f3222d4ccf1a9ac29d7eb9ba1530d53e2affaee Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138451 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-08-18oox: set fill properties correctly for the data table at importTomaž Vajngerl
Change-Id: Ia108c5b67e85ba770bd84d90ad1d3dd27046b245 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138461 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2022-08-17cid#1500403 Dereference before null checkCaolán McNamara
Change-Id: I0246551dd84cc7637d4a7a7fc0763ef2d084049f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138390 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-08-11Related: tdf#150176 pptx chart import: fix automatic border styleBalazs Varga
With this patch it will work not just for pptx, but other ooxml presentation file formats. Follow up of commit: 071a36e042c76286fedb38f479dac79f29b661f9 (tdf#150176 pptx chart import: fix automatic border style) Change-Id: I05e03d2723e9978156dfd8025e3a4b5bcecddbc0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138059 Tested-by: Jenkins Reviewed-by: Balazs Varga <balazs.varga.extern@allotropia.de>
2022-08-10loplugin:passstuffbyrefNoel Grandin
Change-Id: Ib2b2650da7abc9260897f9b5aad619a0ea6ae941 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138052 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-08-09tdf#150176 pptx chart import: fix automatic border styleBalazs Varga
Do not set the default border style for chart area in case of pptx charts, if it is came from the MSO as an automtic line style. regression from commit: 0dac43445b35da7e554dd4d7574c59611a0d0be1 (tdf#81437 XLSX import: fix missing chart border) Change-Id: Iaaaecc1dffe80c3f1528851e707236f2f7228bee Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137993 Tested-by: Jenkins Reviewed-by: Balazs Varga <balazs.varga.extern@allotropia.de>
2022-08-04Silence false -Werror=maybe-uninitializedStephan Bergmann
...in code recently added with 7e23cbdbb6ec0247a29ed8a8f744c01e10963ea0 "tdf#149551 separate TextRotateAngle from TextPreRotateAngle", hitting at least with gcc-c++-12.1.1-1.fc36.x86_64, > In file included from include/tools/degree.hxx:15, > from include/vcl/bitmap.hxx:23, > from include/vcl/alpha.hxx:28, > from include/vcl/bitmapex.hxx:24, > from include/vcl/graph.hxx:26, > from include/oox/export/drawingml.hxx:47, > from oox/source/export/drawingml.cxx:26: > In function ‘o3tl::strong_int<UT, PT> o3tl::operator+(const strong_int<UT, PT>&, const strong_int<UT, PT>&) [with UT = int; PT = FractionTag<100>]’, > inlined from ‘void oox::drawingml::DrawingML::WriteText(const com::sun::star::uno::Reference<com::sun::star::uno::XInterface>&, bool, bool, sal_Int32, bool)’ at oox/source/export/drawingml.cxx:3520:33: > include/o3tl/strong_int.hxx:143:12: error: ‘*(const o3tl::strong_int<int, FractionTag<100> >*)((char*)&nTextRotateAngleDeg100 + offsetof(std::optional<o3tl::strong_int<int, FractionTag<100> > >,std::optional<o3tl::strong_int<int, FractionTag<100> > >::<unnamed>.std::_Optional_base<o3tl::strong_int<int, FractionTag<100> >, true, true>::<unnamed>)).o3tl::strong_int<int, FractionTag<100> >::m_value’ may be used uninitialized [-Werror=maybe-uninitialized] > 143 | return strong_int<UT,PT>(lhs.get() + rhs.get()); > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > oox/source/export/drawingml.cxx: In member function ‘void oox::drawingml::DrawingML::WriteText(const com::sun::star::uno::Reference<com::sun::star::uno::XInterface>&, bool, bool, sal_Int32, bool)’: > oox/source/export/drawingml.cxx:3346:30: note: ‘*(const o3tl::strong_int<int, FractionTag<100> >*)((char*)&nTextRotateAngleDeg100 + offsetof(std::optional<o3tl::strong_int<int, FractionTag<100> > >,std::optional<o3tl::strong_int<int, FractionTag<100> > >::<unnamed>.std::_Optional_base<o3tl::strong_int<int, FractionTag<100> >, true, true>::<unnamed>)).o3tl::strong_int<int, FractionTag<100> >::m_value’ was declared here > 3346 | std::optional<Degree100> nTextRotateAngleDeg100; // text area rotation > | ^~~~~~~~~~~~~~~~~~~~~~ and then > In file included from include/oox/export/drawingml.hxx:38, > from oox/source/export/drawingml.cxx:26: > In function ‘rtl::OString oox::drawingml::calcRotationValue(sal_Int32)’, > inlined from ‘void oox::drawingml::DrawingML::WriteText(const com::sun::star::uno::Reference<com::sun::star::uno::XInterface>&, bool, bool, sal_Int32, bool)’ at oox/source/export/drawingml.cxx:3551:48: > include/oox/drawingml/drawingmltypes.hxx:168:19: error: ‘*(const o3tl::strong_int<int, FractionTag<100> >*)((char*)&nTextRotateAngleDeg100 + offsetof(std::optional<o3tl::strong_int<int, FractionTag<100> > >,std::optional<o3tl::strong_int<int, FractionTag<100> > >::<unnamed>.std::_Optional_base<o3tl::strong_int<int, FractionTag<100> >, true, true>::<unnamed>)).o3tl::strong_int<int, FractionTag<100> >::m_value’ may be used uninitialized [-Werror=maybe-uninitialized] > 168 | nRotation -= 36000; > | ~~~~~~~~~~^~~~~~~~ > oox/source/export/drawingml.cxx: In member function ‘void oox::drawingml::DrawingML::WriteText(const com::sun::star::uno::Reference<com::sun::star::uno::XInterface>&, bool, bool, sal_Int32, bool)’: > oox/source/export/drawingml.cxx:3346:30: note: ‘*(const o3tl::strong_int<int, FractionTag<100> >*)((char*)&nTextRotateAngleDeg100 + offsetof(std::optional<o3tl::strong_int<int, FractionTag<100> > >,std::optional<o3tl::strong_int<int, FractionTag<100> > >::<unnamed>.std::_Optional_base<o3tl::strong_int<int, FractionTag<100> >, true, true>::<unnamed>)).o3tl::strong_int<int, FractionTag<100> >::m_value’ was declared here > 3346 | std::optional<Degree100> nTextRotateAngleDeg100; // text area rotation > | ^~~~~~~~~~~~~~~~~~~~~~ Change-Id: Id0bf911ada8f8d7343e9c51107776e303ed72a25 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137779 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-08-02elide some temporary OUString construction in oox parsingNoel Grandin
Change-Id: I2ea01ef4724dd375d641c8e39a7028c0e5ccec2e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137702 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-08-02clang-tidy modernize-pass-by-value in ooxNoel Grandin
Change-Id: Ia553a24693f2ffc0f580c9869b82f0d01a1a0ffb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137693 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-08-02use more getStringDefaultedNoel Grandin
rather than repeatedly constructing an empty OUString parameter Change-Id: I9ed2826f260f1f551c77e03b26f13a98e277f42f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137685 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-08-01use more string_view when dealing with attributesNoel Grandin
which means we don't need to call strlen on them, since we already know how long they are. Change-Id: Iefc76f38a23250e87a65c27df3634d562464a760 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137679 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-07-31Fix typo in codeAndrea Gelmini
Change-Id: Ica86f2c5043fd8f78e83d06778e4b0f468032474 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137645 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2022-07-29cid#1507491 cut and paste typo triggering 'Constant' variable guards dead codeCaolán McNamara
Change-Id: I9b833575f3cc3ba886b355eefdfa9155d2dffae1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137587 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Jenkins
2022-07-29cid#1507492 Improper use of negative valueCaolán McNamara
Change-Id: I7c44307917df3397cfc9c99a982c54f51693e660 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137589 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-07-29Revert "tdf#141652 partial revert "Reset ShapeProperty priority..."Justin Luth
This reverts 7.4 commit 18cc1240565e697859dd7d17058f91d5e01df929. Someone backported it to 7.3 as well. Change-Id: Ie04595e11dd9d2e15fa940b8ada71714bd434f6a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137581 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com>
2022-07-28oox export: export line/fill and text props. of a data tableTomaž Vajngerl
Change-Id: I02a4c35693b599578e073d52a2d22ad59bc31786 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137409 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2022-07-26oox export: add export of basic properties of a data tableTomaž Vajngerl
Change-Id: I2c8b76125fc788a9e4df164171d6cbd351bc1c4a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137406 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2022-07-25tdf#135953 move txXfrm to compensate TextRotateAngleRegina Henschel
The text rectangle specified by the txXfrm element rotates around its center. We not directly use this rectangle but we use the text area rectangle of the preset geometry and crop it by setting distances so, that the result equals the txXfrm rectangle. But the text area rectangle still rotates at its original center. So we shift the txXfrm rectangle so, that it would be at it original place, when rotated with TextRotateAngle. We then can use the shifted one to calculate the needed distance values. This patch contains the calculation of the text area rectangle for type 'rightArrow' in addition. That fixes tdf#132302. Change-Id: I59d9aecaaa7ce2ef4502651088ff9576b90873f7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137396 Tested-by: Jenkins Reviewed-by: Regina Henschel <rb.henschel@t-online.de>
2022-07-25sw content controls, plain text: add DOCX importMiklos Vajna
- the core of this is the writerfilter/ change to call PopSdt() for SdtControlType::plainText, which maps inline plain text SDTs to Writer content controls, not to input fields - disable the grab-bag in this case, otherwise we would run duplicated <w:sdt> elements on export - fix CppunitTest_sw_ooxmlexport7's testSdtAndShapeOverlapping by postponing the SDT start in DocxAttributeOutput::WriteContentControlStart() in case a shape is anchored at the same position as the SDT start: if the shape should start inside the content control, then it should be anchored after the dummy character - reduce the debug output in VMLExport::Commit(), which could write control characters to the terminal on test failure, potentially breaking it (requiring a 'reset' to recover) - fix CppunitTest_sw_ooxmlexport5's testSdt2Run: now we merge two runs inside a plain text content control into a single one, and there is no problem with that, so adapt the test instead - fix CppunitTest_sw_ooxmlexport17's testTdf148361: plain text inline SDT is now a content control, not a field - fix CppunitTest_sw_ooxmlfieldexport's testfdo82492: explicitly assert that there is 1 text run inside the SDT and there is a shape after it (outside). Also extend DocxAttributeOutput::EndContentControl(), so it ends the content control at the correct, earlier position in case it's followed by an as-char shape - fix CppunitTest_sw_ooxmlfieldexport's testfdo82123: again assert that the SDT has 1 run with text, and there is a drawing after the SDT - fix CppunitTest_sw_ooxmlfieldexport's testTdf104823: this revealed that some more complex logic is needed to support data bindings, so exclude text-with-databinding from the scope of this commit and continue to map those to input fields for now - fix CppunitTest_sw_ooxmlfieldexport's testFdo81945: this had a similar problem as as-char shapes, but this time a new SDT is starting right after a previous SDT. Adapt DocxAttributeOutput::EndContentControl() accordingly, though perhaps this should be generalized later, so we always close SDTs in the previous run, unless this is the last run, or something similar Change-Id: Ifaf581be884a683de6c8b932008a03ba43734b75 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137399 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2022-07-24Fix typoAndrea Gelmini
Change-Id: Ia6c5e8615cc1438664f2208b6b1fc5f0383840ca Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137392 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2022-07-23tdf#149538 no text area rotation if upright exportedRegina Henschel
This is a followup to commit 7e23cbdb. With that commit the attribute 'upright' is correctly emulated by a rotation of the text area rectangle. But I forgot to remove this rotation when the 'upright' attribute is used on export. Change-Id: I46d0f421be8ef6b44537134c73dc1e4326ba7e1d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137368 Tested-by: Jenkins Reviewed-by: Regina Henschel <rb.henschel@t-online.de>
2022-07-22tdf#149697 PPTX export: fix changing place of connection pointsTibor Nagy
Place of the connection point of a polygon changed during a PPTX round-trip, connecting other vertices of e.g. a square or a hexagon, as before. See also commit c3f73f75772d076dfb2ed0538e7d515503edc038 "tdf#149128 PPTX export: fix <stCxn> and <endCxn> connector properties". Change-Id: I64fc6377417a99d32e84ea71fbed13cf36760118 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136474 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2022-07-22elide some makeStringAndClear() callsNoel Grandin
Change-Id: I3b80d0f5b6d39c071242bc6ccc1e4333886c835d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137309 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-07-21Fix typosAndrea Gelmini
Change-Id: I626c182fc8c9b8fd17000f3ab3739c1bfb334a37 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137243 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2022-07-21One more -Werror,-Wunused-resultStephan Bergmann
...similar to cf69bb4f503eb8b3966d5caf825e0c05264a369e "-Werror,-Wunused-result", after c6965c5bcc95430c2a2d01051791d23f2c2f5a5b "tdf#145528 add round1Rect to SmartArt text area corrections" Change-Id: I59292c7e4aae07be2ea46ae5c3db9629fa129a58 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137295 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-07-21tdf#145528 add round1Rect to SmartArt text area correctionsRegina Henschel
Some SmartArt types use text area rectangles different from defaults. The new rectangle is available in element <txXfrm>. This patch adds the needed corrections for type round1Rect. It is four times used in SmartArt 'Titled Matrix' with rotations 0deg, 90deg, 180deg and 270deg. Change-Id: I8c82b446a982ad93026e976b2a47d509b858858d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137287 Tested-by: Jenkins Reviewed-by: Regina Henschel <rb.henschel@t-online.de>
2022-07-21-Werror,-Wunused-resultStephan Bergmann
...when building against a recent libc++ that marks std::clamp [[nodiscard]], in code newly introduced in 7e23cbdbb6ec0247a29ed8a8f744c01e10963ea0 "tdf#149551 separate TextRotateAngle from TextPreRotateAngle" Change-Id: Ifdce627b5d76fac269f1403e7bb98d4576dfa682 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137257 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-07-20tdf#149551 separate TextRotateAngle from TextPreRotateAngleRegina Henschel
The import filter had only one member for both and had it mapped to TextPreRotateAngle. That resulted in lost text area rotation when a shape had both types of rotations, and sheared text when only text area rotation existed. The patch introduces a new 'moTextAreaRotation' member for the 'rot' attribute of the <bodyPr> element. It is mapped to 'TextRotateAngle' property. It becomes the 'draw:text-rotate-angle' attribute of the <draw:enhanced-geometry> element for a shape and 'style:rotate-angle' for chart elements in ODF. It must also be used to simulate 'upright' and is used for the 'rot' attribute in <txXfrm> of diagram shapes. The 'moRotation' member is now only used for the 'TextPreRotateAngle' property. That angle describes a rotation of the text without changing the text area. Valid values are multiples of 90deg. It is used for simulating vertical writing modes that are not yet implemented. It has no corresponding attribute in ODF. To make the meaning clear in code, the member is renamed to 'moTextPreRotation'. MS Office recalutes a diagram on file opening from layout.xml and data.xml. That is not yet implemented in LO, but we use drawing.xml, which gives the state of the diagram at time of saving. The patch handles the 'rot' attribute of <txXfrm> element as well. It has to be mapped to moTextAreaRotation, because it might contain angles, which are not multiples of 90deg, for example diagram 'Gear'. The <off> and <ext> child elements of <txXfrm> describe the actual used text area rectangle. The existing import calculates the difference of the actual used text area rectangle to the predefined one and incorporates it into the TextArea*Distance attributes. The patch adds calculating the current values of the text area rectangle as it would be using the preset markup. At that time in import there is no SdrObjCustomShape object, thus we cannot use its GetTextBounds() method. So it is down manually, covering most of those types, which are used in diagrams of MS Office. Remarks to unit tests: Now the rotation introduced by txXfrm is no longer in TextPreRotateAngle, but in TextRotateAngle. According changes are in SdImportTest::testN86510_2 Test, testFdo87488 Now the correct preset text area rectangles are used. That requires adaption of the needed distances. Done in SdImportTest::testBnc870237() SdImportTest::testTdf93830() SdImportTestSmartArt::testTdf134221() The buggy 'upright' export is fixed. Adaption in ScExportTest2::testTdf137000_handle_upright() Change-Id: I79df1559f88b76e96988fe745304dc4162de6316 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136447 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-07-17oox: support reading text and shape properties for a data tableTomaž Vajngerl
Change-Id: I740d3bd6af11457ecb54878be648ad1e22b9d4b8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137153 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2022-07-17oox: add data table and props. with the new UNO DataTable serviceTomaž Vajngerl
Refactor filling of the old data table UNO properties to use the new service DataTable and its properties. Change-Id: Iee611c88bec6f58a50b5ae09d3acffd16e0b6dd9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136790 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2022-07-17cid#1506711 Uncaught exceptionCaolán McNamara
and cid#1506712 Uncaught exception cid#1506713 Uncaught exception Change-Id: I8f9753369cb3c85e5f6b910b00aaf553db62750b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137144 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-07-14tdf#149985 pptx crash on a one-slide presentation (with a chart)Noel Grandin
regression from commit 04073c5fedd33654f242fecb7e39afb07cf0e273 Date: Tue Jun 21 13:17:09 2022 +0200 replace oox::OptValue with std::optional Change-Id: I830713495ca04771433018f1091faadf0f6bd71e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137051 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-07-12elide some temporary OUStringsNoel Grandin
Change-Id: I93ee61a04dfc1bb3dc758fd83a503f7374824ae8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136999 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-07-11tools: rename getHeight/Width() to GetOpenHeight/Width()Chris Sherlock
By default Rectangle uses closed interval, if we really want to use half open intervals then we should specifically say as such in the name. Change-Id: Id7a91120ba1a1a4bc330014216b73a692dbf03a2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136575 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2022-06-30tdf#149785 Read Error importing documentNoel Grandin
after commit 04073c5fedd33654f242fecb7e39afb07cf0e273 Author: Noel Grandin <noel.grandin@collabora.co.uk> Date: Tue Jun 21 13:17:09 2022 +0200 replace oox::OptValue with std::optional and add a SAL_WARN to make this easier to diagnose in the future Change-Id: Ia5be0b82e3a5df34f50bc8a2decb1de98e0c5556 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136665 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-06-28use utl::TempFile directly in packageNoel Grandin
so we can (a) control the lifetime of the temp file properly and (b) we don't need to use file URLs which means we stay on the efficient path on Windows Change-Id: I2b1eed5f5afc8f89f53bde35ebb44e9922889817 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136557 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-06-27Integer division could cancel small values of wrong signMike Kaganski
... as seen at some documents where the values are like -1. There the checks in pushToPropMap may pass (the division result would be 0), but the original small negative values would fail the asserts that were introduced in commit 5772cef244dbee5834efbc693bc714d89ae6301d Author Mike Kaganski <mike.kaganski@collabora.com> Date Wed Jun 15 18:33:38 2022 +0300 tdf#134210: Reimplement cropping from srcRect and fillRect Change-Id: I114588862b5cfd2b2e4491424430cc139bdbaae9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136492 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-06-27tdf#149692 crash importing document with vba formsNoel Grandin
This bug appears to date back to commit a43cc9ec8dde4f311bcf8ff96e6a26d56b2abdcf Author: Noel Power <noel.power@suse.com> Date: Wed Apr 17 17:08:59 2013 +0100 implement MultiPage, Page & TabStrip import for oox Change-Id: Ia4784e4c34189f05e516704fa2e2485e4560fa4b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136500 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-06-27replace oox::OptValue with std::optionalNoel Grandin
Change-Id: I16e7179b2851640b4d73665685dcc1e84042ddaf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136270 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-06-25use SAL_WARN instead of printf for loggingNoel Grandin
Change-Id: Ic6134cae251b8096b720005b62ce282def6b7ac1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136368 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>