From facd86ef9cdac2f0acab13a8b525f0bfb99cac28 Mon Sep 17 00:00:00 2001 From: Petr Mladek Date: Mon, 4 Oct 2010 16:59:40 +0200 Subject: remove include guards using fixguard.py --- xmlscript/source/misc/unoservices.cxx | 2 -- 1 file changed, 2 deletions(-) (limited to 'xmlscript') diff --git a/xmlscript/source/misc/unoservices.cxx b/xmlscript/source/misc/unoservices.cxx index b95665eef01e..932bb9f2a6ef 100644 --- a/xmlscript/source/misc/unoservices.cxx +++ b/xmlscript/source/misc/unoservices.cxx @@ -28,9 +28,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_xmlscript.hxx" -#ifndef _CPPUHELPER_IMPLEMENTATIONENTRY_HXX_ #include -#endif using namespace ::rtl; using namespace ::com::sun::star::uno; -- cgit From d890da89f4d27f7acfb181a5a547a95ad823efb0 Mon Sep 17 00:00:00 2001 From: Petr Mladek Date: Tue, 5 Oct 2010 15:55:12 +0200 Subject: more removed include guards using fixguard.py --- xmlscript/inc/xmlscript/xmldlg_imexp.hxx | 8 -------- xmlscript/source/xmlflat_imexp/xmlbas_import.hxx | 2 -- 2 files changed, 10 deletions(-) (limited to 'xmlscript') diff --git a/xmlscript/inc/xmlscript/xmldlg_imexp.hxx b/xmlscript/inc/xmlscript/xmldlg_imexp.hxx index fca73bc0144a..bde03d51ad89 100644 --- a/xmlscript/inc/xmlscript/xmldlg_imexp.hxx +++ b/xmlscript/inc/xmlscript/xmldlg_imexp.hxx @@ -27,18 +27,10 @@ #ifndef _XMLSCRIPT_XMLDLG_IMEXP_HXX_ #define _XMLSCRIPT_XMLDLG_IMEXP_HXX_ -#ifndef _COM_SUN_STAR_CONTAINER_XNAMECONTAINER_HXX_ #include -#endif -#ifndef _COM_SUN_STAR_IO_XINPUTSTREAMPROVIDER_HXX_ #include -#endif -#ifndef _COM_SUN_STAR_XML_SAX_XEXTENDEDDOCUMENTHANDLER_HXX_ #include -#endif -#ifndef _COM_SUN_STAR_UNO_XCOMPONENTCONTEXT_HXX_ #include -#endif #include "xmlscript/xmlns.h" diff --git a/xmlscript/source/xmlflat_imexp/xmlbas_import.hxx b/xmlscript/source/xmlflat_imexp/xmlbas_import.hxx index 6c11b197722a..b383649a4eac 100644 --- a/xmlscript/source/xmlflat_imexp/xmlbas_import.hxx +++ b/xmlscript/source/xmlflat_imexp/xmlbas_import.hxx @@ -32,9 +32,7 @@ #include #include #include -#ifndef _COM_SUN_STAR_SCRIPT_XLIBRYARYCONTAINER2_HPP_ #include -#endif #include #include #include -- cgit From 0b21b8b146fc4b982c7c9bbb866b9ff18a29332a Mon Sep 17 00:00:00 2001 From: Noel Power Date: Wed, 6 Oct 2010 10:16:27 +0100 Subject: initial commit for vba blob ( not including container_control stuff ) --- xmlscript/inc/xmlscript/xmldlg_imexp.hxx | 18 +- xmlscript/source/xmldlg_imexp/exp_share.hxx | 14 +- xmlscript/source/xmldlg_imexp/imp_share.hxx | 54 ++- xmlscript/source/xmldlg_imexp/xmldlg_addfunc.cxx | 11 +- xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx | 191 +++++++++- xmlscript/source/xmldlg_imexp/xmldlg_export.cxx | 29 +- xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx | 418 ++++++++++++++++++++- xmlscript/source/xmldlg_imexp/xmldlg_import.cxx | 34 +- xmlscript/util/makefile.mk | 1 + 9 files changed, 722 insertions(+), 48 deletions(-) (limited to 'xmlscript') diff --git a/xmlscript/inc/xmlscript/xmldlg_imexp.hxx b/xmlscript/inc/xmlscript/xmldlg_imexp.hxx index fca73bc0144a..2e1654adb1b1 100644 --- a/xmlscript/inc/xmlscript/xmldlg_imexp.hxx +++ b/xmlscript/inc/xmlscript/xmldlg_imexp.hxx @@ -27,6 +27,8 @@ #ifndef _XMLSCRIPT_XMLDLG_IMEXP_HXX_ #define _XMLSCRIPT_XMLDLG_IMEXP_HXX_ +#include + #ifndef _COM_SUN_STAR_CONTAINER_XNAMECONTAINER_HXX_ #include #endif @@ -51,7 +53,9 @@ void SAL_CALL exportDialogModel( ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XExtendedDocumentHandler > const & xOut, ::com::sun::star::uno::Reference< - ::com::sun::star::container::XNameContainer > const & xDialogModel ) + ::com::sun::star::container::XNameContainer > const & xDialogModel, + ::com::sun::star::uno::Reference< + ::com::sun::star::frame::XModel > const & xDocument ) SAL_THROW( (::com::sun::star::uno::Exception) ); //============================================================================== @@ -60,7 +64,9 @@ SAL_CALL importDialogModel( ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > const & xDialogModel, ::com::sun::star::uno::Reference< - ::com::sun::star::uno::XComponentContext > const & xContext ) + ::com::sun::star::uno::XComponentContext > const & xContext, + ::com::sun::star::uno::Reference< + ::com::sun::star::frame::XModel > const & xDocument ) SAL_THROW( (::com::sun::star::uno::Exception) ); // additional functions for convenience @@ -71,7 +77,9 @@ SAL_CALL exportDialogModel( ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > const & xDialogModel, ::com::sun::star::uno::Reference< - ::com::sun::star::uno::XComponentContext > const & xContext ) + ::com::sun::star::uno::XComponentContext > const & xContext, + ::com::sun::star::uno::Reference< + ::com::sun::star::frame::XModel > const & xDocument ) SAL_THROW( (::com::sun::star::uno::Exception) ); //============================================================================== @@ -81,7 +89,9 @@ void SAL_CALL importDialogModel( ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > const & xDialogModel, ::com::sun::star::uno::Reference< - ::com::sun::star::uno::XComponentContext > const & xContext ) + ::com::sun::star::uno::XComponentContext > const & xContext, + ::com::sun::star::uno::Reference< + ::com::sun::star::frame::XModel > const & xDocument ) SAL_THROW( (::com::sun::star::uno::Exception) ); } diff --git a/xmlscript/source/xmldlg_imexp/exp_share.hxx b/xmlscript/source/xmldlg_imexp/exp_share.hxx index a53d02393ae6..f96186448ea4 100644 --- a/xmlscript/source/xmldlg_imexp/exp_share.hxx +++ b/xmlscript/source/xmldlg_imexp/exp_share.hxx @@ -171,15 +171,17 @@ public: // void readDialogModel( StyleBag * all_styles ) SAL_THROW( (css::uno::Exception) ); + void readMultiPageModel( StyleBag * all_styles ) + SAL_THROW( (css::uno::Exception) ); void readButtonModel( StyleBag * all_styles ) SAL_THROW( (css::uno::Exception) ); void readEditModel( StyleBag * all_styles ) SAL_THROW( (css::uno::Exception) ); void readCheckBoxModel( StyleBag * all_styles ) SAL_THROW( (css::uno::Exception) ); - void readRadioButtonModel( StyleBag * all_styles ) + void readRadioButtonModel( StyleBag * all_styles, com::sun::star::uno::Reference< com::sun::star::frame::XModel > const & xDocument ) SAL_THROW( (css::uno::Exception) ); - void readComboBoxModel( StyleBag * all_styles ) + void readComboBoxModel( StyleBag * all_styles, com::sun::star::uno::Reference< com::sun::star::frame::XModel > const & xDocument ) SAL_THROW( (css::uno::Exception) ); void readCurrencyFieldModel( StyleBag * all_styles ) SAL_THROW( (css::uno::Exception) ); @@ -193,9 +195,9 @@ public: SAL_THROW( (css::uno::Exception) ); void readGroupBoxModel( StyleBag * all_styles ) SAL_THROW( (css::uno::Exception) ); - void readImageControlModel( StyleBag * all_styles ) + void readImageControlModel( StyleBag * all_styles, com::sun::star::uno::Reference< com::sun::star::frame::XModel > const & xDocument ) 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) ); @@ -209,7 +211,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) ); diff --git a/xmlscript/source/xmldlg_imexp/imp_share.hxx b/xmlscript/source/xmldlg_imexp/imp_share.hxx index 29966392e7a5..a13a205a7bf7 100644 --- a/xmlscript/source/xmldlg_imexp/imp_share.hxx +++ b/xmlscript/source/xmldlg_imexp/imp_share.hxx @@ -42,6 +42,7 @@ #include #include #include +#include #include @@ -128,6 +129,8 @@ 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; @@ -161,16 +164,20 @@ public: inline DialogImport( css::uno::Reference const & xContext, css::uno::Reference - const & xDialogModel ) + const & xDialogModel, + css::uno::Reference 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; } + + css::uno::Reference< css::script::XLibraryContainer > getScriptLibraryContainer(); // XRoot virtual void SAL_CALL startDocument( css::uno::Reference< css::xml::input::XNamespaceMapping > @@ -996,6 +1003,49 @@ 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 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 MultiPage + : public ControlElement +{ +public: + virtual css::uno::Reference< css::xml::input::XElement > + SAL_CALL startChildElement( + sal_Int32 nUid, ::rtl::OUString const & rLocalName, + css::uno::Reference const & xAttributes ) + throw (css::xml::sax::SAXException, css::uno::RuntimeException); + virtual void SAL_CALL endElement() + throw (css::xml::sax::SAXException, css::uno::RuntimeException); + + inline MultiPage( + ::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 { diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_addfunc.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_addfunc.cxx index 22c472ac1782..5e9937f061b0 100644 --- a/xmlscript/source/xmldlg_imexp/xmldlg_addfunc.cxx +++ b/xmlscript/source/xmldlg_imexp/xmldlg_addfunc.cxx @@ -41,6 +41,7 @@ using namespace ::rtl; using namespace ::com::sun::star; using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::frame; namespace xmlscript { @@ -70,7 +71,8 @@ Reference< io::XInputStream > InputStreamProvider::createInputStream() //================================================================================================== Reference< io::XInputStreamProvider > SAL_CALL exportDialogModel( Reference< container::XNameContainer > const & xDialogModel, - Reference< XComponentContext > const & xContext ) + Reference< XComponentContext > const & xContext, + Reference< XModel > const & xDocument ) SAL_THROW( (Exception) ) { Reference< lang::XMultiComponentFactory > xSMgr( xContext->getServiceManager() ); @@ -95,7 +97,7 @@ Reference< io::XInputStreamProvider > SAL_CALL exportDialogModel( Reference< io::XActiveDataSource > xSource( xHandler, UNO_QUERY ); xSource->setOutputStream( createOutputStream( &aBytes ) ); - exportDialogModel( xHandler, xDialogModel ); + exportDialogModel( xHandler, xDialogModel, xDocument ); return new InputStreamProvider( aBytes ); } @@ -104,7 +106,8 @@ Reference< io::XInputStreamProvider > SAL_CALL exportDialogModel( void SAL_CALL importDialogModel( Reference< io::XInputStream > xInput, Reference< container::XNameContainer > const & xDialogModel, - Reference< XComponentContext > const & xContext ) + Reference< XComponentContext > const & xContext, + Reference< XModel > const & xDocument ) SAL_THROW( (Exception) ) { Reference< lang::XMultiComponentFactory > xSMgr( xContext->getServiceManager() ); @@ -126,7 +129,7 @@ void SAL_CALL importDialogModel( } // error handler, entity resolver omitted for this helper function - xParser->setDocumentHandler( importDialogModel( xDialogModel, xContext ) ); + xParser->setDocumentHandler( importDialogModel( xDialogModel, xContext, xDocument ) ); xml::sax::InputSource source; source.aInputStream = xInput; diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx index 1d9e67d23d28..3cd7ff985eef 100644 --- a/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx +++ b/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx @@ -29,7 +29,16 @@ #include "precompiled_xmlscript.hxx" #include "exp_share.hxx" +#include +#include +#include +#include +#include #include +#include +#include +#include +#include using namespace ::com::sun::star; @@ -39,6 +48,66 @@ using ::rtl::OUString; namespace xmlscript { +void lclExportBindableAndListSourceBits( Reference< frame::XModel > const & xDocument, const Reference< beans::XPropertySet >& _xProps, ElementDescriptor& rModel ) +{ + Reference< lang::XMultiServiceFactory > xFac; + if ( xDocument.is() ) + xFac.set( xDocument, uno::UNO_QUERY ); + + Reference< form::binding::XBindableValue > xBinding( _xProps, UNO_QUERY ); + + if ( xFac.is() && xBinding.is() ) + { + try + { + 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 aAddress; + xBindable->getPropertyValue( OUSTR("BoundCell") ) >>= aAddress; + xConvertor->setPropertyValue( OUSTR("Address"), makeAny( aAddress ) ); + rtl::OUString sAddress; + xConvertor->getPropertyValue( OUSTR("PersistentRepresentation") ) >>= sAddress; + if ( sAddress.getLength() > 0 ) + rModel.addAttribute( OUSTR(XMLNS_DIALOGS_PREFIX ":linked-cell"), sAddress ); + + OSL_TRACE( "*** Bindable value %s", rtl::OUStringToOString( sAddress, RTL_TEXTENCODING_UTF8 ).getStr() ); + + } + } + catch( uno::Exception& ) + { + } + } + Reference< form::binding::XListEntrySink > xEntrySink( _xProps, UNO_QUERY ); + if ( xEntrySink.is() ) + { + Reference< beans::XPropertySet > xListSource( xEntrySink->getListEntrySource(), UNO_QUERY ); + if ( xListSource.is() ) + { + try + { + Reference< beans::XPropertySet > xConvertor( xFac->createInstance( OUSTR( "com.sun.star.table.CellRangeAddressConversion" )), uno::UNO_QUERY ); + + table::CellRangeAddress aAddress; + 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 ); + rModel.addAttribute( OUSTR(XMLNS_DIALOGS_PREFIX ":source-cell-range"), sAddress ); + } + catch( uno::Exception& ) + { + } + } + } + +} static inline bool readBorderProps( ElementDescriptor * element, Style & style ) { @@ -65,6 +134,42 @@ static inline bool readFontProps( ElementDescriptor * element, Style & style ) } //__________________________________________________________________________________________________ +void ElementDescriptor::readMultiPageModel( StyleBag * all_styles ) +{ + // collect styles + Style aStyle( 0x2 | 0x8 | 0x20 ); + if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextColor") ) ) >>= aStyle._textColor) + aStyle._set |= 0x2; + if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextLineColor") ) ) >>= aStyle._textLineColor) + aStyle._set |= 0x20; + if (readFontProps( this, aStyle )) + aStyle._set |= 0x8; + if (aStyle._set) + { + addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":style-id") ), + all_styles->getStyleId( aStyle ) ); + } + + // collect elements + readDefaults(); + readLongAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ProgressValue") ), + OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":value") ) ); + readLongAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ProgressValueMax") ), + OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":value-max") ) ); + + OUString aTitle; + if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("Label") ) ) >>= aTitle) + { + ElementDescriptor * title = new ElementDescriptor( + _xProps, _xPropState, + OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":title") ) ); + title->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":value") ), + aTitle ); + addSubElement( title ); + } + + readEvents(); +} void ElementDescriptor::readButtonModel( StyleBag * all_styles ) SAL_THROW( (Exception) ) { @@ -206,7 +311,7 @@ void ElementDescriptor::readCheckBoxModel( StyleBag * all_styles ) readEvents(); } //__________________________________________________________________________________________________ -void ElementDescriptor::readComboBoxModel( StyleBag * all_styles ) +void ElementDescriptor::readComboBoxModel( StyleBag * all_styles, Reference< frame::XModel > const & xDocument ) SAL_THROW( (Exception) ) { // collect styles @@ -247,7 +352,8 @@ void ElementDescriptor::readComboBoxModel( StyleBag * all_styles ) OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":maxlength") ) ); readShortAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("LineCount") ), OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":linecount") ) ); - + // Cell Range, Ref Cell etc. + lclExportBindableAndListSourceBits( xDocument, _xProps, *this ); // string item list Sequence< OUString > itemValues; if ((readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("StringItemList") ) ) >>= itemValues) && @@ -273,7 +379,7 @@ void ElementDescriptor::readComboBoxModel( StyleBag * all_styles ) readEvents(); } //__________________________________________________________________________________________________ -void ElementDescriptor::readListBoxModel( StyleBag * all_styles ) +void ElementDescriptor::readListBoxModel( StyleBag * all_styles, Reference< frame::XModel > const & xDocument ) SAL_THROW( (Exception) ) { // collect styles @@ -308,7 +414,7 @@ void ElementDescriptor::readListBoxModel( StyleBag * all_styles ) OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":linecount") ) ); readAlignAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Align") ), OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":align") ) ); - + lclExportBindableAndListSourceBits( xDocument, _xProps, *this ); // string item list Sequence< OUString > itemValues; if ((readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("StringItemList") ) ) >>= itemValues) && @@ -348,7 +454,7 @@ void ElementDescriptor::readListBoxModel( StyleBag * all_styles ) readEvents(); } //__________________________________________________________________________________________________ -void ElementDescriptor::readRadioButtonModel( StyleBag * all_styles ) +void ElementDescriptor::readRadioButtonModel( StyleBag * all_styles, Reference< frame::XModel > const & xDocument ) SAL_THROW( (Exception) ) { // collect styles @@ -385,6 +491,8 @@ void ElementDescriptor::readRadioButtonModel( StyleBag * all_styles ) OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":image-position") ) ); readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("MultiLine") ), OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":multiline") ) ); + readStringAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("GroupName") ), + OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":group-name") ) ); sal_Int16 nState = 0; if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("State") ) ) >>= nState) @@ -404,6 +512,7 @@ void ElementDescriptor::readRadioButtonModel( StyleBag * all_styles ) break; } } + lclExportBindableAndListSourceBits( xDocument, _xProps, *this ); readEvents(); } //__________________________________________________________________________________________________ @@ -576,7 +685,7 @@ void ElementDescriptor::readEditModel( StyleBag * all_styles ) readEvents(); } //__________________________________________________________________________________________________ -void ElementDescriptor::readImageControlModel( StyleBag * all_styles ) +void ElementDescriptor::readImageControlModel( StyleBag * all_styles, com::sun::star::uno::Reference< com::sun::star::frame::XModel > const & xDocument ) SAL_THROW( (Exception) ) { // collect styles @@ -595,8 +704,31 @@ void ElementDescriptor::readImageControlModel( StyleBag * all_styles ) readDefaults(); readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ScaleImage") ), OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":scale-image") ) ); - readStringAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ImageURL") ), - OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":src") ) ); + rtl::OUString sURL; + _xProps->getPropertyValue( OUSTR("ImageURL") ) >>= sURL; + + if ( sURL.indexOf( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "vnd.sun.star.GraphicObject:" ) ) ) == 0 ) + { + Reference< document::XStorageBasedDocument > xDocStorage( xDocument, UNO_QUERY ); + + if ( xDocStorage.is() ) + { + uno::Sequence< Any > aArgs( 1 ); + aArgs[ 0 ] <<= xDocStorage->getDocumentStorage(); + + ::comphelper::ComponentContext aContext( ::comphelper::getProcessServiceFactory() ); + uno::Reference< document::XGraphicObjectResolver > xGraphicResolver; + aContext.createComponentWithArguments( OUSTR( "com.sun.star.comp.Svx.GraphicExportHelper" ), aArgs, xGraphicResolver ); + if ( xGraphicResolver.is() ) + { + sURL = xGraphicResolver->resolveGraphicObjectURL( sURL ); + } + } + } + if ( sURL.getLength() > 0 ) + { + addAttribute( OUSTR(XMLNS_DIALOGS_PREFIX ":src"), sURL ); + } readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Tabstop") ), OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":tabstop") ) ); readEvents(); @@ -1073,7 +1205,7 @@ void ElementDescriptor::readProgressBarModel( StyleBag * all_styles ) readEvents(); } //__________________________________________________________________________________________________ -void ElementDescriptor::readScrollBarModel( StyleBag * all_styles ) +void ElementDescriptor::readScrollBarModel( StyleBag * all_styles, Reference< frame::XModel > const & xDocument ) SAL_THROW( (Exception) ) { // collect styles @@ -1111,6 +1243,47 @@ void ElementDescriptor::readScrollBarModel( StyleBag * all_styles ) 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(); } //__________________________________________________________________________________________________ diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx index 365355375808..be4643f35222 100644 --- a/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx +++ b/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx @@ -1325,7 +1325,8 @@ void StyleBag::dump( Reference< xml::sax::XExtendedDocumentHandler > const & xOu //================================================================================================== void SAL_CALL exportDialogModel( Reference< xml::sax::XExtendedDocumentHandler > const & xOut, - Reference< container::XNameContainer > const & xDialogModel ) + Reference< container::XNameContainer > const & xDialogModel, + Reference< frame::XModel > const & xDocument ) SAL_THROW( (Exception) ) { StyleBag all_styles; @@ -1373,7 +1374,7 @@ void SAL_CALL exportDialogModel( xProps, xPropState, OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":radio") ) ); xElem = static_cast< xml::sax::XAttributeList * >( pElem ); - pElem->readRadioButtonModel( &all_styles ); + pElem->readRadioButtonModel( &all_styles, xDocument ); pRadioGroup->addSubElement( xElem ); } else // no radio @@ -1402,7 +1403,7 @@ void SAL_CALL exportDialogModel( xProps, xPropState, OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":combobox") ) ); xElem = static_cast< xml::sax::XAttributeList * >( pElem ); - pElem->readComboBoxModel( &all_styles ); + pElem->readComboBoxModel( &all_styles, xDocument ); } else if (xServiceInfo->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlListBoxModel") ) ) ) { @@ -1410,7 +1411,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") ) ) ) { @@ -1420,6 +1421,14 @@ void SAL_CALL exportDialogModel( xElem = static_cast< xml::sax::XAttributeList * >( pElem ); pElem->readGroupBoxModel( &all_styles ); } + else if (xServiceInfo->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoMultiPageModel") ) ) ) + { + pElem = new ElementDescriptor( + xProps, xPropState, + OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":multipage") ) ); + xElem = static_cast< xml::sax::XAttributeList * >( pElem ); + pElem->readMultiPageModel( &all_styles ); + } else if (xServiceInfo->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlFixedTextModel") ) ) ) { pElem = new ElementDescriptor( @@ -1451,7 +1460,7 @@ void SAL_CALL exportDialogModel( xProps, xPropState, OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":img") ) ); xElem = static_cast< xml::sax::XAttributeList * >( pElem ); - pElem->readImageControlModel( &all_styles ); + pElem->readImageControlModel( &all_styles, xDocument ); } else if (xServiceInfo->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlFileControlModel") ) ) ) { @@ -1531,7 +1540,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") ) ) ) { diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx index a0968eb007d5..420adb39787d 100644 --- a/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx +++ b/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx @@ -28,17 +28,195 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_xmlscript.hxx" #include "imp_share.hxx" - +#include +#include +#include +#include +#include +#include #include #include +#include +#include +#include - +#include +#include using namespace ::com::sun::star; using namespace ::com::sun::star::uno; using ::rtl::OUString; namespace xmlscript { +Reference< xml::input::XElement > MultiPage::startChildElement( + sal_Int32 nUid, OUString const & rLocalName, + Reference< xml::input::XAttributes > const & xAttributes ) + throw (xml::sax::SAXException, RuntimeException) +{ + // event +rtl::OUString _label = rtl::OUString::createFromAscii("foo"); + if (_pImport->isEventElement( nUid, rLocalName )) + { + return new EventElement( + nUid, rLocalName, xAttributes, this, _pImport ); + } + else if (rLocalName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("title") )) + { + getStringAttr( &_label, + OUString( RTL_CONSTASCII_USTRINGPARAM("value") ), + xAttributes, + _pImport->XMLNS_DIALOGS_UID ); + + return new ElementBase( + _pImport->XMLNS_DIALOGS_UID, + rLocalName, xAttributes, this, _pImport ); + } + else + { + + throw xml::sax::SAXException( + OUString( RTL_CONSTASCII_USTRINGPARAM("expected event element!") ), + Reference< XInterface >(), Any() ); + } +} +//__________________________________________________________________________________________________ + +void MultiPage::endElement() + throw (xml::sax::SAXException, RuntimeException) +{ + ControlImportContext ctx( + _pImport, getControlId( _xAttributes ), + OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoMultiPageModel") ) ); +// OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlGroupBoxModel") ) ); + Reference< beans::XPropertySet > xControlModel( ctx.getControlModel() ); + + Reference< xml::input::XElement > xStyle( getStyle( _xAttributes ) ); + if (xStyle.is()) + { + StyleElement * pStyle = static_cast< StyleElement * >( xStyle.get () ); + pStyle->importTextColorStyle( xControlModel ); + pStyle->importTextLineColorStyle( xControlModel ); + pStyle->importFontStyle( xControlModel ); + } + + ctx.importDefaults( 0, 0, _xAttributes ); // inherited from BulletinBoardElement + ctx.importLongProperty( OUString( RTL_CONSTASCII_USTRINGPARAM("ProgressValue") ), + OUString( RTL_CONSTASCII_USTRINGPARAM("value") ), + _xAttributes ); + ctx.importLongProperty( OUString( RTL_CONSTASCII_USTRINGPARAM("ProgressValueMax") ), + OUString( RTL_CONSTASCII_USTRINGPARAM("value-max") ), + _xAttributes ); + ctx.importEvents( _events ); + // avoid ring-reference: + // vector< event elements > holding event elements holding this (via _pParent) + _events.clear(); +} + +// #FIXME cut'n'pasted from xmloff/source/core/xmlimp.cxx:1251 +// of course we need to find a common home for this helper + +bool IsPackageURL( const ::rtl::OUString& rURL ) +{ + // Some quick tests: Some may rely on the package structure! + sal_Int32 nLen = rURL.getLength(); + if( (nLen > 0 && '/' == rURL[0]) ) + // RFC2396 net_path or abs_path + return false; + else if( nLen > 1 && '.' == rURL[0] ) + { + if( '.' == rURL[1] ) + // ../: We are never going up one level, so we know + // it's not an external URI + return false; + else if( '/' == rURL[1] ) + // we are remaining on a level, so it's an package URI + return true; + } + + // Now check for a RFC2396 schema + sal_Int32 nPos = 1; + while( nPos < nLen ) + { + switch( rURL[nPos] ) + { + case '/': + // a relative path segement + return true; + case ':': + // a schema + return false; + default: + break; + // we don't care about any other characters + } + ++nPos; + } + + return true; +} + +void importBindableAndListRangeBits( DialogImport* _pImport, const rtl::OUString sLinkedCell, const rtl::OUString & sCellRange, ControlImportContext& ctx ) +{ + 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 ); + + } + } + } +} + +sal_Bool isVBACompatibilityMode( DialogImport* _pImport ) +{ + sal_Bool bVBAMode = sal_False; + Reference< script::vba::XVBACompatibility > xVBACompat( _pImport->getScriptLibraryContainer(), UNO_QUERY ); + if( xVBACompat.is() ) + { + bVBAMode = xVBACompat->getVBACompatibilityMode(); + } + return bVBAMode; +} // progessmeter //__________________________________________________________________________________________________ @@ -119,9 +297,23 @@ Reference< xml::input::XElement > ScrollBarElement::startChildElement( 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 ( isVBACompatibilityMode( _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()) @@ -165,6 +357,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) @@ -1003,9 +1281,37 @@ void ImageControlElement::endElement() ctx.importBooleanProperty( OUString( RTL_CONSTASCII_USTRINGPARAM("ScaleImage") ), OUString( RTL_CONSTASCII_USTRINGPARAM("scale-image") ), _xAttributes ); - ctx.importStringProperty( OUString( RTL_CONSTASCII_USTRINGPARAM("ImageURL") ), - OUString( RTL_CONSTASCII_USTRINGPARAM("src") ), - _xAttributes ); + rtl::OUString sURL = _xAttributes->getValueByUidName( _pImport->XMLNS_DIALOGS_UID, OUSTR( "src" ) ); + Reference< document::XStorageBasedDocument > xDocStorage( _pImport->getDocOwner(), UNO_QUERY ); + + if ( xDocStorage.is() && IsPackageURL( sURL ) ) + { + uno::Sequence< Any > aArgs( 1 ); + aArgs[ 0 ] <<= xDocStorage->getDocumentStorage(); + + ::comphelper::ComponentContext aContext( ::comphelper::getProcessServiceFactory() ); + uno::Reference< document::XGraphicObjectResolver > xGraphicResolver; + aContext.createComponentWithArguments( OUSTR( "com.sun.star.comp.Svx.GraphicImportHelper" ), aArgs, xGraphicResolver ); + + if ( xGraphicResolver.is() ) + { + rtl::OUString aTmp( RTL_CONSTASCII_USTRINGPARAM( "vnd.sun.star.Package:" ) ); + aTmp += sURL; + sURL = xGraphicResolver->resolveGraphicObjectURL( aTmp ); + Reference< beans::XPropertySet > xProps( ctx.getControlModel(), UNO_QUERY ); + // we must set the url while the graphic object ( held by the resolver is in scope ) + if ( xProps.is() ) + xProps->setPropertyValue( OUSTR("ImageURL"), makeAny( sURL ) ); + } + } + + else if ( sURL.getLength() > 0 ) + { + Reference< beans::XPropertySet > xProps( ctx.getControlModel(), UNO_QUERY ); + if ( xProps.is() ) + xProps->setPropertyValue( OUSTR("ImageURL"), makeAny( sURL ) ); + } + ctx.importBooleanProperty( OUString( RTL_CONSTASCII_USTRINGPARAM("Tabstop") ), OUString( RTL_CONSTASCII_USTRINGPARAM("tabstop") ), _xAttributes ); @@ -1338,10 +1644,24 @@ void TitledBoxElement::endElement() Reference< xml::input::XElement > xRadio( _radios[ nPos ] ); Reference< xml::input::XAttributes > xAttributes( xRadio->getAttributes() ); + OUString sLinkedCell; + OUString sCellRange; + OUString sService( OUSTR("com.sun.star.awt.UnoControlRadioButtonModel") ); + try + { + sLinkedCell = xAttributes->getValueByUidName( _pImport->XMLNS_DIALOGS_UID, OUSTR( "linked-cell" ) ); + // we should probably limit this to vba mode also ( leave for now ) + if ( isVBACompatibilityMode( _pImport ) ) + sService = OUSTR("com.sun.star.form.component.RadioButton"); + } + catch( Exception& /*e*/ ) + { + } + ControlImportContext ctx( _pImport, getControlId( xAttributes ), - OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlRadioButtonModel") ) ); + sService ); Reference< beans::XPropertySet > xControlModel( ctx.getControlModel() ); Reference< xml::input::XElement > xStyle( getStyle( xAttributes ) ); @@ -1377,6 +1697,9 @@ void TitledBoxElement::endElement() ctx.importBooleanProperty( OUString( RTL_CONSTASCII_USTRINGPARAM("MultiLine") ), OUString( RTL_CONSTASCII_USTRINGPARAM("multiline") ), xAttributes ); + ctx.importStringProperty( OUString( RTL_CONSTASCII_USTRINGPARAM("GroupName") ), + OUString( RTL_CONSTASCII_USTRINGPARAM("group-name") ), + xAttributes ); sal_Int16 nVal = 0; sal_Bool bChecked = sal_False; @@ -1390,7 +1713,7 @@ void TitledBoxElement::endElement() } xControlModel->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM("State") ), makeAny( nVal ) ); - + importBindableAndListRangeBits( _pImport, sLinkedCell, sCellRange, ctx ); ::std::vector< Reference< xml::input::XElement > > * radioEvents = static_cast< RadioElement * >( xRadio.get() )->getEvents(); ctx.importEvents( *radioEvents ); @@ -1466,10 +1789,23 @@ void RadioGroupElement::endElement() Reference< xml::input::XElement > xRadio( _radios[ nPos ] ); Reference< xml::input::XAttributes > xAttributes( xRadio->getAttributes() ); + OUString sLinkedCell; + OUString sCellRange; + OUString sService( OUSTR("com.sun.star.awt.UnoControlRadioButtonModel") ); + try + { + sLinkedCell = xAttributes->getValueByUidName( _pImport->XMLNS_DIALOGS_UID, OUSTR( "linked-cell" ) ); + // we should probably limit this to vba mode also ( leave for now ) + if ( isVBACompatibilityMode( _pImport ) ) + sService = OUSTR("com.sun.star.form.component.RadioButton"); + } + catch( Exception& /*e*/ ) + { + } ControlImportContext ctx( _pImport, getControlId( xAttributes ), - OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlRadioButtonModel") ) ); + sService ); Reference< beans::XPropertySet > xControlModel( ctx.getControlModel() ); Reference< xml::input::XElement > xStyle( getStyle( xAttributes ) ); @@ -1505,6 +1841,9 @@ void RadioGroupElement::endElement() ctx.importBooleanProperty( OUString( RTL_CONSTASCII_USTRINGPARAM("MultiLine") ), OUString( RTL_CONSTASCII_USTRINGPARAM("multiline") ), xAttributes ); + ctx.importStringProperty( OUString( RTL_CONSTASCII_USTRINGPARAM("GroupName") ), + OUString( RTL_CONSTASCII_USTRINGPARAM("group-name") ), + xAttributes ); sal_Int16 nVal = 0; sal_Bool bChecked = sal_False; if (getBoolAttr( &bChecked, @@ -1518,6 +1857,7 @@ void RadioGroupElement::endElement() xControlModel->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM("State") ), makeAny( nVal ) ); + importBindableAndListRangeBits( _pImport, sLinkedCell, sCellRange, ctx ); ::std::vector< Reference< xml::input::XElement > > * radioEvents = static_cast< RadioElement * >( xRadio.get() )->getEvents(); ctx.importEvents( *radioEvents ); @@ -1638,9 +1978,26 @@ Reference< xml::input::XElement > MenuListElement::startChildElement( void MenuListElement::endElement() throw (xml::sax::SAXException, RuntimeException) { + OUString sLinkedCell; + OUString sCellRange; + OUString sListBoxService( OUSTR("com.sun.star.awt.UnoControlListBoxModel") ); + + // we should probably limit this to vba mode also ( leave for now ) + if ( isVBACompatibilityMode( _pImport ) ) + sListBoxService = OUSTR("com.sun.star.form.component.ListBox"); + + try + { + sLinkedCell = _xAttributes->getValueByUidName( _pImport->XMLNS_DIALOGS_UID, OUSTR( "linked-cell" ) ); + sCellRange = _xAttributes->getValueByUidName( _pImport->XMLNS_DIALOGS_UID, OUSTR( "source-cell-range" ) ); + } + 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 +2030,16 @@ void MenuListElement::endElement() ctx.importAlignProperty( OUString( RTL_CONSTASCII_USTRINGPARAM("Align") ), OUString( RTL_CONSTASCII_USTRINGPARAM("align") ), _xAttributes ); - + // import cell-link and cell source range + importBindableAndListRangeBits( _pImport, sLinkedCell, sCellRange, ctx ); 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 ); @@ -1725,9 +2085,26 @@ Reference< xml::input::XElement > ComboBoxElement::startChildElement( void ComboBoxElement::endElement() throw (xml::sax::SAXException, RuntimeException) { + OUString sService( OUSTR("com.sun.star.awt.UnoControlComboBoxModel") ); + + // we should probably limit this to vba mode also ( leave for now ) + if ( isVBACompatibilityMode( _pImport ) ) + sService = OUSTR("com.sun.star.form.component.ComboBox"); + + OUString sLinkedCell; + OUString sCellRange; + try + { + sLinkedCell = _xAttributes->getValueByUidName( _pImport->XMLNS_DIALOGS_UID, OUSTR( "linked-cell" ) ); + sCellRange = _xAttributes->getValueByUidName( _pImport->XMLNS_DIALOGS_UID, OUSTR( "source-cell-range" ) ); + } + catch( Exception& /*e*/ ) + { + } + ControlImportContext ctx( _pImport, getControlId( _xAttributes ), - OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlComboBoxModel") ) ); + sService ); Reference< beans::XPropertySet > xControlModel( ctx.getControlModel() ); Reference< xml::input::XElement > xStyle( getStyle( _xAttributes ) ); @@ -1769,8 +2146,10 @@ void ComboBoxElement::endElement() ctx.importAlignProperty( OUString( RTL_CONSTASCII_USTRINGPARAM("Align") ), OUString( RTL_CONSTASCII_USTRINGPARAM("align") ), _xAttributes ); + // import cell-link and cell source range + importBindableAndListRangeBits( _pImport, sLinkedCell, sCellRange, ctx ); - if (_popup.is()) + if (_popup.is() && !sCellRange.getLength() ) { MenuPopupElement * p = static_cast< MenuPopupElement * >( _popup.get() ); xControlModel->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM("StringItemList") ), @@ -2096,11 +2475,20 @@ Reference< xml::input::XElement > BulletinBoardElement::startChildElement( { return new ScrollBarElement( rLocalName, xAttributes, this, _pImport ); } + // spinbutton + else if (rLocalName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("spinbutton") ) && isVBACompatibilityMode( _pImport ) ) + { + return new SpinButtonElement( rLocalName, xAttributes, this, _pImport ); + } // progressmeter else if (rLocalName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("progressmeter") )) { return new ProgressBarElement( rLocalName, xAttributes, this, _pImport ); } + else if (rLocalName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("multipage") )) + { + return new MultiPage( rLocalName, xAttributes, this, _pImport ); + } // bulletinboard else if (rLocalName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("bulletinboard") )) { diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx index 5fb2a39c6913..fb57c5acb769 100644 --- a/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx +++ b/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx @@ -57,9 +57,13 @@ #include #include +#include +#include +#include using namespace ::com::sun::star; using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::frame; using ::rtl::OUString; namespace xmlscript @@ -1888,18 +1892,42 @@ Reference< xml::input::XElement > DialogImport::getStyle( } return 0; } +//__________________________________________________________________________________________________ +Reference< script::XLibraryContainer > DialogImport::getScriptLibraryContainer() +{ + if( !_xScriptLibraryContainer.is() ) + { + try + { + Reference< beans::XPropertySet > xProps( _xDoc, UNO_QUERY ); + if( xProps.is() ) + _xScriptLibraryContainer.set( xProps->getPropertyValue( OUSTR("BasicLibraries") ), UNO_QUERY ); + } + catch( const Exception& ) + { + } + } + + return _xScriptLibraryContainer; +} //################################################################################################## //================================================================================================== Reference< xml::sax::XDocumentHandler > SAL_CALL importDialogModel( Reference< container::XNameContainer > const & xDialogModel, - Reference< XComponentContext > const & xContext ) + Reference< XComponentContext > const & xContext, + Reference< XModel > const & xDocument ) SAL_THROW( (Exception) ) { + DialogImport* pImport = new DialogImport( xContext, xDialogModel, xDocument ); + uno::Reference< script::vba::XVBACompatibility > xVBAModeSource( pImport->getScriptLibraryContainer(), uno::UNO_QUERY ); + + uno::Reference< beans::XPropertySet > xDlgProps( xDialogModel, uno::UNO_QUERY ); + if ( xVBAModeSource.is() && xDlgProps.is() && xVBAModeSource->getVBACompatibilityMode() ) + xDlgProps->setPropertyValue( OUSTR("VBAForm"), uno::makeAny( sal_True ) ); return ::xmlscript::createDocumentHandler( - static_cast< xml::input::XRoot * >( - new DialogImport( xContext, xDialogModel ) ) ); + static_cast< xml::input::XRoot * >( pImport ) ); } } diff --git a/xmlscript/util/makefile.mk b/xmlscript/util/makefile.mk index 3ccf63dc3b89..7a391cdcaaa9 100644 --- a/xmlscript/util/makefile.mk +++ b/xmlscript/util/makefile.mk @@ -54,6 +54,7 @@ SHL1LIBS= \ $(LIB1TARGET) SHL1STDLIBS= \ + $(COMPHELPERLIB) \ $(CPPUHELPERLIB) \ $(CPPULIB) \ $(SALLIB) -- cgit From 8694d2bc19ea6b531e85ac8135de34dc99956bca Mon Sep 17 00:00:00 2001 From: Sebastian Spaeth Date: Tue, 12 Oct 2010 15:53:47 +0200 Subject: Add vim/emacs modelines to all source files Fixes #fdo30794 Based on bin/add-modelines script (originally posted in mail 1286706307.1871.1399280959@webmail.messagingengine.com) Signed-off-by: Sebastian Spaeth --- xmlscript/inc/pch/precompiled_xmlscript.cxx | 2 ++ xmlscript/source/misc/unoservices.cxx | 3 +++ xmlscript/source/xml_helper/xml_byteseq.cxx | 3 +++ xmlscript/source/xml_helper/xml_element.cxx | 3 +++ xmlscript/source/xml_helper/xml_impctx.cxx | 3 +++ xmlscript/source/xmldlg_imexp/xmldlg_addfunc.cxx | 3 +++ xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx | 3 +++ xmlscript/source/xmldlg_imexp/xmldlg_export.cxx | 3 +++ xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx | 3 +++ xmlscript/source/xmldlg_imexp/xmldlg_import.cxx | 3 +++ xmlscript/source/xmlflat_imexp/xmlbas_export.cxx | 3 +++ xmlscript/source/xmlflat_imexp/xmlbas_import.cxx | 3 +++ xmlscript/source/xmllib_imexp/xmllib_export.cxx | 2 ++ xmlscript/source/xmllib_imexp/xmllib_import.cxx | 3 +++ xmlscript/source/xmlmod_imexp/xmlmod_export.cxx | 2 ++ xmlscript/source/xmlmod_imexp/xmlmod_import.cxx | 2 ++ xmlscript/test/imexp.cxx | 2 ++ 17 files changed, 46 insertions(+) (limited to 'xmlscript') diff --git a/xmlscript/inc/pch/precompiled_xmlscript.cxx b/xmlscript/inc/pch/precompiled_xmlscript.cxx index 7998575efea9..812b8d428514 100644 --- a/xmlscript/inc/pch/precompiled_xmlscript.cxx +++ b/xmlscript/inc/pch/precompiled_xmlscript.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -27,3 +28,4 @@ #include "precompiled_xmlscript.hxx" +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlscript/source/misc/unoservices.cxx b/xmlscript/source/misc/unoservices.cxx index 932bb9f2a6ef..8c0ccc3589f9 100644 --- a/xmlscript/source/misc/unoservices.cxx +++ b/xmlscript/source/misc/unoservices.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -129,3 +130,5 @@ extern "C" pImplName, pServiceManager, pRegistryKey, ::xmlscript::s_entries ); } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlscript/source/xml_helper/xml_byteseq.cxx b/xmlscript/source/xml_helper/xml_byteseq.cxx index a570db629aca..d23e12d671c3 100644 --- a/xmlscript/source/xml_helper/xml_byteseq.cxx +++ b/xmlscript/source/xml_helper/xml_byteseq.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -171,3 +172,5 @@ Reference< io::XOutputStream > SAL_CALL createOutputStream( ByteSequence * pOutD } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlscript/source/xml_helper/xml_element.cxx b/xmlscript/source/xml_helper/xml_element.cxx index 7fe5436ffd86..1eae9b80d590 100644 --- a/xmlscript/source/xml_helper/xml_element.cxx +++ b/xmlscript/source/xml_helper/xml_element.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -130,3 +131,5 @@ OUString XMLElement::getValueByName( OUString const & rName ) } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlscript/source/xml_helper/xml_impctx.cxx b/xmlscript/source/xml_helper/xml_impctx.cxx index 754b546a112c..9edccbf9bff4 100644 --- a/xmlscript/source/xml_helper/xml_impctx.cxx +++ b/xmlscript/source/xml_helper/xml_impctx.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -902,3 +903,5 @@ Reference< XInterface > SAL_CALL create_DocumentHandlerImpl( } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_addfunc.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_addfunc.cxx index 22c472ac1782..273bf5ff4b17 100644 --- a/xmlscript/source/xmldlg_imexp/xmldlg_addfunc.cxx +++ b/xmlscript/source/xmldlg_imexp/xmldlg_addfunc.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -136,3 +137,5 @@ void SAL_CALL importDialogModel( } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx index 1d9e67d23d28..ea3603de5e75 100644 --- a/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx +++ b/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1167,3 +1168,5 @@ void ElementDescriptor::readDialogModel( StyleBag * all_styles ) } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx index 365355375808..d0f8a6dde611 100644 --- a/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx +++ b/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1608,3 +1609,5 @@ void SAL_CALL exportDialogModel( } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx index a0968eb007d5..2b6f47622c1a 100644 --- a/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx +++ b/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -2287,3 +2288,5 @@ void WindowElement::endElement() } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx index 5fb2a39c6913..2c5a6aafc835 100644 --- a/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx +++ b/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1903,3 +1904,5 @@ Reference< xml::sax::XDocumentHandler > SAL_CALL importDialogModel( } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlscript/source/xmlflat_imexp/xmlbas_export.cxx b/xmlscript/source/xmlflat_imexp/xmlbas_export.cxx index cfb8de1c1f1e..b6e31ba7951b 100644 --- a/xmlscript/source/xmlflat_imexp/xmlbas_export.cxx +++ b/xmlscript/source/xmlflat_imexp/xmlbas_export.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -549,3 +550,5 @@ sal_Bool XMLBasicExporterBase::filter( const Sequence< beans::PropertyValue >& / //......................................................................... } // namespace xmlscript //......................................................................... + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlscript/source/xmlflat_imexp/xmlbas_import.cxx b/xmlscript/source/xmlflat_imexp/xmlbas_import.cxx index e4e966189a98..eb9662fe5121 100644 --- a/xmlscript/source/xmlflat_imexp/xmlbas_import.cxx +++ b/xmlscript/source/xmlflat_imexp/xmlbas_import.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -929,3 +930,5 @@ void BasicImport::setDocumentLocator( const Reference< xml::sax::XLocator >& /*x //......................................................................... } // namespace xmlscript //......................................................................... + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlscript/source/xmllib_imexp/xmllib_export.cxx b/xmlscript/source/xmllib_imexp/xmllib_export.cxx index 1e21dc49ea32..d731fed9f10b 100644 --- a/xmlscript/source/xmllib_imexp/xmllib_export.cxx +++ b/xmlscript/source/xmllib_imexp/xmllib_export.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -174,3 +175,4 @@ SAL_CALL exportLibrary( } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlscript/source/xmllib_imexp/xmllib_import.cxx b/xmlscript/source/xmllib_imexp/xmllib_import.cxx index bac997d4dc94..a1fd0fff2b2f 100644 --- a/xmlscript/source/xmllib_imexp/xmllib_import.cxx +++ b/xmlscript/source/xmllib_imexp/xmllib_import.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -370,3 +371,5 @@ LibDescriptorArray::~LibDescriptorArray() } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlscript/source/xmlmod_imexp/xmlmod_export.cxx b/xmlscript/source/xmlmod_imexp/xmlmod_export.cxx index 781d2d779dda..782e6d343818 100644 --- a/xmlscript/source/xmlmod_imexp/xmlmod_export.cxx +++ b/xmlscript/source/xmlmod_imexp/xmlmod_export.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -78,3 +79,4 @@ SAL_CALL exportScriptModule( } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlscript/source/xmlmod_imexp/xmlmod_import.cxx b/xmlscript/source/xmlmod_imexp/xmlmod_import.cxx index 7f38f915aa62..efae2852eec6 100644 --- a/xmlscript/source/xmlmod_imexp/xmlmod_import.cxx +++ b/xmlscript/source/xmlmod_imexp/xmlmod_import.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -228,3 +229,4 @@ SAL_CALL importScriptModule( ModuleDescriptor& rMod ) } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlscript/test/imexp.cxx b/xmlscript/test/imexp.cxx index 04ed371df676..45a76ffc15fa 100644 --- a/xmlscript/test/imexp.cxx +++ b/xmlscript/test/imexp.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -240,3 +241,4 @@ void MyApp::Main() } } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit From e63e28d7d6f74fd7a826afbeff618a2fd6ab0a3c Mon Sep 17 00:00:00 2001 From: Noel Power Date: Fri, 15 Oct 2010 13:00:04 +0100 Subject: fix fdo#30856 remove VBAForm property and associated geometry hack --- xmlscript/source/xmldlg_imexp/xmldlg_import.cxx | 5 ----- 1 file changed, 5 deletions(-) (limited to 'xmlscript') diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx index 8488851bcaa2..81ba97c6a955 100644 --- a/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx +++ b/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx @@ -1922,11 +1922,6 @@ Reference< xml::sax::XDocumentHandler > SAL_CALL importDialogModel( SAL_THROW( (Exception) ) { DialogImport* pImport = new DialogImport( xContext, xDialogModel, xDocument ); - uno::Reference< script::vba::XVBACompatibility > xVBAModeSource( pImport->getScriptLibraryContainer(), uno::UNO_QUERY ); - - uno::Reference< beans::XPropertySet > xDlgProps( xDialogModel, uno::UNO_QUERY ); - if ( xVBAModeSource.is() && xDlgProps.is() && xVBAModeSource->getVBACompatibilityMode() ) - xDlgProps->setPropertyValue( OUSTR("VBAForm"), uno::makeAny( sal_True ) ); return ::xmlscript::createDocumentHandler( static_cast< xml::input::XRoot * >( pImport ) ); } -- cgit From c65d39c026e2141b123e196c5b203ca06227076b Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 19 Oct 2010 21:18:22 +0100 Subject: this is just wrong --- xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'xmlscript') diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx index fbe68fe84ca9..a2abb08d5c0f 100644 --- a/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx +++ b/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx @@ -99,7 +99,7 @@ void lclExportBindableAndListSourceBits( Reference< frame::XModel > const & xDoc xConvertor->getPropertyValue( OUSTR("PersistentRepresentation") ) >>= sAddress; OSL_TRACE("**** cell range source list %s", rtl::OUStringToOString( sAddress, RTL_TEXTENCODING_UTF8 ).getStr() ); - if ( sAddress.getLength() > 0 ); + if ( sAddress.getLength() > 0 ) rModel.addAttribute( OUSTR(XMLNS_DIALOGS_PREFIX ":source-cell-range"), sAddress ); } catch( uno::Exception& ) -- cgit From 758c8774fbbd09c4202c0744c06945e3cf7e1a99 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 27 Oct 2010 13:11:31 +0100 Subject: add modelines to .hxx files as well --- xmlscript/inc/pch/precompiled_xmlscript.hxx | 2 ++ xmlscript/inc/xmlscript/xml_helper.hxx | 3 +++ xmlscript/inc/xmlscript/xml_import.hxx | 3 +++ xmlscript/inc/xmlscript/xmldlg_imexp.hxx | 3 +++ xmlscript/inc/xmlscript/xmllib_imexp.hxx | 3 +++ xmlscript/inc/xmlscript/xmlmod_imexp.hxx | 3 +++ xmlscript/inc/xmlscript/xmlns.h | 3 +++ xmlscript/source/inc/misc.hxx | 3 +++ xmlscript/source/xmldlg_imexp/common.hxx | 3 +++ xmlscript/source/xmldlg_imexp/exp_share.hxx | 3 +++ xmlscript/source/xmldlg_imexp/imp_share.hxx | 3 +++ xmlscript/source/xmlflat_imexp/xmlbas_export.hxx | 3 +++ xmlscript/source/xmlflat_imexp/xmlbas_import.hxx | 3 +++ xmlscript/source/xmllib_imexp/imp_share.hxx | 3 +++ xmlscript/source/xmlmod_imexp/imp_share.hxx | 3 +++ 15 files changed, 44 insertions(+) (limited to 'xmlscript') diff --git a/xmlscript/inc/pch/precompiled_xmlscript.hxx b/xmlscript/inc/pch/precompiled_xmlscript.hxx index 31ddc8cda8d8..ad1762464bde 100644 --- a/xmlscript/inc/pch/precompiled_xmlscript.hxx +++ b/xmlscript/inc/pch/precompiled_xmlscript.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -30,3 +31,4 @@ #ifdef PRECOMPILED_HEADERS #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlscript/inc/xmlscript/xml_helper.hxx b/xmlscript/inc/xmlscript/xml_helper.hxx index 764667af4b5b..f3b272db7afd 100644 --- a/xmlscript/inc/xmlscript/xml_helper.hxx +++ b/xmlscript/inc/xmlscript/xml_helper.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -144,3 +145,5 @@ SAL_CALL createOutputStream( } #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlscript/inc/xmlscript/xml_import.hxx b/xmlscript/inc/xmlscript/xml_import.hxx index 86255523fa05..ca8cc3a0f0e9 100644 --- a/xmlscript/inc/xmlscript/xml_import.hxx +++ b/xmlscript/inc/xmlscript/xml_import.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -64,3 +65,5 @@ SAL_CALL createDocumentHandler( } #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlscript/inc/xmlscript/xmldlg_imexp.hxx b/xmlscript/inc/xmlscript/xmldlg_imexp.hxx index ed3c131d1078..30d92bfc1bd3 100644 --- a/xmlscript/inc/xmlscript/xmldlg_imexp.hxx +++ b/xmlscript/inc/xmlscript/xmldlg_imexp.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -89,3 +90,5 @@ void SAL_CALL importDialogModel( } #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlscript/inc/xmlscript/xmllib_imexp.hxx b/xmlscript/inc/xmlscript/xmllib_imexp.hxx index 03d043a56ca5..95750c26655f 100644 --- a/xmlscript/inc/xmlscript/xmllib_imexp.hxx +++ b/xmlscript/inc/xmlscript/xmllib_imexp.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -92,3 +93,5 @@ SAL_CALL importLibrary( LibDescriptor& rLib ) } #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlscript/inc/xmlscript/xmlmod_imexp.hxx b/xmlscript/inc/xmlscript/xmlmod_imexp.hxx index a2873542d10c..f2e3b169454f 100644 --- a/xmlscript/inc/xmlscript/xmlmod_imexp.hxx +++ b/xmlscript/inc/xmlscript/xmlmod_imexp.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -63,3 +64,5 @@ SAL_CALL importScriptModule( ModuleDescriptor& rMod ) } #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlscript/inc/xmlscript/xmlns.h b/xmlscript/inc/xmlscript/xmlns.h index 4ab2c18376eb..13751ea8489e 100644 --- a/xmlscript/inc/xmlscript/xmlns.h +++ b/xmlscript/inc/xmlscript/xmlns.h @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -43,3 +44,5 @@ #define XMLNS_XLINK_PREFIX "xlink" #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlscript/source/inc/misc.hxx b/xmlscript/source/inc/misc.hxx index 50435002a3bb..bd7f737292af 100644 --- a/xmlscript/source/inc/misc.hxx +++ b/xmlscript/source/inc/misc.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -61,3 +62,5 @@ inline T extract_throw( ::com::sun::star::uno::Any const & a ) } #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlscript/source/xmldlg_imexp/common.hxx b/xmlscript/source/xmldlg_imexp/common.hxx index f5bc51684ebb..e391fb619ed4 100644 --- a/xmlscript/source/xmldlg_imexp/common.hxx +++ b/xmlscript/source/xmldlg_imexp/common.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -40,3 +41,5 @@ const sal_Int16 BORDER_SIMPLE_COLOR = 3; } #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlscript/source/xmldlg_imexp/exp_share.hxx b/xmlscript/source/xmldlg_imexp/exp_share.hxx index f96186448ea4..ffb97055dff4 100644 --- a/xmlscript/source/xmldlg_imexp/exp_share.hxx +++ b/xmlscript/source/xmldlg_imexp/exp_share.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -247,3 +248,5 @@ inline bool ElementDescriptor::readProp( } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlscript/source/xmldlg_imexp/imp_share.hxx b/xmlscript/source/xmldlg_imexp/imp_share.hxx index a13a205a7bf7..27929a349bfe 100644 --- a/xmlscript/source/xmldlg_imexp/imp_share.hxx +++ b/xmlscript/source/xmldlg_imexp/imp_share.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -1068,3 +1069,5 @@ public: }; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlscript/source/xmlflat_imexp/xmlbas_export.hxx b/xmlscript/source/xmlflat_imexp/xmlbas_export.hxx index 452dceb84e12..bd425b0f0aad 100644 --- a/xmlscript/source/xmlflat_imexp/xmlbas_export.hxx +++ b/xmlscript/source/xmlflat_imexp/xmlbas_export.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -130,3 +131,5 @@ namespace xmlscript //......................................................................... #endif // XMLSCRIPT_XMLBAS_EXPORT_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlscript/source/xmlflat_imexp/xmlbas_import.hxx b/xmlscript/source/xmlflat_imexp/xmlbas_import.hxx index b383649a4eac..96567f3e2eb5 100644 --- a/xmlscript/source/xmlflat_imexp/xmlbas_import.hxx +++ b/xmlscript/source/xmlflat_imexp/xmlbas_import.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -343,3 +344,5 @@ namespace xmlscript //......................................................................... #endif // XMLSCRIPT_XMLBAS_IMPORT_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlscript/source/xmllib_imexp/imp_share.hxx b/xmlscript/source/xmllib_imexp/imp_share.hxx index 329f166a1314..a3728cb4488b 100644 --- a/xmlscript/source/xmllib_imexp/imp_share.hxx +++ b/xmlscript/source/xmllib_imexp/imp_share.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -261,3 +262,5 @@ public: }; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlscript/source/xmlmod_imexp/imp_share.hxx b/xmlscript/source/xmlmod_imexp/imp_share.hxx index b5b42fc56625..3e63aa7a4e3e 100644 --- a/xmlscript/source/xmlmod_imexp/imp_share.hxx +++ b/xmlscript/source/xmlmod_imexp/imp_share.hxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -141,3 +142,5 @@ public: //================================================================================================== } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit From 928159ff71d19a3910d1fd1e472a11ef1c89415b Mon Sep 17 00:00:00 2001 From: Noel Power Date: Tue, 2 Nov 2010 16:22:07 +0000 Subject: initial import of latest cws container_controls --- xmlscript/source/xmldlg_imexp/common.hxx | 1 + xmlscript/source/xmldlg_imexp/exp_share.hxx | 26 +- xmlscript/source/xmldlg_imexp/imp_share.hxx | 103 +++- xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx | 551 +++++++++++++++------ xmlscript/source/xmldlg_imexp/xmldlg_export.cxx | 390 +++++---------- xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx | 463 +++++++---------- xmlscript/source/xmldlg_imexp/xmldlg_import.cxx | 144 +++++- xmlscript/util/makefile.mk | 1 + 8 files changed, 974 insertions(+), 705 deletions(-) (limited to 'xmlscript') diff --git a/xmlscript/source/xmldlg_imexp/common.hxx b/xmlscript/source/xmldlg_imexp/common.hxx index e391fb619ed4..7395c1034f95 100644 --- a/xmlscript/source/xmldlg_imexp/common.hxx +++ b/xmlscript/source/xmldlg_imexp/common.hxx @@ -40,6 +40,7 @@ const sal_Int16 BORDER_SIMPLE_COLOR = 3; } +#define XMLSCRIPT_GRAPHOBJ_URLPREFIX "vnd.sun.star.GraphicObject:" #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlscript/source/xmldlg_imexp/exp_share.hxx b/xmlscript/source/xmldlg_imexp/exp_share.hxx index ffb97055dff4..aaf6bd6aeef6 100644 --- a/xmlscript/source/xmldlg_imexp/exp_share.hxx +++ b/xmlscript/source/xmldlg_imexp/exp_share.hxx @@ -91,16 +91,18 @@ class ElementDescriptor { css::uno::Reference< css::beans::XPropertySet > _xProps; css::uno::Reference< css::beans::XPropertyState > _xPropState; + css::uno::Reference< css::frame::XModel > _xDocument; public: inline ElementDescriptor( css::uno::Reference< css::beans::XPropertySet > const & xProps, css::uno::Reference< css::beans::XPropertyState > const & xPropState, - ::rtl::OUString const & name ) + ::rtl::OUString const & name, css::uno::Reference< css::frame::XModel > const & xDocument ) SAL_THROW( () ) : XMLElement( name ) , _xProps( xProps ) , _xPropState( xPropState ) + , _xDocument( xDocument ) {} inline ElementDescriptor( ::rtl::OUString const & name ) @@ -142,6 +144,8 @@ public: ::rtl::OUString const & rPropName, ::rtl::OUString const & rAttrName ); void readVerticalAlignAttr( ::rtl::OUString const & rPropName, ::rtl::OUString const & rAttrName ); + void readImageURLAttr( + ::rtl::OUString const & rPropName, ::rtl::OUString const & rAttrName ); void readImageAlignAttr( ::rtl::OUString const & rPropName, ::rtl::OUString const & rAttrName ); void readImagePositionAttr( @@ -159,6 +163,8 @@ public: void readSelectionTypeAttr( ::rtl::OUString const & rPropName, ::rtl::OUString const & rAttrName ); // + void readDataAwareAttr( + ::rtl::OUString const & rAttrName ); inline void addBoolAttr( ::rtl::OUString const & rAttrName, sal_Bool bValue ) { addAttribute( rAttrName, ::rtl::OUString::valueOf(bValue) ); } @@ -172,17 +178,23 @@ public: // void readDialogModel( StyleBag * all_styles ) SAL_THROW( (css::uno::Exception) ); + void readBullitinBoard( StyleBag * all_styles ) + SAL_THROW( (css::uno::Exception) ); void readMultiPageModel( StyleBag * all_styles ) SAL_THROW( (css::uno::Exception) ); + void readFrameModel( StyleBag * all_styles ) + SAL_THROW( (css::uno::Exception) ); + void readPageModel( StyleBag * all_styles ) + SAL_THROW( (css::uno::Exception) ); void readButtonModel( StyleBag * all_styles ) SAL_THROW( (css::uno::Exception) ); void readEditModel( StyleBag * all_styles ) SAL_THROW( (css::uno::Exception) ); void readCheckBoxModel( StyleBag * all_styles ) SAL_THROW( (css::uno::Exception) ); - void readRadioButtonModel( StyleBag * all_styles, com::sun::star::uno::Reference< com::sun::star::frame::XModel > const & xDocument ) + void readRadioButtonModel( StyleBag * all_styles ) SAL_THROW( (css::uno::Exception) ); - void readComboBoxModel( StyleBag * all_styles, com::sun::star::uno::Reference< com::sun::star::frame::XModel > const & xDocument ) + void readComboBoxModel( StyleBag * all_styles ) SAL_THROW( (css::uno::Exception) ); void readCurrencyFieldModel( StyleBag * all_styles ) SAL_THROW( (css::uno::Exception) ); @@ -196,9 +208,9 @@ public: SAL_THROW( (css::uno::Exception) ); void readGroupBoxModel( StyleBag * all_styles ) SAL_THROW( (css::uno::Exception) ); - void readImageControlModel( StyleBag * all_styles, com::sun::star::uno::Reference< com::sun::star::frame::XModel > const & xDocument ) + void readImageControlModel( StyleBag * all_styles ) SAL_THROW( (css::uno::Exception) ); - void readListBoxModel( StyleBag * all_styles, com::sun::star::uno::Reference< com::sun::star::frame::XModel > const & xDocument ) + void readListBoxModel( StyleBag * all_styles ) SAL_THROW( (css::uno::Exception) ); void readNumericFieldModel( StyleBag * all_styles ) SAL_THROW( (css::uno::Exception) ); @@ -212,9 +224,9 @@ public: SAL_THROW( (css::uno::Exception) ); void readProgressBarModel( StyleBag * all_styles ) SAL_THROW( (css::uno::Exception) ); - void readScrollBarModel( StyleBag * all_styles, com::sun::star::uno::Reference< com::sun::star::frame::XModel > const & xDocument ) + void readScrollBarModel( StyleBag * all_styles ) SAL_THROW( (css::uno::Exception) ); - void readSpinButtonModel( StyleBag * all_styles, com::sun::star::uno::Reference< com::sun::star::frame::XModel > const & xDocument ) + void readSpinButtonModel( StyleBag * all_styles ) SAL_THROW( (css::uno::Exception) ); void readFixedHyperLinkModel( StyleBag * all_styles ) SAL_THROW( (css::uno::Exception) ); diff --git a/xmlscript/source/xmldlg_imexp/imp_share.hxx b/xmlscript/source/xmldlg_imexp/imp_share.hxx index 27929a349bfe..5523fe05440b 100644 --- a/xmlscript/source/xmldlg_imexp/imp_share.hxx +++ b/xmlscript/source/xmldlg_imexp/imp_share.hxx @@ -45,7 +45,7 @@ #include #include #include - +#include namespace css = ::com::sun::star; @@ -117,16 +117,19 @@ inline bool getLongAttr( class ImportContext; //============================================================================== +typedef ::cppu::WeakImplHelper1< css::xml::input::XRoot > DialogImport_Base; struct DialogImport - : public ::cppu::WeakImplHelper1< css::xml::input::XRoot > + : DialogImport_Base { friend class ImportContext; css::uno::Reference< css::uno::XComponentContext > _xContext; css::uno::Reference< css::util::XNumberFormatsSupplier > _xSupplier; - ::std::vector< ::rtl::OUString > _styleNames; - ::std::vector< css::uno::Reference< css::xml::input::XElement > > _styles; + ::boost::shared_ptr< ::std::vector< ::rtl::OUString > > _pStyleNames; + ::boost::shared_ptr< ::std::vector< css::uno::Reference< css::xml::input::XElement > > > _pStyles; + ::std::vector< ::rtl::OUString >& _styleNames; + ::std::vector< css::uno::Reference< css::xml::input::XElement > >& _styles; css::uno::Reference< css::container::XNameContainer > _xDialogModel; css::uno::Reference< css::lang::XMultiServiceFactory > _xDialogModelFactory; @@ -166,13 +169,32 @@ public: css::uno::Reference const & xContext, css::uno::Reference const & xDialogModel, + ::boost::shared_ptr< ::std::vector< ::rtl::OUString > >& pStyleNames, + ::boost::shared_ptr< ::std::vector< css::uno::Reference< css::xml::input::XElement > > >& pStyles, css::uno::Reference const & xDoc ) SAL_THROW( () ) : _xContext( xContext ) + , _pStyleNames( pStyleNames ) + , _pStyles( pStyles ) + , _styleNames( *_pStyleNames ) + , _styles( *_pStyles ) , _xDialogModel( xDialogModel ) , _xDialogModelFactory( xDialogModel, css::uno::UNO_QUERY_THROW ), _xDoc( xDoc ) { OSL_ASSERT( _xDialogModel.is() && _xDialogModelFactory.is() && _xContext.is() ); } + inline DialogImport( const DialogImport& rOther ) : DialogImport_Base() + , _xContext( rOther._xContext ) + , _xSupplier( rOther._xSupplier ) + , _pStyleNames( rOther._pStyleNames ) + , _pStyles( rOther._pStyles ) + , _styleNames( *_pStyleNames ) + , _styles( *_pStyles ) + , _xDialogModel( rOther._xDialogModel ) + , _xDialogModelFactory( rOther._xDialogModelFactory ) + , _xDoc( rOther._xDoc ) + , XMLNS_DIALOGS_UID( rOther.XMLNS_DIALOGS_UID ) + , XMLNS_SCRIPT_UID( rOther.XMLNS_SCRIPT_UID ) {} + virtual ~DialogImport() SAL_THROW( () ); @@ -365,6 +387,9 @@ protected: ::rtl::OUString getControlId( css::uno::Reference const & xAttributes ); + ::rtl::OUString getControlModelName( + rtl::OUString const& rDefaultModel, + css::uno::Reference const & xAttributes ); css::uno::Reference< css::xml::input::XElement > getStyle( css::uno::Reference const & xAttributes ); public: @@ -435,6 +460,8 @@ public: bool importVerticalAlignProperty( ::rtl::OUString const & rPropName, ::rtl::OUString const & rAttrName, css::uno::Reference const & xAttributes ); + bool importImageURLProperty( rtl::OUString const & rPropName, rtl::OUString const & rAttrName, + css::uno::Reference< css::xml::input::XAttributes > const & xAttributes ); bool importImageAlignProperty( ::rtl::OUString const & rPropName, ::rtl::OUString const & rAttrName, css::uno::Reference const & xAttributes ); @@ -459,6 +486,9 @@ public: bool importSelectionTypeProperty( ::rtl::OUString const & rPropName, ::rtl::OUString const & rAttrName, css::uno::Reference const & xAttributes ); + bool importDataAwareProperty( + ::rtl::OUString const & rPropName, + css::uno::Reference const & xAttributes ); }; //============================================================================== @@ -474,6 +504,14 @@ public: pImport->_xDialogModelFactory->createInstance( rControlName ), css::uno::UNO_QUERY_THROW ), rId ) {} + inline ControlImportContext( + DialogImport * pImport, + const css::uno::Reference< css::beans::XPropertySet >& xProps, ::rtl::OUString const & rControlName ) + : ImportContext( + pImport, + xProps, + rControlName ) + {} inline ~ControlImportContext() { _pImport->_xDialogModel->insertByName( @@ -1004,6 +1042,7 @@ public: }; //============================================================================== + class SpinButtonElement : public ControlElement { @@ -1039,14 +1078,70 @@ public: throw (css::xml::sax::SAXException, css::uno::RuntimeException); inline MultiPage( + ::rtl::OUString const & rLocalName, + css::uno::Reference< css::xml::input::XAttributes > const & xAttributes, + ElementBase * pParent, DialogImport * pImport ) + SAL_THROW( () ) + : ControlElement( rLocalName, xAttributes, pParent, pImport ) + { + m_xContainer.set( _pImport->_xDialogModelFactory->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoMultiPageModel") ) ), css::uno::UNO_QUERY ); + } +private: + css::uno::Reference< css::container::XNameContainer > m_xContainer; +}; + +//============================================================================== +class Frame + : public ControlElement +{ + ::rtl::OUString _label; +public: + virtual css::uno::Reference< css::xml::input::XElement > + SAL_CALL startChildElement( + sal_Int32 nUid, ::rtl::OUString const & rLocalName, + css::uno::Reference const & xAttributes ) + throw (css::xml::sax::SAXException, css::uno::RuntimeException); + virtual void SAL_CALL endElement() + throw (css::xml::sax::SAXException, css::uno::RuntimeException); + + inline Frame( ::rtl::OUString const & rLocalName, css::uno::Reference< css::xml::input::XAttributes > const & xAttributes, ElementBase * pParent, DialogImport * pImport ) SAL_THROW( () ) : ControlElement( rLocalName, xAttributes, pParent, pImport ) {} +private: + css::uno::Reference< css::container::XNameContainer > m_xContainer; }; +//============================================================================== +class Page + : public ControlElement +{ +public: + virtual css::uno::Reference< css::xml::input::XElement > + SAL_CALL startChildElement( + sal_Int32 nUid, ::rtl::OUString const & rLocalName, + css::uno::Reference const & xAttributes ) + throw (css::xml::sax::SAXException, css::uno::RuntimeException); + virtual void SAL_CALL endElement() + throw (css::xml::sax::SAXException, css::uno::RuntimeException); + + inline Page( + ::rtl::OUString const & rLocalName, + css::uno::Reference< css::xml::input::XAttributes > const & xAttributes, + ElementBase * pParent, DialogImport * pImport ) + SAL_THROW( () ) + : ControlElement( rLocalName, xAttributes, pParent, pImport ) + { + m_xContainer.set( _pImport->_xDialogModelFactory->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoPageModel") ) ), css::uno::UNO_QUERY ); + } +private: + css::uno::Reference< css::container::XNameContainer > m_xContainer; +}; + + class ProgressBarElement : public ControlElement { diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx index a2abb08d5c0f..2d955fd5c5d5 100644 --- a/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx +++ b/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx @@ -39,8 +39,7 @@ #include #include #include -#include - +#include using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -49,66 +48,6 @@ using ::rtl::OUString; namespace xmlscript { -void lclExportBindableAndListSourceBits( Reference< frame::XModel > const & xDocument, const Reference< beans::XPropertySet >& _xProps, ElementDescriptor& rModel ) -{ - Reference< lang::XMultiServiceFactory > xFac; - if ( xDocument.is() ) - xFac.set( xDocument, uno::UNO_QUERY ); - - Reference< form::binding::XBindableValue > xBinding( _xProps, UNO_QUERY ); - - if ( xFac.is() && xBinding.is() ) - { - try - { - 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 aAddress; - xBindable->getPropertyValue( OUSTR("BoundCell") ) >>= aAddress; - xConvertor->setPropertyValue( OUSTR("Address"), makeAny( aAddress ) ); - rtl::OUString sAddress; - xConvertor->getPropertyValue( OUSTR("PersistentRepresentation") ) >>= sAddress; - if ( sAddress.getLength() > 0 ) - rModel.addAttribute( OUSTR(XMLNS_DIALOGS_PREFIX ":linked-cell"), sAddress ); - - OSL_TRACE( "*** Bindable value %s", rtl::OUStringToOString( sAddress, RTL_TEXTENCODING_UTF8 ).getStr() ); - - } - } - catch( uno::Exception& ) - { - } - } - Reference< form::binding::XListEntrySink > xEntrySink( _xProps, UNO_QUERY ); - if ( xEntrySink.is() ) - { - Reference< beans::XPropertySet > xListSource( xEntrySink->getListEntrySource(), UNO_QUERY ); - if ( xListSource.is() ) - { - try - { - Reference< beans::XPropertySet > xConvertor( xFac->createInstance( OUSTR( "com.sun.star.table.CellRangeAddressConversion" )), uno::UNO_QUERY ); - - table::CellRangeAddress aAddress; - 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 ) - rModel.addAttribute( OUSTR(XMLNS_DIALOGS_PREFIX ":source-cell-range"), sAddress ); - } - catch( uno::Exception& ) - { - } - } - } - -} static inline bool readBorderProps( ElementDescriptor * element, Style & style ) { @@ -138,7 +77,9 @@ static inline bool readFontProps( ElementDescriptor * element, Style & style ) void ElementDescriptor::readMultiPageModel( StyleBag * all_styles ) { // collect styles - Style aStyle( 0x2 | 0x8 | 0x20 ); + Style aStyle( 0x1 | 0x2 | 0x8 | 0x20 ); + if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("BackgroundColor") ) ) >>= aStyle._backgroundColor) + aStyle._set |= 0x1; if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextColor") ) ) >>= aStyle._textColor) aStyle._set |= 0x2; if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextLineColor") ) ) >>= aStyle._textLineColor) @@ -153,24 +94,101 @@ void ElementDescriptor::readMultiPageModel( StyleBag * all_styles ) // collect elements readDefaults(); - readLongAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ProgressValue") ), + readLongAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("MultiPageValue") ), OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":value") ) ); - readLongAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ProgressValueMax") ), - OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":value-max") ) ); + Any aDecorationAny( _xProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM("Decoration") ) ) ); + bool bDecoration = sal_True; + if ( (aDecorationAny >>= bDecoration) && !bDecoration ) + addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":withtabs") ), OUString( RTL_CONSTASCII_USTRINGPARAM("false") ) ); + + readEvents(); + uno::Reference< container::XNameContainer > xPagesContainer( _xProps, uno::UNO_QUERY ); + if ( xPagesContainer.is() && xPagesContainer->getElementNames().getLength() ) + { + ElementDescriptor * pElem = new ElementDescriptor( _xProps, _xPropState, OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":bulletinboard") ), _xDocument ); + pElem->readBullitinBoard( all_styles ); + addSubElement( pElem ); + } +} +//__________________________________________________________________________________________________ +void ElementDescriptor::readFrameModel( StyleBag * all_styles ) +{ + // collect styles + Style aStyle( 0x1 | 0x2 | 0x8 | 0x20 ); +/* + if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("BackgroundColor") ) ) >>= aStyle._backgroundColor) + aStyle._set |= 0x1; +*/ + if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextColor") ) ) >>= aStyle._textColor) + aStyle._set |= 0x2; + if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextLineColor") ) ) >>= aStyle._textLineColor) + aStyle._set |= 0x20; + if (readFontProps( this, aStyle )) + aStyle._set |= 0x8; + if (aStyle._set) + { + addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":style-id") ), + all_styles->getStyleId( aStyle ) ); + } + // collect elements + readDefaults(); OUString aTitle; - if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("Label") ) ) >>= aTitle) + + if ( readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("Label") ) ) >>= aTitle) { ElementDescriptor * title = new ElementDescriptor( _xProps, _xPropState, - OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":title") ) ); + OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":title") ), _xDocument ); title->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":value") ), aTitle ); addSubElement( title ); } + uno::Reference< container::XNameContainer > xControlContainer( _xProps, uno::UNO_QUERY ); + if ( xControlContainer.is() && xControlContainer->getElementNames().getLength() ) + { + ElementDescriptor * pElem = new ElementDescriptor( _xProps, _xPropState, OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":bulletinboard") ), _xDocument ); + pElem->readBullitinBoard( all_styles ); + addSubElement( pElem ); + } + readEvents(); +} +//__________________________________________________________________________________________________ +void ElementDescriptor::readPageModel( StyleBag * all_styles ) +{ + // collect styles + Style aStyle( 0x1 | 0x2 | 0x8 | 0x20 ); + if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("BackgroundColor") ) ) >>= aStyle._backgroundColor) + aStyle._set |= 0x1; + if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextColor") ) ) >>= aStyle._textColor) + aStyle._set |= 0x2; + if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextLineColor") ) ) >>= aStyle._textLineColor) + aStyle._set |= 0x20; + if (readFontProps( this, aStyle )) + aStyle._set |= 0x8; + if (aStyle._set) + { + addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":style-id") ), + all_styles->getStyleId( aStyle ) ); + } + + // collect elements + readDefaults(); + rtl::OUString aTitle; + readStringAttr( + OUString( RTL_CONSTASCII_USTRINGPARAM("Title") ), + OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":title") ) ); + uno::Reference< container::XNameContainer > xControlContainer( _xProps, uno::UNO_QUERY ); + if ( xControlContainer.is() && xControlContainer->getElementNames().getLength() ) + { + ElementDescriptor * pElem = new ElementDescriptor( _xProps, _xPropState, OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":bulletinboard") ), _xDocument ); + pElem->readBullitinBoard( all_styles ); + addSubElement( pElem ); + } readEvents(); } + void ElementDescriptor::readButtonModel( StyleBag * all_styles ) SAL_THROW( (Exception) ) { @@ -204,8 +222,10 @@ void ElementDescriptor::readButtonModel( StyleBag * all_styles ) OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":valign") ) ); readButtonTypeAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("PushButtonType") ), OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":button-type") ) ); - readStringAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ImageURL") ), - OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":image-src") ) ); + readImageURLAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ImageURL") ), + OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":image-src") ) ); + + readImagePositionAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ImagePosition") ), OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":image-position") ) ); readImageAlignAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ImageAlign") ), @@ -275,8 +295,8 @@ void ElementDescriptor::readCheckBoxModel( StyleBag * all_styles ) OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":align") ) ); readVerticalAlignAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("VerticalAlign") ), OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":valign") ) ); - readStringAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ImageURL") ), - OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":image-src") ) ); + readImageURLAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ImageURL") ), + OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":image-src") ) ); readImagePositionAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ImagePosition") ), OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":image-position") ) ); readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("MultiLine") ), @@ -312,7 +332,7 @@ void ElementDescriptor::readCheckBoxModel( StyleBag * all_styles ) readEvents(); } //__________________________________________________________________________________________________ -void ElementDescriptor::readComboBoxModel( StyleBag * all_styles, Reference< frame::XModel > const & xDocument ) +void ElementDescriptor::readComboBoxModel( StyleBag * all_styles ) SAL_THROW( (Exception) ) { // collect styles @@ -354,7 +374,9 @@ void ElementDescriptor::readComboBoxModel( StyleBag * all_styles, Reference< fra readShortAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("LineCount") ), OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":linecount") ) ); // Cell Range, Ref Cell etc. - lclExportBindableAndListSourceBits( xDocument, _xProps, *this ); + readDataAwareAttr( OUSTR(XMLNS_DIALOGS_PREFIX ":linked-cell") ); + readDataAwareAttr( OUSTR( XMLNS_DIALOGS_PREFIX ":source-cell-range") ); + // string item list Sequence< OUString > itemValues; if ((readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("StringItemList") ) ) >>= itemValues) && @@ -362,14 +384,14 @@ void ElementDescriptor::readComboBoxModel( StyleBag * all_styles, Reference< fra { ElementDescriptor * popup = new ElementDescriptor( _xProps, _xPropState, - OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":menupopup") ) ); + OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":menupopup") ), _xDocument ); OUString const * pItemValues = itemValues.getConstArray(); for ( sal_Int32 nPos = 0; nPos < itemValues.getLength(); ++nPos ) { ElementDescriptor * item = new ElementDescriptor( _xProps, _xPropState, - OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":menuitem") ) ); + OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":menuitem") ), _xDocument ); item->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":value") ), pItemValues[ nPos ] ); popup->addSubElement( item ); @@ -380,7 +402,7 @@ void ElementDescriptor::readComboBoxModel( StyleBag * all_styles, Reference< fra readEvents(); } //__________________________________________________________________________________________________ -void ElementDescriptor::readListBoxModel( StyleBag * all_styles, Reference< frame::XModel > const & xDocument ) +void ElementDescriptor::readListBoxModel( StyleBag * all_styles ) SAL_THROW( (Exception) ) { // collect styles @@ -415,7 +437,8 @@ void ElementDescriptor::readListBoxModel( StyleBag * all_styles, Reference< fram OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":linecount") ) ); readAlignAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Align") ), OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":align") ) ); - lclExportBindableAndListSourceBits( xDocument, _xProps, *this ); + readDataAwareAttr( OUSTR(XMLNS_DIALOGS_PREFIX ":linked-cell") ); + readDataAwareAttr( OUSTR( XMLNS_DIALOGS_PREFIX ":source-cell-range") ); // string item list Sequence< OUString > itemValues; if ((readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("StringItemList") ) ) >>= itemValues) && @@ -423,7 +446,7 @@ void ElementDescriptor::readListBoxModel( StyleBag * all_styles, Reference< fram { ElementDescriptor * popup = new ElementDescriptor( _xProps, _xPropState, - OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":menupopup") ) ); + OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":menupopup") ), _xDocument ); OUString const * pItemValues = itemValues.getConstArray(); sal_Int32 nPos; @@ -431,7 +454,7 @@ void ElementDescriptor::readListBoxModel( StyleBag * all_styles, Reference< fram { ElementDescriptor * item = new ElementDescriptor( _xProps, _xPropState, - OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":menuitem") ) ); + OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":menuitem") ), _xDocument ); item->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":value") ), pItemValues[ nPos ] ); popup->addSubElement( item ); @@ -455,7 +478,7 @@ void ElementDescriptor::readListBoxModel( StyleBag * all_styles, Reference< fram readEvents(); } //__________________________________________________________________________________________________ -void ElementDescriptor::readRadioButtonModel( StyleBag * all_styles, Reference< frame::XModel > const & xDocument ) +void ElementDescriptor::readRadioButtonModel( StyleBag * all_styles ) SAL_THROW( (Exception) ) { // collect styles @@ -486,8 +509,8 @@ void ElementDescriptor::readRadioButtonModel( StyleBag * all_styles, Reference< OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":align") ) ); readVerticalAlignAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("VerticalAlign") ), OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":valign") ) ); - readStringAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ImageURL") ), - OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":image-src") ) ); + readImageURLAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ImageURL") ), + OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":image-src") ) ); readImagePositionAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ImagePosition") ), OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":image-position") ) ); readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("MultiLine") ), @@ -513,7 +536,7 @@ void ElementDescriptor::readRadioButtonModel( StyleBag * all_styles, Reference< break; } } - lclExportBindableAndListSourceBits( xDocument, _xProps, *this ); + readDataAwareAttr( OUSTR(XMLNS_DIALOGS_PREFIX ":linked-cell") ); readEvents(); } //__________________________________________________________________________________________________ @@ -542,7 +565,7 @@ void ElementDescriptor::readGroupBoxModel( StyleBag * all_styles ) { ElementDescriptor * title = new ElementDescriptor( _xProps, _xPropState, - OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":title") ) ); + OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":title") ), _xDocument ); title->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":value") ), aTitle ); addSubElement( title ); @@ -683,10 +706,11 @@ void ElementDescriptor::readEditModel( StyleBag * all_styles ) addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":echochar") ), OUString( &cEcho, 1 ) ); } + readDataAwareAttr( OUSTR(XMLNS_DIALOGS_PREFIX ":linked-cell") ); readEvents(); } //__________________________________________________________________________________________________ -void ElementDescriptor::readImageControlModel( StyleBag * all_styles, com::sun::star::uno::Reference< com::sun::star::frame::XModel > const & xDocument ) +void ElementDescriptor::readImageControlModel( StyleBag * all_styles ) SAL_THROW( (Exception) ) { // collect styles @@ -705,33 +729,10 @@ void ElementDescriptor::readImageControlModel( StyleBag * all_styles, com::sun:: readDefaults(); readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ScaleImage") ), OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":scale-image") ) ); - rtl::OUString sURL; - _xProps->getPropertyValue( OUSTR("ImageURL") ) >>= sURL; - - if ( sURL.indexOf( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "vnd.sun.star.GraphicObject:" ) ) ) == 0 ) - { - Reference< document::XStorageBasedDocument > xDocStorage( xDocument, UNO_QUERY ); - - if ( xDocStorage.is() ) - { - uno::Sequence< Any > aArgs( 1 ); - aArgs[ 0 ] <<= xDocStorage->getDocumentStorage(); - - ::comphelper::ComponentContext aContext( ::comphelper::getProcessServiceFactory() ); - uno::Reference< document::XGraphicObjectResolver > xGraphicResolver; - aContext.createComponentWithArguments( OUSTR( "com.sun.star.comp.Svx.GraphicExportHelper" ), aArgs, xGraphicResolver ); - if ( xGraphicResolver.is() ) - { - sURL = xGraphicResolver->resolveGraphicObjectURL( sURL ); - } - } - } - if ( sURL.getLength() > 0 ) - { - addAttribute( OUSTR(XMLNS_DIALOGS_PREFIX ":src"), sURL ); - } readBoolAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Tabstop") ), OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":tabstop") ) ); + readImageURLAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ImageURL") ), + OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":src") ) ); readEvents(); } //__________________________________________________________________________________________________ @@ -1151,6 +1152,45 @@ void ElementDescriptor::readFormattedFieldModel( StyleBag * all_styles ) 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") ) ); + readDataAwareAttr( OUSTR(XMLNS_DIALOGS_PREFIX ":linked-cell") ); + readEvents(); +} + //__________________________________________________________________________________________________ void ElementDescriptor::readFixedLineModel( StyleBag * all_styles ) SAL_THROW( (Exception) ) @@ -1206,7 +1246,7 @@ void ElementDescriptor::readProgressBarModel( StyleBag * all_styles ) readEvents(); } //__________________________________________________________________________________________________ -void ElementDescriptor::readScrollBarModel( StyleBag * all_styles, Reference< frame::XModel > const & xDocument ) +void ElementDescriptor::readScrollBarModel( StyleBag * all_styles ) SAL_THROW( (Exception) ) { // collect styles @@ -1244,47 +1284,7 @@ void ElementDescriptor::readScrollBarModel( StyleBag * all_styles, Reference< fr 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 ); + readDataAwareAttr( OUSTR(XMLNS_DIALOGS_PREFIX ":linked-cell") ); readEvents(); } //__________________________________________________________________________________________________ @@ -1340,6 +1340,251 @@ void ElementDescriptor::readDialogModel( StyleBag * all_styles ) readEvents(); } +void ElementDescriptor::readBullitinBoard( StyleBag * all_styles ) + SAL_THROW( (Exception) ) +{ + // collect elements + ::std::vector< ElementDescriptor* > all_elements; + // read out all props + Reference< container::XNameContainer > xDialogModel( _xProps, UNO_QUERY ); + if ( !xDialogModel.is() ) + return; // #TODO throw??? + Sequence< OUString > aElements( xDialogModel->getElementNames() ); + OUString const * pElements = aElements.getConstArray(); + + ElementDescriptor * pRadioGroup = 0; + + sal_Int32 nPos; + for ( nPos = 0; nPos < aElements.getLength(); ++nPos ) + { + Any aControlModel( xDialogModel->getByName( pElements[ nPos ] ) ); + Reference< beans::XPropertySet > xProps; + OSL_VERIFY( aControlModel >>= xProps ); + if (! xProps.is()) + continue; + Reference< beans::XPropertyState > xPropState( xProps, UNO_QUERY ); + OSL_ENSURE( xPropState.is(), "no XPropertyState!" ); + if (! xPropState.is()) + continue; + Reference< lang::XServiceInfo > xServiceInfo( xProps, UNO_QUERY ); + OSL_ENSURE( xServiceInfo.is(), "no XServiceInfo!" ); + if (! xServiceInfo.is()) + continue; + + ElementDescriptor * pElem = 0; + + // group up radio buttons + if ( xServiceInfo->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlRadioButtonModel") ) ) ) + { + if (! pRadioGroup) // open radiogroup + { + pRadioGroup = new ElementDescriptor( + xProps, xPropState, + OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":radiogroup") ), _xDocument ); + all_elements.push_back( pRadioGroup ); + } + + pElem = new ElementDescriptor( + xProps, xPropState, + OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":radio") ), _xDocument ); + pElem->readRadioButtonModel( all_styles ); + pRadioGroup->addSubElement( pElem ); + } + else // no radio + { + pRadioGroup = 0; // close radiogroup + + if (xServiceInfo->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlButtonModel") ) ) ) + { + pElem = new ElementDescriptor( + xProps, xPropState, + OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":button") ), _xDocument ); + pElem->readButtonModel( all_styles ); + } + else if (xServiceInfo->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlCheckBoxModel") ) ) ) + { + pElem = new ElementDescriptor( + xProps, xPropState, + OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":checkbox") ), _xDocument ); + pElem->readCheckBoxModel( all_styles ); + } + else if (xServiceInfo->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlComboBoxModel") ) ) ) + { + pElem = new ElementDescriptor( + xProps, xPropState, + OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":combobox") ), _xDocument ); + pElem->readComboBoxModel( all_styles ); + } + else if (xServiceInfo->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlListBoxModel") ) ) ) + { + pElem = new ElementDescriptor( + xProps, xPropState, + OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":menulist") ), _xDocument ); + pElem->readListBoxModel( all_styles ); + } + else if (xServiceInfo->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlGroupBoxModel") ) ) ) + { + pElem = new ElementDescriptor( + xProps, xPropState, + OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":titledbox") ), _xDocument ); + pElem->readGroupBoxModel( all_styles ); + } + else if (xServiceInfo->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoMultiPageModel") ) ) ) + { + pElem = new ElementDescriptor( + xProps, xPropState, + OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":multipage") ), _xDocument ); + pElem->readMultiPageModel( all_styles ); + } + else if (xServiceInfo->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoFrameModel") ) ) ) + { + pElem = new ElementDescriptor( + xProps, xPropState, + OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":frame") ), _xDocument ); + pElem->readFrameModel( all_styles ); + } + else if (xServiceInfo->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoPageModel") ) ) ) + { + pElem = new ElementDescriptor( + xProps, xPropState, + OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":page") ), _xDocument ); + pElem->readPageModel( all_styles ); + } + else if (xServiceInfo->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlFixedTextModel") ) ) ) + { + pElem = new ElementDescriptor( + xProps, xPropState, + OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":text") ), _xDocument ); + pElem->readFixedTextModel( all_styles ); + } + else if (xServiceInfo->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlEditModel") ) ) ) + { + pElem = new ElementDescriptor( + xProps, xPropState, + OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":textfield") ), _xDocument ); + pElem->readEditModel( all_styles ); + } + // FixedHyperLink + else if (xServiceInfo->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlFixedHyperlinkModel") ) ) ) + { + pElem = new ElementDescriptor( + xProps, xPropState, + OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":linklabel") ), _xDocument ); + pElem->readFixedHyperLinkModel( all_styles ); + } + else if (xServiceInfo->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlImageControlModel") ) ) ) + { + pElem = new ElementDescriptor( + xProps, xPropState, + OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":img") ), _xDocument ); + pElem->readImageControlModel( all_styles ); + } + else if (xServiceInfo->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlFileControlModel") ) ) ) + { + pElem = new ElementDescriptor( + xProps, xPropState, + OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":filecontrol") ), _xDocument ); + pElem->readFileControlModel( all_styles ); + } + else if (xServiceInfo->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.tree.TreeControlModel") ) ) ) + { + pElem = new ElementDescriptor( + xProps, xPropState, + OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":treecontrol") ), _xDocument ); + pElem->readTreeControlModel( all_styles ); + } + else if (xServiceInfo->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlCurrencyFieldModel") ) ) ) + { + pElem = new ElementDescriptor( + xProps, xPropState, + OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":currencyfield") ), _xDocument ); + pElem->readCurrencyFieldModel( all_styles ); + } + else if (xServiceInfo->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlDateFieldModel") ) ) ) + { + pElem = new ElementDescriptor( + xProps, xPropState, + OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":datefield") ), _xDocument ); + pElem->readDateFieldModel( all_styles ); + } + else if (xServiceInfo->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlNumericFieldModel") ) ) ) + { + pElem = new ElementDescriptor( + xProps, xPropState, + OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":numericfield") ), _xDocument ); + pElem->readNumericFieldModel( all_styles ); + } + else if (xServiceInfo->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlTimeFieldModel") ) ) ) + { + pElem = new ElementDescriptor( + xProps, xPropState, + OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":timefield") ) , _xDocument); + pElem->readTimeFieldModel( all_styles ); + } + else if (xServiceInfo->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlPatternFieldModel") ) ) ) + { + pElem = new ElementDescriptor( + xProps, xPropState, + OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":patternfield") ), _xDocument ); + pElem->readPatternFieldModel( all_styles ); + } + else if (xServiceInfo->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlFormattedFieldModel") ) ) ) + { + pElem = new ElementDescriptor( + xProps, xPropState, + OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":formattedfield") ), _xDocument ); + pElem->readFormattedFieldModel( all_styles ); + } + else if (xServiceInfo->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlFixedLineModel") ) ) ) + { + pElem = new ElementDescriptor( + xProps, xPropState, + OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":fixedline") ), _xDocument ); + pElem->readFixedLineModel( all_styles ); + } + else if (xServiceInfo->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlScrollBarModel") ) ) ) + { + pElem = new ElementDescriptor( + xProps, xPropState, + OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":scrollbar") ), _xDocument ); + 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") ), _xDocument ); + pElem->readSpinButtonModel( all_styles ); + } + else if (xServiceInfo->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlProgressBarModel") ) ) ) + { + pElem = new ElementDescriptor( + xProps, xPropState, + OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":progressmeter") ), _xDocument ); + pElem->readProgressBarModel( all_styles ); + } + // + + if (pElem) + { + all_elements.push_back( pElem ); + } + else + { + OSL_ENSURE( sal_False, "unknown control type!" ); + continue; + } + } + } + if (! all_elements.empty()) + { + for ( std::size_t n = 0; n < all_elements.size(); ++n ) + { + addSubElement( all_elements[ n ] ); + } + } +} + } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx index cec44ca50a04..4ae2ebdabc11 100644 --- a/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx +++ b/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx @@ -47,6 +47,8 @@ #include #include +#include + #include #include @@ -58,6 +60,17 @@ #include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -777,6 +790,33 @@ void ElementDescriptor::readVerticalAlignAttr( OUString const & rPropName, OUStr } } //__________________________________________________________________________________________________ +void ElementDescriptor::readImageURLAttr( OUString const & rPropName, OUString const & rAttrName ) +{ + if (beans::PropertyState_DEFAULT_VALUE != _xPropState->getPropertyState( rPropName )) + { + rtl::OUString sURL; + _xProps->getPropertyValue( rPropName ) >>= sURL; + + if ( sURL.getLength() && sURL.compareToAscii( XMLSCRIPT_GRAPHOBJ_URLPREFIX, RTL_CONSTASCII_LENGTH( XMLSCRIPT_GRAPHOBJ_URLPREFIX ) ) == 0 ) + { + Reference< document::XStorageBasedDocument > xDocStorage( _xDocument, UNO_QUERY ); + if ( xDocStorage.is() ) + { + uno::Sequence< Any > aArgs( 1 ); + aArgs[ 0 ] <<= xDocStorage->getDocumentStorage(); + + ::comphelper::ComponentContext aContext( ::comphelper::getProcessServiceFactory() ); + uno::Reference< document::XGraphicObjectResolver > xGraphicResolver; + aContext.createComponentWithArguments( OUSTR( "com.sun.star.comp.Svx.GraphicExportHelper" ), aArgs, xGraphicResolver ); + if ( xGraphicResolver.is() ) + sURL = xGraphicResolver->resolveGraphicObjectURL( sURL ); + } + } + if ( sURL.getLength() ) + addAttribute( rAttrName, sURL ); + } +} +//__________________________________________________________________________________________________ void ElementDescriptor::readImageAlignAttr( OUString const & rPropName, OUString const & rAttrName ) { if (beans::PropertyState_DEFAULT_VALUE != _xPropState->getPropertyState( rPropName )) @@ -940,6 +980,66 @@ void ElementDescriptor::readLineEndFormatAttr( OUString const & rPropName, OUStr } } //__________________________________________________________________________________________________ +void ElementDescriptor::readDataAwareAttr( OUString const & rAttrName ) +{ + Reference< lang::XMultiServiceFactory > xFac; + if ( _xDocument.is() ) + xFac.set( _xDocument, uno::UNO_QUERY ); + + Reference< form::binding::XBindableValue > xBinding( _xProps, UNO_QUERY ); + + if ( xFac.is() && xBinding.is() && rAttrName.equals( OUSTR(XMLNS_DIALOGS_PREFIX ":linked-cell") ) ) + { + try + { + 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 aAddress; + xBindable->getPropertyValue( OUSTR("BoundCell") ) >>= aAddress; + xConvertor->setPropertyValue( OUSTR("Address"), makeAny( aAddress ) ); + rtl::OUString sAddress; + xConvertor->getPropertyValue( OUSTR("PersistentRepresentation") ) >>= sAddress; + if ( sAddress.getLength() > 0 ) + addAttribute( rAttrName, sAddress ); + + OSL_TRACE( "*** Bindable value %s", rtl::OUStringToOString( sAddress, RTL_TEXTENCODING_UTF8 ).getStr() ); + + } + } + catch( uno::Exception& ) + { + } + } + Reference< form::binding::XListEntrySink > xEntrySink( _xProps, UNO_QUERY ); + if ( xEntrySink.is() && rAttrName.equals( OUSTR( XMLNS_DIALOGS_PREFIX ":source-cell-range") ) ) + { + Reference< beans::XPropertySet > xListSource( xEntrySink->getListEntrySource(), UNO_QUERY ); + if ( xListSource.is() ) + { + try + { + Reference< beans::XPropertySet > xConvertor( xFac->createInstance( OUSTR( "com.sun.star.table.CellRangeAddressConversion" )), uno::UNO_QUERY ); + + table::CellRangeAddress aAddress; + 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( rAttrName, sAddress ); + } + catch( uno::Exception& ) + { + } + } + } +} +//__________________________________________________________________________________________________ void ElementDescriptor::readSelectionTypeAttr( OUString const & rPropName, OUString const & rAttrName ) { if (beans::PropertyState_DEFAULT_VALUE != _xPropState->getPropertyState( rPropName )) @@ -976,6 +1076,28 @@ void ElementDescriptor::readSelectionTypeAttr( OUString const & rPropName, OUStr void ElementDescriptor::readDefaults( bool supportPrintable, bool supportVisible ) { Any a( _xProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM("Name") ) ) ); + + // The following is a hack to allow 'form' controls to override the default + // control supported by dialogs. This should work well for both vba support and + // normal openoffice ( when normal 'Dialogs' decide to support form control models ) + // In the future VBA support might require custom models ( and not the just the form + // variant of a control that we currently use ) In this case the door is still open, + // we just need to define a new way for the 'ServiceName' to be extracted from the + // incomming model. E.g. the use of supporting service + // "com.sun.star.form.FormComponent", 'ServiceName' and XPersistObject + // is only an implementation detail here, in the future some other + // method ( perhaps a custom prop ) could be used instead. + Reference< lang::XServiceInfo > xSrvInfo( _xProps, UNO_QUERY ); + if ( xSrvInfo.is() && xSrvInfo->supportsService( OUSTR("com.sun.star.form.FormComponent" ) ) ) + { + Reference< io::XPersistObject > xPersist( _xProps, UNO_QUERY ); + if ( xPersist.is() ) + { + OUString sCtrlName = xPersist->getServiceName(); + if ( sCtrlName.getLength() ) + addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":control-implementation") ), sCtrlName ); + } + } addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":id") ), * reinterpret_cast< const OUString * >( a.getValue() ) ); readShortAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("TabIndex") ), @@ -1331,248 +1453,17 @@ void SAL_CALL exportDialogModel( SAL_THROW( (Exception) ) { StyleBag all_styles; - ::std::vector< Reference< xml::sax::XAttributeList > > all_elements; - - // read out all props - - Sequence< OUString > aElements( xDialogModel->getElementNames() ); - OUString const * pElements = aElements.getConstArray(); - - ElementDescriptor * pRadioGroup = 0; - - sal_Int32 nPos; - for ( nPos = 0; nPos < aElements.getLength(); ++nPos ) - { - Any aControlModel( xDialogModel->getByName( pElements[ nPos ] ) ); - Reference< beans::XPropertySet > xProps; - OSL_VERIFY( aControlModel >>= xProps ); - if (! xProps.is()) - continue; - Reference< beans::XPropertyState > xPropState( xProps, UNO_QUERY ); - OSL_ENSURE( xPropState.is(), "no XPropertyState!" ); - if (! xPropState.is()) - continue; - Reference< lang::XServiceInfo > xServiceInfo( xProps, UNO_QUERY ); - OSL_ENSURE( xServiceInfo.is(), "no XServiceInfo!" ); - if (! xServiceInfo.is()) - continue; - - ElementDescriptor * pElem = 0; - Reference< xml::sax::XAttributeList > xElem; - - // group up radio buttons - if ( xServiceInfo->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlRadioButtonModel") ) ) ) - { - if (! pRadioGroup) // open radiogroup - { - pRadioGroup = new ElementDescriptor( - xProps, xPropState, - OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":radiogroup") ) ); - all_elements.push_back( pRadioGroup ); - } - - pElem = new ElementDescriptor( - xProps, xPropState, - OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":radio") ) ); - xElem = static_cast< xml::sax::XAttributeList * >( pElem ); - pElem->readRadioButtonModel( &all_styles, xDocument ); - pRadioGroup->addSubElement( xElem ); - } - else // no radio - { - pRadioGroup = 0; // close radiogroup + // window + Reference< beans::XPropertySet > xProps( xDialogModel, UNO_QUERY ); + OSL_ASSERT( xProps.is() ); + Reference< beans::XPropertyState > xPropState( xProps, UNO_QUERY ); + OSL_ASSERT( xPropState.is() ); - if (xServiceInfo->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlButtonModel") ) ) ) - { - pElem = new ElementDescriptor( - xProps, xPropState, - OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":button") ) ); - xElem = static_cast< xml::sax::XAttributeList * >( pElem ); - pElem->readButtonModel( &all_styles ); - } - else if (xServiceInfo->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlCheckBoxModel") ) ) ) - { - pElem = new ElementDescriptor( - xProps, xPropState, - OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":checkbox") ) ); - xElem = static_cast< xml::sax::XAttributeList * >( pElem ); - pElem->readCheckBoxModel( &all_styles ); - } - else if (xServiceInfo->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlComboBoxModel") ) ) ) - { - pElem = new ElementDescriptor( - xProps, xPropState, - OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":combobox") ) ); - xElem = static_cast< xml::sax::XAttributeList * >( pElem ); - pElem->readComboBoxModel( &all_styles, xDocument ); - } - else if (xServiceInfo->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlListBoxModel") ) ) ) - { - pElem = new ElementDescriptor( - xProps, xPropState, - OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":menulist") ) ); - xElem = static_cast< xml::sax::XAttributeList * >( pElem ); - pElem->readListBoxModel( &all_styles, xDocument ); - } - else if (xServiceInfo->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlGroupBoxModel") ) ) ) - { - pElem = new ElementDescriptor( - xProps, xPropState, - OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":titledbox") ) ); - xElem = static_cast< xml::sax::XAttributeList * >( pElem ); - pElem->readGroupBoxModel( &all_styles ); - } - else if (xServiceInfo->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoMultiPageModel") ) ) ) - { - pElem = new ElementDescriptor( - xProps, xPropState, - OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":multipage") ) ); - xElem = static_cast< xml::sax::XAttributeList * >( pElem ); - pElem->readMultiPageModel( &all_styles ); - } - else if (xServiceInfo->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlFixedTextModel") ) ) ) - { - pElem = new ElementDescriptor( - xProps, xPropState, - OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":text") ) ); - xElem = static_cast< xml::sax::XAttributeList * >( pElem ); - pElem->readFixedTextModel( &all_styles ); - } - else if (xServiceInfo->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlEditModel") ) ) ) - { - pElem = new ElementDescriptor( - xProps, xPropState, - OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":textfield") ) ); - xElem = static_cast< xml::sax::XAttributeList * >( pElem ); - pElem->readEditModel( &all_styles ); - } - // FixedHyperLink - else if (xServiceInfo->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlFixedHyperlinkModel") ) ) ) - { - pElem = new ElementDescriptor( - xProps, xPropState, - OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":linklabel") ) ); - xElem = static_cast< xml::sax::XAttributeList * >( pElem ); - pElem->readFixedHyperLinkModel( &all_styles ); - } - else if (xServiceInfo->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlImageControlModel") ) ) ) - { - pElem = new ElementDescriptor( - xProps, xPropState, - OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":img") ) ); - xElem = static_cast< xml::sax::XAttributeList * >( pElem ); - pElem->readImageControlModel( &all_styles, xDocument ); - } - else if (xServiceInfo->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlFileControlModel") ) ) ) - { - pElem = new ElementDescriptor( - xProps, xPropState, - OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":filecontrol") ) ); - xElem = static_cast< xml::sax::XAttributeList * >( pElem ); - pElem->readFileControlModel( &all_styles ); - } - else if (xServiceInfo->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.tree.TreeControlModel") ) ) ) - { - pElem = new ElementDescriptor( - xProps, xPropState, - OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":treecontrol") ) ); - xElem = static_cast< xml::sax::XAttributeList * >( pElem ); - pElem->readTreeControlModel( &all_styles ); - } - else if (xServiceInfo->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlCurrencyFieldModel") ) ) ) - { - pElem = new ElementDescriptor( - xProps, xPropState, - OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":currencyfield") ) ); - xElem = static_cast< xml::sax::XAttributeList * >( pElem ); - pElem->readCurrencyFieldModel( &all_styles ); - } - else if (xServiceInfo->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlDateFieldModel") ) ) ) - { - pElem = new ElementDescriptor( - xProps, xPropState, - OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":datefield") ) ); - xElem = static_cast< xml::sax::XAttributeList * >( pElem ); - pElem->readDateFieldModel( &all_styles ); - } - else if (xServiceInfo->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlNumericFieldModel") ) ) ) - { - pElem = new ElementDescriptor( - xProps, xPropState, - OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":numericfield") ) ); - xElem = static_cast< xml::sax::XAttributeList * >( pElem ); - pElem->readNumericFieldModel( &all_styles ); - } - else if (xServiceInfo->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlTimeFieldModel") ) ) ) - { - pElem = new ElementDescriptor( + ElementDescriptor * pElem = new ElementDescriptor( xProps, xPropState, - OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":timefield") ) ); - xElem = static_cast< xml::sax::XAttributeList * >( pElem ); - pElem->readTimeFieldModel( &all_styles ); - } - else if (xServiceInfo->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlPatternFieldModel") ) ) ) - { - pElem = new ElementDescriptor( - xProps, xPropState, - OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":patternfield") ) ); - xElem = static_cast< xml::sax::XAttributeList * >( pElem ); - pElem->readPatternFieldModel( &all_styles ); - } - else if (xServiceInfo->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlFormattedFieldModel") ) ) ) - { - pElem = new ElementDescriptor( - xProps, xPropState, - OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":formattedfield") ) ); - xElem = static_cast< xml::sax::XAttributeList * >( pElem ); - pElem->readFormattedFieldModel( &all_styles ); - } - else if (xServiceInfo->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlFixedLineModel") ) ) ) - { - pElem = new ElementDescriptor( - xProps, xPropState, - OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":fixedline") ) ); - xElem = static_cast< xml::sax::XAttributeList * >( pElem ); - pElem->readFixedLineModel( &all_styles ); - } - else if (xServiceInfo->supportsService( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlScrollBarModel") ) ) ) - { - pElem = new ElementDescriptor( - xProps, xPropState, - OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":scrollbar") ) ); - xElem = static_cast< xml::sax::XAttributeList * >( pElem ); - 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") ) ) ) - { - pElem = new ElementDescriptor( - xProps, xPropState, - OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":progressmeter") ) ); - xElem = static_cast< xml::sax::XAttributeList * >( pElem ); - pElem->readProgressBarModel( &all_styles ); - } - // - - OSL_ASSERT( xElem.is() ); - if (xElem.is()) - { - all_elements.push_back( xElem ); - } - else - { - OSL_ENSURE( sal_False, "unknown control type!" ); - continue; - } - } - } + OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":bulletinboard") ), xDocument ); + Reference< xml::sax::XAttributeList > xElem( pElem ); + pElem->readBullitinBoard( &all_styles ); xOut->startDocument(); @@ -1582,14 +1473,9 @@ void SAL_CALL exportDialogModel( xOut->unknown( aDocTypeStr ); xOut->ignorableWhitespace( OUString() ); - // window - Reference< beans::XPropertySet > xProps( xDialogModel, UNO_QUERY ); - OSL_ASSERT( xProps.is() ); - Reference< beans::XPropertyState > xPropState( xProps, UNO_QUERY ); - OSL_ASSERT( xPropState.is() ); OUString aWindowName( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":window") ); - ElementDescriptor * pWindow = new ElementDescriptor( xProps, xPropState, aWindowName ); + ElementDescriptor * pWindow = new ElementDescriptor( xProps, xPropState, aWindowName, xDocument ); Reference< xml::sax::XAttributeList > xWindow( pWindow ); pWindow->readDialogModel( &all_styles ); xOut->ignorableWhitespace( OUString() ); @@ -1599,20 +1485,14 @@ void SAL_CALL exportDialogModel( // dump out stylebag all_styles.dump( xOut ); - if (! all_elements.empty()) + if ( xDialogModel->getElementNames().getLength() ) { // open up bulletinboard OUString aBBoardName( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":bulletinboard") ); xOut->ignorableWhitespace( OUString() ); - xOut->startElement( aBBoardName, Reference< xml::sax::XAttributeList >() ); - - // export control elements - for ( std::size_t n = 0; n < all_elements.size(); ++n ) - { - ElementDescriptor * pElem = static_cast< ElementDescriptor * >( all_elements[ n ].get() ); - pElem->dump( xOut.get() ); - } + xOut->startElement( aBBoardName, xElem ); + pElem->dumpSubElements( xOut.get() ); // end bulletinboard xOut->ignorableWhitespace( OUString() ); xOut->endElement( aBBoardName ); diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx index 901aeac8127a..4baa8f2a9710 100644 --- a/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx +++ b/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx @@ -49,30 +49,102 @@ using ::rtl::OUString; namespace xmlscript { -Reference< xml::input::XElement > MultiPage::startChildElement( + +Reference< xml::input::XElement > Frame::startChildElement( sal_Int32 nUid, OUString const & rLocalName, Reference< xml::input::XAttributes > const & xAttributes ) - throw (xml::sax::SAXException, RuntimeException) + throw (xml::sax::SAXException, RuntimeException) { + if ( !m_xContainer.is() ) + m_xContainer.set( _pImport->_xDialogModelFactory->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoFrameModel") ) ), UNO_QUERY ); // event -rtl::OUString _label = rtl::OUString::createFromAscii("foo"); if (_pImport->isEventElement( nUid, rLocalName )) { - return new EventElement( + return new EventElement( nUid, rLocalName, xAttributes, this, _pImport ); } + else if (rLocalName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("bulletinboard") )) + { + // Create new DialogImport for this container + DialogImport* pFrameImport = new DialogImport( *_pImport ); + pFrameImport->_xDialogModel = m_xContainer; + return new BulletinBoardElement( rLocalName, xAttributes, this, pFrameImport ); + } else if (rLocalName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("title") )) { getStringAttr( &_label, - OUString( RTL_CONSTASCII_USTRINGPARAM("value") ), - xAttributes, - _pImport->XMLNS_DIALOGS_UID ); + OUString( RTL_CONSTASCII_USTRINGPARAM("value") ), + xAttributes, + _pImport->XMLNS_DIALOGS_UID ); return new ElementBase( _pImport->XMLNS_DIALOGS_UID, rLocalName, xAttributes, this, _pImport ); } else + { + OSL_TRACE("****** ARGGGGG!!!! **********"); + throw xml::sax::SAXException( + OUString( RTL_CONSTASCII_USTRINGPARAM("expected event element!") ), + Reference< XInterface >(), Any() ); + } +} +//__________________________________________________________________________________________________ + +void Frame::endElement() + throw (xml::sax::SAXException, RuntimeException) +{ + if ( !m_xContainer.is() ) + m_xContainer.set( _pImport->_xDialogModelFactory->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoFrameModel") ) ), UNO_QUERY ); + Reference< beans::XPropertySet > xProps( m_xContainer, UNO_QUERY_THROW ); + // _pImport is what we need to add to ( e.g. the dialog in this case ) + ControlImportContext ctx( _pImport, xProps, getControlId( _xAttributes ) ); + + Reference< beans::XPropertySet > xControlModel( ctx.getControlModel() ); + + Reference< xml::input::XElement > xStyle( getStyle( _xAttributes ) ); + if (xStyle.is()) + { + StyleElement * pStyle = static_cast< StyleElement * >( xStyle.get () ); + pStyle->importTextColorStyle( xControlModel ); + pStyle->importTextLineColorStyle( xControlModel ); + pStyle->importFontStyle( xControlModel ); + } + + ctx.importDefaults( 0, 0, _xAttributes ); // inherited from BulletinBoardElement + if (_label.getLength()) + { + xControlModel->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM("Label") ), + makeAny( _label ) ); + } + ctx.importEvents( _events ); + // avoid ring-reference: + // vector< event elements > holding event elements holding this (via _pParent) + _events.clear(); +} + +//=== +Reference< xml::input::XElement > MultiPage::startChildElement( + sal_Int32 nUid, OUString const & rLocalName, + Reference< xml::input::XAttributes > const & xAttributes ) + throw (xml::sax::SAXException, RuntimeException) +{ + // event +rtl::OUString _label = rtl::OUString::createFromAscii("foo"); + if (_pImport->isEventElement( nUid, rLocalName )) + { + return new EventElement( + nUid, rLocalName, xAttributes, this, _pImport ); + } + else if (rLocalName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("bulletinboard") )) + { + // Create new DialogImport for this container + + DialogImport* pMultiPageImport = new DialogImport( *_pImport ); + pMultiPageImport->_xDialogModel = m_xContainer; + return new BulletinBoardElement( rLocalName, xAttributes, this, pMultiPageImport ); + } + else { throw xml::sax::SAXException( @@ -85,10 +157,10 @@ rtl::OUString _label = rtl::OUString::createFromAscii("foo"); void MultiPage::endElement() throw (xml::sax::SAXException, RuntimeException) { - ControlImportContext ctx( - _pImport, getControlId( _xAttributes ), - OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoMultiPageModel") ) ); -// OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlGroupBoxModel") ) ); + Reference< beans::XPropertySet > xProps( m_xContainer, UNO_QUERY_THROW ); + // _pImport is what we need to add to ( e.g. the dialog in this case ) + ControlImportContext ctx( _pImport, xProps, getControlId( _xAttributes )); + Reference< beans::XPropertySet > xControlModel( ctx.getControlModel() ); Reference< xml::input::XElement > xStyle( getStyle( _xAttributes ) ); @@ -98,125 +170,76 @@ void MultiPage::endElement() pStyle->importTextColorStyle( xControlModel ); pStyle->importTextLineColorStyle( xControlModel ); pStyle->importFontStyle( xControlModel ); + pStyle->importBackgroundColorStyle( xControlModel ); } ctx.importDefaults( 0, 0, _xAttributes ); // inherited from BulletinBoardElement - ctx.importLongProperty( OUString( RTL_CONSTASCII_USTRINGPARAM("ProgressValue") ), + ctx.importLongProperty( OUString( RTL_CONSTASCII_USTRINGPARAM("MultiPageValue") ), OUString( RTL_CONSTASCII_USTRINGPARAM("value") ), _xAttributes ); - ctx.importLongProperty( OUString( RTL_CONSTASCII_USTRINGPARAM("ProgressValueMax") ), - OUString( RTL_CONSTASCII_USTRINGPARAM("value-max") ), - _xAttributes ); + ctx.importBooleanProperty( + OUString( RTL_CONSTASCII_USTRINGPARAM("Decoration") ), + OUString( RTL_CONSTASCII_USTRINGPARAM("withtabs") ), + _xAttributes ); ctx.importEvents( _events ); // avoid ring-reference: // vector< event elements > holding event elements holding this (via _pParent) _events.clear(); } -// #FIXME cut'n'pasted from xmloff/source/core/xmlimp.cxx:1251 -// of course we need to find a common home for this helper - -bool IsPackageURL( const ::rtl::OUString& rURL ) +Reference< xml::input::XElement > Page::startChildElement( + sal_Int32 nUid, OUString const & rLocalName, + Reference< xml::input::XAttributes > const & xAttributes ) + throw (xml::sax::SAXException, RuntimeException) { - // Some quick tests: Some may rely on the package structure! - sal_Int32 nLen = rURL.getLength(); - if( (nLen > 0 && '/' == rURL[0]) ) - // RFC2396 net_path or abs_path - return false; - else if( nLen > 1 && '.' == rURL[0] ) - { - if( '.' == rURL[1] ) - // ../: We are never going up one level, so we know - // it's not an external URI - return false; - else if( '/' == rURL[1] ) - // we are remaining on a level, so it's an package URI - return true; - } - - // Now check for a RFC2396 schema - sal_Int32 nPos = 1; - while( nPos < nLen ) - { - switch( rURL[nPos] ) - { - case '/': - // a relative path segement - return true; - case ':': - // a schema - return false; - default: - break; - // we don't care about any other characters - } - ++nPos; + // event + if (_pImport->isEventElement( nUid, rLocalName )) + { + return new EventElement( + nUid, rLocalName, xAttributes, this, _pImport ); + } + else if (rLocalName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("bulletinboard") )) + { + + DialogImport* pPageImport = new DialogImport( *_pImport ); + pPageImport->_xDialogModel = m_xContainer; + return new BulletinBoardElement( rLocalName, xAttributes, this, pPageImport ); } + else + { - return true; + throw xml::sax::SAXException( + OUString( RTL_CONSTASCII_USTRINGPARAM("expected event element!") ), + Reference< XInterface >(), Any() ); + } } +//__________________________________________________________________________________________________ -void importBindableAndListRangeBits( DialogImport* _pImport, const rtl::OUString sLinkedCell, const rtl::OUString & sCellRange, ControlImportContext& ctx ) +void Page::endElement() + throw (xml::sax::SAXException, RuntimeException) { - 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; + Reference< beans::XPropertySet > xProps( m_xContainer, UNO_QUERY_THROW ); - uno::Reference< form::binding::XValueBinding > xBinding( xFac->createInstanceWithArguments( OUSTR("com.sun.star.table.CellValueBinding" ), aArgs ), uno::UNO_QUERY ); - xBindable->setValueBinding( xBinding ); + ControlImportContext ctx( _pImport, xProps, getControlId( _xAttributes )); - } - } - // 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 ); - - } - } - } -} + Reference< beans::XPropertySet > xControlModel( ctx.getControlModel() ); -sal_Bool isVBACompatibilityMode( DialogImport* _pImport ) -{ - sal_Bool bVBAMode = sal_False; - Reference< script::vba::XVBACompatibility > xVBACompat( _pImport->getScriptLibraryContainer(), UNO_QUERY ); - if( xVBACompat.is() ) + Reference< xml::input::XElement > xStyle( getStyle( _xAttributes ) ); + if (xStyle.is()) { - bVBAMode = xVBACompat->getVBACompatibilityMode(); + StyleElement * pStyle = static_cast< StyleElement * >( xStyle.get () ); + pStyle->importTextColorStyle( xControlModel ); + pStyle->importTextLineColorStyle( xControlModel ); + pStyle->importFontStyle( xControlModel ); + pStyle->importBackgroundColorStyle( xControlModel ); } - return bVBAMode; + + ctx.importDefaults( 0, 0, _xAttributes ); // inherited from BulletinBoardElement + ctx.importStringProperty( OUString( RTL_CONSTASCII_USTRINGPARAM("Title") ), OUString( RTL_CONSTASCII_USTRINGPARAM("title") ), _xAttributes ); + ctx.importEvents( _events ); + // avoid ring-reference: + // vector< event elements > holding event elements holding this (via _pParent) + _events.clear(); } // progessmeter @@ -298,23 +321,9 @@ Reference< xml::input::XElement > ScrollBarElement::startChildElement( 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 ( isVBACompatibilityMode( _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 ), - sService ); + getControlModelName( OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlScrollBarModel") ), _xAttributes ) ); Reference< xml::input::XElement > xStyle( getStyle( _xAttributes ) ); if (xStyle.is()) @@ -358,10 +367,7 @@ void ScrollBarElement::endElement() OUString( RTL_CONSTASCII_USTRINGPARAM("symbol-color") ), _xAttributes ); - // import cell-link - OUString sCellRange; - importBindableAndListRangeBits( _pImport, sLinkedCell, sCellRange, ctx ); - + ctx.importDataAwareProperty( OUSTR("linked-cell" ), _xAttributes ); ctx.importEvents( _events ); // avoid ring-reference: // vector< event elements > holding event elements holding this (via _pParent) @@ -393,18 +399,9 @@ Reference< xml::input::XElement > SpinButtonElement::startChildElement( 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") ) ); + _pImport, getControlId( _xAttributes ), + getControlModelName( OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlSpinButtonModel") ), _xAttributes ) ); Reference< xml::input::XElement > xStyle( getStyle( _xAttributes ) ); if (xStyle.is()) @@ -417,33 +414,25 @@ void SpinButtonElement::endElement() ctx.importDefaults( _nBasePosX, _nBasePosY, _xAttributes ); ctx.importOrientationProperty( OUString( RTL_CONSTASCII_USTRINGPARAM("Orientation") ), - OUString( RTL_CONSTASCII_USTRINGPARAM("align") ), - _xAttributes ); + OUString( RTL_CONSTASCII_USTRINGPARAM("align") ), + _xAttributes ); ctx.importLongProperty( OUString( RTL_CONSTASCII_USTRINGPARAM("SpinIncrement") ), - OUString( RTL_CONSTASCII_USTRINGPARAM("increment") ), - _xAttributes ); + OUString( RTL_CONSTASCII_USTRINGPARAM("increment") ), + _xAttributes ); ctx.importLongProperty( OUString( RTL_CONSTASCII_USTRINGPARAM("SpinValue") ), - OUString( RTL_CONSTASCII_USTRINGPARAM("curval") ), - _xAttributes ); + OUString( RTL_CONSTASCII_USTRINGPARAM("curval") ),_xAttributes ); ctx.importLongProperty( OUString( RTL_CONSTASCII_USTRINGPARAM("SpinValueMax") ), - OUString( RTL_CONSTASCII_USTRINGPARAM("maxval") ), - _xAttributes ); + OUString( RTL_CONSTASCII_USTRINGPARAM("maxval") ), _xAttributes ); ctx.importLongProperty( OUSTR("SpinValueMin"), OUSTR("minval"), - _xAttributes ); - ctx.importLongProperty( OUSTR("Repeat"), OUSTR("repeat"), - _xAttributes ); + _xAttributes ); + ctx.importLongProperty( OUSTR("Repeat"), OUSTR("repeat"), _xAttributes ); ctx.importLongProperty( OUSTR("RepeatDelay"), OUSTR("repeat-delay"), - _xAttributes ); +_xAttributes ); ctx.importBooleanProperty( OUString( RTL_CONSTASCII_USTRINGPARAM("Tabstop") ), - OUString( RTL_CONSTASCII_USTRINGPARAM("tabstop") ), - _xAttributes ); + 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 ); - + OUString( RTL_CONSTASCII_USTRINGPARAM("symbol-color") ), _xAttributes ); + ctx.importDataAwareProperty( OUSTR("linked-cell" ), _xAttributes ); ctx.importEvents( _events ); // avoid ring-reference: // vector< event elements > holding event elements holding this (via _pParent) @@ -746,6 +735,7 @@ void FormattedFieldElement::endElement() OUString( RTL_CONSTASCII_USTRINGPARAM("enforce-format") ), _xAttributes ); + ctx.importDataAwareProperty( OUSTR("linked-cell" ), _xAttributes ); ctx.importEvents( _events ); // avoid ring-reference: // vector< event elements > holding event elements holding this (via _pParent) @@ -1285,34 +1275,7 @@ void ImageControlElement::endElement() rtl::OUString sURL = _xAttributes->getValueByUidName( _pImport->XMLNS_DIALOGS_UID, OUSTR( "src" ) ); Reference< document::XStorageBasedDocument > xDocStorage( _pImport->getDocOwner(), UNO_QUERY ); - if ( xDocStorage.is() && IsPackageURL( sURL ) ) - { - uno::Sequence< Any > aArgs( 1 ); - aArgs[ 0 ] <<= xDocStorage->getDocumentStorage(); - - ::comphelper::ComponentContext aContext( ::comphelper::getProcessServiceFactory() ); - uno::Reference< document::XGraphicObjectResolver > xGraphicResolver; - aContext.createComponentWithArguments( OUSTR( "com.sun.star.comp.Svx.GraphicImportHelper" ), aArgs, xGraphicResolver ); - - if ( xGraphicResolver.is() ) - { - rtl::OUString aTmp( RTL_CONSTASCII_USTRINGPARAM( "vnd.sun.star.Package:" ) ); - aTmp += sURL; - sURL = xGraphicResolver->resolveGraphicObjectURL( aTmp ); - Reference< beans::XPropertySet > xProps( ctx.getControlModel(), UNO_QUERY ); - // we must set the url while the graphic object ( held by the resolver is in scope ) - if ( xProps.is() ) - xProps->setPropertyValue( OUSTR("ImageURL"), makeAny( sURL ) ); - } - } - - else if ( sURL.getLength() > 0 ) - { - Reference< beans::XPropertySet > xProps( ctx.getControlModel(), UNO_QUERY ); - if ( xProps.is() ) - xProps->setPropertyValue( OUSTR("ImageURL"), makeAny( sURL ) ); - } - + ctx.importImageURLProperty( OUSTR( "ImageURL" ), OUSTR( "src" ), _xAttributes ); ctx.importBooleanProperty( OUString( RTL_CONSTASCII_USTRINGPARAM("Tabstop") ), OUString( RTL_CONSTASCII_USTRINGPARAM("tabstop") ), _xAttributes ); @@ -1645,24 +1608,10 @@ void TitledBoxElement::endElement() Reference< xml::input::XElement > xRadio( _radios[ nPos ] ); Reference< xml::input::XAttributes > xAttributes( xRadio->getAttributes() ); - OUString sLinkedCell; - OUString sCellRange; - OUString sService( OUSTR("com.sun.star.awt.UnoControlRadioButtonModel") ); - try - { - sLinkedCell = xAttributes->getValueByUidName( _pImport->XMLNS_DIALOGS_UID, OUSTR( "linked-cell" ) ); - // we should probably limit this to vba mode also ( leave for now ) - if ( isVBACompatibilityMode( _pImport ) ) - sService = OUSTR("com.sun.star.form.component.RadioButton"); - } - catch( Exception& /*e*/ ) - { - } - ControlImportContext ctx( _pImport, getControlId( xAttributes ), - sService ); + getControlModelName( OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlRadioButtonModel") ), xAttributes ) ); Reference< beans::XPropertySet > xControlModel( ctx.getControlModel() ); Reference< xml::input::XElement > xStyle( getStyle( xAttributes ) ); @@ -1689,9 +1638,7 @@ void TitledBoxElement::endElement() ctx.importVerticalAlignProperty( OUString( RTL_CONSTASCII_USTRINGPARAM("VerticalAlign") ), OUString( RTL_CONSTASCII_USTRINGPARAM("valign") ), xAttributes ); - ctx.importStringProperty( OUString( RTL_CONSTASCII_USTRINGPARAM("ImageURL") ), - OUString( RTL_CONSTASCII_USTRINGPARAM("image-src") ), - xAttributes ); + ctx.importImageURLProperty( OUSTR( "ImageURL" ), OUSTR( "image-src" ), _xAttributes ); ctx.importImagePositionProperty( OUString( RTL_CONSTASCII_USTRINGPARAM("ImagePosition") ), OUString( RTL_CONSTASCII_USTRINGPARAM("image-position") ), xAttributes ); @@ -1714,7 +1661,7 @@ void TitledBoxElement::endElement() } xControlModel->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM("State") ), makeAny( nVal ) ); - importBindableAndListRangeBits( _pImport, sLinkedCell, sCellRange, ctx ); + ctx.importDataAwareProperty( OUSTR("linked-cell" ), xAttributes ); ::std::vector< Reference< xml::input::XElement > > * radioEvents = static_cast< RadioElement * >( xRadio.get() )->getEvents(); ctx.importEvents( *radioEvents ); @@ -1790,23 +1737,10 @@ void RadioGroupElement::endElement() Reference< xml::input::XElement > xRadio( _radios[ nPos ] ); Reference< xml::input::XAttributes > xAttributes( xRadio->getAttributes() ); - OUString sLinkedCell; - OUString sCellRange; - OUString sService( OUSTR("com.sun.star.awt.UnoControlRadioButtonModel") ); - try - { - sLinkedCell = xAttributes->getValueByUidName( _pImport->XMLNS_DIALOGS_UID, OUSTR( "linked-cell" ) ); - // we should probably limit this to vba mode also ( leave for now ) - if ( isVBACompatibilityMode( _pImport ) ) - sService = OUSTR("com.sun.star.form.component.RadioButton"); - } - catch( Exception& /*e*/ ) - { - } ControlImportContext ctx( _pImport, getControlId( xAttributes ), - sService ); + getControlModelName( OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlRadioButtonModel") ), xAttributes ) ); Reference< beans::XPropertySet > xControlModel( ctx.getControlModel() ); Reference< xml::input::XElement > xStyle( getStyle( xAttributes ) ); @@ -1833,9 +1767,7 @@ void RadioGroupElement::endElement() ctx.importVerticalAlignProperty( OUString( RTL_CONSTASCII_USTRINGPARAM("VerticalAlign") ), OUString( RTL_CONSTASCII_USTRINGPARAM("valign") ), xAttributes ); - ctx.importStringProperty( OUString( RTL_CONSTASCII_USTRINGPARAM("ImageURL") ), - OUString( RTL_CONSTASCII_USTRINGPARAM("image-src") ), - xAttributes ); + ctx.importImageURLProperty( OUSTR( "ImageURL" ), OUSTR( "image-src" ), xAttributes ); ctx.importImagePositionProperty( OUString( RTL_CONSTASCII_USTRINGPARAM("ImagePosition") ), OUString( RTL_CONSTASCII_USTRINGPARAM("image-position") ), xAttributes ); @@ -1858,7 +1790,8 @@ void RadioGroupElement::endElement() xControlModel->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM("State") ), makeAny( nVal ) ); - importBindableAndListRangeBits( _pImport, sLinkedCell, sCellRange, ctx ); + ctx.importDataAwareProperty( OUSTR("linked-cell" ), xAttributes ); + ::std::vector< Reference< xml::input::XElement > > * radioEvents = static_cast< RadioElement * >( xRadio.get() )->getEvents(); ctx.importEvents( *radioEvents ); @@ -1979,26 +1912,10 @@ Reference< xml::input::XElement > MenuListElement::startChildElement( void MenuListElement::endElement() throw (xml::sax::SAXException, RuntimeException) { - OUString sLinkedCell; - OUString sCellRange; - OUString sListBoxService( OUSTR("com.sun.star.awt.UnoControlListBoxModel") ); - - // we should probably limit this to vba mode also ( leave for now ) - if ( isVBACompatibilityMode( _pImport ) ) - sListBoxService = OUSTR("com.sun.star.form.component.ListBox"); - - try - { - sLinkedCell = _xAttributes->getValueByUidName( _pImport->XMLNS_DIALOGS_UID, OUSTR( "linked-cell" ) ); - sCellRange = _xAttributes->getValueByUidName( _pImport->XMLNS_DIALOGS_UID, OUSTR( "source-cell-range" ) ); - } - catch( Exception& /*e*/ ) - { - } ControlImportContext ctx( _pImport, getControlId( _xAttributes ), - //OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlListBoxModel") ) ); - sListBoxService ); + + getControlModelName( OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlListBoxModel") ), _xAttributes ) ); Reference< beans::XPropertySet > xControlModel( ctx.getControlModel() ); Reference< xml::input::XElement > xStyle( getStyle( _xAttributes ) ); @@ -2031,17 +1948,16 @@ void MenuListElement::endElement() ctx.importAlignProperty( OUString( RTL_CONSTASCII_USTRINGPARAM("Align") ), OUString( RTL_CONSTASCII_USTRINGPARAM("align") ), _xAttributes ); - // import cell-link and cell source range - importBindableAndListRangeBits( _pImport, sLinkedCell, sCellRange, ctx ); + bool bHasLinkedCell = ctx.importDataAwareProperty( OUSTR("linked-cell" ), _xAttributes ); + bool bHasSrcRange = ctx.importDataAwareProperty( OUSTR("source-cell-range" ), _xAttributes ); if (_popup.is()) { MenuPopupElement * p = static_cast< MenuPopupElement * >( _popup.get() ); - if ( !sCellRange.getLength() ) - xControlModel->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM("StringItemList") ), - makeAny( p->getItemValues() ) ); - if ( !sLinkedCell.getLength() ) - xControlModel->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM("SelectedItems") ), - makeAny( p->getSelectedItems() ) ); + if ( !bHasSrcRange ) + xControlModel->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM("StringItemList") ), makeAny( p->getItemValues() ) ); + if ( !bHasLinkedCell ) + xControlModel->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM("SelectedItems") ), makeAny( p->getSelectedItems() ) ); + } ctx.importEvents( _events ); // avoid ring-reference: @@ -2086,26 +2002,9 @@ Reference< xml::input::XElement > ComboBoxElement::startChildElement( void ComboBoxElement::endElement() throw (xml::sax::SAXException, RuntimeException) { - OUString sService( OUSTR("com.sun.star.awt.UnoControlComboBoxModel") ); - - // we should probably limit this to vba mode also ( leave for now ) - if ( isVBACompatibilityMode( _pImport ) ) - sService = OUSTR("com.sun.star.form.component.ComboBox"); - - OUString sLinkedCell; - OUString sCellRange; - try - { - sLinkedCell = _xAttributes->getValueByUidName( _pImport->XMLNS_DIALOGS_UID, OUSTR( "linked-cell" ) ); - sCellRange = _xAttributes->getValueByUidName( _pImport->XMLNS_DIALOGS_UID, OUSTR( "source-cell-range" ) ); - } - catch( Exception& /*e*/ ) - { - } - ControlImportContext ctx( _pImport, getControlId( _xAttributes ), - sService ); + getControlModelName( OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlComboBoxModel") ), _xAttributes ) ); Reference< beans::XPropertySet > xControlModel( ctx.getControlModel() ); Reference< xml::input::XElement > xStyle( getStyle( _xAttributes ) ); @@ -2147,10 +2046,9 @@ void ComboBoxElement::endElement() ctx.importAlignProperty( OUString( RTL_CONSTASCII_USTRINGPARAM("Align") ), OUString( RTL_CONSTASCII_USTRINGPARAM("align") ), _xAttributes ); - // import cell-link and cell source range - importBindableAndListRangeBits( _pImport, sLinkedCell, sCellRange, ctx ); - - if (_popup.is() && !sCellRange.getLength() ) + ctx.importDataAwareProperty( OUSTR("linked-cell" ), _xAttributes ); + bool bHasSrcRange = ctx.importDataAwareProperty( OUSTR("source-cell-range" ), _xAttributes ); + if (_popup.is() && !bHasSrcRange ) { MenuPopupElement * p = static_cast< MenuPopupElement * >( _popup.get() ); xControlModel->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM("StringItemList") ), @@ -2217,9 +2115,7 @@ void CheckBoxElement::endElement() ctx.importVerticalAlignProperty( OUString( RTL_CONSTASCII_USTRINGPARAM("VerticalAlign") ), OUString( RTL_CONSTASCII_USTRINGPARAM("valign") ), _xAttributes ); - ctx.importStringProperty( OUString( RTL_CONSTASCII_USTRINGPARAM("ImageURL") ), - OUString( RTL_CONSTASCII_USTRINGPARAM("image-src") ), - _xAttributes ); + ctx.importImageURLProperty( OUSTR( "ImageURL" ), OUSTR( "image-src" ), _xAttributes ); ctx.importImagePositionProperty( OUString( RTL_CONSTASCII_USTRINGPARAM("ImagePosition") ), OUString( RTL_CONSTASCII_USTRINGPARAM("image-position") ), _xAttributes ); @@ -2320,9 +2216,7 @@ void ButtonElement::endElement() ctx.importButtonTypeProperty( OUString( RTL_CONSTASCII_USTRINGPARAM("PushButtonType") ), OUString( RTL_CONSTASCII_USTRINGPARAM("button-type") ), _xAttributes ); - ctx.importStringProperty( OUString( RTL_CONSTASCII_USTRINGPARAM("ImageURL") ), - OUString( RTL_CONSTASCII_USTRINGPARAM("image-src") ), - _xAttributes ); + ctx.importImageURLProperty( OUSTR( "ImageURL" ), OUSTR( "image-src" ), _xAttributes ); ctx.importImagePositionProperty( OUString( RTL_CONSTASCII_USTRINGPARAM("ImagePosition") ), OUString( RTL_CONSTASCII_USTRINGPARAM("image-position") ), _xAttributes ); @@ -2477,7 +2371,7 @@ Reference< xml::input::XElement > BulletinBoardElement::startChildElement( return new ScrollBarElement( rLocalName, xAttributes, this, _pImport ); } // spinbutton - else if (rLocalName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("spinbutton") ) && isVBACompatibilityMode( _pImport ) ) + else if (rLocalName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("spinbutton") ) ) { return new SpinButtonElement( rLocalName, xAttributes, this, _pImport ); } @@ -2490,6 +2384,14 @@ Reference< xml::input::XElement > BulletinBoardElement::startChildElement( { return new MultiPage( rLocalName, xAttributes, this, _pImport ); } + else if (rLocalName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("frame") )) + { + return new Frame( rLocalName, xAttributes, this, _pImport ); + } + else if (rLocalName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("page") )) + { + return new Page( rLocalName, xAttributes, this, _pImport ); + } // bulletinboard else if (rLocalName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("bulletinboard") )) { @@ -2665,10 +2567,7 @@ void WindowElement::endElement() OUString( RTL_CONSTASCII_USTRINGPARAM("Decoration") ), OUString( RTL_CONSTASCII_USTRINGPARAM("withtitlebar") ), _xAttributes ); - ctx.importStringProperty( - OUString( RTL_CONSTASCII_USTRINGPARAM("ImageURL") ), - OUString( RTL_CONSTASCII_USTRINGPARAM("image-src") ), - _xAttributes ); + ctx.importImageURLProperty( OUSTR( "ImageURL" ), OUSTR( "image-src" ), _xAttributes ); ctx.importEvents( _events ); // avoid ring-reference: // vector< event elements > holding event elements holding this (via _pParent) diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx index 81ba97c6a955..02a74f2be0cb 100644 --- a/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx +++ b/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx @@ -58,10 +58,20 @@ #include #include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include +#include + using namespace ::com::sun::star; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::frame; @@ -129,6 +139,20 @@ OUString ControlElement::getControlId( return aId; } +OUString ControlElement::getControlModelName( + OUString const& rDefaultModel, + Reference< xml::input::XAttributes > const & xAttributes ) +{ + OUString aModel; + aModel = xAttributes->getValueByUidName( + _pImport->XMLNS_DIALOGS_UID, + OUString( RTL_CONSTASCII_USTRINGPARAM("control-implementation") ) ); + if (! aModel.getLength()) + aModel = rDefaultModel; + return aModel; +} + + //################################################################################################## //__________________________________________________________________________________________________ @@ -820,6 +844,7 @@ bool ImportContext::importDoubleProperty( } return false; } + //__________________________________________________________________________________________________ bool ImportContext::importBooleanProperty( OUString const & rPropName, OUString const & rAttrName, @@ -971,6 +996,115 @@ bool ImportContext::importVerticalAlignProperty( return false; } //__________________________________________________________________________________________________ +bool ImportContext::importImageURLProperty( + OUString const & rPropName, OUString const & rAttrName, + Reference< xml::input::XAttributes > const & xAttributes ) +{ + rtl::OUString sURL = xAttributes->getValueByUidName( _pImport->XMLNS_DIALOGS_UID, rAttrName ); + if ( sURL.getLength() ) + { + Reference< document::XStorageBasedDocument > xDocStorage( _pImport->getDocOwner(), UNO_QUERY ); + + uno::Reference< document::XGraphicObjectResolver > xGraphicResolver; + if ( xDocStorage.is() ) + { + uno::Sequence< Any > aArgs( 1 ); + aArgs[ 0 ] <<= xDocStorage->getDocumentStorage(); + ::comphelper::ComponentContext aContext( _pImport->getComponentContext() ); + aContext.createComponentWithArguments( OUSTR( "com.sun.star.comp.Svx.GraphicImportHelper" ), aArgs, xGraphicResolver ); + if ( xGraphicResolver.is() ) + { + rtl::OUString aTmp( RTL_CONSTASCII_USTRINGPARAM( "vnd.sun.star.Package:" ) ); + aTmp += sURL; + try + { + aTmp = xGraphicResolver->resolveGraphicObjectURL( aTmp ); + if ( aTmp.getLength() ) + sURL = aTmp; + } + catch( uno::Exception& e ) + { + (void)e; + return false; + } + + } + } + if ( sURL.getLength() > 0 ) + { + Reference< beans::XPropertySet > xProps( getControlModel(), UNO_QUERY ); + if ( xProps.is() ) + { + xProps->setPropertyValue( rPropName, makeAny( sURL ) ); + return true; + } + } + } + return false; +} +//__________________________________________________________________________________________________ + bool ImportContext::importDataAwareProperty( + ::rtl::OUString const & rPropName, + Reference const & xAttributes ) +{ + OUString sLinkedCell; + OUString sCellRange; + if ( rPropName.equals( OUSTR("linked-cell" ) ) ) + sLinkedCell = xAttributes->getValueByUidName( _pImport->XMLNS_DIALOGS_UID, rPropName ); + if ( rPropName.equals( OUSTR( "source-cell-range" ) ) ) + sCellRange = xAttributes->getValueByUidName( _pImport->XMLNS_DIALOGS_UID, rPropName ); + bool bRes = false; + 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( 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 ); + bRes = true; + } + } + // Set up CelllRange + if ( sCellRange.getLength() ) + { + Reference< form::binding::XListEntrySink > xListEntrySink( 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 ); + bRes = true; + } + } + } + return bRes; +} +//__________________________________________________________________________________________________ bool ImportContext::importImageAlignProperty( OUString const & rPropName, OUString const & rAttrName, Reference< xml::input::XAttributes > const & xAttributes ) @@ -1921,11 +2055,13 @@ Reference< xml::sax::XDocumentHandler > SAL_CALL importDialogModel( Reference< XModel > const & xDocument ) SAL_THROW( (Exception) ) { - DialogImport* pImport = new DialogImport( xContext, xDialogModel, xDocument ); - return ::xmlscript::createDocumentHandler( - static_cast< xml::input::XRoot * >( pImport ) ); + // single set of styles and stylenames apply to all containees + :: boost::shared_ptr< ::std::vector< ::rtl::OUString > > pStyleNames( new ::std::vector< ::rtl::OUString > ); + :: boost::shared_ptr< ::std::vector< css::uno::Reference< css::xml::input::XElement > > > pStyles( new ::std::vector< css::uno::Reference< css::xml::input::XElement > > ); + return ::xmlscript::createDocumentHandler( + static_cast< xml::input::XRoot * >( + new DialogImport( xContext, xDialogModel, pStyleNames, pStyles, xDocument ) ) ); } - } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlscript/util/makefile.mk b/xmlscript/util/makefile.mk index bc259db75455..dd21c16cd558 100644 --- a/xmlscript/util/makefile.mk +++ b/xmlscript/util/makefile.mk @@ -56,6 +56,7 @@ SHL1LIBS= \ SHL1STDLIBS= \ $(COMPHELPERLIB) \ $(CPPUHELPERLIB) \ + $(COMPHELPERLIB) \ $(CPPULIB) \ $(SALLIB) -- cgit From d3b7fb06974a847840d3c59a84b48b4ce09c8611 Mon Sep 17 00:00:00 2001 From: Noel Power Date: Fri, 5 Nov 2010 10:37:53 +0000 Subject: clean up styles, fix missing export of (embedded) image url --- xmlscript/source/xmldlg_imexp/imp_share.hxx | 6 ------ xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx | 6 ++---- xmlscript/source/xmldlg_imexp/xmldlg_import.cxx | 10 +++++----- 3 files changed, 7 insertions(+), 15 deletions(-) (limited to 'xmlscript') diff --git a/xmlscript/source/xmldlg_imexp/imp_share.hxx b/xmlscript/source/xmldlg_imexp/imp_share.hxx index 5523fe05440b..0717e32720d9 100644 --- a/xmlscript/source/xmldlg_imexp/imp_share.hxx +++ b/xmlscript/source/xmldlg_imexp/imp_share.hxx @@ -128,8 +128,6 @@ struct DialogImport ::boost::shared_ptr< ::std::vector< ::rtl::OUString > > _pStyleNames; ::boost::shared_ptr< ::std::vector< css::uno::Reference< css::xml::input::XElement > > > _pStyles; - ::std::vector< ::rtl::OUString >& _styleNames; - ::std::vector< css::uno::Reference< css::xml::input::XElement > >& _styles; css::uno::Reference< css::container::XNameContainer > _xDialogModel; css::uno::Reference< css::lang::XMultiServiceFactory > _xDialogModelFactory; @@ -176,8 +174,6 @@ public: : _xContext( xContext ) , _pStyleNames( pStyleNames ) , _pStyles( pStyles ) - , _styleNames( *_pStyleNames ) - , _styles( *_pStyles ) , _xDialogModel( xDialogModel ) , _xDialogModelFactory( xDialogModel, css::uno::UNO_QUERY_THROW ), _xDoc( xDoc ) { OSL_ASSERT( _xDialogModel.is() && _xDialogModelFactory.is() && @@ -187,8 +183,6 @@ public: , _xSupplier( rOther._xSupplier ) , _pStyleNames( rOther._pStyleNames ) , _pStyles( rOther._pStyles ) - , _styleNames( *_pStyleNames ) - , _styles( *_pStyles ) , _xDialogModel( rOther._xDialogModel ) , _xDialogModelFactory( rOther._xDialogModelFactory ) , _xDoc( rOther._xDoc ) diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx index 2d955fd5c5d5..01f1efee03b2 100644 --- a/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx +++ b/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx @@ -1333,10 +1333,8 @@ void ElementDescriptor::readDialogModel( StyleBag * all_styles ) if ( (aDecorationAny >>= bDecoration) && !bDecoration ) addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":withtitlebar") ), OUString( RTL_CONSTASCII_USTRINGPARAM("false") ) ); - - readStringAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ImageURL") ), - OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":image-src") ) ); - + readImageURLAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ImageURL") ), + OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":image-src") ) ); readEvents(); } diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx index 02a74f2be0cb..b5d61fd7dc83 100644 --- a/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx +++ b/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx @@ -2010,19 +2010,19 @@ void DialogImport::addStyle( Reference< xml::input::XElement > const & xStyle ) SAL_THROW( () ) { - _styleNames.push_back( rStyleId ); - _styles.push_back( xStyle ); + (*_pStyleNames).push_back( rStyleId ); + (*_pStyles).push_back( xStyle ); } //__________________________________________________________________________________________________ Reference< xml::input::XElement > DialogImport::getStyle( OUString const & rStyleId ) const SAL_THROW( () ) { - for ( size_t nPos = 0; nPos < _styleNames.size(); ++nPos ) + for ( size_t nPos = 0; nPos < (*_pStyleNames).size(); ++nPos ) { - if (_styleNames[ nPos ] == rStyleId) + if ( (*_pStyleNames)[ nPos ] == rStyleId) { - return _styles[ nPos ]; + return (*_pStyles)[ nPos ]; } } return 0; -- cgit From ae8f29fa66a341f97513db5d34e2bb0e5564b34e Mon Sep 17 00:00:00 2001 From: Gert Faller Date: Sun, 21 Nov 2010 17:45:09 +0100 Subject: RTL_CONSTASCII_USTRINGPARAM in libs core 47 --- xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'xmlscript') diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx index 4baa8f2a9710..f9ceaaefb8d3 100644 --- a/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx +++ b/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx @@ -130,7 +130,7 @@ Reference< xml::input::XElement > MultiPage::startChildElement( throw (xml::sax::SAXException, RuntimeException) { // event -rtl::OUString _label = rtl::OUString::createFromAscii("foo"); +rtl::OUString _label(RTL_CONSTASCII_USTRINGPARAM("foo")); if (_pImport->isEventElement( nUid, rLocalName )) { return new EventElement( -- cgit From 0b30cb7e66e0cef4f6f75013eb182c2d58615ca1 Mon Sep 17 00:00:00 2001 From: Takeshi Abe Date: Sat, 4 Dec 2010 13:16:21 +0900 Subject: Replace all occured, occurance etc. --- xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'xmlscript') diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx index f9ceaaefb8d3..e09f2d6b519e 100644 --- a/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx +++ b/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx @@ -722,7 +722,7 @@ void FormattedFieldElement::endElement() } catch (util::MalformedNumberFormatException & exc) { - OSL_ENSURE( 0, "### util::MalformedNumberFormatException occured!" ); + OSL_ENSURE( 0, "### util::MalformedNumberFormatException occurred!" ); // rethrow throw xml::sax::SAXException( exc.Message, Reference< XInterface >(), Any() ); } -- cgit From 9d4fdd4f187ae3082ba5077fbdf33e48aaae3821 Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Tue, 1 Feb 2011 17:55:57 +0100 Subject: Clean up makefiles --- xmlscript/util/makefile.mk | 1 - 1 file changed, 1 deletion(-) (limited to 'xmlscript') diff --git a/xmlscript/util/makefile.mk b/xmlscript/util/makefile.mk index dd21c16cd558..a916c42e29d8 100644 --- a/xmlscript/util/makefile.mk +++ b/xmlscript/util/makefile.mk @@ -29,7 +29,6 @@ PRJ=.. PRJNAME=xmlscript TARGET=xcr NO_BSYMBOLIC=TRUE -#USE_DEFFILE=TRUE ENABLE_EXCEPTIONS=TRUE # --- Settings ----------------------------------------------------- -- cgit From bb564bec137f76dfa099a1cdda3cf39367a6fe50 Mon Sep 17 00:00:00 2001 From: Fridrich Štrba Date: Sat, 5 Feb 2011 13:18:52 +0100 Subject: migrate to use boost unordered containers --- xmlscript/source/xml_helper/xml_impctx.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'xmlscript') diff --git a/xmlscript/source/xml_helper/xml_impctx.cxx b/xmlscript/source/xml_helper/xml_impctx.cxx index 9edccbf9bff4..646fadfb1b9f 100644 --- a/xmlscript/source/xml_helper/xml_impctx.cxx +++ b/xmlscript/source/xml_helper/xml_impctx.cxx @@ -43,7 +43,7 @@ #include "com/sun/star/uno/XComponentContext.hpp" #include -#include +#include #include @@ -71,8 +71,8 @@ OUString getImplementationName_DocumentHandlerImpl() "com.sun.star.comp.xml.input.SaxDocumentHandler") ); } -typedef ::std::hash_map< OUString, sal_Int32, OUStringHash > t_OUString2LongMap; -typedef ::std::hash_map< sal_Int32, OUString > t_Long2OUStringMap; +typedef ::boost::unordered_map< OUString, sal_Int32, OUStringHash > t_OUString2LongMap; +typedef ::boost::unordered_map< sal_Int32, OUString > t_Long2OUStringMap; struct PrefixEntry { @@ -82,7 +82,7 @@ struct PrefixEntry { m_Uids.reserve( 4 ); } }; -typedef ::std::hash_map< +typedef ::boost::unordered_map< OUString, PrefixEntry *, OUStringHash > t_OUString2PrefixMap; struct ElementEntry -- cgit From b9b36572d95b1a1583ff352631cf4a89d6dd8227 Mon Sep 17 00:00:00 2001 From: Julien Nabet Date: Sat, 26 Feb 2011 22:39:23 +0100 Subject: Remove "using namespace ::rtl" --- xmlscript/source/xml_helper/xml_byteseq.cxx | 2 +- xmlscript/source/xml_helper/xml_element.cxx | 3 +-- xmlscript/source/xmllib_imexp/xmllib_export.cxx | 3 ++- xmlscript/source/xmlmod_imexp/xmlmod_export.cxx | 3 ++- 4 files changed, 6 insertions(+), 5 deletions(-) (limited to 'xmlscript') diff --git a/xmlscript/source/xml_helper/xml_byteseq.cxx b/xmlscript/source/xml_helper/xml_byteseq.cxx index d23e12d671c3..e1208e8a0774 100644 --- a/xmlscript/source/xml_helper/xml_byteseq.cxx +++ b/xmlscript/source/xml_helper/xml_byteseq.cxx @@ -34,11 +34,11 @@ #include -using namespace rtl; using namespace osl; using namespace com::sun::star; using namespace com::sun::star::uno; +using ::rtl::ByteSequence; namespace xmlscript { diff --git a/xmlscript/source/xml_helper/xml_element.cxx b/xmlscript/source/xml_helper/xml_element.cxx index 1eae9b80d590..cd1fe1a0fc33 100644 --- a/xmlscript/source/xml_helper/xml_element.cxx +++ b/xmlscript/source/xml_helper/xml_element.cxx @@ -31,11 +31,10 @@ #include -using namespace rtl; using namespace com::sun::star; using namespace com::sun::star::uno; - +using ::rtl::OUString; namespace xmlscript { diff --git a/xmlscript/source/xmllib_imexp/xmllib_export.cxx b/xmlscript/source/xmllib_imexp/xmllib_export.cxx index d731fed9f10b..7684cef4fe8e 100644 --- a/xmlscript/source/xmllib_imexp/xmllib_export.cxx +++ b/xmlscript/source/xmllib_imexp/xmllib_export.cxx @@ -34,7 +34,8 @@ using namespace com::sun::star::uno; using namespace com::sun::star; -using namespace rtl; + +using ::rtl::OUString; namespace xmlscript { diff --git a/xmlscript/source/xmlmod_imexp/xmlmod_export.cxx b/xmlscript/source/xmlmod_imexp/xmlmod_export.cxx index 782e6d343818..aeb39a6df1ef 100644 --- a/xmlscript/source/xmlmod_imexp/xmlmod_export.cxx +++ b/xmlscript/source/xmlmod_imexp/xmlmod_export.cxx @@ -34,7 +34,8 @@ using namespace com::sun::star::uno; using namespace com::sun::star; -using namespace rtl; + +using ::rtl::OUString; namespace xmlscript { -- cgit From 6495f3945ec0dd4cef37b8dfd5217562de4a3269 Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Sat, 12 Mar 2011 12:08:22 +0100 Subject: Move OSL_ENSURE(0,...) to OSL_FAIL(...) --- xmlscript/source/xmldlg_imexp/exp_share.hxx | 2 +- xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx | 6 +-- xmlscript/source/xmldlg_imexp/xmldlg_export.cxx | 48 +++++++++++----------- xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx | 2 +- xmlscript/test/imexp.cxx | 8 ++-- 5 files changed, 33 insertions(+), 33 deletions(-) (limited to 'xmlscript') diff --git a/xmlscript/source/xmldlg_imexp/exp_share.hxx b/xmlscript/source/xmldlg_imexp/exp_share.hxx index aaf6bd6aeef6..385e9c977c1c 100644 --- a/xmlscript/source/xmldlg_imexp/exp_share.hxx +++ b/xmlscript/source/xmldlg_imexp/exp_share.hxx @@ -246,7 +246,7 @@ inline void ElementDescriptor::read( if (a >>= v) addAttribute( attrName, ::rtl::OUString::valueOf(v) ); else - OSL_ENSURE( 0, "### unexpected property type!" ); + OSL_FAIL( "### unexpected property type!" ); } } diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx index 01f1efee03b2..9f91a337810c 100644 --- a/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx +++ b/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx @@ -256,7 +256,7 @@ void ElementDescriptor::readButtonModel( StyleBag * all_styles ) OUString( RTL_CONSTASCII_USTRINGPARAM("true") ) ); break; default: - OSL_ENSURE( 0, "### unexpected radio state!" ); + OSL_FAIL( "### unexpected radio state!" ); break; } } @@ -325,7 +325,7 @@ void ElementDescriptor::readCheckBoxModel( StyleBag * all_styles ) OSL_ENSURE( bTriState, "### detected tristate value, but TriState is not set!" ); break; default: - OSL_ENSURE( 0, "### unexpected checkbox state!" ); + OSL_FAIL( "### unexpected checkbox state!" ); break; } } @@ -532,7 +532,7 @@ void ElementDescriptor::readRadioButtonModel( StyleBag * all_styles ) OUString( RTL_CONSTASCII_USTRINGPARAM("true") ) ); break; default: - OSL_ENSURE( 0, "### unexpected radio state!" ); + OSL_FAIL( "### unexpected radio state!" ); break; } } diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx index 4ae2ebdabc11..2dce75b26f67 100644 --- a/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx +++ b/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx @@ -160,7 +160,7 @@ Reference< xml::sax::XAttributeList > Style::createElement() break; } default: - OSL_ENSURE( 0, "### unexpected border value!" ); + OSL_FAIL( "### unexpected border value!" ); break; } } @@ -183,7 +183,7 @@ Reference< xml::sax::XAttributeList > Style::createElement() OUSTR("simple") ); break; default: - OSL_ENSURE( 0, "### unexpected visual effect value!" ); + OSL_FAIL( "### unexpected visual effect value!" ); break; } } @@ -247,7 +247,7 @@ Reference< xml::sax::XAttributeList > Style::createElement() OUString( RTL_CONSTASCII_USTRINGPARAM("system") ) ); break; default: - OSL_ENSURE( 0, "### unexpected font-family!" ); + OSL_FAIL( "### unexpected font-family!" ); break; } } @@ -297,7 +297,7 @@ Reference< xml::sax::XAttributeList > Style::createElement() OUString( RTL_CONSTASCII_USTRINGPARAM("symbol") ) ); break; default: - OSL_ENSURE( 0, "### unexpected font-charset!" ); + OSL_FAIL( "### unexpected font-charset!" ); break; } } @@ -315,7 +315,7 @@ Reference< xml::sax::XAttributeList > Style::createElement() OUString( RTL_CONSTASCII_USTRINGPARAM("variable") ) ); break; default: - OSL_ENSURE( 0, "### unexpected font-pitch!" ); + OSL_FAIL( "### unexpected font-pitch!" ); break; } } @@ -353,7 +353,7 @@ Reference< xml::sax::XAttributeList > Style::createElement() OUString( RTL_CONSTASCII_USTRINGPARAM("reverse_italic") ) ); break; default: - OSL_ENSURE( 0, "### unexpected font-slant!" ); + OSL_FAIL( "### unexpected font-slant!" ); break; } } @@ -431,7 +431,7 @@ Reference< xml::sax::XAttributeList > Style::createElement() OUString( RTL_CONSTASCII_USTRINGPARAM("boldwave") ) ); break; default: - OSL_ENSURE( 0, "### unexpected font-underline!" ); + OSL_FAIL( "### unexpected font-underline!" ); break; } } @@ -461,7 +461,7 @@ Reference< xml::sax::XAttributeList > Style::createElement() OUString( RTL_CONSTASCII_USTRINGPARAM("x") ) ); break; default: - OSL_ENSURE( 0, "### unexpected font-strikeout!" ); + OSL_FAIL( "### unexpected font-strikeout!" ); break; } } @@ -501,7 +501,7 @@ Reference< xml::sax::XAttributeList > Style::createElement() OUString( RTL_CONSTASCII_USTRINGPARAM("scalable") ) ); break; default: - OSL_ENSURE( 0, "### unexpected font-type!" ); + OSL_FAIL( "### unexpected font-type!" ); break; } } @@ -523,7 +523,7 @@ Reference< xml::sax::XAttributeList > Style::createElement() OUString( RTL_CONSTASCII_USTRINGPARAM("engraved") ) ); break; default: - OSL_ENSURE( 0, "### unexpected font-relief!" ); + OSL_FAIL( "### unexpected font-relief!" ); break; } // dialog:font-emphasismark (none|dot|circle|disc|accent|above|below) #IMPLIED @@ -562,7 +562,7 @@ Reference< xml::sax::XAttributeList > Style::createElement() OUString( RTL_CONSTASCII_USTRINGPARAM("below") ) ); break; default: - OSL_ENSURE( 0, "### unexpected font-emphasismark!" ); + OSL_FAIL( "### unexpected font-emphasismark!" ); break; } } @@ -626,7 +626,7 @@ void ElementDescriptor::readStringAttr( if (a >>= v) addAttribute( rAttrName, v ); else - OSL_ENSURE( 0, "### unexpected property type!" ); + OSL_FAIL( "### unexpected property type!" ); } } @@ -694,7 +694,7 @@ void ElementDescriptor::readDateFormatAttr( OUString const & rPropName, OUString addAttribute( rAttrName, OUString( RTL_CONSTASCII_USTRINGPARAM("short_YYYYMMDD_DIN5008") ) ); break; default: - OSL_ENSURE( 0, "### unexpected date format!" ); + OSL_FAIL( "### unexpected date format!" ); break; } } @@ -729,7 +729,7 @@ void ElementDescriptor::readTimeFormatAttr( OUString const & rPropName, OUString addAttribute( rAttrName, OUString( RTL_CONSTASCII_USTRINGPARAM("Duration_long") ) ); break; default: - OSL_ENSURE( 0, "### unexpected time format!" ); + OSL_FAIL( "### unexpected time format!" ); break; } } @@ -755,7 +755,7 @@ void ElementDescriptor::readAlignAttr( OUString const & rPropName, OUString cons addAttribute( rAttrName, OUString( RTL_CONSTASCII_USTRINGPARAM("right") ) ); break; default: - OSL_ENSURE( 0, "### illegal alignment value!" ); + OSL_FAIL( "### illegal alignment value!" ); break; } } @@ -783,7 +783,7 @@ void ElementDescriptor::readVerticalAlignAttr( OUString const & rPropName, OUStr addAttribute( rAttrName, OUString( RTL_CONSTASCII_USTRINGPARAM("bottom") ) ); break; default: - OSL_ENSURE( 0, "### illegal vertical alignment value!" ); + OSL_FAIL( "### illegal vertical alignment value!" ); break; } } @@ -839,7 +839,7 @@ void ElementDescriptor::readImageAlignAttr( OUString const & rPropName, OUString addAttribute( rAttrName, OUString( RTL_CONSTASCII_USTRINGPARAM("bottom") ) ); break; default: - OSL_ENSURE( 0, "### illegal image alignment value!" ); + OSL_FAIL( "### illegal image alignment value!" ); break; } } @@ -895,7 +895,7 @@ void ElementDescriptor::readImagePositionAttr( OUString const & rPropName, OUStr addAttribute( rAttrName, OUString( RTL_CONSTASCII_USTRINGPARAM("center") ) ); break; default: - OSL_ENSURE( 0, "### illegal image position value!" ); + OSL_FAIL( "### illegal image position value!" ); break; } } @@ -924,7 +924,7 @@ void ElementDescriptor::readButtonTypeAttr( OUString const & rPropName, OUString addAttribute( rAttrName, OUString( RTL_CONSTASCII_USTRINGPARAM("help") ) ); break; default: - OSL_ENSURE( 0, "### illegal button-type value!" ); + OSL_FAIL( "### illegal button-type value!" ); break; } } @@ -947,7 +947,7 @@ void ElementDescriptor::readOrientationAttr( OUString const & rPropName, OUStrin addAttribute( rAttrName, OUString( RTL_CONSTASCII_USTRINGPARAM("vertical") ) ); break; default: - OSL_ENSURE( 0, "### illegal orientation value!" ); + OSL_FAIL( "### illegal orientation value!" ); break; } } @@ -973,7 +973,7 @@ void ElementDescriptor::readLineEndFormatAttr( OUString const & rPropName, OUStr addAttribute( rAttrName, OUString( RTL_CONSTASCII_USTRINGPARAM("carriage-return-line-feed") ) ); break; default: - OSL_ENSURE( 0, "### illegal line end format value!" ); + OSL_FAIL( "### illegal line end format value!" ); break; } } @@ -1066,7 +1066,7 @@ void ElementDescriptor::readSelectionTypeAttr( OUString const & rPropName, OUStr addAttribute( rAttrName, OUString( RTL_CONSTASCII_USTRINGPARAM("range") ) ); break; default: - OSL_ENSURE( 0, "### illegal selection type value!" ); + OSL_FAIL( "### illegal selection type value!" ); break; } } @@ -1114,7 +1114,7 @@ void ElementDescriptor::readDefaults( bool supportPrintable, bool supportVisible } else { - OSL_ENSURE( 0, "unexpected property type for \"Enabled\": not bool!" ); + OSL_FAIL( "unexpected property type for \"Enabled\": not bool!" ); } sal_Bool bVisible = sal_True; @@ -1303,7 +1303,7 @@ void ElementDescriptor::readEvents() } else { - OSL_ENSURE( 0, "### unexpected event type in container!" ); + OSL_FAIL( "### unexpected event type in container!" ); } } } diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx index e09f2d6b519e..2aa541b08efd 100644 --- a/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx +++ b/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx @@ -722,7 +722,7 @@ void FormattedFieldElement::endElement() } catch (util::MalformedNumberFormatException & exc) { - OSL_ENSURE( 0, "### util::MalformedNumberFormatException occurred!" ); + OSL_FAIL( "### util::MalformedNumberFormatException occurred!" ); // rethrow throw xml::sax::SAXException( exc.Message, Reference< XInterface >(), Any() ); } diff --git a/xmlscript/test/imexp.cxx b/xmlscript/test/imexp.cxx index 45a76ffc15fa..100a3972101b 100644 --- a/xmlscript/test/imexp.cxx +++ b/xmlscript/test/imexp.cxx @@ -95,7 +95,7 @@ Reference< XComponentContext > createInitialComponentContext( catch( Exception& rExc ) { OString aStr( OUStringToOString( rExc.Message, RTL_TEXTENCODING_ASCII_US ) ); - OSL_ENSURE( 0, aStr.getStr() ); + OSL_FAIL( aStr.getStr() ); } return xContext; @@ -178,7 +178,7 @@ void MyApp::Main() { if (GetCommandLineParamCount() < 2) { - OSL_ENSURE( 0, "usage: imexp inst_dir inputfile [outputfile]\n" ); + OSL_FAIL( "usage: imexp inst_dir inputfile [outputfile]\n" ); return; } @@ -226,12 +226,12 @@ void MyApp::Main() aStr += OString( " >>> " ); aStr += OUStringToOString( exc.Message, RTL_TEXTENCODING_ASCII_US ); } - OSL_ENSURE( 0, aStr.getStr() ); + OSL_FAIL( aStr.getStr() ); } catch (uno::Exception & rExc) { OString aStr( OUStringToOString( rExc.Message, RTL_TEXTENCODING_ASCII_US ) ); - OSL_ENSURE( 0, aStr.getStr() ); + OSL_FAIL( aStr.getStr() ); } Reference< lang::XComponent > xComp( xContext, UNO_QUERY ); -- cgit From c703f03e506d6fd8c0d8e8fde6608a8b4cbab021 Mon Sep 17 00:00:00 2001 From: Thorsten Behrens Date: Tue, 15 Mar 2011 11:52:49 +0100 Subject: Fix build in scripting --- xmlscript/inc/xmlscript/xmldlg_imexp.hxx | 2 +- xmlscript/source/xmldlg_imexp/xmldlg_addfunc.cxx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'xmlscript') diff --git a/xmlscript/inc/xmlscript/xmldlg_imexp.hxx b/xmlscript/inc/xmlscript/xmldlg_imexp.hxx index 30d92bfc1bd3..47d0d17e989f 100755 --- a/xmlscript/inc/xmlscript/xmldlg_imexp.hxx +++ b/xmlscript/inc/xmlscript/xmldlg_imexp.hxx @@ -78,7 +78,7 @@ SAL_CALL exportDialogModel( //============================================================================== void SAL_CALL importDialogModel( ::com::sun::star::uno::Reference< - ::com::sun::star::io::XInputStream > xInput, + ::com::sun::star::io::XInputStream > const & xInput, ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > const & xDialogModel, ::com::sun::star::uno::Reference< diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_addfunc.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_addfunc.cxx index f0e8a3dfd4ea..d435883ef8d3 100755 --- a/xmlscript/source/xmldlg_imexp/xmldlg_addfunc.cxx +++ b/xmlscript/source/xmldlg_imexp/xmldlg_addfunc.cxx @@ -105,7 +105,7 @@ Reference< io::XInputStreamProvider > SAL_CALL exportDialogModel( //================================================================================================== void SAL_CALL importDialogModel( - Reference< io::XInputStream > xInput, + Reference< io::XInputStream > const & xInput, Reference< container::XNameContainer > const & xDialogModel, Reference< XComponentContext > const & xContext, Reference< XModel > const & xDocument ) -- cgit From 3d9981af0da5f612250c8cb88ee716da8d067e75 Mon Sep 17 00:00:00 2001 From: Xisco Fauli Date: Fri, 18 Mar 2011 21:46:25 +0100 Subject: Remove dead code in libs-core --- xmlscript/source/xml_helper/xml_element.cxx | 1 - xmlscript/source/xmldlg_imexp/exp_share.hxx | 6 ------ xmlscript/source/xmldlg_imexp/imp_share.hxx | 1 - xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx | 6 +----- xmlscript/source/xmllib_imexp/imp_share.hxx | 1 - 5 files changed, 1 insertion(+), 14 deletions(-) (limited to 'xmlscript') diff --git a/xmlscript/source/xml_helper/xml_element.cxx b/xmlscript/source/xml_helper/xml_element.cxx index cd1fe1a0fc33..6a2717019f7e 100755 --- a/xmlscript/source/xml_helper/xml_element.cxx +++ b/xmlscript/source/xml_helper/xml_element.cxx @@ -73,7 +73,6 @@ void XMLElement::dump( Reference< xml::sax::XDocumentHandler > const & xOut ) xOut->startElement( _name, static_cast< xml::sax::XAttributeList * >( this ) ); // write sub elements dumpSubElements( xOut ); - // xOut->ignorableWhitespace( OUString() ); xOut->endElement( _name ); } diff --git a/xmlscript/source/xmldlg_imexp/exp_share.hxx b/xmlscript/source/xmldlg_imexp/exp_share.hxx index 385e9c977c1c..50a9d2393393 100755 --- a/xmlscript/source/xmldlg_imexp/exp_share.hxx +++ b/xmlscript/source/xmldlg_imexp/exp_share.hxx @@ -115,13 +115,10 @@ public: ::rtl::OUString const & propName, ::rtl::OUString const & attrName, bool forceAttribute = false ); - // template inline bool readProp( T * ret, ::rtl::OUString const & rPropName ); css::uno::Any readProp( ::rtl::OUString const & rPropName ); - // void readDefaults( bool supportPrintable = true, bool supportVisible = true ); - // void readStringAttr( ::rtl::OUString const & rPropName, ::rtl::OUString const & rAttrName ); inline void readDoubleAttr( @@ -162,7 +159,6 @@ public: ::rtl::OUString const & rPropName, ::rtl::OUString const & rAttrName ); void readSelectionTypeAttr( ::rtl::OUString const & rPropName, ::rtl::OUString const & rAttrName ); - // void readDataAwareAttr( ::rtl::OUString const & rAttrName ); inline void addBoolAttr( @@ -173,9 +169,7 @@ public: const & xFormatProperties, ::rtl::OUString const & rAttrName ); - // void readEvents() SAL_THROW( (css::uno::Exception) ); - // void readDialogModel( StyleBag * all_styles ) SAL_THROW( (css::uno::Exception) ); void readBullitinBoard( StyleBag * all_styles ) diff --git a/xmlscript/source/xmldlg_imexp/imp_share.hxx b/xmlscript/source/xmldlg_imexp/imp_share.hxx index 0717e32720d9..0c413a3afe53 100755 --- a/xmlscript/source/xmldlg_imexp/imp_share.hxx +++ b/xmlscript/source/xmldlg_imexp/imp_share.hxx @@ -52,7 +52,6 @@ namespace css = ::com::sun::star; namespace xmlscript { -// inline sal_Int32 toInt32( ::rtl::OUString const & rStr ) SAL_THROW( () ) { sal_Int32 nVal; diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx index 9f91a337810c..e858f7d857f6 100755 --- a/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx +++ b/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx @@ -115,10 +115,7 @@ void ElementDescriptor::readFrameModel( StyleBag * all_styles ) { // collect styles Style aStyle( 0x1 | 0x2 | 0x8 | 0x20 ); -/* - if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("BackgroundColor") ) ) >>= aStyle._backgroundColor) - aStyle._set |= 0x1; -*/ + if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextColor") ) ) >>= aStyle._textColor) aStyle._set |= 0x2; if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextLineColor") ) ) >>= aStyle._textLineColor) @@ -1561,7 +1558,6 @@ void ElementDescriptor::readBullitinBoard( StyleBag * all_styles ) OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":progressmeter") ), _xDocument ); pElem->readProgressBarModel( all_styles ); } - // if (pElem) { diff --git a/xmlscript/source/xmllib_imexp/imp_share.hxx b/xmlscript/source/xmllib_imexp/imp_share.hxx index a3728cb4488b..1cfa25525a3e 100755 --- a/xmlscript/source/xmllib_imexp/imp_share.hxx +++ b/xmlscript/source/xmllib_imexp/imp_share.hxx @@ -51,7 +51,6 @@ using namespace ::com::sun::star::uno; namespace xmlscript { -// inline sal_Int32 toInt32( OUString const & rStr ) SAL_THROW( () ) { sal_Int32 nVal; -- cgit From 970be45287de1a046df1c546abb06ad5f6b9c084 Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Sat, 19 Mar 2011 14:09:49 +0100 Subject: Move OSL_ENSURE(sal_False,...) to OSL_FAIL(...) --- xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'xmlscript') diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx index e858f7d857f6..7ff7b289d2c1 100755 --- a/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx +++ b/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx @@ -1565,7 +1565,7 @@ void ElementDescriptor::readBullitinBoard( StyleBag * all_styles ) } else { - OSL_ENSURE( sal_False, "unknown control type!" ); + OSL_FAIL( "unknown control type!" ); continue; } } -- cgit From e60d365c86b164a4a6940a39377b0b580c9e918d Mon Sep 17 00:00:00 2001 From: Francisco Saito Date: Tue, 29 Mar 2011 21:38:39 +0100 Subject: drop bogus executable flag from [ch]xx/bas/asm files --- xmlscript/inc/pch/precompiled_xmlscript.cxx | 0 xmlscript/inc/pch/precompiled_xmlscript.hxx | 0 xmlscript/inc/xmlscript/xml_helper.hxx | 0 xmlscript/inc/xmlscript/xml_import.hxx | 0 xmlscript/inc/xmlscript/xmldlg_imexp.hxx | 0 xmlscript/inc/xmlscript/xmllib_imexp.hxx | 0 xmlscript/inc/xmlscript/xmlmod_imexp.hxx | 0 xmlscript/source/inc/misc.hxx | 0 xmlscript/source/misc/unoservices.cxx | 0 xmlscript/source/xml_helper/xml_byteseq.cxx | 0 xmlscript/source/xml_helper/xml_element.cxx | 0 xmlscript/source/xml_helper/xml_impctx.cxx | 0 xmlscript/source/xmldlg_imexp/common.hxx | 0 xmlscript/source/xmldlg_imexp/exp_share.hxx | 0 xmlscript/source/xmldlg_imexp/imp_share.hxx | 0 xmlscript/source/xmldlg_imexp/xmldlg_addfunc.cxx | 0 xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx | 0 xmlscript/source/xmldlg_imexp/xmldlg_export.cxx | 0 xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx | 0 xmlscript/source/xmldlg_imexp/xmldlg_import.cxx | 0 xmlscript/source/xmlflat_imexp/xmlbas_export.cxx | 0 xmlscript/source/xmlflat_imexp/xmlbas_export.hxx | 0 xmlscript/source/xmlflat_imexp/xmlbas_import.cxx | 0 xmlscript/source/xmlflat_imexp/xmlbas_import.hxx | 0 xmlscript/source/xmllib_imexp/imp_share.hxx | 0 xmlscript/source/xmllib_imexp/xmllib_export.cxx | 0 xmlscript/source/xmllib_imexp/xmllib_import.cxx | 0 xmlscript/source/xmlmod_imexp/imp_share.hxx | 0 xmlscript/source/xmlmod_imexp/xmlmod_export.cxx | 0 xmlscript/source/xmlmod_imexp/xmlmod_import.cxx | 0 xmlscript/test/imexp.cxx | 0 31 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 xmlscript/inc/pch/precompiled_xmlscript.cxx mode change 100755 => 100644 xmlscript/inc/pch/precompiled_xmlscript.hxx mode change 100755 => 100644 xmlscript/inc/xmlscript/xml_helper.hxx mode change 100755 => 100644 xmlscript/inc/xmlscript/xml_import.hxx mode change 100755 => 100644 xmlscript/inc/xmlscript/xmldlg_imexp.hxx mode change 100755 => 100644 xmlscript/inc/xmlscript/xmllib_imexp.hxx mode change 100755 => 100644 xmlscript/inc/xmlscript/xmlmod_imexp.hxx mode change 100755 => 100644 xmlscript/source/inc/misc.hxx mode change 100755 => 100644 xmlscript/source/misc/unoservices.cxx mode change 100755 => 100644 xmlscript/source/xml_helper/xml_byteseq.cxx mode change 100755 => 100644 xmlscript/source/xml_helper/xml_element.cxx mode change 100755 => 100644 xmlscript/source/xml_helper/xml_impctx.cxx mode change 100755 => 100644 xmlscript/source/xmldlg_imexp/common.hxx mode change 100755 => 100644 xmlscript/source/xmldlg_imexp/exp_share.hxx mode change 100755 => 100644 xmlscript/source/xmldlg_imexp/imp_share.hxx mode change 100755 => 100644 xmlscript/source/xmldlg_imexp/xmldlg_addfunc.cxx mode change 100755 => 100644 xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx mode change 100755 => 100644 xmlscript/source/xmldlg_imexp/xmldlg_export.cxx mode change 100755 => 100644 xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx mode change 100755 => 100644 xmlscript/source/xmldlg_imexp/xmldlg_import.cxx mode change 100755 => 100644 xmlscript/source/xmlflat_imexp/xmlbas_export.cxx mode change 100755 => 100644 xmlscript/source/xmlflat_imexp/xmlbas_export.hxx mode change 100755 => 100644 xmlscript/source/xmlflat_imexp/xmlbas_import.cxx mode change 100755 => 100644 xmlscript/source/xmlflat_imexp/xmlbas_import.hxx mode change 100755 => 100644 xmlscript/source/xmllib_imexp/imp_share.hxx mode change 100755 => 100644 xmlscript/source/xmllib_imexp/xmllib_export.cxx mode change 100755 => 100644 xmlscript/source/xmllib_imexp/xmllib_import.cxx mode change 100755 => 100644 xmlscript/source/xmlmod_imexp/imp_share.hxx mode change 100755 => 100644 xmlscript/source/xmlmod_imexp/xmlmod_export.cxx mode change 100755 => 100644 xmlscript/source/xmlmod_imexp/xmlmod_import.cxx mode change 100755 => 100644 xmlscript/test/imexp.cxx (limited to 'xmlscript') diff --git a/xmlscript/inc/pch/precompiled_xmlscript.cxx b/xmlscript/inc/pch/precompiled_xmlscript.cxx old mode 100755 new mode 100644 diff --git a/xmlscript/inc/pch/precompiled_xmlscript.hxx b/xmlscript/inc/pch/precompiled_xmlscript.hxx old mode 100755 new mode 100644 diff --git a/xmlscript/inc/xmlscript/xml_helper.hxx b/xmlscript/inc/xmlscript/xml_helper.hxx old mode 100755 new mode 100644 diff --git a/xmlscript/inc/xmlscript/xml_import.hxx b/xmlscript/inc/xmlscript/xml_import.hxx old mode 100755 new mode 100644 diff --git a/xmlscript/inc/xmlscript/xmldlg_imexp.hxx b/xmlscript/inc/xmlscript/xmldlg_imexp.hxx old mode 100755 new mode 100644 diff --git a/xmlscript/inc/xmlscript/xmllib_imexp.hxx b/xmlscript/inc/xmlscript/xmllib_imexp.hxx old mode 100755 new mode 100644 diff --git a/xmlscript/inc/xmlscript/xmlmod_imexp.hxx b/xmlscript/inc/xmlscript/xmlmod_imexp.hxx old mode 100755 new mode 100644 diff --git a/xmlscript/source/inc/misc.hxx b/xmlscript/source/inc/misc.hxx old mode 100755 new mode 100644 diff --git a/xmlscript/source/misc/unoservices.cxx b/xmlscript/source/misc/unoservices.cxx old mode 100755 new mode 100644 diff --git a/xmlscript/source/xml_helper/xml_byteseq.cxx b/xmlscript/source/xml_helper/xml_byteseq.cxx old mode 100755 new mode 100644 diff --git a/xmlscript/source/xml_helper/xml_element.cxx b/xmlscript/source/xml_helper/xml_element.cxx old mode 100755 new mode 100644 diff --git a/xmlscript/source/xml_helper/xml_impctx.cxx b/xmlscript/source/xml_helper/xml_impctx.cxx old mode 100755 new mode 100644 diff --git a/xmlscript/source/xmldlg_imexp/common.hxx b/xmlscript/source/xmldlg_imexp/common.hxx old mode 100755 new mode 100644 diff --git a/xmlscript/source/xmldlg_imexp/exp_share.hxx b/xmlscript/source/xmldlg_imexp/exp_share.hxx old mode 100755 new mode 100644 diff --git a/xmlscript/source/xmldlg_imexp/imp_share.hxx b/xmlscript/source/xmldlg_imexp/imp_share.hxx old mode 100755 new mode 100644 diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_addfunc.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_addfunc.cxx old mode 100755 new mode 100644 diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx old mode 100755 new mode 100644 diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx old mode 100755 new mode 100644 diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx old mode 100755 new mode 100644 diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx old mode 100755 new mode 100644 diff --git a/xmlscript/source/xmlflat_imexp/xmlbas_export.cxx b/xmlscript/source/xmlflat_imexp/xmlbas_export.cxx old mode 100755 new mode 100644 diff --git a/xmlscript/source/xmlflat_imexp/xmlbas_export.hxx b/xmlscript/source/xmlflat_imexp/xmlbas_export.hxx old mode 100755 new mode 100644 diff --git a/xmlscript/source/xmlflat_imexp/xmlbas_import.cxx b/xmlscript/source/xmlflat_imexp/xmlbas_import.cxx old mode 100755 new mode 100644 diff --git a/xmlscript/source/xmlflat_imexp/xmlbas_import.hxx b/xmlscript/source/xmlflat_imexp/xmlbas_import.hxx old mode 100755 new mode 100644 diff --git a/xmlscript/source/xmllib_imexp/imp_share.hxx b/xmlscript/source/xmllib_imexp/imp_share.hxx old mode 100755 new mode 100644 diff --git a/xmlscript/source/xmllib_imexp/xmllib_export.cxx b/xmlscript/source/xmllib_imexp/xmllib_export.cxx old mode 100755 new mode 100644 diff --git a/xmlscript/source/xmllib_imexp/xmllib_import.cxx b/xmlscript/source/xmllib_imexp/xmllib_import.cxx old mode 100755 new mode 100644 diff --git a/xmlscript/source/xmlmod_imexp/imp_share.hxx b/xmlscript/source/xmlmod_imexp/imp_share.hxx old mode 100755 new mode 100644 diff --git a/xmlscript/source/xmlmod_imexp/xmlmod_export.cxx b/xmlscript/source/xmlmod_imexp/xmlmod_export.cxx old mode 100755 new mode 100644 diff --git a/xmlscript/source/xmlmod_imexp/xmlmod_import.cxx b/xmlscript/source/xmlmod_imexp/xmlmod_import.cxx old mode 100755 new mode 100644 diff --git a/xmlscript/test/imexp.cxx b/xmlscript/test/imexp.cxx old mode 100755 new mode 100644 -- cgit From d3174feec24928b79d015d08c7b5587c0be2bfdb Mon Sep 17 00:00:00 2001 From: Francisco Saito Date: Tue, 29 Mar 2011 21:44:51 +0100 Subject: drop bogus executable flag from image files --- xmlscript/test/w3c.jpg | Bin 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 xmlscript/test/w3c.jpg (limited to 'xmlscript') diff --git a/xmlscript/test/w3c.jpg b/xmlscript/test/w3c.jpg old mode 100755 new mode 100644 -- cgit From df965c99f376635361721f8970499611f1732edc Mon Sep 17 00:00:00 2001 From: Francisco Saito Date: Tue, 29 Mar 2011 21:47:37 +0100 Subject: drop bogus executable flag from idl/build/src and config files --- xmlscript/prj/build.lst | 0 xmlscript/prj/d.lst | 0 2 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 xmlscript/prj/build.lst mode change 100755 => 100644 xmlscript/prj/d.lst (limited to 'xmlscript') diff --git a/xmlscript/prj/build.lst b/xmlscript/prj/build.lst old mode 100755 new mode 100644 diff --git a/xmlscript/prj/d.lst b/xmlscript/prj/d.lst old mode 100755 new mode 100644 -- cgit From 561192cfc9f10adab404e6dfed51fd4d78d11210 Mon Sep 17 00:00:00 2001 From: Julien Nabet Date: Thu, 21 Apr 2011 00:27:41 +0200 Subject: Easyhack: Add visibility markup to all component_get* functions --- xmlscript/source/misc/unoservices.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'xmlscript') diff --git a/xmlscript/source/misc/unoservices.cxx b/xmlscript/source/misc/unoservices.cxx index 746b2c11a007..0e7119368d20 100644 --- a/xmlscript/source/misc/unoservices.cxx +++ b/xmlscript/source/misc/unoservices.cxx @@ -106,7 +106,7 @@ namespace xmlscript extern "C" { - void SAL_CALL component_getImplementationEnvironment( + SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( const sal_Char ** ppEnvTypeName, uno_Environment ** ) { *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; @@ -114,7 +114,7 @@ extern "C" // ----------------------------------------------------------------------------- - void * SAL_CALL component_getFactory( + SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * pRegistryKey ) { return ::cppu::component_getFactoryHelper( -- cgit From 4912a5e54fe31fd132de5d3a7ddef8de01bb75ba Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Fri, 3 Jun 2011 13:27:08 +0300 Subject: Drop %_EXT% which was always empty --- xmlscript/prj/d.lst | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'xmlscript') diff --git a/xmlscript/prj/d.lst b/xmlscript/prj/d.lst index 2f1ff7e37785..6a2447ad8c1f 100644 --- a/xmlscript/prj/d.lst +++ b/xmlscript/prj/d.lst @@ -1,14 +1,14 @@ -mkdir: %_DEST%\inc%_EXT%\xmlscript -..\%__SRC%\bin\*.dll %_DEST%\bin%_EXT%\*.dll -..\%__SRC%\lib\*.lib %_DEST%\lib%_EXT%\*.lib -..\%__SRC%\lib\lib*.so %_DEST%\lib%_EXT%\lib*.so -..\%__SRC%\lib\*.dylib %_DEST%\lib%_EXT%\*.dylib +mkdir: %_DEST%\inc\xmlscript +..\%__SRC%\bin\*.dll %_DEST%\bin\*.dll +..\%__SRC%\lib\*.lib %_DEST%\lib\*.lib +..\%__SRC%\lib\lib*.so %_DEST%\lib\lib*.so +..\%__SRC%\lib\*.dylib %_DEST%\lib\*.dylib -..\inc\xmlscript\xml_helper.hxx %_DEST%\inc%_EXT%\xmlscript\xml_helper.hxx -..\inc\xmlscript\xmldlg_imexp.hxx %_DEST%\inc%_EXT%\xmlscript\xmldlg_imexp.hxx -..\inc\xmlscript\xmllib_imexp.hxx %_DEST%\inc%_EXT%\xmlscript\xmllib_imexp.hxx -..\inc\xmlscript\xmlmod_imexp.hxx %_DEST%\inc%_EXT%\xmlscript\xmlmod_imexp.hxx -..\inc\xmlscript\xmlns.h %_DEST%\inc%_EXT%\xmlscript\xmlns.h +..\inc\xmlscript\xml_helper.hxx %_DEST%\inc\xmlscript\xml_helper.hxx +..\inc\xmlscript\xmldlg_imexp.hxx %_DEST%\inc\xmlscript\xmldlg_imexp.hxx +..\inc\xmlscript\xmllib_imexp.hxx %_DEST%\inc\xmlscript\xmllib_imexp.hxx +..\inc\xmlscript\xmlmod_imexp.hxx %_DEST%\inc\xmlscript\xmlmod_imexp.hxx +..\inc\xmlscript\xmlns.h %_DEST%\inc\xmlscript\xmlns.h -..\dtd\*.dtd %_DEST%\bin%_EXT%\*.dtd -..\%__SRC%\misc\xcr.component %_DEST%\xml%_EXT%\xcr.component +..\dtd\*.dtd %_DEST%\bin\*.dtd +..\%__SRC%\misc\xcr.component %_DEST%\xml\xcr.component -- cgit