diff options
Diffstat (limited to 'patches/vba/vba-spinbutton-in-userform.diff')
-rw-r--r-- | patches/vba/vba-spinbutton-in-userform.diff | 344 |
1 files changed, 0 insertions, 344 deletions
diff --git a/patches/vba/vba-spinbutton-in-userform.diff b/patches/vba/vba-spinbutton-in-userform.diff deleted file mode 100644 index f79a42900..000000000 --- a/patches/vba/vba-spinbutton-in-userform.diff +++ /dev/null @@ -1,344 +0,0 @@ ---- svx/inc/svx/msocximex.hxx.orig 2008-09-10 13:54:24.000000000 +0800 -+++ svx/inc/svx/msocximex.hxx 2008-09-11 13:27:15.000000000 +0800 -@@ -292,6 +292,8 @@ public: - UniString msToolTip; - UniString msParentName; - OCX_FontData aFontData; -+ rtl::OUString msCtrlSource; -+ rtl::OUString msRowSource; - SfxObjectShell *pDocSh; - protected: - -@@ -405,8 +407,6 @@ public: - sal_uInt32 nGroupNameLen; - sal_uInt32 nUnknown10; - -- rtl::OUString msCtrlSource; -- rtl::OUString msRowSource; - char *pValue; - char *pCaption; - char *pGroupName; ---- svx/source/msfilter/msocximex.cxx.orig 2008-09-10 13:54:24.000000000 +0800 -+++ svx/source/msfilter/msocximex.cxx 2008-09-11 13:30:06.000000000 +0800 -@@ -3669,8 +3669,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 ); -@@ -3694,13 +3693,11 @@ void OCX_ContainerControl::ProcessContro - case LISTBOX: - case OPTIONBUTTON: - case COMBOBOX: -+ case SPINBUTTON: -+ case SCROLLBAR: - { -- OCX_ModernControl* pList = static_cast< OCX_ModernControl* >( pControl ); -- if ( pList ) -- { -- pList->msCtrlSource = rec.sCtrlSource; -- pList->msRowSource = rec.sRowSource; -- } -+ pControl->msCtrlSource = rec.sCtrlSource; -+ pControl->msRowSource = rec.sRowSource; - } - } - pControl->sName = rec.cName; -@@ -5566,7 +5563,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; - } -@@ -5689,6 +5686,9 @@ 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 ); -+ lcl_ApplyListSourceAndBindableStuff( xModel, rPropSet, msCtrlSource, msRowSource ); -+ - return sal_True; - } - -@@ -5856,7 +5856,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"); - - } - -@@ -5922,6 +5922,9 @@ 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 ); -+ lcl_ApplyListSourceAndBindableStuff( xModel, rPropSet, msCtrlSource, msRowSource ); -+ - return sal_True; - } - ---- xmlscript/source/xmldlg_imexp/exp_share.hxx.orig 2008-09-10 13:54:25.000000000 +0800 -+++ xmlscript/source/xmldlg_imexp/exp_share.hxx 2008-09-10 13:54:35.000000000 +0800 -@@ -212,7 +212,9 @@ public: - SAL_THROW( (css::uno::Exception) ); - void readProgressBarModel( StyleBag * all_styles ) - SAL_THROW( (css::uno::Exception) ); -- 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-10 13:54:25.000000000 +0800 -+++ xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx 2008-09-10 13:54:35.000000000 +0800 -@@ -1164,7 +1164,7 @@ void ElementDescriptor::readProgressBarM - readEvents(); - } - //__________________________________________________________________________________________________ --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 -+ 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") ) ); -+ // Cell Range, Ref Cell etc. -+ lclExportBindableAndListSourceBits( xDocument, _xProps, *this ); - readEvents(); - } - //__________________________________________________________________________________________________ ---- xmlscript/source/xmldlg_imexp/xmldlg_export.cxx.orig 2008-09-10 13:54:25.000000000 +0800 -+++ xmlscript/source/xmldlg_imexp/xmldlg_export.cxx 2008-09-10 13:54: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, 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, xDocument ); - } - else if (xServiceInfo->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlProgressBarModel") ) ) ) - { ---- xmlscript/source/xmldlg_imexp/imp_share.hxx.orig 2008-09-10 13:54:25.000000000 +0800 -+++ xmlscript/source/xmldlg_imexp/imp_share.hxx 2008-09-10 13:54:35.000000000 +0800 -@@ -1006,6 +1006,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-10 13:54:25.000000000 +0800 -+++ xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx 2008-09-10 13:54:35.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( -+ 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) -+{ -+ 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.form.component.SpinButton") ) ); -+ -+ 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 ); -+ // 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) -@@ -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") ) && isVBACompatModeOn( _pImport ) ) -+ { -+ return new SpinButtonElement( rLocalName, xAttributes, this, _pImport ); -+ } - // progressmeter - else if (rLocalName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("progressmeter") )) - { |