diff options
author | Krisztian Pinter <pin.terminator@gmail.com> | 2013-09-11 17:34:09 +0200 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-10-07 13:34:06 +0000 |
commit | eacbdd0e974ff8229b18d1a8434a6ca08cfe8b34 (patch) | |
tree | 6fec08dcd2a0706845f876c3ab80f612a988d023 /sfx2/source/dialog | |
parent | f3123d396c8f7f175551a9bab8bc232efe602083 (diff) |
startcenter: Hide template toggle button if no templates
Change-Id: I9c6f2058e67990156a4be928449c6ebe6614e486
Reviewed-on: https://gerrit.libreoffice.org/5913
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sfx2/source/dialog')
-rw-r--r-- | sfx2/source/dialog/backingwindow.cxx | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/sfx2/source/dialog/backingwindow.cxx b/sfx2/source/dialog/backingwindow.cxx index 4bff268a6bdb..4b6d7490d2cc 100644 --- a/sfx2/source/dialog/backingwindow.cxx +++ b/sfx2/source/dialog/backingwindow.cxx @@ -369,11 +369,19 @@ void BackingWindow::setupTemplateView( TemplateLocalView* pView, FILTER_APPLICAT pView->showRootRegion(); pView->setOpenTemplateHdl( LINK( this, BackingWindow, OpenTemplateHdl ) ); - // setup buttons - pRecentButton->SetClickHdl( LINK( this, BackingWindow, RecentTemplateToggleHdl ) ); - pTemplateButton->SetClickHdl( LINK( this, BackingWindow, RecentTemplateToggleHdl ) ); + if( pView->HasUnfilteredItems(eFilter) ) + { + // setup buttons + pRecentButton->SetClickHdl( LINK( this, BackingWindow, RecentTemplateToggleHdl ) ); + pTemplateButton->SetClickHdl( LINK( this, BackingWindow, RecentTemplateToggleHdl ) ); - pRecentButton->Hide(); // hidden by default + pRecentButton->Hide(); // hidden by default + } + else // no templates, hide toggle button + { + pTemplateButton->Hide(); + pRecentButton->Hide(); + } } void BackingWindow::Paint( const Rectangle& ) { |