LibreOffice Module sc (master)  1
xlchart.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 <xlchart.hxx>
21 
22 #include <com/sun/star/container/XNameContainer.hpp>
23 #include <com/sun/star/awt/Size.hpp>
24 #include <com/sun/star/awt/Gradient.hpp>
25 #include <com/sun/star/drawing/Hatch.hpp>
26 #include <com/sun/star/drawing/LineDash.hpp>
27 #include <com/sun/star/drawing/LineStyle.hpp>
28 #include <com/sun/star/drawing/FillStyle.hpp>
29 #include <com/sun/star/drawing/BitmapMode.hpp>
30 #include <com/sun/star/chart/DataLabelPlacement.hpp>
31 #include <com/sun/star/chart/XAxisXSupplier.hpp>
32 #include <com/sun/star/chart/XAxisYSupplier.hpp>
33 #include <com/sun/star/chart/XAxisZSupplier.hpp>
34 #include <com/sun/star/chart/XChartDocument.hpp>
35 #include <com/sun/star/chart/XSecondAxisTitleSupplier.hpp>
36 #include <com/sun/star/chart2/Symbol.hpp>
37 #include <com/sun/star/chart2/XChartDocument.hpp>
38 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
39 
40 #include <rtl/math.hxx>
41 #include <sal/macros.h>
42 #include <svl/itemset.hxx>
43 #include <svx/xfillit0.hxx>
44 #include <svx/xflclit.hxx>
45 #include <svx/xfltrit.hxx>
46 #include <svx/xflgrit.hxx>
47 #include <svx/xbtmpit.hxx>
48 #include <svx/unomid.hxx>
50 #include <xlroot.hxx>
51 #include <xlstyle.hxx>
52 #include <xltools.hxx>
53 
54 using namespace css;
55 
56 // Common =====================================================================
57 
59  mnX( 0 ),
60  mnY( 0 ),
61  mnWidth( 0 ),
62  mnHeight( 0 )
63 {
64 }
65 
66 XclChDataPointPos::XclChDataPointPos( sal_uInt16 nSeriesIdx, sal_uInt16 nPointIdx ) :
67  mnSeriesIdx( nSeriesIdx ),
68  mnPointIdx( nPointIdx )
69 {
70 }
71 
72 bool operator<( const XclChDataPointPos& rL, const XclChDataPointPos& rR )
73 {
74  return (rL.mnSeriesIdx < rR.mnSeriesIdx) ||
75  ((rL.mnSeriesIdx == rR.mnSeriesIdx) && (rL.mnPointIdx < rR.mnPointIdx));
76 }
77 
79  mnType( nType ),
80  mnContext( 0 ),
81  mnValue1( 0 ),
82  mnValue2( 0 )
83 {
84 }
85 
86 // Frame formatting ===========================================================
87 
89  mnTLMode( EXC_CHFRAMEPOS_PARENT ),
90  mnBRMode( EXC_CHFRAMEPOS_PARENT )
91 {
92 }
93 
95  maColor( COL_BLACK ),
96  mnPattern( EXC_CHLINEFORMAT_SOLID ),
99 {
100 }
101 
103  maPattColor( COL_WHITE ),
104  maBackColor( COL_BLACK ),
105  mnPattern( EXC_PATT_SOLID ),
107 {
108 }
109 
111 {
112 }
113 
115 {
116 }
117 
119  mnBmpMode( EXC_CHPICFORMAT_NONE ),
121  mfScale( 0.5 )
122 {
123 }
124 
126  mnFormat( EXC_CHFRAME_STANDARD ),
128 {
129 }
130 
131 // Source links ===============================================================
132 
134  mnDestType( EXC_CHSRCLINK_TITLE ),
135  mnLinkType( EXC_CHSRCLINK_DEFAULT ),
136  mnFlags( 0 ),
137  mnNumFmtIdx( 0 )
138 {
139 }
140 
141 // Text =======================================================================
142 
144  mnTarget( EXC_CHOBJLINK_NONE )
145 {
146 }
147 
149  mnFlags( 0 )
150 {
151 }
152 
154  maTextColor( COL_BLACK ),
155  mnHAlign( EXC_CHTEXT_ALIGN_CENTER ),
156  mnVAlign( EXC_CHTEXT_ALIGN_CENTER ),
157  mnBackMode( EXC_CHTEXT_TRANSPARENT ),
159  mnFlags2( EXC_CHTEXT_POS_DEFAULT ),
160  mnRotation( EXC_ROT_NONE )
161 {
162 }
163 
164 // Data series ================================================================
165 
167  maLineColor( COL_BLACK ),
169  mnMarkerSize( EXC_CHMARKERFORMAT_SINGLESIZE ),
170  mnMarkerType( EXC_CHMARKERFORMAT_NOSYMBOL ),
172 {
173 };
174 
176  mnBase( EXC_CH3DDATAFORMAT_RECT ),
178 {
179 }
180 
182  mnFormatIdx( EXC_CHDATAFORMAT_DEFAULT ),
183  mnFlags( 0 )
184 {
185 }
186 
188  mfForecastFor( 0.0 ),
189  mfForecastBack( 0.0 ),
190  mnLineType( EXC_CHSERTREND_POLYNOMIAL ),
191  mnOrder( 1 ),
192  mnShowEquation( 0 ),
193  mnShowRSquared( 0 )
194 {
195  /* Set all bits in mfIntercept to 1 (that is -1.#NAN) to indicate that
196  there is no interception point. Cannot use ::rtl::math::setNan() here
197  cause it misses the sign bit. */
198  sal_math_Double* pDouble = reinterpret_cast< sal_math_Double* >( &mfIntercept );
199  pDouble->w32_parts.msw = pDouble->w32_parts.lsw = 0xFFFFFFFF;
200 }
201 
203  mfValue( 0.0 ),
204  mnValueCount( 1 ),
205  mnBarType( EXC_CHSERERR_NONE ),
206  mnSourceType( EXC_CHSERERR_FIXED ),
207  mnLineEnd( EXC_CHSERERR_END_TSHAPE )
208 {
209 }
210 
212  mnCategType( EXC_CHSERIES_NUMERIC ),
214  mnBubbleType( EXC_CHSERIES_NUMERIC ),
215  mnCategCount( 0 ),
216  mnValueCount( 0 ),
217  mnBubbleCount( 0 )
218 {
219 }
220 
221 // Chart type groups ==========================================================
222 
224  mnOverlap( 0 ),
225  mnGap( 150 ),
226  mnRotation( 0 ),
227  mnPieHole( 0 ),
228  mnBubbleSize( 100 ),
229  mnBubbleType( EXC_CHSCATTER_AREA ),
230  mnFlags( 0 )
231 {
232 }
233 
235  mnRotation( 20 ),
236  mnElevation( 15 ),
237  mnEyeDist( 30 ),
238  mnRelHeight( 100 ),
239  mnRelDepth( 100 ),
240  mnDepthGap( 150 ),
242 {
243 }
244 
246  mnDockMode( EXC_CHLEGEND_RIGHT ),
247  mnSpacing( EXC_CHLEGEND_MEDIUM ),
250 {
251 }
252 
254  mnFlags( 0 ),
255  mnGroupIdx( EXC_CHSERGROUP_NONE )
256 {
257 }
258 
260  mnFlags( 0 ),
261  mnEmptyMode( EXC_CHPROPS_EMPTY_SKIP )
262 {
263 }
264 
265 // Axes =======================================================================
266 
268  mnCross( 1 ),
269  mnLabelFreq( 1 ),
270  mnTickFreq( 1 ),
271  mnFlags( 0 )
272 {
273 }
274 
276  mnMinDate( 0 ),
277  mnMaxDate( 0 ),
278  mnMajorStep( 0 ),
279  mnMajorUnit( EXC_CHDATERANGE_DAYS ),
280  mnMinorStep( 0 ),
281  mnMinorUnit( EXC_CHDATERANGE_DAYS ),
282  mnBaseUnit( EXC_CHDATERANGE_DAYS ),
283  mnCross( 0 ),
288 {
289 }
290 
292  mfMin( 0.0 ),
293  mfMax( 0.0 ),
294  mfMajorStep( 0.0 ),
295  mfMinorStep( 0.0 ),
296  mfCross( 0.0 ),
300 {
301 }
302 
304  maTextColor( COL_BLACK ),
306  mnMinor( 0 ),
307  mnLabelPos( EXC_CHTICK_NEXT ),
308  mnBackMode( EXC_CHTICK_TRANSPARENT ),
310  mnRotation( EXC_ROT_NONE )
311 {
312 }
313 
316 {
317 }
318 
320 {
321  sal_Int32 nApiAxisDim = EXC_CHART_AXIS_NONE;
322  switch( mnType )
323  {
324  case EXC_CHAXIS_X: nApiAxisDim = EXC_CHART_AXIS_X; break;
325  case EXC_CHAXIS_Y: nApiAxisDim = EXC_CHART_AXIS_Y; break;
326  case EXC_CHAXIS_Z: nApiAxisDim = EXC_CHART_AXIS_Z; break;
327  }
328  return nApiAxisDim;
329 }
330 
332  mnAxesSetId( EXC_CHAXESSET_PRIMARY )
333 {
334 }
335 
337 {
338  sal_Int32 nApiAxesSetIdx = EXC_CHART_AXESSET_NONE;
339  switch( mnAxesSetId )
340  {
341  case EXC_CHAXESSET_PRIMARY: nApiAxesSetIdx = EXC_CHART_AXESSET_PRIMARY; break;
342  case EXC_CHAXESSET_SECONDARY: nApiAxesSetIdx = EXC_CHART_AXESSET_SECONDARY; break;
343  }
344  return nApiAxesSetIdx;
345 }
346 
347 // Static helper functions ====================================================
348 
349 sal_uInt16 XclChartHelper::GetSeriesLineAutoColorIdx( sal_uInt16 nFormatIdx )
350 {
351  static const sal_uInt16 spnLineColors[] =
352  {
353  32, 33, 34, 35, 36, 37, 38, 39,
354  40, 41, 42, 43, 44, 45, 46, 47,
355  48, 49, 50, 51, 52, 53, 54, 55,
356  56, 57, 58, 59, 60, 61, 62, 8,
357  9, 10, 11, 12, 13, 14, 15, 16,
358  17, 18, 19, 20, 21, 22, 23, 24,
359  25, 26, 27, 28, 29, 30, 31, 63
360  };
361  return spnLineColors[ nFormatIdx % SAL_N_ELEMENTS( spnLineColors ) ];
362 }
363 
364 sal_uInt16 XclChartHelper::GetSeriesFillAutoColorIdx( sal_uInt16 nFormatIdx )
365 {
366  static const sal_uInt16 spnFillColors[] =
367  {
368  24, 25, 26, 27, 28, 29, 30, 31,
369  32, 33, 34, 35, 36, 37, 38, 39,
370  40, 41, 42, 43, 44, 45, 46, 47,
371  48, 49, 50, 51, 52, 53, 54, 55,
372  56, 57, 58, 59, 60, 61, 62, 63,
373  8, 9, 10, 11, 12, 13, 14, 15,
374  16, 17, 18, 19, 20, 21, 22, 23
375  };
376  return spnFillColors[ nFormatIdx % SAL_N_ELEMENTS( spnFillColors ) ];
377 }
378 
380 {
381  static const sal_uInt8 spnTrans[] = { 0x00, 0x40, 0x20, 0x60, 0x70 };
382  return spnTrans[ (nFormatIdx / 56) % SAL_N_ELEMENTS( spnTrans ) ];
383 }
384 
385 sal_uInt16 XclChartHelper::GetAutoMarkerType( sal_uInt16 nFormatIdx )
386 {
387  static const sal_uInt16 spnSymbols[] = {
391  return spnSymbols[ nFormatIdx % SAL_N_ELEMENTS( spnSymbols ) ];
392 }
393 
394 bool XclChartHelper::HasMarkerFillColor( sal_uInt16 nMarkerType )
395 {
396  static const bool spbFilled[] = {
397  false, true, true, true, false, false, false, false, true, false };
398  return (nMarkerType < SAL_N_ELEMENTS( spbFilled )) && spbFilled[ nMarkerType ];
399 }
400 
402 {
403  switch( nBarType )
404  {
409  default: OSL_FAIL( "XclChartHelper::GetErrorBarValuesRole - unknown bar type" );
410  }
411  return OUString();
412 }
413 
414 // Chart formatting info provider =============================================
415 
416 namespace {
417 
418 const XclChFormatInfo spFmtInfos[] =
419 {
420  // object type property mode auto line color auto line weight auto pattern color missing frame type create delete isframe
437 };
438 
439 }
440 
442 {
443  for(auto const &rIt : spFmtInfos)
444  maInfoMap[ rIt.meObjType ] = &rIt;
445 }
446 
448 {
449  XclFmtInfoMap::const_iterator aIt = maInfoMap.find( eObjType );
450  OSL_ENSURE( aIt != maInfoMap.end(), "XclChFormatInfoProvider::GetFormatInfo - unknown object type" );
451  return (aIt == maInfoMap.end()) ? *spFmtInfos : *aIt->second;
452 }
453 
454 // Chart type info provider ===================================================
455 
456 namespace {
457 
458 // chart type service names
459 const char SERVICE_CHART2_AREA[] = "com.sun.star.chart2.AreaChartType";
460 const char SERVICE_CHART2_CANDLE[] = "com.sun.star.chart2.CandleStickChartType";
461 const char SERVICE_CHART2_COLUMN[] = "com.sun.star.chart2.ColumnChartType";
462 const char SERVICE_CHART2_LINE[] = "com.sun.star.chart2.LineChartType";
463 const char SERVICE_CHART2_NET[] = "com.sun.star.chart2.NetChartType";
464 const char SERVICE_CHART2_FILLEDNET[] = "com.sun.star.chart2.FilledNetChartType";
465 const char SERVICE_CHART2_PIE[] = "com.sun.star.chart2.PieChartType";
466 const char SERVICE_CHART2_SCATTER[] = "com.sun.star.chart2.ScatterChartType";
467 const char SERVICE_CHART2_BUBBLE[] = "com.sun.star.chart2.BubbleChartType";
468 const char SERVICE_CHART2_SURFACE[] = "com.sun.star.chart2.ColumnChartType"; // Todo
469 
470 namespace csscd = css::chart::DataLabelPlacement;
471 
472 const XclChTypeInfo spTypeInfos[] =
473 {
474  // chart type chart type category record id service varied point color def label pos comb2d 3d polar area2d area3d 1stvis xcateg swap stack revers betw
475  { EXC_CHTYPEID_BAR, EXC_CHTYPECATEG_BAR, EXC_ID_CHBAR, SERVICE_CHART2_COLUMN, EXC_CHVARPOINT_SINGLE, csscd::OUTSIDE, true, true, false, true, true, false, true, false, true, false, true },
476  { EXC_CHTYPEID_HORBAR, EXC_CHTYPECATEG_BAR, EXC_ID_CHBAR, SERVICE_CHART2_COLUMN, EXC_CHVARPOINT_SINGLE, csscd::OUTSIDE, false, true, false, true, true, false, true, true, true, false, true },
477  { EXC_CHTYPEID_LINE, EXC_CHTYPECATEG_LINE, EXC_ID_CHLINE, SERVICE_CHART2_LINE, EXC_CHVARPOINT_SINGLE, csscd::RIGHT, true, true, false, false, true, false, true, false, true, false, false },
478  { EXC_CHTYPEID_AREA, EXC_CHTYPECATEG_LINE, EXC_ID_CHAREA, SERVICE_CHART2_AREA, EXC_CHVARPOINT_NONE, csscd::CENTER, true, true, false, true, true, false, true, false, true, true, false },
479  { EXC_CHTYPEID_STOCK, EXC_CHTYPECATEG_LINE, EXC_ID_CHLINE, SERVICE_CHART2_CANDLE, EXC_CHVARPOINT_NONE, csscd::RIGHT, true, false, false, false, false, false, true, false, true, false, false },
480  { EXC_CHTYPEID_RADARLINE, EXC_CHTYPECATEG_RADAR, EXC_ID_CHRADARLINE, SERVICE_CHART2_NET, EXC_CHVARPOINT_SINGLE, csscd::TOP, false, false, true, false, true, false, true, false, false, false, false },
481  { EXC_CHTYPEID_RADARAREA, EXC_CHTYPECATEG_RADAR, EXC_ID_CHRADARAREA, SERVICE_CHART2_FILLEDNET, EXC_CHVARPOINT_NONE, csscd::TOP, false, false, true, true, true, false, true, false, false, true, false },
482  { EXC_CHTYPEID_PIE, EXC_CHTYPECATEG_PIE, EXC_ID_CHPIE, SERVICE_CHART2_PIE, EXC_CHVARPOINT_MULTI, csscd::AVOID_OVERLAP, false, true, true, true, true, true, true, false, false, false, false },
483  { EXC_CHTYPEID_DONUT, EXC_CHTYPECATEG_PIE, EXC_ID_CHPIE, SERVICE_CHART2_PIE, EXC_CHVARPOINT_MULTI, csscd::AVOID_OVERLAP, false, true, true, true, true, false, true, false, false, false, false },
484  { EXC_CHTYPEID_PIEEXT, EXC_CHTYPECATEG_PIE, EXC_ID_CHPIEEXT, SERVICE_CHART2_PIE, EXC_CHVARPOINT_MULTI, csscd::AVOID_OVERLAP, false, false, true, true, true, true, true, false, false, false, false },
485  { EXC_CHTYPEID_SCATTER, EXC_CHTYPECATEG_SCATTER, EXC_ID_CHSCATTER, SERVICE_CHART2_SCATTER, EXC_CHVARPOINT_SINGLE, csscd::RIGHT, true, false, false, false, true, false, false, false, false, false, false },
486  { EXC_CHTYPEID_BUBBLES, EXC_CHTYPECATEG_SCATTER, EXC_ID_CHSCATTER, SERVICE_CHART2_BUBBLE, EXC_CHVARPOINT_SINGLE, csscd::RIGHT, false, false, false, true, true, false, false, false, false, false, false },
487  { EXC_CHTYPEID_SURFACE, EXC_CHTYPECATEG_SURFACE, EXC_ID_CHSURFACE, SERVICE_CHART2_SURFACE, EXC_CHVARPOINT_NONE, csscd::RIGHT, false, true, false, true, true, false, true, false, false, false, false },
488  { EXC_CHTYPEID_UNKNOWN, EXC_CHTYPECATEG_BAR, EXC_ID_CHBAR, SERVICE_CHART2_COLUMN, EXC_CHVARPOINT_SINGLE, csscd::OUTSIDE, true, true, false, true, true, false, true, false, true, false, true }
489 };
490 
491 } // namespace
492 
494  XclChTypeInfo( rTypeInfo ),
495  mb3dChart( false ),
496  mbSpline( false )
497 {
498 }
499 
500 void XclChExtTypeInfo::Set( const XclChTypeInfo& rTypeInfo, bool b3dChart, bool bSpline )
501 {
502  static_cast< XclChTypeInfo& >( *this ) = rTypeInfo;
503  mb3dChart = mbSupports3d && b3dChart;
504  mbSpline = bSpline;
505 }
506 
508 {
509  for(const auto &rIt : spTypeInfos)
510  maInfoMap[ rIt.meTypeId ] = &rIt;
511 }
512 
514 {
515  XclChTypeInfoMap::const_iterator aIt = maInfoMap.find( eTypeId );
516  OSL_ENSURE( aIt != maInfoMap.end(), "XclChTypeInfoProvider::GetTypeInfo - unknown chart type" );
517  return (aIt == maInfoMap.end()) ? *maInfoMap.rbegin()->second : *aIt->second;
518 }
519 
521 {
522  for(const auto &rIt : spTypeInfos)
523  {
524  if(rIt.mnRecId == nRecId)
525  return rIt;
526  }
527  OSL_FAIL( "XclChTypeInfoProvider::GetTypeInfoFromRecId - unknown record id" );
529 }
530 
531 const XclChTypeInfo& XclChTypeInfoProvider::GetTypeInfoFromService( const OUString& rServiceName ) const
532 {
533  for(auto const &rIt : spTypeInfos)
534  if( rServiceName.equalsAscii( rIt.mpcServiceName ) )
535  return rIt;
536  OSL_FAIL( "XclChTypeInfoProvider::GetTypeInfoFromService - unknown service name" );
538 }
539 
540 // Property helpers ===========================================================
541 
542 XclChObjectTable::XclChObjectTable(uno::Reference<lang::XMultiServiceFactory> const & xFactory,
543  const OUString& rServiceName, const OUString& rObjNameBase ) :
544  mxFactory( xFactory ),
545  maServiceName( rServiceName ),
546  maObjNameBase( rObjNameBase ),
547  mnIndex( 0 )
548 {
549 }
550 
551 uno::Any XclChObjectTable::GetObject( const OUString& rObjName )
552 {
553  // get object table
554  if( !mxContainer.is() )
556  OSL_ENSURE( mxContainer.is(), "XclChObjectTable::GetObject - container not found" );
557 
558  uno::Any aObj;
559  if( mxContainer.is() )
560  {
561  // get object from container
562  try
563  {
564  aObj = mxContainer->getByName( rObjName );
565  }
566  catch (uno::Exception &)
567  {
568  OSL_FAIL( "XclChObjectTable::GetObject - object not found" );
569  }
570  }
571  return aObj;
572 }
573 
575 {
576 
577  // create object table
578  if( !mxContainer.is() )
580  OSL_ENSURE( mxContainer.is(), "XclChObjectTable::InsertObject - container not found" );
581 
582  OUString aObjName;
583  if( mxContainer.is() )
584  {
585  // create new unused identifier
586  do
587  {
588  aObjName = maObjNameBase + OUString::number( ++mnIndex );
589  }
590  while( mxContainer->hasByName( aObjName ) );
591 
592  // insert object
593  try
594  {
595  mxContainer->insertByName( aObjName, rObj );
596  }
597  catch (uno::Exception &)
598  {
599  OSL_FAIL( "XclChObjectTable::InsertObject - cannot insert object" );
600  aObjName.clear();
601  }
602  }
603  return aObjName;
604 }
605 
606 // Property names -------------------------------------------------------------
607 
608 namespace {
609 
611 const char* const sppcLineNamesCommon[] =
612  { "LineStyle", "LineWidth", "LineColor", "LineTransparence", "LineDashName", nullptr };
614 const char* const sppcLineNamesLinear[] =
615  { "LineStyle", "LineWidth", "Color", "Transparency", "LineDashName", nullptr };
617 const char* const sppcLineNamesFilled[] =
618  { "BorderStyle", "BorderWidth", "BorderColor", "BorderTransparency", "BorderDashName", nullptr };
619 
621 const char* const sppcAreaNamesCommon[] = { "FillStyle", "FillColor", "FillTransparence", nullptr };
623 const char* const sppcAreaNamesFilled[] = { "FillStyle", "Color", "Transparency", nullptr };
625 const char* const sppcGradNamesCommon[] = { "FillStyle", "FillGradientName", nullptr };
627 const char* const sppcGradNamesFilled[] = { "FillStyle", "GradientName", nullptr };
629 const char* const sppcHatchNamesCommon[] = { "FillStyle", "FillHatchName", "FillColor", "FillBackground", nullptr };
631 const char* const sppcHatchNamesFilled[] = { "FillStyle", "HatchName", "Color", "FillBackground", nullptr };
633 const char* const sppcBitmapNames[] = { "FillStyle", "FillBitmapName", "FillBitmapMode", nullptr };
634 
635 } // namespace
636 
638  maLineHlpCommon( sppcLineNamesCommon ),
639  maLineHlpLinear( sppcLineNamesLinear ),
640  maLineHlpFilled( sppcLineNamesFilled ),
641  maAreaHlpCommon( sppcAreaNamesCommon ),
642  maAreaHlpFilled( sppcAreaNamesFilled ),
643  maGradHlpCommon( sppcGradNamesCommon ),
644  maGradHlpFilled( sppcGradNamesFilled ),
645  maHatchHlpCommon( sppcHatchNamesCommon ),
646  maHatchHlpFilled( sppcHatchNamesFilled ),
647  maBitmapHlp( sppcBitmapNames )
648 {
649 }
650 
651 // read properties ------------------------------------------------------------
652 
654  XclChLineFormat& rLineFmt, XclChObjectTable& rDashTable,
655  const ScfPropertySet& rPropSet, XclChPropertyMode ePropMode )
656 {
657  // read properties from property set
658  drawing::LineStyle eApiStyle = drawing::LineStyle_NONE;
659  sal_Int32 nApiWidth = 0;
660  sal_Int16 nApiTrans = 0;
661  uno::Any aDashNameAny;
662 
663  ScfPropSetHelper& rLineHlp = GetLineHelper( ePropMode );
664  rLineHlp.ReadFromPropertySet( rPropSet );
665  rLineHlp >> eApiStyle >> nApiWidth >> rLineFmt.maColor >> nApiTrans >> aDashNameAny;
666 
667  // clear automatic flag
668  ::set_flag( rLineFmt.mnFlags, EXC_CHLINEFORMAT_AUTO, false );
669 
670  // line width
671  if( nApiWidth <= 0 ) rLineFmt.mnWeight = EXC_CHLINEFORMAT_HAIR;
672  else if( nApiWidth <= 35 ) rLineFmt.mnWeight = EXC_CHLINEFORMAT_SINGLE;
673  else if( nApiWidth <= 70 ) rLineFmt.mnWeight = EXC_CHLINEFORMAT_DOUBLE;
674  else rLineFmt.mnWeight = EXC_CHLINEFORMAT_TRIPLE;
675 
676  // line style
677  switch( eApiStyle )
678  {
679  case drawing::LineStyle_NONE:
680  rLineFmt.mnPattern = EXC_CHLINEFORMAT_NONE;
681  break;
682  case drawing::LineStyle_SOLID:
683  {
684  if( nApiTrans < 13 ) rLineFmt.mnPattern = EXC_CHLINEFORMAT_SOLID;
685  else if( nApiTrans < 38 ) rLineFmt.mnPattern = EXC_CHLINEFORMAT_DARKTRANS;
686  else if( nApiTrans < 63 ) rLineFmt.mnPattern = EXC_CHLINEFORMAT_MEDTRANS;
687  else if( nApiTrans < 100 ) rLineFmt.mnPattern = EXC_CHLINEFORMAT_LIGHTTRANS;
688  else rLineFmt.mnPattern = EXC_CHLINEFORMAT_NONE;
689  }
690  break;
691  case drawing::LineStyle_DASH:
692  {
694  OUString aDashName;
695  drawing::LineDash aApiDash;
696  if( (aDashNameAny >>= aDashName) && (rDashTable.GetObject( aDashName ) >>= aApiDash) )
697  {
698  // reorder dashes that are shorter than dots
699  if( (aApiDash.Dashes == 0) || (aApiDash.DashLen < aApiDash.DotLen) )
700  {
701  ::std::swap( aApiDash.Dashes, aApiDash.Dots );
702  ::std::swap( aApiDash.DashLen, aApiDash.DotLen );
703  }
704  // ignore dots that are nearly equal to dashes
705  if( aApiDash.DotLen * 3 > aApiDash.DashLen * 2 )
706  aApiDash.Dots = 0;
707 
708  // convert line dash to predefined Excel dash types
709  if( (aApiDash.Dashes == 1) && (aApiDash.Dots >= 1) )
710  // one dash and one or more dots
711  rLineFmt.mnPattern = (aApiDash.Dots == 1) ?
713  else if( aApiDash.Dashes >= 1 )
714  // one or more dashes and no dots (also: dash-dash-dot)
715  rLineFmt.mnPattern = (aApiDash.DashLen < 250) ?
717  }
718  }
719  break;
720  default:
721  OSL_FAIL( "XclChPropSetHelper::ReadLineProperties - unknown line style" );
723  }
724 }
725 
727  const ScfPropertySet& rPropSet, XclChPropertyMode ePropMode )
728 {
729  // read properties from property set
730  drawing::FillStyle eApiStyle = drawing::FillStyle_NONE;
731  sal_Int16 nTransparency = 0;
732 
733  ScfPropSetHelper& rAreaHlp = GetAreaHelper( ePropMode );
734  rAreaHlp.ReadFromPropertySet( rPropSet );
735  rAreaHlp >> eApiStyle >> rAreaFmt.maPattColor >> nTransparency;
736 
737  // clear automatic flag
738  ::set_flag( rAreaFmt.mnFlags, EXC_CHAREAFORMAT_AUTO, false );
739 
740  // set fill style transparent or solid (set solid for anything but transparent)
741  rAreaFmt.mnPattern = (eApiStyle == drawing::FillStyle_NONE) ? EXC_PATT_NONE : EXC_PATT_SOLID;
742 
743  // return true to indicate complex fill (gradient, bitmap, solid transparency)
744  return (eApiStyle != drawing::FillStyle_NONE) && ((eApiStyle != drawing::FillStyle_SOLID) || (nTransparency > 0));
745 }
746 
748  XclChEscherFormat& rEscherFmt, XclChPicFormat& rPicFmt,
749  XclChObjectTable& rGradientTable, XclChObjectTable& rHatchTable, XclChObjectTable& rBitmapTable,
750  const ScfPropertySet& rPropSet, XclChPropertyMode ePropMode )
751 {
752  // read style and transparency properties from property set
753  drawing::FillStyle eApiStyle = drawing::FillStyle_NONE;
754  Color aColor;
755  sal_Int16 nTransparency = 0;
756 
757  ScfPropSetHelper& rAreaHlp = GetAreaHelper( ePropMode );
758  rAreaHlp.ReadFromPropertySet( rPropSet );
759  rAreaHlp >> eApiStyle >> aColor >> nTransparency;
760 
761  switch( eApiStyle )
762  {
763  case drawing::FillStyle_SOLID:
764  {
765  OSL_ENSURE( nTransparency > 0, "XclChPropSetHelper::ReadEscherProperties - unexpected solid area without transparency" );
766  if( (0 < nTransparency) && (nTransparency <= 100) )
767  {
768  // convert to Escher properties
769  sal_uInt32 nEscherColor = 0x02000000;
770  ::insert_value( nEscherColor, aColor.GetBlue(), 16, 8 );
771  ::insert_value( nEscherColor, aColor.GetGreen(), 8, 8 );
772  ::insert_value( nEscherColor, aColor.GetRed(), 0, 8 );
773  sal_uInt32 nEscherOpacity = static_cast< sal_uInt32 >( (100 - nTransparency) * 655.36 );
774  rEscherFmt.mxEscherSet = std::make_shared<EscherPropertyContainer>();
775  rEscherFmt.mxEscherSet->AddOpt( ESCHER_Prop_fillType, ESCHER_FillSolid );
776  rEscherFmt.mxEscherSet->AddOpt( ESCHER_Prop_fillColor, nEscherColor );
777  rEscherFmt.mxEscherSet->AddOpt( ESCHER_Prop_fillOpacity, nEscherOpacity );
778  rEscherFmt.mxEscherSet->AddOpt( ESCHER_Prop_fillBackColor, 0x02FFFFFF );
779  rEscherFmt.mxEscherSet->AddOpt( ESCHER_Prop_fillBackOpacity, 0x00010000 );
780  rEscherFmt.mxEscherSet->AddOpt( ESCHER_Prop_fNoFillHitTest, 0x001F001C );
781  }
782  }
783  break;
784  case drawing::FillStyle_GRADIENT:
785  {
786  // extract gradient from global gradient table
787  OUString aGradientName;
788  ScfPropSetHelper& rGradHlp = GetGradientHelper( ePropMode );
789  rGradHlp.ReadFromPropertySet( rPropSet );
790  rGradHlp >> eApiStyle >> aGradientName;
791  awt::Gradient aGradient;
792  if( rGradientTable.GetObject( aGradientName ) >>= aGradient )
793  {
794  // convert to Escher properties
795  rEscherFmt.mxEscherSet = std::make_shared<EscherPropertyContainer>();
796  rEscherFmt.mxEscherSet->CreateGradientProperties( aGradient );
797  }
798  }
799  break;
800  case drawing::FillStyle_HATCH:
801  {
802  // extract hatch from global hatch table
803  OUString aHatchName;
804  bool bFillBackground;
805  ScfPropSetHelper& rHatchHlp = GetHatchHelper( ePropMode );
806  rHatchHlp.ReadFromPropertySet( rPropSet );
807  rHatchHlp >> eApiStyle >> aHatchName >> aColor >> bFillBackground;
808  drawing::Hatch aHatch;
809  if( rHatchTable.GetObject( aHatchName ) >>= aHatch )
810  {
811  // convert to Escher properties
812  rEscherFmt.mxEscherSet = std::make_shared<EscherPropertyContainer>();
813  rEscherFmt.mxEscherSet->CreateEmbeddedHatchProperties( aHatch, aColor, bFillBackground );
815  }
816  }
817  break;
818  case drawing::FillStyle_BITMAP:
819  {
820  // extract bitmap URL from global bitmap table
821  OUString aBitmapName;
822  drawing::BitmapMode eApiBmpMode;
823  maBitmapHlp.ReadFromPropertySet( rPropSet );
824  maBitmapHlp >> eApiStyle >> aBitmapName >> eApiBmpMode;
825  uno::Reference<awt::XBitmap> xBitmap;
826  if (rBitmapTable.GetObject( aBitmapName ) >>= xBitmap)
827  {
828  // convert to Escher properties
829  rEscherFmt.mxEscherSet = std::make_shared<EscherPropertyContainer>();
830  rEscherFmt.mxEscherSet->CreateEmbeddedBitmapProperties( xBitmap, eApiBmpMode );
831  rPicFmt.mnBmpMode = (eApiBmpMode == drawing::BitmapMode_REPEAT) ?
833  }
834  }
835  break;
836  default:
837  OSL_FAIL( "XclChPropSetHelper::ReadEscherProperties - unknown fill style" );
838  }
839 }
840 
842  XclChMarkerFormat& rMarkerFmt, const ScfPropertySet& rPropSet, sal_uInt16 nFormatIdx )
843 {
844  chart2::Symbol aApiSymbol;
845  if( !rPropSet.GetProperty( aApiSymbol, EXC_CHPROP_SYMBOL ) )
846  return;
847 
848  // clear automatic flag
849  ::set_flag( rMarkerFmt.mnFlags, EXC_CHMARKERFORMAT_AUTO, false );
850 
851  // symbol style
852  switch( aApiSymbol.Style )
853  {
854  case chart2::SymbolStyle_NONE:
856  break;
857  case chart2::SymbolStyle_STANDARD:
858  switch( aApiSymbol.StandardSymbol )
859  {
860  case 0: rMarkerFmt.mnMarkerType = EXC_CHMARKERFORMAT_SQUARE; break; // square
861  case 1: rMarkerFmt.mnMarkerType = EXC_CHMARKERFORMAT_DIAMOND; break; // diamond
862  case 2: rMarkerFmt.mnMarkerType = EXC_CHMARKERFORMAT_STDDEV; break; // arrow down
863  case 3: rMarkerFmt.mnMarkerType = EXC_CHMARKERFORMAT_TRIANGLE; break; // arrow up
864  case 4: rMarkerFmt.mnMarkerType = EXC_CHMARKERFORMAT_DOWJ; break; // arrow right, same as import
865  case 5: rMarkerFmt.mnMarkerType = EXC_CHMARKERFORMAT_PLUS; break; // arrow left
866  case 6: rMarkerFmt.mnMarkerType = EXC_CHMARKERFORMAT_CROSS; break; // bow tie
867  case 7: rMarkerFmt.mnMarkerType = EXC_CHMARKERFORMAT_STAR; break; // sand glass
868  case 8: rMarkerFmt.mnMarkerType = EXC_CHMARKERFORMAT_CIRCLE; break; // circle new in LibO3.5
869  case 9: rMarkerFmt.mnMarkerType = EXC_CHMARKERFORMAT_DIAMOND; break; // star new in LibO3.5
870  case 10: rMarkerFmt.mnMarkerType = EXC_CHMARKERFORMAT_CROSS; break; // X new in LibO3.5
871  case 11: rMarkerFmt.mnMarkerType = EXC_CHMARKERFORMAT_PLUS; break; // plus new in LibO3.5
872  case 12: rMarkerFmt.mnMarkerType = EXC_CHMARKERFORMAT_STAR; break; // asterisk new in LibO3.5
873  case 13: rMarkerFmt.mnMarkerType = EXC_CHMARKERFORMAT_STDDEV; break; // horizontal bar new in LibO3.5
874  case 14: rMarkerFmt.mnMarkerType = EXC_CHMARKERFORMAT_STAR; break; // vertical bar new in LibO3.5
875  default: rMarkerFmt.mnMarkerType = XclChartHelper::GetAutoMarkerType( nFormatIdx );
876  }
877  break;
878  default:
879  rMarkerFmt.mnMarkerType = XclChartHelper::GetAutoMarkerType( nFormatIdx );
880  }
881  bool bHasFillColor = XclChartHelper::HasMarkerFillColor( rMarkerFmt.mnMarkerType );
882  ::set_flag( rMarkerFmt.mnFlags, EXC_CHMARKERFORMAT_NOFILL, !bHasFillColor );
883 
884  // symbol size
885  sal_Int32 nApiSize = (aApiSymbol.Size.Width + aApiSymbol.Size.Height + 1) / 2;
886  rMarkerFmt.mnMarkerSize = XclTools::GetTwipsFromHmm( nApiSize );
887 
888  // symbol colors
889  rMarkerFmt.maLineColor = Color( aApiSymbol.BorderColor );
890  rMarkerFmt.maFillColor = Color( aApiSymbol.FillColor );
891 }
892 
893 sal_uInt16 XclChPropSetHelper::ReadRotationProperties( const ScfPropertySet& rPropSet, bool bSupportsStacked )
894 {
895  // chart2 handles rotation as double in the range [0,360)
896  double fAngle = 0.0;
897  rPropSet.GetProperty( fAngle, EXC_CHPROP_TEXTROTATION );
898  bool bStacked = bSupportsStacked && rPropSet.GetBoolProperty( EXC_CHPROP_STACKCHARACTERS );
899  return bStacked ? EXC_ROT_STACKED :
900  XclTools::GetXclRotation( static_cast< sal_Int32 >( fAngle * 100.0 + 0.5 ) );
901 }
902 
903 // write properties -----------------------------------------------------------
904 
906  ScfPropertySet& rPropSet, XclChObjectTable& rDashTable,
907  const XclChLineFormat& rLineFmt, XclChPropertyMode ePropMode )
908 {
909  // line width
910  sal_Int32 nApiWidth = 0; // 0 is the width of a hair line
911  switch( rLineFmt.mnWeight )
912  {
913  case EXC_CHLINEFORMAT_SINGLE: nApiWidth = 35; break;
914  case EXC_CHLINEFORMAT_DOUBLE: nApiWidth = 70; break;
915  case EXC_CHLINEFORMAT_TRIPLE: nApiWidth = 105; break;
916  }
917 
918  // line style
919  drawing::LineStyle eApiStyle = drawing::LineStyle_NONE;
920  sal_Int16 nApiTrans = 0;
921  sal_Int32 nDotLen = ::std::min< sal_Int32 >( rLineFmt.mnWeight + 105, 210 );
922  drawing::LineDash aApiDash( drawing::DashStyle_RECT, 0, nDotLen, 0, 4 * nDotLen, nDotLen );
923 
924  switch( rLineFmt.mnPattern )
925  {
927  eApiStyle = drawing::LineStyle_SOLID;
928  break;
930  eApiStyle = drawing::LineStyle_SOLID; nApiTrans = 25;
931  break;
933  eApiStyle = drawing::LineStyle_SOLID; nApiTrans = 50;
934  break;
936  eApiStyle = drawing::LineStyle_SOLID; nApiTrans = 75;
937  break;
939  eApiStyle = drawing::LineStyle_DASH; aApiDash.Dashes = 1;
940  break;
942  eApiStyle = drawing::LineStyle_DASH; aApiDash.Dots = 1;
943  break;
945  eApiStyle = drawing::LineStyle_DASH; aApiDash.Dashes = aApiDash.Dots = 1;
946  break;
948  eApiStyle = drawing::LineStyle_DASH; aApiDash.Dashes = 1; aApiDash.Dots = 2;
949  break;
950  }
951 
952  // line color
953  sal_Int32 nApiColor = sal_Int32( rLineFmt.maColor );
954 
955  // try to insert the dash style and receive its name
956  uno::Any aDashNameAny;
957  if( eApiStyle == drawing::LineStyle_DASH )
958  {
959  OUString aDashName = rDashTable.InsertObject( uno::makeAny( aApiDash ) );
960  if( !aDashName.isEmpty() )
961  aDashNameAny <<= aDashName;
962  }
963 
964  // write the properties
965  ScfPropSetHelper& rLineHlp = GetLineHelper( ePropMode );
966  rLineHlp.InitializeWrite();
967  rLineHlp << eApiStyle << nApiWidth << nApiColor << nApiTrans << aDashNameAny;
968  rLineHlp.WriteToPropertySet( rPropSet );
969 }
970 
972  const XclChAreaFormat& rAreaFmt, XclChPropertyMode ePropMode )
973 {
974  drawing::FillStyle eFillStyle = drawing::FillStyle_NONE;
975  Color aColor;
976 
977  // fill color
978  if( rAreaFmt.mnPattern != EXC_PATT_NONE )
979  {
980  eFillStyle = drawing::FillStyle_SOLID;
981  aColor = XclTools::GetPatternColor( rAreaFmt.maPattColor, rAreaFmt.maBackColor, rAreaFmt.mnPattern );
982  }
983 
984  // write the properties
985  ScfPropSetHelper& rAreaHlp = GetAreaHelper( ePropMode );
986  rAreaHlp.InitializeWrite();
987  rAreaHlp << eFillStyle << aColor << sal_Int16(0)/*nTransparency*/;
988  rAreaHlp.WriteToPropertySet( rPropSet );
989 }
990 
992  XclChObjectTable& rGradientTable, XclChObjectTable& rBitmapTable,
993  const XclChEscherFormat& rEscherFmt, const XclChPicFormat* pPicFmt,
994  sal_uInt32 nDffFillType, XclChPropertyMode ePropMode )
995 {
996  if( !rEscherFmt.mxItemSet )
997  return;
998 
999  const XFillStyleItem* pStyleItem = rEscherFmt.mxItemSet->GetItem<XFillStyleItem>( XATTR_FILLSTYLE, false );
1000  if( !pStyleItem )
1001  return;
1002 
1003  switch( pStyleItem->GetValue() )
1004  {
1005  case drawing::FillStyle_SOLID:
1006  // #i84812# Excel 2007 writes Escher properties for solid fill
1007  if( const XFillColorItem* pColorItem = rEscherFmt.mxItemSet->GetItem<XFillColorItem>( XATTR_FILLCOLOR, false ) )
1008  {
1009  // get solid transparence too
1010  const XFillTransparenceItem* pTranspItem = rEscherFmt.mxItemSet->GetItem<XFillTransparenceItem>( XATTR_FILLTRANSPARENCE, false );
1011  sal_uInt16 nTransp = pTranspItem ? pTranspItem->GetValue() : 0;
1012  ScfPropSetHelper& rAreaHlp = GetAreaHelper( ePropMode );
1013  rAreaHlp.InitializeWrite();
1014  rAreaHlp << drawing::FillStyle_SOLID << pColorItem->GetColorValue() << static_cast< sal_Int16 >( nTransp );
1015  rAreaHlp.WriteToPropertySet( rPropSet );
1016  }
1017  break;
1018  case drawing::FillStyle_GRADIENT:
1019  if( const XFillGradientItem* pGradItem = rEscherFmt.mxItemSet->GetItem<XFillGradientItem>( XATTR_FILLGRADIENT, false ) )
1020  {
1021  uno::Any aGradientAny;
1022  if( pGradItem->QueryValue( aGradientAny, MID_FILLGRADIENT ) )
1023  {
1024  OUString aGradName = rGradientTable.InsertObject( aGradientAny );
1025  if( !aGradName.isEmpty() )
1026  {
1027  ScfPropSetHelper& rGradHlp = GetGradientHelper( ePropMode );
1028  rGradHlp.InitializeWrite();
1029  rGradHlp << drawing::FillStyle_GRADIENT << aGradName;
1030  rGradHlp.WriteToPropertySet( rPropSet );
1031  }
1032  }
1033  }
1034  break;
1035  case drawing::FillStyle_BITMAP:
1036  if( const XFillBitmapItem* pBmpItem = rEscherFmt.mxItemSet->GetItem<XFillBitmapItem>( XATTR_FILLBITMAP, false ) )
1037  {
1038  uno::Any aBitmapAny;
1039  if (pBmpItem->QueryValue(aBitmapAny, MID_BITMAP))
1040  {
1041  OUString aBmpName = rBitmapTable.InsertObject( aBitmapAny );
1042  if( !aBmpName.isEmpty() )
1043  {
1044  /* #i71810# Caller decides whether to use a CHPICFORMAT record for bitmap mode.
1045  If not passed, detect fill mode from the DFF property 'fill-type'. */
1046  bool bStretch = pPicFmt ? (pPicFmt->mnBmpMode == EXC_CHPICFORMAT_STRETCH) : (nDffFillType == mso_fillPicture);
1047  drawing::BitmapMode eApiBmpMode = bStretch ? drawing::BitmapMode_STRETCH : drawing::BitmapMode_REPEAT;
1049  maBitmapHlp << drawing::FillStyle_BITMAP << aBmpName << eApiBmpMode;
1050  maBitmapHlp.WriteToPropertySet( rPropSet );
1051  }
1052  }
1053  }
1054  break;
1055  default:
1056  OSL_FAIL( "XclChPropSetHelper::WriteEscherProperties - unknown fill mode" );
1057  }
1058 }
1059 
1061  ScfPropertySet& rPropSet, const XclChMarkerFormat& rMarkerFmt )
1062 {
1063  // symbol style
1064  chart2::Symbol aApiSymbol;
1065  aApiSymbol.Style = chart2::SymbolStyle_STANDARD;
1066  switch( rMarkerFmt.mnMarkerType )
1067  {
1068  case EXC_CHMARKERFORMAT_NOSYMBOL: aApiSymbol.Style = chart2::SymbolStyle_NONE; break;
1069  case EXC_CHMARKERFORMAT_SQUARE: aApiSymbol.StandardSymbol = 0; break; // square
1070  case EXC_CHMARKERFORMAT_DIAMOND: aApiSymbol.StandardSymbol = 1; break; // diamond
1071  case EXC_CHMARKERFORMAT_TRIANGLE: aApiSymbol.StandardSymbol = 3; break; // arrow up
1072  case EXC_CHMARKERFORMAT_CROSS: aApiSymbol.StandardSymbol = 10; break; // X, legacy bow tie
1073  case EXC_CHMARKERFORMAT_STAR: aApiSymbol.StandardSymbol = 12; break; // asterisk, legacy sand glass
1074  case EXC_CHMARKERFORMAT_DOWJ: aApiSymbol.StandardSymbol = 4; break; // arrow right, same as export
1075  case EXC_CHMARKERFORMAT_STDDEV: aApiSymbol.StandardSymbol = 13; break; // horizontal bar, legacy arrow down
1076  case EXC_CHMARKERFORMAT_CIRCLE: aApiSymbol.StandardSymbol = 8; break; // circle, legacy arrow right
1077  case EXC_CHMARKERFORMAT_PLUS: aApiSymbol.StandardSymbol = 11; break; // plus, legacy arrow left
1078  default: break;
1079  }
1080 
1081  // symbol size
1082  sal_Int32 nApiSize = XclTools::GetHmmFromTwips( rMarkerFmt.mnMarkerSize );
1083  aApiSymbol.Size = awt::Size( nApiSize, nApiSize );
1084 
1085  // symbol colors
1086  aApiSymbol.FillColor = sal_Int32( rMarkerFmt.maFillColor );
1087  aApiSymbol.BorderColor = ::get_flag( rMarkerFmt.mnFlags, EXC_CHMARKERFORMAT_NOLINE ) ?
1088  aApiSymbol.FillColor : sal_Int32( rMarkerFmt.maLineColor );
1089 
1090  // set the property
1091  rPropSet.SetProperty( EXC_CHPROP_SYMBOL, aApiSymbol );
1092 }
1093 
1095  ScfPropertySet& rPropSet, sal_uInt16 nRotation, bool bSupportsStacked )
1096 {
1097  if( nRotation != EXC_CHART_AUTOROTATION )
1098  {
1099  // chart2 handles rotation as double in the range [0,360)
1100  double fAngle = XclTools::GetScRotation( nRotation, 0 ) / 100.0;
1101  rPropSet.SetProperty( EXC_CHPROP_TEXTROTATION, fAngle );
1102  if( bSupportsStacked )
1103  rPropSet.SetProperty( EXC_CHPROP_STACKCHARACTERS, nRotation == EXC_ROT_STACKED );
1104  }
1105 }
1106 
1107 // private --------------------------------------------------------------------
1108 
1110 {
1111  switch( ePropMode )
1112  {
1116  default: OSL_FAIL( "XclChPropSetHelper::GetLineHelper - unknown property mode" );
1117  }
1118  return maLineHlpCommon;
1119 }
1120 
1122 {
1123  switch( ePropMode )
1124  {
1127  default: OSL_FAIL( "XclChPropSetHelper::GetAreaHelper - unknown property mode" );
1128  }
1129  return maAreaHlpCommon;
1130 }
1131 
1133 {
1134  switch( ePropMode )
1135  {
1138  default: OSL_FAIL( "XclChPropSetHelper::GetGradientHelper - unknown property mode" );
1139  }
1140  return maGradHlpCommon;
1141 }
1142 
1144 {
1145  switch( ePropMode )
1146  {
1149  default: OSL_FAIL( "XclChPropSetHelper::GetHatchHelper - unknown property mode" );
1150  }
1151  return maHatchHlpCommon;
1152 }
1153 
1154 namespace {
1155 
1156 /* The following local functions implement getting the XShape interface of all
1157  supported title objects (chart and axes). This needs some effort due to the
1158  design of the old Chart1 API used to access these objects. */
1159 
1161 uno::Reference<drawing::XShape> lclGetMainTitleShape(const uno::Reference<chart::XChartDocument> & rxChart1Doc)
1162 {
1163  ScfPropertySet aPropSet(rxChart1Doc);
1164  if (rxChart1Doc.is() && aPropSet.GetBoolProperty("HasMainTitle"))
1165  return rxChart1Doc->getTitle();
1166  return uno::Reference<drawing::XShape>();
1167 }
1168 
1169 uno::Reference<drawing::XShape> lclGetXAxisTitleShape(const uno::Reference<chart::XChartDocument> & rxChart1Doc)
1170 {
1171  uno::Reference<chart::XAxisXSupplier> xAxisSupp(rxChart1Doc->getDiagram(), uno::UNO_QUERY);
1172  ScfPropertySet aPropSet(xAxisSupp);
1173  if (xAxisSupp.is() && aPropSet.GetBoolProperty("HasXAxisTitle"))
1174  return xAxisSupp->getXAxisTitle();
1175  return uno::Reference<drawing::XShape>();
1176 }
1177 
1178 uno::Reference<drawing::XShape> lclGetYAxisTitleShape(const uno::Reference<chart::XChartDocument> & rxChart1Doc )
1179 {
1180  uno::Reference<chart::XAxisYSupplier> xAxisSupp(rxChart1Doc->getDiagram(), uno::UNO_QUERY);
1181  ScfPropertySet aPropSet(xAxisSupp);
1182  if (xAxisSupp.is() && aPropSet.GetBoolProperty("HasYAxisTitle"))
1183  return xAxisSupp->getYAxisTitle();
1184  return uno::Reference<drawing::XShape>();
1185 }
1186 
1187 uno::Reference<drawing::XShape> lclGetZAxisTitleShape(const uno::Reference<chart::XChartDocument> & rxChart1Doc )
1188 {
1189  uno::Reference<chart::XAxisZSupplier> xAxisSupp(rxChart1Doc->getDiagram(), uno::UNO_QUERY);
1190  ScfPropertySet aPropSet(xAxisSupp);
1191  if (xAxisSupp.is() && aPropSet.GetBoolProperty("HasZAxisTitle"))
1192  return xAxisSupp->getZAxisTitle();
1193  return uno::Reference<drawing::XShape>();
1194 }
1195 
1196 uno::Reference<drawing::XShape> lclGetSecXAxisTitleShape(const uno::Reference<chart::XChartDocument> & rxChart1Doc)
1197 {
1198  uno::Reference<chart::XSecondAxisTitleSupplier> xAxisSupp(rxChart1Doc->getDiagram(), uno::UNO_QUERY);
1199  ScfPropertySet aPropSet(xAxisSupp);
1200  if (xAxisSupp.is() && aPropSet.GetBoolProperty("HasSecondaryXAxisTitle"))
1201  return xAxisSupp->getSecondXAxisTitle();
1202  return uno::Reference<drawing::XShape>();
1203 }
1204 
1205 uno::Reference<drawing::XShape> lclGetSecYAxisTitleShape(const uno::Reference<chart::XChartDocument> & rxChart1Doc)
1206 {
1207  uno::Reference<chart::XSecondAxisTitleSupplier> xAxisSupp(rxChart1Doc->getDiagram(), uno::UNO_QUERY);
1208  ScfPropertySet aPropSet(xAxisSupp);
1209  if (xAxisSupp.is() && aPropSet.GetBoolProperty("HasSecondaryYAxisTitle"))
1210  return xAxisSupp->getSecondYAxisTitle();
1211  return uno::Reference<drawing::XShape>();
1212 }
1213 
1214 } // namespace
1215 
1217  : mxTypeInfoProv(std::make_shared<XclChTypeInfoProvider>())
1218  , mxFmtInfoProv(std::make_shared<XclChFormatInfoProvider>())
1219  , mnBorderGapX(0)
1220  , mnBorderGapY(0)
1221  , mfUnitSizeX(0.0)
1222  , mfUnitSizeY(0.0)
1223 {
1224  // remember some title shape getter functions
1225  maGetShapeFuncs[ XclChTextKey( EXC_CHTEXTTYPE_TITLE ) ] = lclGetMainTitleShape;
1231 }
1232 
1234 {
1235 }
1236 
1237 void XclChRootData::InitConversion(const XclRoot& rRoot, const uno::Reference<chart2::XChartDocument> & rxChartDoc, const tools::Rectangle& rChartRect)
1238 {
1239  // remember chart document reference and chart shape position/size
1240  OSL_ENSURE( rxChartDoc.is(), "XclChRootData::InitConversion - missing chart document" );
1241  mxChartDoc = rxChartDoc;
1242  maChartRect = rChartRect;
1243 
1244  // Excel excludes a border of 5 pixels in each direction from chart area
1245  mnBorderGapX = rRoot.GetHmmFromPixelX( 5.0 );
1246  mnBorderGapY = rRoot.GetHmmFromPixelY( 5.0 );
1247 
1248  // size of a chart unit in 1/100 mm
1251 
1252  // create object tables
1253  uno::Reference<lang::XMultiServiceFactory> xFactory(mxChartDoc, uno::UNO_QUERY);
1254  mxLineDashTable = std::make_shared<XclChObjectTable>(xFactory, SERVICE_DRAWING_DASHTABLE, "Excel line dash ");
1255  mxGradientTable = std::make_shared<XclChObjectTable>(xFactory, SERVICE_DRAWING_GRADIENTTABLE, "Excel gradient ");
1256  mxHatchTable = std::make_shared<XclChObjectTable>(xFactory, SERVICE_DRAWING_HATCHTABLE, "Excel hatch ");
1257  mxBitmapTable = std::make_shared<XclChObjectTable>(xFactory, SERVICE_DRAWING_BITMAPTABLE, "Excel bitmap ");
1258 }
1259 
1261 {
1262  // forget formatting object tables
1263  mxBitmapTable.reset();
1264  mxHatchTable.reset();
1265  mxGradientTable.reset();
1266  mxLineDashTable.reset();
1267  // forget chart document reference
1268  mxChartDoc.clear();
1269 }
1270 
1271 uno::Reference<drawing::XShape> XclChRootData::GetTitleShape(const XclChTextKey& rTitleKey) const
1272 {
1273  XclChGetShapeFuncMap::const_iterator aIt = maGetShapeFuncs.find( rTitleKey );
1274  OSL_ENSURE( aIt != maGetShapeFuncs.end(), "XclChRootData::GetTitleShape - invalid title key" );
1275  uno::Reference<chart::XChartDocument> xChart1Doc( mxChartDoc, uno::UNO_QUERY );
1276  uno::Reference<drawing::XShape> xTitleShape;
1277  if (xChart1Doc.is() && (aIt != maGetShapeFuncs.end()))
1278  xTitleShape = (aIt->second)(xChart1Doc);
1279  return xTitleShape;
1280 }
1281 
1282 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
#define MID_FILLGRADIENT
ScfPropSetHelper maBitmapHlp
Properties for hatches in filled series.
Definition: xlchart.hxx:1396
XclChPropertyMode
Specifies the type of a formatting.
Definition: xlchart.hxx:1081
const sal_uInt16 EXC_CHSERGROUP_NONE
Definition: xlchart.hxx:612
const sal_uInt8 EXC_CHPROPS_EMPTY_SKIP
Manual plot area layout in CHFRAMEPOS record.
Definition: xlchart.hxx:604
Color maPattColor
Definition: xlchart.hxx:801
double mnHeight
XclChLineFormat()
Additional flags.
Definition: xlchart.cxx:94
const sal_uInt16 EXC_CHDATERANGE_AUTOMAJOR
Definition: xlchart.hxx:714
const sal_uInt16 EXC_CHLINEFORMAT_DASHDOT
Definition: xlchart.hxx:253
const sal_uInt16 EXC_CHMARKERFORMAT_CIRCLE
Definition: xlchart.hxx:280
const sal_uInt16 EXC_ID_CHLINE
Definition: xlchart.hxx:357
const sal_uInt16 EXC_CHTEXT_POS_DEFAULT
Data point caption is category name.
Definition: xlchart.hxx:485
const sal_uInt16 EXC_CHPICFORMAT_LEFTRIGHT
Definition: xlchart.hxx:554
const sal_Int32 EXC_CHART_TOTALUNITS
API secondary axes set index.
Definition: xlchart.hxx:163
long GetWidth() const
const sal_uInt8 EXC_CHTICK_OUTSIDE
Definition: xlchart.hxx:404
const sal_uInt8 EXC_CHTEXT_ALIGN_CENTER
Horizontal: left, vertical: top.
Definition: xlchart.hxx:464
const sal_uInt16 EXC_ID_CHBAR
Definition: xlchart.hxx:348
Text boxes (titles, data point labels).
Definition: xlchart.hxx:1118
const sal_uInt8 EXC_CH3DDATAFORMAT_STRAIGHT
Circular base.
Definition: xlchart.hxx:700
No varied colors supported.
Definition: xlchart.hxx:1202
const sal_uInt8 EXC_CHSERERR_END_TSHAPE
Line end: blank.
Definition: xlchart.hxx:683
const sal_uInt16 EXC_CHAXESSET_PRIMARY
Definition: xlchart.hxx:583
void WriteLineProperties(ScfPropertySet &rPropSet, XclChObjectTable &rDashTable, const XclChLineFormat &rLineFmt, XclChPropertyMode ePropMode)
Writes all line properties to the passed property set.
Definition: xlchart.cxx:905
mso_fillPicture
long GetHeight() const
XclChTypeInfoMap maInfoMap
Definition: xlchart.hxx:1261
sal_uInt8 GetRed() const
const sal_Int32 EXC_CHART_AXESSET_SECONDARY
API primary axes set index.
Definition: xlchart.hxx:161
XclChTick()
Tick labels angle (BIFF8+).
Definition: xlchart.cxx:303
const sal_uInt8 EXC_CHSERERR_YPLUS
Definition: xlchart.hxx:673
#define EXC_CHPROP_SYMBOL
Definition: xlchart.hxx:126
XclChMarkerFormat()
Additional flags.
Definition: xlchart.cxx:166
Contains information for a chart type.
Definition: xlchart.hxx:1207
sal_uInt16 mnFlags
Marker type (none, diamond, ...).
Definition: xlchart.hxx:893
XclChLabelRange()
Additional flags.
Definition: xlchart.cxx:267
Line chart.
Definition: xlchart.hxx:1174
const sal_uInt16 EXC_CHLEGEND_STACKED
Definition: xlchart.hxx:343
EscherPropSetRef mxEscherSet
Item set for Escher properties import.
Definition: xlchart.hxx:818
const sal_uInt16 EXC_CHDATERANGE_DAYS
Recognize date/text automatically.
Definition: xlchart.hxx:721
sal_Int16 mnValueType
XclChAreaFormat()
Additional flags.
Definition: xlchart.cxx:102
XclChFrame()
Additional flags.
Definition: xlchart.cxx:125
#define SERVICE_DRAWING_DASHTABLE
Definition: xlchart.hxx:42
ScfPropSetHelper & GetGradientHelper(XclChPropertyMode ePropMode)
Returns a gradient property set helper according to the passed property mode.
Definition: xlchart.cxx:1132
const XclChFormatInfo & GetFormatInfo(XclChObjectType eObjType) const
Returns an info struct about auto formatting for the passed object type.
Definition: xlchart.cxx:447
const sal_uInt8 EXC_ROT_STACKED
Text rotation: 90 deg clockwise.
Definition: xlconst.hxx:147
const sal_uInt8 EXC_CHTICK_INSIDE
Definition: xlchart.hxx:403
Series trend line.
Definition: xlchart.hxx:1124
double mfUnitSizeX
Border gap to chart space in 1/100mm.
Definition: xlchart.hxx:1419
Series formatting in a chart supporting line formatting only.
Definition: xlchart.hxx:1120
Bar charts (horizontal or vertical).
Definition: xlchart.hxx:1191
void WriteEscherProperties(ScfPropertySet &rPropSet, XclChObjectTable &rGradientTable, XclChObjectTable &rBitmapTable, const XclChEscherFormat &rEscherFmt, const XclChPicFormat *pPicFmt, sal_uInt32 nDffFillType, XclChPropertyMode ePropMode)
Writes gradient or bitmap area properties to the passed property set.
Definition: xlchart.cxx:991
ScfPropSetHelper maLineHlpCommon
Definition: xlchart.hxx:1387
const sal_uInt8 EXC_CHSRCLINK_TITLE
Definition: xlchart.hxx:655
High/low lines in stock charts.
Definition: xlchart.hxx:1127
constexpr TypedWhichId< XFillStyleItem > XATTR_FILLSTYLE(XATTR_FILL_FIRST)
uno::Reference< presentation::XTransitionFactory > mxFactory
const sal_uInt16 EXC_CHDATAFORMAT_DEFAULT
Maximum number of data points.
Definition: xlchart.hxx:240
XclChRectangle()
Height of the object in 1/4000 of chart height.
Definition: xlchart.cxx:58
XclChRootData()
Size of a chart Y unit (1/4000 of chart height) in 1/100 mm.
Definition: xlchart.cxx:1216
Contains information about auto formatting of a specific chart object type.
Definition: xlchart.hxx:1139
const sal_uInt16 EXC_CHMARKERFORMAT_DIAMOND
Definition: xlchart.hxx:274
XclChLegend()
Additional flags.
Definition: xlchart.cxx:245
Provides access to chart auto formatting for all available object types.
Definition: xlchart.hxx:1153
const sal_uInt16 EXC_CHLEGEND_AUTOSERIES
Definition: xlchart.hxx:340
const sal_uInt16 EXC_ID_CHRADARLINE
Definition: xlchart.hxx:566
Scatter and bubble charts.
Definition: xlchart.hxx:1195
bool GetBoolProperty(const OUString &rPropName) const
Gets the specified Boolean property from the property set.
Definition: fapihelper.cxx:188
static bool HasMarkerFillColor(sal_uInt16 nMarkerType)
Returns true, if the passed marker type is filled.
Definition: xlchart.cxx:394
Data point connector line.
Definition: xlchart.hxx:1126
void set_flag(Type &rnBitField, Type nMask, bool bSet=true)
Sets or clears (according to bSet) all set bits of nMask in rnBitField.
Definition: ftools.hxx:93
static void WriteRotationProperties(ScfPropertySet &rPropSet, sal_uInt16 nRotation, bool bSupportsStacked)
Writes rotation properties to the passed property set.
Definition: xlchart.cxx:1094
XclChSeries()
Number of bubble entries.
Definition: xlchart.cxx:211
sal_Int32 GetHmmFromPixelX(double fPixelX) const
Calculates the width of the passed number of pixels in 1/100 mm.
Definition: xlroot.cxx:229
basegfx::BColor maColor
XclChSerTrendLine()
1 = Show R-squared.
Definition: xlchart.cxx:187
#define EXC_CHPROP_ROLE_ERRORBARS_POSY
Definition: xlchart.hxx:140
css::uno::Reference< css::drawing::XShape > GetTitleShape(const XclChTextKey &rTitleKey) const
Returns the drawing shape interface of the specified title object.
Definition: xlchart.cxx:1271
const sal_uInt16 EXC_CHSERIES_NUMERIC
Definition: xlchart.hxx:228
std::shared_ptr< T > make_shared(Args &&...args)
XclChGetShapeFuncMap maGetShapeFuncs
Container for bitmap fill styles.
Definition: xlchart.hxx:1416
Bubble chart.
Definition: xlchart.hxx:1183
#define ESCHER_Prop_fillBackOpacity
#define EXC_CHPROP_STACKCHARACTERS
Definition: xlchart.hxx:122
Pie chart.
Definition: xlchart.hxx:1179
Missing frame represents automatic formatting.
Definition: xlchart.hxx:1135
css::uno::Reference< css::lang::XMultiServiceFactory > mxFactory
Definition: xlchart.hxx:1302
const sal_uInt16 EXC_CHTICK_AUTOCOLOR
Definition: xlchart.hxx:414
A map key for text and title objects.
Definition: xlchart.hxx:1278
XclFmtInfoMap maInfoMap
Definition: xlchart.hxx:1163
const sal_uInt16 EXC_ID_CHPIEEXT
Sharp top, truncated.
Definition: xlchart.hxx:706
Pie-to-pie or pie-to-bar chart.
Definition: xlchart.hxx:1181
const sal_uInt16 EXC_CHVALUERANGE_AUTOMAX
Definition: xlchart.hxx:423
static sal_uInt8 GetSeriesFillAutoTransp(sal_uInt16 nFormatIdx)
Returns a transparency value for automatic series fill colors.
Definition: xlchart.cxx:379
const sal_uInt16 EXC_CHLINEFORMAT_DOT
Definition: xlchart.hxx:252
FuncFlags mnFlags
Information about all parameters.
#define SERVICE_DRAWING_HATCHTABLE
Definition: xlchart.hxx:44
bool mbSupports3d
true = Types can be combined in one axes set.
Definition: xlchart.hxx:1216
Axis grid line format.
Definition: xlchart.hxx:1123
sal_uInt32 mnMarkerSize
Fill color.
Definition: xlchart.hxx:891
SfxItemSetRef mxItemSet
Definition: xlchart.hxx:817
const sal_Int32 EXC_CHART_AXIS_Z
API Y axis index.
Definition: xlchart.hxx:158
OUString maObjNameBase
Service name to create the container.
Definition: xlchart.hxx:1305
sal_uInt16 mnPattern
Line color.
Definition: xlchart.hxx:792
sal_uInt16 mnType
Definition: xlchart.hxx:1059
Series formatting in a chart supporting area formatting.
Definition: xlchart.hxx:1121
const sal_uInt16 EXC_CHAXIS_NONE
Definition: xlchart.hxx:397
bool mb3dChart
const sal_uInt16 EXC_CHDATERANGE_AUTODATE
Other axis crosses at own maximum.
Definition: xlchart.hxx:719
void WriteAreaProperties(ScfPropertySet &rPropSet, const XclChAreaFormat &rAreaFmt, XclChPropertyMode ePropMode)
Writes solid area properties to the passed property set.
Definition: xlchart.cxx:971
sal_Int16 mnWeight
Line pattern (solid, dashed, ...).
Definition: xlchart.hxx:793
const sal_uInt16 EXC_CHPICFORMAT_FRONTBACK
Definition: xlchart.hxx:553
const sal_uInt16 EXC_CHMARKERFORMAT_PLUS
Definition: xlchart.hxx:281
ScfPropSetHelper maHatchHlpFilled
Properties for hatches in common objects.
Definition: xlchart.hxx:1395
ScfPropSetHelper maLineHlpFilled
Properties for lines in linear series.
Definition: xlchart.hxx:1389
const sal_uInt16 EXC_CHPICFORMAT_STACK
Bitmap stretched to area.
Definition: xlchart.hxx:549
tools::Rectangle maChartRect
The chart document.
Definition: xlchart.hxx:1409
const sal_Int16 EXC_CHLINEFORMAT_SINGLE
Definition: xlchart.hxx:261
const sal_uInt8 EXC_CHSRCLINK_DEFAULT
Definition: xlchart.hxx:660
void InitializeWrite()
Must be called before reading or storing property values in the helper.
Definition: fapihelper.cxx:335
const sal_Int32 EXC_CHART_AXIS_Y
API X axis index.
Definition: xlchart.hxx:157
Specific to data series drawn as lines.
Definition: xlchart.hxx:1085
const sal_uInt16 EXC_CHMARKERFORMAT_NOFILL
Definition: xlchart.hxx:289
#define ESCHER_Prop_fillOpacity
sal_uInt16 mnFlags
Line weight (hairline, single, ...).
Definition: xlchart.hxx:794
bool ReadAreaProperties(XclChAreaFormat &rAreaFmt, const ScfPropertySet &rPropSet, XclChPropertyMode ePropMode)
Reads solid area properties from the passed property set.
Definition: xlchart.cxx:726
sal_uInt8 GetBlue() const
sal_uInt16 mnSeriesIdx
Definition: xlchart.hxx:756
sal_Int32 GetApiAxesSetIndex() const
Returns the axes set index used by the chart API.
Definition: xlchart.cxx:336
void ReadFromPropertySet(const ScfPropertySet &rPropSet)
Reads all values from the passed property set.
Definition: fapihelper.cxx:306
Chart background.
Definition: xlchart.hxx:1114
static sal_uInt16 GetAutoMarkerType(sal_uInt16 nFormatIdx)
Returns an automatic symbol index for the passed format index.
Definition: xlchart.cxx:385
#define SAL_N_ELEMENTS(arr)
const sal_uInt8 EXC_CHTICK_TRANSPARENT
Next to axis.
Definition: xlchart.hxx:411
void WriteToPropertySet(ScfPropertySet &rPropSet) const
Writes all values to the passed property set.
Definition: fapihelper.cxx:352
XclChDataFormat()
Additional flags.
Definition: xlchart.cxx:181
ScfPropSetHelper & GetHatchHelper(XclChPropertyMode ePropMode)
Returns a hatch property set helper according to the passed property mode.
Definition: xlchart.cxx:1143
const sal_uInt16 EXC_CHFRAME_STANDARD
Definition: xlchart.hxx:518
virtual ~XclChRootData()
Definition: xlchart.cxx:1233
XclChObjectType
Enumerates different object types for specific automatic formatting behaviour.
Definition: xlchart.hxx:1111
ESCHER_FillSolid
const sal_uInt16 EXC_CHDATERANGE_AUTOMIN
Definition: xlchart.hxx:712
static sal_Int32 GetHmmFromTwips(sal_Int32 nTwips)
Returns the length in 1/100 mm calculated from a length in twips.
Definition: xltools.cxx:300
const sal_uInt16 EXC_CHMARKERFORMAT_STDDEV
Definition: xlchart.hxx:279
Radar charts (linear or filled).
Definition: xlchart.hxx:1193
const sal_uInt16 EXC_ID_CHAREA
Definition: xlchart.hxx:358
double mfUnitSizeY
Size of a chart X unit (1/4000 of chart width) in 1/100 mm.
Definition: xlchart.hxx:1420
const sal_Int16 EXC_CHLINEFORMAT_HAIR
Definition: xlchart.hxx:260
static sal_uInt16 GetTwipsFromHmm(sal_Int32 nHmm)
Returns the length in twips calculated from a length in 1/100 mm.
Definition: xltools.cxx:280
OUString InsertObject(const css::uno::Any &rObj)
Inserts a named formatting object into the chart document.
Definition: xlchart.cxx:574
void ReadLineProperties(XclChLineFormat &rLineFmt, XclChObjectTable &rDashTable, const ScfPropertySet &rPropSet, XclChPropertyMode ePropMode)
Reads all line properties from the passed property set.
Definition: xlchart.cxx:653
const sal_uInt8 EXC_CHSERERR_YMINUS
Definition: xlchart.hxx:674
Horizontal bar chart.
Definition: xlchart.hxx:1173
constexpr TypedWhichId< XFillTransparenceItem > XATTR_FILLTRANSPARENCE(XATTR_FILL_FIRST+5)
const sal_uInt16 EXC_CHLINEFORMAT_NONE
Definition: xlchart.hxx:255
constexpr TypedWhichId< XFillGradientItem > XATTR_FILLGRADIENT(XATTR_FILL_FIRST+2)
bool operator<(const XclChDataPointPos &rL, const XclChDataPointPos &rR)
Definition: xlchart.cxx:72
sal_uInt16 mnFlags
Fill pattern.
Definition: xlchart.hxx:804
Common objects, no special handling.
Definition: xlchart.hxx:1084
const XclChTypeInfo & GetTypeInfoFromRecId(sal_uInt16 nRecId) const
Returns the first fitting chart type info for an Excel chart type record identifier.
Definition: xlchart.cxx:520
const sal_uInt16 EXC_CHAXESSET_SECONDARY
Definition: xlchart.hxx:584
const sal_uInt8 EXC_CHLEGEND_RIGHT
Definition: xlchart.hxx:331
const sal_uInt16 EXC_CHFRAME_AUTOSIZE
Definition: xlchart.hxx:521
constexpr TypedWhichId< XFillBitmapItem > XATTR_FILLBITMAP(XATTR_FILL_FIRST+4)
Floor formatting in 3d charts.
Definition: xlchart.hxx:1117
const sal_uInt16 EXC_CHTEXT_TRANSPARENT
Definition: xlchart.hxx:469
void FinishConversion()
Finishes the API chart document conversion.
Definition: xlchart.cxx:1260
const sal_uInt16 EXC_CHSCATTER_AREA
Definition: xlchart.hxx:375
sal_Int32 mnType
void InitConversion(const XclRoot &rRoot, const css::uno::Reference< css::chart2::XChartDocument > &rxChartDoc, const tools::Rectangle &rChartRect)
Starts the API chart document conversion.
Definition: xlchart.cxx:1237
const sal_uInt16 EXC_COLOR_CHWINDOWTEXT
System button background color (face color).
Definition: xlstyle.hxx:211
const sal_uInt8 EXC_CHSERERR_FIXED
Definition: xlchart.hxx:677
const sal_uInt8 EXC_CHSERERR_XPLUS
For internal use only.
Definition: xlchart.hxx:671
const sal_uInt8 EXC_CHSERERR_XMINUS
Definition: xlchart.hxx:672
const sal_Int32 EXC_CHART_AXIS_X
For internal use only.
Definition: xlchart.hxx:156
const sal_uInt16 EXC_CHVALUERANGE_AUTOCROSS
Definition: xlchart.hxx:426
static Color GetPatternColor(const Color &rPattColor, const Color &rBackColor, sal_uInt16 nXclPattern)
Returns the best fitting color for an Excel pattern area format.
Definition: xltools.cxx:348
Donut chart.
Definition: xlchart.hxx:1180
const sal_Int32 EXC_CHART_AXIS_NONE
Automatic rotation, e.g. axis labels (internal use only).
Definition: xlchart.hxx:155
const sal_Int32 EXC_CHART_AXESSET_PRIMARY
For internal use only.
Definition: xlchart.hxx:160
sal_Int32 mnWeight
const sal_uInt16 EXC_CHDATERANGE_AUTOMINOR
Definition: xlchart.hxx:715
sal_Int32 GetHmmFromPixelY(double fPixelY) const
Calculates the height of the passed number of pixels in 1/100 mm.
Definition: xlroot.cxx:234
const sal_uInt16 EXC_CHMARKERFORMAT_CROSS
Definition: xlchart.hxx:276
sal_uInt16 mnAxesSetId
Position of the axes set (inner plot area).
Definition: xlchart.hxx:1070
ScfPropSetHelper maGradHlpCommon
Properties for areas in filled series.
Definition: xlchart.hxx:1392
bool get_flag(Type nBitField, Type nMask)
Returns true, if at least one of the bits set in nMask is set in nBitField.
Definition: ftools.hxx:73
XclChDateRange()
Additional flags.
Definition: xlchart.cxx:275
const sal_uInt16 EXC_CHPICFORMAT_NONE
Definition: xlchart.hxx:547
#define EXC_CHPROP_TEXTROTATION
Definition: xlchart.hxx:129
const sal_uInt16 EXC_CHDATERANGE_AUTOMAX
Definition: xlchart.hxx:713
XclChFramePos()
Bottom-right position mode.
Definition: xlchart.cxx:88
const sal_uInt16 EXC_CHLINEFORMAT_DASHDOTDOT
Definition: xlchart.hxx:254
XclChFrBlock(sal_uInt16 nType)
Optional secondary value for current context.
Definition: xlchart.cxx:78
const sal_uInt16 EXC_CHLINEFORMAT_MEDTRANS
Definition: xlchart.hxx:257
const sal_uInt16 EXC_CHMARKERFORMAT_STAR
Definition: xlchart.hxx:277
const sal_uInt16 EXC_CHCHART3D_AUTOHEIGHT
false = Z axis, true = clustered/stacked.
Definition: xlchart.hxx:539
const sal_uInt16 EXC_CHMARKERFORMAT_NOSYMBOL
Definition: xlchart.hxx:272
Linear radar chart.
Definition: xlchart.hxx:1177
XclChType()
Additional flags (all chart types).
Definition: xlchart.cxx:223
XclChChart3d()
Additional flags.
Definition: xlchart.cxx:234
static css::uno::Reference< css::uno::XInterface > CreateInstance(const css::uno::Reference< css::lang::XMultiServiceFactory > &xFactory, const OUString &rServiceName)
Creates an instance from the passed service name, using the passed service factory.
const sal_uInt16 EXC_CHLEGEND_DOCKED
Definition: xlchart.hxx:339
static sal_uInt8 GetXclRotation(sal_Int32 nScRot)
Calculates the Excel angle value from an angle in 1/100 of degrees.
Definition: xltools.cxx:161
const sal_uInt8 EXC_CHTICK_NEXT
Above diagram/left of diagram.
Definition: xlchart.hxx:409
const sal_uInt16 EXC_CHLINEFORMAT_AUTO
Definition: xlchart.hxx:265
const sal_uInt16 EXC_CHLINEFORMAT_SOLID
Definition: xlchart.hxx:250
XclChTypeId
Enumerates all kinds of different chart types.
Definition: xlchart.hxx:1169
#define EXC_CHPROP_ROLE_ERRORBARS_NEGY
Definition: xlchart.hxx:138
Line charts (line, area, stock charts).
Definition: xlchart.hxx:1192
const sal_uInt16 EXC_CHMARKERFORMAT_TRIANGLE
Definition: xlchart.hxx:275
Filled radar chart.
Definition: xlchart.hxx:1178
const sal_Int16 EXC_CHLINEFORMAT_TRIPLE
Definition: xlchart.hxx:263
#define ESCHER_Prop_fillBackColor
const sal_uInt16 EXC_CHOBJLINK_NONE
Definition: xlchart.hxx:506
ScfPropSetHelper maAreaHlpCommon
Properties for lines in filled series.
Definition: xlchart.hxx:1390
Scatter (XY) chart.
Definition: xlchart.hxx:1182
uno::Sequence< double > maFillColor
sal_Int32 mnIndex
Base of names for inserted objects.
Definition: xlchart.hxx:1306
XclChObjectTableRef mxGradientTable
Container for line dash styles.
Definition: xlchart.hxx:1413
sal_Int32 mnTop
const sal_uInt16 EXC_CHAXIS_Z
Definition: xlchart.hxx:396
sal_uInt8 GetGreen() const
#define ESCHER_Prop_fillColor
XclChAxis()
Axis type.
Definition: xlchart.cxx:314
ScfPropSetHelper maGradHlpFilled
Properties for gradients in common objects.
Definition: xlchart.hxx:1393
#define SERVICE_DRAWING_BITMAPTABLE
Definition: xlchart.hxx:41
XclChObjectTableRef mxBitmapTable
Container for hatch fill styles.
Definition: xlchart.hxx:1415
const sal_uInt16 EXC_CHTEXT_AUTOFILL
Text object is removed.
Definition: xlchart.hxx:479
A wrapper for a UNO property set.
Definition: fapihelper.hxx:104
const sal_Int32 EXC_CHART_AXESSET_NONE
API Z axis index.
Definition: xlchart.hxx:159
const sal_uInt16 EXC_CHMARKERFORMAT_AUTO
Automatic symbol size for triple lines.
Definition: xlchart.hxx:288
constexpr TypedWhichId< XFillColorItem > XATTR_FILLCOLOR(XATTR_FILL_FIRST+1)
XclChObjectTableRef mxLineDashTable
Provides info about auto formatting.
Definition: xlchart.hxx:1412
const sal_uInt16 EXC_CHDATERANGE_AUTOBASE
Definition: xlchart.hxx:717
const sal_uInt16 EXC_COLOR_CHBORDERAUTO
System window background color (BIFF8 charts).
Definition: xlstyle.hxx:213
static OUString GetErrorBarValuesRole(sal_uInt8 nBarType)
Returns the role name for a manual data source for error bars.
Definition: xlchart.cxx:401
ScfPropSetHelper maAreaHlpFilled
Properties for areas in common objects.
Definition: xlchart.hxx:1391
Area chart.
Definition: xlchart.hxx:1175
const sal_uInt16 EXC_CHVALUERANGE_AUTOMIN
Definition: xlchart.hxx:422
static sal_Int32 GetScRotation(sal_uInt16 nXclRot, sal_Int32 nRotForStacked)
Calculates an angle (in 1/100 of degrees) from an Excel angle value.
Definition: xltools.cxx:153
const sal_uInt8 EXC_PATT_SOLID
Definition: xlstyle.hxx:56
sal_uInt16 mnPointIdx
Series index of series or a data point.
Definition: xlchart.hxx:757
XclChSerErrorBar()
Type of the line ends.
Definition: xlchart.cxx:202
void Set(const XclChTypeInfo &rTypeInfo, bool b3dChart, bool bSpline)
Definition: xlchart.cxx:500
XclChFrLabelProps()
Flags indicating which values to be displayed.
Definition: xlchart.cxx:148
ScfPropSetHelper & GetAreaHelper(XclChPropertyMode ePropMode)
Returns an area property set helper according to the passed property mode.
Definition: xlchart.cxx:1121
const sal_uInt32 EXC_CHMARKERFORMAT_SINGLESIZE
Automatic symbol size for hair lines.
Definition: xlchart.hxx:284
XclChDataPointPos(sal_uInt16 nSeriesIdx=EXC_CHSERIES_INVALID, sal_uInt16 nPointIdx=EXC_CHDATAFORMAT_ALLPOINTS)
Index of a data point inside a series.
Definition: xlchart.cxx:66
unsigned char sal_uInt8
ScfPropSetHelper maHatchHlpCommon
Properties for gradients in filled series.
Definition: xlchart.hxx:1394
OUString maServiceName
Container for the objects.
Definition: xlchart.hxx:1304
const sal_uInt16 EXC_CHVALUERANGE_BIT8
Other axis crosses at own maximum.
Definition: xlchart.hxx:430
const OUString maServiceName
Specifies the position of a data series or data point.
Definition: xlchart.hxx:754
#define ESCHER_Prop_fNoFillHitTest
const sal_uInt16 EXC_CHART_AUTOROTATION
Definition: xlchart.hxx:153
XclChValueRange()
Additional flags.
Definition: xlchart.cxx:291
sal_Int32 mnBorderGapY
Border gap to chart space in 1/100mm.
Definition: xlchart.hxx:1418
const sal_uInt16 EXC_CHFRAMEPOS_PARENT
Definition: xlchart.hxx:643
XclChProperties()
Plotting mode for empty cells.
Definition: xlchart.cxx:259
const sal_uInt16 EXC_CHLEGEND_AUTOPOSX
Definition: xlchart.hxx:341
const sal_uInt16 EXC_COLOR_CHWINDOWBACK
System window text color (BIFF8 charts).
Definition: xlstyle.hxx:212
const ::std::vector< Color > ImpSvNumberformatScan::StandardColor COL_WHITE
static sal_uInt16 GetSeriesLineAutoColorIdx(sal_uInt16 nFormatIdx)
Returns a palette index for automatic series line colors.
Definition: xlchart.cxx:349
static sal_uInt16 GetSeriesFillAutoColorIdx(sal_uInt16 nFormatIdx)
Returns a palette index for automatic series fill colors.
Definition: xlchart.cxx:364
const sal_uInt16 EXC_CHPICFORMAT_STRETCH
For internal use only.
Definition: xlchart.hxx:548
sal_Int32 mnBorderGapX
Maps title shape getter functions.
Definition: xlchart.hxx:1417
const sal_uInt8 EXC_CHSERTREND_POLYNOMIAL
Definition: xlchart.hxx:627
XclChPicFormat()
Picture scaling (units).
Definition: xlchart.cxx:118
static sal_uInt16 ReadRotationProperties(const ScfPropertySet &rPropSet, bool bSupportsStacked)
Reads rotation properties from the passed property set.
Definition: xlchart.cxx:893
const sal_uInt16 EXC_CHVALUERANGE_AUTOMAJOR
Definition: xlchart.hxx:424
#define ESCHER_Prop_fillType
double mnWidth
Surface chart.
Definition: xlchart.hxx:1184
ScfPropSetHelper & GetLineHelper(XclChPropertyMode ePropMode)
Returns a line property set helper according to the passed property mode.
Definition: xlchart.cxx:1109
XclChAxesSet()
Primary/secondary axes set.
Definition: xlchart.cxx:331
XclChExtTypeInfo(const XclChTypeInfo &rTypeInfo)
Series lines are smoothed.
Definition: xlchart.cxx:493
#define EXC_CHPROP_ROLE_ERRORBARS_NEGX
Definition: xlchart.hxx:137
void insert_value(Type &rnBitField, InsertType nValue, sal_uInt8 nStartBit, sal_uInt8 nBitCount)
Inserts a value into a bitfield.
Definition: ftools.hxx:100
QPRO_FUNC_TYPE nType
Definition: qproform.cxx:401
const ::std::vector< Color > ImpSvNumberformatScan::StandardColor COL_BLACK
static void WriteMarkerProperties(ScfPropertySet &rPropSet, const XclChMarkerFormat &rMarkerFmt)
Writes all marker properties to the passed property set.
Definition: xlchart.cxx:1060
sal_uInt16 mnMarkerType
Size of a marker.
Definition: xlchart.hxx:892
Color maFillColor
Border line color.
Definition: xlchart.hxx:890
css::uno::Reference< css::chart2::XChartDocument > mxChartDoc
Definition: xlchart.hxx:1408
Axis line format.
Definition: xlchart.hxx:1122
XclChObjectTableRef mxHatchTable
Container for gradient fill styles.
Definition: xlchart.hxx:1414
const sal_uInt8 EXC_ROT_NONE
Text orientation: 90 deg clockwise.
Definition: xlconst.hxx:144
Wall formatting in 3d charts.
Definition: xlchart.hxx:1116
XclChTypeGroup()
Chart type group index.
Definition: xlchart.cxx:253
Only supported, if type group contains only one series.
Definition: xlchart.hxx:1203
double mfScale
const sal_uInt16 EXC_CHLINEFORMAT_LIGHTTRANS
Definition: xlchart.hxx:258
void SetProperty(const OUString &rPropName, const Type &rValue)
Puts the passed value into the property set.
Definition: fapihelper.hxx:175
const sal_uInt8 EXC_PATT_NONE
Definition: xlstyle.hxx:55
Color maBackColor
Pattern color.
Definition: xlchart.hxx:802
const sal_uInt16 EXC_ID_CHSCATTER
Definition: xlchart.hxx:373
static void ReadMarkerProperties(XclChMarkerFormat &rMarkerFmt, const ScfPropertySet &rPropSet, sal_uInt16 nFormatIdx)
Reads all marker properties from the passed property set.
Definition: xlchart.cxx:841
Reference< XSingleServiceFactory > xFactory
const sal_uInt16 EXC_CHFRAME_AUTOPOS
Definition: xlchart.hxx:522
const sal_uInt16 EXC_CHLINEFORMAT_DASH
Definition: xlchart.hxx:251
ScfPropSetHelper maLineHlpLinear
Properties for lines in common objects.
Definition: xlchart.hxx:1388
sal_uInt16 mnPattern
Pattern background color.
Definition: xlchart.hxx:803
const sal_uInt16 EXC_CHPICFORMAT_TOPBOTTOM
Bitmap scaled to axis scale.
Definition: xlchart.hxx:552
XclChObjectTable(css::uno::Reference< css::lang::XMultiServiceFactory > const &xFactory, const OUString &rServiceName, const OUString &rObjNameBase)
Definition: xlchart.cxx:542
sal_uInt16 mnBmpMode
Definition: xlchart.hxx:826
#define EXC_CHPROP_ROLE_ERRORBARS_POSX
Definition: xlchart.hxx:139
const sal_uInt16 EXC_ID_CHSURFACE
Definition: xlchart.hxx:574
const sal_uInt16 EXC_ID_CHPIE
Definition: xlchart.hxx:366
const sal_uInt16 EXC_CHVALUERANGE_AUTOMINOR
Definition: xlchart.hxx:425
const sal_uInt16 EXC_CHMARKERFORMAT_DOWJ
Definition: xlchart.hxx:278
int mnIndex
const sal_uInt16 EXC_CHDATERANGE_AUTOCROSS
Definition: xlchart.hxx:718
Generic helper class for reading from and writing to property sets.
Definition: fapihelper.hxx:214
XclChEscherFormat()
Container for Escher properties export.
Definition: xlchart.cxx:110
const XclChTypeInfo & GetTypeInfo(XclChTypeId eType) const
Returns chart type info for a unique chart type identifier.
Definition: xlchart.cxx:513
const sal_uInt8 EXC_CHLEGEND_MEDIUM
Definition: xlchart.hxx:336
const sal_uInt16 EXC_CHMARKERFORMAT_SQUARE
Definition: xlchart.hxx:273
css::uno::Reference< css::container::XNameContainer > mxContainer
Factory to create the container.
Definition: xlchart.hxx:1303
const sal_uInt16 EXC_CHMARKERFORMAT_NOLINE
Definition: xlchart.hxx:290
Access to global data for a filter object (imported or exported document) from other classes...
Definition: xlroot.hxx:126
White-day drop bar in stock charts.
Definition: xlchart.hxx:1128
Vertical bar chart.
Definition: xlchart.hxx:1172
sal_Int32 GetApiAxisDimension() const
Returns the axis dimension index used by the chart API.
Definition: xlchart.cxx:319
bool GetProperty(Type &rValue, const OUString &rPropName) const
Gets the specified property from the property set.
Definition: fapihelper.hxx:149
void ReadEscherProperties(XclChEscherFormat &rEscherFmt, XclChPicFormat &rPicFmt, XclChObjectTable &rGradientTable, XclChObjectTable &rHatchTable, XclChObjectTable &rBitmapTable, const ScfPropertySet &rPropSet, XclChPropertyMode ePropMode)
Reads gradient or bitmap area properties from the passed property set.
Definition: xlchart.cxx:747
const sal_Int16 EXC_CHLINEFORMAT_DOUBLE
Definition: xlchart.hxx:262
Wall formatting in 2d charts.
Definition: xlchart.hxx:1115
const sal_uInt16 EXC_CHTEXT_AUTOCOLOR
Definition: xlchart.hxx:472
const sal_uInt8 EXC_CHSERERR_NONE
Definition: xlchart.hxx:670
const sal_uInt16 EXC_CHAREAFORMAT_AUTO
Definition: xlchart.hxx:296
double mfIntercept
Definition: xlchart.hxx:917
const sal_uInt16 EXC_CHLINEFORMAT_DARKTRANS
Definition: xlchart.hxx:256
#define MID_BITMAP
const sal_uInt8 EXC_CH3DDATAFORMAT_RECT
Definition: xlchart.hxx:697
Series error bar.
Definition: xlchart.hxx:1125
Pie and donut charts.
Definition: xlchart.hxx:1194
const sal_uInt16 EXC_CHLEGEND_AUTOPOSY
Definition: xlchart.hxx:342
const sal_uInt16 EXC_CHAXIS_Y
Definition: xlchart.hxx:395
const XclChTypeInfo & GetTypeInfoFromService(const OUString &rServiceName) const
Returns the first fitting chart type info for the passed service name.
Definition: xlchart.cxx:531
const sal_uInt16 EXC_CHAXIS_X
Definition: xlchart.hxx:394
css::uno::Any GetObject(const OUString &rObjName)
Returns a named formatting object from the chart document.
Definition: xlchart.cxx:551
#define SERVICE_DRAWING_GRADIENTTABLE
Definition: xlchart.hxx:43
XclChText()
Text object rotation (BIFF8+).
Definition: xlchart.cxx:153
bool mbSpline
Chart is actually a 3D chart.
Definition: xlchart.hxx:1232
const sal_uInt16 EXC_CHTICK_AUTOROT
Definition: xlchart.hxx:416
XclCh3dDataFormat()
Top edge mode.
Definition: xlchart.cxx:175
const sal_uInt16 EXC_ID_CHRADARAREA
Definition: xlchart.hxx:567
Provides access to chart type info structs for all available chart types.
Definition: xlchart.hxx:1247