[Libreoffice-commits] core.git: sfx2/source
Akshay Deep
akshaydeepiitr at gmail.com
Fri Jun 17 07:02:54 UTC 2016
sfx2/source/control/templateabstractview.cxx | 5 ++++-
sfx2/source/control/templatelocalview.cxx | 1 +
sfx2/source/control/templatesearchview.cxx | 8 +++++++-
sfx2/source/doc/templatedlg.cxx | 3 ---
4 files changed, 12 insertions(+), 5 deletions(-)
New commits:
commit 5b8c86f2a3eb5e092fb96f5ae2eaf58c10c8f4f0
Author: Akshay Deep <akshaydeepiitr at gmail.com>
Date: Thu Jun 16 19:18:30 2016 +0530
tdf#100423 Template Manager: ctrl + A and del should work correctly
Change-Id: Ibe0326827e6dacb670bb948ca4f6e9797ab7edeb
Reviewed-on: https://gerrit.libreoffice.org/26374
Reviewed-by: Akshay Deep <akshaydeepiitr at gmail.com>
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
diff --git a/sfx2/source/control/templateabstractview.cxx b/sfx2/source/control/templateabstractview.cxx
index 45f5555..0067c3d 100644
--- a/sfx2/source/control/templateabstractview.cxx
+++ b/sfx2/source/control/templateabstractview.cxx
@@ -235,7 +235,10 @@ void TemplateAbstractView::KeyInput( const KeyEvent& rKEvt )
if ( aQueryDlg->Execute() != RET_YES )
return;
- for (ThumbnailViewItem* pItem : mFilteredItemList)
+ //copy to avoid changing filtered item list during deletion
+ ThumbnailValueItemList mFilteredItemListCopy = mFilteredItemList;
+
+ for (ThumbnailViewItem* pItem : mFilteredItemListCopy)
{
if (pItem->isSelected())
{
diff --git a/sfx2/source/control/templatelocalview.cxx b/sfx2/source/control/templatelocalview.cxx
index 5b13654..605011e 100644
--- a/sfx2/source/control/templatelocalview.cxx
+++ b/sfx2/source/control/templatelocalview.cxx
@@ -239,6 +239,7 @@ IMPL_LINK_TYPED(TemplateLocalView, ContextMenuSelectHdl, Menu*, pMenu, bool)
break;
maDeleteTemplateHdl.Call(maSelectedItem);
+ reload();
}
break;
case MNI_DEFAULT_TEMPLATE:
diff --git a/sfx2/source/control/templatesearchview.cxx b/sfx2/source/control/templatesearchview.cxx
index eef7d8c..20da15c 100644
--- a/sfx2/source/control/templatesearchview.cxx
+++ b/sfx2/source/control/templatesearchview.cxx
@@ -64,11 +64,17 @@ void TemplateSearchView::KeyInput( const KeyEvent& rKEvt )
if ( aQueryDlg->Execute() != RET_YES )
return;
- for (ThumbnailViewItem* pItem : mFilteredItemList)
+ //copy to avoid changing filtered item list during deletion
+ ThumbnailValueItemList mFilteredItemListCopy = mFilteredItemList;
+
+ for (ThumbnailViewItem* pItem : mFilteredItemListCopy)
{
if (pItem->isSelected())
{
maDeleteTemplateHdl.Call(pItem);
+ RemoveItem(pItem->mnId);
+
+ CalculateItemPositions();
}
}
}
diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx
index 78eb6ce..9d6b8de 100644
--- a/sfx2/source/doc/templatedlg.cxx
+++ b/sfx2/source/doc/templatedlg.cxx
@@ -847,9 +847,6 @@ IMPL_LINK_TYPED(SfxTemplateManagerDlg, DeleteTemplateHdl, ThumbnailViewItem*, pI
OUString aMsg( SfxResId(STR_MSG_ERROR_DELETE_TEMPLATE).toString() );
ScopedVclPtrInstance<MessageDialog>::Create(this, aMsg.replaceFirst("$1",aDeletedTemplate))->Execute();
}
-
- if(mpSearchView->IsVisible())
- SearchUpdateHdl(*mpSearchFilter);
}
IMPL_LINK_TYPED(SfxTemplateManagerDlg, DefaultTemplateHdl, ThumbnailViewItem*, pItem, void)
More information about the Libreoffice-commits
mailing list