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
27e1a92d
Kaydet (Commit)
27e1a92d
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 SdrFormTextOutlineAttribute
Change-Id: I7f75833bfec2cde140ded1dfe60aed2684905b0a
üst
6a42657f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
63 deletions
+28
-63
sdrformtextoutlineattribute.hxx
svx/inc/sdr/attribute/sdrformtextoutlineattribute.hxx
+5
-2
sdrformtextoutlineattribute.cxx
svx/source/sdr/attribute/sdrformtextoutlineattribute.cxx
+23
-61
No files found.
svx/inc/sdr/attribute/sdrformtextoutlineattribute.hxx
Dosyayı görüntüle @
27e1a92d
...
...
@@ -21,7 +21,7 @@
#define INCLUDED_SVX_INC_SDR_ATTRIBUTE_SDRFORMTEXTOUTLINEATTRIBUTE_HXX
#include <sal/types.h>
#include <o3tl/cow_wrapper.hxx>
// predefines
...
...
@@ -39,8 +39,11 @@ namespace drawinglayer
{
class
SdrFormTextOutlineAttribute
{
public
:
typedef
o3tl
::
cow_wrapper
<
ImpSdrFormTextOutlineAttribute
>
ImplType
;
private
:
Imp
SdrFormTextOutlineAttribute
*
mpSdrFormTextOutlineAttribute
;
Imp
lType
mpSdrFormTextOutlineAttribute
;
public
:
/// constructors/assignmentoperator/destructor
...
...
svx/source/sdr/attribute/sdrformtextoutlineattribute.cxx
Dosyayı görüntüle @
27e1a92d
...
...
@@ -21,7 +21,7 @@
#include <sdr/attribute/sdrformtextoutlineattribute.hxx>
#include <drawinglayer/attribute/lineattribute.hxx>
#include <drawinglayer/attribute/strokeattribute.hxx>
#include <rtl/instance.hxx>
namespace
drawinglayer
...
...
@@ -31,9 +31,6 @@ namespace drawinglayer
class
ImpSdrFormTextOutlineAttribute
{
public
:
// refcounter
sal_uInt32
mnRefCount
;
// one set of attributes for FormText (FontWork) outline visualisation
LineAttribute
maLineAttribute
;
StrokeAttribute
maStrokeAttribute
;
...
...
@@ -43,13 +40,19 @@ namespace drawinglayer
const
LineAttribute
&
rLineAttribute
,
const
StrokeAttribute
&
rStrokeAttribute
,
sal_uInt8
nTransparence
)
:
mnRefCount
(
0
),
maLineAttribute
(
rLineAttribute
),
:
maLineAttribute
(
rLineAttribute
),
maStrokeAttribute
(
rStrokeAttribute
),
mnTransparence
(
nTransparence
)
{
}
ImpSdrFormTextOutlineAttribute
()
:
maLineAttribute
(),
maStrokeAttribute
(),
mnTransparence
(
0
)
{
}
// data read access
const
LineAttribute
&
getLineAttribute
()
const
{
return
maLineAttribute
;
}
const
StrokeAttribute
&
getStrokeAttribute
()
const
{
return
maStrokeAttribute
;
}
...
...
@@ -62,97 +65,56 @@ namespace drawinglayer
&&
getStrokeAttribute
()
==
rCandidate
.
getStrokeAttribute
()
&&
getTransparence
()
==
rCandidate
.
getTransparence
());
}
static
ImpSdrFormTextOutlineAttribute
*
get_global_default
()
{
static
ImpSdrFormTextOutlineAttribute
*
pDefault
=
0
;
if
(
!
pDefault
)
{
pDefault
=
new
ImpSdrFormTextOutlineAttribute
(
LineAttribute
(),
StrokeAttribute
(),
0
);
// never delete; start with RefCount 1, not 0
pDefault
->
mnRefCount
++
;
}
return
pDefault
;
}
};
namespace
{
struct
theGlobalDefault
:
public
rtl
::
Static
<
SdrFormTextOutlineAttribute
::
ImplType
,
theGlobalDefault
>
{};
}
SdrFormTextOutlineAttribute
::
SdrFormTextOutlineAttribute
(
const
LineAttribute
&
rLineAttribute
,
const
StrokeAttribute
&
rStrokeAttribute
,
sal_uInt8
nTransparence
)
:
mpSdrFormTextOutlineAttribute
(
new
ImpSdrFormTextOutlineAttribute
(
rLineAttribute
,
rStrokeAttribute
,
nTransparence
))
:
mpSdrFormTextOutlineAttribute
(
ImpSdrFormTextOutlineAttribute
(
rLineAttribute
,
rStrokeAttribute
,
nTransparence
))
{
}
SdrFormTextOutlineAttribute
::
SdrFormTextOutlineAttribute
()
:
mpSdrFormTextOutlineAttribute
(
ImpSdrFormTextOutlineAttribute
::
get_global_defaul
t
())
:
mpSdrFormTextOutlineAttribute
(
theGlobalDefault
::
ge
t
())
{
mpSdrFormTextOutlineAttribute
->
mnRefCount
++
;
}
SdrFormTextOutlineAttribute
::
SdrFormTextOutlineAttribute
(
const
SdrFormTextOutlineAttribute
&
rCandidate
)
:
mpSdrFormTextOutlineAttribute
(
rCandidate
.
mpSdrFormTextOutlineAttribute
)
{
mpSdrFormTextOutlineAttribute
->
mnRefCount
++
;
}
SdrFormTextOutlineAttribute
::~
SdrFormTextOutlineAttribute
()
{
if
(
mpSdrFormTextOutlineAttribute
->
mnRefCount
)
{
mpSdrFormTextOutlineAttribute
->
mnRefCount
--
;
}
else
{
delete
mpSdrFormTextOutlineAttribute
;
}
}
bool
SdrFormTextOutlineAttribute
::
isDefault
()
const
{
return
mpSdrFormTextOutlineAttribute
==
ImpSdrFormTextOutlineAttribute
::
get_global_default
(
);
return
mpSdrFormTextOutlineAttribute
.
same_object
(
theGlobalDefault
::
get
()
);
}
SdrFormTextOutlineAttribute
&
SdrFormTextOutlineAttribute
::
operator
=
(
const
SdrFormTextOutlineAttribute
&
rCandidate
)
{
if
(
rCandidate
.
mpSdrFormTextOutlineAttribute
!=
mpSdrFormTextOutlineAttribute
)
{
if
(
mpSdrFormTextOutlineAttribute
->
mnRefCount
)
{
mpSdrFormTextOutlineAttribute
->
mnRefCount
--
;
}
else
{
delete
mpSdrFormTextOutlineAttribute
;
}
mpSdrFormTextOutlineAttribute
=
rCandidate
.
mpSdrFormTextOutlineAttribute
;
mpSdrFormTextOutlineAttribute
->
mnRefCount
++
;
}
mpSdrFormTextOutlineAttribute
=
rCandidate
.
mpSdrFormTextOutlineAttribute
;
return
*
this
;
}
bool
SdrFormTextOutlineAttribute
::
operator
==
(
const
SdrFormTextOutlineAttribute
&
rCandidate
)
const
{
if
(
rCandidate
.
mpSdrFormTextOutlineAttribute
==
mpSdrFormTextOutlineAttribute
)
{
return
true
;
}
// tdf#87509 default attr is always != non-default attr, even with same values
if
(
rCandidate
.
isDefault
()
!=
isDefault
())
{
return
false
;
}
return
(
*
rCandidate
.
mpSdrFormTextOutlineAttribute
==
*
mpSdrFormTextOutlineAttribute
)
;
return
rCandidate
.
mpSdrFormTextOutlineAttribute
==
mpSdrFormTextOutlineAttribute
;
}
const
LineAttribute
&
SdrFormTextOutlineAttribute
::
getLineAttribute
()
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