LibreOffice Module chart2 (master) 1
ObjectIdentifier.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 <sal/config.h>
21
22#include <cstddef>
23#include <map>
24
25#include <ObjectIdentifier.hxx>
26#include <TitleHelper.hxx>
27#include <ChartModel.hxx>
28#include <ChartModelHelper.hxx>
29#include <ChartType.hxx>
30#include <GridProperties.hxx>
31#include <Axis.hxx>
32#include <AxisHelper.hxx>
34#include <DiagramHelper.hxx>
35#include <Diagram.hxx>
36#include <unonames.hxx>
38#include <DataSeries.hxx>
40
41#include <com/sun/star/chart2/XAxis.hpp>
42#include <com/sun/star/awt/Point.hpp>
43#include <com/sun/star/drawing/XShape.hpp>
44
45#include <rtl/ustrbuf.hxx>
47#include <o3tl/safeint.hxx>
48#include <o3tl/string_view.hxx>
49#include <utility>
50
51namespace com::sun::star::drawing { class XShape; }
52
53namespace chart
54{
55using namespace ::com::sun::star;
56using namespace ::com::sun::star::chart2;
57
58using ::com::sun::star::uno::Reference;
59using ::com::sun::star::uno::Any;
60
61constexpr OUStringLiteral m_aMultiClick = u"MultiClick";
62constexpr OUStringLiteral m_aDragMethodEquals = u"DragMethod=";
63constexpr OUStringLiteral m_aDragParameterEquals = u"DragParameter=";
64constexpr OUStringLiteral m_aProtocol = u"CID/";
65const OUString m_aPieSegmentDragMethodServiceName("PieSegmentDragging");
66
67namespace
68{
69
70OUString lcl_createClassificationStringForType( ObjectType eObjectType
71 , std::u16string_view rDragMethodServiceName
72 , std::u16string_view rDragParameterString
73 )
74{
75 OUStringBuffer aRet;
76 switch( eObjectType )
77 {
78 //these object types are all selected only after their parents was selected before
79 case OBJECTTYPE_LEGEND_ENTRY: //parent is intended to be OBJECTTYPE_LEGEND
80 case OBJECTTYPE_DATA_POINT: //parent is intended to be OBJECTTYPE_DATA_SERIES
81 case OBJECTTYPE_DATA_LABEL: //parent is intended to be OBJECTTYPE_DATA_LABELS
82 case OBJECTTYPE_DATA_ERRORS_X: //parent is intended to be OBJECTTYPE_DATA_ERRORS
83 case OBJECTTYPE_DATA_ERRORS_Y: //parent is intended to be OBJECTTYPE_DATA_ERRORS
84 case OBJECTTYPE_DATA_ERRORS_Z: //parent is intended to be OBJECTTYPE_DATA_ERRORS
85 aRet=m_aMultiClick;
86 break;
87 default:
88 break;//empty string
89 }
90 if( !rDragMethodServiceName.empty() )
91 {
92 if( !aRet.isEmpty() )
93 aRet.append(":");
94 aRet.append( OUString::Concat(m_aDragMethodEquals) + rDragMethodServiceName );
95
96 if( !rDragParameterString.empty() )
97 {
98 if( !aRet.isEmpty() )
99 aRet.append(":");
100 aRet.append( OUString::Concat(m_aDragParameterEquals) + rDragParameterString );
101 }
102 }
103 return aRet.makeStringAndClear();
104}
105
106typedef std::map< TitleHelper::eTitleType, OUString > tTitleMap;
107const tTitleMap& lcl_getTitleMap()
108{
109 //maps the title type to the ParentParticle for that title
110 static tTitleMap s_aTitleMap{
112 {TitleHelper::SUB_TITLE, "D=0"},
113 {TitleHelper::X_AXIS_TITLE, "D=0:CS=0:Axis=0,0"},
114 {TitleHelper::Y_AXIS_TITLE, "D=0:CS=0:Axis=1,0"},
115 {TitleHelper::Z_AXIS_TITLE, "D=0:CS=0:Axis=2,0"},
116 {TitleHelper::SECONDARY_X_AXIS_TITLE, "D=0:CS=0:Axis=0,1"},
117 {TitleHelper::SECONDARY_Y_AXIS_TITLE, "D=0:CS=0:Axis=1,1"}};
118 return s_aTitleMap;
119}
120
121OUString lcl_getTitleParentParticle( TitleHelper::eTitleType aTitleType )
122{
123 OUString aRet;
124
125 const tTitleMap& rMap = lcl_getTitleMap();
126 tTitleMap::const_iterator aIt( rMap.find( aTitleType ) );
127 if( aIt != rMap.end())
128 aRet = (*aIt).second;
129
130 return aRet;
131}
132
133rtl::Reference<ChartType> lcl_getFirstStockChartType( const rtl::Reference<::chart::ChartModel>& xChartModel )
134{
135 rtl::Reference< Diagram > xDiagram( xChartModel->getFirstChartDiagram() );
136 if(!xDiagram.is())
137 return nullptr;
138
139 //iterate through all coordinate systems
140
141 const std::vector< rtl::Reference< BaseCoordinateSystem > > & aCooSysList( xDiagram->getBaseCoordinateSystems() );
142 for( rtl::Reference< BaseCoordinateSystem > const & coords : aCooSysList )
143 {
144 //iterate through all chart types in the current coordinate system
145 for( rtl::Reference< ChartType > const & xChartType : coords->getChartTypes2() )
146 {
147 OUString aChartType = xChartType->getChartType();
148 if( aChartType.equalsIgnoreAsciiCase(CHART2_SERVICE_NAME_CHARTTYPE_CANDLESTICK) )
149 return xChartType;
150 }
151 }
152 return nullptr;
153}
154
155std::u16string_view lcl_getIndexStringAfterString( std::u16string_view rString, std::u16string_view rSearchString )
156{
157 size_t nIndexStart = rString.rfind( rSearchString );
158 if( nIndexStart == std::u16string_view::npos )
159 return std::u16string_view();
160 nIndexStart += rSearchString.size();
161 size_t nIndexEnd = rString.size();
162 size_t nNextColon = rString.find( ':', nIndexStart );
163 if( nNextColon != std::u16string_view::npos )
164 nIndexEnd = nNextColon;
165 return rString.substr(nIndexStart,nIndexEnd-nIndexStart);
166}
167
168sal_Int32 lcl_StringToIndex( std::u16string_view rIndexString )
169{
170 sal_Int32 nRet = -1;
171 if( !rIndexString.empty() )
172 {
173 nRet = o3tl::toInt32(rIndexString);
174 if( nRet < -1 )
175 nRet = -1;
176 }
177 return nRet;
178}
179
180void lcl_parseCooSysIndices( sal_Int32& rnDiagram, sal_Int32& rnCooSys, std::u16string_view rString )
181{
182 rnDiagram = lcl_StringToIndex( lcl_getIndexStringAfterString( rString, u"D=" ) );
183 rnCooSys = lcl_StringToIndex( lcl_getIndexStringAfterString( rString, u"CS=" ) );
184}
185
186void lcl_parseAxisIndices( sal_Int32& rnDimensionIndex, sal_Int32& rnAxisIndex, std::u16string_view rString )
187{
188 std::u16string_view aAxisIndexString = lcl_getIndexStringAfterString( rString, u":Axis=" );
189 sal_Int32 nCharacterIndex=0;
190 rnDimensionIndex = lcl_StringToIndex( o3tl::getToken(aAxisIndexString, 0, ',', nCharacterIndex ) );
191 rnAxisIndex = lcl_StringToIndex( o3tl::getToken(aAxisIndexString, 0, ',', nCharacterIndex ) );
192}
193
194void lcl_parseGridIndices( sal_Int32& rnSubGridIndex, std::u16string_view rString )
195{
196 rnSubGridIndex = -1;
197 rnSubGridIndex = lcl_StringToIndex( lcl_getIndexStringAfterString( rString, u":SubGrid=" ) );
198}
199
200void lcl_parseSeriesIndices( sal_Int32& rnChartTypeIndex, sal_Int32& rnSeriesIndex, sal_Int32& rnPointIndex, std::u16string_view rString )
201{
202 rnChartTypeIndex = lcl_StringToIndex( lcl_getIndexStringAfterString( rString, u"CT=" ) );
203 rnSeriesIndex = lcl_StringToIndex( lcl_getIndexStringAfterString( rString, u"Series=" ) );
204 rnPointIndex = lcl_StringToIndex( lcl_getIndexStringAfterString( rString, u"Point=" ) );
205}
206
207void lcl_getDiagramAndCooSys( std::u16string_view rObjectCID
208 , const rtl::Reference<::chart::ChartModel>& xChartModel
209 , rtl::Reference< Diagram >& xDiagram
211{
212 sal_Int32 nDiagramIndex = -1;
213 sal_Int32 nCooSysIndex = -1;
214 lcl_parseCooSysIndices( nDiagramIndex, nCooSysIndex, rObjectCID );
215 xDiagram = xChartModel->getFirstChartDiagram();//todo use nDiagramIndex when more than one diagram is possible in future
216 if( !xDiagram.is() )
217 return;
218
219 if( nCooSysIndex > -1 )
220 {
221 const std::vector< rtl::Reference< BaseCoordinateSystem > > aCooSysList( xDiagram->getBaseCoordinateSystems() );
222 if( o3tl::make_unsigned(nCooSysIndex) < aCooSysList.size() )
223 xCooSys = aCooSysList[nCooSysIndex];
224 }
225}
226
227} //anonymous namespace
228
230{
231}
232
234 :m_aObjectCID(std::move( aObjectCID ))
235{
236}
237
239 : m_xAdditionalShape( rxShape )
240{
241}
242
243ObjectIdentifier::ObjectIdentifier( const Any& rAny )
244{
245 const uno::Type& rType = rAny.getValueType();
246 if ( rType == cppu::UnoType<OUString>::get() )
247 {
248 rAny >>= m_aObjectCID;
249 }
250 else if ( rType == cppu::UnoType< drawing::XShape >::get() )
251 {
252 rAny >>= m_xAdditionalShape;
253 }
254}
255
257{
260}
261
263{
264 return !operator==( rOID );
265}
266
268{
269 bool bReturn = false;
270 if ( !(m_aObjectCID.isEmpty() || rOID.m_aObjectCID.isEmpty()) )
271 {
272 bReturn = ( m_aObjectCID.compareTo( rOID.m_aObjectCID ) < 0 );
273 }
274 else if ( !m_aObjectCID.isEmpty() )
275 {
276 bReturn = true;
277 }
278 else if ( !rOID.m_aObjectCID.isEmpty() )
279 {
280 bReturn = false;
281 }
282 else if ( m_xAdditionalShape.is() && rOID.m_xAdditionalShape.is() )
283 {
284 bReturn = ( m_xAdditionalShape < rOID.m_xAdditionalShape );
285 }
286 return bReturn;
287}
288
291 , const rtl::Reference<::chart::ChartModel>& xChartModel )
292{
293 TitleHelper::eTitleType aTitleType;
294 OUString aRet;
295 const std::u16string_view aObjectID;
296 const std::u16string_view aDragMethodServiceName;
297 const std::u16string_view aDragParameterString;
298 if( TitleHelper::getTitleType( aTitleType, xTitle, xChartModel ) )
299 {
300 enum ObjectType eObjectType = OBJECTTYPE_TITLE;
301 OUString aParentParticle = lcl_getTitleParentParticle( aTitleType );
303 eObjectType, aObjectID, aParentParticle, aDragMethodServiceName, aDragParameterString );
304 }
305 return aRet;
306}
307
309 const Reference< uno::XInterface >& xObject
310 , const rtl::Reference<::chart::ChartModel>& xChartModel )
311{
312 OUString aRet;
313
314 enum ObjectType eObjectType = OBJECTTYPE_UNKNOWN;
315 const std::u16string_view aObjectID;
316 OUString aParentParticle;
317 const std::u16string_view aDragMethodServiceName;
318 const std::u16string_view aDragParameterString;
319
320 try
321 {
322 //title
323 if( ::chart::Title* pTitle = dynamic_cast<::chart::Title*>(xObject.get()) )
325
326 uno::Reference<chart2::XDataTable> xDataTable(xObject, uno::UNO_QUERY);
327 if (xDataTable.is())
328 {
330 }
331
332 //axis
333 rtl::Reference< Axis > xAxis = dynamic_cast<Axis*>( xObject.get() );
334 if( xAxis.is() )
335 {
336 rtl::Reference<Diagram> xDiagram = xChartModel->getFirstChartDiagram();
338 OUString aCooSysParticle( createParticleForCoordinateSystem( xCooSys, xChartModel ) );
339 sal_Int32 nDimensionIndex=-1;
340 sal_Int32 nAxisIndex=-1;
341 AxisHelper::getIndicesForAxis( xAxis, xCooSys, nDimensionIndex, nAxisIndex );
342 OUString aAxisParticle( createParticleForAxis( nDimensionIndex, nAxisIndex ) );
343 return createClassifiedIdentifierForParticles( aCooSysParticle, aAxisParticle );
344 }
345
346 //legend
347 Reference< XLegend > xLegend( xObject, uno::UNO_QUERY );
348 if( xLegend.is() )
349 {
351 }
352
353 //diagram
354 Reference< XDiagram > xDiagram( xObject, uno::UNO_QUERY );
355 if( xDiagram.is() )
356 {
358 }
359
360 //todo
361 //XDataSeries
362 //CooSys
363 //charttype
364 //datapoint?
365 //Gridproperties
366 }
367 catch(const uno::Exception&)
368 {
369 DBG_UNHANDLED_EXCEPTION("chart2");
370 }
371
372 if( eObjectType != OBJECTTYPE_UNKNOWN )
373 {
375 eObjectType, aObjectID, aParentParticle, aDragMethodServiceName, aDragParameterString );
376 }
377 else
378 {
379 OSL_FAIL("give object could not be identified in createClassifiedIdentifierForObject");
380 }
381
382 return aRet;
383}
384
386 const rtl::Reference< Legend >& xLegend
387 , const rtl::Reference<::chart::ChartModel>& xChartModel )
388{
389 try
390 {
391 if( xLegend.is() )
392 {
394 }
395 }
396 catch(const uno::Exception&)
397 {
398 DBG_UNHANDLED_EXCEPTION("chart2");
399 }
400
401 OSL_FAIL("give object could not be identified in createClassifiedIdentifierForObject");
402
403 return OUString();
404}
405
408 , const rtl::Reference<::chart::ChartModel>& xChartModel )
409{
410 try
411 {
412 //axis
413 if( xAxis.is() )
414 {
415 rtl::Reference<Diagram> xDiagram = xChartModel->getFirstChartDiagram();
417 OUString aCooSysParticle( createParticleForCoordinateSystem( xCooSys, xChartModel ) );
418 sal_Int32 nDimensionIndex=-1;
419 sal_Int32 nAxisIndex=-1;
420 AxisHelper::getIndicesForAxis( xAxis, xCooSys, nDimensionIndex, nAxisIndex );
421 OUString aAxisParticle( createParticleForAxis( nDimensionIndex, nAxisIndex ) );
422 return createClassifiedIdentifierForParticles( aCooSysParticle, aAxisParticle );
423 }
424 }
425 catch(const uno::Exception&)
426 {
427 DBG_UNHANDLED_EXCEPTION("chart2");
428 }
429
430 OSL_FAIL("give object could not be identified in createClassifiedIdentifierForObject");
431
432 return OUString();
433}
434
436 std::u16string_view rParticle )
437{
439}
440
442 std::u16string_view rParentParticle
443 , std::u16string_view rChildParticle
444 , std::u16string_view rDragMethodServiceName
445 , std::u16string_view rDragParameterString )
446{
447 ObjectType eObjectType( ObjectIdentifier::getObjectType( rChildParticle ) );
448 if( eObjectType == OBJECTTYPE_UNKNOWN )
449 eObjectType = ObjectIdentifier::getObjectType( rParentParticle );
450
451 OUStringBuffer aRet( m_aProtocol +
452 lcl_createClassificationStringForType( eObjectType, rDragMethodServiceName, rDragParameterString ));
453 if(aRet.getLength() > m_aProtocol.getLength())
454 aRet.append("/");
455
456 if(!rParentParticle.empty())
457 {
458 aRet.append(rParentParticle);
459 if( !rChildParticle.empty() )
460 aRet.append(":");
461 }
462 aRet.append(rChildParticle);
463
464 return aRet.makeStringAndClear();
465}
466
468{
469 //TODO: if more than one diagram is implemented, add the correct diagram index here
470 return "D=0";
471}
472
475 , const rtl::Reference<::chart::ChartModel>& xChartModel )
476{
477 OUString aRet;
478
479 rtl::Reference< Diagram > xDiagram( xChartModel->getFirstChartDiagram() );
480 if( xDiagram.is() )
481 {
482 std::size_t nCooSysIndex = 0;
483 const std::vector< rtl::Reference< BaseCoordinateSystem > > & aCooSysList( xDiagram->getBaseCoordinateSystems() );
484 for( ; nCooSysIndex < aCooSysList.size(); ++nCooSysIndex )
485 {
486 if( xCooSys == aCooSysList[nCooSysIndex] )
487 {
488 aRet = ObjectIdentifier::createParticleForDiagram() + ":CS=" + OUString::number( nCooSysIndex );
489 break;
490 }
491 }
492 }
493
494 return aRet;
495}
496
498 sal_Int32 nDimensionIndex
499 , sal_Int32 nAxisIndex )
500{
501 return "Axis=" +
502 OUString::number( nDimensionIndex ) +
503 "," +
504 OUString::number( nAxisIndex );
505}
506
508 sal_Int32 nDimensionIndex
509 , sal_Int32 nAxisIndex )
510{
511 OUString aRet = "Axis=" + OUString::number( nDimensionIndex )
512 + "," + OUString::number( nAxisIndex ) + ":Grid=0";
513
514 return aRet;
515}
516
518 const Reference< XAxis >& xAxis
519 , const rtl::Reference<::chart::ChartModel>& xChartModel
520 , sal_Int32 nSubGridIndex )
521{
522 //-1: main grid, 0: first subgrid etc
523
524 OUString aAxisCID( createClassifiedIdentifierForObject( xAxis, xChartModel ) );
525 OUString aGridCID( addChildParticle( aAxisCID
527 if( nSubGridIndex >= 0 )
528 {
529 aGridCID = addChildParticle( aGridCID
531 }
532 return aGridCID;
533}
534
536 sal_Int32 nDiagramIndex, sal_Int32 nCooSysIndex
537 , sal_Int32 nChartTypeIndex, sal_Int32 nSeriesIndex )
538{
539 return
540 "D=" + OUString::number( nDiagramIndex ) +
541 ":CS=" + OUString::number( nCooSysIndex ) +
542 ":CT=" + OUString::number( nChartTypeIndex ) +
544 OUString::number( nSeriesIndex );
545}
546
547
550{
551 //todo: if more than one diagram is implemented, find the correct diagram which is owner of the given legend
552
554}
555
557{
559}
560
562 enum ObjectType eObjectType //e.g. OBJECTTYPE_DATA_SERIES
563 , std::u16string_view rParticleID )//e.g. SeriesID
564{
566 eObjectType, rParticleID, u"" );
567}
568
570 enum ObjectType eObjectType //e.g. OBJECTTYPE_DATA_POINT or OBJECTTYPE_GRID
571 , std::u16string_view rParticleID //e.g. Point Index or SubGrid Index
572 , std::u16string_view rParentPartical //e.g. "Series=SeriesID" or "Grid=GridId"
573 , std::u16string_view rDragMethodServiceName
574 , std::u16string_view rDragParameterString
575 )
576 //, bool bIsMultiClickObject ) //e.g. true
577{
578 //e.g. "MultiClick/Series=2:Point=34"
579
580 OUStringBuffer aRet( m_aProtocol +
581 lcl_createClassificationStringForType( eObjectType, rDragMethodServiceName, rDragParameterString ));
582 if(aRet.getLength() > m_aProtocol.getLength())
583 aRet.append("/");
584 aRet.append(rParentPartical);
585 if(!rParentPartical.empty())
586 aRet.append(":");
587
588 aRet.append(getStringForType( eObjectType ) + "=" + rParticleID);
589
590 return aRet.makeStringAndClear();
591}
592
594{
596}
597
599 sal_Int32 nOffsetPercent
600 , const awt::Point& rMinimumPosition
601 , const awt::Point& rMaximumPosition )
602{
603 OUString aRet = OUString::number( nOffsetPercent )
604 + "," + OUString::number( rMinimumPosition.X )
605 + "," + OUString::number( rMinimumPosition.Y )
606 + "," + OUString::number( rMaximumPosition.X )
607 + "," + OUString::number( rMaximumPosition.Y );
608 return aRet;
609}
610
612 std::u16string_view rDragParameterString
613 , sal_Int32& rOffsetPercent
614 , awt::Point& rMinimumPosition
615 , awt::Point& rMaximumPosition )
616{
617 sal_Int32 nCharacterIndex = 0;
618
619 std::u16string_view aValueString( o3tl::getToken(rDragParameterString, 0, ',', nCharacterIndex ) );
620 rOffsetPercent = o3tl::toInt32(aValueString);
621 if( nCharacterIndex < 0 )
622 return false;
623
624 aValueString = o3tl::getToken(rDragParameterString, 0, ',', nCharacterIndex );
625 rMinimumPosition.X = o3tl::toInt32(aValueString);
626 if( nCharacterIndex < 0 )
627 return false;
628
629 aValueString = o3tl::getToken(rDragParameterString, 0, ',', nCharacterIndex );
630 rMinimumPosition.Y = o3tl::toInt32(aValueString);
631 if( nCharacterIndex < 0 )
632 return false;
633
634 aValueString = o3tl::getToken(rDragParameterString, 0, ',', nCharacterIndex );
635 rMaximumPosition.X = o3tl::toInt32(aValueString);
636 if( nCharacterIndex < 0 )
637 return false;
638
639 aValueString = o3tl::getToken(rDragParameterString, 0, ',', nCharacterIndex );
640 rMaximumPosition.Y = o3tl::toInt32(aValueString);
641 return nCharacterIndex >= 0;
642}
643
644std::u16string_view ObjectIdentifier::getDragMethodServiceName( std::u16string_view rCID )
645{
646 std::u16string_view aRet;
647
648 size_t nIndexStart = rCID.find( m_aDragMethodEquals );
649 if( nIndexStart != std::u16string_view::npos )
650 {
651 nIndexStart = rCID.find( '=', nIndexStart );
652 if( nIndexStart != std::u16string_view::npos )
653 {
654 nIndexStart++;
655 size_t nNextSlash = rCID.find( '/', nIndexStart );
656 if( nNextSlash != std::u16string_view::npos )
657 {
658 sal_Int32 nIndexEnd = nNextSlash;
659 size_t nNextColon = rCID.find( ':', nIndexStart );
660 if( nNextColon == std::u16string_view::npos || nNextColon < nNextSlash )
661 nIndexEnd = nNextColon;
662 aRet = rCID.substr(nIndexStart,nIndexEnd-nIndexStart);
663 }
664 }
665 }
666 return aRet;
667}
668
669std::u16string_view ObjectIdentifier::getDragParameterString( std::u16string_view rCID )
670{
671 std::u16string_view aRet;
672
673 size_t nIndexStart = rCID.find( m_aDragParameterEquals );
674 if( nIndexStart != std::u16string_view::npos )
675 {
676 nIndexStart = rCID.find( '=', nIndexStart );
677 if( nIndexStart != std::u16string_view::npos )
678 {
679 nIndexStart++;
680 size_t nNextSlash = rCID.find( '/', nIndexStart );
681 if( nNextSlash != std::u16string_view::npos )
682 {
683 sal_Int32 nIndexEnd = nNextSlash;
684 size_t nNextColon = rCID.find( ':', nIndexStart );
685 if( nNextColon == std::u16string_view::npos || nNextColon < nNextSlash )
686 nIndexEnd = nNextColon;
687 aRet = rCID.substr(nIndexStart,nIndexEnd-nIndexStart);
688 }
689 }
690 }
691 return aRet;
692}
693
694bool ObjectIdentifier::isDragableObject( std::u16string_view rClassifiedIdentifier )
695{
696 bool bReturn = false;
697 ObjectType eObjectType = ObjectIdentifier::getObjectType( rClassifiedIdentifier );
698 switch( eObjectType )
699 {
700 case OBJECTTYPE_TITLE:
705 //case OBJECTTYPE_DIAGRAM_WALL:
706 bReturn = true;
707 break;
708 default:
709 std::u16string_view aDragMethodServiceName( ObjectIdentifier::getDragMethodServiceName( rClassifiedIdentifier ) );
710 bReturn = !aDragMethodServiceName.empty();
711 break;
712 }
713 return bReturn;
714}
715
717{
718 bool bReturn = false;
719 if ( isAutoGeneratedObject() )
720 {
721 bReturn = isDragableObject( m_aObjectCID );
722 }
723 else if ( isAdditionalShape() )
724 {
725 bReturn = true;
726 }
727 return bReturn;
728}
729
730bool ObjectIdentifier::isRotateableObject( std::u16string_view rClassifiedIdentifier )
731{
732 bool bReturn = false;
733 ObjectType eObjectType = ObjectIdentifier::getObjectType( rClassifiedIdentifier );
734 switch( eObjectType )
735 {
737 //case OBJECTTYPE_DIAGRAM_WALL:
738 bReturn = true;
739 break;
740 default:
741 bReturn = false;
742 break;
743 }
744 return bReturn;
745}
746
747bool ObjectIdentifier::isMultiClickObject( std::u16string_view rClassifiedIdentifier )
748{
749 //the name of a shape is it's ClassifiedIdentifier
750
751 //a MultiClickObject is an object that is selectable by more than one click only ;
752 //before a MultiClickObject can be selected it is necessary that a named parent group object
753 //was selected before;
754
756 bool bRet = o3tl::starts_with(rClassifiedIdentifier.substr( m_aProtocol.getLength() ), m_aMultiClick);
757 return bRet;
758}
759
760bool ObjectIdentifier::areSiblings( std::u16string_view rCID1, std::u16string_view rCID2 )
761{
762 bool bRet=false;
763 size_t nLastSign1 = rCID1.rfind( '=' );
764 size_t nLastSign2 = rCID2.rfind( '=' );
765 if( nLastSign1 == rCID1.find( '=' ) )//CID cannot be sibling if only one "=" occurs
766 bRet=false;
767 else if( nLastSign2 == rCID2.find( '=' ) )//CID cannot be sibling if only one "=" occurs
768 bRet=false;
769 else if( ObjectIdentifier::areIdenticalObjects( rCID1, rCID2 ) )
770 bRet=false;
771 else
772 {
773 std::u16string_view aParent1( ObjectIdentifier::getFullParentParticle( rCID1 ) );
774 if( !aParent1.empty() )
775 {
776 std::u16string_view aParent2( ObjectIdentifier::getFullParentParticle( rCID2 ) );
777 bRet=aParent1 == aParent2;
778 }
779 //legend entries are special:
780 if(!bRet)
781 {
784 bRet = true;
785 }
786 }
787 return bRet;
788}
789
790bool ObjectIdentifier::areIdenticalObjects( std::u16string_view rCID1, std::u16string_view rCID2 )
791{
792 if( rCID1 == rCID2 )
793 return true;
794 //draggable pie or donut segments need special treatment, as their CIDs do change with offset
795 {
796 if( rCID1.find( m_aPieSegmentDragMethodServiceName ) == std::u16string_view::npos
797 || rCID2.find( m_aPieSegmentDragMethodServiceName ) == std::u16string_view::npos )
798 return false;
799
800 OUString aID1( ObjectIdentifier::getObjectID( rCID1 ) );
801 OUString aID2( ObjectIdentifier::getObjectID( rCID2 ) );
802 if( !aID1.isEmpty() && aID1 == aID2 )
803 return true;
804 }
805 return false;
806}
807
809{
810 OUString aRet;
811 switch( eObjectType )
812 {
813 case OBJECTTYPE_PAGE:
814 aRet="Page";
815 break;
816 case OBJECTTYPE_TITLE:
817 aRet="Title";
818 break;
820 aRet="Legend";
821 break;
823 aRet="LegendEntry";
824 break;
826 aRet="D";
827 break;
829 aRet="DiagramWall";
830 break;
832 aRet="DiagramFloor";
833 break;
834 case OBJECTTYPE_AXIS:
835 aRet="Axis";
836 break;
838 aRet="AxisUnitLabel";
839 break;
840 case OBJECTTYPE_GRID:
841 aRet="Grid";
842 break;
844 aRet="SubGrid";
845 break;
847 aRet="Series";
848 break;
850 aRet="Point";
851 break;
853 aRet="DataLabels";
854 break;
856 aRet="DataLabel";
857 break;
859 aRet="ErrorsX";
860 break;
862 aRet="ErrorsY";
863 break;
865 aRet="ErrorsZ";
866 break;
868 aRet="Curve";
869 break;
871 aRet="Equation";
872 break;
874 aRet="Average";
875 break;
877 aRet="StockRange";
878 break;
880 aRet="StockLoss";
881 break;
883 aRet="StockGain";
884 break;
886 aRet="DataTable";
887 break;
888 default: //OBJECTTYPE_UNKNOWN
889 ;
890 }
891 return aRet;
892}
893
895{
896 ObjectType eRet;
897 size_t nLastSign = aCID.rfind( ':' );//last sign before the type string
898 if(nLastSign == std::u16string_view::npos)
899 nLastSign = aCID.rfind( '/' );
900 if(nLastSign == std::u16string_view::npos)
901 {
902 size_t nEndIndex = aCID.rfind( '=' );
903 if(nEndIndex == std::u16string_view::npos)
904 return OBJECTTYPE_UNKNOWN;
905 nLastSign = 0;
906 }
907 if( nLastSign>0 )
908 nLastSign++;
909
910 aCID = aCID.substr(nLastSign);
911 if( o3tl::starts_with(aCID, u"Page") )
912 eRet = OBJECTTYPE_PAGE;
913 else if( o3tl::starts_with(aCID, u"Title") )
914 eRet = OBJECTTYPE_TITLE;
915 else if( o3tl::starts_with(aCID, u"LegendEntry") )
917 else if( o3tl::starts_with(aCID, u"Legend") )
918 eRet = OBJECTTYPE_LEGEND;
919 else if( o3tl::starts_with(aCID, u"DiagramWall") )
921 else if( o3tl::starts_with(aCID, u"DiagramFloor") )
923 else if( o3tl::starts_with(aCID, u"D=") )
924 eRet = OBJECTTYPE_DIAGRAM;
925 else if( o3tl::starts_with(aCID, u"AxisUnitLabel") )
927 else if( o3tl::starts_with(aCID, u"Axis") )
928 eRet = OBJECTTYPE_AXIS;
929 else if( o3tl::starts_with(aCID, u"Grid") )
930 eRet = OBJECTTYPE_GRID;
931 else if( o3tl::starts_with(aCID, u"SubGrid") )
932 eRet = OBJECTTYPE_SUBGRID;
933 else if( o3tl::starts_with(aCID, u"Series") )
935 else if( o3tl::starts_with(aCID, u"Point") )
937 else if( o3tl::starts_with(aCID, u"DataLabels") )
939 else if( o3tl::starts_with(aCID, u"DataLabel") )
941 else if( o3tl::starts_with(aCID, u"ErrorsX") )
943 else if( o3tl::starts_with(aCID, u"ErrorsY") )
945 else if( o3tl::starts_with(aCID, u"ErrorsZ") )
947 else if( o3tl::starts_with(aCID, u"Curve") )
949 else if( o3tl::starts_with(aCID, u"Equation") )
951 else if( o3tl::starts_with(aCID, u"Average") )
953 else if( o3tl::starts_with(aCID, u"StockRange") )
955 else if( o3tl::starts_with(aCID, u"StockLoss") )
957 else if( o3tl::starts_with(aCID, u"StockGain") )
959 else if( o3tl::starts_with(aCID, u"DataTable") )
961 else
962 eRet = OBJECTTYPE_UNKNOWN;
963
964 return eRet;
965}
966
968{
969 ObjectType eObjectType( OBJECTTYPE_UNKNOWN );
970 if ( isAutoGeneratedObject() )
971 {
972 eObjectType = getObjectType( m_aObjectCID );
973 }
974 else if ( isAdditionalShape() )
975 {
976 eObjectType = OBJECTTYPE_SHAPE;
977 }
978 return eObjectType;
979}
980
982 std::u16string_view rSeriesParticle
983 , sal_Int32 nCurveIndex
984 , bool bAverageLine )
985{
986 OUString aParticleID( OUString::number( nCurveIndex ) );
988 return createClassifiedIdentifierWithParent( eType, aParticleID, rSeriesParticle );
989}
990
992 std::u16string_view rSeriesParticle
993 , sal_Int32 nCurveIndex )
994{
995 OUString aParticleID( OUString::number( nCurveIndex ) );
996 return createClassifiedIdentifierWithParent( OBJECTTYPE_DATA_CURVE_EQUATION, aParticleID, rSeriesParticle );
997}
998
999OUString ObjectIdentifier::addChildParticle( std::u16string_view rParticle, std::u16string_view rChildParticle )
1000{
1001 OUStringBuffer aRet(rParticle);
1002
1003 if( !aRet.isEmpty() && !rChildParticle.empty() )
1004 aRet.append(":");
1005 if( !rChildParticle.empty() )
1006 aRet.append(rChildParticle);
1007
1008 return aRet.makeStringAndClear();
1009}
1010
1011OUString ObjectIdentifier::createChildParticleWithIndex( ObjectType eObjectType, sal_Int32 nIndex )
1012{
1013 OUStringBuffer aRet( getStringForType( eObjectType ) );
1014 if( !aRet.isEmpty() )
1015 {
1016 aRet.append("=" + OUString::number(nIndex));
1017 }
1018 return aRet.makeStringAndClear();
1019}
1020
1021sal_Int32 ObjectIdentifier::getIndexFromParticleOrCID( std::u16string_view rParticleOrCID )
1022{
1023 const std::u16string_view aIndexString = lcl_getIndexStringAfterString( rParticleOrCID, u"=" );
1024 return lcl_StringToIndex( o3tl::getToken(aIndexString, 0, ',' ) );
1025}
1026
1028 , std::u16string_view rSeriesParticle
1029 , std::u16string_view rDragMethodServiceName
1030 , std::u16string_view rDragParameterString )
1031{
1032 OUString aChildParticle = getStringForType( eSubObjectType ) + "=";
1033
1035 rSeriesParticle, aChildParticle
1036 , rDragMethodServiceName, rDragParameterString );
1037}
1038
1039OUString ObjectIdentifier::createPointCID( std::u16string_view rPointCID_Stub, sal_Int32 nIndex )
1040{
1041 return rPointCID_Stub + OUString::number( nIndex );
1042}
1043
1044std::u16string_view ObjectIdentifier::getParticleID( std::u16string_view rCID )
1045{
1046 std::u16string_view aRet;
1047 size_t nLast = rCID.rfind('=');
1048 if(nLast != std::u16string_view::npos)
1049 aRet = rCID.substr(++nLast);
1050 return aRet;
1051}
1052
1053std::u16string_view ObjectIdentifier::getFullParentParticle( std::u16string_view rCID )
1054{
1055 std::u16string_view aRet;
1056
1057 size_t nStartPos = rCID.rfind('/');
1058 if( nStartPos != std::u16string_view::npos )
1059 {
1060 nStartPos++;
1061 size_t nEndPos = rCID.rfind(':');
1062 if( nEndPos != std::u16string_view::npos && nStartPos < nEndPos )
1063 {
1064 aRet = rCID.substr(nStartPos,nEndPos-nStartPos);
1065 }
1066 }
1067
1068 return aRet;
1069}
1070
1071OUString ObjectIdentifier::getObjectID( std::u16string_view rCID )
1072{
1073 OUString aRet;
1074
1075 size_t nStartPos = rCID.rfind('/');
1076 if( nStartPos != std::u16string_view::npos )
1077 {
1078 nStartPos++;
1079 size_t nEndPos = rCID.size();
1080 aRet = rCID.substr(nStartPos,nEndPos-nStartPos);
1081 }
1082
1083 return aRet;
1084}
1085
1086bool ObjectIdentifier::isCID( std::u16string_view rName )
1087{
1088 return !rName.empty() && o3tl::starts_with( rName, m_aProtocol );
1089}
1090
1092 std::u16string_view rObjectCID
1093 , const rtl::Reference<::chart::ChartModel>& xChartModel )
1094{
1095 //return the model object that is indicated by rObjectCID
1096 if(rObjectCID.empty())
1097 return nullptr;
1098 if(!xChartModel.is())
1099 return nullptr;
1100
1101 Reference< beans::XPropertySet > xObjectProperties;
1102 try
1103 {
1104 ObjectType eObjectType = ObjectIdentifier::getObjectType( rObjectCID );
1105 std::u16string_view aParticleID = ObjectIdentifier::getParticleID( rObjectCID );
1106
1109 lcl_getDiagramAndCooSys( rObjectCID, xChartModel, xDiagram, xCooSys );
1110
1111 switch(eObjectType)
1112 {
1113 case OBJECTTYPE_PAGE:
1114 {
1115 xObjectProperties.set( xChartModel->getPageBackground() );
1116 }
1117 break;
1118 case OBJECTTYPE_TITLE:
1119 {
1120 TitleHelper::eTitleType aTitleType = getTitleTypeForCID( rObjectCID );
1121 rtl::Reference< Title > xTitle( TitleHelper::getTitle( aTitleType, xChartModel ) );
1122 xObjectProperties = xTitle;
1123 }
1124 break;
1125 case OBJECTTYPE_LEGEND:
1126 {
1127 if( xDiagram.is() )
1128 xObjectProperties.set( xDiagram->getLegend(), uno::UNO_QUERY );
1129 }
1130 break;
1132 break;
1133 case OBJECTTYPE_DIAGRAM:
1134 {
1135 xObjectProperties = xDiagram;
1136 }
1137 break;
1139 {
1140 if( xDiagram.is() )
1141 xObjectProperties.set( xDiagram->getWall() );
1142 }
1143 break;
1145 {
1146 if( xDiagram.is() )
1147 xObjectProperties.set( xDiagram->getFloor() );
1148 }
1149 break;
1150 case OBJECTTYPE_AXIS:
1151 {
1152 sal_Int32 nDimensionIndex = -1;
1153 sal_Int32 nAxisIndex = -1;
1154 lcl_parseAxisIndices( nDimensionIndex, nAxisIndex, rObjectCID );
1155
1157 AxisHelper::getAxis( nDimensionIndex, nAxisIndex, xCooSys );
1158 if( xAxis.is() )
1159 xObjectProperties = xAxis;
1160 }
1161 break;
1163 break;
1164 case OBJECTTYPE_GRID:
1165 case OBJECTTYPE_SUBGRID:
1166 {
1167 sal_Int32 nDimensionIndex = -1;
1168 sal_Int32 nAxisIndex = -1;
1169 lcl_parseAxisIndices( nDimensionIndex, nAxisIndex, rObjectCID );
1170
1171 sal_Int32 nSubGridIndex = -1;
1172 lcl_parseGridIndices( nSubGridIndex, rObjectCID );
1173
1174 xObjectProperties = AxisHelper::getGridProperties( xCooSys , nDimensionIndex, nAxisIndex, nSubGridIndex );
1175 }
1176 break;
1179 {
1181 rObjectCID, xChartModel ) );
1182 if( xSeries.is() )
1183 xObjectProperties = xSeries;
1184
1185 break;
1186 }
1189 {
1191 rObjectCID, xChartModel );
1192 if(xSeries.is())
1193 {
1194 sal_Int32 nIndex = o3tl::toInt32(aParticleID);
1195 xObjectProperties = xSeries->getDataPointByIndex( nIndex );
1196 }
1197 break;
1198 }
1202 {
1204 rObjectCID, xChartModel );
1205 if(xSeries.is())
1206 {
1208 OUString errorBar;
1209
1210 if ( eObjectType == OBJECTTYPE_DATA_ERRORS_X)
1211 errorBar = CHART_UNONAME_ERRORBAR_X;
1212 else if (eObjectType == OBJECTTYPE_DATA_ERRORS_Y)
1213 errorBar = CHART_UNONAME_ERRORBAR_Y;
1214 else
1215 errorBar = "ErrorBarZ";
1216
1217 xSeries->getPropertyValue( errorBar ) >>= xErrorBarProp;
1218 xObjectProperties = xErrorBarProp;
1219 }
1220 break;
1221 }
1225 {
1227 rObjectCID, xChartModel );
1228 if(xRegressionContainer.is())
1229 {
1230 sal_Int32 nIndex = o3tl::toInt32(aParticleID);
1231 const std::vector< rtl::Reference< RegressionCurveModel > > & aCurveList =
1232 xRegressionContainer->getRegressionCurves2();
1233 if( nIndex >= 0 && o3tl::make_unsigned(nIndex) < aCurveList.size() )
1234 {
1235 if( eObjectType == OBJECTTYPE_DATA_CURVE_EQUATION )
1236 xObjectProperties = aCurveList[nIndex]->getEquationProperties();
1237 else
1238 xObjectProperties = aCurveList[nIndex];
1239 }
1240 }
1241 break;
1242 }
1244 break;
1246 {
1247 rtl::Reference<ChartType> xChartType( lcl_getFirstStockChartType( xChartModel ) );
1248 if(xChartType.is())
1249 xChartType->getPropertyValue( "BlackDay" ) >>= xObjectProperties;
1250 }
1251 break;
1253 {
1254 rtl::Reference<ChartType> xChartType( lcl_getFirstStockChartType( xChartModel ) );
1255 if(xChartType.is())
1256 xChartType->getPropertyValue( "WhiteDay" ) >>= xObjectProperties;
1257 }
1258 break;
1260 {
1261 if (xDiagram.is())
1262 xObjectProperties.set(xDiagram->getDataTable(), uno::UNO_QUERY);
1263 }
1264 break;
1265 break;
1266 default: //OBJECTTYPE_UNKNOWN
1267 break;
1268 }
1269 }
1270 catch(const uno::Exception&)
1271 {
1272 DBG_UNHANDLED_EXCEPTION("chart2");
1273 }
1274 return xObjectProperties;
1275}
1276
1278 std::u16string_view rObjectCID
1279 , const rtl::Reference<::chart::ChartModel>& xChartModel )
1280{
1283 lcl_getDiagramAndCooSys( rObjectCID, xChartModel, xDiagram, xCooSys );
1284
1285 sal_Int32 nDimensionIndex = -1;
1286 sal_Int32 nAxisIndex = -1;
1287 lcl_parseAxisIndices( nDimensionIndex, nAxisIndex, rObjectCID );
1288
1289 return AxisHelper::getAxis( nDimensionIndex, nAxisIndex, xCooSys );
1290}
1291
1293 std::u16string_view rObjectCID
1294 , const rtl::Reference<::chart::ChartModel>& xChartModel )
1295{
1298 lcl_getDiagramAndCooSys( rObjectCID, xChartModel, xDiagram, xCooSys );
1299
1300 sal_Int32 nChartTypeIndex = -1;
1301 sal_Int32 nSeriesIndex = -1;
1302 sal_Int32 nPointIndex = -1;
1303 lcl_parseSeriesIndices( nChartTypeIndex, nSeriesIndex, nPointIndex, rObjectCID );
1304
1306 if (xDiagram)
1307 {
1308 rtl::Reference< ChartType > xDataSeriesContainer( xDiagram->getChartTypeByIndex( nChartTypeIndex ) );
1309 if( xDataSeriesContainer.is() )
1310 {
1311 const std::vector< rtl::Reference< DataSeries > > & aDataSeriesSeq( xDataSeriesContainer->getDataSeries2() );
1312 if( nSeriesIndex >= 0 && o3tl::make_unsigned(nSeriesIndex) < aDataSeriesSeq.size() )
1313 xSeries = aDataSeriesSeq[nSeriesIndex];
1314 }
1315 }
1316 return xSeries;
1317}
1318
1320 std::u16string_view rObjectCID
1321 , const rtl::Reference<::chart::ChartModel>& xChartModel )
1322{
1325 lcl_getDiagramAndCooSys( rObjectCID, xChartModel, xDiagram, xCooSys );
1326
1327 return xDiagram;
1328}
1329
1331{
1333
1334 std::u16string_view aParentParticle = ObjectIdentifier::getFullParentParticle( rCID );
1335 const tTitleMap& rMap = lcl_getTitleMap();
1336 tTitleMap::const_iterator aIt = std::find_if(rMap.begin(), rMap.end(),
1337 [&aParentParticle](tTitleMap::const_reference rEntry) { return aParentParticle == rEntry.second; });
1338 if (aIt != rMap.end())
1339 eRet = (*aIt).first;
1340
1341 return eRet;
1342}
1343
1344OUString ObjectIdentifier::getSeriesParticleFromCID( std::u16string_view rCID )
1345{
1346 sal_Int32 nDiagramIndex = -1;
1347 sal_Int32 nCooSysIndex = -1;
1348 lcl_parseCooSysIndices( nDiagramIndex, nCooSysIndex, rCID );
1349
1350 sal_Int32 nChartTypeIndex = -1;
1351 sal_Int32 nSeriesIndex = -1;
1352 sal_Int32 nPointIndex = -1;
1353 lcl_parseSeriesIndices( nChartTypeIndex, nSeriesIndex, nPointIndex, rCID );
1354
1355 return ObjectIdentifier::createParticleForSeries( nDiagramIndex, nCooSysIndex, nChartTypeIndex, nSeriesIndex );
1356}
1357
1358OUString ObjectIdentifier::getMovedSeriesCID( std::u16string_view rObjectCID, bool bForward )
1359{
1360 sal_Int32 nDiagramIndex = lcl_StringToIndex( lcl_getIndexStringAfterString( rObjectCID, u"CID/D=" ) );
1361 sal_Int32 nCooSysIndex = lcl_StringToIndex( lcl_getIndexStringAfterString( rObjectCID, u"CS=" ) );
1362 sal_Int32 nChartTypeIndex = lcl_StringToIndex( lcl_getIndexStringAfterString( rObjectCID, u"CT=" ) );
1363 sal_Int32 nSeriesIndex = lcl_StringToIndex( lcl_getIndexStringAfterString( rObjectCID, u"Series=" ) );
1364
1365 if( bForward )
1366 nSeriesIndex--;
1367 else
1368 nSeriesIndex++;
1369
1370 OUString aRet = ObjectIdentifier::createParticleForSeries( nDiagramIndex, nCooSysIndex, nChartTypeIndex, nSeriesIndex );
1372}
1373
1375{
1376 return ( isAutoGeneratedObject() || isAdditionalShape() );
1377}
1378
1380{
1381 return ( !m_aObjectCID.isEmpty() );
1382}
1383
1385{
1386 return m_xAdditionalShape.is();
1387}
1388
1390{
1391 Any aAny;
1392 if ( isAutoGeneratedObject() )
1393 {
1394 aAny <<= getObjectCID();
1395 }
1396 else if ( isAdditionalShape() )
1397 {
1398 aAny <<= getAdditionalShape();
1399 }
1400 return aAny;
1401}
1402
1403} //namespace chart
1404
1405/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
static rtl::Reference< ::chart::BaseCoordinateSystem > getCoordinateSystemOfAxis(const rtl::Reference< ::chart::Axis > &xAxis, const rtl::Reference< ::chart::Diagram > &xDiagram)
Definition: AxisHelper.cxx:982
static rtl::Reference< ::chart::Axis > getAxis(sal_Int32 nDimensionIndex, bool bMainAxis, const rtl::Reference< ::chart::Diagram > &xDiagram)
static rtl::Reference< ::chart::GridProperties > getGridProperties(const rtl::Reference< ::chart::BaseCoordinateSystem > &xCooSys, sal_Int32 nDimensionIndex, sal_Int32 nAxisIndex, sal_Int32 nSubGridIndex)
Definition: AxisHelper.cxx:678
static bool getIndicesForAxis(const rtl::Reference< ::chart::Axis > &xAxis, const rtl::Reference< ::chart::BaseCoordinateSystem > &xCooSys, sal_Int32 &rOutDimensionIndex, sal_Int32 &rOutAxisIndex)
static SAL_DLLPRIVATE OUString createParticleForDiagram()
static OUString createClassifiedIdentifierForParticle(std::u16string_view rParticle)
static OUString createParticleForCoordinateSystem(const rtl::Reference< ::chart::BaseCoordinateSystem > &xCooSys, const rtl::Reference<::chart::ChartModel > &xChartModel)
static bool areSiblings(std::u16string_view rCID1, std::u16string_view rCID2)
static OUString getSeriesParticleFromCID(std::u16string_view rCID)
static OUString createDataCurveEquationCID(std::u16string_view rSeriesParticle, sal_Int32 nCurveIndex)
bool operator==(const ObjectIdentifier &rOID) const
static OUString createParticleForLegend(const rtl::Reference<::chart::ChartModel > &xChartModel)
css::uno::Any getAny() const
static bool isCID(std::u16string_view rName)
css::uno::Reference< css::drawing::XShape > m_xAdditionalShape
static rtl::Reference< ::chart::DataSeries > getDataSeriesForCID(std::u16string_view rObjectCID, const rtl::Reference<::chart::ChartModel > &xChartModel)
static bool isMultiClickObject(std::u16string_view rClassifiedIdentifier)
static OUString createChildParticleWithIndex(ObjectType eObjectType, sal_Int32 nIndex)
static OUString getStringForType(ObjectType eObjectType)
const OUString & getObjectCID() const
static TitleHelper::eTitleType getTitleTypeForCID(std::u16string_view rCID)
static OUString createDataCurveCID(std::u16string_view rSeriesParticle, sal_Int32 nCurveIndex, bool bAverageLine)
bool operator!=(const ObjectIdentifier &rOID) const
static bool isRotateableObject(std::u16string_view rClassifiedIdentifier)
static std::u16string_view getParticleID(std::u16string_view rCID)
static OUString createClassifiedIdentifier(enum ObjectType eObjectType, std::u16string_view rParticleID)
const css::uno::Reference< css::drawing::XShape > & getAdditionalShape() const
static css::uno::Reference< css::beans::XPropertySet > getObjectPropertySet(std::u16string_view rObjectCID, const rtl::Reference< ::chart::ChartModel > &xChartDocument)
static OUString createClassifiedIdentifierForParticles(std::u16string_view rParentParticle, std::u16string_view rChildParticle, std::u16string_view rDragMethodServiceName=std::u16string_view(), std::u16string_view rDragParameterString=std::u16string_view())
bool operator<(const ObjectIdentifier &rOID) const
static bool areIdenticalObjects(std::u16string_view rCID1, std::u16string_view rCID2)
static rtl::Reference< ::chart::Axis > getAxisForCID(std::u16string_view rObjectCID, const rtl::Reference<::chart::ChartModel > &xChartModel)
static OUString createParticleForAxis(sal_Int32 nDimensionIndex, sal_Int32 nAxisIndex)
static std::u16string_view getDragParameterString(std::u16string_view rCID)
static OUString createParticleForDataTable(const rtl::Reference<::chart::ChartModel > &xChartModel)
Creates an identifier for the data table.
static sal_Int32 getIndexFromParticleOrCID(std::u16string_view rParticleOrCID)
static OUString getMovedSeriesCID(std::u16string_view rObjectCID, bool bForward)
static OUString createPieSegmentDragParameterString(sal_Int32 nOffsetPercent, const css::awt::Point &rMinimumPosition, const css::awt::Point &rMaximumPosition)
static OUString addChildParticle(std::u16string_view rParticle, std::u16string_view rChildParticle)
static OUString createSeriesSubObjectStub(ObjectType eSubObjectType, std::u16string_view rSeriesParticle, std::u16string_view rDragMethodServiceName=std::u16string_view(), std::u16string_view rDragParameterString=std::u16string_view())
static rtl::Reference< ::chart::Diagram > getDiagramForCID(std::u16string_view rObjectCID, const rtl::Reference<::chart::ChartModel > &xChartModel)
static OUString createClassifiedIdentifierWithParent(enum ObjectType, std::u16string_view rParticleID, std::u16string_view rParentPartical, std::u16string_view rDragMethodServiceName=std::u16string_view(), std::u16string_view rDragParameterString=std::u16string_view())
static OUString createParticleForGrid(sal_Int32 nDimensionIndex, sal_Int32 nAxisIndex)
static OUString createPointCID(std::u16string_view rPointCID_Stub, sal_Int32 nIndex)
static OUString createParticleForSeries(sal_Int32 nDiagramIndex, sal_Int32 nCooSysIndex, sal_Int32 nChartTypeIndex, sal_Int32 nSeriesIndex)
static std::u16string_view getFullParentParticle(std::u16string_view rCID)
static std::u16string_view getDragMethodServiceName(std::u16string_view rClassifiedIdentifier)
static bool parsePieSegmentDragParameterString(std::u16string_view rDragParameterString, sal_Int32 &rOffsetPercent, css::awt::Point &rMinimumPosition, css::awt::Point &rMaximumPosition)
static const OUString & getPieSegmentDragMethodServiceName()
static OUString createClassifiedIdentifierForGrid(const css::uno::Reference< css::chart2::XAxis > &xAxis, const rtl::Reference<::chart::ChartModel > &xChartModel, sal_Int32 nSubIndex=-1)
ObjectType getObjectType() const
static SAL_DLLPRIVATE OUString getObjectID(std::u16string_view rCID)
static OUString createClassifiedIdentifierForObject(const css::uno::Reference< css::uno::XInterface > &xObject, const rtl::Reference<::chart::ChartModel > &xChartModel)
static rtl::Reference< ::chart::Title > getTitle(eTitleType nTitleIndex, ChartModel &rModel)
static bool getTitleType(eTitleType &rType, const rtl::Reference< ::chart::Title > &xTitle, const rtl::Reference< ::chart::ChartModel > &xModel)
#define DBG_UNHANDLED_EXCEPTION(...)
float u
DocumentType eType
sal_Int32 nIndex
constexpr OUStringLiteral m_aProtocol
constexpr OUStringLiteral m_aMultiClick
constexpr OUStringLiteral m_aDragMethodEquals
@ OBJECTTYPE_DATA_SERIES
@ OBJECTTYPE_DATA_LABELS
@ OBJECTTYPE_DATA_TABLE
@ OBJECTTYPE_DIAGRAM
@ OBJECTTYPE_LEGEND_ENTRY
@ OBJECTTYPE_DATA_ERRORS_X
@ OBJECTTYPE_DATA_STOCK_LOSS
@ OBJECTTYPE_DIAGRAM_FLOOR
@ OBJECTTYPE_DATA_POINT
@ OBJECTTYPE_DATA_STOCK_RANGE
@ OBJECTTYPE_UNKNOWN
@ OBJECTTYPE_SUBGRID
@ OBJECTTYPE_DATA_ERRORS_Y
@ OBJECTTYPE_AXIS_UNITLABEL
@ OBJECTTYPE_DATA_CURVE_EQUATION
@ OBJECTTYPE_DATA_STOCK_GAIN
@ OBJECTTYPE_DATA_AVERAGE_LINE
@ OBJECTTYPE_DATA_ERRORS_Z
@ OBJECTTYPE_DATA_CURVE
@ OBJECTTYPE_DATA_LABEL
@ OBJECTTYPE_DIAGRAM_WALL
const OUString m_aPieSegmentDragMethodServiceName("PieSegmentDragging")
constexpr OUStringLiteral m_aDragParameterEquals
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
sal_Int32 toInt32(std::u16string_view str, sal_Int16 radix=10)
constexpr bool starts_with(std::basic_string_view< charT, traits > sv, std::basic_string_view< charT, traits > x) noexcept
std::basic_string_view< charT, traits > getToken(std::basic_string_view< charT, traits > sv, charT delimiter, std::size_t &position)
constexpr OUStringLiteral CHART2_SERVICE_NAME_CHARTTYPE_CANDLESTICK
constexpr OUStringLiteral CHART_UNONAME_ERRORBAR_Y
Definition: unonames.hxx:23
constexpr OUStringLiteral CHART_UNONAME_ERRORBAR_X
Definition: unonames.hxx:22