LibreOffice Module xmloff (master)  1
PropertyMaps.cxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
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/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
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 .
18  */
19 
20 // include PropertyMap.hxx with this define
21 // to create the maps
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
26 #endif
27 
28 #include <sax/tools/converter.hxx>
29 
30 #include "SchXMLTools.hxx"
37 #include <propimp0.hxx>
38 
40 #include <xmloff/attrlist.hxx>
41 #include <xmloff/namespacemap.hxx>
42 #include <xmloff/xmluconv.hxx>
43 #include <xmloff/shapeimport.hxx>
44 #include <xmloff/xmlexp.hxx>
45 #include <xmloff/xmltoken.hxx>
46 #include <xmloff/prhdlfac.hxx>
47 
48 #include <com/sun/star/awt/Size.hpp>
49 #include <com/sun/star/drawing/LineStyle.hpp>
50 #include <com/sun/star/drawing/FillStyle.hpp>
51 #include <com/sun/star/chart/ChartAxisMarks.hpp>
52 #include <com/sun/star/chart/ChartDataCaption.hpp>
53 #include <com/sun/star/chart2/MovingAverageType.hpp>
54 #include <com/sun/star/chart2/XChartDocument.hpp>
55 #include <com/sun/star/chart2/data/XRangeXMLConversion.hpp>
56 #include <com/sun/star/graphic/XGraphic.hpp>
57 
58 #include <rtl/ustrbuf.hxx>
59 
60 #define SCH_XML_SETFLAG( status, flag ) (status)|= (flag)
61 #define SCH_XML_UNSETFLAG( status, flag ) (status) = ((status) | (flag)) - (flag)
62 
63 using namespace com::sun::star;
64 using namespace ::xmloff::token;
65 using namespace css::chart2;
66 
67 namespace {
68 
69 SvXMLEnumMapEntry<drawing::LineStyle> const aLineStyleMap[] =
70 {
71  { XML_NONE, drawing::LineStyle_NONE },
72  { XML_SOLID, drawing::LineStyle_SOLID },
73  { XML_DASH, drawing::LineStyle_DASH },
74  { XML_TOKEN_INVALID, drawing::LineStyle(0) }
75 };
76 
77 SvXMLEnumMapEntry<drawing::FillStyle> const aFillStyleMap[] =
78 {
79  { XML_NONE, drawing::FillStyle_NONE },
80  { XML_SOLID, drawing::FillStyle_SOLID },
81  { XML_HATCH, drawing::FillStyle_HATCH }
82 };
83 
84 }
85 
86 // the following class implementations are in this file:
87 
88 // * XMLChartPropHdlFactory
89 // * XMLChartPropertySetMapper
90 // * XMLChartExportPropertyMapper
91 // * XMLChartImportPropertyMapper
92 // * SchXMLStyleExport
93 
95  : m_pExport(pExport)
96 {
97 }
98 
100 {
101 }
102 
104 {
106  if( ! pHdl )
107  {
108  switch( nType )
109  {
111  pHdl = new XMLAxisPositionPropertyHdl( false );
112  break;
114  pHdl = new XMLAxisPositionPropertyHdl( true );
115  break;
116 
118  pHdl = new XMLEnumPropertyHdl( aXMLChartAxisLabelPositionEnumMap);
119  break;
120 
122  pHdl = new XMLEnumPropertyHdl( aXMLChartAxisMarkPositionEnumMap);
123  break;
124 
126  pHdl = new XMLEnumPropertyHdl( aXMLChartAxisArrangementEnumMap);
127  break;
128 
130  // here we have a constant rather than an enum
131  pHdl = new XMLErrorBarStylePropertyHdl( aXMLChartErrorBarStyleEnumMap );
132  break;
133 
135  pHdl = new XMLErrorIndicatorPropertyHdl( false );
136  break;
138  pHdl = new XMLErrorIndicatorPropertyHdl( true );
139  break;
140 
142  // here we have a constant rather than an enum
143  pHdl = new XMLEnumPropertyHdl( aXMLChartSolidTypeEnumMap );
144  break;
146  // here we have a constant rather than an enum
147  pHdl = new XMLEnumPropertyHdl( aXMLChartDataLabelPlacementEnumMap );
148  break;
150  pHdl = new XMLEnumPropertyHdl( aXMLChartDataRowSourceTypeEnumMap);
151  break;
153  pHdl = new XMLTextOrientationHdl;
154  break;
155 
158  {
159  pHdl = new XMLEnumPropertyHdl(g_XMLChartInterpolationTypeEnumMap_ODF12);
160  }
161  else // ODF 1.3 OFFICE-3662
162  {
163  pHdl = new XMLEnumPropertyHdl(g_XMLChartInterpolationTypeEnumMap);
164  }
165  break;
167  pHdl = new XMLSymbolTypePropertyHdl( false );
168  break;
169 
171  pHdl = new XMLSymbolTypePropertyHdl( true );
172  break;
173 
175  pHdl = new XMLEnumPropertyHdl( aXMLChartMissingValueTreatmentEnumMap );
176  break;
178  pHdl = new XMLEnumPropertyHdl( aLineStyleMap );
179  break;
181  pHdl = new XMLOpacityPropertyHdl(nullptr);
182  break;
184  pHdl = new XMLEnumPropertyHdl( aFillStyleMap );
185  break;
186  default:
187  ;
188  }
189  if( pHdl )
190  PutHdlCache( nType, pHdl );
191  }
192 
193  return pHdl;
194 }
195 
197  : XMLPropertySetMapper(aXMLChartPropMap, new XMLChartPropHdlFactory(pExport), pExport != nullptr)
198 {
199 }
200 
202 {
203 }
204 
206  SvXMLExport& rExport) :
207  SvXMLExportPropertyMapper( rMapper ),
208  mrExport( rExport )
209 {
210  // chain draw properties
212 
213  // chain text properties
215 }
216 
218 {
219 }
220 
222  bool bEnableFoFontFamily,
223  std::vector< XMLPropertyState >& rProperties,
224  const uno::Reference< beans::XPropertySet >& rPropSet ) const
225 {
226  OUString aAutoPropName;
227  bool bCheckAuto = false;
228 
229  // filter properties
230  for( auto& rProperty : rProperties )
231  {
232  // find properties with context
233  // to prevent writing this property set mnIndex member to -1
234  switch( getPropertySetMapper()->GetEntryContextId( rProperty.mnIndex ))
235  {
236  // if Auto... is set the corresponding properties mustn't be exported
237  case XML_SCH_CONTEXT_MIN:
238  bCheckAuto = true;
239  aAutoPropName = "AutoMin";
240  break;
241  case XML_SCH_CONTEXT_MAX:
242  bCheckAuto = true;
243  aAutoPropName = "AutoMax";
244  break;
246  bCheckAuto = true;
247  aAutoPropName = "AutoStepMain";
248  break;
250  bCheckAuto = true;
251  aAutoPropName = "AutoStepHelp";
252  break;
253 
255  bCheckAuto = true;
256  aAutoPropName = "AutoOrigin";
257  break;
258 
259  // the following property is deprecated
260  // element-item symbol-image is used now
262  rProperty.mnIndex = -1;
263  break;
264 
267  // note this avoids export of the properties in OASIS format,
268  // but also for the OOo XML Flat format (used by binfilter),
269  // because there, the transformation to OOo is done after the
270  // complete export of the chart in OASIS format.
272  rProperty.mnIndex = -1;
273  break;
274  }
275 
276  if( bCheckAuto )
277  {
278  if( rPropSet.is())
279  {
280  try
281  {
282  bool bAuto = false;
283  uno::Any aAny = rPropSet->getPropertyValue( aAutoPropName );
284  aAny >>= bAuto;
285  if( bAuto )
286  rProperty.mnIndex = -1;
287  }
288  catch(const beans::UnknownPropertyException&)
289  {
290  }
291  }
292  bCheckAuto = false;
293  }
294  }
295 
296  SvXMLExportPropertyMapper::ContextFilter(bEnableFoFontFamily, rProperties, rPropSet);
297 }
298 
301  const XMLPropertyState& rProperty, SvXmlExportFlags nFlags,
302  const ::std::vector< XMLPropertyState > *pProperties,
303  sal_uInt32 nIdx ) const
304 {
305  switch( getPropertySetMapper()->GetEntryContextId( rProperty.mnIndex ))
306  {
308  {
309  uno::Reference<graphic::XGraphic> xGraphic;
310  rProperty.maValue >>= xGraphic;
311 
312  OUString sInternalURL;
313  // export as XLink reference into the package
314  // if embedding is off
315  if (xGraphic.is())
316  {
317  OUString aOutMimeType;
318  sInternalURL = mrExport.AddEmbeddedXGraphic(xGraphic, aOutMimeType);
319  }
320  if (!sInternalURL.isEmpty())
321  {
323  }
324 
325  {
326  sal_uInt32 nPropIndex = rProperty.mnIndex;
327  // this is the element that has to live until the next statement
329  getPropertySetMapper()->GetEntryNameSpace( nPropIndex ),
330  getPropertySetMapper()->GetEntryXMLName( nPropIndex ),
331  true, true );
332 
333  // export as Base64 embedded graphic
334  // if embedding is on
335  if (xGraphic.is())
337  }
338  }
339  break;
340 
342  {
343  OUString aSeparator;
344  rProperty.maValue >>= aSeparator;
345 
346  if( !aSeparator.isEmpty() )
347  {
348  sal_uInt32 nPropIndex = rProperty.mnIndex;
350  getPropertySetMapper()->GetEntryNameSpace( nPropIndex ),
351  getPropertySetMapper()->GetEntryXMLName( nPropIndex ),
352  true, true );
353 
354  SchXMLTools::exportText( mrExport, aSeparator, true );
355  }
356  }
357  break;
358 
359  default:
360  // call parent
362  nFlags, pProperties, nIdx );
363  break;
364  }
365 }
366 
367 namespace {
368 
369 OUString convertRange( const OUString & rRange, const uno::Reference< chart2::XChartDocument > & xDoc )
370 {
371  OUString aResult = rRange;
372  if( !xDoc.is() )
373  return aResult;
374  uno::Reference< chart2::data::XRangeXMLConversion > xConversion(
375  xDoc->getDataProvider(), uno::UNO_QUERY );
376  try
377  {
378  if( xConversion.is())
379  aResult = xConversion->convertRangeToXML( rRange );
380  }
381  catch (css::lang::IllegalArgumentException&)
382  {
383  }
384 
385  return aResult;
386 }
387 
388 }
389 
391  SvXMLAttributeList& rAttrList, const XMLPropertyState& rProperty,
392  const SvXMLUnitConverter& rUnitConverter,
393  const SvXMLNamespaceMap& rNamespaceMap,
394  const ::std::vector< XMLPropertyState > *pProperties,
395  sal_uInt32 nIdx ) const
396 {
397  bool bHandled = false;
398 
399  sal_Int32 nContextId = getPropertySetMapper()->GetEntryContextId( rProperty.mnIndex );
400 
401  if( nContextId )
402  {
403  bHandled = true;
404 
405  OUString sAttrName = getPropertySetMapper()->GetEntryXMLName( rProperty.mnIndex );
406  sal_uInt16 nNameSpace = getPropertySetMapper()->GetEntryNameSpace( rProperty.mnIndex );
407  OUStringBuffer sValueBuffer;
408 
409  sal_Int32 nValue = 0;
410  bool bValue = false;
411 
412  switch( nContextId )
413  {
416  rProperty.maValue >>= nValue;
417  bValue = (( nValue & chart::ChartAxisMarks::INNER ) == chart::ChartAxisMarks::INNER );
418  ::sax::Converter::convertBool( sValueBuffer, bValue );
419  break;
422  rProperty.maValue >>= nValue;
423  bValue = (( nValue & chart::ChartAxisMarks::OUTER ) == chart::ChartAxisMarks::OUTER );
424  ::sax::Converter::convertBool( sValueBuffer, bValue );
425  break;
427  {
428  // convert from 100th degrees to degrees (double)
429  rProperty.maValue >>= nValue;
430  double fVal = static_cast<double>(nValue) / 100.0;
431  ::sax::Converter::convertDouble( sValueBuffer, fVal );
432  }
433  break;
435  {
436  rProperty.maValue >>= nValue;
437  if( ( nValue & chart::ChartDataCaption::VALUE ) == chart::ChartDataCaption::VALUE )
438  {
439  if( ( nValue & chart::ChartDataCaption::PERCENT ) == chart::ChartDataCaption::PERCENT )
440  {
441  const SvtSaveOptions::ODFSaneDefaultVersion nCurrentVersion( SvtSaveOptions().GetODFSaneDefaultVersion() );
442  if (nCurrentVersion < SvtSaveOptions::ODFSVER_012)
443  sValueBuffer.append( GetXMLToken( XML_PERCENTAGE ));
444  else
445  sValueBuffer.append( GetXMLToken( XML_VALUE_AND_PERCENTAGE ));
446  }
447  else
448  sValueBuffer.append( GetXMLToken( XML_VALUE ));
449  }
450  else if(( nValue & chart::ChartDataCaption::PERCENT ) == chart::ChartDataCaption::PERCENT )
451  sValueBuffer.append( GetXMLToken( XML_PERCENTAGE ));
452  else
453  sValueBuffer.append( GetXMLToken( XML_NONE ));
454  }
455  break;
457  rProperty.maValue >>= nValue;
458  bValue = (( nValue & chart::ChartDataCaption::TEXT ) == chart::ChartDataCaption::TEXT );
459  ::sax::Converter::convertBool( sValueBuffer, bValue );
460  break;
462  rProperty.maValue >>= nValue;
463  bValue = (( nValue & chart::ChartDataCaption::SYMBOL ) == chart::ChartDataCaption::SYMBOL );
464  ::sax::Converter::convertBool( sValueBuffer, bValue );
465  break;
467  rProperty.maValue >>= nValue;
468  bValue = (( nValue & chart::ChartDataCaption::DATA_SERIES ) == chart::ChartDataCaption::DATA_SERIES );
469  ::sax::Converter::convertBool( sValueBuffer, bValue );
470  break;
473  {
474  awt::Size aSize;
475  rProperty.maValue >>= aSize;
476  rUnitConverter.convertMeasureToXML( sValueBuffer,
478  ? aSize.Width
479  : aSize.Height );
480  }
481  break;
482 
484  {
485  // just for import
486  break;
487  }
488 
490  {
491  OUString aRangeStr;
492  rProperty.maValue >>= aRangeStr;
493  sValueBuffer.append(convertRange(aRangeStr, mxChartDoc));
494  }
495  break;
497  {
498  const SvtSaveOptions::ODFSaneDefaultVersion nCurrentVersion( SvtSaveOptions().GetODFSaneDefaultVersion() );
499 
500  OUString aServiceName;
501  rProperty.maValue >>= aServiceName;
502  if (aServiceName == "com.sun.star.chart2.LinearRegressionCurve")
503  sValueBuffer.append( GetXMLToken( XML_LINEAR ));
504  else if (aServiceName == "com.sun.star.chart2.LogarithmicRegressionCurve")
505  sValueBuffer.append( GetXMLToken( XML_LOGARITHMIC ));
506  else if (aServiceName == "com.sun.star.chart2.ExponentialRegressionCurve")
507  sValueBuffer.append( GetXMLToken( XML_EXPONENTIAL ));
508  else if (aServiceName == "com.sun.star.chart2.PotentialRegressionCurve")
509  sValueBuffer.append( GetXMLToken( XML_POWER ));
510  else if (nCurrentVersion >= SvtSaveOptions::ODFSVER_013 && aServiceName == "com.sun.star.chart2.PolynomialRegressionCurve")
511  { // ODF 1.3 OFFICE-3958
512  sValueBuffer.append( GetXMLToken( XML_POLYNOMIAL ));
513  }
514  else if (nCurrentVersion >= SvtSaveOptions::ODFSVER_013 && aServiceName == "com.sun.star.chart2.MovingAverageRegressionCurve")
515  { // ODF 1.3 OFFICE-3959
516  sValueBuffer.append( GetXMLToken( XML_MOVING_AVERAGE ));
517  }
518  }
519  break;
520 
522  {
523  rProperty.maValue >>= nValue;
524  if (nValue == MovingAverageType::Prior)
525  sValueBuffer.append( GetXMLToken( XML_PRIOR ));
526  else if (nValue == MovingAverageType::Central)
527  sValueBuffer.append( GetXMLToken( XML_CENTRAL ));
528  else if (nValue == MovingAverageType::AveragedAbscissa)
529  sValueBuffer.append( GetXMLToken( XML_AVERAGED_ABSCISSA ));
530  else // default
531  sValueBuffer.append( GetXMLToken( XML_PRIOR ));
532  }
533  break;
534 
535  default:
536  bHandled = false;
537  break;
538  }
539 
540  if( !sValueBuffer.isEmpty())
541  {
542  OUString sValue = sValueBuffer.makeStringAndClear();
543  sAttrName = rNamespaceMap.GetQNameByKey( nNameSpace, sAttrName );
544  rAttrList.AddAttribute( sAttrName, sValue );
545  }
546  }
547 
548  if( !bHandled )
549  {
550  // call parent
551  SvXMLExportPropertyMapper::handleSpecialItem( rAttrList, rProperty, rUnitConverter, rNamespaceMap, pProperties, nIdx );
552  }
553 }
554 
555 void XMLChartExportPropertyMapper::setChartDoc( const uno::Reference< chart2::XChartDocument >& xChartDoc )
556 {
557  mxChartDoc = xChartDoc;
558 }
559 
561  const SvXMLImport& _rImport ) :
562  SvXMLImportPropertyMapper( rMapper, const_cast< SvXMLImport & >( _rImport )),
563  mrImport( const_cast< SvXMLImport & > ( _rImport ))
564 {
565  // chain shape mapper for drawing properties
566 
567  // give an empty model. It is only used for numbering rules that don't exist in chart
568  uno::Reference< frame::XModel > xEmptyModel;
570 
571  //#i14365# save and load writing-mode for chart elements
572  //The property TextWritingMode is mapped wrongly in the underlying draw mapper, but for draw it is necessary
573  //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')
574  sal_Int32 nUnwantedWrongEntry = maPropMapper->FindEntryIndex( "TextWritingMode", XML_NAMESPACE_STYLE, GetXMLToken(XML_WRITING_MODE) );
575  maPropMapper->RemoveEntry(nUnwantedWrongEntry);
576 
577  // do not chain text properties: on import this is done by shape mapper
578  // to import old documents
579 }
580 
582 {
583 }
584 
586  XMLPropertyState& rProperty,
587  ::std::vector< XMLPropertyState >& rProperties,
588  const OUString& rValue,
589  const SvXMLUnitConverter& rUnitConverter,
590  const SvXMLNamespaceMap& rNamespaceMap ) const
591 {
592  sal_Int32 nContextId = maPropMapper->GetEntryContextId( rProperty.mnIndex );
593  bool bRet = (nContextId != 0);
594 
595  if( nContextId )
596  {
597  sal_Int32 nValue = 0;
598  bool bValue = false;
599 
600  switch( nContextId )
601  {
604  (void)::sax::Converter::convertBool( bValue, rValue );
605  // modify old value
606  rProperty.maValue >>= nValue;
607  if( bValue )
608  SCH_XML_SETFLAG( nValue, chart::ChartAxisMarks::INNER );
609  else
610  SCH_XML_UNSETFLAG( nValue, chart::ChartAxisMarks::INNER );
611  rProperty.maValue <<= nValue;
612  break;
615  (void)::sax::Converter::convertBool( bValue, rValue );
616  // modify old value
617  rProperty.maValue >>= nValue;
618  if( bValue )
619  SCH_XML_SETFLAG( nValue, chart::ChartAxisMarks::OUTER );
620  else
621  SCH_XML_UNSETFLAG( nValue, chart::ChartAxisMarks::OUTER );
622  rProperty.maValue <<= nValue;
623  break;
625  {
626  // convert from degrees (double) to 100th degrees (integer)
627  double fVal;
628  ::sax::Converter::convertDouble( fVal, rValue );
629  nValue = static_cast<sal_Int32>( fVal * 100.0 );
630  rProperty.maValue <<= nValue;
631  }
632  break;
634  {
635  // modify old value
636  rProperty.maValue >>= nValue;
637  if( IsXMLToken( rValue, XML_NONE ))
638  SCH_XML_UNSETFLAG( nValue, chart::ChartDataCaption::VALUE | chart::ChartDataCaption::PERCENT );
639  else if( IsXMLToken( rValue, XML_VALUE_AND_PERCENTAGE ) )
640  SCH_XML_SETFLAG( nValue, chart::ChartDataCaption::VALUE | chart::ChartDataCaption::PERCENT );
641  else if( IsXMLToken( rValue, XML_VALUE ) )
642  SCH_XML_SETFLAG( nValue, chart::ChartDataCaption::VALUE );
643  else // must be XML_PERCENTAGE
644  SCH_XML_SETFLAG( nValue, chart::ChartDataCaption::PERCENT );
645  rProperty.maValue <<= nValue;
646  }
647  break;
649  rProperty.maValue >>= nValue;
650  (void)::sax::Converter::convertBool( bValue, rValue );
651  if( bValue )
652  SCH_XML_SETFLAG( nValue, chart::ChartDataCaption::TEXT );
653  else
654  SCH_XML_UNSETFLAG( nValue, chart::ChartDataCaption::TEXT );
655  rProperty.maValue <<= nValue;
656  break;
658  rProperty.maValue >>= nValue;
659  (void)::sax::Converter::convertBool( bValue, rValue );
660  if( bValue )
661  SCH_XML_SETFLAG( nValue, chart::ChartDataCaption::SYMBOL );
662  else
663  SCH_XML_UNSETFLAG( nValue, chart::ChartDataCaption::SYMBOL );
664  rProperty.maValue <<= nValue;
665  break;
667  rProperty.maValue >>= nValue;
668  (void)::sax::Converter::convertBool( bValue, rValue );
669  if( bValue )
670  SCH_XML_SETFLAG( nValue, chart::ChartDataCaption::DATA_SERIES );
671  else
672  SCH_XML_UNSETFLAG( nValue, chart::ChartDataCaption::DATA_SERIES );
673  rProperty.maValue <<= nValue;
674  break;
677  {
678  awt::Size aSize;
679  rProperty.maValue >>= aSize;
680  rUnitConverter.convertMeasureToCore(
682  ? aSize.Width
683  : aSize.Height,
684  rValue );
685  rProperty.maValue <<= aSize;
686  }
687  break;
688 
690  {
691  rProperty.maValue <<= rValue;
692  }
693  break;
694 
695  // deprecated from 6.0 beta on
697  rProperty.maValue <<= mrImport.loadGraphicByURL(rValue);
698  break;
699 
701  {
702  if (IsXMLToken( rValue, XML_LINEAR ))
703  rProperty.maValue <<= OUString("com.sun.star.chart2.LinearRegressionCurve");
704  else if (IsXMLToken( rValue, XML_LOGARITHMIC))
705  rProperty.maValue <<= OUString("com.sun.star.chart2.LogarithmicRegressionCurve");
706  else if (IsXMLToken( rValue, XML_EXPONENTIAL))
707  rProperty.maValue <<= OUString("com.sun.star.chart2.ExponentialRegressionCurve");
708  else if (IsXMLToken( rValue, XML_POWER))
709  rProperty.maValue <<= OUString("com.sun.star.chart2.PotentialRegressionCurve");
710  else if (IsXMLToken( rValue, XML_POLYNOMIAL))
711  rProperty.maValue <<= OUString("com.sun.star.chart2.PolynomialRegressionCurve");
712  else if (IsXMLToken( rValue, XML_MOVING_AVERAGE))
713  rProperty.maValue <<= OUString("com.sun.star.chart2.MovingAverageRegressionCurve");
714  }
715  break;
716 
718  {
719  if (IsXMLToken( rValue, XML_PRIOR ))
720  rProperty.maValue <<= MovingAverageType::Prior;
721  else if (IsXMLToken( rValue, XML_CENTRAL))
722  rProperty.maValue <<= MovingAverageType::Central;
723  else if (IsXMLToken( rValue, XML_AVERAGED_ABSCISSA))
724  rProperty.maValue <<= MovingAverageType::AveragedAbscissa;
725  else // default
726  rProperty.maValue <<= MovingAverageType::Prior;
727  }
728  break;
729 
730  default:
731  bRet = false;
732  break;
733  }
734  }
735 
736  // if we didn't handle it, the parent should
737  if( !bRet )
738  {
739  // call parent
740  bRet = SvXMLImportPropertyMapper::handleSpecialItem( rProperty, rProperties, rValue, rUnitConverter, rNamespaceMap );
741  }
742 
743  return bRet;
744 }
745 
746 void XMLChartImportPropertyMapper::finished( ::std::vector< XMLPropertyState >& /*rProperties*/, sal_Int32 /*nStartIndex*/, sal_Int32 /*nEndIndex*/ ) const
747 {
748 }
749 
750 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
#define XML_SCH_CONTEXT_SPECIAL_TICKS_MIN_OUTER
Definition: PropertyMap.hxx:71
virtual const XMLPropertyHandler * GetPropertyHandler(sal_Int32 nType) const override
This method retrieves a PropertyHandler for the given XML-type.
bool convertMeasureToCore(sal_Int32 &rValue, std::u16string_view rString, sal_Int32 nMin=SAL_MIN_INT32, sal_Int32 nMax=SAL_MAX_INT32) const
convert string to measure with meCoreMeasureUnit, using optional min and max values ...
Definition: xmluconv.cxx:171
#define XML_SCH_TYPE_SYMBOL_TYPE
Definition: PropertyMap.hxx:45
#define XML_SCH_TYPE_ERROR_BAR_STYLE
Definition: PropertyMap.hxx:37
#define XML_SCH_CONTEXT_SPECIAL_LABEL_SEPARATOR
Definition: PropertyMap.hxx:82
virtual void handleElementItem(SvXMLExport &rExport, const XMLPropertyState &rProperty, SvXmlExportFlags nFlags, const ::std::vector< XMLPropertyState > *pProperties, sal_uInt32 nIdx) const
this method is called for every item that has the MID_FLAG_ELEMENT_EXPORT flag set ...
Definition: xmlexppr.cxx:864
virtual const XMLPropertyHandler * GetPropertyHandler(sal_Int32 nType) const
This method retrieves a PropertyHandler for the given XML-type.
Definition: prhdlfac.cxx:138
#define XML_SCH_CONTEXT_SPECIAL_MOVING_AVERAGE_TYPE
Definition: PropertyMap.hxx:86
the SvXMLTypeConverter converts values of various types from their internal representation to the tex...
Definition: xmluconv.hxx:80
#define XML_SCH_TYPE_AXIS_POSITION_VALUE
Definition: PropertyMap.hxx:50
#define XML_SCH_TYPE_TEXT_ORIENTATION
Definition: PropertyMap.hxx:43
#define XML_SCH_TYPE_NAMED_SYMBOL
Definition: PropertyMap.hxx:46
constexpr sal_uInt16 XML_NAMESPACE_XLINK
sal_Int32 mnIndex
Definition: maptype.hxx:124
bool IsXMLToken(std::u16string_view rString, enum XMLTokenEnum eToken)
compare eToken to the string
Definition: xmltoken.cxx:3480
static SvXMLExportPropertyMapper * CreateShapePropMapper(SvXMLExport &rExport)
returns the export property mapper for external chaining
XMLChartExportPropertyMapper(const rtl::Reference< XMLPropertySetMapper > &rMapper, SvXMLExport &rExport)
css::uno::Reference< css::graphic::XGraphic > loadGraphicByURL(OUString const &rURL)
Definition: xmlimp.cxx:1275
virtual void handleSpecialItem(SvXMLAttributeList &rAttrList, const XMLPropertyState &rProperty, const SvXMLUnitConverter &rUnitConverter, const SvXMLNamespaceMap &rNamespaceMap, const ::std::vector< XMLPropertyState > *pProperties, sal_uInt32 nIdx) const
this method is called for every item that has the MID_FLAG_SPECIAL_ITEM_EXPORT flag set ...
Definition: xmlexppr.cxx:848
#define XML_SCH_CONTEXT_SPECIAL_DATA_LABEL_NUMBER
Definition: PropertyMap.hxx:73
#define XML_SCH_CONTEXT_SPECIAL_DATA_LABEL_TEXT
Definition: PropertyMap.hxx:74
#define XML_SCH_TYPE_TICK_MARK_POSITION
Definition: PropertyMap.hxx:52
#define XML_SCH_CONTEXT_STEP_HELP_COUNT
Definition: PropertyMap.hxx:62
static void convertDouble(OUStringBuffer &rBuffer, double fNumber, bool bWriteUnits, sal_Int16 nSourceUnit, sal_Int16 nTargetUnit)
PropertyHandler for a generic xml enumeration type:
#define XML_SCH_CONTEXT_LINES_USED
Definition: PropertyMap.hxx:66
css::uno::Any const & rValue
Definition: ImageStyle.hxx:38
#define XML_SCH_CONTEXT_SPECIAL_TICKS_MAJ_INNER
Definition: PropertyMap.hxx:68
#define XML_SCH_CONTEXT_SPECIAL_SYMBOL_IMAGE
Definition: PropertyMap.hxx:81
#define XML_SCH_TYPE_SOLID_TYPE
Definition: PropertyMap.hxx:39
virtual void ContextFilter(bool bEnableFoFontFamily,::std::vector< XMLPropertyState > &rProperties, const css::uno::Reference< css::beans::XPropertySet > &rPropSet) const
Application-specific filter.
Definition: xmlexppr.cxx:663
#define XML_SCH_CONTEXT_SPECIAL_TEXT_ROTATION
Definition: PropertyMap.hxx:72
#define XML_SCH_TYPE_LABEL_BORDER_OPACITY
Definition: PropertyMap.hxx:54
void AddAttribute(sal_uInt16 nPrefix, const char *pName, const OUString &rValue)
Definition: xmlexp.cxx:909
#define XML_SCH_CONTEXT_SPECIAL_SYMBOL_IMAGE_NAME
Definition: PropertyMap.hxx:80
virtual ~XMLChartPropHdlFactory() override
#define XML_SCH_CONTEXT_STEP_MAIN
Definition: PropertyMap.hxx:61
#define XML_SCH_CONTEXT_SPECIAL_SYMBOL_WIDTH
Definition: PropertyMap.hxx:78
OUString AddEmbeddedXGraphic(css::uno::Reference< css::graphic::XGraphic > const &rxGraphic, OUString &rOutMimeType, OUString const &rRequestedName=OUString())
Definition: xmlexp.cxx:1856
#define XML_SCH_TYPE_LABEL_PLACEMENT_TYPE
Definition: PropertyMap.hxx:47
#define XML_SCH_CONTEXT_MIN
Definition: PropertyMap.hxx:59
#define XML_SCH_TYPE_ERROR_INDICATOR_UPPER
Definition: PropertyMap.hxx:40
virtual bool handleSpecialItem(XMLPropertyState &rProperty,::std::vector< XMLPropertyState > &rProperties, const OUString &rValue, const SvXMLUnitConverter &rUnitConverter, const SvXMLNamespaceMap &rNamespaceMap) const override
this method is called for every item that has the MID_FLAG_SPECIAL_ITEM_IMPORT flag set ...
SvtSaveOptions::ODFSaneDefaultVersion getSaneDefaultVersion() const
returns the deterministic version for odf export
Definition: xmlexp.cxx:2295
#define XML_SCH_TYPE_INTERPOLATION
Definition: PropertyMap.hxx:44
virtual void handleElementItem(SvXMLExport &rExport, const XMLPropertyState &rProperty, SvXmlExportFlags nFlags, const ::std::vector< XMLPropertyState > *pProperties, sal_uInt32 nIdx) const override
this method is called for every item that has the MID_FLAG_ELEMENT_EXPORT flag set ...
#define XML_SCH_CONTEXT_ORIGIN
Definition: PropertyMap.hxx:63
virtual bool handleSpecialItem(XMLPropertyState &rProperty,::std::vector< XMLPropertyState > &rProperties, const OUString &rValue, const SvXMLUnitConverter &rUnitConverter, const SvXMLNamespaceMap &rNamespaceMap) const
this method is called for every item that has the MID_FLAG_SPECIAL_ITEM_IMPORT flag set ...
Definition: xmlimppr.cxx:350
void setChartDoc(const css::uno::Reference< css::chart2::XChartDocument > &xChartDoc)
SvXMLExport const *const m_pExport
#define XML_SCH_CONTEXT_SPECIAL_ERRORBAR_RANGE
Definition: PropertyMap.hxx:83
virtual ~XMLChartExportPropertyMapper() override
#define XML_SCH_TYPE_LABEL_BORDER_STYLE
Definition: PropertyMap.hxx:53
#define XML_SCH_TYPE_LABEL_FILL_STYLE
Definition: PropertyMap.hxx:55
rtl::Reference< XMLPropertySetMapper > maPropMapper
Definition: xmlimppr.hxx:73
OUString GetQNameByKey(sal_uInt16 nKey, const OUString &rLocalName, bool bCache=true) const
#define XML_SCH_TYPE_AXIS_POSITION
Definition: PropertyMap.hxx:49
void exportText(SvXMLExport &rExport, const OUString &rText, bool bConvertTabsLFs)
void ChainExportMapper(const rtl::Reference< SvXMLExportPropertyMapper > &rMapper)
Definition: xmlexppr.cxx:486
#define XML_SCH_TYPE_DATAROWSOURCE
Definition: PropertyMap.hxx:42
static bool convertBool(bool &rBool, std::u16string_view rString)
virtual void finished(::std::vector< XMLPropertyState > &rProperties, sal_Int32 nStartIndex, sal_Int32 nEndIndex) const override
This method is called when all attributes have benn processed.
#define XML_SCH_CONTEXT_SPECIAL_DATA_LABEL_SERIES
Definition: PropertyMap.hxx:85
#define XML_SCH_CONTEXT_MAX
Definition: PropertyMap.hxx:60
Map an XMLTokenEnum to an enum value.
Definition: ximpshap.hxx:39
css::uno::Any maValue
Definition: maptype.hxx:125
XMLChartPropHdlFactory(SvXMLExport const *)
#define XML_SCH_CONTEXT_SPECIAL_REGRESSION_TYPE
Definition: PropertyMap.hxx:84
XMLChartPropertySetMapper(SvXMLExport const *pExport)
SvXmlExportFlags
Definition: xmlexppr.hxx:39
const OUString & GetXMLToken(enum XMLTokenEnum eToken)
return the OUString representation for eToken
Definition: xmltoken.cxx:3424
#define SCH_XML_UNSETFLAG(status, flag)
Handling of tokens in XML:
#define XML_SCH_CONTEXT_SPECIAL_TICKS_MAJ_OUTER
Definition: PropertyMap.hxx:69
Smart struct to transport an Any with an index to the appropriate property-name.
Definition: maptype.hxx:122
virtual ~XMLChartImportPropertyMapper() override
virtual ~XMLChartPropertySetMapper() override
#define XML_SCH_CONTEXT_SPECIAL_NUMBER_FORMAT
Definition: PropertyMap.hxx:76
#define XML_SCH_CONTEXT_STOCK_WITH_VOLUME
Definition: PropertyMap.hxx:65
virtual void handleSpecialItem(SvXMLAttributeList &rAttrList, const XMLPropertyState &rProperty, const SvXMLUnitConverter &rUnitConverter, const SvXMLNamespaceMap &rNamespaceMap, const ::std::vector< XMLPropertyState > *pProperties, sal_uInt32 nIdx) const override
this method is called for every item that has the MID_FLAG_SPECIAL_ITEM_EXPORT flag set ...
bool AddEmbeddedXGraphicAsBase64(css::uno::Reference< css::graphic::XGraphic > const &rxGraphic)
Definition: xmlexp.cxx:1893
#define XML_SCH_CONTEXT_SPECIAL_DATA_LABEL_SYMBOL
Definition: PropertyMap.hxx:75
void AddAttribute(const OUString &sName, const OUString &sValue)
Definition: attrlist.cxx:110
static SvXMLExportPropertyMapper * CreateParaExtPropMapper(SvXMLExport &rExport)
Definition: txtparae.cxx:1334
Abstract base-class for different XML-types.
Definition: xmlprhdl.hxx:35
virtual void ContextFilter(bool bEnableFoFontFamily,::std::vector< XMLPropertyState > &rProperties, const css::uno::Reference< css::beans::XPropertySet > &rPropSet) const override
Application-specific filter.
#define XML_SCH_TYPE_AXIS_ARRANGEMENT
Definition: PropertyMap.hxx:36
#define XML_SCH_TYPE_AXIS_LABEL_POSITION
Definition: PropertyMap.hxx:51
#define SCH_XML_SETFLAG(status, flag)
#define XML_SCH_CONTEXT_SPECIAL_TICKS_MIN_INNER
Definition: PropertyMap.hxx:70
#define XML_SCH_CONTEXT_SPECIAL_SYMBOL_HEIGHT
Definition: PropertyMap.hxx:79
void ChainImportMapper(const rtl::Reference< SvXMLImportPropertyMapper > &rMapper)
Definition: xmlimppr.cxx:76
css::uno::Any const SvXMLExport & rExport
Definition: ImageStyle.hxx:38
#define XML_SCH_TYPE_ERROR_INDICATOR_LOWER
Definition: PropertyMap.hxx:41
SvXMLExportFlags getExportFlags() const
Definition: xmlexp.hxx:476
#define XML_SCH_TYPE_MISSING_VALUE_TREATMENT
Definition: PropertyMap.hxx:48
Reference< XGraphic > xGraphic
css::uno::Reference< css::chart2::XChartDocument > mxChartDoc
static SvXMLImportPropertyMapper * CreateShapePropMapper(const css::uno::Reference< css::frame::XModel > &rModel, SvXMLImport &rImport)
creates a property mapper for external chaining
void convertMeasureToXML(OUStringBuffer &rBuffer, sal_Int32 nMeasure) const
convert measure to string: from meCoreMeasureUnit to meXMLMeasureUnit
Definition: xmluconv.cxx:191
constexpr sal_uInt16 XML_NAMESPACE_STYLE
sal_Int16 nValue
const rtl::Reference< XMLPropertySetMapper > & getPropertySetMapper() const
Definition: xmlexppr.cxx:1113
XMLChartImportPropertyMapper(const rtl::Reference< XMLPropertySetMapper > &rMapper, const SvXMLImport &rImport)
void PutHdlCache(sal_Int32 nType, const XMLPropertyHandler *pHdl) const
Puts a PropertyHandler into the internal cache.
Definition: prhdlfac.cxx:156
typedef void(CALLTYPE *GetFuncDataPtr)(sal_uInt16 &nNo