sc/source/core/opencl/op_math.cxx | 3 -- sc/source/core/opencl/opencl_device_selection.h | 10 ++++++- sc/source/ui/Accessibility/AccessibleCell.cxx | 8 +++--- sc/source/ui/Accessibility/AccessibleContextBase.cxx | 4 +-- sc/source/ui/inc/AccessibleCell.hxx | 8 +++--- sc/source/ui/inc/AccessibleContextBase.hxx | 4 +-- sc/source/ui/vba/vbawindow.cxx | 4 +-- sc/source/ui/vba/vbawindow.hxx | 2 - svtools/source/contnr/treelistbox.cxx | 10 ++----- svtools/source/control/valueacc.cxx | 1 sw/source/core/doc/tblcpy.cxx | 3 ++ sw/source/core/txtnode/fntcache.cxx | 24 +++++++++--------- sw/source/core/txtnode/thints.cxx | 6 +++- sw/source/core/view/viewsh.cxx | 3 -- sw/source/filter/ww8/ww8par.cxx | 4 +-- sw/source/ui/utlui/content.cxx | 2 - xmloff/source/style/PageMasterImportPropMapper.cxx | 25 +++++++++---------- 17 files changed, 68 insertions(+), 53 deletions(-)
New commits: commit 4b1ecc4c7da84eee69c583222b62afbf6afed3ab Author: Caolán McNamara <caol...@redhat.com> Date: Fri Jan 24 13:50:41 2014 +0000 coverity#705740 Resource leak Change-Id: I646d7eabf77843f639ede33d018eac338c5d0d27 diff --git a/sw/source/core/doc/tblcpy.cxx b/sw/source/core/doc/tblcpy.cxx index 869af75..8100d47 100644 --- a/sw/source/core/doc/tblcpy.cxx +++ b/sw/source/core/doc/tblcpy.cxx @@ -938,7 +938,10 @@ sal_Bool SwTable::InsTable( const SwTable& rCpyTbl, const SwSelBoxes& rSelBoxes, { if( !( pTmpBox = pLine->GetTabBoxes()[ nSttBox + nBx ]) ->GetSttNd() ) + { + delete pInsFLine; return sal_False; + } // if Ok, insert the Box into the FndLine pFndBox = new _FndBox( pTmpBox, pInsFLine ); pInsFLine->GetBoxes().insert( pInsFLine->GetBoxes().begin() + nBx, pFndBox ); commit 0df3ba835d512745cbf673cfe44f03693baf1a41 Author: Caolán McNamara <caol...@redhat.com> Date: Fri Jan 24 13:46:15 2014 +0000 coverity#736746 Resource leak Change-Id: I01fc15563b57560fd503f66abf2e2fc07301feb7 diff --git a/xmloff/source/style/PageMasterImportPropMapper.cxx b/xmloff/source/style/PageMasterImportPropMapper.cxx index 056b80c..8975307 100644 --- a/xmloff/source/style/PageMasterImportPropMapper.cxx +++ b/xmloff/source/style/PageMasterImportPropMapper.cxx @@ -25,6 +25,7 @@ #include <com/sun/star/table/BorderLine2.hpp> #include <com/sun/star/container/XNameContainer.hpp> #include <xmloff/xmlimp.hxx> +#include <boost/scoped_ptr.hpp> #define XML_LINE_LEFT 0 #define XML_LINE_RIGHT 1 @@ -110,10 +111,10 @@ void PageMasterImportPropertyMapper::finished(::std::vector< XMLPropertyState >& XMLPropertyState* pFooterBorderWidths[4] = { NULL, NULL, NULL, NULL }; XMLPropertyState* pHeaderHeight = NULL; XMLPropertyState* pHeaderMinHeight = NULL; - XMLPropertyState* pHeaderDynamic = NULL; + boost::scoped_ptr<XMLPropertyState> xHeaderDynamic; XMLPropertyState* pFooterHeight = NULL; XMLPropertyState* pFooterMinHeight = NULL; - XMLPropertyState* pFooterDynamic = NULL; + boost::scoped_ptr<XMLPropertyState> xFooterDynamic; XMLPropertyState* pAllMarginProperty = NULL; XMLPropertyState* pMargins[4] = { NULL, NULL, NULL, NULL }; SAL_WNODEPRECATED_DECLARATIONS_PUSH @@ -321,28 +322,28 @@ void PageMasterImportPropertyMapper::finished(::std::vector< XMLPropertyState >& sal_Bool bValue(sal_False); uno::Any aAny; aAny.setValue( &bValue, ::getBooleanCppuType() ); - pHeaderDynamic = new XMLPropertyState(pHeaderHeight->mnIndex + 2, aAny); + xHeaderDynamic.reset(new XMLPropertyState(pHeaderHeight->mnIndex + 2, aAny)); } if (pHeaderMinHeight) { sal_Bool bValue(sal_True); uno::Any aAny; aAny.setValue( &bValue, ::getBooleanCppuType() ); - pHeaderDynamic = new XMLPropertyState(pHeaderMinHeight->mnIndex + 1, aAny); + xHeaderDynamic.reset(new XMLPropertyState(pHeaderMinHeight->mnIndex + 1, aAny)); } if (pFooterHeight) { sal_Bool bValue(sal_False); uno::Any aAny; aAny.setValue( &bValue, ::getBooleanCppuType() ); - pFooterDynamic = new XMLPropertyState(pFooterHeight->mnIndex + 2, aAny); + xFooterDynamic.reset(new XMLPropertyState(pFooterHeight->mnIndex + 2, aAny)); } if (pFooterMinHeight) { sal_Bool bValue(sal_True); uno::Any aAny; aAny.setValue( &bValue, ::getBooleanCppuType() ); - pFooterDynamic = new XMLPropertyState(pFooterMinHeight->mnIndex + 1, aAny); + xFooterDynamic.reset(new XMLPropertyState(pFooterMinHeight->mnIndex + 1, aAny)); } // fdo#38056: nerf the various AllFoo properties so they do not override @@ -441,15 +442,15 @@ void PageMasterImportPropertyMapper::finished(::std::vector< XMLPropertyState >& delete pFooterNewBorders[i]; } } - if(pHeaderDynamic) + if(xHeaderDynamic) { - rProperties.push_back(*pHeaderDynamic); - delete pHeaderDynamic; + rProperties.push_back(*xHeaderDynamic); + xHeaderDynamic.reset(); } - if(pFooterDynamic) + if(xFooterDynamic) { - rProperties.push_back(*pFooterDynamic); - delete pFooterDynamic; + rProperties.push_back(*xFooterDynamic); + xFooterDynamic.reset(); } } commit f1afa83eadf2e2edec26b5ac50b6f28b17fb79ab Author: Caolán McNamara <caol...@redhat.com> Date: Fri Jan 24 13:41:22 2014 +0000 coverity#1130488 Uninitialized scalar field Change-Id: Ia1def7b58a9d7709d11336e2e27bd3b3679d7aea diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx index 92cce0a..8e2e3d4 100644 --- a/sw/source/core/txtnode/fntcache.cxx +++ b/sw/source/core/txtnode/fntcache.cxx @@ -103,19 +103,21 @@ void SwFntCache::Flush( ) |* |*************************************************************************/ -SwFntObj::SwFntObj( const SwSubFont &rFont, const void *pOwn, SwViewShell *pSh ) : - SwCacheObj( (void*)pOwn ), - aFont( rFont ), - pScrFont( NULL ), - pPrtFont( &aFont ), - pPrinter( NULL ), - nPropWidth( rFont.GetPropWidth() ) +SwFntObj::SwFntObj(const SwSubFont &rFont, const void *pOwn, SwViewShell *pSh) + : SwCacheObj((void*)pOwn) + , aFont(rFont) + , pScrFont(NULL) + , pPrtFont(&aFont) + , pPrinter(NULL) + , nGuessedLeading(USHRT_MAX) + , nExtLeading(USHRT_MAX) + , nScrAscent(0) + , nPrtAscent(USHRT_MAX) + , nScrHeight(0) + , nPrtHeight(USHRT_MAX) + , nPropWidth(rFont.GetPropWidth()) { nZoom = pSh ? pSh->GetViewOptions()->GetZoom() : USHRT_MAX; - nGuessedLeading = USHRT_MAX; - nExtLeading = USHRT_MAX; - nPrtAscent = USHRT_MAX; - nPrtHeight = USHRT_MAX; bSymbol = RTL_TEXTENCODING_SYMBOL == aFont.GetCharSet(); bPaintBlank = ( UNDERLINE_NONE != aFont.GetUnderline() || UNDERLINE_NONE != aFont.GetOverline() commit 45ef5c48f47b43da2c6898ebb234915f1468dbf6 Author: Caolán McNamara <caol...@redhat.com> Date: Fri Jan 24 13:37:56 2014 +0000 coverity#1130491 Unused pointer value Change-Id: I6de205be4c35a0f06fa9c16671b99d44fb47f9d5 diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx index b2794d0..61fbf74 100644 --- a/sw/source/core/view/viewsh.cxx +++ b/sw/source/core/view/viewsh.cxx @@ -615,10 +615,9 @@ void SwViewShell::UpdateAllCharts() sal_Bool SwViewShell::HasCharts() const { sal_Bool bRet = sal_False; - const SwStartNode *pStNd; SwNodeIndex aIdx( *GetDoc()->GetNodes().GetEndOfAutotext(). StartOfSectionNode(), 1 ); - while ( 0 != (pStNd = aIdx.GetNode().GetStartNode()) ) + while (aIdx.GetNode().GetStartNode()) { ++aIdx; const SwOLENode *pNd = aIdx.GetNode().GetOLENode(); commit 604ce7566d0ab2c6ddc94951773c23bf716728f4 Author: Caolán McNamara <caol...@redhat.com> Date: Fri Jan 24 13:35:56 2014 +0000 coverity#708304 Uninitialized scalar field Change-Id: If82964036862e309dc1c90036df59942a24fd7d6 diff --git a/svtools/source/control/valueacc.cxx b/svtools/source/control/valueacc.cxx index 1306c96..cba9d06 100644 --- a/svtools/source/control/valueacc.cxx +++ b/svtools/source/control/valueacc.cxx @@ -40,6 +40,7 @@ ValueSetItem::ValueSetItem( ValueSet& rParent ) , meType(VALUESETITEM_NONE) , mbVisible(true) , mpData(NULL) + , mbSelected(false) , mpxAcc(NULL) { } commit 7b1c01887719f5631c67a581183f5a4b615d70c8 Author: Caolán McNamara <caol...@redhat.com> Date: Fri Jan 24 13:31:55 2014 +0000 coverity#1158080 Dereference after null check Change-Id: I708977778bcd6d488d8f61703acbe90c62f6f2e4 diff --git a/sw/source/core/txtnode/thints.cxx b/sw/source/core/txtnode/thints.cxx index f3fdc96..11a8fac 100644 --- a/sw/source/core/txtnode/thints.cxx +++ b/sw/source/core/txtnode/thints.cxx @@ -3421,8 +3421,10 @@ sal_uInt16 SwTxtNode::GetLang( const sal_Int32 nBegin, const sal_Int32 nLen, const sal_Int32 *pEndIdx = pHt->End(); // Ueberlappt das Attribut den Bereich? - if( pEndIdx && - nLen ? ( nAttrStart < nEnd && nBegin < *pEndIdx ) + if (!pEndIdx) + continue; + + if( nLen ? ( nAttrStart < nEnd && nBegin < *pEndIdx ) : (( nAttrStart < nBegin && ( pHt->DontExpand() ? nBegin < *pEndIdx : nBegin <= *pEndIdx )) || commit d93c204f3769c2cb33439c2c41b2d5d4a7de9c3c Author: Caolán McNamara <caol...@redhat.com> Date: Fri Jan 24 13:26:20 2014 +0000 coverity#1158180 Argument cannot be negative Change-Id: Ic8dd6aeff02b08c8a3951ce0378eab95ba0c6f1d diff --git a/sc/source/core/opencl/opencl_device_selection.h b/sc/source/core/opencl/opencl_device_selection.h index 85ee9f6..2712adc 100644 --- a/sc/source/core/opencl/opencl_device_selection.h +++ b/sc/source/core/opencl/opencl_device_selection.h @@ -347,6 +347,7 @@ inline ds_status readProFile(const char* fileName, char** content, size_t* conte FILE* input = NULL; size_t size = 0; char* binary = NULL; + long pos = -1; *contentSize = 0; *content = NULL; @@ -358,7 +359,14 @@ inline ds_status readProFile(const char* fileName, char** content, size_t* conte } fseek(input, 0L, SEEK_END); - size = ftell(input); + pos = ftell(input); + if (pos < 0) + { + fclose(input); + return DS_FILE_ERROR; + } + + size = pos; rewind(input); binary = (char*)malloc(size); if (binary == NULL) commit cbff9d45e47a9d8e28a1570c45c3e4617a638ad1 Author: Caolán McNamara <caol...@redhat.com> Date: Fri Jan 24 13:20:21 2014 +0000 coverity#1158214 Assign instead of compare Change-Id: Iaf1fd2a1b37338acef9c110e20911503255e8167 diff --git a/sc/source/core/opencl/op_math.cxx b/sc/source/core/opencl/op_math.cxx index 9b7dca0..1c8c717 100644 --- a/sc/source/core/opencl/op_math.cxx +++ b/sc/source/core/opencl/op_math.cxx @@ -2051,8 +2051,7 @@ void OpSumIf::GenSlidingWindowFunction(std::stringstream &ss, { ss << "\ndouble " << sSymName; ss << "_"<< BinFuncName() <<"("; - int flag = 0; - (3 == vSubArguments.size()) && (flag = 2); + int flag = 3 == vSubArguments.size() ? 2 : 0; for (unsigned i = 0; i < vSubArguments.size(); i++) { if (i) commit 949ad7ac998a833f02fde9e4d7c43e2f831ca31a Author: Caolán McNamara <caol...@redhat.com> Date: Fri Jan 24 13:17:43 2014 +0000 coverity#1158239 Dereference before null check Change-Id: Ieb358c5449cdb2a0c4ce5c5602b6023f3697a57c diff --git a/sw/source/ui/utlui/content.cxx b/sw/source/ui/utlui/content.cxx index 47357c0..35e7b72 100644 --- a/sw/source/ui/utlui/content.cxx +++ b/sw/source/ui/utlui/content.cxx @@ -2736,7 +2736,7 @@ void SwContentTree::KeyInput(const KeyEvent& rEvent) } //mod end } - if ( pActiveShell && !hasObjectMarked ) + if ( !hasObjectMarked ) { SwEditWin& pEditWindow = pActiveShell->GetView().GetEditWin(); commit 6c7b64bad403fb6eeac6e79d356f456f741a00d4 Author: Caolán McNamara <caol...@redhat.com> Date: Fri Jan 24 13:13:59 2014 +0000 coverity#1158240 Dereference before null check Change-Id: I5ce6d5514c6bb2298dd00c43d21a43dba55268c3 diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index 218a13d..84965e8 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -2199,8 +2199,8 @@ long SwWW8ImplReader::Read_And(WW8PLCFManResult* pRes) } while( !pNode->IsTxtNode() && pPaM->GetPoint()->nNode >= 0 ); - // Subtrackt previous text node's length - if( pNode && pNode->IsTxtNode() ) + // Subtract previous text node's length + if( pNode->IsTxtNode() ) { pTxtNode = pNode->GetTxtNode(); if( nLen < pTxtNode->Len() ) commit e9ab0dbfec46e15c7723f10b55a18d61efaae306 Author: Caolán McNamara <caol...@redhat.com> Date: Fri Jan 24 13:12:01 2014 +0000 coverity#1158253 Dereference before null check Change-Id: If653cc6dc0b53f66728500d779460ee352924947 diff --git a/svtools/source/contnr/treelistbox.cxx b/svtools/source/contnr/treelistbox.cxx index 1399757..5eafd3a 100644 --- a/svtools/source/contnr/treelistbox.cxx +++ b/svtools/source/contnr/treelistbox.cxx @@ -4079,13 +4079,9 @@ void SvTreeListBox::FillAccessibleEntryStateSet( SvTreeListEntry* pEntry, ::utl: rStateSet.AddState( AccessibleStateType::ENABLED ); rStateSet.AddState( AccessibleStateType::FOCUSABLE ); rStateSet.AddState( AccessibleStateType::SELECTABLE ); - SvViewDataEntry* pViewDataNewCur = 0; - if( pEntry ) - { - pViewDataNewCur = GetViewDataEntry(pEntry); - if (pViewDataNewCur && pViewDataNewCur->HasFocus()) - rStateSet.AddState( AccessibleStateType::FOCUSED ); - } + SvViewDataEntry* pViewDataNewCur = GetViewDataEntry(pEntry); + if (pViewDataNewCur && pViewDataNewCur->HasFocus()) + rStateSet.AddState( AccessibleStateType::FOCUSED ); } } commit 269451915f6c676721c7094b14c04b61e44931f4 Author: Caolán McNamara <caol...@redhat.com> Date: Fri Jan 24 13:08:18 2014 +0000 coverity#1158383 Uncaught exception Change-Id: I5c8e88406232ab579d23fd2a67756c5b637c2d96 diff --git a/sc/source/ui/Accessibility/AccessibleCell.cxx b/sc/source/ui/Accessibility/AccessibleCell.cxx index 149d41a..e0fc4c8 100644 --- a/sc/source/ui/Accessibility/AccessibleCell.cxx +++ b/sc/source/ui/Accessibility/AccessibleCell.cxx @@ -508,7 +508,9 @@ static OUString ReplaceFourChar(OUString oldOUString) } uno::Any SAL_CALL ScAccessibleCell::getExtendedAttributes() - throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException) + throw (::com::sun::star::lang::IndexOutOfBoundsException, + ::com::sun::star::uno::RuntimeException, + std::exception) { uno::Any strRet; if (mpViewShell) diff --git a/sc/source/ui/inc/AccessibleCell.hxx b/sc/source/ui/inc/AccessibleCell.hxx index db04108..9ad298b 100644 --- a/sc/source/ui/inc/AccessibleCell.hxx +++ b/sc/source/ui/inc/AccessibleCell.hxx @@ -146,7 +146,9 @@ public: throw (::com::sun::star::uno::RuntimeException); virtual ::com::sun::star::uno::Any SAL_CALL getExtendedAttributes() - throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException) ; + throw (::com::sun::star::lang::IndexOutOfBoundsException, + ::com::sun::star::uno::RuntimeException, + std::exception); // Override this method to handle cell's ParaIndent attribute specially. virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL getCharacterAttributes( sal_Int32 nIndex, const ::com::sun::star::uno::Sequence< OUString >& aRequestedAttributes ) commit 3b65ac148cc0a125f41c9662439b99dc8b5b41cc Author: Caolán McNamara <caol...@redhat.com> Date: Fri Jan 24 13:05:42 2014 +0000 coverity#1158384 Uncaught exception Change-Id: I8e0b8f7c10f2289732246a3ce75d7ccd7650d0ea diff --git a/sc/source/ui/Accessibility/AccessibleCell.cxx b/sc/source/ui/Accessibility/AccessibleCell.cxx index cb319a4..149d41a 100644 --- a/sc/source/ui/Accessibility/AccessibleCell.cxx +++ b/sc/source/ui/Accessibility/AccessibleCell.cxx @@ -282,8 +282,8 @@ uno::Reference<XAccessibleStateSet> SAL_CALL } uno::Reference<XAccessibleRelationSet> SAL_CALL - ScAccessibleCell::getAccessibleRelationSet(void) - throw (uno::RuntimeException) + ScAccessibleCell::getAccessibleRelationSet() + throw (uno::RuntimeException, std::exception) { SolarMutexGuard aGuard; IsObjectValid(); diff --git a/sc/source/ui/Accessibility/AccessibleContextBase.cxx b/sc/source/ui/Accessibility/AccessibleContextBase.cxx index 4fe9288..c11b054 100644 --- a/sc/source/ui/Accessibility/AccessibleContextBase.cxx +++ b/sc/source/ui/Accessibility/AccessibleContextBase.cxx @@ -368,8 +368,8 @@ OUString SAL_CALL } uno::Reference<XAccessibleRelationSet> SAL_CALL - ScAccessibleContextBase::getAccessibleRelationSet(void) - throw (uno::RuntimeException) + ScAccessibleContextBase::getAccessibleRelationSet() + throw (uno::RuntimeException, std::exception) { return new utl::AccessibleRelationSetHelper(); } diff --git a/sc/source/ui/inc/AccessibleCell.hxx b/sc/source/ui/inc/AccessibleCell.hxx index 90cde3e..db04108 100644 --- a/sc/source/ui/inc/AccessibleCell.hxx +++ b/sc/source/ui/inc/AccessibleCell.hxx @@ -128,8 +128,8 @@ public: virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleRelationSet> SAL_CALL - getAccessibleRelationSet(void) - throw (::com::sun::star::uno::RuntimeException); + getAccessibleRelationSet() + throw (::com::sun::star::uno::RuntimeException, std::exception); ///===== XServiceInfo ==================================================== diff --git a/sc/source/ui/inc/AccessibleContextBase.hxx b/sc/source/ui/inc/AccessibleContextBase.hxx index acbab2c..ad598f1 100644 --- a/sc/source/ui/inc/AccessibleContextBase.hxx +++ b/sc/source/ui/inc/AccessibleContextBase.hxx @@ -178,8 +178,8 @@ public: /// Return NULL to indicate that an empty relation set. virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleRelationSet> SAL_CALL - getAccessibleRelationSet(void) - throw (::com::sun::star::uno::RuntimeException); + getAccessibleRelationSet() + throw (::com::sun::star::uno::RuntimeException, std::exception); /// Return the set of current states. virtual ::com::sun::star::uno::Reference< commit 8be64b9ffc76b5ee3bfff0716e2d7ae3e87e24af Author: Caolán McNamara <caol...@redhat.com> Date: Fri Jan 24 13:04:06 2014 +0000 coverity#1158386 Uncaught exception Change-Id: I51a5ef561e3a9f3f53567cb781a294a14712f97b diff --git a/sc/source/ui/vba/vbawindow.cxx b/sc/source/ui/vba/vbawindow.cxx index 544e149..be4792b 100644 --- a/sc/source/ui/vba/vbawindow.cxx +++ b/sc/source/ui/vba/vbawindow.cxx @@ -764,8 +764,8 @@ ScVbaWindow::getZoom() throw (uno::RuntimeException) return uno::Any(); } -void SAL_CALL -ScVbaWindow::setZoom( const uno::Any& _zoom ) throw (uno::RuntimeException) +void SAL_CALL ScVbaWindow::setZoom(const uno::Any& _zoom) + throw (uno::RuntimeException, std::exception) { sal_Int16 nZoom = 100; _zoom >>= nZoom; diff --git a/sc/source/ui/vba/vbawindow.hxx b/sc/source/ui/vba/vbawindow.hxx index a808791..f1c7c0e 100644 --- a/sc/source/ui/vba/vbawindow.hxx +++ b/sc/source/ui/vba/vbawindow.hxx @@ -102,7 +102,7 @@ public: virtual css::uno::Any SAL_CALL getWindowState() throw (css::uno::RuntimeException); virtual void SAL_CALL setWindowState( const css::uno::Any& _windowstate ) throw (css::uno::RuntimeException); virtual css::uno::Any SAL_CALL getZoom() throw (css::uno::RuntimeException); - virtual void SAL_CALL setZoom( const css::uno::Any& _zoom ) throw (css::uno::RuntimeException); + virtual void SAL_CALL setZoom(const css::uno::Any& _zoom) throw (css::uno::RuntimeException, std::exception); virtual double SAL_CALL getTabRatio() throw (css::uno::RuntimeException) ; virtual void SAL_CALL setTabRatio( double _tabratio ) throw (css::uno::RuntimeException) ;
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits