[Libreoffice-commits] .: 3 commits - oovbaapi/ooo sc/source

Noel Power noelp at kemper.freedesktop.org
Fri Apr 20 10:26:49 PDT 2012


 oovbaapi/ooo/vba/excel/XApplication.idl |    5 +
 sc/source/ui/inc/viewutil.hxx           |    2 
 sc/source/ui/vba/vbaapplication.cxx     |   86 +++++++++++++++++++++++++++++++-
 sc/source/ui/vba/vbaapplication.hxx     |   11 ++++
 4 files changed, 101 insertions(+), 3 deletions(-)

New commits:
commit 101132c28a8f084612106337f4cafe21c535dea8
Author: Noel Power <noel.power at novell.com>
Date:   Fri Apr 20 18:25:45 2012 +0100

    add stub vba implementation Application methods
    
    added Application.DisplayExcel4Menus, Application.DisplayNoteIndicator, Application.ShowWindowsInTaskbar. Althought these attributes of the Application object don't do anything they allow setting and retrieval of the state. We could make a usable implementation for Application.DisplayNoteIndicator, the others though don't really seem to have any useful equivalent in the libreoffice world

diff --git a/oovbaapi/ooo/vba/excel/XApplication.idl b/oovbaapi/ooo/vba/excel/XApplication.idl
index 866ab21..baf6468 100644
--- a/oovbaapi/ooo/vba/excel/XApplication.idl
+++ b/oovbaapi/ooo/vba/excel/XApplication.idl
@@ -76,6 +76,9 @@ interface XApplication
     [attribute] long EnableCancelKey;
     [attribute] boolean DisplayFullScreen;
     [attribute] boolean DisplayScrollBars;
+    [attribute] boolean DisplayExcel4Menus;
+    [attribute] boolean DisplayNoteIndicator;
+    [attribute] boolean ShowWindowsInTaskbar;
 
     void setDefaultFilePath([in] string DefaultFilePath) raises(com::sun::star::script::BasicErrorException);
 
diff --git a/sc/source/ui/vba/vbaapplication.cxx b/sc/source/ui/vba/vbaapplication.cxx
index 4963882..bb31732 100644
--- a/sc/source/ui/vba/vbaapplication.cxx
+++ b/sc/source/ui/vba/vbaapplication.cxx
@@ -154,14 +154,19 @@ struct ScVbaAppSettings
     sal_Int32 mnCalculation;
     sal_Bool mbDisplayAlerts;
     sal_Bool mbEnableEvents;
-
+    sal_Bool mbExcel4Menus;
+    sal_Bool mbDisplayNoteIndicator;
+    sal_Bool mbShowWindowsInTaskbar;
     explicit ScVbaAppSettings();
 };
 
 ScVbaAppSettings::ScVbaAppSettings() :
     mnCalculation( excel::XlCalculation::xlCalculationAutomatic ),
     mbDisplayAlerts( sal_True ),
-    mbEnableEvents( sal_True )
+    mbEnableEvents( sal_True ),
+    mbExcel4Menus( sal_False ),
+    mbDisplayNoteIndicator( sal_True ),
+    mbShowWindowsInTaskbar( sal_True )
 {
 }
 
@@ -916,6 +921,42 @@ ScVbaApplication::setDisplayScrollBars( sal_Bool bSet )  throw (uno::RuntimeExce
 }
 
 sal_Bool SAL_CALL
+ScVbaApplication::getDisplayExcel4Menus() throw (css::uno::RuntimeException)
+{
+    return mrAppSettings.mbExcel4Menus;
+}
+
+void SAL_CALL
+ScVbaApplication::setDisplayExcel4Menus( sal_Bool bSet ) throw (css::uno::RuntimeException)
+{
+    mrAppSettings.mbExcel4Menus = bSet;
+}
+
+sal_Bool SAL_CALL
+ScVbaApplication::getDisplayNoteIndicator() throw (css::uno::RuntimeException)
+{
+    return mrAppSettings.mbDisplayNoteIndicator;
+}
+
+void SAL_CALL
+ScVbaApplication::setDisplayNoteIndicator( sal_Bool bSet ) throw (css::uno::RuntimeException)
+{
+    mrAppSettings.mbDisplayNoteIndicator = bSet;
+}
+
+sal_Bool SAL_CALL
+ScVbaApplication::getShowWindowsInTaskbar() throw (css::uno::RuntimeException)
+{
+    return mrAppSettings.mbShowWindowsInTaskbar;
+}
+
+void SAL_CALL
+ScVbaApplication::setShowWindowsInTaskbar( sal_Bool bSet ) throw (css::uno::RuntimeException)
+{
+    mrAppSettings.mbShowWindowsInTaskbar = bSet;
+}
+
+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 9b1c528..0f72d7b 100644
--- a/sc/source/ui/vba/vbaapplication.hxx
+++ b/sc/source/ui/vba/vbaapplication.hxx
@@ -126,6 +126,13 @@ public:
     virtual void SAL_CALL setDisplayFullScreen( sal_Bool bSet ) throw (css::uno::RuntimeException);
     virtual sal_Bool SAL_CALL getDisplayScrollBars() throw (css::uno::RuntimeException);
     virtual void SAL_CALL setDisplayScrollBars( sal_Bool bSet ) throw (css::uno::RuntimeException);
+    virtual sal_Bool SAL_CALL getDisplayExcel4Menus() throw (css::uno::RuntimeException);
+    virtual void SAL_CALL setDisplayExcel4Menus( sal_Bool bSet ) throw (css::uno::RuntimeException);
+
+    virtual sal_Bool SAL_CALL getDisplayNoteIndicator() throw (css::uno::RuntimeException);
+    virtual void SAL_CALL setDisplayNoteIndicator( sal_Bool bSet ) throw (css::uno::RuntimeException);
+    virtual sal_Bool SAL_CALL getShowWindowsInTaskbar() throw (css::uno::RuntimeException);
+    virtual void SAL_CALL setShowWindowsInTaskbar( 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);
commit f2cf3f30a76cb257bf44f9651b295280fb12d4aa
Author: Noel Power <noel.power at novell.com>
Date:   Fri Apr 20 17:57:02 2012 +0100

    vba api Application.DisplayScrollBars implementation bnc#757840

diff --git a/oovbaapi/ooo/vba/excel/XApplication.idl b/oovbaapi/ooo/vba/excel/XApplication.idl
index 6453011..866ab21 100644
--- a/oovbaapi/ooo/vba/excel/XApplication.idl
+++ b/oovbaapi/ooo/vba/excel/XApplication.idl
@@ -75,6 +75,7 @@ interface XApplication
     [attribute] boolean Iteration;
     [attribute] long EnableCancelKey;
     [attribute] boolean DisplayFullScreen;
+    [attribute] boolean DisplayScrollBars;
 
     void setDefaultFilePath([in] string DefaultFilePath) raises(com::sun::star::script::BasicErrorException);
 
diff --git a/sc/source/ui/vba/vbaapplication.cxx b/sc/source/ui/vba/vbaapplication.cxx
index d9f4b10..4963882 100644
--- a/sc/source/ui/vba/vbaapplication.cxx
+++ b/sc/source/ui/vba/vbaapplication.cxx
@@ -895,6 +895,27 @@ ScVbaApplication::setDisplayFullScreen( sal_Bool bSet )  throw (uno::RuntimeExce
 }
 
 sal_Bool SAL_CALL
+ScVbaApplication::getDisplayScrollBars()  throw (uno::RuntimeException)
+{
+    ScTabViewShell* pShell  = excel::getCurrentBestViewShell( mxContext );
+    if ( pShell )
+    {
+        return ( pShell->GetViewData()->IsHScrollMode() && pShell->GetViewData()->IsVScrollMode() );
+    }
+    return true;
+}
+
+void SAL_CALL
+ScVbaApplication::setDisplayScrollBars( sal_Bool bSet )  throw (uno::RuntimeException)
+{
+    // use uno here as it does all he repainting etc. magic
+    uno::Reference< sheet::XSpreadsheetView > xView( getCurrentDocument()->getCurrentController(), uno::UNO_QUERY_THROW );
+    uno::Reference< beans::XPropertySet > xProps( xView, uno::UNO_QUERY );
+    xProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("HasVerticalScrollBar") ), uno::makeAny( bSet ) );
+    xProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("HasHorizontalScrollBar") ), uno::makeAny( bSet ) );
+}
+
+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 3712bc1..9b1c528 100644
--- a/sc/source/ui/vba/vbaapplication.hxx
+++ b/sc/source/ui/vba/vbaapplication.hxx
@@ -124,6 +124,8 @@ public:
 
     virtual sal_Bool SAL_CALL getDisplayFullScreen() throw (css::uno::RuntimeException);
     virtual void SAL_CALL setDisplayFullScreen( sal_Bool bSet ) throw (css::uno::RuntimeException);
+    virtual sal_Bool SAL_CALL getDisplayScrollBars() throw (css::uno::RuntimeException);
+    virtual void SAL_CALL setDisplayScrollBars( 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);
commit 4fa65f95e86dc4e348c83814475b057e8f30c107
Author: Noel Power <noel.power at novell.com>
Date:   Fri Apr 20 17:44:14 2012 +0100

    implement VBA Application.DisplayFullScreen bnc#757885

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 4204ba0..d9f4b10 100644
--- a/sc/source/ui/vba/vbaapplication.cxx
+++ b/sc/source/ui/vba/vbaapplication.cxx
@@ -119,6 +119,8 @@
 #include <basic/sbxobj.hxx>
 
 #include "vbafiledialog.hxx"
+#include "viewutil.hxx"
+
 using namespace ::ooo::vba;
 using namespace ::com::sun::star;
 using ::com::sun::star::uno::Reference;
@@ -875,6 +877,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 ad8c833..3712bc1 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);


More information about the Libreoffice-commits mailing list