summaryrefslogtreecommitdiff
path: root/oox
AgeCommit message (Collapse)Author
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>
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-24tdf#149311 PPTX export: fix internal hyperlink on textsTibor Nagy
by converting "Slide [digits]" URLs to slide[digits].xml See also commit 4142d728f003166ebe520bfdaf672505e585b807 "tdf#149314 PPTX import: fix internal hyperlink on texts". Change-Id: I39e095c960b04e728b3e28fa0a657d37d9c71ba1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135250 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
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-23tdf#149314 PPTX import: fix internal hyperlink in editorTibor Nagy
Hyperlinks on text weren't imported correctly if the linked slides have default slide name, resulting broken links in the editor (hyperlinks work well in slide shows without this fix, too). Change-Id: I797fa94134c1346bc83729c713e65b2a268a14c2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135245 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2022-06-23tdf#149126 fix export of PPTX preset shapesTibor Nagy
Follow-up to commit 63cd67e5e18f01aca303131e148c80398a181a41 "tdf#92525 tdf#142398: fix export of simple custom shapes" and commit 744e6c0b758fefe6011f09860b44f03ab70fbcfe "tdf#147459 PPTX: add "glue points" to some basic shapes". Thanks to Regina Henschel for the code pointer. Change-Id: I378ffffc2ba09fcffcaa4e5dcf74bfd19e9f704d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135361 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
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-22remove OptValue(bool,Type) constructorNoel Grandin
as a step towards converting it to std::optional Change-Id: I6f377967f2a495d8c29979444607c991aaaf5d63 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136267 Tested-by: Jenkins 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-13crashtesting: assert seen on loading forum-mso-en-2633.pptxCaolán McNamara
probably since: commit 855a56fea4561135a63cb729d7a625a950b210e7 Date: Fri May 13 08:12:17 2022 +0200 tdf#148965 PPTX import: fix internal hyperlinks on shapes Change-Id: I920cbbb5544cbe9d76f37b3d524c9ccebd426132 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135682 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
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-31tdf#147991 PPTX export: fix bullet indent regressionAttila Bakos (NISZ)
Instead of exporting the inherited master slide indent values of the placeholders, export 0 indent value for removed/disabled bullets to fix interoperability. Regression from commit f57cfddb51b7d7409b7b425dc200aa73406a13bd "tdf#145162 PPTX export: fix extra bullet regression". Change-Id: Icbf823adc07f19fd10d1a60da9cff17616a2aef6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135025 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2022-05-31Revert 6eeb0942c35f07dfbadb13f35fc6aa3703dac945Thorsten Behrens
Change-Id: I096f25d38f19fb728110e209a189f89a8e8d402f
2022-05-30tdf#149128 PPTX export: fix <stCxn> and <endCxn> connector propertiesTibor Nagy
to avoid of detaching connections between shapes, when these connections were created in Impress. Change-Id: I1bc90bb8a408546b303b70bcfb27d3549d5e72d3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134940 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2022-05-27tdf#148965 PPTX import: fix internal hyperlinks on shapesTibor Nagy
Locale dependent code path resulted broken hyperlinks on shapes in a non-English build. Change-Id: I045bbe4246ab5336e2b967bf252b5fbca5b17706 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134266 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2022-05-27tdf#149124 PPTX import: fix broken connectors in grouped shapesTibor Nagy
Previously connector lines of grouped shapes were detached after the import losing the original layout (without ungrouping and moving the shapes). Change-Id: I660629d9d1c2cb0ab68de275ca5406f4c48e9145 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134943 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
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-24Use o3tl::make_unsigned in some placesStephan Bergmann
...where a signed and an unsigned value are compared, and the signed value has just been proven to be non-negative here Change-Id: I20600d61a5d59d739bc1bee838c0038e4611aec2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134875 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-05-23tdf#66228 PPTX export: fix lost U-shaped connectorsTibor Nagy
which were replaced with straight connector lines. The "Line Connector" has no equivalent in OOXML. So far it has been saved as a "Straight connector". In most cases, the better solution is to change it to "Standard connector", keeping the original layout with U-shaped connectors. Change-Id: I9d6b6174d0556ba2478c6a9837c500b3cc794c82 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134284 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
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-13add SvStream::ReadLine(OStringBuffer... to reduce OString allocationNoel Grandin
and use it where possible Change-Id: I3efc7a642f73661ce606c917c0323ba9948521c6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134265 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2022-05-12tdf#148961 sd theme: add PPTX export for shape fill color effectsMiklos Vajna
Which allows taking the fill color theme index from the model even in case there are effects. Previously effects meant reading from the grab-bag, and only the no-effect case read the color theme index from the doc model. Change-Id: Ib50c3128b971a388f14ad721ed7f73043916a736 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134208 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
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-10tdf#147919 PPTX export: fix curved and bent connector shapeTibor Nagy
by calculating and exporting adjustment values to avoid of connector lines with bad turns overlapping the connected shapes. Change-Id: I0441508f4fe98b3482e2955df5f41f2cfc2ffb4e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134109 Tested-by: Jenkins Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2022-05-07Revert "tdf#147919 PPTX export: fix curved and bent connector shape"Stephan Bergmann
This reverts commit 1f8c6efbfea10997f188962d036f5c7db4c13f8a, as it caues > warn:legacy.tools:12871:12871:tools/source/generic/poly.cxx:1581: Polygon::[]: nPos >= nPoints > ================================================================= > ==12871==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x603000445080 at pc 0x7f6303ec7854 bp 0x7ffd23271600 sp 0x7ffd232715f8 > READ of size 8 at 0x603000445080 thread T0 > #0 0x7f6303ec7853 in Point::X() const /include/tools/gen.hxx:83:51 > #1 0x7f63045baaa1 in oox::drawingml::lcl_GetConnectorAdjustValue(com::sun::star::uno::Reference<com::sun::star::drawing::XShape> const&, tools::Polygon, com::sun::star::drawing::ConnectorType, std::__debug::vector<std::pair<int, int>, std::allocator<std::pair<int, int> > >&) /oox/source/export/shapes.cxx:1556:27 > #2 0x7f63045b731f in oox::drawingml::ShapeExport::WriteConnectorShape(com::sun::star::uno::Reference<com::sun::star::drawing::XShape> const&) /oox/source/export/shapes.cxx:1701:13 > #3 0x7f63045984e7 in oox::drawingml::ShapeExport::WriteShape(com::sun::star::uno::Reference<com::sun::star::drawing::XShape> const&) /oox/source/export/shapes.cxx:1956:5 > #4 0x7f62b399ad3b in oox::core::PowerPointExport::WriteShapeTree(std::shared_ptr<sax_fastparser::FastSerializerHelper> const&, PageType, bool) /sd/source/filter/eppt/pptx-epptooxml.cxx:1658:22 during CppunitTest_sd_export_tests-ooxml3 CPPUNIT_TEST_NAME=SdOOXMLExportTest3::testTdf114848 (<https://ci.libreoffice.org/job/lo_ubsan/2388/consoleFull#-1714579836d893063f-7f3d-4b7e-b56f-4e0f225817cd>) Change-Id: I7eab9d3ef8e6604a57d3e59a77905edf6ce6e6ac Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133870 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.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>