summaryrefslogtreecommitdiff
path: root/sfx2/source/control
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2024-02-07 09:16:14 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2024-02-07 11:27:10 +0100
commitf9772bee2bc95a5b1880286dfb255e026cbd8a1e (patch)
treeed26a0b10d67e1bf24640d5664cdb8dc4bfad2dd /sfx2/source/control
parent10cc0f3d2ddaa5d7f6ee18042dacfc67c1be96af (diff)
simplify some Primitive2DContainer construction
Change-Id: Iced31da6891a5d218d63e9b59d48fb2645f39203 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163071 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sfx2/source/control')
-rw-r--r--sfx2/source/control/recentdocsviewitem.cxx15
1 files changed, 7 insertions, 8 deletions
diff --git a/sfx2/source/control/recentdocsviewitem.cxx b/sfx2/source/control/recentdocsviewitem.cxx
index c114be951cfc..2c6a87c7b125 100644
--- a/sfx2/source/control/recentdocsviewitem.cxx
+++ b/sfx2/source/control/recentdocsviewitem.cxx
@@ -300,17 +300,17 @@ void RecentDocsViewItem::Paint(drawinglayer::processor2d::BaseProcessor2D *pProc
// paint the remove/pinned icon when hovered
if (isHighlighted())
{
- drawinglayer::primitive2d::Primitive2DContainer aSeq(2);
+ drawinglayer::primitive2d::Primitive2DContainer aSeq;
Point aIconPos(getRemoveIconArea().TopLeft());
- aSeq[0] = drawinglayer::primitive2d::Primitive2DReference(new DiscreteBitmapPrimitive2D(
+ aSeq.push_back(new DiscreteBitmapPrimitive2D(
m_bRemoveIconHighlighted ? m_aRemoveRecentBitmapHighlighted : m_aRemoveRecentBitmap,
B2DPoint(aIconPos.X(), aIconPos.Y())));
// tdf#38742 - draw pinned icon
const Point aPinnedIconPos(getPinnedIconArea().TopLeft());
- aSeq[1] = drawinglayer::primitive2d::Primitive2DReference(new DiscreteBitmapPrimitive2D(
+ aSeq.push_back(new DiscreteBitmapPrimitive2D(
m_aPinnedDocumentBitmap, B2DPoint(aPinnedIconPos.X(), aPinnedIconPos.Y())));
pProcessor->process(aSeq);
@@ -318,12 +318,11 @@ void RecentDocsViewItem::Paint(drawinglayer::processor2d::BaseProcessor2D *pProc
// tdf#38742 - draw pinned icon if item is pinned
else if (m_bPinned)
{
- drawinglayer::primitive2d::Primitive2DContainer aSeq(1);
-
const Point aPinnedIconPos(getPinnedIconArea().TopLeft());
- aSeq[0] = drawinglayer::primitive2d::Primitive2DReference(new DiscreteBitmapPrimitive2D(
- m_bPinnedIconHighlighted ? m_aPinnedDocumentBitmapHiglighted : m_aPinnedDocumentBitmap,
- B2DPoint(aPinnedIconPos.X(), aPinnedIconPos.Y())));
+ drawinglayer::primitive2d::Primitive2DContainer aSeq {
+ new DiscreteBitmapPrimitive2D(
+ m_bPinnedIconHighlighted ? m_aPinnedDocumentBitmapHiglighted : m_aPinnedDocumentBitmap,
+ B2DPoint(aPinnedIconPos.X(), aPinnedIconPos.Y())) };
pProcessor->process(aSeq);
}