diff options
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/inc/XMLChartPropertySetMapper.hxx | 18 | ||||
-rw-r--r-- | xmloff/source/chart/PropertyMap.hxx | 18 | ||||
-rw-r--r-- | xmloff/source/chart/PropertyMaps.cxx | 40 | ||||
-rw-r--r-- | xmloff/source/chart/SchXMLExport.cxx | 28 | ||||
-rw-r--r-- | xmloff/source/style/xmlstyle.cxx | 6 |
5 files changed, 77 insertions, 33 deletions
diff --git a/xmloff/inc/XMLChartPropertySetMapper.hxx b/xmloff/inc/XMLChartPropertySetMapper.hxx index 5f2250ae6915..f3d6cc926eb3 100644 --- a/xmloff/inc/XMLChartPropertySetMapper.hxx +++ b/xmloff/inc/XMLChartPropertySetMapper.hxx @@ -2,9 +2,9 @@ * * $RCSfile: XMLChartPropertySetMapper.hxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: mib $ $Date: 2000-11-07 13:33:02 $ + * last change: $Author: bm $ $Date: 2001-05-11 18:17:55 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -73,11 +73,15 @@ #ifndef _XMLOFF_XMLIMPPR_HXX #include "xmlimppr.hxx" #endif +#ifndef _XMLOFF_XMLIMP_HXX +#include "xmlimp.hxx" +#endif namespace rtl { class OUString; } extern const XMLPropertyMapEntry aXMLChartPropMap[]; +class SvXMLExport; // ---------------------------------------- @@ -109,6 +113,8 @@ private: const rtl::OUString msTrue; const rtl::OUString msFalse; + SvXMLExport& mrExport; + protected: virtual void ContextFilter( ::std::vector< XMLPropertyState >& rProperties, @@ -132,7 +138,8 @@ private: sal_uInt32 nIdx = 0 ) const; public: - XMLChartExportPropertyMapper( const UniReference< XMLPropertySetMapper >& rMapper ); + XMLChartExportPropertyMapper( const UniReference< XMLPropertySetMapper >& rMapper, + SvXMLExport& rExport ); virtual ~XMLChartExportPropertyMapper(); }; @@ -141,8 +148,11 @@ public: class XMLChartImportPropertyMapper : public SvXMLImportPropertyMapper { private: + SvXMLImport& mrImport; + public: - XMLChartImportPropertyMapper( const UniReference< XMLPropertySetMapper >& rMapper ); + XMLChartImportPropertyMapper( const UniReference< XMLPropertySetMapper >& rMapper, + const SvXMLImport& rImport ); virtual ~XMLChartImportPropertyMapper(); virtual sal_Bool handleSpecialItem( diff --git a/xmloff/source/chart/PropertyMap.hxx b/xmloff/source/chart/PropertyMap.hxx index cadd0ced74be..927d238dff4e 100644 --- a/xmloff/source/chart/PropertyMap.hxx +++ b/xmloff/source/chart/PropertyMap.hxx @@ -2,9 +2,9 @@ * * $RCSfile: PropertyMap.hxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: bm $ $Date: 2001-05-10 12:33:42 $ + * last change: $Author: bm $ $Date: 2001-05-11 18:17:55 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -95,6 +95,9 @@ #ifndef _COM_SUN_STAR_CHART_CHARTSOLIDTYPE_HPP_ #include <com/sun/star/chart/ChartSolidType.hpp> #endif +#ifndef _COM_SUN_STAR_CHART_CHARTDATAROWSOURCE_HPP_ +#include <com/sun/star/chart/ChartDataRowSource.hpp> +#endif // custom types #define XML_SCH_TYPE_AXIS_ARRANGEMENT ( XML_SCH_TYPES_START + 0 ) @@ -103,6 +106,7 @@ #define XML_SCH_TYPE_SOLID_TYPE ( XML_SCH_TYPES_START + 3 ) #define XML_SCH_TYPE_ERROR_INDICATOR_UPPER ( XML_SCH_TYPES_START + 4 ) #define XML_SCH_TYPE_ERROR_INDICATOR_LOWER ( XML_SCH_TYPES_START + 5 ) +#define XML_SCH_TYPE_DATAROWSOURCE ( XML_SCH_TYPES_START + 6 ) // context ids #define XML_SCH_CONTEXT_USER_SYMBOL ( XML_SCH_CTF_START + 0 ) @@ -124,6 +128,7 @@ #define XML_SCH_CONTEXT_SPECIAL_DATA_ROW_SOURCE ( XML_SCH_CTF_START + 19 ) #define XML_SCH_CONTEXT_SPECIAL_SYMBOL_WIDTH ( XML_SCH_CTF_START + 20 ) #define XML_SCH_CONTEXT_SPECIAL_SYMBOL_HEIGHT ( XML_SCH_CTF_START + 21 ) +#define XML_SCH_CONTEXT_SPECIAL_SYMBOL_IMAGE_NAME ( XML_SCH_CTF_START + 22 ) #define MAP_ENTRY( a, ns, nm, t ) { a, XML_NAMESPACE_##ns, sXML_##nm, t } #define MAP_CONTEXT( a, ns, nm, t, c ) { a, XML_NAMESPACE_##ns, sXML_##nm, t, XML_SCH_CONTEXT_##c } @@ -156,12 +161,13 @@ const XMLPropertyMapEntry aXMLChartPropMap[] = MAP_CONTEXT( "SymbolType", CHART, symbol, XML_TYPE_NUMBER, USER_SYMBOL ), MAP_SPECIAL( "SymbolSize", CHART, symbol_width, XML_TYPE_MEASURE | MID_FLAG_MERGE_PROPERTY, SYMBOL_WIDTH ), MAP_SPECIAL( "SymbolSize", CHART, symbol_height, XML_TYPE_MEASURE | MID_FLAG_MERGE_PROPERTY, SYMBOL_HEIGHT ), + MAP_SPECIAL( "SymbolBitmapURL", CHART, symbol_image_name, XML_TYPE_STRING, SYMBOL_IMAGE_NAME ), MAP_ENTRY( "Vertical", CHART, vertical, XML_TYPE_BOOL ), MAP_ENTRY( "NumberOfLines", CHART, lines_used, XML_TYPE_NUMBER ), MAP_ENTRY( "StackedBarsConnected", CHART, connect_bars, XML_TYPE_BOOL ), // plot-area properties - MAP_SPECIAL( "DataRowSource", CHART, reinterpret_data_in_rows, XML_TYPE_BOOL, DATA_ROW_SOURCE ), + MAP_SPECIAL( "DataRowSource", CHART, series_source, XML_SCH_TYPE_DATAROWSOURCE, DATA_ROW_SOURCE ), // axis properties MAP_ENTRY( "DisplayLabels", CHART, display_label, XML_TYPE_BOOL ), @@ -245,6 +251,12 @@ SvXMLEnumMapEntry aXMLChartSolidTypeEnumMap[] = { sXML_pyramid, ::com::sun::star::chart::ChartSolidType::PYRAMID }, }; +SvXMLEnumMapEntry aXMLChartDataRowSourceTypeEnumMap[] = +{ + { sXML_columns, ::com::sun::star::chart::ChartDataRowSource_COLUMNS }, + { sXML_rows, ::com::sun::star::chart::ChartDataRowSource_ROWS } +}; + #endif // XML_SCH_CREATE_GLOBAL_MAPS #endif // _PROPERTYMAP_HXX_ diff --git a/xmloff/source/chart/PropertyMaps.cxx b/xmloff/source/chart/PropertyMaps.cxx index 997b69b42e0d..0ce9d45622e6 100644 --- a/xmloff/source/chart/PropertyMaps.cxx +++ b/xmloff/source/chart/PropertyMaps.cxx @@ -2,9 +2,9 @@ * * $RCSfile: PropertyMaps.cxx,v $ * - * $Revision: 1.19 $ + * $Revision: 1.20 $ * - * last change: $Author: bm $ $Date: 2001-05-10 12:41:11 $ + * last change: $Author: bm $ $Date: 2001-05-11 18:17:55 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -90,6 +90,9 @@ #ifndef _XMLOFF_NAMEDBOOLPROPERTYHANDLER_HXX #include "NamedBoolPropertyHdl.hxx" #endif +#ifndef _XMLOFF_XMLEXP_HXX +#include "xmlexp.hxx" +#endif #ifndef _XMLERRORINDICATORPROPERTYHDL_HXX_ #include "XMLErrorIndicatorPropertyHdl.hxx" @@ -177,7 +180,11 @@ const XMLPropertyHandler* XMLChartPropHdlFactory::GetPropertyHandler( sal_Int32 // here we have a constant rather than an enum pHdl = new XMLConstantsPropertyHandler( aXMLChartSolidTypeEnumMap, sXML_cuboid ); break; - } + case XML_SCH_TYPE_DATAROWSOURCE: + pHdl = new XMLEnumPropertyHdl( aXMLChartDataRowSourceTypeEnumMap, + ::getCppuType((const chart::ChartDataRowSource*)0) ); + break; + } if( pHdl ) PutHdlCache( nType, pHdl ); } @@ -198,11 +205,13 @@ XMLChartPropertySetMapper::~XMLChartPropertySetMapper() // ---------------------------------------- -XMLChartExportPropertyMapper::XMLChartExportPropertyMapper( const UniReference< XMLPropertySetMapper >& rMapper ) : +XMLChartExportPropertyMapper::XMLChartExportPropertyMapper( const UniReference< XMLPropertySetMapper >& rMapper, + SvXMLExport& rExport) : SvXMLExportPropertyMapper( rMapper ), msCDATA( rtl::OUString::createFromAscii( sXML_CDATA )), msTrue( rtl::OUString::createFromAscii( sXML_true )), - msFalse( rtl::OUString::createFromAscii( sXML_false )) + msFalse( rtl::OUString::createFromAscii( sXML_false )), + mrExport( rExport ) { } @@ -228,9 +237,9 @@ void XMLChartExportPropertyMapper::ContextFilter( { case XML_SCH_CONTEXT_USER_SYMBOL: { - sal_Int32 nIndex = chart::ChartSymbolType::AUTO; + sal_Int32 nIndex = chart::ChartSymbolType::NONE; property->maValue >>= nIndex; - if( nIndex == chart::ChartSymbolType::AUTO ) + if( nIndex == chart::ChartSymbolType::NONE ) property->mnIndex = -1; } break; @@ -256,6 +265,13 @@ void XMLChartExportPropertyMapper::ContextFilter( bCheckAuto = sal_True; aAutoPropName = ::rtl::OUString::createFromAscii( "AutoOrigin" ); break; + case XML_SCH_CONTEXT_SPECIAL_SYMBOL_IMAGE_NAME: + { + ::rtl::OUString aURLStr; + property->maValue >>= aURLStr; + property->maValue <<= mrExport.AddEmbeddedGraphicObject( aURLStr ); + } + break; } if( bCheckAuto ) @@ -393,8 +409,10 @@ void XMLChartExportPropertyMapper::handleSpecialItem( // ---------------------------------------- -XMLChartImportPropertyMapper::XMLChartImportPropertyMapper( const UniReference< XMLPropertySetMapper >& rMapper ) : - SvXMLImportPropertyMapper( rMapper ) +XMLChartImportPropertyMapper::XMLChartImportPropertyMapper( const UniReference< XMLPropertySetMapper >& rMapper, + const SvXMLImport& rImport ) : + SvXMLImportPropertyMapper( rMapper ), + mrImport( SAL_CONST_CAST( SvXMLImport&, rImport )) { // chain shape mapper for drawing properties @@ -414,6 +432,7 @@ sal_Bool XMLChartImportPropertyMapper::handleSpecialItem( const SvXMLUnitConverter& rUnitConverter, const SvXMLNamespaceMap& rNamespaceMap ) const { + static const ::rtl::OUString sPackageProtocol( RTL_CONSTASCII_USTRINGPARAM( "vnd.sun.star.Package:" ) ); sal_Int32 nContextId = maPropMapper->GetEntryContextId( rProperty.mnIndex ); sal_Bool bRet = (nContextId != 0); @@ -508,6 +527,9 @@ sal_Bool XMLChartImportPropertyMapper::handleSpecialItem( rProperty.maValue <<= aSize; } break; + case XML_SCH_CONTEXT_SPECIAL_SYMBOL_IMAGE_NAME: + rProperty.maValue <<= mrImport.ResolveGraphicObjectURL( rValue, sal_False ); + break; default: bRet = sal_False; break; diff --git a/xmloff/source/chart/SchXMLExport.cxx b/xmloff/source/chart/SchXMLExport.cxx index e592ca60598e..eecdc20afc0c 100644 --- a/xmloff/source/chart/SchXMLExport.cxx +++ b/xmloff/source/chart/SchXMLExport.cxx @@ -2,9 +2,9 @@ * * $RCSfile: SchXMLExport.cxx,v $ * - * $Revision: 1.34 $ + * $Revision: 1.35 $ * - * last change: $Author: bm $ $Date: 2001-05-09 14:02:55 $ + * last change: $Author: bm $ $Date: 2001-05-11 18:17:55 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -197,7 +197,7 @@ SchXMLExportHelper::SchXMLExportHelper( } - mxExpPropMapper = new XMLChartExportPropertyMapper( mxPropertySetMapper ); + mxExpPropMapper = new XMLChartExportPropertyMapper( mxPropertySetMapper, rExport ); // chain draw properties mxExpPropMapper->ChainExportMapper( XMLShapeExport::CreateShapePropMapper( rExport )); @@ -1133,15 +1133,15 @@ void SchXMLExportHelper::exportPlotArea( uno::Reference< chart::XDiagram > xDiag else aASName = GetAutoStylePoolP().Find( nStyleFamily, aPropertyStates ); - if( aASName.equals( aLastASName )) + if( nElement ) // The first element is skipped because it can not be compared to a previous one. { - nRepeated++; - } - else - { - // write last style - if( nElement ) // don't write when first getting here + if( aASName.equals( aLastASName )) { + nRepeated++; + } + else + { + // write last style if( nRepeated > 1 ) { mrExport.AddAttribute( XML_NAMESPACE_CHART, sXML_repeated, @@ -1154,11 +1154,11 @@ void SchXMLExportHelper::exportPlotArea( uno::Reference< chart::XDiagram > xDiag mrExport.AddAttribute( XML_NAMESPACE_CHART, sXML_style_name, aLastASName ); } SvXMLElementExport aPoint( mrExport, XML_NAMESPACE_CHART, sXML_data_point, sal_True, sal_True ); - } - // reset repeat counter for new style - nRepeated = 1; - aLastASName = aASName; + // reset repeat counter for new style + nRepeated = 1; + aLastASName = aASName; + } } } else diff --git a/xmloff/source/style/xmlstyle.cxx b/xmloff/source/style/xmlstyle.cxx index 510801f405ae..3538ed0f5f62 100644 --- a/xmloff/source/style/xmlstyle.cxx +++ b/xmloff/source/style/xmlstyle.cxx @@ -2,9 +2,9 @@ * * $RCSfile: xmlstyle.cxx,v $ * - * $Revision: 1.21 $ + * $Revision: 1.22 $ * - * last change: $Author: sab $ $Date: 2001-03-21 10:51:03 $ + * last change: $Author: bm $ $Date: 2001-05-11 18:17:56 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -810,7 +810,7 @@ UniReference < SvXMLImportPropertyMapper > SvXMLStylesContext::GetImportProperty if( ! xChartImpPropMapper.is() ) { XMLPropertySetMapper *pPropMapper = new XMLChartPropertySetMapper(); - xChartImpPropMapper = new XMLChartImportPropertyMapper( pPropMapper ); + xChartImpPropMapper = new XMLChartImportPropertyMapper( pPropMapper, GetImport() ); } xMapper = xChartImpPropMapper; break; |