coverity#1355507 uninitialized scalar field

I think

commit b2fb84499e
Author: Noel Grandin <noel@peralex.com>
Date:   Mon Mar 7 14:19:22 2016 +0200

    loplugin:write only fields

wrong wrong and took out this param along with the unused nIndex
beside it

Change-Id: Idc34e03b5d59d4b0017fff456b79c807fda2535f
This commit is contained in:
Caolán McNamara
2016-03-10 20:43:37 +00:00
parent eee4dd746e
commit c27d0a583d
8 changed files with 25 additions and 21 deletions

View File

@@ -2408,7 +2408,7 @@ css::uno::Reference< css::datatransfer::XTransferable >
// ====================== Virtual Methods ======================== // ====================== Virtual Methods ========================
void EditEngine::DrawingText( const Point&, const OUString&, sal_Int32, sal_Int32, void EditEngine::DrawingText( const Point&, const OUString&, sal_Int32, sal_Int32,
const long*, const SvxFont&, sal_uInt8, const long*, const SvxFont&, sal_Int32 /*nPara*/, sal_uInt8 /*nRightToLeft*/,
const EEngineData::WrongSpellVector*, const SvxFieldData*, bool, bool, bool, const EEngineData::WrongSpellVector*, const SvxFieldData*, bool, bool, bool,
const css::lang::Locale*, const Color&, const Color&) const css::lang::Locale*, const Color&, const Color&)
@@ -2417,7 +2417,7 @@ void EditEngine::DrawingText( const Point&, const OUString&, sal_Int32, sal_Int3
void EditEngine::DrawingTab( const Point& /*rStartPos*/, long /*nWidth*/, void EditEngine::DrawingTab( const Point& /*rStartPos*/, long /*nWidth*/,
const OUString& /*rChar*/, const SvxFont& /*rFont*/, const OUString& /*rChar*/, const SvxFont& /*rFont*/,
sal_uInt8 /*nRightToLeft*/, bool /*bEndOfLine*/, sal_Int32 /*nPara*/, sal_uInt8 /*nRightToLeft*/, bool /*bEndOfLine*/,
bool /*bEndOfParagraph*/, const Color& /*rOverlineColor*/, bool /*bEndOfParagraph*/, const Color& /*rOverlineColor*/,
const Color& /*rTextLineColor*/) const Color& /*rTextLineColor*/)
{ {

View File

@@ -3344,7 +3344,7 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, Rectangle aClipRect, Point aSt
// StripPortions() data callback // StripPortions() data callback
GetEditEnginePtr()->DrawingText( aOutPos, aText, nTextStart, nTextLen, pDXArray, GetEditEnginePtr()->DrawingText( aOutPos, aText, nTextStart, nTextLen, pDXArray,
aTmpFont, rTextPortion.GetRightToLeft(), aTmpFont, n, rTextPortion.GetRightToLeft(),
aWrongSpellVector.size() ? &aWrongSpellVector : nullptr, aWrongSpellVector.size() ? &aWrongSpellVector : nullptr,
pFieldData, pFieldData,
bEndOfLine, bEndOfParagraph, false, // support for EOL/EOP TEXT comments bEndOfLine, bEndOfParagraph, false, // support for EOL/EOP TEXT comments
@@ -3574,7 +3574,7 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, Rectangle aClipRect, Point aSt
GetEditEnginePtr()->DrawingTab( aTmpPos, GetEditEnginePtr()->DrawingTab( aTmpPos,
rTextPortion.GetSize().Width(), rTextPortion.GetSize().Width(),
OUString(rTextPortion.GetExtraValue()), OUString(rTextPortion.GetExtraValue()),
aTmpFont, rTextPortion.GetRightToLeft(), aTmpFont, n, rTextPortion.GetRightToLeft(),
bEndOfLine, bEndOfParagraph, bEndOfLine, bEndOfParagraph,
aOverlineColor, aTextLineColor); aOverlineColor, aTextLineColor);
} }
@@ -3592,7 +3592,7 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, Rectangle aClipRect, Point aSt
GetEditEnginePtr()->DrawingText( GetEditEnginePtr()->DrawingText(
aTmpPos, OUString(), 0, 0, nullptr, aTmpPos, OUString(), 0, 0, nullptr,
aTmpFont, 0, aTmpFont, n, 0,
nullptr, nullptr,
nullptr, nullptr,
bEndOfLine, bEndOfParagraph, false, bEndOfLine, bEndOfParagraph, false,
@@ -3649,7 +3649,7 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, Rectangle aClipRect, Point aSt
GetEditEnginePtr()->DrawingText( GetEditEnginePtr()->DrawingText(
aTmpPos, OUString(), 0, 0, nullptr, aTmpPos, OUString(), 0, 0, nullptr,
aTmpFont, 0, aTmpFont, n, 0,
nullptr, nullptr,
nullptr, nullptr,
false, true, false, // support for EOL/EOP TEXT comments false, true, false, // support for EOL/EOP TEXT comments

View File

@@ -147,7 +147,7 @@ OUString OutlinerEditEng::GetUndoComment( sal_uInt16 nUndoId ) const
} }
void OutlinerEditEng::DrawingText( const Point& rStartPos, const OUString& rText, sal_Int32 nTextStart, sal_Int32 nTextLen, void OutlinerEditEng::DrawingText( const Point& rStartPos, const OUString& rText, sal_Int32 nTextStart, sal_Int32 nTextLen,
const long* pDXArray, const SvxFont& rFont, sal_uInt8 nRightToLeft, const long* pDXArray, const SvxFont& rFont, sal_Int32 nPara, sal_uInt8 nRightToLeft,
const EEngineData::WrongSpellVector* pWrongSpellVector, const EEngineData::WrongSpellVector* pWrongSpellVector,
const SvxFieldData* pFieldData, const SvxFieldData* pFieldData,
bool bEndOfLine, bool bEndOfLine,
@@ -157,16 +157,16 @@ void OutlinerEditEng::DrawingText( const Point& rStartPos, const OUString& rText
const Color& rOverlineColor, const Color& rOverlineColor,
const Color& rTextLineColor) const Color& rTextLineColor)
{ {
pOwner->DrawingText(rStartPos,rText,nTextStart,nTextLen,pDXArray,rFont,nRightToLeft, pOwner->DrawingText(rStartPos,rText,nTextStart,nTextLen,pDXArray,rFont,nPara,nRightToLeft,
pWrongSpellVector, pFieldData, bEndOfLine, bEndOfParagraph, bEndOfBullet, pLocale, rOverlineColor, rTextLineColor); pWrongSpellVector, pFieldData, bEndOfLine, bEndOfParagraph, bEndOfBullet, pLocale, rOverlineColor, rTextLineColor);
} }
void OutlinerEditEng::DrawingTab( const Point& rStartPos, long nWidth, const OUString& rChar, void OutlinerEditEng::DrawingTab( const Point& rStartPos, long nWidth, const OUString& rChar,
const SvxFont& rFont, sal_uInt8 nRightToLeft, const SvxFont& rFont, sal_Int32 nPara, sal_uInt8 nRightToLeft,
bool bEndOfLine, bool bEndOfParagraph, bool bEndOfLine, bool bEndOfParagraph,
const Color& rOverlineColor, const Color& rTextLineColor) const Color& rOverlineColor, const Color& rTextLineColor)
{ {
pOwner->DrawingTab(rStartPos, nWidth, rChar, rFont, nRightToLeft, pOwner->DrawingTab(rStartPos, nWidth, rChar, rFont, nPara, nRightToLeft,
bEndOfLine, bEndOfParagraph, rOverlineColor, rTextLineColor ); bEndOfLine, bEndOfParagraph, rOverlineColor, rTextLineColor );
} }

View File

@@ -46,7 +46,7 @@ public:
virtual void DrawingText( const Point& rStartPos, const OUString& rText, sal_Int32 nTextStart, virtual void DrawingText( const Point& rStartPos, const OUString& rText, sal_Int32 nTextStart,
sal_Int32 nTextLen, const long* pDXArray, const SvxFont& rFont, sal_Int32 nTextLen, const long* pDXArray, const SvxFont& rFont,
sal_uInt8 nRightToLeft, sal_Int32 nPara, sal_uInt8 nRightToLeft,
const EEngineData::WrongSpellVector* pWrongSpellVector, const EEngineData::WrongSpellVector* pWrongSpellVector,
const SvxFieldData* pFieldData, const SvxFieldData* pFieldData,
bool bEndOfLine, bool bEndOfLine,
@@ -58,7 +58,7 @@ public:
virtual void DrawingTab( virtual void DrawingTab(
const Point& rStartPos, long nWidth, const OUString& rChar, const Point& rStartPos, long nWidth, const OUString& rChar,
const SvxFont& rFont, sal_uInt8 nRightToLeft, const SvxFont& rFont, sal_Int32 nPara, sal_uInt8 nRightToLeft,
bool bEndOfLine, bool bEndOfLine,
bool bEndOfParagraph, bool bEndOfParagraph,
const Color& rOverlineColor, const Color& rOverlineColor,

View File

@@ -983,7 +983,7 @@ void Outliner::PaintBullet( sal_Int32 nPara, const Point& rStartPos,
} }
DrawingText(aTextPos, pPara->GetText(), 0, pPara->GetText().getLength(), pBuf.get(), DrawingText(aTextPos, pPara->GetText(), 0, pPara->GetText().getLength(), pBuf.get(),
aSvxFont, bRightToLeftPara ? 1 : 0, nullptr, nullptr, false, false, true, nullptr, Color(), Color()); aSvxFont, nPara, bRightToLeftPara ? 1 : 0, nullptr, nullptr, false, false, true, nullptr, Color(), Color());
} }
else else
{ {
@@ -1702,7 +1702,7 @@ void Outliner::StripPortions()
void Outliner::DrawingText( const Point& rStartPos, const OUString& rText, sal_Int32 nTextStart, void Outliner::DrawingText( const Point& rStartPos, const OUString& rText, sal_Int32 nTextStart,
sal_Int32 nTextLen, const long* pDXArray,const SvxFont& rFont, sal_Int32 nTextLen, const long* pDXArray,const SvxFont& rFont,
sal_uInt8 nRightToLeft, sal_Int32 nPara, sal_uInt8 nRightToLeft,
const EEngineData::WrongSpellVector* pWrongSpellVector, const EEngineData::WrongSpellVector* pWrongSpellVector,
const SvxFieldData* pFieldData, const SvxFieldData* pFieldData,
bool bEndOfLine, bool bEndOfLine,
@@ -1714,7 +1714,7 @@ void Outliner::DrawingText( const Point& rStartPos, const OUString& rText, sal_I
{ {
if(aDrawPortionHdl.IsSet()) if(aDrawPortionHdl.IsSet())
{ {
DrawPortionInfo aInfo( rStartPos, rText, nTextStart, nTextLen, rFont, pDXArray, pWrongSpellVector, DrawPortionInfo aInfo( rStartPos, rText, nTextStart, nTextLen, rFont, nPara, pDXArray, pWrongSpellVector,
pFieldData, pLocale, rOverlineColor, rTextLineColor, nRightToLeft, false, 0, bEndOfLine, bEndOfParagraph, bEndOfBullet); pFieldData, pLocale, rOverlineColor, rTextLineColor, nRightToLeft, false, 0, bEndOfLine, bEndOfParagraph, bEndOfBullet);
aDrawPortionHdl.Call( &aInfo ); aDrawPortionHdl.Call( &aInfo );
@@ -1722,12 +1722,12 @@ void Outliner::DrawingText( const Point& rStartPos, const OUString& rText, sal_I
} }
void Outliner::DrawingTab( const Point& rStartPos, long nWidth, const OUString& rChar, const SvxFont& rFont, void Outliner::DrawingTab( const Point& rStartPos, long nWidth, const OUString& rChar, const SvxFont& rFont,
sal_uInt8 nRightToLeft, bool bEndOfLine, bool bEndOfParagraph, sal_Int32 nPara, sal_uInt8 nRightToLeft, bool bEndOfLine, bool bEndOfParagraph,
const Color& rOverlineColor, const Color& rTextLineColor) const Color& rOverlineColor, const Color& rTextLineColor)
{ {
if(aDrawPortionHdl.IsSet()) if(aDrawPortionHdl.IsSet())
{ {
DrawPortionInfo aInfo( rStartPos, rChar, 0, rChar.getLength(), rFont, nullptr, nullptr, DrawPortionInfo aInfo( rStartPos, rChar, 0, rChar.getLength(), rFont, nPara, nullptr, nullptr,
nullptr, nullptr, rOverlineColor, rTextLineColor, nRightToLeft, true, nWidth, bEndOfLine, bEndOfParagraph, false); nullptr, nullptr, rOverlineColor, rTextLineColor, nRightToLeft, true, nWidth, bEndOfLine, bEndOfParagraph, false);
aDrawPortionHdl.Call( &aInfo ); aDrawPortionHdl.Call( &aInfo );

View File

@@ -481,7 +481,7 @@ public:
virtual void DrawingText( const Point& rStartPos, const OUString& rText, virtual void DrawingText( const Point& rStartPos, const OUString& rText,
sal_Int32 nTextStart, sal_Int32 nTextLen, sal_Int32 nTextStart, sal_Int32 nTextLen,
const long* pDXArray, const SvxFont& rFont, const long* pDXArray, const SvxFont& rFont,
sal_uInt8 nRightToLeft, sal_Int32 nPara, sal_uInt8 nRightToLeft,
const EEngineData::WrongSpellVector* pWrongSpellVector, const EEngineData::WrongSpellVector* pWrongSpellVector,
const SvxFieldData* pFieldData, const SvxFieldData* pFieldData,
bool bEndOfLine, bool bEndOfLine,
@@ -492,7 +492,7 @@ public:
const Color& rTextLineColor); const Color& rTextLineColor);
virtual void DrawingTab( const Point& rStartPos, long nWidth, const OUString& rChar, virtual void DrawingTab( const Point& rStartPos, long nWidth, const OUString& rChar,
const SvxFont& rFont, sal_uInt8 nRightToLeft, const SvxFont& rFont, sal_Int32 nPara, sal_uInt8 nRightToLeft,
bool bEndOfLine, bool bEndOfLine,
bool bEndOfParagraph, bool bEndOfParagraph,
const Color& rOverlineColor, const Color& rOverlineColor,

View File

@@ -396,6 +396,7 @@ public:
const OUString maText; const OUString maText;
sal_Int32 mnTextStart; sal_Int32 mnTextStart;
sal_Int32 mnTextLen; sal_Int32 mnTextLen;
sal_Int32 mnPara;
const SvxFont& mrFont; const SvxFont& mrFont;
const long* mpDXArray; const long* mpDXArray;
@@ -423,6 +424,7 @@ public:
sal_Int32 nTxtStart, sal_Int32 nTxtStart,
sal_Int32 nTxtLen, sal_Int32 nTxtLen,
const SvxFont& rFnt, const SvxFont& rFnt,
sal_Int32 nPar,
const long* pDXArr, const long* pDXArr,
const EEngineData::WrongSpellVector* pWrongSpellVector, const EEngineData::WrongSpellVector* pWrongSpellVector,
const SvxFieldData* pFieldData, const SvxFieldData* pFieldData,
@@ -439,6 +441,7 @@ public:
maText(rTxt), maText(rTxt),
mnTextStart(nTxtStart), mnTextStart(nTxtStart),
mnTextLen(nTxtLen), mnTextLen(nTxtLen),
mnPara(nPar),
mrFont(rFnt), mrFont(rFnt),
mpDXArray(pDXArr), mpDXArray(pDXArr),
mpWrongSpellVector(pWrongSpellVector), mpWrongSpellVector(pWrongSpellVector),
@@ -832,7 +835,7 @@ public:
void DrawingText( const Point& rStartPos, const OUString& rText, void DrawingText( const Point& rStartPos, const OUString& rText,
sal_Int32 nTextStart, sal_Int32 nTextLen, sal_Int32 nTextStart, sal_Int32 nTextLen,
const long* pDXArray, const SvxFont& rFont, const long* pDXArray, const SvxFont& rFont,
sal_uInt8 nRightToLeft, sal_Int32 nPara, sal_uInt8 nRightToLeft,
const EEngineData::WrongSpellVector* pWrongSpellVector, const EEngineData::WrongSpellVector* pWrongSpellVector,
const SvxFieldData* pFieldData, const SvxFieldData* pFieldData,
bool bEndOfLine, bool bEndOfLine,
@@ -843,7 +846,7 @@ public:
const Color& rTextLineColor); const Color& rTextLineColor);
void DrawingTab( const Point& rStartPos, long nWidth, const OUString& rChar, void DrawingTab( const Point& rStartPos, long nWidth, const OUString& rChar,
const SvxFont& rFont, sal_uInt8 nRightToLeft, const SvxFont& rFont, sal_Int32 nPara, sal_uInt8 nRightToLeft,
bool bEndOfLine, bool bEndOfLine,
bool bEndOfParagraph, bool bEndOfParagraph,
const Color& rOverlineColor, const Color& rOverlineColor,

View File

@@ -87,6 +87,7 @@ namespace
maText(rInfo.maText), maText(rInfo.maText),
mnTextStart(rInfo.mnTextStart), mnTextStart(rInfo.mnTextStart),
mnTextLength(rInfo.mnTextLen), mnTextLength(rInfo.mnTextLen),
mnParagraph(rInfo.mnPara),
maFont(rInfo.mrFont), maFont(rInfo.mrFont),
maDblDXArray(), maDblDXArray(),
maLocale(rInfo.mpLocale ? *rInfo.mpLocale : css::lang::Locale()), maLocale(rInfo.mpLocale ? *rInfo.mpLocale : css::lang::Locale()),