LCOV - code coverage report
Current view: top level - usr/local/src/libreoffice/sw/source/ui/uno - unodoc.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 27 37 73.0 %
Date: 2013-07-09 Functions: 9 11 81.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             : //============================================================
      32             : // com.sun.star.comp.Writer.TextDocument
      33             : 
      34          32 : uno::Sequence< OUString > SAL_CALL SwTextDocument_getSupportedServiceNames() throw()
      35             : {
      36             :     // return only top level services here! All others must be
      37             :     // resolved by rtti!
      38          32 :     uno::Sequence< OUString > aRet ( 1 );
      39          32 :     OUString* pArray = aRet.getArray();
      40          32 :     pArray[0] = OUString( "com.sun.star.text.TextDocument" );
      41             : 
      42          32 :     return aRet;
      43             : }
      44             : 
      45          66 : OUString SAL_CALL SwTextDocument_getImplementationName() throw()
      46             : {
      47          66 :     return OUString( "com.sun.star.comp.Writer.TextDocument" );
      48             : }
      49             : 
      50         793 : uno::Reference< uno::XInterface > SAL_CALL SwTextDocument_createInstance(
      51             :         const uno::Reference< lang::XMultiServiceFactory >&, const sal_uInt64 _nCreationFlags )
      52             :     throw( uno::Exception )
      53             : {
      54         793 :     SolarMutexGuard aGuard;
      55         793 :     SwGlobals::ensure();
      56         793 :     SfxObjectShell* pShell = new SwDocShell( _nCreationFlags );
      57         793 :     return uno::Reference< uno::XInterface >( pShell->GetModel() );
      58             : }
      59             : 
      60             : //============================================================
      61             : // com.sun.star.comp.Writer.WebDocument
      62             : 
      63           1 : uno::Sequence< OUString > SAL_CALL SwWebDocument_getSupportedServiceNames() throw()
      64             : {
      65             :     // return only top level services here! All others must be
      66             :     // resolved by rtti!
      67           1 :     uno::Sequence< OUString > aRet ( 1 );
      68           1 :     OUString* pArray = aRet.getArray();
      69           1 :     pArray[0] = OUString( "com.sun.star.text.WebDocument" );
      70             : 
      71           1 :     return aRet;
      72             : }
      73             : 
      74           3 : OUString SAL_CALL SwWebDocument_getImplementationName() throw()
      75             : {
      76           3 :     return OUString( "com.sun.star.comp.Writer.WebDocument" );
      77             : }
      78             : 
      79           2 : uno::Reference< uno::XInterface > SAL_CALL SwWebDocument_createInstance(
      80             :     const uno::Reference< lang::XMultiServiceFactory > & )
      81             :         throw( uno::Exception )
      82             : {
      83           2 :     SolarMutexGuard aGuard;
      84           2 :     SwGlobals::ensure();
      85           2 :     SfxObjectShell* pShell = new SwWebDocShell( SFX_CREATE_MODE_STANDARD );
      86           2 :     return uno::Reference< uno::XInterface >( pShell->GetModel() );
      87             : }
      88             : 
      89             : //============================================================
      90             : // com.sun.star.comp.Writer.GlobalDocument
      91             : 
      92           0 : uno::Sequence< OUString > SAL_CALL SwGlobalDocument_getSupportedServiceNames() throw()
      93             : {
      94           0 :     uno::Sequence< OUString > aRet ( 1 );
      95           0 :     OUString* pArray = aRet.getArray();
      96           0 :     pArray[0] = OUString( "com.sun.star.text.GlobalDocument" );
      97             : 
      98           0 :     return aRet;
      99             : }
     100             : 
     101           1 : OUString SAL_CALL SwGlobalDocument_getImplementationName() throw()
     102             : {
     103           1 :     return OUString( "com.sun.star.comp.Writer.GlobalDocument" );
     104             : }
     105             : 
     106           0 : uno::Reference< uno::XInterface > SAL_CALL SwGlobalDocument_createInstance(
     107             :     const uno::Reference< lang::XMultiServiceFactory > &)
     108             :         throw( uno::Exception )
     109             : {
     110           0 :     SolarMutexGuard aGuard;
     111           0 :     SwGlobals::ensure();
     112           0 :     SfxObjectShell* pShell = new SwGlobalDocShell( SFX_CREATE_MODE_STANDARD );
     113           0 :     return uno::Reference< uno::XInterface >( pShell->GetModel() );
     114          99 : }
     115             : 
     116             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10