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



Author: pflin
Date: Tue Sep  2 07:10:54 2008
New Revision: 13754
URL: http://svn.gnome.org/viewvc/ooo-build?rev=13754&view=rev

Log:
2008-09-02  Fong Lin  <pflin novell com>
	* patches/vba/vba-spinbutton-in-userform.diff:
	* patches/dev300/apply: support spinbutton in userform.



Added:
   trunk/patches/vba/vba-spinbutton-in-userform.diff
Modified:
   trunk/ChangeLog
   trunk/patches/dev300/apply

Modified: trunk/patches/dev300/apply
==============================================================================
--- trunk/patches/dev300/apply	(original)
+++ trunk/patches/dev300/apply	Tue Sep  2 07:10:54 2008
@@ -1566,6 +1566,8 @@
 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
 
 vbaevents-services-sources.diff, i#68893
 

Added: trunk/patches/vba/vba-spinbutton-in-userform.diff
==============================================================================
--- (empty file)
+++ trunk/patches/vba/vba-spinbutton-in-userform.diff	Tue Sep  2 07:10:54 2008
@@ -0,0 +1,208 @@
+--- 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
+@@ -3660,8 +3660,7 @@ void OCX_ContainerControl::ProcessContro
+     SotStorageStreamRef oStream = mContainedControlsStream;
+ 
+     // can insert into OO Dialog (e.g is this a supported dialog control)??
+-    if ( rec.nTypeIdent == SPINBUTTON ||
+-        rec.nTypeIdent == TABSTRIP)
++    if ( rec.nTypeIdent == TABSTRIP )
+     {
+         // 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:
+         SAL_THROW( (css::uno::Exception) );
+     void readScrollBarModel( StyleBag * all_styles )
+         SAL_THROW( (css::uno::Exception) );
++    void readSpinButtonModel( StyleBag * all_styles )
++        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
+     readEvents();
+ }
+ //__________________________________________________________________________________________________
++void ElementDescriptor::readSpinButtonModel( StyleBag * all_styles )
++    SAL_THROW( (Exception) )
++{
++    // collect styles
++    Style aStyle( 0x1 | 0x4 );
++    if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("BackgroundColor") ) ) >>= aStyle._backgroundColor)
++        aStyle._set |= 0x1;
++    if (readBorderProps( this, aStyle ))
++        aStyle._set |= 0x4;
++    if (aStyle._set)
++    {
++        addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":style-id") ),
++                      all_styles->getStyleId( aStyle ) );
++    }
++    
++    // collect elements
++    readDefaults();
++    readOrientationAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Orientation") ),
++                         OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":align") ) );  
++    readLongAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("SpinIncrement") ),
++                  OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":increment") ) );
++    readLongAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("SpinValue") ),
++                  OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":curval") ) );
++    readLongAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("SpinValueMax") ),
++                  OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":maxval") ) );
++    readLongAttr( OUSTR("SpinValueMin"),
++                  OUSTR(XMLNS_DIALOGS_PREFIX ":minval") );
++    readLongAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Repeat") ),
++                  OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":repeat") ) );
++    readLongAttr( OUSTR("RepeatDelay"), OUSTR(XMLNS_DIALOGS_PREFIX ":repeat-delay") );
++    readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Tabstop") ),
++                  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(
+                 xElem = static_cast< xml::sax::XAttributeList * >( pElem );
+                 pElem->readScrollBarModel( &all_styles );
+             }
++            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 );
++            }
+             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:
+ };
+ 
+ //==============================================================================
++class SpinButtonElement
++    : public ControlElement
++{
++public:
++    virtual css::uno::Reference< css::xml::input::XElement >
++    SAL_CALL startChildElement(
++        sal_Int32 nUid, ::rtl::OUString const & rLocalName,
++        css::uno::Reference<css::xml::input::XAttributes> const & xAttributes )
++        throw (css::xml::sax::SAXException, css::uno::RuntimeException);
++    virtual void SAL_CALL endElement()
++        throw (css::xml::sax::SAXException, css::uno::RuntimeException);
++    
++    inline SpinButtonElement(
++        ::rtl::OUString const & rLocalName,
++        css::uno::Reference< css::xml::input::XAttributes > const & xAttributes,
++        ElementBase * pParent, DialogImport * pImport )
++        SAL_THROW( () )
++        : ControlElement( rLocalName, xAttributes, pParent, pImport )
++        {}
++};
++
++//==============================================================================
+ 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()
+ 
+ //##################################################################################################
+ 
++// spinbutton
++//__________________________________________________________________________________________________
++Reference< xml::input::XElement > SpinButtonElement::startChildElement(
++	sal_Int32 nUid, OUString const & rLocalName,
++	Reference< xml::input::XAttributes > const & xAttributes )
++	throw (xml::sax::SAXException, RuntimeException)
++{
++	// event
++    if (_pImport->isEventElement( nUid, rLocalName ))
++	{
++		return new EventElement( nUid, rLocalName, xAttributes, this, _pImport );
++	}
++	else
++	{
++		throw xml::sax::SAXException(
++			OUString( RTL_CONSTASCII_USTRINGPARAM("expected event element!") ),
++			Reference< XInterface >(), Any() );
++	}
++}
++//__________________________________________________________________________________________________
++void SpinButtonElement::endElement()
++	throw (xml::sax::SAXException, RuntimeException)
++{
++	ControlImportContext ctx(
++		_pImport, getControlId( _xAttributes ),
++		OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlSpinButtonModel") ) );
++	
++	Reference< xml::input::XElement > xStyle( getStyle( _xAttributes ) );
++	if (xStyle.is())
++	{
++		StyleElement * pStyle = static_cast< StyleElement * >( xStyle.get () );
++		Reference< beans::XPropertySet > xControlModel( ctx.getControlModel() );
++        pStyle->importBackgroundColorStyle( xControlModel );
++		pStyle->importBorderStyle( xControlModel );
++	}
++	
++	ctx.importDefaults( _nBasePosX, _nBasePosY, _xAttributes );
++	ctx.importOrientationProperty( OUString( RTL_CONSTASCII_USTRINGPARAM("Orientation") ),
++                                   OUString( RTL_CONSTASCII_USTRINGPARAM("align") ),
++                                   _xAttributes );
++	ctx.importLongProperty( OUString( RTL_CONSTASCII_USTRINGPARAM("SpinIncrement") ),
++                            OUString( RTL_CONSTASCII_USTRINGPARAM("increment") ),
++                            _xAttributes );
++	ctx.importLongProperty( OUString( RTL_CONSTASCII_USTRINGPARAM("SpinValue") ),
++                            OUString( RTL_CONSTASCII_USTRINGPARAM("curval") ),
++                            _xAttributes );
++	ctx.importLongProperty( OUString( RTL_CONSTASCII_USTRINGPARAM("SpinValueMax") ),
++                            OUString( RTL_CONSTASCII_USTRINGPARAM("maxval") ),
++                            _xAttributes );
++	ctx.importLongProperty( OUSTR("SpinValueMin"), OUSTR("minval"),
++                            _xAttributes );
++	ctx.importLongProperty( OUSTR("Repeat"), OUSTR("repeat"),
++                            _xAttributes );
++	ctx.importLongProperty( OUSTR("RepeatDelay"), OUSTR("repeat-delay"),
++                            _xAttributes );
++    ctx.importBooleanProperty( OUString( RTL_CONSTASCII_USTRINGPARAM("Tabstop") ),
++                               OUString( RTL_CONSTASCII_USTRINGPARAM("tabstop") ),
++                               _xAttributes );
++    ctx.importHexLongProperty( OUString( RTL_CONSTASCII_USTRINGPARAM("SymbolColor") ),
++                               OUString( RTL_CONSTASCII_USTRINGPARAM("symbol-color") ),
++                               _xAttributes );
++    
++	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
+ 	{
+ 		return new ScrollBarElement( rLocalName, xAttributes, this, _pImport );
+ 	}
++	// spinbutton
++	else if (rLocalName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("spinbutton") ))
++	{
++		return new SpinButtonElement( rLocalName, xAttributes, this, _pImport );
++	}
+ 	// progressmeter
+ 	else if (rLocalName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("progressmeter") ))
+ 	{



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