summaryrefslogtreecommitdiff
path: root/oox
AgeCommit message (Collapse)Author
2021-03-19tdf#131905 PPTX table export: fix vertical alignmentTibor Nagy
Table cells lost their vertical alignment. Change-Id: Id5ca22550b5613566d7ea2a93e8a36fdca31860d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112171 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
2021-03-18tdf#118693: no need to use convertMm100ToTwip() for line shapes anymoreXisco Fauli
It was introduced in 11129d89b152db54c86bb2bda58c24b8abb6c5a8 < tdf#85232 WPG import: fix handling of line shapes > and later in 36bade04d3780bc54c51b46bb0b63e69789658a5 < tdf106792 Get rid of SvxShapePolyPolygonBezier > ForceMetricToItemPoolMetric was added to SvxShapePolyPolygon::setPropertyValueImpl to convert from 100thmm to twips as can be read in the comment in testTdf85232 With this change, xShape->getPosition().X in testTdf85232 is 2267, which was already in twips Change-Id: I30b757885327a477213f96f8f84541971f435164 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112663 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-03-13add PixelFormat enum that replaces bit count in Bitmap/BitmapExTomaž Vajngerl
Bit count for the image is a numeric value (sal_uInt16) but only a handful of values make sense - namely 1,4,8,24 and 32. This replaces the numeric value with an enum, which only accepts those values and checks the correct values are used at compile time. Change-Id: I0fc137c62bce3b0d021f05019a1648da628521bc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112408 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2021-03-12Drop some unused includesMiklos Vajna
Change-Id: Ic79d81387867f028eb8dc9553fb87f5961d6c771 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112364 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-03-11Revert "tdf#118133 DOCX import: disable lazy-loading of tiff images"Xisco Fauli
This reverts commit fa356008b08a8a5b5556aa8f89ca8f7989c53516 Similar to 1238ca8d100c107656b707ed3a6b662f0a1867fb <Revert "tdf#126310 Disable lazy loading of WMF images> it seems this workaround is no longer needed and lazy-loading works with tiff images. The unittest has not been reverted Change-Id: Ie8debfc2978a4b57aa035679116472c98db89e33 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112162 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-03-10Drop 'static_cast<cppu::OWeakObject*>' syntactic noiseMike Kaganski
... a leftover from 96388e5e809a48573970df9b6b2649517a08447f. Change-Id: I909a470612c421472d8bf94f80e3e94ecb51d6e3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112257 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-03-10tdf#140865 roundtrip pptx wordart 3D, add sp3dRegina Henschel
Change-Id: I446ae4e8c9dd5f2fbf3efe289681339f967c515a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112185 Tested-by: Jenkins Reviewed-by: Regina Henschel <rb.henschel@t-online.de>
2021-03-09Make sal/config.h the first in pchMike Kaganski
By convention, it should be the first include in C/CXX files; so use of pch should not break that. Change-Id: Ic329c5f39e8f48ad1778724368e262e48972342b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112123 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-03-07Revert "tdf#126310 Disable lazy loading of WMF images"Xisco Fauli
This reverts commit 184a4771dad448a37f80b29bc62ad62e0a6a4bb6. Reason for revert: The problem is no longer reproducible as described here: https://bugs.documentfoundation.org/show_bug.cgi?id=138515#c3 It also needs to be reverted in order to get tdf#138515 fixed, although it doesn't fix the problem Change-Id: I7bb678f1a19ae3609064449cfc5e71e0ba8c9de2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111931 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
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