LCOV - code coverage report
Current view: top level - sfx2/source/sidebar - SidebarChildWindow.cxx (source / functions) Hit Total Coverage
Test: commit 0e63ca4fde4e446f346e35849c756a30ca294aab Lines: 17 18 94.4 %
Date: 2014-04-11 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             : #include "TabBar.hxx"
      21             : #include <sfx2/sidebar/SidebarChildWindow.hxx>
      22             : #include "SidebarDockingWindow.hxx"
      23             : #include <sfx2/sfxsids.hrc>
      24             : #include "helpid.hrc"
      25             : #include <sfx2/dockwin.hxx>
      26             : #include <sfx2/sidebar/ResourceDefinitions.hrc>
      27             : 
      28             : 
      29             : namespace sfx2 { namespace sidebar {
      30             : 
      31             : 
      32         256 : SFX_IMPL_DOCKINGWINDOW_WITHID(SidebarChildWindow, SID_SIDEBAR);
      33             : 
      34             : 
      35          17 : SidebarChildWindow::SidebarChildWindow (
      36             :     Window* pParentWindow,
      37             :     sal_uInt16 nId,
      38             :     SfxBindings* pBindings,
      39             :     SfxChildWinInfo* pInfo)
      40          17 :     : SfxChildWindow(pParentWindow, nId)
      41             : {
      42             :     this->pWindow = new SidebarDockingWindow(
      43             :         pBindings,
      44             :         *this,
      45             :         pParentWindow,
      46          17 :         WB_STDDOCKWIN | WB_OWNERDRAWDECORATION | WB_CLIPCHILDREN | WB_SIZEABLE | WB_3DLOOK | WB_ROLLABLE);
      47          17 :     eChildAlignment = SFX_ALIGN_RIGHT;
      48             : 
      49          17 :     this->pWindow->SetHelpId(HID_SIDEBAR_WINDOW);
      50          17 :     this->pWindow->SetOutputSizePixel(Size(GetDefaultWidth(this->pWindow), 450));
      51             : 
      52          17 :     SfxDockingWindow* pDockingParent = dynamic_cast<SfxDockingWindow*>(this->pWindow);
      53          17 :     if (pDockingParent != NULL)
      54          17 :         pDockingParent->Initialize(pInfo);
      55          17 :     SetHideNotDelete(true);
      56             : 
      57          17 :     this->pWindow->Show();
      58          17 : }
      59             : 
      60             : 
      61             : 
      62             : 
      63          17 : sal_Int32 SidebarChildWindow::GetDefaultWidth (Window* pWindow)
      64             : {
      65          17 :     if (pWindow != NULL)
      66             :     {
      67             :         // Width of the paragraph panel.
      68             :         const static sal_Int32 nMaxPropertyPageWidth (115);
      69             : 
      70          34 :         return pWindow->LogicToPixel(Point(nMaxPropertyPageWidth,1), MAP_APPFONT).X()
      71          17 :             + TabBar::GetDefaultWidth() * pWindow->GetDPIScaleFactor();
      72             :     }
      73             :     else
      74           0 :         return 0;
      75             : }
      76             : 
      77             : 
      78             : } } // end of namespace sfx2::sidebar
      79             : 
      80             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10