summaryrefslogtreecommitdiff
path: root/sw/source/core/text/inftxt.cxx
diff options
context:
space:
mode:
authorSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2019-11-28 11:13:44 +0100
committerMichael Stahl <michael.stahl@cib.de>2019-12-07 19:58:33 +0100
commitad86ebb1f86f6347ccb9bbe40b0ca080562cbae8 (patch)
treeb598bad7d2ae57861cc57cd81271bd96b9aa9929 /sw/source/core/text/inftxt.cxx
parente000187243b9b90f9c8c9110fcd9a82c01ba0fe7 (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 'sw/source/core/text/inftxt.cxx')
-rw-r--r--sw/source/core/text/inftxt.cxx16
1 files changed, 11 insertions, 5 deletions
diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx
index c1aacf8c8bf1..133266675553 100644
--- a/sw/source/core/text/inftxt.cxx
+++ b/sw/source/core/text/inftxt.cxx
@@ -1334,13 +1334,13 @@ void SwTextPaintInfo::DrawViewOpt( const SwLinePortion &rPor,
}
static void lcl_InitHyphValues( PropertyValues &rVals,
- sal_Int16 nMinLeading, sal_Int16 nMinTrailing )
+ sal_Int16 nMinLeading, sal_Int16 nMinTrailing, bool bNoCapsHyphenation )
{
sal_Int32 nLen = rVals.getLength();
if (0 == nLen) // yet to be initialized?
{
- rVals.realloc( 2 );
+ rVals.realloc( 3 );
PropertyValue *pVal = rVals.getArray();
pVal[0].Name = UPN_HYPH_MIN_LEADING;
@@ -1350,12 +1350,17 @@ static void lcl_InitHyphValues( PropertyValues &rVals,
pVal[1].Name = UPN_HYPH_MIN_TRAILING;
pVal[1].Handle = UPH_HYPH_MIN_TRAILING;
pVal[1].Value <<= nMinTrailing;
+
+ pVal[2].Name = UPN_HYPH_NO_CAPS;
+ pVal[2].Handle = UPH_HYPH_NO_CAPS;
+ pVal[2].Value <<= bNoCapsHyphenation;
}
- else if (2 == nLen) // already initialized once?
+ else if (3 == nLen) // already initialized once?
{
PropertyValue *pVal = rVals.getArray();
pVal[0].Value <<= nMinLeading;
pVal[1].Value <<= nMinTrailing;
+ pVal[2].Value <<= bNoCapsHyphenation;
}
else {
OSL_FAIL( "unexpected size of sequence" );
@@ -1364,7 +1369,7 @@ static void lcl_InitHyphValues( PropertyValues &rVals,
const PropertyValues & SwTextFormatInfo::GetHyphValues() const
{
- OSL_ENSURE( 2 == m_aHyphVals.getLength(),
+ OSL_ENSURE( 3 == m_aHyphVals.getLength(),
"hyphenation values not yet initialized" );
return m_aHyphVals;
}
@@ -1382,7 +1387,8 @@ bool SwTextFormatInfo::InitHyph( const bool bAutoHyphen )
{
const sal_Int16 nMinimalLeading = std::max(rAttr.GetMinLead(), sal_uInt8(2));
const sal_Int16 nMinimalTrailing = rAttr.GetMinTrail();
- lcl_InitHyphValues( m_aHyphVals, nMinimalLeading, nMinimalTrailing);
+ const bool bNoCapsHyphenation = rAttr.IsNoCapsHyphenation();
+ lcl_InitHyphValues( m_aHyphVals, nMinimalLeading, nMinimalTrailing, bNoCapsHyphenation);
}
return bAuto;
}