diff options
Diffstat (limited to 'sc/source/ui/view/viewutil.cxx')
-rw-r--r-- | sc/source/ui/view/viewutil.cxx | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/sc/source/ui/view/viewutil.cxx b/sc/source/ui/view/viewutil.cxx index 6436026613e4..0dc2a2f960f6 100644 --- a/sc/source/ui/view/viewutil.cxx +++ b/sc/source/ui/view/viewutil.cxx @@ -37,6 +37,8 @@ #include <tools/list.hxx> #include "scitems.hxx" #include <sfx2/bindings.hxx> +#include <sfx2/viewsh.hxx> +#include <sfx2/dispatch.hxx> #include <svx/charmap.hxx> #include <svx/fontitem.hxx> #include <svx/langitem.hxx> @@ -393,6 +395,26 @@ BOOL ScViewUtil::ExecuteCharMap( const SvxFontItem& rOldFont, return bRet; } +bool ScViewUtil::IsFullScreen( SfxViewShell& rViewShell ) +{ + SfxBindings& rBindings = rViewShell.GetViewFrame()->GetBindings(); + SfxPoolItem* pItem = 0; + bool bIsFullScreen = false; + + if (rBindings.QueryState( SID_WIN_FULLSCREEN, pItem ) >= SFX_ITEM_DEFAULT) + bIsFullScreen = static_cast< SfxBoolItem* >( pItem )->GetValue(); + return bIsFullScreen; +} + +void ScViewUtil::SetFullScreen( SfxViewShell& rViewShell, bool bSet ) +{ + if( IsFullScreen( rViewShell ) != bSet ) + { + SfxBoolItem aItem( SID_WIN_FULLSCREEN, bSet ); + rViewShell.GetDispatcher()->Execute( SID_WIN_FULLSCREEN, SFX_CALLMODE_RECORD, &aItem, 0L ); + } +} + //------------------------------------------------------------------ ScUpdateRect::ScUpdateRect( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2 ) |