LCOV - code coverage report
Current view: top level - starmath/source - smdll.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 26 26 100.0 %
Date: 2012-08-25 Functions: 5 5 100.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 5 10 50.0 %

           Branch data     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 <sot/factory.hxx>
      21                 :            : #include <svx/svxids.hrc>
      22                 :            : #include <svx/modctrl.hxx>
      23                 :            : #include <svx/zoomctrl.hxx>
      24                 :            : #include <sfx2/docfac.hxx>
      25                 :            : #include <svx/lboxctrl.hxx>
      26                 :            : #include <sfx2/docfile.hxx>
      27                 :            : #include <sfx2/docfilt.hxx>
      28                 :            : #include <sfx2/app.hxx>
      29                 :            : #include <sfx2/taskpane.hxx>
      30                 :            : 
      31                 :            : #include <smdll.hxx>
      32                 :            : #include <document.hxx>
      33                 :            : #include <toolbox.hxx>
      34                 :            : #include <view.hxx>
      35                 :            : 
      36                 :            : #include <starmath.hrc>
      37                 :            : 
      38                 :            : #include <svx/xmlsecctrl.hxx>
      39                 :            : 
      40                 :            : namespace
      41                 :            : {
      42                 :            :     class SmDLL
      43                 :            :     {
      44                 :            :     public:
      45                 :            :         SmDLL();
      46                 :            :         ~SmDLL();
      47                 :            :     };
      48                 :            : 
      49                 :         10 :     SmDLL::SmDLL()
      50                 :            :     {
      51                 :         10 :         SmModule** ppShlPtr = (SmModule**) GetAppData(SHL_SM);
      52         [ -  + ]:         10 :         if ( *ppShlPtr )
      53                 :         10 :             return;
      54                 :            : 
      55                 :         10 :         SfxObjectFactory& rFactory = SmDocShell::Factory();
      56         [ +  - ]:         10 :         SmModule *pModule = new SmModule( &rFactory );
      57                 :         10 :         *ppShlPtr = pModule;
      58                 :            : 
      59         [ +  - ]:         10 :         rFactory.SetDocumentServiceName( rtl::OUString("com.sun.star.formula.FormulaProperties") );
      60                 :            : 
      61                 :         10 :         SmModule::RegisterInterface(pModule);
      62                 :         10 :         SmDocShell::RegisterInterface(pModule);
      63                 :         10 :         SmViewShell::RegisterInterface(pModule);
      64                 :            : 
      65                 :         10 :         SmViewShell::RegisterFactory(1);
      66                 :            : 
      67                 :         10 :         SvxZoomStatusBarControl::RegisterControl(SID_ATTR_ZOOM, pModule);
      68                 :         10 :         SvxModifyControl::RegisterControl(SID_TEXTSTATUS, pModule);
      69                 :         10 :         SvxUndoRedoControl::RegisterControl(SID_UNDO, pModule);
      70                 :         10 :         SvxUndoRedoControl::RegisterControl(SID_REDO, pModule);
      71                 :         10 :         XmlSecStatusBarControl::RegisterControl(SID_SIGNATURE, pModule);
      72                 :            : 
      73                 :         10 :         SmToolBoxWrapper::RegisterChildWindow(true);
      74                 :         10 :         SmCmdBoxWrapper::RegisterChildWindow(true);
      75                 :            : 
      76                 :         10 :         ::sfx2::TaskPaneWrapper::RegisterChildWindow(false, pModule);
      77                 :            :     }
      78                 :            : 
      79                 :         10 :     SmDLL::~SmDLL()
      80                 :            :     {
      81                 :            : #if 0
      82                 :            :         // the SdModule must be destroyed
      83                 :            :         SmModule** ppShlPtr = (SmModule**) GetAppData(SHL_SM);
      84                 :            :         delete (*ppShlPtr);
      85                 :            :         (*ppShlPtr) = NULL;
      86                 :            :         *GetAppData(SHL_SM) = 0;
      87                 :            : #endif
      88                 :         10 :     }
      89                 :            : 
      90                 :            :     struct theSmDLLInstance : public rtl::Static<SmDLL, theSmDLLInstance> {};
      91                 :            : }
      92                 :            : 
      93                 :            : namespace SmGlobals
      94                 :            : {
      95                 :        460 :     void ensure()
      96                 :            :     {
      97                 :        460 :         theSmDLLInstance::get();
      98                 :        460 :     }
      99 [ +  - ][ +  - ]:         30 : }
     100                 :            : 
     101                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10