summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorRafael Dominguez <venccsralph@gmail.com>2012-07-15 08:13:50 -0430
committerRafael Dominguez <venccsralph@gmail.com>2012-07-15 08:15:26 -0430
commitcbdfab6e43d1462d7c677bc8dd5f66ced51ce88f (patch)
treed22abe60078d387360b460abb5b42425f564e31f /sfx2
parent7d2e94d0f8ec8824b3056fc107e29b8ba283e0b3 (diff)
Keep track of the current view and close it when we click close icon.
Change-Id: I63faf58203ac43b4216a57d8ad5fbfe8d9f0bfff
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/inc/templatedlg.hxx2
-rw-r--r--sfx2/source/doc/templatedlg.cxx8
2 files changed, 9 insertions, 1 deletions
diff --git a/sfx2/inc/templatedlg.hxx b/sfx2/inc/templatedlg.hxx
index 307922d68092..47e6f9b39d68 100644
--- a/sfx2/inc/templatedlg.hxx
+++ b/sfx2/inc/templatedlg.hxx
@@ -17,6 +17,7 @@
class Edit;
class PopupMenu;
+class TemplateAbstractView;
class TemplateFolderView;
class TemplateOnlineView;
class TemplateSearchView;
@@ -95,6 +96,7 @@ private:
ToolBox *mpActionBar;
ToolBox *mpTemplateBar;
TemplateSearchView *mpSearchView;
+ TemplateAbstractView *mpCurView;
TemplateFolderView *maView;
TemplateOnlineView *mpOnlineView;
PopupMenu *mpCreateMenu;
diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx
index 6555d7e57449..05d333b24054 100644
--- a/sfx2/source/doc/templatedlg.cxx
+++ b/sfx2/source/doc/templatedlg.cxx
@@ -198,6 +198,8 @@ SfxTemplateManagerDlg::SfxTemplateManagerDlg (Window *parent)
ITEM_MAX_HEIGHT-THUMBNAIL_MAX_HEIGHT,
ITEM_PADDING);
+ mpOnlineView->setOverlayCloseHdl(LINK(this,SfxTemplateManagerDlg,CloseOverlayHdl));
+
mpSearchView->SetSizePixel(aThumbSize);
mpSearchView->setItemMaxTextLength(ITEM_MAX_TEXT_LENGTH);
@@ -308,7 +310,7 @@ IMPL_LINK_NOARG(SfxTemplateManagerDlg, CloseOverlayHdl)
mpTemplateBar->Hide();
mpViewBar->Show();
- maView->showOverlay(false);
+ mpCurView->showOverlay(false);
return 0;
}
@@ -839,6 +841,8 @@ void SfxTemplateManagerDlg::switchMainView(bool bDisplayLocal)
{
if (bDisplayLocal)
{
+ mpCurView = maView;
+
mpViewBar->ShowItem(TBI_TEMPLATE_ONLINE);
mpViewBar->HideItem(TBI_TEMPLATE_LOCAL);
@@ -847,6 +851,8 @@ void SfxTemplateManagerDlg::switchMainView(bool bDisplayLocal)
}
else
{
+ mpCurView = mpOnlineView;
+
mpViewBar->ShowItem(TBI_TEMPLATE_LOCAL);
mpViewBar->HideItem(TBI_TEMPLATE_ONLINE);