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
e79c9c4c
Kaydet (Commit)
e79c9c4c
authored
Nis 08, 2012
tarafından
Fridrich Štrba
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Generate SVG preview of embedded WPG image
üst
04950bf3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
2 deletions
+19
-2
WordPerfectImportFilter.cxx
writerperfect/source/wpdimp/WordPerfectImportFilter.cxx
+19
-2
No files found.
writerperfect/source/wpdimp/WordPerfectImportFilter.cxx
Dosyayı görüntüle @
e79c9c4c
...
...
@@ -85,7 +85,7 @@ using com::sun::star::xml::sax::XParser;
void
callHandler
(
uno
::
Reference
<
XDocumentHandler
>
xDocHandler
);
static
bool
handleEmbeddedWPG
(
const
WPXBinaryData
&
data
,
OdfDocumentHandler
*
pHandler
,
const
OdfStreamType
streamType
)
static
bool
handleEmbeddedWPG
Object
(
const
WPXBinaryData
&
data
,
OdfDocumentHandler
*
pHandler
,
const
OdfStreamType
streamType
)
{
OdgGenerator
exporter
(
pHandler
,
streamType
);
...
...
@@ -97,6 +97,22 @@ static bool handleEmbeddedWPG(const WPXBinaryData &data, OdfDocumentHandler *pHa
return
libwpg
::
WPGraphics
::
parse
(
const_cast
<
WPXInputStream
*>
(
data
.
getDataStream
()),
&
exporter
,
fileFormat
);
}
static
bool
handleEmbeddedWPGImage
(
const
WPXBinaryData
&
input
,
WPXBinaryData
&
output
)
{
WPXString
svgOutput
;
libwpg
::
WPGFileFormat
fileFormat
=
libwpg
::
WPG_AUTODETECT
;
if
(
!
libwpg
::
WPGraphics
::
isSupported
(
const_cast
<
WPXInputStream
*>
(
input
.
getDataStream
())))
fileFormat
=
libwpg
::
WPG_WPG1
;
if
(
!
libwpg
::
WPGraphics
::
generateSVG
(
const_cast
<
WPXInputStream
*>
(
input
.
getDataStream
()),
svgOutput
,
fileFormat
))
return
false
;
output
.
clear
();
output
.
append
((
unsigned
char
*
)
svgOutput
.
cstr
(),
strlen
(
svgOutput
.
cstr
()));
return
true
;
}
sal_Bool
SAL_CALL
WordPerfectImportFilter
::
importImpl
(
const
Sequence
<
::
com
::
sun
::
star
::
beans
::
PropertyValue
>&
aDescriptor
)
throw
(
RuntimeException
)
{
...
...
@@ -159,7 +175,8 @@ throw (RuntimeException)
DocumentHandler
xHandler
(
xInternalHandler
);
OdtGenerator
collector
(
&
xHandler
,
ODF_FLAT_XML
);
collector
.
registerEmbeddedObjectHandler
(
"image/x-wpg"
,
&
handleEmbeddedWPG
);
collector
.
registerEmbeddedObjectHandler
(
"image/x-wpg"
,
&
handleEmbeddedWPGObject
);
collector
.
registerEmbeddedImageHandler
(
"image/x-wpg"
,
&
handleEmbeddedWPGImage
);
if
(
WPD_OK
==
WPDocument
::
parse
(
&
input
,
&
collector
,
aUtf8Passwd
.
isEmpty
()
?
0
:
aUtf8Passwd
.
getStr
()))
return
sal_True
;
return
sal_False
;
...
...
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