sc/source/core/data/tablestyle.cxx | 15 +++------------ svx/source/diagram/datamodel_svx.cxx | 4 ++-- 2 files changed, 5 insertions(+), 14 deletions(-)
New commits: commit 8592c04fa634b258d71e0ec85682c4c962ea4467 Author: Caolán McNamara <[email protected]> AuthorDate: Thu Feb 19 17:31:48 2026 +0000 Commit: Caolán McNamara <[email protected]> CommitDate: Thu Feb 19 21:14:09 2026 +0100 cid#1681426 Dereference null return value Change-Id: I3b9bd1c36719b7daeb2ad27d63e606b2f6ee9374 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199751 Tested-by: Jenkins Reviewed-by: Caolán McNamara <[email protected]> diff --git a/svx/source/diagram/datamodel_svx.cxx b/svx/source/diagram/datamodel_svx.cxx index 3f5caf5d8b40..2619313c5a71 100644 --- a/svx/source/diagram/datamodel_svx.cxx +++ b/svx/source/diagram/datamodel_svx.cxx @@ -486,10 +486,10 @@ std::pair<OUString, DomMapFlags> DiagramData_svx::addDiagramNode() aPresPoint.msModelId = OStringToOUString(comphelper::xml::generateGUIDString(), RTL_TEXTENCODING_UTF8); aPresPoint.msPresentationAssociationId = aDataPoint.msModelId; - if (!sPresSibling.isEmpty()) + const svx::diagram::Point* pSiblingPoint = !sPresSibling.isEmpty() ? getPointByModelID(sPresSibling) : nullptr; + if (pSiblingPoint) { // no idea where to get these values from, so copy from previous sibling - const svx::diagram::Point* pSiblingPoint(getPointByModelID(sPresSibling)); aPresPoint.msPresentationLayoutName = pSiblingPoint->msPresentationLayoutName; aPresPoint.msPresentationLayoutStyleLabel = pSiblingPoint->msPresentationLayoutStyleLabel; aPresPoint.mnLayoutStyleIndex = pSiblingPoint->mnLayoutStyleIndex; commit f92d567a783934cfe09902619506117ec7e50938 Author: Caolán McNamara <[email protected]> AuthorDate: Thu Feb 19 17:28:09 2026 +0000 Commit: Caolán McNamara <[email protected]> CommitDate: Thu Feb 19 21:14:02 2026 +0100 cid#1681364 Logically dead code these are inside a if (pPoolItem) outer condition Change-Id: I0f0f273e653407a6512e24840e0655e6f3ca0ab6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199750 Tested-by: Caolán McNamara <[email protected]> Reviewed-by: Caolán McNamara <[email protected]> diff --git a/sc/source/core/data/tablestyle.cxx b/sc/source/core/data/tablestyle.cxx index 0a027c1609e5..806d75765e2c 100644 --- a/sc/source/core/data/tablestyle.cxx +++ b/sc/source/core/data/tablestyle.cxx @@ -524,10 +524,7 @@ std::unique_ptr<SvxBoxItem> ScTableStyle::GetBoxItem(const ScDBData& rDBData, SC pBLine = pBoxItem->GetLine(SvxBoxItemLine::BOTTOM); if (pLLine || pBLine) { - std::unique_ptr<SvxBoxItem> pNewBoxItem(pPoolItem ? pPoolItem->Clone() - : nullptr); - if (!pNewBoxItem) - pNewBoxItem = std::make_unique<SvxBoxItem>(ATTR_BORDER); + std::unique_ptr<SvxBoxItem> pNewBoxItem(pPoolItem->Clone()); if (pBLine) pNewBoxItem->SetLine(pBLine, SvxBoxItemLine::BOTTOM); if (pLLine) @@ -545,10 +542,7 @@ std::unique_ptr<SvxBoxItem> ScTableStyle::GetBoxItem(const ScDBData& rDBData, SC pBLine = pBoxItem->GetLine(SvxBoxItemLine::BOTTOM); if (pRLine || pBLine) { - std::unique_ptr<SvxBoxItem> pNewBoxItem(pPoolItem ? pPoolItem->Clone() - : nullptr); - if (!pNewBoxItem) - pNewBoxItem = std::make_unique<SvxBoxItem>(ATTR_BORDER); + std::unique_ptr<SvxBoxItem> pNewBoxItem(pPoolItem->Clone()); if (pBLine) pNewBoxItem->SetLine(pBLine, SvxBoxItemLine::BOTTOM); if (pRLine) @@ -569,10 +563,7 @@ std::unique_ptr<SvxBoxItem> ScTableStyle::GetBoxItem(const ScDBData& rDBData, SC if (pBLine || pVLine) { - std::unique_ptr<SvxBoxItem> pNewBoxItem(pPoolItem ? pPoolItem->Clone() - : nullptr); - if (!pNewBoxItem) - pNewBoxItem = std::make_unique<SvxBoxItem>(ATTR_BORDER); + std::unique_ptr<SvxBoxItem> pNewBoxItem(pPoolItem->Clone()); if (pBLine) pNewBoxItem->SetLine(pBLine, SvxBoxItemLine::BOTTOM); if (pVLine)
