summaryrefslogtreecommitdiff
path: root/sw/source/ui/table
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-01-23 15:16:20 +0000
committerCaolán McNamara <caolanm@redhat.com>2013-01-23 15:39:04 +0000
commit83e5a76f0e8803646de26daa736a9d3353d4ae85 (patch)
tree5756755edaf9640c3b97162bbd3445c255b331ff /sw/source/ui/table
parentd931b994a4bd2f8fe72f351a7d628a44a35f4abe (diff)
convert autofit width dialog to new .ui
Change-Id: I81bc6e119019f9bd4f90ae4ed77fbb65455260cd
Diffstat (limited to 'sw/source/ui/table')
-rw-r--r--sw/source/ui/table/rowht.cxx39
-rw-r--r--sw/source/ui/table/rowht.hrc25
-rw-r--r--sw/source/ui/table/rowht.src82
3 files changed, 13 insertions, 133 deletions
diff --git a/sw/source/ui/table/rowht.cxx b/sw/source/ui/table/rowht.cxx
index 2b1587b044c9..9fec8f0bea1d 100644
--- a/sw/source/ui/table/rowht.cxx
+++ b/sw/source/ui/table/rowht.cxx
@@ -34,18 +34,14 @@
#include <usrpref.hxx>
#include <cmdid.h>
-#include <rowht.hrc>
#include <table.hrc>
-
-
-
void SwTableHeightDlg::Apply()
{
- SwTwips nHeight = static_cast< SwTwips >(aHeightEdit.Denormalize(aHeightEdit.GetValue(FUNIT_TWIP)));
+ SwTwips nHeight = static_cast< SwTwips >(m_pHeightEdit->Denormalize(m_pHeightEdit->GetValue(FUNIT_TWIP)));
SwFmtFrmSize aSz(ATT_FIX_SIZE, 0, nHeight);
- SwFrmSize eFrmSize = (SwFrmSize) aAutoHeightCB.IsChecked() ?
+ SwFrmSize eFrmSize = (SwFrmSize) m_pAutoHeightCB->IsChecked() ?
ATT_MIN_SIZE : ATT_FIX_SIZE;
if(eFrmSize != aSz.GetHeightSizeType())
{
@@ -54,37 +50,28 @@ void SwTableHeightDlg::Apply()
rSh.SetRowHeight( aSz );
}
-// CTOR / DTOR -----------------------------------------------------------
-
-
-SwTableHeightDlg::SwTableHeightDlg( Window *pParent, SwWrtShell &rS ) :
-
- SvxStandardDialog(pParent, SW_RES(DLG_ROW_HEIGHT)),
- aHeightFL(this, SW_RES(FL_HEIGHT)),
- aHeightEdit(this, SW_RES(ED_HEIGHT)),
- aAutoHeightCB(this, SW_RES(CB_AUTOHEIGHT)),
- aOKBtn(this, SW_RES(BT_OK)),
- aCancelBtn(this, SW_RES(BT_CANCEL)),
- aHelpBtn( this, SW_RES( BT_HELP ) ),
- rSh( rS )
+SwTableHeightDlg::SwTableHeightDlg(Window *pParent, SwWrtShell &rS)
+ : SvxStandardDialog(pParent, "RowHeightDialog", "modules/swriter/ui/rowheight.ui")
+ , rSh( rS )
{
- FreeResource();
+ get(m_pHeightEdit, "heightmf");
+ get(m_pAutoHeightCB, "fit");
FieldUnit eFieldUnit = SW_MOD()->GetUsrPref( 0 != PTR_CAST( SwWebDocShell,
rSh.GetView().GetDocShell() ) )->GetMetric();
- ::SetFieldUnit( aHeightEdit, eFieldUnit );
+ ::SetFieldUnit(*m_pHeightEdit, eFieldUnit);
- aHeightEdit.SetMin(MINLAY, FUNIT_TWIP);
- if(!aHeightEdit.GetMin())
- aHeightEdit.SetMin(1);
+ m_pHeightEdit->SetMin(MINLAY, FUNIT_TWIP);
+ if(!m_pHeightEdit->GetMin())
+ m_pHeightEdit->SetMin(1);
SwFmtFrmSize *pSz;
rSh.GetRowHeight( pSz );
if ( pSz )
{
long nHeight = pSz->GetHeight();
- aAutoHeightCB.Check(pSz->GetHeightSizeType() != ATT_FIX_SIZE);
- aHeightEdit.SetValue(aHeightEdit.Normalize(nHeight), FUNIT_TWIP);
+ m_pAutoHeightCB->Check(pSz->GetHeightSizeType() != ATT_FIX_SIZE);
+ m_pHeightEdit->SetValue(m_pHeightEdit->Normalize(nHeight), FUNIT_TWIP);
delete pSz;
}
diff --git a/sw/source/ui/table/rowht.hrc b/sw/source/ui/table/rowht.hrc
deleted file mode 100644
index cddbe4f45627..000000000000
--- a/sw/source/ui/table/rowht.hrc
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-#define ED_HEIGHT 1
-#define CB_AUTOHEIGHT 2
-#define FL_HEIGHT 3
-
-#define BT_OK 100
-#define BT_CANCEL 101
-#define BT_HELP 102
-
diff --git a/sw/source/ui/table/rowht.src b/sw/source/ui/table/rowht.src
deleted file mode 100644
index bee371c01429..000000000000
--- a/sw/source/ui/table/rowht.src
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#include "table.hrc"
-#include "rowht.hrc"
-#include "cmdid.h"
-#include "helpid.h"
-ModalDialog DLG_ROW_HEIGHT
-{
- HelpID = CMD_FN_TABLE_SET_ROW_HEIGHT ;
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 157 , 60 ) ;
- Text [ en-US ] = "Row Height" ;
- Moveable = TRUE ;
- OKButton BT_OK
- {
- Pos = MAP_APPFONT ( 101 , 6 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- DefButton = TRUE ;
- };
- CancelButton BT_CANCEL
- {
- Pos = MAP_APPFONT ( 101 , 23 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
- HelpButton BT_HELP
- {
- Pos = MAP_APPFONT ( 101 , 43 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
- MetricField ED_HEIGHT
- {
- HelpID = "sw:MetricField:DLG_ROW_HEIGHT:ED_HEIGHT";
- Border = TRUE ;
- Pos = MAP_APPFONT ( 12 , 16 ) ;
- Size = MAP_APPFONT ( 38 , 12 ) ;
- TabStop = TRUE ;
- Left = TRUE ;
- Repeat = TRUE ;
- Spin = TRUE ;
- Minimum = 5 ;
- Maximum = 990 ;
- DecimalDigits = 1 ;
- Value = 10 ;
- Unit = FUNIT_CM ;
- First = 100 ;
- Last = 9999 ;
- };
- CheckBox CB_AUTOHEIGHT
- {
- HelpID = "sw:CheckBox:DLG_ROW_HEIGHT:CB_AUTOHEIGHT";
- Pos = MAP_APPFONT ( 12 , 34 ) ;
- Size = MAP_APPFONT ( 80 , 10 ) ;
- TabStop = TRUE ;
- Text [ en-US ] = "~Fit to size" ;
- };
- FixedLine FL_HEIGHT
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 89 , 8 ) ;
- Text [ en-US ] = "Height" ;
- };
-};