summaryrefslogtreecommitdiff
path: root/oox
AgeCommit message (Collapse)AuthorFilesLines
2019-09-02tdf#127085: FILESAVE: Transparency is lost after RTTamás Zolnai1-3/+7
Reviewed-on: https://gerrit.libreoffice.org/77963 Tested-by: Jenkins Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com> (cherry picked from commit 505cbb9c3d2771a12c989515663cc1eb73dd0c2f) Change-Id: I22ba83b5cc00f84112a3755898ee2be58337afd6 Reviewed-on: https://gerrit.libreoffice.org/78263 Tested-by: Jenkins Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
2019-08-28warn on load when a document binds an event to a macroCaolán McNamara1-0/+4
a) treat shared/Scripts equivalently to document scripts This doesn't automatically warn/block running those scripts when used in a freshly loaded document on its own however because DocumentMacroMode::checkMacrosOnLoading will see at... if ( m_xData->m_rDocumentAccess.documentStorageHasMacros() || hasMacroLibrary() ) that the document contains no macros and flip the allow macros flag to true so that potentially new uses of macros added by the user during the edit are allowed to run b) so, add an additional flag to indicate existence of use of macros in a document c) for odf import, set it when a script:event-listener tag is encountered d) for html import when registerScriptEvents or SwFormatINetFormat::SetMacroTable is called e) for doc import when Read_F_Macro or StoreMacroCmds is called as well for good measure f) for xls import when registerScriptEvent or ScMacroInfo::SetMacro is called g) for oox import when VbaProject::attachMacros is called Change-Id: Ic1203d8ec7dfc217aa217135033ae9db2888e19b Reviewed-on: https://gerrit.libreoffice.org/77387 Tested-by: Jenkins Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
2019-07-15tdf#126310 Disable lazy loading of WMF imagesGabor Kelemen1-2/+2
Change-Id: I70d271e29bedc640cbfeab187ddb9ffce3e779e6 Reviewed-on: https://gerrit.libreoffice.org/75599 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com> (cherry picked from commit 184a4771dad448a37f80b29bc62ad62e0a6a4bb6) Reviewed-on: https://gerrit.libreoffice.org/75614 Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org> (cherry picked from commit 1c04b5c97ca3b12e52ec55572da77f7b6636e34c) Reviewed-on: https://gerrit.libreoffice.org/75623 Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
2019-06-03SmartArt: more constraints used in linear algorithmGrzegorz Araminowicz1-31/+47
* both width and height of children and space is taken from constraints * better handling of space between children (not lost in some cases) * children centered in the other axis Change-Id: I25b8360790de0292b2b5c313dfa55e58dc042193 Reviewed-on: https://gerrit.libreoffice.org/73201 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/73259
2019-06-03SmartArt: keep parent constraints instead of merging every timeGrzegorz Araminowicz2-20/+8
currently for every node we were additionaly loading constraints from parent node, merging them and then deleting it makes more sense just to keep already loaded constraints from parent node Change-Id: I3fcd669547f24eeeac0b77876950ff7436bd5cb3 Reviewed-on: https://gerrit.libreoffice.org/73116 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/73258
2019-06-03SmartArt: sort shapes by Z order after layout algorithmsGrzegorz Araminowicz2-32/+42
so that they are laid out in correct order Change-Id: I82baa61311197880654d09f356decc666e6fa4c7 Reviewed-on: https://gerrit.libreoffice.org/73094 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/73255
2019-06-03SmartArt: adjust text size to fit shapesGrzegorz Araminowicz1-1/+15
up to maximal size of primFontSz constraint. Do not override text size changed by user. Change-Id: If7ea6bbb96cb839831d877edc274a1b0eefdaf21 Reviewed-on: https://gerrit.libreoffice.org/73050 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/73251
2019-05-31SmartArt: support diagram backgroundGrzegorz Araminowicz3-0/+28
Solved by adding additional shape filling whole diagram. MS PowerPoint does the same when converting SmartArt to shapes. Background shape is also copied when loading from drawingML fallback, appearently there is no background information. Corrected SmartArt import tests, so that they are aware of extra shape. Change-Id: I6154f8e1b34e5867ab582d6fc54459c7c93edbac Reviewed-on: https://gerrit.libreoffice.org/72012 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/73250
2019-05-31tdf#122765: Legend interferes with pie chart after pptx importTamás Zolnai1-2/+1
Revert the commit caused this regression: 0fc41c53dfbd21e526fb0ad68a6651693c4a2ecd The original issue does not come back with reverting this commit. Reviewed-on: https://gerrit.libreoffice.org/72679 Tested-by: Jenkins Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com> (cherry picked from commit 10609749126ca76eaf12904d4cce9cc5a16d8405) Add unit test for tdf#118150. Reviewed-on: https://gerrit.libreoffice.org/72678 Tested-by: Jenkins Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com> (cherry picked from commit a703b4d8842261f55f489c28352df1f53a9b070a) Fix outdated comment. Reviewed-on: https://gerrit.libreoffice.org/72697 Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com> Tested-by: Tamás Zolnai <tamas.zolnai@collabora.com> (cherry picked from commit c43534d5e8d33f73ee4ba70867065be675302579) Change-Id: I666c4f92e3b70b416ec6da7a704298d207451649 cea2c8aacb36e843dad67a056d07d6495fbbb17a 1be6e4cf52ccd385d59f85d9d5fa5b8a47caf4f1 Reviewed-on: https://gerrit.libreoffice.org/72761 Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org> Tested-by: Xisco Faulí <xiscofauli@libreoffice.org> Tested-by: Jenkins Reviewed-by: Andras Timar <andras.timar@collabora.com>
2019-05-22tdf#123106: oox: disable gradient fill grab-bag for PPTXMiklos Vajna1-1/+3
This was added in commit 2fcf3a871c94feeca11619ef5c8c0466ce61eb74 (ooxml: preserve gradient shape fill, 2014-01-31), and assumes that the theme colors can be preserved, as the theme definition is grab-bagged as well. But the theme is grab-bagged only for DOCX, not for PPTX, so skip gradient grab-bag for PPTX, otherwise the gradient would refer to incorrect colors in the theme. Change-Id: I98e1c67d4b10e68916f81dd7fc508eb4146d506b Reviewed-on: https://gerrit.libreoffice.org/67386 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins Reviewed-on: https://gerrit.libreoffice.org/72681 Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
2019-05-22PPTX export: save SmartArt as diagram instead of group of shapesGrzegorz Araminowicz2-0/+321
preserving SmartArt allows editing it in PowerPoint after saving as pptx file * moved common parts for docx and pptx export to oox/drawingml * fixed export tests that expected shapes on output Change-Id: I3e70a9f4177bebf5e1671232f4cd0ef0e7212626 Reviewed-on: https://gerrit.libreoffice.org/69598 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/72474
2019-05-21PPTX import: save also OOXDrawing in InteropGrabBagGrzegorz Araminowicz3-28/+33
Change-Id: Ieaf341dd13e06046044f3523c3aad74476160402 Reviewed-on: https://gerrit.libreoffice.org/69328 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/72473
2019-05-21PPTX import: import SmartArt drawing into single GroupShapeGrzegorz Araminowicz3-8/+6
before that there were imported two GroupShapes: - empty one with properties like id, name, InteropGrapBag - second one with actual shapes also fixed tests that relyed on that behaviour Change-Id: I2b94a53e21666b16725c4353448d75e916e4f9df Reviewed-on: https://gerrit.libreoffice.org/69252 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/72472
2019-05-21PPTX import: save SmartArt markup into InteropGrabBagGrzegorz Araminowicz2-11/+28
it will allow to preserve SmartArt when saving PPTX files Change-Id: I9bb66c59d202b4ce426864599014d042d4aa04b0 Reviewed-on: https://gerrit.libreoffice.org/68916 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/72471
2019-05-21tdf#125360: PPTX: Shape fill transparency is not exportedTamás Zolnai1-10/+39
.. if the original shape fill is defined with a theme Override the alpha value with the current value get from FillTransparence API attirbute even if the color is defined with a style or a color scheme. Reviewed-on: https://gerrit.libreoffice.org/72596 Tested-by: Jenkins Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com> (cherry picked from commit 259d01a34d27df2fbfd11c3bf6fe9dc508ff6ac2) Change-Id: I09d26238a9c2b501279e6749687dc535e614bbd6 Reviewed-on: https://gerrit.libreoffice.org/72618 Tested-by: Jenkins Reviewed-by: Andras Timar <andras.timar@collabora.com>
2019-05-19tdf#125346: PPTX export: Shape has wrong fill color comming from themeTamás Zolnai1-5/+15
Write the correct theme path to the InteropGrabBag, the same path what is generated and checked in the export code. Reviewed-on: https://gerrit.libreoffice.org/72500 Tested-by: Jenkins Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com> (cherry picked from commit a8bba60e8b655167ad91edcd0c2d1723d525b546) Change-Id: I32617c1a11cf3bafb142f7c8839b498aaac49aa0 Reviewed-on: https://gerrit.libreoffice.org/72521 Tested-by: Jenkins Reviewed-by: Andras Timar <andras.timar@collabora.com>
2019-05-17tdf#124398 DOCX drawingML import: handle charts in group shapesMiklos Vajna2-2/+9
Regression from commit 8c73b16f5f18f3bc1dbf9ff6c1475db56b44d304 (DOCX import: declare wpg as a supported feature, 2013-12-05), the problem was that <wpg:graphicFrame> did not forward to to the relevant oox context, and also Writer had no idea how to create a com.sun.star.drawing.OLE2Shape. Fix the later by using the same service name that's in use for the non-groupshape case. (cherry picked from commit fdf4aaa3dc5cc1d2e7a112e6c32d7845f13caef8) Change-Id: Id3536854da7c1f01525bb38d801496ecebd4c161 Reviewed-on: https://gerrit.libreoffice.org/71524 Tested-by: Xisco Faulí <xiscofauli@libreoffice.org> Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-05-15ooxml import: supprt cropping to shapeTamas Bunth3-6/+26
Change-Id: I7bdc959921ecb0cbf19037a78b63eaeb8fc52814 Reviewed-on: https://gerrit.libreoffice.org/72206 Tested-by: Jenkins Reviewed-by: Tamás Bunth <btomi96@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/72310 Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-05-14tdf#124754 sw docx import: do not override text color with -1 (auto) colorSerge Krot1-1/+7
Change-Id: Id821b0d8bef69a7124ee41558e822cf8b025df9d Reviewed-on: https://gerrit.libreoffice.org/72232 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Reviewed-on: https://gerrit.libreoffice.org/72293 Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
2019-05-11PPTX: Fix import / export of image transparencyTamás Zolnai2-3/+8
Reviewed-on: https://gerrit.libreoffice.org/71916 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com> (cherry picked from commit ae3aabdb951643af8d2f7aee9c9f900245e5b384) Change-Id: Ib07c606083b833389fcb82aac57ca8535d6e861f Reviewed-on: https://gerrit.libreoffice.org/72051 Tested-by: Jenkins Reviewed-by: Andras Timar <andras.timar@collabora.com>
2019-04-26ofz#14422 null derefCaolán McNamara1-0/+6
Change-Id: Icd00e2aaa5932564668cd12ce4ee63aecc34419a Reviewed-on: https://gerrit.libreoffice.org/71305 Tested-by: Jenkins Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
2019-04-23tdf#123684 PPTX import: fix wrong background color for <p:sp useBgFill="1">Miklos Vajna1-6/+20
Regression from commit 59339dec1ce56213dc74a06af2f0d35ac1c534d7 (tdf#105150 PPTX import: try harder to handle <p:sp useBgFill="1">, 2017-01-06), the problem was that we gave a white solid fill to a shape which is meant to be transparent. Fix the problem by limiting the scope of the mentioned commit to solid colors only, and also extend to code to look for background fill from the masterpage as well. This allows not hardcoding the white solid fill and leaves the fill style of shapes as transparent where the slide background is a bitmap or other more complex fill type. (cherry picked from commit 943a534ac7cb3df513583e226c986dafd8ba246b) Change-Id: I0063e88d510250652d2b14856df3bd431681422d Reviewed-on: https://gerrit.libreoffice.org/71115 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-03-05Related: tdf#117761 oox smartart: backport fixes related to picture stripMiklos Vajna5-27/+148
This is a combination of 7 commits. This is the 1st commit: oox smartart, picture strip: handle bitmap fill of pres nodes There were two problems here: 1) We did not import bitmap fill from presentation nodes. 2) Presentation nodes contained properties with reference semantics, so if you set a bitmap fill for a first and a second shape, then at the end both shapes contained the second bitmap. With this, both bitmaps are imported exactly once. (cherry picked from commit 333e9ea15bb57cf1c87ac2ea150de1e3fd79cfcb) This is the commit #2: oox smartart, picture strip: fetch # of children only once in snake algo No functional changes intended. (cherry picked from commit 90372d52fdcc378473b89f4e6f2de0e206c110ef) This is the commit #3: oox smartart, picture strip: expose aspect ratio of children for snake algo The aspect ratio request of the Shape is not yet used in AlgAtom::layoutShape(), though. The heavy-lifting is needed, because the number of cols/rows in the snake algorithm depends on the aspect ratio request from the child algorithm, so need to transfer the aspect ratio from child algorithm -> layout node -> shape -> parent algorithm. Still no functional changes intended. (cherry picked from commit a1e10b7968fbf4dba962349be8a6dfb0cb1d3176) This is the commit #4: oox smartart, picture strip: fix too many columns with aspect ratio request The bugdoc has 3 items in the picture strip and PowerPoint laid this out as a single column with 3 rows (as a snake algorithm). We used to put the first two items to the first row and the third item to the second row. Improve out layout by taking into account what aspect ratio the child algorithms request: this way it's obvious that we should use a single column in case we have a large enough aspect ratio and few enough items. (PowerPoint also uses multiple columns without the aspect ratio request.) (cherry picked from commit 159e33ec661b2ce038b2642b2f30600ce7901d1b) This is the commit #5: oox smartart, picture strip: fix lack of spacing around the picture list The snake algorithm in PowerPoint seem to interpret spacing as follows: if you have N elements, then there should be the requested amount of spacing between the elements, and also double amount of spacing around the actual list of elements. With this, the SmartArt and the title shape in the bugdoc no longer overlaps. (cherry picked from commit 0a29c928afa74123bca05dc089c751603d368467) This is the commit #6: oox smartart, picture strip: fix lack of margin in text shapes Shape text has two kind of spacing inside the shape's bounding box: the shape-level margin and the paragraph-level one. Only the second was handled in the tx algorithm so far, add support for the first. The margins taken from constraints were way large by default: the only explanation I found for that is that SmartArt layout sometimes calculates in MMs, sometimes in Points, and the ratio between the two is exactly the Impress / PowerPoint margin. So assume that indeed that unit difference is the reason for the smaller in-PowerPoint margin values and do the same on our side. (cherry picked from commit 279c7f83a57c4d3991930ee80e9d9c287c21270a) This is the commit #7: oox smartart, picture strip: fix too wide child shapes Once the constraints determine the size, the aspect ratio may shrink one dimension to achieve the requested ratio. Implement the case where a >1 ratio shrinks the width, so the container of the image-text shape pair has correct aspect ratio. (cherry picked from commit f4fbb127897ea6afe27055d3b6cfcb0441080902) Change-Id: I7bac764c031e80bac532c4f97ebd5b5096401096 Reviewed-on: https://gerrit.libreoffice.org/68679 Tested-by: Jenkins Reviewed-by: Andras Timar <andras.timar@collabora.com>
2019-03-05tdf#122226 OOXML Chart Import: data label separatorBalazs Varga1-1/+5
Set the data label separator to "new line" if there is not present explicit point separator and the "percentage format wins over number value format". In MS-Office (2007/2010/2013/2016) the defult separator is the "new line" in that case, any other case the separator is a semicolon. (cherry picked from commit de73efb96fbb1d268caea0f41acbe20a234ec59f) (cherry picked from commit 42fd10b0ab6c6f65ba6394f9ae216c0f13973221) Change-Id: I9ee0fb9f98fc1bb322892616af50954f4f8db0f9 Reviewed-on: https://gerrit.libreoffice.org/67758 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2019-03-05tdf#97575 Chart OOXML: Export ShapeProps of Error BarsBalazs Varga1-0/+2
Export the shapeProps (fillstyle, linestyle, linewidth, linecolor etc.) of the Error Bars to OOXML. Change-Id: Iff74fa463fdd0fb6ed95e4d1bf0d3e906349860c Reviewed-on: https://gerrit.libreoffice.org/67825 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org> (cherry picked from commit b89f239aa9d3d4660380bbd0c893aecde0986032) Reviewed-on: https://gerrit.libreoffice.org/67950 Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2019-02-21Related: tdf#117761 oox smartart: backport fixes related to cycle matrixMiklos Vajna5-22/+88
This is a combination of 6 commits. This is the 1st commit: oox smartart, cycle matrix: fix counting presentation children The markup is: <dgm:if name="Name6" axis="ch ch" ptType="node node" st="1 1" cnt="1 0" func="cnt" op="gte" val="1"> Where PowerPoint evaluated the condition to true, but Impress evaluated to false. This means that the undocumented relation between the child lists is "OR" (not "AND"). Also, our code assumed that "node" has to be a data node (not presentation node), but it seems the only way this condition can be true if presentation children is also counted. (The presentation node in question is not a presentation of anything.) (cherry picked from commit e3c6f249c10f7f1bcc528e643f5723288c514b29) This is the commit #2: oox smartart, cycle matrix: handle left/bottom constraint in composite algo The bugdoc has 3 shapes in the "outer" circle which have a position where either x or y is not 0. But these are defined using constraints talking about the right or bottom edge of the shape. Map that to top/left, given that we already know the shape size. (cherry picked from commit b9b4e9223b6c0d6e0b48b694c9aabbe54a250660) This is the commit #3: oox smartart, cycle matrix: fix too large height in composite algo The user-level problem was that the height of the entire smartart was too large. The reason for this was that: - composite algorithm gets the constraint height should be 77% of width, this means 6096000 -> 4693920 EMUs - at the same time the parent container is already smaller, 4064000 EMUs - a few lines later we already limit the max height with std::min(), but in the meantime an incorrect y position is calculated, exactly due to the lack of early limited height Solve the problem by making sure composite algorithm never works with a height (even when using it to calculate vertical center) that exceeds the height of the parent. (cherry picked from commit 5b2e38e0cfc7006d6982f741cf158a8a98dc8630) This is the commit #4: oox smartart, cycle matrix: handle aspect ratio in composite algo This way the 4 quadrant shapes in the center of the SmartArt form a circle, as width is shrinking. It's not height growing, as OOXML spec clearly says "ar" always just shrinks one axis. (>1 and <1 "ar" is to be handled when they are seen in action in an actual document.) (cherry picked from commit 34383064ac061497b0c46c449313877c6b6a2087) This is the commit #5: oox smartart, cycle matrix: handle destination order in connections It is possible to have connections from multiple data nodes to the same presentation node with a presOf type. We use to order these based on as they appear in the data XML, but we need to order them according to the destOrd attribute. Introduce an std::map for that, so get ordering automatically as we iterate. Turn the std::pair into a struct to make the code a bit more readable. (cherry picked from commit ecb733da58b74714eb66d2063a2835ce5c471870) Conflicts: oox/source/drawingml/diagram/diagramlayoutatoms.cxx This is the commit #6: oox smartart, cycle matrix: fix fill and line props of shape The topmost shape may not have 0 depth, but something larger. In that case at least it's safe to still use fill & line properties. The B1 quadrant of the test file now has the proper orange background, and B2's border is also properly orange. (cherry picked from commit 8193e697d286595aa62859011761adeb002244e3) Conflicts: oox/source/drawingml/diagram/diagramlayoutatoms.cxx Change-Id: Iccc5f6993693a0f1cf8f50d163003c24d3ad690e Reviewed-on: https://gerrit.libreoffice.org/68144 Tested-by: Jenkins Reviewed-by: Andras Timar <andras.timar@collabora.com>
2019-02-21tdf#123090 Handle removed column with gridSpan.Gülşah Köse1-17/+60
This is a combination of 3 commits. (cherry picked from commit 48ef20f2039d1a300a4324072e9b712c9994b406) (cherry picked from commit 00e89430a2f8cd1f9ec702a7583a1e4c886a2b46) (cherry picked from commit 1f0206d940cd8f7fb627a59cfe4165c0bfebaf46) Change-Id: Ic6fa6f335623e2114fc8bea76dc54833284d2a02 Reviewed-on: https://gerrit.libreoffice.org/68150 Tested-by: Jenkins Reviewed-by: Andras Timar <andras.timar@collabora.com>
2019-02-16tdf#123400 OOXML Chart: Export Data Label SeparatorBalazs Varga1-0/+11
Export the data label separator XML tag and the separated character to OOXML. Change-Id: I9b3bcb588e42a42494107ebde70f4a72492cfac4 Reviewed-on: https://gerrit.libreoffice.org/67753 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org> (cherry picked from commit e32e5e61b509dcae0462419acfc556d445895840) Reviewed-on: https://gerrit.libreoffice.org/67772 Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
2019-02-08tdf#122091 OOXML Import: Automatically break of X Axis labelsBalazs Varga3-2/+27
Set the TextBreak value automatically true, only if the X axis labels rotation is 0 degree. The MS Office using a similar method because there is no any XML tag in the OOXML standard which refer to this setting. Change-Id: Ie84a95935f0d5c4c1f9a30803e22572141385960 Reviewed-on: https://gerrit.libreoffice.org/65853 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl> (cherry picked from commit 015569fc919b702f7a1b0f09038bafa9f104ca70) Reviewed-on: https://gerrit.libreoffice.org/65934
2019-02-07fix assert seen on opening attachment from tdf#123163Caolán McNamara1-1/+2
I imagine it should have been seqPos-(idPos+2) seems to be like this since the initial commit of commit 091fe76b6329b4bb974987554369cbfadd8f2401 Date: Tue Jun 30 12:55:18 2015 +0300 tdf#87348 implement mso-next-textbox vml-style textbox chaining import Change-Id: Ic2f527ede2102c01c8589d58d8c705d59b0a6ffe Reviewed-on: https://gerrit.libreoffice.org/67453 Tested-by: Jenkins Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
2019-01-28tdf#122563 DOCX import: fix OLE size after roundtripLászló Németh1-1/+3
Embedded XLSX spreadsheets and other OLE objects became small in Writer after a roundtrip between LibO and MSO, caused by the empty drawing path of OLE shapes. Change-Id: I4cd39d4bcd6707cc5a3b8e40dde8c6148a20cabc Reviewed-on: https://gerrit.libreoffice.org/66053 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org> (cherry picked from commit bdb0177b550d27a541cdfc0668714b2e9ac28540) Reviewed-on: https://gerrit.libreoffice.org/66689 Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-01-24Related: tdf#117761 oox smartart: backport fixes related to org chartMiklos Vajna6-28/+238
This is a combination of 10 commits. This is the 1st commit: oox smartart, org chart: add initial hierChild/Root algorithms hierChild is supposed to align and position its child layout nodes in a linear path under the hierRoot layout node, so initially just use a simple vertical layout algorithm. (cherry picked from commit 3103f9f9461f6eabb61a70be73862ef4be98010e) This is the commit #2: oox smartart, org chart: handle multiple elements in hierChild In case one manager has multiple employees, then we laid out only the first one. Recognize non-assistant type as the node type (as a start) to get the correct number of employees (when there are no assistants), and also render employees on a horizontal (and not on a vertical) path. With this, the 1 manager and multiple employees case looks reasonable. (cherry picked from commit dcd378bf614c99d705312259a0a0a25b40d88e2b) This is the commit #3: oox smartart, org chart: fix font color when defined with quick styles createStyleMatrixContext() assumed that <dgm:style> contains <dgm:fontRef>, but it contains <a:fontRef> instead. This resulted in a 0 mnThemedIdx, which meant that since commit 89206c472ecf18bfde6824cea8004921cd404365 (bnc#862510: PPTX import: Wrong text color inside shape, 2014-12-21) we ignored the theme color in oox::drawingml::Shape::createAndInsert(). (cherry picked from commit 5dfd5755c709e91d2903bd7be4582f7832e89780) This is the commit #4: oox smartart, org chart: fix vertical order of assistant nodes It seems the manager -> assistant -> employees ordering is not part of the file format. The order is stored twice in the file: the hierRoot algorithm has 3 layout nodes as a children, and also the data model has an order of the presentation nodes: both describe that employees go before assistant nodes. In contrast to that, PowerPoint orders XML_asst nodes before XML_node ones, so teach the hierRoot algorithm about this. This requires tracking the data model node type for each in-diagram drawingML shape, so that layout can determine if a hierRoot algorithm children has an assistant node or not. (cherry picked from commit 22086e70c4f3bb41620ff81ecaf57fd2af6ccbce) This is the commit #5: oox smartart, org chart: handle multiple paragraphs on data node This problem was similar to the one fixed in cfa76f538a44d4396574ece59e8a3953c22c6eb7 (oox smartart, accent process: handle multiple runs from a data point, 2018-11-21), but this there we handled multiple runs and this handles multiple paragraphs. It seems some smartart types allow multiple paragraphs in a diagram node, others only allow multiple runs. Org chart is in the former category. (cherry picked from commit dfc97dd381ef516ca4a7e99b29f9da1033a380f4) This is the commit #6: oox smartart, org chart: fix height of manager nodes without employees Employees and/or assistants reduce the height of managers -- this effect is wanted even if there are no employees/assistants. (cherry picked from commit 8638cc1b737195df16a160b148d2cd2c68131174) This is the commit #7: oox smartart, org chart: improve width of non-manager nodes The default case is that all managers have assistants/employees, so nodes under a manager can only use the horizontal space under the manager to avoid overlapping. But in case the previous / next sibling of the manager have no child nodes (assistant/employee) then we can use that space to make the child nodes larger. This improves readability of the chart's text a lot and brings the layout closer to what PowerPoint does for the same input. Handle all this in the hierChild algorithm, i.e. the container for a list of assistants or a list of employees, which means "parent" in this context always refers to a manager node. (cherry picked from commit 3a655975e5ea43417885513d0752da3627dd25ed) This is the commit #8: oox smartart, org chart: implement support for hierBranch conditions The relevant part of the layout is the <dgm:layoutNode name="hierChild2"> element that has a <dgm:choose> with two branches: <dgm:if name="Name34" func="var" arg="hierBranch" op="equ" val="std"> <dgm:if name="Name36" func="var" arg="hierBranch" op="equ" val="init"> The connectors were missing as we took the first branch (ConditionAtom::getDecision() returned true if the arg was hierBranch), even hierBranch on the parent layout node was set to "init". With this, the correct number of connectors are created, previously all employee connectors were missing. Their size / position is still incorrect, though. (cherry picked from commit ae34f471030869dfc0da1784597cae6f9131f8c5) This is the commit #9: oox smartart, org chart: fix shape type of connectors PowerPoint renders these as bent connectors, not as arrow shapes. Also add a bit of vertical spacing between the nodes, otherwise the connectors have no way to be visible. Their position is still incorrect, though. (cherry picked from commit 1791e08e9f27453ac5563ef400c715e30c791133) This is the commit #10: oox smartart, org chart: fix position and size of connector shapes Finally the bugdoc rendering result is reasonable and even looks like a tree as it should. (cherry picked from commit 2bfb9117b287a371066a157267614b9bdb367d71) Change-Id: I4e7a729afd3d2c5af2e7f41903737bd56be406fa Reviewed-on: https://gerrit.libreoffice.org/66693 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2018-12-20tdf#121744 XLSX Export Combinated Chart (Column and Line)Jozsef Szakacs1-8/+18
Each of the Column and Line Chart creates it's own x and y Axes. So now the LineChart Exporter Method uses the same Axes as the BarChart. Thanks for the help: - Balazs Varga - Adam Kovacs Change-Id: Ie763cf831c2ce63ef204d1fdcbff634e7ca8fad5 Reviewed-on: https://gerrit.libreoffice.org/64146 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org> Reviewed-on: https://gerrit.libreoffice.org/65449
2018-12-19tdf#121804 DOCX import: handle sub/superscript inside group shapesMiklos Vajna1-0/+11
Regression from commit d5c934d150cb6cea5f96cbbee4fb5e8312bf027e (n#792778 DOCX import: parse group shapes in oox only, 2012-12-14), where where manual wordprocessingML -> drawingML translation did not handle this character property. Change-Id: I87481bc9c26651fd15dd39a58a92f467e8311256 Reviewed-on: https://gerrit.libreoffice.org/65289 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com> (cherry picked from commit dafbc86037d63e938967c0f501bdfe3ae19fa992) Reviewed-on: https://gerrit.libreoffice.org/65413 Tested-by: Xisco Faulí <xiscofauli@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2018-12-18tdf#122090 Chart: Fix OOXML export of X axis labels rotationBalazs Varga1-1/+13
The MS Office UI allows values only in range of [-90,90]. Because of this, we should reflect the angle if the Textrotation is between 90 and 270 degree. Also we have to recalculated the the Textrotation between 270 and 360 degree, because the OOXML counts clockwise. Change-Id: I2fbd53d93ab2e8ea4e26840fd056de20b337daa3 Reviewed-on: https://gerrit.libreoffice.org/65194 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl> (cherry picked from commit 527772d8dfcedad56b11b5b13540ec1defa464e5) Reviewed-on: https://gerrit.libreoffice.org/65351 Reviewed-by: Balazs Varga <balazs.varga991@gmail.com> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2018-12-17oox smartart, accent process: fix missing bullets and large para indentMiklos Vajna1-0/+14
Bulleted paragraphs had a large left indent because we assumed the bullet levels are inherited from the normal master page styles. But that's not true, as <https://support.office.com/en-us/article/add-bullets-to-a-shape-in-a-smartart-graphic-47edc03d-a2f8-4b54-acfd-ca103c515ab4> points out: "It is not possible to change the bullet style for text in a SmartArt graphic." This explains why the margin and bullet char info is missing from the file format, and hints that just hardcoding these to the importer is correct. The result is less linebreaks in the shape text and the lost bullets are also fixed. Change-Id: I60bbee75f3e834551ebb1963a2f42101f3bd91d4 Reviewed-on: https://gerrit.libreoffice.org/65168 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins (cherry picked from commit 6277a767f33bb5327408dafff2fed199087e938d) Reviewed-on: https://gerrit.libreoffice.org/65254
2018-12-17oox smartart, continuous block process: read space width from constraintMiklos Vajna1-13/+16
The information is needed by the linear layout, but it's provided by a child algorithm of type "space", with possibly multiple foreach atoms in-between. So start supporting a custom space factor by reading it from constraints, but still assume a fixed layout node name, as it's tricky to look that up. Change-Id: I2aa8db8823694618d8ca6707ddcd71715a65b831 Reviewed-on: https://gerrit.libreoffice.org/65049 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins (cherry picked from commit ee6787fc5597b7f730c4ee3a1f2a1b261d0a5644) Reviewed-on: https://gerrit.libreoffice.org/65253
2018-12-17oox smartart, accent process: adjust size of connector from constraintsMiklos Vajna3-6/+45
The constraints explicitly said that the width should be larger than the height, but it was the opposite as constraints were not parsed. Unfortunately it would be too brave for globally start handling all constraints which lack a forName, so add a switch to opt in for this, and use that with the conn algorithm. All clients should migrate to bRequireForName=true at some stage, though. Change-Id: I24ae79b141c0f7a11e4d19f141759fc1dd2169b0 Reviewed-on: https://gerrit.libreoffice.org/64350 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins (cherry picked from commit ddc2786831367577967e806d603f337a2e42806a) Reviewed-on: https://gerrit.libreoffice.org/65252
2018-12-17oox smartart, accent process: handle connector shape between pairsMiklos Vajna2-0/+53
The shape was created, but we literally tried to create a "conn" type, while that has to be resolved to the relevant arrow type based on the context. This means now arrows show up between the parent-child pairs (but their size is not yet correct). Change-Id: I82594e46579e4ef723093e1dd0ba31bfcbbec4a0 Reviewed-on: https://gerrit.libreoffice.org/64348 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins (cherry picked from commit 7f66a340933339974b5c6d70af4ae3c17e4f001a) Reviewed-on: https://gerrit.libreoffice.org/65251
2018-12-17oox smartart, accent process: handle followSib axis of forEachMiklos Vajna2-0/+16
Currently the accept process document creates 0 connectors. Instead, it creates empty custom shapes: this commit fixes the loop, so that only one of them is created. The whole purpose of the follow sibling axis is that N - 1 connectors are created for N shapes, not N connectors. Change-Id: I54244c7615b83f607ef53a4ff8d01d3c9594856e Reviewed-on: https://gerrit.libreoffice.org/64122 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins (cherry picked from commit aedc5427e4b6645ff3257e523c33190cf5e1934d) Reviewed-on: https://gerrit.libreoffice.org/65250
2018-12-17oox smartart, accent process: handle multiple runs from a data pointMiklos Vajna1-2/+4
Multiple paragraphs indeed are impossible for those containers, but multiple runs can happen. Change-Id: I47a2f72cae4cbb822f31a5b7cd0169a663e2a6a8 Reviewed-on: https://gerrit.libreoffice.org/63732 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins (cherry picked from commit cfa76f538a44d4396574ece59e8a3953c22c6eb7) Reviewed-on: https://gerrit.libreoffice.org/65249
2018-12-17oox smartart, accent process: fix overlapping shape pairsMiklos Vajna1-1/+1
Linear algorithm had an idea how to take width from constrains, but that was unused for embedded child algorithms. Change-Id: If4c497e053ea0d134a1ffc529f1d233ec4fc50db Reviewed-on: https://gerrit.libreoffice.org/63725 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins (cherry picked from commit 67e062aa5e5946d4985921fe2b6f87766f363ddc) Reviewed-on: https://gerrit.libreoffice.org/65248
2018-12-13tdf#94231 OOXML Import: Fix disappeared Hatch Background ColorBalazs Varga2-5/+6
With adding the PROP_FillBackground property to spnCommonPropIds and spnFilledPropIds the hatch background color imported correctly, an will not disappear. Change-Id: I56745179236d2912a2d5c8585098e54acc4e3062 Reviewed-on: https://gerrit.libreoffice.org/63069 Tested-by: Jenkins Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com> (cherry picked from commit dddcfa0089bc84965d7a2c94f5f738a325cfae78) Reviewed-on: https://gerrit.libreoffice.org/64944 Reviewed-by: László Németh <nemeth@numbertext.org>
2018-11-30tdf#121435 OOXML export: fixing linestyle export in chartsAdam Kovacs1-7/+18
Fixing linestyle export of chart wall (plot area) and chart page. Change-Id: Id5265110352d393d9c3e01ff55cea0770d4e0cef Reviewed-on: https://gerrit.libreoffice.org/63418 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org> Tested-by: László Németh <nemeth@numbertext.org> (cherry picked from commit 5bdc78f65da36d65e94de1e2dde5659f0563f08f) Reviewed-on: https://gerrit.libreoffice.org/64322
2018-11-30tdf#121282, tdf#121279, set text properties also on complex data labelsMarkus Mohrhard1-4/+10
Change-Id: I2304b6050b786b6e4a9a8a968d7a4846d9da8be8 Reviewed-on: https://gerrit.libreoffice.org/64306 Tested-by: Jenkins Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com> (cherry picked from commit 6a04b9298ae993881d20fc4b5aa91516d4df6695) Reviewed-on: https://gerrit.libreoffice.org/64308
2018-11-19tdf#104579, if no data point shape props are set take the series propsMarkus Mohrhard1-0/+4
Change-Id: Ia2c0d6b05385a0f3900e20ef807b869e4098654c Reviewed-on: https://gerrit.libreoffice.org/63541 Tested-by: Jenkins Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com> (cherry picked from commit afe5e1f8de0a25364c8c98b453cfe831330c4eed) Reviewed-on: https://gerrit.libreoffice.org/63543
2018-11-19tdf#102186, don't overwrite the deleted flagMarkus Mohrhard1-2/+2
Change-Id: I3cc69a0baebc55ad52b64960657e9daa4be8f39d Reviewed-on: https://gerrit.libreoffice.org/63510 Tested-by: Jenkins Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com> (cherry picked from commit 4bd2e57653ce22044ab984b06c84f22ef287cecf) Reviewed-on: https://gerrit.libreoffice.org/63512
2018-11-16oox smartart, accent process: add support for zorder offsetsMiklos Vajna3-0/+36
The oox::drawingml::Shape -> css::drawing::XShape converter doesn't support ZOrder, so just give each drawingml::Shape a default ZOrder. This way the offsets can be applied, and sorting can move the shapes to their correct place. This makes parent text of the bugdoc readable. Change-Id: Ib87a096fba66aad4a4f35d19473ea88dab340fd0 Reviewed-on: https://gerrit.libreoffice.org/63478 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2018-11-16tdf#114179: Custom size and position of the chart wallJozsef Szakacs1-1/+7
By Xlsx files, rChartSize is using the Values that it gets from getChartSize(), this is the same Size as rPageSize. By Docx files rChartSize was a negative number everytime, so the calcAbsRectangle Method gave back a 'false' Value because of this. The rPageSize shows at every Debugging, Width = 16000, and Height = 9000 for Docx files, and beacause rChartSize was equal to rPageSize by Xlsx, I tried rChartSize with this Fixed Size. Change-Id: Ia29fa3401475c33c1b5e3dde9c3cb030a02cceb4 Reviewed-on: https://gerrit.libreoffice.org/62991 Reviewed-by: Bartosz Kosiorek <gang65@poczta.onet.pl> Tested-by: Bartosz Kosiorek <gang65@poczta.onet.pl>
2018-11-16loplugin:buriedassign in dbaccess..ooxNoel Grandin3-4/+4
Change-Id: Ic0ca695a1d9d05418213475a68e233953136cc8e Reviewed-on: https://gerrit.libreoffice.org/63468 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>