summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2014-02-06 23:49:20 +0100
committerMichael Stahl <mstahl@redhat.com>2014-02-07 00:13:41 +0100
commit7e61bfe813347949307cdf2876ead3cc42e4cd7b (patch)
treee85d145bb4bda004e468ebeae01c924ba497f4ad
parent16442998b8b6ac7e284ab2377013f36c28b2cb8c (diff)
fdo#74474: sw: fix Label wizard document creation
Infinite loop in InsertLabEnvText() due to wrong handling of starting '<'. (regression from fa469b2e00d83459faebe4c1fcb3ea1aac5fb20d) Change-Id: I1d7ab1b276756bddd87890bb39d3e817330bc6dd
-rw-r--r--sw/source/ui/app/appenv.cxx7
1 files changed, 4 insertions, 3 deletions
diff --git a/sw/source/ui/app/appenv.cxx b/sw/source/ui/app/appenv.cxx
index 8d3842a3721e..b068661a7053 100644
--- a/sw/source/ui/app/appenv.cxx
+++ b/sw/source/ui/app/appenv.cxx
@@ -90,10 +90,11 @@ OUString InsertLabEnvText( SwWrtShell& rSh, SwFldMgr& rFldMgr, const OUString& r
bool bField = false;
sal_Int32 nPos = aLine.indexOf( '<' );
- if ( nPos != -1)
+ if (0 != nPos)
{
- sTmpText = aLine.copy( 0, nPos );
- aLine = aLine.copy( nPos );
+ sal_Int32 const nCopy((nPos != -1) ? nPos : aLine.getLength());
+ sTmpText = aLine.copy(0, nCopy);
+ aLine = aLine.copy(nCopy);
}
else
{