LCOV - code coverage report
Current view: top level - chart2/source/view/charttypes - BarPositionHelper.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 20 27 74.1 %
Date: 2012-08-25 Functions: 6 8 75.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 8 24 33.3 %

           Branch data     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                 :            : 
      21                 :            : #include "BarPositionHelper.hxx"
      22                 :            : #include "Linear3DTransformation.hxx"
      23                 :            : #include "ViewDefines.hxx"
      24                 :            : #include "CommonConverters.hxx"
      25                 :            : #include "DateHelper.hxx"
      26                 :            : #include <com/sun/star/chart/TimeUnit.hpp>
      27                 :            : 
      28                 :            : //.............................................................................
      29                 :            : namespace chart
      30                 :            : {
      31                 :            : //.............................................................................
      32                 :            : using namespace ::com::sun::star;
      33                 :            : using namespace ::com::sun::star::chart2;
      34                 :            : 
      35                 :        890 : BarPositionHelper::BarPositionHelper( bool /* bSwapXAndY */ )
      36         [ +  - ]:        890 :         : CategoryPositionHelper( 1 )
      37                 :            : {
      38         [ +  - ]:        890 :     AllowShiftXAxisPos(true);
      39         [ +  - ]:        890 :     AllowShiftZAxisPos(true);
      40                 :        890 : }
      41                 :            : 
      42                 :          0 : BarPositionHelper::BarPositionHelper( const BarPositionHelper& rSource )
      43                 :            :         : CategoryPositionHelper( rSource )
      44         [ #  # ]:          0 :         , PlottingPositionHelper( rSource )
      45                 :            : {
      46                 :          0 : }
      47                 :            : 
      48         [ +  - ]:        890 : BarPositionHelper::~BarPositionHelper()
      49                 :            : {
      50         [ -  + ]:       1780 : }
      51                 :            : 
      52                 :          0 : PlottingPositionHelper* BarPositionHelper::clone() const
      53                 :            : {
      54         [ #  # ]:          0 :     BarPositionHelper* pRet = new BarPositionHelper(*this);
      55         [ #  # ]:          0 :     return pRet;
      56                 :            : }
      57                 :            : 
      58                 :      11117 : void BarPositionHelper::updateSeriesCount( double fSeriesCount )
      59                 :            : {
      60                 :      11117 :     m_fSeriesCount = fSeriesCount;
      61                 :      11117 : }
      62                 :            : 
      63                 :      11165 : double BarPositionHelper::getScaledSlotPos( double fUnscaledLogicX, double fSeriesNumber ) const
      64                 :            : {
      65         [ -  + ]:      11165 :     if( m_bDateAxis )
      66         [ #  # ]:          0 :         fUnscaledLogicX = DateHelper::RasterizeDateValue( fUnscaledLogicX, m_aNullDate, m_nTimeResolution );
      67                 :      11165 :     double fScaledLogicX(fUnscaledLogicX);
      68         [ +  - ]:      11165 :     doLogicScaling(&fScaledLogicX,NULL,NULL);
      69         [ +  - ]:      11165 :     fScaledLogicX = CategoryPositionHelper::getScaledSlotPos( fScaledLogicX, fSeriesNumber );
      70                 :      11165 :     return fScaledLogicX;
      71                 :            : 
      72                 :            : }
      73                 :            : 
      74                 :      11120 : void BarPositionHelper::setScaledCategoryWidth( double fScaledCategoryWidth )
      75                 :            : {
      76                 :      11120 :     m_fScaledCategoryWidth = fScaledCategoryWidth;
      77                 :      11120 :     CategoryPositionHelper::setCategoryWidth( m_fScaledCategoryWidth );
      78                 :      11120 : }
      79                 :            : //.............................................................................
      80                 :            : } //namespace chart
      81                 :            : //.............................................................................
      82                 :            : 
      83                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10