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 <rtl/instance.hxx>
25 
26 
28 {
30  {
31  public:
32  // one set of attributes for FormText (FontWork) outline visualisation
36 
38  const LineAttribute& rLineAttribute,
39  const StrokeAttribute& rStrokeAttribute,
40  sal_uInt8 nTransparence)
41  : maLineAttribute(rLineAttribute),
42  maStrokeAttribute(rStrokeAttribute),
43  mnTransparence(nTransparence)
44  {
45  }
46 
48  : maLineAttribute(),
49  maStrokeAttribute(),
50  mnTransparence(0)
51  {
52  }
53 
54  // data read access
55  const LineAttribute& getLineAttribute() const { return maLineAttribute; }
58 
59  // compare operator
60  bool operator==(const ImpSdrFormTextOutlineAttribute& rCandidate) const
61  {
62  return (getLineAttribute() == rCandidate.getLineAttribute()
63  && getStrokeAttribute() == rCandidate.getStrokeAttribute()
64  && getTransparence() == rCandidate.getTransparence());
65  }
66  };
67 
68  namespace
69  {
70  struct theGlobalDefault :
71  public rtl::Static< SdrFormTextOutlineAttribute::ImplType, theGlobalDefault > {};
72  }
73 
75  const LineAttribute& rLineAttribute,
76  const StrokeAttribute& rStrokeAttribute,
77  sal_uInt8 nTransparence)
78  : mpSdrFormTextOutlineAttribute(
80  rLineAttribute, rStrokeAttribute, nTransparence))
81  {
82  }
83 
85  : mpSdrFormTextOutlineAttribute(theGlobalDefault::get())
86  {
87  }
88 
90  : mpSdrFormTextOutlineAttribute(rCandidate.mpSdrFormTextOutlineAttribute)
91  {
92  }
93 
95  {
96  }
97 
99  {
100  return mpSdrFormTextOutlineAttribute.same_object(theGlobalDefault::get());
101  }
102 
104  {
106  return *this;
107  }
108 
110  {
111  mpSdrFormTextOutlineAttribute = std::move(rCandidate.mpSdrFormTextOutlineAttribute);
112  return *this;
113  }
114 
116  {
117  // tdf#87509 default attr is always != non-default attr, even with same values
118  if(rCandidate.isDefault() != isDefault())
119  return false;
120 
122  }
123 
125  {
126  return mpSdrFormTextOutlineAttribute->getLineAttribute();
127  }
128 
130  {
131  return mpSdrFormTextOutlineAttribute->getStrokeAttribute();
132  }
133 
135  {
136  return mpSdrFormTextOutlineAttribute->getTransparence();
137  }
138 
139 } // end of namespace
140 
141 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
ImpSdrFormTextOutlineAttribute(const LineAttribute &rLineAttribute, const StrokeAttribute &rStrokeAttribute, sal_uInt8 nTransparence)
bool same_object(const cow_wrapper &rOther) const
bool operator==(const SdrFormTextOutlineAttribute &rCandidate) const
unsigned char sal_uInt8
SdrFormTextOutlineAttribute & operator=(const SdrFormTextOutlineAttribute &rCandidate)
bool operator==(const ImpSdrFormTextOutlineAttribute &rCandidate) const