From 5dc19680cd27d4eaea5f2f7fdc48969f704e696a Mon Sep 17 00:00:00 2001 From: Noel Power Date: Thu, 6 Sep 2012 10:21:11 +0100 Subject: add persistence support for the scrollable attributes Change-Id: I6fc196233f997e540301cac2cdf1b99d48aa2bde --- xmlscript/source/xmldlg_imexp/exp_share.hxx | 1 + xmlscript/source/xmldlg_imexp/imp_share.hxx | 1 + xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx | 1 + xmlscript/source/xmldlg_imexp/xmldlg_export.cxx | 16 +++++++++++++++ xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx | 1 + xmlscript/source/xmldlg_imexp/xmldlg_import.cxx | 23 ++++++++++++++++++++++ 6 files changed, 43 insertions(+) (limited to 'xmlscript') diff --git a/xmlscript/source/xmldlg_imexp/exp_share.hxx b/xmlscript/source/xmldlg_imexp/exp_share.hxx index f2cbd45298f1..a03d42b69173 100644 --- a/xmlscript/source/xmldlg_imexp/exp_share.hxx +++ b/xmlscript/source/xmldlg_imexp/exp_share.hxx @@ -109,6 +109,7 @@ public: template inline bool readProp( T * ret, OUString const & rPropName ); css::uno::Any readProp( OUString const & rPropName ); + void readScrollableSettings(); void readDefaults( bool supportPrintable = true, bool supportVisible = true ); void readStringAttr( OUString const & rPropName, OUString const & rAttrName ); diff --git a/xmlscript/source/xmldlg_imexp/imp_share.hxx b/xmlscript/source/xmldlg_imexp/imp_share.hxx index 3f306b7f4e9c..5ea50d3af3a9 100644 --- a/xmlscript/source/xmldlg_imexp/imp_share.hxx +++ b/xmlscript/source/xmldlg_imexp/imp_share.hxx @@ -401,6 +401,7 @@ public: inline css::uno::Reference< css::beans::XPropertySet > getControlModel() const { return _xControlModel; } + void importScollableSettings( css::uno::Reference< css::xml::input::XAttributes > const & xAttributes ); void importDefaults( sal_Int32 nBaseX, sal_Int32 nBaseY, css::uno::Reference< css::xml::input::XAttributes > const & xAttributes, diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx index a8c026ed94e0..c8daaaf1a704 100644 --- a/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx +++ b/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx @@ -1063,6 +1063,7 @@ void ElementDescriptor::readDialogModel( StyleBag * all_styles ) readBoolAttr( "Sizeable", XMLNS_DIALOGS_PREFIX ":resizeable" ); readStringAttr( "Title", XMLNS_DIALOGS_PREFIX ":title" ); + readScrollableSettings(); Any aDecorationAny( _xProps->getPropertyValue( "Decoration" ) ); bool bDecoration = sal_False; if ( (aDecorationAny >>= bDecoration) && !bDecoration ) diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx index daaf6a27e0a0..b0004ed8bcd3 100644 --- a/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx +++ b/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx @@ -970,6 +970,22 @@ void ElementDescriptor::readSelectionTypeAttr( OUString const & rPropName, OUStr } } //__________________________________________________________________________________________________ +void ElementDescriptor::readScrollableSettings() +{ + readLongAttr( "ScrollHeight", + XMLNS_DIALOGS_PREFIX ":scrollheight" ); + readLongAttr( "ScrollWidth", + XMLNS_DIALOGS_PREFIX ":scrollwidth" ); + readLongAttr( "ScrollTop", + XMLNS_DIALOGS_PREFIX ":scrolltop" ); + readLongAttr( "ScrollLeft", + XMLNS_DIALOGS_PREFIX ":scrollleft" ); + readBoolAttr( "HScroll", + XMLNS_DIALOGS_PREFIX ":hscroll" ); + readBoolAttr( "VScroll", + XMLNS_DIALOGS_PREFIX ":vscroll" ); +} + void ElementDescriptor::readDefaults( bool supportPrintable, bool supportVisible ) { Any a( _xProps->getPropertyValue( "Name" ) ); diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx index 8bd9edbe7735..e8e3b5381fa7 100644 --- a/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx +++ b/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx @@ -1970,6 +1970,7 @@ void WindowElement::endElement() ctx.importStringProperty("Title", "title", _xAttributes ); ctx.importBooleanProperty("Decoration", "withtitlebar", _xAttributes ); ctx.importImageURLProperty( "ImageURL" , "image-src" , _xAttributes ); + ctx.importScollableSettings( _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 6fec94bf13a1..d1dad5fcf498 100644 --- a/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx +++ b/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx @@ -1514,6 +1514,29 @@ void ImportContext::importEvents( } } //__________________________________________________________________________________________________ +void ImportContext::importScollableSettings( + Reference< xml::input::XAttributes > const & _xAttributes ) +{ + importLongProperty( OUString( "ScrollHeight" ), + OUString( "scrollheight" ), + _xAttributes ); + importLongProperty( OUString( "ScrollWidth" ), + OUString( "scrollwidth" ), + _xAttributes ); + importLongProperty( OUString( "ScrollTop" ), + OUString( "scrolltop" ), + _xAttributes ); + importLongProperty( OUString( "ScrollLeft" ), + OUString( "scrollleft" ), + _xAttributes ); + importBooleanProperty( OUString( "HScroll" ), + OUString( "hscroll" ), + _xAttributes ); + importBooleanProperty( OUString( "VScroll" ), + OUString( "vscroll" ), + _xAttributes ); +} + void ImportContext::importDefaults( sal_Int32 nBaseX, sal_Int32 nBaseY, Reference< xml::input::XAttributes > const & xAttributes, -- cgit