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/nmspmap.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/XChartDocument.hpp>
54 #include <com/sun/star/chart2/data/XRangeXMLConversion.hpp>
55 #include <com/sun/star/graphic/XGraphic.hpp>
56 
57 #include <rtl/ustrbuf.hxx>
58 
59 #define SCH_XML_SETFLAG( status, flag ) (status)|= (flag)
60 #define SCH_XML_UNSETFLAG( status, flag ) (status) = ((status) | (flag)) - (flag)
61 
62 using namespace com::sun::star;
63 using namespace ::xmloff::token;
64 
65 namespace {
66 
67 SvXMLEnumMapEntry<drawing::LineStyle> const aLineStyleMap[] =
68 {
69  { XML_NONE, drawing::LineStyle_NONE },
70  { XML_SOLID, drawing::LineStyle_SOLID },
71  { XML_DASH, drawing::LineStyle_DASH },
72  { XML_TOKEN_INVALID, drawing::LineStyle(0) }
73 };
74 
75 SvXMLEnumMapEntry<drawing::FillStyle> const aFillStyleMap[] =
76 {
77  { XML_NONE, drawing::FillStyle_NONE },
78  { XML_SOLID, drawing::FillStyle_SOLID }
79 };
80 
81 }
82 
83 // the following class implementations are in this file:
84 
85 // * XMLChartPropHdlFactory
86 // * XMLChartPropertySetMapper
87 // * XMLChartExportPropertyMapper
88 // * XMLChartImportPropertyMapper
89 // * SchXMLStyleExport
90 
92 {
93 }
94 
96 {
98  if( ! pHdl )
99  {
100  switch( nType )
101  {
103  pHdl = new XMLAxisPositionPropertyHdl( false );
104  break;
106  pHdl = new XMLAxisPositionPropertyHdl( true );
107  break;
108 
110  pHdl = new XMLEnumPropertyHdl( aXMLChartAxisLabelPositionEnumMap);
111  break;
112 
114  pHdl = new XMLEnumPropertyHdl( aXMLChartAxisMarkPositionEnumMap);
115  break;
116 
118  pHdl = new XMLEnumPropertyHdl( aXMLChartAxisArrangementEnumMap);
119  break;
120 
122  // here we have a constant rather than an enum
123  pHdl = new XMLErrorBarStylePropertyHdl( aXMLChartErrorBarStyleEnumMap );
124  break;
125 
127  pHdl = new XMLErrorIndicatorPropertyHdl( false );
128  break;
130  pHdl = new XMLErrorIndicatorPropertyHdl( true );
131  break;
132 
134  // here we have a constant rather than an enum
135  pHdl = new XMLEnumPropertyHdl( aXMLChartSolidTypeEnumMap );
136  break;
138  // here we have a constant rather than an enum
139  pHdl = new XMLEnumPropertyHdl( aXMLChartDataLabelPlacementEnumMap );
140  break;
142  pHdl = new XMLEnumPropertyHdl( aXMLChartDataRowSourceTypeEnumMap);
143  break;
145  pHdl = new XMLTextOrientationHdl;
146  break;
147 
149  pHdl = new XMLEnumPropertyHdl( aXMLChartInterpolationTypeEnumMap );
150  break;
152  pHdl = new XMLSymbolTypePropertyHdl( false );
153  break;
154 
156  pHdl = new XMLSymbolTypePropertyHdl( true );
157  break;
158 
160  pHdl = new XMLEnumPropertyHdl( aXMLChartMissingValueTreatmentEnumMap );
161  break;
163  pHdl = new XMLEnumPropertyHdl( aLineStyleMap );
164  break;
166  pHdl = new XMLOpacityPropertyHdl(nullptr);
167  break;
169  pHdl = new XMLEnumPropertyHdl( aFillStyleMap );
170  break;
171  default:
172  ;
173  }
174  if( pHdl )
175  PutHdlCache( nType, pHdl );
176  }
177 
178  return pHdl;
179 }
180 
183 {
184 }
185 
187 {
188 }
189 
191  SvXMLExport& rExport) :
192  SvXMLExportPropertyMapper( rMapper ),
193  mrExport( rExport )
194 {
195  // chain draw properties
197 
198  // chain text properties
200 }
201 
203 {
204 }
205 
207  bool bEnableFoFontFamily,
208  std::vector< XMLPropertyState >& rProperties,
209  const uno::Reference< beans::XPropertySet >& rPropSet ) const
210 {
211  OUString aAutoPropName;
212  bool bCheckAuto = false;
213 
214  // filter properties
215  for( auto& rProperty : rProperties )
216  {
217  // find properties with context
218  // to prevent writing this property set mnIndex member to -1
219  switch( getPropertySetMapper()->GetEntryContextId( rProperty.mnIndex ))
220  {
221  // if Auto... is set the corresponding properties mustn't be exported
222  case XML_SCH_CONTEXT_MIN:
223  bCheckAuto = true;
224  aAutoPropName = "AutoMin";
225  break;
226  case XML_SCH_CONTEXT_MAX:
227  bCheckAuto = true;
228  aAutoPropName = "AutoMax";
229  break;
231  bCheckAuto = true;
232  aAutoPropName = "AutoStepMain";
233  break;
235  bCheckAuto = true;
236  aAutoPropName = "AutoStepHelp";
237  break;
238 
240  bCheckAuto = true;
241  aAutoPropName = "AutoOrigin";
242  break;
243 
244  // the following property is deprecated
245  // element-item symbol-image is used now
247  rProperty.mnIndex = -1;
248  break;
249 
252  // note this avoids export of the properties in OASIS format,
253  // but also for the OOo XML Flat format (used by binfilter),
254  // because there, the transformation to OOo is done after the
255  // complete export of the chart in OASIS format.
257  rProperty.mnIndex = -1;
258  break;
259  }
260 
261  if( bCheckAuto )
262  {
263  if( rPropSet.is())
264  {
265  try
266  {
267  bool bAuto = false;
268  uno::Any aAny = rPropSet->getPropertyValue( aAutoPropName );
269  aAny >>= bAuto;
270  if( bAuto )
271  rProperty.mnIndex = -1;
272  }
273  catch(const beans::UnknownPropertyException&)
274  {
275  }
276  }
277  bCheckAuto = false;
278  }
279  }
280 
281  SvXMLExportPropertyMapper::ContextFilter(bEnableFoFontFamily, rProperties, rPropSet);
282 }
283 
286  const XMLPropertyState& rProperty, SvXmlExportFlags nFlags,
287  const ::std::vector< XMLPropertyState > *pProperties,
288  sal_uInt32 nIdx ) const
289 {
290  switch( getPropertySetMapper()->GetEntryContextId( rProperty.mnIndex ))
291  {
293  {
294  uno::Reference<graphic::XGraphic> xGraphic;
295  rProperty.maValue >>= xGraphic;
296 
297  OUString sInternalURL;
298  // export as XLink reference into the package
299  // if embedding is off
300  if (xGraphic.is())
301  {
302  OUString aOutMimeType;
303  sInternalURL = mrExport.AddEmbeddedXGraphic(xGraphic, aOutMimeType);
304  }
305  if (!sInternalURL.isEmpty())
306  {
308  }
309 
310  {
311  sal_uInt32 nPropIndex = rProperty.mnIndex;
312  // this is the element that has to live until the next statement
314  getPropertySetMapper()->GetEntryNameSpace( nPropIndex ),
315  getPropertySetMapper()->GetEntryXMLName( nPropIndex ),
316  true, true );
317 
318  // export as Base64 embedded graphic
319  // if embedding is on
320  if (xGraphic.is())
322  }
323  }
324  break;
325 
327  {
328  OUString aSeparator;
329  rProperty.maValue >>= aSeparator;
330 
331  if( !aSeparator.isEmpty() )
332  {
333  sal_uInt32 nPropIndex = rProperty.mnIndex;
335  getPropertySetMapper()->GetEntryNameSpace( nPropIndex ),
336  getPropertySetMapper()->GetEntryXMLName( nPropIndex ),
337  true, true );
338 
339  SchXMLTools::exportText( mrExport, aSeparator, true );
340  }
341  }
342  break;
343 
344  default:
345  // call parent
347  nFlags, pProperties, nIdx );
348  break;
349  }
350 }
351 
352 namespace {
353 
354 OUString convertRange( const OUString & rRange, const uno::Reference< chart2::XChartDocument > & xDoc )
355 {
356  OUString aResult = rRange;
357  if( !xDoc.is() )
358  return aResult;
359  uno::Reference< chart2::data::XRangeXMLConversion > xConversion(
360  xDoc->getDataProvider(), uno::UNO_QUERY );
361  try
362  {
363  if( xConversion.is())
364  aResult = xConversion->convertRangeToXML( rRange );
365  }
366  catch (css::lang::IllegalArgumentException&)
367  {
368  }
369 
370  return aResult;
371 }
372 
373 }
374 
376  SvXMLAttributeList& rAttrList, const XMLPropertyState& rProperty,
377  const SvXMLUnitConverter& rUnitConverter,
378  const SvXMLNamespaceMap& rNamespaceMap,
379  const ::std::vector< XMLPropertyState > *pProperties,
380  sal_uInt32 nIdx ) const
381 {
382  bool bHandled = false;
383 
384  sal_Int32 nContextId = getPropertySetMapper()->GetEntryContextId( rProperty.mnIndex );
385 
386  if( nContextId )
387  {
388  bHandled = true;
389 
390  OUString sAttrName = getPropertySetMapper()->GetEntryXMLName( rProperty.mnIndex );
391  sal_uInt16 nNameSpace = getPropertySetMapper()->GetEntryNameSpace( rProperty.mnIndex );
392  OUStringBuffer sValueBuffer;
393  OUString sValue;
394 
395  sal_Int32 nValue = 0;
396  bool bValue = false;
397 
398  switch( nContextId )
399  {
402  rProperty.maValue >>= nValue;
403  bValue = (( nValue & chart::ChartAxisMarks::INNER ) == chart::ChartAxisMarks::INNER );
404  ::sax::Converter::convertBool( sValueBuffer, bValue );
405  break;
408  rProperty.maValue >>= nValue;
409  bValue = (( nValue & chart::ChartAxisMarks::OUTER ) == chart::ChartAxisMarks::OUTER );
410  ::sax::Converter::convertBool( sValueBuffer, bValue );
411  break;
413  {
414  // convert from 100th degrees to degrees (double)
415  rProperty.maValue >>= nValue;
416  double fVal = static_cast<double>(nValue) / 100.0;
417  ::sax::Converter::convertDouble( sValueBuffer, fVal );
418  }
419  break;
421  {
422  rProperty.maValue >>= nValue;
423  if( ( nValue & chart::ChartDataCaption::VALUE ) == chart::ChartDataCaption::VALUE )
424  {
425  if( ( nValue & chart::ChartDataCaption::PERCENT ) == chart::ChartDataCaption::PERCENT )
426  {
427  const SvtSaveOptions::ODFSaneDefaultVersion nCurrentVersion( SvtSaveOptions().GetODFSaneDefaultVersion() );
428  if (nCurrentVersion < SvtSaveOptions::ODFSVER_012)
429  sValueBuffer.append( GetXMLToken( XML_PERCENTAGE ));
430  else
431  sValueBuffer.append( GetXMLToken( XML_VALUE_AND_PERCENTAGE ));
432  }
433  else
434  sValueBuffer.append( GetXMLToken( XML_VALUE ));
435  }
436  else if(( nValue & chart::ChartDataCaption::PERCENT ) == chart::ChartDataCaption::PERCENT )
437  sValueBuffer.append( GetXMLToken( XML_PERCENTAGE ));
438  else
439  sValueBuffer.append( GetXMLToken( XML_NONE ));
440  }
441  break;
443  rProperty.maValue >>= nValue;
444  bValue = (( nValue & chart::ChartDataCaption::TEXT ) == chart::ChartDataCaption::TEXT );
445  ::sax::Converter::convertBool( sValueBuffer, bValue );
446  break;
448  rProperty.maValue >>= nValue;
449  bValue = (( nValue & chart::ChartDataCaption::SYMBOL ) == chart::ChartDataCaption::SYMBOL );
450  ::sax::Converter::convertBool( sValueBuffer, bValue );
451  break;
454  {
455  awt::Size aSize;
456  rProperty.maValue >>= aSize;
457  rUnitConverter.convertMeasureToXML( sValueBuffer,
459  ? aSize.Width
460  : aSize.Height );
461  }
462  break;
463 
465  {
466  // just for import
467  break;
468  }
469 
471  {
472  OUString aRangeStr;
473  rProperty.maValue >>= aRangeStr;
474  sValueBuffer.append(convertRange(aRangeStr, mxChartDoc));
475  }
476  break;
478  {
479  const SvtSaveOptions::ODFSaneDefaultVersion nCurrentVersion( SvtSaveOptions().GetODFSaneDefaultVersion() );
480 
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 (nCurrentVersion > SvtSaveOptions::ODFSVER_012 && aServiceName == "com.sun.star.chart2.PolynomialRegressionCurve")
492  sValueBuffer.append( GetXMLToken( XML_POLYNOMIAL ));
493  else if (nCurrentVersion > SvtSaveOptions::ODFSVER_012 && aServiceName == "com.sun.star.chart2.MovingAverageRegressionCurve")
494  sValueBuffer.append( GetXMLToken( XML_MOVING_AVERAGE ));
495  }
496  break;
497 
498  default:
499  bHandled = false;
500  break;
501  }
502 
503  if( !sValueBuffer.isEmpty())
504  {
505  sValue = sValueBuffer.makeStringAndClear();
506  sAttrName = rNamespaceMap.GetQNameByKey( nNameSpace, sAttrName );
507  rAttrList.AddAttribute( sAttrName, sValue );
508  }
509  }
510 
511  if( !bHandled )
512  {
513  // call parent
514  SvXMLExportPropertyMapper::handleSpecialItem( rAttrList, rProperty, rUnitConverter, rNamespaceMap, pProperties, nIdx );
515  }
516 }
517 
518 void XMLChartExportPropertyMapper::setChartDoc( const uno::Reference< chart2::XChartDocument >& xChartDoc )
519 {
520  mxChartDoc = xChartDoc;
521 }
522 
524  const SvXMLImport& _rImport ) :
525  SvXMLImportPropertyMapper( rMapper, const_cast< SvXMLImport & >( _rImport )),
526  mrImport( const_cast< SvXMLImport & > ( _rImport ))
527 {
528  // chain shape mapper for drawing properties
529 
530  // give an empty model. It is only used for numbering rules that don't exist in chart
531  uno::Reference< frame::XModel > xEmptyModel;
533 
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);
539 
540  // do not chain text properties: on import this is done by shape mapper
541  // to import old documents
542 }
543 
545 {
546 }
547 
549  XMLPropertyState& rProperty,
550  ::std::vector< XMLPropertyState >& rProperties,
551  const OUString& rValue,
552  const SvXMLUnitConverter& rUnitConverter,
553  const SvXMLNamespaceMap& rNamespaceMap ) const
554 {
555  sal_Int32 nContextId = maPropMapper->GetEntryContextId( rProperty.mnIndex );
556  bool bRet = (nContextId != 0);
557 
558  if( nContextId )
559  {
560  sal_Int32 nValue = 0;
561  bool bValue = false;
562 
563  switch( nContextId )
564  {
567  (void)::sax::Converter::convertBool( bValue, rValue );
568  // modify old value
569  rProperty.maValue >>= nValue;
570  if( bValue )
571  SCH_XML_SETFLAG( nValue, chart::ChartAxisMarks::INNER );
572  else
573  SCH_XML_UNSETFLAG( nValue, chart::ChartAxisMarks::INNER );
574  rProperty.maValue <<= nValue;
575  break;
578  (void)::sax::Converter::convertBool( bValue, rValue );
579  // modify old value
580  rProperty.maValue >>= nValue;
581  if( bValue )
582  SCH_XML_SETFLAG( nValue, chart::ChartAxisMarks::OUTER );
583  else
584  SCH_XML_UNSETFLAG( nValue, chart::ChartAxisMarks::OUTER );
585  rProperty.maValue <<= nValue;
586  break;
588  {
589  // convert from degrees (double) to 100th degrees (integer)
590  double fVal;
591  ::sax::Converter::convertDouble( fVal, rValue );
592  nValue = static_cast<sal_Int32>( fVal * 100.0 );
593  rProperty.maValue <<= nValue;
594  }
595  break;
597  {
598  // modify old value
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;
609  }
610  break;
612  rProperty.maValue >>= nValue;
613  (void)::sax::Converter::convertBool( bValue, rValue );
614  if( bValue )
615  SCH_XML_SETFLAG( nValue, chart::ChartDataCaption::TEXT );
616  else
617  SCH_XML_UNSETFLAG( nValue, chart::ChartDataCaption::TEXT );
618  rProperty.maValue <<= nValue;
619  break;
621  rProperty.maValue >>= nValue;
622  (void)::sax::Converter::convertBool( bValue, rValue );
623  if( bValue )
624  SCH_XML_SETFLAG( nValue, chart::ChartDataCaption::SYMBOL );
625  else
626  SCH_XML_UNSETFLAG( nValue, chart::ChartDataCaption::SYMBOL );
627  rProperty.maValue <<= nValue;
628  break;
631  {
632  awt::Size aSize;
633  rProperty.maValue >>= aSize;
634  rUnitConverter.convertMeasureToCore(
636  ? aSize.Width
637  : aSize.Height,
638  rValue );
639  rProperty.maValue <<= aSize;
640  }
641  break;
642 
644  {
645  rProperty.maValue <<= rValue;
646  }
647  break;
648 
649  // deprecated from 6.0 beta on
651  rProperty.maValue <<= mrImport.loadGraphicByURL(rValue);
652  break;
653 
655  {
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");
668  }
669  break;
670 
671  default:
672  bRet = false;
673  break;
674  }
675  }
676 
677  // if we didn't handle it, the parent should
678  if( !bRet )
679  {
680  // call parent
681  bRet = SvXMLImportPropertyMapper::handleSpecialItem( rProperty, rProperties, rValue, rUnitConverter, rNamespaceMap );
682  }
683 
684  return bRet;
685 }
686 
687 void XMLChartImportPropertyMapper::finished( ::std::vector< XMLPropertyState >& /*rProperties*/, sal_Int32 /*nStartIndex*/, sal_Int32 /*nEndIndex*/ ) const
688 {
689 }
690 
691 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
#define XML_SCH_CONTEXT_SPECIAL_TICKS_MIN_OUTER
Definition: PropertyMap.hxx:72
bool IsXMLToken(const OUString &rString, enum XMLTokenEnum eToken)
compare eToken to the string
Definition: xmltoken.cxx:3422
virtual const XMLPropertyHandler * GetPropertyHandler(sal_Int32 nType) const override
This method retrieves a PropertyHandler for the given XML-type.
constexpr sal_uInt16 XML_NAMESPACE_STYLE
Definition: xmlnmspe.hxx:30
#define XML_SCH_TYPE_SYMBOL_TYPE
Definition: PropertyMap.hxx:46
#define XML_SCH_TYPE_ERROR_BAR_STYLE
Definition: PropertyMap.hxx:38
#define XML_SCH_CONTEXT_SPECIAL_LABEL_SEPARATOR
Definition: PropertyMap.hxx:83
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:839
virtual const XMLPropertyHandler * GetPropertyHandler(sal_Int32 nType) const
This method retrieves a PropertyHandler for the given XML-type.
Definition: prhdlfac.cxx:137
static bool convertBool(bool &rBool, const OUString &rString)
the SvXMLTypeConverter converts values of various types from their internal representation to the tex...
Definition: xmluconv.hxx:77
XMLChartPropertySetMapper(bool bForExport)
#define XML_SCH_TYPE_AXIS_POSITION_VALUE
Definition: PropertyMap.hxx:51
#define XML_SCH_TYPE_TEXT_ORIENTATION
Definition: PropertyMap.hxx:44
#define XML_SCH_TYPE_NAMED_SYMBOL
Definition: PropertyMap.hxx:47
sal_Int32 mnIndex
Definition: maptype.hxx:106
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:1356
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:823
#define XML_SCH_CONTEXT_SPECIAL_DATA_LABEL_NUMBER
Definition: PropertyMap.hxx:74
#define XML_SCH_CONTEXT_SPECIAL_DATA_LABEL_TEXT
Definition: PropertyMap.hxx:75
#define XML_SCH_TYPE_TICK_MARK_POSITION
Definition: PropertyMap.hxx:53
#define XML_SCH_CONTEXT_STEP_HELP_COUNT
Definition: PropertyMap.hxx:63
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:67
css::uno::Any const & rValue
Definition: ImageStyle.hxx:38
bool convertMeasureToCore(sal_Int32 &rValue, const OUString &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_CONTEXT_SPECIAL_TICKS_MAJ_INNER
Definition: PropertyMap.hxx:69
#define XML_SCH_CONTEXT_SPECIAL_SYMBOL_IMAGE
Definition: PropertyMap.hxx:82
#define XML_SCH_TYPE_SOLID_TYPE
Definition: PropertyMap.hxx:40
virtual void ContextFilter(bool bEnableFoFontFamily,::std::vector< XMLPropertyState > &rProperties, const css::uno::Reference< css::beans::XPropertySet > &rPropSet) const
Application-specific filter.
Definition: xmlexppr.cxx:638
#define XML_SCH_CONTEXT_SPECIAL_TEXT_ROTATION
Definition: PropertyMap.hxx:73
#define XML_SCH_TYPE_LABEL_BORDER_OPACITY
Definition: PropertyMap.hxx:55
void AddAttribute(sal_uInt16 nPrefix, const char *pName, const OUString &rValue)
Definition: xmlexp.cxx:926
#define XML_SCH_CONTEXT_SPECIAL_SYMBOL_IMAGE_NAME
Definition: PropertyMap.hxx:81
virtual ~XMLChartPropHdlFactory() override
#define XML_SCH_CONTEXT_STEP_MAIN
Definition: PropertyMap.hxx:62
#define XML_SCH_CONTEXT_SPECIAL_SYMBOL_WIDTH
Definition: PropertyMap.hxx:79
OUString AddEmbeddedXGraphic(css::uno::Reference< css::graphic::XGraphic > const &rxGraphic, OUString &rOutMimeType, OUString const &rRequestedName=OUString())
Definition: xmlexp.cxx:1863
#define XML_SCH_TYPE_LABEL_PLACEMENT_TYPE
Definition: PropertyMap.hxx:48
#define XML_SCH_CONTEXT_MIN
Definition: PropertyMap.hxx:60
#define XML_SCH_TYPE_ERROR_INDICATOR_UPPER
Definition: PropertyMap.hxx:41
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 ...
#define XML_SCH_TYPE_INTERPOLATION
Definition: PropertyMap.hxx:45
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:64
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:322
void setChartDoc(const css::uno::Reference< css::chart2::XChartDocument > &xChartDoc)
#define XML_SCH_CONTEXT_SPECIAL_ERRORBAR_RANGE
Definition: PropertyMap.hxx:84
virtual ~XMLChartExportPropertyMapper() override
#define XML_SCH_TYPE_LABEL_BORDER_STYLE
Definition: PropertyMap.hxx:54
#define XML_SCH_TYPE_LABEL_FILL_STYLE
Definition: PropertyMap.hxx:56
rtl::Reference< XMLPropertySetMapper > maPropMapper
Definition: xmlimppr.hxx:71
OUString GetQNameByKey(sal_uInt16 nKey, const OUString &rLocalName, bool bCache=true) const
Definition: nmspmap.cxx:187
#define XML_SCH_TYPE_AXIS_POSITION
Definition: PropertyMap.hxx:50
void exportText(SvXMLExport &rExport, const OUString &rText, bool bConvertTabsLFs)
void ChainExportMapper(const rtl::Reference< SvXMLExportPropertyMapper > &rMapper)
Definition: xmlexppr.cxx:513
#define XML_SCH_TYPE_DATAROWSOURCE
Definition: PropertyMap.hxx:43
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.
constexpr sal_uInt16 XML_NAMESPACE_XLINK
Definition: xmlnmspe.hxx:35
#define XML_SCH_CONTEXT_MAX
Definition: PropertyMap.hxx:61
Map an XMLTokenEnum to an enum value.
Definition: ximpshap.hxx:40
css::uno::Any maValue
Definition: maptype.hxx:107
#define XML_SCH_CONTEXT_SPECIAL_REGRESSION_TYPE
Definition: PropertyMap.hxx:85
SvXmlExportFlags
Definition: xmlexppr.hxx:39
const XMLPropertyMapEntry aXMLChartPropMap[]
const OUString & GetXMLToken(enum XMLTokenEnum eToken)
return the OUString representation for eToken
Definition: xmltoken.cxx:3366
#define SCH_XML_UNSETFLAG(status, flag)
Handling of tokens in XML:
#define XML_SCH_CONTEXT_SPECIAL_TICKS_MAJ_OUTER
Definition: PropertyMap.hxx:70
Smart struct to transport an Any with an index to the appropriate property-name.
Definition: maptype.hxx:104
virtual ~XMLChartImportPropertyMapper() override
virtual ~XMLChartPropertySetMapper() override
#define XML_SCH_CONTEXT_SPECIAL_NUMBER_FORMAT
Definition: PropertyMap.hxx:77
#define XML_SCH_CONTEXT_STOCK_WITH_VOLUME
Definition: PropertyMap.hxx:66
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:1900
#define XML_SCH_CONTEXT_SPECIAL_DATA_LABEL_SYMBOL
Definition: PropertyMap.hxx:76
void AddAttribute(const OUString &sName, const OUString &sValue)
Definition: attrlist.cxx:143
static SvXMLExportPropertyMapper * CreateParaExtPropMapper(SvXMLExport &rExport)
Definition: txtparae.cxx:1353
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:37
#define XML_SCH_TYPE_AXIS_LABEL_POSITION
Definition: PropertyMap.hxx:52
#define SCH_XML_SETFLAG(status, flag)
#define XML_SCH_CONTEXT_SPECIAL_TICKS_MIN_INNER
Definition: PropertyMap.hxx:71
#define XML_SCH_CONTEXT_SPECIAL_SYMBOL_HEIGHT
Definition: PropertyMap.hxx:80
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:42
SvXMLExportFlags getExportFlags() const
Definition: xmlexp.hxx:477
#define XML_SCH_TYPE_MISSING_VALUE_TREATMENT
Definition: PropertyMap.hxx:49
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:181
sal_Int16 nValue
const rtl::Reference< XMLPropertySetMapper > & getPropertySetMapper() const
Definition: xmlexppr.cxx:1082
XMLChartImportPropertyMapper(const rtl::Reference< XMLPropertySetMapper > &rMapper, const SvXMLImport &rImport)
typedef void(CALLTYPE *GetFuncDataPtr)(sal_uInt16 &nNo