summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/core/txtnode/fntcache.cxx4
-rw-r--r--sw/source/core/txtnode/fntcap.cxx9
2 files changed, 6 insertions, 7 deletions
diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx
index 83981599c0df..80b2ea8e6249 100644
--- a/sw/source/core/txtnode/fntcache.cxx
+++ b/sw/source/core/txtnode/fntcache.cxx
@@ -2444,8 +2444,8 @@ xub_StrLen SwFont::GetTxtBreak( SwDrawTextInfo& rInf, long nTextWidth )
nTxtBreak = rInf.GetOut().GetTextBreak( sTmpText, nTextWidth,
static_cast<sal_Unicode>('-'), nHyphPos,
nTmpIdx2, nTmpLen2, nKern );
- xub_StrLen nTmpHyphPos = static_cast<xub_StrLen>(nHyphPos);
- rInf.SetHyphPos(&nTmpHyphPos);
+ *rInf.GetHyphPos() = (nHyphPos == -1)
+ ? STRING_LEN : static_cast<xub_StrLen>(nHyphPos);
}
else
nTxtBreak = rInf.GetOut().GetTextBreak( sTmpText, nTextWidth,
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;