Kaydet (Commit) 644d22e6 authored tarafından Caolán McNamara's avatar Caolán McNamara

convert insert rule

Change-Id: Ic4191a6dd38ef619efc4e4dc5ed6fe418c0942f4
üst de661fd7
...@@ -156,7 +156,6 @@ $(eval $(call gb_SrsTarget_add_files,sw/res,\ ...@@ -156,7 +156,6 @@ $(eval $(call gb_SrsTarget_add_files,sw/res,\
sw/source/ui/misc/glosbib.src \ sw/source/ui/misc/glosbib.src \
sw/source/ui/misc/glossary.src \ sw/source/ui/misc/glossary.src \
sw/source/ui/misc/insfnote.src \ sw/source/ui/misc/insfnote.src \
sw/source/ui/misc/insrule.src \
sw/source/ui/misc/num.src \ sw/source/ui/misc/num.src \
sw/source/ui/misc/numberingtypelistbox.src \ sw/source/ui/misc/numberingtypelistbox.src \
sw/source/ui/misc/outline.src \ sw/source/ui/misc/outline.src \
......
...@@ -14,6 +14,7 @@ $(eval $(call gb_UI_add_uifiles,modules/swriter,\ ...@@ -14,6 +14,7 @@ $(eval $(call gb_UI_add_uifiles,modules/swriter,\
sw/uiconfig/swriter/ui/charurlpage \ sw/uiconfig/swriter/ui/charurlpage \
sw/uiconfig/swriter/ui/columnwidth \ sw/uiconfig/swriter/ui/columnwidth \
sw/uiconfig/swriter/ui/converttexttable \ sw/uiconfig/swriter/ui/converttexttable \
sw/uiconfig/swriter/ui/horizontalrule \
sw/uiconfig/swriter/ui/insertbreak \ sw/uiconfig/swriter/ui/insertbreak \
sw/uiconfig/swriter/ui/inserttable \ sw/uiconfig/swriter/ui/inserttable \
sw/uiconfig/swriter/ui/linenumbering \ sw/uiconfig/swriter/ui/linenumbering \
......
...@@ -69,7 +69,6 @@ ...@@ -69,7 +69,6 @@
#define HID_VS_BULLET "SW_HID_VS_BULLET" #define HID_VS_BULLET "SW_HID_VS_BULLET"
#define HID_VS_NUMBMP "SW_HID_VS_NUMBMP" #define HID_VS_NUMBMP "SW_HID_VS_NUMBMP"
#define HID_VS_RULER "SW_HID_VS_RULER" #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_INSERT_ABSTRACT "SW_HID_INSERT_ABSTRACT"
#define HID_NAVI_TBX1 "SW_HID_NAVI_TBX1" #define HID_NAVI_TBX1 "SW_HID_NAVI_TBX1"
#define HID_NAVI_TBX2 "SW_HID_NAVI_TBX2" #define HID_NAVI_TBX2 "SW_HID_NAVI_TBX2"
......
...@@ -444,8 +444,7 @@ public: ...@@ -444,8 +444,7 @@ public:
virtual VclAbstractDialog* CreateTitlePageDlg ( Window * pParent ) = 0; virtual VclAbstractDialog* CreateTitlePageDlg ( Window * pParent ) = 0;
virtual VclAbstractDialog * CreateVclSwViewDialog( int nResId, virtual VclAbstractDialog * CreateVclSwViewDialog( int nResId,
SwView& rView, sal_Bool bCol = sal_False ) = 0; //add for SwInsRowColDlg, SwLineNumberingDlg SwView& rView, sal_Bool bCol = sal_False ) = 0; //add for SwInsRowColDlg, SwLineNumberingDlg
virtual AbstractInsertGrfRulerDlg* CreateInsertGrfRulerDlg( int nResId, virtual AbstractInsertGrfRulerDlg* CreateInsertGrfRulerDlg(Window * pParent) = 0; //add for SwInsertGrfRulerDlg
Window * pParent ) = 0; //add for SwInsertGrfRulerDlg
virtual AbstractInsTableDlg* CreateInsTableDlg(SwView& rView) = 0; //add for SwInsTableDlg virtual AbstractInsTableDlg* CreateInsTableDlg(SwView& rView) = 0; //add for SwInsTableDlg
virtual AbstractJavaEditDialog* CreateJavaEditDialog( int nResId, virtual AbstractJavaEditDialog* CreateJavaEditDialog( int nResId,
Window* pParent, SwWrtShell* pWrtSh ) = 0; //add for SwJavaEditDialog Window* pParent, SwWrtShell* pWrtSh ) = 0; //add for SwJavaEditDialog
......
...@@ -655,6 +655,11 @@ String STR_COL ...@@ -655,6 +655,11 @@ String STR_COL
Text [ en-US ] = "Column" ; Text [ en-US ] = "Column" ;
}; };
String STR_SIMPLE
{
Text [ en-US ] = "Plain" ;
};
ToolBox RID_MODULE_TOOLBOX ToolBox RID_MODULE_TOOLBOX
{ {
HelpID = HID_MODULE_TOOLBOX ; HelpID = HID_MODULE_TOOLBOX ;
......
...@@ -1243,22 +1243,11 @@ VclAbstractDialog * SwAbstractDialogFactory_Impl::CreateVclSwViewDialog( int nRe ...@@ -1243,22 +1243,11 @@ VclAbstractDialog * SwAbstractDialogFactory_Impl::CreateVclSwViewDialog( int nRe
return 0; return 0;
} }
AbstractInsertGrfRulerDlg * SwAbstractDialogFactory_Impl::CreateInsertGrfRulerDlg( int nResId, //add for SwInsertGrfRulerDlg
Window * pParent ) //add for SwInsertGrfRulerDlg AbstractInsertGrfRulerDlg * SwAbstractDialogFactory_Impl::CreateInsertGrfRulerDlg(Window * pParent)
{ {
SwInsertGrfRulerDlg* pDlg=NULL; SwInsertGrfRulerDlg* pDlg = new SwInsertGrfRulerDlg(pParent);
switch ( nResId ) return new AbstractInsertGrfRulerDlg_Impl(pDlg);
{
case DLG_INSERT_RULER :
pDlg = new SwInsertGrfRulerDlg( pParent );
break;
default:
break;
}
if ( pDlg )
return new AbstractInsertGrfRulerDlg_Impl( pDlg );
return 0;
} }
AbstractInsTableDlg * SwAbstractDialogFactory_Impl::CreateInsTableDlg(SwView& rView) //add for SwInsTableDlg AbstractInsTableDlg * SwAbstractDialogFactory_Impl::CreateInsTableDlg(SwView& rView) //add for SwInsTableDlg
......
...@@ -523,8 +523,7 @@ public: ...@@ -523,8 +523,7 @@ public:
virtual VclAbstractDialog * CreateTitlePageDlg ( Window * pParent ); virtual VclAbstractDialog * CreateTitlePageDlg ( Window * pParent );
virtual VclAbstractDialog * CreateVclSwViewDialog( int nResId, virtual VclAbstractDialog * CreateVclSwViewDialog( int nResId,
SwView& rView, sal_Bool bCol = sal_False ); //add for SwInsRowColDlg, SwLineNumberingDlg SwView& rView, sal_Bool bCol = sal_False ); //add for SwInsRowColDlg, SwLineNumberingDlg
virtual AbstractInsertGrfRulerDlg* CreateInsertGrfRulerDlg( int nResId, virtual AbstractInsertGrfRulerDlg* CreateInsertGrfRulerDlg(Window * pParent); //add for SwInsertGrfRulerDlg
Window * pParent ); //add for SwInsertGrfRulerDlg
virtual AbstractInsTableDlg* CreateInsTableDlg(SwView& rView); //add for SwInsTableDlg virtual AbstractInsTableDlg* CreateInsTableDlg(SwView& rView); //add for SwInsTableDlg
virtual AbstractJavaEditDialog* CreateJavaEditDialog( int nResId, virtual AbstractJavaEditDialog* CreateJavaEditDialog( int nResId,
Window* pParent, SwWrtShell* pWrtSh ); //add for SwJavaEditDialog Window* pParent, SwWrtShell* pWrtSh ); //add for SwJavaEditDialog
......
...@@ -114,8 +114,9 @@ ...@@ -114,8 +114,9 @@
#define STR_NUMERIC (RC_APP_BEGIN + 126) #define STR_NUMERIC (RC_APP_BEGIN + 126)
#define STR_COL (RC_APP_BEGIN + 127) #define STR_COL (RC_APP_BEGIN + 127)
#define STR_ROW (RC_APP_BEGIN + 128) #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 #if APP_ACT_END > RC_APP_END
#error Resource-Id Ueberlauf in #file, #line #error Resource-Id Ueberlauf in #file, #line
......
...@@ -28,18 +28,14 @@ class ValueSet; ...@@ -28,18 +28,14 @@ class ValueSet;
class SwInsertGrfRulerDlg : public SfxModalDialog class SwInsertGrfRulerDlg : public SfxModalDialog
{ {
FixedLine aSelectionFL; OKButton* m_pOkPB;
OKButton aOkPB; SwRulerValueSet* m_pExampleVS;
CancelButton aCancelPB;
HelpButton aHelpPB;
std::vector<String> aGrfNames; std::vector<String> aGrfNames;
String sSimple; String sSimple;
String sRulers; String sRulers;
sal_uInt16 nSelPos; sal_uInt16 nSelPos;
SwRulerValueSet* pExampleVS;
protected: protected:
DECL_LINK(SelectHdl, ValueSet*); DECL_LINK(SelectHdl, ValueSet*);
DECL_LINK(DoubleClickHdl, void *); DECL_LINK(DoubleClickHdl, void *);
......
...@@ -31,7 +31,6 @@ ...@@ -31,7 +31,6 @@
#define DLG_NUM_NAMES (RC_MISC_BEGIN + 18) #define DLG_NUM_NAMES (RC_MISC_BEGIN + 18)
#define DLG_SORTING (RC_MISC_BEGIN + 19) #define DLG_SORTING (RC_MISC_BEGIN + 19)
#define DLG_RENAME_GLOS (RC_MISC_BEGIN + 25) #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_REDLINE_ACCEPT (RC_MISC_BEGIN + 29)
#define DLG_TAB_OUTLINE (RC_MISC_BEGIN + 31) #define DLG_TAB_OUTLINE (RC_MISC_BEGIN + 31)
......
...@@ -37,49 +37,44 @@ ...@@ -37,49 +37,44 @@
#include "docsh.hxx" #include "docsh.hxx"
#include "insrule.hxx" #include "insrule.hxx"
#include "swvset.hxx" #include "swvset.hxx"
#include "insrule.hrc" #include "app.hrc"
#include "misc.hrc" #include "misc.hrc"
#include "helpid.h" #include "helpid.h"
SwInsertGrfRulerDlg::SwInsertGrfRulerDlg( Window* pParent ) : SwInsertGrfRulerDlg::SwInsertGrfRulerDlg( Window* pParent )
SfxModalDialog(pParent, SW_RES(DLG_INSERT_RULER)), : SfxModalDialog(pParent, "HorizontalRuleDialog", "modules/swriter/ui/horizontalrule.ui")
aSelectionFL(this, SW_RES(FL_SEL )), , sSimple(SW_RESSTR(STR_SIMPLE))
aOkPB (this, SW_RES(PB_OK )), , nSelPos(USHRT_MAX)
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 )))
{ {
FreeResource(); get(m_pOkPB, "ok");
pExampleVS->SetLineCount(6); get(m_pExampleVS, "rulers");
pExampleVS->SetColCount(1);
pExampleVS->SetSelectHdl(LINK(this, SwInsertGrfRulerDlg, SelectHdl)); m_pExampleVS->SetLineCount(6);
pExampleVS->SetDoubleClickHdl(LINK(this, SwInsertGrfRulerDlg, DoubleClickHdl)); m_pExampleVS->SetColCount(1);
pExampleVS->GrabFocus(); m_pExampleVS->SetSelectHdl(LINK(this, SwInsertGrfRulerDlg, SelectHdl));
m_pExampleVS->SetDoubleClickHdl(LINK(this, SwInsertGrfRulerDlg, DoubleClickHdl));
// determine graphic name // determine graphic name
GalleryExplorer::BeginLocking(GALLERY_THEME_RULERS); GalleryExplorer::BeginLocking(GALLERY_THEME_RULERS);
GalleryExplorer::FillObjList( GALLERY_THEME_RULERS, aGrfNames ); GalleryExplorer::FillObjList( GALLERY_THEME_RULERS, aGrfNames );
pExampleVS->SetHelpId(HID_VS_RULER); m_pExampleVS->SetHelpId(HID_VS_RULER);
Color aColor(COL_WHITE); Color aColor(COL_WHITE);
pExampleVS->InsertItem( 1, 1); m_pExampleVS->InsertItem( 1, 1);
pExampleVS->SetItemText( 1, sSimple); m_pExampleVS->SetItemText( 1, sSimple);
for(sal_uInt16 i = 1; i <= aGrfNames.size(); i++) for(sal_uInt16 i = 1; i <= aGrfNames.size(); i++)
{ {
pExampleVS->InsertItem( i + 1, i); m_pExampleVS->InsertItem( i + 1, i);
pExampleVS->SetItemText( i + 1, aGrfNames[i-1]); m_pExampleVS->SetItemText( i + 1, aGrfNames[i-1]);
} }
pExampleVS->Show();
m_pExampleVS->SelectItem(1);
m_pExampleVS->GrabFocus();
} }
SwInsertGrfRulerDlg::~SwInsertGrfRulerDlg() SwInsertGrfRulerDlg::~SwInsertGrfRulerDlg()
{ {
GalleryExplorer::EndLocking(GALLERY_THEME_RULERS); GalleryExplorer::EndLocking(GALLERY_THEME_RULERS);
delete pExampleVS;
} }
String SwInsertGrfRulerDlg::GetGraphicName() String SwInsertGrfRulerDlg::GetGraphicName()
...@@ -96,7 +91,7 @@ String SwInsertGrfRulerDlg::GetGraphicName() ...@@ -96,7 +91,7 @@ String SwInsertGrfRulerDlg::GetGraphicName()
IMPL_LINK(SwInsertGrfRulerDlg, SelectHdl, ValueSet*, pVS) IMPL_LINK(SwInsertGrfRulerDlg, SelectHdl, ValueSet*, pVS)
{ {
nSelPos = pVS->GetSelectItemId(); nSelPos = pVS->GetSelectItemId();
aOkPB.Enable(); m_pOkPB->Enable();
return 0; return 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
/*
* 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" ;
};
...@@ -660,8 +660,7 @@ void SwTextShell::ExecInsert(SfxRequest &rReq) ...@@ -660,8 +660,7 @@ void SwTextShell::ExecInsert(SfxRequest &rReq)
{ {
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
OSL_ENSURE(pFact, "Dialogdiet fail!"); OSL_ENSURE(pFact, "Dialogdiet fail!");
AbstractInsertGrfRulerDlg* pDlg = pFact->CreateInsertGrfRulerDlg( DLG_INSERT_RULER, AbstractInsertGrfRulerDlg* pDlg = pFact->CreateInsertGrfRulerDlg(pParent);
pParent );
OSL_ENSURE(pDlg, "Dialogdiet fail!"); OSL_ENSURE(pDlg, "Dialogdiet fail!");
// MessageBox fuer fehlende Grafiken // MessageBox fuer fehlende Grafiken
if(!pDlg->HasImages()) if(!pDlg->HasImages())
......
<?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">&lt;b&gt;Selection&lt;/b&gt;</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>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment