summaryrefslogtreecommitdiff
path: root/sw/source/filter/ascii
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/filter/ascii')
-rw-r--r--sw/source/filter/ascii/ascatr.cxx8
1 files changed, 6 insertions, 2 deletions
diff --git a/sw/source/filter/ascii/ascatr.cxx b/sw/source/filter/ascii/ascatr.cxx
index 1fb879fb2fd4..04a5d890f477 100644
--- a/sw/source/filter/ascii/ascatr.cxx
+++ b/sw/source/filter/ascii/ascatr.cxx
@@ -197,7 +197,7 @@ static Writer& OutASC_SwTxtNode( Writer& rWrt, SwCntntNode& rNode )
const bool bExportSoftHyphens = RTL_TEXTENCODING_UCS2 == rWrt.GetAsciiOptions().GetCharSet() ||
RTL_TEXTENCODING_UTF8 == rWrt.GetAsciiOptions().GetCharSet();
- do {
+ for (;;) {
const sal_Int32 nNextAttr = std::min(aAttrIter.WhereNext(), nEnd);
if( !aAttrIter.OutAttr( nStrPos ))
@@ -209,8 +209,12 @@ static Writer& OutASC_SwTxtNode( Writer& rWrt, SwCntntNode& rNode )
rWrt.Strm().WriteUnicodeOrByteText( aOutStr );
}
nStrPos = nNextAttr;
+ if (nStrPos >= nEnd)
+ {
+ break;
+ }
aAttrIter.NextPos();
- } while( nStrPos < nEnd );
+ }
if( !bLastNd ||
( ( !rWrt.bWriteClipboardDoc && !rWrt.bASCII_NoLastLineEnd )