diff options
author | Regina Henschel <rb.henschel@t-online.de> | 2018-08-17 19:02:55 +0200 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2018-08-27 16:27:17 +0200 |
commit | 9826a4e4a6aa9953d3f354fe645a23f9dae59d77 (patch) | |
tree | 25a38cbe766a092b8df736ab5c75581d77944895 /include | |
parent | 3ed1bd19eb7fb7898bcca8e046e058799f836063 (diff) |
tdf#101242 Support draw:display and draw:protect attributes of ODF
LibreOffice writes the properties visible, printable and locked of
layers into items in the subfile settings.xml and handles them as
properties of the view. ODF handles them as property of the layer.
To become more ODF conform as a first step these properties are now
read and written. They are used to initialize the view in case they
are missing in settings.xml, which is the case for foreign documents.
The ODF properties are written in addition to the items in
settings.xml, so that older versions will notice no difference with
such documents. SdModelTestBase is changed to handle odg as Draw
document.
Change-Id: I190ecc51fc6ee91ec4b96d06bb216ce517bdfcfe
Reviewed-on: https://gerrit.libreoffice.org/59269
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/svx/svdlayer.hxx | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/include/svx/svdlayer.hxx b/include/svx/svdlayer.hxx index 36fa08a1a105..60e7027e4688 100644 --- a/include/svx/svdlayer.hxx +++ b/include/svx/svdlayer.hxx @@ -62,6 +62,9 @@ class SVX_DLLPUBLIC SdrLayer OUString maName; OUString maTitle; OUString maDescription; + bool mbVisibleODF; // corresponds to ODF draw:display + bool mbPrintableODF; // corresponds to ODF draw:display + bool mbLockedODF; // corresponds to ODF draw:protected SdrModel* pModel; // For broadcasting sal_uInt16 nType; // 0= userdefined, 1= default layer SdrLayerID nID; @@ -80,6 +83,15 @@ public: void SetDescription(const OUString& rDesc) { maDescription = rDesc; } const OUString& GetDescription() const { return maDescription; } + void SetVisibleODF(const bool& rVisibleODF) { mbVisibleODF = rVisibleODF; } + bool IsVisibleODF() const { return mbVisibleODF; } + + void SetPrintableODF(const bool& rPrintableODF) { mbPrintableODF = rPrintableODF; } + bool IsPrintableODF() const { return mbPrintableODF; } + + void SetLockedODF(const bool& rLockedODF) { mbLockedODF = rLockedODF; } + bool IsLockedODF() const { return mbLockedODF; } + SdrLayerID GetID() const { return nID; } void SetModel(SdrModel* pNewModel) { pModel=pNewModel; } // A SdrLayer should be considered the standard Layer. It shall then set the @@ -114,16 +126,11 @@ public: SdrLayerAdmin(const SdrLayerAdmin& rSrcLayerAdmin); ~SdrLayerAdmin(); SdrLayerAdmin& operator=(const SdrLayerAdmin& rSrcLayerAdmin); + SdrLayerAdmin* GetParent() const { return pParent; } + void SetModel(SdrModel* pNewModel); - void InsertLayer(SdrLayer* pLayer, sal_uInt16 nPos) - { - if(nPos==0xFFFF) - aLayer.push_back(pLayer); - else - aLayer.insert(aLayer.begin() + nPos, pLayer); - pLayer->SetModel(pModel); - Broadcast(); - } + + void InsertLayer(SdrLayer* pLayer, sal_uInt16 nPos); SdrLayer* RemoveLayer(sal_uInt16 nPos); // Delete the entire layer @@ -151,6 +158,12 @@ public: void SetControlLayerName(const OUString& rNewName); const OUString& GetControlLayerName() const { return maControlLayerName; } + + // Removes all elements in rOutSet and then adds all IDs of layers from member aLayer + // that fullfill the criterion visible, printable, or locked respectively. + void getVisibleLayersODF( SdrLayerIDSet& rOutSet) const; + void getPrintableLayersODF( SdrLayerIDSet& rOutSet) const; + void getLockedLayersODF( SdrLayerIDSet& rOutSet) const; }; #endif // INCLUDED_SVX_SVDLAYER_HXX |