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 
300  SvXMLExport& rExport,
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(
443  if (nCurrentVersion < SvtSaveOptions::ODFSVER_012)
444  sValueBuffer.append( GetXMLToken( XML_PERCENTAGE ));
445  else
446  sValueBuffer.append( GetXMLToken( XML_VALUE_AND_PERCENTAGE ));
447  }
448  else
449  sValueBuffer.append( GetXMLToken( XML_VALUE ));
450  }
451  else if(( nValue & chart::ChartDataCaption::PERCENT ) == chart::ChartDataCaption::PERCENT )
452  sValueBuffer.append( GetXMLToken( XML_PERCENTAGE ));
453  else
454  sValueBuffer.append( GetXMLToken( XML_NONE ));
455  }
456  break;
458  rProperty.maValue >>= nValue;
459  bValue = (( nValue & chart::ChartDataCaption::TEXT ) == chart::ChartDataCaption::TEXT );
460  ::sax::Converter::convertBool( sValueBuffer, bValue );
461  break;
463  rProperty.maValue >>= nValue;
464  bValue = (( nValue & chart::ChartDataCaption::SYMBOL ) == chart::ChartDataCaption::SYMBOL );
465  ::sax::Converter::convertBool( sValueBuffer, bValue );
466  break;
468  rProperty.maValue >>= nValue;
469  bValue = (( nValue & chart::ChartDataCaption::DATA_SERIES ) == chart::ChartDataCaption::DATA_SERIES );
470  ::sax::Converter::convertBool( sValueBuffer, bValue );
471  break;
474  {
475  awt::Size aSize;
476  rProperty.maValue >>= aSize;
477  rUnitConverter.convertMeasureToXML( sValueBuffer,
479  ? aSize.Width
480  : aSize.Height );
481  }
482  break;
483 
485  {
486  // just for import
487  break;
488  }
489 
491  {
492  OUString aRangeStr;
493  rProperty.maValue >>= aRangeStr;
494  sValueBuffer.append(convertRange(aRangeStr, mxChartDoc));
495  }
496  break;
498  {
499  const SvtSaveOptions::ODFSaneDefaultVersion nCurrentVersion(
501 
502  OUString aServiceName;
503  rProperty.maValue >>= aServiceName;
504  if (aServiceName == "com.sun.star.chart2.LinearRegressionCurve")
505  sValueBuffer.append( GetXMLToken( XML_LINEAR ));
506  else if (aServiceName == "com.sun.star.chart2.LogarithmicRegressionCurve")
507  sValueBuffer.append( GetXMLToken( XML_LOGARITHMIC ));
508  else if (aServiceName == "com.sun.star.chart2.ExponentialRegressionCurve")
509  sValueBuffer.append( GetXMLToken( XML_EXPONENTIAL ));
510  else if (aServiceName == "com.sun.star.chart2.PotentialRegressionCurve")
511  sValueBuffer.append( GetXMLToken( XML_POWER ));
512  else if (nCurrentVersion >= SvtSaveOptions::ODFSVER_013 && aServiceName == "com.sun.star.chart2.PolynomialRegressionCurve")
513  { // ODF 1.3 OFFICE-3958
514  sValueBuffer.append( GetXMLToken( XML_POLYNOMIAL ));
515  }
516  else if (nCurrentVersion >= SvtSaveOptions::ODFSVER_013 && aServiceName == "com.sun.star.chart2.MovingAverageRegressionCurve")
517  { // ODF 1.3 OFFICE-3959
518  sValueBuffer.append( GetXMLToken( XML_MOVING_AVERAGE ));
519  }
520  }
521  break;
522 
524  {
525  rProperty.maValue >>= nValue;
526  if (nValue == MovingAverageType::Prior)
527  sValueBuffer.append( GetXMLToken( XML_PRIOR ));
528  else if (nValue == MovingAverageType::Central)
529  sValueBuffer.append( GetXMLToken( XML_CENTRAL ));
530  else if (nValue == MovingAverageType::AveragedAbscissa)
531  sValueBuffer.append( GetXMLToken( XML_AVERAGED_ABSCISSA ));
532  else // default
533  sValueBuffer.append( GetXMLToken( XML_PRIOR ));
534  }
535  break;
536 
537  default:
538  bHandled = false;
539  break;
540  }
541 
542  if( !sValueBuffer.isEmpty())
543  {
544  OUString sValue = sValueBuffer.makeStringAndClear();
545  sAttrName = rNamespaceMap.GetQNameByKey( nNameSpace, sAttrName );
546  rAttrList.AddAttribute( sAttrName, sValue );
547  }
548  }
549 
550  if( !bHandled )
551  {
552  // call parent
553  SvXMLExportPropertyMapper::handleSpecialItem( rAttrList, rProperty, rUnitConverter, rNamespaceMap, pProperties, nIdx );
554  }
555 }
556 
557 void XMLChartExportPropertyMapper::setChartDoc( const uno::Reference< chart2::XChartDocument >& xChartDoc )
558 {
559  mxChartDoc = xChartDoc;
560 }
561 
563  const SvXMLImport& _rImport ) :
564  SvXMLImportPropertyMapper( rMapper, const_cast< SvXMLImport & >( _rImport )),
565  mrImport( const_cast< SvXMLImport & > ( _rImport ))
566 {
567  // chain shape mapper for drawing properties
568 
569  // give an empty model. It is only used for numbering rules that don't exist in chart
570  uno::Reference< frame::XModel > xEmptyModel;
572 
573  //#i14365# save and load writing-mode for chart elements
574  //The property TextWritingMode is mapped wrongly in the underlying draw mapper, but for draw it is necessary
575  //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')
576  sal_Int32 nUnwantedWrongEntry = maPropMapper->FindEntryIndex( "TextWritingMode", XML_NAMESPACE_STYLE, GetXMLToken(XML_WRITING_MODE) );
577  maPropMapper->RemoveEntry(nUnwantedWrongEntry);
578 
579  // do not chain text properties: on import this is done by shape mapper
580  // to import old documents
581 }
582 
584 {
585 }
586 
588  XMLPropertyState& rProperty,
589  ::std::vector< XMLPropertyState >& rProperties,
590  const OUString& rValue,
591  const SvXMLUnitConverter& rUnitConverter,
592  const SvXMLNamespaceMap& rNamespaceMap ) const
593 {
594  sal_Int32 nContextId = maPropMapper->GetEntryContextId( rProperty.mnIndex );
595  bool bRet = (nContextId != 0);
596 
597  if( nContextId )
598  {
599  sal_Int32 nValue = 0;
600  bool bValue = false;
601 
602  switch( nContextId )
603  {
606  (void)::sax::Converter::convertBool( bValue, rValue );
607  // modify old value
608  rProperty.maValue >>= nValue;
609  if( bValue )
610  SCH_XML_SETFLAG( nValue, chart::ChartAxisMarks::INNER );
611  else
612  SCH_XML_UNSETFLAG( nValue, chart::ChartAxisMarks::INNER );
613  rProperty.maValue <<= nValue;
614  break;
617  (void)::sax::Converter::convertBool( bValue, rValue );
618  // modify old value
619  rProperty.maValue >>= nValue;
620  if( bValue )
621  SCH_XML_SETFLAG( nValue, chart::ChartAxisMarks::OUTER );
622  else
623  SCH_XML_UNSETFLAG( nValue, chart::ChartAxisMarks::OUTER );
624  rProperty.maValue <<= nValue;
625  break;
627  {
628  // convert from degrees (double) to 100th degrees (integer)
629  double fVal;
630  ::sax::Converter::convertDouble( fVal, rValue );
631  nValue = static_cast<sal_Int32>( fVal * 100.0 );
632  rProperty.maValue <<= nValue;
633  }
634  break;
636  {
637  // modify old value
638  rProperty.maValue >>= nValue;
639  if( IsXMLToken( rValue, XML_NONE ))
640  SCH_XML_UNSETFLAG( nValue, chart::ChartDataCaption::VALUE | chart::ChartDataCaption::PERCENT );
641  else if( IsXMLToken( rValue, XML_VALUE_AND_PERCENTAGE ) )
642  SCH_XML_SETFLAG( nValue, chart::ChartDataCaption::VALUE | chart::ChartDataCaption::PERCENT );
643  else if( IsXMLToken( rValue, XML_VALUE ) )
644  SCH_XML_SETFLAG( nValue, chart::ChartDataCaption::VALUE );
645  else // must be XML_PERCENTAGE
646  SCH_XML_SETFLAG( nValue, chart::ChartDataCaption::PERCENT );
647  rProperty.maValue <<= nValue;
648  }
649  break;
651  rProperty.maValue >>= nValue;
652  (void)::sax::Converter::convertBool( bValue, rValue );
653  if( bValue )
654  SCH_XML_SETFLAG( nValue, chart::ChartDataCaption::TEXT );
655  else
656  SCH_XML_UNSETFLAG( nValue, chart::ChartDataCaption::TEXT );
657  rProperty.maValue <<= nValue;
658  break;
660  rProperty.maValue >>= nValue;
661  (void)::sax::Converter::convertBool( bValue, rValue );
662  if( bValue )
663  SCH_XML_SETFLAG( nValue, chart::ChartDataCaption::SYMBOL );
664  else
665  SCH_XML_UNSETFLAG( nValue, chart::ChartDataCaption::SYMBOL );
666  rProperty.maValue <<= nValue;
667  break;
669  rProperty.maValue >>= nValue;
670  (void)::sax::Converter::convertBool( bValue, rValue );
671  if( bValue )
672  SCH_XML_SETFLAG( nValue, chart::ChartDataCaption::DATA_SERIES );
673  else
674  SCH_XML_UNSETFLAG( nValue, chart::ChartDataCaption::DATA_SERIES );
675  rProperty.maValue <<= nValue;
676  break;
679  {
680  awt::Size aSize;
681  rProperty.maValue >>= aSize;
682  rUnitConverter.convertMeasureToCore(
684  ? aSize.Width
685  : aSize.Height,
686  rValue );
687  rProperty.maValue <<= aSize;
688  }
689  break;
690 
692  {
693  rProperty.maValue <<= rValue;
694  }
695  break;
696 
697  // deprecated from 6.0 beta on
699  rProperty.maValue <<= mrImport.loadGraphicByURL(rValue);
700  break;
701 
703  {
704  if (IsXMLToken( rValue, XML_LINEAR ))
705  rProperty.maValue <<= OUString("com.sun.star.chart2.LinearRegressionCurve");
706  else if (IsXMLToken( rValue, XML_LOGARITHMIC))
707  rProperty.maValue <<= OUString("com.sun.star.chart2.LogarithmicRegressionCurve");
708  else if (IsXMLToken( rValue, XML_EXPONENTIAL))
709  rProperty.maValue <<= OUString("com.sun.star.chart2.ExponentialRegressionCurve");
710  else if (IsXMLToken( rValue, XML_POWER))
711  rProperty.maValue <<= OUString("com.sun.star.chart2.PotentialRegressionCurve");
712  else if (IsXMLToken( rValue, XML_POLYNOMIAL))
713  rProperty.maValue <<= OUString("com.sun.star.chart2.PolynomialRegressionCurve");
714  else if (IsXMLToken( rValue, XML_MOVING_AVERAGE))
715  rProperty.maValue <<= OUString("com.sun.star.chart2.MovingAverageRegressionCurve");
716  }
717  break;
718 
720  {
721  if (IsXMLToken( rValue, XML_PRIOR ))
722  rProperty.maValue <<= MovingAverageType::Prior;
723  else if (IsXMLToken( rValue, XML_CENTRAL))
724  rProperty.maValue <<= MovingAverageType::Central;
725  else if (IsXMLToken( rValue, XML_AVERAGED_ABSCISSA))
726  rProperty.maValue <<= MovingAverageType::AveragedAbscissa;
727  else // default
728  rProperty.maValue <<= MovingAverageType::Prior;
729  }
730  break;
731 
732  default:
733  bRet = false;
734  break;
735  }
736  }
737 
738  // if we didn't handle it, the parent should
739  if( !bRet )
740  {
741  // call parent
742  bRet = SvXMLImportPropertyMapper::handleSpecialItem( rProperty, rProperties, rValue, rUnitConverter, rNamespaceMap );
743  }
744 
745  return bRet;
746 }
747 
748 void XMLChartImportPropertyMapper::finished( ::std::vector< XMLPropertyState >& /*rProperties*/, sal_Int32 /*nStartIndex*/, sal_Int32 /*nEndIndex*/ ) const
749 {
750 }
751 
752 /* 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:186
#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:865
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:82
#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:3508
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:1271
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:849
#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
#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:664
#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:938
#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:1885
#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:2323
#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:75
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:484
#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:3452
#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:1922
#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:1317
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
#define XML_SCH_TYPE_ERROR_INDICATOR_LOWER
Definition: PropertyMap.hxx:41
SvXMLExportFlags getExportFlags() const
Definition: xmlexp.hxx:482
#define XML_SCH_TYPE_MISSING_VALUE_TREATMENT
Definition: PropertyMap.hxx:48
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:206
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