rpms/openoffice.org/devel openoffice.org-2.0.4.rh213710.vba.patch, NONE, 1.1 openoffice.org.spec, 1.915, 1.916

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Mon Nov 6 17:27:07 UTC 2006


Author: caolanm

Update of /cvs/dist/rpms/openoffice.org/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv23405

Modified Files:
	openoffice.org.spec 
Added Files:
	openoffice.org-2.0.4.rh213710.vba.patch 
Log Message:
rhbz#213710 application.version vba support

openoffice.org-2.0.4.rh213710.vba.patch:
 offapi/org/openoffice/vba/XApplication.idl |    3 +
 sc/source/ui/vba/vbaapplication.cxx        |   87 +++++++++++++++++++++++++++++
 sc/source/ui/vba/vbaapplication.hxx        |    5 +
 3 files changed, 95 insertions(+)

--- NEW FILE openoffice.org-2.0.4.rh213710.vba.patch ---
--- openoffice.org.orig/offapi/org/openoffice/vba/XApplication.idl	2006-11-06 14:49:03.000000000 +0000
+++ openoffice.org/offapi/org/openoffice/vba/XApplication.idl	2006-11-06 16:11:20.000000000 +0000
@@ -29,7 +29,10 @@
 	// to determine this
 	[attribute, readonly] XWorkbook ThisWorkbook;
 	[attribute] boolean ScreenUpdating;
+        [attribute] boolean DisplayStatusBar;
+        [attribute] any StatusBar;
 	[attribute] any CutCopyMode;
+        [attribute, readonly] string Version;
 	any Workbooks( [in] any aIndex );
 	any Worksheets( [in] any aIndex );
 	any Windows( [in] any aIndex );
diff -u -r sc/source/ui/vba/vbaapplication.cxx sc/source/ui/vba/vbaapplication.cxx
--- openoffice.org.orig/sc/source/ui/vba/vbaapplication.cxx	2006-11-06 14:53:52.000000000 +0000
+++ openoffice.org/sc/source/ui/vba/vbaapplication.cxx	2006-11-06 16:25:06.000000000 +0000
@@ -4,6 +4,9 @@
 #include<com/sun/star/view/XSelectionSupplier.hpp>
 #include<org/openoffice/vba/Excel/XlCalculation.hpp>
 #include <com/sun/star/sheet/XCellRangeReferrer.hpp>
+#include <com/sun/star/frame/XLayoutManager.hpp>
+#include <com/sun/star/task/XStatusIndicatorSupplier.hpp>
+#include <com/sun/star/task/XStatusIndicator.hpp>
 
 #include "vbaapplication.hxx"
 #include "vbaworkbooks.hxx"
@@ -30,6 +33,8 @@
 #include <basic/sbmeth.hxx>
 //end test includes
 
+#define EXCELVERSION "10.0"
+
 using namespace ::org::openoffice;
 using namespace ::com::sun::star;
 
@@ -187,6 +192,88 @@
 {
 	//# FIXME TODO, implementation
 }
+
+sal_Bool
+ScVbaApplication::getDisplayStatusBar() throw (uno::RuntimeException)
+{
+       uno::Reference< frame::XModel > xModel( getCurrentDocument(), uno::UNO_QUERY_THROW );
+    uno::Reference< frame::XFrame > xFrame( xModel->getCurrentController()->getFrame(), uno::UNO_QUERY_THROW );
+    uno::Reference< beans::XPropertySet > xProps( xFrame, uno::UNO_QUERY_THROW );
+
+    if( xProps.is() ){
+        uno::Reference< frame::XLayoutManager > xLayoutManager( xProps->getPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("LayoutManager")) ), uno::UNO_QUERY_THROW );
+        rtl::OUString url(RTL_CONSTASCII_USTRINGPARAM( "private:resource/statusbar/statusbar" ));
+        if( xLayoutManager.is() && xLayoutManager->isElementVisible( url ) ){
+            return sal_True;
+        }
+    }
+    return sal_False;
+}
+
+void
+ScVbaApplication::setDisplayStatusBar(sal_Bool bDisplayStatusBar) throw (uno::RuntimeException)
+{
+       uno::Reference< frame::XModel > xModel( getCurrentDocument(), uno::UNO_QUERY_THROW );
+    uno::Reference< frame::XFrame > xFrame( xModel->getCurrentController()->getFrame(), uno::UNO_QUERY_THROW );
+    uno::Reference< beans::XPropertySet > xProps( xFrame, uno::UNO_QUERY_THROW );
+
+    if( xProps.is() ){
+        uno::Reference< frame::XLayoutManager > xLayoutManager( xProps->getPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("LayoutManager")) ), uno::UNO_QUERY_THROW );
+        rtl::OUString url(RTL_CONSTASCII_USTRINGPARAM( "private:resource/statusbar/statusbar" ));
+        if( xLayoutManager.is() ){
+            if( bDisplayStatusBar && !xLayoutManager->isElementVisible( url ) ){
+                if( !xLayoutManager->showElement( url ) )
+                    xLayoutManager->createElement( url );
+                return;
+            }
+            else if( !bDisplayStatusBar && xLayoutManager->isElementVisible( url ) ){
+                xLayoutManager->hideElement( url ); 
+                return;
+            }
+        }
+    }
+    return;
+}
+
+uno::Any SAL_CALL
+ScVbaApplication::getStatusBar() throw (uno::RuntimeException)
+{
+       return uno::makeAny( !getDisplayStatusBar() );
+}
+
+void SAL_CALL 
+ScVbaApplication::setStatusBar( const uno::Any& _statusbar ) throw (uno::RuntimeException)
+{
+    rtl::OUString sText;
+    sal_Bool bDefault;
+       uno::Reference< frame::XModel > xModel( getCurrentDocument(), uno::UNO_QUERY_THROW );
+    uno::Reference< task::XStatusIndicatorSupplier > xStatusIndicatorSupplier( xModel->getCurrentController(), uno::UNO_QUERY_THROW );
+    uno::Reference< task::XStatusIndicator > xStatusIndicator( xStatusIndicatorSupplier->getStatusIndicator(), uno::UNO_QUERY_THROW );
+    if( _statusbar >>= sText )
+    {
+        setDisplayStatusBar( sal_True );
+        xStatusIndicator->start( sText, 100 );
+        //xStatusIndicator->setText( sText );
+    }
+    else if( _statusbar >>= bDefault )
+    {
+        if( bDefault == sal_False )
+        {
+            xStatusIndicator->end();
+            setDisplayStatusBar( sal_True );
+        }
+    }
+    else
+        throw uno::RuntimeException( rtl::OUString::createFromAscii( "Invalid prarameter. It should be a string or False" ),
+            uno::Reference< uno::XInterface >() );
+}
+
+::rtl::OUString
+ScVbaApplication::getVersion() throw (uno::RuntimeException)
+{
+	return rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(EXCELVERSION));
+}
+
 double SAL_CALL 
 ScVbaApplication::CountA( const uno::Any& arg1 ) throw (uno::RuntimeException)
 {
diff -u -r sc/source/ui/vba/vbaapplication.hxx sc/source/ui/vba/vbaapplication.hxx
--- sc/source/ui/vba/vbaapplication.hxx	2006-11-06 14:53:53.000000000 +0000
+++ sc/source/ui/vba/vbaapplication.hxx	2006-11-06 15:58:30.000000000 +0000
@@ -30,6 +30,8 @@
  virtual css::uno::Reference< oo::vba::XWorksheet > SAL_CALL getActiveSheet() throw (::com::sun::star::uno::RuntimeException);
 	virtual sal_Bool SAL_CALL getScreenUpdating() throw (css::uno::RuntimeException);
 	virtual void SAL_CALL setScreenUpdating(sal_Bool bUpdate) throw (css::uno::RuntimeException);
+        virtual sal_Bool SAL_CALL getDisplayStatusBar() throw (css::uno::RuntimeException);
+        virtual void SAL_CALL setDisplayStatusBar(sal_Bool bDisplayStatusBar) throw (css::uno::RuntimeException);
 	virtual css::uno::Reference< oo::vba::XWorkbook > SAL_CALL getThisWorkbook() throw (css::uno::RuntimeException);
 	virtual css::uno::Any SAL_CALL Workbooks( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException);
 	virtual css::uno::Any SAL_CALL Worksheets( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException);
@@ -38,6 +40,9 @@
 	virtual css::uno::Any SAL_CALL Dialogs( const css::uno::Any& DialogIndex ) throw (css::uno::RuntimeException);
 	virtual css::uno::Any SAL_CALL getCutCopyMode() throw (css::uno::RuntimeException);
 	virtual void SAL_CALL setCutCopyMode( const css::uno::Any& _cutcopymode ) throw (css::uno::RuntimeException);
+        virtual css::uno::Any SAL_CALL getStatusBar() throw (css::uno::RuntimeException);
+        virtual void SAL_CALL setStatusBar( const css::uno::Any& _statusbar ) throw (css::uno::RuntimeException);
+	virtual ::rtl::OUString SAL_CALL getVersion() throw (css::uno::RuntimeException);
 
 	virtual double SAL_CALL CountA( const css::uno::Any& arg1 ) throw (css::uno::RuntimeException) ;
 


Index: openoffice.org.spec
===================================================================
RCS file: /cvs/dist/rpms/openoffice.org/devel/openoffice.org.spec,v
retrieving revision 1.915
retrieving revision 1.916
diff -u -r1.915 -r1.916
--- openoffice.org.spec	6 Nov 2006 14:26:13 -0000	1.915
+++ openoffice.org.spec	6 Nov 2006 17:27:04 -0000	1.916
@@ -1,6 +1,6 @@
 %define oootag OOE680
 %define ooomilestone 1
-%define rh_rpm_release 1
+%define rh_rpm_release 2
 
 # gcc#19664#
 %define stlvisibilityfcked 1
@@ -127,6 +127,7 @@
 Patch61: workspace.gtkquickstart2.patch
 Patch62: openoffice.org-1.9.129.ooo54603.fontconfig.part4.patch
 Patch63: openoffice.org-2.1.0.ooo71078.pyuno.correctrelease.patch
+Patch64: openoffice.org-2.0.4.rh213710.vba.patch
 
 %define instdir %{_libdir}/openoffice.org2.1
 
@@ -990,6 +991,7 @@
 %patch61 -p1 -b .workspace.gtkquickstart2.patch
 %patch62 -p1 -b .ooo54603.fontconfig.part4.patch
 %patch63 -p1 -b .ooo71078.pyuno.correctrelease.patch
+%patch64 -p1 -b .rh213710.vba.patch
 
 tar xzf %{SOURCE1}
 
@@ -2513,6 +2515,9 @@
 %{instdir}/share/registry/modules/org/openoffice/Office/Scripting/Scripting-python.xcu
 
 %changelog
+* Mon Nov 06 2006 Caolan McNamara <caolanm at redhat.com> - 1:2.1.0-1.2
+- Resolves: rhbz#213710
+
 * Thu Nov 02 2006 Caolan McNamara <caolanm at redhat.com> - 1:2.1.0-1.1
 - start of 2.1.0
 - setlang patch partially upstreamed




More information about the fedora-cvs-commits mailing list