ooo-build r13075 - in trunk: . patches/vba



Author: noelpwer
Date: Sat Jul  5 08:04:21 2008
New Revision: 13075
URL: http://svn.gnome.org/viewvc/ooo-build?rev=13075&view=rev

Log:
2008-07-05  Noel Power  <noel power novell com>

        * patches/vba/vba-workbook-worksheet-events-dev300.diff: tweak 
        activate and open sequencing, also removed using namespace directive
        in header, fix for a core too



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	Sat Jul  5 08:04:21 2008
@@ -83,9 +83,10 @@
 +}; }; }; };
 +
 +#endif
+
 --- /dev/null	2008-04-03 19:37:22.000000000 +0800
 +++ offapi/com/sun/star/document/XVbaEventsHelper.idl	2008-06-12 10:59:31.000000000 +0800
-@@ -0,0 +1,59 @@
+@@ -0,0 +1,60 @@
 +/*************************************************************************
 + *
 + *  OpenOffice.org - a multi-platform office productivity suite
@@ -140,11 +141,13 @@
 +        return: True if execute successfully, or False.
 +    **/
 +    boolean ProcessCompatibleVbaEvent( [in] long nEventId, [in] sequence< any > aArgs );
++    [attribute ] boolean IgnoreEvents;
 +};
 +
 +}; }; }; };
 +
 +#endif
+
 --- /dev/null	2008-04-03 19:37:22.000000000 +0800
 +++ offapi/com/sun/star/document/VbaEventsHelper.idl	2008-06-05 18:11:39.000000000 +0800
 @@ -0,0 +1,55 @@
@@ -203,6 +206,7 @@
 +}; }; }; };
 +
 +#endif
+
 --- /dev/null	2008-04-03 19:37:22.000000000 +0800
 +++ offapi/com/sun/star/document/XDocumentEventCompatibleHelper.idl	2008-06-09 08:28:28.000000000 +0800
 @@ -0,0 +1,53 @@
@@ -259,6 +263,7 @@
 +}; }; }; };
 +
 +#endif
+
 --- /home/feng/work/ooo-build/build/dev300-m14/offapi/com/sun/star/document/makefile.mk	2008-06-16 21:30:17.000000000 +0800
 +++ offapi/com/sun/star/document/makefile.mk	2008-06-05 18:11:39.000000000 +0800
 @@ -109,6 +109,10 @@ IDLFILES=\
@@ -272,9 +277,10 @@
  
  
  # ------------------------------------------------------------------
+
 --- /dev/null	2008-04-03 19:37:22.000000000 +0800
 +++ sc/source/ui/vba/vbaeventshelper.hxx	2008-06-16 13:57:16.000000000 +0800
-@@ -0,0 +1,81 @@
+@@ -0,0 +1,83 @@
 +/*************************************************************************
 + *
 + *  OpenOffice.org - a multi-platform office productivity suite
@@ -319,7 +325,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;
@@ -332,18 +337,19 @@
 +    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 ){};
@@ -351,14 +357,17 @@
 +    ~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
 +
+
 --- /dev/null	2008-04-03 19:37:22.000000000 +0800
 +++ sc/source/ui/vba/vbaeventshelper.cxx	2008-06-17 13:25:46.000000000 +0800
-@@ -0,0 +1,958 @@
+@@ -0,0 +1,968 @@
 +/*************************************************************************
 + *
 + *  OpenOffice.org - a multi-platform office productivity suite
@@ -659,7 +668,7 @@
 +}
 +
 +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 );
@@ -937,17 +946,14 @@
 +    	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:
@@ -1237,14 +1243,13 @@
 +        {
 +            // 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:
@@ -1262,6 +1267,7 @@
 +            {
 +                processVbaEvent( nEventId, aArgs );
 +                mbOpened = sal_True;
++                ProcessCompatibleVbaEvent( VBAEVENT_WORKBOOK_ACTIVATE, aArgs );
 +            }
 +            // register the window listener.
 +            if( !mpWindowListener )
@@ -1308,6 +1314,19 @@
 +    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;
@@ -1317,6 +1336,7 @@
 +    "ScVbaEventsHelper",
 +    "com.sun.star.document.VbaEventsHelper" );
 +}
+
 --- /home/feng/work/ooo-build/build/dev300-m14/sc/inc/document.hxx	2008-06-16 21:30:17.000000000 +0800
 +++ sc/inc/document.hxx	2008-06-16 14:34:49.000000000 +0800
 @@ -151,6 +151,9 @@ namespace com { namespace sun { namespac
@@ -1347,6 +1367,7 @@
      /** Should only be GRAM_PODF or GRAM_ODFF. */
      void                SetStorageGrammar( ScGrammar::Grammar eGrammar );
      ScGrammar::Grammar  GetStorageGrammar() const
+
 --- /home/feng/work/ooo-build/build/dev300-m14/sc/source/core/data/documen2.cxx	2008-06-16 21:30:17.000000000 +0800
 +++ sc/source/core/data/documen2.cxx	2008-06-16 14:35:26.000000000 +0800
 @@ -93,6 +93,7 @@
@@ -1371,7 +1392,7 @@
 +        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 );
@@ -1384,6 +1405,7 @@
 +	}
 +	return mxVbaEventsHelper;
 +}
+
 --- /home/feng/work/ooo-build/build/dev300-m14/sc/source/core/data/documen7.cxx	2008-06-16 21:30:17.000000000 +0800
 +++ sc/source/core/data/documen7.cxx	2008-06-05 18:11:39.000000000 +0800
 @@ -59,7 +59,15 @@
@@ -1442,6 +1464,7 @@
  	}
  	DBG_ASSERT( nFormulaTrackCount==0, "TrackFormulas: nFormulaTrackCount!=0" );
  }
+
 --- /home/feng/work/ooo-build/build/dev300-m14/sc/source/ui/docshell/docsh.cxx	2008-06-16 21:30:17.000000000 +0800
 +++ sc/source/ui/docshell/docsh.cxx	2008-06-16 17:15:54.000000000 +0800
 @@ -126,6 +126,13 @@
@@ -1458,6 +1481,30 @@
  
  using namespace com::sun::star;
  
+@@ -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 );
+@@ -601,6 +605,10 @@ 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 );
+ 	aDocument.SetImportingXML( FALSE );
+     aDocument.EnableUndo( TRUE );
+     bIsEmpty = FALSE;
 @@ -714,9 +721,71 @@ BOOL __EXPORT ScDocShell::Load( SfxMediu
  	return bRet;
  }
@@ -1582,6 +1629,7 @@
  
  void ScDocShell::SetDocumentModified( BOOL bIsModified /* = TRUE */ )
  {
+
 --- /home/feng/work/ooo-build/build/dev300-m14/sc/source/ui/inc/docsh.hxx	2008-06-16 21:30:17.000000000 +0800
 +++ sc/source/ui/inc/docsh.hxx	2008-06-05 18:11:39.000000000 +0800
 @@ -47,6 +47,7 @@
@@ -1601,6 +1649,7 @@
  
  	void			UpdatePaintExt( USHORT& rExtFlags, SCCOL nStartCol, SCROW nStartRow, SCTAB nStartTab,
  													   SCCOL nEndCol, SCROW nEndRow, SCTAB nEndTab );
+
 --- /home/feng/work/ooo-build/build/dev300-m14/sc/source/ui/undo/undoblk3.cxx	2008-06-16 21:30:17.000000000 +0800
 +++ sc/source/ui/undo/undoblk3.cxx	2008-06-05 18:11:39.000000000 +0800
 @@ -79,7 +79,17 @@ TYPEINIT1(ScUndoInsertAreaLink,		SfxUndo
@@ -1660,6 +1709,7 @@
  			}
  		}
  
+
 --- /home/feng/work/ooo-build/build/dev300-m14/sc/source/ui/undo/undoblk.cxx	2008-06-16 21:30:17.000000000 +0800
 +++ sc/source/ui/undo/undoblk.cxx	2008-06-05 18:11:39.000000000 +0800
 @@ -125,6 +125,7 @@ ScUndoInsertCells::ScUndoInsertCells( Sc
@@ -1758,6 +1808,7 @@
      SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_AREALINKS_CHANGED ) );
  }
  
+
 --- /home/feng/work/ooo-build/build/dev300-m14/sc/source/ui/undo/undocell.cxx	2008-06-16 21:30:17.000000000 +0800
 +++ sc/source/ui/undo/undocell.cxx	2008-06-05 18:11:39.000000000 +0800
 @@ -214,6 +214,7 @@ ScUndoEnterData::ScUndoEnterData( ScDocS
@@ -1832,6 +1883,7 @@
  }
  
  void __EXPORT ScUndoPutCell::Repeat(SfxRepeatTarget& /* rTarget */)
+
 --- /home/feng/work/ooo-build/build/dev300-m14/sc/source/ui/unoobj/viewuno.cxx	2008-06-16 21:30:17.000000000 +0800
 +++ sc/source/ui/unoobj/viewuno.cxx	2008-06-16 21:21:54.000000000 +0800
 @@ -71,8 +71,12 @@
@@ -1947,6 +1999,7 @@
  }
  
  ScTabViewObj::~ScTabViewObj()
+
 --- /home/feng/work/ooo-build/build/dev300-m14/sc/source/ui/unoobj/docuno.cxx	2008-06-16 21:30:17.000000000 +0800
 +++ sc/source/ui/unoobj/docuno.cxx	2008-06-16 15:09:05.000000000 +0800
 @@ -92,7 +92,10 @@
@@ -2008,6 +2061,7 @@
  // XServiceInfo
  
  rtl::OUString SAL_CALL ScModelObj::getImplementationName() throw(uno::RuntimeException)
+
 --- /home/feng/work/ooo-build/build/dev300-m14/sc/inc/docuno.hxx	2008-06-16 21:30:17.000000000 +0800
 +++ sc/inc/docuno.hxx	2008-06-16 15:08:17.000000000 +0800
 @@ -55,6 +55,7 @@
@@ -2035,6 +2089,7 @@
  };
  
  
+
 --- /home/feng/work/ooo-build/build/dev300-m14/sc/source/ui/view/gridwin.cxx	2008-06-16 21:30:17.000000000 +0800
 +++ sc/source/ui/view/gridwin.cxx	2008-06-16 17:37:15.000000000 +0800
 @@ -150,7 +150,13 @@
@@ -2158,6 +2213,7 @@
  
  	ScHideTextCursor aHideCursor( pViewData, eWhich );	// before GetEditArea (MapMode is changed)
  
+
 --- /home/feng/work/ooo-build/build/dev300-m14/sc/source/ui/view/tabview3.cxx	2008-06-16 21:30:17.000000000 +0800
 +++ sc/source/ui/view/tabview3.cxx	2008-06-05 18:11:39.000000000 +0800
 @@ -82,6 +82,10 @@
@@ -2209,6 +2265,7 @@
  		TabChanged();										// DrawView
  		aViewData.GetViewShell()->WindowChanged();			// falls das aktive Fenster anders ist
          if ( !bUnoRefDialog )
+
 --- /home/feng/work/ooo-build/build/dev300-m14/sc/source/ui/vba/makefile.mk	2008-06-16 21:30:17.000000000 +0800
 +++ sc/source/ui/vba/makefile.mk	2008-06-05 18:11:39.000000000 +0800
 @@ -128,6 +128,7 @@ SLOFILES= \
@@ -2219,6 +2276,7 @@
   
  
  # --- Targets ------------------------------------------------------
+
 --- /home/feng/work/ooo-build/build/dev300-m14/sc/source/ui/vba/service.cxx	2008-06-16 21:30:17.000000000 +0800
 +++ sc/source/ui/vba/service.cxx	2008-06-05 18:11:39.000000000 +0800
 @@ -69,6 +69,10 @@ namespace hyperlink 
@@ -2250,6 +2308,7 @@
  	OSL_TRACE("Ret is 0x%x", pRet);
  	return pRet;
      }
+
 --- sfx2/inc/sfx2/objsh.hxx.orig	2008-06-04 11:30:47.000000000 +0800
 +++ sfx2/inc/sfx2/objsh.hxx	2008-06-04 10:41:41.000000000 +0800
 @@ -304,6 +304,7 @@ public:
@@ -2280,6 +2339,7 @@
      );
  
      /** adjusts the internal macro mode, according to the current security settings
+
 --- sfx2/source/doc/objmisc.cxx.orig	2008-06-04 11:20:37.000000000 +0800
 +++ sfx2/source/doc/objmisc.cxx	2008-06-03 18:53:21.000000000 +0800
 @@ -1591,7 +1591,7 @@ namespace
@@ -2312,6 +2372,7 @@
  }
  
  //-------------------------------------------------------------------------
+
 --- /home/feng/work/ooo-build/build/dev300-m14/sfx2/source/doc/objserv.cxx	2008-06-16 21:30:17.000000000 +0800
 +++ sfx2/source/doc/objserv.cxx	2008-06-16 15:11:04.000000000 +0800
 @@ -109,6 +109,7 @@
@@ -2341,6 +2402,7 @@
  			//!! detaillierte Auswertung eines Fehlercodes
  			SfxObjectShellRef xLock( this );
  
+
 --- /home/feng/work/ooo-build/build/dev300-m14/sfx2/source/view/viewprn.cxx	2008-06-16 21:30:17.000000000 +0800
 +++ sfx2/source/view/viewprn.cxx	2008-06-16 15:12:05.000000000 +0800
 @@ -32,6 +32,7 @@
@@ -2399,6 +2461,7 @@
  				bool bDetectHidden = ( !bSilent && pDoc );
  				if ( bDetectHidden && pDoc->QueryHiddenInformation( WhenPrinting, NULL ) != RET_YES )
  					return;
+
 --- /home/feng/work/ooo-build/build/dev300-m14/sfx2/source/doc/objxtor.cxx	2008-06-16 21:30:17.000000000 +0800
 +++ sfx2/source/doc/objxtor.cxx	2008-06-05 18:11:40.000000000 +0800
 @@ -594,6 +594,13 @@ SfxObjectShell* SfxObjectShell::Current(
@@ -2415,3 +2478,4 @@
  //------------------------------------------------------------------------
  
  struct BoolEnv_Impl
+



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