summaryrefslogtreecommitdiff
path: root/oox/source/drawingml
AgeCommit message (Collapse)Author
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-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-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-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-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-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-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-24make oox::OptValue::value() assert if emptyNoel Grandin
as part of replacing OptValue with std::optional, we need to mimc the behaviour of std::optional::value(), which will throw bad_optional_access Change-Id: Icf5141cefd4623a6a1bb7b3a3449d3af382e01c1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136365 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-06-24almost nobody is using the oox::AttributeList::get methods properlyNoel Grandin
Most of the call sites just ignore the fact that we are returning an optional value here. Which means that when an attribute is missing, they get an empty string or zero. And we seem to be fine with that. So make a plugin that warns about calling value() on a temporay OptValue. And add a utility method so we don't have to pay the cost of passing a default value to getString() The need for this is driven by wanting to change to std::optional, which will throw an exception if code attempts to read an empty std::optional Change-Id: Idb0a5ad1eac66b5caa93d6195928bad9e0b2ad70 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136283 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-06-22rename oox::OptValue::get to valueNoel Grandin
as a step in replacing OptValue with std::optional Change-Id: Ia5d05c28a88beaced11ae1d0414de66106cc9e20 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136269 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-06-22rename oox::OptValue::get(Type) to value_orNoel Grandin
as a step towards replacing OptValue with std::optional Change-Id: Ic4afaca87034b1b794432ee4261a6495058b26fa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136268 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-06-22make oox::OptValue::assignIfUsed a free functionNoel Grandin
as a step towards making OptValue into std::optional. Change-Id: I3eae4034a846dd63a16e501abe4a6eba9d186a49 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136266 Tested-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-06-22replace oox::OptValue::useNoel Grandin
with emplace and operator* as a step towards converting it to std::optional Change-Id: I3fca397c7dcfe200962e2b81a423322e29787f20 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136215 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-06-21remove oox::OptValue::setNoel Grandin
as a step towards converting it to std::optional Change-Id: I49db0b13338388c92108fc2c27d8e662dcd954d7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136214 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-06-21remove oox::OptValue::differsFromNoel Grandin
as a step towards converting it to std::optional Change-Id: I198abb4ae85b1d82f465577ebd0eec37b78c1111 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136213 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-06-21rename oox::OptValue::has() to has_valueNoel Grandin
as a step towards converting it to std::optional Change-Id: I9b2201c29827fcddae3b46480065c90b2907e6cd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136210 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-06-18o3tl: ensure that the initializer of enumarray contains enough elementsMichael Stahl
Currently this silently succeeds. Turns out oox already contains some too-short initializers, let's guess the missing properties are all invalid. One downside of the templated parameter pack approach in the enumarray ctor, as witnessed in vcl/win/window/salframe.cxx, is that argument types can no longer be implicitly deduced and thus need to be spelled explicitly now in certain cases. There were also three uses of enumarry with V being unsigned short (aka sal_uInt16) that started to cause narrowing conversion errors now and needed to be adapted: In editeng/source/uno/unonrule.cxx the obvious fix was to use the proper type for V. In sw/source/core/unocore/unosett.cxx with its odd mix of saL_Int16 and USHRT_MAX, lets keep things that way for now (probably awaiting later clean up) and use casts to avoid the implicit narrowing. And in sw/source/filter/ww8/wrtw8esh.cxx the ESCHER_Prop_* values, while presumably conceptionally of type sal_uInt16, are plain #defines (thus of type int), so rather than changing V to int it looked more consistent to explicitly cast the ESCHER_Prop_* vlaues to sal_uInt16. (And in tools/source/fsys/urlobj.cxx the poor loplugin:redundantfcast started to unhelpfully kick in for (only) the first argument now.) Change-Id: If06c29e673ec7e565e283c6f447889cf1f777cb7 Co-authored-by: Stephan Bergmann <sbergman@redhat.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135970 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-06-17tdf#134210: Reimplement cropping from srcRect and fillRectMike Kaganski
This avoids the scaling after the crop, since scaling is performed anyway when applying BitmapMode_STRETCH. This improves resulting bitmap quality. Also consider the "crop to zero" case (when the sum of cropped parts is equal to 100%). In that case, just use an empty graphic as the fill bitmap. This makes the differences between srcRect and fillRect processing explicit, simplifies the code, avoids extra rounding inaccuracies, and takes care of the edge cases that were considered in commit 2859ec288f2c1323ea3123d82cb1684b349ff598 Author Miklos Vajna <vmiklos@collabora.com> Date Wed Jun 15 15:52:18 2022 +0200 oox: fix div by zero in lclCalculateCropPercentage() The change in SdImportTest2::testTdf134210 is because we now don't scale the cropped image. The previous value was an interpolated color, while the new value is the actual color of pixel [0, 41] of the original image. Change-Id: I24fa9928cff32bcaa6a7b3e34def14700fddd7ca Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135917 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-06-16tdf#128150 Add OOXML import/export for "use background fill"Samuel Mehrbrodt
and allow editing this fill property in area dlg Change-Id: Ic63ba11e9d499d4a0fb22f6739587e3e25140b8f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134406 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
2022-06-16Correct parsing of ST_PercentageMike Kaganski
Change-Id: I227b2abd493d3a4ce6f4e4dcd256aa29653fdce0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135886 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2022-06-15oox: fix div by zero in lclCalculateCropPercentage()Miklos Vajna
Similar to what oox::vml::ShapeType::getAbsRectangle() already does. Crashreport signature: Fatal signal received: SIGFPE code: 1 for address: 0x7fcd55eeff59 program/libooxlo.so oox::drawingml::GraphicProperties::pushToPropMap(oox::PropertyMap&, oox::GraphicHelper const&, bool, bool) const oox/source/drawingml/fillproperties.cxx:103 Change-Id: I0f82cbc955d9e60bad103682638b07153a5589e7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135910 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2022-06-08tdf148321: convert OOXML inset values to text distance valuesTomaž Vajngerl
Inset values for top, bottom are calcualted differently in OOXML and need to be coverted on import to the text distance LO values, that place the text relative to the shape correctly. At export, the values can be converted back to the OOXML inset compatible values, but the values are not always converted back to the same values as the conversion is not bijective, however they do render the same. This also adds the test for the conversion when importing and checks that the exported values are expected. Change-Id: Ic64eec1a2a80ddad997f916da3e87dc30aaa12be Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135463 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2022-05-25Advanced Diagram support: Isolated IDiagramHelper, selection visualizationArmin Le Grand (Allotropia)
Moved and isolated IDiagramHelper to own file to get SdrObjGroup smaller and less dependent again, all places adapted. isDiagram() now available at SdrObject directly, adapted and have less places which need to cast for SdrObjGroup for check. Started to add SdrHdl/selection visualization to seleced Diagram. Only as a start, will need to be extended to look good/better, plus evtl. functionality in handles/UI. Corrected error(s) found by failing UnitTests More clang-notes (static, namespace) I nneeded to follow Change-Id: If4675b3270d3ee30259fce49deb017dbbaf5c0c4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134825 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2022-05-18Remove 1 ImportGraphic methodJulien Nabet
and replace its only use in Shape::renderDiagramToGraphic (oox/source/drawingml/shape.cxx) by an existing one. It became quite useless since 2876a0f79f94cdd139cc8fa40669acde9674bf8c (2020/03/03) graphic: remove preview when importing with GraphicFilter Change-Id: Iec3b13d85297bbe7cbfefe91a2a88e33e53d506b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134503 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2022-05-14use more string_view in ooxNoel Grandin
Change-Id: I7c6d201cfbfb577ef53e685df245997e5ec8f134 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134299 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-11Advanced Diagram support: UNDO/REDO support for Diagram DataModelArmin Le Grand (Allotropia)
Added support for UNDO/REDO for changes in Diagram ModelData. This is currenly applied/used in the DiagramDialog for it's Add/Remove actions (also supports Cancel of that dialog 1st time ever). But it is defined more general to add/support manipulating actions like clone/change_text etc. Also the UI/dialog at he end will not be/stay modal, so this is a test implemenation how to use it. It uses an extract/apply mechanism to get/set the Diagram ModelData at/for the UNDO action. That may be expanded as needed for additional data in he future. It may also be considered to modify the Connection/Point ModelData to shared_ptr internally completely to avoid copying these at all. OTOH it is not that much data to handle at all. Change-Id: I4702ed908b79a476177fe66c0e3284898c6adda5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134118 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2022-05-06tdf#148929 sd theme: limit PPTX import for shape fill effects to lum mod/offMiklos Vajna
Regression from 30735bdb5a0a81619000fdd24b2d0fbf45687f01 (sd theme: add PPTX import for shape fill color effects, 2022-04-27), the bugdoc's A2 cell lost its tinting (its background color is no longer lighter than A1) after saving back to PPTX + import again. The code assumed that in case a fill color has effects, it can only be luminance offset or modulation, since that's what the PowerPoint UI generates when setting a fill color explicitly. This did not take the table style case into account, which uses tinting to make a color lighter. Fix the problem by not importing the theme index / effects if tinting is used -- the current doc model is limited to theme index + lum mod/off with effects. This limitation can be removed while text color / fill color effects are not limited to lum mod/off, but also support tinting/shading. Change-Id: I382cc0067518cc262e261a462999170cb7db261b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133908 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-05-05loplugin:unusedvariableplusNoel Grandin
Change-Id: Id93086be1224b6f6bf0bdaa1d50b4f289099027e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133876 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-04simplify lcl_parseHandleRefNoel Grandin
Change-Id: I0a7cb2754ab43b8b627f196c99778b5fa3f2e005 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133808 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-04Just use Any ctor instead of makeAny in ooxStephan Bergmann
Change-Id: Id6c8341b545c819521056926ef1b80d20d148c5f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133795 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-04-29use more string_view in ooxNoel Grandin
found by examining uses of OUString::copy() for likely places Change-Id: I23c397b0438e67e0fdbc1fb4ffa6882aa5e2bf91 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133591 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-29oox: make buSzTx and buFontTx behave the same way as buClrTxXisco Fauli
I believe this is the right thing to do although this is a blind fix, since I couldn't find any file affected Change-Id: I500ceaf11b917abb5e86769b8816ddc2d6dfec6c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133522 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-04-29use more string_view in INetURLObjectNoel Grandin
Change-Id: I4462f7cf4740fa4d1b129d76a0775f4250f41bbd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133555 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-04-28sd theme: add PPTX import for shape fill color effectsMiklos Vajna
This is always direct formatting, so FillProperties::pushToPropMap() always has the needed info at hand. Change-Id: I3317b618e0e8bb7688d0f0fbfe4546e2e8b4e947 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133525 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2022-04-27tdf#148665 Fix crash while loading SmartArt graphicsHossein
The regression introduced by c79fa460fe6220051bbda2d3c0cb67fbf765e2ac causes LibreOffice to crash while loading certain files that contain SmartArt graphics. By loading sample documents from tdf#148665 (docx) and also tdf#148735 (pptx) in a debug session, it became obvious that the problem happens in these statements from TextBody::toString() in textbody.cxx: if (!isEmpty()) return maParagraphs.front()->getRuns().front()->getText(); It is guaranteed that maParagraphs is not empty when trying to call getRuns(), but it is not checked that there are no runs in the first paragraph before trying to call getText(). The isEmpty() function returns false upon finding out that there is at least 1 paragraph. A check is added to TextBody::toString() to prevent a crash. This is the backtrace generated from loading documents from tdf#148735 in a Qt Creator debug session: 1 __GI_raise raise.c 50 0x7ffff79ec03b 2 __GI_abort abort.c 79 0x7ffff79cb859 3 ?? 0x7ffff7846109 4 std::vector<std::shared_ptr<oox::drawingml::TextRun>>::front vector 443 0x7fffd23d1fa6 5 oox::drawingml::TextBody::toString textbody.cxx 92 0x7fffd23d0f85 6 oox::drawingml::DiagramData::secureDataFromShapeToModelAfterDiagramImport datamodel.cxx 295 0x7fffd22d3047 7 oox::drawingml::AdvancedDiagramHelper::doAnchor diagramhelper.cxx 213 0x7fffd22fb92d 8 oox::drawingml::Shape::propagateDiagramHelper shape.cxx 229 0x7fffd2372a27 9 oox::ppt::PPTShape::addShape pptshape.cxx 574 0x7fffd25b2bd4 10 oox::ppt::SlidePersist::createXShapes slidepersist.cxx 150 0x7fffd25d81ea 11 oox::ppt::PresentationFragmentHandler::importSlide presentationfragmenthandler.cxx 404 0x7fffd25c1a78 12 oox::ppt::PresentationFragmentHandler::finalizeImport presentationfragmenthandler.cxx 550 0x7fffd25c3331 13 oox::core::FragmentHandler2::endDocument fragmenthandler2.cxx 53 0x7fffd22364ab 14 sax_fastparser::FastSaxParserImpl::parseStream fastparser.cxx 907 0x7fffe18b2d2b 15 sax_fastparser::FastSaxParser::parseStream fastparser.cxx 1480 0x7fffe18b71d2 16 oox::core::FastParser::parseStream fastparser.cxx 121 0x7fffd221d85b 17 oox::core::FastParser::parseStream fastparser.cxx 129 0x7fffd221d930 18 oox::core::XmlFilterBase::importFragment xmlfilterbase.cxx 413 0x7fffd2248ba5 19 oox::core::XmlFilterBase::importFragment xmlfilterbase.cxx 343 0x7fffd2248687 20 oox::ppt::PowerPointImport::importDocument pptimport.cxx 109 0x7fffd25a89e2 ... <More> Change-Id: I3a40be33061008b93455a5926259ef5b92e4ffe6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133341 Tested-by: Jenkins Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
2022-04-26tdf#53970 PPTX: fix import of linked media filesTünde Tóth
Linked media files were imported as images in documents created with Impress after PPTX export. Change-Id: If4920c2e40f45fff73eca4a5fa987d524177597e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132635 Tested-by: Jenkins Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2022-04-26tdf#147586: Initialize mbBulletColorFollowText to falseXisco Fauli
Otherwise, once it's set to true, it's never reset Change-Id: Ie8a752da4162775f40c2f84f480e6a103eb55942 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133422 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-04-25oox: Remove obsolete TODOXisco Fauli
This can go after 1c924efe1f80207a5e104d755615b1eb9a91d418 < tdf#148685: Unset CharUnderlineColor and CharUnderlineHasColor properties > Change-Id: I9b9540cf0cdcd9ecbb39b92fe24b83a1810df7da Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133382 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-04-22tdf#148685: Unset CharUnderlineColor and CharUnderlineHasColor propertiesXisco Fauli
Change-Id: Iebf482434cd393f55ae3e4690580b573624d78b1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133219 Tested-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
2022-04-22Fix typo in codeAndrea Gelmini
Change-Id: I289162ed8adf93139bbc69e8f5f4a1444dd52199 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133231 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>