diff options
author | Oliver Bolte <obo@openoffice.org> | 2004-11-17 09:35:34 +0000 |
---|---|---|
committer | Oliver Bolte <obo@openoffice.org> | 2004-11-17 09:35:34 +0000 |
commit | d65acf861223aa048048decfe802bc6bd589cdec (patch) | |
tree | 43845f5e3f9974e2318410639556748e6d26bfcc /xmloff/source | |
parent | 0ab41375adcf8db9e750287b8bf36ab3926bd242 (diff) |
INTEGRATION: CWS impress17 (1.42.44); FILE MERGED
2004/10/28 14:09:30 bm 1.42.44.1: #i35918# conversion of fill property names with spaces
Diffstat (limited to 'xmloff/source')
-rw-r--r-- | xmloff/source/draw/ximpstyl.cxx | 73 |
1 files changed, 71 insertions, 2 deletions
diff --git a/xmloff/source/draw/ximpstyl.cxx b/xmloff/source/draw/ximpstyl.cxx index 03ff7a9c4203..265f781aa90e 100644 --- a/xmloff/source/draw/ximpstyl.cxx +++ b/xmloff/source/draw/ximpstyl.cxx @@ -2,9 +2,9 @@ * * $RCSfile: ximpstyl.cxx,v $ * - * $Revision: 1.43 $ + * $Revision: 1.44 $ * - * last change: $Author: rt $ $Date: 2004-11-03 16:41:34 $ + * last change: $Author: obo $ $Date: 2004-11-17 10:35:34 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -274,6 +274,11 @@ public: const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & xAttrList ); virtual void Finish( sal_Bool bOverwrite ); + + // #i35918# + virtual void FillPropertySet( + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertySet > & rPropSet ); }; TYPEINIT1( SdXMLDrawingPageStyleContext, XMLPropStyleContext ); @@ -358,6 +363,70 @@ void SdXMLDrawingPageStyleContext::Finish( sal_Bool bOverwrite ) } +// #i35918# +void SdXMLDrawingPageStyleContext::FillPropertySet( + const Reference< beans::XPropertySet > & rPropSet ) +{ + const sal_uInt16 MAX_SPECIAL_DRAW_STYLES = 7; + struct _ContextID_Index_Pair aContextIDs[MAX_SPECIAL_DRAW_STYLES+1] = + { + { CTF_DASHNAME , -1 }, + { CTF_LINESTARTNAME , -1 }, + { CTF_LINEENDNAME , -1 }, + { CTF_FILLGRADIENTNAME, -1 }, + { CTF_FILLTRANSNAME , -1 }, + { CTF_FILLHATCHNAME , -1 }, + { CTF_FILLBITMAPNAME , -1 }, + { -1, -1 } + }; + static sal_uInt16 aFamilies[MAX_SPECIAL_DRAW_STYLES] = + { + XML_STYLE_FAMILY_SD_STROKE_DASH_ID, + XML_STYLE_FAMILY_SD_MARKER_ID, + XML_STYLE_FAMILY_SD_MARKER_ID, + XML_STYLE_FAMILY_SD_GRADIENT_ID, + XML_STYLE_FAMILY_SD_GRADIENT_ID, + XML_STYLE_FAMILY_SD_HATCH_ID, + XML_STYLE_FAMILY_SD_FILL_IMAGE_ID + }; + + UniReference < SvXMLImportPropertyMapper > xImpPrMap = + GetStyles()->GetImportPropertyMapper( GetFamily() ); + DBG_ASSERT( xImpPrMap.is(), "There is the import prop mapper" ); + if( xImpPrMap.is() ) + xImpPrMap->FillPropertySet( GetProperties(), rPropSet, aContextIDs ); + + Reference< beans::XPropertySetInfo > xInfo; + for( sal_uInt16 i=0; i<MAX_SPECIAL_DRAW_STYLES; i++ ) + { + sal_Int32 nIndex = aContextIDs[i].nIndex; + if( nIndex != -1 ) + { + struct XMLPropertyState& rState = GetProperties()[nIndex]; + OUString sStyleName; + rState.maValue >>= sStyleName; + sStyleName = GetImport().GetStyleDisplayName( aFamilies[i], + sStyleName ); + // get property set mapper + UniReference<XMLPropertySetMapper> rPropMapper = + xImpPrMap->getPropertySetMapper(); + + // set property + const OUString& rPropertyName = + rPropMapper->GetEntryAPIName(rState.mnIndex); + if( !xInfo.is() ) + xInfo = rPropSet->getPropertySetInfo(); + if ( xInfo->hasPropertyByName( rPropertyName ) ) + { + Any aAny; + aAny <<= sStyleName; + + rPropSet->setPropertyValue( rPropertyName, aAny ); + } + } + } +} + ////////////////////////////////////////////////////////////////////////////// TYPEINIT1( SdXMLPageMasterStyleContext, SvXMLStyleContext ); |