diff options
author | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2019-11-28 11:13:44 +0100 |
---|---|---|
committer | Michael Stahl <michael.stahl@cib.de> | 2019-12-07 19:58:33 +0100 |
commit | ad86ebb1f86f6347ccb9bbe40b0ca080562cbae8 (patch) | |
tree | b598bad7d2ae57861cc57cd81271bd96b9aa9929 /cui | |
parent | e000187243b9b90f9c8c9110fcd9a82c01ba0fe7 (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>
(cherry picked from commit 72bd0df107ee47c4d54fa88b4960d32ea03e9f69)
Reviewed-on: https://gerrit.libreoffice.org/84620
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/inc/paragrph.hxx | 1 | ||||
-rw-r--r-- | cui/source/tabpages/paragrph.cxx | 9 | ||||
-rw-r--r-- | cui/uiconfig/ui/textflowpage.ui | 32 |
3 files changed, 36 insertions, 6 deletions
diff --git a/cui/source/inc/paragrph.hxx b/cui/source/inc/paragrph.hxx index 51fe77596c41..b068fe643808 100644 --- a/cui/source/inc/paragrph.hxx +++ b/cui/source/inc/paragrph.hxx @@ -226,6 +226,7 @@ private: // hyphenation std::unique_ptr<weld::CheckButton> m_xHyphenBox; + std::unique_ptr<weld::CheckButton> m_xHyphenNoCapsBox; std::unique_ptr<weld::Label> m_xBeforeText; std::unique_ptr<weld::SpinButton> m_xExtHyphenBeforeBox; std::unique_ptr<weld::Label> m_xAfterText; diff --git a/cui/source/tabpages/paragrph.cxx b/cui/source/tabpages/paragrph.cxx index 7990744f1cc3..dba1ea03caa8 100644 --- a/cui/source/tabpages/paragrph.cxx +++ b/cui/source/tabpages/paragrph.cxx @@ -1369,6 +1369,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() ) @@ -1376,6 +1377,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 ) { @@ -1586,6 +1588,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()); @@ -1594,8 +1597,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); @@ -1861,6 +1866,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()); @@ -1906,6 +1912,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")) @@ -1970,6 +1977,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); @@ -2102,6 +2110,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); diff --git a/cui/uiconfig/ui/textflowpage.ui b/cui/uiconfig/ui/textflowpage.ui index d9f2c1c0caa6..4fe15fa396c5 100644 --- a/cui/uiconfig/ui/textflowpage.ui +++ b/cui/uiconfig/ui/textflowpage.ui @@ -102,7 +102,7 @@ </object> <packing> <property name="left_attach">0</property> - <property name="top_attach">3</property> + <property name="top_attach">4</property> </packing> </child> <child> @@ -116,7 +116,7 @@ </object> <packing> <property name="left_attach">0</property> - <property name="top_attach">2</property> + <property name="top_attach">3</property> </packing> </child> <child> @@ -131,7 +131,7 @@ </object> <packing> <property name="left_attach">0</property> - <property name="top_attach">1</property> + <property name="top_attach">2</property> </packing> </child> <child> @@ -145,7 +145,7 @@ </object> <packing> <property name="left_attach">1</property> - <property name="top_attach">1</property> + <property name="top_attach">2</property> </packing> </child> <child> @@ -159,7 +159,7 @@ </object> <packing> <property name="left_attach">1</property> - <property name="top_attach">2</property> + <property name="top_attach">3</property> </packing> </child> <child> @@ -173,9 +173,29 @@ </object> <packing> <property name="left_attach">1</property> - <property name="top_attach">3</property> + <property name="top_attach">4</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="checkNoCaps"> + <property name="label" translatable="yes" context="textflowpage|checkNoCaps">Don't hyphenate words in _CAPS</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="has_tooltip">True</property> + <property name="use_underline">True</property> + <property name="xalign">0</property> + <property name="always_show_image">True</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">1</property> </packing> </child> + <child> + <placeholder/> + </child> </object> </child> </object> |