summaryrefslogtreecommitdiff
path: root/cui/source/tabpages/paragrph.cxx
diff options
context:
space:
mode:
authorSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2019-11-28 11:13:44 +0100
committerSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2019-12-06 12:00:37 +0100
commit72bd0df107ee47c4d54fa88b4960d32ea03e9f69 (patch)
treef4ad346dbf636f32211298aace3a4a34957058f3 /cui/source/tabpages/paragrph.cxx
parentd8c36a8771398327ba83884a2e0aa82a6d7c8492 (diff)
tdf#121658 Add option to not hyphenate words in CAPS
* Add checkbox to pagraph dialog * Store property in paragraph model * Move docx import/export from grabbag to paragraph model * Add ODF import/export * Add ODF unit test * Add layout test Change-Id: Id4e7c5a0ad145c042f862995d227c31ae2aa0abd Reviewed-on: https://gerrit.libreoffice.org/83979 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
Diffstat (limited to 'cui/source/tabpages/paragrph.cxx')
-rw-r--r--cui/source/tabpages/paragrph.cxx9
1 files changed, 9 insertions, 0 deletions
diff --git a/cui/source/tabpages/paragrph.cxx b/cui/source/tabpages/paragrph.cxx
index 8cfb01fa1a31..0c9734d197b4 100644
--- a/cui/source/tabpages/paragrph.cxx
+++ b/cui/source/tabpages/paragrph.cxx
@@ -1373,6 +1373,7 @@ bool SvxExtParagraphTabPage::FillItemSet( SfxItemSet* rOutSet )
const SfxPoolItem* pOld = GetOldItem( *rOutSet, SID_ATTR_PARA_HYPHENZONE );
if ( m_xHyphenBox->get_state_changed_from_saved() ||
+ m_xHyphenNoCapsBox->get_state_changed_from_saved() ||
m_xExtHyphenBeforeBox->get_value_changed_from_saved() ||
m_xExtHyphenAfterBox->get_value_changed_from_saved() ||
m_xMaxHyphenEdit->get_value_changed_from_saved() )
@@ -1380,6 +1381,7 @@ bool SvxExtParagraphTabPage::FillItemSet( SfxItemSet* rOutSet )
SvxHyphenZoneItem aHyphen(
static_cast<const SvxHyphenZoneItem&>(GetItemSet().Get( _nWhich )) );
aHyphen.SetHyphen( eHyphenState == TRISTATE_TRUE );
+ aHyphen.SetNoCapsHyphenation(m_xHyphenNoCapsBox->get_state() == TRISTATE_TRUE);
if ( eHyphenState == TRISTATE_TRUE )
{
@@ -1590,6 +1592,7 @@ void SvxExtParagraphTabPage::Reset( const SfxItemSet* rSet )
bIsHyphen = rHyphen.IsHyphen();
m_xHyphenBox->set_state(bIsHyphen ? TRISTATE_TRUE : TRISTATE_FALSE);
+ m_xHyphenNoCapsBox->set_state(rHyphen.IsNoCapsHyphenation() ? TRISTATE_TRUE : TRISTATE_FALSE);
m_xExtHyphenBeforeBox->set_value(rHyphen.GetMinLead());
m_xExtHyphenAfterBox->set_value(rHyphen.GetMinTrail());
@@ -1598,8 +1601,10 @@ void SvxExtParagraphTabPage::Reset( const SfxItemSet* rSet )
else
{
m_xHyphenBox->set_state(TRISTATE_INDET);
+ m_xHyphenNoCapsBox->set_state(TRISTATE_INDET);
}
bool bEnable = bItemAvailable && bIsHyphen;
+ m_xHyphenNoCapsBox->set_sensitive(bEnable);
m_xExtHyphenBeforeBox->set_sensitive(bEnable);
m_xExtHyphenAfterBox->set_sensitive(bEnable);
m_xBeforeText->set_sensitive(bEnable);
@@ -1865,6 +1870,7 @@ void SvxExtParagraphTabPage::Reset( const SfxItemSet* rSet )
void SvxExtParagraphTabPage::ChangesApplied()
{
m_xHyphenBox->save_state();
+ m_xHyphenNoCapsBox->save_state();
m_xExtHyphenBeforeBox->set_value(m_xExtHyphenBeforeBox->get_value());
m_xExtHyphenAfterBox->set_value(m_xExtHyphenAfterBox->get_value());
m_xMaxHyphenEdit->set_value(m_xMaxHyphenEdit->get_value());
@@ -1910,6 +1916,7 @@ SvxExtParagraphTabPage::SvxExtParagraphTabPage(weld::Container* pPage, weld::Dia
, nStdPos(0)
// Hyphenation
, m_xHyphenBox(m_xBuilder->weld_check_button("checkAuto"))
+ , m_xHyphenNoCapsBox(m_xBuilder->weld_check_button("checkNoCaps"))
, m_xBeforeText(m_xBuilder->weld_label("labelLineBegin"))
, m_xExtHyphenBeforeBox(m_xBuilder->weld_spin_button("spinLineEnd"))
, m_xAfterText(m_xBuilder->weld_label("labelLineEnd"))
@@ -1974,6 +1981,7 @@ SvxExtParagraphTabPage::SvxExtParagraphTabPage(weld::Container* pPage, weld::Dia
{
bHtmlMode = true;
m_xHyphenBox->set_sensitive(false);
+ m_xHyphenNoCapsBox->set_sensitive(false);
m_xBeforeText->set_sensitive(false);
m_xExtHyphenBeforeBox->set_sensitive(false);
m_xAfterText->set_sensitive(false);
@@ -2106,6 +2114,7 @@ void SvxExtParagraphTabPage::OrphanHdl()
void SvxExtParagraphTabPage::HyphenClickHdl()
{
bool bEnable = m_xHyphenBox->get_state() == TRISTATE_TRUE;
+ m_xHyphenNoCapsBox->set_sensitive(bEnable);
m_xBeforeText->set_sensitive(bEnable);
m_xExtHyphenBeforeBox->set_sensitive(bEnable);
m_xAfterText->set_sensitive(bEnable);