LCOV - code coverage report
Current view: top level - sw/source/core/uibase/uno - unodoc.cxx (source / functions) Hit Total Coverage
Test: commit 0e63ca4fde4e446f346e35849c756a30ca294aab Lines: 26 36 72.2 %
Date: 2014-04-11 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 <sfx2/docfac.hxx>
      21             : #include <sfx2/sfxmodelfactory.hxx>
      22             : #include "swdll.hxx"
      23             : #include "docsh.hxx"
      24             : #include "globdoc.hxx"
      25             : #include "wdocsh.hxx"
      26             : #include <osl/mutex.hxx>
      27             : #include <vcl/svapp.hxx>
      28             : 
      29             : using namespace ::com::sun::star;
      30             : 
      31             : // com.sun.star.comp.Writer.TextDocument
      32             : 
      33          35 : uno::Sequence< OUString > SAL_CALL SwTextDocument_getSupportedServiceNames() throw()
      34             : {
      35             :     // return only top level services here! All others must be
      36             :     // resolved by rtti!
      37          35 :     uno::Sequence< OUString > aRet ( 1 );
      38          35 :     OUString* pArray = aRet.getArray();
      39          35 :     pArray[0] = "com.sun.star.text.TextDocument";
      40             : 
      41          35 :     return aRet;
      42             : }
      43             : 
      44          74 : OUString SAL_CALL SwTextDocument_getImplementationName() throw()
      45             : {
      46          74 :     return OUString( "com.sun.star.comp.Writer.TextDocument" );
      47             : }
      48             : 
      49        1731 : uno::Reference< uno::XInterface > SAL_CALL SwTextDocument_createInstance(
      50             :         const uno::Reference< lang::XMultiServiceFactory >&, const sal_uInt64 _nCreationFlags )
      51             :     throw( uno::Exception )
      52             : {
      53        1731 :     SolarMutexGuard aGuard;
      54        1731 :     SwGlobals::ensure();
      55        1731 :     SfxObjectShell* pShell = new SwDocShell( _nCreationFlags );
      56        1731 :     return uno::Reference< uno::XInterface >( pShell->GetModel() );
      57             : }
      58             : 
      59             : // com.sun.star.comp.Writer.WebDocument
      60             : 
      61           1 : uno::Sequence< OUString > SAL_CALL SwWebDocument_getSupportedServiceNames() throw()
      62             : {
      63             :     // return only top level services here! All others must be
      64             :     // resolved by rtti!
      65           1 :     uno::Sequence< OUString > aRet ( 1 );
      66           1 :     OUString* pArray = aRet.getArray();
      67           1 :     pArray[0] = "com.sun.star.text.WebDocument";
      68             : 
      69           1 :     return aRet;
      70             : }
      71             : 
      72           5 : OUString SAL_CALL SwWebDocument_getImplementationName() throw()
      73             : {
      74           5 :     return OUString( "com.sun.star.comp.Writer.WebDocument" );
      75             : }
      76             : 
      77           2 : uno::Reference< uno::XInterface > SAL_CALL SwWebDocument_createInstance(
      78             :     const uno::Reference< lang::XMultiServiceFactory > & )
      79             :         throw( uno::Exception )
      80             : {
      81           2 :     SolarMutexGuard aGuard;
      82           2 :     SwGlobals::ensure();
      83           2 :     SfxObjectShell* pShell = new SwWebDocShell( SFX_CREATE_MODE_STANDARD );
      84           2 :     return uno::Reference< uno::XInterface >( pShell->GetModel() );
      85             : }
      86             : 
      87             : // com.sun.star.comp.Writer.GlobalDocument
      88             : 
      89           0 : uno::Sequence< OUString > SAL_CALL SwGlobalDocument_getSupportedServiceNames() throw()
      90             : {
      91           0 :     uno::Sequence< OUString > aRet ( 1 );
      92           0 :     OUString* pArray = aRet.getArray();
      93           0 :     pArray[0] = "com.sun.star.text.GlobalDocument";
      94             : 
      95           0 :     return aRet;
      96             : }
      97             : 
      98           3 : OUString SAL_CALL SwGlobalDocument_getImplementationName() throw()
      99             : {
     100           3 :     return OUString( "com.sun.star.comp.Writer.GlobalDocument" );
     101             : }
     102             : 
     103           0 : uno::Reference< uno::XInterface > SAL_CALL SwGlobalDocument_createInstance(
     104             :     const uno::Reference< lang::XMultiServiceFactory > &)
     105             :         throw( uno::Exception )
     106             : {
     107           0 :     SolarMutexGuard aGuard;
     108           0 :     SwGlobals::ensure();
     109           0 :     SfxObjectShell* pShell = new SwGlobalDocShell( SFX_CREATE_MODE_STANDARD );
     110           0 :     return uno::Reference< uno::XInterface >( pShell->GetModel() );
     111             : }
     112             : 
     113             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10