summaryrefslogtreecommitdiff
path: root/sc
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 /sc
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 'sc')
-rw-r--r--sc/source/ui/view/hintwin.cxx11
1 files changed, 6 insertions, 5 deletions
diff --git a/sc/source/ui/view/hintwin.cxx b/sc/source/ui/view/hintwin.cxx
index d57d8e0b787f..7a287ed25c77 100644
--- a/sc/source/ui/view/hintwin.cxx
+++ b/sc/source/ui/view/hintwin.cxx
@@ -92,7 +92,8 @@ drawinglayer::primitive2d::Primitive2DContainer ScOverlayHint::createOverlaySequ
drawinglayer::geometry::ViewInformation2D aDummy;
rRange.expand(pTitle->getB2DRange(aDummy));
- drawinglayer::primitive2d::Primitive2DContainer aSeq { pTitle };
+ // insert two empty elements as placeholders for bg and border
+ drawinglayer::primitive2d::Primitive2DContainer aSeq { nullptr, nullptr, pTitle };
aFontMetric = pDefaultDev->GetFontMetric(aTextFont);
pDefaultDev->SetMapMode(aOld);
@@ -145,16 +146,16 @@ drawinglayer::primitive2d::Primitive2DContainer ScOverlayHint::createOverlaySequ
basegfx::B2DPolygon aPoly(basegfx::utils::createPolygonFromRect(rRange));
- const drawinglayer::primitive2d::Primitive2DReference aBg(
+ drawinglayer::primitive2d::Primitive2DReference aBg(
new drawinglayer::primitive2d::PolyPolygonColorPrimitive2D(basegfx::B2DPolyPolygon(aPoly), getBaseColor().getBColor()));
basegfx::BColor aBorderColor(0.5, 0.5, 0.5);
- const drawinglayer::primitive2d::Primitive2DReference aBorder(
+ drawinglayer::primitive2d::Primitive2DReference aBorder(
new drawinglayer::primitive2d::PolygonHairlinePrimitive2D(
std::move(aPoly), aBorderColor));
- aSeq.insert(aSeq.begin(), aBorder);
- aSeq.insert(aSeq.begin(), aBg);
+ aSeq[0] = aBg;
+ aSeq[1] = aBorder;
return aSeq;
}