diff options
author | Cédric Bosdonnat <cedric.bosdonnat@free.fr> | 2013-01-09 15:18:17 +0100 |
---|---|---|
committer | Noel Power <noel.power@suse.com> | 2013-01-14 18:39:17 +0000 |
commit | a98e717ba315b51fd2e9e3a4e12edfbc75f287be (patch) | |
tree | c7c6f7361b96517c854cba83ddb94cea0121cb77 /sfx2 | |
parent | c61861f870385f0cfbf8f5aa1b8d301475c6a73e (diff) |
Template Manager: filter the results when opening the dialog
Conflicts:
sfx2/source/control/templateabstractview.cxx
Change-Id: If6cc5f6d5e502c1fc5da210179263be63fc8c8a6
Reviewed-on: https://gerrit.libreoffice.org/1675
Reviewed-by: Noel Power <noel.power@suse.com>
Tested-by: Noel Power <noel.power@suse.com>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/control/templateabstractview.cxx | 21 | ||||
-rw-r--r-- | sfx2/source/doc/templatedlg.cxx | 2 |
2 files changed, 21 insertions, 2 deletions
diff --git a/sfx2/source/control/templateabstractview.cxx b/sfx2/source/control/templateabstractview.cxx index f8f20f58e305..182d8335a691 100644 --- a/sfx2/source/control/templateabstractview.cxx +++ b/sfx2/source/control/templateabstractview.cxx @@ -102,7 +102,7 @@ TemplateAbstractView::TemplateAbstractView (Window *pParent, WinBits nWinStyle, : ThumbnailView(pParent,nWinStyle,bDisableTransientChildren), mpItemView(new TemplateView(this)), mbFilteredResults(false), - meFilterOption(FILTER_APP_NONE) + meFilterOption(FILTER_APP_WRITER) { mpItemView->setItemStateHdl(LINK(this,TemplateAbstractView,OverlayItemStateHdl)); } @@ -111,7 +111,7 @@ TemplateAbstractView::TemplateAbstractView(Window *pParent, const ResId &rResId, : ThumbnailView(pParent,rResId,bDisableTransientChildren), mpItemView(new TemplateView(this)), mbFilteredResults(false), - meFilterOption(FILTER_APP_NONE) + meFilterOption(FILTER_APP_WRITER) { mpItemView->setItemStateHdl(LINK(this,TemplateAbstractView,OverlayItemStateHdl)); } @@ -174,6 +174,23 @@ void TemplateAbstractView::filterTemplatesByApp (const FILTER_APPLICATION &eApp) } } +void TemplateAbstractView::showOverlay (bool bVisible) +{ + mpItemView->Show(bVisible); + + // Clear items is the overlay is closed. + if (!bVisible) + { + // Check if the folder view needs to be filtered + if (mbFilteredResults) + { + filterItems(ViewFilter_Application(meFilterOption)); + } + + mpItemView->Clear(); + } +} + void TemplateAbstractView::filterTemplatesByKeyword(const OUString &rKeyword) { if (mpItemView->IsVisible()) diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx index 7bd3741c1557..388f0cbc492e 100644 --- a/sfx2/source/doc/templatedlg.cxx +++ b/sfx2/source/doc/templatedlg.cxx @@ -190,6 +190,8 @@ SfxTemplateManagerDlg::SfxTemplateManagerDlg (Window *parent) maView->Populate(); maView->Show(); + mpCurView->filterTemplatesByApp(FILTER_APP_WRITER); + FreeResource(); } |