LCOV - code coverage report
Current view: top level - sfx2/source/appl - appreg.cxx (source / functions) Hit Total Coverage
Test: commit 10e77ab3ff6f4314137acd6e2702a6e5c1ce1fae Lines: 30 31 96.8 %
Date: 2014-11-03 Functions: 6 6 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             : 
      21             : #include <vcl/toolbox.hxx>
      22             : 
      23             : #include <sfx2/app.hxx>
      24             : #include "appdata.hxx"
      25             : #include <sfx2/sfxhelp.hxx>
      26             : #include <sfx2/templdlg.hxx>
      27             : #include "inettbc.hxx"
      28             : #include <sfx2/stbitem.hxx>
      29             : #include <sfx2/infobar.hxx>
      30             : #include <sfx2/navigat.hxx>
      31             : #include <sfx2/taskpane.hxx>
      32             : #include <sfx2/module.hxx>
      33             : #include <sfx2/viewfrm.hxx>
      34             : #include "partwnd.hxx"
      35             : #include <sfx2/sfxsids.hrc>
      36             : #include "recfloat.hxx"
      37             : #include <sfx2/objsh.hxx>
      38             : #include <sfx2/viewsh.hxx>
      39             : #include <sfx2/objface.hxx>
      40             : #include <sfx2/mnuitem.hxx>
      41             : 
      42             : 
      43             : 
      44         303 : void SfxApplication::Registrations_Impl()
      45             : {
      46             :     // Interfaces
      47         303 :     SfxApplication::RegisterInterface();
      48         303 :     SfxModule::RegisterInterface();
      49         303 :     SfxViewFrame::RegisterInterface();
      50         303 :     SfxObjectShell::RegisterInterface();
      51         303 :     SfxViewShell::RegisterInterface();
      52             : 
      53             :     // ChildWindows
      54         303 :     SfxRecordingFloatWrapper_Impl::RegisterChildWindow();
      55         303 :     SfxNavigatorWrapper::RegisterChildWindow( false, NULL, SFX_CHILDWIN_NEVERHIDE );
      56         303 :     SfxPartChildWnd_Impl::RegisterChildWindow();
      57         303 :     SfxDockingWrapper::RegisterChildWindow();
      58         303 :     SfxInfoBarContainerChild::RegisterChildWindow( true, NULL, SFX_CHILDWIN_NEVERHIDE );
      59             : 
      60             :     // Controller
      61         303 :     SfxToolBoxControl::RegisterControl(SID_REPEAT);
      62         303 :     SfxURLToolBoxControl_Impl::RegisterControl(SID_OPENURL);
      63         303 :     SfxRecentFilesToolBoxControl::RegisterControl( SID_OPENDOC );
      64         303 : };
      65             : 
      66             : 
      67             : 
      68       13023 : void SfxApplication::RegisterToolBoxControl_Impl( SfxModule *pMod, SfxTbxCtrlFactory *pFact )
      69             : {
      70       13023 :     if ( pMod )
      71             :     {
      72       10924 :         pMod->RegisterToolBoxControl( pFact );
      73       23947 :         return;
      74             :     }
      75             : 
      76             : #ifdef DBG_UTIL
      77             :     for ( sal_uInt16 n=0; n<pAppData_Impl->pTbxCtrlFac->size(); n++ )
      78             :     {
      79             :         SfxTbxCtrlFactory *pF = &(*pAppData_Impl->pTbxCtrlFac)[n];
      80             :         if ( pF->nTypeId && pF->nTypeId == pFact->nTypeId &&
      81             :             (pF->nSlotId == pFact->nSlotId || pF->nSlotId == 0) )
      82             :         {
      83             :             DBG_WARNING("TbxController registration is not clearly defined!");
      84             :         }
      85             :     }
      86             : #endif
      87             : 
      88        2099 :     pAppData_Impl->pTbxCtrlFac->push_back( pFact );
      89             : }
      90             : 
      91             : 
      92             : 
      93        1872 : void SfxApplication::RegisterStatusBarControl_Impl( SfxModule *pMod, SfxStbCtrlFactory *pFact )
      94             : {
      95        1872 :     if ( pMod )
      96             :     {
      97        1872 :         pMod->RegisterStatusBarControl( pFact );
      98        3744 :         return;
      99             :     }
     100             : 
     101             : #ifdef DBG_UTIL
     102             :     for ( sal_uInt16 n=0; n<pAppData_Impl->pStbCtrlFac->size(); n++ )
     103             :     {
     104             :         SfxStbCtrlFactory *pF = &(*pAppData_Impl->pStbCtrlFac)[n];
     105             :         if ( pF->nTypeId && pF->nTypeId == pFact->nTypeId &&
     106             :             (pF->nSlotId == pFact->nSlotId || pF->nSlotId == 0) )
     107             :         {
     108             :             DBG_WARNING("StbController registration is not clearly defined!");
     109             :         }
     110             :     }
     111             : #endif
     112             : 
     113           0 :     pAppData_Impl->pStbCtrlFac->push_back( pFact );
     114             : }
     115             : 
     116             : 
     117             : 
     118         766 : void SfxApplication::RegisterMenuControl_Impl( SfxModule *pMod, SfxMenuCtrlFactory *pFact )
     119             : {
     120         766 :     if ( pMod )
     121             :     {
     122         596 :         pMod->RegisterMenuControl( pFact );
     123        1362 :         return;
     124             :     }
     125             : 
     126             : #ifdef DBG_UTIL
     127             :     for ( sal_uInt16 n=0; n<pAppData_Impl->pMenuCtrlFac->size(); n++ )
     128             :     {
     129             :         SfxMenuCtrlFactory *pF = &(*pAppData_Impl->pMenuCtrlFac)[n];
     130             :         if ( pF->nTypeId && pF->nTypeId == pFact->nTypeId &&
     131             :             (pF->nSlotId == pFact->nSlotId || pF->nSlotId == 0) )
     132             :         {
     133             :             DBG_WARNING("MenuController register is not clearly defined!");
     134             :         }
     135             :     }
     136             : #endif
     137             : 
     138         170 :     pAppData_Impl->pMenuCtrlFac->push_back( pFact );
     139         951 : }
     140             : 
     141             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10