Kaydet (Commit) 7d620e26 authored tarafından Cédric Bosdonnat's avatar Cédric Bosdonnat

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
üst 8a2bfe69
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment