diff options
author | Cédric Bosdonnat <cedric.bosdonnat@free.fr> | 2013-02-11 18:09:45 +0100 |
---|---|---|
committer | Cédric Bosdonnat <cedric.bosdonnat@free.fr> | 2013-02-12 08:46:02 +0100 |
commit | 98fa4be44290ceefd7f08ef167f0278743ade1c5 (patch) | |
tree | d0c801169cb5d51b9ffe9fc35fa34ac36005665c | |
parent | 8eaac1d73140abf82631a60a99421d9e1b2c595d (diff) |
Templates Manager: if the title can't be edited, don't update it in UI
Conflicts:
sfx2/inc/sfx2/templatelocalview.hxx
sfx2/source/control/templatelocalview.cxx
sfx2/source/control/templateview.cxx
Change-Id: Id16431fb3517c831a5e81ff72fafaa8569f99ef1
-rw-r--r-- | sfx2/inc/sfx2/templatelocalview.hxx | 4 | ||||
-rw-r--r-- | sfx2/inc/sfx2/templateview.hxx | 2 | ||||
-rw-r--r-- | sfx2/inc/sfx2/thumbnailview.hxx | 2 | ||||
-rw-r--r-- | sfx2/source/control/templatelocalview.cxx | 4 | ||||
-rw-r--r-- | sfx2/source/control/templateview.cxx | 5 | ||||
-rw-r--r-- | sfx2/source/control/thumbnailview.cxx | 3 | ||||
-rw-r--r-- | sfx2/source/control/thumbnailviewitem.cxx | 4 |
7 files changed, 13 insertions, 11 deletions
diff --git a/sfx2/inc/sfx2/templatelocalview.hxx b/sfx2/inc/sfx2/templatelocalview.hxx index c27659f90b63..432b008be60c 100644 --- a/sfx2/inc/sfx2/templatelocalview.hxx +++ b/sfx2/inc/sfx2/templatelocalview.hxx @@ -68,8 +68,8 @@ public: const OUString &rName); bool isTemplateNameUnique (const sal_uInt16 nRegionItemId, const OUString &rName) const; - - virtual void renameItem(ThumbnailViewItem* pItem, rtl::OUString sNewTitle); + + virtual bool renameItem(ThumbnailViewItem* pItem, rtl::OUString sNewTitle); private: diff --git a/sfx2/inc/sfx2/templateview.hxx b/sfx2/inc/sfx2/templateview.hxx index 81582efc904c..b7ff21571442 100644 --- a/sfx2/inc/sfx2/templateview.hxx +++ b/sfx2/inc/sfx2/templateview.hxx @@ -43,7 +43,7 @@ public: void setOpenHdl (const Link &rLink) { maOpenHdl = rLink; } virtual void OnItemDblClicked(ThumbnailViewItem *pItem) { maOpenHdl.Call(pItem); } void setMasterView(TemplateAbstractView* pMasterView) { mpMasterView = pMasterView; } - virtual void renameItem(ThumbnailViewItem* pItem, rtl::OUString sNewTitle); + virtual bool renameItem(ThumbnailViewItem* pItem, rtl::OUString sNewTitle); protected: diff --git a/sfx2/inc/sfx2/thumbnailview.hxx b/sfx2/inc/sfx2/thumbnailview.hxx index 78e1df6bf6ef..1e8f1ac413ee 100644 --- a/sfx2/inc/sfx2/thumbnailview.hxx +++ b/sfx2/inc/sfx2/thumbnailview.hxx @@ -236,7 +236,7 @@ public: virtual void Resize(); - virtual void renameItem(ThumbnailViewItem* pItem, rtl::OUString sNewTitle); + virtual bool renameItem(ThumbnailViewItem* pItem, rtl::OUString sNewTitle); protected: diff --git a/sfx2/source/control/templatelocalview.cxx b/sfx2/source/control/templatelocalview.cxx index e42f9c8a243d..0bb12dc9ce82 100644 --- a/sfx2/source/control/templatelocalview.cxx +++ b/sfx2/source/control/templatelocalview.cxx @@ -571,7 +571,7 @@ bool TemplateLocalView::isTemplateNameUnique(const sal_uInt16 nRegionItemId, con return true; } -void TemplateLocalView::renameItem(ThumbnailViewItem* pItem, rtl::OUString sNewTitle) +bool TemplateLocalView::renameItem(ThumbnailViewItem* pItem, rtl::OUString sNewTitle) { sal_uInt16 nRegionId = 0; sal_uInt16 nDocId = USHRT_MAX; @@ -586,7 +586,7 @@ void TemplateLocalView::renameItem(ThumbnailViewItem* pItem, rtl::OUString sNewT { nRegionId = pContainerItem->mnId - 1; } - mpDocTemplates->SetName( sNewTitle, nRegionId, nDocId ); + return mpDocTemplates->SetName( sNewTitle, nRegionId, nDocId ); } static void lcl_updateThumbnails (TemplateContainerItem *pItem) diff --git a/sfx2/source/control/templateview.cxx b/sfx2/source/control/templateview.cxx index 7073a6f90474..21b260389b0b 100644 --- a/sfx2/source/control/templateview.cxx +++ b/sfx2/source/control/templateview.cxx @@ -100,10 +100,11 @@ void TemplateView::Resize() ThumbnailView::Resize(); } -void TemplateView::renameItem(ThumbnailViewItem* pItem, rtl::OUString sNewTitle) +bool TemplateView::renameItem(ThumbnailViewItem* pItem, rtl::OUString sNewTitle) { if (mpMasterView) - mpMasterView->renameItem(pItem, sNewTitle); + return mpMasterView->renameItem(pItem, sNewTitle); + return false; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/control/thumbnailview.cxx b/sfx2/source/control/thumbnailview.cxx index a1c08980161a..4cff5377cf64 100644 --- a/sfx2/source/control/thumbnailview.cxx +++ b/sfx2/source/control/thumbnailview.cxx @@ -969,9 +969,10 @@ void ThumbnailView::sortItems (const boost::function<bool (const ThumbnailViewIt Invalidate(); } -void ThumbnailView::renameItem(ThumbnailViewItem*, rtl::OUString) +bool ThumbnailView::renameItem(ThumbnailViewItem*, rtl::OUString) { // Do nothing by default + return false; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/control/thumbnailviewitem.cxx b/sfx2/source/control/thumbnailviewitem.cxx index c228babd21c5..2a83bc175774 100644 --- a/sfx2/source/control/thumbnailviewitem.cxx +++ b/sfx2/source/control/thumbnailviewitem.cxx @@ -187,8 +187,8 @@ void ThumbnailViewItem::updateTitleEditSize() void ThumbnailViewItem::setTitle (const rtl::OUString& rTitle) { - mrParent.renameItem(this, rTitle); - maTitle = rTitle; + if (mrParent.renameItem(this, rTitle)) + maTitle = rTitle; } uno::Reference< accessibility::XAccessible > ThumbnailViewItem::GetAccessible( bool bIsTransientChildrenDisabled ) |