ScAutoFormatData: Use unique_ptr::get() instead of &*iter

Using &* can be problematic if the pointer is null. In this case I don’t
think it matters, but using unique_ptr::get() is probably easier to
understand anyway. This also paves the way for a later compiler plugin
to check for this.

Change-Id: I6b399d57cdf580d40721789bf3d6e7607c56fd6e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211751
Tested-by: Jenkins
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
This commit is contained in:
Neil Roberts
2026-10-07 08:41:18 +02:00
parent 711c6c0c5b
commit 13fb6e87c7
+5 -2
View File
@@ -367,10 +367,13 @@ ScAutoFormat::~ScAutoFormat() = default;
const ScAutoFormatData* ScAutoFormat::GetData(size_t nIndex) const
{
return &*mpImpl->maAutoFormats[nIndex];
return mpImpl->maAutoFormats[nIndex].get();
}
ScAutoFormatData* ScAutoFormat::GetData(size_t nIndex) { return &*mpImpl->maAutoFormats[nIndex]; }
ScAutoFormatData* ScAutoFormat::GetData(size_t nIndex)
{
return mpImpl->maAutoFormats[nIndex].get();
}
bool ScAutoFormat::InsertAutoFormat(SvxAutoFormatData* pFormat)
{