[PATCH libreoffice-4-0] Display create template folder only when its allowed.

Rafael Dominguez (via Code Review) gerrit at gerrit.libreoffice.org
Sun Apr 7 11:52:21 PDT 2013


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/3246

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/46/3246/1

Display create template folder only when its allowed.

Change-Id: I892cfd88907ac4588e882e3a89c4feb200ce6744
---
M sfx2/inc/sfx2/templateabstractview.hxx
M sfx2/inc/sfx2/templatelocalview.hxx
M sfx2/inc/sfx2/templateremoteview.hxx
M sfx2/source/control/templatelocalview.cxx
M sfx2/source/control/templateremoteview.cxx
5 files changed, 17 insertions(+), 0 deletions(-)



diff --git a/sfx2/inc/sfx2/templateabstractview.hxx b/sfx2/inc/sfx2/templateabstractview.hxx
index 4eeafa0..1df856d 100644
--- a/sfx2/inc/sfx2/templateabstractview.hxx
+++ b/sfx2/inc/sfx2/templateabstractview.hxx
@@ -94,6 +94,9 @@
 
     virtual void showRegion (ThumbnailViewItem *pItem) = 0;
 
+    // Return if we can have regions inside the current region
+    virtual bool isNestedRegionAllowed () const = 0;
+
     sal_uInt16 getCurRegionId () const;
 
     const OUString& getCurRegionName () const;
diff --git a/sfx2/inc/sfx2/templatelocalview.hxx b/sfx2/inc/sfx2/templatelocalview.hxx
index 9dccf51..762dbf5 100644
--- a/sfx2/inc/sfx2/templatelocalview.hxx
+++ b/sfx2/inc/sfx2/templatelocalview.hxx
@@ -55,6 +55,8 @@
 
     sal_uInt16 createRegion (const OUString &rName);
 
+    virtual bool isNestedRegionAllowed () const;
+
     bool removeRegion (const sal_uInt16 nItemId);
 
     bool removeTemplate (const sal_uInt16 nItemId, const sal_uInt16 nSrcItemId);
diff --git a/sfx2/inc/sfx2/templateremoteview.hxx b/sfx2/inc/sfx2/templateremoteview.hxx
index 3319022..0a89803 100644
--- a/sfx2/inc/sfx2/templateremoteview.hxx
+++ b/sfx2/inc/sfx2/templateremoteview.hxx
@@ -31,6 +31,8 @@
 
     bool loadRepository (TemplateRepository* pRepository, bool bRefresh);
 
+    virtual bool isNestedRegionAllowed () const;
+
 private:
 
     com::sun::star::uno::Reference< com::sun::star::ucb::XCommandEnvironment > m_xCmdEnv;
diff --git a/sfx2/source/control/templatelocalview.cxx b/sfx2/source/control/templatelocalview.cxx
index e7eaa98..dd472f2 100644
--- a/sfx2/source/control/templatelocalview.cxx
+++ b/sfx2/source/control/templatelocalview.cxx
@@ -258,6 +258,11 @@
     return pItem->mnId;
 }
 
+bool TemplateLocalView::isNestedRegionAllowed() const
+{
+    return !mnCurRegionId;
+}
+
 bool TemplateLocalView::removeRegion(const sal_uInt16 nItemId)
 {
     sal_uInt16 nRegionId = USHRT_MAX;
diff --git a/sfx2/source/control/templateremoteview.cxx b/sfx2/source/control/templateremoteview.cxx
index a8d88f5..8fd2e87 100644
--- a/sfx2/source/control/templateremoteview.cxx
+++ b/sfx2/source/control/templateremoteview.cxx
@@ -190,4 +190,9 @@
     return true;
 }
 
+bool TemplateRemoteView::isNestedRegionAllowed() const
+{
+    return true;
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

-- 
To view, visit https://gerrit.libreoffice.org/3246
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I892cfd88907ac4588e882e3a89c4feb200ce6744
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: libreoffice-4-0
Gerrit-Owner: Rafael Dominguez <venccsralph at gmail.com>



More information about the LibreOffice mailing list