diff options
author | Rafael Dominguez <venccsralph@gmail.com> | 2013-03-27 16:59:50 -0430 |
---|---|---|
committer | Miklos Vajna <vmiklos@suse.cz> | 2013-04-08 07:38:05 +0000 |
commit | b6ec9b44fd7d4f6064f6eb407a75b1fcdb030ebf (patch) | |
tree | 21db4b8a8d2c28b50e184e48a25ac5906860f41e /sfx2 | |
parent | e40a7ee5768af7c65e0cea5cc619df313b749c74 (diff) |
Display create template folder only when its allowed.
Change-Id: I892cfd88907ac4588e882e3a89c4feb200ce6744
Reviewed-on: https://gerrit.libreoffice.org/3246
Reviewed-by: Miklos Vajna <vmiklos@suse.cz>
Tested-by: Miklos Vajna <vmiklos@suse.cz>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/inc/sfx2/templateabstractview.hxx | 3 | ||||
-rw-r--r-- | sfx2/inc/sfx2/templatelocalview.hxx | 2 | ||||
-rw-r--r-- | sfx2/inc/sfx2/templateremoteview.hxx | 2 | ||||
-rw-r--r-- | sfx2/source/control/templatelocalview.cxx | 5 | ||||
-rw-r--r-- | sfx2/source/control/templateremoteview.cxx | 5 |
5 files changed, 17 insertions, 0 deletions
diff --git a/sfx2/inc/sfx2/templateabstractview.hxx b/sfx2/inc/sfx2/templateabstractview.hxx index 4eeafa00443f..1df856ddbb57 100644 --- a/sfx2/inc/sfx2/templateabstractview.hxx +++ b/sfx2/inc/sfx2/templateabstractview.hxx @@ -94,6 +94,9 @@ public: 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 9dccf517c109..762dbf5d6eb1 100644 --- a/sfx2/inc/sfx2/templatelocalview.hxx +++ b/sfx2/inc/sfx2/templatelocalview.hxx @@ -55,6 +55,8 @@ public: 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 3319022cda2c..0a89803e3e07 100644 --- a/sfx2/inc/sfx2/templateremoteview.hxx +++ b/sfx2/inc/sfx2/templateremoteview.hxx @@ -31,6 +31,8 @@ public: 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 e7eaa987dc21..dd472f2dd446 100644 --- a/sfx2/source/control/templatelocalview.cxx +++ b/sfx2/source/control/templatelocalview.cxx @@ -258,6 +258,11 @@ sal_uInt16 TemplateLocalView::createRegion(const OUString &rName) 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 a8d88f543c08..8fd2e87660c4 100644 --- a/sfx2/source/control/templateremoteview.cxx +++ b/sfx2/source/control/templateremoteview.cxx @@ -190,4 +190,9 @@ bool TemplateRemoteView::loadRepository (TemplateRepository* pItem, bool bRefres return true; } +bool TemplateRemoteView::isNestedRegionAllowed() const +{ + return true; +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |