diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-10-16 17:49:59 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-10-17 16:06:33 +0100 |
commit | 644d22e6765d961f6130affc84ace869d6fd5177 (patch) | |
tree | d3e3a9f93c51628d0816fce6d945728a3f270ee8 /sw | |
parent | de661fd70a33010ff455a3909020c8df346b5743 (diff) |
convert insert rule
Change-Id: Ic4191a6dd38ef619efc4e4dc5ed6fe418c0942f4
Diffstat (limited to 'sw')
-rw-r--r-- | sw/AllLangResTarget_sw.mk | 1 | ||||
-rw-r--r-- | sw/UI_swriter.mk | 1 | ||||
-rw-r--r-- | sw/inc/helpid.h | 1 | ||||
-rw-r--r-- | sw/inc/swabstdlg.hxx | 3 | ||||
-rw-r--r-- | sw/source/ui/app/app.src | 5 | ||||
-rw-r--r-- | sw/source/ui/dialog/swdlgfact.cxx | 19 | ||||
-rw-r--r-- | sw/source/ui/dialog/swdlgfact.hxx | 3 | ||||
-rw-r--r-- | sw/source/ui/inc/app.hrc | 3 | ||||
-rw-r--r-- | sw/source/ui/inc/insrule.hxx | 8 | ||||
-rw-r--r-- | sw/source/ui/inc/misc.hrc | 1 | ||||
-rw-r--r-- | sw/source/ui/misc/insrule.cxx | 45 | ||||
-rw-r--r-- | sw/source/ui/misc/insrule.hrc | 26 | ||||
-rw-r--r-- | sw/source/ui/misc/insrule.src | 68 | ||||
-rw-r--r-- | sw/source/ui/shells/textsh.cxx | 3 | ||||
-rw-r--r-- | sw/uiconfig/swriter/ui/horizontalrule.ui | 120 |
15 files changed, 157 insertions, 150 deletions
diff --git a/sw/AllLangResTarget_sw.mk b/sw/AllLangResTarget_sw.mk index 8d7f4f8cf886..5bb8873e0f86 100644 --- a/sw/AllLangResTarget_sw.mk +++ b/sw/AllLangResTarget_sw.mk @@ -156,7 +156,6 @@ $(eval $(call gb_SrsTarget_add_files,sw/res,\ sw/source/ui/misc/glosbib.src \ sw/source/ui/misc/glossary.src \ sw/source/ui/misc/insfnote.src \ - sw/source/ui/misc/insrule.src \ sw/source/ui/misc/num.src \ sw/source/ui/misc/numberingtypelistbox.src \ sw/source/ui/misc/outline.src \ diff --git a/sw/UI_swriter.mk b/sw/UI_swriter.mk index fc53c25e062a..9e3527895407 100644 --- a/sw/UI_swriter.mk +++ b/sw/UI_swriter.mk @@ -14,6 +14,7 @@ $(eval $(call gb_UI_add_uifiles,modules/swriter,\ sw/uiconfig/swriter/ui/charurlpage \ sw/uiconfig/swriter/ui/columnwidth \ sw/uiconfig/swriter/ui/converttexttable \ + sw/uiconfig/swriter/ui/horizontalrule \ sw/uiconfig/swriter/ui/insertbreak \ sw/uiconfig/swriter/ui/inserttable \ sw/uiconfig/swriter/ui/linenumbering \ diff --git a/sw/inc/helpid.h b/sw/inc/helpid.h index a9151084a0e4..bf781733b65d 100644 --- a/sw/inc/helpid.h +++ b/sw/inc/helpid.h @@ -69,7 +69,6 @@ #define HID_VS_BULLET "SW_HID_VS_BULLET" #define HID_VS_NUMBMP "SW_HID_VS_NUMBMP" #define HID_VS_RULER "SW_HID_VS_RULER" -#define HID_RULER_DIALOG "SW_HID_RULER_DIALOG" #define HID_INSERT_ABSTRACT "SW_HID_INSERT_ABSTRACT" #define HID_NAVI_TBX1 "SW_HID_NAVI_TBX1" #define HID_NAVI_TBX2 "SW_HID_NAVI_TBX2" diff --git a/sw/inc/swabstdlg.hxx b/sw/inc/swabstdlg.hxx index 5f12fa8d5423..056f3a2a2dfb 100644 --- a/sw/inc/swabstdlg.hxx +++ b/sw/inc/swabstdlg.hxx @@ -444,8 +444,7 @@ public: virtual VclAbstractDialog* CreateTitlePageDlg ( Window * pParent ) = 0; virtual VclAbstractDialog * CreateVclSwViewDialog( int nResId, SwView& rView, sal_Bool bCol = sal_False ) = 0; //add for SwInsRowColDlg, SwLineNumberingDlg - virtual AbstractInsertGrfRulerDlg* CreateInsertGrfRulerDlg( int nResId, - Window * pParent ) = 0; //add for SwInsertGrfRulerDlg + virtual AbstractInsertGrfRulerDlg* CreateInsertGrfRulerDlg(Window * pParent) = 0; //add for SwInsertGrfRulerDlg virtual AbstractInsTableDlg* CreateInsTableDlg(SwView& rView) = 0; //add for SwInsTableDlg virtual AbstractJavaEditDialog* CreateJavaEditDialog( int nResId, Window* pParent, SwWrtShell* pWrtSh ) = 0; //add for SwJavaEditDialog diff --git a/sw/source/ui/app/app.src b/sw/source/ui/app/app.src index 99d63e95169f..3492f9e1c76b 100644 --- a/sw/source/ui/app/app.src +++ b/sw/source/ui/app/app.src @@ -655,6 +655,11 @@ String STR_COL Text [ en-US ] = "Column" ; }; +String STR_SIMPLE +{ + Text [ en-US ] = "Plain" ; +}; + ToolBox RID_MODULE_TOOLBOX { HelpID = HID_MODULE_TOOLBOX ; diff --git a/sw/source/ui/dialog/swdlgfact.cxx b/sw/source/ui/dialog/swdlgfact.cxx index 09dbd3fd3568..a851292f856d 100644 --- a/sw/source/ui/dialog/swdlgfact.cxx +++ b/sw/source/ui/dialog/swdlgfact.cxx @@ -1243,22 +1243,11 @@ VclAbstractDialog * SwAbstractDialogFactory_Impl::CreateVclSwViewDialog( int nRe return 0; } -AbstractInsertGrfRulerDlg * SwAbstractDialogFactory_Impl::CreateInsertGrfRulerDlg( int nResId, - Window * pParent ) //add for SwInsertGrfRulerDlg +//add for SwInsertGrfRulerDlg +AbstractInsertGrfRulerDlg * SwAbstractDialogFactory_Impl::CreateInsertGrfRulerDlg(Window * pParent) { - SwInsertGrfRulerDlg* pDlg=NULL; - switch ( nResId ) - { - case DLG_INSERT_RULER : - pDlg = new SwInsertGrfRulerDlg( pParent ); - break; - default: - break; - } - - if ( pDlg ) - return new AbstractInsertGrfRulerDlg_Impl( pDlg ); - return 0; + SwInsertGrfRulerDlg* pDlg = new SwInsertGrfRulerDlg(pParent); + return new AbstractInsertGrfRulerDlg_Impl(pDlg); } AbstractInsTableDlg * SwAbstractDialogFactory_Impl::CreateInsTableDlg(SwView& rView) //add for SwInsTableDlg diff --git a/sw/source/ui/dialog/swdlgfact.hxx b/sw/source/ui/dialog/swdlgfact.hxx index f1764397bb6e..129b9e32a40a 100644 --- a/sw/source/ui/dialog/swdlgfact.hxx +++ b/sw/source/ui/dialog/swdlgfact.hxx @@ -523,8 +523,7 @@ public: virtual VclAbstractDialog * CreateTitlePageDlg ( Window * pParent ); virtual VclAbstractDialog * CreateVclSwViewDialog( int nResId, SwView& rView, sal_Bool bCol = sal_False ); //add for SwInsRowColDlg, SwLineNumberingDlg - virtual AbstractInsertGrfRulerDlg* CreateInsertGrfRulerDlg( int nResId, - Window * pParent ); //add for SwInsertGrfRulerDlg + virtual AbstractInsertGrfRulerDlg* CreateInsertGrfRulerDlg(Window * pParent); //add for SwInsertGrfRulerDlg virtual AbstractInsTableDlg* CreateInsTableDlg(SwView& rView); //add for SwInsTableDlg virtual AbstractJavaEditDialog* CreateJavaEditDialog( int nResId, Window* pParent, SwWrtShell* pWrtSh ); //add for SwJavaEditDialog diff --git a/sw/source/ui/inc/app.hrc b/sw/source/ui/inc/app.hrc index 1e924271d2d3..565fa3833459 100644 --- a/sw/source/ui/inc/app.hrc +++ b/sw/source/ui/inc/app.hrc @@ -114,8 +114,9 @@ #define STR_NUMERIC (RC_APP_BEGIN + 126) #define STR_COL (RC_APP_BEGIN + 127) #define STR_ROW (RC_APP_BEGIN + 128) +#define STR_SIMPLE (RC_APP_BEGIN + 129) -#define APP_ACT_END STR_ROW +#define APP_ACT_END STR_SIMPLE #if APP_ACT_END > RC_APP_END #error Resource-Id Ueberlauf in #file, #line diff --git a/sw/source/ui/inc/insrule.hxx b/sw/source/ui/inc/insrule.hxx index 77a13c7eaaff..78d331909355 100644 --- a/sw/source/ui/inc/insrule.hxx +++ b/sw/source/ui/inc/insrule.hxx @@ -28,18 +28,14 @@ class ValueSet; class SwInsertGrfRulerDlg : public SfxModalDialog { - FixedLine aSelectionFL; - OKButton aOkPB; - CancelButton aCancelPB; - HelpButton aHelpPB; + OKButton* m_pOkPB; + SwRulerValueSet* m_pExampleVS; std::vector<String> aGrfNames; String sSimple; String sRulers; sal_uInt16 nSelPos; - SwRulerValueSet* pExampleVS; - protected: DECL_LINK(SelectHdl, ValueSet*); DECL_LINK(DoubleClickHdl, void *); diff --git a/sw/source/ui/inc/misc.hrc b/sw/source/ui/inc/misc.hrc index 4bfbfe587c0f..ebaae1552d8a 100644 --- a/sw/source/ui/inc/misc.hrc +++ b/sw/source/ui/inc/misc.hrc @@ -31,7 +31,6 @@ #define DLG_NUM_NAMES (RC_MISC_BEGIN + 18) #define DLG_SORTING (RC_MISC_BEGIN + 19) #define DLG_RENAME_GLOS (RC_MISC_BEGIN + 25) -#define DLG_INSERT_RULER (RC_MISC_BEGIN + 28) #define DLG_REDLINE_ACCEPT (RC_MISC_BEGIN + 29) #define DLG_TAB_OUTLINE (RC_MISC_BEGIN + 31) diff --git a/sw/source/ui/misc/insrule.cxx b/sw/source/ui/misc/insrule.cxx index eecd57a9b977..cfa03016681d 100644 --- a/sw/source/ui/misc/insrule.cxx +++ b/sw/source/ui/misc/insrule.cxx @@ -37,49 +37,44 @@ #include "docsh.hxx" #include "insrule.hxx" #include "swvset.hxx" -#include "insrule.hrc" +#include "app.hrc" #include "misc.hrc" #include "helpid.h" -SwInsertGrfRulerDlg::SwInsertGrfRulerDlg( Window* pParent ) : - SfxModalDialog(pParent, SW_RES(DLG_INSERT_RULER)), - aSelectionFL(this, SW_RES(FL_SEL )), - aOkPB (this, SW_RES(PB_OK )), - aCancelPB (this, SW_RES(PB_CANCEL )), - aHelpPB (this, SW_RES(PB_HELP )), - - sSimple (SW_RES(ST_SIMPLE)), - nSelPos(USHRT_MAX), - pExampleVS (new SwRulerValueSet(this, SW_RES(VS_EXAMPLE ))) +SwInsertGrfRulerDlg::SwInsertGrfRulerDlg( Window* pParent ) + : SfxModalDialog(pParent, "HorizontalRuleDialog", "modules/swriter/ui/horizontalrule.ui") + , sSimple(SW_RESSTR(STR_SIMPLE)) + , nSelPos(USHRT_MAX) { - FreeResource(); - pExampleVS->SetLineCount(6); - pExampleVS->SetColCount(1); - pExampleVS->SetSelectHdl(LINK(this, SwInsertGrfRulerDlg, SelectHdl)); - pExampleVS->SetDoubleClickHdl(LINK(this, SwInsertGrfRulerDlg, DoubleClickHdl)); - pExampleVS->GrabFocus(); + get(m_pOkPB, "ok"); + get(m_pExampleVS, "rulers"); + + m_pExampleVS->SetLineCount(6); + m_pExampleVS->SetColCount(1); + m_pExampleVS->SetSelectHdl(LINK(this, SwInsertGrfRulerDlg, SelectHdl)); + m_pExampleVS->SetDoubleClickHdl(LINK(this, SwInsertGrfRulerDlg, DoubleClickHdl)); // determine graphic name GalleryExplorer::BeginLocking(GALLERY_THEME_RULERS); GalleryExplorer::FillObjList( GALLERY_THEME_RULERS, aGrfNames ); - pExampleVS->SetHelpId(HID_VS_RULER); + m_pExampleVS->SetHelpId(HID_VS_RULER); Color aColor(COL_WHITE); - pExampleVS->InsertItem( 1, 1); - pExampleVS->SetItemText( 1, sSimple); + m_pExampleVS->InsertItem( 1, 1); + m_pExampleVS->SetItemText( 1, sSimple); for(sal_uInt16 i = 1; i <= aGrfNames.size(); i++) { - pExampleVS->InsertItem( i + 1, i); - pExampleVS->SetItemText( i + 1, aGrfNames[i-1]); + m_pExampleVS->InsertItem( i + 1, i); + m_pExampleVS->SetItemText( i + 1, aGrfNames[i-1]); } - pExampleVS->Show(); + m_pExampleVS->SelectItem(1); + m_pExampleVS->GrabFocus(); } SwInsertGrfRulerDlg::~SwInsertGrfRulerDlg() { GalleryExplorer::EndLocking(GALLERY_THEME_RULERS); - delete pExampleVS; } String SwInsertGrfRulerDlg::GetGraphicName() @@ -96,7 +91,7 @@ String SwInsertGrfRulerDlg::GetGraphicName() IMPL_LINK(SwInsertGrfRulerDlg, SelectHdl, ValueSet*, pVS) { nSelPos = pVS->GetSelectItemId(); - aOkPB.Enable(); + m_pOkPB->Enable(); return 0; } diff --git a/sw/source/ui/misc/insrule.hrc b/sw/source/ui/misc/insrule.hrc deleted file mode 100644 index d9aaa3651081..000000000000 --- a/sw/source/ui/misc/insrule.hrc +++ /dev/null @@ -1,26 +0,0 @@ -/* - * 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" - -#define FL_SEL 1 -#define VS_EXAMPLE 2 -#define PB_OK 3 -#define PB_CANCEL 4 -#define PB_HELP 5 -#define ST_SIMPLE 6 diff --git a/sw/source/ui/misc/insrule.src b/sw/source/ui/misc/insrule.src deleted file mode 100644 index e419907a8791..000000000000 --- a/sw/source/ui/misc/insrule.src +++ /dev/null @@ -1,68 +0,0 @@ -/* - * 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 "insrule.hrc" -#include "helpid.h" -ModalDialog DLG_INSERT_RULER -{ - HelpID = HID_RULER_DIALOG ; - OutputSize = TRUE ; - SVLook = TRUE ; - Size = MAP_APPFONT ( 242 , 124 ) ; - Moveable = TRUE ; - FixedLine FL_SEL - { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( 174 , 8 ) ; - Text [ en-US ] = "Selection" ; - }; - Control VS_EXAMPLE - { - Pos = MAP_APPFONT ( 9 , 14 ) ; - Size = MAP_APPFONT ( 168 , 104 ) ; - Hide = TRUE ; - Border = TRUE ; - TabStop = TRUE ; - Group = TRUE ; - }; - OKButton PB_OK - { - Pos = MAP_APPFONT ( 186 , 6 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - DefButton = TRUE ; - Disable = TRUE ; - }; - CancelButton PB_CANCEL - { - Pos = MAP_APPFONT ( 186 , 23 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - }; - HelpButton PB_HELP - { - Pos = MAP_APPFONT ( 186 , 43 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - }; - String ST_SIMPLE - { - Text [ en-US ] = "Plain" ; - }; - Text [ en-US ] = "Insert Horizontal Rule" ; -}; diff --git a/sw/source/ui/shells/textsh.cxx b/sw/source/ui/shells/textsh.cxx index 40d93fc79569..f282e5f85d57 100644 --- a/sw/source/ui/shells/textsh.cxx +++ b/sw/source/ui/shells/textsh.cxx @@ -660,8 +660,7 @@ void SwTextShell::ExecInsert(SfxRequest &rReq) { SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "Dialogdiet fail!"); - AbstractInsertGrfRulerDlg* pDlg = pFact->CreateInsertGrfRulerDlg( DLG_INSERT_RULER, - pParent ); + AbstractInsertGrfRulerDlg* pDlg = pFact->CreateInsertGrfRulerDlg(pParent); OSL_ENSURE(pDlg, "Dialogdiet fail!"); // MessageBox fuer fehlende Grafiken if(!pDlg->HasImages()) diff --git a/sw/uiconfig/swriter/ui/horizontalrule.ui b/sw/uiconfig/swriter/ui/horizontalrule.ui new file mode 100644 index 000000000000..a88511482c0d --- /dev/null +++ b/sw/uiconfig/swriter/ui/horizontalrule.ui @@ -0,0 +1,120 @@ +<?xml version="1.0" encoding="UTF-8"?> +<interface> + <!-- interface-requires gtk+ 3.0 --> + <object class="GtkDialog" id="HorizontalRuleDialog"> + <property name="can_focus">False</property> + <property name="border_width">5</property> + <property name="title" translatable="yes">Insert Horizontal Rule</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="spacing">2</property> + <child internal-child="action_area"> + <object class="GtkButtonBox" id="dialog-action_area1"> + <property name="can_focus">False</property> + <property name="orientation">vertical</property> + <property name="layout_style">start</property> + <child> + <object class="GtkButton" id="ok"> + <property name="label">gtk-ok</property> + <property name="use_action_appearance">False</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_action_appearance">False</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="button2"> + <property name="label">gtk-cancel</property> + <property name="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="use_action_appearance">False</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="use_action_appearance">False</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="use_action_appearance">False</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="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="left_padding">12</property> + <child> + <object class="swuilo:SwRulerValueSet" id="rulers"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="width_request">400</property> + <property name="height_request">250</property> + </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"><b>Selection</b></property> + <property name="use_markup">True</property> + </object> + </child> + </object> + <packing> + <property name="expand">True</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">button2</action-widget> + <action-widget response="0">help</action-widget> + </action-widgets> + </object> +</interface> |