Date: prev next · Thread: first prev next last
2013 Archives by date, by thread · List index


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@gmail.com>


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.