1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 28 #include "vbaaxis.hxx" 29 #include <ooo/vba/excel/XlAxisCrosses.hpp> 30 #include <ooo/vba/excel/XlAxisType.hpp> 31 #include <ooo/vba/excel/XlScaleType.hpp> 32 #include "vbaaxistitle.hxx" 33 #include "vbachart.hxx" 34 using namespace ::com::sun::star; 35 using namespace ::ooo::vba; 36 using namespace ::ooo::vba::excel::XlAxisCrosses; 37 using namespace ::ooo::vba::excel::XlAxisType; 38 using namespace ::ooo::vba::excel::XlScaleType; 39 40 const rtl::OUString ORIGIN( RTL_CONSTASCII_USTRINGPARAM("Origin") ); 41 const rtl::OUString AUTOORIGIN( RTL_CONSTASCII_USTRINGPARAM("AutoOrigin") ); 42 const rtl::OUString VBA_MIN( RTL_CONSTASCII_USTRINGPARAM("Max") ); 43 const rtl::OUString VBA_MAX( RTL_CONSTASCII_USTRINGPARAM("Min") ); 44 ScVbaChart* 45 ScVbaAxis::getChartPtr() throw( uno::RuntimeException ) 46 { 47 ScVbaChart* pChart = static_cast< ScVbaChart* >( moChartParent.get() ); 48 if ( !pChart ) 49 throw uno::RuntimeException( rtl::OUString::createFromAscii("Can't access parent chart impl"), uno::Reference< uno::XInterface >() ); 50 return pChart; 51 } 52 53 sal_Bool 54 ScVbaAxis::isValueAxis() throw( script::BasicErrorException ) 55 { 56 if ( getType() == xlCategory ) 57 { 58 DebugHelper::exception(SbERR_METHOD_FAILED, rtl::OUString()); 59 } 60 return sal_True; 61 } 62 63 ScVbaAxis::ScVbaAxis( const uno::Reference< XHelperInterface >& xParent,const uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< beans::XPropertySet >& _xPropertySet, sal_Int32 _nType, sal_Int32 _nGroup ) : ScVbaAxis_BASE( xParent, xContext ), mxPropertySet( _xPropertySet ), mnType( _nType ), mnGroup( _nGroup ), bCrossesAreCustomized( sal_False ) 64 { 65 oShapeHelper.reset( new ShapeHelper( uno::Reference< drawing::XShape >( mxPropertySet, uno::UNO_QUERY ) ) ); 66 moChartParent.set( xParent, uno::UNO_QUERY_THROW ); 67 setType(_nType); 68 setCrosses(xlAxisCrossesAutomatic); 69 } 70 71 void SAL_CALL 72 ScVbaAxis::Delete( ) throw (script::BasicErrorException, uno::RuntimeException) 73 { 74 uno::Reference< lang::XComponent > xComponent( mxPropertySet, uno::UNO_QUERY_THROW ); 75 xComponent->dispose(); 76 } 77 78 uno::Reference< ::ooo::vba::excel::XAxisTitle > SAL_CALL 79 ScVbaAxis::getAxisTitle( ) throw (script::BasicErrorException, uno::RuntimeException) 80 { 81 uno::Reference< excel::XAxisTitle > xAxisTitle; 82 try 83 { 84 ScVbaChart* pChart = getChartPtr(); 85 86 if (getHasTitle() ) 87 { 88 int nType = getType(); 89 switch(nType) 90 { 91 case xlCategory: 92 xAxisTitle = new ScVbaAxisTitle(this, mxContext, pChart->xAxisXSupplier->getXAxisTitle()); 93 break; 94 case xlSeriesAxis: 95 xAxisTitle = new ScVbaAxisTitle(this, mxContext, pChart->xAxisZSupplier->getZAxisTitle()); 96 break; 97 default: // xlValue: 98 xAxisTitle = new ScVbaAxisTitle(this, mxContext, pChart->xAxisYSupplier->getYAxisTitle()); 99 break; 100 } 101 } 102 } 103 catch (uno::Exception& e) 104 { 105 DebugHelper::exception(e); 106 } 107 return xAxisTitle; 108 109 } 110 111 void SAL_CALL 112 ScVbaAxis::setDisplayUnit( ::sal_Int32 /*DisplayUnit*/ ) throw (script::BasicErrorException, uno::RuntimeException) 113 { 114 DebugHelper::exception(SbERR_NOT_IMPLEMENTED, rtl::OUString()); 115 } 116 117 ::sal_Int32 SAL_CALL 118 ScVbaAxis::getDisplayUnit( ) throw (script::BasicErrorException, uno::RuntimeException) 119 { 120 DebugHelper::exception(SbERR_NOT_IMPLEMENTED, rtl::OUString()); 121 return -1; 122 } 123 124 void SAL_CALL 125 ScVbaAxis::setCrosses( ::sal_Int32 _nCrosses ) throw (script::BasicErrorException, uno::RuntimeException) 126 { 127 try 128 { 129 double fNum = 0.0; 130 switch (_nCrosses) 131 { 132 case xlAxisCrossesAutomatic: //Microsoft Excel sets the axis crossing point. 133 mxPropertySet->setPropertyValue(AUTOORIGIN, uno::makeAny( sal_True ) ); 134 bCrossesAreCustomized = sal_False; 135 return; 136 case xlAxisCrossesMinimum: // The axis crosses at the minimum value. 137 mxPropertySet->getPropertyValue(VBA_MIN) >>= fNum; 138 setCrossesAt( fNum ); 139 bCrossesAreCustomized = sal_False; 140 break; 141 case xlAxisCrossesMaximum: // The axis crosses at the maximum value. 142 mxPropertySet->getPropertyValue(VBA_MAX) >>= fNum; 143 setCrossesAt(fNum); 144 bCrossesAreCustomized = sal_False; 145 break; 146 default: //xlAxisCrossesCustom 147 bCrossesAreCustomized = sal_True; 148 break; 149 } 150 mxPropertySet->setPropertyValue(AUTOORIGIN, uno::makeAny(sal_False) ); 151 } 152 catch (uno::Exception& ) 153 { 154 DebugHelper::exception(SbERR_METHOD_FAILED, rtl::OUString()); 155 } 156 } 157 ::sal_Int32 SAL_CALL 158 ScVbaAxis::getCrosses( ) throw (script::BasicErrorException, uno::RuntimeException) 159 { 160 sal_Int32 nCrosses = xlAxisCrossesCustom; 161 try 162 { 163 sal_Bool bisAutoOrigin = sal_False; 164 mxPropertySet->getPropertyValue(AUTOORIGIN) >>= bisAutoOrigin; 165 if (bisAutoOrigin) 166 nCrosses = xlAxisCrossesAutomatic; 167 else 168 { 169 if (bCrossesAreCustomized) 170 nCrosses = xlAxisCrossesCustom; 171 else 172 { 173 double forigin = 0.0; 174 mxPropertySet->getPropertyValue(ORIGIN) >>= forigin; 175 //obsolete double fmax = AnyConverter.toDouble(mxPropertySet.getPropertyValue("Max")); 176 double fmin = 0.0; 177 mxPropertySet->getPropertyValue(VBA_MIN) >>= fmin; 178 if (forigin == fmin) 179 nCrosses = xlAxisCrossesMinimum; 180 else 181 nCrosses = xlAxisCrossesMaximum; 182 } 183 } 184 } 185 catch (uno::Exception& ) 186 { 187 DebugHelper::exception(SbERR_METHOD_FAILED, rtl::OUString() ); 188 } 189 return nCrosses; 190 } 191 192 void SAL_CALL 193 ScVbaAxis::setCrossesAt( double _fCrossesAt ) throw (script::BasicErrorException, uno::RuntimeException) 194 { 195 try 196 { 197 // if (getCrosses() == xlAxisCrossesCustom){ 198 setMaximumScaleIsAuto( sal_False ); 199 setMinimumScaleIsAuto( sal_False ); 200 mxPropertySet->setPropertyValue(ORIGIN, uno::makeAny(_fCrossesAt)); 201 // } 202 } 203 catch (uno::Exception& e) 204 { 205 DebugHelper::exception(e); 206 } 207 } 208 209 double SAL_CALL 210 ScVbaAxis::getCrossesAt( ) throw (script::BasicErrorException, uno::RuntimeException) 211 { 212 double fCrosses = 0.0; 213 try 214 { 215 mxPropertySet->getPropertyValue(ORIGIN) >>= fCrosses; 216 } 217 catch (uno::Exception& ) 218 { 219 DebugHelper::exception(SbERR_METHOD_FAILED, rtl::OUString()); 220 } 221 return fCrosses; 222 } 223 224 void SAL_CALL 225 ScVbaAxis::setType( ::sal_Int32 _nType ) throw (script::BasicErrorException, uno::RuntimeException) 226 { 227 mnType = _nType; 228 } 229 230 ::sal_Int32 SAL_CALL 231 ScVbaAxis::getType( ) throw (script::BasicErrorException, uno::RuntimeException) 232 { 233 return mnType; 234 } 235 236 void SAL_CALL 237 ScVbaAxis::setHasTitle( ::sal_Bool _bHasTitle ) throw (script::BasicErrorException, uno::RuntimeException) 238 { 239 try 240 { 241 ScVbaChart* pChart = getChartPtr(); 242 sal_Int32 nType = getType(); 243 switch(nType) 244 { 245 case xlCategory: 246 pChart->mxDiagramPropertySet->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("HasXAxisTitle")), uno::makeAny(_bHasTitle)); 247 break; 248 case xlSeriesAxis: 249 pChart->mxDiagramPropertySet->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("HasZAxisTitle")), uno::makeAny(_bHasTitle)); 250 break; 251 default: // xlValue: 252 pChart->mxDiagramPropertySet->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("HasYAxisTitle")), uno::makeAny(_bHasTitle)); 253 } 254 255 } 256 catch (uno::Exception& e) 257 { 258 DebugHelper::exception(e); 259 } 260 } 261 262 ::sal_Bool SAL_CALL 263 ScVbaAxis::getHasTitle( ) throw (script::BasicErrorException, uno::RuntimeException) 264 { 265 sal_Bool bHasTitle = sal_False; 266 try 267 { 268 ScVbaChart* pChart = getChartPtr(); 269 int nType = getType(); 270 switch(nType) 271 { 272 case xlCategory: 273 pChart->mxDiagramPropertySet->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("HasXAxisTitle")) ) >>= bHasTitle; 274 break; 275 case xlSeriesAxis: 276 pChart->mxDiagramPropertySet->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("HasZAxisTitle")) ) >>= bHasTitle; 277 break; 278 default: // xlValue: 279 pChart->mxDiagramPropertySet->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("HasYAxisTitle")) ) >>= bHasTitle; 280 } 281 } 282 catch (uno::Exception& e) 283 { 284 DebugHelper::exception(e); 285 } 286 return bHasTitle; 287 } 288 289 void SAL_CALL 290 ScVbaAxis::setMinorUnit( double _fMinorUnit ) throw (script::BasicErrorException, uno::RuntimeException) 291 { 292 try 293 { 294 if (isValueAxis()) 295 mxPropertySet->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("StepHelp") ), uno::makeAny(_fMinorUnit)); 296 } 297 catch (uno::Exception& ) 298 { 299 DebugHelper::exception(SbERR_METHOD_FAILED, rtl::OUString()); 300 } 301 } 302 303 double SAL_CALL 304 ScVbaAxis::getMinorUnit( ) throw (script::BasicErrorException, uno::RuntimeException) 305 { 306 double fMinor = 1.0; 307 try 308 { 309 if (isValueAxis()) 310 mxPropertySet->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("StepHelp"))) >>= fMinor; 311 } 312 catch (uno::Exception& ) 313 { 314 DebugHelper::exception(SbERR_METHOD_FAILED, rtl::OUString()); 315 } 316 return fMinor; 317 } 318 319 void SAL_CALL 320 ScVbaAxis::setMinorUnitIsAuto( ::sal_Bool _bMinorUnitIsAuto ) throw (script::BasicErrorException, uno::RuntimeException) 321 { 322 try 323 { 324 if (isValueAxis()) 325 mxPropertySet->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "AutoStepHelp" ) ), uno::makeAny(_bMinorUnitIsAuto)); 326 } 327 catch (uno::Exception& ) 328 { 329 DebugHelper::exception(SbERR_METHOD_FAILED, rtl::OUString() ); 330 } 331 } 332 333 ::sal_Bool SAL_CALL 334 ScVbaAxis::getMinorUnitIsAuto( ) throw (script::BasicErrorException, uno::RuntimeException) 335 { 336 sal_Bool bIsAuto = sal_False; 337 try 338 { 339 if (isValueAxis()) 340 { 341 mxPropertySet->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "AutoStepHelp")) ) >>= bIsAuto; 342 } 343 } 344 catch (uno::Exception& ) 345 { 346 DebugHelper::exception(SbERR_METHOD_FAILED, rtl::OUString()); 347 } 348 return bIsAuto; 349 } 350 351 void SAL_CALL 352 ScVbaAxis::setReversePlotOrder( ::sal_Bool /*ReversePlotOrder*/ ) throw (script::BasicErrorException, uno::RuntimeException) 353 { 354 DebugHelper::exception(SbERR_NOT_IMPLEMENTED, rtl::OUString()); 355 } 356 357 ::sal_Bool SAL_CALL 358 ScVbaAxis::getReversePlotOrder( ) throw (script::BasicErrorException, uno::RuntimeException) 359 { 360 DebugHelper::exception(SbERR_NOT_IMPLEMENTED, rtl::OUString()); 361 return sal_False; 362 } 363 364 void SAL_CALL 365 ScVbaAxis::setMajorUnit( double _fMajorUnit ) throw (script::BasicErrorException, uno::RuntimeException) 366 { 367 try 368 { 369 if (isValueAxis()) 370 { 371 mxPropertySet->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("StepMain")), uno::makeAny(_fMajorUnit)); 372 } 373 } 374 catch (uno::Exception& ) 375 { 376 DebugHelper::exception(SbERR_METHOD_FAILED, rtl::OUString()); 377 } 378 } 379 380 double SAL_CALL 381 ScVbaAxis::getMajorUnit( ) throw (script::BasicErrorException, uno::RuntimeException) 382 { 383 double fMax = 1.0; 384 try 385 { 386 if (isValueAxis()) 387 mxPropertySet->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("StepMain"))) >>= fMax; 388 } 389 catch (uno::Exception& ) 390 { 391 DebugHelper::exception(SbERR_METHOD_FAILED, rtl::OUString() ); 392 } 393 return fMax; 394 } 395 396 void SAL_CALL 397 ScVbaAxis::setMajorUnitIsAuto( ::sal_Bool _bMajorUnitIsAuto ) throw (script::BasicErrorException, uno::RuntimeException) 398 { 399 try 400 { 401 if (isValueAxis()) 402 { 403 mxPropertySet->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "AutoStepMain" ) ), uno::makeAny( _bMajorUnitIsAuto )); 404 } 405 } 406 catch (uno::Exception& ) 407 { 408 DebugHelper::exception(SbERR_METHOD_FAILED, rtl::OUString()); 409 } 410 } 411 412 ::sal_Bool SAL_CALL 413 ScVbaAxis::getMajorUnitIsAuto( ) throw (script::BasicErrorException, uno::RuntimeException) 414 { 415 sal_Bool bIsAuto = sal_False; 416 try 417 { 418 if (isValueAxis()) 419 { 420 mxPropertySet->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "AutoStepMain"))) >>= bIsAuto; 421 } 422 } 423 catch (uno::Exception& ) 424 { 425 DebugHelper::exception(SbERR_METHOD_FAILED, rtl::OUString()); 426 } 427 return bIsAuto; 428 } 429 430 void SAL_CALL 431 ScVbaAxis::setMaximumScale( double _fMaximumScale ) throw (script::BasicErrorException, uno::RuntimeException) 432 { 433 try 434 { 435 if ( isValueAxis() ) 436 { 437 mxPropertySet->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Max" ) ), uno::makeAny(_fMaximumScale)); 438 } 439 } 440 catch ( uno::Exception& ) 441 { 442 DebugHelper::exception(SbERR_METHOD_FAILED, rtl::OUString()); 443 } 444 } 445 446 double SAL_CALL 447 ScVbaAxis::getMaximumScale( ) throw (script::BasicErrorException, uno::RuntimeException) 448 { 449 double fMax = 1.0; 450 try 451 { 452 if (isValueAxis()) 453 { 454 mxPropertySet->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Max" ))) >>= fMax; 455 } 456 } 457 catch (uno::Exception& ) 458 { 459 DebugHelper::exception(SbERR_METHOD_FAILED, rtl::OUString()); 460 } 461 return fMax; 462 463 } 464 465 void SAL_CALL 466 ScVbaAxis::setMaximumScaleIsAuto( ::sal_Bool _bMaximumScaleIsAuto ) throw (script::BasicErrorException, uno::RuntimeException) 467 { 468 try 469 { 470 if ( isValueAxis() ) 471 mxPropertySet->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "AutoMax" ) ), uno::makeAny( _bMaximumScaleIsAuto )); 472 473 } 474 catch ( uno::Exception& ) 475 { 476 DebugHelper::exception(SbERR_METHOD_FAILED, rtl::OUString()); 477 } 478 } 479 480 481 ::sal_Bool SAL_CALL 482 ScVbaAxis::getMaximumScaleIsAuto( ) throw (script::BasicErrorException, uno::RuntimeException) 483 { 484 sal_Bool bIsAuto = sal_False; 485 try 486 { 487 if (isValueAxis()) 488 mxPropertySet->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "AutoMax" )) ) >>= bIsAuto; 489 } 490 catch ( uno::Exception& ) 491 { 492 DebugHelper::exception( SbERR_METHOD_FAILED, rtl::OUString() ); 493 } 494 return bIsAuto; 495 } 496 497 void SAL_CALL 498 ScVbaAxis::setMinimumScale( double _fMinimumScale ) throw (script::BasicErrorException, uno::RuntimeException) 499 { 500 try 501 { 502 if (isValueAxis()) 503 mxPropertySet->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Min") ), uno::makeAny( _fMinimumScale ) ); 504 } 505 catch ( uno::Exception& ) 506 { 507 DebugHelper::exception(SbERR_METHOD_FAILED, rtl::OUString() ); 508 } 509 } 510 511 double SAL_CALL 512 ScVbaAxis::getMinimumScale( ) throw (script::BasicErrorException, uno::RuntimeException) 513 { 514 double fMin = 0.0; 515 try 516 { 517 if (isValueAxis()) 518 mxPropertySet->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Min") )) >>= fMin; 519 } 520 catch (uno::Exception& e) 521 { 522 DebugHelper::exception(e); 523 } 524 return fMin; 525 } 526 527 void SAL_CALL 528 ScVbaAxis::setMinimumScaleIsAuto( ::sal_Bool _bMinimumScaleIsAuto ) throw (script::BasicErrorException, uno::RuntimeException) 529 { 530 try 531 { 532 if (isValueAxis()) 533 { 534 mxPropertySet->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("AutoMin") ), uno::makeAny(_bMinimumScaleIsAuto)); 535 } 536 } 537 catch (uno::Exception& ) 538 { 539 DebugHelper::exception(SbERR_METHOD_FAILED, rtl::OUString()); 540 } 541 } 542 543 ::sal_Bool SAL_CALL 544 ScVbaAxis::getMinimumScaleIsAuto( ) throw (script::BasicErrorException, uno::RuntimeException) 545 { 546 sal_Bool bIsAuto = sal_False; 547 try 548 { 549 if (isValueAxis()) 550 { 551 mxPropertySet->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("AutoMin")) ) >>= bIsAuto; 552 } 553 } 554 catch (uno::Exception& ) 555 { 556 DebugHelper::exception(SbERR_METHOD_FAILED, rtl::OUString()); 557 } 558 return bIsAuto; 559 } 560 561 ::sal_Int32 SAL_CALL 562 ScVbaAxis::getAxisGroup( ) throw (uno::RuntimeException) 563 { 564 return mnGroup; 565 } 566 567 void SAL_CALL 568 ScVbaAxis::setScaleType( ::sal_Int32 _nScaleType ) throw (script::BasicErrorException, uno::RuntimeException) 569 { 570 try 571 { 572 if (isValueAxis()) 573 { 574 switch (_nScaleType) 575 { 576 case xlScaleLinear: 577 mxPropertySet->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Logarithmic" ) ), uno::makeAny( sal_False ) ); 578 break; 579 case xlScaleLogarithmic: 580 mxPropertySet->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Logarithmic" ) ), uno::makeAny( sal_True ) ); 581 break; 582 default: 583 // According to MS the paramenter is ignored and no Error is thrown 584 break; 585 } 586 } 587 } 588 catch (uno::Exception& ) 589 { 590 DebugHelper::exception(SbERR_METHOD_FAILED, rtl::OUString() ); 591 } 592 } 593 594 ::sal_Int32 SAL_CALL 595 ScVbaAxis::getScaleType( ) throw (script::BasicErrorException, uno::RuntimeException) 596 { 597 sal_Int32 nScaleType = xlScaleLinear; 598 try 599 { 600 if (isValueAxis()) 601 { 602 sal_Bool bisLogarithmic = sal_False; 603 mxPropertySet->getPropertyValue( rtl::OUString( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Logarithmic"))) ) >>= bisLogarithmic; 604 if (bisLogarithmic) 605 nScaleType = xlScaleLogarithmic; 606 else 607 nScaleType = xlScaleLinear; 608 } 609 } 610 catch (uno::Exception& ) 611 { 612 DebugHelper::exception(SbERR_METHOD_FAILED, rtl::OUString()); 613 } 614 return nScaleType; 615 } 616 617 double SAL_CALL 618 ScVbaAxis::getHeight( ) throw (css::script::BasicErrorException, css::uno::RuntimeException) 619 { 620 return oShapeHelper->getHeight(); 621 } 622 623 void SAL_CALL ScVbaAxis::setHeight( double height ) throw (css::script::BasicErrorException, css::uno::RuntimeException) 624 { 625 oShapeHelper->setHeight( height ); 626 } 627 double SAL_CALL ScVbaAxis::getWidth( ) throw (css::script::BasicErrorException, css::uno::RuntimeException) 628 { 629 return oShapeHelper->getWidth( ); 630 } 631 void SAL_CALL ScVbaAxis::setWidth( double width ) throw (css::script::BasicErrorException, css::uno::RuntimeException) 632 { 633 oShapeHelper->setWidth( width ); 634 } 635 double SAL_CALL ScVbaAxis::getTop( ) throw (css::script::BasicErrorException, css::uno::RuntimeException) 636 { 637 return oShapeHelper->getTop( ); 638 } 639 void SAL_CALL ScVbaAxis::setTop( double top ) throw (css::script::BasicErrorException, css::uno::RuntimeException) 640 { 641 oShapeHelper->setTop( top ); 642 } 643 double SAL_CALL ScVbaAxis::getLeft( ) throw (css::script::BasicErrorException, css::uno::RuntimeException) 644 { 645 return oShapeHelper->getLeft( ); 646 } 647 void SAL_CALL ScVbaAxis::setLeft( double left ) throw (css::script::BasicErrorException, css::uno::RuntimeException) 648 { 649 oShapeHelper->setLeft( left ); 650 } 651 652 rtl::OUString& 653 ScVbaAxis::getServiceImplName() 654 { 655 static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaAxis") ); 656 return sImplName; 657 } 658 659 uno::Sequence< rtl::OUString > 660 ScVbaAxis::getServiceNames() 661 { 662 static uno::Sequence< rtl::OUString > aServiceNames; 663 if ( aServiceNames.getLength() == 0 ) 664 { 665 aServiceNames.realloc( 1 ); 666 aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.excel.Axis" ) ); 667 } 668 return aServiceNames; 669 } 670 671