1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 // include PropertyMap.hxx with this define
22 #ifndef INCLUDED_XMLOFF_SOURCE_CHART_PROPERTYMAP_HXX
23 #define XML_SCH_CREATE_GLOBAL_MAPS
24 #include "PropertyMap.hxx"
25 #undef XML_SCH_CREATE_GLOBAL_MAPS
28 #include <sax/tools/converter.hxx>
30 #include "SchXMLTools.hxx"
31 #include "XMLChartPropertySetMapper.hxx"
32 #include "XMLErrorIndicatorPropertyHdl.hxx"
33 #include "XMLErrorBarStylePropertyHdl.hxx"
34 #include "XMLTextOrientationHdl.hxx"
35 #include "XMLSymbolTypePropertyHdl.hxx"
36 #include "XMLAxisPositionPropertyHdl.hxx"
37 #include "../draw/propimp0.hxx"
39 #include <xmloff/EnumPropertyHdl.hxx>
40 #include <xmloff/XMLConstantsPropertyHandler.hxx>
41 #include <xmloff/attrlist.hxx>
42 #include <xmloff/nmspmap.hxx>
43 #include <xmloff/xmluconv.hxx>
44 #include <xmloff/shapeimport.hxx>
45 #include <xmloff/NamedBoolPropertyHdl.hxx>
46 #include <xmloff/xmlexp.hxx>
47 #include <xmloff/xmltoken.hxx>
49 #include <com/sun/star/drawing/LineStyle.hpp>
50 #include <com/sun/star/drawing/FillStyle.hpp>
51 #include <com/sun/star/drawing/LineJoint.hpp>
52 #include <com/sun/star/chart/ChartAxisMarks.hpp>
53 #include <com/sun/star/chart/ChartDataCaption.hpp>
54 #include <com/sun/star/chart/ChartSymbolType.hpp>
55 #include <com/sun/star/chart/ChartDataRowSource.hpp>
56 #include <com/sun/star/chart/ChartAxisPosition.hpp>
57 #include <com/sun/star/chart2/XChartDocument.hpp>
58 #include <com/sun/star/chart2/data/XRangeXMLConversion.hpp>
60 #include <comphelper/extract.hxx>
61 #include <rtl/ustrbuf.hxx>
62 #include <rtl/math.hxx>
64 #define SCH_XML_SETFLAG( status, flag ) (status)|= (flag)
65 #define SCH_XML_UNSETFLAG( status, flag ) (status) = ((status) | (flag)) - (flag)
67 using namespace com::sun::star
;
68 using namespace ::xmloff::token
;
72 SvXMLEnumMapEntry
const aLineStyleMap
[] =
74 { XML_NONE
, drawing::LineStyle_NONE
},
75 { XML_SOLID
, drawing::LineStyle_SOLID
},
76 { XML_DASH
, drawing::LineStyle_DASH
},
77 { XML_TOKEN_INVALID
, 0 }
82 // the following class implementations are in this file:
84 // * XMLChartPropHdlFactory
85 // * XMLChartPropertySetMapper
86 // * XMLChartExportPropertyMapper
87 // * XMLChartImportPropertyMapper
88 // * SchXMLStyleExport
90 XMLChartPropHdlFactory::~XMLChartPropHdlFactory()
94 const XMLPropertyHandler
* XMLChartPropHdlFactory::GetPropertyHandler( sal_Int32 nType
) const
96 const XMLPropertyHandler
* pHdl
= XMLPropertyHandlerFactory::GetPropertyHandler( nType
);
101 case XML_SCH_TYPE_AXIS_POSITION
:
102 pHdl
= new XMLAxisPositionPropertyHdl( false );
104 case XML_SCH_TYPE_AXIS_POSITION_VALUE
:
105 pHdl
= new XMLAxisPositionPropertyHdl( true );
108 case XML_SCH_TYPE_AXIS_LABEL_POSITION
:
109 pHdl
= new XMLEnumPropertyHdl( aXMLChartAxisLabelPositionEnumMap
,
110 cppu::UnoType
<chart::ChartAxisLabelPosition
>::get());
113 case XML_SCH_TYPE_TICK_MARK_POSITION
:
114 pHdl
= new XMLEnumPropertyHdl( aXMLChartAxisMarkPositionEnumMap
,
115 cppu::UnoType
<chart::ChartAxisMarkPosition
>::get());
118 case XML_SCH_TYPE_AXIS_ARRANGEMENT
:
119 pHdl
= new XMLEnumPropertyHdl( aXMLChartAxisArrangementEnumMap
,
120 cppu::UnoType
<chart::ChartAxisArrangeOrderType
>::get());
123 case XML_SCH_TYPE_ERROR_BAR_STYLE
:
124 // here we have a constant rather than an enum
125 pHdl
= new XMLErrorBarStylePropertyHdl( aXMLChartErrorBarStyleEnumMap
,
126 ::cppu::UnoType
<sal_Int32
>::get() );
129 case XML_SCH_TYPE_ERROR_INDICATOR_LOWER
:
130 pHdl
= new XMLErrorIndicatorPropertyHdl( false );
132 case XML_SCH_TYPE_ERROR_INDICATOR_UPPER
:
133 pHdl
= new XMLErrorIndicatorPropertyHdl( true );
136 case XML_SCH_TYPE_SOLID_TYPE
:
137 // here we have a constant rather than an enum
138 pHdl
= new XMLEnumPropertyHdl( aXMLChartSolidTypeEnumMap
,
139 ::cppu::UnoType
<sal_Int32
>::get() );
141 case XML_SCH_TYPE_LABEL_PLACEMENT_TYPE
:
142 // here we have a constant rather than an enum
143 pHdl
= new XMLEnumPropertyHdl( aXMLChartDataLabelPlacementEnumMap
,
144 ::cppu::UnoType
<sal_Int32
>::get() );
146 case XML_SCH_TYPE_DATAROWSOURCE
:
147 pHdl
= new XMLEnumPropertyHdl( aXMLChartDataRowSourceTypeEnumMap
,
148 cppu::UnoType
<chart::ChartDataRowSource
>::get());
150 case XML_SCH_TYPE_TEXT_ORIENTATION
:
151 pHdl
= new XMLTextOrientationHdl();
154 case XML_SCH_TYPE_INTERPOLATION
:
155 pHdl
= new XMLEnumPropertyHdl( aXMLChartInterpolationTypeEnumMap
,
156 ::cppu::UnoType
<sal_Int32
>::get() );
158 case XML_SCH_TYPE_SYMBOL_TYPE
:
159 pHdl
= new XMLSymbolTypePropertyHdl( false );
162 case XML_SCH_TYPE_NAMED_SYMBOL
:
163 pHdl
= new XMLSymbolTypePropertyHdl( true );
166 case XML_SCH_TYPE_MISSING_VALUE_TREATMENT
:
167 pHdl
= new XMLEnumPropertyHdl( aXMLChartMissingValueTreatmentEnumMap
,
168 ::cppu::UnoType
<sal_Int32
>::get() );
170 case XML_SCH_TYPE_LABEL_BORDER_STYLE
:
171 pHdl
= new XMLEnumPropertyHdl(aLineStyleMap
, cppu::UnoType
<drawing::LineStyle
>::get());
173 case XML_SCH_TYPE_LABEL_BORDER_OPACITY
:
174 pHdl
= new XMLOpacityPropertyHdl(nullptr);
180 PutHdlCache( nType
, pHdl
);
186 XMLChartPropertySetMapper::XMLChartPropertySetMapper( bool bForExport
) :
187 XMLPropertySetMapper( aXMLChartPropMap
, new XMLChartPropHdlFactory
, bForExport
)
191 XMLChartPropertySetMapper::~XMLChartPropertySetMapper()
195 XMLChartExportPropertyMapper::XMLChartExportPropertyMapper( const rtl::Reference
< XMLPropertySetMapper
>& rMapper
,
196 SvXMLExport
& rExport
) :
197 SvXMLExportPropertyMapper( rMapper
),
200 // chain draw properties
201 ChainExportMapper( XMLShapeExport::CreateShapePropMapper( rExport
));
203 // chain text properties
204 ChainExportMapper( XMLTextParagraphExport::CreateParaExtPropMapper( rExport
));
207 XMLChartExportPropertyMapper::~XMLChartExportPropertyMapper()
211 void XMLChartExportPropertyMapper::ContextFilter(
212 bool bEnableFoFontFamily
,
213 std::vector
< XMLPropertyState
>& rProperties
,
214 const uno::Reference
< beans::XPropertySet
>& rPropSet
) const
216 OUString aAutoPropName
;
217 bool bCheckAuto
= false;
220 for( std::vector
< XMLPropertyState
>::iterator property
= rProperties
.begin();
221 property
!= rProperties
.end();
224 // find properties with context
225 // to prevent writing this property set mnIndex member to -1
226 switch( getPropertySetMapper()->GetEntryContextId( property
->mnIndex
))
228 // if Auto... is set the corresponding properties mustn't be exported
229 case XML_SCH_CONTEXT_MIN
:
231 aAutoPropName
= "AutoMin";
233 case XML_SCH_CONTEXT_MAX
:
235 aAutoPropName
= "AutoMax";
237 case XML_SCH_CONTEXT_STEP_MAIN
:
239 aAutoPropName
= "AutoStepMain";
241 case XML_SCH_CONTEXT_STEP_HELP_COUNT
:
243 aAutoPropName
= "AutoStepHelp";
246 case XML_SCH_CONTEXT_ORIGIN
:
248 aAutoPropName
= "AutoOrigin";
251 // the following property is deprecated
252 // element-item symbol-image is used now
253 case XML_SCH_CONTEXT_SPECIAL_SYMBOL_IMAGE_NAME
:
254 property
->mnIndex
= -1;
257 case XML_SCH_CONTEXT_STOCK_WITH_VOLUME
:
258 case XML_SCH_CONTEXT_LINES_USED
:
259 // note this avoids export of the properties in OASIS format,
260 // but also for the OOo XML Flat format (used by binfilter),
261 // because there, the transformation to OOo is done after the
262 // complete export of the chart in OASIS format.
263 if( mrExport
.getExportFlags() & SvXMLExportFlags::OASIS
)
264 property
->mnIndex
= -1;
275 uno::Any aAny
= rPropSet
->getPropertyValue( aAutoPropName
);
278 property
->mnIndex
= -1;
280 catch(const beans::UnknownPropertyException
&)
288 SvXMLExportPropertyMapper::ContextFilter(bEnableFoFontFamily
, rProperties
, rPropSet
);
291 void XMLChartExportPropertyMapper::handleElementItem(
292 SvXMLExport
& rExport
,
293 const XMLPropertyState
& rProperty
, SvXmlExportFlags nFlags
,
294 const ::std::vector
< XMLPropertyState
> *pProperties
,
295 sal_uInt32 nIdx
) const
297 switch( getPropertySetMapper()->GetEntryContextId( rProperty
.mnIndex
))
299 case XML_SCH_CONTEXT_SPECIAL_SYMBOL_IMAGE
:
302 rProperty
.maValue
>>= aURLStr
;
304 // export as XLink reference into the package
305 // if embedding is off
306 OUString
sTempURL( mrExport
.AddEmbeddedGraphicObject( aURLStr
));
307 if( !sTempURL
.isEmpty() )
309 mrExport
.AddAttribute( XML_NAMESPACE_XLINK
, XML_HREF
, sTempURL
);
313 sal_uInt32 nPropIndex
= rProperty
.mnIndex
;
314 // this is the element that has to live until the next statement
315 SvXMLElementExport
aElem( mrExport
,
316 getPropertySetMapper()->GetEntryNameSpace( nPropIndex
),
317 getPropertySetMapper()->GetEntryXMLName( nPropIndex
),
320 // export as Base64 embedded graphic
321 // if embedding is on
322 if( !aURLStr
.isEmpty())
323 mrExport
.AddEmbeddedGraphicObjectAsBase64( aURLStr
);
328 case XML_SCH_CONTEXT_SPECIAL_LABEL_SEPARATOR
:
331 rProperty
.maValue
>>= aSeparator
;
333 if( !aSeparator
.isEmpty() )
335 sal_uInt32 nPropIndex
= rProperty
.mnIndex
;
336 SvXMLElementExport
aElem( mrExport
,
337 getPropertySetMapper()->GetEntryNameSpace( nPropIndex
),
338 getPropertySetMapper()->GetEntryXMLName( nPropIndex
),
341 SchXMLTools::exportText( mrExport
, aSeparator
, true );
348 SvXMLExportPropertyMapper::handleElementItem( rExport
, rProperty
,
349 nFlags
, pProperties
, nIdx
);
356 OUString
convertRange( const OUString
& rRange
, const uno::Reference
< chart2::XChartDocument
> & xDoc
)
358 OUString aResult
= rRange
;
361 uno::Reference
< chart2::data::XRangeXMLConversion
> xConversion(
362 xDoc
->getDataProvider(), uno::UNO_QUERY
);
365 if( xConversion
.is())
366 aResult
= xConversion
->convertRangeToXML( rRange
);
368 catch (css::lang::IllegalArgumentException
&)
377 void XMLChartExportPropertyMapper::handleSpecialItem(
378 SvXMLAttributeList
& rAttrList
, const XMLPropertyState
& rProperty
,
379 const SvXMLUnitConverter
& rUnitConverter
,
380 const SvXMLNamespaceMap
& rNamespaceMap
,
381 const ::std::vector
< XMLPropertyState
> *pProperties
,
382 sal_uInt32 nIdx
) const
384 bool bHandled
= false;
386 sal_Int32 nContextId
= getPropertySetMapper()->GetEntryContextId( rProperty
.mnIndex
);
392 OUString sAttrName
= getPropertySetMapper()->GetEntryXMLName( rProperty
.mnIndex
);
393 sal_uInt16 nNameSpace
= getPropertySetMapper()->GetEntryNameSpace( rProperty
.mnIndex
);
394 OUStringBuffer sValueBuffer
;
397 sal_Int32 nValue
= 0;
402 case XML_SCH_CONTEXT_SPECIAL_TICKS_MAJ_INNER
:
403 case XML_SCH_CONTEXT_SPECIAL_TICKS_MIN_INNER
:
404 rProperty
.maValue
>>= nValue
;
405 bValue
= (( nValue
& chart::ChartAxisMarks::INNER
) == chart::ChartAxisMarks::INNER
);
406 ::sax::Converter::convertBool( sValueBuffer
, bValue
);
408 case XML_SCH_CONTEXT_SPECIAL_TICKS_MAJ_OUTER
:
409 case XML_SCH_CONTEXT_SPECIAL_TICKS_MIN_OUTER
:
410 rProperty
.maValue
>>= nValue
;
411 bValue
= (( nValue
& chart::ChartAxisMarks::OUTER
) == chart::ChartAxisMarks::OUTER
);
412 ::sax::Converter::convertBool( sValueBuffer
, bValue
);
414 case XML_SCH_CONTEXT_SPECIAL_TEXT_ROTATION
:
416 // convert from 100th degrees to degrees (double)
417 rProperty
.maValue
>>= nValue
;
418 double fVal
= (double)(nValue
) / 100.0;
419 ::sax::Converter::convertDouble( sValueBuffer
, fVal
);
422 case XML_SCH_CONTEXT_SPECIAL_DATA_LABEL_NUMBER
:
424 rProperty
.maValue
>>= nValue
;
425 if((( nValue
& chart::ChartDataCaption::VALUE
) == chart::ChartDataCaption::VALUE
))
427 if( ( nValue
& chart::ChartDataCaption::PERCENT
) == chart::ChartDataCaption::PERCENT
)
429 const SvtSaveOptions::ODFDefaultVersion
nCurrentVersion( SvtSaveOptions().GetODFDefaultVersion() );
430 if( nCurrentVersion
< SvtSaveOptions::ODFVER_012
)
431 sValueBuffer
.append( GetXMLToken( XML_PERCENTAGE
));
433 sValueBuffer
.append( GetXMLToken( XML_VALUE_AND_PERCENTAGE
));
436 sValueBuffer
.append( GetXMLToken( XML_VALUE
));
438 else if(( nValue
& chart::ChartDataCaption::PERCENT
) == chart::ChartDataCaption::PERCENT
)
439 sValueBuffer
.append( GetXMLToken( XML_PERCENTAGE
));
441 sValueBuffer
.append( GetXMLToken( XML_NONE
));
444 case XML_SCH_CONTEXT_SPECIAL_DATA_LABEL_TEXT
:
445 rProperty
.maValue
>>= nValue
;
446 bValue
= (( nValue
& chart::ChartDataCaption::TEXT
) == chart::ChartDataCaption::TEXT
);
447 ::sax::Converter::convertBool( sValueBuffer
, bValue
);
449 case XML_SCH_CONTEXT_SPECIAL_DATA_LABEL_SYMBOL
:
450 rProperty
.maValue
>>= nValue
;
451 bValue
= (( nValue
& chart::ChartDataCaption::SYMBOL
) == chart::ChartDataCaption::SYMBOL
);
452 ::sax::Converter::convertBool( sValueBuffer
, bValue
);
454 case XML_SCH_CONTEXT_SPECIAL_SYMBOL_WIDTH
:
455 case XML_SCH_CONTEXT_SPECIAL_SYMBOL_HEIGHT
:
458 rProperty
.maValue
>>= aSize
;
459 rUnitConverter
.convertMeasureToXML( sValueBuffer
,
460 nContextId
== XML_SCH_CONTEXT_SPECIAL_SYMBOL_WIDTH
466 case XML_SCH_CONTEXT_SPECIAL_NUMBER_FORMAT
:
472 case XML_SCH_CONTEXT_SPECIAL_ERRORBAR_RANGE
:
475 rProperty
.maValue
>>= aRangeStr
;
476 sValueBuffer
.append(convertRange(aRangeStr
, mxChartDoc
));
479 case XML_SCH_CONTEXT_SPECIAL_REGRESSION_TYPE
:
481 OUString aServiceName
;
482 rProperty
.maValue
>>= aServiceName
;
483 if (aServiceName
== "com.sun.star.chart2.LinearRegressionCurve")
484 sValueBuffer
.append( GetXMLToken( XML_LINEAR
));
485 else if (aServiceName
== "com.sun.star.chart2.LogarithmicRegressionCurve")
486 sValueBuffer
.append( GetXMLToken( XML_LOGARITHMIC
));
487 else if (aServiceName
== "com.sun.star.chart2.ExponentialRegressionCurve")
488 sValueBuffer
.append( GetXMLToken( XML_EXPONENTIAL
));
489 else if (aServiceName
== "com.sun.star.chart2.PotentialRegressionCurve")
490 sValueBuffer
.append( GetXMLToken( XML_POWER
));
491 else if (aServiceName
== "com.sun.star.chart2.PolynomialRegressionCurve")
492 sValueBuffer
.append( GetXMLToken( XML_POLYNOMIAL
));
493 else if (aServiceName
== "com.sun.star.chart2.MovingAverageRegressionCurve")
494 sValueBuffer
.append( GetXMLToken( XML_MOVING_AVERAGE
));
503 if( !sValueBuffer
.isEmpty())
505 sValue
= sValueBuffer
.makeStringAndClear();
506 sAttrName
= rNamespaceMap
.GetQNameByKey( nNameSpace
, sAttrName
);
507 rAttrList
.AddAttribute( sAttrName
, sValue
);
514 SvXMLExportPropertyMapper::handleSpecialItem( rAttrList
, rProperty
, rUnitConverter
, rNamespaceMap
, pProperties
, nIdx
);
518 void XMLChartExportPropertyMapper::setChartDoc( const uno::Reference
< chart2::XChartDocument
>& xChartDoc
)
520 mxChartDoc
= xChartDoc
;
523 XMLChartImportPropertyMapper::XMLChartImportPropertyMapper( const rtl::Reference
< XMLPropertySetMapper
>& rMapper
,
524 const SvXMLImport
& _rImport
) :
525 SvXMLImportPropertyMapper( rMapper
, const_cast< SvXMLImport
& >( _rImport
)),
526 mrImport( const_cast< SvXMLImport
& > ( _rImport
))
528 // chain shape mapper for drawing properties
530 // give an empty model. It is only used for numbering rules that don't exist in chart
531 uno::Reference
< frame::XModel
> xEmptyModel
;
532 ChainImportMapper( XMLShapeImportHelper::CreateShapePropMapper( xEmptyModel
, mrImport
));
534 //#i14365# save and load writing-mode for chart elements
535 //The property TextWritingMode is mapped wrongly in the underlying draw mapper, but for draw it is necessary
536 //We remove that property here only for chart thus the chart can use the correct mapping from the writer paragraph settings (attribute 'writing-mode' <-> property 'WritingMode')
537 sal_Int32 nUnwantedWrongEntry
= maPropMapper
->FindEntryIndex( "TextWritingMode", XML_NAMESPACE_STYLE
, GetXMLToken(XML_WRITING_MODE
) );
538 maPropMapper
->RemoveEntry(nUnwantedWrongEntry
);
540 // do not chain text properties: on import this is done by shape mapper
541 // to import old documents
544 XMLChartImportPropertyMapper::~XMLChartImportPropertyMapper()
548 bool XMLChartImportPropertyMapper::handleSpecialItem(
549 XMLPropertyState
& rProperty
,
550 ::std::vector
< XMLPropertyState
>& rProperties
,
551 const OUString
& rValue
,
552 const SvXMLUnitConverter
& rUnitConverter
,
553 const SvXMLNamespaceMap
& rNamespaceMap
) const
555 sal_Int32 nContextId
= maPropMapper
->GetEntryContextId( rProperty
.mnIndex
);
556 bool bRet
= (nContextId
!= 0);
560 sal_Int32 nValue
= 0;
565 case XML_SCH_CONTEXT_SPECIAL_TICKS_MAJ_INNER
:
566 case XML_SCH_CONTEXT_SPECIAL_TICKS_MIN_INNER
:
567 ::sax::Converter::convertBool( bValue
, rValue
);
569 rProperty
.maValue
>>= nValue
;
571 SCH_XML_SETFLAG( nValue
, chart::ChartAxisMarks::INNER
);
573 SCH_XML_UNSETFLAG( nValue
, chart::ChartAxisMarks::INNER
);
574 rProperty
.maValue
<<= nValue
;
576 case XML_SCH_CONTEXT_SPECIAL_TICKS_MAJ_OUTER
:
577 case XML_SCH_CONTEXT_SPECIAL_TICKS_MIN_OUTER
:
578 ::sax::Converter::convertBool( bValue
, rValue
);
580 rProperty
.maValue
>>= nValue
;
582 SCH_XML_SETFLAG( nValue
, chart::ChartAxisMarks::OUTER
);
584 SCH_XML_UNSETFLAG( nValue
, chart::ChartAxisMarks::OUTER
);
585 rProperty
.maValue
<<= nValue
;
587 case XML_SCH_CONTEXT_SPECIAL_TEXT_ROTATION
:
589 // convert from degrees (double) to 100th degrees (integer)
591 ::sax::Converter::convertDouble( fVal
, rValue
);
592 nValue
= (sal_Int32
)( fVal
* 100.0 );
593 rProperty
.maValue
<<= nValue
;
596 case XML_SCH_CONTEXT_SPECIAL_DATA_LABEL_NUMBER
:
599 rProperty
.maValue
>>= nValue
;
600 if( IsXMLToken( rValue
, XML_NONE
))
601 SCH_XML_UNSETFLAG( nValue
, chart::ChartDataCaption::VALUE
| chart::ChartDataCaption::PERCENT
);
602 else if( IsXMLToken( rValue
, XML_VALUE_AND_PERCENTAGE
) )
603 SCH_XML_SETFLAG( nValue
, chart::ChartDataCaption::VALUE
| chart::ChartDataCaption::PERCENT
);
604 else if( IsXMLToken( rValue
, XML_VALUE
) )
605 SCH_XML_SETFLAG( nValue
, chart::ChartDataCaption::VALUE
);
606 else // must be XML_PERCENTAGE
607 SCH_XML_SETFLAG( nValue
, chart::ChartDataCaption::PERCENT
);
608 rProperty
.maValue
<<= nValue
;
611 case XML_SCH_CONTEXT_SPECIAL_DATA_LABEL_TEXT
:
612 rProperty
.maValue
>>= nValue
;
613 ::sax::Converter::convertBool( bValue
, rValue
);
615 SCH_XML_SETFLAG( nValue
, chart::ChartDataCaption::TEXT
);
617 SCH_XML_UNSETFLAG( nValue
, chart::ChartDataCaption::TEXT
);
618 rProperty
.maValue
<<= nValue
;
620 case XML_SCH_CONTEXT_SPECIAL_DATA_LABEL_SYMBOL
:
621 rProperty
.maValue
>>= nValue
;
622 ::sax::Converter::convertBool( bValue
, rValue
);
624 SCH_XML_SETFLAG( nValue
, chart::ChartDataCaption::SYMBOL
);
626 SCH_XML_UNSETFLAG( nValue
, chart::ChartDataCaption::SYMBOL
);
627 rProperty
.maValue
<<= nValue
;
629 case XML_SCH_CONTEXT_SPECIAL_SYMBOL_WIDTH
:
630 case XML_SCH_CONTEXT_SPECIAL_SYMBOL_HEIGHT
:
633 rProperty
.maValue
>>= aSize
;
634 rUnitConverter
.convertMeasureToCore(
635 (nContextId
== XML_SCH_CONTEXT_SPECIAL_SYMBOL_WIDTH
)
639 rProperty
.maValue
<<= aSize
;
643 case XML_SCH_CONTEXT_SPECIAL_ERRORBAR_RANGE
:
645 rProperty
.maValue
<<= rValue
;
649 // deprecated from 6.0 beta on
650 case XML_SCH_CONTEXT_SPECIAL_SYMBOL_IMAGE_NAME
:
651 rProperty
.maValue
<<= mrImport
.ResolveGraphicObjectURL( rValue
, false );
654 case XML_SCH_CONTEXT_SPECIAL_REGRESSION_TYPE
:
656 if (IsXMLToken( rValue
, XML_LINEAR
))
657 rProperty
.maValue
<<= OUString("com.sun.star.chart2.LinearRegressionCurve");
658 else if (IsXMLToken( rValue
, XML_LOGARITHMIC
))
659 rProperty
.maValue
<<= OUString("com.sun.star.chart2.LogarithmicRegressionCurve");
660 else if (IsXMLToken( rValue
, XML_EXPONENTIAL
))
661 rProperty
.maValue
<<= OUString("com.sun.star.chart2.ExponentialRegressionCurve");
662 else if (IsXMLToken( rValue
, XML_POWER
))
663 rProperty
.maValue
<<= OUString("com.sun.star.chart2.PotentialRegressionCurve");
664 else if (IsXMLToken( rValue
, XML_POLYNOMIAL
))
665 rProperty
.maValue
<<= OUString("com.sun.star.chart2.PolynomialRegressionCurve");
666 else if (IsXMLToken( rValue
, XML_MOVING_AVERAGE
))
667 rProperty
.maValue
<<= OUString("com.sun.star.chart2.MovingAverageRegressionCurve");
677 // if we didn't handle it, the parent should
681 bRet
= SvXMLImportPropertyMapper::handleSpecialItem( rProperty
, rProperties
, rValue
, rUnitConverter
, rNamespaceMap
);
687 void XMLChartImportPropertyMapper::finished( ::std::vector
< XMLPropertyState
>& /*rProperties*/, sal_Int32
/*nStartIndex*/, sal_Int32
/*nEndIndex*/ ) const
691 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */