LCOV - code coverage report
Current view: top level - framework/source/helper - statusindicator.cxx (source / functions) Hit Total Coverage
Test: commit 10e77ab3ff6f4314137acd6e2702a6e5c1ce1fae Lines: 34 41 82.9 %
Date: 2014-11-03 Functions: 9 10 90.0 %
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 <config_features.h>
      21             : 
      22             : #include <helper/statusindicator.hxx>
      23             : 
      24             : namespace framework{
      25             : 
      26        5504 : StatusIndicator::StatusIndicator(StatusIndicatorFactory* pFactory)
      27        5504 :     : m_xFactory         (pFactory)
      28             : {
      29        5504 : }
      30             : 
      31       10996 : StatusIndicator::~StatusIndicator()
      32             : {
      33       10996 : }
      34             : 
      35        3930 : void SAL_CALL StatusIndicator::start(const OUString& sText ,
      36             :                                            sal_Int32        nRange)
      37             :     throw(css::uno::RuntimeException, std::exception)
      38             : {
      39             : #if !HAVE_FEATURE_DESKTOP
      40             :     (void) sText;
      41             :     (void) nRange;
      42             : #else
      43        3930 :     css::uno::Reference< css::task::XStatusIndicatorFactory > xFactory(m_xFactory);
      44        3930 :     if (xFactory.is())
      45             :     {
      46        3930 :         StatusIndicatorFactory* pFactory = static_cast<StatusIndicatorFactory*>(xFactory.get());
      47        3930 :         pFactory->start(this, sText, nRange);
      48        3930 :     }
      49             : #endif
      50        3930 : }
      51             : 
      52        4160 : void SAL_CALL StatusIndicator::end()
      53             :     throw(css::uno::RuntimeException, std::exception)
      54             : {
      55             : #if HAVE_FEATURE_DESKTOP
      56        4160 :     css::uno::Reference< css::task::XStatusIndicatorFactory > xFactory(m_xFactory);
      57        4160 :     if (xFactory.is())
      58             :     {
      59        4160 :         StatusIndicatorFactory* pFactory = static_cast<StatusIndicatorFactory*>(xFactory.get());
      60        4160 :         pFactory->end(this);
      61        4160 :     }
      62             : #endif
      63        4160 : }
      64             : 
      65         446 : void SAL_CALL StatusIndicator::reset()
      66             :     throw(css::uno::RuntimeException, std::exception)
      67             : {
      68             : #if HAVE_FEATURE_DESKTOP
      69         446 :     css::uno::Reference< css::task::XStatusIndicatorFactory > xFactory(m_xFactory);
      70         446 :     if (xFactory.is())
      71             :     {
      72         446 :         StatusIndicatorFactory* pFactory = static_cast<StatusIndicatorFactory*>(xFactory.get());
      73         446 :         pFactory->reset(this);
      74         446 :     }
      75             : #endif
      76         446 : }
      77             : 
      78           0 : void SAL_CALL StatusIndicator::setText(const OUString& sText)
      79             :     throw(css::uno::RuntimeException, std::exception)
      80             : {
      81             : #if !HAVE_FEATURE_DESKTOP
      82             :     (void) sText;
      83             : #else
      84           0 :     css::uno::Reference< css::task::XStatusIndicatorFactory > xFactory(m_xFactory);
      85           0 :     if (xFactory.is())
      86             :     {
      87           0 :         StatusIndicatorFactory* pFactory = static_cast<StatusIndicatorFactory*>(xFactory.get());
      88           0 :         pFactory->setText(this, sText);
      89           0 :     }
      90             : #endif
      91           0 : }
      92             : 
      93       51050 : void SAL_CALL StatusIndicator::setValue(sal_Int32 nValue)
      94             :     throw(css::uno::RuntimeException, std::exception)
      95             : {
      96             : #if !HAVE_FEATURE_DESKTOP
      97             :     (void) nValue;
      98             : #else
      99       51050 :     css::uno::Reference< css::task::XStatusIndicatorFactory > xFactory(m_xFactory);
     100       51050 :     if (xFactory.is())
     101             :     {
     102       51050 :         StatusIndicatorFactory* pFactory = static_cast<StatusIndicatorFactory*>(xFactory.get());
     103       51050 :         pFactory->setValue(this, nValue);
     104       51050 :     }
     105             : #endif
     106       51050 : }
     107             : 
     108         951 : } // namespace framework
     109             : 
     110             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10