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
1ea8c3a9
Kaydet (Commit)
1ea8c3a9
authored
Tem 27, 2012
tarafından
Armin Le Grand
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
#119450# Added EMR_ALPHABLEND case to EnhWMFReader to correct visualisations
Patch by: Jianyuan Li Review by: alg
üst
3909704e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
71 additions
and
1 deletion
+71
-1
enhwmf.cxx
svtools/source/filter/wmf/enhwmf.cxx
+71
-1
No files found.
svtools/source/filter/wmf/enhwmf.cxx
Dosyayı görüntüle @
1ea8c3a9
...
...
@@ -168,6 +168,21 @@ static float GetSwapFloat( SvStream& rSt )
}
#endif
struct
BLENDFUNCTION
{
unsigned
char
aBlendOperation
;
unsigned
char
aBlendFlags
;
unsigned
char
aSrcConstantAlpha
;
unsigned
char
aAlphaFormat
;
friend
SvStream
&
operator
>>
(
SvStream
&
rIn
,
BLENDFUNCTION
&
rBlendFun
);
};
SvStream
&
operator
>>
(
SvStream
&
rIn
,
BLENDFUNCTION
&
rBlendFun
)
{
rIn
>>
rBlendFun
.
aBlendOperation
>>
rBlendFun
.
aBlendFlags
>>
rBlendFun
.
aSrcConstantAlpha
>>
rBlendFun
.
aAlphaFormat
;
return
rIn
;
}
SvStream
&
operator
>>
(
SvStream
&
rIn
,
XForm
&
rXForm
)
{
if
(
sizeof
(
float
)
!=
4
)
...
...
@@ -805,7 +820,63 @@ sal_Bool EnhWMFReader::ReadEnhWMF()
pOut
->
SetClipPath
(
aPolyPoly
,
iMode
,
sal_False
);
}
break
;
case
EMR_ALPHABLEND
:
{
sal_Int32
xDest
,
yDest
,
cxDest
,
cyDest
;
BLENDFUNCTION
aFunc
;
sal_Int32
xSrc
,
ySrc
;
XForm
xformSrc
;
sal_uInt32
BkColorSrc
,
iUsageSrc
,
offBmiSrc
,
cbBmiSrc
,
offBitsSrc
,
cbBitsSrc
,
cxSrc
,
cySrc
;
sal_uInt32
nStart
=
pWMF
->
Tell
()
-
8
;
pWMF
->
SeekRel
(
0x10
);
*
pWMF
>>
xDest
>>
yDest
>>
cxDest
>>
cyDest
>>
aFunc
>>
xSrc
>>
ySrc
>>
xformSrc
>>
BkColorSrc
>>
iUsageSrc
>>
offBmiSrc
>>
cbBmiSrc
>>
offBitsSrc
>>
cbBitsSrc
>>
cxSrc
>>
cySrc
;
sal_uInt32
dwRop
=
SRCAND
|
SRCINVERT
;
Bitmap
aBitmap
;
Rectangle
aRect
(
Point
(
xDest
,
yDest
),
Size
(
cxDest
+
1
,
cyDest
+
1
)
);
if
(
(
cbBitsSrc
>
(
SAL_MAX_UINT32
-
14
))
||
((
SAL_MAX_UINT32
-
14
)
-
cbBitsSrc
<
cbBmiSrc
)
)
bStatus
=
sal_False
;
else
{
sal_uInt32
nSize
=
cbBmiSrc
+
cbBitsSrc
+
14
;
if
(
nSize
<=
(
nEndPos
-
nStartPos
)
)
{
char
*
pBuf
=
new
char
[
nSize
];
SvMemoryStream
aTmp
(
pBuf
,
nSize
,
STREAM_READ
|
STREAM_WRITE
);
aTmp
.
ObjectOwnsMemory
(
sal_True
);
aTmp
<<
(
sal_uInt8
)
'B'
<<
(
sal_uInt8
)
'M'
<<
(
sal_uInt32
)
cbBitsSrc
<<
(
sal_uInt16
)
0
<<
(
sal_uInt16
)
0
<<
(
sal_uInt32
)
cbBmiSrc
+
14
;
pWMF
->
Seek
(
nStart
+
offBmiSrc
);
pWMF
->
Read
(
pBuf
+
14
,
cbBmiSrc
);
pWMF
->
Seek
(
nStart
+
offBitsSrc
);
pWMF
->
Read
(
pBuf
+
14
+
cbBmiSrc
,
cbBitsSrc
);
aTmp
.
Seek
(
0
);
aBitmap
.
Read
(
aTmp
,
sal_True
);
// test if it is sensible to crop
if
(
(
cxSrc
>
0
)
&&
(
cySrc
>
0
)
&&
(
xSrc
>=
0
)
&&
(
ySrc
>=
0
)
&&
(
xSrc
+
cxSrc
<=
aBitmap
.
GetSizePixel
().
Width
()
)
&&
(
ySrc
+
cySrc
<=
aBitmap
.
GetSizePixel
().
Height
()
)
)
{
Rectangle
aCropRect
(
Point
(
xSrc
,
ySrc
),
Size
(
cxSrc
,
cySrc
)
);
aBitmap
.
Crop
(
aCropRect
);
}
aBmpSaveList
.
Insert
(
new
BSaveStruct
(
aBitmap
,
aRect
,
dwRop
),
LIST_APPEND
);
}
}
}
break
;
case
EMR_BITBLT
:
// PASSTHROUGH INTENDED
case
EMR_STRETCHBLT
:
{
...
...
@@ -1225,7 +1296,6 @@ sal_Bool EnhWMFReader::ReadEnhWMF()
case
EMR_COLORCORRECTPALETTE
:
WinMtfAssertHandler
(
"ColorCorrectPalette"
);
break
;
case
EMR_SETICMPROFILEA
:
WinMtfAssertHandler
(
"SetICMProfileA"
);
break
;
case
EMR_SETICMPROFILEW
:
WinMtfAssertHandler
(
"SetICMProfileW"
);
break
;
case
EMR_ALPHABLEND
:
WinMtfAssertHandler
(
"Alphablend"
);
break
;
case
EMR_TRANSPARENTBLT
:
WinMtfAssertHandler
(
"TransparenBlt"
);
break
;
case
EMR_TRANSPARENTDIB
:
WinMtfAssertHandler
(
"TransparenDib"
);
break
;
case
EMR_GRADIENTFILL
:
WinMtfAssertHandler
(
"GradientFill"
);
break
;
...
...
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