[PATCH] Change in core[libreoffice-4-0]: Template Manager: filter the results when opening the dialog
Bosdonnat Cedric (via Code Review)
gerrit at gerrit.libreoffice.org
Mon Jan 14 08:03:27 PST 2013
Hi,
I have submitted a patch for review:
https://gerrit.libreoffice.org/1675
To pull it, you can do:
git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/75/1675/1
Template Manager: filter the results when opening the dialog
Conflicts:
sfx2/source/control/templateabstractview.cxx
Change-Id: If6cc5f6d5e502c1fc5da210179263be63fc8c8a6
---
M sfx2/source/control/templateabstractview.cxx
M sfx2/source/doc/templatedlg.cxx
2 files changed, 21 insertions(+), 2 deletions(-)
diff --git a/sfx2/source/control/templateabstractview.cxx b/sfx2/source/control/templateabstractview.cxx
index f8f20f5..182d833 100644
--- a/sfx2/source/control/templateabstractview.cxx
+++ b/sfx2/source/control/templateabstractview.cxx
@@ -102,7 +102,7 @@
: 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 @@
: 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::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 7bd3741..388f0cb 100644
--- a/sfx2/source/doc/templatedlg.cxx
+++ b/sfx2/source/doc/templatedlg.cxx
@@ -190,6 +190,8 @@
maView->Populate();
maView->Show();
+ mpCurView->filterTemplatesByApp(FILTER_APP_WRITER);
+
FreeResource();
}
--
To view, visit https://gerrit.libreoffice.org/1675
To unsubscribe, visit https://gerrit.libreoffice.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: If6cc5f6d5e502c1fc5da210179263be63fc8c8a6
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: libreoffice-4-0
Gerrit-Owner: Bosdonnat Cedric <cedric.bosdonnat at free.fr>
More information about the LibreOffice
mailing list