diff options
Diffstat (limited to 'sc/source/ui/navipi/navipi.cxx')
-rw-r--r-- | sc/source/ui/navipi/navipi.cxx | 64 |
1 files changed, 45 insertions, 19 deletions
diff --git a/sc/source/ui/navipi/navipi.cxx b/sc/source/ui/navipi/navipi.cxx index 5d32ee48dbf7..5c5d7583476e 100644 --- a/sc/source/ui/navipi/navipi.cxx +++ b/sc/source/ui/navipi/navipi.cxx @@ -547,7 +547,7 @@ ScNavigatorDialogWrapper::ScNavigatorDialogWrapper( SfxChildWinInfo* /* pInfo */ ) : SfxChildWindowContext( nId ) { - pNavigator = new ScNavigatorDlg( pBind, this, pParent ); + pNavigator = new ScNavigatorDlg( pBind, this, pParent, true ); SetWindow( pNavigator ); // Einstellungen muessen anderswo gemerkt werden, @@ -615,7 +615,8 @@ void ScNavigatorDialogWrapper::Resizing( Size& rSize ) #define REGISTER_SLOT(i,id) \ ppBoundItems[i]=new ScNavigatorControllerItem(id,*this,rBindings); -ScNavigatorDlg::ScNavigatorDlg( SfxBindings* pB, SfxChildWindowContext* pCW, Window* pParent ) : +ScNavigatorDlg::ScNavigatorDlg( SfxBindings* pB, SfxChildWindowContext* pCW, Window* pParent, + const bool bUseStyleSettingsBackground) : Window( pParent, ScResId(RID_SCDLG_NAVIGATOR) ), rBindings ( *pB ), // is used in CommandToolBox ctor aCmdImageList( ScResId( IL_CMD ) ), @@ -640,7 +641,8 @@ ScNavigatorDlg::ScNavigatorDlg( SfxBindings* pB, SfxChildWindowContext* pCW, Win nCurCol ( 0 ), nCurRow ( 0 ), nCurTab ( 0 ), - bFirstBig ( false ) + bFirstBig ( false ), + mbUseStyleSettingsBackground(bUseStyleSettingsBackground) { ScNavipiCfg& rCfg = SC_MOD()->GetNavipiCfg(); nDropMode = rCfg.GetDragMode(); @@ -725,6 +727,16 @@ ScNavigatorDlg::ScNavigatorDlg( SfxBindings* pB, SfxChildWindowContext* pCW, Win aLbEntries.SetAccessibleRelationLabeledBy(&aLbEntries); aTbxCmd.SetAccessibleRelationLabeledBy(&aTbxCmd); aLbDocuments.SetAccessibleName(aStrActiveWin); + + if (pContextWin == NULL) + { + // When the context window is missing then the navigator is + // displayed in the sidebar and has the whole deck to fill. + // Therefore hide the button that hides all controls below the + // top two rows of buttons. + aTbxCmd.Select(IID_ZOOMOUT); + aTbxCmd.RemoveItem(aTbxCmd.GetItemPos(IID_ZOOMOUT)); + } } //------------------------------------------------------------------------ @@ -748,7 +760,7 @@ ScNavigatorDlg::~ScNavigatorDlg() void ScNavigatorDlg::Resizing( Size& rNewSize ) // Size = Outputsize? { - FloatingWindow* pFloat = pContextWin->GetFloatingWindow(); + FloatingWindow* pFloat = pContextWin!=NULL ? pContextWin->GetFloatingWindow() : NULL; if ( pFloat ) { Size aMinOut = pFloat->GetMinOutputSizePixel(); @@ -770,13 +782,21 @@ void ScNavigatorDlg::Resizing( Size& rNewSize ) // Size = Outputsize? void ScNavigatorDlg::Paint( const Rectangle& rRect ) { - const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings(); - Color aBgColor = rStyleSettings.GetFaceColor(); - Wallpaper aBack( aBgColor ); + if (mbUseStyleSettingsBackground) + { + const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings(); + Color aBgColor = rStyleSettings.GetFaceColor(); + Wallpaper aBack( aBgColor ); - SetBackground( aBack ); - aFtCol.SetBackground( aBack ); - aFtRow.SetBackground( aBack ); + SetBackground( aBack ); + aFtCol.SetBackground( aBack ); + aFtRow.SetBackground( aBack ); + } + else + { + aFtCol.SetBackground(Wallpaper()); + aFtRow.SetBackground(Wallpaper()); + } Window::Paint( rRect ); } @@ -850,9 +870,12 @@ void ScNavigatorDlg::DoResize() aLbDocuments.SetSizePixel( aDocSize ); sal_Bool bListMode = (eListMode != NAV_LMODE_NONE); - FloatingWindow* pFloat = pContextWin->GetFloatingWindow(); - if ( pFloat && bListMode ) - nListModeHeight = nTotalHeight; + if (pContextWin != NULL) + { + FloatingWindow* pFloat = pContextWin->GetFloatingWindow(); + if ( pFloat && bListMode ) + nListModeHeight = nTotalHeight; + } } //------------------------------------------------------------------------ @@ -1183,7 +1206,7 @@ void ScNavigatorDlg::SetListMode( NavListMode eMode, sal_Bool bSetSize ) void ScNavigatorDlg::ShowList( sal_Bool bShow, sal_Bool bSetSize ) { - FloatingWindow* pFloat = pContextWin->GetFloatingWindow(); + FloatingWindow* pFloat = pContextWin!=NULL ? pContextWin->GetFloatingWindow() : NULL; Size aSize = GetParent()->GetOutputSizePixel(); if ( bShow ) @@ -1217,10 +1240,13 @@ void ScNavigatorDlg::ShowList( sal_Bool bShow, sal_Bool bSetSize ) } else { - SfxNavigator* pNav = (SfxNavigator*)GetParent(); - Size aFloating = pNav->GetFloatingSize(); - aFloating.Height() = aSize.Height(); - pNav->SetFloatingSize( aFloating ); + SfxNavigator* pNav = dynamic_cast<SfxNavigator*>(GetParent()); + if (pNav != NULL) + { + Size aFloating = pNav->GetFloatingSize(); + aFloating.Height() = aSize.Height(); + pNav->SetFloatingSize( aFloating ); + } } } @@ -1228,7 +1254,7 @@ void ScNavigatorDlg::ShowList( sal_Bool bShow, sal_Bool bSetSize ) void ScNavigatorDlg::ShowScenarios( sal_Bool bShow, sal_Bool bSetSize ) { - FloatingWindow* pFloat = pContextWin->GetFloatingWindow(); + FloatingWindow* pFloat = pContextWin!=NULL ? pContextWin->GetFloatingWindow() : NULL; Size aSize = GetParent()->GetOutputSizePixel(); if ( bShow ) |