incubator-ooo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m..@apache.org
Subject svn commit: r1172135 - in /incubator/ooo/trunk/main/sc/source/ui/vba: vbaapplication.cxx vbaworkbook.cxx
Date Sat, 17 Sep 2011 22:44:26 GMT
Author: mst
Date: Sat Sep 17 22:44:25 2011
New Revision: 1172135

URL: http://svn.apache.org/viewvc?rev=1172135&view=rev
Log:
calc69: #i116936# fix VBA symbol Cells

# HG changeset patch
# User Daniel Rentz [dr] <daniel.rentz@oracle.com>
# Date 1303210366 -7200
# Node ID a0047afb36a09c0f8656e22eb1ee8e63655d21ad
# Parent d92a3dd6ece07f4ab2a98d8ec0b0e43fc8dc828b

Modified:
    incubator/ooo/trunk/main/sc/source/ui/vba/vbaapplication.cxx
    incubator/ooo/trunk/main/sc/source/ui/vba/vbaworkbook.cxx

Modified: incubator/ooo/trunk/main/sc/source/ui/vba/vbaapplication.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sc/source/ui/vba/vbaapplication.cxx?rev=1172135&r1=1172134&r2=1172135&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sc/source/ui/vba/vbaapplication.cxx (original)
+++ incubator/ooo/trunk/main/sc/source/ui/vba/vbaapplication.cxx Sat Sep 17 22:44:25 2011
@@ -205,15 +205,21 @@ ScVbaApplication::hasProperty( const ::r
 uno::Reference< excel::XWorkbook >
 ScVbaApplication::getActiveWorkbook() throw (uno::RuntimeException)
 {
-    // will throw if active document is not in VBA compatibility mode (no object for codename)
-    return uno::Reference< excel::XWorkbook >( getVBADocument( getCurrentExcelDoc(
mxContext ) ), uno::UNO_QUERY_THROW );
+	uno::Reference< frame::XModel > xModel( getCurrentExcelDoc( mxContext ), uno::UNO_SET_THROW
);
+    uno::Reference< excel::XWorkbook > xWorkbook( getVBADocument( xModel ), uno::UNO_QUERY
);
+    if( xWorkbook.is() ) return xWorkbook;
+    // #i116936# getVBADocument() may return null in documents without global VBA mode enabled
+    return new ScVbaWorkbook( this, mxContext, xModel );
 }
 
 uno::Reference< excel::XWorkbook > SAL_CALL 
 ScVbaApplication::getThisWorkbook() throw (uno::RuntimeException)
 {
-    // should never throw as this model is in VBA compatibility mode
-    return uno::Reference< excel::XWorkbook >( getVBADocument( getThisExcelDoc( mxContext
) ), uno::UNO_QUERY_THROW );
+	uno::Reference< frame::XModel > xModel( getThisExcelDoc( mxContext ), uno::UNO_SET_THROW
);
+    uno::Reference< excel::XWorkbook > xWorkbook( getVBADocument( xModel ), uno::UNO_QUERY
);
+    if( xWorkbook.is() ) return xWorkbook;
+    // #i116936# getVBADocument() may return null in documents without global VBA mode enabled
+    return new ScVbaWorkbook( this, mxContext, xModel );
 }
 
 uno::Reference< XAssistant > SAL_CALL

Modified: incubator/ooo/trunk/main/sc/source/ui/vba/vbaworkbook.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sc/source/ui/vba/vbaworkbook.cxx?rev=1172135&r1=1172134&r2=1172135&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sc/source/ui/vba/vbaworkbook.cxx (original)
+++ incubator/ooo/trunk/main/sc/source/ui/vba/vbaworkbook.cxx Sat Sep 17 22:44:25 2011
@@ -220,7 +220,10 @@ ScVbaWorkbook::getActiveSheet() throw (u
 	uno::Reference< sheet::XSpreadsheetView > xView( xModel->getCurrentController(),
uno::UNO_QUERY_THROW );
     uno::Reference< sheet::XSpreadsheet > xSheet( xView->getActiveSheet(), uno::UNO_SET_THROW
);
     // #162503# return the original sheet module wrapper object, instead of a new instance
-    return uno::Reference< excel::XWorksheet >( excel::getUnoSheetModuleObj( xSheet
), uno::UNO_QUERY_THROW );
+    uno::Reference< excel::XWorksheet > xWorksheet( excel::getUnoSheetModuleObj( xSheet
), uno::UNO_QUERY );
+    if( xWorksheet.is() ) return xWorksheet;
+    // #i116936# excel::getUnoSheetModuleObj() may return null in documents without global
VBA mode enabled
+    return new ScVbaWorksheet( this, mxContext, xSheet, xModel );
 }
 
 uno::Any SAL_CALL



Mime
View raw message