1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
21 #include <sdr/attribute/sdreffectstextattribute.hxx>
25 namespace drawinglayer::attribute
27 SdrEffectsTextAttribute::SdrEffectsTextAttribute(
28 SdrShadowAttribute aShadow
,
29 SdrTextAttribute aTextAttribute
,
30 SdrGlowAttribute aGlow
,
31 SdrGlowTextAttribute aGlowText
,
32 sal_Int32 nSoftEdgeRadius
)
33 : maShadow(std::move(aShadow
)),
34 maTextAttribute(std::move(aTextAttribute
)),
35 maGlow(std::move(aGlow
)),
36 maGlowText(std::move(aGlowText
)),
37 mnSoftEdgeRadius(nSoftEdgeRadius
)
41 SdrEffectsTextAttribute::SdrEffectsTextAttribute()
45 SdrEffectsTextAttribute::SdrEffectsTextAttribute(const SdrEffectsTextAttribute
& rCandidate
)
46 : maShadow(rCandidate
.getShadow()),
47 maTextAttribute(rCandidate
.getText()),
48 maGlow(rCandidate
.maGlow
),
49 maGlowText(rCandidate
.maGlowText
),
50 mnSoftEdgeRadius(rCandidate
.mnSoftEdgeRadius
)
54 SdrEffectsTextAttribute
& SdrEffectsTextAttribute::operator=(const SdrEffectsTextAttribute
& rCandidate
)
56 maShadow
= rCandidate
.getShadow();
57 maTextAttribute
= rCandidate
.getText();
58 maGlow
= rCandidate
.maGlow
;
59 maGlowText
= rCandidate
.maGlowText
;
60 mnSoftEdgeRadius
= rCandidate
.mnSoftEdgeRadius
;
65 bool SdrEffectsTextAttribute::isDefault() const
67 return (getShadow().isDefault()
68 && getText().isDefault() && maGlow
.isDefault()
69 && maGlowText
.isDefault() && getSoftEdgeRadius() == 0);
72 bool SdrEffectsTextAttribute::operator==(const SdrEffectsTextAttribute
& rCandidate
) const
74 return (getShadow() == rCandidate
.getShadow()
75 && getText() == rCandidate
.getText()
76 && getGlow() == rCandidate
.getGlow()
77 && getGlowText() == rCandidate
.getGlowText()
78 && getSoftEdgeRadius() == rCandidate
.getSoftEdgeRadius());
83 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */