[PATCH 3/7] add stub vba implementation Application methods

Noel Power noel.power at novell.com
Fri Apr 20 10:25:45 PDT 2012


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
---
 oovbaapi/ooo/vba/excel/XApplication.idl |    3 ++
 sc/source/ui/vba/vbaapplication.cxx     |   45 +++++++++++++++++++++++++++++-
 sc/source/ui/vba/vbaapplication.hxx     |    7 +++++
 3 files changed, 53 insertions(+), 2 deletions(-)

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 ce8be4e..20bb19c 100644
--- a/sc/source/ui/vba/vbaapplication.cxx
+++ b/sc/source/ui/vba/vbaapplication.cxx
@@ -158,14 +158,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 )
 {
 }
 
@@ -920,6 +925,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 9e5d7f7..95703f0 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);
-- 
1.7.3.4


--------------070704010006060703060206
Content-Type: text/plain; charset=UTF-8;
 name="0004-add-support-for-MousePointer-attribute-in-controls.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename*0="0004-add-support-for-MousePointer-attribute-in-controls.patc";
 filename*1="h"



More information about the LibreOffice mailing list