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

Generated by: LCOV version 1.10