[Libreoffice-commits] core.git: 22 commits - codemaker/source comphelper/source idl/source pyuno/inc pyuno/source reportdesign/source sc/source sd/inc sd/source svx/source
Caolán McNamara
caolanm at redhat.com
Mon May 26 07:52:29 PDT 2014
codemaker/source/cppumaker/cpputype.cxx | 14 +++++++-------
comphelper/source/property/propagg.cxx | 2 +-
idl/source/objects/slot.cxx | 4 ++--
pyuno/inc/pyuno/pyuno.hxx | 13 +++++++++++++
pyuno/source/loader/pyuno_loader.cxx | 3 ++-
pyuno/source/module/pyuno_adapter.cxx | 2 +-
pyuno/source/module/pyuno_except.cxx | 2 +-
pyuno/source/module/pyuno_module.cxx | 4 ++--
pyuno/source/module/pyuno_runtime.cxx | 2 +-
pyuno/source/module/pyuno_type.cxx | 8 ++++----
reportdesign/source/ui/report/ReportSection.cxx | 10 +++++-----
sc/source/core/tool/chgtrack.cxx | 23 ++++++++++-------------
sc/source/ui/miscdlgs/conflictsdlg.cxx | 2 +-
sd/inc/stlsheet.hxx | 2 +-
sd/source/core/stlsheet.cxx | 2 +-
sd/source/ui/inc/SdUnoDrawView.hxx | 2 +-
sd/source/ui/unoidl/SdUnoDrawView.cxx | 3 ++-
svx/source/gallery2/gallery1.cxx | 16 +++++++++++-----
18 files changed, 66 insertions(+), 48 deletions(-)
New commits:
commit c5abfa5fdf4163d1eb7226642960b957655bdb0e
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon May 26 15:24:14 2014 +0100
coverity#704706 Unchecked dynamic_cast
Change-Id: I74bced4ccbe2e801fe7a3ef8e2fe0c5c39d2a4fa
diff --git a/sc/source/ui/miscdlgs/conflictsdlg.cxx b/sc/source/ui/miscdlgs/conflictsdlg.cxx
index 82aa38f..7c10fab 100644
--- a/sc/source/ui/miscdlgs/conflictsdlg.cxx
+++ b/sc/source/ui/miscdlgs/conflictsdlg.cxx
@@ -787,7 +787,7 @@ void ScConflictsDlg::UpdateView()
// only display own top content entries
if ( pAction->GetType() == SC_CAT_CONTENT )
{
- ScChangeActionContent* pNextContent = ( dynamic_cast< ScChangeActionContent* >( pAction ) )->GetNextContent();
+ ScChangeActionContent* pNextContent = ( dynamic_cast<ScChangeActionContent&>(*pAction) ).GetNextContent();
if ( pNextContent && aItr->HasOwnAction( pNextContent->GetActionNumber() ) )
{
continue;
commit a7807068b6a71a1a8773cd89497ff1bb3113109b
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon May 26 15:22:24 2014 +0100
coverity#704675 Unchecked dynamic_cast
Change-Id: Ib2d86a3cfaff0019bc6969b657b035cb65bbc0c3
diff --git a/sc/source/core/tool/chgtrack.cxx b/sc/source/core/tool/chgtrack.cxx
index 6626022..d8c9e86 100644
--- a/sc/source/core/tool/chgtrack.cxx
+++ b/sc/source/core/tool/chgtrack.cxx
@@ -4472,18 +4472,17 @@ ScChangeTrack* ScChangeTrack::Clone( ScDocument* pDocument ) const
case SC_CAT_DELETE_ROWS:
case SC_CAT_DELETE_TABS:
{
- const ScChangeActionDel* pDelete = dynamic_cast< const ScChangeActionDel* >( pAction );
- OSL_ENSURE( pDelete, "ScChangeTrack::Clone: pDelete is null!" );
+ const ScChangeActionDel& rDelete = dynamic_cast<const ScChangeActionDel&>(*pAction);
SCsCOLROW nD = 0;
ScChangeActionType eType = pAction->GetType();
if ( eType == SC_CAT_DELETE_COLS )
{
- nD = static_cast< SCsCOLROW >( pDelete->GetDx() );
+ nD = static_cast< SCsCOLROW >( rDelete.GetDx() );
}
else if ( eType == SC_CAT_DELETE_ROWS )
{
- nD = static_cast< SCsCOLROW >( pDelete->GetDy() );
+ nD = static_cast< SCsCOLROW >( rDelete.GetDy() );
}
pClonedAction = new ScChangeActionDel(
commit 088d53701f9b756f70af844ac53239c49cccb5c7
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon May 26 15:21:32 2014 +0100
coverity#704674 Unchecked dynamic_cast
Change-Id: I4432ad08fe149e299933443fb6f1c6afc0746cf5
diff --git a/sc/source/core/tool/chgtrack.cxx b/sc/source/core/tool/chgtrack.cxx
index 067ff74..6626022 100644
--- a/sc/source/core/tool/chgtrack.cxx
+++ b/sc/source/core/tool/chgtrack.cxx
@@ -4432,15 +4432,14 @@ ScChangeTrack* ScChangeTrack::Clone( ScDocument* pDocument ) const
{
pGenerated = aGeneratedStack.top();
aGeneratedStack.pop();
- const ScChangeActionContent* pContent = dynamic_cast< const ScChangeActionContent* >( pGenerated );
- OSL_ENSURE( pContent, "ScChangeTrack::Clone: pContent is null!" );
- const ScCellValue& rNewCell = pContent->GetNewCell();
+ const ScChangeActionContent& rContent = dynamic_cast<const ScChangeActionContent&>(*pGenerated);
+ const ScCellValue& rNewCell = rContent.GetNewCell();
if (!rNewCell.isEmpty())
{
ScCellValue aClonedNewCell;
aClonedNewCell.assign(rNewCell, *pDocument);
OUString aNewValue;
- pContent->GetNewString( aNewValue, pDocument );
+ rContent.GetNewString( aNewValue, pDocument );
pClonedTrack->nGeneratedMin = pGenerated->GetActionNumber() + 1;
pClonedTrack->AddLoadedGenerated(aClonedNewCell, pGenerated->GetBigRange(), aNewValue);
}
@@ -4519,13 +4518,12 @@ ScChangeTrack* ScChangeTrack::Clone( ScDocument* pDocument ) const
break;
case SC_CAT_CONTENT:
{
- const ScChangeActionContent* pContent = dynamic_cast< const ScChangeActionContent* >( pAction );
- OSL_ENSURE( pContent, "ScChangeTrack::Clone: pContent is null!" );
- const ScCellValue& rOldCell = pContent->GetOldCell();
+ const ScChangeActionContent& rContent = dynamic_cast<const ScChangeActionContent&>(*pAction);
+ const ScCellValue& rOldCell = rContent.GetOldCell();
ScCellValue aClonedOldCell;
aClonedOldCell.assign(rOldCell, *pDocument);
OUString aOldValue;
- pContent->GetOldString( aOldValue, pDocument );
+ rContent.GetOldString( aOldValue, pDocument );
ScChangeActionContent* pClonedContent = new ScChangeActionContent(
pAction->GetActionNumber(),
@@ -4539,7 +4537,7 @@ ScChangeTrack* ScChangeTrack::Clone( ScDocument* pDocument ) const
pDocument,
aOldValue );
- const ScCellValue& rNewCell = pContent->GetNewCell();
+ const ScCellValue& rNewCell = rContent.GetNewCell();
if (!rNewCell.isEmpty())
{
ScCellValue aClonedNewCell;
commit 8ce3c6f7c30f6f816ffd14cb640a7d0b1458860c
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon May 26 15:19:38 2014 +0100
coverity#704659 Unchecked dynamic_cast
Change-Id: I773351290293b1e54f6e983852baf6ffd2fc3e05
diff --git a/reportdesign/source/ui/report/ReportSection.cxx b/reportdesign/source/ui/report/ReportSection.cxx
index 6ea7f94..e4be3ed 100644
--- a/reportdesign/source/ui/report/ReportSection.cxx
+++ b/reportdesign/source/ui/report/ReportSection.cxx
@@ -556,8 +556,8 @@ void OReportSection::impl_adjustObjectSizePosition(sal_Int32 i_nPaperWidth,sal_I
SdrObject* pObject = pShape ? pShape->GetSdrObject() : NULL;
if ( pObject )
{
- OObjectBase* pBase = dynamic_cast<OObjectBase*>(pObject);
- pBase->EndListening(false);
+ OObjectBase& rBase = dynamic_cast<OObjectBase&>(*pObject);
+ rBase.EndListening(false);
if ( aPos.X < i_nLeftMargin )
{
aPos.X = i_nLeftMargin;
@@ -571,9 +571,9 @@ void OReportSection::impl_adjustObjectSizePosition(sal_Int32 i_nPaperWidth,sal_I
aSize.Width += aPos.X - i_nLeftMargin;
aPos.X = i_nLeftMargin;
// add listener around
- pBase->StartListening();
+ rBase.StartListening();
xReportComponent->setSize(aSize);
- pBase->EndListening(false);
+ rBase.EndListening(false);
}
bChanged = true;
}
@@ -591,7 +591,7 @@ void OReportSection::impl_adjustObjectSizePosition(sal_Int32 i_nPaperWidth,sal_I
pObject->RecalcBoundRect();
}
- pBase->StartListening();
+ rBase.StartListening();
}
}
}
commit 9c2b19c926b65fff2fcbea2b0e970aa499432410
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon May 26 15:16:23 2014 +0100
coverity#703930 Unchecked return value
Change-Id: Ifa4091eb08774309829ec9016b19e71cf9ea201a
diff --git a/comphelper/source/property/propagg.cxx b/comphelper/source/property/propagg.cxx
index bee4e70..bf23a41 100644
--- a/comphelper/source/property/propagg.cxx
+++ b/comphelper/source/property/propagg.cxx
@@ -626,7 +626,7 @@ sal_Int32 OPropertySetAggregationHelper::getOriginalHandle(sal_Int32 nHandle) co
{
OPropertyArrayAggregationHelper& rPH = (OPropertyArrayAggregationHelper&)const_cast<OPropertySetAggregationHelper*>(this)->getInfoHelper();
sal_Int32 nOriginalHandle = -1;
- rPH.fillAggregatePropertyInfoByHandle(NULL, &nOriginalHandle, nHandle);
+ (void)rPH.fillAggregatePropertyInfoByHandle(NULL, &nOriginalHandle, nHandle);
return nOriginalHandle;
}
commit 0897a5a8c538d9c7a8949d1f9fbe426523b95533
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon May 26 15:09:46 2014 +0100
coverity#1209405 Unchecked dynamic_cast
Change-Id: I5b16007b514169e2349c8c3a78d3c150c9d52d85
diff --git a/idl/source/objects/slot.cxx b/idl/source/objects/slot.cxx
index 2d9de32..b1996c2 100644
--- a/idl/source/objects/slot.cxx
+++ b/idl/source/objects/slot.cxx
@@ -1020,8 +1020,8 @@ void SvMetaSlot::Insert( SvSlotElementList& rList, const OString& rPrefix,
SvMetaAttribute * pAttr = rBase.GetAttrList()[m];
if (aSId.equals(pAttr->GetSlotId().getString()))
{
- SvMetaSlot* pSlot = dynamic_cast<SvMetaSlot*>(pAttr);
- xEnumSlot = pSlot->Clone();
+ SvMetaSlot& rSlot = dynamic_cast<SvMetaSlot&>(*pAttr);
+ xEnumSlot = rSlot.Clone();
break;
}
}
commit 9fbcf18e5372230f02d080a4860b8c358267a185
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon May 26 15:04:02 2014 +0100
coverity#982751 Dereference null return value
Change-Id: I070317e55cf3260d1d50def0894a507cd08cc43f
diff --git a/pyuno/source/loader/pyuno_loader.cxx b/pyuno/source/loader/pyuno_loader.cxx
index ead7dbd..36d6ffd 100644
--- a/pyuno/source/loader/pyuno_loader.cxx
+++ b/pyuno/source/loader/pyuno_loader.cxx
@@ -47,6 +47,7 @@
using pyuno::PyRef;
+using pyuno::NOT_NULL;
using pyuno::Runtime;
using pyuno::PyThreadAttach;
@@ -241,7 +242,7 @@ Reference< XInterface > CreateInstance( const Reference< XComponentContext > & c
com::sun::star::uno::makeAny( ctx ) );
PyRef clazz = getObjectFromLoaderModule( "Loader" );
- PyRef args ( PyTuple_New( 1 ), SAL_NO_ACQUIRE );
+ PyRef args ( PyTuple_New( 1 ), SAL_NO_ACQUIRE, NOT_NULL );
PyTuple_SetItem( args.get(), 0 , pyCtx.getAcquired() );
PyRef pyInstance( PyObject_CallObject( clazz.get() , args.get() ), SAL_NO_ACQUIRE );
runtime.pyObject2Any( pyInstance ) >>= ret;
commit f556b1b614eb54159a58201c1b266b120050ed5a
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon May 26 15:03:26 2014 +0100
coverity#982752 Dereference null return value
Change-Id: I394a13939d67b6959903e277dd78ea05cdcadfa8
diff --git a/pyuno/source/module/pyuno_adapter.cxx b/pyuno/source/module/pyuno_adapter.cxx
index 30b89ff..d239119 100644
--- a/pyuno/source/module/pyuno_adapter.cxx
+++ b/pyuno/source/module/pyuno_adapter.cxx
@@ -206,7 +206,7 @@ Any Adapter::invoke( const OUString &aFunctionName,
}
sal_Int32 size = aParams.getLength();
- PyRef argsTuple(PyTuple_New( size ), SAL_NO_ACQUIRE );
+ PyRef argsTuple(PyTuple_New( size ), SAL_NO_ACQUIRE, NOT_NULL );
int i;
// fill tuple with default values in case of exceptions
for( i = 0 ;i < size ; i ++ )
commit 6342a9c49e437405dd11d3966b8a1b3483b7fe69
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon May 26 15:02:49 2014 +0100
coverity#982754 Dereference null return value
Change-Id: I0d0dc196f223a988fd029cc61a8b160b2150534c
diff --git a/pyuno/source/module/pyuno_except.cxx b/pyuno/source/module/pyuno_except.cxx
index 08a0728..1835784 100644
--- a/pyuno/source/module/pyuno_except.cxx
+++ b/pyuno/source/module/pyuno_except.cxx
@@ -133,7 +133,7 @@ static PyRef createClass( const OUString & name, const Runtime &runtime )
base = PyRef(PyExc_Exception);
}
}
- PyRef args( PyTuple_New( 3 ), SAL_NO_ACQUIRE );
+ PyRef args( PyTuple_New( 3 ), SAL_NO_ACQUIRE, NOT_NULL );
PyRef pyTypeName = ustring2PyString( name /*.replace( '.', '_' )*/ );
commit dfddb56699469c62a2a1ccdea65821bab4f8d062
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon May 26 15:02:11 2014 +0100
coverity#982757 Dereference null return value
Change-Id: Ie2c88a778bb25e6909138e633fe115686e2cc026
diff --git a/pyuno/source/module/pyuno_runtime.cxx b/pyuno/source/module/pyuno_runtime.cxx
index 5a3e6ca..5ef20df 100644
--- a/pyuno/source/module/pyuno_runtime.cxx
+++ b/pyuno/source/module/pyuno_runtime.cxx
@@ -900,7 +900,7 @@ Any Runtime::extractUnoException( const PyRef & excType, const PyRef &excValue,
if( PyCallable_Check(extractTraceback.get()) )
{
- PyRef args( PyTuple_New( 1), SAL_NO_ACQUIRE );
+ PyRef args( PyTuple_New( 1), SAL_NO_ACQUIRE, NOT_NULL );
PyTuple_SetItem( args.get(), 0, excTraceback.getAcquired() );
PyRef pyStr( PyObject_CallObject( extractTraceback.get(),args.get() ), SAL_NO_ACQUIRE);
str = OUString::createFromAscii( PyStr_AsString(pyStr.get()) );
commit 88d9c8705882b4791d42955a465cc3e7a2efaa3f
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon May 26 15:01:20 2014 +0100
coverity#982758 Dereference null return value
Change-Id: Ia797bbd9c5587d2b55dd183a377e5b3dded96e7b
diff --git a/pyuno/source/module/pyuno_type.cxx b/pyuno/source/module/pyuno_type.cxx
index 592d81b..2833626 100644
--- a/pyuno/source/module/pyuno_type.cxx
+++ b/pyuno/source/module/pyuno_type.cxx
@@ -254,7 +254,7 @@ static PyObject* callCtor( const Runtime &r , const char * clazz, const PyRef &
PyObject *PyUNO_Enum_new( const char *enumBase, const char *enumValue, const Runtime &r )
{
- PyRef args( PyTuple_New( 2 ), SAL_NO_ACQUIRE );
+ PyRef args( PyTuple_New( 2 ), SAL_NO_ACQUIRE, NOT_NULL );
PyTuple_SetItem( args.get() , 0 , PyStr_FromString( enumBase ) );
PyTuple_SetItem( args.get() , 1 , PyStr_FromString( enumValue ) );
commit b15532a03c48c67a1aad52b4582e9271f8872381
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon May 26 15:00:48 2014 +0100
coverity#982761 Dereference null return value
Change-Id: I35e93ccf5992236d163d708089cd798e324157fb
diff --git a/pyuno/source/module/pyuno_type.cxx b/pyuno/source/module/pyuno_type.cxx
index 81f18f7..592d81b 100644
--- a/pyuno/source/module/pyuno_type.cxx
+++ b/pyuno/source/module/pyuno_type.cxx
@@ -295,7 +295,7 @@ PyObject *PyUNO_ByteSequence_new(
PyRef str(
PyStrBytes_FromStringAndSize( (char*)byteSequence.getConstArray(), byteSequence.getLength()),
SAL_NO_ACQUIRE );
- PyRef args( PyTuple_New( 1 ), SAL_NO_ACQUIRE );
+ PyRef args( PyTuple_New( 1 ), SAL_NO_ACQUIRE, NOT_NULL );
PyTuple_SetItem( args.get() , 0 , str.getAcquired() );
return callCtor( r, "ByteSequence" , args );
commit e17245c0c2050b94ffdbdf664615c3813a198dd7
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon May 26 15:00:11 2014 +0100
coverity#982759 Dereference null return value
Change-Id: I72209c52d6a8d036f0903f39b91fc62a2880448b
diff --git a/pyuno/source/module/pyuno_type.cxx b/pyuno/source/module/pyuno_type.cxx
index 5c0e2f3..81f18f7 100644
--- a/pyuno/source/module/pyuno_type.cxx
+++ b/pyuno/source/module/pyuno_type.cxx
@@ -279,7 +279,7 @@ PyObject* PyUNO_Type_new (const char *typeName , TypeClass t , const Runtime &r
PyObject* PyUNO_char_new ( sal_Unicode val , const Runtime &r )
{
// retrieve type object
- PyRef args( PyTuple_New( 1 ), SAL_NO_ACQUIRE );
+ PyRef args( PyTuple_New( 1 ), SAL_NO_ACQUIRE, NOT_NULL );
Py_UNICODE u[2];
u[0] = val;
commit 5bdc28028c6b4959d045e2f52ab852efa947e8f9
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon May 26 14:58:59 2014 +0100
coverity#982760 Dereference null return value
Change-Id: I779fa5fa418370dd6c53308943374e981f65ae29
diff --git a/pyuno/inc/pyuno/pyuno.hxx b/pyuno/inc/pyuno/pyuno.hxx
index da0f832..77f9662 100644
--- a/pyuno/inc/pyuno/pyuno.hxx
+++ b/pyuno/inc/pyuno/pyuno.hxx
@@ -68,6 +68,13 @@ extern "C" LO_DLLPUBLIC_PYUNO
namespace pyuno
{
+enum __NotNull
+{
+ /** definition of a no acquire enum for ctors
+ */
+ NOT_NULL
+};
+
/** Helper class for keeping references to python objects.
BEWARE: Look up every python function you use to check
whether you get an acquired or not acquired object pointer
@@ -88,6 +95,12 @@ public:
PyRef( PyObject * p, __sal_NoAcquire ) : m( p ) {}
+ PyRef( PyObject * p, __sal_NoAcquire, __NotNull ) : m( p )
+ {
+ if (!m)
+ throw std::bad_alloc();
+ }
+
PyRef( const PyRef &r ) : m( r.get() ) { Py_XINCREF( m ); }
~PyRef() { Py_XDECREF( m ); }
diff --git a/pyuno/source/module/pyuno_type.cxx b/pyuno/source/module/pyuno_type.cxx
index 0d8e630..5c0e2f3 100644
--- a/pyuno/source/module/pyuno_type.cxx
+++ b/pyuno/source/module/pyuno_type.cxx
@@ -265,7 +265,7 @@ PyObject *PyUNO_Enum_new( const char *enumBase, const char *enumValue, const Run
PyObject* PyUNO_Type_new (const char *typeName , TypeClass t , const Runtime &r )
{
// retrieve type object
- PyRef args( PyTuple_New( 2 ), SAL_NO_ACQUIRE );
+ PyRef args(PyTuple_New( 2 ), SAL_NO_ACQUIRE, NOT_NULL);
PyTuple_SetItem( args.get() , 0 , PyStr_FromString( typeName ) );
PyObject *typeClass = PyUNO_Enum_new( "com.sun.star.uno.TypeClass" , typeClassToString(t), r );
commit c6c135930c66d2465dcdfbb34ecb2d1abff735c6
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon May 26 13:23:02 2014 +0100
coverity#1019311 Unchecked return value
Change-Id: I682ca0b62e6eb0d02113218de97d1440089b782c
diff --git a/codemaker/source/cppumaker/cpputype.cxx b/codemaker/source/cppumaker/cpputype.cxx
index 850c95d..00b2ee3 100644
--- a/codemaker/source/cppumaker/cpputype.cxx
+++ b/codemaker/source/cppumaker/cpputype.cxx
@@ -155,7 +155,7 @@ public:
void dump(CppuOptions const & options);
- void dumpFile(
+ bool dumpFile(
OUString const & uri, OUString const & name, bool hpp,
CppuOptions const & options);
@@ -388,7 +388,7 @@ void CppuType::dump(CppuOptions const & options) {
options.isValid("-O") ? b2u(options.getOption("-O")) : "", options);
}
-void CppuType::dumpFile(
+bool CppuType::dumpFile(
OUString const & uri, OUString const & name, bool hpp,
CppuOptions const & options)
{
@@ -400,7 +400,7 @@ void CppuType::dumpFile(
}
bool exists = fileExists(u2b(fileUri));
if (exists && options.isValid("-G")) {
- return;
+ return false;
}
FileStream out;
out.createTempFile(getTempDir(u2b(fileUri)));
@@ -427,7 +427,7 @@ void CppuType::dumpFile(
throw;
}
out.close();
- makeValidTypeFile(
+ return makeValidTypeFile(
u2b(fileUri), u2b(tmpUri), exists && options.isValid("-Gc"));
}
commit e947342b9c4ffaef8e25e2763e60cbc67e6fa36c
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon May 26 13:21:02 2014 +0100
coverity#1019326 Unchecked dynamic_cast
Change-Id: Ib3f0776048ca3dbb8a7efa4d9240f4ee9d6ac9dd
diff --git a/codemaker/source/cppumaker/cpputype.cxx b/codemaker/source/cppumaker/cpputype.cxx
index 9acec60..850c95d 100644
--- a/codemaker/source/cppumaker/cpputype.cxx
+++ b/codemaker/source/cppumaker/cpputype.cxx
@@ -719,7 +719,7 @@ OUString CppuType::getTypeClass(OUString const & name, bool cStyle) {
: OUString("::css::uno::TypeClass_INTERFACE");
case codemaker::UnoType::SORT_TYPEDEF:
return getTypeClass(
- dynamic_cast< unoidl::TypedefEntity * >(ent.get())->getType(),
+ dynamic_cast<unoidl::TypedefEntity&>(*ent.get()).getType(),
cStyle);
default:
for (;;) { std::abort(); }
commit 9c82cb60de359a34d029ad8c3a84fa264840cde9
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon May 26 13:18:17 2014 +0100
coverity#1019329 Unchecked dynamic_cast
Change-Id: Ic340559c9ab9b74f4f932c90e08f2530c08e8d08
diff --git a/codemaker/source/cppumaker/cpputype.cxx b/codemaker/source/cppumaker/cpputype.cxx
index 06bf874..9acec60 100644
--- a/codemaker/source/cppumaker/cpputype.cxx
+++ b/codemaker/source/cppumaker/cpputype.cxx
@@ -929,7 +929,7 @@ OUString CppuType::resolveAllTypedefs(OUString const & name) const {
sal_Int32 k2;
n = b2u(
codemaker::UnoType::decompose(
- u2b(dynamic_cast< unoidl::TypedefEntity * >(ent.get())->
+ u2b(dynamic_cast<unoidl::TypedefEntity&>(*ent.get()).
getType()),
&k2));
k1 += k2; //TODO: overflow
commit 353188ecc44db8ed4e7c1e900901c17e4d7ce8e4
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon May 26 13:16:47 2014 +0100
coverity#1019330 Unchecked dynamic_cast
Change-Id: I9c7893f7c9af2b42dcc50f2d1463ec497bb85e30
diff --git a/codemaker/source/cppumaker/cpputype.cxx b/codemaker/source/cppumaker/cpputype.cxx
index 1ef6506..06bf874 100644
--- a/codemaker/source/cppumaker/cpputype.cxx
+++ b/codemaker/source/cppumaker/cpputype.cxx
@@ -914,7 +914,7 @@ OUString CppuType::resolveOuterTypedefs(OUString const & name) const {
if (m_typeMgr->getSort(n, &ent) != codemaker::UnoType::SORT_TYPEDEF) {
return n;
}
- n = dynamic_cast< unoidl::TypedefEntity * >(ent.get())->getType();
+ n = dynamic_cast<unoidl::TypedefEntity&>(*ent.get()).getType();
}
}
commit 4dbb91ce732a51b8f388e12038ecf43b1b5d98da
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon May 26 11:21:21 2014 +0100
coverity#1215317 Uncaught exception
Change-Id: Idada0fbd80f55f67bd62cb7d31dcc7457e4a18d5
diff --git a/svx/source/gallery2/gallery1.cxx b/svx/source/gallery2/gallery1.cxx
index 09b1ded..0ab6c02 100644
--- a/svx/source/gallery2/gallery1.cxx
+++ b/svx/source/gallery2/gallery1.cxx
@@ -596,7 +596,7 @@ bool Gallery::RemoveTheme( const OUString& rThemeName )
return bRet;
}
-GalleryTheme* Gallery::ImplGetCachedTheme( const GalleryThemeEntry* pThemeEntry )
+GalleryTheme* Gallery::ImplGetCachedTheme(const GalleryThemeEntry* pThemeEntry)
{
GalleryTheme* pTheme = NULL;
@@ -623,12 +623,18 @@ GalleryTheme* Gallery::ImplGetCachedTheme( const GalleryThemeEntry* pThemeEntry
if( pIStm )
{
- pTheme = new GalleryTheme( this, (GalleryThemeEntry*) pThemeEntry );
- ReadGalleryTheme( *pIStm, *pTheme );
+ try
+ {
+ pTheme = new GalleryTheme( this, (GalleryThemeEntry*) pThemeEntry );
+ ReadGalleryTheme( *pIStm, *pTheme );
- if( pIStm->GetError() )
+ if( pIStm->GetError() )
+ {
+ delete pTheme, pTheme = NULL;
+ }
+ }
+ catch (const css::ucb::ContentCreationException&)
{
- delete pTheme, pTheme = NULL;
}
delete pIStm;
commit 91e8185802741eb386b93cfc7fcce773951881b4
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon May 26 10:48:05 2014 +0100
coverity#983778 Uncaught exception
Change-Id: I27ebb40f21a15c7e1696217a53d8c07e1d1161ad
diff --git a/sd/inc/stlsheet.hxx b/sd/inc/stlsheet.hxx
index 90ce7eb..cad63a7 100644
--- a/sd/inc/stlsheet.hxx
+++ b/sd/inc/stlsheet.hxx
@@ -120,7 +120,7 @@ public:
void notifyModifyListener();
protected:
- const SfxItemPropertySimpleEntry* getPropertyMapEntry( const OUString& rPropertyName ) const throw();
+ const SfxItemPropertySimpleEntry* getPropertyMapEntry( const OUString& rPropertyName ) const throw (css::uno::RuntimeException);
virtual void Load (SvStream& rIn, sal_uInt16 nVersion) SAL_OVERRIDE;
virtual void Store(SvStream& rOut) SAL_OVERRIDE;
diff --git a/sd/source/core/stlsheet.cxx b/sd/source/core/stlsheet.cxx
index 1838b5a..c19cba3 100644
--- a/sd/source/core/stlsheet.cxx
+++ b/sd/source/core/stlsheet.cxx
@@ -1359,7 +1359,7 @@ Any SAL_CALL SdStyleSheet::getPropertyDefault( const OUString& aPropertyName ) t
/** this is used because our property map is not sorted yet */
-const SfxItemPropertySimpleEntry* SdStyleSheet::getPropertyMapEntry( const OUString& rPropertyName ) const throw()
+const SfxItemPropertySimpleEntry* SdStyleSheet::getPropertyMapEntry( const OUString& rPropertyName ) const throw (css::uno::RuntimeException)
{
return GetStylePropertySet().getPropertyMapEntry(rPropertyName);
}
commit b07446600796bea0e00840d2fcd85af4d9deb8f5
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon May 26 10:44:53 2014 +0100
coverity#982169 Unchecked return value
Change-Id: I4aa333a907ff050fff4a4c7c41120ce00961673c
diff --git a/pyuno/source/module/pyuno_module.cxx b/pyuno/source/module/pyuno_module.cxx
index 6c55a50..eeb039a 100644
--- a/pyuno/source/module/pyuno_module.cxx
+++ b/pyuno/source/module/pyuno_module.cxx
@@ -102,9 +102,9 @@ public:
{
Py_DECREF(used);
}
- void setUsed(PyObject *key)
+ int setUsed(PyObject *key)
{
- PyDict_SetItem(used, key, Py_True);
+ return PyDict_SetItem(used, key, Py_True);
}
void setInitialised(const OUString& key, sal_Int32 pos = -1)
{
commit 5c5bbe9d0198a53eee67963c9cae7ba80e7b2a83
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon May 26 10:43:21 2014 +0100
coverity#707122 Uncaught exception
Change-Id: I4a2da7874493169ad60b81be59d14269418aae96
diff --git a/sd/source/ui/inc/SdUnoDrawView.hxx b/sd/source/ui/inc/SdUnoDrawView.hxx
index 6268752..2472340 100644
--- a/sd/source/ui/inc/SdUnoDrawView.hxx
+++ b/sd/source/ui/inc/SdUnoDrawView.hxx
@@ -117,7 +117,7 @@ protected:
@param rxLayer
The new layer object.
*/
- void setActiveLayer (const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XLayer>& rxLayer) throw ();
+ void setActiveLayer (const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XLayer>& rxLayer) throw (css::uno::RuntimeException);
void SetZoom( sal_Int16 nZoom );
sal_Int16 GetZoom(void) const;
diff --git a/sd/source/ui/unoidl/SdUnoDrawView.cxx b/sd/source/ui/unoidl/SdUnoDrawView.cxx
index f167cc3..9a4c554e 100644
--- a/sd/source/ui/unoidl/SdUnoDrawView.cxx
+++ b/sd/source/ui/unoidl/SdUnoDrawView.cxx
@@ -150,7 +150,8 @@ Reference<drawing::XLayer> SdUnoDrawView::getActiveLayer (void) throw ()
-void SdUnoDrawView::setActiveLayer (const Reference<drawing::XLayer>& rxLayer) throw ()
+void SdUnoDrawView::setActiveLayer (const Reference<drawing::XLayer>& rxLayer)
+ throw (uno::RuntimeException)
{
// Get the SdrLayer object corresponding to the given reference.
if ( ! rxLayer.is())
More information about the Libreoffice-commits
mailing list