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"
21 
22 #include <sax/tools/converter.hxx>
23 
24 #include "SchXMLTools.hxx"
31 #include <propimp0.hxx>
32 
34 #include <xmloff/attrlist.hxx>
35 #include <xmloff/namespacemap.hxx>
36 #include <xmloff/xmluconv.hxx>
37 #include <xmloff/shapeimport.hxx>
38 #include <xmloff/xmlexp.hxx>
39 #include <xmloff/xmltoken.hxx>
40 #include <xmloff/prhdlfac.hxx>
41 
42 #include <com/sun/star/awt/Size.hpp>
43 #include <com/sun/star/drawing/LineStyle.hpp>
44 #include <com/sun/star/drawing/FillStyle.hpp>
45 #include <com/sun/star/chart/ChartAxisMarks.hpp>
46 #include <com/sun/star/chart/ChartDataCaption.hpp>
47 #include <com/sun/star/chart2/MovingAverageType.hpp>
48 #include <com/sun/star/chart2/XChartDocument.hpp>
49 #include <com/sun/star/chart2/data/XRangeXMLConversion.hpp>
50 #include <com/sun/star/graphic/XGraphic.hpp>
51 
52 #include <rtl/ustrbuf.hxx>
53 
54 #define SCH_XML_SETFLAG( status, flag ) (status)|= (flag)
55 #define SCH_XML_UNSETFLAG( status, flag ) (status) = ((status) | (flag)) - (flag)
56 
57 using namespace com::sun::star;
58 using namespace ::xmloff::token;
59 using namespace css::chart2;
60 
61 
62 #define MAP_FULL( ApiName, NameSpace, XMLTokenName, XMLType, ContextId, EarliestODFVersionForExport ) { ApiName, XML_NAMESPACE_##NameSpace, xmloff::token::XMLTokenName, XMLType|XML_TYPE_PROP_CHART, ContextId, EarliestODFVersionForExport, false }
63 #define MAP_ENTRY( a, ns, nm, t ) { a, XML_NAMESPACE_##ns, xmloff::token::nm, t|XML_TYPE_PROP_CHART, 0, SvtSaveOptions::ODFSVER_010, false }
64 #define MAP_ENTRY_ODF12( a, ns, nm, t ) { a, XML_NAMESPACE_##ns, xmloff::token::nm, t|XML_TYPE_PROP_CHART, 0, SvtSaveOptions::ODFSVER_012, false }
65 #define MAP_ENTRY_ODF13( a, ns, nm, t ) { a, ns, xmloff::token::nm, t|XML_TYPE_PROP_CHART, 0, SvtSaveOptions::ODFSVER_013, false }
66 #define MAP_ENTRY_ODF_EXT( a, ns, nm, t ) { a, XML_NAMESPACE_##ns, xmloff::token::nm, t|XML_TYPE_PROP_CHART, 0, SvtSaveOptions::ODFSVER_FUTURE_EXTENDED, false }
67 #define MAP_ENTRY_ODF_EXT_IMPORT( a, ns, nm, t ) { a, XML_NAMESPACE_##ns, xmloff::token::nm, t|XML_TYPE_PROP_CHART, 0, SvtSaveOptions::ODFSVER_FUTURE_EXTENDED, true }
68 #define MAP_CONTEXT( a, ns, nm, t, c ) { a, XML_NAMESPACE_##ns, xmloff::token::nm, t|XML_TYPE_PROP_CHART, c, SvtSaveOptions::ODFSVER_010, false }
69 #define MAP_SPECIAL( a, ns, nm, t, c ) { a, XML_NAMESPACE_##ns, xmloff::token::nm, t|XML_TYPE_PROP_CHART | MID_FLAG_SPECIAL_ITEM, c, SvtSaveOptions::ODFSVER_010, false }
70 #define MAP_SPECIAL_ODF12( a, ns, nm, t, c ) { a, XML_NAMESPACE_##ns, xmloff::token::nm, t|XML_TYPE_PROP_CHART | MID_FLAG_SPECIAL_ITEM, c, SvtSaveOptions::ODFSVER_012, false }
71 #define MAP_SPECIAL_ODF13( a, ns, nm, t, c ) { a, XML_NAMESPACE_##ns, xmloff::token::nm, t|XML_TYPE_PROP_CHART | MID_FLAG_SPECIAL_ITEM, c, SvtSaveOptions::ODFSVER_013, false }
72 #define MAP_ENTRY_END { nullptr,0,xmloff::token::XML_TOKEN_INVALID,0,0,SvtSaveOptions::ODFSVER_010, false }
73 
74 // PropertyMap for Chart properties drawing- and
75 // textproperties are added later using the chaining
76 // mechanism
77 
79 {
80  // chart subtypes
81  MAP_ENTRY( "UpDown", CHART, XML_JAPANESE_CANDLE_STICK, XML_TYPE_BOOL ), // formerly XML_STOCK_UPDOWN_BARS
85  MAP_ENTRY( "Lines", CHART, XML_LINES, XML_TYPE_BOOL ),
88  // ODF 1.3 OFFICE-3662 added values
90  MAP_ENTRY( "Stacked", CHART, XML_STACKED, XML_TYPE_BOOL ),
91  // type: "none", "automatic", "named-symbol" or "image"
93  // if type=="named-symbol" => name of symbol (square, diamond, ...)
95  // if type=="image" => an xlink:href element with a linked (package) URI
99  MAP_ENTRY( "Vertical", CHART, XML_VERTICAL, XML_TYPE_BOOL ),
100  // #i32368# property should no longer be used as XML-property (in OASIS
101  // format), but is still ex-/imported for compatibility with the OOo file format
103  MAP_ENTRY( "StackedBarsConnected", CHART, XML_CONNECT_BARS, XML_TYPE_BOOL ),
104 
106  MAP_ENTRY_ODF12( "IncludeHiddenCells", CHART, XML_INCLUDE_HIDDEN_CELLS, XML_TYPE_BOOL ),
107  MAP_ENTRY_ODF12( "AutomaticPosition", CHART, XML_AUTOMATIC_POSITION, XML_TYPE_BOOL ),
111  // #72304 Chart data table flags
112  MAP_ENTRY_ODF_EXT( "DataTableHBorder", LO_EXT, XML_DATA_TABLE_SHOW_HORZ_BORDER, XML_TYPE_BOOL ),
113  MAP_ENTRY_ODF_EXT( "DataTableVBorder", LO_EXT, XML_DATA_TABLE_SHOW_VERT_BORDER, XML_TYPE_BOOL ),
114  MAP_ENTRY_ODF_EXT( "DataTableOutline", LO_EXT, XML_DATA_TABLE_SHOW_OUTLINE, XML_TYPE_BOOL ),
118  // Chart display units flags
121  MAP_ENTRY_ODF_EXT( "ExternalData", LO_EXT, XML_EXTERNALDATA, XML_TYPE_STRING),
122 
123  MAP_ENTRY_ODF_EXT( "LabelBorderColor", LO_EXT, XML_LABEL_STROKE_COLOR, XML_TYPE_COLOR ),
126  MAP_ENTRY_ODF_EXT( "LabelBorderWidth", LO_EXT, XML_LABEL_STROKE_WIDTH, XML_TYPE_MEASURE ),
127 
128  MAP_ENTRY_ODF_EXT( "LabelFillColor", LO_EXT, XML_LABEL_FILL_COLOR, XML_TYPE_COLOR ),
129  MAP_ENTRY_ODF_EXT( "LabelFillStyle", LO_EXT, XML_LABEL_FILL, XML_SCH_TYPE_LABEL_FILL_STYLE ),
130  MAP_ENTRY_ODF_EXT( "LabelFillBackground", LO_EXT, XML_FILL_HATCH_SOLID, XML_TYPE_BOOL ),
131  MAP_ENTRY_ODF_EXT( "LabelFillHatchName", LO_EXT, XML_FILL_HATCH_NAME, XML_TYPE_STYLENAME),
132 
133  MAP_ENTRY( "ScaleText", CHART, XML_SCALE_TEXT, XML_TYPE_BOOL ),
134 
135  // spline settings
136  MAP_ENTRY( "SplineOrder", CHART, XML_SPLINE_ORDER, XML_TYPE_NUMBER ),
137  MAP_ENTRY( "SplineResolution", CHART, XML_SPLINE_RESOLUTION, XML_TYPE_NUMBER ),
138 
139  // plot-area properties
143 
144  // axis properties
145  MAP_ENTRY( "DisplayLabels", CHART, XML_DISPLAY_LABEL, XML_TYPE_BOOL ),
156  MAP_ENTRY( "GapWidth", CHART, XML_GAP_WIDTH, XML_TYPE_NUMBER ),
157  MAP_ENTRY( "Overlap", CHART, XML_OVERLAP, XML_TYPE_NUMBER ),
158  MAP_ENTRY( "TextCanOverlap", CHART, XML_TEXT_OVERLAP, XML_TYPE_BOOL ),
159  MAP_ENTRY_ODF12( "ReverseDirection", CHART, XML_REVERSE_DIRECTION, XML_TYPE_BOOL ),
160  MAP_ENTRY( "TextBreak", TEXT, XML_LINE_BREAK, XML_TYPE_BOOL ),
161  MAP_ENTRY_ODF_EXT( "TryStaggeringFirst", LO_EXT, XML_TRY_STAGGERING_FIRST, XML_TYPE_BOOL ),
164  MAP_ENTRY( "LinkNumberFormatToSource", CHART, XML_LINK_DATA_STYLE_TO_SOURCE, XML_TYPE_BOOL ),
165  MAP_ENTRY( "Visible", CHART, XML_VISIBLE, XML_TYPE_BOOL ),
166  MAP_ENTRY_ODF_EXT( "MajorOrigin", LO_EXT, XML_MAJOR_ORIGIN, XML_TYPE_DOUBLE ),
167 
172 
173  // statistical properties
174 
175  MAP_ENTRY( "MeanValue", CHART, XML_MEAN_VALUE, XML_TYPE_BOOL ),
176  MAP_ENTRY( "ErrorMargin", CHART, XML_ERROR_MARGIN, XML_TYPE_DOUBLE ),
179  MAP_ENTRY( "ShowPositiveError", CHART, XML_ERROR_UPPER_INDICATOR, XML_TYPE_BOOL),
180  MAP_ENTRY( "ShowNegativeError", CHART, XML_ERROR_LOWER_INDICATOR, XML_TYPE_BOOL),
182  MAP_ENTRY( "PercentageError", CHART, XML_ERROR_PERCENTAGE, XML_TYPE_DOUBLE ),
183 
184  // regression curve properties
188 
189  // ODF 1.3 OFFICE-3958
198 
199  // ODF 1.3 OFFICE-3959
202 
203  MAP_ENTRY_ODF_EXT( "ExtrapolateForward", LO_EXT, XML_REGRESSION_EXTRAPOLATE_FORWARD, XML_TYPE_DOUBLE ),
204  MAP_ENTRY_ODF_EXT( "ExtrapolateBackward", LO_EXT, XML_REGRESSION_EXTRAPOLATE_BACKWARD, XML_TYPE_DOUBLE ),
207 
210 
213 
214  // errorbars properties (chart2)
217 
218  // series/data-point properties
225  MAP_ENTRY( "SegmentOffset", CHART, XML_PIE_OFFSET, XML_TYPE_NUMBER ),
227  MAP_ENTRY_ODF_EXT( "ShowCustomLeaderLines", LO_EXT, XML_CUSTOM_LEADERLINES, XML_TYPE_BOOL ),
228 
229  // text properties for titles
230  MAP_SPECIAL( "TextRotation", STYLE, XML_ROTATION_ANGLE, XML_TYPE_NUMBER, XML_SCH_CONTEXT_SPECIAL_TEXT_ROTATION ), // convert 1/100th degrees to degrees
232 
233  // for compatibility to pre 6.0beta documents
234 // MAP_SPECIAL( "SymbolBitmap", CHART, XML_SYMBOL_IMAGE_NAME, XML_TYPE_STRING, XML_SCH_CONTEXT_SPECIAL_SYMBOL_IMAGE_NAME ),
235 
236  MAP_ENTRY( "ChartUserDefinedAttributes", TEXT, XML_XMLNS, XML_TYPE_ATTRIBUTE_CONTAINER | MID_FLAG_SPECIAL_ITEM ),
237 
239 };
240 
241 // maps for enums to XML attributes
242 
244 {
245  { ::xmloff::token::XML_NEAR_AXIS, css::chart::ChartAxisLabelPosition_NEAR_AXIS },
246  { ::xmloff::token::XML_NEAR_AXIS_OTHER_SIDE, css::chart::ChartAxisLabelPosition_NEAR_AXIS_OTHER_SIDE },
247  { ::xmloff::token::XML_OUTSIDE_START, css::chart::ChartAxisLabelPosition_OUTSIDE_START },
248  { ::xmloff::token::XML_OUTSIDE_END, css::chart::ChartAxisLabelPosition_OUTSIDE_END },
249  { ::xmloff::token::XML_OUTSIDE_MINIMUM, css::chart::ChartAxisLabelPosition_OUTSIDE_START },//#i114142#
250  { ::xmloff::token::XML_OUTSIDE_MAXIMUM, css::chart::ChartAxisLabelPosition_OUTSIDE_END },//#i114142#
251  { ::xmloff::token::XML_TOKEN_INVALID, css::chart::ChartAxisLabelPosition(0) }
252 };
253 
255 {
256  { ::xmloff::token::XML_AT_LABELS, css::chart::ChartAxisMarkPosition_AT_LABELS },
257  { ::xmloff::token::XML_AT_AXIS, css::chart::ChartAxisMarkPosition_AT_AXIS },
258  { ::xmloff::token::XML_AT_LABELS_AND_AXIS, css::chart::ChartAxisMarkPosition_AT_LABELS_AND_AXIS },
259  { ::xmloff::token::XML_TOKEN_INVALID, css::chart::ChartAxisMarkPosition(0) }
260 };
261 
263 {
264  { ::xmloff::token::XML_SIDE_BY_SIDE, css::chart::ChartAxisArrangeOrderType_SIDE_BY_SIDE },
265  { ::xmloff::token::XML_STAGGER_EVEN, css::chart::ChartAxisArrangeOrderType_STAGGER_EVEN },
266  { ::xmloff::token::XML_STAGGER_ODD, css::chart::ChartAxisArrangeOrderType_STAGGER_ODD },
267  { ::xmloff::token::XML_TOKEN_INVALID, css::chart::ChartAxisArrangeOrderType(0) }
268 };
269 
271 {
272  { ::xmloff::token::XML_NONE, css::chart::ErrorBarStyle::NONE },
273  { ::xmloff::token::XML_VARIANCE, css::chart::ErrorBarStyle::VARIANCE },
274  { ::xmloff::token::XML_STANDARD_DEVIATION, css::chart::ErrorBarStyle::STANDARD_DEVIATION },
275  { ::xmloff::token::XML_CONSTANT, css::chart::ErrorBarStyle::ABSOLUTE },
276  { ::xmloff::token::XML_PERCENTAGE, css::chart::ErrorBarStyle::RELATIVE },
277  { ::xmloff::token::XML_ERROR_MARGIN, css::chart::ErrorBarStyle::ERROR_MARGIN },
278  { ::xmloff::token::XML_STANDARD_ERROR, css::chart::ErrorBarStyle::STANDARD_ERROR },
279  { ::xmloff::token::XML_CELL_RANGE, css::chart::ErrorBarStyle::FROM_DATA },
281 };
282 
284 {
285  { ::xmloff::token::XML_CUBOID, css::chart::ChartSolidType::RECTANGULAR_SOLID },
286  { ::xmloff::token::XML_CYLINDER, css::chart::ChartSolidType::CYLINDER },
287  { ::xmloff::token::XML_CONE, css::chart::ChartSolidType::CONE },
288  { ::xmloff::token::XML_PYRAMID, css::chart::ChartSolidType::PYRAMID },
290 };
291 
293 {
294  { ::xmloff::token::XML_COLUMNS, css::chart::ChartDataRowSource_COLUMNS },
295  { ::xmloff::token::XML_ROWS, css::chart::ChartDataRowSource_ROWS },
296  { ::xmloff::token::XML_TOKEN_INVALID, css::chart::ChartDataRowSource(0) }
297 };
298 
300 {
301  // this is neither an enum nor a constants group, but just a
302  // documented long property
307 };
308 
310 {
311  // this is neither an enum nor a constants group, but just a
312  // documented long property
320  // the GNM values should only be used for reading Gnumeric ods files
321  // they should never be used for writing ods file
327 };
328 
330 {
331  { ::xmloff::token::XML_AVOID_OVERLAP, css::chart::DataLabelPlacement::AVOID_OVERLAP },
332  { ::xmloff::token::XML_CENTER, css::chart::DataLabelPlacement::CENTER },
333  { ::xmloff::token::XML_TOP, css::chart::DataLabelPlacement::TOP },
334  { ::xmloff::token::XML_TOP_LEFT, css::chart::DataLabelPlacement::TOP_LEFT },
335  { ::xmloff::token::XML_LEFT, css::chart::DataLabelPlacement::LEFT },
336  { ::xmloff::token::XML_BOTTOM_LEFT, css::chart::DataLabelPlacement::BOTTOM_LEFT },
337  { ::xmloff::token::XML_BOTTOM, css::chart::DataLabelPlacement::BOTTOM },
338  { ::xmloff::token::XML_BOTTOM_RIGHT, css::chart::DataLabelPlacement::BOTTOM_RIGHT },
339  { ::xmloff::token::XML_RIGHT, css::chart::DataLabelPlacement::RIGHT },
340  { ::xmloff::token::XML_TOP_RIGHT, css::chart::DataLabelPlacement::TOP_RIGHT },
341  { ::xmloff::token::XML_INSIDE, css::chart::DataLabelPlacement::INSIDE },
342  { ::xmloff::token::XML_OUTSIDE, css::chart::DataLabelPlacement::OUTSIDE },
343  { ::xmloff::token::XML_NEAR_ORIGIN, css::chart::DataLabelPlacement::NEAR_ORIGIN },
345 };
346 
348 {
349  { ::xmloff::token::XML_LEAVE_GAP, css::chart::MissingValueTreatment::LEAVE_GAP },
350  { ::xmloff::token::XML_USE_ZERO, css::chart::MissingValueTreatment::USE_ZERO },
351  { ::xmloff::token::XML_IGNORE, css::chart::MissingValueTreatment::CONTINUE },
353 };
354 
355 namespace {
356 
357 SvXMLEnumMapEntry<drawing::LineStyle> const aLineStyleMap[] =
358 {
359  { XML_NONE, drawing::LineStyle_NONE },
360  { XML_SOLID, drawing::LineStyle_SOLID },
361  { XML_DASH, drawing::LineStyle_DASH },
362  { XML_TOKEN_INVALID, drawing::LineStyle(0) }
363 };
364 
365 SvXMLEnumMapEntry<drawing::FillStyle> const aFillStyleMap[] =
366 {
367  { XML_NONE, drawing::FillStyle_NONE },
368  { XML_SOLID, drawing::FillStyle_SOLID },
369  { XML_HATCH, drawing::FillStyle_HATCH }
370 };
371 
372 }
373 
374 // the following class implementations are in this file:
375 
376 // * XMLChartPropHdlFactory
377 // * XMLChartPropertySetMapper
378 // * XMLChartExportPropertyMapper
379 // * XMLChartImportPropertyMapper
380 // * SchXMLStyleExport
381 
383  : m_pExport(pExport)
384 {
385 }
386 
388 {
389 }
390 
392 {
394  if( ! pHdl )
395  {
396  switch( nType )
397  {
399  pHdl = new XMLAxisPositionPropertyHdl( false );
400  break;
402  pHdl = new XMLAxisPositionPropertyHdl( true );
403  break;
404 
406  pHdl = new XMLEnumPropertyHdl( aXMLChartAxisLabelPositionEnumMap);
407  break;
408 
410  pHdl = new XMLEnumPropertyHdl( aXMLChartAxisMarkPositionEnumMap);
411  break;
412 
414  pHdl = new XMLEnumPropertyHdl( aXMLChartAxisArrangementEnumMap);
415  break;
416 
418  // here we have a constant rather than an enum
419  pHdl = new XMLErrorBarStylePropertyHdl( aXMLChartErrorBarStyleEnumMap );
420  break;
421 
423  pHdl = new XMLErrorIndicatorPropertyHdl( false );
424  break;
426  pHdl = new XMLErrorIndicatorPropertyHdl( true );
427  break;
428 
430  // here we have a constant rather than an enum
431  pHdl = new XMLEnumPropertyHdl( aXMLChartSolidTypeEnumMap );
432  break;
434  // here we have a constant rather than an enum
435  pHdl = new XMLEnumPropertyHdl( aXMLChartDataLabelPlacementEnumMap );
436  break;
438  pHdl = new XMLEnumPropertyHdl( aXMLChartDataRowSourceTypeEnumMap);
439  break;
441  pHdl = new XMLTextOrientationHdl;
442  break;
443 
446  {
447  pHdl = new XMLEnumPropertyHdl(g_XMLChartInterpolationTypeEnumMap_ODF12);
448  }
449  else // ODF 1.3 OFFICE-3662
450  {
451  pHdl = new XMLEnumPropertyHdl(g_XMLChartInterpolationTypeEnumMap);
452  }
453  break;
455  pHdl = new XMLSymbolTypePropertyHdl( false );
456  break;
457 
459  pHdl = new XMLSymbolTypePropertyHdl( true );
460  break;
461 
463  pHdl = new XMLEnumPropertyHdl( aXMLChartMissingValueTreatmentEnumMap );
464  break;
466  pHdl = new XMLEnumPropertyHdl( aLineStyleMap );
467  break;
469  pHdl = new XMLOpacityPropertyHdl(nullptr);
470  break;
472  pHdl = new XMLEnumPropertyHdl( aFillStyleMap );
473  break;
474  default:
475  ;
476  }
477  if( pHdl )
478  PutHdlCache( nType, pHdl );
479  }
480 
481  return pHdl;
482 }
483 
485  : XMLPropertySetMapper(aXMLChartPropMap, new XMLChartPropHdlFactory(pExport), pExport != nullptr)
486 {
487 }
488 
490 {
491 }
492 
494  SvXMLExport& rExport) :
495  SvXMLExportPropertyMapper( rMapper ),
496  mrExport( rExport )
497 {
498  // chain draw properties
500 
501  // chain text properties
503 }
504 
506 {
507 }
508 
510  bool bEnableFoFontFamily,
511  std::vector< XMLPropertyState >& rProperties,
512  const uno::Reference< beans::XPropertySet >& rPropSet ) const
513 {
514  OUString aAutoPropName;
515  bool bCheckAuto = false;
516 
517  // filter properties
518  for( auto& rProperty : rProperties )
519  {
520  // find properties with context
521  // to prevent writing this property set mnIndex member to -1
522  switch( getPropertySetMapper()->GetEntryContextId( rProperty.mnIndex ))
523  {
524  // if Auto... is set the corresponding properties mustn't be exported
525  case XML_SCH_CONTEXT_MIN:
526  bCheckAuto = true;
527  aAutoPropName = "AutoMin";
528  break;
529  case XML_SCH_CONTEXT_MAX:
530  bCheckAuto = true;
531  aAutoPropName = "AutoMax";
532  break;
534  bCheckAuto = true;
535  aAutoPropName = "AutoStepMain";
536  break;
538  bCheckAuto = true;
539  aAutoPropName = "AutoStepHelp";
540  break;
541 
543  bCheckAuto = true;
544  aAutoPropName = "AutoOrigin";
545  break;
546 
547  // the following property is deprecated
548  // element-item symbol-image is used now
550  rProperty.mnIndex = -1;
551  break;
552 
555  // note this avoids export of the properties in OASIS format,
556  // but also for the OOo XML Flat format (used by binfilter),
557  // because there, the transformation to OOo is done after the
558  // complete export of the chart in OASIS format.
560  rProperty.mnIndex = -1;
561  break;
562  }
563 
564  if( bCheckAuto )
565  {
566  if( rPropSet.is())
567  {
568  try
569  {
570  bool bAuto = false;
571  uno::Any aAny = rPropSet->getPropertyValue( aAutoPropName );
572  aAny >>= bAuto;
573  if( bAuto )
574  rProperty.mnIndex = -1;
575  }
576  catch(const beans::UnknownPropertyException&)
577  {
578  }
579  }
580  bCheckAuto = false;
581  }
582  }
583 
584  SvXMLExportPropertyMapper::ContextFilter(bEnableFoFontFamily, rProperties, rPropSet);
585 }
586 
588  SvXMLExport& rExport,
589  const XMLPropertyState& rProperty, SvXmlExportFlags nFlags,
590  const ::std::vector< XMLPropertyState > *pProperties,
591  sal_uInt32 nIdx ) const
592 {
593  switch( getPropertySetMapper()->GetEntryContextId( rProperty.mnIndex ))
594  {
596  {
597  uno::Reference<graphic::XGraphic> xGraphic;
598  rProperty.maValue >>= xGraphic;
599 
600  OUString sInternalURL;
601  // export as XLink reference into the package
602  // if embedding is off
603  if (xGraphic.is())
604  {
605  OUString aOutMimeType;
606  sInternalURL = mrExport.AddEmbeddedXGraphic(xGraphic, aOutMimeType);
607  }
608  if (!sInternalURL.isEmpty())
609  {
611  }
612 
613  {
614  sal_uInt32 nPropIndex = rProperty.mnIndex;
615  // this is the element that has to live until the next statement
617  getPropertySetMapper()->GetEntryNameSpace( nPropIndex ),
618  getPropertySetMapper()->GetEntryXMLName( nPropIndex ),
619  true, true );
620 
621  // export as Base64 embedded graphic
622  // if embedding is on
623  if (xGraphic.is())
625  }
626  }
627  break;
628 
630  {
631  OUString aSeparator;
632  rProperty.maValue >>= aSeparator;
633 
634  if( !aSeparator.isEmpty() )
635  {
636  sal_uInt32 nPropIndex = rProperty.mnIndex;
638  getPropertySetMapper()->GetEntryNameSpace( nPropIndex ),
639  getPropertySetMapper()->GetEntryXMLName( nPropIndex ),
640  true, true );
641 
642  SchXMLTools::exportText( mrExport, aSeparator, true );
643  }
644  }
645  break;
646 
647  default:
648  // call parent
650  nFlags, pProperties, nIdx );
651  break;
652  }
653 }
654 
655 namespace {
656 
657 OUString convertRange( const OUString & rRange, const uno::Reference< chart2::XChartDocument > & xDoc )
658 {
659  OUString aResult = rRange;
660  if( !xDoc.is() )
661  return aResult;
662  uno::Reference< chart2::data::XRangeXMLConversion > xConversion(
663  xDoc->getDataProvider(), uno::UNO_QUERY );
664  try
665  {
666  if( xConversion.is())
667  aResult = xConversion->convertRangeToXML( rRange );
668  }
669  catch (css::lang::IllegalArgumentException&)
670  {
671  }
672 
673  return aResult;
674 }
675 
676 }
677 
679  SvXMLAttributeList& rAttrList, const XMLPropertyState& rProperty,
680  const SvXMLUnitConverter& rUnitConverter,
681  const SvXMLNamespaceMap& rNamespaceMap,
682  const ::std::vector< XMLPropertyState > *pProperties,
683  sal_uInt32 nIdx ) const
684 {
685  bool bHandled = false;
686 
687  sal_Int32 nContextId = getPropertySetMapper()->GetEntryContextId( rProperty.mnIndex );
688 
689  if( nContextId )
690  {
691  bHandled = true;
692 
693  OUString sAttrName = getPropertySetMapper()->GetEntryXMLName( rProperty.mnIndex );
694  sal_uInt16 nNameSpace = getPropertySetMapper()->GetEntryNameSpace( rProperty.mnIndex );
695  OUStringBuffer sValueBuffer;
696 
697  sal_Int32 nValue = 0;
698  bool bValue = false;
699 
700  switch( nContextId )
701  {
704  rProperty.maValue >>= nValue;
705  bValue = (( nValue & chart::ChartAxisMarks::INNER ) == chart::ChartAxisMarks::INNER );
706  ::sax::Converter::convertBool( sValueBuffer, bValue );
707  break;
710  rProperty.maValue >>= nValue;
711  bValue = (( nValue & chart::ChartAxisMarks::OUTER ) == chart::ChartAxisMarks::OUTER );
712  ::sax::Converter::convertBool( sValueBuffer, bValue );
713  break;
715  {
716  // convert from 100th degrees to degrees (double)
717  rProperty.maValue >>= nValue;
718  double fVal = static_cast<double>(nValue) / 100.0;
719  ::sax::Converter::convertDouble( sValueBuffer, fVal );
720  }
721  break;
723  {
724  rProperty.maValue >>= nValue;
725  if( ( nValue & chart::ChartDataCaption::VALUE ) == chart::ChartDataCaption::VALUE )
726  {
727  if( ( nValue & chart::ChartDataCaption::PERCENT ) == chart::ChartDataCaption::PERCENT )
728  {
729  const SvtSaveOptions::ODFSaneDefaultVersion nCurrentVersion(
731  if (nCurrentVersion < SvtSaveOptions::ODFSVER_012)
732  sValueBuffer.append( GetXMLToken( XML_PERCENTAGE ));
733  else
734  sValueBuffer.append( GetXMLToken( XML_VALUE_AND_PERCENTAGE ));
735  }
736  else
737  sValueBuffer.append( GetXMLToken( XML_VALUE ));
738  }
739  else if(( nValue & chart::ChartDataCaption::PERCENT ) == chart::ChartDataCaption::PERCENT )
740  sValueBuffer.append( GetXMLToken( XML_PERCENTAGE ));
741  else
742  sValueBuffer.append( GetXMLToken( XML_NONE ));
743  }
744  break;
746  rProperty.maValue >>= nValue;
747  bValue = (( nValue & chart::ChartDataCaption::TEXT ) == chart::ChartDataCaption::TEXT );
748  ::sax::Converter::convertBool( sValueBuffer, bValue );
749  break;
751  rProperty.maValue >>= nValue;
752  bValue = (( nValue & chart::ChartDataCaption::SYMBOL ) == chart::ChartDataCaption::SYMBOL );
753  ::sax::Converter::convertBool( sValueBuffer, bValue );
754  break;
756  rProperty.maValue >>= nValue;
757  bValue = (( nValue & chart::ChartDataCaption::DATA_SERIES ) == chart::ChartDataCaption::DATA_SERIES );
758  ::sax::Converter::convertBool( sValueBuffer, bValue );
759  break;
762  {
763  awt::Size aSize;
764  rProperty.maValue >>= aSize;
765  rUnitConverter.convertMeasureToXML( sValueBuffer,
767  ? aSize.Width
768  : aSize.Height );
769  }
770  break;
771 
773  {
774  // just for import
775  break;
776  }
777 
779  {
780  OUString aRangeStr;
781  rProperty.maValue >>= aRangeStr;
782  sValueBuffer.append(convertRange(aRangeStr, mxChartDoc));
783  }
784  break;
786  {
787  const SvtSaveOptions::ODFSaneDefaultVersion nCurrentVersion(
789 
790  OUString aServiceName;
791  rProperty.maValue >>= aServiceName;
792  if (aServiceName == "com.sun.star.chart2.LinearRegressionCurve")
793  sValueBuffer.append( GetXMLToken( XML_LINEAR ));
794  else if (aServiceName == "com.sun.star.chart2.LogarithmicRegressionCurve")
795  sValueBuffer.append( GetXMLToken( XML_LOGARITHMIC ));
796  else if (aServiceName == "com.sun.star.chart2.ExponentialRegressionCurve")
797  sValueBuffer.append( GetXMLToken( XML_EXPONENTIAL ));
798  else if (aServiceName == "com.sun.star.chart2.PotentialRegressionCurve")
799  sValueBuffer.append( GetXMLToken( XML_POWER ));
800  else if (nCurrentVersion >= SvtSaveOptions::ODFSVER_013 && aServiceName == "com.sun.star.chart2.PolynomialRegressionCurve")
801  { // ODF 1.3 OFFICE-3958
802  sValueBuffer.append( GetXMLToken( XML_POLYNOMIAL ));
803  }
804  else if (nCurrentVersion >= SvtSaveOptions::ODFSVER_013 && aServiceName == "com.sun.star.chart2.MovingAverageRegressionCurve")
805  { // ODF 1.3 OFFICE-3959
806  sValueBuffer.append( GetXMLToken( XML_MOVING_AVERAGE ));
807  }
808  }
809  break;
810 
812  {
813  rProperty.maValue >>= nValue;
814  if (nValue == MovingAverageType::Prior)
815  sValueBuffer.append( GetXMLToken( XML_PRIOR ));
816  else if (nValue == MovingAverageType::Central)
817  sValueBuffer.append( GetXMLToken( XML_CENTRAL ));
818  else if (nValue == MovingAverageType::AveragedAbscissa)
819  sValueBuffer.append( GetXMLToken( XML_AVERAGED_ABSCISSA ));
820  else // default
821  sValueBuffer.append( GetXMLToken( XML_PRIOR ));
822  }
823  break;
824 
825  default:
826  bHandled = false;
827  break;
828  }
829 
830  if( !sValueBuffer.isEmpty())
831  {
832  OUString sValue = sValueBuffer.makeStringAndClear();
833  sAttrName = rNamespaceMap.GetQNameByKey( nNameSpace, sAttrName );
834  rAttrList.AddAttribute( sAttrName, sValue );
835  }
836  }
837 
838  if( !bHandled )
839  {
840  // call parent
841  SvXMLExportPropertyMapper::handleSpecialItem( rAttrList, rProperty, rUnitConverter, rNamespaceMap, pProperties, nIdx );
842  }
843 }
844 
845 void XMLChartExportPropertyMapper::setChartDoc( const uno::Reference< chart2::XChartDocument >& xChartDoc )
846 {
847  mxChartDoc = xChartDoc;
848 }
849 
851  const SvXMLImport& _rImport ) :
852  SvXMLImportPropertyMapper( rMapper, const_cast< SvXMLImport & >( _rImport )),
853  mrImport( const_cast< SvXMLImport & > ( _rImport ))
854 {
855  // chain shape mapper for drawing properties
856 
857  // give an empty model. It is only used for numbering rules that don't exist in chart
858  uno::Reference< frame::XModel > xEmptyModel;
860 
861  //#i14365# save and load writing-mode for chart elements
862  //The property TextWritingMode is mapped wrongly in the underlying draw mapper, but for draw it is necessary
863  //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')
864  sal_Int32 nUnwantedWrongEntry = maPropMapper->FindEntryIndex( "TextWritingMode", XML_NAMESPACE_STYLE, GetXMLToken(XML_WRITING_MODE) );
865  maPropMapper->RemoveEntry(nUnwantedWrongEntry);
866 
867  // do not chain text properties: on import this is done by shape mapper
868  // to import old documents
869 }
870 
872 {
873 }
874 
876  XMLPropertyState& rProperty,
877  ::std::vector< XMLPropertyState >& rProperties,
878  const OUString& rValue,
879  const SvXMLUnitConverter& rUnitConverter,
880  const SvXMLNamespaceMap& rNamespaceMap ) const
881 {
882  sal_Int32 nContextId = maPropMapper->GetEntryContextId( rProperty.mnIndex );
883  bool bRet = (nContextId != 0);
884 
885  if( nContextId )
886  {
887  sal_Int32 nValue = 0;
888  bool bValue = false;
889 
890  switch( nContextId )
891  {
894  (void)::sax::Converter::convertBool( bValue, rValue );
895  // modify old value
896  rProperty.maValue >>= nValue;
897  if( bValue )
898  SCH_XML_SETFLAG( nValue, chart::ChartAxisMarks::INNER );
899  else
900  SCH_XML_UNSETFLAG( nValue, chart::ChartAxisMarks::INNER );
901  rProperty.maValue <<= nValue;
902  break;
905  (void)::sax::Converter::convertBool( bValue, rValue );
906  // modify old value
907  rProperty.maValue >>= nValue;
908  if( bValue )
909  SCH_XML_SETFLAG( nValue, chart::ChartAxisMarks::OUTER );
910  else
911  SCH_XML_UNSETFLAG( nValue, chart::ChartAxisMarks::OUTER );
912  rProperty.maValue <<= nValue;
913  break;
915  {
916  // convert from degrees (double) to 100th degrees (integer)
917  double fVal;
918  ::sax::Converter::convertDouble( fVal, rValue );
919  nValue = static_cast<sal_Int32>( fVal * 100.0 );
920  rProperty.maValue <<= nValue;
921  }
922  break;
924  {
925  // modify old value
926  rProperty.maValue >>= nValue;
927  if( IsXMLToken( rValue, XML_NONE ))
928  SCH_XML_UNSETFLAG( nValue, chart::ChartDataCaption::VALUE | chart::ChartDataCaption::PERCENT );
929  else if( IsXMLToken( rValue, XML_VALUE_AND_PERCENTAGE ) )
930  SCH_XML_SETFLAG( nValue, chart::ChartDataCaption::VALUE | chart::ChartDataCaption::PERCENT );
931  else if( IsXMLToken( rValue, XML_VALUE ) )
932  SCH_XML_SETFLAG( nValue, chart::ChartDataCaption::VALUE );
933  else // must be XML_PERCENTAGE
934  SCH_XML_SETFLAG( nValue, chart::ChartDataCaption::PERCENT );
935  rProperty.maValue <<= nValue;
936  }
937  break;
939  rProperty.maValue >>= nValue;
940  (void)::sax::Converter::convertBool( bValue, rValue );
941  if( bValue )
942  SCH_XML_SETFLAG( nValue, chart::ChartDataCaption::TEXT );
943  else
944  SCH_XML_UNSETFLAG( nValue, chart::ChartDataCaption::TEXT );
945  rProperty.maValue <<= nValue;
946  break;
948  rProperty.maValue >>= nValue;
949  (void)::sax::Converter::convertBool( bValue, rValue );
950  if( bValue )
951  SCH_XML_SETFLAG( nValue, chart::ChartDataCaption::SYMBOL );
952  else
953  SCH_XML_UNSETFLAG( nValue, chart::ChartDataCaption::SYMBOL );
954  rProperty.maValue <<= nValue;
955  break;
957  rProperty.maValue >>= nValue;
958  (void)::sax::Converter::convertBool( bValue, rValue );
959  if( bValue )
960  SCH_XML_SETFLAG( nValue, chart::ChartDataCaption::DATA_SERIES );
961  else
962  SCH_XML_UNSETFLAG( nValue, chart::ChartDataCaption::DATA_SERIES );
963  rProperty.maValue <<= nValue;
964  break;
967  {
968  awt::Size aSize;
969  rProperty.maValue >>= aSize;
970  rUnitConverter.convertMeasureToCore(
972  ? aSize.Width
973  : aSize.Height,
974  rValue );
975  rProperty.maValue <<= aSize;
976  }
977  break;
978 
980  {
981  rProperty.maValue <<= rValue;
982  }
983  break;
984 
985  // deprecated from 6.0 beta on
987  rProperty.maValue <<= mrImport.loadGraphicByURL(rValue);
988  break;
989 
991  {
992  if (IsXMLToken( rValue, XML_LINEAR ))
993  rProperty.maValue <<= OUString("com.sun.star.chart2.LinearRegressionCurve");
994  else if (IsXMLToken( rValue, XML_LOGARITHMIC))
995  rProperty.maValue <<= OUString("com.sun.star.chart2.LogarithmicRegressionCurve");
996  else if (IsXMLToken( rValue, XML_EXPONENTIAL))
997  rProperty.maValue <<= OUString("com.sun.star.chart2.ExponentialRegressionCurve");
998  else if (IsXMLToken( rValue, XML_POWER))
999  rProperty.maValue <<= OUString("com.sun.star.chart2.PotentialRegressionCurve");
1000  else if (IsXMLToken( rValue, XML_POLYNOMIAL))
1001  rProperty.maValue <<= OUString("com.sun.star.chart2.PolynomialRegressionCurve");
1002  else if (IsXMLToken( rValue, XML_MOVING_AVERAGE))
1003  rProperty.maValue <<= OUString("com.sun.star.chart2.MovingAverageRegressionCurve");
1004  }
1005  break;
1006 
1008  {
1009  if (IsXMLToken( rValue, XML_PRIOR ))
1010  rProperty.maValue <<= MovingAverageType::Prior;
1011  else if (IsXMLToken( rValue, XML_CENTRAL))
1012  rProperty.maValue <<= MovingAverageType::Central;
1013  else if (IsXMLToken( rValue, XML_AVERAGED_ABSCISSA))
1014  rProperty.maValue <<= MovingAverageType::AveragedAbscissa;
1015  else // default
1016  rProperty.maValue <<= MovingAverageType::Prior;
1017  }
1018  break;
1019 
1020  default:
1021  bRet = false;
1022  break;
1023  }
1024  }
1025 
1026  // if we didn't handle it, the parent should
1027  if( !bRet )
1028  {
1029  // call parent
1030  bRet = SvXMLImportPropertyMapper::handleSpecialItem( rProperty, rProperties, rValue, rUnitConverter, rNamespaceMap );
1031  }
1032 
1033  return bRet;
1034 }
1035 
1036 void XMLChartImportPropertyMapper::finished( ::std::vector< XMLPropertyState >& /*rProperties*/, sal_Int32 /*nStartIndex*/, sal_Int32 /*nEndIndex*/ ) const
1037 {
1038 }
1039 
1040 /* 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.
const SvXMLEnumMapEntry< css::chart::ChartAxisLabelPosition > aXMLChartAxisLabelPositionEnumMap[]
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
#define XML_TYPE_DOUBLE
Definition: xmltypes.hxx:138
constexpr sal_uInt16 XML_NAMESPACE_CHART
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:141
constexpr sal_uInt16 XML_NAMESPACE_LO_EXT
bool IsXMLToken(std::u16string_view rString, enum XMLTokenEnum eToken)
compare eToken to the string
Definition: xmltoken.cxx:3567
const SvXMLEnumMapEntry< sal_Int32 > aXMLChartMissingValueTreatmentEnumMap[]
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:1285
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
const SvXMLEnumMapEntry< sal_Int32 > g_XMLChartInterpolationTypeEnumMap_ODF12[]
#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 MAP_ENTRY(a, ns, nm, t)
#define MID_FLAG_MERGE_ATTRIBUTE
Definition: xmltypes.hxx:57
#define XML_TYPE_STYLENAME
Definition: xmltypes.hxx:150
#define XML_SCH_CONTEXT_SPECIAL_TICKS_MAJ_INNER
Definition: PropertyMap.hxx:68
#define MAP_ENTRY_ODF_EXT(a, ns, nm, t)
#define XML_SCH_CONTEXT_SPECIAL_SYMBOL_IMAGE
Definition: PropertyMap.hxx:81
#define XML_SCH_TYPE_SOLID_TYPE
Definition: PropertyMap.hxx:39
#define XML_SCH_CONTEXT_LOGARITHMIC
Definition: PropertyMap.hxx:64
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 MAP_SPECIAL_ODF13(a, ns, nm, t, c)
const SvXMLEnumMapEntry< css::chart::ChartAxisArrangeOrderType > aXMLChartAxisArrangementEnumMap[]
void AddAttribute(sal_uInt16 nPrefix, const OUString &rName, const OUString &rValue)
Definition: xmlexp.cxx:911
#define XML_SCH_CONTEXT_SPECIAL_TEXT_ROTATION
Definition: PropertyMap.hxx:72
#define XML_SCH_TYPE_LABEL_BORDER_OPACITY
Definition: PropertyMap.hxx:54
#define XML_SCH_CONTEXT_SPECIAL_SYMBOL_IMAGE_NAME
Definition: PropertyMap.hxx:80
virtual ~XMLChartPropHdlFactory() override
#define MID_FLAG_MULTI_PROPERTY
Definition: xmltypes.hxx:64
#define MAP_ENTRY_ODF12(a, ns, nm, t)
#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:1843
#define MID_FLAG_ELEMENT_ITEM
Definition: xmltypes.hxx:70
#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 ...
#define MAP_CONTEXT(a, ns, nm, t, c)
const SvXMLEnumMapEntry< sal_Int32 > aXMLChartSolidTypeEnumMap[]
SvtSaveOptions::ODFSaneDefaultVersion getSaneDefaultVersion() const
returns the deterministic version for odf export
Definition: xmlexp.cxx:2272
#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:347
#define MAP_ENTRY_ODF13(a, ns, nm, t)
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_TYPE_ATTRIBUTE_CONTAINER
Definition: xmltypes.hxx:219
#define MAP_SPECIAL_ODF12(a, ns, nm, t, c)
Represents a property with its API-name, its XML-name and the type of its value.
Definition: maptype.hxx:31
#define XML_TYPE_NUMBER
Definition: xmltypes.hxx:134
#define XML_SCH_TYPE_LABEL_FILL_STYLE
Definition: PropertyMap.hxx:55
rtl::Reference< XMLPropertySetMapper > maPropMapper
Definition: xmlimppr.hxx:75
#define MID_FLAG_SPECIAL_ITEM
Definition: xmltypes.hxx:87
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 MID_FLAG_MERGE_PROPERTY
Definition: xmltypes.hxx:61
const XMLPropertyMapEntry aXMLChartPropMap[]
#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
#define XML_TYPE_STRING
Definition: xmltypes.hxx:132
const SvXMLEnumMapEntry< sal_Int32 > aXMLChartDataLabelPlacementEnumMap[]
#define MAP_FULL(ApiName, NameSpace, XMLTokenName, XMLType, ContextId, EarliestODFVersionForExport)
css::uno::Any maValue
Definition: maptype.hxx:142
XMLChartPropHdlFactory(SvXMLExport const *)
#define XML_SCH_CONTEXT_SPECIAL_REGRESSION_TYPE
Definition: PropertyMap.hxx:84
#define MAP_ENTRY_ODF_EXT_IMPORT(a, ns, nm, t)
XMLChartPropertySetMapper(SvXMLExport const *pExport)
SvXmlExportFlags
Definition: xmlexppr.hxx:39
const OUString & GetXMLToken(enum XMLTokenEnum eToken)
return the OUString representation for eToken
Definition: xmltoken.cxx:3511
#define SCH_XML_UNSETFLAG(status, flag)
Handling of tokens in XML:
const SvXMLEnumMapEntry< css::chart::ChartDataRowSource > aXMLChartDataRowSourceTypeEnumMap[]
#define MAP_ENTRY_END
#define XML_TYPE_MEASURE
Definition: xmltypes.hxx:126
#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:139
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
#define MAP_SPECIAL(a, ns, nm, t, c)
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:1880
#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:1318
Abstract base-class for different XML-types.
Definition: xmlprhdl.hxx:35
#define XML_TYPE_BOOL
Definition: xmltypes.hxx:125
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
const SvXMLEnumMapEntry< sal_Int32 > g_XMLChartInterpolationTypeEnumMap[]
#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
const SvXMLEnumMapEntry< sal_Int32 > aXMLChartErrorBarStyleEnumMap[]
#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:478
#define XML_SCH_TYPE_MISSING_VALUE_TREATMENT
Definition: PropertyMap.hxx:48
css::uno::Reference< css::chart2::XChartDocument > mxChartDoc
TEXT
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
const SvXMLEnumMapEntry< css::chart::ChartAxisMarkPosition > aXMLChartAxisMarkPositionEnumMap[]
#define XML_TYPE_COLOR
Definition: xmltypes.hxx:133
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