summaryrefslogtreecommitdiff
path: root/sfx2/source/doc
diff options
context:
space:
mode:
authorCédric Bosdonnat <cedric.bosdonnat@free.fr>2013-01-08 15:21:51 +0100
committerCédric Bosdonnat <cedric.bosdonnat@free.fr>2013-01-08 15:29:52 +0100
commit7d620e26070fda48f91a8ebe0a088224d6d19f75 (patch)
tree3385b6c304a18b0175d4de4772d60c24685e5bf3 /sfx2/source/doc
parent8a2bfe697bf71c8a2ca3c6ba1ef5e6324d4163aa (diff)
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
Diffstat (limited to 'sfx2/source/doc')
-rw-r--r--sfx2/source/doc/templatedlg.cxx8
1 files changed, 5 insertions, 3 deletions
diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx
index cfb979e2ec9c..80f180a4b923 100644
--- a/sfx2/source/doc/templatedlg.cxx
+++ b/sfx2/source/doc/templatedlg.cxx
@@ -502,6 +502,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)
@@ -512,7 +513,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);
@@ -520,11 +521,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);