[ooo-build-commit] .: 2 commits - patches/dev300 patches/vba

Noel Power noelp at kemper.freedesktop.org
Thu Sep 2 06:49:09 PDT 2010


 patches/dev300/apply                                        |    2 
 patches/dev300/calc-pdf-export-allow-filtered-range-sc.diff |    8 
 patches/dev300/calc-perf-import-dbf-sc.diff                 |    5 
 patches/dev300/calc-subtotal-function-update.diff           |    4 
 patches/vba/cws-vbasupportdev300.diff                       |  760 ------------
 5 files changed, 24 insertions(+), 755 deletions(-)

New commits:
commit c88721dd1ef8aa1105a24207ca1bf90cf361a1ac
Author: Noel Power <noel.power at novell.com>
Date:   Thu Sep 2 14:46:38 2010 +0100

    remove sun/oracle fake vba selection event, replace with own

diff --git a/patches/dev300/apply b/patches/dev300/apply
index e11335a..6836b2f 100644
--- a/patches/dev300/apply
+++ b/patches/dev300/apply
@@ -1522,6 +1522,8 @@ vba-fix-interesection.diff
 vba-use-ooxfilter-forcontrols.diff
 # fix hlink & macro import/export for autoshapes and pictures
 vba-fix-shapepic-hlinkmacro.diff
+# remove some events from base ( sun/oracle ) sources and replace with own
+vba-override-base-vbaevents.diff
 
 [ VBAUntested ]
 SectionOwner => noelpwer
diff --git a/patches/vba/cws-vbasupportdev300.diff b/patches/vba/cws-vbasupportdev300.diff
index 9f15224..3db8e47 100644
--- a/patches/vba/cws-vbasupportdev300.diff
+++ b/patches/vba/cws-vbasupportdev300.diff
@@ -40513,6 +40513,17 @@ index ce1419b..3993ad0 100644
      $(I18NUTILLIB)
  
  .IF "$(ENABLE_VBA)" == "YES"
+@@ -369,6 +371,10 @@ SHL5STDLIBS= \
+                 $(SVXCORELIB) \
+                 $(MSFILTERLIB)
+
++.IF "$(GUI)"=="WNT"
++SHL5STDLIBS+=$(SHELLLIB)
++.ENDIF #WNT
++
+ SHL5DEPN=$(SHL1TARGETN)
+ SHL5LIBS=$(SLB)$/$(TARGET_VBA).lib
+ .ENDIF # .IF "$(ENABLE_VBA)" == "YES"
 diff --git toolkit/inc/toolkit/awt/vclxmenu.hxx toolkit/inc/toolkit/awt/vclxmenu.hxx
 index 9fefbe9..88be605 100644
 --- toolkit/inc/toolkit/awt/vclxmenu.hxx
diff --git a/patches/vba/vba-override-base-vbaevents.diff b/patches/vba/vba-override-base-vbaevents.diff
new file mode 100644
index 0000000..e69de29
commit 08182bda9d2670101fc6876a1b4c00e9c7acb6e5
Author: Noel Power <noel.power at novell.com>
Date:   Thu Sep 2 09:48:57 2010 +0100

    remove old doc/sheet vba event fake stuff ( revert to sun/oracle base )

diff --git a/patches/dev300/calc-pdf-export-allow-filtered-range-sc.diff b/patches/dev300/calc-pdf-export-allow-filtered-range-sc.diff
index 759c561..a3b1cc9 100644
--- a/patches/dev300/calc-pdf-export-allow-filtered-range-sc.diff
+++ b/patches/dev300/calc-pdf-export-allow-filtered-range-sc.diff
@@ -14,15 +14,15 @@ index fd60fdf..35092fd 100644
  #include <com/sun/star/sheet/XNamedRanges.hpp>
  #include <com/sun/star/sheet/XLabelRanges.hpp>
 @@ -106,6 +107,9 @@
- #include <com/sun/star/document/XVbaEventsHelper.hpp>
- #include <com/sun/star/document/VbaEventId.hpp>
+ #include "scresid.hxx"
+
  using namespace com::sun::star;
 +using ::rtl::OUString;
 +using ::com::sun::star::uno::Reference;
 +
- using namespace com::sun::star::document::VbaEventId;
- 
  #define SC_UNO_VBADOCOBJ "ThisVBADocObj" // perhaps we want to actually make this ThisWorkbook ?
+
+ //------------------------------------------------------------------------
 @@ -929,7 +933,13 @@ sal_Int32 SAL_CALL ScModelObj::getRendererCount( const uno::Any& aSelection,
      ScPrintSelectionStatus aStatus;
      String aPagesStr;
diff --git a/patches/dev300/calc-perf-import-dbf-sc.diff b/patches/dev300/calc-perf-import-dbf-sc.diff
index 6910be6..cdfb5ae 100644
--- a/patches/dev300/calc-perf-import-dbf-sc.diff
+++ b/patches/dev300/calc-perf-import-dbf-sc.diff
@@ -681,7 +681,7 @@ index ef33f94..7249979 100644
  #include <rtl/logfile.hxx>
  
  #include <comphelper/processfactory.hxx>
-@@ -129,12 +131,18 @@
+@@ -129,9 +131,15 @@
  #include "uiitems.hxx"
  #include "cellsuno.hxx"
  
@@ -690,9 +690,6 @@ index ef33f94..7249979 100644
 +#include <boost/shared_ptr.hpp>
 +
  using namespace com::sun::star;
- using namespace com::sun::star::document::VbaEventId;
- 
- using namespace com::sun::star;
  using ::rtl::OUString;
  using ::rtl::OUStringBuffer;
 +using ::boost::shared_ptr;
diff --git a/patches/dev300/calc-subtotal-function-update.diff b/patches/dev300/calc-subtotal-function-update.diff
index aa2e6d7..8d1cf6f 100644
--- a/patches/dev300/calc-subtotal-function-update.diff
+++ b/patches/dev300/calc-subtotal-function-update.diff
@@ -3,8 +3,8 @@ index 2b5dc0f..603a005 100644
 --- sc/inc/document.hxx
 +++ sc/inc/document.hxx
 @@ -449,6 +449,8 @@ private:
- 	// for worksheet calculate event
- 	::std::vector< SCTAB > maTabs;
+
+     sal_Int16           mnNamedRangesLockCount;
  
 +    ::std::set<ScFormulaCell*> maSubTotalCells;
 +    
diff --git a/patches/vba/cws-vbasupportdev300.diff b/patches/vba/cws-vbasupportdev300.diff
index 9ac0972..9f15224 100644
--- a/patches/vba/cws-vbasupportdev300.diff
+++ b/patches/vba/cws-vbasupportdev300.diff
@@ -8279,162 +8279,6 @@ index fed0aab..fca0dc4 100644
          }
          if (SC_OPCODE_START_NO_PAR <= eOp && eOp < SC_OPCODE_STOP_NO_PAR)
          {
-diff --git offapi/com/sun/star/document/VbaEventId.idl offapi/com/sun/star/document/VbaEventId.idl
-new file mode 100644
-index 0000000..b5af431
---- /dev/null
-+++ offapi/com/sun/star/document/VbaEventId.idl
-@@ -0,0 +1,89 @@
-+/*************************************************************************
-+ *
-+ *  OpenOffice.org - a multi-platform office productivity suite
-+ *
-+ *  $RCSfile$
-+ *
-+ *  $Revision$
-+ *
-+ *  last change: $Author$ $Date$
-+ *
-+ *  The Contents of this file are made available subject to
-+ *  the terms of GNU Lesser General Public License Version 2.1.
-+ *
-+ *
-+ *    GNU Lesser General Public License Version 2.1
-+ *    =============================================
-+ *    Copyright 2005 by Sun Microsystems, Inc.
-+ *    901 San Antonio Road, Palo Alto, CA 94303, USA
-+ *
-+ *    This library is free software; you can redistribute it and/or
-+ *    modify it under the terms of the GNU Lesser General Public
-+ *    License version 2.1, as published by the Free Software Foundation.
-+ *
-+ *    This library is distributed in the hope that it will be useful,
-+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-+ *    Lesser General Public License for more details.
-+ *
-+ *    You should have received a copy of the GNU Lesser General Public
-+ *    License along with this library; if not, write to the Free Software
-+ *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
-+ *    MA  02111-1307  USA
-+ *
-+ ************************************************************************/
-+#ifndef __org_openoffice_vba_VbaEventId_idl__
-+#define __org_openoffice_vba_VbaEventId_idl__
-+
-+//=============================================================================
-+
-+module com {  module sun {  module star { module document {
-+//=============================================================================
-+
-+/* VBA compatibility event id */
-+constants VbaEventId
-+{
-+    // Worksheet
-+    const long VBAEVENT_WORKSHEET_ACTIVATE                  	= 1;
-+    const long VBAEVENT_WORKSHEET_BEFOREDOUBLECLICK         	= 2;
-+    const long VBAEVENT_WORKSHEET_BEFORERIGHTCLICK          	= 3;
-+    const long VBAEVENT_WORKSHEET_CALCULATE                 	= 4;
-+    const long VBAEVENT_WORKSHEET_CHANGE                    	= 5;
-+    const long VBAEVENT_WORKSHEET_DEACTIVATE                	= 6;
-+    const long VBAEVENT_WORKSHEET_FOLLOWHYPERLINK           	= 7;
-+    const long VBAEVENT_WORKSHEET_PIVOTTABLEUPDATE          	= 8;
-+    const long VBAEVENT_WORKSHEET_SELECTIONCHANGE           	= 9;
-+    // Workbook
-+    const long VBAEVENT_WORKBOOK_ACTIVATE            			= 20;
-+    const long VBAEVENT_WORKBOOK_DEACTIVATE          			= 21;
-+    const long VBAEVENT_WORKBOOK_OPEN                			= 22;
-+    const long VBAEVENT_WORKBOOK_AUTOOPEN            			= 23;
-+    const long VBAEVENT_WORKBOOK_BEFORECLOSE         			= 24;
-+    const long VBAEVENT_WORKBOOK_BEFOREPRINT         			= 25;
-+    const long VBAEVENT_WORKBOOK_BEFORESAVE          			= 26;
-+    const long VBAEVENT_WORKBOOK_NEWSHEET            			= 27;
-+    const long VBAEVENT_WORKBOOK_WINDOWACTIVATE      			= 28;
-+    const long VBAEVENT_WORKBOOK_WINDOWDEACTIVATE    			= 29;
-+    const long VBAEVENT_WORKBOOK_WINDOWRESIZE        			= 30;
-+    // Workbook_sheet
-+    const long VBAEVENT_WORKBOOK_SHEET_ACTIVATE               	= 51;
-+    const long VBAEVENT_WORKBOOK_SHEET_BEFOREDOUBLECLICK      	= 52;
-+    const long VBAEVENT_WORKBOOK_SHEET_BEFORERIGHTCLICK       	= 53;
-+    const long VBAEVENT_WORKBOOK_SHEET_CALCULATE              	= 54;
-+    const long VBAEVENT_WORKBOOK_SHEET_CHANGE                 	= 55;
-+    const long VBAEVENT_WORKBOOK_SHEET_DEACTIVATE             	= 56;
-+    const long VBAEVENT_WORKBOOK_SHEET_FOLLOWHYPERLINK        	= 57;
-+    const long VBAEVENT_WORKBOOK_SHEET_PIVOTTABLEUPDATE       	= 58;
-+    const long VBAEVENT_WORKBOOK_SHEET_SELECTIONCHANGE        	= 59;
-+
-+    // Document event for Word
-+    const long VBAEVENT_DOCUMENT_NEW                            = 70;
-+    const long VBAEVENT_DOCUMENT_AUTONEW                        = 71;
-+    const long VBAEVENT_DOCUMENT_OPEN                           = 72;
-+    const long VBAEVENT_DOCUMENT_AUTOOPEN                       = 73;
-+    const long VBAEVENT_DOCUMENT_CLOSE                          = 74;
-+};
-+
-+}; }; }; };
-+
-+#endif
-diff --git offapi/com/sun/star/document/VbaEventsHelper.idl offapi/com/sun/star/document/VbaEventsHelper.idl
-new file mode 100644
-index 0000000..30f8f7e
---- /dev/null
-+++ offapi/com/sun/star/document/VbaEventsHelper.idl
-@@ -0,0 +1,55 @@
-+/*************************************************************************
-+ *
-+ *  OpenOffice.org - a multi-platform office productivity suite
-+ *
-+ *  $RCSfile$
-+ *
-+ *  $Revision$
-+ *
-+ *  last change: $Author$ $Date$
-+ *
-+ *  The Contents of this file are made available subject to
-+ *  the terms of GNU Lesser General Public License Version 2.1.
-+ *
-+ *
-+ *    GNU Lesser General Public License Version 2.1
-+ *    =============================================
-+ *    Copyright 2005 by Sun Microsystems, Inc.
-+ *    901 San Antonio Road, Palo Alto, CA 94303, USA
-+ *
-+ *    This library is free software; you can redistribute it and/or
-+ *    modify it under the terms of the GNU Lesser General Public
-+ *    License version 2.1, as published by the Free Software Foundation.
-+ *
-+ *    This library is distributed in the hope that it will be useful,
-+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-+ *    Lesser General Public License for more details.
-+ *
-+ *    You should have received a copy of the GNU Lesser General Public
-+ *    License along with this library; if not, write to the Free Software
-+ *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
-+ *    MA  02111-1307  USA
-+ *
-+ ************************************************************************/
-+#ifndef __com_sun_star_document_VbaEventsHelper_idl__
-+#define __com_sun_star_document_VbaEventsHelper_idl__
-+
-+#ifndef __com_sun_star_uno_XInterface_idl__
-+#include <com/sun/star/uno/XInterface.idl>
-+#endif
-+#include <com/sun/star/frame/XModel.idl>
-+#include <com/sun/star/document/XVbaEventsHelper.idl>
-+//=============================================================================
-+
-+module com {  module sun {  module star { module document {
-+//=============================================================================
-+
-+service VbaEventsHelper : XVbaEventsHelper
-+{
-+  	createVbaEventsHelper(  [in] ::com::sun::star::frame::XModel xModel );
-+};
-+
-+}; }; }; };
-+
-+#endif
 diff --git offapi/com/sun/star/document/XCompatWriterDocProperties.idl offapi/com/sun/star/document/XCompatWriterDocProperties.idl
 new file mode 100644
 index 0000000..435ffb3
@@ -8490,131 +8334,6 @@ index 0000000..435ffb3
 +}; }; }; };
 +};
 +#endif
-diff --git offapi/com/sun/star/document/XDocumentEventCompatibleHelper.idl offapi/com/sun/star/document/XDocumentEventCompatibleHelper.idl
-new file mode 100644
-index 0000000..d10deab
---- /dev/null
-+++ offapi/com/sun/star/document/XDocumentEventCompatibleHelper.idl
-@@ -0,0 +1,53 @@
-+/*************************************************************************
-+ *
-+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-+ * 
-+ * Copyright 2008 by Sun Microsystems, Inc.
-+ *
-+ * OpenOffice.org - a multi-platform office productivity suite
-+ *
-+ * $RCSfile: XVbaEventHelper.idl,v $
-+ * $Revision: 1.0 $
-+ *
-+ * This file is part of OpenOffice.org.
-+ *
-+ * OpenOffice.org is free software: you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License version 3
-+ * only, as published by the Free Software Foundation.
-+ *
-+ * OpenOffice.org is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ * GNU Lesser General Public License version 3 for more details
-+ * (a copy is included in the LICENSE file that accompanied this code).
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * version 3 along with OpenOffice.org.  If not, see
-+ * <http://www.openoffice.org/license.html>
-+ * for a copy of the LGPLv3 License.
-+ *
-+ ************************************************************************/
-+#ifndef __com_sun_star_document_XDocumentEventCompatibleHelper_idl__
-+#define __com_sun_star_document_XDocumentEventCompatibleHelper_idl__
-+
-+#ifndef __com_sun_star_uno_XInterface_idl__
-+#include <com/sun/star/uno/XInterface.idl>
-+#endif
-+//=============================================================================
-+
-+module com {   module sun {   module star {   module document {
-+
-+//=============================================================================
-+interface XDocumentEventCompatibleHelper
-+{
-+    /* Execute some compatible VBA event related to document, such as document save, document print.
-+       nEventId: event id.
-+    */
-+    boolean processCompatibleEvent( [in] short nEventId );
-+};
-+
-+//=============================================================================
-+
-+}; }; }; };
-+
-+#endif
-diff --git offapi/com/sun/star/document/XVbaEventsHelper.idl offapi/com/sun/star/document/XVbaEventsHelper.idl
-new file mode 100644
-index 0000000..0c5abc7
---- /dev/null
-+++ offapi/com/sun/star/document/XVbaEventsHelper.idl
-@@ -0,0 +1,60 @@
-+/*************************************************************************
-+ *
-+ *  OpenOffice.org - a multi-platform office productivity suite
-+ *
-+ *  $RCSfile$
-+ *
-+ *  $Revision$
-+ *
-+ *  last change: $Author$ $Date$
-+ *
-+ *  The Contents of this file are made available subject to
-+ *  the terms of GNU Lesser General Public License Version 2.1.
-+ *
-+ *
-+ *    GNU Lesser General Public License Version 2.1
-+ *    =============================================
-+ *    Copyright 2005 by Sun Microsystems, Inc.
-+ *    901 San Antonio Road, Palo Alto, CA 94303, USA
-+ *
-+ *    This library is free software; you can redistribute it and/or
-+ *    modify it under the terms of the GNU Lesser General Public
-+ *    License version 2.1, as published by the Free Software Foundation.
-+ *
-+ *    This library is distributed in the hope that it will be useful,
-+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-+ *    Lesser General Public License for more details.
-+ *
-+ *    You should have received a copy of the GNU Lesser General Public
-+ *    License along with this library; if not, write to the Free Software
-+ *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
-+ *    MA  02111-1307  USA
-+ *
-+ ************************************************************************/
-+#ifndef __org_openoffice_vba_XVbaEventsHelper_idl__
-+#define __org_openoffice_vba_XVbaEventsHelper_idl__
-+
-+#ifndef __com_sun_star_uno_XInterface_idl__
-+#include <com/sun/star/uno/XInterface.idl>
-+#endif
-+//=============================================================================
-+
-+module com {  module sun {  module star {  module document {
-+//=============================================================================
-+
-+interface XVbaEventsHelper
-+{
-+    /**
-+        Execute VBA compatible event.
-+        VbaEvent: Compatible VBA event id.
-+        aArgs: the array of input arguments.
-+        return: True if execute successfully, or False.
-+    **/
-+    boolean ProcessCompatibleVbaEvent( [in] long nEventId, [in] sequence< any > aArgs );
-+    [attribute ] boolean IgnoreEvents;
-+};
-+
-+}; }; }; };
-+
-+#endif
 diff --git offapi/com/sun/star/document/XVbaMethodParameter.idl offapi/com/sun/star/document/XVbaMethodParameter.idl
 new file mode 100644
 index 0000000..7ef5296
@@ -8693,18 +8412,14 @@ diff --git offapi/com/sun/star/document/makefile.mk offapi/com/sun/star/document
 index 48394a6..6796fcf 100644
 --- offapi/com/sun/star/document/makefile.mk
 +++ offapi/com/sun/star/document/makefile.mk
-@@ -114,7 +114,13 @@ IDLFILES=\
+@@ -114,7 +114,9 @@ IDLFILES=\
      XDocumentRevisionListPersistence.idl\
      DocumentRevisionListPersistence.idl \
      XDocumentLanguages.idl \
 -    XCodeNameQuery.idl
 +    XCodeNameQuery.idl \
-+    XDocumentEventCompatibleHelper.idl \
 +    XCompatWriterDocProperties.idl \
 +    XVbaMethodParameter.idl \
-+    VbaEventId.idl \
-+    XVbaEventsHelper.idl \
-+    VbaEventsHelper.idl \
  
  
  # ------------------------------------------------------------------
@@ -12363,16 +12078,6 @@ index 9112c6d..59d774f 100644
  class ScMarkData;
  class ScOutlineTable;
  class ScPatternAttr;
-@@ -170,6 +171,9 @@ namespace com { namespace sun { namespace star {
-     }
- } } }
- 
-+namespace com { namespace sun { namespace star { namespace document {
-+    class XVbaEventsHelper;
-+} } } }
- #include <svl/zforlist.hxx>
- /*
- #ifdef _ZFORLIST_DECLARE_TABLE
 @@ -305,6 +309,8 @@ private:
      ::std::auto_ptr<ScClipParam>     mpClipParam;
  
@@ -12382,25 +12087,6 @@ index 9112c6d..59d774f 100644
  
      // mutable for lazy construction
      mutable ::std::auto_ptr< ScFormulaParserPool >
-@@ -341,6 +347,8 @@ private:
-     com::sun::star::uno::Reference< com::sun::star::script::vba::XVBAEventProcessor >
-                         mxVbaEvents;
- 
-+    com::sun::star::uno::Reference< com::sun::star::document::XVbaEventsHelper > mxVbaEventsHelper;
-+
- public:
-     ScTabOpList         aTableOpList;		            // list of ScInterpreterTableOpParams currently in use
-     ScInterpreterTableOpParams  aLastTableOpParams;     // remember last params
-@@ -440,6 +448,9 @@ private:
- 
-     sal_Int16           mnNamedRangesLockCount;
- 
-+	// for worksheet calculate event
-+	::std::vector< SCTAB > maTabs;
-+
- public:
-     SC_DLLPUBLIC ULONG			GetCellCount() const;		// alle Zellen
-     SCSIZE          GetCellCount(SCTAB nTab, SCCOL nCol) const;
 @@ -460,6 +471,8 @@ public:
      void			SetName( const String& r ) { aDocName = r; }
      const String& 	GetCodeName() const { return aDocCodeName; }
@@ -12410,26 +12096,6 @@ index 9112c6d..59d774f 100644
  
      void			GetDocStat( ScDocStat& rDocStat );
  
-@@ -821,7 +834,7 @@ public:
-     BOOL            HasSelectionData( SCCOL nCol, SCROW nRow, SCTAB nTab ) const;
- 
-     /** Returns the pointer to a cell note object at the passed cell address. */
--    ScPostIt*       GetNote( const ScAddress& rPos );
-+    SC_DLLPUBLIC ScPostIt*       GetNote( const ScAddress& rPos );
-     /** Sets the passed note at the cell with the passed cell address. */
-     void            TakeNote( const ScAddress& rPos, ScPostIt*& rpNote );
-     /** Returns and forgets the cell note object at the passed cell address. */
-@@ -917,6 +930,10 @@ public:
-     BOOL			IsForcedFormulaPending() const { return bForcedFormulaPending; }
-                     // if CalcFormulaTree() is currently running
-     BOOL			IsCalculatingFormulaTree() { return bCalculatingFormulaTree; }
-+	
-+					// for worksheet calculate event
-+	BOOL			FireCalculateEvent( SCTAB nTab );
-+	void			AddCalculateTable( SCTAB nTab );
-     
-     USHORT			GetErrCode( const ScAddress& ) const;
- 
 @@ -956,7 +973,7 @@ public:
                                              SCCOL nEndCol, SCROW nEndRow, SCTAB nEndTab,
                                              ScDirection eDir );
@@ -12465,44 +12131,6 @@ index 9112c6d..59d774f 100644
  
  private:
      ScDocument(const ScDocument& r); // disabled with no definition
-@@ -1804,6 +1822,8 @@ public:
-     inline com::sun::star::uno::Reference< com::sun::star::script::vba::XVBAEventProcessor >
-                     GetVbaEventProcessor() const { return mxVbaEvents; }
- 
-+    com::sun::star::uno::Reference< com::sun::star::document::XVbaEventsHelper > GetVbaEventsHelper();
-+
-     /** Should only be GRAM_PODF or GRAM_ODFF. */
-     void                SetStorageGrammar( formula::FormulaGrammar::Grammar eGrammar );
-     formula::FormulaGrammar::Grammar  GetStorageGrammar() const
-diff --git sc/inc/docuno.hxx sc/inc/docuno.hxx
-index 19448b0..2a86977 100644
---- sc/inc/docuno.hxx
-+++ sc/inc/docuno.hxx
-@@ -53,6 +53,7 @@
- #include <com/sun/star/beans/XPropertySet.hpp>
- #include <com/sun/star/sheet/XCellRangesAccess.hpp>
- #include <com/sun/star/util/XChangesNotifier.hpp>
-+#include <com/sun/star/document/XDocumentEventCompatibleHelper.hpp>
- #include <cppuhelper/implbase2.hxx>
- #include <cppuhelper/implbase3.hxx>
- #include <cppuhelper/implbase4.hxx>
-@@ -88,6 +89,7 @@ class SC_DLLPUBLIC ScModelObj : public SfxBaseModel,
-                     public com::sun::star::view::XRenderable,
-                     public com::sun::star::document::XLinkTargetSupplier,
-                     public com::sun::star::beans::XPropertySet,
-+                    public com::sun::star::document::XDocumentEventCompatibleHelper,
-                     public SvxFmMSFactory,	// derived from XMultiServiceFactory
-                     public com::sun::star::lang::XServiceInfo,
-                     public ::com::sun::star::util::XChangesNotifier
-@@ -320,6 +322,8 @@ public:
-     virtual void SAL_CALL removeChangesListener( const ::com::sun::star::uno::Reference<
-                                     ::com::sun::star::util::XChangesListener >& aListener )
-                                 throw (::com::sun::star::uno::RuntimeException);
-+                            // XVbaEventHelper
-+    virtual sal_Bool SAL_CALL processCompatibleEvent( sal_Int16 nEventId ) throw (::com::sun::star::uno::RuntimeException);
- };
- 
- 
 diff --git sc/inc/global.hxx sc/inc/global.hxx
 index e456fed..cde71d8 100644
 --- sc/inc/global.hxx
@@ -13029,16 +12657,6 @@ index 74d7126..ce3a9b0 100644
  
      if (pDocument->HasExternalRefManager())
          pDocument->GetExternalRefManager()->removeRefCell(this);
-@@ -1470,6 +1473,9 @@ void ScFormulaCell::Interpret()
-             }
-         } while (bIterationFromRecursion || bResumeIteration);
-     }
-+
-+	// Fire worksheet calculate event
-+	pDocument->FireCalculateEvent( aPos.Tab() );
- }
- 
- void ScFormulaCell::InterpretTail( ScInterpretTailParameter eTailParam )
 @@ -1742,6 +1748,36 @@ void ScFormulaCell::InterpretTail( ScInterpretTailParameter eTailParam )
          // Reschedule verlangsamt das ganze erheblich, nur bei Prozentaenderung ausfuehren
          ScProgress::GetInterpretProgress()->SetStateCountDownOnPercent(
@@ -13111,7 +12729,7 @@ index 74d7126..ce3a9b0 100644
 +{
 +	bDirty = TRUE;
 +	// mark the sheet of this cell to be calculated
-+	pDocument->AddCalculateTable( aPos.Tab() );
++	//#FIXME do we need to revert this remnant of old fake vba events? pDocument->AddCalculateTable( aPos.Tab() );
 +}
 +
  void ScFormulaCell::SetDirtyAfterLoad()
@@ -13156,16 +12774,13 @@ diff --git sc/source/core/data/documen2.cxx sc/source/core/data/documen2.cxx
 index 1c1cf39..2153170 100644
 --- sc/source/core/data/documen2.cxx
 +++ sc/source/core/data/documen2.cxx
-@@ -94,6 +94,9 @@
+@@ -94,5 +94,6 @@
  #include "tabprotection.hxx"
  #include "formulaparserpool.hxx"
  #include "clipparam.hxx"
 +#include "macromgr.hxx"
-+#include <com/sun/star/document/XVbaEventsHelper.hpp>
-+#include <vbahelper/vbaaccesshelper.hxx>
  
  using namespace com::sun::star;
- 
 @@ -156,6 +159,7 @@ ScDocument::ScDocument( ScDocumentMode	eMode,
          pCacheFieldEditEngine( NULL ),
          pDocProtection( NULL ),
@@ -13174,92 +12789,6 @@ index 1c1cf39..2153170 100644
          pExternalRefMgr( NULL ),
          pViewOptions( NULL ),
          pDocOptions( NULL ),
-@@ -1297,6 +1297,29 @@ void ScDocument::RemoveLookupCache( ScLo
-     }
- }
- 
-+using namespace com::sun::star;
-+uno::Reference< document::XVbaEventsHelper > 
-+ScDocument::GetVbaEventsHelper()
-+{
-+	if( !mxVbaEventsHelper.is() && pShell && ooo::vba::isAlienExcelDoc( *pShell ) )
-+	{
-+        try
-+        {
-+            uno::Reference< lang::XMultiServiceFactory > xSF( comphelper::getProcessServiceFactory(), 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.sheet.SpreadsheetDocumentVbaEventsHelper" ) ), aArgs ), uno::UNO_QUERY );
-+            // helper will always be created successfully.
-+            mxVbaEventsHelper.set( xVbaEventsHelper, uno::UNO_QUERY );
-+        }
-+        catch( uno::Exception& e )
-+        {
-+        }
-+	}
-+	return mxVbaEventsHelper;
-+}
-+
- void ScDocument::ClearLookupCaches()
- {
-     if( pLookupCacheMapImpl )
-diff --git sc/source/core/data/documen7.cxx sc/source/core/data/documen7.cxx
-index 96484dc..fcc6661 100644
---- sc/source/core/data/documen7.cxx
-+++ sc/source/core/data/documen7.cxx
-@@ -57,7 +57,15 @@
- 
- 
- #include "globstr.hrc"
-+#include <algorithm>
-+#include <vector>
- 
-+
-+#include <com/sun/star/document/XVbaEventsHelper.hpp>
-+#include <com/sun/star/document/VbaEventId.hpp>
-+
-+using namespace com::sun::star;
-+using namespace com::sun::star::document::VbaEventId;
- extern const ScFormulaCell* pLastFormulaTreeTop;	// cellform.cxx Err527 WorkAround
- 
- // STATIC DATA -----------------------------------------------------------
-@@ -530,5 +538,35 @@ void ScDocument::SetAutoCalc( BOOL bNewAutoCalc )
-     }
- }
- 
-+BOOL ScDocument::FireCalculateEvent( SCTAB nTab )
-+{
-+	BOOL bSuccess = FALSE;
-+	::std::vector<SCTAB>::iterator iter;
-+	iter = ::std::find( maTabs.begin(), maTabs.end(), nTab );
-+	if( iter != maTabs.end() )
-+	{
-+		// make sure fire worksheet calculate event only once for each sheet 
-+		// regardless of how many formula cells are calculated.
-+		maTabs.erase(iter);
-+
-+		uno::Reference< document::XVbaEventsHelper > xVbaEventsHelper ( GetVbaEventsHelper(), uno::UNO_QUERY );
-+		if( xVbaEventsHelper.is() )
-+		{
-+			uno::Sequence< uno::Any > aArgs(1);
-+			aArgs[0] <<= nTab;
-+			bSuccess = xVbaEventsHelper->ProcessCompatibleVbaEvent( VBAEVENT_WORKSHEET_CALCULATE, aArgs );
-+		}
-+	}	
-+	return bSuccess;
-+}
- 
-+void ScDocument::AddCalculateTable( SCTAB nTab )
-+{
-+	::std::vector<SCTAB>::iterator iter;
-+	iter = ::std::find( maTabs.begin(), maTabs.end(), nTab );
-+	if( iter == maTabs.end() )
-+	{
-+		maTabs.push_back( nTab );
-+	}
-+}
- 
 diff --git sc/source/core/data/documen8.cxx sc/source/core/data/documen8.cxx
 index bc2bf8c..1daa520 100644
 --- sc/source/core/data/documen8.cxx
@@ -15516,57 +15045,6 @@ index bec1b90..634456f 100644
  
      switch (eDir)
      {
-diff --git sc/source/ui/docshell/docsh.cxx sc/source/ui/docshell/docsh.cxx
-index ee7c15d..25670ba 100644
---- sc/source/ui/docshell/docsh.cxx
-+++ sc/source/ui/docshell/docsh.cxx
-@@ -127,10 +127,15 @@
- #include <rtl/logfile.hxx>
- 
- #include <comphelper/processfactory.hxx>
-+#include <com/sun/star/document/XVbaEventsHelper.hpp>
-+#include <com/sun/star/document/VbaEventId.hpp>
- #include "uiitems.hxx"
- #include "cellsuno.hxx"
- 
- using namespace com::sun::star;
-+using namespace com::sun::star::document::VbaEventId;
-+
-+using namespace com::sun::star;
- using ::rtl::OUString;
- using ::rtl::OUStringBuffer;
- 
-@@ -276,7 +281,12 @@ sal_uInt16 ScDocShell::GetHiddenInformationState( sal_uInt16 nStates )
- 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 );
-+    
-+// if VBA enabled then we need to  
-     // prevent unnecessary broadcasts and updates
-     DBG_ASSERT(pModificator == NULL, "The Modificator should not exist");
-     pModificator = new ScDocShellModificator( *this );
-@@ -2402,6 +2412,16 @@ USHORT __EXPORT ScDocShell::PrepareClose( BOOL bUI, BOOL bForBrowsing )
-     }
-     // end handler code
- 
-+	// start handler for possible veto from DocBefore_Close
-+    uno::Sequence< uno::Any > aArgs;
-+    uno::Reference< document::XVbaEventsHelper > xVbaEventsHelper ( aDocument.GetVbaEventsHelper(), uno::UNO_QUERY );
-+    if ( !IsInPrepareClose() && xVbaEventsHelper.is() )
-+    {
-+	    if ( xVbaEventsHelper->ProcessCompatibleVbaEvent( VBAEVENT_WORKBOOK_BEFORECLOSE, aArgs ) )
-+		    return sal_False;
-+    }
-+	// end handler code
-+
-     USHORT nRet = SfxObjectShell::PrepareClose( bUI, bForBrowsing );
-     if (nRet == TRUE)						// TRUE = schliessen
-         aDocument.DisableIdle(TRUE);		// nicht mehr drin rumpfuschen !!!
 diff --git sc/source/ui/docshell/docsh5.cxx sc/source/ui/docshell/docsh5.cxx
 index aa3ca3e..82e797e 100644
 --- sc/source/ui/docshell/docsh5.cxx
@@ -17422,15 +16900,11 @@ diff --git sc/source/ui/unoobj/docuno.cxx sc/source/ui/unoobj/docuno.cxx
 index ccf3ddf..39caf07 100644
 --- sc/source/ui/unoobj/docuno.cxx
 +++ sc/source/ui/unoobj/docuno.cxx
-@@ -101,7 +101,12 @@
+@@ -101,7 +101,8 @@
  #include "sc.hrc"
  #include "scresid.hxx"
  
-+#include <com/sun/star/document/XVbaEventsHelper.hpp>
-+#include <com/sun/star/document/VbaEventId.hpp>
  using namespace com::sun::star;
-+using namespace com::sun::star::document::VbaEventId;
-+
 +#define SC_UNO_VBADOCOBJ "ThisVBADocObj" // perhaps we want to actually make this ThisWorkbook ?
  
  //------------------------------------------------------------------------
@@ -17443,14 +16917,6 @@ index ccf3ddf..39caf07 100644
          {MAP_CHAR_LEN(SC_UNO_CALCASSHOWN),       PROP_UNO_CALCASSHOWN, &getBooleanCppuType(),                                    0, 0},
          {MAP_CHAR_LEN(SC_UNONAME_CLOCAL),        0, &getCppuType((lang::Locale*)0),                           0, 0},
          {MAP_CHAR_LEN(SC_UNO_CJK_CLOCAL),        0, &getCppuType((lang::Locale*)0),                           0, 0},
-@@ -464,6 +470,7 @@ uno::Any SAL_CALL ScModelObj::queryInterface( const uno::Type& rType )
-     SC_QUERYINTERFACE( view::XRenderable )
-     SC_QUERYINTERFACE( document::XLinkTargetSupplier )
-     SC_QUERYINTERFACE( beans::XPropertySet )
-+	SC_QUERYINTERFACE( document::XDocumentEventCompatibleHelper)
-     SC_QUERYINTERFACE( lang::XMultiServiceFactory )
-     SC_QUERYINTERFACE( lang::XServiceInfo )
-     SC_QUERYINTERFACE( util::XChangesNotifier )
 @@ -1873,6 +1880,18 @@ uno::Any SAL_CALL ScModelObj::getPropertyValue( const rtl::OUString& aPropertyNa
          {
              aRet <<= pDocShell->GetDialogContainer();
@@ -17470,54 +16936,6 @@ index ccf3ddf..39caf07 100644
          else if ( aString.EqualsAscii( SC_UNO_RUNTIMEUID ) )
          {
              aRet <<= getRuntimeUID();
-@@ -2038,6 +2057,39 @@ uno::Sequence<rtl::OUString> SAL_CALL ScModelObj::getAvailableServiceNames()
-     return concatServiceNames( aMyServices, aDrawServices );
- }
- 
-+// XVbaEventHelper
-+// For Vba Event
-+sal_Bool SAL_CALL
-+ScModelObj::processCompatibleEvent( sal_Int16 nSlotId ) throw( ::com::sun::star::uno::RuntimeException )
-+{
-+    USHORT nId = (USHORT)nSlotId;
-+    uno::Reference< document::XVbaEventsHelper > xVbaEventsHelper( GetDocument()->GetVbaEventsHelper(), uno::UNO_QUERY );
-+    if( xVbaEventsHelper.is() )
-+    {
-+        switch( nId )
-+        {
-+            case SID_SAVEDOC:
-+            {
-+                uno::Sequence< uno::Any > aArgs(1);
-+                aArgs[0] <<= sal_False;
-+                return xVbaEventsHelper->ProcessCompatibleVbaEvent( VBAEVENT_WORKBOOK_BEFORESAVE, aArgs );
-+            }
-+            case SID_SAVEASDOC:
-+            {
-+                uno::Sequence< uno::Any > aArgs(1);
-+                aArgs[0] <<= sal_True;
-+                return xVbaEventsHelper->ProcessCompatibleVbaEvent( VBAEVENT_WORKBOOK_BEFORESAVE, aArgs );
-+            }
-+            case SID_PRINTDOC:
-+            case SID_PRINTDOCDIRECT:
-+            {
-+                uno::Sequence< uno::Any > aArgs;
-+                return xVbaEventsHelper->ProcessCompatibleVbaEvent( VBAEVENT_WORKBOOK_BEFOREPRINT, aArgs );
-+            }
-+        }
-+    }
-+    return sal_False;
-+}
- // XServiceInfo
- 
- rtl::OUString SAL_CALL ScModelObj::getImplementationName() throw(uno::RuntimeException)
-@@ -2082,7 +2134,6 @@ sal_Int64 SAL_CALL ScModelObj::getSomething(
-     {
-         return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_IntPtr>(pDocShell ));
-     }
--
-     //	aggregated number formats supplier has XUnoTunnel, too
-     //	interface from aggregated object must be obtained via queryAggregation
- 
 diff --git sc/source/ui/unoobj/servuno.cxx sc/source/ui/unoobj/servuno.cxx
 index a9a83b7..32106fa 100644
 --- sc/source/ui/unoobj/servuno.cxx
@@ -17730,165 +17148,6 @@ diff --git sc/source/ui/unoobj/viewuno.cxx sc/source/ui/unoobj/viewuno.cxx
 index 0a3fe3f..200e592 100644
 --- sc/source/ui/unoobj/viewuno.cxx
 +++ sc/source/ui/unoobj/viewuno.cxx
-@@ -72,9 +72,12 @@
- #include "gridwin.hxx"
- #include "sheetevents.hxx"
- #include "AccessibilityHints.hxx"
-+#include <com/sun/star/document/XVbaEventsHelper.hpp>
-+#include <com/sun/star/document/VbaEventId.hpp>
- #include <svx/sdrhittesthelper.hxx>
- 
- using namespace com::sun::star;
-+using namespace com::sun::star::document::VbaEventId;
- 
- //------------------------------------------------------------------------
- 
-@@ -460,6 +463,104 @@ void SAL_CALL ScViewPaneObj::release() throw()
-     OWeakObject::release();
- }
- 
-+// To process sheet compatibile event
-+typedef ::cppu::WeakImplHelper2< awt::XEnhancedMouseClickHandler, view::XSelectionChangeListener > TabViewEventListener_BASE;
-+class ScTabViewEventListener: public TabViewEventListener_BASE
-+{
-+private:
-+    uno::Reference< document::XVbaEventsHelper > xVbaEventsHelper;
-+    ScTabViewObj* pViewObj;
-+    sal_Bool bDelaySelectionEvent;
-+    sal_Bool bSelectionChangeOccured;
-+
-+    void fireSelectionChangeEvent();
-+    
-+public:
-+    ScTabViewEventListener( ScTabViewObj* pObj, uno::Reference< document::XVbaEventsHelper >& rVbaEventsHelper);
-+    ~ScTabViewEventListener();
-+	// XEnhancedMouseClickHandler
-+	virtual sal_Bool SAL_CALL mousePressed( const awt::EnhancedMouseEvent& e ) throw (uno::RuntimeException);
-+	virtual sal_Bool SAL_CALL mouseReleased( const awt::EnhancedMouseEvent& e ) throw (uno::RuntimeException);
-+
-+    // XSelectionChangeListener
-+    virtual void SAL_CALL selectionChanged( const lang::EventObject& aEvent ) throw ( uno::RuntimeException );
-+    // XEventListener
-+	virtual void SAL_CALL disposing( const lang::EventObject& aEvent ) throw ( uno::RuntimeException );
-+};
-+
-+ScTabViewEventListener::ScTabViewEventListener(ScTabViewObj* pObj, uno::Reference< document::XVbaEventsHelper >& rVbaEventsHelper):
-+	pViewObj( pObj ),xVbaEventsHelper( rVbaEventsHelper ), bDelaySelectionEvent( sal_False ), bSelectionChangeOccured( sal_False )
-+{
-+}
-+
-+ScTabViewEventListener::~ScTabViewEventListener()
-+{
-+}
-+
-+void SAL_CALL ScTabViewEventListener::disposing(  const lang::EventObject& /*aEvent*/ ) throw ( uno::RuntimeException )
-+{
-+}
-+
-+void ScTabViewEventListener::fireSelectionChangeEvent()
-+{
-+	if ( xVbaEventsHelper.is() && pViewObj )
-+	{
-+		uno::Sequence< uno::Any > aArgs(1);
-+		aArgs[0] = pViewObj->getSelection();
-+		xVbaEventsHelper->ProcessCompatibleVbaEvent( VBAEVENT_WORKSHEET_SELECTIONCHANGE, aArgs );
-+	}
-+	bDelaySelectionEvent = sal_False;
-+	bSelectionChangeOccured = sal_False;
-+}
-+
-+sal_Bool SAL_CALL ScTabViewEventListener::mousePressed( const awt::EnhancedMouseEvent& e ) throw (uno::RuntimeException)
-+{
-+	// Delay to fire the selection change event if clicking the left mouse button to do selection.
-+	bDelaySelectionEvent = ( e.Buttons == ::com::sun::star::awt::MouseButton::RIGHT ) ? sal_False : sal_True;
-+	bSelectionChangeOccured = sal_False;
-+
-+	sal_Bool result =  sal_False;
-+    // process BeforeDoubleClick and BeforeRightClick events
-+	if( e.ClickCount == 2 || e.Buttons == ::com::sun::star::awt::MouseButton::RIGHT )
-+	{
-+		// ensure the target is a cell
-+        uno::Reference< table::XCell > xCell( e.Target, uno::UNO_QUERY );
-+		if( xCell.is() && xVbaEventsHelper.is() && pViewObj)
-+		{
-+			uno::Sequence< uno::Any > aArgs(1);
-+			aArgs[0] = pViewObj->getSelection();
-+			sal_Int32 nEventId = VBAEVENT_WORKSHEET_BEFORERIGHTCLICK;
-+			if( e.ClickCount == 2 )
-+				nEventId = VBAEVENT_WORKSHEET_BEFOREDOUBLECLICK;
-+            
-+            result = xVbaEventsHelper->ProcessCompatibleVbaEvent( nEventId, aArgs );
-+			// TODO: process Cancel argument	
-+		}
-+	}
-+	return result;
-+}
-+
-+sal_Bool SAL_CALL ScTabViewEventListener::mouseReleased( const awt::EnhancedMouseEvent&/*e*/) throw (uno::RuntimeException)
-+{
-+	if ( bSelectionChangeOccured )
-+	{
-+		fireSelectionChangeEvent();
-+	}
-+	return sal_False;
-+}
-+
-+void SAL_CALL ScTabViewEventListener::selectionChanged( const lang::EventObject& /*aEvent*/ ) throw ( uno::RuntimeException )
-+{
-+	if ( !bDelaySelectionEvent )
-+	{
-+		fireSelectionChangeEvent();
-+	}
-+	else
-+	{
-+		bSelectionChangeOccured = sal_True;
-+	}
-+}
-+
- //------------------------------------------------------------------------
- 
- //	Default-ctor wird fuer SMART_REFLECTION_IMPLEMENTATION gebraucht
-@@ -482,10 +583,23 @@ ScTabViewObj::ScTabViewObj( ScTabViewShell* pViewSh ) :
-     aMouseClickHandlers( 0 ),
-     aActivationListeners( 0 ),
-     nPreviousTab( 0 ),
--    bDrawSelModeSet(sal_False)
-+    bDrawSelModeSet(sal_False),
-+    bFilteredRangeSelection(sal_True)
- {
-     if (pViewSh)
-+    {
-         nPreviousTab = pViewSh->GetViewData()->GetTabNo();
-+	ScViewData* pViewData = pViewSh->GetViewData();
-+	if( pViewData )
-+	{
-+            uno::Reference< document::XVbaEventsHelper > xVbaEventsHelper (pViewData->GetDocument()->GetVbaEventsHelper(), uno::UNO_QUERY );
-+			ScTabViewEventListener* pEventListener = new ScTabViewEventListener( this, xVbaEventsHelper );
-+			uno::Reference< awt::XEnhancedMouseClickHandler > aMouseClickHandler( *pEventListener, uno::UNO_QUERY );
-+			addEnhancedMouseClickHandler( aMouseClickHandler );
-+            uno::Reference< view::XSelectionChangeListener > aSelectionChangeListener( *pEventListener, uno::UNO_QUERY );
-+            addSelectionChangeListener( aSelectionChangeListener );
-+	}
-+    }
- }
- 
- ScTabViewObj::~ScTabViewObj()
-@@ -938,6 +1052,15 @@ uno::Any SAL_CALL ScTabViewObj::getSelection() throw(uno::RuntimeException)
- 
-         ScRange aRange;
-         ScMarkType eMarkType = pViewData->GetSimpleArea(aRange);
-+
-+        if (!bFilteredRangeSelection)
-+        {
-+            if (eMarkType == SC_MARK_SIMPLE_FILTERED)
-+                eMarkType = SC_MARK_SIMPLE;
-+            else if (eMarkType == SC_MARK_FILTERED)
-+                eMarkType = SC_MARK_MULTI;
-+        }
-+
-         if ( nTabs == 1 && (eMarkType == SC_MARK_SIMPLE) )
-         {
-             if (aRange.aStart == aRange.aEnd)
 @@ -1173,11 +1296,21 @@ uno::Reference<sheet::XSpreadsheet> SAL_CALL ScTabViewObj::getActiveSheet()
      return NULL;
  }


More information about the ooo-build-commit mailing list