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
a2aceeb0
Kaydet (Commit)
a2aceeb0
authored
Ock 01, 2017
tarafından
Caolán McNamara
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
return earlier, no logic change intended
Change-Id: Icd75c46eb57c059fb60fd9701e6bb1fb651d8f3f
üst
b560dc89
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
71 additions
and
70 deletions
+71
-70
impgraph.cxx
vcl/source/gdi/impgraph.cxx
+71
-70
No files found.
vcl/source/gdi/impgraph.cxx
Dosyayı görüntüle @
a2aceeb0
...
...
@@ -1520,86 +1520,87 @@ void ReadImpGraphic( SvStream& rIStm, ImpGraphic& rImpGraphic )
void
WriteImpGraphic
(
SvStream
&
rOStm
,
const
ImpGraphic
&
rImpGraphic
)
{
if
(
!
rOStm
.
GetError
()
)
if
(
rOStm
.
GetError
())
return
;
if
(
rImpGraphic
.
ImplIsSwapOut
())
{
if
(
!
rImpGraphic
.
ImplIsSwapOut
()
)
{
if
(
(
rOStm
.
GetVersion
()
>=
SOFFICE_FILEFORMAT_50
)
&&
(
rOStm
.
GetCompressMode
()
&
SvStreamCompressFlags
::
NATIVE
)
&&
rImpGraphic
.
mpGfxLink
&&
rImpGraphic
.
mpGfxLink
->
IsNative
()
&&
!
rImpGraphic
.
maPdfData
.
hasElements
())
{
// native format
rOStm
.
WriteUInt32
(
NATIVE_FORMAT_50
);
rOStm
.
SetError
(
SVSTREAM_GENERALERROR
);
return
;
}
// write compat info
std
::
unique_ptr
<
VersionCompat
>
pCompat
(
new
VersionCompat
(
rOStm
,
StreamMode
::
WRITE
,
1
));
pCompat
.
reset
();
// destructor writes stuff into the header
if
(
(
rOStm
.
GetVersion
()
>=
SOFFICE_FILEFORMAT_50
)
&&
(
rOStm
.
GetCompressMode
()
&
SvStreamCompressFlags
::
NATIVE
)
&&
rImpGraphic
.
mpGfxLink
&&
rImpGraphic
.
mpGfxLink
->
IsNative
()
&&
!
rImpGraphic
.
maPdfData
.
hasElements
())
{
// native format
rOStm
.
WriteUInt32
(
NATIVE_FORMAT_50
);
rImpGraphic
.
mpGfxLink
->
SetPrefMapMode
(
rImpGraphic
.
ImplGetPrefMapMode
()
);
rImpGraphic
.
mpGfxLink
->
SetPrefSize
(
rImpGraphic
.
ImplGetPrefSize
()
);
WriteGfxLink
(
rOStm
,
*
rImpGraphic
.
mpGfxLink
);
}
else
{
// own format
const
SvStreamEndian
nOldFormat
=
rOStm
.
GetEndian
();
rOStm
.
SetEndian
(
SvStreamEndian
::
LITTLE
);
// write compat info
std
::
unique_ptr
<
VersionCompat
>
pCompat
(
new
VersionCompat
(
rOStm
,
StreamMode
::
WRITE
,
1
));
pCompat
.
reset
();
// destructor writes stuff into the header
switch
(
rImpGraphic
.
ImplGetType
()
)
{
case
GraphicType
:
:
NONE
:
case
GraphicType
:
:
Default
:
break
;
rImpGraphic
.
mpGfxLink
->
SetPrefMapMode
(
rImpGraphic
.
ImplGetPrefMapMode
()
);
rImpGraphic
.
mpGfxLink
->
SetPrefSize
(
rImpGraphic
.
ImplGetPrefSize
()
);
WriteGfxLink
(
rOStm
,
*
rImpGraphic
.
mpGfxLink
);
}
else
{
// own format
const
SvStreamEndian
nOldFormat
=
rOStm
.
GetEndian
();
rOStm
.
SetEndian
(
SvStreamEndian
::
LITTLE
);
case
GraphicType
:
:
Bitmap
:
{
if
(
rImpGraphic
.
getSvgData
().
get
())
{
// stream out Svg defining data (length, byte array and evtl. path)
// this is used e.g. in swapping out graphic data and in transporting it over UNO API
// as sequence of bytes, but AFAIK not written anywhere to any kind of file, so it should be
// no problem to extend it; only used at runtime
const
sal_uInt32
nSvgMagic
((
sal_uInt32
(
's'
)
<<
24
)
|
(
sal_uInt32
(
'v'
)
<<
16
)
|
(
sal_uInt32
(
'g'
)
<<
8
)
|
sal_uInt32
(
'0'
));
rOStm
.
WriteUInt32
(
nSvgMagic
);
rOStm
.
WriteUInt32
(
rImpGraphic
.
getSvgData
()
->
getSvgDataArrayLength
()
);
rOStm
.
WriteBytes
(
rImpGraphic
.
getSvgData
()
->
getSvgDataArray
().
getConstArray
(),
rImpGraphic
.
getSvgData
()
->
getSvgDataArrayLength
());
rOStm
.
WriteUniOrByteString
(
rImpGraphic
.
getSvgData
()
->
getPath
(),
rOStm
.
GetStreamCharSet
());
}
else
if
(
rImpGraphic
.
ImplIsAnimated
())
{
WriteAnimation
(
rOStm
,
*
rImpGraphic
.
mpAnimation
);
}
else
{
WriteDIBBitmapEx
(
rImpGraphic
.
maEx
,
rOStm
);
}
}
break
;
switch
(
rImpGraphic
.
ImplGetType
()
)
{
case
GraphicType
:
:
NONE
:
case
GraphicType
:
:
Default
:
break
;
default
:
{
if
(
rImpGraphic
.
maPdfData
.
hasElements
())
{
// Stream out PDF data.
rOStm
.
WriteUInt32
(
nPdfMagic
);
rOStm
.
WriteUInt32
(
rImpGraphic
.
maPdfData
.
getLength
());
rOStm
.
WriteBytes
(
rImpGraphic
.
maPdfData
.
getConstArray
(),
rImpGraphic
.
maPdfData
.
getLength
());
}
if
(
rImpGraphic
.
ImplIsSupportedGraphic
()
)
WriteGDIMetaFile
(
rOStm
,
rImpGraphic
.
maMetaFile
);
}
break
;
case
GraphicType
:
:
Bitmap
:
{
if
(
rImpGraphic
.
getSvgData
().
get
())
{
// stream out Svg defining data (length, byte array and evtl. path)
// this is used e.g. in swapping out graphic data and in transporting it over UNO API
// as sequence of bytes, but AFAIK not written anywhere to any kind of file, so it should be
// no problem to extend it; only used at runtime
const
sal_uInt32
nSvgMagic
((
sal_uInt32
(
's'
)
<<
24
)
|
(
sal_uInt32
(
'v'
)
<<
16
)
|
(
sal_uInt32
(
'g'
)
<<
8
)
|
sal_uInt32
(
'0'
));
rOStm
.
WriteUInt32
(
nSvgMagic
);
rOStm
.
WriteUInt32
(
rImpGraphic
.
getSvgData
()
->
getSvgDataArrayLength
()
);
rOStm
.
WriteBytes
(
rImpGraphic
.
getSvgData
()
->
getSvgDataArray
().
getConstArray
(),
rImpGraphic
.
getSvgData
()
->
getSvgDataArrayLength
());
rOStm
.
WriteUniOrByteString
(
rImpGraphic
.
getSvgData
()
->
getPath
(),
rOStm
.
GetStreamCharSet
());
}
else
if
(
rImpGraphic
.
ImplIsAnimated
())
{
WriteAnimation
(
rOStm
,
*
rImpGraphic
.
mpAnimation
);
}
else
{
WriteDIBBitmapEx
(
rImpGraphic
.
maEx
,
rOStm
);
}
}
break
;
rOStm
.
SetEndian
(
nOldFormat
);
default
:
{
if
(
rImpGraphic
.
maPdfData
.
hasElements
())
{
// Stream out PDF data.
rOStm
.
WriteUInt32
(
nPdfMagic
);
rOStm
.
WriteUInt32
(
rImpGraphic
.
maPdfData
.
getLength
());
rOStm
.
WriteBytes
(
rImpGraphic
.
maPdfData
.
getConstArray
(),
rImpGraphic
.
maPdfData
.
getLength
());
}
if
(
rImpGraphic
.
ImplIsSupportedGraphic
()
)
WriteGDIMetaFile
(
rOStm
,
rImpGraphic
.
maMetaFile
);
}
break
;
}
else
rOStm
.
SetError
(
SVSTREAM_GENERALERROR
);
rOStm
.
SetEndian
(
nOldFormat
);
}
}
...
...
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