[Libreoffice-commits] core.git: 2 commits - sw/source
Michael Stahl
mstahl at redhat.com
Thu Feb 6 15:22:51 PST 2014
sw/source/core/bastyp/calc.cxx | 3 +--
sw/source/ui/app/appenv.cxx | 9 +++++----
2 files changed, 6 insertions(+), 6 deletions(-)
New commits:
commit 9dbe5a576330b7fadd8838249d07aafe548a4ee2
Author: Michael Stahl <mstahl at redhat.com>
Date: Fri Feb 7 00:11:55 2014 +0100
fdo#74474: sw: fix Label wizard document creation harder
The function ReplacePoint() was changed to return a value but not all
call sites were adapted.
(regression from 263153842741d7ce21cc0bf1c5296a55a1138024)
Change-Id: I33efd9ce61611e025dfc76047187826aa0f8dd84
diff --git a/sw/source/core/bastyp/calc.cxx b/sw/source/core/bastyp/calc.cxx
index 9843a27..d446816 100644
--- a/sw/source/core/bastyp/calc.cxx
+++ b/sw/source/core/bastyp/calc.cxx
@@ -512,8 +512,7 @@ SwCalcExp* SwCalc::VarLook( const OUString& rStr, sal_uInt16 ins )
}
// At this point the "real" case variable has to be used
- OUString sTmpName( rStr );
- ::ReplacePoint( sTmpName );
+ OUString const sTmpName( ::ReplacePoint(rStr) );
if( !ins )
{
diff --git a/sw/source/ui/app/appenv.cxx b/sw/source/ui/app/appenv.cxx
index b068661..67519b0 100644
--- a/sw/source/ui/app/appenv.cxx
+++ b/sw/source/ui/app/appenv.cxx
@@ -114,7 +114,7 @@ OUString InsertLabEnvText( SwWrtShell& rSh, SwFldMgr& rFldMgr, const OUString& r
sal_uInt16 nCnt = comphelper::string::getTokenCount(sDBName, '.');
if (nCnt >= 3)
{
- ::ReplacePoint(sDBName, true);
+ sDBName = ::ReplacePoint(sDBName, true);
SwInsertFld_Data aData(TYP_DBFLD, 0, sDBName, aEmptyOUStr, 0, &rSh );
rFldMgr.InsertFld( aData );
sRet = sDBName;
commit 7e61bfe813347949307cdf2876ead3cc42e4cd7b
Author: Michael Stahl <mstahl at redhat.com>
Date: Thu Feb 6 23:49:20 2014 +0100
fdo#74474: sw: fix Label wizard document creation
Infinite loop in InsertLabEnvText() due to wrong handling of starting '<'.
(regression from fa469b2e00d83459faebe4c1fcb3ea1aac5fb20d)
Change-Id: I1d7ab1b276756bddd87890bb39d3e817330bc6dd
diff --git a/sw/source/ui/app/appenv.cxx b/sw/source/ui/app/appenv.cxx
index 8d3842a..b068661 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
{
More information about the Libreoffice-commits
mailing list