diff options
author | Ingrid Halama <iha@openoffice.org> | 2009-12-15 16:30:15 +0100 |
---|---|---|
committer | Ingrid Halama <iha@openoffice.org> | 2009-12-15 16:30:15 +0100 |
commit | 91f22fc22a92557dd823ac63456743736fd27ec0 (patch) | |
tree | d89d26ed8b9f009ad02902160fdc0af82815b939 /chart2/source/view/axes/VAxisBase.cxx | |
parent | 4d5f3c429b4391d63cab1af8b070b04f5787f5c4 (diff) |
chartmultiline: #i82971# complex categories (part2 - hierarchical axis label display)
Diffstat (limited to 'chart2/source/view/axes/VAxisBase.cxx')
-rw-r--r-- | chart2/source/view/axes/VAxisBase.cxx | 41 |
1 files changed, 27 insertions, 14 deletions
diff --git a/chart2/source/view/axes/VAxisBase.cxx b/chart2/source/view/axes/VAxisBase.cxx index be24262e8801..530da86dab8f 100644 --- a/chart2/source/view/axes/VAxisBase.cxx +++ b/chart2/source/view/axes/VAxisBase.cxx @@ -98,13 +98,15 @@ void SAL_CALL VAxisBase::initAxisLabelProperties( const ::com::sun::star::awt::S else if( AxisType::CATEGORY==m_aAxisProperties.m_nAxisType ) { if( m_aAxisProperties.m_pExplicitCategoriesProvider ) - m_aTextLabels = m_aAxisProperties.m_pExplicitCategoriesProvider->getTextualData(); + m_aTextLabels = m_aAxisProperties.m_pExplicitCategoriesProvider->getSimpleCategories(); m_bUseTextLabels = true; } m_aAxisLabelProperties.nNumberFormatKey = m_aAxisProperties.m_nNumberFormatKey; m_aAxisLabelProperties.init(m_aAxisProperties.m_xAxisModel); + if( m_aAxisProperties.m_bComplexCategories && AxisType::CATEGORY == m_aAxisProperties.m_nAxisType ) + m_aAxisLabelProperties.eStaggering = SIDE_BY_SIDE; } void VAxisBase::recordMaximumTextSize( const Reference< drawing::XShape >& xShape, double fRotationAngleDegree ) @@ -161,6 +163,12 @@ void SAL_CALL VAxisBase::setExplicitScaleAndIncrement( m_aIncrement = rIncrement; } +void VAxisBase::createAllTickInfos( ::std::vector< ::std::vector< TickInfo > >& rAllTickInfos ) +{ + std::auto_ptr< TickmarkHelper > apTickmarkHelper( this->createTickmarkHelper() ); + apTickmarkHelper->getAllTicks( rAllTickInfos ); +} + bool VAxisBase::prepareShapeCreation() { //returns true if all is ready for further shape creation and any shapes need to be created @@ -171,14 +179,9 @@ bool VAxisBase::prepareShapeCreation() { //----------------------------------------- //create all scaled tickmark values - if( m_xTextTarget.is() ) - { - TickIter aRemoveIter( m_aAllTickInfos, m_aIncrement, 0, 0 ); - removeTextShapesFromTicks( aRemoveIter, m_xTextTarget ); - } + removeTextShapesFromTicks(); - std::auto_ptr< TickmarkHelper > apTickmarkHelper( this->createTickmarkHelper() ); - apTickmarkHelper->getAllTicks( m_aAllTickInfos ); + createAllTickInfos(m_aAllTickInfos); m_bReCreateAllTickInfos = false; } @@ -212,15 +215,25 @@ sal_Int32 VAxisBase::getIndexOfLongestLabel( const uno::Sequence< rtl::OUString return nRet; } -void VAxisBase::removeTextShapesFromTicks( TickIter& rIter, const Reference< drawing::XShapes >& xTarget ) +void VAxisBase::removeTextShapesFromTicks() { - for( TickInfo* pTickInfo = rIter.firstInfo() - ; pTickInfo; pTickInfo = rIter.nextInfo() ) + if( m_xTextTarget.is() ) { - if(pTickInfo->xTextShape.is()) + ::std::vector< ::std::vector< TickInfo > >::iterator aDepthIter = m_aAllTickInfos.begin(); + const ::std::vector< ::std::vector< TickInfo > >::const_iterator aDepthEnd = m_aAllTickInfos.end(); + for( ; aDepthIter != aDepthEnd; aDepthIter++ ) { - xTarget->remove(pTickInfo->xTextShape); - pTickInfo->xTextShape = NULL; + ::std::vector< TickInfo >::iterator aTickIter = (*aDepthIter).begin(); + const ::std::vector< TickInfo >::const_iterator aTickEnd = (*aDepthIter).end(); + for( ; aTickIter != aTickEnd; aTickIter++ ) + { + TickInfo& rTickInfo = (*aTickIter); + if(rTickInfo.xTextShape.is()) + { + m_xTextTarget->remove(rTickInfo.xTextShape); + rTickInfo.xTextShape = NULL; + } + } } } } |