summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-04-25 11:58:40 +0100
committerCaolán McNamara <caolanm@redhat.com>2013-04-25 12:01:52 +0100
commit61483d2f40cb0d77a4e1593ee677ae37c9ec6d65 (patch)
treefa5c57a7e8ba3b8a8e302bb7ef70f0695e006680
parent5907bb462de34e9cc59c178350bf9153c42d038a (diff)
convert merge table dialog to .ui
Change-Id: I59ff70e3280d4e746b0d20f7f9532a341d88cb57
-rw-r--r--sw/AllLangResTarget_sw.mk1
-rw-r--r--sw/UIConfig_swriter.mk1
-rw-r--r--sw/inc/swabstdlg.hxx2
-rw-r--r--sw/source/ui/dialog/swdlgfact.cxx17
-rw-r--r--sw/source/ui/dialog/swdlgfact.hxx3
-rw-r--r--sw/source/ui/inc/mergetbl.hxx11
-rw-r--r--sw/source/ui/inc/table.hrc4
-rw-r--r--sw/source/ui/shells/tabsh.cxx2
-rw-r--r--sw/source/ui/table/mergetbl.cxx21
-rw-r--r--sw/source/ui/table/mergetbl.hrc26
-rw-r--r--sw/source/ui/table/mergetbl.src75
-rw-r--r--sw/uiconfig/swriter/ui/mergetabledialog.ui154
12 files changed, 170 insertions, 147 deletions
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 <swtypes.hxx>
#include <mergetbl.hxx>
-#include <mergetbl.hrc>
-#include <table.hrc>
-
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 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <!-- interface-requires gtk+ 3.0 -->
+ <object class="GtkDialog" id="MergeTableDialog">
+ <property name="can_focus">False</property>
+ <property name="border_width">6</property>
+ <property name="title" translatable="yes">Merge Tables</property>
+ <property name="type_hint">dialog</property>
+ <child internal-child="vbox">
+ <object class="GtkBox" id="dialog-vbox1">
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">12</property>
+ <child internal-child="action_area">
+ <object class="GtkButtonBox" id="dialog-action_area1">
+ <property name="can_focus">False</property>
+ <property name="layout_style">end</property>
+ <child>
+ <object class="GtkButton" id="ok">
+ <property name="label">gtk-ok</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="has_default">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="cancel">
+ <property name="label">gtk-cancel</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="help">
+ <property name="label">gtk-help</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="pack_type">end</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkFrame" id="frame1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="label_xalign">0</property>
+ <property name="shadow_type">none</property>
+ <child>
+ <object class="GtkAlignment" id="alignment1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="top_padding">6</property>
+ <property name="left_padding">12</property>
+ <child>
+ <object class="GtkGrid" id="grid1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkRadioButton" id="prev">
+ <property name="label" translatable="yes">Join with _previous table</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_underline">True</property>
+ <property name="xalign">0</property>
+ <property name="active">True</property>
+ <property name="draw_indicator">True</property>
+ <property name="group">next</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkRadioButton" id="next">
+ <property name="label" translatable="yes">Join with _next table</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_underline">True</property>
+ <property name="xalign">0</property>
+ <property name="draw_indicator">True</property>
+ <property name="group">prev</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">1</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child type="label">
+ <object class="GtkLabel" id="label1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Mode</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <action-widgets>
+ <action-widget response="0">ok</action-widget>
+ <action-widget response="0">cancel</action-widget>
+ <action-widget response="0">help</action-widget>
+ </action-widgets>
+ </object>
+</interface>