[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sfx2/source
Akshay Deep
akshaydeepiitr at gmail.com
Fri Jun 17 07:17:29 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 edd2f7b4793b29ae1aff05e1e54c957ac0fed15d
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>
(cherry picked from commit 5b8c86f2a3eb5e092fb96f5ae2eaf58c10c8f4f0)
Reviewed-on: https://gerrit.libreoffice.org/26403
Tested-by: Akshay Deep <akshaydeepiitr at gmail.com>
diff --git a/sfx2/source/control/templateabstractview.cxx b/sfx2/source/control/templateabstractview.cxx
index a29b4b0..45f644d 100644
--- a/sfx2/source/control/templateabstractview.cxx
+++ b/sfx2/source/control/templateabstractview.cxx
@@ -258,7 +258,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 5374af0..3608334 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 0767c13..b225b29 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 9e83a73..df1e7bf 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