LCOV - code coverage report
Current view: top level - uui/source - requeststringresolver.cxx (source / functions) Hit Total Coverage
Test: commit c8344322a7af75b84dd3ca8f78b05543a976dfd5 Lines: 16 24 66.7 %
Date: 2015-06-13 12:38:46 Functions: 7 9 77.8 %
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 "requeststringresolver.hxx"
      21             : #include "iahndl.hxx"
      22             : #include <comphelper/processfactory.hxx>
      23             : #include <cppuhelper/supportsservice.hxx>
      24             : 
      25             : using namespace css;
      26             : 
      27           1 : UUIInteractionRequestStringResolver::UUIInteractionRequestStringResolver(
      28             :     uno::Reference< uno::XComponentContext > const &
      29             :         rxContext)
      30           1 :         : m_pImpl(new UUIInteractionHelper(rxContext))
      31             : {
      32           1 : }
      33             : 
      34           3 : UUIInteractionRequestStringResolver::~UUIInteractionRequestStringResolver()
      35             : {
      36           1 :     delete m_pImpl;
      37           2 : }
      38             : 
      39             : OUString SAL_CALL
      40           1 : UUIInteractionRequestStringResolver::getImplementationName()
      41             :     throw (uno::RuntimeException, std::exception)
      42             : {
      43           1 :     return OUString::createFromAscii(m_aImplementationName);
      44             : }
      45             : 
      46             : sal_Bool SAL_CALL
      47           0 : UUIInteractionRequestStringResolver::supportsService(
      48             :         OUString const & rServiceName)
      49             :     throw (uno::RuntimeException, std::exception)
      50             : {
      51           0 :     return cppu::supportsService(this, rServiceName);
      52             : }
      53             : 
      54             : uno::Sequence< OUString > SAL_CALL
      55           1 : UUIInteractionRequestStringResolver::getSupportedServiceNames()
      56             :     throw (uno::RuntimeException, std::exception)
      57             : {
      58           1 :     return getSupportedServiceNames_static();
      59             : }
      60             : 
      61             : beans::Optional< OUString > SAL_CALL
      62           0 : UUIInteractionRequestStringResolver::getStringFromInformationalRequest(
      63             :     const uno::Reference<
      64             :         task::XInteractionRequest >& Request )
      65             :     throw (uno::RuntimeException, std::exception)
      66             : {
      67             :     try
      68             :     {
      69           0 :         return m_pImpl->getStringFromRequest(Request);
      70             :     }
      71           0 :     catch (uno::RuntimeException const & ex)
      72             :     {
      73           0 :         throw uno::RuntimeException(ex.Message, *this);
      74             :     }
      75             : }
      76             : 
      77             : char const UUIInteractionRequestStringResolver::m_aImplementationName[]
      78             :     = "com.sun.star.comp.uui.UUIInteractionRequestStringResolver";
      79             : 
      80             : uno::Sequence< OUString >
      81           2 : UUIInteractionRequestStringResolver::getSupportedServiceNames_static()
      82             : {
      83           2 :     uno::Sequence< OUString > aNames(1);
      84           2 :     aNames[0] = "com.sun.star.task.InteractionRequestStringResolver";
      85           2 :     return aNames;
      86             : }
      87             : 
      88             : uno::Reference< uno::XInterface > SAL_CALL
      89           1 : UUIInteractionRequestStringResolver::createInstance(
      90             :     uno::Reference< lang::XMultiServiceFactory > const &
      91             :         rServiceFactory)
      92             : {
      93             :     try
      94             :     {
      95           1 :         return *new UUIInteractionRequestStringResolver(comphelper::getComponentContext(rServiceFactory));
      96             :     }
      97           0 :     catch (std::bad_alloc const &)
      98             :     {
      99           0 :         throw uno::RuntimeException("out of memory", 0);
     100             :     }
     101             : }
     102             : 
     103             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.11