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
10cd5567
Kaydet (Commit)
10cd5567
authored
May 18, 2014
tarafından
Tomaž Vajngerl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
vcl wmf: EnhWMFReader more cleanup
Change-Id: Ia6bff28bc70214da965c26cd72ea332573576cc1
üst
e6c5c854
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
60 additions
and
48 deletions
+60
-48
enhwmf.cxx
vcl/source/filter/wmf/enhwmf.cxx
+60
-48
No files found.
vcl/source/filter/wmf/enhwmf.cxx
Dosyayı görüntüle @
10cd5567
...
...
@@ -158,36 +158,40 @@ namespace
#ifdef OSL_BIGENDIAN
// little endian <-> big endian switch
static
float
GetSwapFloat
(
SvStream
&
rSt
)
static
float
GetSwapFloat
(
SvStream
&
rStream
)
{
float
fTmp
;
float
fTmp
;
sal_Int8
*
pPtr
=
(
sal_Int8
*
)
&
fTmp
;
rSt
.
ReadSChar
(
pPtr
[
3
]
);
rSt
.
ReadSChar
(
pPtr
[
2
]
);
rSt
.
ReadSChar
(
pPtr
[
1
]
);
rSt
.
ReadSChar
(
pPtr
[
0
]
);
rSt
ream
.
ReadSChar
(
pPtr
[
3
]
);
rSt
ream
.
ReadSChar
(
pPtr
[
2
]
);
rSt
ream
.
ReadSChar
(
pPtr
[
1
]
);
rSt
ream
.
ReadSChar
(
pPtr
[
0
]
);
return
fTmp
;
}
#endif
struct
BLENDFUNCTION
{
struct
BLENDFUNCTION
{
unsigned
char
aBlendOperation
;
unsigned
char
aBlendFlags
;
unsigned
char
aSrcConstantAlpha
;
unsigned
char
aAlphaFormat
;
friend
SvStream
&
operator
>>
(
SvStream
&
rIn
,
BLENDFUNCTION
&
rBlendFun
);
friend
SvStream
&
operator
>>
(
SvStream
&
rInStream
,
BLENDFUNCTION
&
rBlendFun
);
};
SvStream
&
operator
>>
(
SvStream
&
rIn
,
BLENDFUNCTION
&
rBlendFun
)
SvStream
&
operator
>>
(
SvStream
&
rInStream
,
BLENDFUNCTION
&
rBlendFun
)
{
rIn
.
ReadUChar
(
rBlendFun
.
aBlendOperation
).
ReadUChar
(
rBlendFun
.
aBlendFlags
).
ReadUChar
(
rBlendFun
.
aSrcConstantAlpha
).
ReadUChar
(
rBlendFun
.
aAlphaFormat
);
return
rIn
;
rInStream
.
ReadUChar
(
rBlendFun
.
aBlendOperation
);
rInStream
.
ReadUChar
(
rBlendFun
.
aBlendFlags
);
rInStream
.
ReadUChar
(
rBlendFun
.
aSrcConstantAlpha
);
rInStream
.
ReadUChar
(
rBlendFun
.
aAlphaFormat
);
return
rInStream
;
}
SvStream
&
operator
>>
(
SvStream
&
rIn
,
XForm
&
rXForm
)
SvStream
&
operator
>>
(
SvStream
&
rInStream
,
XForm
&
rXForm
)
{
if
(
sizeof
(
float
)
!=
4
)
if
(
sizeof
(
float
)
!=
4
)
{
OSL_FAIL
(
"EnhWMFReader::sizeof( float ) != 4"
);
rXForm
=
XForm
();
...
...
@@ -195,51 +199,59 @@ SvStream& operator>>( SvStream& rIn, XForm& rXForm )
else
{
#ifdef OSL_BIGENDIAN
rXForm
.
eM11
=
GetSwapFloat
(
rIn
);
rXForm
.
eM12
=
GetSwapFloat
(
rIn
);
rXForm
.
eM21
=
GetSwapFloat
(
rIn
);
rXForm
.
eM22
=
GetSwapFloat
(
rIn
);
rXForm
.
eDx
=
GetSwapFloat
(
rIn
);
rXForm
.
eDy
=
GetSwapFloat
(
rIn
);
rXForm
.
eM11
=
GetSwapFloat
(
rInStream
);
rXForm
.
eM12
=
GetSwapFloat
(
rInStream
);
rXForm
.
eM21
=
GetSwapFloat
(
rInStream
);
rXForm
.
eM22
=
GetSwapFloat
(
rInStream
);
rXForm
.
eDx
=
GetSwapFloat
(
rInStream
);
rXForm
.
eDy
=
GetSwapFloat
(
rInStream
);
#else
rIn
.
ReadFloat
(
rXForm
.
eM11
).
ReadFloat
(
rXForm
.
eM12
).
ReadFloat
(
rXForm
.
eM21
).
ReadFloat
(
rXForm
.
eM22
)
.
ReadFloat
(
rXForm
.
eDx
).
ReadFloat
(
rXForm
.
eDy
);
rInStream
.
ReadFloat
(
rXForm
.
eM11
);
rInStream
.
ReadFloat
(
rXForm
.
eM12
);
rInStream
.
ReadFloat
(
rXForm
.
eM21
);
rInStream
.
ReadFloat
(
rXForm
.
eM22
);
rInStream
.
ReadFloat
(
rXForm
.
eDx
);
rInStream
.
ReadFloat
(
rXForm
.
eDy
);
#endif
}
return
rIn
;
return
rIn
Stream
;
}
static
bool
ImplReadRegion
(
PolyPolygon
&
rPolyPoly
,
SvStream
&
rSt
,
sal_uInt32
nLen
)
static
bool
ImplReadRegion
(
PolyPolygon
&
rPolyPoly
,
SvStream
&
rSt
ream
,
sal_uInt32
nLen
)
{
bool
bOk
=
false
;
if
(
nLen
)
if
(
nLen
==
0
)
return
false
;
sal_uInt32
nHdSize
,
nType
,
nCount
,
nRgnSize
,
i
;
rStream
.
ReadUInt32
(
nHdSize
);
rStream
.
ReadUInt32
(
nType
);
rStream
.
ReadUInt32
(
nCount
);
rStream
.
ReadUInt32
(
nRgnSize
);
if
(
nCount
>
0
&&
nType
==
RDH_RECTANGLES
&&
nLen
>=
((
nCount
<<
4
)
+
(
nHdSize
-
16
)))
{
sal_uInt32
nHdSize
,
nType
,
nCount
,
nRgnSize
,
i
;
rSt
.
ReadUInt32
(
nHdSize
)
.
ReadUInt32
(
nType
)
.
ReadUInt32
(
nCount
)
.
ReadUInt32
(
nRgnSize
);
if
(
nCount
&&
(
nType
==
RDH_RECTANGLES
)
&&
(
nLen
>=
(
(
nCount
<<
4
)
+
(
nHdSize
-
16
)
)
)
)
{
sal_Int32
nx1
,
ny1
,
nx2
,
ny2
;
sal_Int32
nx1
,
ny1
,
nx2
,
ny2
;
for
(
i
=
0
;
i
<
nCount
;
i
++
)
{
rSt
.
ReadInt32
(
nx1
).
ReadInt32
(
ny1
).
ReadInt32
(
nx2
).
ReadInt32
(
ny2
);
Rectangle
aRect
(
Point
(
nx1
,
ny1
),
Point
(
nx2
,
ny2
)
);
Polygon
aPolygon
(
aRect
);
PolyPolygon
aPolyPolyOr1
(
aPolygon
);
PolyPolygon
aPolyPolyOr2
(
rPolyPoly
);
rPolyPoly
.
GetUnion
(
aPolyPolyOr1
,
aPolyPolyOr2
);
rPolyPoly
=
aPolyPolyOr2
;
}
bOk
=
true
;
for
(
i
=
0
;
i
<
nCount
;
i
++
)
{
rStream
.
ReadInt32
(
nx1
);
rStream
.
ReadInt32
(
ny1
);
rStream
.
ReadInt32
(
nx2
);
rStream
.
ReadInt32
(
ny2
);
Rectangle
aRectangle
(
Point
(
nx1
,
ny1
),
Point
(
nx2
,
ny2
));
Polygon
aPolygon
(
aRectangle
);
PolyPolygon
aPolyPolyOr1
(
aPolygon
);
PolyPolygon
aPolyPolyOr2
(
rPolyPoly
);
rPolyPoly
.
GetUnion
(
aPolyPolyOr1
,
aPolyPolyOr2
);
rPolyPoly
=
aPolyPolyOr2
;
}
return
true
;
}
return
bOk
;
return
false
;
}
}
// anonymous namespace
...
...
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