diff options
-rw-r--r-- | sw/AllLangResTarget_sw.mk | 1 | ||||
-rw-r--r-- | sw/UIConfig_swriter.mk | 1 | ||||
-rw-r--r-- | sw/inc/dochdl.hrc | 1 | ||||
-rw-r--r-- | sw/inc/swabstdlg.hxx | 2 | ||||
-rw-r--r-- | sw/source/ui/dialog/swdlgfact.cxx | 18 | ||||
-rw-r--r-- | sw/source/ui/dialog/swdlgfact.hxx | 2 | ||||
-rw-r--r-- | sw/source/ui/dochdl/gloshdl.cxx | 2 | ||||
-rw-r--r-- | sw/source/ui/dochdl/selglos.cxx | 28 | ||||
-rw-r--r-- | sw/source/ui/dochdl/selglos.hrc | 25 | ||||
-rw-r--r-- | sw/source/ui/dochdl/selglos.src | 69 | ||||
-rw-r--r-- | sw/source/ui/inc/selglos.hxx | 34 | ||||
-rw-r--r-- | sw/uiconfig/swriter/ui/insertautotextdialog.ui | 122 |
12 files changed, 151 insertions, 154 deletions
diff --git a/sw/AllLangResTarget_sw.mk b/sw/AllLangResTarget_sw.mk index e3af1f2d56c3..091679315e1b 100644 --- a/sw/AllLangResTarget_sw.mk +++ b/sw/AllLangResTarget_sw.mk @@ -93,7 +93,6 @@ $(eval $(call gb_SrsTarget_add_files,sw/res,\ sw/source/ui/dialog/dialog.src \ sw/source/ui/dialog/regionsw.src \ sw/source/ui/dochdl/dochdl.src \ - sw/source/ui/dochdl/selglos.src \ sw/source/ui/docvw/annotation.src \ sw/source/ui/docvw/access.src \ sw/source/ui/docvw/docvw.src \ diff --git a/sw/UIConfig_swriter.mk b/sw/UIConfig_swriter.mk index b0105bc1983a..b123a7e57f26 100644 --- a/sw/UIConfig_swriter.mk +++ b/sw/UIConfig_swriter.mk @@ -93,6 +93,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/swriter,\ sw/uiconfig/swriter/ui/indexentry \ sw/uiconfig/swriter/ui/inputfielddialog \ sw/uiconfig/swriter/ui/indentpage \ + sw/uiconfig/swriter/ui/insertautotextdialog \ sw/uiconfig/swriter/ui/insertbookmark \ sw/uiconfig/swriter/ui/insertbreak \ sw/uiconfig/swriter/ui/insertcaption \ diff --git a/sw/inc/dochdl.hrc b/sw/inc/dochdl.hrc index fc1c10a1d31a..c37def077bc3 100644 --- a/sw/inc/dochdl.hrc +++ b/sw/inc/dochdl.hrc @@ -27,7 +27,6 @@ #define MSG_CLPBRD_FORMAT_ERROR (RC_DOCHDL_BEGIN + 4) #define MSG_UPDATE_NEW_GLOS_FMT (RC_DOCHDL_BEGIN + 5) -#define DLG_SEL_GLOS (RC_DOCHDL_BEGIN + 6) #define STR_NO_TABLE (RC_DOCHDL_BEGIN + 7) #define STR_PRIVATETEXT (RC_DOCHDL_BEGIN + 8) diff --git a/sw/inc/swabstdlg.hxx b/sw/inc/swabstdlg.hxx index b2a73e34a8b1..3cdb1bb9dd81 100644 --- a/sw/inc/swabstdlg.hxx +++ b/sw/inc/swabstdlg.hxx @@ -369,7 +369,7 @@ public: sal_Bool bDraw = sal_False, sal_uInt16 nDefPage = 0) = 0; - virtual AbstractSwSelGlossaryDlg * CreateSwSelGlossaryDlg ( Window * pParent, const String &rShortName, int nResId ) = 0; //add for SwSelGlossaryDlg + virtual AbstractSwSelGlossaryDlg * CreateSwSelGlossaryDlg(Window * pParent, const String &rShortName) = 0; //add for SwSelGlossaryDlg virtual VclAbstractDialog * CreateVclAbstractDialog ( Window * pParent, SwWrtShell &rSh, int nResId ) = 0; //add for SwTableHeightDlg SwSortDlg virtual AbstractSplitTableDialog * CreateSplitTblDialog ( Window * pParent, SwWrtShell &rSh ) = 0; //add for SwSplitTblDlg diff --git a/sw/source/ui/dialog/swdlgfact.cxx b/sw/source/ui/dialog/swdlgfact.cxx index 7d220dd9072c..74d6453b1880 100644 --- a/sw/source/ui/dialog/swdlgfact.cxx +++ b/sw/source/ui/dialog/swdlgfact.cxx @@ -859,22 +859,10 @@ AbstractSplitTableDialog * SwAbstractDialogFactory_Impl::CreateSplitTblDialog ( return new AbstractSplitTableDialog_Impl( new SwSplitTblDlg( pParent, rSh) ); } -AbstractSwSelGlossaryDlg * SwAbstractDialogFactory_Impl::CreateSwSelGlossaryDlg ( Window * pParent, const String &rShortName, int nResId ) +AbstractSwSelGlossaryDlg * SwAbstractDialogFactory_Impl::CreateSwSelGlossaryDlg(Window * pParent, const String &rShortName) { - SwSelGlossaryDlg* pDlg=NULL; - switch ( nResId ) - { - case DLG_SEL_GLOS : - pDlg = new SwSelGlossaryDlg( pParent, rShortName); - break; - - default: - break; - } - - if ( pDlg ) - return new AbstractSwSelGlossaryDlg_Impl( pDlg ); - return 0; + SwSelGlossaryDlg* pDlg = new SwSelGlossaryDlg(pParent, rShortName); + return new AbstractSwSelGlossaryDlg_Impl(pDlg); } AbstractSwAutoFormatDlg * SwAbstractDialogFactory_Impl::CreateSwAutoFormatDlg(Window* pParent, diff --git a/sw/source/ui/dialog/swdlgfact.hxx b/sw/source/ui/dialog/swdlgfact.hxx index 060abef45acf..9efa6e4cdb1e 100644 --- a/sw/source/ui/dialog/swdlgfact.hxx +++ b/sw/source/ui/dialog/swdlgfact.hxx @@ -470,7 +470,7 @@ public: sal_Bool bDraw = sal_False, sal_uInt16 nDefPage = 0); - virtual AbstractSwSelGlossaryDlg * CreateSwSelGlossaryDlg ( Window * pParent, const String &rShortName, int nResId ); //add for SwSelGlossaryDlg + virtual AbstractSwSelGlossaryDlg * CreateSwSelGlossaryDlg(Window * pParent, const String &rShortName); //add for SwSelGlossaryDlg virtual VclAbstractDialog * CreateVclAbstractDialog ( Window * pParent, SwWrtShell &rSh, int nResId ); //add for SwTableHeightDlg SwSortDlg virtual AbstractSplitTableDialog * CreateSplitTblDialog ( Window * pParent, SwWrtShell &rSh ); //add for SwSplitTblDlg diff --git a/sw/source/ui/dochdl/gloshdl.cxx b/sw/source/ui/dochdl/gloshdl.cxx index 8e852fb802a9..4c4edefdbbc7 100644 --- a/sw/source/ui/dochdl/gloshdl.cxx +++ b/sw/source/ui/dochdl/gloshdl.cxx @@ -454,7 +454,7 @@ sal_Bool SwGlossaryHdl::Expand( const OUString& rShortName, SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); - AbstractSwSelGlossaryDlg* pDlg = pFact->CreateSwSelGlossaryDlg( 0, aShortName, DLG_SEL_GLOS ); + AbstractSwSelGlossaryDlg* pDlg = pFact->CreateSwSelGlossaryDlg(0, aShortName); OSL_ENSURE(pDlg, "Dialogdiet fail!"); for(sal_uInt16 i = 0; i < aFoundArr.size(); ++i) { diff --git a/sw/source/ui/dochdl/selglos.cxx b/sw/source/ui/dochdl/selglos.cxx index 930fb8215b57..484787deba8b 100644 --- a/sw/source/ui/dochdl/selglos.cxx +++ b/sw/source/ui/dochdl/selglos.cxx @@ -21,32 +21,20 @@ #include "selglos.hxx" -#include "selglos.hrc" #include "dochdl.hrc" -#include <vcl/msgbox.hxx> - -// STATIC DATA ----------------------------------------------------------- - - -// CTOR / DTOR ----------------------------------------------------------- +#include <vcl/layout.hxx> SwSelGlossaryDlg::SwSelGlossaryDlg(Window * pParent, const OUString &rShortName) - : ModalDialog(pParent, SW_RES(DLG_SEL_GLOS)), - aGlosBox(this, SW_RES( LB_GLOS)), - aGlosFL(this, SW_RES( FL_GLOS)), - aOKBtn(this, SW_RES( BT_OK)), - aCancelBtn(this, SW_RES( BT_CANCEL)), - aHelpBtn(this, SW_RES(BT_HELP)) + : ModalDialog(pParent, "InsertAutoTextDialog", + "modules/swriter/ui/insertautotextdialog.ui") { - aGlosFL.SetText(aGlosFL.GetText() + rShortName); - FreeResource(); - - aGlosBox.SetDoubleClickHdl(LINK(this, SwSelGlossaryDlg, DoubleClickHdl)); + VclFrame *pFrame(get<VclFrame>("frame")); + pFrame->set_label(pFrame->get_label() + rShortName); + get(m_pGlosBox, "treeview"); + m_pGlosBox->set_height_request(m_pGlosBox->GetTextHeight() * 10); + m_pGlosBox->SetDoubleClickHdl(LINK(this, SwSelGlossaryDlg, DoubleClickHdl)); } -// overload dtor -SwSelGlossaryDlg::~SwSelGlossaryDlg() {} - IMPL_LINK(SwSelGlossaryDlg, DoubleClickHdl, ListBox*, /*pBox*/) { EndDialog(RET_OK); diff --git a/sw/source/ui/dochdl/selglos.hrc b/sw/source/ui/dochdl/selglos.hrc deleted file mode 100644 index 9513d3aa9f96..000000000000 --- a/sw/source/ui/dochdl/selglos.hrc +++ /dev/null @@ -1,25 +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 BT_OK 100 -#define BT_CANCEL 101 -#define BT_HELP 102 -#define LB_GLOS 1 -#define FL_GLOS 2 - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/dochdl/selglos.src b/sw/source/ui/dochdl/selglos.src deleted file mode 100644 index 2a27214b9090..000000000000 --- a/sw/source/ui/dochdl/selglos.src +++ /dev/null @@ -1,69 +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 "selglos.hrc" -#include "dochdl.hrc" -#include "cmdid.h" -#include "helpid.h" - -ModalDialog DLG_SEL_GLOS -{ - HelpID = CMD_FN_EXPAND_GLOSSARY ; - OutputSize = TRUE ; - SVLook = TRUE ; - Size = MAP_APPFONT ( 220 , 100 ) ; - Text [ en-US ] = "Insert AutoText" ; - Moveable = TRUE ; - OKButton BT_OK - { - Pos = MAP_APPFONT ( 164 , 6 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - DefButton = TRUE ; - }; - CancelButton BT_CANCEL - { - Pos = MAP_APPFONT ( 164 , 23 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - }; - HelpButton BT_HELP - { - Pos = MAP_APPFONT ( 164 , 43 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - }; - FixedLine FL_GLOS - { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 152 , 8 ) ; - Text [ en-US ] = "AutoTexts for shortcut " ; - }; - ListBox LB_GLOS - { - HelpID = "sw:ListBox:DLG_SEL_GLOS:LB_GLOS"; - Border = TRUE ; - Pos = MAP_APPFONT ( 12 , 14 ) ; - Size = MAP_APPFONT ( 140 , 74 ) ; - TabStop = TRUE ; - AutoHScroll = TRUE ; - }; -}; - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/selglos.hxx b/sw/source/ui/inc/selglos.hxx index 88da01455595..d86d4d56ae9d 100644 --- a/sw/source/ui/inc/selglos.hxx +++ b/sw/source/ui/inc/selglos.hxx @@ -29,32 +29,26 @@ class SwSelGlossaryDlg : public ModalDialog { protected: - ListBox aGlosBox; - FixedLine aGlosFL; - OKButton aOKBtn; - CancelButton aCancelBtn; - HelpButton aHelpBtn; + ListBox* m_pGlosBox; DECL_LINK(DoubleClickHdl, ListBox*); public: SwSelGlossaryDlg(Window * pParent, const OUString &rShortName); - ~SwSelGlossaryDlg(); - void InsertGlos(const OUString &rRegion, const OUString &rGlosName); // inline - sal_uInt16 GetSelectedIdx() const; // inline - void SelectEntryPos(sal_uInt16 nIdx); // inline + void InsertGlos(const OUString &rRegion, const OUString &rGlosName) + { + const OUString aTmp = rRegion + ":" + rGlosName; + m_pGlosBox->InsertEntry(aTmp); + } + sal_uInt16 GetSelectedIdx() const + { + return m_pGlosBox->GetSelectEntryPos(); + } + void SelectEntryPos(sal_uInt16 nIdx) + { + m_pGlosBox->SelectEntryPos(nIdx); + } }; -inline void SwSelGlossaryDlg::InsertGlos(const OUString &rRegion, - const OUString &rGlosName) -{ - const OUString aTmp = rRegion + ":" + rGlosName; - aGlosBox.InsertEntry( aTmp ); -} -inline sal_uInt16 SwSelGlossaryDlg::GetSelectedIdx() const -{ return aGlosBox.GetSelectEntryPos(); } -inline void SwSelGlossaryDlg::SelectEntryPos(sal_uInt16 nIdx) -{ aGlosBox.SelectEntryPos(nIdx); } - #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/uiconfig/swriter/ui/insertautotextdialog.ui b/sw/uiconfig/swriter/ui/insertautotextdialog.ui new file mode 100644 index 000000000000..28a63288d3e0 --- /dev/null +++ b/sw/uiconfig/swriter/ui/insertautotextdialog.ui @@ -0,0 +1,122 @@ +<?xml version="1.0" encoding="UTF-8"?> +<interface> + <!-- interface-requires gtk+ 3.0 --> + <object class="GtkDialog" id="InsertAutoTextDialog"> + <property name="can_focus">False</property> + <property name="border_width">6</property> + <property name="title" translatable="yes">Insert AutoText</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="frame"> + <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="GtkTreeView" id="treeview:border"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <child internal-child="selection"> + <object class="GtkTreeSelection" id="treeview-selection1"/> + </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">AutoTexts for shortcut </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> |