summaryrefslogtreecommitdiff
path: root/oox
AgeCommit message (Collapse)Author
2021-03-04tdf#139940 oox: mark end before growing largest segment backwardsJustin Luth
This fixes a regression in 7.1 (backported to 7.0.1) caused by commit 73993fdb5d4b507694cd0edf80887d19f7e2bf9a for tdf#134183. The largest segment has already been found, so we know where the next segment starts. Now if we grow it backwards, that shouldn't affect where it ends. So flag the end before growing the start, otherwise we would have to recalculate the end again. Change-Id: Iaae401d0438e533c7498be56f48fa153f7d3ff0a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110004 Tested-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Justin Luth <justin_luth@sil.org>
2021-03-03Reset ShapeProperty priority and handle only crop case.Gülşah Köse
With 2c96bd26ec488d865370fe9d394e7c4e228e05ab we changed the ShapeProperty priority uncessarily. Reset the priority as use FillBitmapName if supported. BlipFillProperties::moFillRect negative GraphicCrop values means stretched. BlipFillProperties::moClipRect positive GraphicCrop values means stretched. We add a control to handle only stretched cases. Change-Id: I2eb1233d0477acf093ada36b4cc29ff34f767037 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111479 Tested-by: Jenkins Reviewed-by: Gülşah Köse <gulsah.kose@collabora.com>
2021-02-25tdf#136570 OOXML import: fix height of OLE objectsAttila Bakos (NISZ)
e.g. OLE icons or math formulas by skipping unset border properties. Regression from 636d16efe45a55c1a5a7a451c46fbb8618bf0393 (tdf#135653 OOXML import: fix OLE background color). Change-Id: I64bd68037d063de81fbb302b90d65b77af50a622 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111119 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2021-02-25tdf#139734 Remove redundant asserts after MacrosTest::loadFromDesktopMoaz
MacrosTest::loadFromDesktop itself asserts on its return value. Thus, the additional checks in unit tests are redundant, and only create noise unrelated to the tested functionality. Change-Id: If616001b296afdde38f5a23ececee3d44b4a395d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111290 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-02-24Prevent the unnecessary lclCropGraphic call.Gülşah Köse
In case text::GraphicCrop aGraphCrop( 0, 0, 0, 0 ) we don't need to call lclCropGraphic. Change-Id: I9960900f9b5c5b770824c76ffeb9ec9b51cbaef3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111401 Tested-by: Jenkins Reviewed-by: Gülşah Köse <gulsah.kose@collabora.com>
2021-02-22oox: VML export: write o:allowincell attribute on shapesMichael Stahl
Apparently the default is "t", which causes a fly that is anchored at-page with the first content on the page being a table to be wrongly positioned. Change-Id: Iba1b961c6e884b2a55928952937187732ef73a5a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111336 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-02-21loplugin:refcounting in oox..i18npoolNoel
Change-Id: Iff904a7ac887fa9b77bea87dbb1012281848a540 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111278 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-02-19update pchesCaolán McNamara
Change-Id: Ic4586057346b6de700c1bb6ff4cd759a11bb3e4d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111231 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-02-16Fix index out of range when vml-shape-types is missingMike Kaganski
See https://lists.freedesktop.org/archives/libreoffice/2021-February/086844.html Change-Id: Id38061c03dc80700872b41f54c679ee3120df9f2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110988 Tested-by: Xisco Fauli <xiscofauli@libreoffice.org> Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-02-16loplugin:referencecasting in oox..packageNoel
Change-Id: I4276c6c45cb2478afbc0231a15c402ddcafd00a7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110950 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-02-14Move unit conversion code to o3tl, and unify on that in more placesMike Kaganski
This also allows to easily add more units, both of length and for other unit categories. The conversion for "Line" unit (312 twip) is questionable. Corresponding entries in aImplFactor in vcl/source/control/field.cxx were inconsistent (45/11 in; 10/13 pc; 156/10 pt). They were added without explanation in commit c85db626029fd8a5e0dfcb312937279df32339a0. I haven't found a spec of the unit (https://en.wikipedia.org/wiki/Line_(unit) is not specific). I used the definition based on "by pt", "by mm/100", "by char" (they all were consistent); "by pc" seems inverted; "by twip" was half as much. This accepted conversion makes unit test for tdf#79236 pass. Change-Id: Iae5a21d915fa8e934a1f47f8ba9f6df03b79a9fd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110839 Tested-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-02-11Fix typoAndrea Gelmini
Extending this: https://gerrit.libreoffice.org/c/core/+/110707 Change-Id: I4bfd3f85501d881810cfd4731e0ab84f404d1896 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110752 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-02-11Fix typoAndrea Gelmini
Change-Id: Ie307727fdbc5c748c2ef249f10012a7b81c6803b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110731 Tested-by: Jenkins Reviewed-by: Gülşah Köse <gulsah.kose@collabora.com>
2021-02-11loplugin:refcounting generalise type checkingNoel
Change-Id: Ia013878ac9c2918d8eaf9aab16b291d8211e708f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110700 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-02-10Fix loplugin:stringliteralvarStephan Bergmann
...detection of OUString( const sal_Unicode * value, sal_Int32 length ) ctor. (On platforms where sal_Int32 is a typedef for int, an argument that already is of type int will not be wrapped in an ImplicitCastExpr to the sal_Int32 typedef.) Change-Id: Ifc5456a62d42c1acad76ea949549dc24bd67201a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110654 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-02-10Fix chart label import, use the locale as MS Office doesAndras Timar
Change-Id: Ic2b9198d37c102721c3043825113567d703d72b3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110674 Tested-by: Jenkins Reviewed-by: Andras Timar <andras.timar@collabora.com>
2021-02-10tdf#134210 Handle greyscale effect on bitmap filled custom shapes.Gülşah Köse
Change-Id: Ia4a0828dad80e32cc0c7fe12227ffca717d62e03 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110572 Tested-by: Jenkins Reviewed-by: Gülşah Köse <gulsah.kose@collabora.com>
2021-02-10pass FastAttributeList around by rtl::ReferenceNoel
Change-Id: I958a22f60975c74dfaeb8469b4c0cd3759d40130 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110653 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-02-10tdf#134210 Import crop position of bitmap filled shape.Gülşah Köse
Change-Id: I6a62d68cd0f57e53934851a2f53dae05bf7d3730 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110262 Tested-by: Jenkins Reviewed-by: Gülşah Köse <gulsah.kose@collabora.com>
2021-02-08Remove unneeded breaksAndrea Gelmini
Extending this: https://gerrit.libreoffice.org/c/core/+/110512 Change-Id: I1c5bfcddeb0f5619dc848bbf02408cf166bebc8e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110521 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2021-02-08update pchesCaolán McNamara
Change-Id: Icf55ddda055d11b649e7607c2cdd8b6d6ddfefbc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110483 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-02-08oox: prefix VML shapetype ids with _x0000_tMichael Stahl
Word 2013 refuses to even load a file that has a <v:shapetype id="shapetype_75"> on some form control shape, reporting a misleading error in a location far later when the top-level w:tbl that contains the shape ends. Using id="_x0000_t75" appears to work, so let's do that then. Couldn't find any documentation on why this is so. Change-Id: Ie22bb04244e24b00a1880544872ae8e281422405 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110493 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
2021-02-08tdf#94235 Add support for series name in data series labelsSamuel Mehrbrodt
including ODF/OOXML import/export (and test) Change-Id: Id5a5194630a67476f7c5390294400a00ea3ad42d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110338 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
2021-02-06Use more conversion functions from <tools/UnitConversion.hxx>Mike Kaganski
This unifies conversion functions to provide both floating-point and integral overloads, with correct rounding for the latter. Also sanitizing code it templatized to allow reuse if needed. Change-Id: Ibe1c9fe4d5baa226c600445779dbaf7dc41a02cb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110487 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-02-05Make sanitiseMm100ToTwip simpler and more correctMike Kaganski
The result's absolute value is always smaller than n. Returning an uncorrected value taken from reversing multiplication and division order when intermediate value would overflow is better than arbitrary constant. Also further deduplicate Twips <-> 100th-mm conversion, and make sure they all are in a single header. Using conversion implementation that handles negatives correctly improves accuracy, as seen in unit tests; e.g. in testPictureEffectPreservation (the original doc had "dir" equal to "8100000", while we tested that it was "8076614" after roundtrip). Change-Id: Icd027af6238a9f45f916f53f8684506cc959e696 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110433 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-02-04Fix -Wmaybe-uninitializeddante
Any operator >>= does not guarantee initialization. (code was introduced with <https://git.libreoffice.org/core/+/11e52fe2979b0947814a49b9c17ec373795cbf8e%5E!/> "introduce Degree100 strong_int type") .../libreoffice/oox/source/export/drawingml.cxx: In member function ‘void oox::drawingml::DrawingML::WriteShapeTransformation(const com::sun::star::uno::Reference<com::sun::star::drawing::XShape>&, sal_Int32, bool, bool, bool, bool, bool)’: ...s/libreoffice/oox/source/export/drawingml.cxx:1790:79: warning: ‘nTmp’ may be used uninitialized in this function [-Wmaybe-uninitialized] 1790 | nCameraRotation = NormAngle36000(Degree100(nTmp / -600)); Change-Id: I93bee48bc050c29d831e78afcf62aef154c72fc5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110341 Tested-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-02-04have one set of twips<->mm conversionsNoel
Change-Id: I510f4a0524a7c72eb124cba103cbf398024976d3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110407 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-02-04use more getSdrObjectFromXShapeNoel
Change-Id: Ia237643ab040425f231f781c86e7e060f0b53717 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110400 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-01-29loplugin:stringviewparam extend to new..Noel
O[U]StringBuffer methods Change-Id: I0ffbc33d54ae7c98b5652434f3370ee4f819f6f4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110090 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-01-28simplify code, use more subView()Noel
Change-Id: I569c7f34acbdf8451cd5c9acf1abd334637072d1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110051 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-01-28tdf#134210 Apply mirror property to custom cropped graphic.Gülşah Köse
Change-Id: I5bf2ba8fa432af8b6a560cc60c18bef799834fd0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110039 Tested-by: Jenkins Reviewed-by: Gülşah Köse <gulsah.kose@collabora.com>
2021-01-28add string_view variants of methods to O[U]StringBufferNoel
and update the stringview loplugin to detect cases where we can use these new methods. Change-Id: I998efe02e35c8efcb3abfb4d7186165bbe6dfb2c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110046 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-01-27PPTX filter: fix lost is-narration property for slide narrationsMiklos Vajna
Otherwise removing narrations don't work in powerpoint, it would say there are no narrations, just plain media shapes. Change-Id: Ibd0478540ac018bc23f81223846518b3bf7c7c2a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110016 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-01-26[API CHANGE] PPTX filter: fix lost hide-while-show prop for slide narrationsMiklos Vajna
The OOXML markup is <p:cMediaNode ... showWhenStopped="0">, but the UI uses "Hide During Show", which is easier to understand, so use the second naming in the code. With this, the PPTX no longer makes the speaker bitmaps on slides visible while projecting. API change, because the animation node is only available via UNO, though it's likely that no actual external code would ever interact with it directly. (And also add a stub Narration attribute, so that can be implemented in a follow-up commit without an API change.) Change-Id: Ia90a2fb30c2bfdb4cff2901fe11bdf1d4ab38261 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109969 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-01-26cid#1472266 silence Using invalid iteratorCaolán McNamara
Change-Id: I5d332a7f0c718614ad8e07408161e214c4d9d876 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109966 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-01-26loplugin:passstuffbyrefNoel
Change-Id: I330e0ab6c9955939dad313f9d472f93e39dbd313 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109924 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-01-24cid#1472266 silence Using invalid iteratorCaolán McNamara
Change-Id: Ibb2e139d60496925ef96f13b15bae4bfb0bd0c67 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109845 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-01-22PPTX filter: fix playFrom command handling for slide narrationsMiklos Vajna
The import side went wrong in commit 812ee7a6dc29b55acfbeaa1a43e632adbaf72e6b (Removal rtl and string cleanup, 2012-12-31), which turned a prefix check into an equality check. The export side ignored the command parameters, now we write 'playFrom' instead of 'play' in case we have a start timestamp. Change-Id: Ia7e058e17400b1efbf7a6254355a70c4a5e15dbe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109825 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-01-22PPTX export: fix size of shape for slide narrationsMiklos Vajna
This was invisible in PowerPoint without explicit stretching. Change-Id: I29b9f23eba6d59436cb1b6d15c9840794f932e69 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109778 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-01-21tdf#134210 Import support for custom stretch values.Gülşah Köse
Change-Id: I33ced8d667e37b7fb79f4c87b689f45966ac0097 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109658 Tested-by: Jenkins Reviewed-by: Gülşah Köse <gulsah.kose@collabora.com>
2021-01-20oox smartart: extract composite algo from AlgAtom::layoutShape()Miklos Vajna
AlgAtom::layoutShape() is more or less the single function where all layouting happens for all algoritms. Extract the composite algorithm part from it to a separate CompositeAlg::layoutShapeChildren() before that function grows too large. This also allows making it clear that some local functions are only meant to be used with the composite algorithm. Change-Id: Iccfd5ea0dcca2f531dae14cbed3e900d4ffd9cc8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109668 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-01-20tdf#128550 set sub item on the ancestor node.Mark Hung
The target of a animation node may resolved to a subitem. However it only has effect on a iterate container or animate node, not on any other containers. Subitem setting like background and paragraph got ignored, so everything were shown together. The patch find the ancestor node that is iterate container or animate, and set the subitem on it. Change-Id: Iaaa52aed3a34eb2d70b3b318b8336246e17e1e98 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109444 Tested-by: Jenkins Reviewed-by: Mark Hung <marklh9@gmail.com>
2021-01-19oox smartart: composite algo: handle right constraint when left+width is givenMiklos Vajna
The bugdoc had this constraint: <dgm:constr type="l" for="ch" forName="text" refType="r" refFor="ch" refForName="img"/> While img has no "r", it has: <dgm:constr type="w" for="ch" forName="img" refType="w" refFor="ch" refForName="box" fact="0.2"/> <dgm:constr type="l" for="ch" forName="img" refType="h" refFor="ch" refForName="box" fact="0.1"/> Which is enough to fix the x position of the text to not overlap with img. Change-Id: I80db290bd1695884ffb7b1eabaffa09462e8883d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109642 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-01-16make the Color constructors explicitly specify transparencyNoel
to reduce the churn, we leave the existing constructor in place, and add a clang plugin to detect when the value passed to the existing constructor may contain transparency/alpha data. i.e. we leave expressions like Color(0xffffff) alone, but warn about any non-constant expression, and any expression like Color(0xff000000) Change-Id: Id2ce58e08882d9b7bd0b9f88eca97359dcdbcc8c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109362 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-01-16PPTX export: fix mime type of slide narrationsMiklos Vajna
Import was working already for the audio stream. Change-Id: I43ac6561c4e39decfd99587e489cb2888805bb0c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109374 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-01-15tdf#61028 OOXML export: fix lost arcTo shapeTünde Tóth
a:custGeom was exported without the a:arcTo element and its attributes. Note: see customshapegeometry.cxx for import of a:arcTo attributes. Change-Id: I611ea9fb6a81d45cfd52a16abbb37071ea0ce7d1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108874 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2021-01-13oox smartart: extract pyra algo from AlgAtom::layoutShape()Miklos Vajna
AlgAtom::layoutShape() is more or less the single function where all layouting happens for all algoritms. Extract the pyra algorithm part from it to a separate PyraAlg::layoutShapeChildren() before that function grows too large. Change-Id: I097ac9ed6110536bbeb8a26ab35a8ee8a79d5b33 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109231 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2021-01-12transparency->alpha in tools::ColorNoel
this just changes the Get/Set methods, the constructor and internal representation of Color is not changed. Change-Id: Idb6e07cc08bbaa5bd55b6bd4b585e648aef507b6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109074 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-01-12oox smartart: fix crash in pyra algorithm with a single child shapeMiklos Vajna
Regression from commit 14a56533ff2c9c859d22cd3039ada75b99e94bc0 (SmartArt Pyramid: Now lays out shapes, 2018-07-10), the added pyramid algorithm by first centering the topmost children, then decrementing the horizontal postion of each additional shape, with the end goal of having 0 horizontal position of the last children. This means that simply avoiding the division in the 1-child case leads to correct results, because in this case the only child is also the last child at the sane time. Change-Id: Ifd0027e9616b0909dbfde43e1555427b50de4dad Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109161 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-01-10fix coverity parse errorsCaolán McNamara
Change-Id: I4884bfb67a061b865e8cf38b2fea6de0cb1bc3d6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109057 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>