1*cde9e8dcSAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*cde9e8dcSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*cde9e8dcSAndrew Rist * or more contributor license agreements. See the NOTICE file 5*cde9e8dcSAndrew Rist * distributed with this work for additional information 6*cde9e8dcSAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*cde9e8dcSAndrew Rist * to you under the Apache License, Version 2.0 (the 8*cde9e8dcSAndrew Rist * "License"); you may not use this file except in compliance 9*cde9e8dcSAndrew Rist * with the License. You may obtain a copy of the License at 10cdf0e10cSrcweir * 11*cde9e8dcSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12cdf0e10cSrcweir * 13*cde9e8dcSAndrew Rist * Unless required by applicable law or agreed to in writing, 14*cde9e8dcSAndrew Rist * software distributed under the License is distributed on an 15*cde9e8dcSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*cde9e8dcSAndrew Rist * KIND, either express or implied. See the License for the 17*cde9e8dcSAndrew Rist * specific language governing permissions and limitations 18*cde9e8dcSAndrew Rist * under the License. 19cdf0e10cSrcweir * 20*cde9e8dcSAndrew Rist *************************************************************/ 21*cde9e8dcSAndrew Rist 22*cde9e8dcSAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove 25cdf0e10cSrcweir #include "precompiled_chart2.hxx" 26cdf0e10cSrcweir #include "TitleHelper.hxx" 27cdf0e10cSrcweir #include "ChartModelHelper.hxx" 28cdf0e10cSrcweir #include "macros.hxx" 29cdf0e10cSrcweir #include "AxisHelper.hxx" 30cdf0e10cSrcweir #include "DiagramHelper.hxx" 31cdf0e10cSrcweir #include <com/sun/star/chart2/XChartDocument.hpp> 32cdf0e10cSrcweir #include <rtl/ustrbuf.hxx> 33cdf0e10cSrcweir 34cdf0e10cSrcweir //............................................................................. 35cdf0e10cSrcweir namespace chart 36cdf0e10cSrcweir { 37cdf0e10cSrcweir //............................................................................. 38cdf0e10cSrcweir 39cdf0e10cSrcweir using namespace ::com::sun::star; 40cdf0e10cSrcweir using namespace ::com::sun::star::chart2; 41cdf0e10cSrcweir using ::com::sun::star::uno::Reference; 42cdf0e10cSrcweir 43cdf0e10cSrcweir uno::Reference< XTitled > lcl_getTitleParentFromDiagram( 44cdf0e10cSrcweir TitleHelper::eTitleType nTitleIndex 45cdf0e10cSrcweir , const uno::Reference< XDiagram >& xDiagram ) 46cdf0e10cSrcweir { 47cdf0e10cSrcweir uno::Reference< XTitled > xResult; 48cdf0e10cSrcweir 49cdf0e10cSrcweir if( nTitleIndex == TitleHelper::TITLE_AT_STANDARD_X_AXIS_POSITION || 50cdf0e10cSrcweir nTitleIndex == TitleHelper::TITLE_AT_STANDARD_Y_AXIS_POSITION ) 51cdf0e10cSrcweir { 52cdf0e10cSrcweir bool bDummy = false; 53cdf0e10cSrcweir bool bIsVertical = DiagramHelper::getVertical( xDiagram, bDummy, bDummy ); 54cdf0e10cSrcweir 55cdf0e10cSrcweir if( nTitleIndex == TitleHelper::TITLE_AT_STANDARD_Y_AXIS_POSITION ) 56cdf0e10cSrcweir nTitleIndex = bIsVertical ? TitleHelper::X_AXIS_TITLE : TitleHelper::Y_AXIS_TITLE; 57cdf0e10cSrcweir else 58cdf0e10cSrcweir nTitleIndex = bIsVertical ? TitleHelper::Y_AXIS_TITLE : TitleHelper::X_AXIS_TITLE; 59cdf0e10cSrcweir } 60cdf0e10cSrcweir 61cdf0e10cSrcweir 62cdf0e10cSrcweir switch( nTitleIndex ) 63cdf0e10cSrcweir { 64cdf0e10cSrcweir case TitleHelper::SUB_TITLE: 65cdf0e10cSrcweir if( xDiagram.is()) 66cdf0e10cSrcweir xResult.set( xDiagram, uno::UNO_QUERY ); 67cdf0e10cSrcweir break; 68cdf0e10cSrcweir case TitleHelper::X_AXIS_TITLE: 69cdf0e10cSrcweir if( xDiagram.is()) 70cdf0e10cSrcweir xResult.set( AxisHelper::getAxis( 0, true, xDiagram ), uno::UNO_QUERY ); 71cdf0e10cSrcweir break; 72cdf0e10cSrcweir case TitleHelper::Y_AXIS_TITLE: 73cdf0e10cSrcweir if( xDiagram.is()) 74cdf0e10cSrcweir xResult.set( AxisHelper::getAxis( 1, true, xDiagram ), uno::UNO_QUERY ); 75cdf0e10cSrcweir break; 76cdf0e10cSrcweir case TitleHelper::Z_AXIS_TITLE: 77cdf0e10cSrcweir if( xDiagram.is()) 78cdf0e10cSrcweir xResult.set( AxisHelper::getAxis( 2, true, xDiagram ), uno::UNO_QUERY ); 79cdf0e10cSrcweir break; 80cdf0e10cSrcweir case TitleHelper::SECONDARY_X_AXIS_TITLE: 81cdf0e10cSrcweir if( xDiagram.is()) 82cdf0e10cSrcweir xResult.set( AxisHelper::getAxis( 0, false, xDiagram ), uno::UNO_QUERY ); 83cdf0e10cSrcweir break; 84cdf0e10cSrcweir case TitleHelper::SECONDARY_Y_AXIS_TITLE: 85cdf0e10cSrcweir if( xDiagram.is()) 86cdf0e10cSrcweir xResult.set( AxisHelper::getAxis( 1, false, xDiagram ), uno::UNO_QUERY ); 87cdf0e10cSrcweir break; 88cdf0e10cSrcweir 89cdf0e10cSrcweir case TitleHelper::MAIN_TITLE: 90cdf0e10cSrcweir default: 91cdf0e10cSrcweir OSL_ENSURE( false, "Unsupported Title-Type requested" ); 92cdf0e10cSrcweir break; 93cdf0e10cSrcweir } 94cdf0e10cSrcweir 95cdf0e10cSrcweir return xResult; 96cdf0e10cSrcweir } 97cdf0e10cSrcweir 98cdf0e10cSrcweir uno::Reference< XTitled > lcl_getTitleParent( TitleHelper::eTitleType nTitleIndex 99cdf0e10cSrcweir , const uno::Reference< frame::XModel >& xModel ) 100cdf0e10cSrcweir { 101cdf0e10cSrcweir uno::Reference< XTitled > xResult; 102cdf0e10cSrcweir uno::Reference< XChartDocument > xChartDoc( xModel, uno::UNO_QUERY ); 103cdf0e10cSrcweir uno::Reference< XDiagram > xDiagram; 104cdf0e10cSrcweir if( xChartDoc.is()) 105cdf0e10cSrcweir xDiagram.set( xChartDoc->getFirstDiagram()); 106cdf0e10cSrcweir 107cdf0e10cSrcweir switch( nTitleIndex ) 108cdf0e10cSrcweir { 109cdf0e10cSrcweir case TitleHelper::MAIN_TITLE: 110cdf0e10cSrcweir xResult.set( xModel, uno::UNO_QUERY ); 111cdf0e10cSrcweir break; 112cdf0e10cSrcweir case TitleHelper::SUB_TITLE: 113cdf0e10cSrcweir case TitleHelper::X_AXIS_TITLE: 114cdf0e10cSrcweir case TitleHelper::Y_AXIS_TITLE: 115cdf0e10cSrcweir case TitleHelper::Z_AXIS_TITLE: 116cdf0e10cSrcweir case TitleHelper::TITLE_AT_STANDARD_X_AXIS_POSITION: 117cdf0e10cSrcweir case TitleHelper::TITLE_AT_STANDARD_Y_AXIS_POSITION: 118cdf0e10cSrcweir case TitleHelper::SECONDARY_X_AXIS_TITLE: 119cdf0e10cSrcweir case TitleHelper::SECONDARY_Y_AXIS_TITLE: 120cdf0e10cSrcweir xResult.set( lcl_getTitleParentFromDiagram( nTitleIndex, xDiagram )); 121cdf0e10cSrcweir break; 122cdf0e10cSrcweir default: 123cdf0e10cSrcweir OSL_ENSURE( false, "Unsupported Title-Type requested" ); 124cdf0e10cSrcweir break; 125cdf0e10cSrcweir } 126cdf0e10cSrcweir 127cdf0e10cSrcweir return xResult; 128cdf0e10cSrcweir } 129cdf0e10cSrcweir 130cdf0e10cSrcweir uno::Reference< XTitle > TitleHelper::getTitle( TitleHelper::eTitleType nTitleIndex 131cdf0e10cSrcweir , const uno::Reference< frame::XModel >& xModel ) 132cdf0e10cSrcweir { 133cdf0e10cSrcweir uno::Reference< XTitled > xTitled( lcl_getTitleParent( nTitleIndex, xModel ) ); 134cdf0e10cSrcweir if( xTitled.is()) 135cdf0e10cSrcweir return xTitled->getTitleObject(); 136cdf0e10cSrcweir return NULL; 137cdf0e10cSrcweir } 138cdf0e10cSrcweir 139cdf0e10cSrcweir uno::Reference< XTitle > TitleHelper::createTitle( 140cdf0e10cSrcweir TitleHelper::eTitleType eTitleType 141cdf0e10cSrcweir , const rtl::OUString& rTitleText 142cdf0e10cSrcweir , const uno::Reference< frame::XModel >& xModel 143cdf0e10cSrcweir , const uno::Reference< uno::XComponentContext > & xContext 144cdf0e10cSrcweir , ReferenceSizeProvider * pRefSizeProvider ) 145cdf0e10cSrcweir { 146cdf0e10cSrcweir uno::Reference< XTitle > xTitle; 147cdf0e10cSrcweir uno::Reference< XTitled > xTitled( lcl_getTitleParent( eTitleType, xModel ) ); 148cdf0e10cSrcweir 149cdf0e10cSrcweir if( !xTitled.is() ) 150cdf0e10cSrcweir { 151cdf0e10cSrcweir uno::Reference< XDiagram > xDiagram( ChartModelHelper::findDiagram( xModel ) ); 152cdf0e10cSrcweir uno::Reference< chart2::XAxis > xAxis; 153cdf0e10cSrcweir switch( eTitleType ) 154cdf0e10cSrcweir { 155cdf0e10cSrcweir case TitleHelper::SECONDARY_X_AXIS_TITLE: 156cdf0e10cSrcweir xAxis = AxisHelper::createAxis( 0, false, xDiagram, xContext ); 157cdf0e10cSrcweir break; 158cdf0e10cSrcweir case TitleHelper::SECONDARY_Y_AXIS_TITLE: 159cdf0e10cSrcweir xAxis = AxisHelper::createAxis( 1, false, xDiagram, xContext ); 160cdf0e10cSrcweir break; 161cdf0e10cSrcweir default: 162cdf0e10cSrcweir break; 163cdf0e10cSrcweir } 164cdf0e10cSrcweir uno::Reference< beans::XPropertySet > xProps( xAxis, uno::UNO_QUERY ); 165cdf0e10cSrcweir if( xProps.is() ) 166cdf0e10cSrcweir { 167cdf0e10cSrcweir xProps->setPropertyValue( C2U( "Show" ), uno::makeAny( sal_False ) ); 168cdf0e10cSrcweir xTitled = lcl_getTitleParent( eTitleType, xModel ); 169cdf0e10cSrcweir } 170cdf0e10cSrcweir } 171cdf0e10cSrcweir 172cdf0e10cSrcweir if(xTitled.is()) 173cdf0e10cSrcweir { 174cdf0e10cSrcweir uno::Reference< XDiagram > xDiagram( ChartModelHelper::findDiagram( xModel ) ); 175cdf0e10cSrcweir 176cdf0e10cSrcweir xTitle.set( xContext->getServiceManager()->createInstanceWithContext( 177cdf0e10cSrcweir C2U( "com.sun.star.chart2.Title" ), 178cdf0e10cSrcweir xContext ), uno::UNO_QUERY ); 179cdf0e10cSrcweir 180cdf0e10cSrcweir if(xTitle.is()) 181cdf0e10cSrcweir { 182cdf0e10cSrcweir // default char height (main: 13.0 == default) 183cdf0e10cSrcweir float fDefaultCharHeightSub = 11.0; 184cdf0e10cSrcweir float fDefaultCharHeightAxis = 9.0; 185cdf0e10cSrcweir switch( eTitleType ) 186cdf0e10cSrcweir { 187cdf0e10cSrcweir case TitleHelper::SUB_TITLE: 188cdf0e10cSrcweir TitleHelper::setCompleteString( 189cdf0e10cSrcweir rTitleText, xTitle, xContext, & fDefaultCharHeightSub ); 190cdf0e10cSrcweir break; 191cdf0e10cSrcweir case TitleHelper::X_AXIS_TITLE: 192cdf0e10cSrcweir case TitleHelper::Y_AXIS_TITLE: 193cdf0e10cSrcweir case TitleHelper::Z_AXIS_TITLE: 194cdf0e10cSrcweir case TitleHelper::TITLE_AT_STANDARD_X_AXIS_POSITION: 195cdf0e10cSrcweir case TitleHelper::TITLE_AT_STANDARD_Y_AXIS_POSITION: 196cdf0e10cSrcweir case TitleHelper::SECONDARY_X_AXIS_TITLE: 197cdf0e10cSrcweir case TitleHelper::SECONDARY_Y_AXIS_TITLE: 198cdf0e10cSrcweir TitleHelper::setCompleteString( 199cdf0e10cSrcweir rTitleText, xTitle, xContext, & fDefaultCharHeightAxis ); 200cdf0e10cSrcweir break; 201cdf0e10cSrcweir default: 202cdf0e10cSrcweir TitleHelper::setCompleteString( rTitleText, xTitle, xContext ); 203cdf0e10cSrcweir break; 204cdf0e10cSrcweir } 205cdf0e10cSrcweir 206cdf0e10cSrcweir // set/clear autoscale 207cdf0e10cSrcweir if( pRefSizeProvider ) 208cdf0e10cSrcweir pRefSizeProvider->setValuesAtTitle( xTitle ); 209cdf0e10cSrcweir 210cdf0e10cSrcweir xTitled->setTitleObject( xTitle ); 211cdf0e10cSrcweir 212cdf0e10cSrcweir //default rotation 90 degree for y axis title in normal coordinatesystems or for x axis title for swapped coordinatesystems 213cdf0e10cSrcweir if( eTitleType == TitleHelper::X_AXIS_TITLE || 214cdf0e10cSrcweir eTitleType == TitleHelper::Y_AXIS_TITLE || 215cdf0e10cSrcweir eTitleType == TitleHelper::SECONDARY_X_AXIS_TITLE || 216cdf0e10cSrcweir eTitleType == TitleHelper::SECONDARY_Y_AXIS_TITLE ) 217cdf0e10cSrcweir 218cdf0e10cSrcweir { 219cdf0e10cSrcweir try 220cdf0e10cSrcweir { 221cdf0e10cSrcweir bool bDummy = false; 222cdf0e10cSrcweir bool bIsVertical = DiagramHelper::getVertical( xDiagram, bDummy, bDummy ); 223cdf0e10cSrcweir 224cdf0e10cSrcweir Reference< beans::XPropertySet > xTitleProps( xTitle, uno::UNO_QUERY ); 225cdf0e10cSrcweir if( xTitleProps.is() ) 226cdf0e10cSrcweir { 227cdf0e10cSrcweir double fNewAngleDegree = 90.0; 228cdf0e10cSrcweir if( (!bIsVertical && eTitleType == TitleHelper::Y_AXIS_TITLE) 229cdf0e10cSrcweir || (bIsVertical && eTitleType == TitleHelper::X_AXIS_TITLE) 230cdf0e10cSrcweir || (!bIsVertical && eTitleType == TitleHelper::SECONDARY_Y_AXIS_TITLE) 231cdf0e10cSrcweir || (bIsVertical && eTitleType == TitleHelper::SECONDARY_X_AXIS_TITLE) ) 232cdf0e10cSrcweir xTitleProps->setPropertyValue( C2U( "TextRotation" ), uno::makeAny( fNewAngleDegree )); 233cdf0e10cSrcweir } 234cdf0e10cSrcweir } 235cdf0e10cSrcweir catch( uno::Exception & ex ) 236cdf0e10cSrcweir { 237cdf0e10cSrcweir ASSERT_EXCEPTION( ex ); 238cdf0e10cSrcweir } 239cdf0e10cSrcweir } 240cdf0e10cSrcweir } 241cdf0e10cSrcweir } 242cdf0e10cSrcweir return xTitle; 243cdf0e10cSrcweir 244cdf0e10cSrcweir } 245cdf0e10cSrcweir 246cdf0e10cSrcweir rtl::OUString TitleHelper::getCompleteString( const uno::Reference< XTitle >& xTitle ) 247cdf0e10cSrcweir { 248cdf0e10cSrcweir rtl::OUString aRet; 249cdf0e10cSrcweir if(!xTitle.is()) 250cdf0e10cSrcweir return aRet; 251cdf0e10cSrcweir uno::Sequence< uno::Reference< XFormattedString > > aStringList = xTitle->getText(); 252cdf0e10cSrcweir for( sal_Int32 nN=0; nN<aStringList.getLength();nN++ ) 253cdf0e10cSrcweir aRet += aStringList[nN]->getString(); 254cdf0e10cSrcweir return aRet; 255cdf0e10cSrcweir } 256cdf0e10cSrcweir 257cdf0e10cSrcweir void TitleHelper::setCompleteString( const rtl::OUString& rNewText 258cdf0e10cSrcweir , const uno::Reference< XTitle >& xTitle 259cdf0e10cSrcweir , const uno::Reference< uno::XComponentContext > & xContext 260cdf0e10cSrcweir , float * pDefaultCharHeight /* = 0 */ ) 261cdf0e10cSrcweir { 262cdf0e10cSrcweir //the format of the first old text portion will be maintained if there is any 263cdf0e10cSrcweir if(!xTitle.is()) 264cdf0e10cSrcweir return; 265cdf0e10cSrcweir 266cdf0e10cSrcweir rtl::OUString aNewText = rNewText; 267cdf0e10cSrcweir 268cdf0e10cSrcweir bool bStacked = false; 269cdf0e10cSrcweir uno::Reference< beans::XPropertySet > xTitleProperties( xTitle, uno::UNO_QUERY ); 270cdf0e10cSrcweir if( xTitleProperties.is() ) 271cdf0e10cSrcweir xTitleProperties->getPropertyValue( C2U( "StackCharacters" ) ) >>= bStacked; 272cdf0e10cSrcweir 273cdf0e10cSrcweir if( bStacked ) 274cdf0e10cSrcweir { 275cdf0e10cSrcweir //#i99841# remove linebreaks that were added for vertical stacking 276cdf0e10cSrcweir rtl::OUStringBuffer aUnstackedStr; 277cdf0e10cSrcweir rtl::OUStringBuffer aSource(rNewText); 278cdf0e10cSrcweir 279cdf0e10cSrcweir bool bBreakIgnored = false; 280cdf0e10cSrcweir sal_Int32 nLen = rNewText.getLength(); 281cdf0e10cSrcweir for( sal_Int32 nPos = 0; nPos < nLen; ++nPos ) 282cdf0e10cSrcweir { 283cdf0e10cSrcweir sal_Unicode aChar = aSource.charAt( nPos ); 284cdf0e10cSrcweir if( aChar != '\n' ) 285cdf0e10cSrcweir { 286cdf0e10cSrcweir aUnstackedStr.append( aChar ); 287cdf0e10cSrcweir bBreakIgnored = false; 288cdf0e10cSrcweir } 289cdf0e10cSrcweir else if( aChar == '\n' && bBreakIgnored ) 290cdf0e10cSrcweir aUnstackedStr.append( aChar ); 291cdf0e10cSrcweir else 292cdf0e10cSrcweir bBreakIgnored = true; 293cdf0e10cSrcweir } 294cdf0e10cSrcweir aNewText = aUnstackedStr.makeStringAndClear(); 295cdf0e10cSrcweir } 296cdf0e10cSrcweir 297cdf0e10cSrcweir uno::Sequence< uno::Reference< XFormattedString > > aNewStringList(1); 298cdf0e10cSrcweir 299cdf0e10cSrcweir uno::Sequence< uno::Reference< XFormattedString > > aOldStringList = xTitle->getText(); 300cdf0e10cSrcweir if( aOldStringList.getLength() ) 301cdf0e10cSrcweir { 302cdf0e10cSrcweir aNewStringList[0].set( aOldStringList[0] ); 303cdf0e10cSrcweir aNewStringList[0]->setString( aNewText ); 304cdf0e10cSrcweir } 305cdf0e10cSrcweir else 306cdf0e10cSrcweir { 307cdf0e10cSrcweir uno::Reference< uno::XInterface > xI( 308cdf0e10cSrcweir xContext->getServiceManager()->createInstanceWithContext( 309cdf0e10cSrcweir C2U( "com.sun.star.chart2.FormattedString" ), xContext ) ); 310cdf0e10cSrcweir uno::Reference< XFormattedString > xFormattedString( xI, uno::UNO_QUERY ); 311cdf0e10cSrcweir 312cdf0e10cSrcweir if(xFormattedString.is()) 313cdf0e10cSrcweir { 314cdf0e10cSrcweir xFormattedString->setString( aNewText ); 315cdf0e10cSrcweir aNewStringList[0].set( xFormattedString ); 316cdf0e10cSrcweir if( pDefaultCharHeight != 0 ) 317cdf0e10cSrcweir { 318cdf0e10cSrcweir try 319cdf0e10cSrcweir { 320cdf0e10cSrcweir uno::Reference< beans::XPropertySet > xProp( xFormattedString, uno::UNO_QUERY_THROW ); 321cdf0e10cSrcweir 322cdf0e10cSrcweir uno::Any aFontSize( uno::makeAny( *pDefaultCharHeight )); 323cdf0e10cSrcweir xProp->setPropertyValue( C2U("CharHeight"), aFontSize ); 324cdf0e10cSrcweir xProp->setPropertyValue( C2U("CharHeightAsian"), aFontSize ); 325cdf0e10cSrcweir xProp->setPropertyValue( C2U("CharHeightComplex"), aFontSize ); 326cdf0e10cSrcweir } 327cdf0e10cSrcweir catch( uno::Exception & ex ) 328cdf0e10cSrcweir { 329cdf0e10cSrcweir ASSERT_EXCEPTION( ex ); 330cdf0e10cSrcweir } 331cdf0e10cSrcweir } 332cdf0e10cSrcweir } 333cdf0e10cSrcweir } 334cdf0e10cSrcweir xTitle->setText( aNewStringList ); 335cdf0e10cSrcweir } 336cdf0e10cSrcweir 337cdf0e10cSrcweir void TitleHelper::removeTitle( TitleHelper::eTitleType nTitleIndex 338cdf0e10cSrcweir , const ::com::sun::star::uno::Reference< 339cdf0e10cSrcweir ::com::sun::star::frame::XModel >& xModel ) 340cdf0e10cSrcweir { 341cdf0e10cSrcweir uno::Reference< XTitled > xTitled( lcl_getTitleParent( nTitleIndex, xModel ) ); 342cdf0e10cSrcweir if( xTitled.is()) 343cdf0e10cSrcweir { 344cdf0e10cSrcweir xTitled->setTitleObject(NULL); 345cdf0e10cSrcweir } 346cdf0e10cSrcweir } 347cdf0e10cSrcweir 348cdf0e10cSrcweir bool TitleHelper::getTitleType( eTitleType& rType 349cdf0e10cSrcweir , const ::com::sun::star::uno::Reference< 350cdf0e10cSrcweir ::com::sun::star::chart2::XTitle >& xTitle 351cdf0e10cSrcweir , const ::com::sun::star::uno::Reference< 352cdf0e10cSrcweir ::com::sun::star::frame::XModel >& xModel ) 353cdf0e10cSrcweir { 354cdf0e10cSrcweir if( !xTitle.is() || !xModel.is() ) 355cdf0e10cSrcweir return false; 356cdf0e10cSrcweir 357cdf0e10cSrcweir Reference< chart2::XTitle > xCurrentTitle; 358cdf0e10cSrcweir for( sal_Int32 nTitleType = TITLE_BEGIN; nTitleType < NORMAL_TITLE_END; nTitleType++ ) 359cdf0e10cSrcweir { 360cdf0e10cSrcweir xCurrentTitle = TitleHelper::getTitle( static_cast<eTitleType>(nTitleType), xModel ); 361cdf0e10cSrcweir if( xCurrentTitle == xTitle ) 362cdf0e10cSrcweir { 363cdf0e10cSrcweir rType = static_cast<eTitleType>(nTitleType); 364cdf0e10cSrcweir return true; 365cdf0e10cSrcweir } 366cdf0e10cSrcweir } 367cdf0e10cSrcweir 368cdf0e10cSrcweir return false; 369cdf0e10cSrcweir } 370cdf0e10cSrcweir 371cdf0e10cSrcweir //............................................................................. 372cdf0e10cSrcweir } //namespace chart 373cdf0e10cSrcweir //............................................................................. 374cdf0e10cSrcweir 375