summaryrefslogtreecommitdiff
path: root/oox/source/drawingml/diagram/diagram.hxx
AgeCommit message (Collapse)Author
2024-06-01Advanced Diagram support: Load fill DiagramModelArmin Le Grand (allotropia)
In the case the input file does have a graphical representation of the Diagram as image file, the DiagramModel was not fully loaded. For being able to edit the Diagram in the future it is necessary to re-create the geometry, thus a full model is needed. Needed to know at recreation if this is the first time the geometry gets self-created using the layout/creation mechanism to decide if to apply the style or use the saved/reapplyable data from secure/restoreDataFromShapeToModelAfterDiagramImport mechanism, added that. Change-Id: Icb7590306ab59728e83b800b8637333e0d372de5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168223 Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com> Tested-by: Jenkins
2022-04-20Advanced Diagram support: Use better association Model<->XShapeArmin Le Grand (Allotropia)
To have a more direct and more reliable association between the XShape/oox::Shape and the model data svx::diagram::Point I added optional usage of the Model-UUID for that at the oox::Shape. Also added a 'fake' UUID to work with the BackgroundShape's attributes. Changed all preserve/rescue code to work based on that. Also cleanups/comments and preparations of some flags in the Diagram ModelData to steer behaviour on re-ceration. Change-Id: Ie30effdff34dcdbbc79a766de09157b2a3bd97d3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133168 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2022-04-14Advanced Diagram support: Secure properties at Diagram ModelDataArmin Le Grand (Allotropia)
Additionally to the Text/Attributes already saved/secured after Diagram import, secure more data that is part of the Diagram ModelData. This is about attributes (e.g. FillStyle/LineStyle, TextAttributes, ...) in UNO API formt that will be secured/ attached to the Diagram ModelData in it's svx::diagram::Point structure. This is done for all those entries for which a XShape will/ would be incarnated, thus associated to entries that will get a visualization, including the BackgroundObject. From that data, at re-creation time, the attributes can be re-applied to the re-created XShape(s), also after changes to the Diagram Model Data (e.g. Add/Remove). This is - besides the already added securing of the Style/ Theme - a 2nd method for lossless re-creation. For the BackgroundObject - if it has FillStyles - it is even the only method to secure that data and thus necessary for that case. The selection of atributes that gets secured is minimal for now and may/need to be extended for existing cases accordingly. Change-Id: Ie9b72b9b9135113cf858d57fe6cd8622d736c4a4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132976 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2022-03-31Advanced Diagram support: Move class DiagramData to svx AFAPArmin Le Grand (Allotropia)
Splitted and moved parts of DiagramData class to svx as peparation to access from there. Done as pure virtual class so that no incarnations will be possible, also made the constructor protected. The derived class in oox hosts all functionality/data which involves usage/modification of oox::Shape class. That way we get closer to get the Diagram DataModel isloated/seperated. Not-yet moved is the String/Text holding data, it's still in oox. Moving that one will be next, that will allow to migrate quite some more functionalty to svx. Change-Id: I389dbf3ebf6171b8175cf30be7bbc8c20d9a38e1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132303 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2022-03-28Advanced Diagram support: Move data classes to svxArmin Le Grand (Allotropia)
As preparation for own im/export move data classes for which that is now possible to svx Made TypeConstant more safe, also sorted it. Corrected an error there. Secured TypeConstant usage by identifying usages (mnType -> mnXMLType). Had to convert from oox::OptValue to std::optional since 1st is not available in svx in datamodelcontext.cxx. That makes the test work and the test-file load corrrectly. Change-Id: Ifee008caf486ddb6b52a347dc08e7e053c49ef49 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132195 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2022-03-04Advanced Diagram support: Allow reLayout without keeping oox::ShapeArmin Le Grand (Allotropia)
Goal is to minimize dependencies on oox classes. For that pupose I redesigned the Diagram class to work without remembering an oox::Shape at all. For reLayout, a new temporary one is created and used. That was a bit tricky, I needed to find out what data at the oox::Shape is needed to sucessfully do that with the not-originally-imported one. Another necessary change was to move the DiagramFontHeights adapting mechanism away from oox::Shape, too. It fits better to Diagram class. That way it can also be used for reLayout and the oox::Shape gets a little bit smaller, too. This opens the path to move needed Mode-Data Diagam core claasses to other libs where changing/im/exPorting them will be possible. Change-Id: I40bc4b190d2abc797f5c56f9e476d22155d21422 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131004 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2022-02-25Advanced Diagram support: cleanup/consolidate with existing codeArmin Le Grand (Allotropia)
Reorganized and streamlined, use IDiagramHelper as main interface now also for existing code. Had to adapt oox::Shape && Diagram handling since there the import gets handled very different. This ensures that a Diagram is detected at export and that the same happens for now as before Had to add a detection that resetting the GrabBag is meant to disable the Diagam functionality. That is very indirect, but has to stay for compaibility reasons for now Change-Id: I620b7d61cd84b5f9dd8ae4dc890ebf70ce779cdf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130389 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
2022-02-24tdf#147609 and ofz#44965 Indirect-leakCaolán McNamara
Change-Id: I2fb89bf68d8df2da1b97942d70c386f62f61c64f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130413 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com> 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>
2020-10-06loplugin:const* make some params and methods constNoel
Change-Id: Idec482c21c270912f9bcaeb980077c1616f67c8c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104022 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-09-11oox smartart: add support for syncing font heights of multiple shapesMiklos Vajna
When 2 or more shapes have their text set to autofit and they have a constraint like: <dgm:constr type="primFontSz" for="des" forName="node" op="equ"/> Then make sure that the automatic font size is the same for all shapes and all content fits, by using the smallest scaling factor from all relevant shapes. Some rework is needed, because normally oox::drawingml::Shapes don't have access to their parents, at the same time there can be multiple SmartArts on a single slide, so storing the grouping info in the filter is problematic, too. Solve this by storing the grouping in the toplevel oox::drawingml::Shape and exposing them in XmlFilterBase just during the time the children of the toplevel shape of the SmartArt are added. This works, because we know SmartArts can't be nested. Change-Id: I6c591eadc7166c7c42752650afdb7ee1e416cff6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102490 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2020-05-22smartart import: handle multiple <a:schemeClr> in <dgm:fillClrLst>Miklos Vajna
The TODO in the ColorFragmentHandler ctor was right: we only handled the last <a:schemeClr> child, but there can be multiple one. Use them based on the index of a shape in a <dgm:forEach> loop. Move the TODO to the only place which still assumes a single color in the color list. Change-Id: I1c5c4f82e621f1110ef06b0490ff79f82f60f214 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94697 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2020-05-09compact namespace in i18npool..ooxNoel Grandin
Change-Id: I1de87468b56b86a1eeee09a612551ab119a1be8b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93857 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-09-17SmartArt: separate data model from diagram.cxxGrzegorz Araminowicz
data model is having more and more code, so separate it from diagram.cxx as this file is getting too big Change-Id: I05193c518c47958d24739d97f7b6afbf821b5361 Reviewed-on: https://gerrit.libreoffice.org/79067 Tested-by: Jenkins Reviewed-by: Grzegorz Araminowicz <grzegorz.araminowicz@collabora.com>
2019-09-02SmartArt edit UI: add new nodeGrzegorz Araminowicz
First approach to adding new node. Currently it's possible only to add top-level node to the end of diagram. Change-Id: Icd9530ab2fb8987a1690ffc96c244cc845b72eba Reviewed-on: https://gerrit.libreoffice.org/78286 Tested-by: Jenkins Reviewed-by: Grzegorz Araminowicz <grzegorz.araminowicz@collabora.com>
2019-08-27SmartArt edit UI: change plain text widget to tree viewGrzegorz Araminowicz
Added getChildren() data interface method, so that it's possible to recursively fill tree view with (id, text) pairs Change-Id: Ic100ded3a3e125bf79f5caa421cd8f91e5210954 Reviewed-on: https://gerrit.libreoffice.org/78169 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-08-18SmartArt: implement DiagramData::getString()Grzegorz Araminowicz
Allows to get data representation of diagram as text. It will be useful as a starting point for displaying data on diagram dialog. Change-Id: I9765d7de64a68224a6d36b7c3bc4862ce6610bdf Reviewed-on: https://gerrit.libreoffice.org/77669 Tested-by: Jenkins Reviewed-by: Grzegorz Araminowicz <grzegorz.araminowicz@collabora.com>
2019-08-05SmartArt: store diagram data model in SdrObjectGrzegorz Araminowicz
It will allow modifying loaded diagram and exporting it. This data is used for regenerating diagram instead of parsing xml fragment every time. Also provided an interface for UI that can be extended to show, add and remove nodes from data model. It is stored as SdrObject field because diagram top-level shape is group shape. Item set doesn't exist for them and storing data in child shapes is not possible here because children are removed and recreated on every diagram reload. Change-Id: I84e5ec955f638b254fef9ef9d1731ca7938982b7 Reviewed-on: https://gerrit.libreoffice.org/76121 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-07-02SmartArt: make if-node functions relative to current presentation nodeGrzegorz Araminowicz
* maxDepth calculates maximum depth of associated data node children (instead of per-diagram max depth) * cnt counts children of associated data node (instead of looking up presOf node and if not found counting presentation node children) Change-Id: Ifb50510acb9e6a3d2655197102060ec1c207075b Reviewed-on: https://gerrit.libreoffice.org/75000 Tested-by: Jenkins Reviewed-by: Grzegorz Araminowicz <grzegorz.araminowicz@collabora.com>
2019-07-01SmartArt: all visitors follow data presentation nodesGrzegorz Araminowicz
* visitors now are keeping track of current presentation node instead of looking it up by name * extracted visitor base class that follows if/else and for-each nodes * moved condition logic from ConditionAtom to visitor, as it depends on visitor state Change-Id: Iede86cd74a6098f2398a77b6cb3e9c6272dbfe4b Reviewed-on: https://gerrit.libreoffice.org/74732 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2019-06-18SmartArt: support ForEach referencesGrzegorz Araminowicz
ForEach 'ref' parameter causes specified ForEach node to be used instead. Used to create recursive structures like organisation charts. Change-Id: Iee61b2e103759355b59beb8d3f33eb3cce47c590 Reviewed-on: https://gerrit.libreoffice.org/74271 Tested-by: Jenkins Reviewed-by: Grzegorz Araminowicz <grzegorz.araminowicz@collabora.com>
2019-02-27loplugin:unusedfields look for classes where we can make all the..Noel Grandin
fields private Change-Id: Id3c6b123f06ab5dcf87628de4c347626110d2d27 Reviewed-on: https://gerrit.libreoffice.org/68302 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-02-19oox smartart, cycle matrix: handle destination order in connectionsMiklos Vajna
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. Change-Id: I3d2bb047ed3f171a194851f89151bd94071a8176 Reviewed-on: https://gerrit.libreoffice.org/68027 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2019-01-18oox smartart, org chart: implement support for hierBranch conditionsMiklos Vajna
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. Change-Id: I74a705b13f82a065fc0b9b9d306bfb0dcaf0f7f4 Reviewed-on: https://gerrit.libreoffice.org/66579 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
2017-10-23loplugin:includeform: ooxStephan Bergmann
Change-Id: I9f1cc9940f5b31370394f789ebfaddfd6d30ca61
2017-08-24SmartArt: implement dir and maxDepth if node functionsGrzegorz Araminowicz
Change-Id: I4ef05b5bab1188cf349d1c7f5bbc9022bc79b21c Reviewed-on: https://gerrit.libreoffice.org/41452 Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2017-08-17SmartArt: simplify conditions, miscellaneous changesGrzegorz Araminowicz
Change-Id: I70cc3548a68367b0a5f4cc5f55e55dc2db1e8b27 Reviewed-on: https://gerrit.libreoffice.org/41239 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jan Holesovsky <kendy@collabora.com>
2017-08-17SmartArt: support cnt functionGrzegorz Araminowicz
it was necessary to introduce in LayoutAtoms reference to containing LayoutNode passed by constructors, so that ConditionAtom can access LayoutNode's name and diagram data Change-Id: I35c9cb9061f23eb15e7a9372476530e2ead5d0dc Reviewed-on: https://gerrit.libreoffice.org/41108 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jan Holesovsky <kendy@collabora.com>
2017-08-10SmartArt: add nested shapes only if they are node's childrenGrzegorz Araminowicz
Change-Id: I6527fc4166001ffc1e1e170b179cd4eadf55305c Reviewed-on: https://gerrit.libreoffice.org/40870 Reviewed-by: Jan Holesovsky <kendy@collabora.com> Tested-by: Jan Holesovsky <kendy@collabora.com> Tested-by: Jenkins <ci@libreoffice.org>
2017-01-24Move two include files to oox/inc as they are used only in ooxTor Lillqvist
Change-Id: Ie13614c1977f45aa8086f4db65ca86b7d9212735
2016-04-13loplugin:passstuffbyref in ooxNoel Grandin
Change-Id: Iec989e9060c77dd5b010224b37633179cee4f7e9
2015-12-22loplugin:unusedfields in oox,packageNoel Grandin
Change-Id: I8f8c3ff9ded455a09f3df81c501da17cca0b2310
2015-10-21more removal of com::sun::star typedefsNoel Grandin
Change-Id: Ia73f1b4f1dcfa3f0936359e744afe76e02dcd2eb
2015-09-17boost->stdCaolán McNamara
Change-Id: Ifde84627578283bd057d7393eb7e5578ef5c029a
2015-07-21loplugin:unusedmethods ooxNoel Grandin
Change-Id: I5381e0da0efc1f951e248cfcfb35fc680ace94e4 Reviewed-on: https://gerrit.libreoffice.org/17225 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2014-09-14Move oox/drawingml/*hxx internal headers to oox/inc.Matúš Kukan
Do not export LinePropertiesContext class as visible. And move GraphicProperties to its own header. Change-Id: I047c181e9f2adc7e59885f59663ea56c7eb898ed
2014-06-25remove whitespacesMarkus Mohrhard
Change-Id: Ie14ba3dcb97f20479a04538748ef2c1c9e6c5dac
2014-05-19oox: remove using namespace from headersThomas Arnhold
Change-Id: Iaf33c536c86a372aed2a719b6f87a8e03a5481ea
2014-03-05fdo#74792 [DOCX] Grab-bag rels and images for SmartArtVinaya Mandke
Added support to grab-bag rels and associated Images for data[i].xml, and drawing[i].xml. Added UT for the same Conflicts: sw/qa/extras/ooxmlexport/ooxmlexport.cxx Reviewed on: https://gerrit.libreoffice.org/8362 Change-Id: I545825f67214f14037ab72b77764a07d575b8b5b
2014-02-26Remove visual noise from ooxAlexander Wilms
Change-Id: Ie25838f20f00dc32d9d22959308c118cef688e94 Reviewed-on: https://gerrit.libreoffice.org/8288 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2013-10-23fixincludeguards.sh: ooxThomas Arnhold
Change-Id: Ibc1fb5c149461d6030749a974c6d37aa11ad0e16
2013-09-11oox: Smart-Art DOMs stored in the InteropGrabBagAndres Gomez
The XDocuments representing the DOM documents of a DrawingML diagram (Smart-Art) are now stored as the PropertyValues "OOXData", "OOXLayout", "OOXStyle", "OOXColor" and "OOXDrawing" into the "InteropGraBag" property of the parent SvxGroupShape created from such diagram. Modified the oox::drawingml::dgm::Diagram class to be able to hold the map storing the XDocuments and its names. Added the getDomMap() method to obtain the map directly and the getDomsAsPropertyValues method to get the map as a sequence of Property Values. Modified the methods for importing and loading the Smart-Art into the Diagram so they add automatically the DOM documents to it. Modified the oox::drawingml::Shape class to be able to hold the sequence of PropertyValues storing the XDocuments and its names coming from the oox::drawingml::dgm::Diagram class. Added the getDiagramDoms() and setDiagramDoms() methods. Enhanced the oox::shape::ShapeContextHandler::getShape() method to add the extended drawing document to the oox::drawingml::Shape class. Modified the oox::drawingml::Shape::createAndInsert() method to store the sequence of XDocuments in the "InteropGrabBag" property of the GroupShape service SvxGroupShape implementation representing a Smart-Art. Change-Id: I7d0b9dfbfc9d5299ddd25fab394e5e9a422d1dd1 Reviewed-on: https://gerrit.libreoffice.org/5849 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2013-03-19trailing whitespacesThomas Arnhold
Change-Id: I3d0e2015e4c9f0ea6118fd92892022607fe4bde6
2013-03-04remove trailing whitespacesThomas Arnhold
Change-Id: Ib6684fe00e063e150af30477fd704d9b3f029282
2012-12-07::rtl:: removal in ooxJosé Guilherme Vanz
This commit removes some ::rtl:: prefixes on oox Change-Id: Ibb3be70695c48eb0a02fdf285a0c049e244d613e Signed-off-by: José Guilherme Vanz <guilherme.sft@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/1259 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2012-07-17re-base on ALv2 code. Includes:Michael Meeks
retain presence of MPL licensed nssrenam.h symbol renamer.
2012-03-14Remove unused code in drawingml/diagram.Mariana Marasoiu
2012-02-13Remove unused codeElton Chung
2011-12-30n#655408: Importing extLst of drawings in diagrams.Muthu Subramanian
data*.xml contains the list of drawings which can be imported instead. These are easier to import now that we support better smartart.
2011-08-12Import SmartArt graphics to ImpressThorsten Behrens
Extending the existing functionality to * properly parse and model the declarative shapes * provide means for round-tripping, and re-rendering the shapes from xml snippets * implements the layouts composite, cycle, linear, and the special 'text' node This is based on the initial smartart work from hfiguiere@novell.com