LibreOffice Module svx (master) 1
sdrconnectorprimitive2d.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
26#include <utility>
27
28
29using namespace com::sun::star;
30
31
33{
35 {
37
38 // add line
39 if(getSdrLSTAttribute().getLine().isDefault())
40 {
41 // create invisible line for HitTest/BoundRect
42 aRetval.push_back(
45 }
46 else
47 {
48 aRetval.push_back(
51 getSdrLSTAttribute().getLine(),
52 getSdrLSTAttribute().getLineStartEnd()));
53 }
54
55 // add text
56 if(!getSdrLSTAttribute().getText().isDefault())
57 {
58 aRetval.push_back(
62 getSdrLSTAttribute().getText(),
63 getSdrLSTAttribute().getLine(),
64 false,
65 false));
66 }
67
68 // add shadow
69 if(!getSdrLSTAttribute().getShadow().isDefault())
70 {
72 std::move(aRetval),
73 getSdrLSTAttribute().getShadow());
74 }
75
76 rContainer.append(std::move(aRetval));
77 }
78
80 const attribute::SdrLineEffectsTextAttribute& rSdrLSTAttribute,
81 ::basegfx::B2DPolygon aUnitPolygon)
82 : maSdrLSTAttribute(rSdrLSTAttribute),
83 maUnitPolygon(std::move(aUnitPolygon))
84 {
85 }
86
88 {
89 if(BufferedDecompositionPrimitive2D::operator==(rPrimitive))
90 {
91 const SdrConnectorPrimitive2D& rCompare = static_cast<const SdrConnectorPrimitive2D&>(rPrimitive);
92
93 return (getUnitPolygon() == rCompare.getUnitPolygon()
94 && getSdrLSTAttribute() == rCompare.getSdrLSTAttribute());
95 }
96
97 return false;
98 }
99
100 // provide unique ID
102 {
104 }
105
106} // end of namespace
107
108/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void append(const Primitive2DReference &)
const ::basegfx::B2DPolygon & getUnitPolygon() const
virtual void create2DDecomposition(Primitive2DContainer &rContainer, const geometry::ViewInformation2D &aViewInformation) const override
virtual bool operator==(const BasePrimitive2D &rPrimitive) const override
SdrConnectorPrimitive2D(const attribute::SdrLineEffectsTextAttribute &rSdrLSTAttribute, ::basegfx::B2DPolygon aUnitPolygon)
const attribute::SdrLineEffectsTextAttribute & getSdrLSTAttribute() const
Primitive2DReference createHiddenGeometryPrimitives2D(const basegfx::B2DHomMatrix &rMatrix)
Primitive2DContainer createEmbeddedShadowPrimitive(Primitive2DContainer &&rContent, const attribute::SdrShadowAttribute &rShadow, const basegfx::B2DHomMatrix &rObjectMatrix, const Primitive2DContainer *pContentForShadow)
Primitive2DReference createPolygonLinePrimitive(const basegfx::B2DPolygon &rPolygon, const attribute::SdrLineAttribute &rLine, const attribute::SdrLineStartEndAttribute &rStroke)
Primitive2DReference createTextPrimitive(const basegfx::B2DPolyPolygon &rUnitPolyPolygon, const basegfx::B2DHomMatrix &rObjectTransform, const attribute::SdrTextAttribute &rText, const attribute::SdrLineAttribute &rStroke, bool bCellText, bool bWordWrap)
#define PRIMITIVE2D_ID_SDRCONNECTORPRIMITIVE2D