basctl/source/basicide/doceventnotifier.cxx | 1 basegfx/source/polygon/b2dsvgpolypolygon.cxx | 8 ++++-- unotest/source/cpp/unoexceptionprotector/unoexceptionprotector.cxx | 8 ++++++ vcl/source/control/tabctrl.cxx | 13 +++++----- 4 files changed, 22 insertions(+), 8 deletions(-)
New commits: commit eb227657d91c94f151434434e31087ae74efdd24 Author: Caolán McNamara <[email protected]> AuthorDate: Thu Sep 26 08:48:56 2024 +0100 Commit: Caolán McNamara <[email protected]> CommitDate: Thu Sep 26 13:39:32 2024 +0200 cid#1608414 Double lock since: commit f3e127217d8daa443b8eda52ac4810e375cc7d63 CommitDate: Wed May 10 13:28:09 2023 +0200 use comphelper::WeakComponentImplHelper in DocumentEventNotifier::Impl problem: 108 std::unique_lock aGuard(m_aMutex); 109 if ( !impl_isDisposed_nothrow(aGuard) ) 110 { 111 acquire(); CID 1608414: (#1 of 1): Double lock (LOCK) 4. double_lock: dispose locks this->m_aMutex while it is locked.[show details] 112 dispose(); /include/comphelper/compbase.hxx 73 virtual void SAL_CALL dispose() noexcept final override 74 { 1. lock: dispose locks this->m_aMutex.[show details] 75 WeakComponentImplHelperBase::dispose(); /comphelper/source/misc/compbase.cxx 20 void SAL_CALL WeakComponentImplHelperBase::dispose() 21 { 1. lock: unique_lock locks this->m_aMutex. 22 std::unique_lock aGuard(m_aMutex); Change-Id: Ibd9dc0564adf86c6409794f584a743aecd9d36e6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173970 Tested-by: Jenkins Reviewed-by: Caolán McNamara <[email protected]> diff --git a/basctl/source/basicide/doceventnotifier.cxx b/basctl/source/basicide/doceventnotifier.cxx index 254c719bb5cc..9d408d7f967a 100644 --- a/basctl/source/basicide/doceventnotifier.cxx +++ b/basctl/source/basicide/doceventnotifier.cxx @@ -109,6 +109,7 @@ namespace basctl if ( !impl_isDisposed_nothrow(aGuard) ) { acquire(); + aGuard.unlock(); // dispose locks m_aMutex dispose(); } } commit 27fc6242c7153fcc3f41e38cc2ea649a3fe0c4cf Author: Caolán McNamara <[email protected]> AuthorDate: Wed Sep 25 15:24:20 2024 +0100 Commit: Caolán McNamara <[email protected]> CommitDate: Thu Sep 26 13:39:23 2024 +0200 cid#1607525 silence Overflowed constant and cid#1607982 Overflowed constant Change-Id: Ib7be7f8e17deb6184e25e543eab68dd704673eba Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173968 Tested-by: Jenkins Reviewed-by: Caolán McNamara <[email protected]> diff --git a/basegfx/source/polygon/b2dsvgpolypolygon.cxx b/basegfx/source/polygon/b2dsvgpolypolygon.cxx index 9728a3896de6..7e525d5e1644 100644 --- a/basegfx/source/polygon/b2dsvgpolypolygon.cxx +++ b/basegfx/source/polygon/b2dsvgpolypolygon.cxx @@ -271,6 +271,7 @@ namespace basegfx::utils aCurrPoly.append(B2DPoint(nLastX, nLastY)); nCurrPolyCount = 1; } + assert(nCurrPolyCount > 0 && "coverity 2023.12.2"); // get first control point. It's the reflection of the PrevControlPoint // of the last point. If not existent, use current point (see SVG) @@ -416,15 +417,18 @@ namespace basegfx::utils } // ensure existence of start point - if(!aCurrPoly.count()) + sal_uInt32 nCurrPolyCount = aCurrPoly.count(); + if (nCurrPolyCount == 0) { aCurrPoly.append(B2DPoint(nLastX, nLastY)); + nCurrPolyCount = 1; } + assert(nCurrPolyCount > 0 && "coverity 2023.12.2"); // get first control point. It's the reflection of the PrevControlPoint // of the last point. If not existent, use current point (see SVG) B2DPoint aPrevControl(nLastX, nLastY); - const sal_uInt32 nIndex(aCurrPoly.count() - 1); + const sal_uInt32 nIndex(nCurrPolyCount - 1); const B2DPoint aPrevPoint(aCurrPoly.getB2DPoint(nIndex)); if(aCurrPoly.areControlPointsUsed() && aCurrPoly.isPrevControlPointUsed(nIndex)) diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx index b104c6ee5e27..5e4c874d53bc 100644 --- a/vcl/source/control/tabctrl.cxx +++ b/vcl/source/control/tabctrl.cxx @@ -1129,7 +1129,7 @@ void TabControl::Paint( vcl::RenderContext& rRenderContext, const tools::Rectang const bool bPaneWithHeader = mbShowTabs && rRenderContext.IsNativeControlSupported(ControlType::TabPane, ControlPart::TabPaneWithHeader); tools::Rectangle aHeaderRect(aRect.Left(), 0, aRect.Right(), aRect.Top()); - if (mpTabCtrlData->maItemList.size()) + if (!mpTabCtrlData->maItemList.empty()) { tools::Long nLeft = LONG_MAX; tools::Long nRight = 0; @@ -1213,7 +1213,8 @@ void TabControl::Paint( vcl::RenderContext& rRenderContext, const tools::Rectang } } - if (mbShowTabs && !mpTabCtrlData->maItemList.empty() && mpTabCtrlData->mpListBox == nullptr) + const size_t nItemListSize = mpTabCtrlData->maItemList.size(); + if (mbShowTabs && nItemListSize > 0 && mpTabCtrlData->mpListBox == nullptr) { // Some native toolkits (GTK+) draw tabs right-to-left, with an // overlap between adjacent tabs @@ -1227,17 +1228,17 @@ void TabControl::Paint( vcl::RenderContext& rRenderContext, const tools::Rectang if (bDrawTabsRTL) { pFirstTab = mpTabCtrlData->maItemList.data(); - pLastTab = pFirstTab + mpTabCtrlData->maItemList.size() - 1; - idx = mpTabCtrlData->maItemList.size() - 1; + pLastTab = pFirstTab + nItemListSize - 1; + idx = nItemListSize - 1; } else { pLastTab = mpTabCtrlData->maItemList.data(); - pFirstTab = pLastTab + mpTabCtrlData->maItemList.size() - 1; + pFirstTab = pLastTab + nItemListSize - 1; idx = 0; } - while (idx < mpTabCtrlData->maItemList.size()) + while (idx < nItemListSize) { ImplTabItem* pItem = &mpTabCtrlData->maItemList[idx]; commit cfc0fcd729e8e1e4395523a2ef2409fffc071f0d Author: Caolán McNamara <[email protected]> AuthorDate: Thu Sep 26 08:20:17 2024 +0100 Commit: Caolán McNamara <[email protected]> CommitDate: Thu Sep 26 13:39:16 2024 +0200 cid#1619687 Not restoring ostream format Change-Id: Id47cdffca6e597f3bf60ac9def5e92916443b117 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173967 Tested-by: Caolán McNamara <[email protected]> Reviewed-by: Caolán McNamara <[email protected]> diff --git a/unotest/source/cpp/unoexceptionprotector/unoexceptionprotector.cxx b/unotest/source/cpp/unoexceptionprotector/unoexceptionprotector.cxx index 5273699f57ab..804b8e7d12ca 100644 --- a/unotest/source/cpp/unoexceptionprotector/unoexceptionprotector.cxx +++ b/unotest/source/cpp/unoexceptionprotector/unoexceptionprotector.cxx @@ -82,11 +82,19 @@ void printUnoValue( out << *o3tl::forceAccess<sal_uInt64>(value); break; case css::uno::TypeClass_FLOAT: + { + std::ios_base::fmtflags origfmt = out.flags(); out << std::uppercase << *o3tl::forceAccess<float>(value); + out.setf(origfmt); break; + } case css::uno::TypeClass_DOUBLE: + { + std::ios_base::fmtflags origfmt = out.flags(); out << std::uppercase << *o3tl::forceAccess<double>(value); + out.setf(origfmt); break; + } case css::uno::TypeClass_CHAR: { std::ios_base::fmtflags origfmt = out.flags();
