ooo-build r13854 - in trunk: . patches/dev300 patches/vba



Author: pflin
Date: Tue Sep  9 01:48:50 2008
New Revision: 13854
URL: http://svn.gnome.org/viewvc/ooo-build?rev=13854&view=rev

Log:
2008-09-09  Fong Lin  <pflin novell com>
	* patches/vba/vba-workbook-worksheet-events.diff: Fixed for 
	n#423591.
	* patches/vba/vba-compatible-mode-uno.diff:
	* patches/vba/vba-spinbutton-in-userform.diff: Import spinbutton on
	a userform only if vba mode is set. Add spinbutton and scrollbar to 
	support linked cell property in a userform.
	* patches/dev300/Apply.



Modified:
   trunk/ChangeLog
   trunk/patches/dev300/apply
   trunk/patches/vba/vba-compatible-mode-uno.diff
   trunk/patches/vba/vba-spinbutton-in-userform.diff
   trunk/patches/vba/vba-workbook-worksheet-events.diff

Modified: trunk/patches/dev300/apply
==============================================================================
--- trunk/patches/dev300/apply	(original)
+++ trunk/patches/dev300/apply	Tue Sep  9 01:48:50 2008
@@ -1572,10 +1572,10 @@
 vba-userform.diff
 # fix userform activate event re-compute; extracted from vcl92
 vba-userform-activate-fix.diff, i#91038
-# support to display spinbutton in userform
-vba-spinbutton-in-userform.diff, Fong
 # uno interface for vba mode
 vba-compatible-mode-uno.diff, Fong
+# support to display spinbutton in userform
+vba-spinbutton-in-userform.diff, Fong
 
 vbaevents-services-sources.diff, i#68893
 

Modified: trunk/patches/vba/vba-compatible-mode-uno.diff
==============================================================================
--- trunk/patches/vba/vba-compatible-mode-uno.diff	(original)
+++ trunk/patches/vba/vba-compatible-mode-uno.diff	Tue Sep  9 01:48:50 2008
@@ -136,8 +136,73 @@
  // Methods XServiceInfo
  ::sal_Bool SAL_CALL SfxLibraryContainer::supportsService( const ::rtl::OUString& _rServiceName )
      throw (RuntimeException)
---- xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx.orig	2008-09-03 13:17:42.000000000 +0800
-+++ xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx	2008-09-03 16:45:22.000000000 +0800
+--- xmlscript/source/xmldlg_imexp/imp_share.hxx.orig	2008-09-05 15:24:41.000000000 +0800
++++ xmlscript/source/xmldlg_imexp/imp_share.hxx	2008-09-05 15:25:18.000000000 +0800
+@@ -45,6 +45,7 @@
+ #include <com/sun/star/awt/FontEmphasisMark.hpp>
+ #include <com/sun/star/awt/FontRelief.hpp>
+ #include <com/sun/star/xml/input/XRoot.hpp>
++#include <com/sun/star/script/XLibraryContainer.hpp>
+ #include <vector>
+ 
+ 
+@@ -132,6 +133,7 @@ struct DialogImport
+     css::uno::Reference< css::container::XNameContainer > _xDialogModel;
+     css::uno::Reference< css::lang::XMultiServiceFactory > _xDialogModelFactory;
+     css::uno::Reference< css::frame::XModel > _xDoc;
++    css::uno::Reference< css::script::XLibraryContainer > _xScriptLibraryContainer;
+ 
+     sal_Int32 XMLNS_DIALOGS_UID, XMLNS_SCRIPT_UID;
+     
+@@ -177,6 +179,8 @@ public:
+         SAL_THROW( () );
+     
+     inline css::uno::Reference< css::frame::XModel > getDocOwner() { return _xDoc; }
++
++	css::uno::Reference< css::script::XLibraryContainer > getScriptLibraryContainer();
+     // XRoot
+     virtual void SAL_CALL startDocument(
+         css::uno::Reference< css::xml::input::XNamespaceMapping >
+--- xmlscript/source/xmldlg_imexp/xmldlg_import.cxx.orig	2008-09-05 15:24:30.000000000 +0800
++++ xmlscript/source/xmldlg_imexp/xmldlg_import.cxx	2008-09-05 15:25:18.000000000 +0800
+@@ -59,6 +59,8 @@
+ #include <com/sun/star/script/ScriptEventDescriptor.hpp>
+ 
+ #include <com/sun/star/view/SelectionType.hpp>
++#include <com/sun/star/document/XStorageBasedDocument.hpp>
++#include <com/sun/star/script/DocumentScriptLibraryContainer.hpp>
+ 
+ using namespace ::com::sun::star;
+ using namespace ::com::sun::star::uno;
+@@ -1874,6 +1876,26 @@ Reference< xml::input::XElement > Dialog
+     }
+     return 0;
+ }
++//__________________________________________________________________________________________________
++Reference< script::XLibraryContainer > DialogImport::getScriptLibraryContainer()
++{
++	if( !_xScriptLibraryContainer.is() )
++	{
++		try
++		{
++			Reference< document::XStorageBasedDocument > xStorageDoc( _xDoc, UNO_QUERY );
++			if( xStorageDoc.is() )
++				_xScriptLibraryContainer.set(
++									script::DocumentScriptLibraryContainer::create( comphelper_getProcessComponentContext(), xStorageDoc ), 
++									UNO_QUERY );
++		}
++		catch( const Exception& )
++		{
++		}
++	}
++
++	return _xScriptLibraryContainer;
++}
+ 
+ //##################################################################################################
+ 
+--- xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx.orig	2008-09-05 15:24:41.000000000 +0800
++++ xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx	2008-09-05 15:25:18.000000000 +0800
 @@ -41,6 +41,7 @@
  #include <com/sun/star/beans/XPropertyState.hpp>
  #include <com/sun/star/document/XStorageBasedDocument.hpp>
@@ -174,33 +239,7 @@
  // progessmeter
  //__________________________________________________________________________________________________
  Reference< xml::input::XElement > ProgressBarElement::startChildElement(
-@@ -301,9 +314,24 @@ Reference< xml::input::XElement > SpinBu
- void SpinButtonElement::endElement()
- 	throw (xml::sax::SAXException, RuntimeException)
- {
-+    OUString sService( OUSTR("com.sun.star.awt.UnoControlSpinButtonModel") );
-+
-+    // we should probably limit this to vba mode also ( leave for now )
-+    if ( isVBACompatModeOn( _pImport ) )
-+        sService = OUSTR("com.sun.star.form.component.SpinButton");
-+
-+    OUString sLinkedCell;
-+    try
-+    {
-+        sLinkedCell = _xAttributes->getValueByUidName( _pImport->XMLNS_DIALOGS_UID, OUSTR( "linked-cell" ) );
-+    }
-+    catch( Exception& /*e*/ )
-+    {
-+    }
-+
- 	ControlImportContext ctx(
- 		_pImport, getControlId( _xAttributes ),
--		OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlSpinButtonModel") ) );
-+		sService );
- 	
- 	Reference< xml::input::XElement > xStyle( getStyle( _xAttributes ) );
- 	if (xStyle.is())
-@@ -1545,7 +1573,7 @@ void TitledBoxElement::endElement()
+@@ -1475,7 +1488,7 @@ void TitledBoxElement::endElement()
  		{
  			sLinkedCell = xAttributes->getValueByUidName( _pImport->XMLNS_DIALOGS_UID, OUSTR( "linked-cell" ) );
  			// we should probably limit this to vba mode also ( leave for now )
@@ -209,7 +248,7 @@
  				sService = OUSTR("com.sun.star.form.component.RadioButton");
  		}
  		catch( Exception& /*e*/ )
-@@ -1690,7 +1718,7 @@ void RadioGroupElement::endElement()
+@@ -1620,7 +1633,7 @@ void RadioGroupElement::endElement()
  		{
  			sLinkedCell = xAttributes->getValueByUidName( _pImport->XMLNS_DIALOGS_UID, OUSTR( "linked-cell" ) );
  			// we should probably limit this to vba mode also ( leave for now )
@@ -218,7 +257,7 @@
  				sService = OUSTR("com.sun.star.form.component.RadioButton");
  		}
  		catch( Exception& /*e*/ )
-@@ -1877,7 +1905,7 @@ void MenuListElement::endElement()
+@@ -1807,7 +1820,7 @@ void MenuListElement::endElement()
          OUString sListBoxService( OUSTR("com.sun.star.awt.UnoControlListBoxModel") );
  
          // we should probably limit this to vba mode also ( leave for now )
@@ -227,7 +266,7 @@
              sListBoxService = OUSTR("com.sun.star.form.component.ListBox");
  
          try
-@@ -1982,7 +2010,7 @@ void ComboBoxElement::endElement()
+@@ -1912,7 +1925,7 @@ void ComboBoxElement::endElement()
          OUString sService( OUSTR("com.sun.star.awt.UnoControlComboBoxModel") );
  
          // we should probably limit this to vba mode also ( leave for now )
@@ -236,68 +275,3 @@
              sService = OUSTR("com.sun.star.form.component.ComboBox");
  
          OUString sLinkedCell;
---- xmlscript/source/xmldlg_imexp/imp_share.hxx.orig	2008-09-03 15:53:46.000000000 +0800
-+++ xmlscript/source/xmldlg_imexp/imp_share.hxx	2008-09-03 16:43:24.000000000 +0800
-@@ -45,6 +45,7 @@
- #include <com/sun/star/awt/FontEmphasisMark.hpp>
- #include <com/sun/star/awt/FontRelief.hpp>
- #include <com/sun/star/xml/input/XRoot.hpp>
-+#include <com/sun/star/script/XLibraryContainer.hpp>
- #include <vector>
- 
- 
-@@ -132,6 +133,7 @@ struct DialogImport
-     css::uno::Reference< css::container::XNameContainer > _xDialogModel;
-     css::uno::Reference< css::lang::XMultiServiceFactory > _xDialogModelFactory;
-     css::uno::Reference< css::frame::XModel > _xDoc;
-+    css::uno::Reference< css::script::XLibraryContainer > _xScriptLibraryContainer;
- 
-     sal_Int32 XMLNS_DIALOGS_UID, XMLNS_SCRIPT_UID;
-     
-@@ -177,6 +179,8 @@ public:
-         SAL_THROW( () );
-     
-     inline css::uno::Reference< css::frame::XModel > getDocOwner() { return _xDoc; }
-+
-+	css::uno::Reference< css::script::XLibraryContainer > getScriptLibraryContainer();
-     // XRoot
-     virtual void SAL_CALL startDocument(
-         css::uno::Reference< css::xml::input::XNamespaceMapping >
---- xmlscript/source/xmldlg_imexp/xmldlg_import.cxx.orig	2008-09-03 16:31:30.000000000 +0800
-+++ xmlscript/source/xmldlg_imexp/xmldlg_import.cxx	2008-09-03 16:40:02.000000000 +0800
-@@ -59,6 +59,8 @@
- #include <com/sun/star/script/ScriptEventDescriptor.hpp>
- 
- #include <com/sun/star/view/SelectionType.hpp>
-+#include <com/sun/star/document/XStorageBasedDocument.hpp>
-+#include <com/sun/star/script/DocumentScriptLibraryContainer.hpp>
- 
- using namespace ::com::sun::star;
- using namespace ::com::sun::star::uno;
-@@ -1874,6 +1876,26 @@ Reference< xml::input::XElement > Dialog
-     }
-     return 0;
- }
-+//__________________________________________________________________________________________________
-+Reference< script::XLibraryContainer > DialogImport::getScriptLibraryContainer()
-+{
-+	if( !_xScriptLibraryContainer.is() )
-+	{
-+		try
-+		{
-+			Reference< document::XStorageBasedDocument > xStorageDoc( _xDoc, UNO_QUERY );
-+			if( xStorageDoc.is() )
-+				_xScriptLibraryContainer.set(
-+									script::DocumentScriptLibraryContainer::create( comphelper_getProcessComponentContext(), xStorageDoc ), 
-+									UNO_QUERY );
-+		}
-+		catch( const Exception& )
-+		{
-+		}
-+	}
-+
-+	return _xScriptLibraryContainer;
-+}
- 
- //##################################################################################################
- 

Modified: trunk/patches/vba/vba-spinbutton-in-userform.diff
==============================================================================
--- trunk/patches/vba/vba-spinbutton-in-userform.diff	(original)
+++ trunk/patches/vba/vba-spinbutton-in-userform.diff	Tue Sep  9 01:48:50 2008
@@ -1,5 +1,17 @@
---- svx/source/msfilter/msocximex.cxx.orig	2008-09-02 13:28:45.000000000 +0800
-+++ svx/source/msfilter/msocximex.cxx	2008-09-02 13:28:55.000000000 +0800
+--- svx/inc/svx/msocximex.hxx.orig	2008-09-08 15:38:59.000000000 +0800
++++ svx/inc/svx/msocximex.hxx	2008-09-08 15:41:32.000000000 +0800
+@@ -1355,6 +1355,9 @@ protected:
+     bool                mbEnabled;
+     bool                mbLocked;
+     bool                mbPropThumb;
++
++public:
++	rtl::OUString msCtrlSource;
+ };
+ 
+ class OCX_ScrollBar : public OCX_SpinButton
+--- svx/source/msfilter/msocximex.cxx.orig	2008-09-05 15:24:41.000000000 +0800
++++ svx/source/msfilter/msocximex.cxx	2008-09-08 16:53:27.000000000 +0800
 @@ -3660,8 +3660,7 @@ void OCX_ContainerControl::ProcessContro
      SotStorageStreamRef oStream = mContainedControlsStream;
  
@@ -10,24 +22,99 @@
      {
          // skip the record in the stream, discard the control
          oStream->SeekRel( rec.nSubStreamLen );
---- xmlscript/source/xmldlg_imexp/exp_share.hxx.orig	2008-09-02 11:14:19.000000000 +0800
-+++ xmlscript/source/xmldlg_imexp/exp_share.hxx	2008-09-02 11:15:45.000000000 +0800
-@@ -214,6 +214,8 @@ public:
+@@ -3692,7 +3691,18 @@ void OCX_ContainerControl::ProcessContro
+                         pList->msCtrlSource = rec.sCtrlSource;
+                         pList->msRowSource = rec.sRowSource;
+                     }
++					break;
+                 }
++			case SPINBUTTON:
++			case SCROLLBAR:
++				{
++					OCX_SpinButton* pLink = static_cast< OCX_SpinButton* >( pControl );
++					if( pLink )
++					{
++						pLink->msCtrlSource = rec.sCtrlSource;
++					}
++					break;
++				}
+         }
+         pControl->sName = rec.cName;
+         pControl->msToolTip = rec.controlTip;
+@@ -5554,7 +5564,7 @@ OCX_SpinButton::OCX_SpinButton() :
+     mbPropThumb( true )
+ {
+     msFormType = C2U("com.sun.star.form.component.SpinButton");
+-    msDialogType = C2U("com.sun.star.awt.UnoControlSpinButtonModel");
++    msDialogType = C2U("com.sun.star.form.component.SpinButton");
+     mnBackColor = 0x8000000F;
+     mnForeColor = 0x80000012;
+ }
+@@ -5677,6 +5687,10 @@ sal_Bool OCX_SpinButton::Import(com::sun
+     aTmp <<= sal_Int16( 0 );
+     rPropSet->setPropertyValue( WW8_ASCII2STR("Border"), aTmp);
+ 
++	uno::Reference< frame::XModel > xModel ( pDocSh ? pDocSh->GetModel() : NULL );
++	rtl::OUString sRowSource;
++	lcl_ApplyListSourceAndBindableStuff( xModel, rPropSet, msCtrlSource, sRowSource );
++
+     return sal_True;
+ }
+ 
+@@ -5844,7 +5858,7 @@ OCX_ScrollBar::OCX_ScrollBar()
+     sName = OUString( RTL_CONSTASCII_USTRINGPARAM( "ScrollBar" ) );
+     mnMax = 32767;
+     msFormType = C2U("com.sun.star.form.component.ScrollBar");
+-    msDialogType = C2U("com.sun.star.awt.UnoControlScrollBarModel");
++    msDialogType = C2U("com.sun.star.form.component.ScrollBar");
+ 
+ }
+ 
+@@ -5910,6 +5924,10 @@ sal_Bool OCX_ScrollBar::Import(com::sun:
+     aTmp <<= sal_Int16( 0 );
+     rPropSet->setPropertyValue( WW8_ASCII2STR("Border"), aTmp);
+ 
++	uno::Reference< frame::XModel > xModel ( pDocSh ? pDocSh->GetModel() : NULL );
++	rtl::OUString sRowSource;
++	lcl_ApplyListSourceAndBindableStuff( xModel, rPropSet, msCtrlSource, sRowSource );
++
+     return sal_True;
+ }
+ 
+--- xmlscript/source/xmldlg_imexp/exp_share.hxx.orig	2008-09-05 15:24:41.000000000 +0800
++++ xmlscript/source/xmldlg_imexp/exp_share.hxx	2008-09-08 16:36:40.000000000 +0800
+@@ -212,7 +212,9 @@ public:
          SAL_THROW( (css::uno::Exception) );
-     void readScrollBarModel( StyleBag * all_styles )
+     void readProgressBarModel( StyleBag * all_styles )
          SAL_THROW( (css::uno::Exception) );
-+    void readSpinButtonModel( StyleBag * all_styles )
+-    void readScrollBarModel( StyleBag * all_styles )
++    void readScrollBarModel( StyleBag * all_styles, com::sun::star::uno::Reference< com::sun::star::frame::XModel > const & xDocument )
 +        SAL_THROW( (css::uno::Exception) );
++    void readSpinButtonModel( StyleBag * all_styles, com::sun::star::uno::Reference< com::sun::star::frame::XModel > const & xDocument )
+         SAL_THROW( (css::uno::Exception) );
  	void readFixedHyperLinkModel( StyleBag * all_styles )
          SAL_THROW( (css::uno::Exception) );
- };
---- xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx.orig	2008-09-02 11:16:26.000000000 +0800
-+++ xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx	2008-09-02 13:40:29.000000000 +0800
-@@ -1205,6 +1205,43 @@ void ElementDescriptor::readScrollBarMod
+--- xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx.orig	2008-09-05 15:24:41.000000000 +0800
++++ xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx	2008-09-08 16:38:15.000000000 +0800
+@@ -1164,7 +1164,7 @@ void ElementDescriptor::readProgressBarM
      readEvents();
  }
  //__________________________________________________________________________________________________
-+void ElementDescriptor::readSpinButtonModel( StyleBag * all_styles )
+-void ElementDescriptor::readScrollBarModel( StyleBag * all_styles )
++void ElementDescriptor::readScrollBarModel( StyleBag * all_styles, Reference< frame::XModel > const & xDocument  )
+     SAL_THROW( (Exception) )
+ {
+     // collect styles
+@@ -1202,6 +1202,47 @@ void ElementDescriptor::readScrollBarMod
+                   OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":live-scroll") ) );
+     readHexLongAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("SymbolColor") ),
+                      OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":symbol-color") ) );
++    // Cell Range, Ref Cell etc.
++    lclExportBindableAndListSourceBits( xDocument, _xProps, *this );
++    readEvents();
++}
++//__________________________________________________________________________________________________
++void ElementDescriptor::readSpinButtonModel( StyleBag * all_styles, Reference< frame::XModel > const & xDocument  )
 +    SAL_THROW( (Exception) )
 +{
 +    // collect styles
@@ -61,32 +148,33 @@
 +                  OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":tabstop") ) );
 +    readHexLongAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("SymbolColor") ),
 +                     OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":symbol-color") ) );
-+    readEvents();
-+}
-+//__________________________________________________________________________________________________
- void ElementDescriptor::readDialogModel( StyleBag * all_styles )
-     SAL_THROW( (Exception) )
- {
---- xmlscript/source/xmldlg_imexp/xmldlg_export.cxx.orig	2008-09-02 14:08:16.000000000 +0800
-+++ xmlscript/source/xmldlg_imexp/xmldlg_export.cxx	2008-09-02 11:13:40.000000000 +0800
-@@ -1518,6 +1518,14 @@ void SAL_CALL exportDialogModel(
++    // Cell Range, Ref Cell etc.
++    lclExportBindableAndListSourceBits( xDocument, _xProps, *this );
+     readEvents();
+ }
+ //__________________________________________________________________________________________________
+--- xmlscript/source/xmldlg_imexp/xmldlg_export.cxx.orig	2008-09-05 15:24:41.000000000 +0800
++++ xmlscript/source/xmldlg_imexp/xmldlg_export.cxx	2008-09-08 16:39:35.000000000 +0800
+@@ -1516,7 +1516,15 @@ void SAL_CALL exportDialogModel(
+                     xProps, xPropState,
+                     OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":scrollbar") ) );
                  xElem = static_cast< xml::sax::XAttributeList * >( pElem );
-                 pElem->readScrollBarModel( &all_styles );
-             }
+-                pElem->readScrollBarModel( &all_styles );
++                pElem->readScrollBarModel( &all_styles, xDocument );
++            }
 +            else if (xServiceInfo->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlSpinButtonModel") ) ) )
 +            {
 +                pElem = new ElementDescriptor(
 +                    xProps, xPropState,
 +                    OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":spinbutton") ) );
 +                xElem = static_cast< xml::sax::XAttributeList * >( pElem );
-+                pElem->readSpinButtonModel( &all_styles );
-+            }
++                pElem->readSpinButtonModel( &all_styles, xDocument );
+             }
              else if (xServiceInfo->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlProgressBarModel") ) ) )
              {
-                 pElem = new ElementDescriptor(
---- xmlscript/source/xmldlg_imexp/imp_share.hxx.orig	2008-09-02 10:26:07.000000000 +0800
-+++ xmlscript/source/xmldlg_imexp/imp_share.hxx	2008-09-02 13:50:23.000000000 +0800
-@@ -1002,6 +1002,28 @@ public:
+--- xmlscript/source/xmldlg_imexp/imp_share.hxx.orig	2008-09-05 15:25:18.000000000 +0800
++++ xmlscript/source/xmldlg_imexp/imp_share.hxx	2008-09-05 15:30:38.000000000 +0800
+@@ -1006,6 +1006,28 @@ public:
  };
  
  //==============================================================================
@@ -115,12 +203,51 @@
  class ProgressBarElement
      : public ControlElement
  {
---- xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx.orig	2008-09-02 10:18:44.000000000 +0800
-+++ xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx	2008-09-02 14:01:48.000000000 +0800
-@@ -278,6 +278,76 @@ void ScrollBarElement::endElement()
- 
- //##################################################################################################
- 
+--- xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx.orig	2008-09-05 15:25:18.000000000 +0800
++++ xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx	2008-09-08 17:07:40.000000000 +0800
+@@ -237,10 +237,24 @@ Reference< xml::input::XElement > Scroll
+ void ScrollBarElement::endElement()
+ 	throw (xml::sax::SAXException, RuntimeException)
+ {
++	OUString sService( OUSTR("com.sun.star.awt.UnoControlScrollBarModel") );
++	// we should probably limit this to vba mode also ( leave for now )
++	if ( isVBACompatModeOn( _pImport ) )
++		sService = OUSTR("com.sun.star.form.component.ScrollBar");
++
++    OUString sLinkedCell;
++    try
++    {
++        sLinkedCell = _xAttributes->getValueByUidName( _pImport->XMLNS_DIALOGS_UID, OUSTR( "linked-cell" ) );
++    }
++    catch( Exception& /*e*/ )
++    {
++    }
++
+ 	ControlImportContext ctx(
+ 		_pImport, getControlId( _xAttributes ),
+-		OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlScrollBarModel") ) );
+-	
++		sService );	
++
+ 	Reference< xml::input::XElement > xStyle( getStyle( _xAttributes ) );
+ 	if (xStyle.is())
+ 	{
+@@ -283,6 +297,92 @@ void ScrollBarElement::endElement()
+                                OUString( RTL_CONSTASCII_USTRINGPARAM("symbol-color") ),
+                                _xAttributes );
+     
++    // import cell-link
++	OUString sCellRange;
++	importBindableAndListRangeBits( _pImport, sLinkedCell, sCellRange, ctx );
++
++	ctx.importEvents( _events );
++    // avoid ring-reference:
++    // vector< event elements > holding event elements holding this (via _pParent)
++    _events.clear();
++}
++
++//##################################################################################################
++
 +// spinbutton
 +//__________________________________________________________________________________________________
 +Reference< xml::input::XElement > SpinButtonElement::startChildElement(
@@ -144,9 +271,18 @@
 +void SpinButtonElement::endElement()
 +	throw (xml::sax::SAXException, RuntimeException)
 +{
++    OUString sLinkedCell;
++    try
++    {
++        sLinkedCell = _xAttributes->getValueByUidName( _pImport->XMLNS_DIALOGS_UID, OUSTR( "linked-cell" ) );
++    }
++    catch( Exception& /*e*/ )
++    {
++    }
++
 +	ControlImportContext ctx(
 +		_pImport, getControlId( _xAttributes ),
-+		OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlSpinButtonModel") ) );
++		OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.form.component.SpinButton") ) );
 +	
 +	Reference< xml::input::XElement > xStyle( getStyle( _xAttributes ) );
 +	if (xStyle.is())
@@ -182,24 +318,19 @@
 +    ctx.importHexLongProperty( OUString( RTL_CONSTASCII_USTRINGPARAM("SymbolColor") ),
 +                               OUString( RTL_CONSTASCII_USTRINGPARAM("symbol-color") ),
 +                               _xAttributes );
++    // import cell-link
++	OUString sCellRange;
++	importBindableAndListRangeBits( _pImport, sLinkedCell, sCellRange, ctx );
 +    
-+	ctx.importEvents( _events );
-+    // avoid ring-reference:
-+    // vector< event elements > holding event elements holding this (via _pParent)
-+    _events.clear();
-+}
-+
-+//##################################################################################################
-+
- // fixedline
- //__________________________________________________________________________________________________
- Reference< xml::input::XElement > FixedLineElement::startChildElement(
-@@ -2299,6 +2369,11 @@ Reference< xml::input::XElement > Bullet
+ 	ctx.importEvents( _events );
+     // avoid ring-reference:
+     // vector< event elements > holding event elements holding this (via _pParent)
+@@ -2312,6 +2412,11 @@ Reference< xml::input::XElement > Bullet
  	{
  		return new ScrollBarElement( rLocalName, xAttributes, this, _pImport );
  	}
 +	// spinbutton
-+	else if (rLocalName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("spinbutton") ))
++	else if (rLocalName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("spinbutton") ) && isVBACompatModeOn( _pImport ) )
 +	{
 +		return new SpinButtonElement( rLocalName, xAttributes, this, _pImport );
 +	}

Modified: trunk/patches/vba/vba-workbook-worksheet-events.diff
==============================================================================
--- trunk/patches/vba/vba-workbook-worksheet-events.diff	(original)
+++ trunk/patches/vba/vba-workbook-worksheet-events.diff	Tue Sep  9 01:48:50 2008
@@ -2299,7 +2299,7 @@
 --- /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 @@
- #include "client.hxx"
+ #include "tabprotection.hxx"
  
  #include <com/sun/star/chart2/data/HighlightedRange.hpp>
 +#include <com/sun/star/document/XVbaEventsHelper.hpp>
@@ -2309,7 +2309,7 @@
  
  namespace
  {
-@@ -1685,6 +1689,17 @@ void ScTabView::SetTabNo( SCTAB nTab, BO
+@@ -1688,6 +1692,17 @@ void ScTabView::SetTabNo( SCTAB nTab, BO
  										//	nicht InputEnterHandler wegen Referenzeingabe !
  
  		ScDocument* pDoc = aViewData.GetDocument();
@@ -2327,12 +2327,14 @@
  		pDoc->MakeTable( nTab );
  
  		SCTAB nTabCount = pDoc->GetTableCount();
-@@ -1783,7 +1798,18 @@ void ScTabView::SetTabNo( SCTAB nTab, BO
+@@ -1786,8 +1801,20 @@ void ScTabView::SetTabNo( SCTAB nTab, BO
  					if ( pGridWin[i]->IsVisible() )
  						pGridWin[i]->UpdateEditViewPos();
  		}
 -
 +		
+ 		TabChanged();										// DrawView
++
 +		if( !bNew )
 +		{
 +            uno::Reference< document::XVbaEventsHelper > xVbaEventsHelper ( pDoc->GetVbaEventsHelper(), uno::UNO_QUERY );
@@ -2344,10 +2346,9 @@
 +            }
 +		}
 +			
- 		TabChanged();										// DrawView
  		aViewData.GetViewShell()->WindowChanged();			// falls das aktive Fenster anders ist
          if ( !bUnoRefDialog )
-
+             aViewData.GetViewShell()->DisconnectAllClients();   // important for floating frames
 --- /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,7 +128,8 @@ SLOFILES= \



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