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

Generated by: LCOV version 1.10