LCOV - code coverage report
Current view: top level - libreoffice/cui/source/dialogs - splitcelldlg.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 1 45 2.2 %
Date: 2012-12-27 Functions: 2 12 16.7 %
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/dispatch.hxx>
      21             : #include <svl/intitem.hxx>
      22             : #include <svl/eitem.hxx>
      23             : #include "dialmgr.hxx"
      24             : #include "splitcelldlg.hxx"
      25             : #include "cuires.hrc"
      26             : #include "splitcelldlg.hrc"
      27             : 
      28           0 : SvxSplitTableDlg::SvxSplitTableDlg( Window *pParent, bool bIsTableVertical, long nMaxVertical, long nMaxHorizontal )
      29           0 : : SvxStandardDialog(pParent, CUI_RES(RID_SVX_SPLITCELLDLG))
      30           0 : , maCountFL(this, CUI_RES(FL_COUNT))
      31           0 : , maCountLbl(this, CUI_RES(FT_COUNT))
      32           0 : , maCountEdit(this, CUI_RES(ED_COUNT))
      33           0 : , maDirFL(this, CUI_RES(FL_DIR))
      34           0 : , maHorzBox(this, CUI_RES(RB_HORZ))
      35           0 : , maVertBox(this, CUI_RES(RB_VERT))
      36           0 : , maPropCB(this, CUI_RES(CB_PROP))
      37           0 : , maOKBtn(this, CUI_RES(BT_OK))
      38           0 : , maCancelBtn(this, CUI_RES(BT_CANCEL))
      39           0 : , maHelpBtn( this, CUI_RES( BT_HELP ) )
      40             : , mnMaxVertical( nMaxVertical )
      41           0 : , mnMaxHorizontal( nMaxHorizontal )
      42             : {
      43           0 :     FreeResource();
      44           0 :     maHorzBox.SetClickHdl( LINK( this, SvxSplitTableDlg, ClickHdl ));
      45           0 :     maPropCB.SetClickHdl( LINK( this, SvxSplitTableDlg, ClickHdl ));
      46           0 :     maVertBox.SetClickHdl( LINK( this, SvxSplitTableDlg, ClickHdl ));
      47             : 
      48           0 :     if( mnMaxVertical < 2 )
      49           0 :         maVertBox.Enable(sal_False);
      50             : 
      51             :     //exchange the meaning of horizontal and vertical for vertical text
      52           0 :     if(bIsTableVertical)
      53             :     {
      54           0 :         Image aTmpImg(maHorzBox.GetModeRadioImage());
      55           0 :         String sTmp(maHorzBox.GetText());
      56           0 :         maHorzBox.SetText(maVertBox.GetText());
      57           0 :         maHorzBox.SetModeRadioImage(maVertBox.GetModeRadioImage());
      58           0 :         maVertBox.SetText(sTmp);
      59           0 :         maVertBox.SetModeRadioImage(aTmpImg);
      60             :     }
      61           0 : }
      62             : 
      63           0 : SvxSplitTableDlg::~SvxSplitTableDlg()
      64             : {
      65           0 : }
      66             : 
      67           0 : IMPL_LINK( SvxSplitTableDlg, ClickHdl, Button *, pButton )
      68             : {
      69           0 :     const bool bIsVert =  pButton == &maVertBox ;
      70           0 :     long nMax = bIsVert ? mnMaxVertical : mnMaxHorizontal;
      71           0 :     maPropCB.Enable(!bIsVert);
      72           0 :     maCountEdit.SetMax( nMax );
      73           0 :     return 0;
      74             : }
      75             : 
      76           0 : bool SvxSplitTableDlg::IsHorizontal() const
      77             : {
      78           0 :     return maHorzBox.IsChecked();
      79             : }
      80             : 
      81           0 : bool SvxSplitTableDlg::IsProportional() const
      82             : {
      83           0 :     return maPropCB.IsChecked() && maHorzBox.IsChecked();
      84             : }
      85             : 
      86           0 : long SvxSplitTableDlg::GetCount() const
      87             : {
      88           0 :     return sal::static_int_cast<long>( maCountEdit.GetValue() );
      89             : }
      90             : 
      91           0 : short SvxSplitTableDlg::Execute()
      92             : {
      93           0 :     return SvxStandardDialog::Execute();
      94             : }
      95             : 
      96           0 : void SvxSplitTableDlg::Apply()
      97             : {
      98           3 : }
      99             : 
     100             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10