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  : mnTransparence(0)
49  {
50  }
51 
52  // data read access
53  const LineAttribute& getLineAttribute() const { return maLineAttribute; }
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  {
68  struct theGlobalDefault :
69  public rtl::Static< SdrFormTextOutlineAttribute::ImplType, theGlobalDefault > {};
70  }
71 
73  const LineAttribute& rLineAttribute,
74  const StrokeAttribute& rStrokeAttribute,
75  sal_uInt8 nTransparence)
76  : mpSdrFormTextOutlineAttribute(
78  rLineAttribute, rStrokeAttribute, nTransparence))
79  {
80  }
81 
83  : mpSdrFormTextOutlineAttribute(theGlobalDefault::get())
84  {
85  }
86 
88  : mpSdrFormTextOutlineAttribute(rCandidate.mpSdrFormTextOutlineAttribute)
89  {
90  }
91 
93  {
94  }
95 
97  {
98  return mpSdrFormTextOutlineAttribute.same_object(theGlobalDefault::get());
99  }
100 
102  {
104  return *this;
105  }
106 
108  {
109  mpSdrFormTextOutlineAttribute = std::move(rCandidate.mpSdrFormTextOutlineAttribute);
110  return *this;
111  }
112 
114  {
115  // tdf#87509 default attr is always != non-default attr, even with same values
116  if(rCandidate.isDefault() != isDefault())
117  return false;
118 
120  }
121 
123  {
124  return mpSdrFormTextOutlineAttribute->getLineAttribute();
125  }
126 
128  {
129  return mpSdrFormTextOutlineAttribute->getStrokeAttribute();
130  }
131 
133  {
134  return mpSdrFormTextOutlineAttribute->getTransparence();
135  }
136 
137 } // end of namespace
138 
139 /* 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