summaryrefslogtreecommitdiff
path: root/sw/source/ui
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-09-03 08:45:49 +0100
committerCaolán McNamara <caolanm@redhat.com>2013-09-03 09:04:50 +0100
commit58fe754c70b64ee5152197b24c3e0cf92d4122ed (patch)
treebd40b9cb89618f2f735af55b05fd21088c6242ea /sw/source/ui
parent8b90ad8af9d72937109ded62609731033558dd84 (diff)
convert select index dialog to .ui
Change-Id: I49a3d67e9c22c1608354b732f8aee27afcf15885
Diffstat (limited to 'sw/source/ui')
-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/multmrk.hxx13
-rw-r--r--sw/source/ui/index/multmrk.cxx37
-rw-r--r--sw/source/ui/index/multmrk.hrc27
-rw-r--r--sw/source/ui/index/multmrk.src82
-rw-r--r--sw/source/ui/shells/textidx.cxx3
7 files changed, 24 insertions, 158 deletions
diff --git a/sw/source/ui/dialog/swdlgfact.cxx b/sw/source/ui/dialog/swdlgfact.cxx
index e07cc8b483c2..cd2d333f2931 100644
--- a/sw/source/ui/dialog/swdlgfact.cxx
+++ b/sw/source/ui/dialog/swdlgfact.cxx
@@ -1023,21 +1023,10 @@ AbstractMailMergeFieldConnectionsDlg * SwAbstractDialogFactory_Impl::CreateMailM
return new AbstractMailMergeFieldConnectionsDlg_Impl( pDlg );
}
-VclAbstractDialog * SwAbstractDialogFactory_Impl::CreateMultiTOXMarkDlg( int nResId,
- Window* pParent, SwTOXMgr &rTOXMgr )
+VclAbstractDialog * SwAbstractDialogFactory_Impl::CreateMultiTOXMarkDlg(Window* pParent, SwTOXMgr &rTOXMgr)
{
- Dialog* pDlg=NULL;
- switch ( nResId )
- {
- case DLG_MULTMRK :
- pDlg = new SwMultiTOXMarkDlg( pParent, rTOXMgr );
- break;
- default:
- break;
- }
- if ( pDlg )
- return new VclAbstractDialog_Impl( pDlg );
- return 0;
+ Dialog* pDlg = new SwMultiTOXMarkDlg(pParent, rTOXMgr);
+ return new VclAbstractDialog_Impl(pDlg);
}
SfxAbstractTabDialog* SwAbstractDialogFactory_Impl::CreateSwTabDialog( int nResId,
diff --git a/sw/source/ui/dialog/swdlgfact.hxx b/sw/source/ui/dialog/swdlgfact.hxx
index 77aa49c5c2f9..a0b113c20ca9 100644
--- a/sw/source/ui/dialog/swdlgfact.hxx
+++ b/sw/source/ui/dialog/swdlgfact.hxx
@@ -469,8 +469,7 @@ public:
::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >* pSelection = 0 );
virtual AbstractMailMergeCreateFromDlg* CreateMailMergeCreateFromDlg(Window* pParent);
virtual AbstractMailMergeFieldConnectionsDlg* CreateMailMergeFieldConnectionsDlg(Window* pParent);
- virtual VclAbstractDialog* CreateMultiTOXMarkDlg( int nResId,
- Window* pParent, SwTOXMgr &rTOXMgr );
+ virtual VclAbstractDialog* CreateMultiTOXMarkDlg(Window* pParent, SwTOXMgr &rTOXMgr);
virtual SfxAbstractTabDialog* CreateSwTabDialog( int nResId,
Window* pParent,
const SfxItemSet* pSwItemSet,
diff --git a/sw/source/ui/inc/multmrk.hxx b/sw/source/ui/inc/multmrk.hxx
index 13e5ab98609e..e30292d60f92 100644
--- a/sw/source/ui/inc/multmrk.hxx
+++ b/sw/source/ui/inc/multmrk.hxx
@@ -37,15 +37,10 @@ class SwMultiTOXMarkDlg : public SvxStandardDialog
{
DECL_LINK( SelectHdl, ListBox * );
- FixedLine aTOXFL;
- FixedText aEntryFT;
- FixedInfo aTextFT;
- FixedText aTOXFT;
- ListBox aTOXLB;
- OKButton aOkBT;
- CancelButton aCancelBT;
-
- SwTOXMgr &rMgr;
+ FixedText* m_pTextFT;
+ ListBox* m_pTOXLB;
+
+ SwTOXMgr& rMgr;
sal_uInt16 nPos;
void Apply();
diff --git a/sw/source/ui/index/multmrk.cxx b/sw/source/ui/index/multmrk.cxx
index f5a30c558753..6959487a008f 100644
--- a/sw/source/ui/index/multmrk.cxx
+++ b/sw/source/ui/index/multmrk.cxx
@@ -23,41 +23,34 @@
#include "toxmgr.hxx"
#include "index.hrc"
-#include "multmrk.hrc"
-SwMultiTOXMarkDlg::SwMultiTOXMarkDlg( Window* pParent, SwTOXMgr& rTOXMgr ) :
-
- SvxStandardDialog(pParent, SW_RES(DLG_MULTMRK)),
-
- aTOXFL(this, SW_RES(FL_TOX)),
- aEntryFT(this, SW_RES(FT_ENTRY)),
- aTextFT(this, SW_RES(FT_TEXT)),
- aTOXFT(this, SW_RES(FT_TOX)),
- aTOXLB(this, SW_RES(LB_TOX)),
- aOkBT(this, SW_RES(OK_BT)),
- aCancelBT(this, SW_RES(CANCEL_BT)),
- rMgr( rTOXMgr ),
- nPos(0)
+SwMultiTOXMarkDlg::SwMultiTOXMarkDlg(Window* pParent, SwTOXMgr& rTOXMgr)
+ : SvxStandardDialog(pParent, "SelectIndexDialog",
+ "modules/swriter/ui/selectindexdialog.ui")
+ , rMgr(rTOXMgr)
+ , nPos(0)
{
- aTOXLB.SetSelectHdl(LINK(this, SwMultiTOXMarkDlg, SelectHdl));
+ get(m_pTextFT, "type");
+ get(m_pTOXLB, "treeview");
+ m_pTOXLB->set_height_request(m_pTOXLB->GetTextHeight() * 10);
+ m_pTOXLB->set_width_request(m_pTOXLB->approximate_char_width() * 25);
+
+ m_pTOXLB->SetSelectHdl(LINK(this, SwMultiTOXMarkDlg, SelectHdl));
sal_uInt16 nSize = rMgr.GetTOXMarkCount();
for(sal_uInt16 i=0; i < nSize; ++i)
- aTOXLB.InsertEntry(rMgr.GetTOXMark(i)->GetText());
+ m_pTOXLB->InsertEntry(rMgr.GetTOXMark(i)->GetText());
- aTOXLB.SelectEntryPos(0);
- aTextFT.SetText(rMgr.GetTOXMark(0)->GetTOXType()->GetTypeName());
-
- FreeResource();
+ m_pTOXLB->SelectEntryPos(0);
+ m_pTextFT->SetText(rMgr.GetTOXMark(0)->GetTOXType()->GetTypeName());
}
-
IMPL_LINK_INLINE_START( SwMultiTOXMarkDlg, SelectHdl, ListBox *, pBox )
{
if(pBox->GetSelectEntryPos() != LISTBOX_ENTRY_NOTFOUND)
{ SwTOXMark* pMark = rMgr.GetTOXMark(pBox->GetSelectEntryPos());
- aTextFT.SetText(pMark->GetTOXType()->GetTypeName());
+ m_pTextFT->SetText(pMark->GetTOXType()->GetTypeName());
nPos = pBox->GetSelectEntryPos();
}
return 0;
diff --git a/sw/source/ui/index/multmrk.hrc b/sw/source/ui/index/multmrk.hrc
deleted file mode 100644
index 949f850dd299..000000000000
--- a/sw/source/ui/index/multmrk.hrc
+++ /dev/null
@@ -1,27 +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 FT_ENTRY 1
-#define FT_TOX 2
-#define OK_BT 3
-#define LB_TOX 4
-#define FT_TEXT 5
-#define FL_TOX 6
-#define CANCEL_BT 7
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/index/multmrk.src b/sw/source/ui/index/multmrk.src
deleted file mode 100644
index d79e9426dd2d..000000000000
--- a/sw/source/ui/index/multmrk.src
+++ /dev/null
@@ -1,82 +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 "index.hrc"
-#include "multmrk.hrc"
-#include "cmdid.h"
-#include "helpid.h"
-ModalDialog DLG_MULTMRK
-{
- HelpID = CMD_FN_EDIT_IDX_ENTRY_DLG ;
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 220 , 95 ) ;
- Text [ en-US ] = "Index Markings" ;
- Moveable = TRUE ;
- FixedLine FL_TOX
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 153 , 8 ) ;
- Text [ en-US ] = "Selection" ;
- };
- FixedText FT_ENTRY
- {
- Pos = MAP_APPFONT ( 12 , 14 ) ;
- Size = MAP_APPFONT ( 41 , 8 ) ;
- Text [ en-US ] = "Index" ;
- Left = TRUE ;
- };
- FixedText FT_TEXT
- {
- Pos = MAP_APPFONT ( 53 , 14 ) ;
- Size = MAP_APPFONT ( 100 , 8 ) ;
- Left = TRUE ;
- };
- FixedText FT_TOX
- {
- Pos = MAP_APPFONT ( 12 , 26 ) ;
- Size = MAP_APPFONT ( 41 , 8 ) ;
- Text [ en-US ] = "Entry" ;
- Left = TRUE ;
- };
- ListBox LB_TOX
- {
- HelpID = "sw:ListBox:DLG_MULTMRK:LB_TOX";
- Border = TRUE ;
- Pos = MAP_APPFONT ( 12 , 37 ) ;
- Size = MAP_APPFONT ( 100 , 49 ) ;
- TabStop = TRUE ;
- AutoHScroll = TRUE ;
- };
- OKButton OK_BT
- {
- Pos = MAP_APPFONT ( 165 , 6 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- DefButton = TRUE ;
- };
- CancelButton CANCEL_BT
- {
- Pos = MAP_APPFONT ( 165 , 23 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
-};
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/shells/textidx.cxx b/sw/source/ui/shells/textidx.cxx
index 8c7af10769ee..4ceb302e907f 100644
--- a/sw/source/ui/shells/textidx.cxx
+++ b/sw/source/ui/shells/textidx.cxx
@@ -85,8 +85,7 @@ void SwTextShell::ExecIdx(SfxRequest &rReq)
{ // Several marks, which should it be?
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "Dialogdiet fail!");
- VclAbstractDialog* pMultDlg = pFact->CreateMultiTOXMarkDlg( DLG_MULTMRK,
- pMDI, aMgr);
+ VclAbstractDialog* pMultDlg = pFact->CreateMultiTOXMarkDlg(pMDI, aMgr);
OSL_ENSURE(pMultDlg, "Dialogdiet fail!");
nRet = pMultDlg->Execute();
delete pMultDlg;