Kaydet (Commit) 61483d2f authored tarafından Caolán McNamara's avatar Caolán McNamara

convert merge table dialog to .ui

Change-Id: I59ff70e3280d4e746b0d20f7f9532a341d88cb57
üst 5907bb46
...@@ -141,7 +141,6 @@ $(eval $(call gb_SrsTarget_add_files,sw/res,\ ...@@ -141,7 +141,6 @@ $(eval $(call gb_SrsTarget_add_files,sw/res,\
sw/source/ui/shells/shells.src \ sw/source/ui/shells/shells.src \
sw/source/ui/smartmenu/stmenu.src \ sw/source/ui/smartmenu/stmenu.src \
sw/source/ui/table/chartins.src \ sw/source/ui/table/chartins.src \
sw/source/ui/table/mergetbl.src \
sw/source/ui/table/table.src \ sw/source/ui/table/table.src \
sw/source/ui/table/tabledlg.src \ sw/source/ui/table/tabledlg.src \
sw/source/ui/uiview/pview.src \ sw/source/ui/uiview/pview.src \
......
...@@ -85,6 +85,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/swriter,\ ...@@ -85,6 +85,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/swriter,\
sw/uiconfig/swriter/ui/insertscript \ sw/uiconfig/swriter/ui/insertscript \
sw/uiconfig/swriter/ui/inserttable \ sw/uiconfig/swriter/ui/inserttable \
sw/uiconfig/swriter/ui/linenumbering \ sw/uiconfig/swriter/ui/linenumbering \
sw/uiconfig/swriter/ui/mergetabledialog \
sw/uiconfig/swriter/ui/numparapage \ sw/uiconfig/swriter/ui/numparapage \
sw/uiconfig/swriter/ui/opttestpage \ sw/uiconfig/swriter/ui/opttestpage \
sw/uiconfig/swriter/ui/outlinenumbering \ sw/uiconfig/swriter/ui/outlinenumbering \
......
...@@ -391,7 +391,7 @@ public: ...@@ -391,7 +391,7 @@ public:
::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > & xNameAccess, int nResId ) = 0; ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > & xNameAccess, int nResId ) = 0;
virtual AbstractSwModalRedlineAcceptDlg * CreateSwModalRedlineAcceptDlg(Window *pParent) = 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, virtual SfxAbstractTabDialog* CreateFrmTabDialog( int nResId,
SfxViewFrame *pFrame, Window *pParent, SfxViewFrame *pFrame, Window *pParent,
const SfxItemSet& rCoreSet, const SfxItemSet& rCoreSet,
......
...@@ -1028,21 +1028,10 @@ AbstractSwModalRedlineAcceptDlg * SwAbstractDialogFactory_Impl::CreateSwModalRed ...@@ -1028,21 +1028,10 @@ AbstractSwModalRedlineAcceptDlg * SwAbstractDialogFactory_Impl::CreateSwModalRed
return new AbstractSwModalRedlineAcceptDlg_Impl( pDlg ); return new AbstractSwModalRedlineAcceptDlg_Impl( pDlg );
} }
VclAbstractDialog * SwAbstractDialogFactory_Impl::CreateSwVclDialog( int nResId, VclAbstractDialog * SwAbstractDialogFactory_Impl::CreateTblMergeDialog(Window* pParent, sal_Bool& rWithPrev) //add for SwMergeTblDlg
Window* pParent, sal_Bool& rWithPrev ) //add for SwMergeTblDlg
{ {
Dialog* pDlg=NULL; Dialog* pDlg = new SwMergeTblDlg( pParent, rWithPrev );
switch ( nResId ) return new VclAbstractDialog_Impl( pDlg );
{
case DLG_MERGE_TABLE :
pDlg = new SwMergeTblDlg( pParent, rWithPrev );
break;
default:
break;
}
if ( pDlg )
return new VclAbstractDialog_Impl( pDlg );
return 0;
} }
SfxAbstractTabDialog* SwAbstractDialogFactory_Impl::CreateFrmTabDialog( int nResId, SfxAbstractTabDialog* SwAbstractDialogFactory_Impl::CreateFrmTabDialog( int nResId,
......
...@@ -490,8 +490,7 @@ public: ...@@ -490,8 +490,7 @@ public:
::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > & xNameAccess, int nResId ); ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > & xNameAccess, int nResId );
virtual AbstractSwModalRedlineAcceptDlg * CreateSwModalRedlineAcceptDlg(Window *pParent); //add for SwModalRedlineAcceptDlg virtual AbstractSwModalRedlineAcceptDlg * CreateSwModalRedlineAcceptDlg(Window *pParent); //add for SwModalRedlineAcceptDlg
virtual VclAbstractDialog* CreateSwVclDialog( int nResId, virtual VclAbstractDialog* CreateTblMergeDialog(Window* pParent, sal_Bool& rWithPrev); //add for SwMergeTblDlg
Window* pParent, sal_Bool& rWithPrev ); //add for SwMergeTblDlg
virtual SfxAbstractTabDialog* CreateFrmTabDialog( int nResId, virtual SfxAbstractTabDialog* CreateFrmTabDialog( int nResId,
SfxViewFrame *pFrame, Window *pParent, SfxViewFrame *pFrame, Window *pParent,
const SfxItemSet& rCoreSet, const SfxItemSet& rCoreSet,
......
...@@ -27,14 +27,9 @@ ...@@ -27,14 +27,9 @@
class SwMergeTblDlg : public SvxStandardDialog class SwMergeTblDlg : public SvxStandardDialog
{ {
OKButton aOKPB; RadioButton* m_pMergePrevRB;
CancelButton aCancelPB;
HelpButton aHelpPB; sal_Bool& m_rMergePrev;
FixedLine aMergeFL;
RadioButton aMergePrevRB;
RadioButton aMergeNextRB;
sal_Bool& rMergePrev;
protected: protected:
virtual void Apply(); virtual void Apply();
......
...@@ -29,9 +29,7 @@ ...@@ -29,9 +29,7 @@
#define DLG_INSERT_CHART (RC_TABLE_BEGIN + 12) #define DLG_INSERT_CHART (RC_TABLE_BEGIN + 12)
#define MSG_WRONG_TABLENAME (RC_TABLE_BEGIN + 13) #define MSG_WRONG_TABLENAME (RC_TABLE_BEGIN + 13)
#define DLG_MERGE_TABLE (RC_TABLE_BEGIN + 15) #define TABLE_ACT_END MSG_WRONG_TABLENAME
#define TABLE_ACT_END DLG_MERGE_TABLE
#if TABLE_ACT_END > RC_TABLE_END #if TABLE_ACT_END > RC_TABLE_END
#error Resource-Id Ueberlauf in #file, #line #error Resource-Id Ueberlauf in #file, #line
......
...@@ -983,7 +983,7 @@ void SwTableShell::Execute(SfxRequest &rReq) ...@@ -983,7 +983,7 @@ void SwTableShell::Execute(SfxRequest &rReq)
{ {
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); 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!"); OSL_ENSURE(pDlg, "dialogdiet pDlg fail!");
if( RET_OK != pDlg->Execute()) if( RET_OK != pDlg->Execute())
bPrev = bNext = sal_False; bPrev = bNext = sal_False;
......
...@@ -19,29 +19,18 @@ ...@@ -19,29 +19,18 @@
#include <swtypes.hxx> #include <swtypes.hxx>
#include <mergetbl.hxx> #include <mergetbl.hxx>
#include <mergetbl.hrc>
#include <table.hrc>
SwMergeTblDlg::SwMergeTblDlg( Window *pParent, sal_Bool& rWithPrev ) SwMergeTblDlg::SwMergeTblDlg( Window *pParent, sal_Bool& rWithPrev )
: SvxStandardDialog(pParent, SW_RES(DLG_MERGE_TABLE)), : SvxStandardDialog(pParent, "MergeTableDialog", "modules/swriter/ui/mergetabledialog.ui")
aOKPB( this, SW_RES(PB_OK )), , m_rMergePrev(rWithPrev)
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 )
{ {
FreeResource(); get(m_pMergePrevRB, "prev");
aMergePrevRB.Check(); m_pMergePrevRB->Check();
} }
void SwMergeTblDlg::Apply() void SwMergeTblDlg::Apply()
{ {
rMergePrev = aMergePrevRB.IsChecked(); m_rMergePrev = m_pMergePrevRB->IsChecked();
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- 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: */
/* -*- 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: */
<?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>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment