diff options
-rw-r--r-- | svx/inc/svx/stddlg.hxx | 1 | ||||
-rw-r--r-- | svx/source/dialog/stddlg.cxx | 9 | ||||
-rw-r--r-- | sw/AllLangResTarget_sw.mk | 1 | ||||
-rw-r--r-- | sw/UI_swriter.mk | 1 | ||||
-rw-r--r-- | sw/inc/colwd.hxx | 10 | ||||
-rw-r--r-- | sw/inc/swabstdlg.hxx | 2 | ||||
-rw-r--r-- | sw/source/ui/dialog/swdlgfact.cxx | 18 | ||||
-rw-r--r-- | sw/source/ui/dialog/swdlgfact.hxx | 2 | ||||
-rw-r--r-- | sw/source/ui/inc/table.hrc | 4 | ||||
-rw-r--r-- | sw/source/ui/table/colwd.cxx | 46 | ||||
-rw-r--r-- | sw/source/ui/table/colwd.hrc | 27 | ||||
-rw-r--r-- | sw/source/ui/table/colwd.src | 102 | ||||
-rw-r--r-- | sw/source/ui/table/tablemgr.cxx | 2 |
13 files changed, 38 insertions, 187 deletions
diff --git a/svx/inc/svx/stddlg.hxx b/svx/inc/svx/stddlg.hxx index 66385d6cacae..ff77060e4f5f 100644 --- a/svx/inc/svx/stddlg.hxx +++ b/svx/inc/svx/stddlg.hxx @@ -28,6 +28,7 @@ class SVX_DLLPUBLIC SvxStandardDialog: public SfxModalDialog { public: SvxStandardDialog( Window* pParent, const ResId& rResId ); + SvxStandardDialog( Window* pParent, const rtl::OString& rID, const rtl::OUString& rUIXMLDescription ); ~SvxStandardDialog(); short Execute(); diff --git a/svx/source/dialog/stddlg.cxx b/svx/source/dialog/stddlg.cxx index 2f46ce31a09e..85ffbb1c455e 100644 --- a/svx/source/dialog/stddlg.cxx +++ b/svx/source/dialog/stddlg.cxx @@ -46,8 +46,13 @@ short SvxStandardDialog::Execute() // ----------------------------------------------------------------------- -SvxStandardDialog::SvxStandardDialog( Window *pParent, const ResId &rResId ) : - SfxModalDialog( pParent, rResId ) +SvxStandardDialog::SvxStandardDialog( Window *pParent, const ResId &rResId ) + : SfxModalDialog( pParent, rResId ) +{ +} + +SvxStandardDialog::SvxStandardDialog(Window *pParent, const rtl::OString& rID, const rtl::OUString& rUIXMLDescription ) + : SfxModalDialog(pParent, rID, rUIXMLDescription) { } diff --git a/sw/AllLangResTarget_sw.mk b/sw/AllLangResTarget_sw.mk index 48bec3c289aa..cef3c91be03c 100644 --- a/sw/AllLangResTarget_sw.mk +++ b/sw/AllLangResTarget_sw.mk @@ -172,7 +172,6 @@ $(eval $(call gb_SrsTarget_add_files,sw/res,\ sw/source/ui/shells/shells.src \ sw/source/ui/smartmenu/stmenu.src \ sw/source/ui/table/chartins.src \ - sw/source/ui/table/colwd.src \ sw/source/ui/table/convert.src \ sw/source/ui/table/mergetbl.src \ sw/source/ui/table/rowht.src \ diff --git a/sw/UI_swriter.mk b/sw/UI_swriter.mk index e6bece6d7e71..fa2a7279c863 100644 --- a/sw/UI_swriter.mk +++ b/sw/UI_swriter.mk @@ -10,6 +10,7 @@ $(eval $(call gb_UI_UI,modules/swriter)) $(eval $(call gb_UI_add_uifiles,modules/swriter,\ + sw/uiconfig/swriter/ui/columnwidth \ sw/uiconfig/swriter/ui/inserttable \ sw/uiconfig/swriter/ui/linenumbering \ sw/uiconfig/swriter/ui/printeroptions \ diff --git a/sw/inc/colwd.hxx b/sw/inc/colwd.hxx index cd445238c1cf..db909e789e6b 100644 --- a/sw/inc/colwd.hxx +++ b/sw/inc/colwd.hxx @@ -40,14 +40,8 @@ class SwTableFUNC; class SwTableWidthDlg : public SvxStandardDialog { - FixedLine aWidthFL; - FixedText aColFT; - NumericField aColEdit; - FixedText aWidthFT; - MetricField aWidthEdit; - OKButton aOKBtn; - CancelButton aCancelBtn; - HelpButton aHelpBtn; + NumericField* m_pColNF; + MetricField* m_pWidthMF; SwTableFUNC &rFnc; protected: diff --git a/sw/inc/swabstdlg.hxx b/sw/inc/swabstdlg.hxx index 6a12c7c3fb79..a342f7d64a07 100644 --- a/sw/inc/swabstdlg.hxx +++ b/sw/inc/swabstdlg.hxx @@ -406,7 +406,7 @@ public: virtual SfxAbstractDialog * CreateSwBorderDlg ( Window* pParent, SfxItemSet& rSet, sal_uInt16 nType, int nResId ) = 0;//add for SwBorderDlg virtual SfxAbstractDialog * CreateSwWrapDlg ( Window* pParent, SfxItemSet& rSet, SwWrtShell* pSh, sal_Bool bDrawMode, int nResId ) = 0; //add for SwWrapDlg - virtual VclAbstractDialog * CreateSwTableWidthDlg ( Window *pParent, SwTableFUNC &rFnc , int nResId ) = 0; //add for SwTableWidthDlg + virtual VclAbstractDialog * CreateSwTableWidthDlg(Window *pParent, SwTableFUNC &rFnc) = 0; //add for SwTableWidthDlg virtual SfxAbstractTabDialog* CreateSwTableTabDlg( Window* pParent, SfxItemPool& Pool, const SfxItemSet* pItemSet, SwWrtShell* pSh,int nResId ) = 0; //add for SwTableTabDlg diff --git a/sw/source/ui/dialog/swdlgfact.cxx b/sw/source/ui/dialog/swdlgfact.cxx index a8618cc3b4bd..0404a3012aae 100644 --- a/sw/source/ui/dialog/swdlgfact.cxx +++ b/sw/source/ui/dialog/swdlgfact.cxx @@ -1040,22 +1040,10 @@ SfxAbstractDialog* SwAbstractDialogFactory_Impl::CreateSwWrapDlg ( Window* pPare return 0; } -VclAbstractDialog * SwAbstractDialogFactory_Impl::CreateSwTableWidthDlg ( Window *pParent, SwTableFUNC &rFnc , int nResId ) +VclAbstractDialog * SwAbstractDialogFactory_Impl::CreateSwTableWidthDlg(Window *pParent, SwTableFUNC &rFnc) { - Dialog* pDlg=NULL; - switch ( nResId ) - { - case DLG_COL_WIDTH : - pDlg = new SwTableWidthDlg( pParent, rFnc); - break; - - default: - break; - } - - if ( pDlg ) - return new VclAbstractDialog_Impl( pDlg ); - return 0; + Dialog* pDlg = new SwTableWidthDlg(pParent, rFnc); + return new VclAbstractDialog_Impl( pDlg ); } SfxAbstractTabDialog* SwAbstractDialogFactory_Impl::CreateSwTableTabDlg( Window* pParent, SfxItemPool& Pool, diff --git a/sw/source/ui/dialog/swdlgfact.hxx b/sw/source/ui/dialog/swdlgfact.hxx index a005c59b1715..97108acb48a6 100644 --- a/sw/source/ui/dialog/swdlgfact.hxx +++ b/sw/source/ui/dialog/swdlgfact.hxx @@ -485,7 +485,7 @@ public: virtual SfxAbstractDialog * CreateSwBorderDlg (Window* pParent, SfxItemSet& rSet, sal_uInt16 nType,int nResId );//add for SwBorderDlg virtual SfxAbstractDialog * CreateSwWrapDlg ( Window* pParent, SfxItemSet& rSet, SwWrtShell* pSh, sal_Bool bDrawMode, int nResId ); //add for SwWrapDlg - virtual VclAbstractDialog * CreateSwTableWidthDlg ( Window *pParent, SwTableFUNC &rFnc , int nResId ); //add for SwTableWidthDlg + virtual VclAbstractDialog * CreateSwTableWidthDlg(Window *pParent, SwTableFUNC &rFnc); virtual SfxAbstractTabDialog* CreateSwTableTabDlg( Window* pParent, SfxItemPool& Pool, const SfxItemSet* pItemSet, SwWrtShell* pSh,int nResId ); //add for SwTableTabDlg virtual AbstractSwFldDlg * CreateSwFldDlg ( SfxBindings* pB, SwChildWinWrapper* pCW, Window *pParent, int nResId ); //add for SwFldDlg diff --git a/sw/source/ui/inc/table.hrc b/sw/source/ui/inc/table.hrc index a3d6d2485cd9..dfdf13fccb9a 100644 --- a/sw/source/ui/inc/table.hrc +++ b/sw/source/ui/inc/table.hrc @@ -21,8 +21,10 @@ #define DLG_FORMAT_TABLE (RC_TABLE_BEGIN + 1) #define DLG_CONV_TEXT_TABLE (RC_TABLE_BEGIN + 2) #define DLG_ROW_HEIGHT (RC_TABLE_BEGIN + 4) -#define DLG_COL_WIDTH (RC_TABLE_BEGIN + 6) + + #define MSG_ERR_TABLE_MERGE (RC_TABLE_BEGIN + 7) + #define DLG_AUTOFMT_TABLE (RC_TABLE_BEGIN + 9) #define DLG_SWDLG_STRINPUT (RC_TABLE_BEGIN + 10) #define TP_TABLE_COLUMN (RC_TABLE_BEGIN + 11) diff --git a/sw/source/ui/table/colwd.cxx b/sw/source/ui/table/colwd.cxx index 2649e7c7a1e5..f141bd595ff0 100644 --- a/sw/source/ui/table/colwd.cxx +++ b/sw/source/ui/table/colwd.cxx @@ -38,54 +38,44 @@ #include <usrpref.hxx> #include <cmdid.h> -#include <colwd.hrc> #include <table.hrc> IMPL_LINK_NOARG_INLINE_START(SwTableWidthDlg, LoseFocusHdl) { - sal_uInt16 nId = (sal_uInt16)aColEdit.GetValue()-1; + sal_uInt16 nId = (sal_uInt16)m_pColNF->GetValue()-1; const SwTwips lWidth = rFnc.GetColWidth(nId); - aWidthEdit.SetValue(aWidthEdit.Normalize(lWidth), FUNIT_TWIP); - aWidthEdit.SetMax(aWidthEdit.Normalize(rFnc.GetMaxColWidth(nId)), FUNIT_TWIP); + m_pWidthMF->SetMax(m_pWidthMF->Normalize(rFnc.GetMaxColWidth(nId)), FUNIT_TWIP); + m_pWidthMF->SetValue(m_pWidthMF->Normalize(lWidth), FUNIT_TWIP); return 0; } IMPL_LINK_NOARG_INLINE_END(SwTableWidthDlg, LoseFocusHdl) -SwTableWidthDlg::SwTableWidthDlg(Window *pParent, SwTableFUNC &rTableFnc ) : - - SvxStandardDialog( pParent, SW_RES(DLG_COL_WIDTH) ), - aWidthFL(this, SW_RES(FL_WIDTH)), - - aColFT(this, SW_RES(FT_COL)), - aColEdit(this, SW_RES(ED_COL)), - aWidthFT(this, SW_RES(FT_WIDTH)), - aWidthEdit(this, SW_RES(ED_WIDTH)), - aOKBtn(this, SW_RES(BT_OK)), - aCancelBtn(this, SW_RES(BT_CANCEL)), - aHelpBtn(this, SW_RES(BT_HELP)), - rFnc(rTableFnc) +SwTableWidthDlg::SwTableWidthDlg(Window *pParent, SwTableFUNC &rTableFnc ) + : SvxStandardDialog( pParent, "ColumnWidthDialog", "modules/swriter/ui/columnwidth.ui" ) + , rFnc(rTableFnc) { - FreeResource(); + get(m_pColNF, "column"); + get(m_pWidthMF, "width"); sal_Bool bIsWeb = rTableFnc.GetShell() ? static_cast< sal_Bool >(0 != PTR_CAST( SwWebDocShell, rTableFnc.GetShell()->GetView().GetDocShell()) ) : sal_False; FieldUnit eFieldUnit = SW_MOD()->GetUsrPref( bIsWeb )->GetMetric(); - ::SetFieldUnit(aWidthEdit, eFieldUnit ); + ::SetFieldUnit(*m_pWidthMF, eFieldUnit); - aColEdit.SetValue( rFnc.GetCurColNum() +1 ); - aWidthEdit.SetMin(aWidthEdit.Normalize(MINLAY), FUNIT_TWIP); - if(!aWidthEdit.GetMin()) - aWidthEdit.SetMin(1); + m_pColNF->SetValue( rFnc.GetCurColNum() +1 ); + m_pWidthMF->SetMin(m_pWidthMF->Normalize(MINLAY), FUNIT_TWIP); + if(!m_pWidthMF->GetMin()) + m_pWidthMF->SetMin(1); if(rFnc.GetColCount() == 0) - aWidthEdit.SetMin(aWidthEdit.Normalize(rFnc.GetColWidth(0)), FUNIT_TWIP); - aColEdit.SetMax(rFnc.GetColCount() +1 ); - aColEdit.SetModifyHdl(LINK(this,SwTableWidthDlg, LoseFocusHdl)); + m_pWidthMF->SetMin(m_pWidthMF->Normalize(rFnc.GetColWidth(0)), FUNIT_TWIP); + m_pColNF->SetMax(rFnc.GetColCount() +1 ); + m_pColNF->SetModifyHdl(LINK(this,SwTableWidthDlg, LoseFocusHdl)); LoseFocusHdl(); } @@ -95,8 +85,8 @@ void SwTableWidthDlg::Apply() { rFnc.InitTabCols(); rFnc.SetColWidth( - static_cast< sal_uInt16 >(aColEdit.GetValue() - 1), - static_cast< sal_uInt16 >(aWidthEdit.Denormalize(aWidthEdit.GetValue(FUNIT_TWIP)))); + static_cast< sal_uInt16 >(m_pColNF->GetValue() - 1), + static_cast< sal_uInt16 >(m_pWidthMF->Denormalize(m_pWidthMF->GetValue(FUNIT_TWIP)))); } diff --git a/sw/source/ui/table/colwd.hrc b/sw/source/ui/table/colwd.hrc deleted file mode 100644 index 6a6a5d768246..000000000000 --- a/sw/source/ui/table/colwd.hrc +++ /dev/null @@ -1,27 +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 FT_COL 1 -#define ED_COL 2 -#define FT_WIDTH 3 -#define ED_WIDTH 4 -#define FL_WIDTH 5 - -#define BT_OK 100 -#define BT_CANCEL 101 -#define BT_HELP 102 - diff --git a/sw/source/ui/table/colwd.src b/sw/source/ui/table/colwd.src deleted file mode 100644 index 78290db9f250..000000000000 --- a/sw/source/ui/table/colwd.src +++ /dev/null @@ -1,102 +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 "colwd.hrc" -#include "cmdid.h" -#include "helpid.h" -ModalDialog DLG_COL_WIDTH -{ - HelpID = CMD_FN_TABLE_SET_COL_WIDTH ; - OutputSize = TRUE ; - SVLook = TRUE ; - Size = MAP_APPFONT ( 159 , 60 ) ; - Text [ en-US ] = "Column Width" ; - Moveable = TRUE ; - OKButton BT_OK - { - Pos = MAP_APPFONT ( 104 , 6 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - DefButton = TRUE ; - }; - CancelButton BT_CANCEL - { - Pos = MAP_APPFONT ( 104 , 23 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - }; - HelpButton BT_HELP - { - Pos = MAP_APPFONT ( 104 , 43 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - }; - FixedText FT_WIDTH - { - Pos = MAP_APPFONT ( 12 , 31 ) ; - Size = MAP_APPFONT ( 35 , 8 ) ; - Text [ en-US ] = "~Width" ; - Left = TRUE ; - }; - MetricField ED_WIDTH - { - HelpID = "sw:MetricField:DLG_COL_WIDTH:ED_WIDTH"; - Border = TRUE ; - Pos = MAP_APPFONT ( 51 , 30 ) ; - Size = MAP_APPFONT ( 38 , 12 ) ; - TabStop = TRUE ; - Left = TRUE ; - Repeat = TRUE ; - Spin = TRUE ; - Minimum = 50 ; - Maximum = 9999 ; - DecimalDigits = 2 ; - SpinSize = 10 ; - Value = 10 ; - Unit = FUNIT_CM ; - First = 100 ; - Last = 9999 ; - }; - FixedLine FL_WIDTH - { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 91 , 8 ) ; - Text [ en-US ] = "Width" ; - }; - FixedText FT_COL - { - Pos = MAP_APPFONT ( 12 , 16 ) ; - Size = MAP_APPFONT ( 35 , 8 ) ; - Text [ en-US ] = "~Column" ; - Left = TRUE ; - }; - NumericField ED_COL - { - HelpID = "sw:NumericField:DLG_COL_WIDTH:ED_COL"; - Border = TRUE ; - Pos = MAP_APPFONT ( 51 , 14 ) ; - Size = MAP_APPFONT ( 38 , 12 ) ; - TabStop = TRUE ; - Left = TRUE ; - Spin = TRUE ; - Minimum = 1 ; - Maximum = 99 ; - Repeat = TRUE ; - }; -}; diff --git a/sw/source/ui/table/tablemgr.cxx b/sw/source/ui/table/tablemgr.cxx index 9a2b71e83407..5af560c9e2de 100644 --- a/sw/source/ui/table/tablemgr.cxx +++ b/sw/source/ui/table/tablemgr.cxx @@ -66,7 +66,7 @@ void SwTableFUNC::ColWidthDlg( Window *pParent ) SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); - VclAbstractDialog* pDlg = pFact->CreateSwTableWidthDlg( pParent, *this ,DLG_COL_WIDTH ); + VclAbstractDialog* pDlg = pFact->CreateSwTableWidthDlg(pParent, *this); OSL_ENSURE(pDlg, "Dialogdiet fail!"); pDlg->Execute(); delete pDlg; |