summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/sfx2/thumbnailview.hxx5
-rw-r--r--sfx2/source/control/thumbnailview.cxx6
2 files changed, 6 insertions, 5 deletions
diff --git a/include/sfx2/thumbnailview.hxx b/include/sfx2/thumbnailview.hxx
index 50ea94440b4b..c628d38a2eb1 100644
--- a/include/sfx2/thumbnailview.hxx
+++ b/include/sfx2/thumbnailview.hxx
@@ -12,8 +12,9 @@
#include <sfx2/dllapi.h>
-#include <vector>
#include <functional>
+#include <memory>
+#include <vector>
#include <sfx2/thumbnailviewitem.hxx>
#include <vcl/ctrl.hxx>
@@ -317,7 +318,7 @@ protected:
double mfHighlightTransparence; ///< Transparence of the highlight.
Link<const ThumbnailViewItem*, void> maItemStateHdl;
- ThumbnailItemAttributes* mpItemAttrs;
+ std::unique_ptr<ThumbnailItemAttributes> mpItemAttrs;
std::function<bool (const ThumbnailViewItem*)> maFilterFunc;
};
diff --git a/sfx2/source/control/thumbnailview.cxx b/sfx2/source/control/thumbnailview.cxx
index 6e45a4f7dc93..5cd33e453a58 100644
--- a/sfx2/source/control/thumbnailview.cxx
+++ b/sfx2/source/control/thumbnailview.cxx
@@ -69,7 +69,7 @@ void ThumbnailView::dispose()
xComponent->dispose ();
mpScrBar.disposeAndClear();
- delete mpItemAttrs;
+ mpItemAttrs.reset();
ImplDeleteItems();
Control::dispose();
@@ -354,7 +354,7 @@ void ThumbnailView::CalculateItemPositions (bool bScrollBarUsed)
}
pItem->setDrawArea(::tools::Rectangle( Point(x,y), Size(mnItemWidth, mnItemHeight) ));
- pItem->calculateItemsPosition(mnThumbnailHeight,mnDisplayHeight,mnItemPadding,mpItemAttrs->nMaxTextLength,mpItemAttrs);
+ pItem->calculateItemsPosition(mnThumbnailHeight,mnDisplayHeight,mnItemPadding,mpItemAttrs->nMaxTextLength,mpItemAttrs.get());
if ( !((nCurCount+1) % mnCols) )
{
@@ -851,7 +851,7 @@ void ThumbnailView::Paint(vcl::RenderContext& rRenderContext, const ::tools::Rec
if (pItem->isVisible())
{
- pItem->Paint(pProcessor.get(), mpItemAttrs);
+ pItem->Paint(pProcessor.get(), mpItemAttrs.get());
}
}