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



Author: noelpwer
Date: Mon Jun 23 14:54:16 2008
New Revision: 12941
URL: http://svn.gnome.org/viewvc/ooo-build?rev=12941&view=rev

Log:
yet another snapshot


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 Jun 23 14:54:16 2008
@@ -1800,7 +1800,7 @@
  		mnForeColor = 0x80000008;
  		nBorderColor = 0x80000006;
 diff --git svx/source/msfilter/msocximex.cxx svx/source/msfilter/msocximex.cxx
-index 143c66b..aa434b4 100644
+index 143c66b..9a63a94 100644
 --- svx/source/msfilter/msocximex.cxx
 +++ svx/source/msfilter/msocximex.cxx
 @@ -49,6 +49,10 @@
@@ -1853,11 +1853,10 @@
              }
  
              // seek to end of data
-@@ -2825,7 +2844,34 @@ sal_Bool OCX_ListBox::Import(com::sun::s
+@@ -2825,7 +2844,66 @@ sal_Bool OCX_ListBox::Import(com::sun::s
  
      aTmp <<= ImportColor( nBorderColor );
      rPropSet->setPropertyValue( WW8_ASCII2STR("BorderColor"), aTmp);
--
 +// XBindable etc.
 +    uno::Reference< lang::XMultiServiceFactory > xFac;
 +    if ( pDocSh )
@@ -1865,31 +1864,63 @@
 +    uno::Reference< form::binding::XBindableValue > xBindable( rPropSet, uno::UNO_QUERY );
 +    if (  xFac.is() && msCtrlSource.getLength() && xBindable.is() )
 +    {
-+         // we need a service to properly convert XL notation into
++         
 +         // OOo address structures
 +         // RefCell - convert from XL
 +         // pretend we converted the imported string address into the
 +         // appropriate address structure
++         uno::Reference< beans::XPropertySet > xConvertor( xFac->createInstance( C2U( "com.sun.star.table.CellAddressConversion" )), uno::UNO_QUERY );
 +         table::CellAddress aAddress;
-+         aAddress.Row = 0;
-+         aAddress.Column = 6;
-+         aAddress.Sheet = 0;
++         if ( xConvertor.is() )
++         {
++             // we need this service to properly convert XL notation also
++             // Should be easy to extend
++             xConvertor->setPropertyValue( C2U( "PersistentRepresentation" ), uno::makeAny( msCtrlSource ) );
++             xConvertor->getPropertyValue( C2U( "Address" ) ) >>= aAddress;    
++         }
 +        
 +         beans::NamedValue aArg1;
-+         aArg1.Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("BoundCell") );
++         aArg1.Name = C2U("BoundCell");
 +         aArg1.Value <<= aAddress;
 +
 +         uno::Sequence< uno::Any > aArgs(1);
 +         aArgs[ 0 ]  <<= aArg1;
 +
-+         uno::Reference< form::binding::XValueBinding > xBinding( xFac->createInstanceWithArguments( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.table.CellValueBinding" ) ), aArgs ), uno::UNO_QUERY );
-+         if ( xBindable.is() )
-+             xBindable->setValueBinding( xBinding );
++         uno::Reference< form::binding::XValueBinding > xBinding( xFac->createInstanceWithArguments( C2U("com.sun.star.table.CellValueBinding" ), aArgs ), uno::UNO_QUERY );
++         xBindable->setValueBinding( xBinding );
++    }
++    uno::Reference< form::binding::XListEntrySink > xListEntrySink( rPropSet, uno::UNO_QUERY );
++    if (  xFac.is() && msRowSource.getLength() && xListEntrySink.is() )
++    {
++         
++         // OOo address structures
++         // RefCell - convert from XL
++         // pretend we converted the imported string address into the
++         // appropriate address structure
++         uno::Reference< beans::XPropertySet > xConvertor( xFac->createInstance( C2U( "com.sun.star.table.CellRangeAddressConversion" )), uno::UNO_QUERY );
++         table::CellRangeAddress aAddress;
++         if ( xConvertor.is() )
++         {
++             // we need this service to properly convert XL notation also
++             // Should be easy to extend
++             xConvertor->setPropertyValue( C2U( "PersistentRepresentation" ), uno::makeAny( msRowSource ) );
++             xConvertor->getPropertyValue( C2U( "Address" ) ) >>= aAddress;    
++         }
++        
++         beans::NamedValue aArg1;
++         aArg1.Name = C2U("CellRange");
++         aArg1.Value <<= aAddress;
+ 
++         uno::Sequence< uno::Any > aArgs(1);
++         aArgs[ 0 ]  <<= aArg1;
++
++         uno::Reference< form::binding::XListEntrySource > xSource( xFac->createInstanceWithArguments( C2U("com.sun.star.table.CellRangeListSource" ), aArgs ), uno::UNO_QUERY );
++         xListEntrySink->setListEntrySource( xSource );
 +    }
  	aFontData.Import(rPropSet);
  	return sal_True;
  }
-@@ -3600,13 +3646,26 @@ void OCX_ContainerControl::ProcessContro
+@@ -3600,13 +3678,26 @@ void OCX_ContainerControl::ProcessContro
      {
          // A container control needs to read the f stream in
          // the folder ( substorage ) associated with this control
@@ -1922,7 +1953,7 @@
          }
  
          pControl->sName = rec.cName;
-@@ -4247,7 +4306,7 @@ sal_Bool OCX_UserForm::Import(
+@@ -4247,7 +4338,7 @@ sal_Bool OCX_UserForm::Import(
      OCX_ContainerControl::Import( xPropSet );
  
      uno::Reference<io::XInputStreamProvider> xSource =
@@ -2102,6 +2133,52 @@
  
  void
  SAL_CALL exportLibrary(
+diff --git xmlscript/source/xmldlg_imexp/exp_share.hxx xmlscript/source/xmldlg_imexp/exp_share.hxx
+index c87538f..092aeeb 100644
+--- xmlscript/source/xmldlg_imexp/exp_share.hxx
++++ xmlscript/source/xmldlg_imexp/exp_share.hxx
+@@ -198,7 +198,7 @@ public:
+         SAL_THROW( (css::uno::Exception) );
+     void readImageControlModel( StyleBag * all_styles )
+         SAL_THROW( (css::uno::Exception) );
+-    void readListBoxModel( StyleBag * all_styles )
++    void readListBoxModel( StyleBag * all_styles, com::sun::star::uno::Reference< com::sun::star::frame::XModel > const & xDocument )
+         SAL_THROW( (css::uno::Exception) );
+     void readNumericFieldModel( StyleBag * all_styles )
+         SAL_THROW( (css::uno::Exception) );
+diff --git xmlscript/source/xmldlg_imexp/imp_share.hxx xmlscript/source/xmldlg_imexp/imp_share.hxx
+index c53e325..e5263ad 100644
+--- xmlscript/source/xmldlg_imexp/imp_share.hxx
++++ xmlscript/source/xmldlg_imexp/imp_share.hxx
+@@ -131,6 +131,7 @@ struct DialogImport
+     
+     css::uno::Reference< css::container::XNameContainer > _xDialogModel;
+     css::uno::Reference< css::lang::XMultiServiceFactory > _xDialogModelFactory;
++    css::uno::Reference< css::frame::XModel > _xDoc;
+ 
+     sal_Int32 XMLNS_DIALOGS_UID, XMLNS_SCRIPT_UID;
+     
+@@ -164,16 +165,18 @@ public:
+     inline DialogImport(
+         css::uno::Reference<css::uno::XComponentContext> const & xContext,
+         css::uno::Reference<css::container::XNameContainer>
+-        const & xDialogModel )
++        const & xDialogModel,
++        css::uno::Reference<css::frame::XModel> const & xDoc )
+         SAL_THROW( () )
+         : _xContext( xContext )
+         , _xDialogModel( xDialogModel )
+-        , _xDialogModelFactory( xDialogModel, css::uno::UNO_QUERY_THROW )
++        , _xDialogModelFactory( xDialogModel, css::uno::UNO_QUERY_THROW ), _xDoc( xDoc )
+         { OSL_ASSERT( _xDialogModel.is() && _xDialogModelFactory.is() &&
+                       _xContext.is() ); }
+     virtual ~DialogImport()
+         SAL_THROW( () );
+     
++    inline css::uno::Reference< css::frame::XModel > getDocOwner() { return _xDoc; }
+     // XRoot
+     virtual void SAL_CALL startDocument(
+         css::uno::Reference< css::xml::input::XNamespaceMapping >
 diff --git xmlscript/source/xmldlg_imexp/xmldlg_addfunc.cxx xmlscript/source/xmldlg_imexp/xmldlg_addfunc.cxx
 index be29402..1d7e398 100644
 --- xmlscript/source/xmldlg_imexp/xmldlg_addfunc.cxx
@@ -2153,7 +2230,7 @@
  	xml::sax::InputSource source;
  	source.aInputStream = xInput;
 diff --git xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx
-index 4a2c142..cdaa6cd 100644
+index 4a2c142..b419162 100644
 --- xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx
 +++ xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx
 @@ -33,7 +33,11 @@
@@ -2169,22 +2246,43 @@
  
  using namespace ::com::sun::star;
  using namespace ::com::sun::star::uno;
-@@ -311,7 +315,34 @@ void ElementDescriptor::readListBoxModel
+@@ -276,7 +280,7 @@ void ElementDescriptor::readComboBoxMode
+     readEvents();
+ }
+ //__________________________________________________________________________________________________
+-void ElementDescriptor::readListBoxModel( StyleBag * all_styles )
++void ElementDescriptor::readListBoxModel( StyleBag * all_styles, Reference< frame::XModel > const & xDocument  )
+     SAL_THROW( (Exception) )
+ {
+     // collect styles
+@@ -311,7 +315,56 @@ void ElementDescriptor::readListBoxModel
                     OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":linecount") ) );
      readAlignAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Align") ),
                     OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":align") ) );
--
++    Reference< lang::XMultiServiceFactory > xFac;
++    if ( xDocument.is() )
++        xFac.set( xDocument, uno::UNO_QUERY );
++
 +    Reference< form::binding::XBindableValue > xBinding( _xProps, UNO_QUERY );
-+    if ( xBinding.is() )
++
++    if ( xFac.is() && xBinding.is() )
 +    {
++         Reference< beans::XPropertySet > xConvertor( xFac->createInstance( OUSTR( "com.sun.star.table.CellAddressConversion" )), uno::UNO_QUERY );  
 +        Reference< beans::XPropertySet > xBindable( xBinding->getValueBinding(), UNO_QUERY );
 +        if ( xBindable.is() )
 +        {
-+            table::CellAddress sAddress; 
++            table::CellAddress aAddress; 
 +	    try
 +            {
-+                xBindable->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("BoundCell") ) ) >>= sAddress; 
-+                osl_trace( "*** Bindable value %d %d %d", sAddress.Row, sAddress.Column, sAddress.Sheet );
++                xBindable->getPropertyValue( OUSTR("BoundCell") ) >>= aAddress; 
++                xConvertor->setPropertyValue( OUSTR("Address"), makeAny( aAddress ) );
++                rtl::OUString sAddress;
++                xConvertor->getPropertyValue( OUSTR("PersistentRepresentation") ) >>= sAddress;
++                if ( sAddress.getLength() > 0 )
++                    addAttribute( OUSTR(XMLNS_DIALOGS_PREFIX ":linked-cell"), sAddress );
++                
++                OSL_TRACE( "*** Bindable value %s", rtl::OUStringToOString( sAddress, RTL_TEXTENCODING_UTF8 ).getStr() ); 
++               
 +            }
 +            catch( Exception& e )
 +            {
@@ -2197,16 +2295,25 @@
 +        Reference< beans::XPropertySet > xListSource( xEntrySink->getListEntrySource(), UNO_QUERY );
 +        if ( xListSource.is() )
 +        {
++            Reference< beans::XPropertySet > xConvertor( xFac->createInstance( OUSTR( "com.sun.star.table.CellRangeAddressConversion" )), uno::UNO_QUERY );  
++
 +            table::CellRangeAddress aAddress; 
-+            xListSource->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CellRange" ) ) ) >>= aAddress;
-+            osl_trace("**** cell range source list start ( %d, %d, %d ) end ( %d, %d, %d ", aAddress.StartColumn, aAddress.StartRow, aAddress.Sheet, aAddress.EndColumn, aAddress.EndRow, aAddress.Sheet );
++            xListSource->getPropertyValue( OUSTR( "CellRange" ) ) >>= aAddress;
+ 
++            rtl::OUString sAddress;
++            xConvertor->setPropertyValue( OUSTR("Address"), makeAny( aAddress ) );
++            xConvertor->getPropertyValue( OUSTR("PersistentRepresentation") ) >>= sAddress;
++            OSL_TRACE("**** cell range source list %s",
++                rtl::OUStringToOString( sAddress, RTL_TEXTENCODING_UTF8 ).getStr() ); 
++            if ( sAddress.getLength() > 0 );
++                addAttribute( OUSTR(XMLNS_DIALOGS_PREFIX ":source-cell-range"), sAddress );
 +        }
 +    }
      // string item list
      Sequence< OUString > itemValues;
      if ((readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("StringItemList") ) ) >>= itemValues) &&
 diff --git xmlscript/source/xmldlg_imexp/xmldlg_export.cxx xmlscript/source/xmldlg_imexp/xmldlg_export.cxx
-index 999f899..c99fcbe 100644
+index 999f899..0d6fb8a 100644
 --- xmlscript/source/xmldlg_imexp/xmldlg_export.cxx
 +++ xmlscript/source/xmldlg_imexp/xmldlg_export.cxx
 @@ -1309,7 +1309,8 @@ void StyleBag::dump( Reference< xml::sax
@@ -2219,8 +2326,130 @@
      SAL_THROW( (Exception) )
  {
      StyleBag all_styles;
+@@ -1394,7 +1395,7 @@ void SAL_CALL exportDialogModel(
+                     xProps, xPropState,
+                     OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":menulist") ) );
+                 xElem = static_cast< xml::sax::XAttributeList * >( pElem );
+-                pElem->readListBoxModel( &all_styles );
++                pElem->readListBoxModel( &all_styles, xDocument );
+             }
+             else if (xServiceInfo->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlGroupBoxModel") ) ) )
+             {
+diff --git xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx
+index ba05479..34d9d46 100644
+--- xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx
++++ xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx
+@@ -34,6 +34,12 @@
+ 
+ #include <com/sun/star/beans/XPropertySet.hpp>
+ #include <com/sun/star/beans/XPropertyState.hpp>
++#include <com/sun/star/form/binding/XBindableValue.hpp>
++#include <com/sun/star/form/binding/XValueBinding.hpp>
++#include <com/sun/star/form/binding/XListEntrySink.hpp>
++#include <com/sun/star/beans/NamedValue.hpp>
++#include <com/sun/star/table/CellAddress.hpp>
++#include <com/sun/star/table/CellRangeAddress.hpp>
+ 
+ 
+ using namespace ::com::sun::star;
+@@ -1638,9 +1644,24 @@ Reference< xml::input::XElement > MenuLi
+ void MenuListElement::endElement()
+ 	throw (xml::sax::SAXException, RuntimeException)
+ {
++        OUString sLinkedCell;
++        OUString sCellRange;
++        OUString sListBoxService( OUSTR("com.sun.star.awt.UnoControlListBoxModel") );
++        try
++        {
++            sLinkedCell = _xAttributes->getValueByUidName( _pImport->XMLNS_DIALOGS_UID, OUSTR( "linked-cell" ) );
++            sCellRange = _xAttributes->getValueByUidName( _pImport->XMLNS_DIALOGS_UID, OUSTR( "source-cell-range" ) );
++            // we should probably limit this to vba mode also ( leave for now )
++            if ( sLinkedCell.getLength() || sCellRange.getLength() && _pImport->getDocOwner().is() )
++                sListBoxService = OUSTR("com.sun.star.form.component.ListBox");
++        }
++        catch( Exception& /*e*/ )
++        {
++        }
+ 	ControlImportContext ctx(
+ 		_pImport, getControlId( _xAttributes ),
+-		OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlListBoxModel") ) );
++		//OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlListBoxModel") ) );
++		sListBoxService );
+ 	Reference< beans::XPropertySet > xControlModel( ctx.getControlModel() );
+ 	
+ 	Reference< xml::input::XElement > xStyle( getStyle( _xAttributes ) );
+@@ -1673,13 +1694,66 @@ void MenuListElement::endElement()
+ 	ctx.importAlignProperty( OUString( RTL_CONSTASCII_USTRINGPARAM("Align") ),
+                              OUString( RTL_CONSTASCII_USTRINGPARAM("align") ),
+                              _xAttributes );
+-	
++        // import cell-link and cell source range
++        Reference< lang::XMultiServiceFactory > xFac( _pImport->getDocOwner(), UNO_QUERY );;
++        if ( xFac.is() && sLinkedCell.getLength() &&  sCellRange.getLength() )
++        {
++            
++            // Set up Celllink
++            if ( sLinkedCell.getLength() )
++            {
++                Reference< form::binding::XBindableValue > xBindable( ctx.getControlModel(), uno::UNO_QUERY );
++
++                Reference< beans::XPropertySet > xConvertor( xFac->createInstance( OUSTR( "com.sun.star.table.CellAddressConversion" )), uno::UNO_QUERY );
++                if ( xBindable.is() && xConvertor.is() )
++                {
++                    table::CellAddress aAddress;
++                    xConvertor->setPropertyValue( OUSTR( "PersistentRepresentation" ), uno::makeAny( sLinkedCell ) );
++                    xConvertor->getPropertyValue( OUSTR( "Address" ) ) >>= aAddress;     
++                    beans::NamedValue aArg1;
++                    aArg1.Name = OUSTR("BoundCell");
++                    aArg1.Value <<= aAddress;
++           
++                    uno::Sequence< uno::Any > aArgs(1);
++                    aArgs[ 0 ]  <<= aArg1;
++           
++                    uno::Reference< form::binding::XValueBinding > xBinding( xFac->createInstanceWithArguments( OUSTR("com.sun.star.table.CellValueBinding" ), aArgs ), uno::UNO_QUERY );
++                    xBindable->setValueBinding( xBinding );
++ 
++                }
++            }
++            // Set up CelllRange
++            if ( sCellRange.getLength() )
++            {
++                Reference< form::binding::XListEntrySink  > xListEntrySink( ctx.getControlModel(), uno::UNO_QUERY );
++
++                Reference< beans::XPropertySet > xConvertor( xFac->createInstance( OUSTR( "com.sun.star.table.CellRangeAddressConversion" )), uno::UNO_QUERY );
++                if ( xListEntrySink.is() && xConvertor.is() )
++                {
++                    table::CellRangeAddress aAddress;
++                    xConvertor->setPropertyValue( OUSTR( "PersistentRepresentation" ), uno::makeAny( sCellRange ) );
++                    xConvertor->getPropertyValue( OUSTR( "Address" ) ) >>= aAddress;     
++                    beans::NamedValue aArg1;
++                    aArg1.Name = OUSTR("CellRange");
++                    aArg1.Value <<= aAddress;
++           
++                    uno::Sequence< uno::Any > aArgs(1);
++                    aArgs[ 0 ]  <<= aArg1;
++           
++                    uno::Reference< form::binding::XListEntrySource > xSource( xFac->createInstanceWithArguments( OUSTR("com.sun.star.table.CellRangeListSource" ), aArgs ), uno::UNO_QUERY );
++                    xListEntrySink->setListEntrySource( xSource );
++ 
++                }
++            }
++        }
+ 	if (_popup.is())
+ 	{
+ 		MenuPopupElement * p = static_cast< MenuPopupElement * >( _popup.get() );
+-		xControlModel->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM("StringItemList") ),
++        if (  !sCellRange.getLength() )
++		    xControlModel->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM("StringItemList") ),
+ 										 makeAny( p->getItemValues() ) );
+-		xControlModel->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM("SelectedItems") ),
++        if (  !sLinkedCell.getLength() )
++		    xControlModel->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM("SelectedItems") ),
+ 										 makeAny( p->getSelectedItems() ) );
+ 	}
+ 	ctx.importEvents( _events );
 diff --git xmlscript/source/xmldlg_imexp/xmldlg_import.cxx xmlscript/source/xmldlg_imexp/xmldlg_import.cxx
-index 74c09e6..be6db0c 100644
+index 74c09e6..092dcc0 100644
 --- xmlscript/source/xmldlg_imexp/xmldlg_import.cxx
 +++ xmlscript/source/xmldlg_imexp/xmldlg_import.cxx
 @@ -62,6 +62,7 @@
@@ -2231,7 +2460,7 @@
  using ::rtl::OUString;
  
  namespace xmlscript
-@@ -1879,7 +1880,8 @@ Reference< xml::input::XElement > Dialog
+@@ -1879,12 +1880,13 @@ Reference< xml::input::XElement > Dialog
  //==================================================================================================
  Reference< xml::sax::XDocumentHandler > SAL_CALL importDialogModel(
      Reference< container::XNameContainer > const & xDialogModel,
@@ -2241,6 +2470,12 @@
      SAL_THROW( (Exception) )
  {
      return ::xmlscript::createDocumentHandler(
+         static_cast< xml::input::XRoot * >(
+-            new DialogImport( xContext, xDialogModel ) ) );
++            new DialogImport( xContext, xDialogModel, xDocument ) ) );
+ }
+ 
+ }
 diff --git xmlscript/source/xmllib_imexp/imp_share.hxx xmlscript/source/xmllib_imexp/imp_share.hxx
 index d602103..fdc0536 100644
 --- xmlscript/source/xmllib_imexp/imp_share.hxx



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