diff options
author | Rüdiger Timm <rt@openoffice.org> | 2004-08-20 07:18:30 +0000 |
---|---|---|
committer | Rüdiger Timm <rt@openoffice.org> | 2004-08-20 07:18:30 +0000 |
commit | 6bfd5523777567807f8b9296fc6c3edda8a26c8a (patch) | |
tree | e3c69374658259df6e489769b2251e37b6090e53 /xmloff/source/transform/StyleOOoTContext.cxx | |
parent | 53a3ebce64acb0e009ed7edd541166fb8c427372 (diff) |
INTEGRATION: CWS oasis2 (1.2.4); FILE MERGED
2004/08/04 08:53:26 bm 1.2.4.2: #32439# chart:symbol became chart:symbol-type and chart:symbol-name
2004/07/30 13:13:12 bm 1.2.4.1: #i32346# chart:symbol-type
Diffstat (limited to 'xmloff/source/transform/StyleOOoTContext.cxx')
-rw-r--r-- | xmloff/source/transform/StyleOOoTContext.cxx | 104 |
1 files changed, 102 insertions, 2 deletions
diff --git a/xmloff/source/transform/StyleOOoTContext.cxx b/xmloff/source/transform/StyleOOoTContext.cxx index b6d114f724ef..ff9cf5dbade8 100644 --- a/xmloff/source/transform/StyleOOoTContext.cxx +++ b/xmloff/source/transform/StyleOOoTContext.cxx @@ -2,9 +2,9 @@ * * $RCSfile: StyleOOoTContext.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: hr $ $Date: 2004-08-03 13:35:05 $ + * last change: $Author: rt $ $Date: 2004-08-20 08:18:30 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -755,6 +755,106 @@ void XMLPropertiesOOoTContext_Impl::StartElement( SvXMLUnitConverter::convertDouble( fIntervalMinor, rAttrValue ); pIntervalMinorDivisorContext = pContext; break; + case XML_PTACTION_SYMBOL: + { + sal_Int32 nSymbolType = rAttrValue.toInt32(); + OUString aNewAttrName = GetTransformer().GetNamespaceMap().GetQNameByKey( + XML_NAMESPACE_CHART, GetXMLToken( XML_SYMBOL_TYPE ) ); + + if( nSymbolType >= 0 ) + { + pContext->AddAttribute( aNewAttrName, GetXMLToken( XML_NAMED_SYMBOL )); + enum XMLTokenEnum eToken = XML_TOKEN_INVALID; + switch( nSymbolType ) + { + // SYMBOL0 + case 0: + // "square" has an awkward token name + eToken = XML_GRADIENTSTYLE_SQUARE; + break; + // SYMBOL1 + case 1: + eToken = XML_DIAMOND; + break; + // SYMBOL2 + case 2: + eToken = XML_ARROW_DOWN; + break; + // SYMBOL3 + case 3: + eToken = XML_ARROW_UP; + break; + // SYMBOL4 + case 4: + eToken = XML_ARROW_RIGHT; + break; + // SYMBOL5 + case 5: + eToken = XML_ARROW_LEFT; + break; + // SYMBOL6 + case 6: + eToken = XML_BOW_TIE; + break; + // SYMBOL7 + case 7: + eToken = XML_HOURGLASS; + break; + default: + OSL_ENSURE( false, "invalid named symbol" ); + break; + } + + if( eToken != XML_TOKEN_INVALID ) + { + pContext->AddAttribute( GetTransformer().GetNamespaceMap().GetQNameByKey( + XML_NAMESPACE_CHART, GetXMLToken( XML_SYMBOL_NAME )), + GetXMLToken( eToken )); + } + } + else + { + switch( nSymbolType ) + { + // NONE + case -3: + pContext->AddAttribute( + aNewAttrName, GetXMLToken( XML_NONE )); + break; + // AUTO + case -2: + pContext->AddAttribute( + aNewAttrName, GetXMLToken( XML_AUTOMATIC )); + break; + // BITMAPURL + case -1: + pContext->AddAttribute( + aNewAttrName, GetXMLToken( XML_IMAGE )); + break; + default: + OSL_ENSURE( false, "invalid symbol type" ); + pContext->AddAttribute( + aNewAttrName, GetXMLToken( XML_NONE )); + break; + } + } + } + break; + case XML_PTACTION_SYMBOL_IMAGE_NAME: + { + // create an xlink:href element for URI attribute + XMLPersAttrListTContext *pSymbolImageContext = new XMLPersAttrListTContext( + GetTransformer(), GetTransformer().GetNamespaceMap().GetQNameByKey( + XML_NAMESPACE_CHART, GetXMLToken( XML_SYMBOL_IMAGE ))); + + OUString aAttrValue( rAttrValue ); + if( GetTransformer().ConvertURIToOASIS( aAttrValue, sal_True )) + { + pSymbolImageContext->AddAttribute( XML_NAMESPACE_XLINK, XML_HREF, aAttrValue ); + pContext->AddContent( pSymbolImageContext ); + } + } + break; // #i25616# case XML_PTACTION_TRANSPARENCY : |