[PATCH 1/7] implement VBA Application.DisplayFullScreen bnc#757885

Noel Power noel.power at novell.com
Fri May 11 02:43:33 PDT 2012


---
 oovbaapi/ooo/vba/excel/XApplication.idl |    1 +
 sc/source/ui/inc/viewutil.hxx           |    2 +-
 sc/source/ui/vba/vbaapplication.cxx     |   20 ++++++++++++++++++++
 sc/source/ui/vba/vbaapplication.hxx     |    2 ++
 4 files changed, 24 insertions(+), 1 deletions(-)

diff --git a/oovbaapi/ooo/vba/excel/XApplication.idl b/oovbaapi/ooo/vba/excel/XApplication.idl
index e9bee9b..6453011 100644
--- a/oovbaapi/ooo/vba/excel/XApplication.idl
+++ b/oovbaapi/ooo/vba/excel/XApplication.idl
@@ -74,6 +74,7 @@ interface XApplication
     [attribute] boolean Visible;
     [attribute] boolean Iteration;
     [attribute] long EnableCancelKey;
+    [attribute] boolean DisplayFullScreen;
 
     void setDefaultFilePath([in] string DefaultFilePath) raises(com::sun::star::script::BasicErrorException);
 
diff --git a/sc/source/ui/inc/viewutil.hxx b/sc/source/ui/inc/viewutil.hxx
index d01faea..87d8f80 100644
--- a/sc/source/ui/inc/viewutil.hxx
+++ b/sc/source/ui/inc/viewutil.hxx
@@ -50,7 +50,7 @@ enum ScUpdateMode { SC_UPDATE_ALL, SC_UPDATE_CHANGED, SC_UPDATE_MARKS };
 
 // ---------------------------------------------------------------------------
 
-class ScViewUtil                                // static Methoden
+class SC_DLLPUBLIC ScViewUtil								// static Methoden
 {
 public:
     static sal_Bool ExecuteCharMap( const SvxFontItem&  rOldFont,
diff --git a/sc/source/ui/vba/vbaapplication.cxx b/sc/source/ui/vba/vbaapplication.cxx
index d1102b7..8b5344c 100644
--- a/sc/source/ui/vba/vbaapplication.cxx
+++ b/sc/source/ui/vba/vbaapplication.cxx
@@ -123,6 +123,8 @@
 #include <basic/sbuno.hxx>
 
 #include "vbafiledialog.hxx"
+#include "viewutil.hxx"
+
 using namespace ::ooo::vba;
 using namespace ::com::sun::star;
 using ::com::sun::star::uno::Reference;
@@ -879,6 +881,24 @@ ScVbaApplication::getEnableEvents() throw (uno::RuntimeException)
 }
 
 sal_Bool SAL_CALL
+ScVbaApplication::getDisplayFullScreen()  throw (uno::RuntimeException)
+{
+    SfxViewShell* pShell  = excel::getCurrentBestViewShell( mxContext );
+    if ( pShell )
+        return ScViewUtil::IsFullScreen( *pShell );
+    return sal_False;
+}
+
+void SAL_CALL
+ScVbaApplication::setDisplayFullScreen( sal_Bool bSet )  throw (uno::RuntimeException)
+{
+    // #FIXME calling  ScViewUtil::SetFullScreen( *pShell, bSet );
+    // directly results in a strange crash, using dispatch instead
+    if ( bSet != getDisplayFullScreen() )
+        dispatchRequests( getCurrentDocument(), rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(".uno:FullScreen") ) );
+}
+
+sal_Bool SAL_CALL
 ScVbaApplication::getVisible() throw (uno::RuntimeException)
 {
     sal_Bool bVisible = sal_True;
diff --git a/sc/source/ui/vba/vbaapplication.hxx b/sc/source/ui/vba/vbaapplication.hxx
index 8481690..38765e5 100644
--- a/sc/source/ui/vba/vbaapplication.hxx
+++ b/sc/source/ui/vba/vbaapplication.hxx
@@ -122,6 +122,8 @@ public:
     virtual sal_Bool SAL_CALL getEnableEvents() throw (css::uno::RuntimeException);
     virtual void SAL_CALL setEnableEvents( sal_Bool bEnable ) throw (css::uno::RuntimeException);
 
+    virtual sal_Bool SAL_CALL getDisplayFullScreen() throw (css::uno::RuntimeException);
+    virtual void SAL_CALL setDisplayFullScreen( sal_Bool bSet ) throw (css::uno::RuntimeException);
     virtual css::uno::Any SAL_CALL Windows( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException);
     virtual void SAL_CALL wait( double time ) throw (css::uno::RuntimeException);
     virtual css::uno::Any SAL_CALL Range( const css::uno::Any& Cell1, const css::uno::Any& Cell2 ) throw (css::uno::RuntimeException);
-- 
1.7.3.4


--------------070704010006060703060206
Content-Type: text/plain; charset=UTF-8;
 name="0002-vba-api-Application.DisplayScrollBars-implementation.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename*0="0002-vba-api-Application.DisplayScrollBars-implementation.pa";
 filename*1="tch"



More information about the LibreOffice mailing list