diff options
Diffstat (limited to 'xmlscript/source')
-rw-r--r-- | xmlscript/source/xmldlg_imexp/exp_share.hxx | 7 | ||||
-rw-r--r-- | xmlscript/source/xmldlg_imexp/imp_share.hxx | 10 | ||||
-rw-r--r-- | xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx | 71 | ||||
-rw-r--r-- | xmlscript/source/xmldlg_imexp/xmldlg_export.cxx | 47 | ||||
-rw-r--r-- | xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx | 142 | ||||
-rw-r--r-- | xmlscript/source/xmldlg_imexp/xmldlg_import.cxx | 75 |
6 files changed, 325 insertions, 27 deletions
diff --git a/xmlscript/source/xmldlg_imexp/exp_share.hxx b/xmlscript/source/xmldlg_imexp/exp_share.hxx index 49a7c5ae68c8..c813fca70558 100644 --- a/xmlscript/source/xmldlg_imexp/exp_share.hxx +++ b/xmlscript/source/xmldlg_imexp/exp_share.hxx @@ -2,9 +2,9 @@ * * $RCSfile: exp_share.hxx,v $ * - * $Revision: 1.8 $ + * $Revision: 1.9 $ * - * last change: $Author: dbo $ $Date: 2001-05-04 09:14:56 $ + * last change: $Author: dbo $ $Date: 2001-05-04 13:17:40 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -85,6 +85,8 @@ struct Style sal_uInt32 _textColor; sal_Int16 _border; awt::FontDescriptor _descr; + sal_uInt32 _fillColor; + short _all; short _set; @@ -145,6 +147,7 @@ public: void readAlignAttr( OUString const & rPropName, OUString const & rAttrName ); void readDateFormatAttr( OUString const & rPropName, OUString const & rAttrName ); void readTimeFormatAttr( OUString const & rPropName, OUString const & rAttrName ); + void readOrientationAttr( OUString const & rPropName, OUString const & rAttrName ); // inline void addBoolAttr( OUString const & rAttrName, sal_Bool bValue ) SAL_THROW( () ); diff --git a/xmlscript/source/xmldlg_imexp/imp_share.hxx b/xmlscript/source/xmldlg_imexp/imp_share.hxx index 5e4efea9be93..62f06bc9f629 100644 --- a/xmlscript/source/xmldlg_imexp/imp_share.hxx +++ b/xmlscript/source/xmldlg_imexp/imp_share.hxx @@ -2,9 +2,9 @@ * * $RCSfile: imp_share.hxx,v $ * - * $Revision: 1.10 $ + * $Revision: 1.11 $ * - * last change: $Author: dbo $ $Date: 2001-05-04 09:14:56 $ + * last change: $Author: dbo $ $Date: 2001-05-04 13:17:40 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -261,6 +261,7 @@ class StyleElement sal_Int32 _textColor; sal_Int16 _border; awt::FontDescriptor _descr; + sal_Int32 _fillColor; short _inited, _hasValue; @@ -274,6 +275,8 @@ public: bool importTextColorStyle( Reference< beans::XPropertySet > const & xProps ); + bool importFillColorStyle( + Reference< beans::XPropertySet > const & xProps ); bool importBackgroundColorStyle( Reference< beans::XPropertySet > const & xProps ); bool importFontStyle( @@ -384,6 +387,9 @@ public: bool importTimeFormatProperty( OUString const & rPropName, OUString const & rAttrName, Reference< xml::sax2::XExtendedAttributes > const & xAttributes ); + bool importOrientationProperty( + OUString const & rPropName, OUString const & rAttrName, + Reference< xml::sax2::XExtendedAttributes > const & xAttributes ); }; //================================================================================================== class ControlImportContext : public ImportContext diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx index bb16d1ac48a1..ca00ff3bfb91 100644 --- a/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx +++ b/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx @@ -2,9 +2,9 @@ * * $RCSfile: xmldlg_expmodels.cxx,v $ * - * $Revision: 1.9 $ + * $Revision: 1.10 $ * - * last change: $Author: dbo $ $Date: 2001-05-04 09:14:56 $ + * last change: $Author: dbo $ $Date: 2001-05-04 13:17:40 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -684,16 +684,83 @@ void ElementDescriptor::readPatternFieldModel( StyleBag * all_styles ) void ElementDescriptor::readFixedLineModel( StyleBag * all_styles ) SAL_THROW( (Exception) ) { + // collect styles + Style aStyle( 0x2 | 0x8 ); + if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("TextColor") ) ) >>= aStyle._textColor) + aStyle._set |= 0x2; + if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("FontDescriptor") ) ) >>= aStyle._descr) + aStyle._set |= 0x8; + if (aStyle._set) + { + addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":style-id") ), + all_styles->getStyleId( aStyle ) ); + } + + // collect elements + readDefaults(); + readStringAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Label") ), + OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":value") ) ); + readOrientationAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("Orientation") ), + OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":align") ) ); + readEvents(); } //__________________________________________________________________________________________________ void ElementDescriptor::readProgressBarModel( StyleBag * all_styles ) SAL_THROW( (Exception) ) { + // collect styles + Style aStyle( 0x1 | 0x4 | 0x10 ); + if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("BackgroundColor") ) ) >>= aStyle._backgroundColor) + aStyle._set |= 0x1; + if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("Border") ) ) >>= aStyle._border) + aStyle._set |= 0x4; + if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("FillColor") ) ) >>= aStyle._descr) + aStyle._set |= 0x10; + 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("ProgressValueMin") ), + OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":value-min") ) ); + readLongAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ProgressValueMax") ), + OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":value-max") ) ); + readEvents(); } //__________________________________________________________________________________________________ void ElementDescriptor::readScrollBarModel( StyleBag * all_styles ) SAL_THROW( (Exception) ) { + // collect styles + Style aStyle( 0x4 ); + if (readProp( OUString( RTL_CONSTASCII_USTRINGPARAM("Border") ) ) >>= aStyle._border) + 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("BlockIncrement") ), + OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":pageincrement") ) ); + readLongAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("LineIncrement") ), + OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":increment") ) ); + readLongAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ScrollValue") ), + OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":curpos") ) ); + readLongAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("ScrollValueMax") ), + OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":maxpos") ) ); + readLongAttr( OUString( RTL_CONSTASCII_USTRINGPARAM("VisibleSize") ), + OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":visible-size") ) ); + readEvents(); } //__________________________________________________________________________________________________ void ElementDescriptor::readDialogModel( StyleBag * all_styles ) diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx index ae973685b8d1..e51253744535 100644 --- a/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx +++ b/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx @@ -2,9 +2,9 @@ * * $RCSfile: xmldlg_export.cxx,v $ * - * $Revision: 1.18 $ + * $Revision: 1.19 $ * - * last change: $Author: dbo $ $Date: 2001-05-04 09:14:56 $ + * last change: $Author: dbo $ $Date: 2001-05-04 13:17:40 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -112,6 +112,17 @@ Reference< xml::sax::XAttributeList > Style::createElement() buf.makeStringAndClear() ); } + // fill-color + if (_set & 0x10) + { + OUStringBuffer buf( 16 ); + buf.append( (sal_Unicode)'0' ); + buf.append( (sal_Unicode)'x' ); + buf.append( OUString::valueOf( (sal_Int64)(sal_uInt64)_fillColor, 16 ) ); + pStyle->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":fill-color") ), + buf.makeStringAndClear() ); + } + // border if (_set & 0x4) { @@ -630,6 +641,28 @@ void ElementDescriptor::readAlignAttr( OUString const & rPropName, OUString cons } } //__________________________________________________________________________________________________ +void ElementDescriptor::readOrientationAttr( OUString const & rPropName, OUString const & rAttrName ) +{ + if (beans::PropertyState_DEFAULT_VALUE != _xPropState->getPropertyState( rPropName )) + { + Any a( _xProps->getPropertyValue( rPropName ) ); + if (a.getValueTypeClass() == TypeClass_SHORT) + { + switch (*(sal_Int32 const *)a.getValue()) + { + case 0: + addAttribute( rAttrName, OUString( RTL_CONSTASCII_USTRINGPARAM("horizontal") ) ); + break; + case 1: + addAttribute( rAttrName, OUString( RTL_CONSTASCII_USTRINGPARAM("vertical") ) ); + break; + default: + OSL_ENSURE( 0, "### illegal orientation value!" ); + } + } + } +} +//__________________________________________________________________________________________________ void ElementDescriptor::readDefaults() { Any a( _xProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM("Name") ) ) ); @@ -800,6 +833,10 @@ OUString StyleBag::getStyleId( Style const & rStyle ) { continue; } + if ((bset & 0x10) && rStyle._fillColor != pStyle->_fillColor) + { + continue; + } if ((bset & 0x4) && rStyle._border != pStyle->_border) { continue; @@ -819,6 +856,10 @@ OUString StyleBag::getStyleId( Style const & rStyle ) { pStyle->_textColor = rStyle._textColor; } + if (bnset & 0x10) + { + pStyle->_fillColor = rStyle._fillColor; + } if (bnset & 0x4) { pStyle->_border = rStyle._border; @@ -1049,7 +1090,7 @@ void SAL_CALL exportDialogModel( { pElem = new ElementDescriptor( xProps, xPropState, - OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":fixed-line") ) ); + OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_DIALOGS_PREFIX ":fixedline") ) ); xElem = static_cast< xml::sax::XAttributeList * >( pElem ); pElem->readFixedLineModel( &all_styles ); } diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx index 49d33e6255ec..da3c467d7a76 100644 --- a/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx +++ b/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx @@ -2,9 +2,9 @@ * * $RCSfile: xmldlg_impmodels.cxx,v $ * - * $Revision: 1.15 $ + * $Revision: 1.16 $ * - * last change: $Author: dbo $ $Date: 2001-05-04 09:14:56 $ + * last change: $Author: dbo $ $Date: 2001-05-04 13:17:40 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -77,12 +77,53 @@ Reference< xml::XImportContext > ProgressBarElement::createChildContext( Reference< xml::sax2::XExtendedAttributes > const & xAttributes ) throw (xml::sax::SAXException, RuntimeException) { - return Reference< xml::XImportContext >(); + if (XMLNS_DIALOGS_UID != nUid) + { + throw xml::sax::SAXException( + OUString( RTL_CONSTASCII_USTRINGPARAM("illegal namespace!") ), + Reference< XInterface >(), Any() ); + } + // event + else if (rLocalName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("event") )) + { + return new EventElement( rLocalName, xAttributes, this, _pImport ); + } + else + { + throw xml::sax::SAXException( + OUString( RTL_CONSTASCII_USTRINGPARAM("expected event element!") ), + Reference< XInterface >(), Any() ); + } } //__________________________________________________________________________________________________ void ProgressBarElement::endElement() throw (xml::sax::SAXException, RuntimeException) { + ControlImportContext ctx( + _pImport, getControlId( _xAttributes ), + OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlProgressBarModel") ) ); + + Reference< xml::XImportContext > 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 ); + pStyle->importFillColorStyle( xControlModel ); + } + + ctx.importDefaults( _nBasePosX, _nBasePosY, _xAttributes ); + ctx.importLongProperty( OUString( RTL_CONSTASCII_USTRINGPARAM("ProgressValue") ), + OUString( RTL_CONSTASCII_USTRINGPARAM("value") ), + _xAttributes ); + ctx.importLongProperty( OUString( RTL_CONSTASCII_USTRINGPARAM("ProgressValueMin") ), + OUString( RTL_CONSTASCII_USTRINGPARAM("value-min") ), + _xAttributes ); + ctx.importLongProperty( OUString( RTL_CONSTASCII_USTRINGPARAM("ProgressValueMax") ), + OUString( RTL_CONSTASCII_USTRINGPARAM("value-max") ), + _xAttributes ); + ctx.importEvents( _events ); } //################################################################################################## @@ -94,29 +135,114 @@ Reference< xml::XImportContext > ScrollBarElement::createChildContext( Reference< xml::sax2::XExtendedAttributes > const & xAttributes ) throw (xml::sax::SAXException, RuntimeException) { - return Reference< xml::XImportContext >(); + if (XMLNS_DIALOGS_UID != nUid) + { + throw xml::sax::SAXException( + OUString( RTL_CONSTASCII_USTRINGPARAM("illegal namespace!") ), + Reference< XInterface >(), Any() ); + } + // event + else if (rLocalName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("event") )) + { + return new EventElement( rLocalName, xAttributes, this, _pImport ); + } + else + { + throw xml::sax::SAXException( + OUString( RTL_CONSTASCII_USTRINGPARAM("expected event element!") ), + Reference< XInterface >(), Any() ); + } } //__________________________________________________________________________________________________ void ScrollBarElement::endElement() throw (xml::sax::SAXException, RuntimeException) { + ControlImportContext ctx( + _pImport, getControlId( _xAttributes ), + OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlScrollBarModel") ) ); + + Reference< xml::XImportContext > xStyle( getStyle( _xAttributes ) ); + if (xStyle.is()) + { + StyleElement * pStyle = static_cast< StyleElement * >( xStyle.get () ); + Reference< beans::XPropertySet > xControlModel( ctx.getControlModel() ); + 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("BlockIncrement") ), + OUString( RTL_CONSTASCII_USTRINGPARAM("pageincrement") ), + _xAttributes ); + ctx.importLongProperty( OUString( RTL_CONSTASCII_USTRINGPARAM("LineIncrement") ), + OUString( RTL_CONSTASCII_USTRINGPARAM("increment") ), + _xAttributes ); + ctx.importLongProperty( OUString( RTL_CONSTASCII_USTRINGPARAM("ScrollValue") ), + OUString( RTL_CONSTASCII_USTRINGPARAM("curpos") ), + _xAttributes ); + ctx.importLongProperty( OUString( RTL_CONSTASCII_USTRINGPARAM("ScrollValueMax") ), + OUString( RTL_CONSTASCII_USTRINGPARAM("maxpos") ), + _xAttributes ); + ctx.importLongProperty( OUString( RTL_CONSTASCII_USTRINGPARAM("VisibleSize") ), + OUString( RTL_CONSTASCII_USTRINGPARAM("visible-size") ), + _xAttributes ); + ctx.importEvents( _events ); } //################################################################################################## -// fixed-line +// fixedline //__________________________________________________________________________________________________ Reference< xml::XImportContext > FixedLineElement::createChildContext( sal_Int32 nUid, OUString const & rLocalName, Reference< xml::sax2::XExtendedAttributes > const & xAttributes ) throw (xml::sax::SAXException, RuntimeException) { - return Reference< xml::XImportContext >(); + if (XMLNS_DIALOGS_UID != nUid) + { + throw xml::sax::SAXException( + OUString( RTL_CONSTASCII_USTRINGPARAM("illegal namespace!") ), + Reference< XInterface >(), Any() ); + } + // event + else if (rLocalName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("event") )) + { + return new EventElement( rLocalName, xAttributes, this, _pImport ); + } + else + { + throw xml::sax::SAXException( + OUString( RTL_CONSTASCII_USTRINGPARAM("expected event element!") ), + Reference< XInterface >(), Any() ); + } } //__________________________________________________________________________________________________ void FixedLineElement::endElement() throw (xml::sax::SAXException, RuntimeException) { + ControlImportContext ctx( + _pImport, getControlId( _xAttributes ), + OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControlFixedLineModel") ) ); + + Reference< xml::XImportContext > xStyle( getStyle( _xAttributes ) ); + if (xStyle.is()) + { + StyleElement * pStyle = static_cast< StyleElement * >( xStyle.get () ); + Reference< beans::XPropertySet > xControlModel( ctx.getControlModel() ); + pStyle->importTextColorStyle( xControlModel ); + pStyle->importFontStyle( xControlModel ); + } + + ctx.importDefaults( _nBasePosX, _nBasePosY, _xAttributes ); + ctx.importStringProperty( OUString( RTL_CONSTASCII_USTRINGPARAM("Label") ), + OUString( RTL_CONSTASCII_USTRINGPARAM("value") ), + _xAttributes ); + ctx.importOrientationProperty( OUString( RTL_CONSTASCII_USTRINGPARAM("Orientation") ), + OUString( RTL_CONSTASCII_USTRINGPARAM("align") ), + _xAttributes ); + ctx.importEvents( _events ); } //################################################################################################## @@ -1416,8 +1542,8 @@ Reference< xml::XImportContext > BulletinBoardElement::createChildContext( { return new PatternFieldElement( rLocalName, xAttributes, this, _pImport ); } - // fixed-line - else if (rLocalName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("fixed-line") )) + // fixedline + else if (rLocalName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("fixedline") )) { return new FixedLineElement( rLocalName, xAttributes, this, _pImport ); } diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx index 64522952e4cf..70fd8bc8c9e5 100644 --- a/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx +++ b/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx @@ -2,9 +2,9 @@ * * $RCSfile: xmldlg_import.cxx,v $ * - * $Revision: 1.13 $ + * $Revision: 1.14 $ * - * last change: $Author: dbo $ $Date: 2001-04-04 14:35:09 $ + * last change: $Author: dbo $ $Date: 2001-05-04 13:17:40 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -144,9 +144,9 @@ OUString ControlElement::getControlId( bool StyleElement::importTextColorStyle( Reference< beans::XPropertySet > const & xProps ) { - if ((_inited & 0x1) != 0) + if ((_inited & 0x2) != 0) { - if ((_hasValue & 0x1) != 0) + if ((_hasValue & 0x2) != 0) { xProps->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM("TextColor") ), makeAny( _textColor ) ); @@ -154,12 +154,12 @@ bool StyleElement::importTextColorStyle( } return false; } - _inited |= 0x1; + _inited |= 0x2; if (getLongAttr( &_textColor, OUString( RTL_CONSTASCII_USTRINGPARAM("text-color") ), _xAttributes )) { - _hasValue |= 0x1; + _hasValue |= 0x2; xProps->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM("TextColor") ), makeAny( _textColor ) ); return true; @@ -167,12 +167,38 @@ bool StyleElement::importTextColorStyle( return false; } //__________________________________________________________________________________________________ +bool StyleElement::importFillColorStyle( + Reference< beans::XPropertySet > const & xProps ) +{ + if ((_inited & 0x10) != 0) + { + if ((_hasValue & 0x10) != 0) + { + xProps->setPropertyValue( + OUString( RTL_CONSTASCII_USTRINGPARAM("FillColor") ), makeAny( _fillColor ) ); + return true; + } + return false; + } + _inited |= 0x10; + + if (getLongAttr( &_fillColor, + OUString( RTL_CONSTASCII_USTRINGPARAM("fill-color") ), _xAttributes )) + { + _hasValue |= 0x10; + xProps->setPropertyValue( + OUString( RTL_CONSTASCII_USTRINGPARAM("FillColor") ), makeAny( _fillColor ) ); + return true; + } + return false; +} +//__________________________________________________________________________________________________ bool StyleElement::importBackgroundColorStyle( Reference< beans::XPropertySet > const & xProps ) { - if ((_inited & 0x2) != 0) + if ((_inited & 0x1) != 0) { - if ((_hasValue & 0x2) != 0) + if ((_hasValue & 0x1) != 0) { xProps->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM("BackgroundColor") ), makeAny( _backgroundColor ) ); @@ -180,12 +206,12 @@ bool StyleElement::importBackgroundColorStyle( } return false; } - _inited |= 0x2; + _inited |= 0x1; if (getLongAttr( &_backgroundColor, OUString( RTL_CONSTASCII_USTRINGPARAM("background-color") ), _xAttributes )) { - _hasValue |= 0x2; + _hasValue |= 0x1; xProps->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM("BackgroundColor") ), makeAny( _backgroundColor ) ); return true; @@ -812,6 +838,35 @@ bool ImportContext::importTimeFormatProperty( return false; } //__________________________________________________________________________________________________ +bool ImportContext::importOrientationProperty( + OUString const & rPropName, OUString const & rAttrName, + Reference< xml::sax2::XExtendedAttributes > const & xAttributes ) +{ + OUString aOrient( xAttributes->getValueByUidName( XMLNS_DIALOGS_UID, rAttrName ) ); + if (aOrient.getLength()) + { + sal_Int32 nOrient; + if (aOrient.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("horizontal") )) + { + nOrient = 0; + } + else if (aOrient.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("vertical") )) + { + nOrient = 1; + } + else + { + throw xml::sax::SAXException( + OUString( RTL_CONSTASCII_USTRINGPARAM("invalid orientation value!") ), + Reference< XInterface >(), Any() ); + } + + _xControlModel->setPropertyValue( rPropName, makeAny( nOrient ) ); + return true; + } + return false; +} +//__________________________________________________________________________________________________ void ImportContext::importEvents( vector< Reference< xml::sax2::XExtendedAttributes > > const & rEvents ) { |