[Libreoffice-commits] .: Branch 'libreoffice-4-0' - sfx2/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Tue Jan 8 06:32:30 PST 2013
sfx2/source/doc/templatedlg.cxx | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
New commits:
commit 7d792f39b2ca40511544c8a61d7d7f6acdd48bcf
Author: Cédric Bosdonnat <cedric.bosdonnat at free.fr>
Date: Tue Jan 8 15:21:51 2013 +0100
Template Manager: fixed select template and scroll caused trouble with toolbar
Selecting a template in the first row and scrolling down made some items
in the toolbar disappear... Fixed this by checking if the item to update
is already in the selection.
Change-Id: I2ddffae3a1c6092241afcf2acd212fe07b3a65ce
diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx
index 26cf58b..282372d 100644
--- a/sfx2/source/doc/templatedlg.cxx
+++ b/sfx2/source/doc/templatedlg.cxx
@@ -501,6 +501,7 @@ IMPL_LINK(SfxTemplateManagerDlg, TVFolderStateHdl, const ThumbnailViewItem*, pIt
IMPL_LINK(SfxTemplateManagerDlg, TVTemplateStateHdl, const ThumbnailViewItem*, pItem)
{
+ bool bInSelection = maSelTemplates.find(pItem) != maSelTemplates.end();
if (pItem->isSelected())
{
if (!mbIsSaveMode)
@@ -511,7 +512,7 @@ IMPL_LINK(SfxTemplateManagerDlg, TVTemplateStateHdl, const ThumbnailViewItem*, p
mpActionBar->Show(false);
mpTemplateBar->Show();
}
- else
+ else if (maSelTemplates.size() != 1 || !bInSelection)
{
mpTemplateBar->HideItem(TBI_TEMPLATE_EDIT);
mpTemplateBar->HideItem(TBI_TEMPLATE_PROPERTIES);
@@ -519,11 +520,12 @@ IMPL_LINK(SfxTemplateManagerDlg, TVTemplateStateHdl, const ThumbnailViewItem*, p
}
}
- maSelTemplates.insert(pItem);
+ if (!bInSelection)
+ maSelTemplates.insert(pItem);
}
else
{
- if (maSelTemplates.find(pItem) != maSelTemplates.end())
+ if (bInSelection)
{
maSelTemplates.erase(pItem);
More information about the Libreoffice-commits
mailing list