From 61483d2f40cb0d77a4e1593ee677ae37c9ec6d65 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 25 Apr 2013 11:58:40 +0100 Subject: convert merge table dialog to .ui Change-Id: I59ff70e3280d4e746b0d20f7f9532a341d88cb57 --- sw/AllLangResTarget_sw.mk | 1 - sw/UIConfig_swriter.mk | 1 + sw/inc/swabstdlg.hxx | 2 +- sw/source/ui/dialog/swdlgfact.cxx | 17 +--- sw/source/ui/dialog/swdlgfact.hxx | 3 +- sw/source/ui/inc/mergetbl.hxx | 11 +-- sw/source/ui/inc/table.hrc | 4 +- sw/source/ui/shells/tabsh.cxx | 2 +- sw/source/ui/table/mergetbl.cxx | 21 +--- sw/source/ui/table/mergetbl.hrc | 26 ----- sw/source/ui/table/mergetbl.src | 75 -------------- sw/uiconfig/swriter/ui/mergetabledialog.ui | 154 +++++++++++++++++++++++++++++ 12 files changed, 170 insertions(+), 147 deletions(-) delete mode 100644 sw/source/ui/table/mergetbl.hrc delete mode 100644 sw/source/ui/table/mergetbl.src create mode 100644 sw/uiconfig/swriter/ui/mergetabledialog.ui (limited to 'sw') diff --git a/sw/AllLangResTarget_sw.mk b/sw/AllLangResTarget_sw.mk index 6d63cea36714..f52adae82fba 100644 --- a/sw/AllLangResTarget_sw.mk +++ b/sw/AllLangResTarget_sw.mk @@ -141,7 +141,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/mergetbl.src \ sw/source/ui/table/table.src \ sw/source/ui/table/tabledlg.src \ sw/source/ui/uiview/pview.src \ diff --git a/sw/UIConfig_swriter.mk b/sw/UIConfig_swriter.mk index a4349e594ce0..a0145233d078 100644 --- a/sw/UIConfig_swriter.mk +++ b/sw/UIConfig_swriter.mk @@ -85,6 +85,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/swriter,\ sw/uiconfig/swriter/ui/insertscript \ sw/uiconfig/swriter/ui/inserttable \ sw/uiconfig/swriter/ui/linenumbering \ + sw/uiconfig/swriter/ui/mergetabledialog \ sw/uiconfig/swriter/ui/numparapage \ sw/uiconfig/swriter/ui/opttestpage \ sw/uiconfig/swriter/ui/outlinenumbering \ diff --git a/sw/inc/swabstdlg.hxx b/sw/inc/swabstdlg.hxx index c0ff6ed36ee9..acc2af9c9d39 100644 --- a/sw/inc/swabstdlg.hxx +++ b/sw/inc/swabstdlg.hxx @@ -391,7 +391,7 @@ public: ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > & xNameAccess, int nResId ) = 0; virtual AbstractSwModalRedlineAcceptDlg * CreateSwModalRedlineAcceptDlg(Window *pParent) = 0; - virtual VclAbstractDialog* CreateSwVclDialog( int nResId, Window* pParent, sal_Bool& rWithPrev ) = 0; //add for SwMergeTblDlg + virtual VclAbstractDialog* CreateTblMergeDialog( Window* pParent, sal_Bool& rWithPrev ) = 0; //add for SwMergeTblDlg virtual SfxAbstractTabDialog* CreateFrmTabDialog( int nResId, SfxViewFrame *pFrame, Window *pParent, const SfxItemSet& rCoreSet, diff --git a/sw/source/ui/dialog/swdlgfact.cxx b/sw/source/ui/dialog/swdlgfact.cxx index 0cedad70378a..851cbb170db0 100644 --- a/sw/source/ui/dialog/swdlgfact.cxx +++ b/sw/source/ui/dialog/swdlgfact.cxx @@ -1028,21 +1028,10 @@ AbstractSwModalRedlineAcceptDlg * SwAbstractDialogFactory_Impl::CreateSwModalRed return new AbstractSwModalRedlineAcceptDlg_Impl( pDlg ); } -VclAbstractDialog * SwAbstractDialogFactory_Impl::CreateSwVclDialog( int nResId, - Window* pParent, sal_Bool& rWithPrev ) //add for SwMergeTblDlg +VclAbstractDialog * SwAbstractDialogFactory_Impl::CreateTblMergeDialog(Window* pParent, sal_Bool& rWithPrev) //add for SwMergeTblDlg { - Dialog* pDlg=NULL; - switch ( nResId ) - { - case DLG_MERGE_TABLE : - pDlg = new SwMergeTblDlg( pParent, rWithPrev ); - break; - default: - break; - } - if ( pDlg ) - return new VclAbstractDialog_Impl( pDlg ); - return 0; + Dialog* pDlg = new SwMergeTblDlg( pParent, rWithPrev ); + return new VclAbstractDialog_Impl( pDlg ); } SfxAbstractTabDialog* SwAbstractDialogFactory_Impl::CreateFrmTabDialog( int nResId, diff --git a/sw/source/ui/dialog/swdlgfact.hxx b/sw/source/ui/dialog/swdlgfact.hxx index b9c75bddb44f..2547151579ec 100644 --- a/sw/source/ui/dialog/swdlgfact.hxx +++ b/sw/source/ui/dialog/swdlgfact.hxx @@ -490,8 +490,7 @@ public: ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > & xNameAccess, int nResId ); virtual AbstractSwModalRedlineAcceptDlg * CreateSwModalRedlineAcceptDlg(Window *pParent); //add for SwModalRedlineAcceptDlg - virtual VclAbstractDialog* CreateSwVclDialog( int nResId, - Window* pParent, sal_Bool& rWithPrev ); //add for SwMergeTblDlg + virtual VclAbstractDialog* CreateTblMergeDialog(Window* pParent, sal_Bool& rWithPrev); //add for SwMergeTblDlg virtual SfxAbstractTabDialog* CreateFrmTabDialog( int nResId, SfxViewFrame *pFrame, Window *pParent, const SfxItemSet& rCoreSet, diff --git a/sw/source/ui/inc/mergetbl.hxx b/sw/source/ui/inc/mergetbl.hxx index 3958ff485fa9..0c140547b514 100644 --- a/sw/source/ui/inc/mergetbl.hxx +++ b/sw/source/ui/inc/mergetbl.hxx @@ -27,14 +27,9 @@ class SwMergeTblDlg : public SvxStandardDialog { - OKButton aOKPB; - CancelButton aCancelPB; - HelpButton aHelpPB; - FixedLine aMergeFL; - RadioButton aMergePrevRB; - RadioButton aMergeNextRB; - - sal_Bool& rMergePrev; + RadioButton* m_pMergePrevRB; + + sal_Bool& m_rMergePrev; protected: virtual void Apply(); diff --git a/sw/source/ui/inc/table.hrc b/sw/source/ui/inc/table.hrc index d61cc15c3231..b3a11114fd89 100644 --- a/sw/source/ui/inc/table.hrc +++ b/sw/source/ui/inc/table.hrc @@ -29,9 +29,7 @@ #define DLG_INSERT_CHART (RC_TABLE_BEGIN + 12) #define MSG_WRONG_TABLENAME (RC_TABLE_BEGIN + 13) -#define DLG_MERGE_TABLE (RC_TABLE_BEGIN + 15) - -#define TABLE_ACT_END DLG_MERGE_TABLE +#define TABLE_ACT_END MSG_WRONG_TABLENAME #if TABLE_ACT_END > RC_TABLE_END #error Resource-Id Ueberlauf in #file, #line diff --git a/sw/source/ui/shells/tabsh.cxx b/sw/source/ui/shells/tabsh.cxx index aa5327fb4c14..e72aaa18c99f 100644 --- a/sw/source/ui/shells/tabsh.cxx +++ b/sw/source/ui/shells/tabsh.cxx @@ -983,7 +983,7 @@ void SwTableShell::Execute(SfxRequest &rReq) { SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); - VclAbstractDialog* pDlg = pFact->CreateSwVclDialog( DLG_MERGE_TABLE, GetView().GetWindow(), bPrev ); + VclAbstractDialog* pDlg = pFact->CreateTblMergeDialog(GetView().GetWindow(), bPrev); OSL_ENSURE(pDlg, "dialogdiet pDlg fail!"); if( RET_OK != pDlg->Execute()) bPrev = bNext = sal_False; diff --git a/sw/source/ui/table/mergetbl.cxx b/sw/source/ui/table/mergetbl.cxx index 16114295b5cf..bafb3fc14134 100644 --- a/sw/source/ui/table/mergetbl.cxx +++ b/sw/source/ui/table/mergetbl.cxx @@ -19,29 +19,18 @@ #include #include -#include -#include - SwMergeTblDlg::SwMergeTblDlg( Window *pParent, sal_Bool& rWithPrev ) - : SvxStandardDialog(pParent, SW_RES(DLG_MERGE_TABLE)), - aOKPB( this, SW_RES(PB_OK )), - aCancelPB( this, SW_RES(PB_CANCEL )), - aHelpPB( this, SW_RES(PB_HELP )), - aMergeFL( this, SW_RES(FL_MERGE )), - aMergePrevRB( this, SW_RES(RB_MERGE_PREV)), - aMergeNextRB( this, SW_RES(RB_MERGE_NEXT)), - rMergePrev( rWithPrev ) + : SvxStandardDialog(pParent, "MergeTableDialog", "modules/swriter/ui/mergetabledialog.ui") + , m_rMergePrev(rWithPrev) { - FreeResource(); - aMergePrevRB.Check(); + get(m_pMergePrevRB, "prev"); + m_pMergePrevRB->Check(); } void SwMergeTblDlg::Apply() { - rMergePrev = aMergePrevRB.IsChecked(); + m_rMergePrev = m_pMergePrevRB->IsChecked(); } - - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/table/mergetbl.hrc b/sw/source/ui/table/mergetbl.hrc deleted file mode 100644 index 97e81b7ff274..000000000000 --- a/sw/source/ui/table/mergetbl.hrc +++ /dev/null @@ -1,26 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * 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 PB_OK 1 -#define PB_CANCEL 2 -#define PB_HELP 3 -#define FL_MERGE 4 -#define RB_MERGE_PREV 5 -#define RB_MERGE_NEXT 6 - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/table/mergetbl.src b/sw/source/ui/table/mergetbl.src deleted file mode 100644 index 3593f9e5c8e4..000000000000 --- a/sw/source/ui/table/mergetbl.src +++ /dev/null @@ -1,75 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * 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 "mergetbl.hrc" -#include "cmdid.h" -#include "helpid.h" -ModalDialog DLG_MERGE_TABLE -{ - HelpID = CMD_FN_TABLE_MERGE_TABLE ; - OutputSize = TRUE ; - SVLook = TRUE ; - Size = MAP_APPFONT ( 207 , 57 ) ; - Moveable = TRUE ; - OKButton PB_OK - { - Pos = MAP_APPFONT ( 151 , 6 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - DefButton = TRUE ; - }; - CancelButton PB_CANCEL - { - Pos = MAP_APPFONT ( 151 , 23 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - }; - HelpButton PB_HELP - { - Pos = MAP_APPFONT ( 151 , 40 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - }; - FixedLine FL_MERGE - { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 139 , 8 ) ; - Text [ en-US ] = "Mode" ; - }; - RadioButton RB_MERGE_PREV - { - HelpID = "sw:RadioButton:DLG_MERGE_TABLE:RB_MERGE_PREV"; - Pos = MAP_APPFONT ( 12 , 15 ) ; - Size = MAP_APPFONT ( 130 , 10 ) ; - Check = TRUE ; - TabStop = TRUE ; - Text [ en-US ] = "Join with ~previous table"; - }; - RadioButton RB_MERGE_NEXT - { - HelpID = "sw:RadioButton:DLG_MERGE_TABLE:RB_MERGE_NEXT"; - Pos = MAP_APPFONT ( 12 , 30 ) ; - Size = MAP_APPFONT ( 130 , 10 ) ; - Text [ en-US ] = "Join with ~next table"; - }; - Text [ en-US ] = "Merge Tables"; -}; - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/uiconfig/swriter/ui/mergetabledialog.ui b/sw/uiconfig/swriter/ui/mergetabledialog.ui new file mode 100644 index 000000000000..9d5ceacaaea7 --- /dev/null +++ b/sw/uiconfig/swriter/ui/mergetabledialog.ui @@ -0,0 +1,154 @@ + + + + + False + 6 + Merge Tables + dialog + + + False + vertical + 12 + + + False + end + + + gtk-ok + True + True + True + True + True + True + + + False + True + 0 + + + + + gtk-cancel + True + True + True + True + + + False + True + 1 + + + + + gtk-help + True + True + True + True + + + False + True + 2 + + + + + False + True + end + 0 + + + + + True + False + True + True + 0 + none + + + True + False + 6 + 12 + + + True + False + + + Join with _previous table + True + True + False + True + 0 + True + True + next + + + 0 + 0 + 1 + 1 + + + + + Join with _next table + True + True + False + True + 0 + True + prev + + + 0 + 1 + 1 + 1 + + + + + + + + + True + False + Mode + + + + + + + + False + True + 1 + + + + + + ok + cancel + help + + + -- cgit