summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-04-26 15:09:00 +0100
committerCaolán McNamara <caolanm@redhat.com>2013-04-26 15:16:30 +0100
commit19e664a7be70616882ffdc8f261dff1f6c3984e6 (patch)
tree695cd479ce2a70c2958f3839b8c99b44ed027265
parent470b5a94b866218237e04165d577728b4a4f9e42 (diff)
convert numbering name dialog to .ui
Change-Id: I5992855dfda8d08913ab2b238f44af059c67ff73
-rw-r--r--sw/AllLangResTarget_sw.mk1
-rw-r--r--sw/inc/helpid.h1
-rw-r--r--sw/source/ui/misc/outline.cxx55
-rw-r--r--sw/source/ui/misc/outline.hrc47
-rw-r--r--sw/source/ui/misc/outline.src90
-rw-r--r--sw/uiconfig/swriter/ui/numberingnamedialog.ui36
6 files changed, 59 insertions, 171 deletions
diff --git a/sw/AllLangResTarget_sw.mk b/sw/AllLangResTarget_sw.mk
index 922d85b36fb1..451a743780f9 100644
--- a/sw/AllLangResTarget_sw.mk
+++ b/sw/AllLangResTarget_sw.mk
@@ -130,7 +130,6 @@ $(eval $(call gb_SrsTarget_add_files,sw/res,\
sw/source/ui/misc/docfnote.src \
sw/source/ui/misc/glossary.src \
sw/source/ui/misc/numberingtypelistbox.src \
- sw/source/ui/misc/outline.src \
sw/source/ui/misc/redlndlg.src \
sw/source/ui/misc/srtdlg.src \
sw/source/ui/misc/swruler.src \
diff --git a/sw/inc/helpid.h b/sw/inc/helpid.h
index 92784ba51dd5..ab344ca83171 100644
--- a/sw/inc/helpid.h
+++ b/sw/inc/helpid.h
@@ -25,7 +25,6 @@
#define HID_DOCINFO_EDT "SW_HID_DOCINFO_EDT"
#define HID_PASSWD "SW_HID_PASSWD"
#define HID_CONFIG_SAVE "SW_HID_CONFIG_SAVE"
-#define HID_NUM_NAMES "SW_HID_NUM_NAMES"
#define HID_FORMEDT_CONTENT "SW_HID_FORMEDT_CONTENT"
#define HID_FORMEDT_USER "SW_HID_FORMEDT_USER"
diff --git a/sw/source/ui/misc/outline.cxx b/sw/source/ui/misc/outline.cxx
index c2b5a9f65a81..f80d0b99721c 100644
--- a/sw/source/ui/misc/outline.cxx
+++ b/sw/source/ui/misc/outline.cxx
@@ -44,7 +44,6 @@
#include <helpid.h>
#include <globals.hrc> // for template name 'none'
#include <misc.hrc>
-#include <outline.hrc>
#include <paratr.hxx>
#include <unomid.h>
@@ -58,14 +57,11 @@ using namespace ::com::sun::star;
DBG_NAME(outlinehdl)
-class SwNumNamesDlg: public ModalDialog
+class SwNumNamesDlg : public ModalDialog
{
- FixedLine aFormFL;
- Edit aFormEdit;
- ListBox aFormBox;
- OKButton aOKBtn;
- CancelButton aCancelBtn;
- HelpButton aHelpBtn;
+ Edit* m_pFormEdit;
+ ListBox* m_pFormBox;
+ OKButton* m_pOKBtn;
DECL_LINK( ModifyHdl, Edit * );
DECL_LINK( SelectHdl, ListBox * );
@@ -73,10 +69,9 @@ class SwNumNamesDlg: public ModalDialog
public:
SwNumNamesDlg(Window *pParent);
- ~SwNumNamesDlg();
void SetUserNames(const String *pList[]);
- String GetName() const { return aFormEdit.GetText(); }
- sal_uInt16 GetCurEntryPos() const { return aFormBox.GetSelectEntryPos(); }
+ String GetName() const { return m_pFormEdit->GetText(); }
+ sal_uInt16 GetCurEntryPos() const { return m_pFormBox->GetSelectEntryPos(); }
};
/*------------------------------------------------------------------------
@@ -84,8 +79,8 @@ public:
------------------------------------------------------------------------*/
IMPL_LINK_INLINE_START( SwNumNamesDlg, SelectHdl, ListBox *, pBox )
{
- aFormEdit.SetText(pBox->GetSelectEntry());
- aFormEdit.SetSelection(Selection(0, SELECTION_MAX));
+ m_pFormEdit->SetText(pBox->GetSelectEntry());
+ m_pFormEdit->SetSelection(Selection(0, SELECTION_MAX));
return 0;
}
IMPL_LINK_INLINE_END( SwNumNamesDlg, SelectHdl, ListBox *, pBox )
@@ -102,14 +97,14 @@ void SwNumNamesDlg::SetUserNames(const String *pList[])
{
if(pList[i])
{
- aFormBox.RemoveEntry(i);
- aFormBox.InsertEntry(*pList[i], i);
+ m_pFormBox->RemoveEntry(i);
+ m_pFormBox->InsertEntry(*pList[i], i);
if(i == nSelect && nSelect < SwBaseNumRules::nMaxRules)
nSelect++;
}
}
- aFormBox.SelectEntryPos(nSelect);
- SelectHdl(&aFormBox);
+ m_pFormBox->SelectEntryPos(nSelect);
+ SelectHdl(m_pFormBox);
}
/*------------------------------------------------------------------------
@@ -117,7 +112,7 @@ void SwNumNamesDlg::SetUserNames(const String *pList[])
------------------------------------------------------------------------*/
IMPL_LINK_INLINE_START( SwNumNamesDlg, ModifyHdl, Edit *, pBox )
{
- aOKBtn.Enable(!pBox->GetText().isEmpty());
+ m_pOKBtn->Enable(!pBox->GetText().isEmpty());
return 0;
}
IMPL_LINK_INLINE_END( SwNumNamesDlg, ModifyHdl, Edit *, pBox )
@@ -133,23 +128,19 @@ IMPL_LINK_NOARG_INLINE_START(SwNumNamesDlg, DoubleClickHdl)
IMPL_LINK_NOARG_INLINE_END(SwNumNamesDlg, DoubleClickHdl)
SwNumNamesDlg::SwNumNamesDlg(Window *pParent)
- : ModalDialog(pParent, SW_RES(DLG_NUM_NAMES)),
- aFormFL(this, SW_RES(FL_FORM)),
- aFormEdit(this, SW_RES(ED_FORM)),
- aFormBox(this, SW_RES(LB_FORM)),
- aOKBtn(this, SW_RES(BT_OK)),
- aCancelBtn(this, SW_RES(BT_CANCEL)),
- aHelpBtn(this, SW_RES(BT_HELP))
+ : ModalDialog(pParent, "NumberingNameDialog",
+ "modules/swriter/ui/numberingnamedialog.ui")
{
- FreeResource();
- aFormEdit.SetModifyHdl(LINK(this, SwNumNamesDlg, ModifyHdl));
- aFormBox.SetSelectHdl(LINK(this, SwNumNamesDlg, SelectHdl));
- aFormBox.SetDoubleClickHdl(LINK(this, SwNumNamesDlg, DoubleClickHdl));
- SelectHdl(&aFormBox);
+ get(m_pFormEdit, "entry");
+ get(m_pFormBox, "form");
+ m_pFormBox->SetDropDownLineCount(5);
+ get(m_pOKBtn, "ok");
+ m_pFormEdit->SetModifyHdl(LINK(this, SwNumNamesDlg, ModifyHdl));
+ m_pFormBox->SetSelectHdl(LINK(this, SwNumNamesDlg, SelectHdl));
+ m_pFormBox->SetDoubleClickHdl(LINK(this, SwNumNamesDlg, DoubleClickHdl));
+ SelectHdl(m_pFormBox);
}
-SwNumNamesDlg::~SwNumNamesDlg() {}
-
static sal_uInt16 lcl_BitToLevel(sal_uInt16 nActLevel)
{
sal_uInt16 nTmp = nActLevel;
diff --git a/sw/source/ui/misc/outline.hrc b/sw/source/ui/misc/outline.hrc
deleted file mode 100644
index ad06adfd6ec6..000000000000
--- a/sw/source/ui/misc/outline.hrc
+++ /dev/null
@@ -1,47 +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_1 6
-#define FT_2 7
-#define FT_3 8
-#define FT_4 9
-
-#define FT_COLL 20
-#define LB_COLL 21
-#define FT_NUMBER 22
-#define LB_NUMBER 23
-#define FT_DELIM 24
-#define FL_NUMBER 30
-
-#define LB_ALIGN 31
-#define FL_ALIGN 33
-
-#define FT_START 40
-#define ED_START 41
-#define FL_START 42
-
-#define BT_OK 100
-#define BT_CANCEL 101
-#define BT_HELP 102
-#define FL_FORM 105
-#define LB_FORM 106
-#define ED_FORM 107
-#define FT_ALL_LEVEL 108
-#define NF_ALL_LEVEL 109
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/misc/outline.src b/sw/source/ui/misc/outline.src
deleted file mode 100644
index c2249fded8a2..000000000000
--- a/sw/source/ui/misc/outline.src
+++ /dev/null
@@ -1,90 +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 "misc.hrc"
-#include "outline.hrc"
-#include "globals.hrc"
-#include "cmdid.h"
-#include "helpid.h"
-ModalDialog DLG_NUM_NAMES
-{
- HelpID = HID_NUM_NAMES ;
- OutputSize = TRUE ;
- SVLook = TRUE ;
- Size = MAP_APPFONT ( 164 , 82 ) ;
- Text [ en-US ] = "Save As";
- Moveable = TRUE ;
- OKButton BT_OK
- {
- Pos = MAP_APPFONT ( 108 , 6 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- DefButton = TRUE ;
- };
- CancelButton BT_CANCEL
- {
- Pos = MAP_APPFONT ( 108 , 23 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
- HelpButton BT_HELP
- {
- Pos = MAP_APPFONT ( 108 , 43 ) ;
- Size = MAP_APPFONT ( 50 , 14 ) ;
- TabStop = TRUE ;
- };
- FixedLine FL_FORM
- {
- Pos = MAP_APPFONT ( 6 , 3 ) ;
- Size = MAP_APPFONT ( 96 , 8 ) ;
- Text [ en-US ] = "Format" ;
- };
- ListBox LB_FORM
- {
- HelpID = "sw:ListBox:DLG_NUM_NAMES:LB_FORM";
- Border = TRUE ;
- Pos = MAP_APPFONT ( 12 , 29 ) ;
- Size = MAP_APPFONT ( 84 , 42 ) ;
- TabStop = TRUE ;
- CurPos = 0 ;
- StringList [ en-US ] =
- {
- < "Untitled 1" ; > ;
- < "Untitled 2" ; > ;
- < "Untitled 3" ; > ;
- < "Untitled 4" ; > ;
- < "Untitled 5" ; > ;
- < "Untitled 6" ; > ;
- < "Untitled 7" ; > ;
- < "Untitled 8" ; > ;
- < "Untitled 9" ; > ;
- };
- };
- Edit ED_FORM
- {
- HelpID = "sw:Edit:DLG_NUM_NAMES:ED_FORM";
- Border = TRUE ;
- Pos = MAP_APPFONT ( 12 , 14 ) ;
- Size = MAP_APPFONT ( 84 , 12 ) ;
- TabStop = TRUE ;
- Left = TRUE ;
- };
-};
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/uiconfig/swriter/ui/numberingnamedialog.ui b/sw/uiconfig/swriter/ui/numberingnamedialog.ui
index 22f728da4d6b..12b2b0eecc93 100644
--- a/sw/uiconfig/swriter/ui/numberingnamedialog.ui
+++ b/sw/uiconfig/swriter/ui/numberingnamedialog.ui
@@ -1,6 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<!-- interface-requires gtk+ 3.0 -->
+ <object class="GtkListStore" id="liststore1">
+ <columns>
+ <!-- column-name gchararray1 -->
+ <column type="gchararray"/>
+ </columns>
+ <data>
+ <row>
+ <col id="0" translatable="yes">Untitled 1</col>
+ </row>
+ <row>
+ <col id="0" translatable="yes">Untitled 2</col>
+ </row>
+ <row>
+ <col id="0" translatable="yes">Untitled 3</col>
+ </row>
+ <row>
+ <col id="0" translatable="yes">Untitled 4</col>
+ </row>
+ <row>
+ <col id="0" translatable="yes">Untitled 5</col>
+ </row>
+ <row>
+ <col id="0" translatable="yes">Untitled 6</col>
+ </row>
+ <row>
+ <col id="0" translatable="yes">Untitled 7</col>
+ </row>
+ <row>
+ <col id="0" translatable="yes">Untitled 8</col>
+ </row>
+ <row>
+ <col id="0" translatable="yes">Untitled 9</col>
+ </row>
+ </data>
+ </object>
<object class="GtkDialog" id="NumberingNameDialog">
<property name="can_focus">False</property>
<property name="border_width">6</property>
@@ -97,6 +132,7 @@
<property name="can_focus">True</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
+ <property name="model">liststore1</property>
<child internal-child="selection">
<object class="GtkTreeSelection" id="treeview-selection1"/>
</child>