[Libreoffice-commits] core.git: 4 commits - editeng/source include/editeng sdext/source sfx2/source svtools/source svx/source
Caolán McNamara
caolanm at redhat.com
Thu Mar 10 22:15:31 UTC 2016
editeng/source/editeng/editeng.cxx | 4 ++--
editeng/source/editeng/impedit3.cxx | 8 ++++----
editeng/source/outliner/outleeng.cxx | 8 ++++----
editeng/source/outliner/outleeng.hxx | 4 ++--
editeng/source/outliner/outliner.cxx | 10 +++++-----
include/editeng/editeng.hxx | 4 ++--
include/editeng/outliner.hxx | 7 +++++--
sdext/source/pdfimport/test/pdf2xml.cxx | 6 ++++--
sfx2/source/control/dispatch.cxx | 2 +-
svtools/source/contnr/iconviewimpl.cxx | 2 +-
svtools/source/contnr/svimpbox.cxx | 2 +-
svx/source/svdraw/svdotextpathdecomposition.cxx | 1 +
12 files changed, 32 insertions(+), 26 deletions(-)
New commits:
commit cb00ae0a82cb50c7b951d7b3c4fe69339bad16ea
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Mar 10 20:57:57 2016 +0000
coverity#1355504 Dereference before null check
Change-Id: I1f19fa2b55054bff7bb7e34d8a07dcf29fd229be
diff --git a/svtools/source/contnr/iconviewimpl.cxx b/svtools/source/contnr/iconviewimpl.cxx
index ca6696a..e361414 100644
--- a/svtools/source/contnr/iconviewimpl.cxx
+++ b/svtools/source/contnr/iconviewimpl.cxx
@@ -508,7 +508,7 @@ bool IconViewImpl::KeyInput( const KeyEvent& rKEvt )
// if there is no next entry, take the current one
// this ensures that in case of _one_ entry in the list, this entry is selected when pressing
// the cursor key
- if ( !pNewCursor && pCursor )
+ if (!pNewCursor)
pNewCursor = pCursor;
if( pNewCursor )
diff --git a/svtools/source/contnr/svimpbox.cxx b/svtools/source/contnr/svimpbox.cxx
index d48f112..7ae2371 100644
--- a/svtools/source/contnr/svimpbox.cxx
+++ b/svtools/source/contnr/svimpbox.cxx
@@ -2149,7 +2149,7 @@ bool SvImpLBox::KeyInput( const KeyEvent& rKEvt)
// if there is no next entry, take the current one
// this ensures that in case of _one_ entry in the list, this entry is selected when pressing
// the cursor key
- if ( !pNewCursor && pCursor )
+ if (!pNewCursor)
pNewCursor = pCursor;
if( pNewCursor )
commit b20af8b684463674a0e25cff9db85bbb6acee44b
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Mar 10 20:55:11 2016 +0000
coverity#1355499 Unchecked return value
Change-Id: I0b9329d00bfcebb6e29db6786715b19a7697d087
diff --git a/sdext/source/pdfimport/test/pdf2xml.cxx b/sdext/source/pdfimport/test/pdf2xml.cxx
index 19dd03c..574a81a 100644
--- a/sdext/source/pdfimport/test/pdf2xml.cxx
+++ b/sdext/source/pdfimport/test/pdf2xml.cxx
@@ -39,6 +39,8 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
if( argc < 4 )
return 1;
+ int nRet = 0;
+
try
{
OUString aBaseURL, aTmpURL, aSrcURL, aDstURL;
@@ -74,7 +76,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
uno::Reference<pdfi::PDFIRawAdaptor> xAdaptor( new pdfi::PDFIRawAdaptor(OUString(), aEnv.getComponentContext()) );
xAdaptor->setTreeVisitorFactory(pTreeFactory);
- xAdaptor->odfConvert( aSrcURL, new OutputWrap(aDstURL), nullptr );
+ nRet = xAdaptor->odfConvert(aSrcURL, new OutputWrap(aDstURL), nullptr) ? 0 : 1;
}
catch (const uno::Exception& e)
{
@@ -87,7 +89,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
return 1;
}
- return 0;
+ return nRet;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit bd17307216b07599cbaa7e0111dc784e3af20ed2
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Mar 10 20:50:16 2016 +0000
coverity#1355501 Dereference after null check
Change-Id: I84001559ed2bafee16a176eb11ea991397b733bc
diff --git a/sfx2/source/control/dispatch.cxx b/sfx2/source/control/dispatch.cxx
index 7851e1f..8c4a2f9 100644
--- a/sfx2/source/control/dispatch.cxx
+++ b/sfx2/source/control/dispatch.cxx
@@ -1368,7 +1368,7 @@ void SfxDispatcher::_Update_Impl( bool bUIActive, bool bIsMDIApp, bool bIsIPOwne
if ( bIsMDIApp || bIsIPOwner )
{
- sal_uInt32 nId = pIFace->GetStatusBarId();
+ sal_uInt32 nId = pIFace ? pIFace->GetStatusBarId() : 0;
if ( nId )
{
nStatBarId = nId;
commit c27d0a583d5748bfe68bcf3be73a33e8d2823f8f
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Mar 10 20:43:37 2016 +0000
coverity#1355507 uninitialized scalar field
I think
commit b2fb84499e1f75735e8fd90bc2eece3fed9af5f6
Author: Noel Grandin <noel at 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
diff --git a/editeng/source/editeng/editeng.cxx b/editeng/source/editeng/editeng.cxx
index 00b0d14..555bce1 100644
--- a/editeng/source/editeng/editeng.cxx
+++ b/editeng/source/editeng/editeng.cxx
@@ -2408,7 +2408,7 @@ css::uno::Reference< css::datatransfer::XTransferable >
// ====================== Virtual Methods ========================
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 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*/,
const OUString& /*rChar*/, const SvxFont& /*rFont*/,
- sal_uInt8 /*nRightToLeft*/, bool /*bEndOfLine*/,
+ sal_Int32 /*nPara*/, sal_uInt8 /*nRightToLeft*/, bool /*bEndOfLine*/,
bool /*bEndOfParagraph*/, const Color& /*rOverlineColor*/,
const Color& /*rTextLineColor*/)
{
diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx
index 5202496..dac9f8b 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -3344,7 +3344,7 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, Rectangle aClipRect, Point aSt
// StripPortions() data callback
GetEditEnginePtr()->DrawingText( aOutPos, aText, nTextStart, nTextLen, pDXArray,
- aTmpFont, rTextPortion.GetRightToLeft(),
+ aTmpFont, n, rTextPortion.GetRightToLeft(),
aWrongSpellVector.size() ? &aWrongSpellVector : nullptr,
pFieldData,
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,
rTextPortion.GetSize().Width(),
OUString(rTextPortion.GetExtraValue()),
- aTmpFont, rTextPortion.GetRightToLeft(),
+ aTmpFont, n, rTextPortion.GetRightToLeft(),
bEndOfLine, bEndOfParagraph,
aOverlineColor, aTextLineColor);
}
@@ -3592,7 +3592,7 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, Rectangle aClipRect, Point aSt
GetEditEnginePtr()->DrawingText(
aTmpPos, OUString(), 0, 0, nullptr,
- aTmpFont, 0,
+ aTmpFont, n, 0,
nullptr,
nullptr,
bEndOfLine, bEndOfParagraph, false,
@@ -3649,7 +3649,7 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, Rectangle aClipRect, Point aSt
GetEditEnginePtr()->DrawingText(
aTmpPos, OUString(), 0, 0, nullptr,
- aTmpFont, 0,
+ aTmpFont, n, 0,
nullptr,
nullptr,
false, true, false, // support for EOL/EOP TEXT comments
diff --git a/editeng/source/outliner/outleeng.cxx b/editeng/source/outliner/outleeng.cxx
index 8716b6b..575bb5e 100644
--- a/editeng/source/outliner/outleeng.cxx
+++ b/editeng/source/outliner/outleeng.cxx
@@ -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,
- 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 SvxFieldData* pFieldData,
bool bEndOfLine,
@@ -157,16 +157,16 @@ void OutlinerEditEng::DrawingText( const Point& rStartPos, const OUString& rText
const Color& rOverlineColor,
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);
}
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,
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 );
}
diff --git a/editeng/source/outliner/outleeng.hxx b/editeng/source/outliner/outleeng.hxx
index a042aee..04e44c2 100644
--- a/editeng/source/outliner/outleeng.hxx
+++ b/editeng/source/outliner/outleeng.hxx
@@ -46,7 +46,7 @@ public:
virtual void DrawingText( const Point& rStartPos, const OUString& rText, sal_Int32 nTextStart,
sal_Int32 nTextLen, const long* pDXArray, const SvxFont& rFont,
- sal_uInt8 nRightToLeft,
+ sal_Int32 nPara, sal_uInt8 nRightToLeft,
const EEngineData::WrongSpellVector* pWrongSpellVector,
const SvxFieldData* pFieldData,
bool bEndOfLine,
@@ -58,7 +58,7 @@ public:
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 bEndOfParagraph,
const Color& rOverlineColor,
diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx
index f14053b..2573168 100644
--- a/editeng/source/outliner/outliner.cxx
+++ b/editeng/source/outliner/outliner.cxx
@@ -983,7 +983,7 @@ void Outliner::PaintBullet( sal_Int32 nPara, const Point& rStartPos,
}
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
{
@@ -1702,7 +1702,7 @@ void Outliner::StripPortions()
void Outliner::DrawingText( const Point& rStartPos, const OUString& rText, sal_Int32 nTextStart,
sal_Int32 nTextLen, const long* pDXArray,const SvxFont& rFont,
- sal_uInt8 nRightToLeft,
+ sal_Int32 nPara, sal_uInt8 nRightToLeft,
const EEngineData::WrongSpellVector* pWrongSpellVector,
const SvxFieldData* pFieldData,
bool bEndOfLine,
@@ -1714,7 +1714,7 @@ void Outliner::DrawingText( const Point& rStartPos, const OUString& rText, sal_I
{
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);
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,
- sal_uInt8 nRightToLeft, bool bEndOfLine, bool bEndOfParagraph,
+ sal_Int32 nPara, sal_uInt8 nRightToLeft, bool bEndOfLine, bool bEndOfParagraph,
const Color& rOverlineColor, const Color& rTextLineColor)
{
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);
aDrawPortionHdl.Call( &aInfo );
diff --git a/include/editeng/editeng.hxx b/include/editeng/editeng.hxx
index debd4d1..b51b8b4 100644
--- a/include/editeng/editeng.hxx
+++ b/include/editeng/editeng.hxx
@@ -481,7 +481,7 @@ public:
virtual void DrawingText( const Point& rStartPos, const OUString& rText,
sal_Int32 nTextStart, sal_Int32 nTextLen,
const long* pDXArray, const SvxFont& rFont,
- sal_uInt8 nRightToLeft,
+ sal_Int32 nPara, sal_uInt8 nRightToLeft,
const EEngineData::WrongSpellVector* pWrongSpellVector,
const SvxFieldData* pFieldData,
bool bEndOfLine,
@@ -492,7 +492,7 @@ public:
const Color& rTextLineColor);
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 bEndOfParagraph,
const Color& rOverlineColor,
diff --git a/include/editeng/outliner.hxx b/include/editeng/outliner.hxx
index 8f3ed25..ac3f0aa 100644
--- a/include/editeng/outliner.hxx
+++ b/include/editeng/outliner.hxx
@@ -396,6 +396,7 @@ public:
const OUString maText;
sal_Int32 mnTextStart;
sal_Int32 mnTextLen;
+ sal_Int32 mnPara;
const SvxFont& mrFont;
const long* mpDXArray;
@@ -423,6 +424,7 @@ public:
sal_Int32 nTxtStart,
sal_Int32 nTxtLen,
const SvxFont& rFnt,
+ sal_Int32 nPar,
const long* pDXArr,
const EEngineData::WrongSpellVector* pWrongSpellVector,
const SvxFieldData* pFieldData,
@@ -439,6 +441,7 @@ public:
maText(rTxt),
mnTextStart(nTxtStart),
mnTextLen(nTxtLen),
+ mnPara(nPar),
mrFont(rFnt),
mpDXArray(pDXArr),
mpWrongSpellVector(pWrongSpellVector),
@@ -832,7 +835,7 @@ public:
void DrawingText( const Point& rStartPos, const OUString& rText,
sal_Int32 nTextStart, sal_Int32 nTextLen,
const long* pDXArray, const SvxFont& rFont,
- sal_uInt8 nRightToLeft,
+ sal_Int32 nPara, sal_uInt8 nRightToLeft,
const EEngineData::WrongSpellVector* pWrongSpellVector,
const SvxFieldData* pFieldData,
bool bEndOfLine,
@@ -843,7 +846,7 @@ public:
const Color& rTextLineColor);
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 bEndOfParagraph,
const Color& rOverlineColor,
diff --git a/svx/source/svdraw/svdotextpathdecomposition.cxx b/svx/source/svdraw/svdotextpathdecomposition.cxx
index c9a1c2c..cc5f37d 100644
--- a/svx/source/svdraw/svdotextpathdecomposition.cxx
+++ b/svx/source/svdraw/svdotextpathdecomposition.cxx
@@ -87,6 +87,7 @@ namespace
maText(rInfo.maText),
mnTextStart(rInfo.mnTextStart),
mnTextLength(rInfo.mnTextLen),
+ mnParagraph(rInfo.mnPara),
maFont(rInfo.mrFont),
maDblDXArray(),
maLocale(rInfo.mpLocale ? *rInfo.mpLocale : css::lang::Locale()),
More information about the Libreoffice-commits
mailing list