[Libreoffice-commits] core.git: 2 commits - sw/source
Caolán McNamara
caolanm at redhat.com
Fri Oct 11 13:10:29 PDT 2013
sw/source/core/bastyp/calc.cxx | 15 +++++++++------
sw/source/core/text/txtfld.cxx | 10 +++++++++-
2 files changed, 18 insertions(+), 7 deletions(-)
New commits:
commit 2a198c02b95bd76c8d7c9e7dd7aff8fc7c030fd5
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Oct 11 20:53:02 2013 +0100
CID#1103739 unintialized members
Change-Id: I15860351c15f7c28ae197fa626c58b5f3ead8bb7
diff --git a/sw/source/core/bastyp/calc.cxx b/sw/source/core/bastyp/calc.cxx
index 9082c04..a5c0c96 100644
--- a/sw/source/core/bastyp/calc.cxx
+++ b/sw/source/core/bastyp/calc.cxx
@@ -229,12 +229,15 @@ static double lcl_ConvertToDateValue( SwDoc& rDoc, sal_Int32 nDate )
}
SwCalc::SwCalc( SwDoc& rD )
- : aErrExpr( aEmptyStr, SwSbxValue(), 0 ),
- rDoc( rD ),
- pLclData( m_aSysLocale.GetLocaleDataPtr() ),
- pCharClass( &GetAppCharClass() ),
- nListPor( 0 ),
- eError( CALC_NOERR )
+ : aErrExpr( aEmptyStr, SwSbxValue(), 0 )
+ , nCommandPos(0)
+ , rDoc( rD )
+ , pLclData( m_aSysLocale.GetLocaleDataPtr() )
+ , pCharClass( &GetAppCharClass() )
+ , nListPor( 0 )
+ , eCurrOper( CALC_NAME )
+ , eCurrListOper( CALC_NAME )
+ , eError( CALC_NOERR )
{
aErrExpr.aStr = "~C_ERR~";
memset( VarTable, 0, sizeof(VarTable) );
commit dace560b350346b9f9a102ee602bb129a008bcfe
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Oct 11 20:45:22 2013 +0100
CID#736194 out of bounds
Change-Id: I236c2f51716bfebd0c132bbaed50c1f1ec811ffa
diff --git a/sw/source/core/text/txtfld.cxx b/sw/source/core/text/txtfld.cxx
index f830594..0133de7 100644
--- a/sw/source/core/text/txtfld.cxx
+++ b/sw/source/core/text/txtfld.cxx
@@ -395,7 +395,15 @@ SwNumberPortion *SwTxtFormatter::NewNumberPortion( SwTxtFormatInfo &rInf ) const
// hat ein "gueltige" Nummer ?
if( pTxtNd->IsNumbered() && pTxtNd->IsCountedInList())
{
- const SwNumFmt &rNumFmt = pNumRule->Get( static_cast<sal_uInt16>(pTxtNd->GetActualListLevel()) );
+ int nLevel = pTxtNd->GetActualListLevel();
+
+ if (nLevel < 0)
+ nLevel = 0;
+
+ if (nLevel >= MAXLEVEL)
+ nLevel = MAXLEVEL - 1;
+
+ const SwNumFmt &rNumFmt = pNumRule->Get( nLevel );
const sal_Bool bLeft = SVX_ADJUST_LEFT == rNumFmt.GetNumAdjust();
const sal_Bool bCenter = SVX_ADJUST_CENTER == rNumFmt.GetNumAdjust();
const bool bLabelAlignmentPosAndSpaceModeActive(
More information about the Libreoffice-commits
mailing list