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

Generated by: LCOV version 1.10