LCOV - code coverage report
Current view: top level - cui/source/tabpages - dstribut.cxx (source / functions) Hit Total Coverage
Test: commit c8344322a7af75b84dd3ca8f78b05543a976dfd5 Lines: 0 94 0.0 %
Date: 2015-06-13 12:38:46 Functions: 0 14 0.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 <sfx2/basedlgs.hxx>
      21             : #include <cuires.hrc>
      22             : #include "dstribut.hxx"
      23             : #include <svx/dialogs.hrc>
      24             : #include <svx/svddef.hxx>
      25             : #include <dialmgr.hxx>
      26             : 
      27             : /*************************************************************************
      28             : |*
      29             : |* Dialog
      30             : |*
      31             : \************************************************************************/
      32             : 
      33           0 : SvxDistributeDialog::SvxDistributeDialog(vcl::Window* pParent,
      34             :     const SfxItemSet& rInAttrs, SvxDistributeHorizontal eHor,
      35             :     SvxDistributeVertical eVer)
      36             :     : SfxSingleTabDialog(pParent, rInAttrs, "DistributionDialog",
      37             :         "cui/ui/distributiondialog.ui")
      38           0 :     , mpPage(NULL)
      39             : {
      40           0 :     mpPage = VclPtr<SvxDistributePage>::Create(get_content_area(), rInAttrs, eHor, eVer);
      41           0 :     SetTabPage(mpPage);
      42           0 : }
      43             : 
      44           0 : SvxDistributeDialog::~SvxDistributeDialog()
      45             : {
      46           0 :     disposeOnce();
      47           0 : }
      48             : 
      49           0 : void SvxDistributeDialog::dispose()
      50             : {
      51           0 :     mpPage.clear();
      52           0 :     SfxSingleTabDialog::dispose();
      53           0 : }
      54             : 
      55             : /*************************************************************************
      56             : |*
      57             : |* Tabpage
      58             : |*
      59             : \************************************************************************/
      60             : 
      61           0 : SvxDistributePage::SvxDistributePage(vcl::Window* pWindow,
      62             :     const SfxItemSet& rInAttrs, SvxDistributeHorizontal eHor,
      63             :     SvxDistributeVertical eVer)
      64             :     : SvxTabPage(pWindow, "DistributionPage", "cui/ui/distributionpage.ui",
      65             :         rInAttrs)
      66             :     , m_eDistributeHor(eHor)
      67           0 :     , m_eDistributeVer(eVer)
      68             : {
      69           0 :     get(m_pBtnHorNone, "hornone");
      70           0 :     get(m_pBtnHorLeft, "horleft");
      71           0 :     get(m_pBtnHorCenter, "horcenter");
      72           0 :     get(m_pBtnHorDistance, "hordistance");
      73           0 :     get(m_pBtnHorRight, "horright");
      74             : 
      75           0 :     get(m_pBtnVerNone, "vernone");
      76           0 :     get(m_pBtnVerTop, "vertop");
      77           0 :     get(m_pBtnVerCenter, "vercenter");
      78           0 :     get(m_pBtnVerDistance, "verdistance");
      79           0 :     get(m_pBtnVerBottom, "verbottom");
      80           0 : }
      81             : 
      82           0 : SvxDistributePage::~SvxDistributePage()
      83             : {
      84           0 :     disposeOnce();
      85           0 : }
      86             : 
      87           0 : void SvxDistributePage::dispose()
      88             : {
      89           0 :     m_pBtnHorNone.clear();
      90           0 :     m_pBtnHorLeft.clear();
      91           0 :     m_pBtnHorCenter.clear();
      92           0 :     m_pBtnHorDistance.clear();
      93           0 :     m_pBtnHorRight.clear();
      94           0 :     m_pBtnVerNone.clear();
      95           0 :     m_pBtnVerTop.clear();
      96           0 :     m_pBtnVerCenter.clear();
      97           0 :     m_pBtnVerDistance.clear();
      98           0 :     m_pBtnVerBottom.clear();
      99           0 :     SvxTabPage::dispose();
     100           0 : }
     101             : 
     102             : 
     103             : /*************************************************************************
     104             : |*
     105             : |* create the tabpage
     106             : |*
     107             : \************************************************************************/
     108             : 
     109           0 : VclPtr<SfxTabPage> SvxDistributePage::Create(vcl::Window* pWindow, const SfxItemSet& rAttrs,
     110             :     SvxDistributeHorizontal eHor, SvxDistributeVertical eVer)
     111             : {
     112           0 :     return VclPtr<SvxDistributePage>::Create(pWindow, rAttrs, eHor, eVer);
     113             : }
     114             : 
     115           0 : void SvxDistributePage::PointChanged(vcl::Window* /*pWindow*/, RECT_POINT /*eRP*/)
     116             : {
     117           0 : }
     118             : 
     119             : /*************************************************************************
     120             : |*
     121             : |* read the delivered Item-Set
     122             : |*
     123             : \************************************************************************/
     124             : 
     125           0 : void SvxDistributePage::Reset(const SfxItemSet* )
     126             : {
     127           0 :     m_pBtnHorNone->SetState(false);
     128           0 :     m_pBtnHorLeft->SetState(false);
     129           0 :     m_pBtnHorCenter->SetState(false);
     130           0 :     m_pBtnHorDistance->SetState(false);
     131           0 :     m_pBtnHorRight->SetState(false);
     132             : 
     133           0 :     switch(m_eDistributeHor)
     134             :     {
     135           0 :         case SvxDistributeHorizontalNone : m_pBtnHorNone->SetState(true); break;
     136           0 :         case SvxDistributeHorizontalLeft : m_pBtnHorLeft->SetState(true); break;
     137           0 :         case SvxDistributeHorizontalCenter : m_pBtnHorCenter->SetState(true); break;
     138           0 :         case SvxDistributeHorizontalDistance : m_pBtnHorDistance->SetState(true); break;
     139           0 :         case SvxDistributeHorizontalRight    : m_pBtnHorRight->SetState(true);    break;
     140             :     }
     141             : 
     142           0 :     m_pBtnVerNone->SetState(false);
     143           0 :     m_pBtnVerTop->SetState(false);
     144           0 :     m_pBtnVerCenter->SetState(false);
     145           0 :     m_pBtnVerDistance->SetState(false);
     146           0 :     m_pBtnVerBottom->SetState(false);
     147             : 
     148           0 :     switch(m_eDistributeVer)
     149             :     {
     150           0 :         case SvxDistributeVerticalNone : m_pBtnVerNone->SetState(true); break;
     151           0 :         case SvxDistributeVerticalTop : m_pBtnVerTop->SetState(true); break;
     152           0 :         case SvxDistributeVerticalCenter : m_pBtnVerCenter->SetState(true); break;
     153           0 :         case SvxDistributeVerticalDistance : m_pBtnVerDistance->SetState(true); break;
     154           0 :         case SvxDistributeVerticalBottom : m_pBtnVerBottom->SetState(true); break;
     155             :     }
     156           0 : }
     157             : 
     158             : /*************************************************************************
     159             : |*
     160             : |* Fill the delivered Item-Set with dialogbox-attributes
     161             : |*
     162             : \************************************************************************/
     163             : 
     164           0 : bool SvxDistributePage::FillItemSet( SfxItemSet* )
     165             : {
     166           0 :     SvxDistributeHorizontal eDistributeHor(SvxDistributeHorizontalNone);
     167           0 :     SvxDistributeVertical eDistributeVer(SvxDistributeVerticalNone);
     168             : 
     169           0 :     if(m_pBtnHorLeft->IsChecked())
     170           0 :         eDistributeHor = SvxDistributeHorizontalLeft;
     171           0 :     else if(m_pBtnHorCenter->IsChecked())
     172           0 :         eDistributeHor = SvxDistributeHorizontalCenter;
     173           0 :     else if(m_pBtnHorDistance->IsChecked())
     174           0 :         eDistributeHor = SvxDistributeHorizontalDistance;
     175           0 :     else if(m_pBtnHorRight->IsChecked())
     176           0 :         eDistributeHor = SvxDistributeHorizontalRight;
     177             : 
     178           0 :     if(m_pBtnVerTop->IsChecked())
     179           0 :         eDistributeVer = SvxDistributeVerticalTop;
     180           0 :     else if(m_pBtnVerCenter->IsChecked())
     181           0 :         eDistributeVer = SvxDistributeVerticalCenter;
     182           0 :     else if(m_pBtnVerDistance->IsChecked())
     183           0 :         eDistributeVer = SvxDistributeVerticalDistance;
     184           0 :     else if(m_pBtnVerBottom->IsChecked())
     185           0 :         eDistributeVer = SvxDistributeVerticalBottom;
     186             : 
     187           0 :     if(eDistributeHor != m_eDistributeHor || eDistributeVer != m_eDistributeVer)
     188             :     {
     189           0 :         m_eDistributeHor = eDistributeHor;
     190           0 :         m_eDistributeVer = eDistributeVer;
     191           0 :         return true;
     192             :     }
     193             : 
     194           0 :     return false;
     195           0 : }
     196             : 
     197             : 
     198             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.11