LCOV - code coverage report
Current view: top level - sd/source/ui/dlg - PaneChildWindows.cxx (source / functions) Hit Total Coverage
Test: commit 0e63ca4fde4e446f346e35849c756a30ca294aab Lines: 26 26 100.0 %
Date: 2014-04-11 Functions: 12 13 92.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 "PaneChildWindows.hxx"
      21             : #include "PaneDockingWindow.hrc"
      22             : #include "PaneDockingWindow.hxx"
      23             : #include "ViewShellBase.hxx"
      24             : #include "framework/FrameworkHelper.hxx"
      25             : #include "taskpane/ToolPanelViewShell.hxx"
      26             : #include "app.hrc"
      27             : #include "strings.hrc"
      28             : #include "sdresid.hxx"
      29             : 
      30             : #include <com/sun/star/drawing/framework/XConfigurationController.hpp>
      31             : #include <com/sun/star/drawing/framework/ResourceActivationMode.hpp>
      32             : 
      33             : #include <sfx2/app.hxx>
      34             : #include <sfx2/dockwin.hxx>
      35             : #include <sfx2/bindings.hxx>
      36             : #include <sfx2/dispatch.hxx>
      37             : #include <tools/diagnose_ex.h>
      38             : 
      39             : namespace sd {
      40             : 
      41             : using ::com::sun::star::uno::Reference;
      42             : using ::com::sun::star::drawing::framework::XResourceId;
      43             : using ::com::sun::star::drawing::framework::XConfigurationController;
      44             : using ::com::sun::star::drawing::framework::ResourceActivationMode_ADD;
      45             : using ::com::sun::star::drawing::framework::ResourceActivationMode_REPLACE;
      46             : 
      47          79 : SFX_IMPL_DOCKINGWINDOW_WITHID(LeftPaneImpressChildWindow, SID_LEFT_PANE_IMPRESS)
      48         230 : SFX_IMPL_DOCKINGWINDOW_WITHID(LeftPaneDrawChildWindow, SID_LEFT_PANE_DRAW)
      49             : 
      50             : //===== PaneChildWindow =======================================================
      51             : 
      52          63 : PaneChildWindow::PaneChildWindow (
      53             :     ::Window* pParentWindow,
      54             :     sal_uInt16 nId,
      55             :     SfxBindings* pBindings,
      56             :     SfxChildWinInfo* pInfo,
      57             :     const sal_uInt16 nDockWinTitleResId,
      58             :     const sal_uInt16 nTitleBarResId,
      59             :     SfxChildAlignment eAlignment)
      60          63 :     : SfxChildWindow (pParentWindow, nId)
      61             : {
      62             :     pWindow = new PaneDockingWindow (
      63             :         pBindings,
      64             :         this,
      65             :         pParentWindow,
      66             :         SdResId( nDockWinTitleResId ),
      67          63 :         SD_RESSTR( nTitleBarResId ) );
      68          63 :     eChildAlignment = eAlignment;
      69          63 :     static_cast<SfxDockingWindow*>(pWindow)->Initialize(pInfo);
      70          63 :     SetHideNotDelete(true);
      71             : 
      72          63 :     ViewShellBase* pBase = ViewShellBase::GetViewShellBase(pBindings->GetDispatcher()->GetFrame());
      73          63 :     if (pBase != NULL)
      74             :     {
      75          63 :         framework::FrameworkHelper::Instance(*pBase)->UpdateConfiguration();
      76             :     }
      77          63 : }
      78             : 
      79             : 
      80             : 
      81             : 
      82         126 : PaneChildWindow::~PaneChildWindow (void)
      83             : {
      84          63 :     ViewShellBase* pBase = NULL;
      85          63 :     PaneDockingWindow* pDockingWindow = dynamic_cast<PaneDockingWindow*>(pWindow);
      86          63 :     if (pDockingWindow != NULL)
      87             :         pBase = ViewShellBase::GetViewShellBase(
      88          63 :             pDockingWindow->GetBindings().GetDispatcher()->GetFrame());
      89          63 :     if (pBase != NULL)
      90          63 :         framework::FrameworkHelper::Instance(*pBase)->UpdateConfiguration();
      91          63 : }
      92             : 
      93             : 
      94             : 
      95             : 
      96             : 
      97             : 
      98             : //===== LeftPaneImpressChildWindow ============================================
      99             : 
     100          12 : LeftPaneImpressChildWindow::LeftPaneImpressChildWindow (
     101             :     ::Window* pParentWindow,
     102             :     sal_uInt16 nId,
     103             :     SfxBindings* pBindings,
     104             :     SfxChildWinInfo* pInfo)
     105             :     : PaneChildWindow(
     106             :         pParentWindow,
     107             :         nId,
     108             :         pBindings,
     109             :         pInfo,
     110             :         FLT_LEFT_PANE_IMPRESS_DOCKING_WINDOW,
     111             :         STR_LEFT_PANE_IMPRESS_TITLE,
     112          12 :         SFX_ALIGN_LEFT)
     113             : {
     114          12 : }
     115             : 
     116             : 
     117             : 
     118             : 
     119             : //===== LeftPaneDrawChildWindow ===============================================
     120             : 
     121          51 : LeftPaneDrawChildWindow::LeftPaneDrawChildWindow (
     122             :     ::Window* pParentWindow,
     123             :     sal_uInt16 nId,
     124             :     SfxBindings* pBindings,
     125             :     SfxChildWinInfo* pInfo)
     126             :     : PaneChildWindow(
     127             :         pParentWindow,
     128             :         nId,
     129             :         pBindings,
     130             :         pInfo,
     131             :         FLT_LEFT_PANE_DRAW_DOCKING_WINDOW,
     132             :         STR_LEFT_PANE_DRAW_TITLE,
     133          51 :         SFX_ALIGN_LEFT)
     134             : {
     135          51 : }
     136             : 
     137             : } // end of namespace ::sd
     138             : 
     139             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10