lokdocview: Use m_pTileBuffer.get instead of &*m_pTileBuffer on unique_ptr

Using &* can be problematic if the pointer is null. In this case it
probably doesn’t matter, 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: If0ece4548b44080acf6db7f8c0ac37922d1a197c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211749
Tested-by: Jenkins
Reviewed-by: Neil Roberts <nroberts@libreoffice.org>
This commit is contained in:
Neil Roberts
2026-10-07 08:40:46 +02:00
parent 0ac807366d
commit d926f62338
+3 -3
View File
@@ -1720,7 +1720,7 @@ renderDocument(LOKDocView* pDocView, cairo_t* pCairo)
pLOEvent->m_nPaintTileX = nRow; pLOEvent->m_nPaintTileX = nRow;
pLOEvent->m_nPaintTileY = nColumn; pLOEvent->m_nPaintTileY = nColumn;
pLOEvent->m_fPaintTileZoom = priv->m_fZoom; pLOEvent->m_fPaintTileZoom = priv->m_fZoom;
pLOEvent->m_pTileBuffer = &*priv->m_pTileBuffer; pLOEvent->m_pTileBuffer = priv->m_pTileBuffer.get();
GTask* task = g_task_new(pDocView, nullptr, paintTileCallback, pLOEvent); GTask* task = g_task_new(pDocView, nullptr, paintTileCallback, pLOEvent);
g_task_set_task_data(task, pLOEvent, LOEvent::destroy); g_task_set_task_data(task, pLOEvent, LOEvent::destroy);
@@ -2482,7 +2482,7 @@ paintTileInThread (gpointer data)
gint nTileSizePixelsScaled = nTileSizePixels * nScaleFactor; gint nTileSizePixelsScaled = nTileSizePixels * nScaleFactor;
// check if "source" tile buffer is different from "current" tile buffer // check if "source" tile buffer is different from "current" tile buffer
if (pLOEvent->m_pTileBuffer != &*priv->m_pTileBuffer) if (pLOEvent->m_pTileBuffer != priv->m_pTileBuffer.get())
{ {
pLOEvent->m_pTileBuffer = nullptr; pLOEvent->m_pTileBuffer = nullptr;
g_task_return_new_error(task, g_task_return_new_error(task,
@@ -2533,7 +2533,7 @@ paintTileInThread (gpointer data)
// requests has passed the previous check at start of this function, and has // requests has passed the previous check at start of this function, and has
// rendered the tile already. We want to stop such rendered tiles from being // rendered the tile already. We want to stop such rendered tiles from being
// stored in new tile buffer. // stored in new tile buffer.
if (pLOEvent->m_pTileBuffer != &*priv->m_pTileBuffer) if (pLOEvent->m_pTileBuffer != priv->m_pTileBuffer.get())
{ {
pLOEvent->m_pTileBuffer = nullptr; pLOEvent->m_pTileBuffer = nullptr;
g_task_return_new_error(task, g_task_return_new_error(task,