cui/source/dialogs/colorpicker.cxx | 2 +- sd/source/ui/dlg/LayerTabBar.cxx | 7 ++++++- svx/source/tbxctrls/PaletteManager.cxx | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-)
New commits: commit dd5fda4fef0526262977d5f9262ce09e27286d01 Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Mon Dec 25 22:11:59 2023 +0000 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Tue Dec 26 11:52:52 2023 +0100 cid#1559938 Dereference null return value Change-Id: I9e4fd4a3c2cf56bb50e765cf64401ac7aa80847c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161291 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> diff --git a/sd/source/ui/dlg/LayerTabBar.cxx b/sd/source/ui/dlg/LayerTabBar.cxx index ece1e0884bcf..49a09a147936 100644 --- a/sd/source/ui/dlg/LayerTabBar.cxx +++ b/sd/source/ui/dlg/LayerTabBar.cxx @@ -179,7 +179,12 @@ void LayerTabBar::BringLayerObjectsToAttention(const sal_uInt16 nPageId) { SdrObject* pObj = aIter.Next(); assert(pObj != nullptr); - if (pObj && (aLayerName == rLayerAdmin.GetLayerPerID(pObj->GetLayer())->GetName())) + if (!pObj) + continue; + const SdrLayer* pSdrLayer = rLayerAdmin.GetLayerPerID(pObj->GetLayer()); + if (!pSdrLayer) + continue; + if (aLayerName == pSdrLayer->GetName()) { ::tools::Rectangle aRect(pObj->GetLogicRect()); if (!aRect.IsEmpty()) commit aa318cc3160841c2b22479cee7bf8941cf7e0d96 Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Mon Dec 25 22:08:01 2023 +0000 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Tue Dec 26 11:52:39 2023 +0100 cid#1559937 COPY_INSTEAD_OF_MOVE and cid#1559939 COPY_INSTEAD_OF_MOVE Change-Id: Ic5e581aff9e12c8c6277355b0a8bc99a155dc63e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161290 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> diff --git a/cui/source/dialogs/colorpicker.cxx b/cui/source/dialogs/colorpicker.cxx index 71b0d0970fc3..290025929d5a 100644 --- a/cui/source/dialogs/colorpicker.cxx +++ b/cui/source/dialogs/colorpicker.cxx @@ -1346,7 +1346,7 @@ void SAL_CALL ColorPicker::startExecuteModal( const css::uno::Reference< css::ui { std::shared_ptr<ColorPickerDialog> xDlg = std::make_shared<ColorPickerDialog>(Application::GetFrameWeld(mxParent), mnColor, mnMode); rtl::Reference<ColorPicker> xThis(this); - weld::DialogController::runAsync(xDlg, [xThis, xDlg, xListener] (sal_Int32 nResult) { + weld::DialogController::runAsync(xDlg, [xThis=std::move(xThis), xDlg, xListener] (sal_Int32 nResult) { if (nResult) xThis->mnColor = xDlg->GetColor(); diff --git a/svx/source/tbxctrls/PaletteManager.cxx b/svx/source/tbxctrls/PaletteManager.cxx index a98149ff30bb..5943ce3b8f27 100644 --- a/svx/source/tbxctrls/PaletteManager.cxx +++ b/svx/source/tbxctrls/PaletteManager.cxx @@ -406,7 +406,7 @@ void PaletteManager::PopupColorPicker(weld::Window* pParent, const OUString& aCo m_pColorDlg->SetColor(rInitialColor); m_pColorDlg->SetMode(svtools::ColorPickerMode::Modify); std::shared_ptr<PaletteManager> xSelf(shared_from_this()); - m_pColorDlg->ExecuteAsync(pParent, [xSelf, aCommandCopy] (sal_Int32 nResult) { + m_pColorDlg->ExecuteAsync(pParent, [xSelf=std::move(xSelf), aCommandCopy] (sal_Int32 nResult) { if (nResult == RET_OK) { Color aLastColor = xSelf->m_pColorDlg->GetColor();