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

Generated by: LCOV version 1.11