accessibility/source/standard/vclxaccessiblelist.cxx | 2 chart2/source/view/main/GL3DRenderer.cxx | 11 ++++ cui/source/dialogs/colorpicker.cxx | 11 +++- dbaccess/source/core/api/querycontainer.cxx | 8 +++ filter/source/flash/swfwriter1.cxx | 4 - include/oox/ppt/slidefragmenthandler.hxx | 2 include/vbahelper/vbahelper.hxx | 4 - oox/source/drawingml/fillproperties.cxx | 2 oox/source/ppt/slidefragmenthandler.cxx | 2 oox/source/shape/ShapeContextHandler.cxx | 6 +- sc/qa/unit/ucalc.cxx | 4 - sc/source/core/tool/interpr4.cxx | 1 sc/source/filter/inc/excelfilter.hxx | 2 sc/source/filter/oox/excelfilter.cxx | 2 sc/source/ui/view/viewfunc.cxx | 6 +- sd/source/ui/unoidl/unomodel.cxx | 5 +- sd/source/ui/unoidl/unopage.cxx | 8 ++- svtools/source/control/valueset.cxx | 2 svtools/source/graphic/grfmgr.cxx | 3 - svx/source/form/datanavi.cxx | 14 +++--- svx/source/gallery2/galtheme.cxx | 17 +++++-- sw/source/core/doc/docbm.cxx | 2 sw/source/core/unocore/unostyle.cxx | 5 +- sw/source/filter/basflt/iodetect.cxx | 14 ++++-- vbahelper/source/vbahelper/vbahelper.cxx | 44 +++++-------------- 25 files changed, 106 insertions(+), 75 deletions(-)
New commits: commit 7f55c89470b3671f9702ca76317a5388bf7513f9 Author: Caolán McNamara <caol...@redhat.com> Date: Fri Jul 18 15:15:01 2014 +0100 some other coverity foo Change-Id: Ide5a10d7f9c45970c3cc5c78213c151c85ff4570 diff --git a/include/vbahelper/vbahelper.hxx b/include/vbahelper/vbahelper.hxx index 3e9fa21..8e56341 100644 --- a/include/vbahelper/vbahelper.hxx +++ b/include/vbahelper/vbahelper.hxx @@ -162,9 +162,9 @@ public: throw (css::script::BasicErrorException, css::uno::RuntimeException); double getHeight() const; - void setHeight(double _fheight) throw ( css::script::BasicErrorException ); + void setHeight(double _fheight); double getWidth() const; - void setWidth(double _fWidth) throw ( css::script::BasicErrorException ); + void setWidth(double _fWidth); double getLeft() const; void setLeft(double _fLeft); double getTop() const; diff --git a/vbahelper/source/vbahelper/vbahelper.cxx b/vbahelper/source/vbahelper/vbahelper.cxx index 738c503..cdee33b 100644 --- a/vbahelper/source/vbahelper/vbahelper.cxx +++ b/vbahelper/source/vbahelper/vbahelper.cxx @@ -1015,18 +1015,11 @@ double ShapeHelper::getHeight() const return Millimeter::getInPoints(xShape->getSize().Height); } -void ShapeHelper::setHeight(double _fheight) throw ( css::script::BasicErrorException ) +void ShapeHelper::setHeight(double _fheight) { - try - { - css::awt::Size aSize = xShape->getSize(); - aSize.Height = Millimeter::getInHundredthsOfOneMillimeter(_fheight); - xShape->setSize(aSize); - } - catch (const css::uno::Exception&) - { - throw css::script::BasicErrorException( OUString(), css::uno::Reference< css::uno::XInterface >(), SbERR_METHOD_FAILED, OUString() ); - } + css::awt::Size aSize = xShape->getSize(); + aSize.Height = Millimeter::getInHundredthsOfOneMillimeter(_fheight); + xShape->setSize(aSize); } double ShapeHelper::getWidth() const @@ -1034,18 +1027,11 @@ double ShapeHelper::getWidth() const return Millimeter::getInPoints(xShape->getSize().Width); } -void ShapeHelper::setWidth(double _fWidth) throw ( css::script::BasicErrorException ) +void ShapeHelper::setWidth(double _fWidth) { - try - { - css::awt::Size aSize = xShape->getSize(); - aSize.Width = Millimeter::getInHundredthsOfOneMillimeter(_fWidth); - xShape->setSize(aSize); - } - catch (const css::uno::Exception&) - { - throw css::script::BasicErrorException( OUString(), css::uno::Reference< css::uno::XInterface >(), SbERR_METHOD_FAILED, OUString() ); - } + css::awt::Size aSize = xShape->getSize(); + aSize.Width = Millimeter::getInHundredthsOfOneMillimeter(_fWidth); + xShape->setSize(aSize); } double ShapeHelper::getLeft() const commit 1aba46ee6707f1ff4b1e0f8d2feb58b34931deb1 Author: Caolán McNamara <caol...@redhat.com> Date: Fri Jul 18 14:49:39 2014 +0100 coverity#1226486 Dereference null return value Change-Id: I9157f1844923e3e6ac360e859ee2cd97c33512ba diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx index b139987..1e4ba7f 100644 --- a/sc/source/ui/view/viewfunc.cxx +++ b/sc/source/ui/view/viewfunc.cxx @@ -1192,9 +1192,11 @@ void ScViewFunc::ApplySelectionPattern( const ScPatternAttr& rAttr, ScAddress aPos(nCol, nRow, nTab); if (rDoc.GetCellType(aPos) == CELLTYPE_EDIT) { - pOldEditData = rDoc.GetEditText(aPos)->Clone(); + const EditTextObject* pEditObj = rDoc.GetEditText(aPos); + pOldEditData = pEditObj ? pEditObj->Clone() : NULL; rDoc.RemoveEditTextCharAttribs(aPos, rAttr); - pNewEditData = rDoc.GetEditText(aPos)->Clone(); + pEditObj = rDoc.GetEditText(aPos); + pNewEditData = pEditObj ? pEditObj->Clone() : NULL; } aChangeRanges.Append(aPos); commit 25ffd3fad8d38295ebcf7cc0212dcb268ef68fdb Author: Caolán McNamara <caol...@redhat.com> Date: Fri Jul 18 14:38:18 2014 +0100 coverity#1038295 Unchecked dynamic_cast Change-Id: I0206983f7dd57626a7d33a95d5025af1b12ed9d3 diff --git a/oox/source/shape/ShapeContextHandler.cxx b/oox/source/shape/ShapeContextHandler.cxx index c80afb6..d9ae694 100644 --- a/oox/source/shape/ShapeContextHandler.cxx +++ b/oox/source/shape/ShapeContextHandler.cxx @@ -473,7 +473,7 @@ ShapeContextHandler::getShape() throw (uno::RuntimeException, std::exception) } else if (mxLockedCanvasContext.is()) { - ShapePtr pShape = dynamic_cast<LockedCanvasContext*>(mxLockedCanvasContext.get())->getShape(); + ShapePtr pShape = dynamic_cast<LockedCanvasContext&>(*mxLockedCanvasContext.get()).getShape(); if (pShape) { basegfx::B2DHomMatrix aMatrix; @@ -514,7 +514,7 @@ ShapeContextHandler::getShape() throw (uno::RuntimeException, std::exception) } else if (mxWpgContext.is()) { - ShapePtr pShape = dynamic_cast<WpgContext*>(mxWpgContext.get())->getShape(); + ShapePtr pShape = dynamic_cast<WpgContext&>(*mxWpgContext.get()).getShape(); if (pShape) { basegfx::B2DHomMatrix aMatrix; commit efa9f14b2a025f8b35a8dc119d6319539f02abd4 Author: Caolán McNamara <caol...@redhat.com> Date: Fri Jul 18 14:37:05 2014 +0100 coverity#1209494 Explicit null dereferenced Change-Id: I127066b71d34e5a4247a8eedc2fba23ed3c8255f diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx index d2a168f..65c91a4 100644 --- a/sc/qa/unit/ucalc.cxx +++ b/sc/qa/unit/ucalc.cxx @@ -5248,7 +5248,7 @@ void Test::testSortWithCellFormats() } const SfxPoolItem* pItem = NULL; - if (pPat->GetItemSet().HasItem(ATTR_FONT_WEIGHT)) + if (pPat->GetItemSet().HasItem(ATTR_FONT_WEIGHT, &pItem)) { // Check if the font weight is applied. if (static_cast<const SvxWeightItem*>(pItem)->GetEnumValue() == WEIGHT_BOLD) @@ -5258,7 +5258,7 @@ void Test::testSortWithCellFormats() } } - if (pPat->GetItemSet().HasItem(ATTR_FONT_POSTURE)) + if (pPat->GetItemSet().HasItem(ATTR_FONT_POSTURE, &pItem)) { // Check if the italics is applied. if (static_cast<const SvxPostureItem*>(pItem)->GetEnumValue() == ITALIC_NORMAL) commit 59e8f814b088ed0e91b1261e42c5040c9abeb5e7 Author: Caolán McNamara <caol...@redhat.com> Date: Fri Jul 18 14:34:02 2014 +0100 coverity#1132662 Dereference after null check Change-Id: Ifbaa05e70c8958d0289047efb75a13e0b8a13a4b diff --git a/accessibility/source/standard/vclxaccessiblelist.cxx b/accessibility/source/standard/vclxaccessiblelist.cxx index d54d515..77c5970 100644 --- a/accessibility/source/standard/vclxaccessiblelist.cxx +++ b/accessibility/source/standard/vclxaccessiblelist.cxx @@ -262,7 +262,7 @@ void VCLXAccessibleList::UpdateSelection_Impl_Acc(bool b_IsDropDownList) { //VCLXAccessibleDropDownComboBox //when in list is dropped down, xText = NULL - if (m_pListBoxHelper->IsInDropDown()) + if (m_pListBoxHelper && m_pListBoxHelper->IsInDropDown()) { if ( aNewValue.hasValue() || aOldValue.hasValue() ) { commit ccf492d844d580122464a482383c79d678185591 Author: Caolán McNamara <caol...@redhat.com> Date: Fri Jul 18 14:33:08 2014 +0100 coverity#735895 Unchecked dynamic_cast Change-Id: I5aaacda8d91d9cbe7671e8fc56990ae203ecbfbb diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx index 032daa8..835f696 100644 --- a/sw/source/core/doc/docbm.cxx +++ b/sw/source/core/doc/docbm.cxx @@ -418,7 +418,7 @@ namespace sw { namespace mark " - Mark was not created."); MarkBase* pMarkBase = dynamic_cast<MarkBase*>(pMark.get()); - if (!pMark) + if (!pMarkBase) return 0; if(pMark->GetMarkPos() != pMark->GetMarkStart()) commit bbe02602fa9d64d57da65be6c4d404e327dcc5dc Author: Caolán McNamara <caol...@redhat.com> Date: Fri Jul 18 14:28:10 2014 +0100 coverity#1215398 Uninitialized scalar field Change-Id: I00fd3afeca6e7c0902231fe88f7f23d4a2b32a3f diff --git a/chart2/source/view/main/GL3DRenderer.cxx b/chart2/source/view/main/GL3DRenderer.cxx index 52de7ce..d692e7b 100644 --- a/chart2/source/view/main/GL3DRenderer.cxx +++ b/chart2/source/view/main/GL3DRenderer.cxx @@ -160,6 +160,17 @@ OpenGL3DRenderer::ShaderResources::ShaderResources() , m_3DNormalMatrixID(0) , m_3DVertexID(0) , m_3DNormalID(0) + , m_3DMaterialAmbientID(0) + , m_3DMaterialDiffuseID(0) + , m_3DMaterialSpecularID(0) + , m_3DMaterialColorID(0) + , m_3DMaterialTwoSidesID(0) + , m_3DMaterialShininessID(0) + , m_3DLightColorID(0) + , m_3DLightPosID(0) + , m_3DLightPowerID(0) + , m_3DLightNumID(0) + , m_3DLightAmbientID(0) , m_TextProID(0) , m_TextMatrixID(0) , m_TextVertexID(0) commit f11118259d890a7d3c590f809c919e27b52a1cda Author: Caolán McNamara <caol...@redhat.com> Date: Fri Jul 18 14:23:30 2014 +0100 coverity#708018 Uninitialized scalar field Change-Id: Ifde16da72b009f0f32a70ccadab08083f5ff14e1 diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx index c6df5fc..e65e08b 100644 --- a/sc/source/core/tool/interpr4.cxx +++ b/sc/source/core/tool/interpr4.cxx @@ -3693,6 +3693,7 @@ ScInterpreter::ScInterpreter( ScFormulaCell* pCell, ScDocument* pDoc, , nCurFmtType(0) , nRetFmtType(0) , mnStringNoValueError(errNoValue) + , mnSubTotalFlags(0) , cPar(0) , bCalcAsShown(pDoc->GetDocOptions().IsCalcAsShown()) , meVolatileType(r.IsRecalcModeAlways() ? VOLATILE : NOT_VOLATILE) commit 724c242f1ddd30f26e2ea08fb1571788a78bf4da Author: Caolán McNamara <caol...@redhat.com> Date: Fri Jul 18 14:15:20 2014 +0100 coverity#704477 Division or modulo by float zero Change-Id: If229ad014851f46ccad5f8aec24cbf0bd2781b5e diff --git a/filter/source/flash/swfwriter1.cxx b/filter/source/flash/swfwriter1.cxx index c487acc..9ea53e5 100644 --- a/filter/source/flash/swfwriter1.cxx +++ b/filter/source/flash/swfwriter1.cxx @@ -892,8 +892,8 @@ void Writer::Impl_writeImage( const BitmapEx& rBmpEx, const Point& rPt, const Si // AS: Christian, my scaling factors are different than yours, and work better for me. // However, I can't explain why exactly. I got some of this by trial and error. - double XScale = static_cast<double>(originalPixelRect.GetWidth())/destRect.GetWidth(); - double YScale = static_cast<double>(originalPixelRect.GetHeight())/destRect.GetHeight(); + double XScale = destRect.GetWidth() ? static_cast<double>(originalPixelRect.GetWidth())/destRect.GetWidth() : 1.0;; + double YScale = destRect.GetHeight() ? static_cast<double>(originalPixelRect.GetHeight())/destRect.GetHeight() : 1.0;; // AS: If rClipRect has a value set, then we need to crop the bmp appropriately. // If a map event already occurred in the metafile, then we do not need to map commit ebdb4a00fa3daaae49b0e20a122284056cc5b846 Author: Caolán McNamara <caol...@redhat.com> Date: Fri Jul 18 14:13:24 2014 +0100 coverity#1202783 Division or modulo by zero Change-Id: Ida169195697d3976500a16e3cced40b25664a02e diff --git a/svtools/source/control/valueset.cxx b/svtools/source/control/valueset.cxx index 87a868b..d1a0409 100644 --- a/svtools/source/control/valueset.cxx +++ b/svtools/source/control/valueset.cxx @@ -1381,7 +1381,7 @@ void ValueSet::KeyInput( const KeyEvent& rKeyEvent ) { // update current column only in case of a new position // which is also not a "specially" handled one. - mnCurCol = nItemPos % mnCols; + mnCurCol = mnCols ? nItemPos % mnCols : 0; } const sal_uInt16 nItemId = (nItemPos != VALUESET_ITEM_NONEITEM) ? GetItemId( nItemPos ) : 0; if ( nItemId != mnSelItemId ) commit fb10049037a0c5936d6aa78df0b53e77a45cdd6e Author: Caolán McNamara <caol...@redhat.com> Date: Fri Jul 18 14:07:53 2014 +0100 coverity#706384 Uncaught exception Change-Id: Ieadbc90be19ec14d78fdf352df7537c69c66616b diff --git a/dbaccess/source/core/api/querycontainer.cxx b/dbaccess/source/core/api/querycontainer.cxx index a68d3c4..59ad63e 100644 --- a/dbaccess/source/core/api/querycontainer.cxx +++ b/dbaccess/source/core/api/querycontainer.cxx @@ -167,7 +167,13 @@ void SAL_CALL OQueryContainer::appendByDescriptor( const Reference< XPropertySet { notifyByName( aGuard, sNewObjectName, xNewObject, NULL, E_INSERTED, ApproveListeners ); } - catch( const Exception& ) + catch (const WrappedTargetException& e) + { + disposeComponent( xNewObject ); + disposeComponent( xCommandDefinitionPart ); + throw WrappedTargetRuntimeException(e.Message, e.Context, e.TargetException); + } + catch (const Exception&) { disposeComponent( xNewObject ); disposeComponent( xCommandDefinitionPart ); commit 5ca2b2e344f8d3be947432069d92188f08e9f4ad Author: Caolán McNamara <caol...@redhat.com> Date: Fri Jul 18 14:00:20 2014 +0100 coverity#707363 Uncaught exception Change-Id: I729204cbe833ad57eb20a02c4773dd66238fbc0d diff --git a/sw/source/filter/basflt/iodetect.cxx b/sw/source/filter/basflt/iodetect.cxx index 8cb7e0d..c6fdded 100644 --- a/sw/source/filter/basflt/iodetect.cxx +++ b/sw/source/filter/basflt/iodetect.cxx @@ -140,7 +140,7 @@ bool SwIoSystem::IsValidStgFilter( const com::sun::star::uno::Reference < com::s if ( bRet ) bRet = ( nStgFmtId && ( rFilter.GetFormat() == nStgFmtId ) ); } - catch ( com::sun::star::uno::Exception& ) + catch (const com::sun::star::uno::Exception& ) { } @@ -254,9 +254,15 @@ const SfxFilter* SwIoSystem::GetFileFilter(const OUString& rFileName, } else { - SvStream* pStream = pMedium->GetInStream(); - if ( pStream && SotStorage::IsStorageFile(pStream) ) - xStg = new SotStorage( pStream, false ); + try + { + SvStream* pStream = pMedium->GetInStream(); + if ( pStream && SotStorage::IsStorageFile(pStream) ) + xStg = new SotStorage( pStream, false ); + } + catch (const css::ucb::ContentCreationException &) + { + } if( xStg.Is() && ( xStg->GetError() == SVSTREAM_OK ) ) { commit 243e9ab76107adc64693ba133d536942afe8712f Author: Caolán McNamara <caol...@redhat.com> Date: Fri Jul 18 13:47:34 2014 +0100 fix indent Change-Id: I799d7a7989209e9fab03fbc79439b64e6c689499 diff --git a/vbahelper/source/vbahelper/vbahelper.cxx b/vbahelper/source/vbahelper/vbahelper.cxx index 78b071a..738c503 100644 --- a/vbahelper/source/vbahelper/vbahelper.cxx +++ b/vbahelper/source/vbahelper/vbahelper.cxx @@ -1012,11 +1012,10 @@ ShapeHelper::ShapeHelper( const css::uno::Reference< css::drawing::XShape >& _xS double ShapeHelper::getHeight() const { - return Millimeter::getInPoints(xShape->getSize().Height); - } - + return Millimeter::getInPoints(xShape->getSize().Height); +} - void ShapeHelper::setHeight(double _fheight) throw ( css::script::BasicErrorException ) +void ShapeHelper::setHeight(double _fheight) throw ( css::script::BasicErrorException ) { try { @@ -1027,12 +1026,13 @@ double ShapeHelper::getHeight() const catch (const css::uno::Exception&) { throw css::script::BasicErrorException( OUString(), css::uno::Reference< css::uno::XInterface >(), SbERR_METHOD_FAILED, OUString() ); - } + } } + double ShapeHelper::getWidth() const { return Millimeter::getInPoints(xShape->getSize().Width); - } +} void ShapeHelper::setWidth(double _fWidth) throw ( css::script::BasicErrorException ) { @@ -1048,13 +1048,11 @@ void ShapeHelper::setWidth(double _fWidth) throw ( css::script::BasicErrorExcept } } - double ShapeHelper::getLeft() const { return Millimeter::getInPoints(xShape->getPosition().X); } - void ShapeHelper::setLeft(double _fLeft) { css::awt::Point aPoint = xShape->getPosition(); @@ -1062,13 +1060,11 @@ void ShapeHelper::setLeft(double _fLeft) xShape->setPosition(aPoint); } - double ShapeHelper::getTop() const { - return Millimeter::getInPoints(xShape->getPosition().Y); + return Millimeter::getInPoints(xShape->getPosition().Y); } - void ShapeHelper::setTop(double _fTop) { css::awt::Point aPoint = xShape->getPosition(); commit 01c8962f281887db59e581906b89d027a994b52a Author: Caolán McNamara <caol...@redhat.com> Date: Fri Jul 18 13:43:40 2014 +0100 coverity#737268 Uncaught exception Change-Id: I376d560a772d7496943d7aee09e2972f33731d9b diff --git a/sc/source/filter/inc/excelfilter.hxx b/sc/source/filter/inc/excelfilter.hxx index 4243018..ae5cfad 100644 --- a/sc/source/filter/inc/excelfilter.hxx +++ b/sc/source/filter/inc/excelfilter.hxx @@ -39,7 +39,7 @@ public: WorkbookGlobals& getWorkbookGlobals() const; void unregisterWorkbookGlobals(); - virtual bool importDocument() throw() SAL_OVERRIDE; + virtual bool importDocument() SAL_OVERRIDE; virtual bool exportDocument() throw() SAL_OVERRIDE; virtual const ::oox::drawingml::Theme* getCurrentTheme() const SAL_OVERRIDE; diff --git a/sc/source/filter/oox/excelfilter.cxx b/sc/source/filter/oox/excelfilter.cxx index d577e53..335c90e 100644 --- a/sc/source/filter/oox/excelfilter.cxx +++ b/sc/source/filter/oox/excelfilter.cxx @@ -87,7 +87,7 @@ void ExcelFilter::unregisterWorkbookGlobals() mpBookGlob = 0; } -bool ExcelFilter::importDocument() throw() +bool ExcelFilter::importDocument() { /* To activate the XLSX/XLSB dumper, insert the full path to the file file:///<path-to-oox-module>/source/dump/xlsbdumper.ini commit 24b6add3774f5f0807c907d5a233ba8ac11116f4 Author: Caolán McNamara <caol...@redhat.com> Date: Fri Jul 18 13:42:36 2014 +0100 coverity#1202900 Uncaught exception Change-Id: I9e49abc490935710b471c79d19385bda37f038b0 diff --git a/include/oox/ppt/slidefragmenthandler.hxx b/include/oox/ppt/slidefragmenthandler.hxx index 4207263..07aa835 100644 --- a/include/oox/ppt/slidefragmenthandler.hxx +++ b/include/oox/ppt/slidefragmenthandler.hxx @@ -35,7 +35,7 @@ class SlideFragmentHandler : public ::oox::core::FragmentHandler2 { public: SlideFragmentHandler( ::oox::core::XmlFilterBase& rFilter, const OUString& rFragmentPath, SlidePersistPtr pPersistPtr, const ShapeLocation eShapeLocation ); - virtual ~SlideFragmentHandler() throw(); + virtual ~SlideFragmentHandler(); virtual void finalizeImport() SAL_OVERRIDE; virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 aElementToken, const AttributeList& rAttribs ) SAL_OVERRIDE; diff --git a/oox/source/ppt/slidefragmenthandler.cxx b/oox/source/ppt/slidefragmenthandler.cxx index 05f571e..70c9472 100644 --- a/oox/source/ppt/slidefragmenthandler.cxx +++ b/oox/source/ppt/slidefragmenthandler.cxx @@ -59,7 +59,7 @@ SlideFragmentHandler::SlideFragmentHandler( XmlFilterBase& rFilter, const OUStri getFilter(), aVMLDrawingFragmentPath, *pPersistPtr->getDrawing() ) ); } -SlideFragmentHandler::~SlideFragmentHandler() throw () +SlideFragmentHandler::~SlideFragmentHandler() { // convert and insert all VML shapes (mostly form controls) mpSlidePersistPtr->getDrawing()->convertAndInsert(); commit 15920e3e0843ad618898d20dc3b784c4778bcde4 Author: Caolán McNamara <caol...@redhat.com> Date: Fri Jul 18 13:40:50 2014 +0100 coverity#1215318 Uncaught exception Change-Id: I784198cacba86fe1778e49ceebe574b9cbd6888b diff --git a/svx/source/gallery2/galtheme.cxx b/svx/source/gallery2/galtheme.cxx index 41f607c..17204a0 100644 --- a/svx/source/gallery2/galtheme.cxx +++ b/svx/source/gallery2/galtheme.cxx @@ -94,10 +94,19 @@ GalleryTheme::~GalleryTheme() void GalleryTheme::ImplCreateSvDrawStorage() { - aSvDrawStorageRef = new SvStorage( false, GetSdvURL().GetMainURL( INetURLObject::NO_DECODE ), pThm->IsReadOnly() ? STREAM_READ : STREAM_STD_READWRITE ); - // #i50423# ReadOnly may not been set though the file can't be written (because of security reasons) - if ( ( aSvDrawStorageRef->GetError() != ERRCODE_NONE ) && !pThm->IsReadOnly() ) - aSvDrawStorageRef = new SvStorage( false, GetSdvURL().GetMainURL( INetURLObject::NO_DECODE ), STREAM_READ ); + try + { + aSvDrawStorageRef = new SvStorage( false, GetSdvURL().GetMainURL( INetURLObject::NO_DECODE ), pThm->IsReadOnly() ? STREAM_READ : STREAM_STD_READWRITE ); + // #i50423# ReadOnly may not been set though the file can't be written (because of security reasons) + if ( ( aSvDrawStorageRef->GetError() != ERRCODE_NONE ) && !pThm->IsReadOnly() ) + aSvDrawStorageRef = new SvStorage( false, GetSdvURL().GetMainURL( INetURLObject::NO_DECODE ), STREAM_READ ); + } + catch (const css::ucb::ContentCreationException& e) + { + SAL_WARN("svx", "failed to open: " + << GetSdvURL().GetMainURL(INetURLObject::NO_DECODE) + << "due to : " << e.Message); + } } bool GalleryTheme::ImplWriteSgaObject( const SgaObject& rObj, size_t nPos, GalleryObject* pExistentEntry ) commit b0f54746be824343379ea957d4220102e14c0f75 Author: Caolán McNamara <caol...@redhat.com> Date: Fri Jul 18 13:38:25 2014 +0100 coverity#1224992 Uncaught exception Change-Id: I42287e6709a157a65bfb783d14fbf889de2e54b2 diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx index cf03055..c3ec4a4 100644 --- a/sw/source/core/unocore/unostyle.cxx +++ b/sw/source/core/unocore/unostyle.cxx @@ -4193,9 +4193,10 @@ uno::Reference< style::XAutoStyle > SwXAutoStyleFamily::insertStyle( uno::Any aValue(pSeq[i].Value); const SfxItemPropertySimpleEntry* pEntry = rMap.getByName(rPropName); - if(!pEntry) + if (!pEntry) { - throw beans::UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + rPropName, static_cast < cppu::OWeakObject * > ( this ) ); + throw uno::RuntimeException(OUString("Unknown property: ") + rPropName, + static_cast<cppu::OWeakObject*>(this)); } const sal_uInt8 nMemberId(pEntry->nMemberId & (~SFX_METRIC_ITEM)); commit dfd1ff2164bf8f0317a0549fe3b67899233c6b17 Author: Caolán McNamara <caol...@redhat.com> Date: Fri Jul 18 13:35:15 2014 +0100 coverity#1226484 Using invalid iterator Change-Id: I30e4d365fb2a851ea8d81e9f45a6f4d0bf6d7ec7 diff --git a/oox/source/drawingml/fillproperties.cxx b/oox/source/drawingml/fillproperties.cxx index 4a7227f..fb02bda 100644 --- a/oox/source/drawingml/fillproperties.cxx +++ b/oox/source/drawingml/fillproperties.cxx @@ -503,7 +503,7 @@ void FillProperties::pushToPropMap( ShapePropertyMap& rPropMap, nShapeRotation = 180*60000 - nShapeRotation; } - aGradientStops.erase( aWidestSegmentStart ); + aGradientStops.erase( aWidestSegmentStart++ ); // Look for which is widest now aIt = boost::next(aGradientStops.begin()); commit e2669d7ee66b59c63114a94875b39d5c1e26d132 Author: Caolán McNamara <caol...@redhat.com> Date: Fri Jul 18 13:29:23 2014 +0100 coverity#1226494 Uninitialized pointer field Change-Id: I88d0414ea6188e807aa347dce4567821e0b7c6f3 diff --git a/svx/source/form/datanavi.cxx b/svx/source/form/datanavi.cxx index 0088a16..7a40de4 100644 --- a/svx/source/form/datanavi.cxx +++ b/svx/source/form/datanavi.cxx @@ -123,12 +123,16 @@ namespace svxform m_xPropSet( _rxSet ) {} }; - // class DataTreeListBox - - DataTreeListBox::DataTreeListBox( Window* pParent, WinBits nBits ) : - - SvTreeListBox( pParent, nBits ) + DataTreeListBox::DataTreeListBox(Window* pParent, WinBits nBits) + : SvTreeListBox(pParent, nBits) + , m_pXFormsPage(NULL) + , m_eGroup(DGTUnknown) + , m_nAddId(0) + , m_nAddElementId(0) + , m_nAddAttributeId(0) + , m_nEditId(0) + , m_nRemoveId(0) { EnableContextMenuHandling(); commit f9094a5eaa00e8b7e6ac44453a0f60feea595fb1 Author: Caolán McNamara <caol...@redhat.com> Date: Fri Jul 18 13:26:08 2014 +0100 coverity#1226487 Dereference null return value Change-Id: Icbdf4f4b1739a63aa02260ddc3b29097cb157b63 diff --git a/sd/source/ui/unoidl/unopage.cxx b/sd/source/ui/unoidl/unopage.cxx index 39cc6ee..c018489 100644 --- a/sd/source/ui/unoidl/unopage.cxx +++ b/sd/source/ui/unoidl/unopage.cxx @@ -1469,8 +1469,12 @@ Reference< drawing::XShape > SdGenericDrawPage::_CreateShape(SdrObject *pObj) c pShape->SetShapeType( aShapeType ); } - // SdXShape aggregates SvxShape - new SdXShape( SvxShape::getImplementation( xShape ), GetModel() ); + SvxShape *pSdShape = SvxShape::getImplementation(xShape); + if (pSdShape) + { + // SdXShape aggregates SvxShape + new SdXShape(pSdShape, GetModel()); + } return xShape; } else commit b1f80f1e9d38f15a00051dc9e7e529d90b572ae4 Author: Caolán McNamara <caol...@redhat.com> Date: Fri Jul 18 13:22:37 2014 +0100 coverity#1226485 Dereference null return value Change-Id: Ib875f26170b90416e2ab1c498d93fb727d9633ce diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx index 498c0c1..5a162f2 100644 --- a/sd/source/ui/unoidl/unomodel.cxx +++ b/sd/source/ui/unoidl/unomodel.cxx @@ -1056,10 +1056,11 @@ css::uno::Reference<css::uno::XInterface> SdXImpressDocument::create( } uno::Reference< drawing::XShape > xShape( xRet, uno::UNO_QUERY ); - if( xShape.is() ) + SvxShape* pShape = xShape.is() ? SvxShape::getImplementation(xShape) : NULL; + if (pShape) { xRet.clear(); - new SdXShape( SvxShape::getImplementation( xShape ), (SdXImpressDocument*)this ); + new SdXShape( pShape, (SdXImpressDocument*)this ); xRet = xShape; xShape.clear(); } commit 2529a364d177c2b232917562d98c2bfcfe7da132 Author: Caolán McNamara <caol...@redhat.com> Date: Fri Jul 18 13:12:31 2014 +0100 coverity#1226482 Dereference after null check Change-Id: I2723812f960cde23c480651c9f8f5b26585fd51d diff --git a/cui/source/dialogs/colorpicker.cxx b/cui/source/dialogs/colorpicker.cxx index 4b11fb5..092c382 100644 --- a/cui/source/dialogs/colorpicker.cxx +++ b/cui/source/dialogs/colorpicker.cxx @@ -641,12 +641,15 @@ void ColorFieldControl::Paint( const Rectangle& rRect ) if( !mpBitmap ) UpdateBitmap(); - Bitmap aOutputBitmap( *mpBitmap ); + if (mpBitmap) + { + Bitmap aOutputBitmap( *mpBitmap ); - if( GetBitCount() <= 8 ) - aOutputBitmap.Dither(); + if( GetBitCount() <= 8 ) + aOutputBitmap.Dither(); - DrawBitmap( rRect.TopLeft(), rRect.GetSize(), rRect.TopLeft(), rRect.GetSize(), aOutputBitmap ); + DrawBitmap( rRect.TopLeft(), rRect.GetSize(), rRect.TopLeft(), rRect.GetSize(), aOutputBitmap ); + } // draw circle around current color if( maColor.IsDark() ) commit f9b22d7c7a85de4f9bf95001d372ad8c6f8ff663 Author: Caolán McNamara <caol...@redhat.com> Date: Fri Jul 18 13:11:21 2014 +0100 coverity#1226481 Dereference after null check Change-Id: I93f9bfb7a360b2851d179f6c4535b416fff339bc diff --git a/svtools/source/graphic/grfmgr.cxx b/svtools/source/graphic/grfmgr.cxx index 1402ea7..32539dc 100644 --- a/svtools/source/graphic/grfmgr.cxx +++ b/svtools/source/graphic/grfmgr.cxx @@ -69,7 +69,8 @@ void GraphicObject::ImplAfterDataChange() mnDataChangeTimeStamp = aIncrementingTimeOfLastDataChange++; // check memory footprint of all GraphicObjects managed and evtl. take action - GetGraphicManager().ImplCheckSizeOfSwappedInGraphics(); + if (mpMgr) + mpMgr->ImplCheckSizeOfSwappedInGraphics(); } GraphicObject::GraphicObject( const GraphicManager* pMgr ) : commit 660b045c1a234215e81e98288d795f3d56beb41f Author: Caolán McNamara <caol...@redhat.com> Date: Fri Jul 18 13:08:25 2014 +0100 coverity#1226480 Unchecked dynamic_cast Change-Id: I07c0ee479a384d213a1b9b9252846bd9873b0bdc diff --git a/oox/source/shape/ShapeContextHandler.cxx b/oox/source/shape/ShapeContextHandler.cxx index 4ed6298..c80afb6 100644 --- a/oox/source/shape/ShapeContextHandler.cxx +++ b/oox/source/shape/ShapeContextHandler.cxx @@ -208,7 +208,7 @@ ShapeContextHandler::getDrawingShapeContext() else { // Reset the handler if fragment path has changed - OUString sHandlerFragmentPath = dynamic_cast<ContextHandler *>(mxDrawingFragmentHandler.get())->getFragmentPath(); + OUString sHandlerFragmentPath = dynamic_cast<ContextHandler&>(*mxDrawingFragmentHandler.get()).getFragmentPath(); if ( !msRelationFragmentPath.equals(sHandlerFragmentPath) ) { mxDrawingFragmentHandler.clear();
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits