LibreOffice Module svx (master) 1
sdrformtextoutlineattribute.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
20
24#include <utility>
25
26
28{
30 {
31 public:
32 // one set of attributes for FormText (FontWork) outline visualisation
36
38 const LineAttribute& rLineAttribute,
39 StrokeAttribute aStrokeAttribute,
40 sal_uInt8 nTransparence)
41 : maLineAttribute(rLineAttribute),
42 maStrokeAttribute(std::move(aStrokeAttribute)),
43 mnTransparence(nTransparence)
44 {
45 }
46
49 {
50 }
51
52 // data read access
56
57 // compare operator
58 bool operator==(const ImpSdrFormTextOutlineAttribute& rCandidate) const
59 {
60 return (getLineAttribute() == rCandidate.getLineAttribute()
61 && getStrokeAttribute() == rCandidate.getStrokeAttribute()
62 && getTransparence() == rCandidate.getTransparence());
63 }
64 };
65
66 namespace
67 {
69 {
71 return SINGLETON;
72 }
73 }
74
76 const LineAttribute& rLineAttribute,
77 const StrokeAttribute& rStrokeAttribute,
78 sal_uInt8 nTransparence)
79 : mpSdrFormTextOutlineAttribute(
81 rLineAttribute, rStrokeAttribute, nTransparence))
82 {
83 }
84
86 : mpSdrFormTextOutlineAttribute(theGlobalDefault())
87 {
88 }
89
91 : mpSdrFormTextOutlineAttribute(rCandidate.mpSdrFormTextOutlineAttribute)
92 {
93 }
94
96 {
97 }
98
100 {
101 return mpSdrFormTextOutlineAttribute.same_object(theGlobalDefault());
102 }
103
105 {
107 return *this;
108 }
109
111 {
112 mpSdrFormTextOutlineAttribute = std::move(rCandidate.mpSdrFormTextOutlineAttribute);
113 return *this;
114 }
115
117 {
118 // tdf#87509 default attr is always != non-default attr, even with same values
119 if(rCandidate.isDefault() != isDefault())
120 return false;
121
123 }
124
126 {
127 return mpSdrFormTextOutlineAttribute->getLineAttribute();
128 }
129
131 {
132 return mpSdrFormTextOutlineAttribute->getStrokeAttribute();
133 }
134
136 {
137 return mpSdrFormTextOutlineAttribute->getTransparence();
138 }
139
140} // end of namespace
141
142/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
ImpSdrFormTextOutlineAttribute(const LineAttribute &rLineAttribute, StrokeAttribute aStrokeAttribute, sal_uInt8 nTransparence)
bool operator==(const ImpSdrFormTextOutlineAttribute &rCandidate) const
o3tl::cow_wrapper< ImpSdrFormTextOutlineAttribute > ImplType
bool operator==(const SdrFormTextOutlineAttribute &rCandidate) const
SdrFormTextOutlineAttribute & operator=(const SdrFormTextOutlineAttribute &rCandidate)
bool same_object(const cow_wrapper &rOther) const
unsigned char sal_uInt8