LCOV - code coverage report
Current view: top level - sfx2/source/appl - appreg.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 30 31 96.8 %
Date: 2012-08-25 Functions: 4 4 100.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 5 6 83.3 %

           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                 :            : 
      21                 :            : #include <vcl/toolbox.hxx>
      22                 :            : 
      23                 :            : #include <sfx2/app.hxx>
      24                 :            : #include "appdata.hxx"
      25                 :            : #include "arrdecl.hxx"
      26                 :            : #include "sfx2/sfxhelp.hxx"
      27                 :            : #include <sfx2/templdlg.hxx>
      28                 :            : #include "inettbc.hxx"
      29                 :            : #include "sfx2/stbitem.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                 :        233 : void SfxApplication::Registrations_Impl()
      45                 :            : {
      46                 :            :     // Interfaces
      47                 :        233 :     SfxApplication::RegisterInterface();
      48                 :        233 :     SfxModule::RegisterInterface();
      49                 :        233 :     SfxViewFrame::RegisterInterface();
      50                 :        233 :     SfxObjectShell::RegisterInterface();
      51                 :        233 :     SfxViewShell::RegisterInterface();
      52                 :            : 
      53                 :            :     // ChildWindows
      54                 :        233 :     SfxRecordingFloatWrapper_Impl::RegisterChildWindow();
      55                 :        233 :     SfxNavigatorWrapper::RegisterChildWindow( sal_False, NULL, SFX_CHILDWIN_NEVERHIDE );
      56                 :        233 :     SfxPartChildWnd_Impl::RegisterChildWindow();
      57                 :        233 :     SfxTemplateDialogWrapper::RegisterChildWindow(sal_True);
      58                 :        233 :     SfxDockingWrapper::RegisterChildWindow();
      59                 :            : 
      60                 :            :     // Controller
      61                 :        233 :     SfxToolBoxControl::RegisterControl(SID_REPEAT);
      62                 :        233 :     SfxURLToolBoxControl_Impl::RegisterControl(SID_OPENURL);
      63                 :        233 :     SfxAppToolBoxControl_Impl::RegisterControl( SID_NEWDOCDIRECT );
      64                 :        233 :     SfxAppToolBoxControl_Impl::RegisterControl( SID_AUTOPILOTMENU );
      65                 :        233 : };
      66                 :            : 
      67                 :            : //--------------------------------------------------------------------
      68                 :            : 
      69                 :       9756 : void SfxApplication::RegisterToolBoxControl_Impl( SfxModule *pMod, SfxTbxCtrlFactory *pFact )
      70                 :            : {
      71         [ +  + ]:       9756 :     if ( pMod )
      72                 :            :     {
      73                 :       7879 :         pMod->RegisterToolBoxControl( pFact );
      74                 :       9756 :         return;
      75                 :            :     }
      76                 :            : 
      77                 :            : #ifdef DBG_UTIL
      78                 :            :     for ( sal_uInt16 n=0; n<pAppData_Impl->pTbxCtrlFac->size(); n++ )
      79                 :            :     {
      80                 :            :         SfxTbxCtrlFactory *pF = (*pAppData_Impl->pTbxCtrlFac)[n];
      81                 :            :         if ( pF->nTypeId && pF->nTypeId == pFact->nTypeId &&
      82                 :            :             (pF->nSlotId == pFact->nSlotId || pF->nSlotId == 0) )
      83                 :            :         {
      84                 :            :             DBG_WARNING("TbxController registration is not clearly defined!");
      85                 :            :         }
      86                 :            :     }
      87                 :            : #endif
      88                 :            : 
      89                 :       1877 :     pAppData_Impl->pTbxCtrlFac->push_back( pFact );
      90                 :            : }
      91                 :            : 
      92                 :            : //--------------------------------------------------------------------
      93                 :            : 
      94                 :       1350 : void SfxApplication::RegisterStatusBarControl_Impl( SfxModule *pMod, SfxStbCtrlFactory *pFact )
      95                 :            : {
      96         [ +  - ]:       1350 :     if ( pMod )
      97                 :            :     {
      98                 :       1350 :         pMod->RegisterStatusBarControl( pFact );
      99                 :       1350 :         return;
     100                 :            :     }
     101                 :            : 
     102                 :            : #ifdef DBG_UTIL
     103                 :            :     for ( sal_uInt16 n=0; n<pAppData_Impl->pStbCtrlFac->size(); n++ )
     104                 :            :     {
     105                 :            :         SfxStbCtrlFactory *pF = (*pAppData_Impl->pStbCtrlFac)[n];
     106                 :            :         if ( pF->nTypeId && pF->nTypeId == pFact->nTypeId &&
     107                 :            :             (pF->nSlotId == pFact->nSlotId || pF->nSlotId == 0) )
     108                 :            :         {
     109                 :            :             DBG_WARNING("StbController registration is not clearly defined!");
     110                 :            :         }
     111                 :            :     }
     112                 :            : #endif
     113                 :            : 
     114                 :          0 :     pAppData_Impl->pStbCtrlFac->push_back( pFact );
     115                 :            : }
     116                 :            : 
     117                 :            : //--------------------------------------------------------------------
     118                 :            : 
     119                 :        581 : void SfxApplication::RegisterMenuControl_Impl( SfxModule *pMod, SfxMenuCtrlFactory *pFact )
     120                 :            : {
     121         [ +  + ]:        581 :     if ( pMod )
     122                 :            :     {
     123                 :        446 :         pMod->RegisterMenuControl( pFact );
     124                 :        581 :         return;
     125                 :            :     }
     126                 :            : 
     127                 :            : #ifdef DBG_UTIL
     128                 :            :     for ( sal_uInt16 n=0; n<pAppData_Impl->pMenuCtrlFac->size(); n++ )
     129                 :            :     {
     130                 :            :         SfxMenuCtrlFactory *pF = (*pAppData_Impl->pMenuCtrlFac)[n];
     131                 :            :         if ( pF->nTypeId && pF->nTypeId == pFact->nTypeId &&
     132                 :            :             (pF->nSlotId == pFact->nSlotId || pF->nSlotId == 0) )
     133                 :            :         {
     134                 :            :             DBG_WARNING("MenuController register is not clearly defined!");
     135                 :            :         }
     136                 :            :     }
     137                 :            : #endif
     138                 :            : 
     139                 :        135 :     pAppData_Impl->pMenuCtrlFac->push_back( pFact );
     140                 :            : }
     141                 :            : 
     142                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10