summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-08-21 20:52:30 +0100
committerCaolán McNamara <caolanm@redhat.com>2013-08-22 09:35:00 +0100
commit7e2742b00910b981f23c4cfa26d7e025a8dc786a (patch)
treefa4c1479e6abd68b34d37d937d839dcf245d22a3
parente743617eb3189a35026096c51a61ec074da9ad9d (diff)
convert field dialog to .ui
Change-Id: I0f956d365242447f39752d544a020cbc77d6ac4c
-rw-r--r--sfx2/source/dialog/tabdlg.cxx6
-rw-r--r--sw/AllLangResTarget_sw.mk1
-rw-r--r--sw/UIConfig_swriter.mk1
-rw-r--r--sw/inc/fldui.hrc1
-rw-r--r--sw/inc/globals.hrc7
-rw-r--r--sw/inc/helpid.h3
-rw-r--r--sw/inc/swabstdlg.hxx4
-rw-r--r--sw/source/ui/dialog/swdlgfact.cxx22
-rw-r--r--sw/source/ui/dialog/swdlgfact.hxx4
-rw-r--r--sw/source/ui/fldui/flddb.cxx1
-rw-r--r--sw/source/ui/fldui/flddinf.cxx1
-rw-r--r--sw/source/ui/fldui/flddok.cxx1
-rw-r--r--sw/source/ui/fldui/fldfunc.cxx1
-rw-r--r--sw/source/ui/fldui/fldpage.hxx2
-rw-r--r--sw/source/ui/fldui/fldref.cxx1
-rw-r--r--sw/source/ui/fldui/fldtdlg.cxx89
-rw-r--r--sw/source/ui/fldui/fldtdlg.hrc30
-rw-r--r--sw/source/ui/fldui/fldtdlg.src84
-rw-r--r--sw/source/ui/fldui/fldvar.cxx1
-rw-r--r--sw/source/ui/fldui/fldwrap.cxx9
-rw-r--r--sw/source/ui/inc/fldtdlg.hxx13
-rw-r--r--sw/source/ui/inc/fldwrap.hxx2
-rw-r--r--sw/source/ui/shells/textfld.cxx2
-rw-r--r--sw/uiconfig/swriter/ui/fielddialog.ui189
24 files changed, 265 insertions, 210 deletions
diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx
index 3e38dc45063d..87f00557bab2 100644
--- a/sfx2/source/dialog/tabdlg.cxx
+++ b/sfx2/source/dialog/tabdlg.cxx
@@ -564,6 +564,8 @@ void SfxTabDialog::Init_Impl( sal_Bool bFmtFlag, const String* pUserButtonText,
m_pTabCtrl->set_expand(true);
}
+ pImpl = new TabDlg_Impl(m_pTabCtrl->GetPageCount());
+
m_pActionArea = get_action_area();
m_bOwnsActionArea = m_pActionArea == NULL;
if (m_bOwnsActionArea)
@@ -601,14 +603,14 @@ void SfxTabDialog::Init_Impl( sal_Bool bFmtFlag, const String* pUserButtonText,
m_bOwnsResetBtn = m_pResetBtn == NULL;
if (m_bOwnsResetBtn)
m_pResetBtn = new PushButton(m_pActionArea);
+ else
+ pImpl->bHideResetBtn = !m_pResetBtn->IsVisible();
m_pBaseFmtBtn = m_pUIBuilder ? m_pUIBuilder->get<PushButton>("standard") : NULL;
m_bOwnsBaseFmtBtn = m_pBaseFmtBtn == NULL;
if (m_bOwnsBaseFmtBtn)
m_pBaseFmtBtn = new PushButton(m_pActionArea);
- pImpl = new TabDlg_Impl(m_pTabCtrl->GetPageCount());
-
m_pOKBtn->SetClickHdl( LINK( this, SfxTabDialog, OkHdl ) );
m_pCancelBtn->SetClickHdl( LINK( this, SfxTabDialog, CancelHdl ) );
m_pResetBtn->SetClickHdl( LINK( this, SfxTabDialog, ResetHdl ) );
diff --git a/sw/AllLangResTarget_sw.mk b/sw/AllLangResTarget_sw.mk
index d55e114529ec..8760bc5f77a3 100644
--- a/sw/AllLangResTarget_sw.mk
+++ b/sw/AllLangResTarget_sw.mk
@@ -101,7 +101,6 @@ $(eval $(call gb_SrsTarget_add_files,sw/res,\
sw/source/ui/envelp/label.src \
sw/source/ui/envelp/labfmt.src \
sw/source/ui/envelp/mailmrge.src \
- sw/source/ui/fldui/fldtdlg.src \
sw/source/ui/fldui/fldui.src \
sw/source/ui/frmdlg/frmpage.src \
sw/source/ui/frmdlg/frmui.src \
diff --git a/sw/UIConfig_swriter.mk b/sw/UIConfig_swriter.mk
index dbc3b7f8d24b..d3360ca8cd14 100644
--- a/sw/UIConfig_swriter.mk
+++ b/sw/UIConfig_swriter.mk
@@ -91,6 +91,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/swriter,\
sw/uiconfig/swriter/ui/envformatpage \
sw/uiconfig/swriter/ui/envprinterpage \
sw/uiconfig/swriter/ui/exchangedatabases \
+ sw/uiconfig/swriter/ui/fielddialog \
sw/uiconfig/swriter/ui/flddbpage \
sw/uiconfig/swriter/ui/flddocinfopage \
sw/uiconfig/swriter/ui/flddocumentpage \
diff --git a/sw/inc/fldui.hrc b/sw/inc/fldui.hrc
index b5ff6f38877a..39a46378ed4a 100644
--- a/sw/inc/fldui.hrc
+++ b/sw/inc/fldui.hrc
@@ -21,7 +21,6 @@
#include "rcid.hrc"
-#define DLG_FLD_INSERT (RC_FLDDLG_BEGIN + 11)
#define DLG_FLD_DROPDOWN (RC_FLDDLG_BEGIN + 12)
/*--------------------------------------------------------------------
diff --git a/sw/inc/globals.hrc b/sw/inc/globals.hrc
index 967584f44d88..56fec8221dd6 100644
--- a/sw/inc/globals.hrc
+++ b/sw/inc/globals.hrc
@@ -135,13 +135,6 @@
#define TP_NUMBER (RC_GLOBALS_BEGIN + 57)
-#define TP_FLD_DB (RC_GLOBALS_BEGIN + 64)
-#define TP_FLD_DOKINF (RC_GLOBALS_BEGIN + 65)
-#define TP_FLD_VAR (RC_GLOBALS_BEGIN + 66)
-#define TP_FLD_DOK (RC_GLOBALS_BEGIN + 67)
-#define TP_FLD_FUNC (RC_GLOBALS_BEGIN + 68)
-#define TP_FLD_REF (RC_GLOBALS_BEGIN + 69)
-
#define TP_OPTSHDWCRSR (RC_GLOBALS_BEGIN + 70)
diff --git a/sw/inc/helpid.h b/sw/inc/helpid.h
index 431a8c98d1a9..8dccf24cf229 100644
--- a/sw/inc/helpid.h
+++ b/sw/inc/helpid.h
@@ -309,9 +309,6 @@
#define HID_CALC_TOOLBOX "SW_HID_CALC_TOOLBOX"
#define HID_PVIEW_TOOLBOX "SW_HID_PVIEW_TOOLBOX"
-#define HID_FIELD_INSERT "SW_HID_FIELD_INSERT"
-#define HID_FIELD_CLOSE "SW_HID_FIELD_CLOSE"
-
#define HID_COND_COLL_TABLIST "SW_HID_COND_COLL_TABLIST"
#define HID_SELECT_TEMPLATE "SW_HID_SELECT_TEMPLATE"
diff --git a/sw/inc/swabstdlg.hxx b/sw/inc/swabstdlg.hxx
index a66211ae34c1..2fca3cc4faf1 100644
--- a/sw/inc/swabstdlg.hxx
+++ b/sw/inc/swabstdlg.hxx
@@ -272,7 +272,7 @@ public:
virtual void Initialize(SfxChildWinInfo *pInfo) = 0;
virtual void ReInitDlg() = 0;
virtual void ActivateDatabasePage() = 0;
- virtual void ShowPage( sal_uInt16 nId ) = 0;// this method from SfxTabDialog
+ virtual void ShowReferencePage() = 0;
virtual Window * GetWindow() = 0; //this method is added for return a Window type pointer
};
@@ -383,7 +383,7 @@ public:
virtual SfxAbstractTabDialog* CreateSwTableTabDlg(Window* pParent, SfxItemPool& Pool,
const SfxItemSet* pItemSet, SwWrtShell* pSh) = 0; //add for SwTableTabDlg
- virtual AbstractSwFldDlg * CreateSwFldDlg ( SfxBindings* pB, SwChildWinWrapper* pCW, Window *pParent, int nResId ) = 0; //add for SwFldDlg
+ virtual AbstractSwFldDlg * CreateSwFldDlg(SfxBindings* pB, SwChildWinWrapper* pCW, Window *pParent) = 0; //add for SwFldDlg
virtual SfxAbstractDialog* CreateSwFldEditDlg ( SwView& rVw, int nResId ) = 0; //add for SwFldEditDlg
virtual AbstractSwRenameXNamedDlg * CreateSwRenameXNamedDlg(Window* pParent, //add for SwRenameXNamedDlg
::com::sun::star::uno::Reference< ::com::sun::star::container::XNamed > & xNamed,
diff --git a/sw/source/ui/dialog/swdlgfact.cxx b/sw/source/ui/dialog/swdlgfact.cxx
index 4c7093f40af0..d15d8342a87d 100644
--- a/sw/source/ui/dialog/swdlgfact.cxx
+++ b/sw/source/ui/dialog/swdlgfact.cxx
@@ -371,9 +371,9 @@ Window* AbstractSwFldDlg_Impl::GetWindow()
{
return (Window*)pDlg;
}
-void AbstractSwFldDlg_Impl::ShowPage( sal_uInt16 nId )
+void AbstractSwFldDlg_Impl::ShowReferencePage()
{
- pDlg->ShowPage(nId);
+ pDlg->ShowReferencePage();
}
void AbstractSwRenameXNamedDlg_Impl::SetForbiddenChars( const String& rSet )
@@ -876,22 +876,10 @@ SfxAbstractTabDialog* SwAbstractDialogFactory_Impl::CreateSwTableTabDlg(Window*
return new AbstractTabDialog_Impl(pDlg);
}
-AbstractSwFldDlg * SwAbstractDialogFactory_Impl::CreateSwFldDlg ( SfxBindings* pB, SwChildWinWrapper* pCW, Window *pParent, int nResId )
+AbstractSwFldDlg * SwAbstractDialogFactory_Impl::CreateSwFldDlg(SfxBindings* pB, SwChildWinWrapper* pCW, Window *pParent)
{
- SwFldDlg* pDlg=NULL;
- switch ( nResId )
- {
- case DLG_FLD_INSERT :
- pDlg = new SwFldDlg( pB, pCW,pParent);
- break;
-
- default:
- break;
- }
-
- if ( pDlg )
- return new AbstractSwFldDlg_Impl( pDlg );
- return 0;
+ SwFldDlg* pDlg = new SwFldDlg(pB, pCW, pParent);
+ return new AbstractSwFldDlg_Impl(pDlg);
}
SfxAbstractDialog* SwAbstractDialogFactory_Impl::CreateSwFldEditDlg ( SwView& rVw, int nResId )
diff --git a/sw/source/ui/dialog/swdlgfact.hxx b/sw/source/ui/dialog/swdlgfact.hxx
index 6838b5949427..74e01c5cbd9a 100644
--- a/sw/source/ui/dialog/swdlgfact.hxx
+++ b/sw/source/ui/dialog/swdlgfact.hxx
@@ -234,7 +234,7 @@ class AbstractSwFldDlg_Impl : public AbstractSwFldDlg //add for SwFldDlg
virtual void SetText( const OUString& rStr );
virtual OUString GetText() const;
virtual void Start( sal_Bool bShow = sal_True ); //this method from SfxTabDialog
- virtual void ShowPage( sal_uInt16 nId );// this method from SfxTabDialog
+ virtual void ShowReferencePage();
virtual void Initialize(SfxChildWinInfo *pInfo);
virtual void ReInitDlg();
virtual void ActivateDatabasePage();
@@ -482,7 +482,7 @@ public:
virtual VclAbstractDialog * CreateSwTableWidthDlg(Window *pParent, SwTableFUNC &rFnc);
virtual SfxAbstractTabDialog* CreateSwTableTabDlg(Window* pParent, SfxItemPool& Pool,
const SfxItemSet* pItemSet, SwWrtShell* pSh); //add for SwTableTabDlg
- virtual AbstractSwFldDlg * CreateSwFldDlg ( SfxBindings* pB, SwChildWinWrapper* pCW, Window *pParent, int nResId ); //add for SwFldDlg
+ virtual AbstractSwFldDlg * CreateSwFldDlg(SfxBindings* pB, SwChildWinWrapper* pCW, Window *pParent); //add for SwFldDlg
virtual SfxAbstractDialog* CreateSwFldEditDlg ( SwView& rVw, int nResId ); //add for SwFldEditDlg
virtual AbstractSwRenameXNamedDlg * CreateSwRenameXNamedDlg(Window* pParent, //add for SwRenameXNamedDlg
::com::sun::star::uno::Reference< ::com::sun::star::container::XNamed > & xNamed,
diff --git a/sw/source/ui/fldui/flddb.cxx b/sw/source/ui/fldui/flddb.cxx
index 875aa830f028..5fc1e8255ab0 100644
--- a/sw/source/ui/fldui/flddb.cxx
+++ b/sw/source/ui/fldui/flddb.cxx
@@ -25,7 +25,6 @@
#include <fldtdlg.hxx>
#include <numrule.hxx>
-#include <fldtdlg.hrc>
#include <fldui.hrc>
#include <flddb.hxx>
#include <dbconfig.hxx>
diff --git a/sw/source/ui/fldui/flddinf.cxx b/sw/source/ui/fldui/flddinf.cxx
index 3eb33c5c41f3..6536b12975d2 100644
--- a/sw/source/ui/fldui/flddinf.cxx
+++ b/sw/source/ui/fldui/flddinf.cxx
@@ -33,7 +33,6 @@
#include <fldui.hrc>
-#include <fldtdlg.hrc>
#include <flddinf.hxx>
#include <swmodule.hxx>
#include <view.hxx>
diff --git a/sw/source/ui/fldui/flddok.cxx b/sw/source/ui/fldui/flddok.cxx
index 3b39d4aef8c8..3203e24dd37e 100644
--- a/sw/source/ui/fldui/flddok.cxx
+++ b/sw/source/ui/fldui/flddok.cxx
@@ -22,7 +22,6 @@
#include <docufld.hxx>
#include <globals.hrc>
#include <chpfld.hxx>
-#include <fldtdlg.hrc>
#include <fldui.hrc>
#include <flddok.hxx>
#include <swmodule.hxx>
diff --git a/sw/source/ui/fldui/fldfunc.cxx b/sw/source/ui/fldui/fldfunc.cxx
index 455f1df6dfe3..6e9ff038ac88 100644
--- a/sw/source/ui/fldui/fldfunc.cxx
+++ b/sw/source/ui/fldui/fldfunc.cxx
@@ -31,7 +31,6 @@
#include <fldfunc.hxx>
#include <flddropdown.hxx>
#include <fldui.hrc>
-#include <fldtdlg.hrc>
#define USER_DATA_VERSION_1 "1"
#define USER_DATA_VERSION USER_DATA_VERSION_1
diff --git a/sw/source/ui/fldui/fldpage.hxx b/sw/source/ui/fldui/fldpage.hxx
index 40aa937c6d8f..83c86bd3e232 100644
--- a/sw/source/ui/fldui/fldpage.hxx
+++ b/sw/source/ui/fldui/fldpage.hxx
@@ -22,6 +22,8 @@
#include <sfx2/tabdlg.hxx>
#include <fldmgr.hxx>
+#define FIELD_COLUMN_WIDTH 76
+
class ListBox;
const int coLBCount = 3;
diff --git a/sw/source/ui/fldui/fldref.cxx b/sw/source/ui/fldui/fldref.cxx
index 8ed6ae3cd549..7fcabfa456f5 100644
--- a/sw/source/ui/fldui/fldref.cxx
+++ b/sw/source/ui/fldui/fldref.cxx
@@ -27,7 +27,6 @@
#include <wrtsh.hxx>
#include <fldui.hrc>
-#include <fldtdlg.hrc>
#include <globals.hrc>
// #i83479#
#include <SwNodeNum.hxx>
diff --git a/sw/source/ui/fldui/fldtdlg.cxx b/sw/source/ui/fldui/fldtdlg.cxx
index 176a91b51b05..47d8e95848de 100644
--- a/sw/source/ui/fldui/fldtdlg.cxx
+++ b/sw/source/ui/fldui/fldtdlg.cxx
@@ -42,7 +42,6 @@
#include <helpid.h>
#include <fldui.hrc>
#include <globals.hrc>
-#include <fldtdlg.hrc>
#include <com/sun/star/document/XDocumentProperties.hpp>
#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
@@ -54,37 +53,32 @@
SwFldDlg::SwFldDlg(SfxBindings* pB, SwChildWinWrapper* pCW, Window *pParent)
- : SfxTabDialog( pParent, SW_RES( DLG_FLD_INSERT )),
- m_pChildWin(pCW),
- m_pBindings(pB),
- m_bDataBaseMode(sal_False)
+ : SfxTabDialog(pParent, "FieldDialog", "modules/swriter/ui/fielddialog.ui")
+ , m_pChildWin(pCW)
+ , m_pBindings(pB)
+ , m_bDataBaseMode(false)
+ , m_nDokId(0)
+ , m_nVarId(0)
+ , m_nDokInf(0)
+ , m_nRefId(0)
+ , m_nFuncId(0)
+ , m_nDbId(0)
{
SetStyle(GetStyle()|WB_STDMODELESS);
m_bHtmlMode = (::GetHtmlMode((SwDocShell*)SfxObjectShell::Current()) & HTMLMODE_ON) != 0;
- RemoveResetButton();
-
- GetOKButton().SetText(String(SW_RES(STR_FLD_INSERT)));
- GetOKButton().SetHelpId(HID_FIELD_INSERT);
- GetOKButton().SetHelpText(aEmptyStr); // so that generated help text is used
-
- GetCancelButton().SetText(String(SW_RES(STR_FLD_CLOSE)));
- GetCancelButton().SetHelpId(HID_FIELD_CLOSE);
- GetCancelButton().SetHelpText(aEmptyStr); // so that generated help text is used
GetCancelButton().SetClickHdl(LINK(this, SwFldDlg, CancelHdl));
- FreeResource();
-
GetOKButton().SetClickHdl(LINK(this, SwFldDlg, OKHdl));
- AddTabPage(TP_FLD_DOK, SwFldDokPage::Create, 0);
- AddTabPage(TP_FLD_VAR, SwFldVarPage::Create, 0);
- AddTabPage(TP_FLD_DOKINF, SwFldDokInfPage::Create, 0);
+ m_nDokId = AddTabPage("document", SwFldDokPage::Create, 0);
+ m_nVarId = AddTabPage("variables", SwFldVarPage::Create, 0);
+ m_nDokInf = AddTabPage("docinfo", SwFldDokInfPage::Create, 0);
if (!m_bHtmlMode)
{
- AddTabPage(TP_FLD_REF, SwFldRefPage::Create, 0);
- AddTabPage(TP_FLD_FUNC, SwFldFuncPage::Create, 0);
+ m_nRefId = AddTabPage("ref", SwFldRefPage::Create, 0);
+ m_nFuncId = AddTabPage("functions", SwFldFuncPage::Create, 0);
utl::OConfigurationTreeRoot aCfgRoot
= utl::OConfigurationTreeRoot::createWithComponentContext(
@@ -99,15 +93,15 @@ SwFldDlg::SwFldDlg(SfxBindings* pB, SwChildWinWrapper* pCW, Window *pParent)
OUString("DatabaseFields")) >>= bDatabaseFields;
if (bDatabaseFields)
- AddTabPage(TP_FLD_DB, SwFldDBPage::Create, 0);
+ m_nDbId = AddTabPage("database", SwFldDBPage::Create, 0);
else
- RemoveTabPage(TP_FLD_DB);
+ RemoveTabPage("database");
}
else
{
- RemoveTabPage(TP_FLD_REF);
- RemoveTabPage(TP_FLD_FUNC);
- RemoveTabPage(TP_FLD_DB);
+ RemoveTabPage("ref");
+ RemoveTabPage("functions");
+ RemoveTabPage("database");
}
}
@@ -120,7 +114,7 @@ sal_Bool SwFldDlg::Close()
m_pBindings->GetDispatcher()->
Execute(m_bDataBaseMode ? FN_INSERT_FIELD_DATA_ONLY : FN_INSERT_FIELD,
SFX_CALLMODE_ASYNCHRON|SFX_CALLMODE_RECORD);
- return sal_True;
+ return true;
}
void SwFldDlg::Initialize(SfxChildWinInfo *pInfo)
@@ -171,7 +165,7 @@ void SwFldDlg::Initialize(SfxChildWinInfo *pInfo)
SfxItemSet* SwFldDlg::CreateInputItemSet( sal_uInt16 nID )
{
- if ( nID == TP_FLD_DOKINF )
+ if ( nID == m_nDokInf )
{
SwDocShell* pDocSh = (SwDocShell*)SfxObjectShell::Current();
SfxItemSet* pISet = new SfxItemSet( pDocSh->GetPool(), SID_DOCINFO, SID_DOCINFO );
@@ -237,15 +231,15 @@ void SwFldDlg::ReInitDlg()
GetOKButton().Enable( !rSh.IsReadOnlyAvailable() ||
!rSh.HasReadonlySel() );
- ReInitTabPage(TP_FLD_DOK);
- ReInitTabPage(TP_FLD_VAR);
- ReInitTabPage(TP_FLD_DOKINF);
+ ReInitTabPage(m_nDokId);
+ ReInitTabPage(m_nVarId);
+ ReInitTabPage(m_nDokInf);
if (!m_bHtmlMode)
{
- ReInitTabPage(TP_FLD_REF);
- ReInitTabPage(TP_FLD_FUNC);
- ReInitTabPage(TP_FLD_DB);
+ ReInitTabPage(m_nRefId);
+ ReInitTabPage(m_nFuncId);
+ ReInitTabPage(m_nDbId);
}
m_pChildWin->SetOldDocShell(pDocSh);
@@ -277,12 +271,12 @@ void SwFldDlg::Activate()
GetOKButton().Enable( !rSh.IsReadOnlyAvailable() ||
!rSh.HasReadonlySel() );
- ReInitTabPage( TP_FLD_VAR, sal_True );
+ ReInitTabPage(m_nVarId, true);
if( !bHtmlMode )
{
- ReInitTabPage( TP_FLD_REF, sal_True );
- ReInitTabPage( TP_FLD_FUNC, sal_True );
+ ReInitTabPage(m_nRefId, true);
+ ReInitTabPage(m_nFuncId, true);
}
}
}
@@ -309,23 +303,28 @@ void SwFldDlg::InsertHdl()
void SwFldDlg::ActivateDatabasePage()
{
m_bDataBaseMode = sal_True;
- ShowPage( TP_FLD_DB );
- SfxTabPage* pDBPage = GetTabPage( TP_FLD_DB );
+ ShowPage(m_nDbId);
+ SfxTabPage* pDBPage = GetTabPage(m_nDbId);
if( pDBPage )
{
((SwFldDBPage*)pDBPage)->ActivateMailMergeAddress();
}
//remove all other pages
- RemoveTabPage(TP_FLD_DOK);
- RemoveTabPage(TP_FLD_VAR);
- RemoveTabPage(TP_FLD_DOKINF);
- RemoveTabPage(TP_FLD_REF);
- RemoveTabPage(TP_FLD_FUNC);
+ RemoveTabPage("document");
+ RemoveTabPage("variables");
+ RemoveTabPage("docinfo");
+ RemoveTabPage("ref");
+ RemoveTabPage("functions");
+}
+
+void SwFldDlg::ShowReferencePage()
+{
+ ShowPage(m_nRefId);
}
void SwFldDlg::PageCreated(sal_uInt16 nId, SfxTabPage& rPage)
{
- if( TP_FLD_DB == nId)
+ if (nId == m_nDbId)
{
SfxDispatcher* pDispatch = m_pBindings->GetDispatcher();
SfxViewFrame* pViewFrame = pDispatch ? pDispatch->GetFrame() : 0;
diff --git a/sw/source/ui/fldui/fldtdlg.hrc b/sw/source/ui/fldui/fldtdlg.hrc
deleted file mode 100644
index aaf843dd21f7..000000000000
--- a/sw/source/ui/fldui/fldtdlg.hrc
+++ /dev/null
@@ -1,30 +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 .
- */
-
-#ifndef _FLDTDLG_HRC
-#define _FLDTDLG_HRC
-
-#define FIELD_COLUMN_WIDTH 76
-
-#define STR_FLD_INSERT 1
-#define STR_FLD_CLOSE 2
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/fldui/fldtdlg.src b/sw/source/ui/fldui/fldtdlg.src
deleted file mode 100644
index a5a28b96421d..000000000000
--- a/sw/source/ui/fldui/fldtdlg.src
+++ /dev/null
@@ -1,84 +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 "globals.hrc"
-#include "fldui.hrc"
-#include "fldtdlg.hrc"
-#include "helpid.h"
-TabDialog DLG_FLD_INSERT
-{
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Moveable = TRUE ;
- Closeable = TRUE ;
- TabControl 1
- {
- OutputSize = TRUE ;
- PageList =
- {
- PageItem
- {
- Identifier = TP_FLD_DOK ;
- PageResID = TP_FLD_DOK ;
- Text [ en-US ] = "Document" ;
- };
- PageItem
- {
- Identifier = TP_FLD_REF ;
- PageResID = TP_FLD_REF ;
- Text [ en-US ] = "Cross-references" ;
- };
- PageItem
- {
- Identifier = TP_FLD_FUNC ;
- PageResID = TP_FLD_FUNC ;
- Text [ en-US ] = "Functions" ;
- };
- PageItem
- {
- Identifier = TP_FLD_DOKINF ;
- PageResID = TP_FLD_DOKINF ;
- Text [ en-US ] = "DocInformation" ;
- };
- PageItem
- {
- Identifier = TP_FLD_VAR ;
- PageResID = TP_FLD_VAR ;
- Text [ en-US ] = "Variables" ;
- };
- PageItem
- {
- Identifier = TP_FLD_DB ;
- PageResID = TP_FLD_DB ;
- Text [ en-US ] = "Database" ;
- };
- };
- };
- String STR_FLD_INSERT
- {
- Text [ en-US ] = "~Insert" ;
- };
- String STR_FLD_CLOSE
- {
- Text [ en-US ] = "~Close" ;
- };
- Text [ en-US ] = "Fields" ;
-};
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/fldui/fldvar.cxx b/sw/source/ui/fldui/fldvar.cxx
index 89da12ebf3a1..df43475b0ab3 100644
--- a/sw/source/ui/fldui/fldvar.cxx
+++ b/sw/source/ui/fldui/fldvar.cxx
@@ -33,7 +33,6 @@
#include <svl/zformat.hxx>
#include <globals.hrc>
#include <fldui.hrc>
-#include <fldtdlg.hrc>
#define USER_DATA_VERSION_1 "1"
#define USER_DATA_VERSION USER_DATA_VERSION_1
diff --git a/sw/source/ui/fldui/fldwrap.cxx b/sw/source/ui/fldui/fldwrap.cxx
index c1c5f77aa6a8..955978d7b8b8 100644
--- a/sw/source/ui/fldui/fldwrap.cxx
+++ b/sw/source/ui/fldui/fldwrap.cxx
@@ -33,7 +33,6 @@
#include <helpid.h>
#include <fldui.hrc>
#include <globals.hrc>
-#include <fldtdlg.hrc>
#include "swabstdlg.hxx"
SFX_IMPL_CHILDWINDOW_WITHID(SwFldDlgWrapper, FN_INSERT_FIELD)
@@ -87,7 +86,7 @@ SwFldDlgWrapper::SwFldDlgWrapper( Window* _pParent, sal_uInt16 nId,
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
- AbstractSwFldDlg* pDlg = pFact->CreateSwFldDlg(pB, this, _pParent, DLG_FLD_INSERT );
+ AbstractSwFldDlg* pDlg = pFact->CreateSwFldDlg(pB, this, _pParent);
OSL_ENSURE(pDlg, "Dialogdiet fail!");
pDlgInterface = pDlg;
pWindow = pDlg->GetWindow();
@@ -110,9 +109,9 @@ sal_Bool SwFldDlgWrapper::ReInitDlg(SwDocShell *pDocSh)
return bRet;
}
-void SwFldDlgWrapper::ShowPage(sal_uInt16 nPage)
+void SwFldDlgWrapper::ShowReferencePage()
{
- pDlgInterface->ShowPage(nPage ? nPage : TP_FLD_REF);
+ pDlgInterface->ShowReferencePage();
}
SFX_IMPL_CHILDWINDOW(SwFldDataOnlyDlgWrapper, FN_INSERT_FIELD_DATA_ONLY)
@@ -134,7 +133,7 @@ SwFldDataOnlyDlgWrapper::SwFldDataOnlyDlgWrapper( Window* _pParent, sal_uInt16 n
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
- AbstractSwFldDlg* pDlg = pFact->CreateSwFldDlg(pB, this, _pParent, DLG_FLD_INSERT );
+ AbstractSwFldDlg* pDlg = pFact->CreateSwFldDlg(pB, this, _pParent);
OSL_ENSURE(pDlg, "Dialogdiet fail!");
pDlgInterface = pDlg;
diff --git a/sw/source/ui/inc/fldtdlg.hxx b/sw/source/ui/inc/fldtdlg.hxx
index 7e71ab3f10c9..120d17965a87 100644
--- a/sw/source/ui/inc/fldtdlg.hxx
+++ b/sw/source/ui/inc/fldtdlg.hxx
@@ -29,10 +29,16 @@ class SwFldDlg: public SfxTabDialog
{
SwChildWinWrapper* m_pChildWin;
SfxBindings* m_pBindings;
- sal_Bool m_bHtmlMode;
- sal_Bool m_bDataBaseMode;
+ sal_Bool m_bHtmlMode;
+ sal_Bool m_bDataBaseMode;
+ sal_uInt16 m_nDokId;
+ sal_uInt16 m_nVarId;
+ sal_uInt16 m_nDokInf;
+ sal_uInt16 m_nRefId;
+ sal_uInt16 m_nFuncId;
+ sal_uInt16 m_nDbId;
- virtual sal_Bool Close();
+ virtual sal_Bool Close();
virtual SfxItemSet* CreateInputItemSet( sal_uInt16 nId );
virtual void Activate();
virtual void PageCreated(sal_uInt16 nId, SfxTabPage& rPage);
@@ -52,6 +58,7 @@ public:
void EnableInsert(sal_Bool bEnable);
void InsertHdl();
void ActivateDatabasePage();
+ void ShowReferencePage();
};
#endif
diff --git a/sw/source/ui/inc/fldwrap.hxx b/sw/source/ui/inc/fldwrap.hxx
index 30676b020c3e..7dfa101b74f7 100644
--- a/sw/source/ui/inc/fldwrap.hxx
+++ b/sw/source/ui/inc/fldwrap.hxx
@@ -32,7 +32,7 @@ public:
SFX_DECL_CHILDWINDOW_WITHID(SwFldDlgWrapper);
virtual sal_Bool ReInitDlg(SwDocShell *pDocSh);
- void ShowPage(sal_uInt16 nPage = 0);
+ void ShowReferencePage();
};
/* --------------------------------------------------
diff --git a/sw/source/ui/shells/textfld.cxx b/sw/source/ui/shells/textfld.cxx
index 1d5cd633fb32..e82298441346 100644
--- a/sw/source/ui/shells/textfld.cxx
+++ b/sw/source/ui/shells/textfld.cxx
@@ -290,7 +290,7 @@ void SwTextShell::ExecField(SfxRequest &rReq)
sal_uInt16 nId = SwFldDlgWrapper::GetChildWindowId();
SwFldDlgWrapper *pWrp = (SwFldDlgWrapper*)pVFrame->GetChildWindow(nId);
if (pWrp)
- pWrp->ShowPage();
+ pWrp->ShowReferencePage();
rReq.Ignore();
}
break;
diff --git a/sw/uiconfig/swriter/ui/fielddialog.ui b/sw/uiconfig/swriter/ui/fielddialog.ui
new file mode 100644
index 000000000000..59af5b7444c3
--- /dev/null
+++ b/sw/uiconfig/swriter/ui/fielddialog.ui
@@ -0,0 +1,189 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <!-- interface-requires gtk+ 3.0 -->
+ <object class="GtkDialog" id="FieldDialog">
+ <property name="can_focus">False</property>
+ <property name="border_width">6</property>
+ <property name="title" translatable="yes">Fields</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">_Insert</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_underline">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-close</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>
+ <child>
+ <object class="GtkButton" id="reset">
+ <property name="label">gtk-revert-to-saved</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="no_show_all">True</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">3</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="GtkNotebook" id="tabcontrol">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <child>
+ <placeholder/>
+ </child>
+ <child type="tab">
+ <object class="GtkLabel" id="document">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Document</property>
+ </object>
+ <packing>
+ <property name="tab_fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child type="tab">
+ <object class="GtkLabel" id="ref">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Cross-references</property>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ <property name="tab_fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child type="tab">
+ <object class="GtkLabel" id="functions">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Functions</property>
+ </object>
+ <packing>
+ <property name="position">2</property>
+ <property name="tab_fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child type="tab">
+ <object class="GtkLabel" id="docinfo">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">DocInformation</property>
+ </object>
+ <packing>
+ <property name="position">3</property>
+ <property name="tab_fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child type="tab">
+ <object class="GtkLabel" id="variables">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Variables</property>
+ </object>
+ <packing>
+ <property name="position">4</property>
+ <property name="tab_fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child type="tab">
+ <object class="GtkLabel" id="database">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Database</property>
+ </object>
+ <packing>
+ <property name="position">5</property>
+ <property name="tab_fill">False</property>
+ </packing>
+ </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-widget response="0">reset</action-widget>
+ </action-widgets>
+ </object>
+</interface>