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
20f9413f
Kaydet (Commit)
20f9413f
authored
Kas 25, 2013
tarafından
Jan Holesovsky
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
EMF+: Parse custom line cap data for start and end line caps.
Change-Id: I3a5f79e22500f53c3c61c173e0827c250b2a8fd0
üst
172acd5b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
110 additions
and
20 deletions
+110
-20
emfplus.cxx
cppcanvas/source/mtfrenderer/emfplus.cxx
+110
-20
No files found.
cppcanvas/source/mtfrenderer/emfplus.cxx
Dosyayı görüntüle @
20f9413f
...
@@ -97,6 +97,12 @@ const sal_Int32 EmfPlusLineStyleDashDot = 0x00000003;
...
@@ -97,6 +97,12 @@ const sal_Int32 EmfPlusLineStyleDashDot = 0x00000003;
const
sal_Int32
EmfPlusLineStyleDashDotDot
=
0x00000004
;
const
sal_Int32
EmfPlusLineStyleDashDotDot
=
0x00000004
;
const
sal_Int32
EmfPlusLineStyleCustom
=
0x00000005
;
const
sal_Int32
EmfPlusLineStyleCustom
=
0x00000005
;
const
sal_uInt32
EmfPlusCustomLineCapDataTypeDefault
=
0x00000000
;
const
sal_uInt32
EmfPlusCustomLineCapDataTypeAdjustableArrow
=
0x00000001
;
const
sal_uInt32
EmfPlusCustomLineCapDataFillPath
=
0x00000001
;
const
sal_uInt32
EmfPlusCustomLineCapDataLinePath
=
0x00000002
;
using
namespace
::
com
::
sun
::
star
;
using
namespace
::
com
::
sun
::
star
;
using
namespace
::
basegfx
;
using
namespace
::
basegfx
;
...
@@ -588,6 +594,94 @@ namespace cppcanvas
...
@@ -588,6 +594,94 @@ namespace cppcanvas
}
}
};
};
struct
EMFPCustomLineCap
:
public
EMFPObject
{
sal_uInt32
type
;
public
:
EMFPCustomLineCap
()
:
EMFPObject
()
{
}
~
EMFPCustomLineCap
()
{
}
void
Read
(
SvStream
&
s
,
ImplRenderer
&
rR
)
{
sal_uInt32
header
;
s
>>
header
>>
type
;
SAL_INFO
(
"cppcanvas.emf"
,
"EMF+
\t\t
custom cap"
);
SAL_INFO
(
"cppcanvas.emf"
,
"EMF+
\t\t
header: 0x"
<<
std
::
hex
<<
header
<<
" type: "
<<
type
<<
std
::
dec
);
if
(
type
==
EmfPlusCustomLineCapDataTypeDefault
)
{
sal_Int32
customLineCapDataFlags
,
baseCap
,
baseInset
;
sal_Int32
strokeStartCap
,
strokeEndCap
,
strokeJoin
;
sal_Int32
strokeMiterLimit
,
widthScale
;
float
fillHotSpotX
,
fillHotSpotY
,
strokeHotSpotX
,
strokeHotSpotY
;
s
>>
customLineCapDataFlags
>>
baseCap
>>
baseInset
>>
strokeStartCap
>>
strokeEndCap
>>
strokeJoin
>>
strokeMiterLimit
>>
widthScale
>>
fillHotSpotX
>>
fillHotSpotY
>>
strokeHotSpotX
>>
strokeHotSpotY
;
SAL_INFO
(
"cppcanvas.emf"
,
"EMF+
\t\t
customLinCapDataFlags: 0x"
<<
std
::
hex
<<
customLineCapDataFlags
);
if
(
customLineCapDataFlags
&
EmfPlusCustomLineCapDataFillPath
)
{
sal_Int32
pathLength
;
s
>>
pathLength
;
SAL_INFO
(
"cppcanvas.emf"
,
"EMF+
\t\t
path length: "
<<
pathLength
);
sal_uInt32
pathHeader
;
sal_Int32
pathPoints
,
pathFlags
;
s
>>
pathHeader
>>
pathPoints
>>
pathFlags
;
SAL_INFO
(
"cppcanvas.emf"
,
"EMF+
\t\t
path (custom cap fill path)"
);
SAL_INFO
(
"cppcanvas.emf"
,
"EMF+
\t\t
header: 0x"
<<
std
::
hex
<<
pathHeader
<<
" points: "
<<
std
::
dec
<<
pathPoints
<<
" additional flags: 0x"
<<
std
::
hex
<<
pathFlags
<<
std
::
dec
);
EMFPPath
path
(
pathPoints
);
path
.
Read
(
s
,
pathFlags
,
rR
);
}
if
(
customLineCapDataFlags
&
EmfPlusCustomLineCapDataLinePath
)
{
sal_Int32
pathLength
;
s
>>
pathLength
;
SAL_INFO
(
"cppcanvas.emf"
,
"EMF+
\t\t
path length: "
<<
pathLength
);
sal_uInt32
pathHeader
;
sal_Int32
pathPoints
,
pathFlags
;
s
>>
pathHeader
>>
pathPoints
>>
pathFlags
;
SAL_INFO
(
"cppcanvas.emf"
,
"EMF+
\t\t
path (custom cap line path)"
);
SAL_INFO
(
"cppcanvas.emf"
,
"EMF+
\t\t
header: 0x"
<<
std
::
hex
<<
pathHeader
<<
" points: "
<<
std
::
dec
<<
pathPoints
<<
" additional flags: 0x"
<<
std
::
hex
<<
pathFlags
<<
std
::
dec
);
EMFPPath
path
(
pathPoints
);
path
.
Read
(
s
,
pathFlags
,
rR
);
}
}
else
if
(
type
==
EmfPlusCustomLineCapDataTypeAdjustableArrow
)
{
// TODO only reads the data, does not use them [I've had
// no test document to be able to implement it]
sal_Int32
width
,
height
,
middleInset
,
fillState
,
lineStartCap
;
sal_Int32
lineEndCap
,
lineJoin
,
lineMiterLimit
,
widthScale
;
float
fillHotSpotX
,
fillHotSpotY
,
lineHotSpotX
,
lineHotSpotY
;
s
>>
width
>>
height
>>
middleInset
>>
fillState
>>
lineStartCap
>>
lineEndCap
>>
lineJoin
>>
lineMiterLimit
>>
widthScale
>>
fillHotSpotX
>>
fillHotSpotY
>>
lineHotSpotX
>>
lineHotSpotY
;
SAL_INFO
(
"cppcanvas.emf"
,
"EMF+
\t\t
TODO - actually read EmfPlusCustomLineCapArrowData object (section 2.2.2.12)"
);
}
}
};
struct
EMFPPen
:
public
EMFPBrush
struct
EMFPPen
:
public
EMFPBrush
{
{
XForm
transformation
;
XForm
transformation
;
...
@@ -605,9 +699,9 @@ namespace cppcanvas
...
@@ -605,9 +699,9 @@ namespace cppcanvas
sal_Int32
compoundArrayLen
;
sal_Int32
compoundArrayLen
;
float
*
compoundArray
;
float
*
compoundArray
;
sal_Int32
customStartCapLen
;
sal_Int32
customStartCapLen
;
sal_uInt8
*
customStartCap
;
EMFPCustomLineCap
*
customStartCap
;
sal_Int32
customEndCapLen
;
sal_Int32
customEndCapLen
;
sal_uInt8
*
customEndCap
;
EMFPCustomLineCap
*
customEndCap
;
public
:
public
:
EMFPPen
()
:
EMFPBrush
()
EMFPPen
()
:
EMFPBrush
()
...
@@ -622,8 +716,8 @@ namespace cppcanvas
...
@@ -622,8 +716,8 @@ namespace cppcanvas
{
{
delete
[]
dashPattern
;
delete
[]
dashPattern
;
delete
[]
compoundArray
;
delete
[]
compoundArray
;
delete
[]
customStartCap
;
delete
customStartCap
;
delete
[]
customEndCap
;
delete
customEndCap
;
}
}
void
SetStrokeWidth
(
rendering
::
StrokeAttributes
&
rStrokeAttributes
,
ImplRenderer
&
rR
,
const
OutDevState
&
rState
)
void
SetStrokeWidth
(
rendering
::
StrokeAttributes
&
rStrokeAttributes
,
ImplRenderer
&
rR
,
const
OutDevState
&
rState
)
...
@@ -762,15 +856,13 @@ namespace cppcanvas
...
@@ -762,15 +856,13 @@ namespace cppcanvas
{
{
s
>>
customStartCapLen
;
s
>>
customStartCapLen
;
SAL_INFO
(
"cppcanvas.emf"
,
"EMF+
\t\t
customStartCapLen: "
<<
customStartCapLen
);
SAL_INFO
(
"cppcanvas.emf"
,
"EMF+
\t\t
customStartCapLen: "
<<
customStartCapLen
);
sal_uInt32
pos
=
s
.
Tell
();
if
(
customStartCapLen
<
0
)
customStartCap
=
new
EMFPCustomLineCap
();
customStartCapLen
=
0
;
customStartCap
->
Read
(
s
,
rR
);
customStartCap
=
new
sal_uInt8
[
customStartCapLen
];
for
(
i
=
0
;
i
<
customStartCapLen
;
i
++
)
// maybe we don't read everything yet, play it safe ;-)
{
s
.
Seek
(
pos
+
customStartCapLen
);
s
>>
customStartCap
[
i
];
SAL_INFO
(
"cppcanvas.emf"
,
"EMF+
\t\t\t
customStartCap["
<<
i
<<
"]: 0x"
<<
std
::
hex
<<
int
(
customStartCap
[
i
]));
}
}
}
else
else
customStartCapLen
=
0
;
customStartCapLen
=
0
;
...
@@ -779,15 +871,13 @@ namespace cppcanvas
...
@@ -779,15 +871,13 @@ namespace cppcanvas
{
{
s
>>
customEndCapLen
;
s
>>
customEndCapLen
;
SAL_INFO
(
"cppcanvas.emf"
,
"EMF+
\t\t
customEndCapLen: "
<<
customEndCapLen
);
SAL_INFO
(
"cppcanvas.emf"
,
"EMF+
\t\t
customEndCapLen: "
<<
customEndCapLen
);
sal_uInt32
pos
=
s
.
Tell
();
if
(
customEndCapLen
<
0
)
customEndCap
=
new
EMFPCustomLineCap
();
customEndCapLen
=
0
;
customEndCap
->
Read
(
s
,
rR
);
customEndCap
=
new
sal_uInt8
[
customEndCapLen
];
for
(
i
=
0
;
i
<
customEndCapLen
;
i
++
)
// maybe we don't read everything yet, play it safe ;-)
{
s
.
Seek
(
pos
+
customEndCapLen
);
s
>>
customEndCap
[
i
];
SAL_INFO
(
"cppcanvas.emf"
,
"EMF+
\t\t\t
customEndCap["
<<
i
<<
"]: 0x"
<<
std
::
hex
<<
int
(
customEndCap
[
i
]));
}
}
}
else
else
customEndCapLen
=
0
;
customEndCapLen
=
0
;
...
...
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