diff options
author | Michael Stahl <mstahl@redhat.com> | 2013-07-07 11:58:42 +0200 |
---|---|---|
committer | Michael Meeks <michael.meeks@suse.com> | 2013-07-08 08:54:56 +0000 |
commit | 4d268e8302d13b81494305eab68e60ab6d0ef264 (patch) | |
tree | 7a67ea47dff571b3f3de398738c65eea9b273cc0 /sw/source/core/txtnode/fntcap.cxx | |
parent | 5430b9e0f4082025ff9bf7621d18292db0361121 (diff) |
fdo#66478: sw: un-break hyphenation
The main problem is calling SetHyphPos with a stack pointer.
Converting STRING_LEN <-> -1 can't hurt though.
(regression from a2f6402b1fe769a430019042e14e63c9414715dc)
Change-Id: I59a4e3b16b418082de468c7d7f7f38a9b0bccd01
(cherry picked from commit 6fa07d2d608646004bc45261275c4ebabb578a09)
Reviewed-on: https://gerrit.libreoffice.org/4757
Reviewed-by: Michael Meeks <michael.meeks@suse.com>
Tested-by: Michael Meeks <michael.meeks@suse.com>
Diffstat (limited to 'sw/source/core/txtnode/fntcap.cxx')
-rw-r--r-- | sw/source/core/txtnode/fntcap.cxx | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/sw/source/core/txtnode/fntcap.cxx b/sw/source/core/txtnode/fntcap.cxx index 18686983d4ff..9735b2c95663 100644 --- a/sw/source/core/txtnode/fntcap.cxx +++ b/sw/source/core/txtnode/fntcap.cxx @@ -209,26 +209,25 @@ void SwDoGetCapitalBreak::Do() { xub_StrLen nEnd = rInf.GetEnd(); OUString sText(rInf.GetText()); // only needed until rInf.GetText() returns OUString - long nTxtWidth2 = nTxtWidth; // only needed until variables are migrated to sal_Int32 sal_Int32 nIdx2 = rInf.GetIdx(); // ditto sal_Int32 nLen2 = rInf.GetLen(); // ditto if( pExtraPos ) { sal_Int32 nExtraPos = *pExtraPos; // ditto - nBreak = GetOut().GetTextBreak( sText, nTxtWidth2, static_cast<sal_Unicode>('-'), + nBreak = GetOut().GetTextBreak( sText, nTxtWidth, + static_cast<sal_Unicode>('-'), nExtraPos, nIdx2, nLen2, rInf.GetKern() ); if( nExtraPos > nEnd ) nExtraPos = nEnd; - *pExtraPos = nExtraPos; + *pExtraPos = (nExtraPos == -1) ? STRING_LEN : nExtraPos; } else - nBreak = GetOut().GetTextBreak( sText, nTxtWidth2, + nBreak = GetOut().GetTextBreak( sText, nTxtWidth, nIdx2, nLen2, rInf.GetKern() ); rInf.SetText(sText); // ditto rInf.SetIdx(nIdx2); // ditto rInf.SetLen(nLen2); // ditto - nTxtWidth = nTxtWidth2; // ditto if( nBreak > nEnd ) nBreak = nEnd; |