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
6f2db2c1
Kaydet (Commit)
6f2db2c1
authored
Ock 16, 2018
tarafından
Noel Grandin
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
loplugin:useuniqueptr in EMFPBrush
Change-Id: I17fc33cfd7c15734fd961fa76c676424900a4373
üst
96c85e7d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
36 deletions
+17
-36
emfpbrush.cxx
cppcanvas/source/mtfrenderer/emfpbrush.cxx
+12
-31
emfpbrush.hxx
cppcanvas/source/mtfrenderer/emfpbrush.hxx
+5
-5
No files found.
cppcanvas/source/mtfrenderer/emfpbrush.cxx
Dosyayı görüntüle @
6f2db2c1
...
...
@@ -67,26 +67,7 @@ namespace cppcanvas
EMFPBrush
::~
EMFPBrush
()
{
if
(
blendPositions
!=
nullptr
)
{
delete
[]
blendPositions
;
blendPositions
=
nullptr
;
}
if
(
colorblendPositions
!=
nullptr
)
{
delete
[]
colorblendPositions
;
colorblendPositions
=
nullptr
;
}
if
(
colorblendColors
!=
nullptr
)
{
delete
[]
colorblendColors
;
colorblendColors
=
nullptr
;
}
if
(
surroundColors
!=
nullptr
)
{
delete
[]
surroundColors
;
surroundColors
=
nullptr
;
}
if
(
path
)
{
delete
path
;
path
=
nullptr
;
}
path
.
reset
();
}
void
EMFPBrush
::
Read
(
SvStream
&
s
,
ImplRenderer
const
&
rR
)
...
...
@@ -149,7 +130,7 @@ namespace cppcanvas
if
(
surroundColorsNumber
<
0
||
sal_uInt32
(
surroundColorsNumber
)
>
SAL_MAX_INT32
/
sizeof
(
::
Color
))
surroundColorsNumber
=
SAL_MAX_INT32
/
sizeof
(
::
Color
);
surroundColors
=
new
::
Color
[
surroundColorsNumber
]
;
surroundColors
.
reset
(
new
::
Color
[
surroundColorsNumber
]
)
;
for
(
int
i
=
0
;
i
<
surroundColorsNumber
;
i
++
)
{
s
.
ReadUInt32
(
color
);
surroundColors
[
i
]
=
::
Color
(
0xff
-
(
color
>>
24
),
(
color
>>
16
)
&
0xff
,
(
color
>>
8
)
&
0xff
,
color
&
0xff
);
...
...
@@ -173,7 +154,7 @@ namespace cppcanvas
SAL_INFO
(
"cppcanvas.emf"
,
"EMF+
\t
path (brush path gradient)"
);
SAL_INFO
(
"cppcanvas.emf"
,
"EMF+
\t
header: 0x"
<<
std
::
hex
<<
pathHeader
<<
" points: "
<<
std
::
dec
<<
pathPoints
<<
" additional flags: 0x"
<<
std
::
hex
<<
pathFlags
<<
std
::
dec
);
path
=
new
EMFPPath
(
pathPoints
);
path
.
reset
(
new
EMFPPath
(
pathPoints
)
);
path
->
Read
(
s
,
pathFlags
,
rR
);
s
.
Seek
(
pos
+
pathLength
);
...
...
@@ -190,7 +171,7 @@ namespace cppcanvas
sal_uInt64
const
pos
=
s
.
Tell
();
SAL_INFO
(
"cppcanvas.emf"
,
"EMF+
\t
use boundary, points: "
<<
boundaryPointCount
);
path
=
new
EMFPPath
(
boundaryPointCount
);
path
.
reset
(
new
EMFPPath
(
boundaryPointCount
)
);
path
->
Read
(
s
,
0x0
,
rR
);
s
.
Seek
(
pos
+
8
*
boundaryPointCount
);
...
...
@@ -216,8 +197,8 @@ namespace cppcanvas
SAL_INFO
(
"cppcanvas.emf"
,
"EMF+
\t
use blend, points: "
<<
blendPoints
);
if
(
blendPoints
<
0
||
sal_uInt32
(
blendPoints
)
>
SAL_MAX_INT32
/
(
2
*
sizeof
(
float
)))
blendPoints
=
SAL_MAX_INT32
/
(
2
*
sizeof
(
float
));
blendPositions
=
new
float
[
2
*
blendPoints
]
;
blendFactors
=
blendPositions
+
blendPoints
;
blendPositions
.
reset
(
new
float
[
2
*
blendPoints
]
)
;
blendFactors
=
blendPositions
.
get
()
+
blendPoints
;
for
(
int
i
=
0
;
i
<
blendPoints
;
i
++
)
{
s
.
ReadFloat
(
blendPositions
[
i
]);
SAL_INFO
(
"cppcanvas.emf"
,
"EMF+
\t
position["
<<
i
<<
"]: "
<<
blendPositions
[
i
]);
...
...
@@ -235,8 +216,8 @@ namespace cppcanvas
colorblendPoints
=
SAL_MAX_INT32
/
sizeof
(
float
);
if
(
sal_uInt32
(
colorblendPoints
)
>
SAL_MAX_INT32
/
sizeof
(
::
Color
))
colorblendPoints
=
SAL_MAX_INT32
/
sizeof
(
::
Color
);
colorblendPositions
=
new
float
[
colorblendPoints
]
;
colorblendColors
=
new
::
Color
[
colorblendPoints
]
;
colorblendPositions
.
reset
(
new
float
[
colorblendPoints
]
)
;
colorblendColors
.
reset
(
new
::
Color
[
colorblendPoints
]
)
;
for
(
int
i
=
0
;
i
<
colorblendPoints
;
i
++
)
{
s
.
ReadFloat
(
colorblendPositions
[
i
]);
SAL_INFO
(
"cppcanvas.emf"
,
"EMF+
\t
position["
<<
i
<<
"]: "
<<
colorblendPositions
[
i
]);
...
...
@@ -288,8 +269,8 @@ namespace cppcanvas
SAL_INFO
(
"cppcanvas.emf"
,
"EMF+
\t
use blend, points: "
<<
blendPoints
);
if
(
blendPoints
<
0
||
sal_uInt32
(
blendPoints
)
>
SAL_MAX_INT32
/
(
2
*
sizeof
(
float
)))
blendPoints
=
SAL_MAX_INT32
/
(
2
*
sizeof
(
float
));
blendPositions
=
new
float
[
2
*
blendPoints
]
;
blendFactors
=
blendPositions
+
blendPoints
;
blendPositions
.
reset
(
new
float
[
2
*
blendPoints
]
)
;
blendFactors
=
blendPositions
.
get
()
+
blendPoints
;
for
(
int
i
=
0
;
i
<
blendPoints
;
i
++
)
{
s
.
ReadFloat
(
blendPositions
[
i
]);
SAL_INFO
(
"cppcanvas.emf"
,
"EMF+
\t
position["
<<
i
<<
"]: "
<<
blendPositions
[
i
]);
...
...
@@ -307,8 +288,8 @@ namespace cppcanvas
colorblendPoints
=
SAL_MAX_INT32
/
sizeof
(
float
);
if
(
sal_uInt32
(
colorblendPoints
)
>
SAL_MAX_INT32
/
sizeof
(
::
Color
))
colorblendPoints
=
sal_uInt32
(
SAL_MAX_INT32
)
/
sizeof
(
::
Color
);
colorblendPositions
=
new
float
[
colorblendPoints
]
;
colorblendColors
=
new
::
Color
[
colorblendPoints
]
;
colorblendPositions
.
reset
(
new
float
[
colorblendPoints
]
)
;
colorblendColors
.
reset
(
new
::
Color
[
colorblendPoints
]
)
;
for
(
int
i
=
0
;
i
<
colorblendPoints
;
i
++
)
{
s
.
ReadFloat
(
colorblendPositions
[
i
]);
SAL_INFO
(
"cppcanvas.emf"
,
"EMF+
\t
position["
<<
i
<<
"]: "
<<
colorblendPositions
[
i
]);
...
...
cppcanvas/source/mtfrenderer/emfpbrush.hxx
Dosyayı görüntüle @
6f2db2c1
...
...
@@ -105,14 +105,14 @@ namespace cppcanvas
XForm
brush_transformation
;
bool
hasTransformation
;
sal_Int32
blendPoints
;
float
*
blendPositions
;
std
::
unique_ptr
<
float
[]
>
blendPositions
;
float
*
blendFactors
;
sal_Int32
colorblendPoints
;
float
*
colorblendPositions
;
::
Color
*
colorblendColors
;
std
::
unique_ptr
<
float
[]
>
colorblendPositions
;
std
::
unique_ptr
<::
Color
[]
>
colorblendColors
;
sal_Int32
surroundColorsNumber
;
::
Color
*
surroundColors
;
EMFPPath
*
path
;
std
::
unique_ptr
<::
Color
[]
>
surroundColors
;
std
::
unique_ptr
<
EMFPPath
>
path
;
EmfPlusHatchStyle
hatchStyle
;
EMFPBrush
();
...
...
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