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

lets just switch directly on the EID_OPTIONS

and remove the intermediate resource ids used
as proxies for them

Change-Id: I3ef542d1eaef274dbefed0b0bb76c6e413c6ce80
üst a932be69
......@@ -422,11 +422,6 @@
#define RID_SVXSTR_DEL_SPACES_AT_STT_END (RID_SVX_START + 1223)
#define RID_SVXSTR_DEL_SPACES_BETWEEN_LINES (RID_SVX_START + 1224)
// from optlingu.src
#define STR_NUM_PRE_BREAK_DLG (RID_SVX_START + 1225)
#define STR_NUM_POST_BREAK_DLG (RID_SVX_START + 1226)
#define STR_NUM_MIN_WORDLEN_DLG (RID_SVX_START + 1227)
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -306,53 +306,6 @@ void BrwStringDic_Impl::Paint(
rDev.SetFont( aOldFont );
}
class OptionsBreakSet : public ModalDialog
{
VclFrame* m_pBeforeFrame;
VclFrame* m_pAfterFrame;
VclFrame* m_pMinimalFrame;
NumericField* m_pBreakNF;
public:
OptionsBreakSet(Window* pParent, int nRID) :
ModalDialog(pParent, "BreakNumberOption", "cui/ui/breaknumberoption.ui")
{
get( m_pBeforeFrame, "beforeframe");
get( m_pAfterFrame, "afterframe");
get( m_pMinimalFrame, "miniframe");
get( m_pBreakNF, "breaknumber");
DBG_ASSERT( STR_NUM_PRE_BREAK_DLG == nRID ||
STR_NUM_POST_BREAK_DLG == nRID ||
STR_NUM_MIN_WORDLEN_DLG == nRID, "unexpected RID" );
if ( nRID != -1 )
{
if( nRID == STR_NUM_PRE_BREAK_DLG )
{
m_pAfterFrame ->Hide();
m_pMinimalFrame->Hide();
}
if( nRID == STR_NUM_POST_BREAK_DLG )
{
m_pBeforeFrame ->Hide();
m_pMinimalFrame->Hide();
}
if( nRID == STR_NUM_MIN_WORDLEN_DLG )
{
m_pAfterFrame ->Hide();
m_pBeforeFrame->Hide();
}
}
}
NumericField& GetNumericFld()
{
return *m_pBreakNF;
}
};
/*--------------------------------------------------
Entry IDs for options listbox of dialog
--------------------------------------------------*/
......@@ -387,13 +340,55 @@ static const char * aEidToPropName[] =
UPN_IS_HYPH_SPECIAL // EID_HYPH_SPECIAL
};
static inline String lcl_GetPropertyName( EID_OPTIONS eEntryId )
static inline OUString lcl_GetPropertyName( EID_OPTIONS eEntryId )
{
DBG_ASSERT( (unsigned int) eEntryId < SAL_N_ELEMENTS(aEidToPropName), "index out of range" );
return OUString::createFromAscii( aEidToPropName[ (int) eEntryId ] );
}
class OptionsBreakSet : public ModalDialog
{
VclFrame* m_pBeforeFrame;
VclFrame* m_pAfterFrame;
VclFrame* m_pMinimalFrame;
NumericField* m_pBreakNF;
public:
OptionsBreakSet(Window* pParent, sal_uInt16 nRID)
: ModalDialog(pParent, "BreakNumberOption",
"cui/ui/breaknumberoption.ui")
{
get(m_pBeforeFrame, "beforeframe");
get(m_pAfterFrame, "afterframe");
get(m_pMinimalFrame, "miniframe");
assert(EID_NUM_PRE_BREAK == nRID ||
EID_NUM_POST_BREAK == nRID ||
EID_NUM_MIN_WORDLEN == nRID); //unexpected ID
if (nRID == EID_NUM_PRE_BREAK)
{
m_pBeforeFrame->Show();
get(m_pBreakNF, "beforebreak");
}
else if(nRID == EID_NUM_POST_BREAK)
{
m_pAfterFrame->Show();
get(m_pBreakNF, "afterbreak");
}
else if(nRID == EID_NUM_MIN_WORDLEN)
{
m_pMinimalFrame->Show();
get(m_pBreakNF, "wordlength");
}
}
NumericField& GetNumericFld()
{
return *m_pBreakNF;
}
};
// class OptionsUserData -------------------------------------------------
class OptionsUserData
......@@ -1788,16 +1783,7 @@ IMPL_LINK( SvxLinguTabPage, ClickHdl_Impl, PushButton *, pBtn )
OptionsUserData aData( (sal_uLong)pEntry->GetUserData() );
if(aData.HasNumericValue())
{
int nRID = -1;
switch (aData.GetEntryId())
{
case EID_NUM_PRE_BREAK : nRID = STR_NUM_PRE_BREAK_DLG; break;
case EID_NUM_POST_BREAK : nRID = STR_NUM_POST_BREAK_DLG; break;
case EID_NUM_MIN_WORDLEN: nRID = STR_NUM_MIN_WORDLEN_DLG; break;
default:
OSL_FAIL( "unexpected case" );
}
sal_uInt16 nRID = aData.GetEntryId();
OptionsBreakSet aDlg( this, nRID );
aDlg.GetNumericFld().SetValue( aData.GetNumericValue() );
if (RET_OK == aDlg.Execute() )
......
......@@ -129,21 +129,6 @@ ModalDialog RID_SVXDLG_EDIT_MODULES
};
};
// Strings ---------------------------------------------------------------
String STR_NUM_PRE_BREAK_DLG
{
Text [ en-US ] = "Characters before break";
};
String STR_NUM_POST_BREAK_DLG
{
Text [ en-US ] = "Characters after break";
};
String STR_NUM_MIN_WORDLEN_DLG
{
Text [ en-US ] = "Minimal word length";
};
// RID_SFXPAGE_LINGU --------------------------------------------------------
TabPage RID_SFXPAGE_LINGU
......
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<!-- interface-requires gtk+ 3.0 -->
<object class="GtkAdjustment" id="adjustment1">
<property name="lower">2</property>
<property name="upper">9</property>
<property name="value">1</property>
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</object>
<object class="GtkDialog" id="BreakNumberOption">
<property name="can_focus">False</property>
<property name="border_width">6</property>
......@@ -16,12 +9,12 @@
<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="orientation">vertical</property>
<property name="layout_style">start</property>
<property name="layout_style">end</property>
<child>
<object class="GtkButton" id="ok">
<property name="label">gtk-ok</property>
......@@ -66,8 +59,8 @@
<property name="can_focus">False</property>
<child>
<object class="GtkFrame" id="beforeframe">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="no_show_all">True</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
......@@ -77,7 +70,14 @@
<property name="top_padding">6</property>
<property name="left_padding">12</property>
<child>
<placeholder/>
<object class="GtkSpinButton" id="beforebreak">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="halign">start</property>
<property name="invisible_char"></property>
<property name="invisible_char_set">True</property>
<property name="adjustment">adjustment1</property>
</object>
</child>
</object>
</child>
......@@ -101,8 +101,8 @@
</child>
<child>
<object class="GtkFrame" id="afterframe">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="no_show_all">True</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
......@@ -112,7 +112,14 @@
<property name="top_padding">6</property>
<property name="left_padding">12</property>
<child>
<placeholder/>
<object class="GtkSpinButton" id="afterbreak">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="halign">start</property>
<property name="invisible_char"></property>
<property name="invisible_char_set">True</property>
<property name="adjustment">adjustment1</property>
</object>
</child>
</object>
</child>
......@@ -136,8 +143,8 @@
</child>
<child>
<object class="GtkFrame" id="miniframe">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="no_show_all">True</property>
<property name="label_xalign">0</property>
<property name="shadow_type">none</property>
<child>
......@@ -147,7 +154,14 @@
<property name="top_padding">6</property>
<property name="left_padding">12</property>
<child>
<placeholder/>
<object class="GtkSpinButton" id="wordlength">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="halign">start</property>
<property name="invisible_char"></property>
<property name="invisible_char_set">True</property>
<property name="adjustment">adjustment1</property>
</object>
</child>
</object>
</child>
......@@ -169,41 +183,6 @@
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkAlignment" id="alignment4">
<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="GtkGrid" id="grid5">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="column_spacing">12</property>
<child>
<object class="GtkSpinButton" id="breaknumber">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char"></property>
<property name="adjustment">adjustment1</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
</object>
</child>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">3</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
......@@ -218,4 +197,11 @@
<action-widget response="0">cancel</action-widget>
</action-widgets>
</object>
<object class="GtkAdjustment" id="adjustment1">
<property name="lower">2</property>
<property name="upper">9</property>
<property name="value">1</property>
<property name="step_increment">1</property>
<property name="page_increment">10</property>
</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