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
1e022fda
Kaydet (Commit)
1e022fda
authored
Haz 12, 2014
tarafından
Caolán McNamara
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
coverity#735947 Explicit null dereferenced
Change-Id: I8fc9d0eeab6f63be4c815adcbd092d5ff2a96586
üst
5c53bb8a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
56 additions
and
55 deletions
+56
-55
wrtww8gr.cxx
sw/source/filter/ww8/wrtww8gr.cxx
+56
-55
No files found.
sw/source/filter/ww8/wrtww8gr.cxx
Dosyayı görüntüle @
1e022fda
...
...
@@ -918,77 +918,78 @@ void SwWW8WrGrf::WriteGraphicNode(SvStream& rStrm, const GraphicDetails &rItem)
case
sw
:
:
Frame
::
eOle
:
{
#ifdef OLE_PREVIEW_AS_EMF
const
SwNode
*
pNode
=
rItem
.
maFly
.
GetContent
();
const
SwOLENode
*
pNd
=
pNode
?
pNode
->
GetOLENode
()
:
0
;
OSL_ENSURE
(
pNd
,
"Impossible"
);
if
(
!
rWrt
.
bWrtWW8
)
if
(
pNd
)
{
SwOLENode
*
pOleNd
=
const_cast
<
SwOLENode
*>
(
pNd
);
OSL_ENSURE
(
pOleNd
,
" Wer hat den OleNode versteckt ?"
);
SwOLEObj
&
rSObj
=
pOleNd
->
GetOLEObj
();
uno
::
Reference
<
embed
::
XEmbeddedObject
>
rObj
(
rSObj
.
GetOleRef
()
);
#ifdef OLE_PREVIEW_AS_EMF
if
(
!
rWrt
.
bWrtWW8
)
{
SwOLENode
*
pOleNd
=
const_cast
<
SwOLENode
*>
(
pNd
);
SwOLEObj
&
rSObj
=
pOleNd
->
GetOLEObj
();
uno
::
Reference
<
embed
::
XEmbeddedObject
>
rObj
(
rSObj
.
GetOleRef
()
);
comphelper
::
EmbeddedObjectContainer
aCnt
(
pOleNd
->
GetDoc
()
->
GetDocStorage
()
);
comphelper
::
EmbeddedObjectContainer
aCnt
(
pOleNd
->
GetDoc
()
->
GetDocStorage
()
);
SvStream
*
pGraphicStream
=
::
utl
::
UcbStreamHelper
::
CreateStream
(
aCnt
.
GetGraphicStream
(
rObj
)
);
OSL_ENSURE
(
pGraphicStream
&&
!
pGraphicStream
->
GetError
(),
"No graphic stream available!"
);
if
(
pGraphicStream
&&
!
pGraphicStream
->
GetError
()
)
{
Graphic
aGr
;
GraphicFilter
&
rGF
=
GraphicFilter
::
GetGraphicFilter
();
if
(
rGF
.
ImportGraphic
(
aGr
,
OUString
(),
*
pGraphicStream
,
GRFILTER_FORMAT_DONTKNOW
)
==
GRFILTER_OK
)
SvStream
*
pGraphicStream
=
::
utl
::
UcbStreamHelper
::
CreateStream
(
aCnt
.
GetGraphicStream
(
rObj
)
);
OSL_ENSURE
(
pGraphicStream
&&
!
pGraphicStream
->
GetError
(),
"No graphic stream available!"
);
if
(
pGraphicStream
&&
!
pGraphicStream
->
GetError
()
)
{
//TODO/LATER: do we really want to use GDIMetafile?!
GDIMetaFile
aMtf
;
aMtf
=
aGr
.
GetGDIMetaFile
();
aMtf
.
WindStart
();
aMtf
.
Play
(
Application
::
GetDefaultDevice
(),
Point
(
0
,
0
),
Size
(
2880
,
2880
));
WritePICFHeader
(
rStrm
,
rFly
,
8
,
nWidth
,
nHeight
,
pNd
->
GetpSwAttrSet
());
WriteWindowMetafileBits
(
rStrm
,
aMtf
);
Graphic
aGr
;
GraphicFilter
&
rGF
=
GraphicFilter
::
GetGraphicFilter
();
if
(
rGF
.
ImportGraphic
(
aGr
,
OUString
(),
*
pGraphicStream
,
GRFILTER_FORMAT_DONTKNOW
)
==
GRFILTER_OK
)
{
//TODO/LATER: do we really want to use GDIMetafile?!
GDIMetaFile
aMtf
;
aMtf
=
aGr
.
GetGDIMetaFile
();
aMtf
.
WindStart
();
aMtf
.
Play
(
Application
::
GetDefaultDevice
(),
Point
(
0
,
0
),
Size
(
2880
,
2880
));
WritePICFHeader
(
rStrm
,
rFly
,
8
,
nWidth
,
nHeight
,
pNd
->
GetpSwAttrSet
());
WriteWindowMetafileBits
(
rStrm
,
aMtf
);
}
}
else
delete
pGraphicStream
;
}
else
delete
pGraphicStream
;
}
else
{
//Convert this ole2 preview in ww8+ to an EMF for better unicode
//support (note that at this moment this breaks StarSymbol
//using graphics because I need to embed starsymbol in exported
//documents.
WritePICFHeader
(
rStrm
,
rFly
,
0x64
,
nWidth
,
nHeight
,
pNd
->
GetpSwAttrSet
());
SwBasicEscherEx
aInlineEscher
(
&
rStrm
,
rWrt
);
aInlineEscher
.
WriteOLEFlyFrame
(
rFly
.
GetFrmFmt
(),
0x401
);
aInlineEscher
.
WritePictures
();
}
{
//Convert this ole2 preview in ww8+ to an EMF for better unicode
//support (note that at this moment this breaks StarSymbol
//using graphics because I need to embed starsymbol in exported
//documents.
WritePICFHeader
(
rStrm
,
rFly
,
0x64
,
nWidth
,
nHeight
,
pNd
->
GetpSwAttrSet
());
SwBasicEscherEx
aInlineEscher
(
&
rStrm
,
rWrt
);
aInlineEscher
.
WriteOLEFlyFrame
(
rFly
.
GetFrmFmt
(),
0x401
);
aInlineEscher
.
WritePictures
();
}
#else
// cast away const
SwOLENode
*
pOleNd
=
const_cast
<
SwOLENode
*>
(
pNd
);
OSL_ENSURE
(
pOleNd
,
" Wer hat den OleNode versteckt ?"
);
SwOLEObj
&
rSObj
=
pOleNd
->
GetOLEObj
();
// cast away const
SwOLENode
*
pOleNd
=
const_cast
<
SwOLENode
*>
(
pNd
);
SwOLEObj
&
rSObj
=
pOleNd
->
GetOLEObj
();
// TODO/LATER: do we need to load object?
Graphic
*
pGr
=
SdrOle2Obj
::
GetGraphicFromObject
(
pOleNd
->
GetDoc
()
->
GetDocStorage
(),
rObj
);
// TODO/LATER: do we need to load object?
Graphic
*
pGr
=
SdrOle2Obj
::
GetGraphicFromObject
(
pOleNd
->
GetDoc
()
->
GetDocStorage
(),
rObj
);
//TODO/LATER: do we really want to use GDIMetafile?!
GDIMetaFile
aMtf
;
if
(
pGr
)
aMtf
=
pGr
->
GetGDIMetaFile
();
//TODO/LATER: do we really want to use GDIMetafile?!
GDIMetaFile
aMtf
;
if
(
pGr
)
aMtf
=
pGr
->
GetGDIMetaFile
();
Size
aS
(
aMtf
.
GetPrefSize
());
aMtf
.
WindStart
();
aMtf
.
Play
(
Application
::
GetDefaultDevice
(),
Point
(
0
,
0
),
Size
(
2880
,
2880
));
Size
aS
(
aMtf
.
GetPrefSize
());
aMtf
.
WindStart
();
aMtf
.
Play
(
Application
::
GetDefaultDevice
(),
Point
(
0
,
0
),
Size
(
2880
,
2880
));
WritePICFHeader
(
rStrm
,
rFly
,
8
,
nWidth
,
nHeight
,
pNd
->
GetpSwAttrSet
());
WriteWindowMetafileBits
(
rStrm
,
aMtf
);
delete
pGr
;
WritePICFHeader
(
rStrm
,
rFly
,
8
,
nWidth
,
nHeight
,
pNd
->
GetpSwAttrSet
());
WriteWindowMetafileBits
(
rStrm
,
aMtf
);
delete
pGr
;
#endif
}
}
break
;
case
sw
:
:
Frame
::
eDrawing
:
...
...
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