LibreOffice Module chart2 (master) 1
ObjectHierarchy.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 <ObjectHierarchy.hxx>
21#include <ObjectIdentifier.hxx>
22#include <ChartModelHelper.hxx>
23#include <DiagramHelper.hxx>
24#include <Diagram.hxx>
27#include <Axis.hxx>
28#include <AxisHelper.hxx>
30#include <ChartType.hxx>
31#include <ChartTypeHelper.hxx>
32#include <ChartModel.hxx>
33#include <DataSeries.hxx>
34#include <DataSeriesHelper.hxx>
35#include <GridProperties.hxx>
36#include <LegendHelper.hxx>
38#include <unonames.hxx>
40
41#include <map>
42#include <algorithm>
43#include <cstddef>
44
45#include <com/sun/star/drawing/XShapes.hpp>
46#include <com/sun/star/chart/ErrorBarStyle.hpp>
47
48#include <com/sun/star/container/XIndexAccess.hpp>
49#include <com/sun/star/awt/Key.hpp>
50#include <com/sun/star/awt/KeyModifier.hpp>
51#include <utility>
53
54using namespace ::com::sun::star;
55using namespace ::com::sun::star::chart2;
56
57using ::com::sun::star::uno::Reference;
58using ::com::sun::star::uno::Sequence;
59
60namespace
61{
62
63void lcl_getChildOIDs(
65 const Reference< container::XIndexAccess >& xShapes )
66{
67 if( !xShapes.is())
68 return;
69
70 sal_Int32 nCount = xShapes->getCount();
71 for( sal_Int32 i=0; i<nCount; ++i)
72 {
73 Reference< beans::XPropertySet > xShapeProp( xShapes->getByIndex( i ), uno::UNO_QUERY );
74 if( xShapeProp.is())
75 {
76 Reference< beans::XPropertySetInfo > xInfo( xShapeProp->getPropertySetInfo());
77 OUString aName;
78 if( xInfo.is() &&
79 xInfo->hasPropertyByName( "Name") &&
80 (xShapeProp->getPropertyValue( "Name") >>= aName ) &&
81 !aName.isEmpty() &&
83 {
84 rOutChildren.emplace_back( aName );
85 }
86 Reference< container::XIndexAccess > xNewShapes( xShapeProp, uno::UNO_QUERY );
87 if( xNewShapes.is())
88 lcl_getChildOIDs( rOutChildren, xNewShapes );
89 }
90 }
91}
92
93void lcl_addAxisTitle( const rtl::Reference< ::chart::Axis >& xAxis, ::chart::ObjectHierarchy::tChildContainer& rContainer, const rtl::Reference<::chart::ChartModel>& xChartModel )
94{
95 if( xAxis.is())
96 {
97 Reference< XTitle > xAxisTitle( xAxis->getTitleObject());
98 if( xAxisTitle.is())
99 rContainer.emplace_back( ::chart::ObjectIdentifier::createClassifiedIdentifierForObject( xAxisTitle, xChartModel ) );
100 }
101}
102
103} // anonymous namespace
104
105namespace chart
106{
107
109{
110 m_aChildMap.clear();
111
112 if( !xChartDocument.is() )
113 return;
114
115 //@todo: change ObjectIdentifier to take an XChartDocument rather than XModel
116 rtl::Reference< Diagram > xDiagram = xChartDocument->getFirstChartDiagram();
117 ObjectIdentifier aDiaOID;
118 if( xDiagram.is() )
119 aDiaOID = ObjectIdentifier( ObjectIdentifier::createClassifiedIdentifierForObject( static_cast<cppu::OWeakObject*>(xDiagram.get()), xChartDocument ) );
120 tChildContainer aTopLevelContainer;
121
122 // First Level
123
124 // Chart Area
126 {
127 aTopLevelContainer.emplace_back( ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_PAGE, u"" ) );
128 if( xDiagram.is() )
129 {
130 aTopLevelContainer.push_back( aDiaOID );
131 createWallAndFloor( aTopLevelContainer, xDiagram );
132 createLegendTree( aTopLevelContainer, xChartDocument, xDiagram );
133 }
134 }
135
136 // Main Title
137 Reference< XTitle > xMainTitle( xChartDocument->getTitleObject());
138 if( xMainTitle.is())
139 aTopLevelContainer.emplace_back( ObjectIdentifier::createClassifiedIdentifierForObject( xMainTitle, xChartDocument ) );
140
141 if( xDiagram.is())
142 {
143 // Sub Title. Note: This is interpreted of being top level
144 Reference< XTitle > xSubTitle( xDiagram->getTitleObject());
145 if( xSubTitle.is())
146 aTopLevelContainer.emplace_back( ObjectIdentifier::createClassifiedIdentifierForObject( xSubTitle, xChartDocument ) );
147
149 {
150 // Axis Titles. Note: These are interpreted of being top level
151 const std::vector< rtl::Reference< Axis > > aAxes = AxisHelper::getAllAxesOfDiagram( xDiagram );
152 for( rtl::Reference< Axis > const & axis : aAxes )
153 lcl_addAxisTitle( axis, aTopLevelContainer, xChartDocument );
154
155 // Diagram
156 aTopLevelContainer.push_back( aDiaOID );
157 }
158
160 createDiagramTree( aTopLevelContainer, xChartDocument, xDiagram );
161 else
162 {
163 tChildContainer aSubContainer;
164 createDiagramTree( aSubContainer, xChartDocument, xDiagram );
165 if( !aSubContainer.empty() )
166 m_aChildMap[ aDiaOID ] = aSubContainer;
167 }
168
170 createLegendTree( aTopLevelContainer, xChartDocument, xDiagram );
171 }
172
173 // #i12587# support for shapes in chart
175 {
176 createAdditionalShapesTree( aTopLevelContainer );
177 }
178
179 // Chart Area
181 aTopLevelContainer.emplace_back( ObjectIdentifier::createClassifiedIdentifier( OBJECTTYPE_PAGE, u"" ) );
182
183 if( ! aTopLevelContainer.empty())
184 m_aChildMap[ObjectHierarchy::getRootNodeOID()] = aTopLevelContainer;
185}
186
188 tChildContainer & rContainer,
189 const rtl::Reference<::chart::ChartModel> & xChartDoc,
190 const rtl::Reference< Diagram > & xDiagram )
191{
192 if( !(xDiagram.is() && LegendHelper::hasLegend( xDiagram )) )
193 return;
194
195 ObjectIdentifier aLegendOID( ObjectIdentifier( ObjectIdentifier::createClassifiedIdentifierForObject( xDiagram->getLegend(), xChartDoc ) ) );
196 rContainer.push_back( aLegendOID );
197
198 // iterate over child shapes of legend and search for matching CIDs
200 {
201 rtl::Reference< SvxShapeGroupAnyD > xLegendShapeContainer =
202 dynamic_cast<SvxShapeGroupAnyD*>(
203 m_pExplicitValueProvider->getShapeForCID( aLegendOID.getObjectCID() ).get() );
204 tChildContainer aLegendEntryOIDs;
205 lcl_getChildOIDs( aLegendEntryOIDs, xLegendShapeContainer );
206
207 m_aChildMap[ aLegendOID ] = aLegendEntryOIDs;
208 }
209}
210
212 tChildContainer & rContainer,
213 const rtl::Reference<::chart::ChartModel> & xChartDoc,
214 const rtl::Reference< Diagram > & xDiagram )
215{
216 sal_Int32 nDimensionCount = xDiagram->getDimension();
217 rtl::Reference< ChartType > xChartType( xDiagram->getChartTypeByIndex( 0 ) );
218 bool bSupportsAxesGrids = ChartTypeHelper::isSupportingMainAxis( xChartType, nDimensionCount, 0 );
219 if( !bSupportsAxesGrids )
220 return;
221
222 // Data Table
223 uno::Reference<chart2::XDataTable> xDataTable = xDiagram->getDataTable();
224 if (xDataTable.is())
225 {
226 rContainer.push_back(ObjectIdentifier::createClassifiedIdentifierForObject(xDataTable, xChartDoc));
227 }
228
229 // Axes
230 std::vector< rtl::Reference< Axis > > aAxes = AxisHelper::getAllAxesOfDiagram( xDiagram, /* bOnlyVisible = */ true );
232 {
233 for (const auto & rAxis : std::as_const(aAxes))
234 rContainer.push_back( ObjectIdentifier::createClassifiedIdentifierForObject( rAxis, xChartDoc ) );
235 }
236
237 // get all axes, also invisible ones
238 aAxes = AxisHelper::getAllAxesOfDiagram( xDiagram );
239 // Grids
240 for( rtl::Reference< Axis > const & xAxis : aAxes )
241 {
242 if(!xAxis.is())
243 continue;
244
245 sal_Int32 nCooSysIndex = 0;
246 sal_Int32 nDimensionIndex = 0;
247 sal_Int32 nAxisIndex = 0;
248 AxisHelper::getIndicesForAxis( xAxis, xDiagram, nCooSysIndex, nDimensionIndex, nAxisIndex );
249 if( nAxisIndex>0 && !ChartTypeHelper::isSupportingSecondaryAxis( xChartType, nDimensionCount ) )
250 continue;
251
253 {
254 // axis
255 if( AxisHelper::isAxisVisible( xAxis ) )
256 rContainer.emplace_back( ObjectIdentifier::createClassifiedIdentifierForObject( xAxis, xChartDoc ) );
257
258 // axis title
259 lcl_addAxisTitle( xAxis, rContainer, xChartDoc );
260 }
261
262 rtl::Reference< ::chart::GridProperties > xGridProperties( xAxis->getGridProperties2() );
263 if( AxisHelper::isGridVisible( xGridProperties ) )
264 {
265 //main grid
266 rContainer.emplace_back( ObjectIdentifier::createClassifiedIdentifierForGrid( xAxis, xChartDoc ) );
267 }
268
269 std::vector< rtl::Reference< ::chart::GridProperties > > aSubGrids( xAxis->getSubGridProperties2() );
270 for( size_t nSubGrid = 0; nSubGrid < aSubGrids.size(); ++nSubGrid )
271 {
272 if( AxisHelper::isGridVisible( aSubGrids[nSubGrid] ) )
273 {
274 //sub grid
275 rContainer.emplace_back( ObjectIdentifier::createClassifiedIdentifierForGrid( xAxis, xChartDoc, nSubGrid ) );
276 }
277 }
278 }
279}
280
282 tChildContainer & rContainer,
283 const rtl::Reference< Diagram > & xDiagram )
284{
285 sal_Int32 nDimensionCount = xDiagram->getDimension();
286 bool bIsThreeD = ( nDimensionCount == 3 );
287 bool bHasWall = xDiagram->isSupportingFloorAndWall();
288 if( bHasWall && bIsThreeD )
289 {
291
292 Reference< beans::XPropertySet > xFloor( xDiagram->getFloor());
293 if( xFloor.is())
295 }
296
297}
298
300 tChildContainer & rContainer,
301 const rtl::Reference<::chart::ChartModel> & xChartDoc,
302 const rtl::Reference< Diagram > & xDiagram )
303{
305 {
306 createDataSeriesTree( rContainer, xDiagram );
307 createAxesTree( rContainer, xChartDoc, xDiagram );
308 createWallAndFloor( rContainer, xDiagram );
309 }
310 else
311 {
312 createAxesTree( rContainer, xChartDoc, xDiagram );
313 createDataSeriesTree( rContainer, xDiagram );
314 }
315}
316
318 tChildContainer & rOutDiagramSubContainer,
319 const rtl::Reference< Diagram > & xDiagram )
320{
321 try
322 {
323 sal_Int32 nDimensionCount = xDiagram->getDimension();
324 std::vector< rtl::Reference< BaseCoordinateSystem > > aCooSysSeq(
325 xDiagram->getBaseCoordinateSystems());
326 for( std::size_t nCooSysIdx=0; nCooSysIdx<aCooSysSeq.size(); ++nCooSysIdx )
327 {
328 std::vector< rtl::Reference< ChartType > > aChartTypeSeq( aCooSysSeq[nCooSysIdx]->getChartTypes2());
329 for( std::size_t nCTIdx=0; nCTIdx<aChartTypeSeq.size(); ++nCTIdx )
330 {
331 rtl::Reference< ChartType > xChartType( aChartTypeSeq[nCTIdx] );
332 std::vector< rtl::Reference< DataSeries > > aSeriesSeq( xChartType->getDataSeries2() );
333 const sal_Int32 nNumberOfSeries =
334 ChartTypeHelper::getNumberOfDisplayedSeries( xChartType, aSeriesSeq.size());
335
336 for( sal_Int32 nSeriesIdx=0; nSeriesIdx<nNumberOfSeries; ++nSeriesIdx )
337 {
338 OUString aSeriesParticle(
340 0, nCooSysIdx, nCTIdx, nSeriesIdx ));
341 ObjectIdentifier aSeriesOID(
343 rOutDiagramSubContainer.push_back( aSeriesOID );
344
345 tChildContainer aSeriesSubContainer;
346
347 rtl::Reference< DataSeries > const & xSeries = aSeriesSeq[nSeriesIdx];
348
349 // data labels
351 {
352 OUString aChildParticle( ObjectIdentifier::getStringForType( OBJECTTYPE_DATA_LABELS ) + "=" );
353 aSeriesSubContainer.emplace_back( ObjectIdentifier::createClassifiedIdentifierForParticles( aSeriesParticle, aChildParticle ) );
354 }
355
356 // Statistics
357 if( ChartTypeHelper::isSupportingStatisticProperties( xChartType, nDimensionCount ) )
358 {
359 const std::vector< rtl::Reference< RegressionCurveModel > > & rCurves( xSeries->getRegressionCurves2());
360 for( size_t nCurveIdx=0; nCurveIdx<rCurves.size(); ++nCurveIdx )
361 {
362 bool bIsAverageLine = RegressionCurveHelper::isMeanValueLine( rCurves[nCurveIdx] );
363 aSeriesSubContainer.emplace_back( ObjectIdentifier::createDataCurveCID( aSeriesParticle, nCurveIdx, bIsAverageLine ) );
364 if( RegressionCurveHelper::hasEquation( rCurves[nCurveIdx] ) )
365 {
366 aSeriesSubContainer.emplace_back( ObjectIdentifier::createDataCurveEquationCID( aSeriesParticle, nCurveIdx ) );
367 }
368 }
370 if( (xSeries->getPropertyValue( CHART_UNONAME_ERRORBAR_Y) >>= xErrorBarProp) &&
371 xErrorBarProp.is())
372 {
373 sal_Int32 nStyle = css::chart::ErrorBarStyle::NONE;
374 if( ( xErrorBarProp->getPropertyValue( "ErrorBarStyle") >>= nStyle ) &&
375 ( nStyle != css::chart::ErrorBarStyle::NONE ) )
376 {
377 aSeriesSubContainer.emplace_back( ObjectIdentifier::createClassifiedIdentifierWithParent(
378 OBJECTTYPE_DATA_ERRORS_Y, u"", aSeriesParticle ) );
379 }
380 }
381
382 if( (xSeries->getPropertyValue(CHART_UNONAME_ERRORBAR_X) >>= xErrorBarProp) &&
383 xErrorBarProp.is())
384 {
385 sal_Int32 nStyle = css::chart::ErrorBarStyle::NONE;
386 if( ( xErrorBarProp->getPropertyValue( "ErrorBarStyle") >>= nStyle ) &&
387 ( nStyle != css::chart::ErrorBarStyle::NONE ) )
388 {
389 aSeriesSubContainer.emplace_back( ObjectIdentifier::createClassifiedIdentifierWithParent(
390 OBJECTTYPE_DATA_ERRORS_X, u"", aSeriesParticle ) );
391 }
392 }
393 }
394
395 // Data Points
396 // iterate over child shapes of legend and search for matching CIDs
398 {
399 rtl::Reference< SvxShapeGroupAnyD > xSeriesShapeContainer =
400 dynamic_cast<SvxShapeGroupAnyD*>(
401 m_pExplicitValueProvider->getShapeForCID( aSeriesOID.getObjectCID() ).get() );
402 lcl_getChildOIDs( aSeriesSubContainer, xSeriesShapeContainer );
403 }
404
405 if( ! aSeriesSubContainer.empty())
406 m_aChildMap[ aSeriesOID ] = aSeriesSubContainer;
407 }
408 }
409 }
410 }
411 catch( const uno::Exception & )
412 {
413 DBG_UNHANDLED_EXCEPTION("chart2");
414 }
415}
416
418{
419 try
420 {
422 {
423 rtl::Reference<SvxDrawPage> xDrawPage( m_pExplicitValueProvider->getDrawModelWrapper()->getMainDrawPage() );
425 sal_Int32 nCount = xDrawPage->getCount();
426 for ( sal_Int32 i = 0; i < nCount; ++i )
427 {
429 if ( xDrawPage->getByIndex( i ) >>= xShape )
430 {
431 if ( xShape.is() && xShape != xChartRoot )
432 {
433 rContainer.emplace_back( xShape );
434 }
435 }
436 }
437 }
438 }
439 catch ( const uno::Exception& )
440 {
441 DBG_UNHANDLED_EXCEPTION("chart2");
442 }
443}
444
446{
447 if ( rParent.isValid() )
448 {
449 tChildMap::const_iterator aIt( m_aChildMap.find( rParent ));
450 if( aIt != m_aChildMap.end())
451 return ! (aIt->second.empty());
452 }
453 return false;
454}
455
457{
458 if ( rParent.isValid() )
459 {
460 tChildMap::const_iterator aIt( m_aChildMap.find( rParent ));
461 if( aIt != m_aChildMap.end())
462 return aIt->second;
463 }
464 static const tChildContainer EMPTY;
465 return EMPTY;
466}
467
469{
470 if ( rNode.isValid() && !ObjectHierarchy::isRootNode( rNode ) )
471 {
472 for (auto const& child : m_aChildMap)
473 {
474 tChildContainer::const_iterator aElemIt(
475 std::find( child.second.begin(), child.second.end(), rNode ));
476 if( aElemIt != child.second.end())
477 return child.second;
478 }
479 }
480 static const tChildContainer EMPTY;
481 return EMPTY;
482}
483
485 const ObjectIdentifier & rParentOID,
486 const ObjectIdentifier & rOID ) const
487{
488 // search children
489 tChildContainer aChildren( getChildren( rParentOID ));
490 tChildContainer::const_iterator aIt(
491 std::find( aChildren.begin(), aChildren.end(), rOID ));
492 // recursion end
493 if( aIt != aChildren.end())
494 return rParentOID;
495
496 for (auto const& child : aChildren)
497 {
498 // recursion
499 ObjectIdentifier aTempParent( getParentImpl( child, rOID ));
500 if ( aTempParent.isValid() )
501 {
502 // exit on success
503 return aTempParent;
504 }
505 }
506
507 // exit on fail
508 return ObjectIdentifier();
509}
510
512 const ObjectIdentifier & rOID ) const
513{
515}
516
518 const rtl::Reference<::chart::ChartModel> & xChartDocument,
519 ExplicitValueProvider * pExplicitValueProvider /* = 0 */,
520 bool bFlattenDiagram /* = false */,
521 bool bOrderingForElementSelector /* = false */) :
522 m_pExplicitValueProvider( pExplicitValueProvider ),
523 m_bFlattenDiagram( bFlattenDiagram ),
524 m_bOrderingForElementSelector( bOrderingForElementSelector )
525{
526 createTree( xChartDocument );
527 // don't remember this helper to avoid access after lifetime
528 m_pExplicitValueProvider = nullptr;
529}
530
532{}
533
535{
536 return ObjectIdentifier( "ROOT" );
537}
538
540{
541 return ( rOID == ObjectHierarchy::getRootNodeOID() );
542}
543
545{
547}
548
550 const ObjectIdentifier& rNode ) const
551{
552 ObjectIdentifier aParentOID( getParent( rNode ));
553 const tChildContainer & aChildren( getChildren( aParentOID ) );
554 sal_Int32 nIndex = 0;
555 for (auto const& child : aChildren)
556 {
557 if ( child == rNode )
558 return nIndex;
559 ++nIndex;
560 }
561 return -1;
562}
563
565 ObjectIdentifier aCurrentOID,
567 ExplicitValueProvider * pExplicitValueProvider /* = 0 */ ) :
568 m_aCurrentOID(std::move( aCurrentOID )),
569 m_xChartDocument(std::move( xChartDocument )),
570 m_pExplicitValueProvider( pExplicitValueProvider )
571{
572 if ( !m_aCurrentOID.isValid() )
573 {
575 }
576}
577
579 const awt::KeyEvent & rEvent )
580{
581 bool bResult = false;
582
583 switch( rEvent.KeyCode )
584 {
585 case awt::Key::TAB:
586 if( rEvent.Modifiers & awt::KeyModifier::SHIFT )
587 bResult = previous();
588 else
589 bResult = next();
590 break;
591 case awt::Key::HOME:
592 bResult = first();
593 break;
594 case awt::Key::END:
595 bResult = last();
596 break;
597 case awt::Key::F3:
598 if( rEvent.Modifiers & awt::KeyModifier::SHIFT )
599 bResult = up();
600 else
601 bResult = down();
602 break;
603 case awt::Key::ESCAPE:
605 bResult = true;
606 break;
607 default:
608 bResult = false;
609 break;
610 }
611 return bResult;
612}
613
615{
616 m_aCurrentOID = rOID;
617}
618
620{
623 bool bResult = !aSiblings.empty();
624 if( bResult )
625 setCurrentSelection( aSiblings.front());
626 else
627 bResult = veryFirst();
628 return bResult;
629}
630
632{
635 bool bResult = !aSiblings.empty();
636 if( bResult )
637 setCurrentSelection( aSiblings.back());
638 else
639 bResult = veryLast();
640 return bResult;
641}
642
644{
647 bool bResult = !aSiblings.empty();
648 if( bResult )
649 {
650 ObjectHierarchy::tChildContainer::const_iterator aIt(
651 std::find( aSiblings.begin(), aSiblings.end(), getCurrentSelection()));
652 assert(aIt != aSiblings.end());
653 if( ++aIt == aSiblings.end())
654 aIt = aSiblings.begin();
655 setCurrentSelection( *aIt );
656 }
657 else
658 bResult = veryFirst();
659
660 return bResult;
661}
662
664{
667 bool bResult = !aSiblings.empty();
668 if( bResult )
669 {
670 ObjectHierarchy::tChildContainer::const_iterator aIt(
671 std::find( aSiblings.begin(), aSiblings.end(), getCurrentSelection()));
672 OSL_ASSERT( aIt != aSiblings.end());
673 if( aIt == aSiblings.begin())
674 aIt = aSiblings.end();
675 --aIt;
676 setCurrentSelection( *aIt );
677 }
678 else
679 bResult = veryLast();
680 return bResult;
681}
682
684{
687 if( bResult )
689 return bResult;
690}
691
693{
695 bool bResult = aHierarchy.hasChildren( getCurrentSelection());
696 if( bResult )
697 {
699 OSL_ASSERT( !aChildren.empty());
700 setCurrentSelection( aChildren.front());
701 }
702 return bResult;
703}
704
706{
709 bool bResult = !aChildren.empty();
710 if( bResult )
711 setCurrentSelection( aChildren.front());
712 return bResult;
713}
714
716{
719 bool bResult = !aChildren.empty();
720 if( bResult )
721 setCurrentSelection( aChildren.back());
722 return bResult;
723}
724
725} // namespace chart
726
727/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
static std::vector< rtl::Reference< ::chart::Axis > > getAllAxesOfDiagram(const rtl::Reference< ::chart::Diagram > &xDiagram, bool bOnlyVisible=false)
Definition: AxisHelper.cxx:809
static bool isGridVisible(const rtl::Reference< ::chart::GridProperties > &xGridProperties)
Definition: AxisHelper.cxx:665
static bool getIndicesForAxis(const rtl::Reference< ::chart::Axis > &xAxis, const rtl::Reference< ::chart::BaseCoordinateSystem > &xCooSys, sal_Int32 &rOutDimensionIndex, sal_Int32 &rOutAxisIndex)
static bool isAxisVisible(const rtl::Reference< ::chart::Axis > &xAxis)
Definition: AxisHelper.cxx:641
static sal_Int32 getNumberOfDisplayedSeries(const rtl::Reference< ::chart::ChartType > &xChartType, sal_Int32 nNumberOfSeries)
static bool isSupportingMainAxis(const rtl::Reference< ::chart::ChartType > &xChartType, sal_Int32 nDimensionCount, sal_Int32 nDimensionIndex)
static bool isSupportingStatisticProperties(const rtl::Reference< ::chart::ChartType > &xChartType, sal_Int32 nDimensionCount)
static bool isSupportingSecondaryAxis(const rtl::Reference< ::chart::ChartType > &xChartType, sal_Int32 nDimensionCount)
static rtl::Reference< SvxShapeGroupAnyD > getChartRootShape(const rtl::Reference< SvxDrawPage > &xPage)
static bool hasLegend(const rtl::Reference< ::chart::Diagram > &xDiagram)
returns <FALSE>, if either there is no legend at the diagram, or there is a legend which has a "Show"...
ObjectIdentifier getParentImpl(const ObjectIdentifier &rParentOID, const ObjectIdentifier &rOID) const
void createDiagramTree(tChildContainer &rContainer, const rtl::Reference<::chart::ChartModel > &xChartDoc, const rtl::Reference< ::chart::Diagram > &xDiagram)
static ObjectIdentifier getRootNodeOID()
const tChildContainer & getTopLevelChildren() const
equal to getChildren( getRootNodeOID())
std::vector< ObjectIdentifier > tChildContainer
ExplicitValueProvider * m_pExplicitValueProvider
void createAxesTree(tChildContainer &rContainer, const rtl::Reference<::chart::ChartModel > &xChartDoc, const rtl::Reference< ::chart::Diagram > &xDiagram)
ObjectIdentifier getParent(const ObjectIdentifier &rNode) const
The result is empty, if the node cannot be found in the tree.
sal_Int32 getIndexInParent(const ObjectIdentifier &rNode) const
static bool isRootNode(const ObjectIdentifier &rOID)
const tChildContainer & getChildren(const ObjectIdentifier &rParent) const
void createTree(const rtl::Reference<::chart::ChartModel > &xChartDocument)
void createDataSeriesTree(tChildContainer &rOutDiagramSubContainer, const rtl::Reference< ::chart::Diagram > &xDiagram)
bool hasChildren(const ObjectIdentifier &rParent) const
void createLegendTree(tChildContainer &rContainer, const rtl::Reference<::chart::ChartModel > &xChartDoc, const rtl::Reference< ::chart::Diagram > &xDiagram)
void createAdditionalShapesTree(tChildContainer &rContainer)
ObjectHierarchy(const rtl::Reference<::chart::ChartModel > &xChartDocument, ExplicitValueProvider *pExplicitValueProvider, bool bFlattenDiagram=false, bool bOrderingForElementSelector=false)
const tChildContainer & getSiblings(const ObjectIdentifier &rNode) const
static void createWallAndFloor(tChildContainer &rContainer, const rtl::Reference< ::chart::Diagram > &xDiagram)
static OUString createClassifiedIdentifierForParticle(std::u16string_view rParticle)
static OUString createDataCurveEquationCID(std::u16string_view rSeriesParticle, sal_Int32 nCurveIndex)
static bool isCID(std::u16string_view rName)
static OUString getStringForType(ObjectType eObjectType)
const OUString & getObjectCID() const
static OUString createDataCurveCID(std::u16string_view rSeriesParticle, sal_Int32 nCurveIndex, bool bAverageLine)
static OUString createClassifiedIdentifier(enum ObjectType eObjectType, std::u16string_view rParticleID)
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())
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 createParticleForSeries(sal_Int32 nDiagramIndex, sal_Int32 nCooSysIndex, sal_Int32 nChartTypeIndex, sal_Int32 nSeriesIndex)
static OUString createClassifiedIdentifierForGrid(const css::uno::Reference< css::chart2::XAxis > &xAxis, const rtl::Reference<::chart::ChartModel > &xChartModel, sal_Int32 nSubIndex=-1)
static OUString createClassifiedIdentifierForObject(const css::uno::Reference< css::uno::XInterface > &xObject, const rtl::Reference<::chart::ChartModel > &xChartModel)
const ObjectIdentifier & getCurrentSelection() const
ObjectKeyNavigation(ObjectIdentifier aCurrentOID, rtl::Reference<::chart::ChartModel > xChartDocument, ExplicitValueProvider *pExplicitValueProvider)
bool handleKeyEvent(const css::awt::KeyEvent &rEvent)
ExplicitValueProvider * m_pExplicitValueProvider
void setCurrentSelection(const ObjectIdentifier &rOID)
rtl::Reference<::chart::ChartModel > m_xChartDocument
int nCount
#define DBG_UNHANDLED_EXCEPTION(...)
float u
sal_Int32 nIndex
OUString aName
OOO_DLLPUBLIC_CHARTTOOLS bool hasDataLabelsAtSeries(const rtl::Reference< ::chart::DataSeries > &xSeries)
OOO_DLLPUBLIC_CHARTTOOLS bool isMeanValueLine(const css::uno::Reference< css::chart2::XRegressionCurve > &xRegCurve)
OOO_DLLPUBLIC_CHARTTOOLS bool hasEquation(const css::uno::Reference< css::chart2::XRegressionCurve > &xCurve)
@ OBJECTTYPE_DATA_LABELS
@ OBJECTTYPE_DATA_ERRORS_X
@ OBJECTTYPE_DIAGRAM_FLOOR
@ OBJECTTYPE_DATA_ERRORS_Y
@ OBJECTTYPE_DIAGRAM_WALL
int i
constexpr OUStringLiteral EMPTY
constexpr OUStringLiteral CHART_UNONAME_ERRORBAR_Y
Definition: unonames.hxx:23
constexpr OUStringLiteral CHART_UNONAME_ERRORBAR_X
Definition: unonames.hxx:22