diff options
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& ) { |