TableProperties: Use shared_ptr::get() instead of &*mpTableStyle

Using &* can be problematic if the pointer is null. In this case the
pointer is explicitly checked for null first so it doesn’t matter, but
using shared_ptr::get() is probably easier to understand anyway. This
also paves the way for a later compiler plugin to check for this.

Change-Id: If087962548c6a7e06311eab9175f5108b50ca549
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211752
Tested-by: Jenkins
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
This commit is contained in:
Neil Roberts
2026-10-07 08:41:30 +02:00
parent 13fb6e87c7
commit 95218dded0
@@ -92,7 +92,7 @@ const TableStyle& TableProperties::getUsedTableStyle( const ::oox::core::XmlFilt
TableStyle* pTableStyle = nullptr;
if ( mpTableStyle )
pTableStyle = &*mpTableStyle;
pTableStyle = mpTableStyle.get();
else if ( !getStyleId().isEmpty() && rBase.getTableStyles() )
{
const std::vector< TableStyle >& rTableStyles( rBase.getTableStyles()->getTableStyles() );