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