Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
6a42657f
Kaydet (Commit)
6a42657f
authored
May 24, 2015
tarafından
Thorsten Behrens
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
tdf#62525: use cow_wrapper for SdrFormTextAttribute
Change-Id: I0fd55ea6c775d771e001c0db78bb72c50e9b81cf
üst
551c2047
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
60 deletions
+20
-60
sdrformtextattribute.hxx
include/svx/sdr/attribute/sdrformtextattribute.hxx
+5
-2
sdrformtextattribute.cxx
svx/source/sdr/attribute/sdrformtextattribute.cxx
+15
-58
No files found.
include/svx/sdr/attribute/sdrformtextattribute.hxx
Dosyayı görüntüle @
6a42657f
...
...
@@ -23,7 +23,7 @@
#include <sal/types.h>
#include <svx/xenum.hxx>
#include <tools/color.hxx>
#include <o3tl/cow_wrapper.hxx>
// predefines
...
...
@@ -42,8 +42,11 @@ namespace drawinglayer
{
class
SdrFormTextAttribute
{
public
:
typedef
o3tl
::
cow_wrapper
<
ImpSdrFormTextAttribute
>
ImplType
;
private
:
Imp
SdrFormTextAttribute
*
mpSdrFormTextAttribute
;
Imp
lType
mpSdrFormTextAttribute
;
public
:
/// constructors/assignmentoperator/destructor
...
...
svx/source/sdr/attribute/sdrformtextattribute.cxx
Dosyayı görüntüle @
6a42657f
...
...
@@ -45,6 +45,7 @@
#include <sdr/attribute/sdrformtextoutlineattribute.hxx>
#include <com/sun/star/drawing/LineCap.hpp>
#include <com/sun/star/drawing/LineStyle.hpp>
#include <rtl/instance.hxx>
// helper to get line, stroke and transparence attributes from SfxItemSet
...
...
@@ -150,9 +151,6 @@ namespace drawinglayer
class
ImpSdrFormTextAttribute
{
public
:
// refcounter
sal_uInt32
mnRefCount
;
// FormText (FontWork) Attributes
sal_Int32
mnFormTextDistance
;
// distance from line in upright direction
sal_Int32
mnFormTextStart
;
// shift from polygon start
...
...
@@ -174,8 +172,7 @@ namespace drawinglayer
bool
mbFormTextOutline
:
1
;
// show contour of objects
explicit
ImpSdrFormTextAttribute
(
const
SfxItemSet
&
rSet
)
:
mnRefCount
(
0
),
mnFormTextDistance
(
static_cast
<
const
XFormTextDistanceItem
&>
(
rSet
.
Get
(
XATTR_FORMTXTDISTANCE
)).
GetValue
()),
:
mnFormTextDistance
(
static_cast
<
const
XFormTextDistanceItem
&>
(
rSet
.
Get
(
XATTR_FORMTXTDISTANCE
)).
GetValue
()),
mnFormTextStart
(
static_cast
<
const
XFormTextStartItem
&>
(
rSet
.
Get
(
XATTR_FORMTXTSTART
)).
GetValue
()),
mnFormTextShdwXVal
(
static_cast
<
const
XFormTextShadowXValItem
&>
(
rSet
.
Get
(
XATTR_FORMTXTSHDWXVAL
)).
GetValue
()),
mnFormTextShdwYVal
(
static_cast
<
const
XFormTextShadowYValItem
&>
(
rSet
.
Get
(
XATTR_FORMTXTSHDWYVAL
)).
GetValue
()),
...
...
@@ -215,8 +212,7 @@ namespace drawinglayer
}
ImpSdrFormTextAttribute
()
:
mnRefCount
(
0
),
mnFormTextDistance
(
0
),
:
mnFormTextDistance
(
0
),
mnFormTextStart
(
0
),
mnFormTextShdwXVal
(
0
),
mnFormTextShdwYVal
(
0
),
...
...
@@ -264,90 +260,51 @@ namespace drawinglayer
&&
getFormTextMirror
()
==
rCandidate
.
getFormTextMirror
()
&&
getFormTextOutline
()
==
rCandidate
.
getFormTextOutline
());
}
static
ImpSdrFormTextAttribute
*
get_global_default
()
{
static
ImpSdrFormTextAttribute
*
pDefault
=
0
;
if
(
!
pDefault
)
{
pDefault
=
new
ImpSdrFormTextAttribute
();
// never delete; start with RefCount 1, not 0
pDefault
->
mnRefCount
++
;
}
return
pDefault
;
}
};
namespace
{
struct
theGlobalDefault
:
public
rtl
::
Static
<
SdrFormTextAttribute
::
ImplType
,
theGlobalDefault
>
{};
}
SdrFormTextAttribute
::
SdrFormTextAttribute
(
const
SfxItemSet
&
rSet
)
:
mpSdrFormTextAttribute
(
new
ImpSdrFormTextAttribute
(
rSet
))
:
mpSdrFormTextAttribute
(
ImpSdrFormTextAttribute
(
rSet
))
{
}
SdrFormTextAttribute
::
SdrFormTextAttribute
()
:
mpSdrFormTextAttribute
(
ImpSdrFormTextAttribute
::
get_global_defaul
t
())
:
mpSdrFormTextAttribute
(
theGlobalDefault
::
ge
t
())
{
mpSdrFormTextAttribute
->
mnRefCount
++
;
}
SdrFormTextAttribute
::
SdrFormTextAttribute
(
const
SdrFormTextAttribute
&
rCandidate
)
:
mpSdrFormTextAttribute
(
rCandidate
.
mpSdrFormTextAttribute
)
{
mpSdrFormTextAttribute
->
mnRefCount
++
;
}
SdrFormTextAttribute
::~
SdrFormTextAttribute
()
{
if
(
mpSdrFormTextAttribute
->
mnRefCount
)
{
mpSdrFormTextAttribute
->
mnRefCount
--
;
}
else
{
delete
mpSdrFormTextAttribute
;
}
}
bool
SdrFormTextAttribute
::
isDefault
()
const
{
return
mpSdrFormTextAttribute
==
ImpSdrFormTextAttribute
::
get_global_default
(
);
return
mpSdrFormTextAttribute
.
same_object
(
theGlobalDefault
::
get
()
);
}
SdrFormTextAttribute
&
SdrFormTextAttribute
::
operator
=
(
const
SdrFormTextAttribute
&
rCandidate
)
{
if
(
rCandidate
.
mpSdrFormTextAttribute
!=
mpSdrFormTextAttribute
)
{
if
(
mpSdrFormTextAttribute
->
mnRefCount
)
{
mpSdrFormTextAttribute
->
mnRefCount
--
;
}
else
{
delete
mpSdrFormTextAttribute
;
}
mpSdrFormTextAttribute
=
rCandidate
.
mpSdrFormTextAttribute
;
mpSdrFormTextAttribute
->
mnRefCount
++
;
}
mpSdrFormTextAttribute
=
rCandidate
.
mpSdrFormTextAttribute
;
return
*
this
;
}
bool
SdrFormTextAttribute
::
operator
==
(
const
SdrFormTextAttribute
&
rCandidate
)
const
{
if
(
rCandidate
.
mpSdrFormTextAttribute
==
mpSdrFormTextAttribute
)
{
return
true
;
}
// tdf#87509 default attr is always != non-default attr, even with same values
if
(
rCandidate
.
isDefault
()
!=
isDefault
())
{
return
false
;
}
return
(
*
rCandidate
.
mpSdrFormTextAttribute
==
*
mpSdrFormTextAttribute
)
;
return
rCandidate
.
mpSdrFormTextAttribute
==
mpSdrFormTextAttribute
;
}
sal_Int32
SdrFormTextAttribute
::
getFormTextDistance
()
const
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment