[Libreoffice-commits] core.git: 14 commits - basegfx/source basic/source bridges/source cppu/source cpputools/source desktop/source drawinglayer/source filter/source forms/source framework/source idlc/source jvmfwk/plugins l10ntools/source registry/source reportdesign/source sal/qa sal/rtl scaddins/source sc/source sdext/source sd/source sfx2/source svl/source svtools/langsupport svtools/source svx/source svx/workben sw/source ucb/source unoidl/source unotest/source unotools/source unusedcode.easy vcl/generic vcl/qa vcl/workben xmloff/source
Caolán McNamara
caolanm at redhat.com
Wed Nov 5 06:58:35 PST 2014
basegfx/source/matrix/b3dhommatrix.cxx | 2
basic/source/classes/sbunoobj.cxx | 4
basic/source/runtime/methods.cxx | 2
basic/source/runtime/methods1.cxx | 4
basic/source/runtime/runtime.cxx | 2
bridges/source/jni_uno/jni_bridge.cxx | 4
bridges/source/jni_uno/jni_info.cxx | 4
cppu/source/typelib/static_types.cxx | 2
cppu/source/typelib/typelib.cxx | 4
cppu/source/uno/sequence.cxx | 14 +
cpputools/source/unoexe/unoexe.cxx | 2
desktop/source/deployment/registry/component/dp_component.cxx | 2
drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx | 3
filter/source/svg/test/svg2odf.cxx | 44 +++--
forms/source/runtime/formoperations.cxx | 2
framework/source/accelerators/acceleratorconfiguration.cxx | 4
idlc/source/parser.y | 2
jvmfwk/plugins/sunmajor/pluginlib/util.cxx | 2
l10ntools/source/helpex.cxx | 1
l10ntools/source/merge.cxx | 1
registry/source/keyimpl.cxx | 1
reportdesign/source/filter/xml/xmlGroup.cxx | 2
reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx | 2
reportdesign/source/filter/xml/xmlSection.cxx | 4
reportdesign/source/filter/xml/xmlTable.cxx | 2
sal/qa/osl/process/osl_process_child.cxx | 3
sal/rtl/alloc_arena.cxx | 1
sal/rtl/alloc_cache.cxx | 3
sc/source/core/data/table4.cxx | 2
sc/source/filter/oox/workbookfragment.cxx | 3
scaddins/source/analysis/analysishelper.cxx | 10 -
scaddins/source/datefunc/datefunc.cxx | 3
scaddins/source/pricing/pricing.cxx | 3
sd/source/ui/framework/tools/FrameworkHelper.cxx | 20 --
sd/source/ui/inc/framework/FrameworkHelper.hxx | 3
sd/source/ui/unoidl/unosrch.cxx | 3
sdext/source/pdfimport/test/pdf2xml.cxx | 64 ++++----
sfx2/source/control/itemdel.cxx | 1
svl/source/items/whiter.cxx | 10 -
svl/source/misc/strmadpt.cxx | 1
svtools/langsupport/langsupport.cxx | 60 ++++----
svtools/source/svhtml/htmlout.cxx | 2
svx/source/gengal/gengal.cxx | 74 +++++-----
svx/source/sdr/primitive2d/sdrattributecreator.cxx | 2
svx/source/sidebar/paragraph/ParaPropertyPanel.cxx | 5
svx/source/sidebar/paragraph/ParaPropertyPanel.hxx | 1
svx/workben/pixelctl.cxx | 36 ++--
sw/source/core/access/acccontext.cxx | 1
sw/source/core/docnode/node.cxx | 4
sw/source/core/frmedt/fecopy.cxx | 2
sw/source/filter/html/htmlform.cxx | 7
sw/source/uibase/envelp/labelcfg.cxx | 2
ucb/source/ucp/ftp/ftpdirp.cxx | 1
unoidl/source/unoidl-check.cxx | 4
unotest/source/cpp/officeconnection.cxx | 2
unotools/source/config/pathoptions.cxx | 6
unusedcode.easy | 5
vcl/generic/print/genpspgraphics.cxx | 2
vcl/generic/print/text_gfx.cxx | 10 -
vcl/qa/cppunit/timer.cxx | 9 -
vcl/workben/svdem.cxx | 34 ++--
vcl/workben/svpclient.cxx | 28 ++-
vcl/workben/svptest.cxx | 26 ++-
vcl/workben/vcldemo.cxx | 34 ++--
xmloff/source/transform/ChartOASISTContext.cxx | 1
xmloff/source/transform/StyleOOoTContext.cxx | 3
66 files changed, 335 insertions(+), 272 deletions(-)
New commits:
commit b7804c42c2bb86bdd7824cf07905d843e671df40
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Nov 5 11:06:57 2014 +0000
callcatcher: update unused code
Change-Id: I792c007541d4d703f17c8cdcd2d441ca505acc52
diff --git a/sd/source/ui/framework/tools/FrameworkHelper.cxx b/sd/source/ui/framework/tools/FrameworkHelper.cxx
index 539f07f..a22e70b 100644
--- a/sd/source/ui/framework/tools/FrameworkHelper.cxx
+++ b/sd/source/ui/framework/tools/FrameworkHelper.cxx
@@ -324,26 +324,6 @@ public:
FrameworkHelper::InstanceMap FrameworkHelper::maInstanceMap;
-::boost::shared_ptr<FrameworkHelper> FrameworkHelper::Instance (
- const Reference<frame::XController>& rxController)
-{
- // Tunnel through the controller to obtain a ViewShellBase.
- Reference<lang::XUnoTunnel> xTunnel (rxController, UNO_QUERY);
- if (xTunnel.is())
- {
- ::sd::DrawController* pController = reinterpret_cast<sd::DrawController*>(
- xTunnel->getSomething(sd::DrawController::getUnoTunnelId()));
- if (pController != NULL)
- {
- ViewShellBase* pBase = pController->GetViewShellBase();
- if (pBase != NULL)
- return Instance(*pBase);
- }
- }
-
- return ::boost::shared_ptr<FrameworkHelper>();
-}
-
::boost::shared_ptr<FrameworkHelper> FrameworkHelper::Instance (ViewShellBase& rBase)
{
diff --git a/sd/source/ui/inc/framework/FrameworkHelper.hxx b/sd/source/ui/inc/framework/FrameworkHelper.hxx
index a5d29a2..ca2a33d 100644
--- a/sd/source/ui/inc/framework/FrameworkHelper.hxx
+++ b/sd/source/ui/inc/framework/FrameworkHelper.hxx
@@ -109,9 +109,6 @@ public:
*/
static ::boost::shared_ptr<FrameworkHelper> Instance (ViewShellBase& rBase);
- static ::boost::shared_ptr<FrameworkHelper> Instance (
- const css::uno::Reference<css::frame::XController>& rxController);
-
/** Mark the FrameworkHelper object for the given ViewShellBase as
disposed. A following ReleaseInstance() call will destroy the
FrameworkHelper object.
diff --git a/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx b/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx
index e683e6d..b118185 100644
--- a/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx
+++ b/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx
@@ -219,11 +219,6 @@ void ParaPropertyPanel::ReSize(bool /* bSize */)
mxSidebar->requestLayout();
}
-void ParaPropertyPanel::EndSpacingPopupMode (void)
-{
- //maLineSpacePopup.Hide();
-}
-
void ParaPropertyPanel::EndBulletsPopupMode (void)
{
//i122054, Missed following line, for collapse the bullets popup
diff --git a/svx/source/sidebar/paragraph/ParaPropertyPanel.hxx b/svx/source/sidebar/paragraph/ParaPropertyPanel.hxx
index 56179de..f8443b6 100644
--- a/svx/source/sidebar/paragraph/ParaPropertyPanel.hxx
+++ b/svx/source/sidebar/paragraph/ParaPropertyPanel.hxx
@@ -77,7 +77,6 @@ public:
sal_uInt16 GetNumTypeIndex(){ return mnNumTypeIndex; }
FieldUnit GetCurrentUnit( SfxItemState eState, const SfxPoolItem* pState );
- void EndSpacingPopupMode (void);
void EndBulletsPopupMode (void);
void EndNumberingPopupMode (void);
diff --git a/unusedcode.easy b/unusedcode.easy
index 31486fb..f22f7b1 100644
--- a/unusedcode.easy
+++ b/unusedcode.easy
@@ -1,5 +1,6 @@
BigInt::BigInt(unsigned int)
CalcUnoApiTest::CalcUnoApiTest(rtl::OUString const&)
+Chart2ImportTest::testTextCanOverlapXLSX()
FontCharMap::GetDefaultMap(bool)
GDriveDocument::GDriveDocument(GDriveSession*)
GDriveFolder::GDriveFolder(GDriveSession*)
@@ -18,6 +19,8 @@ OutputDevice::PixelToLogic(vcl::Region const&, MapMode const&) const
Primitive2dXmlDump::filterActionType(unsigned short, bool)
Primitive2dXmlDump::filterAllActionTypes()
SalGraphics::drawTransformedBitmap(basegfx::B2DPoint const&, basegfx::B2DPoint const&, basegfx::B2DPoint const&, SalBitmap const&, SalBitmap const*)
+ScBroadcastAreaSlotMachine::AreaBroadcastInRange(ScRange const&, ScHint const&) const
+ScColumn::MarkSubTotalCells(sc::ColumnSpanSet&, int, int, bool) const
ScDocument::CreateFormatTable() const
ScFormulaCellGroup::scheduleCompilation()
ScRawToken::Clone() const
@@ -177,7 +180,6 @@ connectivity::firebird::release(int&, cppu::OBroadcastHelperVar<cppu::OMultiType
connectivity::odbc::appendSQLWCHARs(rtl::OUStringBuffer&, wchar_t const*, int)
connectivity::sdbcx::OGroup::OGroup(bool)
connectivity::sdbcx::OGroup::OGroup(rtl::OUString const&, bool)
-dbaccess::ORowSetCacheIterator::getMutex() const
oglcanvas::CanvasHelper::flush() const
oglcanvas::TextLayout::draw(com::sun::star::rendering::ViewState const&, com::sun::star::rendering::RenderState const&, com::sun::star::uno::Reference<com::sun::star::rendering::XGraphicDevice> const&) const
oox::drawingml::TextListStyle::dump() const
@@ -189,7 +191,6 @@ sc::CLBuildKernelThread::produce()
sc::CellValues::transferTo(ScColumn&, int)
sd::LeftDrawPaneShell::RegisterInterface(SfxModule*)
sd::LeftImpressPaneShell::RegisterInterface(SfxModule*)
-sd::framework::FrameworkHelper::Instance(com::sun::star::uno::Reference<com::sun::star::frame::XController> const&)
sfx2::SvBaseLink::SvBaseLink(rtl::OUString const&, unsigned short, sfx2::SvLinkSource*)
std::_Rb_tree<rtl::OUString, std::pair<rtl::OUString const, (anonymous namespace)::TemplateId>, std::_Select1st<std::pair<rtl::OUString const, (anonymous namespace)::TemplateId> >, std::less<rtl::OUString>, std::allocator<std::pair<rtl::OUString const, (anonymous namespace)::TemplateId> > >::_Rb_tree(std::_Rb_tree<rtl::OUString, std::pair<rtl::OUString const, (anonymous namespace)::TemplateId>, std::_Select1st<std::pair<rtl::OUString const, (anonymous namespace)::TemplateId> >, std::less<rtl::OUString>, std::allocator<std::pair<rtl::OUString const, (anonymous namespace)::TemplateId> > >&&)
std::__cxx1998::vector<rtl::Reference<oox::xls::(anonymous namespace)::WorkerThread>, std::allocator<rtl::Reference<oox::xls::(anonymous namespace)::WorkerThread> > >::reserve(unsigned long)
commit 12bcfec04fcbe6425e327109ad47cd2b2b80d2bd
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Nov 5 10:15:38 2014 +0000
markup with event type not checker type
Change-Id: I14c0c5d90b67000cb4fe9e6be647854abfe784da
diff --git a/basegfx/source/matrix/b3dhommatrix.cxx b/basegfx/source/matrix/b3dhommatrix.cxx
index 6e496d1..9233875 100644
--- a/basegfx/source/matrix/b3dhommatrix.cxx
+++ b/basegfx/source/matrix/b3dhommatrix.cxx
@@ -465,6 +465,7 @@ namespace basegfx
if(!fTools::equalZero(fShearY))
{
+ // coverity[copy_paste_error] - this is correct getZ, not getY
rShear.setY(rShear.getY() / rScale.getZ());
}
@@ -472,6 +473,7 @@ namespace basegfx
if(!fTools::equalZero(fShearZ))
{
+ // coverity[original] - this is not an original copy-and-paste source for ^^^
rShear.setZ(rShear.getZ() / rScale.getZ());
}
diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx
index 13bc3dc..36e419e 100644
--- a/basic/source/classes/sbunoobj.cxx
+++ b/basic/source/classes/sbunoobj.cxx
@@ -905,7 +905,7 @@ Type getUnoTypeForSbxValue( const SbxValue* pVal )
sal_Int32 nIdx = nLower;
for( sal_Int32 i = 0 ; i < nSize ; i++,nIdx++ )
{
- // coverity[array_vs_singleton]
+ // coverity[callee_ptr_arith]
SbxVariableRef xVar = pArray->Get32( &nIdx );
Type aType = getUnoTypeForSbxValue( (SbxVariable*)xVar );
if( bNeedsInit )
@@ -1351,7 +1351,7 @@ Any sbxToUnoValue( const SbxValue* pVar, const Type& rType, Property* pUnoProper
sal_Int32 nIdx = nLower;
for( sal_Int32 i = 0 ; i < nSeqSize ; i++,nIdx++ )
{
- // coverity[array_vs_singleton]
+ // coverity[callee_ptr_arith]
SbxVariableRef xVar = pArray->Get32( &nIdx );
// Convert the value of Sbx to Uno
diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx
index 4ab4fff..c1b6889 100644
--- a/basic/source/runtime/methods.cxx
+++ b/basic/source/runtime/methods.cxx
@@ -4372,7 +4372,7 @@ RTLFUNC(StrConv)
{
++index;
}
- // coverity[array_vs_singleton]
+ // coverity[callee_ptr_arith]
pArray->Put( pNew, &index );
}
diff --git a/basic/source/runtime/methods1.cxx b/basic/source/runtime/methods1.cxx
index 3c81652..94ee18b 100644
--- a/basic/source/runtime/methods1.cxx
+++ b/basic/source/runtime/methods1.cxx
@@ -839,7 +839,7 @@ RTLFUNC(Array)
{
++index;
}
- // coverity[array_vs_singleton]
+ // coverity[callee_ptr_arith]
pArray->Put( pNew, &index );
}
@@ -1734,7 +1734,7 @@ RTLFUNC(Join)
pArr->GetDim( 1, nLower, nUpper );
for (short i = nLower; i <= nUpper; ++i)
{
- // coverity[array_vs_singleton]
+ // coverity[callee_ptr_arith]
OUString aStr = pArr->Get( &i )->GetOUString();
aRetStr += aStr;
if( i != nUpper )
diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx
index 455611f..a8a5e94 100644
--- a/basic/source/runtime/runtime.cxx
+++ b/basic/source/runtime/runtime.cxx
@@ -669,7 +669,7 @@ void SbiRuntime::SetParameters( SbxArray* pParams )
{
SbxVariable* v = pParams->Get( j );
short nDimIndex = j - i;
- // coverity[array_vs_singleton]
+ // coverity[callee_ptr_arith]
pArray->Put( v, &nDimIndex );
}
SbxVariable* pArrayVar = new SbxVariable( SbxVARIANT );
diff --git a/bridges/source/jni_uno/jni_bridge.cxx b/bridges/source/jni_uno/jni_bridge.cxx
index 6409c2a..da3a33b 100644
--- a/bridges/source/jni_uno/jni_bridge.cxx
+++ b/bridges/source/jni_uno/jni_bridge.cxx
@@ -490,7 +490,7 @@ SAL_DLLPUBLIC_EXPORT void SAL_CALL uno_ext_getMapping(
uno_registerMapping(
&mapping, Bridge_free,
pFrom, (uno_Environment *)pTo->pExtEnv, 0 );
- //coverity[leaked_storage]
+ // coverity[leaked_storage]
}
else if ( from_env_typename == UNO_LB_UNO && to_env_typename == UNO_LB_JAVA )
{
@@ -500,7 +500,7 @@ SAL_DLLPUBLIC_EXPORT void SAL_CALL uno_ext_getMapping(
uno_registerMapping(
&mapping, Bridge_free,
(uno_Environment *)pFrom->pExtEnv, pTo, 0 );
- //coverity[leaked_storage]
+ // coverity[leaked_storage]
}
}
catch (const BridgeRuntimeError & err)
diff --git a/bridges/source/jni_uno/jni_info.cxx b/bridges/source/jni_uno/jni_info.cxx
index 96f6957..038d971 100644
--- a/bridges/source/jni_uno/jni_info.cxx
+++ b/bridges/source/jni_uno/jni_info.cxx
@@ -104,6 +104,7 @@ JNI_interface_type_info::JNI_interface_type_info(
typelib_InterfaceTypeDescription * td =
reinterpret_cast< typelib_InterfaceTypeDescription * >(
m_td.get() );
+ // coverity [ctor_dtor_leak]
m_methods = new jmethodID[ td->nMapFunctionIndexToMemberIndex ];
sal_Int32 nMethodIndex = 0;
typelib_TypeDescriptionReference ** ppMembers = td->ppMembers;
@@ -289,6 +290,7 @@ JNI_compound_type_info::JNI_compound_type_info(
((typelib_TypeDescription *)td)->pWeakRef,
jni_info->m_RuntimeException_type.getTypeLibType() ))
{
+ // coverity [ctor_dtor_leak]
m_fields = new jfieldID[ 2 ];
m_fields[ 0 ] = 0; // special Throwable.getMessage()
// field Context
@@ -848,7 +850,7 @@ JNI_info::JNI_info(
css::uno::TypeDescription XInterface_td(
::getCppuType(
(css::uno::Reference< css::uno::XInterface > const *)0 ) );
- //coverity [ctor_dtor_leak]
+ // coverity [ctor_dtor_leak]
m_XInterface_type_info =
new JNI_interface_type_info( jni, XInterface_td.get() );
}
diff --git a/cppu/source/typelib/static_types.cxx b/cppu/source/typelib/static_types.cxx
index 887a884..13d2e85 100644
--- a/cppu/source/typelib/static_types.cxx
+++ b/cppu/source/typelib/static_types.cxx
@@ -445,7 +445,7 @@ CPPU_DLLPUBLIC void SAL_CALL typelib_static_interface_type_init(
typelib_TypeDescriptionReference * pBaseType )
SAL_THROW_EXTERN_C()
{
- // coverity[array_vs_singleton]
+ // coverity[callee_ptr_arith]
typelib_static_mi_interface_type_init(
ppRef, pTypeName, pBaseType == 0 ? 0 : 1, &pBaseType);
}
diff --git a/cppu/source/typelib/typelib.cxx b/cppu/source/typelib/typelib.cxx
index b0b1a17..7f3e808 100644
--- a/cppu/source/typelib/typelib.cxx
+++ b/cppu/source/typelib/typelib.cxx
@@ -901,14 +901,12 @@ extern "C" CPPU_DLLPUBLIC void SAL_CALL typelib_typedescription_newInterface(
typelib_TypeDescriptionReference ** ppMembers )
SAL_THROW_EXTERN_C()
{
- // coverity[array_vs_singleton]
+ // coverity[callee_ptr_arith]
typelib_typedescription_newMIInterface(
ppRet, pTypeName, 0, 0, 0, 0, 0, pBaseInterface == 0 ? 0 : 1,
&pBaseInterface, nMembers, ppMembers);
}
-
-
namespace {
class BaseList {
diff --git a/cppu/source/uno/sequence.cxx b/cppu/source/uno/sequence.cxx
index 1f06dd3..2d2a894 100644
--- a/cppu/source/uno/sequence.cxx
+++ b/cppu/source/uno/sequence.cxx
@@ -268,7 +268,10 @@ static inline bool idefaultConstructElements(
case typelib_TypeClass_SEQUENCE:
{
if (nAlloc >= 0)
- pSeq = reallocSeq( pSeq, sizeof(uno_Sequence *), nAlloc );
+ {
+ // coverity[suspicious_sizeof] - sizeof(uno_Sequence*) is correct here
+ pSeq = reallocSeq(pSeq, sizeof(uno_Sequence*), nAlloc);
+ }
if (pSeq != 0)
{
uno_Sequence ** pElements =
@@ -431,8 +434,8 @@ static inline bool icopyConstructFromElements(
rtl_uString ** pDestElements = (rtl_uString **) pSeq->elements;
for ( sal_Int32 nPos = nStartIndex; nPos < nStopIndex; ++nPos )
{
- // https://communities.coverity.com/thread/2993
- /* coverity[overrun-buffer-arg] */
+ // This code tends to trigger coverity's overrun-buffer-arg warning
+ // coverity[index_parm_via_loop_bound] - https://communities.coverity.com/thread/2993
::rtl_uString_acquire(
((rtl_uString **)pSourceElements)[nPos] );
pDestElements[nPos] = ((rtl_uString **)pSourceElements)[nPos];
@@ -534,7 +537,10 @@ static inline bool icopyConstructFromElements(
case typelib_TypeClass_SEQUENCE: // sequence of sequence
{
if (nAlloc >= 0)
- pSeq = reallocSeq( pSeq, sizeof(uno_Sequence *), nAlloc );
+ {
+ // coverity[suspicious_sizeof] - sizeof(uno_Sequence*) is correct here
+ pSeq = reallocSeq(pSeq, sizeof(uno_Sequence*), nAlloc);
+ }
if (pSeq != 0)
{
typelib_TypeDescription * pElementTypeDescr = 0;
diff --git a/cpputools/source/unoexe/unoexe.cxx b/cpputools/source/unoexe/unoexe.cxx
index 91d75b4..e5944ae 100644
--- a/cpputools/source/unoexe/unoexe.cxx
+++ b/cpputools/source/unoexe/unoexe.cxx
@@ -493,7 +493,7 @@ SAL_IMPLEMENT_MAIN()
nIndex = 0;
OUString aUnoUrlToken( aUnoUrl.getToken( 1, ';', nIndex ) );
- // coverity[infinite_loop]
+ // coverity[loop_top] - not really an infinite loop, we can be instructed to exit via the connection
for (;;)
{
// accepting
diff --git a/desktop/source/deployment/registry/component/dp_component.cxx b/desktop/source/deployment/registry/component/dp_component.cxx
index fe30080..7976be5 100644
--- a/desktop/source/deployment/registry/component/dp_component.cxx
+++ b/desktop/source/deployment/registry/component/dp_component.cxx
@@ -458,7 +458,7 @@ void BackendImpl::initServiceRdbFiles()
// switch native rdb:
if (!m_nativeRDB_orig.isEmpty())
{
- create_ucb_content(
+ (void)create_ucb_content(
&oldRDB, makeURL(getCachePath(), m_nativeRDB_orig),
xCmdEnv, false /* no throw */ );
}
diff --git a/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx b/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx
index 0f77658..af59a45 100644
--- a/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx
+++ b/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx
@@ -378,9 +378,10 @@ namespace drawinglayer
aRetval = Primitive2DSequence(&aPrimitiveBlackAndWhite, 1);
break;
}
+ // coverity[dead_error_begin] - intentional dead case
case GRAPHICDRAWMODE_WATERMARK:
{
- OSL_ENSURE(false, "OOps, GRAPHICDRAWMODE_WATERMARK should already be handled (see above)");
+ assert(false && "OOps, GRAPHICDRAWMODE_WATERMARK should already be handled (see above)");
// fallthrough intended
}
default: // case GRAPHICDRAWMODE_STANDARD:
diff --git a/forms/source/runtime/formoperations.cxx b/forms/source/runtime/formoperations.cxx
index c6a16aa..a55451a 100644
--- a/forms/source/runtime/formoperations.cxx
+++ b/forms/source/runtime/formoperations.cxx
@@ -1520,7 +1520,7 @@ namespace frm
if ( m_xCursor->isLast() )
m_xUpdateCursor->moveToInsertRow();
else
- m_xCursor->next();
+ (void)m_xCursor->next();
}
return true;
diff --git a/framework/source/accelerators/acceleratorconfiguration.cxx b/framework/source/accelerators/acceleratorconfiguration.cxx
index be5799d..a36cec0 100644
--- a/framework/source/accelerators/acceleratorconfiguration.cxx
+++ b/framework/source/accelerators/acceleratorconfiguration.cxx
@@ -1208,7 +1208,7 @@ void XCUBasedAcceleratorConfiguration::impl_ts_save(bool bPreferred, const css::
// take over all changes into the original container
SolarMutexGuard g;
- // coverity[reverse_inull]
+ // coverity[check_after_deref]
if (m_pPrimaryWriteCache)
{
m_aPrimaryReadCache.takeOver(*m_pPrimaryWriteCache);
@@ -1247,7 +1247,7 @@ void XCUBasedAcceleratorConfiguration::impl_ts_save(bool bPreferred, const css::
// take over all changes into the original container
SolarMutexGuard g;
- // coverity[reverse_inull]
+ // coverity[check_after_deref]
if (m_pSecondaryWriteCache)
{
m_aSecondaryReadCache.takeOver(*m_pSecondaryWriteCache);
diff --git a/idlc/source/parser.y b/idlc/source/parser.y
index afa3801..4007780 100644
--- a/idlc/source/parser.y
+++ b/idlc/source/parser.y
@@ -2154,7 +2154,7 @@ at_least_one_scoped_name :
} else
{
StringList* pScopedNames = new StringList();
- //coverity [copy_paste_error]
+ // coverity [copy_paste_error]
pScopedNames->push_back(*$1);
$$ = pScopedNames;
}
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
index f3b8991..46f3911 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
@@ -683,7 +683,7 @@ void bubbleSortVersion(vector<rtl::Reference<VendorBase> >& vec)
//check if version of current is recognized, by comparing it with itself
try
{
- cur->compareVersions(cur->getVersion());
+ (void)cur->compareVersions(cur->getVersion());
}
catch (MalformedVersionException &)
{
diff --git a/l10ntools/source/helpex.cxx b/l10ntools/source/helpex.cxx
index 463c8a4..e68abb5 100644
--- a/l10ntools/source/helpex.cxx
+++ b/l10ntools/source/helpex.cxx
@@ -88,6 +88,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) {
aInput >> sTemp;
while( !aInput.eof() )
{
+ // coverity[tainted_data] - this is a build time tool
const OString sXhpFile( sTemp.data(), (sal_Int32)sTemp.length() );
HelpParser aParser( sXhpFile );
const OString sOutput(
diff --git a/l10ntools/source/merge.cxx b/l10ntools/source/merge.cxx
index 09ee4aa..ee98009 100644
--- a/l10ntools/source/merge.cxx
+++ b/l10ntools/source/merge.cxx
@@ -240,6 +240,7 @@ MergeDataFile::MergeDataFile(
bool bSkipCurrentPOFile = false;
const OString sFileName( lcl_NormalizeFilename(rFile) );
const bool bReadAll = sFileName.isEmpty();
+ // coverity[tainted_data] - this is a build time tool
const OString sPoFileName(sPoFile.data(), (sal_Int32)sPoFile.length());
PoIfstream aPoInput;
aPoInput.open( sPoFileName );
diff --git a/registry/source/keyimpl.cxx b/registry/source/keyimpl.cxx
index b4e4786..2b6c3c3 100644
--- a/registry/source/keyimpl.cxx
+++ b/registry/source/keyimpl.cxx
@@ -634,6 +634,7 @@ RegError ORegKey::getValue(const OUString& valueName, RegValue value) const
case RG_VALUETYPE_BINARY:
memcpy(value, pBuffer, valueSize);
break;
+ // coverity[dead_error_begin] - following conditions exist to avoid compiler warning
case RG_VALUETYPE_LONGLIST:
case RG_VALUETYPE_STRINGLIST:
case RG_VALUETYPE_UNICODELIST:
diff --git a/reportdesign/source/filter/xml/xmlGroup.cxx b/reportdesign/source/filter/xml/xmlGroup.cxx
index ec34bb5..ab49807 100644
--- a/reportdesign/source/filter/xml/xmlGroup.cxx
+++ b/reportdesign/source/filter/xml/xmlGroup.cxx
@@ -43,7 +43,7 @@ namespace rptxml
{
sal_uInt16 nRet = report::KeepTogether::NO;
const SvXMLEnumMapEntry* aXML_EnumMap = OXMLHelper::GetKeepTogetherOptions();
- SvXMLUnitConverter::convertEnum( nRet, _sValue, aXML_EnumMap );
+ (void)SvXMLUnitConverter::convertEnum( nRet, _sValue, aXML_EnumMap );
return nRet;
}
diff --git a/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx b/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx
index 0dde198..009442c 100644
--- a/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx
+++ b/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx
@@ -182,7 +182,7 @@ void SAL_CALL ImportDocumentHandler::startElement(const OUString & _sName, const
{
sal_uInt16 nRet = static_cast<sal_uInt16>(sdb::CommandType::COMMAND);
const SvXMLEnumMapEntry* aXML_EnumMap = OXMLHelper::GetCommandTypeOptions();
- SvXMLUnitConverter::convertEnum( nRet, sValue, aXML_EnumMap );
+ (void)SvXMLUnitConverter::convertEnum( nRet, sValue, aXML_EnumMap );
m_xDatabaseDataProvider->setCommandType(nRet);
}
break;
diff --git a/reportdesign/source/filter/xml/xmlSection.cxx b/reportdesign/source/filter/xml/xmlSection.cxx
index 9094457..ed2e20a 100644
--- a/reportdesign/source/filter/xml/xmlSection.cxx
+++ b/reportdesign/source/filter/xml/xmlSection.cxx
@@ -41,11 +41,11 @@ namespace rptxml
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::xml::sax;
- sal_uInt16 lcl_getReportPrintOption(const OUString& _sValue)
+ sal_uInt16 lcl_getReportPrintOption(const OUString& _sValue)
{
sal_uInt16 nRet = report::ReportPrintOption::ALL_PAGES;
const SvXMLEnumMapEntry* aXML_EnumMap = OXMLHelper::GetReportPrintOptions();
- SvXMLUnitConverter::convertEnum( nRet, _sValue, aXML_EnumMap );
+ (void)SvXMLUnitConverter::convertEnum( nRet, _sValue, aXML_EnumMap );
return nRet;
}
diff --git a/reportdesign/source/filter/xml/xmlTable.cxx b/reportdesign/source/filter/xml/xmlTable.cxx
index 8af0b10..7b32c7a 100644
--- a/reportdesign/source/filter/xml/xmlTable.cxx
+++ b/reportdesign/source/filter/xml/xmlTable.cxx
@@ -50,7 +50,7 @@ namespace rptxml
{
sal_uInt16 nRet = report::ForceNewPage::NONE;
const SvXMLEnumMapEntry* aXML_EnumMap = OXMLHelper::GetForceNewPageOptions();
- SvXMLUnitConverter::convertEnum( nRet,_sValue,aXML_EnumMap );
+ (void)SvXMLUnitConverter::convertEnum( nRet,_sValue,aXML_EnumMap );
return nRet;
}
diff --git a/sal/qa/osl/process/osl_process_child.cxx b/sal/qa/osl/process/osl_process_child.cxx
index ca9adb3..ee5ecf5 100644
--- a/sal/qa/osl/process/osl_process_child.cxx
+++ b/sal/qa/osl/process/osl_process_child.cxx
@@ -94,7 +94,10 @@ int main(int argc, char* argv[])
if (argc > 2)
{
if (0 == strcmp("-join", argv[1]))
+ {
+ // coverity[tainted_data] - this is a build-time only test tool
wait_for_seconds(argv[2]);
+ }
else if (0 == strcmp("-env", argv[1]))
dump_env(argv[2]);
}
diff --git a/sal/rtl/alloc_arena.cxx b/sal/rtl/alloc_arena.cxx
index c49f147..b826f13 100644
--- a/sal/rtl/alloc_arena.cxx
+++ b/sal/rtl/alloc_arena.cxx
@@ -309,6 +309,7 @@ rtl_arena_hash_rescale (
rtl_arena_segment_type * next = curr->m_fnext;
rtl_arena_segment_type ** head;
+ // coverity[negative_shift]
head = &(arena->m_hash_table[RTL_ARENA_HASH_INDEX(arena, curr->m_addr)]);
curr->m_fnext = (*head);
(*head) = curr;
diff --git a/sal/rtl/alloc_cache.cxx b/sal/rtl/alloc_cache.cxx
index be6cd4da..a8db5c2 100644
--- a/sal/rtl/alloc_cache.cxx
+++ b/sal/rtl/alloc_cache.cxx
@@ -138,6 +138,7 @@ rtl_cache_hash_rescale (
rtl_cache_bufctl_type * next = curr->m_next;
rtl_cache_bufctl_type ** head;
+ // coverity[negative_shift]
head = &(cache->m_hash_table[RTL_CACHE_HASH_INDEX(cache, curr->m_addr)]);
curr->m_next = (*head);
(*head) = curr;
@@ -208,6 +209,7 @@ rtl_cache_hash_remove (
if (!(cache->m_features & RTL_CACHE_FEATURE_RESCALE))
{
sal_Size ave = nbuf >> cache->m_hash_shift;
+ // coverity[negative_shift]
sal_Size new_size = cache->m_hash_size << (highbit(ave) - 1);
cache->m_features |= RTL_CACHE_FEATURE_RESCALE;
@@ -1438,6 +1440,7 @@ rtl_cache_depot_wsupdate (
RTL_MEMORY_LOCK_ACQUIRE(&(cache->m_depot_lock));
}
}
+ // coverity[missing_unlock]
}
/** rtl_cache_wsupdate()
diff --git a/sc/source/core/data/table4.cxx b/sc/source/core/data/table4.cxx
index ce9a07e..701e6d5 100644
--- a/sc/source/core/data/table4.cxx
+++ b/sc/source/core/data/table4.cxx
@@ -366,7 +366,7 @@ void ScTable::FillAnalyse( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
nRow = sal::static_int_cast<SCROW>( nRow + nAddY );
for (sal_uInt16 i=1; i<nCount && rListData; i++)
{
- GetString(nCol, nRow, aStr);
+ (void)GetString(nCol, nRow, aStr);
if (!rListData->GetSubIndex(aStr, rListIndex))
rListData = NULL;
nCol = sal::static_int_cast<SCCOL>( nCol + nAddX );
diff --git a/sc/source/filter/oox/workbookfragment.cxx b/sc/source/filter/oox/workbookfragment.cxx
index 8488b46..fd95bf6 100644
--- a/sc/source/filter/oox/workbookfragment.cxx
+++ b/sc/source/filter/oox/workbookfragment.cxx
@@ -328,7 +328,7 @@ void importSheetFragments( WorkbookFragment& rWorkbookHandler, SheetFragmentVect
nSheetsLeft++;
}
- // coverity[infinite_loop]
+ // coverity[loop_top] - this isn't an infinite loop where nSheetsLeft gets decremented by the above threads
while( nSheetsLeft > 0)
{
// This is a much more controlled re-enterancy hazard than
@@ -438,6 +438,7 @@ void WorkbookFragment::finalizeImport()
case SHEETTYPE_CHARTSHEET:
xFragment.set( new ChartsheetFragment( *xSheetGlob, aFragmentPath ) );
break;
+ // coverity[dead_error_begin] - following conditions exist to avoid compiler warning
case SHEETTYPE_EMPTYSHEET:
case SHEETTYPE_MODULESHEET:
break;
diff --git a/scaddins/source/analysis/analysishelper.cxx b/scaddins/source/analysis/analysishelper.cxx
index 1dc310b..9e7e8ef 100644
--- a/scaddins/source/analysis/analysishelper.cxx
+++ b/scaddins/source/analysis/analysishelper.cxx
@@ -598,7 +598,7 @@ double GetYearFrac( sal_Int32 nNullDate, sal_Int32 nStartDate, sal_Int32 nEndDat
case 3: // 3=exact/365
nDaysInYear = 365;
break;
- //coverity[dead_error_begin] - condition exists to avoid compiler warning
+ // coverity[dead_error_begin] - following conditions exist to avoid compiler warning
default:
throw lang::IllegalArgumentException();
}
@@ -928,7 +928,7 @@ bool ParseDouble( const sal_Unicode*& rp, double& rRet )
else
eS = S_End;
break;
- //coverity[dead_error_begin] - condition exists to avoid compiler warning
+ // coverity[dead_error_begin] - following conditions exist to avoid compiler warning
case S_End:
break;
}
diff --git a/scaddins/source/datefunc/datefunc.cxx b/scaddins/source/datefunc/datefunc.cxx
index e24f65c..df62929 100644
--- a/scaddins/source/datefunc/datefunc.cxx
+++ b/scaddins/source/datefunc/datefunc.cxx
@@ -429,7 +429,8 @@ OUString SAL_CALL ScaDateAddIn::getProgrammaticCategoryName(
case ScaCat_Inf: aRet = STR_FROM_ANSI( "Information" ); break;
case ScaCat_Math: aRet = STR_FROM_ANSI( "Mathematical" ); break;
case ScaCat_Tech: aRet = STR_FROM_ANSI( "Technical" ); break;
- default: // to prevent compiler warnings
+ // coverity[dead_error_begin] - following conditions exist to avoid compiler warning
+ default:
break;
}
}
diff --git a/scaddins/source/pricing/pricing.cxx b/scaddins/source/pricing/pricing.cxx
index 772f1e3..8da5725 100644
--- a/scaddins/source/pricing/pricing.cxx
+++ b/scaddins/source/pricing/pricing.cxx
@@ -438,7 +438,8 @@ OUString SAL_CALL ScaPricingAddIn::getProgrammaticCategoryName(
case ScaCat_Inf: aRet = STR_FROM_ANSI( "Information" ); break;
case ScaCat_Math: aRet = STR_FROM_ANSI( "Mathematical" ); break;
case ScaCat_Tech: aRet = STR_FROM_ANSI( "Technical" ); break;
- default: // to prevent compiler warnings
+ // coverity[dead_error_begin] - following conditions exist to avoid compiler warning
+ default:
break;
}
}
diff --git a/sfx2/source/control/itemdel.cxx b/sfx2/source/control/itemdel.cxx
index 7ff4d38..9ba81f7 100644
--- a/sfx2/source/control/itemdel.cxx
+++ b/sfx2/source/control/itemdel.cxx
@@ -80,6 +80,7 @@ void DeleteItemOnIdle(SfxPoolItem* pItem)
DBG_ASSERT( 0 == pItem->GetRefCount(), "deleting item in use" );
SfxItemDisruptor_Impl *pDesruptor = new SfxItemDisruptor_Impl(pItem);
pDesruptor->LaunchDeleteOnIdle();
+ // coverity[leaked_storage] pDesruptor takes care of its own destruction at idle time
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svl/source/items/whiter.cxx b/svl/source/items/whiter.cxx
index 9a4e748..d69960c 100644
--- a/svl/source/items/whiter.cxx
+++ b/svl/source/items/whiter.cxx
@@ -26,18 +26,14 @@ SfxWhichIter::SfxWhichIter( const SfxItemSet& rSet, sal_uInt16 nFromWh, sal_uInt
pStart(rSet.GetRanges()),
nOfst(0), nFrom(nFromWh), nTo(nToWh)
{
- if ( nFrom > 0 )
- FirstWhich();
+ if (nFrom > 0)
+ (void)FirstWhich();
}
-
-
SfxWhichIter::~SfxWhichIter()
{
}
-
-
sal_uInt16 SfxWhichIter::NextWhich()
{
while ( 0 != *pRanges )
@@ -56,8 +52,6 @@ sal_uInt16 SfxWhichIter::NextWhich()
return 0;
}
-
-
sal_uInt16 SfxWhichIter::FirstWhich()
{
pRanges = pStart;
diff --git a/svl/source/misc/strmadpt.cxx b/svl/source/misc/strmadpt.cxx
index 7b8dc4e..207e521 100644
--- a/svl/source/misc/strmadpt.cxx
+++ b/svl/source/misc/strmadpt.cxx
@@ -945,6 +945,7 @@ bool SvDataPipe_Impl::removeMark(sal_uInt32 nPosition)
if (t == m_aMarks.end())
return false;
m_aMarks.erase(t);
+ // coverity[pass_freed_arg] - remove frees m_pFirstPage but then sets m_pFirstPage to something else
while (remove(m_pFirstPage)) ;
return true;
}
diff --git a/svtools/source/svhtml/htmlout.cxx b/svtools/source/svhtml/htmlout.cxx
index 54941d3..b88d388 100644
--- a/svtools/source/svhtml/htmlout.cxx
+++ b/svtools/source/svhtml/htmlout.cxx
@@ -455,7 +455,7 @@ static OString lcl_ConvertCharToHTML( sal_Unicode c,
// If the character could not be converted to the destination
// character set, the UNICODE character is exported as character
// entity.
- // coverity[array_vs_singleton]
+ // coverity[callee_ptr_arith]
nLen = rtl_convertUnicodeToText(
rContext.m_hConv, rContext.m_hContext, &c, 0,
cBuffer, TXTCONV_BUFFER_SIZE,
diff --git a/svx/source/sdr/primitive2d/sdrattributecreator.cxx b/svx/source/sdr/primitive2d/sdrattributecreator.cxx
index 06ade19..71b6ac7 100644
--- a/svx/source/sdr/primitive2d/sdrattributecreator.cxx
+++ b/svx/source/sdr/primitive2d/sdrattributecreator.cxx
@@ -421,8 +421,6 @@ namespace drawinglayer
switch(eStyle)
{
- case drawing::FillStyle_NONE : // for warnings
- case drawing::FillStyle_SOLID :
default:
{
// nothing to do, color is defined
diff --git a/sw/source/core/access/acccontext.cxx b/sw/source/core/access/acccontext.cxx
index 7a25d12..9b181a4 100644
--- a/sw/source/core/access/acccontext.cxx
+++ b/sw/source/core/access/acccontext.cxx
@@ -243,6 +243,7 @@ void SwAccessibleContext::ChildrenScrolled( const SwFrm *pFrm,
GetMap() );
}
break;
+ // coverity[dead_error_begin] - following conditions exist to avoid compiler warning
case Action::NONE:
break;
}
diff --git a/sw/source/core/docnode/node.cxx b/sw/source/core/docnode/node.cxx
index 3188fed..ee5a621 100644
--- a/sw/source/core/docnode/node.cxx
+++ b/sw/source/core/docnode/node.cxx
@@ -1614,7 +1614,9 @@ const SfxPoolItem* SwCntntNode::GetNoCondAttr( sal_uInt16 nWhich,
{
if( !GetpSwAttrSet() || ( SfxItemState::SET != GetpSwAttrSet()->GetItemState(
nWhich, false, &pFnd ) && bInParents ))
- ((SwFmt*)GetRegisteredIn())->GetItemState( nWhich, bInParents, &pFnd );
+ {
+ (void)((SwFmt*)GetRegisteredIn())->GetItemState( nWhich, bInParents, &pFnd );
+ }
}
// undo change of issue #i51029#
// Note: <GetSwAttrSet()> returns <mpAttrSet>, if set, otherwise it returns
diff --git a/sw/source/core/frmedt/fecopy.cxx b/sw/source/core/frmedt/fecopy.cxx
index 3669a59..4f10aeb 100644
--- a/sw/source/core/frmedt/fecopy.cxx
+++ b/sw/source/core/frmedt/fecopy.cxx
@@ -965,7 +965,7 @@ bool SwFEShell::Paste( SwDoc* pClpDoc, bool bIncludingPageFrames )
else if( FLY_AT_FLY == aAnchor.GetAnchorId() )
{
Point aPt;
- lcl_SetAnchor( *PCURCRSR->GetPoint(), PCURCRSR->GetNode(),
+ (void)lcl_SetAnchor( *PCURCRSR->GetPoint(), PCURCRSR->GetNode(),
0, aPt, *this, aAnchor, aPt, false );
}
diff --git a/sw/source/filter/html/htmlform.cxx b/sw/source/filter/html/htmlform.cxx
index cbd2e2f..a9c43e8 100644
--- a/sw/source/filter/html/htmlform.cxx
+++ b/sw/source/filter/html/htmlform.cxx
@@ -1126,9 +1126,6 @@ uno::Reference< drawing::XShape > SwHTMLParser::InsertControl(
sal_Int16 nVertOri = text::VertOrientation::NONE;
switch( eVertOri )
{
- case text::VertOrientation::NONE:
- nVertOri = text::VertOrientation::NONE;
- break;
case text::VertOrientation::TOP:
nVertOri = text::VertOrientation::TOP;
break;
@@ -1156,6 +1153,10 @@ uno::Reference< drawing::XShape > SwHTMLParser::InsertControl(
case text::VertOrientation::LINE_BOTTOM:
nVertOri = text::VertOrientation::LINE_BOTTOM;
break;
+ // coverity[dead_error_begin] - following conditions exist to avoid compiler warning
+ case text::VertOrientation::NONE:
+ nVertOri = text::VertOrientation::NONE;
+ break;
}
aTmp <<= (sal_Int16)nVertOri ;
xShapePropSet->setPropertyValue("VertOrient", aTmp );
diff --git a/sw/source/uibase/envelp/labelcfg.cxx b/sw/source/uibase/envelp/labelcfg.cxx
index 232faa9..809df91 100644
--- a/sw/source/uibase/envelp/labelcfg.cxx
+++ b/sw/source/uibase/envelp/labelcfg.cxx
@@ -99,7 +99,7 @@ SwLabelConfig::SwLabelConfig() :
res == xmlreader::XmlReader::RESULT_BEGIN
&& name.equals("manufacturer"));
// Get the name
- reader.nextAttribute(&nsId, &name);
+ (void)reader.nextAttribute(&nsId, &name);
assert(
nsId == xmlreader::XmlReader::NAMESPACE_NONE
&& name.equals("name"));
diff --git a/ucb/source/ucp/ftp/ftpdirp.cxx b/ucb/source/ucp/ftp/ftpdirp.cxx
index 32a6e6d..d5d7d93 100644
--- a/ucb/source/ucp/ftp/ftpdirp.cxx
+++ b/ucb/source/ucp/ftp/ftpdirp.cxx
@@ -934,6 +934,7 @@ bool FTPDirectoryParser::parseUNIX (
else
eMode = FOUND_NONE;
break;
+ // coverity[dead_error_begin] - following conditions exist to avoid compiler warning
case FOUND_YEAR_TIME:
break;
}
diff --git a/unotest/source/cpp/officeconnection.cxx b/unotest/source/cpp/officeconnection.cxx
index b86a4c2..91568b0 100644
--- a/unotest/source/cpp/officeconnection.cxx
+++ b/unotest/source/cpp/officeconnection.cxx
@@ -81,7 +81,7 @@ void OfficeConnection::setUp() {
{
envs = &argEnv.pData;
}
- // coverity[array_vs_singleton]
+ // coverity[callee_ptr_arith]
CPPUNIT_ASSERT_EQUAL(
osl_Process_E_None,
osl_executeProcess(
diff --git a/unotools/source/config/pathoptions.cxx b/unotools/source/config/pathoptions.cxx
index 1b66eb5..42a2caa 100644
--- a/unotools/source/config/pathoptions.cxx
+++ b/unotools/source/config/pathoptions.cxx
@@ -776,8 +776,10 @@ bool SvtPathOptions::SearchFile( OUString& rIniFile, Paths ePath )
case PATH_WORK: aPath = GetWorkPath(); break;
case PATH_UICONFIG: aPath = GetUIConfigPath(); break;
case PATH_FINGERPRINT: aPath = GetFingerprintPath(); break;
- case PATH_USERCONFIG:/*-Wall???*/ break;
- case PATH_COUNT: /*-Wall???*/ break;
+ // coverity[dead_error_begin] - following conditions exist to avoid compiler warning
+ case PATH_USERCONFIG:
+ case PATH_COUNT:
+ break;
}
sal_Int32 nPathIndex = 0;
diff --git a/vcl/generic/print/genpspgraphics.cxx b/vcl/generic/print/genpspgraphics.cxx
index f83d7bc..3b2ce07 100644
--- a/vcl/generic/print/genpspgraphics.cxx
+++ b/vcl/generic/print/genpspgraphics.cxx
@@ -638,7 +638,7 @@ bool PspFontLayout::LayoutText( ImplLayoutArgs& rArgs )
// update fallback_runs if needed
psp::CharacterMetric aMetric;
- // coverity[array_vs_singleton]
+ // coverity[callee_ptr_arith]
mrPrinterGfx.GetFontMgr().getMetrics( mnFontID, cChar, cChar, &aMetric, mbVertical );
if( aMetric.width == -1 && aMetric.height == -1 )
rArgs.NeedFallback( nCharPos, bRightToLeft );
diff --git a/vcl/generic/print/text_gfx.cxx b/vcl/generic/print/text_gfx.cxx
index 4074445..a228aa9 100644
--- a/vcl/generic/print/text_gfx.cxx
+++ b/vcl/generic/print/text_gfx.cxx
@@ -329,9 +329,9 @@ PrinterGfx::DrawText (
for( int n = 0; n < nLen; n++ )
{
CharacterMetric aBBox;
- // coverity[array_vs_singleton]
- pFontMap[n] = getCharMetric (aFont, pEffectiveStr[n], &aBBox);
- pCharWidth[n] = getCharWidth (mbTextVertical, pEffectiveStr[n], &aBBox);
+ // coverity[callee_ptr_arith]
+ pFontMap[n] = getCharMetric(aFont, pEffectiveStr[n], &aBBox);
+ pCharWidth[n] = getCharWidth(mbTextVertical, pEffectiveStr[n], &aBBox);
}
// setup a new delta array, use virtual resolution of 1000
@@ -644,8 +644,8 @@ PrinterGfx::GetCharWidth (sal_Unicode nFrom, sal_Unicode nTo, long *pWidthArray)
for( int n = 0; n < (nTo - nFrom + 1); n++ )
{
CharacterMetric aBBox;
- // coverity[array_vs_singleton]
- getCharMetric (aFont, n + nFrom, &aBBox);
+ // coverity[callee_ptr_arith]
+ getCharMetric(aFont, n + nFrom, &aBBox);
pWidthArray[n] = getCharWidth (mbTextVertical, n + nFrom, &aBBox);
}
diff --git a/vcl/qa/cppunit/timer.cxx b/vcl/qa/cppunit/timer.cxx
index 0732baa..84dd40a 100644
--- a/vcl/qa/cppunit/timer.cxx
+++ b/vcl/qa/cppunit/timer.cxx
@@ -104,7 +104,7 @@ void TimerTest::testDurations()
{
bool bDone = false;
TimerBool aTimer( aDurations[i], bDone );
- // coverity[infinite_loop]
+ // coverity[loop_top] - Application::Yield allows the timer to fire and toggle bDone
while( !bDone )
{
Application::Yield();
@@ -135,7 +135,6 @@ void TimerTest::testAutoTimer()
{
sal_Int32 nCount = 0;
AutoTimerCount aCount(1, nCount);
- // coverity[infinite_loop]
while (nCount < 100) {
Application::Yield();
}
@@ -163,7 +162,7 @@ void TimerTest::testRecursiveTimer()
sal_Int32 nCount = 0;
YieldTimer aCount(5);
AutoTimerCount aCountUp( 3, nCount );
- // coverity[infinite_loop]
+ // coverity[loop_top] - Application::Yield allows the timer to fire and increment nCount
while (nCount < 20)
Application::Yield();
}
@@ -197,10 +196,10 @@ void TimerTest::testSlowTimerCallback()
sal_Int32 nCount = 0;
AutoTimerCount aHighFreq(1, nCount);
SlowCallbackTimer aSlow(250, bBeenSlow);
- // coverity[infinite_loop]
+ // coverity[loop_top] - Application::Yield allows the timer to fire and toggle bBeenSlow
while (!bBeenSlow)
Application::Yield();
- // coverity[infinite_loop]
+ // coverity[loop_top] - Application::Yield allows the timer to fire and increment nCount
while (nCount < 200)
Application::Yield();
}
diff --git a/xmloff/source/transform/ChartOASISTContext.cxx b/xmloff/source/transform/ChartOASISTContext.cxx
index 3ec0748..d451334 100644
--- a/xmloff/source/transform/ChartOASISTContext.cxx
+++ b/xmloff/source/transform/ChartOASISTContext.cxx
@@ -122,6 +122,7 @@ void XMLChartOASISTransformerContext::StartElement(
OUString aAttrQName( GetTransformer().GetNamespaceMap().GetQNameByKey(
XML_NAMESPACE_CHART,
GetXMLToken( XML_ADD_IN_NAME ) ) );
+ // coverity[var_deref_model] - pMutableAttrList is assigned in a superset of the enclosing if condition entry logic
pMutableAttrList->AddAttribute( aAttrQName, aAddInName );
}
diff --git a/xmloff/source/transform/StyleOOoTContext.cxx b/xmloff/source/transform/StyleOOoTContext.cxx
index b66077e..9e934fb 100644
--- a/xmloff/source/transform/StyleOOoTContext.cxx
+++ b/xmloff/source/transform/StyleOOoTContext.cxx
@@ -981,7 +981,7 @@ void XMLPropertiesOOoTContext_Impl::StartElement(
aDrawMirrorAttrValue);
}
- if( bMoveProtect || bSizeProtect || !aProtectAttrValue.isEmpty() )
+ if (bMoveProtect || bSizeProtect || !aProtectAttrValue.isEmpty())
{
if( (bMoveProtect ||bSizeProtect) && IsXMLToken( aProtectAttrValue, XML_NONE ) )
aProtectAttrValue = OUString();
@@ -1002,6 +1002,7 @@ void XMLPropertiesOOoTContext_Impl::StartElement(
aProtectAttrValue += rSize;
}
+ // coverity[var_deref_model] - pProtectContext is assigned in a superset of the enclosing if condition entry logic
pProtectContext->AddAttribute( GetTransformer().GetNamespaceMap().GetQNameByKey( XML_NAMESPACE_STYLE, GetXMLToken( XML_PROTECT ) ), aProtectAttrValue );
}
commit ea272d9fe4bf2dc7419f76e2ddee707d768ccd50
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Nov 5 10:55:59 2014 +0000
coverity#737143 Uncaught exception
Change-Id: If90208f2fb9be0a44cabfc9b281b3715772b30d1
diff --git a/filter/source/svg/test/svg2odf.cxx b/filter/source/svg/test/svg2odf.cxx
index d923dd4..78188fa 100644
--- a/filter/source/svg/test/svg2odf.cxx
+++ b/filter/source/svg/test/svg2odf.cxx
@@ -90,36 +90,40 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
// bootstrap UNO
uno::Reference< lang::XMultiServiceFactory > xFactory;
uno::Reference< uno::XComponentContext > xCtx;
+ int nRet = 1;
try
{
xCtx = ::cppu::defaultBootstrap_InitialComponentContext(aIniUrl);
xFactory = uno::Reference< lang::XMultiServiceFactory >(xCtx->getServiceManager(),
uno::UNO_QUERY);
- if( xFactory.is() )
- ::comphelper::setProcessServiceFactory( xFactory );
- }
- catch( const uno::Exception& )
- {
- }
+ if (!xFactory.is())
+ {
+ OSL_TRACE( "Could not bootstrap UNO, installation must be in disorder. Exiting." );
+ return 1;
+ }
- if( !xFactory.is() )
- {
- OSL_TRACE( "Could not bootstrap UNO, installation must be in disorder. Exiting." );
- return 1;
- }
+ ::comphelper::setProcessServiceFactory( xFactory );
+
+ osl::File aInputFile(aSrcURL);
+ if( osl::FileBase::E_None!=aInputFile.open(osl_File_OpenFlag_Read) )
+ {
+ OSL_TRACE( "Cannot open input file" );
+ return 1;
+ }
- osl::File aInputFile(aSrcURL);
- if( osl::FileBase::E_None!=aInputFile.open(osl_File_OpenFlag_Read) )
+ svgi::SVGReader aReader(xCtx,
+ uno::Reference<io::XInputStream>(
+ new comphelper::OSLInputStreamWrapper(aInputFile)),
+ svgi::createSerializer(new OutputWrap(aDstURL)));
+ nRet = aReader.parseAndConvert() ? 0 : 1;
+
+ }
+ catch (const uno::Exception& e)
{
- OSL_TRACE( "Cannot open input file" );
+ SAL_WARN("vcl.app", "Fatal exception: " << e.Message);
return 1;
}
-
- svgi::SVGReader aReader(xCtx,
- uno::Reference<io::XInputStream>(
- new comphelper::OSLInputStreamWrapper(aInputFile)),
- svgi::createSerializer(new OutputWrap(aDstURL)));
- return aReader.parseAndConvert() ? 0 : 1;
+ return nRet;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 47db04bfdeb642c09a30f0ee85de30255c2ea2b7
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Nov 5 10:40:40 2014 +0000
coverity#736461 Resource leak
Change-Id: I38351eecce12effb61d69439b67062b43344d541
diff --git a/sd/source/ui/unoidl/unosrch.cxx b/sd/source/ui/unoidl/unosrch.cxx
index 148c781..90d466a 100644
--- a/sd/source/ui/unoidl/unosrch.cxx
+++ b/sd/source/ui/unoidl/unosrch.cxx
@@ -303,7 +303,8 @@ uno::Reference< ::com::sun::star::container::XIndexAccess > SAL_CALL SdUnoSearch
if( nFound != nSequence )
aSeq.realloc( nFound );
- return (container::XIndexAccess*)new SdUnoFindAllAccess( aSeq );
+ uno::Reference<css::container::XIndexAccess> xRet(new SdUnoFindAllAccess(aSeq));
+ return xRet;
}
uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL SdUnoSearchReplaceShape::findFirst( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XSearchDescriptor >& xDesc )
commit 7ddfa141d3de8f2a431b5844254f23f7b7aeb1fa
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Nov 5 10:38:32 2014 +0000
coverity#1019393 Uncaught exception
Change-Id: I818a91a3090392efed46700b5e2d77d7f1e3bdb9
diff --git a/sdext/source/pdfimport/test/pdf2xml.cxx b/sdext/source/pdfimport/test/pdf2xml.cxx
index 88b3535..f081097 100644
--- a/sdext/source/pdfimport/test/pdf2xml.cxx
+++ b/sdext/source/pdfimport/test/pdf2xml.cxx
@@ -39,40 +39,48 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
if( argc < 4 )
return 1;
- OUString aBaseURL, aTmpURL, aSrcURL, aDstURL;
+ try
+ {
+ OUString aBaseURL, aTmpURL, aSrcURL, aDstURL;
- TreeVisitorFactorySharedPtr pTreeFactory;
- if( rtl_str_compare(argv[1], "-writer") == 0 )
- pTreeFactory = createWriterTreeVisitorFactory();
- else if( rtl_str_compare(argv[1], "-draw") == 0 )
- pTreeFactory = createDrawTreeVisitorFactory();
- else if( rtl_str_compare(argv[1], "-impress") == 0 )
- pTreeFactory = createImpressTreeVisitorFactory();
- else
- return 1;
+ TreeVisitorFactorySharedPtr pTreeFactory;
+ if( rtl_str_compare(argv[1], "-writer") == 0 )
+ pTreeFactory = createWriterTreeVisitorFactory();
+ else if( rtl_str_compare(argv[1], "-draw") == 0 )
+ pTreeFactory = createDrawTreeVisitorFactory();
+ else if( rtl_str_compare(argv[1], "-impress") == 0 )
+ pTreeFactory = createImpressTreeVisitorFactory();
+ else
+ return 1;
- osl_getProcessWorkingDir(&aBaseURL.pData);
- osl_getFileURLFromSystemPath( OUString::createFromAscii(argv[2]).pData,
- &aTmpURL.pData );
- osl_getAbsoluteFileURL(aBaseURL.pData,aTmpURL.pData,&aSrcURL.pData);
+ osl_getProcessWorkingDir(&aBaseURL.pData);
+ osl_getFileURLFromSystemPath( OUString::createFromAscii(argv[2]).pData,
+ &aTmpURL.pData );
+ osl_getAbsoluteFileURL(aBaseURL.pData,aTmpURL.pData,&aSrcURL.pData);
- osl_getFileURLFromSystemPath( OUString::createFromAscii(argv[3]).pData,
- &aTmpURL.pData );
- osl_getAbsoluteFileURL(aBaseURL.pData,aTmpURL.pData,&aDstURL.pData);
+ osl_getFileURLFromSystemPath( OUString::createFromAscii(argv[3]).pData,
+ &aTmpURL.pData );
+ osl_getAbsoluteFileURL(aBaseURL.pData,aTmpURL.pData,&aDstURL.pData);
- // bootstrap UNO
- uno::Reference< uno::XComponentContext > xContext(
- cppu::defaultBootstrap_InitialComponentContext() );
- uno::Reference<lang::XMultiComponentFactory> xFactory(xContext->getServiceManager());
- uno::Reference<lang::XMultiServiceFactory> xSM(xFactory, uno::UNO_QUERY_THROW);
- comphelper::setProcessServiceFactory(xSM);
+ // bootstrap UNO
+ uno::Reference< uno::XComponentContext > xContext(
+ cppu::defaultBootstrap_InitialComponentContext() );
+ uno::Reference<lang::XMultiComponentFactory> xFactory(xContext->getServiceManager());
+ uno::Reference<lang::XMultiServiceFactory> xSM(xFactory, uno::UNO_QUERY_THROW);
+ comphelper::setProcessServiceFactory(xSM);
- test::BootstrapFixtureBase aEnv;
- aEnv.setUp();
+ test::BootstrapFixtureBase aEnv;
+ aEnv.setUp();
- pdfi::PDFIRawAdaptor aAdaptor( aEnv.getComponentContext() );
- aAdaptor.setTreeVisitorFactory(pTreeFactory);
- aAdaptor.odfConvert( aSrcURL, new OutputWrap(aDstURL), NULL );
+ pdfi::PDFIRawAdaptor aAdaptor( aEnv.getComponentContext() );
+ aAdaptor.setTreeVisitorFactory(pTreeFactory);
+ aAdaptor.odfConvert( aSrcURL, new OutputWrap(aDstURL), NULL );
+ }
+ catch (const uno::Exception& e)
+ {
+ SAL_WARN("vcl.app", "Fatal exception: " << e.Message);
+ return 1;
+ }
return 0;
}
commit 8310ff534e4df002912d9315c13dde7f0627c650
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Nov 5 10:34:06 2014 +0000
coverity#737920 Uncaught exception
Change-Id: I282b874c22c373e078007a29bcbbe74b175a70d3
diff --git a/svtools/langsupport/langsupport.cxx b/svtools/langsupport/langsupport.cxx
index 9dbc90e..b9038d0 100644
--- a/svtools/langsupport/langsupport.cxx
+++ b/svtools/langsupport/langsupport.cxx
@@ -22,45 +22,53 @@ using namespace com::sun::star;
SAL_IMPLEMENT_MAIN()
{
- tools::extendApplicationEnvironment();
+ try
+ {
+ tools::extendApplicationEnvironment();
- uno::Reference<uno::XComponentContext> xContext =
- cppu::defaultBootstrap_InitialComponentContext();
+ uno::Reference<uno::XComponentContext> xContext =
+ cppu::defaultBootstrap_InitialComponentContext();
- uno::Reference<lang::XMultiComponentFactory> xFactory =
- xContext->getServiceManager();
+ uno::Reference<lang::XMultiComponentFactory> xFactory =
+ xContext->getServiceManager();
- uno::Reference<lang::XMultiServiceFactory> xSFactory(xFactory,
- uno::UNO_QUERY_THROW);
+ uno::Reference<lang::XMultiServiceFactory> xSFactory(xFactory,
+ uno::UNO_QUERY_THROW);
- comphelper::setProcessServiceFactory(xSFactory);
+ comphelper::setProcessServiceFactory(xSFactory);
- InitVCL();
+ InitVCL();
- {
- sal_uInt32 nCount = SvtLanguageTable::GetLanguageEntryCount();
- for (sal_uInt32 i = 0; i < nCount; ++i)
{
- LanguageType eLang = SvtLanguageTable::GetLanguageTypeAtIndex(i);
-
- if (eLang == LANGUAGE_DONTKNOW ||
- eLang == LANGUAGE_NONE ||
- eLang == LANGUAGE_HID_HUMAN_INTERFACE_DEVICE ||
- eLang == LANGUAGE_SYSTEM)
+ sal_uInt32 nCount = SvtLanguageTable::GetLanguageEntryCount();
+ for (sal_uInt32 i = 0; i < nCount; ++i)
{
- continue;
- }
+ LanguageType eLang = SvtLanguageTable::GetLanguageTypeAtIndex(i);
+
+ if (eLang == LANGUAGE_DONTKNOW ||
+ eLang == LANGUAGE_NONE ||
+ eLang == LANGUAGE_HID_HUMAN_INTERFACE_DEVICE ||
+ eLang == LANGUAGE_SYSTEM)
+ {
+ continue;
+ }
- OUString sTag( LanguageTag::convertToBcp47( eLang));
+ OUString sTag( LanguageTag::convertToBcp47( eLang));
- std::cout << OUStringToOString(sTag, osl_getThreadTextEncoding()).getStr()
- << std::endl;
+ std::cout << OUStringToOString(sTag, osl_getThreadTextEncoding()).getStr()
+ << std::endl;
+ }
}
- }
- DeInitVCL();
+ DeInitVCL();
- uno::Reference< lang::XComponent >(xContext, uno::UNO_QUERY_THROW)->dispose();
+ uno::Reference< lang::XComponent >(xContext, uno::UNO_QUERY_THROW)->dispose();
+ }
+ catch (const uno::Exception& e)
+ {
+ SAL_WARN("vcl.app", "Fatal exception: " << e.Message);
+ return 1;
+ }
return 0;
}
commit d6fdebc5439887f5998e9e8c21d87f5ccdcdc505
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Nov 5 10:32:11 2014 +0000
coverity#1000852 Uncaught exception
Change-Id: Iaab0c992497b7d6b2da67cf65ade099c784c7a94
diff --git a/svx/source/gengal/gengal.cxx b/svx/source/gengal/gengal.cxx
index ca045cf..ea4e618 100644
--- a/svx/source/gengal/gengal.cxx
+++ b/svx/source/gengal/gengal.cxx
@@ -275,45 +275,53 @@ ReadResponseFile(std::vector<INetURLObject> & rFiles, OUString const& rInput)
int GalApp::Main()
{
- OUString aPath, aDestDir;
- OUString aName( "Default name" );
- std::vector<INetURLObject> aFiles;
-
- for( sal_uInt32 i = 0; i < GetCommandLineParamCount(); i++ )
+ try
{
- OUString aParam = GetCommandLineParam( i );
+ OUString aPath, aDestDir;
+ OUString aName( "Default name" );
+ std::vector<INetURLObject> aFiles;
- if ( aParam.startsWith( "-env:" ) )
- continue;
- else if ( aParam == "--help" || aParam == "-h" )
- return PrintHelp();
- else if ( aParam == "--build-tree" )
+ for( sal_uInt32 i = 0; i < GetCommandLineParamCount(); i++ )
{
- mbRelativeURLs = true;
- mbInBuildTree = true;
+ OUString aParam = GetCommandLineParam( i );
+
+ if ( aParam.startsWith( "-env:" ) )
+ continue;
+ else if ( aParam == "--help" || aParam == "-h" )
+ return PrintHelp();
+ else if ( aParam == "--build-tree" )
+ {
+ mbRelativeURLs = true;
+ mbInBuildTree = true;
+ }
+ else if ( aParam == "--name" )
+ aName = GetCommandLineParam( ++i );
+ else if ( aParam == "--path" )
+ aPath = Smartify( GetCommandLineParam( ++i ) ).
+ GetMainURL(INetURLObject::NO_DECODE);
+ else if ( aParam == "--destdir" )
+ aDestDir = GetCommandLineParam( ++i );
+ else if ( aParam == "--relative-urls" )
+ mbRelativeURLs = true;
+ else if ( aParam == "--number-from" )
+ fprintf ( stderr, "--number-from is deprecated, themes now "
+ "have filenames based on their names\n" );
+ else if ( aParam == "--filenames" )
+ ReadResponseFile(aFiles, GetCommandLineParam(++i));
+ else
+ aFiles.push_back( Smartify( aParam ) );
}
- else if ( aParam == "--name" )
- aName = GetCommandLineParam( ++i );
- else if ( aParam == "--path" )
- aPath = Smartify( GetCommandLineParam( ++i ) ).
- GetMainURL(INetURLObject::NO_DECODE);
- else if ( aParam == "--destdir" )
- aDestDir = GetCommandLineParam( ++i );
- else if ( aParam == "--relative-urls" )
- mbRelativeURLs = true;
- else if ( aParam == "--number-from" )
- fprintf ( stderr, "--number-from is deprecated, themes now "
- "have filenames based on their names\n" );
- else if ( aParam == "--filenames" )
- ReadResponseFile(aFiles, GetCommandLineParam(++i));
- else
- aFiles.push_back( Smartify( aParam ) );
- }
- if( aFiles.empty() )
- return PrintHelp();
+ if( aFiles.empty() )
+ return PrintHelp();
- createTheme( aName, aPath, aDestDir, aFiles, mbRelativeURLs );
+ createTheme( aName, aPath, aDestDir, aFiles, mbRelativeURLs );
+ }
+ catch (const uno::Exception& e)
+ {
+ SAL_WARN("vcl.app", "Fatal exception: " << e.Message);
+ return EXIT_FAILURE;
+ }
return EXIT_SUCCESS;
}
commit f177ab81ced99975851897df389ce62d6e91adf4
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Nov 5 10:27:34 2014 +0000
coverity#1215393 Uncaught exception
Change-Id: I96575d843fd982866c89000bb4426bd5e11c56d1
diff --git a/svx/workben/pixelctl.cxx b/svx/workben/pixelctl.cxx
index 37e106e..f962042 100644
--- a/svx/workben/pixelctl.cxx
+++ b/svx/workben/pixelctl.cxx
@@ -46,20 +46,28 @@ void Main();
SAL_IMPLEMENT_MAIN()
{
- tools::extendApplicationEnvironment();
-
- // create the global service-manager
- Reference< XComponentContext > xContext = defaultBootstrap_InitialComponentContext();
- Reference< XMultiServiceFactory > xServiceManager( xContext->getServiceManager(), UNO_QUERY );
-
- if( !xServiceManager.is() )
- Application::Abort( "Failed to bootstrap" );
-
- comphelper::setProcessServiceFactory( xServiceManager );
-
- InitVCL();
- ::Main();
- DeInitVCL();
+ try
+ {
+ tools::extendApplicationEnvironment();
+
+ // create the global service-manager
+ Reference< XComponentContext > xContext = defaultBootstrap_InitialComponentContext();
+ Reference< XMultiServiceFactory > xServiceManager( xContext->getServiceManager(), UNO_QUERY );
+
+ if( !xServiceManager.is() )
+ Application::Abort( "Failed to bootstrap" );
+
+ comphelper::setProcessServiceFactory( xServiceManager );
+
+ InitVCL();
+ ::Main();
+ DeInitVCL();
+ }
+ catch (const Exception& e)
+ {
+ SAL_WARN("vcl.app", "Fatal exception: " << e.Message);
+ return 1;
+ }
return 0;
}
commit 680438cb97b36f17c6b418ec2556a55c998ca520
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Nov 5 10:17:50 2014 +0000
coverity#1103678 Unchecked dynamic_cast
Change-Id: Ic87cc3d968447051e52012e59d92e95280d9d35a
diff --git a/unoidl/source/unoidl-check.cxx b/unoidl/source/unoidl-check.cxx
index 93cfc2d..c314b86 100644
--- a/unoidl/source/unoidl-check.cxx
+++ b/unoidl/source/unoidl-check.cxx
@@ -203,8 +203,8 @@ void checkMap( rtl::Reference<unoidl::Provider> const & providerB, OUString cons
<< std::endl;
std::exit(EXIT_FAILURE);
}
- if ((dynamic_cast<unoidl::PublishableEntity *>(entA.get())->isPublished()) &&
- (!dynamic_cast<unoidl::PublishableEntity *>(entB.get())->isPublished()))
+ if ((dynamic_cast<unoidl::PublishableEntity&>(*entA.get()).isPublished()) &&
+ (!dynamic_cast<unoidl::PublishableEntity&>(*entB.get()).isPublished()))
{
std::cerr
<< "A published entity " << name << " is not published in B"
commit 37b3a5dc5bf0720a585ae0cd6d64f081247e1aa1
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Nov 5 10:06:47 2014 +0000
coverity#1215387 Uncaught exception
Change-Id: I3e34d078772c701d07c14de0da45bbdcb7b44838
diff --git a/vcl/workben/svdem.cxx b/vcl/workben/svdem.cxx
index ed2b297..a06bf5c 100644
--- a/vcl/workben/svdem.cxx
+++ b/vcl/workben/svdem.cxx
@@ -40,19 +40,27 @@ void Main();
SAL_IMPLEMENT_MAIN()
{
- tools::extendApplicationEnvironment();
-
- Reference< XComponentContext > xContext = defaultBootstrap_InitialComponentContext();
- Reference< XMultiServiceFactory > xServiceManager( xContext->getServiceManager(), UNO_QUERY );
-
- if( !xServiceManager.is() )
- Application::Abort( "Failed to bootstrap" );
-
- comphelper::setProcessServiceFactory( xServiceManager );
-
- InitVCL();
- ::Main();
- DeInitVCL();
+ try
+ {
+ tools::extendApplicationEnvironment();
+
+ Reference< XComponentContext > xContext = defaultBootstrap_InitialComponentContext();
+ Reference< XMultiServiceFactory > xServiceManager( xContext->getServiceManager(), UNO_QUERY );
+
+ if( !xServiceManager.is() )
+ Application::Abort( "Failed to bootstrap" );
+
+ comphelper::setProcessServiceFactory( xServiceManager );
+
+ InitVCL();
+ ::Main();
+ DeInitVCL();
+ }
+ catch (const Exception& e)
+ {
+ SAL_WARN("vcl.app", "Fatal exception: " << e.Message);
+ return 1;
+ }
return 0;
}
commit e90ba3912747b67873344dea14e2a5821ec766c8
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Nov 5 10:05:55 2014 +0000
coverity#1215395 Uncaught exception
Change-Id: I44246f85acf197fa1707b37691f21e6e996bc2d3
diff --git a/vcl/workben/svpclient.cxx b/vcl/workben/svpclient.cxx
index 915dd9c..3f9e274 100644
--- a/vcl/workben/svpclient.cxx
+++ b/vcl/workben/svpclient.cxx
@@ -59,20 +59,28 @@ void Main();
SAL_IMPLEMENT_MAIN()
{
- tools::extendApplicationEnvironment();
+ try
+ {
+ tools::extendApplicationEnvironment();
- // create the global service-manager
- Reference< XComponentContext > xContext = defaultBootstrap_InitialComponentContext();
- Reference< XMultiServiceFactory > xServiceManager( xContext->getServiceManager(), UNO_QUERY );
+ // create the global service-manager
+ Reference< XComponentContext > xContext = defaultBootstrap_InitialComponentContext();
+ Reference< XMultiServiceFactory > xServiceManager( xContext->getServiceManager(), UNO_QUERY );
- if( !xServiceManager.is() )
- Application::Abort( "Failed to bootstrap" );
+ if( !xServiceManager.is() )
+ Application::Abort( "Failed to bootstrap" );
- comphelper::setProcessServiceFactory( xServiceManager );
+ comphelper::setProcessServiceFactory( xServiceManager );
- InitVCL();
- ::Main();
- DeInitVCL();
+ InitVCL();
+ ::Main();
+ DeInitVCL();
+ }
+ catch (const Exception& e)
+ {
+ SAL_WARN("vcl.app", "Fatal exception: " << e.Message);
+ return 1;
+ }
return 0;
}
commit 5e48dc03fe3dfb173fe65c46d52552149b255032
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Nov 5 10:05:05 2014 +0000
coverity#1215391 Uncaught exception
Change-Id: I8a57ad303666cfcb3e338fc1933c29a887240a5a
diff --git a/vcl/workben/svptest.cxx b/vcl/workben/svptest.cxx
index 6b9cfb8..1c3d285 100644
--- a/vcl/workben/svptest.cxx
+++ b/vcl/workben/svptest.cxx
@@ -48,19 +48,27 @@ void Main();
SAL_IMPLEMENT_MAIN()
{
- tools::extendApplicationEnvironment();
+ try
+ {
+ tools::extendApplicationEnvironment();
- Reference< XComponentContext > xContext = defaultBootstrap_InitialComponentContext();
- Reference< XMultiServiceFactory > xServiceManager( xContext->getServiceManager(), UNO_QUERY );
+ Reference< XComponentContext > xContext = defaultBootstrap_InitialComponentContext();
+ Reference< XMultiServiceFactory > xServiceManager( xContext->getServiceManager(), UNO_QUERY );
- if( !xServiceManager.is() )
- Application::Abort( "Failed to bootstrap" );
+ if( !xServiceManager.is() )
+ Application::Abort( "Failed to bootstrap" );
- comphelper::setProcessServiceFactory( xServiceManager );
+ comphelper::setProcessServiceFactory( xServiceManager );
- InitVCL();
- ::Main();
- DeInitVCL();
+ InitVCL();
+ ::Main();
+ DeInitVCL();
+ }
+ catch (const Exception& e)
+ {
+ SAL_WARN("vcl.app", "Fatal exception: " << e.Message);
+ return 1;
+ }
return 0;
}
commit 45ae39b3c6d356b5ea050032e3a911072496f269
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Nov 5 10:04:15 2014 +0000
coverity#1215389 Uncaught exception
Change-Id: I107817e730ca0bd94d66ecf9719c3a6eb273e4f1
diff --git a/vcl/workben/vcldemo.cxx b/vcl/workben/vcldemo.cxx
index f793401..7fe1b2d 100644
--- a/vcl/workben/vcldemo.cxx
+++ b/vcl/workben/vcldemo.cxx
@@ -43,19 +43,27 @@ void Main();
SAL_IMPLEMENT_MAIN()
{
- tools::extendApplicationEnvironment();
-
- Reference< XComponentContext > xContext = defaultBootstrap_InitialComponentContext();
- Reference< XMultiServiceFactory > xServiceManager( xContext->getServiceManager(), UNO_QUERY );
-
- if( !xServiceManager.is() )
- Application::Abort( "Failed to bootstrap" );
-
- comphelper::setProcessServiceFactory( xServiceManager );
-
- InitVCL();
- ::Main();
- DeInitVCL();
+ try
+ {
+ tools::extendApplicationEnvironment();
+
+ Reference< XComponentContext > xContext = defaultBootstrap_InitialComponentContext();
+ Reference< XMultiServiceFactory > xServiceManager( xContext->getServiceManager(), UNO_QUERY );
+
+ if( !xServiceManager.is() )
+ Application::Abort( "Failed to bootstrap" );
+
+ comphelper::setProcessServiceFactory( xServiceManager );
+
+ InitVCL();
+ ::Main();
+ DeInitVCL();
+ }
+ catch (const Exception& e)
+ {
+ SAL_WARN("vcl.app", "Fatal exception: " << e.Message);
+ return 1;
+ }
return 0;
}
commit 32ae77e28d98a60c396d274e1e2ff44fe6265a9b
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Nov 5 09:20:30 2014 +0000
coverity#982307 coverity deadcode vs compiler switch warnings
Change-Id: I022d3bbe40058f81cdfc2436cfe70ac2d96382e6
diff --git a/scaddins/source/analysis/analysishelper.cxx b/scaddins/source/analysis/analysishelper.cxx
index c4a0c54..1dc310b 100644
--- a/scaddins/source/analysis/analysishelper.cxx
+++ b/scaddins/source/analysis/analysishelper.cxx
@@ -598,12 +598,9 @@ double GetYearFrac( sal_Int32 nNullDate, sal_Int32 nStartDate, sal_Int32 nEndDat
case 3: // 3=exact/365
nDaysInYear = 365;
break;
-#ifdef _MSC_VER
- // Coverity complains this is dead code, but MSVC thinks nDaysInYear
- // is uninitialized if it's missing.
+ //coverity[dead_error_begin] - condition exists to avoid compiler warning
default:
throw lang::IllegalArgumentException();
-#endif
}
return double( nDayDiff ) / nDaysInYear;
@@ -931,8 +928,9 @@ bool ParseDouble( const sal_Unicode*& rp, double& rRet )
else
eS = S_End;
break;
- case S_End: // to avoid compiler warning
- break; // loop exits anyway
+ //coverity[dead_error_begin] - condition exists to avoid compiler warning
+ case S_End:
+ break;
}
p++;
More information about the Libreoffice-commits
mailing list