LCOV - code coverage report
Current view: top level - sc/source/ui/vba - vbaaxis.cxx (source / functions) Hit Total Coverage
Test: commit 10e77ab3ff6f4314137acd6e2702a6e5c1ce1fae Lines: 5 287 1.7 %
Date: 2014-11-03 Functions: 2 48 4.2 %
Legend: Lines: hit not hit

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

Generated by: LCOV version 1.10