summaryrefslogtreecommitdiff
path: root/oox
AgeCommit message (Collapse)AuthorFilesLines
2022-01-12tdf#146534 pptx import: make Z rotation work with rotation transformSarper Akdemir5-28/+37
Expands previous idea from a9c5c0d814a266096483572b84c72875ef8efd77 (tdf#133037 OOXML shape import: camera rotation along Z) and uses it also for shapes that have a true bUseRotationTransform flag Also fixes same Z rotation exporting twice from InteropGrabBag to both spPr and textBody causing text overrotating on roundtrip. Dropped the export unit test while cherry-picking to cp-6.4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127880 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com> (cherry-picked from commit 8bdd134bef3baca2ebd878163af4e55e5f898efe) Change-Id: If0f192af029ca86b932a63613f961be1f5003c5b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128275 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-12-20VML import: handle <v:imagedata gain="..." blacklevel="...">Miklos Vajna4-0/+57
Map it to (the UNO API of) GraphicDrawMode::Watermark, similar to what the binary import does in SvxMSDffManager::ImportGraphic() and how the drawingML import does it in oox::drawingml::GraphicProperties::pushToPropMap(). On export, the drawingML export is used, and that already maps GraphicDrawMode::Watermark to <a:lum bright="70000" contrast="-70000">. (cherry picked from commit 90556b6df0f6378fb60d7dee18b2f5d275ece530) Conflicts: oox/qa/unit/vml.cxx Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126949 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Conflicts: oox/source/vml/vmlshape.cxx Change-Id: I33986a03bf3d3863da5c5b1f0a2e0da0fa595c9e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127136 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-07-12tdf143222 Handle alternate content of graphicData element.Gülşah Köse3-71/+95
Handle alternate content and make true choice. According to ooxml spec ole object requires exactly one pic element. (ECMA-376 Part 1, Annex A, CT_OleObject). In the current case first choice has not pic element and we should allow fallback processing. Change-Id: I30b7de703b8c2f00d6bf286e05eea505ac3627f2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118539 Tested-by: Jenkins Reviewed-by: Gülşah Köse <gulsah.kose@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118678 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-06-30tdf#59323 tdf#142221: fix pptx datetime import export formatSarper Akdemir2-12/+15
fixed some problems from the original implementation of pptx datetime field formatting (2b0669eec0d86e973a7d8def8744c522bbf8af8b) also the comments on tests seemed to be based on en-IN which seems to differ a lot for SvxDateFormat::StdBig. So converted them to en-US's StdBig. expanded the tests, so it covers previously poorly imported types. Also made them use the SvxDateFormat and SvxTimeFormat Change-Id: I675c482d3095b5373975abb2e6e7eca2d353243d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118104 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Jan Holesovsky <kendy@collabora.com>
2021-06-30ofz#35597 Null-dereference READCaolán McNamara1-13/+21
add a check for null getTextBody() return unfold it a bit while I'm at it Change-Id: Ib0286048536ad576b520e1adb08fa9b36da9243f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117938 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit 00a658ff104623d4e7fc984b5fc82d1a7e2607f2) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117870 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Jan Holesovsky <kendy@collabora.com>
2021-06-23tdf#59323: pptx export: add initial support for lstStyles in textboxesSarper Akdemir2-10/+61
Adds initial support for writing lstStyles that are specific to a shape. Current implementation only writes first paragraph and first textruns properties in it. Made WriteParagraphProperties return a bool that determines whether or not it wrote a pPr tag. Needed this since lvl1pPr tag should be started even if there was no paragraph properties since run properties also written inside it. Change-Id: Ie0cfc9b9f221093db3a1111ca29140a6dfb5e8ad Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117011 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117539 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-06-23tdf#59323: pptx export: add datetime field type helpersSarper Akdemir1-29/+79
Creates helper functions to convert from LO time and date formats to datetime fields on OOXML Change-Id: Ibbfefa18d0422eddb6c37539294ed23e77fe5f22 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117009 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117537 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-06-23tdf#59323: pptx import: import footer fields as propertiesSarper Akdemir2-0/+105
Makes footer, slidenum and datetime placeholders that are inserted to the slides themselves on pptx files imported as slide properties if it is possible to do so without losing information (style, position etc.) If that is not the case and the footers have some special style applied to them that isn't inherited from master slides, fallbacks to the current implementation importing them as shapes. Also since the default way of displaying slide footers in LO use the respective text fields on master slides, information in master/layout slide datetime and footer placeholders respectively get replaced with <date/time> text fields and <footer> text fields. Change-Id: Ib2f7d18103b62c0c9a8453e01cfd2fd1aa1d39af Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117008 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117536 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-06-23cid#1486005 Uninitialized scalar fieldSarper Akdemir1-0/+1
since... commit 2cfccfba09faa5c3bb973136ffe99d534d09c881 Date: Sun May 9 20:56:41 2021 +0300 tdf#59323: ooxml import: hasListStyleOnImport Change-Id: Ib5d557bc0037bb72e9635391d6991fc1d8e5f2a9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117504 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117535 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-06-23tdf#59323: ooxml import: hasListStyleOnImportSarper Akdemir4-0/+15
Introduces hasListStyleOnImport to determine whether or not the textbody had a non-empty lstStyle tag in it on import. Change-Id: Iccb8cfb20e4402e7cadb8e2f2b9a1f6fa178ade4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117007 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117534 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-06-23tdf#59323: ooxml import: hasNoninheritedBodyPropertiesSarper Akdemir3-0/+12
Introduces hasNoninheritedBodyProperties. Change-Id: Id108f692005455376537e515f41528cc66a8c25c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117006 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117533 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-06-23tdf#59323: ooxml import: hasParagraphPropertiesSarper Akdemir5-0/+20
Introduces hasParagraphProperties to determine whether or not there was a pPr tag in the textbody on import. Change-Id: I3c6815e8405b0087f64520ee4e0e39297b3b4548 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117005 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117532 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-06-23tdf#59323: ooxml import: hasVisualRunPropertiesSarper Akdemir7-1/+67
Introduces helper functions to determine whether a shape has non inherited run properties that change it visually. mbHasVisualRunProperties is set on import if there was a run property that alters visual appearance. Change-Id: Ie1e8e22d2757dc8594e7c6c3b8fc1dd7973c92af Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117004 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117531 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-06-23tdf#59323: ooxml import: hasNonInheritedShapePropertiesSarper Akdemir2-0/+6
Introduces hasNonInheritedShapeProperties helper to PPTShape. If the shape has something imported from it's spPr tag mbHasNoninheritedShapeProperties set to true. Change-Id: I0529f1def8d2c32d5bf06172ce44facdde92893c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117003 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117530 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-06-23tdf#59323: ooxml import: add OOXML to LO datetime helperSarper Akdemir2-60/+94
Added static helper functions getLOTimeFormat and getLODateFormat to TextField class for mapping datetime field types to SvxDateFomat and SvxTimeFormat. Change-Id: I9c1553cc89d47855dc7af06a8ea995de01692ded Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117001 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117529 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2021-05-29tdf#96061 Unset the highlight propertyGülşah Köse1-0/+2
When we have highlight property on specific part of the text the following texts were highligthing. To prevent this we unset the highlight property when we have not highlight property anymore. Change-Id: I802cde1c784afe47201a9ba4f41827dd0c705035 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115800 Tested-by: Jenkins Reviewed-by: Gülşah Köse <gulsah.kose@collabora.com> Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116176 Reviewed-by: Andras Timar <andras.timar@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116333 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
2021-04-20tdf#122222: add DOCX export of resolved comments as "done"Mike Kaganski4-0/+8
Since implementation of tdf#119228, Writer comments may have "Resolved" state, which is the equivalent of Word's internal "done" flag. This relies on [MS-DOCX] extensions available since Word 2013. DOCX import will be implemented in a follow-up commit. [MS-DOCX]: https://docs.microsoft.com/en-us/openspecs/office_standards/ms-docx Change-Id: I3be1e8a096bdec41c8268974fe81328480eb0704 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114023 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114328 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
2021-04-14tdf#140489 fix chart display in xlsxSzymon Kłos1-2/+6
Commit 1147383: tdf#114181 XLSX combined chart: fix swapped primary and secondary axes etc. introduced regression by applying axis swaping not only for combined charts. Change-Id: I764399579ff922ddd495540fdd2a39675f2a8da5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113804 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Jan Holesovsky <kendy@collabora.com>
2021-04-14Don't overwrite existing categories for seriesSzymon Kłos1-5/+8
When chart serie has defined categories which are not references we can fail on creating XLabeledDataSequence and in the end overwrite them. Change-Id: Ie8dc76e420fc4a2508df66a6dca80b8023ee895b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113721 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Jan Holesovsky <kendy@collabora.com>
2021-03-25tdf#140714 Import graphics cropped into custom geometry as custom shapes.Gülşah Köse1-2/+4
Change-Id: I2054d24ce41c9f0d6cc1675f461274067c3b2898 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112943 Tested-by: Jenkins Reviewed-by: Jan Holesovsky <kendy@collabora.com> Reviewed-by: Gülşah Köse <gulsah.kose@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113003 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
2021-03-22tdf#118693: no need to use convertMm100ToTwip() for line shapes anymoreXisco Fauli1-8/+1
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> (cherry picked from commit c9e5640c8fcad7beb42a66f9bee0252eee9fe323) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112619 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org> Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112671 (cherry picked from commit ddf13fc815903238c90aa963af7e0ea96fe7280d) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112800 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Andras Timar <andras.timar@collabora.com>
2021-03-10Reset ShapeProperty priority and handle only crop case.Gülşah Köse1-7/+16
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> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112236 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Jan Holesovsky <kendy@collabora.com>
2021-03-01Prevent the unnecessary lclCropGraphic call.Gülşah Köse1-9/+10
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> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111565 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-02-17tdf#134210 Handle greyscale effect on bitmap filled custom shapes.Gülşah Köse1-0/+19
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> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110965 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-02-17tdf#134210 Import crop position of bitmap filled shape.Gülşah Köse2-26/+81
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> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110964 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-02-11tdf#134210 Apply mirror property to custom cropped graphic.Gülşah Köse3-4/+38
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> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110663 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-02-10Fix chart label import, use the locale as MS Office doesAndras Timar1-1/+1
Change-Id: Ic2b9198d37c102721c3043825113567d703d72b3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110630 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Tested-by: Andras Timar <andras.timar@collabora.com> Reviewed-by: Andras Timar <andras.timar@collabora.com>
2021-01-21tdf#134210 Import support for custom stretch values.Gülşah Köse3-3/+36
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109658 Tested-by: Jenkins Reviewed-by: Gülşah Köse <gulsah.kose@collabora.com> (cherry picked from commit 2c96bd26ec488d865370fe9d394e7c4e228e05ab) Change-Id: I33ced8d667e37b7fb79f4c87b689f45966ac0097 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109739 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Gülşah Köse <gulsah.kose@collabora.com>
2021-01-20oox smartart: composite algo: handle right constraint when left+width is givenMiklos Vajna1-0/+42
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. (cherry picked from commit 1359e8c566970fcef860f7ba7f54a07d8e6e0513) Change-Id: I80db290bd1695884ffb7b1eabaffa09462e8883d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109703 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-01-20loplugin:flattenNoel Grandin1-18/+18
(cherry picked from commit 2d582244680e7f6dec6e4a466e276f93ccb01dc9) Change-Id: I6560756eb63856a22b43e3e65a7b7843cd2d5376 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109702 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-01-20oox smartart: extract pyra algo from AlgAtom::layoutShape()Miklos Vajna2-32/+48
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. (cherry picked from commit 318438a680e6bf5c2c592d5e997f6f45a4ae8e5f) Change-Id: I097ac9ed6110536bbeb8a26ab35a8ee8a79d5b33 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109701 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-01-18do not preload all images in the pptx importerLuboš Luňák2-107/+0
Now with my GraphicFilter::MakeGraphicsAvailableThreaded() patches for Impress images will be loaded in parallel as they are needed, which should usually be more efficient than loading all of them immediately. This basically reverts commits: b1319842a49cdf6512bbd9e81081e2a9edbd6089 04e27df3c162f1df02f061b94434a38d1eaa3a46 9eb8e2737d3a4d52ce1b0cc44091a3b7ecf59e3b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107945 Tested-by: Luboš Luňák <l.lunak@collabora.com> Reviewed-by: Luboš Luňák <l.lunak@collabora.com> (cherry picked from commit afa3dff9c7b963f1d312ef8c2efcbc8ab7271e62) Change-Id: I46bb0d6d93fb69f03f464308f6fce1603aafdfd8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109393 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-01-13oox smartart: fix crash in pyra algorithm with a single child shapeMiklos Vajna1-1/+4
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. (cherry picked from commit f2e04fe98e313cffa3f98d55eae641415142a431) Change-Id: Ifd0027e9616b0909dbfde43e1555427b50de4dad Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109223 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-01-13tdf#137417 oox smartart: avoid considering rules in vertical linear layoutsMiklos Vajna1-0/+6
Regression from commit 0024c48b4822062995effed7db4f1281196384bb (oox smartart: consider rules when scaling in linear layout, 2020-07-31), the problem is that I only tested horizontal layouts and this is not working for vertical layouts. Just disable the vertical case for now, to avoid unwanted side effects. (cherry picked from commit c719db99166a7b4770855a9599ec65c70cd256c5) Change-Id: I31a894157996a2371b8d0ec482ee91dc4d5b053e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109222 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-01-13oox smartart: extract snake algo from AlgAtom::layoutShape()Miklos Vajna2-300/+339
AlgAtom::layoutShape() is more or less the single function where all layouting happens for all algoritms. Extract the snake algorithm part from it to a separate SnakeAlg::layoutShapeChildren() before that function grows too large. (cherry picked from commit 99e51aaf2ad216888622a46a625479e1b42946d4) Conflicts: oox/source/drawingml/diagram/diagramlayoutatoms.cxx Change-Id: I5e5ae66d16770fa72db6edf5df4cbd2ef3eea9c2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109221 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2021-01-07replace hard-coded "1.2" ODF version stringsMichael Stahl1-2/+2
Most of these are calls to DocumentDigitalSignatures::createWithVersion(), where it doesn't make a difference if "1.2" or "1.3" is passed in but maybe it will be different with "1.4". There is another ctor createDefault() which looks appropriate for non-ODF contexts and can also be used when no actual signing or verifying is done. In cases where there's an actual document its Storage has the version. Change-Id: Id636bbf965d9f96c7ed5f50774c509032525b2b1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93091 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
2020-12-17tdf#129961 oox: add PPTX export for table shadow as direct formatMiklos Vajna3-13/+32
Custom shapes export shadow as part of WriteShapeEffects(), so use the same for table shapes as well. This needs fixing the effect export up a bit, because table shapes have no interop grab-bag, glow or soft edge properties, but the rest of the code can be shared. (cherry picked from commit 252cdd5f43d65095543e317d37e1a0ea4fd839e0) Conflicts: oox/source/export/drawingml.cxx Change-Id: Icf0b90c5b44e3d9c4115c9f3b0d56ba0852ab640 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107881 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-12-11tdf#129961 oox: add PPTX import for table shadow as direct formatMiklos Vajna3-0/+24
PPTX export and ODP filter is still missing. (cherry picked from commit b273e82aaa916b0f6198097dc32740faced73741) Change-Id: I451b334ada80d9d228b7d7f36b5f26473b575ef6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107595 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-12-11oox: make effectpropertiescontext available to everyone in oox/Miklos Vajna4-7/+4
I plan to use this from oox/source/drawingml/table/tablecontext.cxx for tdf#129961. (cherry picked from commit f2e1685e489c054ea10afc0df52451c74da10cc0) Conflicts: solenv/clang-format/excludelist Change-Id: Id5177467341f9ddf73c6043796ad35e9cc655d37 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107592 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-11-19tdf#136267 OOXML Chart Import: create main category axis labels onceBalazs Varga5-8/+7
because InternalDataProvider can not handle different category names on the primary and secondary category axis. Revert e0b0502516a10181bbd1737b93b38b2bba4c98e8 commit, except the relevant unit test. Regression from commit: e0b0502516a10181bbd1737b93b38b2bba4c98e8 (tdf#128016 Chart OOXML Import: fix duplicated category labels) Also fix tdf#129994 (FILEOPEN - hang at import time), which is a a regression from commit fa0a981af41a2606541eec1cb20a379a739691e0 (tdf#114166 DOCX chart import: fix missing complex categories) Change-Id: I5d049e760eb1a647ea774be264349a2f16f15f5b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102463 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org> Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103617 Tested-by: Jenkins Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106084 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Andras Timar <andras.timar@collabora.com>
2020-11-18tdf#128213 Fix text camera z rotation import and export.Gülşah Köse9-22/+125
Text3DProperties is added to distinguish shape and text 3D effects. Before there was implementation error about text camera z rotation support. We were using shape effects for text. We already have not support shape 3D rotation but we have text camera z rotation. This patch includes import and export filter changes about text camera z rotation. Change-Id: I623392b82edf4585888d2f15ad91ffb2109d8f96 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106033 Tested-by: Jenkins Reviewed-by: Gülşah Köse <gulsah.kose@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106047 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
2020-11-16tdf#138148 Protect aspect ratio of graphic bullets.Gülşah Köse4-2/+53
Change-Id: I166d547cdc01853fd81436c6cdc8d64b0fe817be Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105618 Tested-by: Jenkins Reviewed-by: Gülşah Köse <gulsah.kose@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105912 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
2020-11-05tdf#128213 Fix export rotation problem.Gülşah Köse1-1/+1
Export code has written for case that we have normal rotation angle and camera z rotation together. If object has not normal rotation but have camera z rotation, problem occurs. Camera z rotation info is already exist between <scene3d> tags. If we have not <xfrm rot="..."> (normal rotation angle) we shouldn't add camera rotation here. Change-Id: I1819953c937783d30b6e7ced978758300bb56d7e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105341 Tested-by: Jenkins Reviewed-by: Gülşah Köse <gulsah.kose@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105350 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
2020-11-05tdf#133037 OOXML shape import: camera rotation along ZDaniel Arato (NISZ)4-4/+60
Instead of implementing proper OOXML 3D rotation (which would be an entirely new feature if I understand correctly), I merely interpret attribute "rev" of the rotation element a:camera/a:rot as a directive to rotate the entire shape the usual 2D way. That is already implemented and works well. This isn't the same thing Word does, but it might be good enough for now. This is kind of a mock solution, but it will be very easy to revert if it turns out to cause problems. Note: the export worked well previously, too (moreover, reloading the first LO export fixed the import). Change-Id: I2a99c119880bbed1c5b6430c4638cfbd10b7ac06 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103627 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org> (cherry picked from commit a9c5c0d814a266096483572b84c72875ef8efd77) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105352 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Gülşah Köse <gulsah.kose@collabora.com>
2020-10-07tdf#137023 PPTX import: fix unexpected center alignment of shape text, 2nd tryMiklos Vajna4-5/+35
Regression from commit 10bb02efd8afd42e633e370480104e2575546d8e (tdf#129685 PPTX import: fix unexpected centering of shape text, 2020-09-18), now the problem was that some text should be left aligned, but was centered. Fix the problem by reverting most of the above commit: XML changes, changes to SdImportTest::testTdf113198() (manual testing show that this change is not needed after all) and changes to the TextBodyPropertiesContext ctor in oox/ (but not the testcase itself). Fix tdf#113198 again, this time in Shape::createAndInsert(), which is meant to be closer to what the binary PPT import does. With this, all cases from tdf#104722, tdf#113198, tdf#129685 and tdf#137023 are meant to be handled correctly at the same time. (cherry picked from commit dfa1856cdb4c69985ef1e809d33055427b6fbd76) Change-Id: Id785252c26fc407cd74c9cfb55624091798d7773 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104050 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-09-30oox smartart: snake algo: make sure child shape height stays within parentMiklos Vajna1-6/+28
1) When applying double outside spacing, introduced with commit 0a29c928afa74123bca05dc089c751603d368467 (oox smartart, picture strip: fix lack of spacing around the picture list, 2019-02-26), make sure that is only applied in the direction of a signle row: i.e. the bugdoc case is left/right outer spacing, but no top/bottom spacing. 2) If a child shape has an aspect ratio request, make sure that it only decreases what would be allocated by default, so the children never leave the parent's rectangle. 3) Fix a mis-match between the first and second row, the unexpected small left padding in the second row was because code assumed that all child shapes have the same width; which is not true, when widths come from constraints. With this in place, we finally do a good rendering of the bugdoc, and child shapes are always within the bounds of the background. (cherry picked from commit 71303c5c23bdb385e9f12c0dbe5d2a0818b836ec) Change-Id: Ia2606dcd945402f7dfe17c6e2f261bfd98667022 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103703 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-09-30oox smartart: snake algo: apply constraints on child shape widthsMiklos Vajna1-10/+47
This requires tracking what is the total of the width request of child shapes, then scaling them according to what is the total available width. Additionally, the height of child shapes should be adjusted based on their aspect ratio requests. A related trap is when an (invisible) spacing shape is at the end of the row, that would result in smaller spacing between the rows, so track the max height of shapes inside a single row. With this, finally the 6 child shapes are arranged on 2 rows, not 3 ones. (cherry picked from commit 5d899bf3ee59a226f855c8c56389344862efaa95) Change-Id: I4eb2f06676df11c1432e0934ca3a0ec8891c5843 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103702 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-09-30oox smartart: snake algo: start parsing relative width constraintsMiklos Vajna1-13/+90
This is needed, but not enough to have the correct width for each shape and spacing item on the path of the snake. Currently we give the same width for all children, while the shapes typically have a larger width than the spacings. (cherry picked from commit ab291c94fb5338a1cf0ab8fe7cbf57dd5c5f81cb) Change-Id: I4e2638ea5b566c21cb1cf503a8cf2e5d35256e3c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103701 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-09-30oox smartart: snake algo: consider child's aspect ratio request for cols/rowsMiklos Vajna1-2/+9
If the child's aspect ratio request will shrink the width, then take that into account when calculating how many rows / cols we need. This reduces the number of columns for the bugdoc from 4 to 3, which is needed, but not enough to render it correctly. (cherry picked from commit acc9aead3cc5162379d34a455aa15f7b13907cf1) Change-Id: I1d02df4834b8a2ce97d5e006db0e3135d3d42917 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103700 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2020-09-25fix Graphic duplication in import and add GraphicMapperTomaž Vajngerl4-12/+53
When importing writerfilter, we change to oox when importing images. This transition doesn't store any previous contexts and all instances are reset. The problem occurs when we have identical images because the transition erases all caches we have to determine if an image has already been imported or not, which causes that we import the same image multiple times which create unnecessary copies. This introduces the XGraphicMapper, which can be used to store the XGraphic for a key and can be transferred between writerfilter to oox. With this we can remember which images were already imported and don't create unnecessary internal copies which decreases memory. This also includes a test which checks that the import and export doesn't produce unnecessary copies of identical images. The test checks that for OOXML, ODF and MS Binary formats. Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103283 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> (cherry picked from commit d0efd878dc41e3913a2d91ff4b5c335c1d71a85c) Change-Id: I33dc19218c565937fab77e132b3a996c51358b6e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103407 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>