ooo-build r13094 - trunk/patches/test/vba



Author: noelpwer
Date: Mon Jul  7 18:18:03 2008
New Revision: 13094
URL: http://svn.gnome.org/viewvc/ooo-build?rev=13094&view=rev

Log:
ported to m21 ( and removed hunks now integrated into ooo-build )


Modified:
   trunk/patches/test/vba/ObjectModule.diff

Modified: trunk/patches/test/vba/ObjectModule.diff
==============================================================================
--- trunk/patches/test/vba/ObjectModule.diff	(original)
+++ trunk/patches/test/vba/ObjectModule.diff	Mon Jul  7 18:18:03 2008
@@ -368,7 +368,7 @@
 +		// otherwise it belongs to the opposite, 
 +		// and yes, this algorithm doesn't scale does it
 +		else
-+			bDocDialog = !( pFound->IsDocBasic() );
++			bDocDialog = !( pSearch->IsDocBasic() );
 +			
  	}
  
@@ -430,7 +430,7 @@
      }
  }
  
-@@ -2301,7 +2302,7 @@ class FormObjEventListenerImpl : public 
+@@ -2303,7 +2304,7 @@ class FormObjEventListenerImpl : public 
  public:
      FormObjEventListenerImpl( SbUserFormModule* pUserForm, const uno::Reference< lang::XComponent >& xComponent ) : mpUserForm( pUserForm ), mxComponent( xComponent) , mbDisposed( false )
      {
@@ -439,7 +439,7 @@
          {
  	    uno::Reference< awt::XTopWindow > xList( mxComponent, uno::UNO_QUERY_THROW );;
              //uno::Reference< awt::XWindow > xList( mxComponent, uno::UNO_QUERY_THROW );;
-@@ -2359,7 +2360,7 @@ public:
+@@ -2379,7 +2380,7 @@ public:
  };
  
  SbUserFormModule::SbUserFormModule( const com::sun::star::script::ModuleInfo& mInfo, bool bIsCompat )
@@ -448,7 +448,7 @@
  {
          m_xModel.set( mInfo.ModuleObject, uno::UNO_QUERY_THROW );
  }
-@@ -2400,12 +2401,13 @@ void SbUserFormModule::triggerDeActivate
+@@ -2420,12 +2421,13 @@ void SbUserFormModule::triggerDeActivate
  }
  
  void SbUserFormModule::triggerInitializeEvent( void )
@@ -464,7 +464,7 @@
  }
  
  void SbUserFormModule::triggerTerminateEvent( void )
-@@ -2413,6 +2415,7 @@ void SbUserFormModule::triggerTerminateE
+@@ -2433,6 +2435,7 @@ void SbUserFormModule::triggerTerminateE
          OSL_TRACE("**** SbUserFormModule::triggerTerminateEvent");
  	static String aTermMethodName( RTL_CONSTASCII_USTRINGPARAM("Userform_Terminate") );
  	triggerMethod( aTermMethodName );
@@ -472,7 +472,7 @@
  }
  
  void SbUserFormModule::load()
-@@ -2470,7 +2473,7 @@ void SbUserFormModule::InitObject()
+@@ -2490,7 +2493,7 @@ void SbUserFormModule::InitObject()
              m_DialogListener = new FormObjEventListenerImpl( this, xComponent );
  
              // trigger initialise event
@@ -1120,16 +1120,6 @@
              { "com.sun.star.form.inspection.XMLFormsPropertyHandler", true },
 diff --git offapi/com/sun/star/document/XVbaEventsHelper.idl offapi/com/sun/star/document/XVbaEventsHelper.idl
 index 88a93e8..c02ed79 100644
---- offapi/com/sun/star/document/XVbaEventsHelper.idl
-+++ offapi/com/sun/star/document/XVbaEventsHelper.idl
-@@ -45,6 +45,7 @@ module com {  module sun {  module star 
- 
- interface XVbaEventsHelper
- {
-+    [attribute ] boolean IgnoreEvents;
-     /**
-         Execute VBA compatible event.
-         VbaEvent: Compatible VBA event id.
 diff --git offapi/com/sun/star/script/XVBACompat.idl offapi/com/sun/star/script/XVBACompat.idl
 new file mode 100644
 index 0000000..e1b2d28
@@ -1263,15 +1253,6 @@
  }
  
  
-@@ -1874,7 +1875,7 @@ ScDocument::GetVbaEventsHelper()
-         try
-         {
-             uno::Reference< lang::XMultiServiceFactory > xSF( comphelper::getProcessServiceFactory(), uno::UNO_QUERY );
--            uno::Reference< frame::XModel > xModel( pShell->GetModel(), uno::UNO_QUERY );
-+            uno::Reference< frame::XModel > xModel( pShell ? pShell->GetModel() : NULL , uno::UNO_QUERY );
-             uno::Sequence< uno::Any > aArgs(1);
-             aArgs[0] = uno::Any( xModel );
-             uno::Reference< document::XVbaEventsHelper > xVbaEventsHelper( xSF->createInstanceWithArguments( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.document.VbaEventsHelper" ) ), aArgs ), uno::UNO_QUERY );
 diff --git sc/source/core/data/document.cxx sc/source/core/data/document.cxx
 index b123ad7..7ee3b4a 100644
 --- sc/source/core/data/document.cxx
@@ -1538,20 +1519,7 @@
  
  using namespace com::sun::star;
  using namespace com::sun::star::document::VbaEventId;
-@@ -516,7 +517,11 @@ sal_uInt16 ScDocShell::GetHiddenInformat
- void ScDocShell::BeforeXMLLoading()
- {
-     aDocument.DisableIdle( TRUE );
--
-+    // suppress VBA events when loading the xml
-+    uno::Reference< document::XVbaEventsHelper > xEvt( aDocument.GetVbaEventsHelper() );
-+    if ( xEvt.is() )
-+       xEvt->setIgnoreEvents( sal_True );
-+    
-     // prevent unnecessary broadcasts and updates
-     DBG_ASSERT(pModificator == NULL, "The Modificator should not exist");
- 	pModificator = new ScDocShellModificator( *this );
-@@ -530,6 +535,45 @@ void ScDocShell::BeforeXMLLoading()
+@@ -534,6 +539,45 @@ void ScDocShell::BeforeXMLLoading()
  		ScColumn::bDoubleAlloc = sal_True;
  }
  
@@ -1597,15 +1565,11 @@
  void ScDocShell::AfterXMLLoading(sal_Bool bRet)
  {
  	if (GetCreateMode() != SFX_CREATE_MODE_ORGANIZER)
-@@ -600,8 +644,35 @@ void ScDocShell::AfterXMLLoading(sal_Boo
-     }
-     else
- 		aDocument.SetInsertingFromOtherDoc( FALSE );
--
-+        // suppress VBA events when loading the xml
-+        uno::Reference< document::XVbaEventsHelper > xEvt( aDocument.GetVbaEventsHelper() );
-+        if ( xEvt.is() )
-+            xEvt->setIgnoreEvents( sal_False );
+@@ -608,8 +652,31 @@ void ScDocShell::AfterXMLLoading(sal_Boo
+         // suppress VBA events when loading the xml
+         uno::Reference< document::XVbaEventsHelper > xEvt( aDocument.GetVbaEventsHelper() );
+         if ( xEvt.is() )
+             xEvt->setIgnoreEvents( sal_False );
 +        // SetCodenames for each tab  ( and set up the vba DOC Modules ) 
 +        SCTAB nTabCount = aDocument.GetTableCount();
 +        for (SCTAB i = 0; i < nTabCount; ++i)
@@ -1630,10 +1594,10 @@
 +        }
 +            
  	aDocument.SetImportingXML( FALSE );
-+    
      aDocument.EnableUndo( TRUE );
      bIsEmpty = FALSE;
  
+
 diff --git sc/source/ui/unoobj/addruno.cxx sc/source/ui/unoobj/addruno.cxx
 index b417b7e..4f313f2 100644
 --- sc/source/ui/unoobj/addruno.cxx
@@ -1764,15 +1728,6 @@
 index d28308f..7de8cbb 100644
 --- sc/source/ui/vba/vbaeventshelper.cxx
 +++ sc/source/ui/vba/vbaeventshelper.cxx
-@@ -298,7 +298,7 @@ void ImplVbaEventNameInfo::InitImplVbaEv
- }
- 
- ScVbaEventsHelper::ScVbaEventsHelper( uno::Sequence< css::uno::Any > const& aArgs, uno::Reference< uno::XComponentContext > const& xContext )
--    : m_xContext( xContext ), mpWindowListener( NULL ), mbOpened( sal_False )
-+    : m_xContext( xContext ), mpWindowListener( NULL ), mbOpened( sal_False ), mbIgnoreEvents( sal_False )
- {
-     uno::Reference< frame::XModel > xModel ( getXSomethingFromArgs< frame::XModel >( aArgs, 0 ), uno::UNO_QUERY );
-     ScDocShell* pDocShell = getDocShell( xModel );
 @@ -522,7 +522,7 @@ String ScVbaEventsHelper::getSheetModule
  {
  	ScExtDocOptions* pExtOptions = pDoc->GetExtDocOptions();
@@ -1782,130 +1737,11 @@
  	// Use code name if that exists
  	if ( pExtOptions )
  		aCodeName = pExtOptions->GetCodeName( nTab );
-@@ -576,17 +576,14 @@ ScVbaEventsHelper::getMacroPath( const s
-     	case VBAEVENT_WORKBOOK_SHEET_SELECTIONCHANGE          :
-         {
- 	        ScExtDocOptions* pExtOptions = pDoc->GetExtDocOptions();
-+            String sWorkbookModuleName = pDoc->GetCodeName();
-             if( pExtOptions )
-             {
-                 ScExtDocSettings aExtDocSettings = pExtOptions->GetDocSettings();
-                 String sWorkbookModuleName = aExtDocSettings.maGlobCodeName;
--                sMacroPath = workbookMacroExists( pShell, sWorkbookModuleName, sMacroName );
--            }
--            else
--            {
--                // TODO need this?
--                sMacroPath = workbookMacroExists( pShell, rtl::OUString(), sMacroName );
-             }
-+           
-+            sMacroPath = workbookMacroExists( pShell, sWorkbookModuleName, sMacroName );
-             break;
-         }
-         default:
-@@ -876,14 +873,13 @@ ScVbaEventsHelper::ProcessCompatibleVbaE
-         {
-             // if workbook open event do not be fired. fired it before 
-             // workbook activate event to compatible with MSO.
--            if( !mbOpened )
-+            if( mbOpened )
-             {
--                ProcessCompatibleVbaEvent( VBAEVENT_WORKBOOK_OPEN, aArgs );
-+                // process workbook activate event
-+                processVbaEvent( nEventId, aArgs );
-+                // process workbook window activate event at the same time
-+                ProcessCompatibleVbaEvent( VBAEVENT_WORKBOOK_WINDOWACTIVATE, aArgs );
-             }
--            // process workbook activate event
--            processVbaEvent( nEventId, aArgs );
--            // process workbook window activate event at the same time
--            ProcessCompatibleVbaEvent( VBAEVENT_WORKBOOK_WINDOWACTIVATE, aArgs );
-             break;
-         }
- 		case VBAEVENT_WORKBOOK_DEACTIVATE:
-@@ -901,6 +897,7 @@ ScVbaEventsHelper::ProcessCompatibleVbaE
-             {
-                 processVbaEvent( nEventId, aArgs );
-                 mbOpened = sal_True;
-+                ProcessCompatibleVbaEvent( VBAEVENT_WORKBOOK_ACTIVATE, aArgs );
-             }
-             // register the window listener.
-             if( !mpWindowListener )
-@@ -947,6 +944,19 @@ ScVbaEventsHelper::ProcessCompatibleVbaE
-     return sal_True;
- }
- 
-+::sal_Bool SAL_CALL 
-+ScVbaEventsHelper::getIgnoreEvents() throw (uno::RuntimeException)
-+{
-+    return mbIgnoreEvents;
-+}
-+
-+void SAL_CALL 
-+ScVbaEventsHelper::setIgnoreEvents( ::sal_Bool _ignoreevents ) throw (uno::RuntimeException)
-+{
-+    mbIgnoreEvents = _ignoreevents;
-+}
-+
-+
- namespace vbaeventshelper
- {
- namespace sdecl = comphelper::service_decl;
-diff --git sc/source/ui/vba/vbaeventshelper.hxx sc/source/ui/vba/vbaeventshelper.hxx
-index fa01761..ab41cea 100644
---- sc/source/ui/vba/vbaeventshelper.hxx
-+++ sc/source/ui/vba/vbaeventshelper.hxx
-@@ -42,7 +42,6 @@
- #include <com/sun/star/document/XVbaEventsHelper.hpp>
- #include "vbahelper.hxx"
- 
--using namespace com::sun::star;
- #define INVALID_TAB -1
- 
- typedef ::cppu::WeakImplHelper1< com::sun::star::document::XVbaEventsHelper > VBAWorkbookEvent_BASE;
-@@ -55,18 +54,19 @@ private:
-     css::uno::Reference< css::uno::XComponentContext > m_xContext;
-     VbaWindowListener* mpWindowListener;
-     sal_Bool mbOpened;
-+    sal_Bool mbIgnoreEvents;
- 
- 	String getSheetModuleName( SCTAB nTab );
- 	String workbookMacroExists( SfxObjectShell* pShell, const String& sMod, const String& sMacro );
--	uno::Any createWorkSheet( SfxObjectShell* pShell, SCTAB nTab );
--	uno::Any createRange( const uno::Any& aRange );
--	uno::Any createHyperlink( const uno::Any& rCell );
--	uno::Any createWindow( SfxObjectShell* pShell );
--	sal_Bool executeMacro( SfxObjectShell* pShell, const String& sMacroName, uno::Sequence< uno::Any >& aArgs, uno::Any& aRet );
--    SCTAB getTabFromArgs( const uno::Sequence< uno::Any > aArgs, const sal_Int32 nPos = 0 );
-+	css::uno::Any createWorkSheet( SfxObjectShell* pShell, SCTAB nTab );
-+	css::uno::Any createRange( const css::uno::Any& aRange );
-+	css::uno::Any createHyperlink( const css::uno::Any& rCell );
-+	css::uno::Any createWindow( SfxObjectShell* pShell );
-+	sal_Bool executeMacro( SfxObjectShell* pShell, const String& sMacroName, css::uno::Sequence< css::uno::Any >& aArgs, css::uno::Any& aRet );
-+    SCTAB getTabFromArgs( const css::uno::Sequence< css::uno::Any > aArgs, const sal_Int32 nPos = 0 );
-     rtl::OUString getEventName( const sal_Int32 nEventId );
-     rtl::OUString getMacroPath( const sal_Int32 nEventId, const SCTAB nTab = INVALID_TAB );
--    sal_Bool processVbaEvent( const sal_Int32 nEventId, const uno::Sequence< uno::Any >& rArgs, const SCTAB nTab = INVALID_TAB );
-+    sal_Bool processVbaEvent( const sal_Int32 nEventId, const css::uno::Sequence< css::uno::Any >& rArgs, const SCTAB nTab = INVALID_TAB );
- 
- public:
- 	ScVbaEventsHelper( ScDocument* pDocument ):pDoc( pDocument ), mpWindowListener( NULL ), mbOpened( sal_False ){};
-@@ -74,7 +74,9 @@ public:
-     ~ScVbaEventsHelper();
- 	ScDocument* getDocument() { return pDoc; };
-     // XVBAWorkbookEventHelper
--    virtual sal_Bool SAL_CALL ProcessCompatibleVbaEvent( sal_Int32 nEventId, const uno::Sequence< uno::Any >& aArgs ) throw (uno::RuntimeException);
-+    virtual sal_Bool SAL_CALL ProcessCompatibleVbaEvent( sal_Int32 nEventId, const css::uno::Sequence< css::uno::Any >& aArgs ) throw (css::uno::RuntimeException);
-+    virtual void SAL_CALL setIgnoreEvents( ::sal_Bool _ignoreevents ) throw (css::uno::RuntimeException);
-+    virtual ::sal_Bool SAL_CALL getIgnoreEvents() throw (css::uno::RuntimeException);
- };
- 
- #endif
 diff --git sc/source/ui/vba/vbarange.cxx sc/source/ui/vba/vbarange.cxx
 index 31620f8..b5595ef 100644
 --- sc/source/ui/vba/vbarange.cxx
 +++ sc/source/ui/vba/vbarange.cxx
-@@ -214,24 +214,27 @@ uno::Reference< excel::XRange > lcl_make
+@@ -215,24 +215,27 @@ uno::Reference< excel::XRange > lcl_make
  	uno::Sequence< table::CellRangeAddress  > sAddresses = xLocSheetCellRanges->getRangeAddresses();
  	ScRangeList aCellRanges;
  	sal_Int32 nLen = sAddresses.getLength();



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]