sc/source/ui/inc/scuiautofmt.hxx | 4 +-- sc/source/ui/miscdlgs/scuiautofmt.cxx | 36 +++++++++++++++++----------------- vcl/source/gdi/metaact.cxx | 3 ++ 3 files changed, 24 insertions(+), 19 deletions(-)
New commits: commit fe07bf975982704c020ad2208a00b15c4d1dd9bf Author: Caolán McNamara <[email protected]> AuthorDate: Mon Dec 22 19:29:46 2025 +0000 Commit: Caolán McNamara <[email protected]> CommitDate: Tue Dec 23 00:33:02 2025 +0100 ofz#467698762 Integer-overflow Change-Id: I48e2bc82ac57475ed41fc41bcb7488c633550f16 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196112 Reviewed-by: Caolán McNamara <[email protected]> Tested-by: Jenkins diff --git a/vcl/source/gdi/metaact.cxx b/vcl/source/gdi/metaact.cxx index 75ebd34a1ba0..f2d747c60627 100644 --- a/vcl/source/gdi/metaact.cxx +++ b/vcl/source/gdi/metaact.cxx @@ -1718,6 +1718,9 @@ MetaTransparentAction::MetaTransparentAction( tools::PolyPolygon aPolyPoly, sal_ void MetaTransparentAction::Execute( OutputDevice* pOut ) { + if (!AllowRect(pOut->LogicToPixel(maPolyPoly.GetBoundRect()))) + return; + pOut->DrawTransparent( maPolyPoly, mnTransPercent ); } commit 076f891c9ce077bf13ffd9439a9f33576a293556 Author: Caolán McNamara <[email protected]> AuthorDate: Mon Dec 22 19:20:56 2025 +0000 Commit: Caolán McNamara <[email protected]> CommitDate: Tue Dec 23 00:32:55 2025 +0100 cid#1676289 silence Improper use of negative value Change-Id: I5375c59b0f34172aee7f4f67ec6a58f525d02722 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196111 Tested-by: Jenkins Reviewed-by: Caolán McNamara <[email protected]> diff --git a/sc/source/ui/miscdlgs/scuiautofmt.cxx b/sc/source/ui/miscdlgs/scuiautofmt.cxx index ba9eb42c7e35..6110ac968b2c 100644 --- a/sc/source/ui/miscdlgs/scuiautofmt.cxx +++ b/sc/source/ui/miscdlgs/scuiautofmt.cxx @@ -358,7 +358,9 @@ IMPL_LINK_NOARG(ScAutoFormatDlg, RenameHdl, weld::Button&, void) IMPL_LINK_NOARG(ScAutoFormatDlg, SelFmtHdl, weld::TreeView&, void) { - m_nIndex = m_xLbFormat->get_selected_index(); + int nIndex = m_xLbFormat->get_selected_index(); + assert(nIndex != -1 && "nothing selected"); + m_nIndex = nIndex; UpdateChecks(); if ( m_nIndex == 0 ) commit c06dbff3319800decc5aebe4d250150cd99e2d64 Author: Caolán McNamara <[email protected]> AuthorDate: Mon Dec 22 19:20:20 2025 +0000 Commit: Caolán McNamara <[email protected]> CommitDate: Tue Dec 23 00:32:48 2025 +0100 prefix member variable Change-Id: I7a08ddeb0a5945912e0e66b4f0b1505db29c9097 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196110 Reviewed-by: Caolán McNamara <[email protected]> Tested-by: Jenkins diff --git a/sc/source/ui/inc/scuiautofmt.hxx b/sc/source/ui/inc/scuiautofmt.hxx index 49e8a5c40dc5..129120dd5165 100644 --- a/sc/source/ui/inc/scuiautofmt.hxx +++ b/sc/source/ui/inc/scuiautofmt.hxx @@ -33,7 +33,7 @@ public: const ScViewData& rViewData); virtual ~ScAutoFormatDlg() override; - sal_uInt16 GetIndex() const { return nIndex; } + sal_uInt16 GetIndex() const { return m_nIndex; } OUString GetCurrFormatName(); private: @@ -45,7 +45,7 @@ private: ScAutoFormat* pFormat; const ScAutoFormatData* pSelFmtData; - sal_uInt16 nIndex; + sal_uInt16 m_nIndex; bool bCoreDataChanged; bool bFmtInserted; diff --git a/sc/source/ui/miscdlgs/scuiautofmt.cxx b/sc/source/ui/miscdlgs/scuiautofmt.cxx index 63c866be5cc2..ba9eb42c7e35 100644 --- a/sc/source/ui/miscdlgs/scuiautofmt.cxx +++ b/sc/source/ui/miscdlgs/scuiautofmt.cxx @@ -47,7 +47,7 @@ ScAutoFormatDlg::ScAutoFormatDlg(weld::Window* pParent, , aStrRename(ScResId(STR_RENAME_AUTOFORMAT_TITLE)) , pFormat(pAutoFormat) , pSelFmtData(pSelFormatData) - , nIndex(0) + , m_nIndex(0) , bCoreDataChanged(false) , bFmtInserted(false) , m_xLbFormat(m_xBuilder->weld_tree_view(u"formatlb"_ustr)) @@ -106,7 +106,7 @@ void ScAutoFormatDlg::Init() m_xBtnRename->set_sensitive(false); m_xBtnRemove->set_sensitive(false); - nIndex = 0; + m_nIndex = 0; UpdateChecks(); if ( !pSelFmtData ) @@ -119,7 +119,7 @@ void ScAutoFormatDlg::Init() void ScAutoFormatDlg::UpdateChecks() { - const ScAutoFormatData* pData = pFormat->findByIndex(nIndex); + const ScAutoFormatData* pData = pFormat->findByIndex(m_nIndex); m_xBtnNumFormat->set_active( pData->GetIncludeValueFormat() ); m_xBtnBorder->set_active( pData->GetIncludeFrame() ); @@ -154,7 +154,7 @@ IMPL_LINK_NOARG(ScAutoFormatDlg, DblClkHdl, weld::TreeView&, bool) IMPL_LINK(ScAutoFormatDlg, CheckHdl, weld::Toggleable&, rBtn, void) { - ScAutoFormatData* pData = pFormat->findByIndex(nIndex); + ScAutoFormatData* pData = pFormat->findByIndex(m_nIndex); bool bCheck = rBtn.get_active(); if (&rBtn == m_xBtnNumFormat.get()) @@ -242,7 +242,7 @@ IMPL_LINK_NOARG(ScAutoFormatDlg, AddHdl, weld::Button&, void) IMPL_LINK_NOARG(ScAutoFormatDlg, RemoveHdl, weld::Button&, void) { - if ( (nIndex > 0) && (m_xLbFormat->n_children() > 0) ) + if ( (m_nIndex > 0) && (m_xLbFormat->n_children() > 0) ) { OUString aMsg = o3tl::getToken(aStrDelMsg, 0, '#' ) + m_xLbFormat->get_selected_text() @@ -255,10 +255,10 @@ IMPL_LINK_NOARG(ScAutoFormatDlg, RemoveHdl, weld::Button&, void) if (RET_YES == xQueryBox->run()) { - m_xLbFormat->remove(nIndex); - m_xLbFormat->select(nIndex-1); + m_xLbFormat->remove(m_nIndex); + m_xLbFormat->select(m_nIndex-1); - if ( nIndex-1 == 0 ) + if ( m_nIndex-1 == 0 ) m_xBtnRemove->set_sensitive(false); if ( !bCoreDataChanged ) @@ -268,9 +268,9 @@ IMPL_LINK_NOARG(ScAutoFormatDlg, RemoveHdl, weld::Button&, void) } ScAutoFormat::iterator it = pFormat->begin(); - std::advance(it, nIndex); + std::advance(it, m_nIndex); pFormat->erase(it); - nIndex--; + m_nIndex--; SelFmtHdl( *m_xLbFormat ); } @@ -308,12 +308,12 @@ IMPL_LINK_NOARG(ScAutoFormatDlg, RenameHdl, weld::Button&, void) { // no format with this name yet, so we can rename - m_xLbFormat->remove(nIndex); - const ScAutoFormatData* p = pFormat->findByIndex(nIndex); + m_xLbFormat->remove(m_nIndex); + const ScAutoFormatData* p = pFormat->findByIndex(m_nIndex); std::unique_ptr<ScAutoFormatData> pNewData(new ScAutoFormatData(*p)); it = pFormat->begin(); - std::advance(it, nIndex); + std::advance(it, m_nIndex); pFormat->erase(it); pNewData->SetName( aFormatName ); @@ -358,10 +358,10 @@ IMPL_LINK_NOARG(ScAutoFormatDlg, RenameHdl, weld::Button&, void) IMPL_LINK_NOARG(ScAutoFormatDlg, SelFmtHdl, weld::TreeView&, void) { - nIndex = m_xLbFormat->get_selected_index(); + m_nIndex = m_xLbFormat->get_selected_index(); UpdateChecks(); - if ( nIndex == 0 ) + if ( m_nIndex == 0 ) { m_xBtnRename->set_sensitive(false); m_xBtnRemove->set_sensitive(false); @@ -372,13 +372,13 @@ IMPL_LINK_NOARG(ScAutoFormatDlg, SelFmtHdl, weld::TreeView&, void) m_xBtnRemove->set_sensitive(true); } - ScAutoFormatData* p = pFormat->findByIndex(nIndex); + ScAutoFormatData* p = pFormat->findByIndex(m_nIndex); m_aWndPreview.NotifyChange(p); } OUString ScAutoFormatDlg::GetCurrFormatName() { - const ScAutoFormatData* p = pFormat->findByIndex(nIndex); + const ScAutoFormatData* p = pFormat->findByIndex(m_nIndex); return p ? p->GetName() : OUString(); }
