diff options
author | Rafael Dominguez <venccsralph@gmail.com> | 2012-07-29 19:13:14 -0430 |
---|---|---|
committer | Rafael Dominguez <venccsralph@gmail.com> | 2012-07-29 21:29:30 -0430 |
commit | 2f14792a4d1788fb1d63acacf1d037389c2d6f98 (patch) | |
tree | 346287faf7791a932fe480bd803481515997b2a7 /sfx2 | |
parent | 39089e15739eb4de2f055e220976ea501a624e3e (diff) |
Move setting overlay item state handler to TemplateAbstractView.
- Rename method to a more descriptive name.
Change-Id: Ib8fc988209ed6bf1453f3ef6784cae865caf2fe0
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/inc/sfx2/templateabstractview.hxx | 5 | ||||
-rw-r--r-- | sfx2/inc/sfx2/templatefolderview.hxx | 5 | ||||
-rw-r--r-- | sfx2/source/control/templateabstractview.cxx | 8 | ||||
-rw-r--r-- | sfx2/source/control/templatefolderview.cxx | 7 | ||||
-rw-r--r-- | sfx2/source/doc/templatedlg.cxx | 2 |
5 files changed, 14 insertions, 13 deletions
diff --git a/sfx2/inc/sfx2/templateabstractview.hxx b/sfx2/inc/sfx2/templateabstractview.hxx index 24ca449d038e..74dcd8a0ff6b 100644 --- a/sfx2/inc/sfx2/templateabstractview.hxx +++ b/sfx2/inc/sfx2/templateabstractview.hxx @@ -37,6 +37,8 @@ public: void sortOverlayItems (const boost::function<bool (const ThumbnailViewItem*, const ThumbnailViewItem*) > &func); + void setOverlayItemStateHdl (const Link &aLink) { maOverlayItemStateHdl = aLink; } + void setOverlayDblClickHdl (const Link &rLink); void setOverlayCloseHdl (const Link &rLink); @@ -49,9 +51,12 @@ protected: virtual void OnSelectionMode (bool bMode); + DECL_LINK(OverlayItemStateHdl, const ThumbnailViewItem*); + protected: TemplateView *mpItemView; + Link maOverlayItemStateHdl; }; #endif // __SFX2_TEMPLATEABSTRACTVIEW_HXX__ diff --git a/sfx2/inc/sfx2/templatefolderview.hxx b/sfx2/inc/sfx2/templatefolderview.hxx index 5d23b9feea71..f6cb683af30f 100644 --- a/sfx2/inc/sfx2/templatefolderview.hxx +++ b/sfx2/inc/sfx2/templatefolderview.hxx @@ -47,8 +47,6 @@ public: std::vector<TemplateItemProperties> getFilteredItems (const boost::function<bool (const TemplateItemProperties&) > &rFunc) const; - void setTemplateStateHdl (const Link &aLink) { maTemplateStateHdl = aLink; } - sal_uInt16 createRegion (const rtl::OUString &rName); bool removeRegion (const sal_uInt16 nItemId); @@ -68,8 +66,6 @@ private: virtual void OnItemDblClicked (ThumbnailViewItem *pRegionItem); - DECL_LINK(TVTemplateStateHdl, const ThumbnailViewItem*); - DECL_LINK(ChangeNameHdl, TemplateView*); private: @@ -77,7 +73,6 @@ private: bool mbFilteredResults; // Flag keep track if overlay has been filtered so folders can get filtered too afterwards FILTER_APPLICATION meFilterOption; SfxDocumentTemplates *mpDocTemplates; - Link maTemplateStateHdl; }; #endif // TEMPLATEFOLDERVIEW_HXX diff --git a/sfx2/source/control/templateabstractview.cxx b/sfx2/source/control/templateabstractview.cxx index 940874b1a44c..8f8d78b5f67d 100644 --- a/sfx2/source/control/templateabstractview.cxx +++ b/sfx2/source/control/templateabstractview.cxx @@ -24,12 +24,14 @@ TemplateAbstractView::TemplateAbstractView (Window *pParent, WinBits nWinStyle, : ThumbnailView(pParent,nWinStyle,bDisableTransientChildren), mpItemView(new TemplateView(this)) { + mpItemView->setItemStateHdl(LINK(this,TemplateAbstractView,OverlayItemStateHdl)); } TemplateAbstractView::TemplateAbstractView(Window *pParent, const ResId &rResId, bool bDisableTransientChildren) : ThumbnailView(pParent,rResId,bDisableTransientChildren), mpItemView(new TemplateView(this)) { + mpItemView->setItemStateHdl(LINK(this,TemplateAbstractView,OverlayItemStateHdl)); } TemplateAbstractView::~TemplateAbstractView () @@ -195,4 +197,10 @@ void TemplateAbstractView::OnSelectionMode (bool bMode) ThumbnailView::OnSelectionMode(bMode); } +IMPL_LINK(TemplateAbstractView, OverlayItemStateHdl, const ThumbnailViewItem*, pItem) +{ + maOverlayItemStateHdl.Call((void*)pItem); + return 0; +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/control/templatefolderview.cxx b/sfx2/source/control/templatefolderview.cxx index c9f53b15116c..c47b2ab59d8c 100644 --- a/sfx2/source/control/templatefolderview.cxx +++ b/sfx2/source/control/templatefolderview.cxx @@ -163,7 +163,6 @@ TemplateFolderView::TemplateFolderView ( Window* pParent, const ResId& rResId, b ITEM_MAX_HEIGHT-THUMBNAIL_MAX_HEIGHT, ITEM_PADDING); - mpItemView->setItemStateHdl(LINK(this,TemplateFolderView,TVTemplateStateHdl)); mpItemView->setChangeNameHdl(LINK(this,TemplateFolderView,ChangeNameHdl)); } @@ -609,12 +608,6 @@ void TemplateFolderView::OnItemDblClicked (ThumbnailViewItem *pRegionItem) mpItemView->Show(); } -IMPL_LINK(TemplateFolderView, TVTemplateStateHdl, const ThumbnailViewItem*, pItem) -{ - maTemplateStateHdl.Call((void*)pItem); - return 0; -} - IMPL_LINK(TemplateFolderView, ChangeNameHdl, TemplateView*, pView) { sal_uInt16 nRegionId = pView->getId(); diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx index b977342bb76a..3109d9c2751e 100644 --- a/sfx2/source/doc/templatedlg.cxx +++ b/sfx2/source/doc/templatedlg.cxx @@ -188,7 +188,7 @@ SfxTemplateManagerDlg::SfxTemplateManagerDlg (Window *parent) ITEM_PADDING); maView->setItemStateHdl(LINK(this,SfxTemplateManagerDlg,TVFolderStateHdl)); - maView->setTemplateStateHdl(LINK(this,SfxTemplateManagerDlg,TVTemplateStateHdl)); + maView->setOverlayItemStateHdl(LINK(this,SfxTemplateManagerDlg,TVTemplateStateHdl)); maView->setOverlayDblClickHdl(LINK(this,SfxTemplateManagerDlg,OpenTemplateHdl)); maView->setOverlayCloseHdl(LINK(this,SfxTemplateManagerDlg,CloseOverlayHdl)); |