summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoren De Cuyper <jorendc@libreoffice.org>2014-02-07 15:08:12 +0100
committerAndras Timar <andras.timar@collabora.com>2014-02-12 11:58:37 +0100
commit9a59699f5daa31675aa502151dc067e02291f158 (patch)
treeeea99b86447fd7b1befcbd67fda8e601c1ca940e
parent5ff44a89b59a6bdfe4cd471456b623eac91afcff (diff)
fdo#65430 add OnItemDblClicked and setOpenTemplateHdl in templateSearchView
Currently only templateAbstractView had such handler, which are templateLocalView and templateRemoteView are based on. Change-Id: I6694d0804a8b7e58abc0ddc970e811d053394d6f Reviewed-on: https://gerrit.libreoffice.org/7918 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit 96e7225260aac0815643a4043f4ddb4e6b5764a1) Reviewed-on: https://gerrit.libreoffice.org/7924
-rw-r--r--sfx2/source/control/templatesearchview.cxx10
-rw-r--r--sfx2/source/doc/templatedlg.cxx1
-rw-r--r--sfx2/source/inc/templatesearchview.hxx8
3 files changed, 19 insertions, 0 deletions
diff --git a/sfx2/source/control/templatesearchview.cxx b/sfx2/source/control/templatesearchview.cxx
index 2942b66a9726..f0b87d20a2bf 100644
--- a/sfx2/source/control/templatesearchview.cxx
+++ b/sfx2/source/control/templatesearchview.cxx
@@ -20,6 +20,16 @@ TemplateSearchView::~TemplateSearchView ()
{
}
+void TemplateSearchView::setOpenTemplateHdl(const Link &rLink)
+{
+ maOpenTemplateHdl = rLink;
+}
+
+void TemplateSearchView::OnItemDblClicked (ThumbnailViewItem *pItem)
+{
+ maOpenTemplateHdl.Call(pItem);
+}
+
void TemplateSearchView::AppendItem(sal_uInt16 nAssocItemId, sal_uInt16 nRegionId, sal_uInt16 nIdx,
const OUString &rTitle, const OUString &rSubtitle,
const OUString &rPath,
diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx
index a31c235532bf..e6e464c3daa6 100644
--- a/sfx2/source/doc/templatedlg.cxx
+++ b/sfx2/source/doc/templatedlg.cxx
@@ -236,6 +236,7 @@ SfxTemplateManagerDlg::SfxTemplateManagerDlg (Window *parent)
TEMPLATE_ITEM_PADDING);
mpSearchView->setItemStateHdl(LINK(this,SfxTemplateManagerDlg,TVItemStateHdl));
+ mpSearchView->setOpenTemplateHdl(LINK(this,SfxTemplateManagerDlg,OpenTemplateHdl));
maTabControl.SetActivatePageHdl(LINK(this,SfxTemplateManagerDlg,ActivatePageHdl));
diff --git a/sfx2/source/inc/templatesearchview.hxx b/sfx2/source/inc/templatesearchview.hxx
index a6a81a311842..f1bb49c93aa9 100644
--- a/sfx2/source/inc/templatesearchview.hxx
+++ b/sfx2/source/inc/templatesearchview.hxx
@@ -20,9 +20,17 @@ public:
virtual ~TemplateSearchView();
+ void setOpenTemplateHdl (const Link &rLink);
+
void AppendItem(sal_uInt16 nAssocItemId, sal_uInt16 nRegionId, sal_uInt16 nIdx,
const OUString &rTitle, const OUString &rSubtitle,
const OUString &rPath, const BitmapEx &rImage );
+
+protected:
+ virtual void OnItemDblClicked(ThumbnailViewItem *pItem);
+
+protected:
+ Link maOpenTemplateHdl;
};
#endif // __SFX2_TEMPLATESEARCHVIEW_HXX__