tdf#156795, tdf#156109 Avoid typesetter language: orphan, widow control
Instead use descriptive language to make it obvious what these options are for. Also invert the logic of the "Do not split paragraph" option as suggested in tdf#156109. Change-Id: I619c0558597aff26b8b7fafea3548d8bf1f24a36 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155769 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
This commit is contained in:
@@ -219,7 +219,7 @@ private:
|
||||
weld::TriStateEnabled aPageBreakState;
|
||||
weld::TriStateEnabled aApplyCollState;
|
||||
weld::TriStateEnabled aPageNumState;
|
||||
weld::TriStateEnabled aKeepTogetherState;
|
||||
weld::TriStateEnabled aAllowSplitState;
|
||||
weld::TriStateEnabled aKeepParaState;
|
||||
weld::TriStateEnabled aOrphanState;
|
||||
weld::TriStateEnabled aWidowState;
|
||||
@@ -255,7 +255,7 @@ private:
|
||||
std::unique_ptr<weld::SpinButton> m_xPagenumEdit;
|
||||
|
||||
// paragraph division
|
||||
std::unique_ptr<weld::CheckButton> m_xKeepTogetherBox;
|
||||
std::unique_ptr<weld::CheckButton> m_xAllowSplitBox;
|
||||
std::unique_ptr<weld::CheckButton> m_xKeepParaBox;
|
||||
|
||||
// orphan/widow
|
||||
@@ -271,12 +271,12 @@ private:
|
||||
void PageNumBoxClickHdl();
|
||||
void ApplyCollClickHdl();
|
||||
void PageBreakHdl();
|
||||
void KeepTogetherHdl();
|
||||
void AllowSplitHdl();
|
||||
void OrphanHdl();
|
||||
void WidowHdl();
|
||||
|
||||
DECL_LINK(PageBreakHdl_Impl, weld::Toggleable&, void);
|
||||
DECL_LINK(KeepTogetherHdl_Impl, weld::Toggleable&, void);
|
||||
DECL_LINK(AllowSplitHdl_Impl, weld::Toggleable&, void);
|
||||
DECL_LINK(WidowHdl_Impl, weld::Toggleable&, void);
|
||||
DECL_LINK(OrphanHdl_Impl, weld::Toggleable&, void);
|
||||
DECL_LINK(HyphenClickHdl_Impl, weld::Toggleable&, void);
|
||||
|
||||
@@ -1753,9 +1753,9 @@ bool SvxExtParagraphTabPage::FillItemSet( SfxItemSet* rOutSet )
|
||||
|
||||
// paragraph split
|
||||
_nWhich = GetWhich( SID_ATTR_PARA_SPLIT );
|
||||
eState = m_xKeepTogetherBox->get_state();
|
||||
eState = m_xAllowSplitBox->get_state();
|
||||
|
||||
if (m_xKeepTogetherBox->get_state_changed_from_saved())
|
||||
if (m_xAllowSplitBox->get_state_changed_from_saved())
|
||||
{
|
||||
pOld = GetOldItem( *rOutSet, SID_ATTR_PARA_SPLIT );
|
||||
|
||||
@@ -2056,13 +2056,13 @@ void SvxExtParagraphTabPage::Reset( const SfxItemSet* rSet )
|
||||
{
|
||||
const SvxFormatSplitItem& rSplit =
|
||||
static_cast<const SvxFormatSplitItem&>(rSet->Get( _nWhich ));
|
||||
aKeepTogetherState.bTriStateEnabled = false;
|
||||
aAllowSplitState.bTriStateEnabled = false;
|
||||
|
||||
if ( !rSplit.GetValue() )
|
||||
m_xKeepTogetherBox->set_state(TRISTATE_TRUE);
|
||||
m_xAllowSplitBox->set_state(TRISTATE_FALSE);
|
||||
else
|
||||
{
|
||||
m_xKeepTogetherBox->set_state(TRISTATE_FALSE);
|
||||
m_xAllowSplitBox->set_state(TRISTATE_TRUE);
|
||||
// default widows and orphans to enabled
|
||||
m_xWidowBox->set_sensitive(true);
|
||||
m_xOrphanBox->set_sensitive(true);
|
||||
@@ -2113,12 +2113,12 @@ void SvxExtParagraphTabPage::Reset( const SfxItemSet* rSet )
|
||||
aOrphanState.eState = m_xOrphanBox->get_state();
|
||||
}
|
||||
else if ( SfxItemState::DONTCARE == eItemState )
|
||||
m_xKeepTogetherBox->set_state(TRISTATE_INDET);
|
||||
m_xAllowSplitBox->set_state(TRISTATE_INDET);
|
||||
else
|
||||
m_xKeepTogetherBox->set_sensitive(false);
|
||||
m_xAllowSplitBox->set_sensitive(false);
|
||||
|
||||
// so that everything is enabled correctly
|
||||
KeepTogetherHdl();
|
||||
AllowSplitHdl();
|
||||
WidowHdl();
|
||||
OrphanHdl();
|
||||
ChangesApplied();
|
||||
@@ -2144,7 +2144,7 @@ void SvxExtParagraphTabPage::ChangesApplied()
|
||||
m_xApplyCollBox->save_value();
|
||||
m_xPageNumBox->save_state();
|
||||
m_xPagenumEdit->save_value();
|
||||
m_xKeepTogetherBox->save_state();
|
||||
m_xAllowSplitBox->save_state();
|
||||
m_xKeepParaBox->save_state();
|
||||
m_xWidowBox->save_state();
|
||||
m_xOrphanBox->save_state();
|
||||
@@ -2202,7 +2202,7 @@ SvxExtParagraphTabPage::SvxExtParagraphTabPage(weld::Container* pPage, weld::Dia
|
||||
, m_xPageNumBox(m_xBuilder->weld_check_button("labelPageNum"))
|
||||
, m_xPagenumEdit(m_xBuilder->weld_spin_button("spinPageNumber"))
|
||||
// Options
|
||||
, m_xKeepTogetherBox(m_xBuilder->weld_check_button("checkSplitPara"))
|
||||
, m_xAllowSplitBox(m_xBuilder->weld_check_button("checkSplitPara"))
|
||||
, m_xKeepParaBox(m_xBuilder->weld_check_button("checkKeepPara"))
|
||||
, m_xOrphanBox(m_xBuilder->weld_check_button("checkOrphan"))
|
||||
, m_xOrphanRowNo(m_xBuilder->weld_spin_button("spinOrphan"))
|
||||
@@ -2216,7 +2216,7 @@ SvxExtParagraphTabPage::SvxExtParagraphTabPage(weld::Container* pPage, weld::Dia
|
||||
|
||||
m_xHyphenBox->connect_toggled(LINK(this, SvxExtParagraphTabPage, HyphenClickHdl_Impl));
|
||||
m_xPageBreakBox->connect_toggled(LINK(this, SvxExtParagraphTabPage, PageBreakHdl_Impl));
|
||||
m_xKeepTogetherBox->connect_toggled(LINK(this, SvxExtParagraphTabPage, KeepTogetherHdl_Impl));
|
||||
m_xAllowSplitBox->connect_toggled(LINK(this, SvxExtParagraphTabPage, AllowSplitHdl_Impl));
|
||||
m_xWidowBox->connect_toggled(LINK(this, SvxExtParagraphTabPage, WidowHdl_Impl));
|
||||
m_xOrphanBox->connect_toggled(LINK(this, SvxExtParagraphTabPage, OrphanHdl_Impl));
|
||||
m_xApplyCollBtn->connect_toggled(LINK(this, SvxExtParagraphTabPage, ApplyCollClickHdl_Impl));
|
||||
@@ -2318,17 +2318,17 @@ IMPL_LINK(SvxExtParagraphTabPage, PageBreakHdl_Impl, weld::Toggleable&, rToggle,
|
||||
PageBreakHdl();
|
||||
}
|
||||
|
||||
void SvxExtParagraphTabPage::KeepTogetherHdl()
|
||||
void SvxExtParagraphTabPage::AllowSplitHdl()
|
||||
{
|
||||
bool bEnable = m_xKeepTogetherBox->get_state() == TRISTATE_FALSE;
|
||||
bool bEnable = m_xAllowSplitBox->get_state() == TRISTATE_TRUE;
|
||||
m_xWidowBox->set_sensitive(bEnable);
|
||||
m_xOrphanBox->set_sensitive(bEnable);
|
||||
}
|
||||
|
||||
IMPL_LINK(SvxExtParagraphTabPage, KeepTogetherHdl_Impl, weld::Toggleable&, rToggle, void)
|
||||
IMPL_LINK(SvxExtParagraphTabPage, AllowSplitHdl_Impl, weld::Toggleable&, rToggle, void)
|
||||
{
|
||||
aKeepTogetherState.ButtonToggled(rToggle);
|
||||
KeepTogetherHdl();
|
||||
aAllowSplitState.ButtonToggled(rToggle);
|
||||
AllowSplitHdl();
|
||||
}
|
||||
|
||||
void SvxExtParagraphTabPage::WidowHdl()
|
||||
@@ -2338,11 +2338,11 @@ void SvxExtParagraphTabPage::WidowHdl()
|
||||
case TRISTATE_TRUE:
|
||||
m_xWidowRowNo->set_sensitive(true);
|
||||
m_xWidowRowLabel->set_sensitive(true);
|
||||
m_xKeepTogetherBox->set_sensitive(false);
|
||||
m_xAllowSplitBox->set_sensitive(true);
|
||||
break;
|
||||
case TRISTATE_FALSE:
|
||||
if (m_xOrphanBox->get_state() == TRISTATE_FALSE)
|
||||
m_xKeepTogetherBox->set_sensitive(true);
|
||||
m_xAllowSplitBox->set_sensitive(false);
|
||||
[[fallthrough]];
|
||||
case TRISTATE_INDET:
|
||||
m_xWidowRowNo->set_sensitive(false);
|
||||
@@ -2370,12 +2370,12 @@ void SvxExtParagraphTabPage::OrphanHdl()
|
||||
case TRISTATE_TRUE:
|
||||
m_xOrphanRowNo->set_sensitive(true);
|
||||
m_xOrphanRowLabel->set_sensitive(true);
|
||||
m_xKeepTogetherBox->set_sensitive(false);
|
||||
m_xAllowSplitBox->set_sensitive(true);
|
||||
break;
|
||||
|
||||
case TRISTATE_FALSE:
|
||||
if (m_xWidowBox->get_state() == TRISTATE_FALSE)
|
||||
m_xKeepTogetherBox->set_sensitive(true);
|
||||
m_xAllowSplitBox->set_sensitive(true);
|
||||
[[fallthrough]];
|
||||
case TRISTATE_INDET:
|
||||
m_xOrphanRowNo->set_sensitive(false);
|
||||
|
||||
@@ -545,7 +545,7 @@
|
||||
<property name="column-spacing">12</property>
|
||||
<child>
|
||||
<object class="GtkCheckButton" id="checkSplitPara">
|
||||
<property name="label" translatable="yes" context="textflowpage|checkSplitPara">_Do not split paragraph</property>
|
||||
<property name="label" translatable="yes" context="textflowpage|checkSplitPara">_Allow to split paragraph</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="receives-default">False</property>
|
||||
@@ -560,7 +560,7 @@
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">0</property>
|
||||
<property name="top-attach">0</property>
|
||||
<property name="top-attach">1</property>
|
||||
<property name="width">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
@@ -581,16 +581,18 @@
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">0</property>
|
||||
<property name="top-attach">1</property>
|
||||
<property name="top-attach">0</property>
|
||||
<property name="width">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkCheckButton" id="checkOrphan">
|
||||
<property name="label" translatable="yes" context="textflowpage|checkOrphan">_Orphan control</property>
|
||||
<property name="label" translatable="yes" context="textflowpage|checkOrphan">No split at _beginning of paragraph</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="receives-default">False</property>
|
||||
<property name="tooltip-text" translatable="yes" context="textflowpage|checkOrphan">Number of lines, that will be kept together at the beginning of the paragraph (orphan control).</property>
|
||||
<property name="margin-start">12</property>
|
||||
<property name="use-underline">True</property>
|
||||
<property name="inconsistent">True</property>
|
||||
<property name="draw-indicator">True</property>
|
||||
@@ -610,10 +612,12 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkCheckButton" id="checkWidow">
|
||||
<property name="label" translatable="yes" context="textflowpage|checkWidow">_Widow control</property>
|
||||
<property name="label" translatable="yes" context="textflowpage|checkWidow">No split at _end of paragraph</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">True</property>
|
||||
<property name="receives-default">False</property>
|
||||
<property name="tooltip-text" translatable="yes" context="textflowpage|checkOrphan">Number of lines, that will be kept together at the end of the paragraph (widow control).</property>
|
||||
<property name="margin-start">12</property>
|
||||
<property name="use-underline">True</property>
|
||||
<property name="inconsistent">True</property>
|
||||
<property name="draw-indicator">True</property>
|
||||
@@ -704,7 +708,7 @@
|
||||
<object class="GtkLabel" id="labelOptions">
|
||||
<property name="visible">True</property>
|
||||
<property name="can-focus">False</property>
|
||||
<property name="label" translatable="yes" context="textflowpage|labelOptions">Options</property>
|
||||
<property name="label" translatable="yes" context="textflowpage|labelOptions">Split Options</property>
|
||||
<attributes>
|
||||
<attribute name="weight" value="bold"/>
|
||||
</attributes>
|
||||
|
||||
Reference in New Issue
Block a user