ooo-build r12700 - in trunk: . patches/vba
- From: noelpwer svn gnome org
- To: svn-commits-list gnome org
- Subject: ooo-build r12700 - in trunk: . patches/vba
- Date: Thu, 29 May 2008 09:12:42 +0000 (UTC)
Author: noelpwer
Date: Thu May 29 09:12:42 2008
New Revision: 12700
URL: http://svn.gnome.org/viewvc/ooo-build?rev=12700&view=rev
Log:
2008-05-29 Noel Power <noel power novell com>
* patches/vba/vba-workbook-worksheet-events-dev300.diff: tweak so
events work again ( with ObjectModule patch )
Modified:
trunk/ChangeLog
trunk/patches/vba/vba-workbook-worksheet-events-dev300.diff
Modified: trunk/patches/vba/vba-workbook-worksheet-events-dev300.diff
==============================================================================
--- trunk/patches/vba/vba-workbook-worksheet-events-dev300.diff (original)
+++ trunk/patches/vba/vba-workbook-worksheet-events-dev300.diff Thu May 29 09:12:42 2008
@@ -902,9 +902,9 @@
+
+#endif
+
---- /dev/null 2007-09-22 03:12:45.000000000 +0800
-+++ sc/source/core/tool/vbaeventshelper.cxx 2008-05-05 10:50:30.000000000 +0800
-@@ -0,0 +1,918 @@
+--- /dev/null 2008-04-22 00:28:44.000000000 +0100
++++ sc/source/core/tool/vbaeventshelper.cxx 2008-05-29 10:41:04.000000000 +0100
+@@ -0,0 +1,921 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
@@ -1111,11 +1111,10 @@
+
+String ScVbaEventsHelper::getWorkbookModuleName()
+{
-+ String sCodeName( RTL_CONSTASCII_USTRINGPARAM("ThisWorkbook") );
++ String sCodeName; // leave blank to force a search of all modules
+ if ( ScExtDocOptions* pExtDocOpts = pDoc->GetExtDocOptions() )
+ {
-+ if ( pExtDocOpts->GetDocSettings().maGlobCodeName.Len() > 0 )
-+ sCodeName = pExtDocOpts->GetDocSettings().maGlobCodeName;
++ sCodeName = pDoc->GetCodeName();
+ }
+ return sCodeName;
+}
@@ -1212,7 +1211,8 @@
+ uno::Sequence< uno::Any > aArgs( 1 );
+ aArgs[ 0 ] <<= bCancel;
+ const static String sBeforeClose( RTL_CONSTASCII_USTRINGPARAM("Workbook_BeforeClose") );
-+ String sFullClose = docMacroExists( pShell, String(), sBeforeClose );
++ rtl::OUString workbookModule = getWorkbookModuleName();
++ String sFullClose = docMacroExists( pShell, workbookModule, sBeforeClose );
+ if ( sFullClose.Len() > 0 )
+ {
+ if ( !executeWorkBookMacro( pShell, sFullClose, aArgs, aRet ) )
@@ -1419,12 +1419,11 @@
+
+String ScVbaEventsHelper::getSheetModuleName( SCTAB nTab )
+{
-+ ScExtDocOptions* pExtOptions = pDoc->GetExtDocOptions();
-+ String aCodeName;
-+ pDoc->GetName( nTab, aCodeName);
++ String aCodeName; // leave blank to force full search
+ // Use code name if that exists
-+ if ( pExtOptions )
-+ aCodeName = pExtOptions->GetCodeName( nTab );
++ if ( ScExtDocOptions* pExtOptions = pDoc->GetExtDocOptions() )
++ // for an imported excel doc we always have the codename
++ pDoc->GetCodeName( nTab, aCodeName );
+ return aCodeName;
+}
+
@@ -1556,7 +1555,8 @@
+ sal_Bool bCancel = sal_False;
+ aArgs[ 0 ] <<= bCancel;
+ const static String sBeforeClose( RTL_CONSTASCII_USTRINGPARAM("Workbook_BeforePrint") );
-+ String sFullClose = docMacroExists( pShell, String(), sBeforeClose );
++ rtl::OUString workbookModule = getWorkbookModuleName();
++ String sFullClose = docMacroExists( pShell, workbookModule, sBeforeClose );
+ if ( sFullClose.Len() > 0 )
+ {
+ if ( !executeWorkBookMacro( pShell, sFullClose, aArgs, aRet ) )
@@ -1574,7 +1574,8 @@
+ uno::Sequence< uno::Any > aArgs(1);
+ aArgs[0] = aElement;
+ const static String sNewSheet( RTL_CONSTASCII_USTRINGPARAM("Workbook_NewSheet") );
-+ String sFullClose = docMacroExists( pShell, String(), sNewSheet );
++ rtl::OUString workbookModule = getWorkbookModuleName();
++ String sFullClose = docMacroExists( pShell, workbookModule, sNewSheet );
+ if ( sFullClose.Len() > 0 )
+ {
+ executeWorkBookMacro( pShell, sFullClose, aArgs, aRet );
@@ -1609,7 +1610,8 @@
+ {
+ uno::Sequence< uno::Any > aArgs(1);
+ aArgs[0] = aElement;
-+ String sMacro = docMacroExists( pShell, String(), sFuncName );
++ rtl::OUString workbookModule = getWorkbookModuleName();
++ String sMacro = docMacroExists( pShell, workbookModule, sFuncName );
+ if ( sMacro.Len() > 0 )
+ {
+ executeWorkBookMacro( pShell, sMacro, aArgs, aRet );
@@ -1674,7 +1676,7 @@
+ sal_Bool result = sal_True;
+ const static rtl::OUString sAtctivateMacro( RTL_CONSTASCII_USTRINGPARAM("Workbook_Activate") );
+ const static rtl::OUString sOnFocusEvt( RTL_CONSTASCII_USTRINGPARAM("OnFocus") );
-+ rtl::OUString sWorkbookModule;
++ rtl::OUString sWorkbookModule = getWorkbookModuleName();
+ String sFullOnFocus = docMacroExists( pShell, sWorkbookModule, sAtctivateMacro );
+ if( sFullOnFocus.Len() > 0 )
+ {
@@ -1689,7 +1691,7 @@
+ sal_Bool result = sal_True;
+ const static rtl::OUString sDeatctivateMacro( RTL_CONSTASCII_USTRINGPARAM("Workbook_Deactivate") );
+ const static rtl::OUString sOnFocusEvt( RTL_CONSTASCII_USTRINGPARAM("OnUnfocus") );
-+ rtl::OUString sWorkbookModule;
++ rtl::OUString sWorkbookModule = getWorkbookModuleName();
+ String sFullUnOnfocus = docMacroExists( pShell, sWorkbookModule, sDeatctivateMacro );
+ if( sFullUnOnfocus.Len() > 0 )
+ {
@@ -1704,7 +1706,8 @@
+ uno::Any aRet;
+ uno::Sequence< uno::Any > aArgs;
+ const static String sDeactivate( RTL_CONSTASCII_USTRINGPARAM("Workbook_Deactivate") );
-+ String sDeactivateMacro = docMacroExists( pShell, String(), sDeactivate );
++ rtl::OUString sWorkbookModule = getWorkbookModuleName();
++ String sDeactivateMacro = docMacroExists( pShell, sWorkbookModule, sDeactivate );
+ if ( sDeactivateMacro.Len() > 0 )
+ {
+ executeWorkBookMacro( pShell, sDeactivateMacro, aArgs, aRet );
@@ -1739,8 +1742,8 @@
+ break;
+ case SFX_EVENT_OPENDOC :
+ {
-+ VbaWindowListener* pListener = new VbaWindowListener( this );
-+ pListener->startWindowLinstener();
++ //VbaWindowListener* pListener = new VbaWindowListener( this );
++ //pListener->startWindowLinstener();
+ break;
+ }
+ default:
@@ -1760,7 +1763,8 @@
+ aArgs[ 0 ] <<= bSaveAsUI;
+ aArgs[ 1 ] <<= bCancel;
+ const static String sBeforeClose( RTL_CONSTASCII_USTRINGPARAM("Workbook_BeforeSave") );
-+ String sFullClose = docMacroExists( pShell, String(), sBeforeClose );
++ rtl::OUString workbookModule = getWorkbookModuleName();
++ String sFullClose = docMacroExists( pShell, workbookModule, sBeforeClose );
+ if ( sFullClose.Len() > 0 )
+ {
+ if ( !executeWorkBookMacro( pShell, sFullClose, aArgs, aRet ) )
@@ -1787,8 +1791,7 @@
+ // until ObjectModules ( and persisting of codename ) are supported if this is a
+ // document saved from XL then we won't be able to determine the codename for the Workbook
+ // Module, so... we have no choice but to search all modules for the moment
-+ //rtl::OUString workbookModule = getWorkbookModuleName( pShell );
-+ rtl::OUString workbookModule; // no name means all modules will be searched
++ rtl::OUString workbookModule = getWorkbookModuleName();
+ String sFullOpen = docMacroExists( pShell, workbookModule, sOpenMacro );
+ if ( sFullOpen.Len() > 0 )
+ {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]