From eacbdd0e974ff8229b18d1a8434a6ca08cfe8b34 Mon Sep 17 00:00:00 2001 From: Krisztian Pinter Date: Wed, 11 Sep 2013 17:34:09 +0200 Subject: startcenter: Hide template toggle button if no templates MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I9c6f2058e67990156a4be928449c6ebe6614e486 Reviewed-on: https://gerrit.libreoffice.org/5913 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- sfx2/source/dialog/backingwindow.cxx | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'sfx2/source/dialog') 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& ) { -- cgit