[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sfx2/inc sfx2/source
Cédric Bosdonnat
cedric.bosdonnat at free.fr
Wed Feb 13 00:54:28 PST 2013
sfx2/inc/sfx2/templatelocalview.hxx | 2 +-
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, 12 insertions(+), 10 deletions(-)
New commits:
commit 1a6ae8e83df22deca193c58bc940d1dc265eb4b8
Author: Cédric Bosdonnat <cedric.bosdonnat at free.fr>
Date: Mon Feb 11 18:09:45 2013 +0100
Templates Manager: if the title can't be edited, don't update it in UI
Change-Id: Id16431fb3517c831a5e81ff72fafaa8569f99ef1
Reviewed-on: https://gerrit.libreoffice.org/2109
Reviewed-by: Tor Lillqvist <tml at iki.fi>
Tested-by: Miklos Vajna <vmiklos at suse.cz>
diff --git a/sfx2/inc/sfx2/templatelocalview.hxx b/sfx2/inc/sfx2/templatelocalview.hxx
index dbf00ef..78cf547 100644
--- a/sfx2/inc/sfx2/templatelocalview.hxx
+++ b/sfx2/inc/sfx2/templatelocalview.hxx
@@ -71,7 +71,7 @@ public:
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 07b8487..3e2a7c8 100644
--- a/sfx2/inc/sfx2/templateview.hxx
+++ b/sfx2/inc/sfx2/templateview.hxx
@@ -40,7 +40,7 @@ public:
void setCloseHdl (const Link &rLink) { maAllButton.SetClickHdl(rLink); }
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 a33e762..8eb9426 100644
--- a/sfx2/inc/sfx2/thumbnailview.hxx
+++ b/sfx2/inc/sfx2/thumbnailview.hxx
@@ -238,7 +238,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 2bbf0d0..ca8856e 100644
--- a/sfx2/source/control/templatelocalview.cxx
+++ b/sfx2/source/control/templatelocalview.cxx
@@ -605,7 +605,7 @@ void TemplateLocalView::OnItemDblClicked (ThumbnailViewItem *pRegionItem)
showOverlay(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;
@@ -620,7 +620,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 90e86ec..615465d 100644
--- a/sfx2/source/control/templateview.cxx
+++ b/sfx2/source/control/templateview.cxx
@@ -105,10 +105,11 @@ void TemplateView::OnItemDblClicked(ThumbnailViewItem *pItem)
maDblClickHdl.Call(pItem);
}
-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 9a29381..c996f0f 100644
--- a/sfx2/source/control/thumbnailview.cxx
+++ b/sfx2/source/control/thumbnailview.cxx
@@ -980,9 +980,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 c228bab..2a83bc1 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 )
More information about the Libreoffice-commits
mailing list