From 98fa4be44290ceefd7f08ef167f0278743ade1c5 Mon Sep 17 00:00:00 2001 From: Cédric Bosdonnat Date: Mon, 11 Feb 2013 18:09:45 +0100 Subject: 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 --- sfx2/inc/sfx2/templatelocalview.hxx | 4 ++-- sfx2/inc/sfx2/templateview.hxx | 2 +- sfx2/inc/sfx2/thumbnailview.hxx | 2 +- sfx2/source/control/templatelocalview.cxx | 4 ++-- sfx2/source/control/templateview.cxx | 5 +++-- sfx2/source/control/thumbnailview.cxx | 3 ++- 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 ThumbnailViewItem::GetAccessible( bool bIsTransientChildrenDisabled ) -- cgit