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
0a049685
Kaydet (Commit)
0a049685
authored
Ock 05, 2015
tarafından
David Tardon
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
read embedded fonts from Flat ODF
Change-Id: Ic94608f4afac9d8ac05ec3140d195b0526e9420a
üst
02266c33
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
3 deletions
+32
-3
XMLFontStylesContext.cxx
xmloff/source/style/XMLFontStylesContext.cxx
+24
-3
XMLFontStylesContext_impl.hxx
xmloff/source/style/XMLFontStylesContext_impl.hxx
+8
-0
No files found.
xmloff/source/style/XMLFontStylesContext.cxx
Dosyayı görüntüle @
0a049685
...
@@ -24,6 +24,8 @@
...
@@ -24,6 +24,8 @@
#include <com/sun/star/awt/FontPitch.hpp>
#include <com/sun/star/awt/FontPitch.hpp>
#include <com/sun/star/embed/ElementModes.hpp>
#include <com/sun/star/embed/ElementModes.hpp>
#include <comphelper/seqstream.hxx>
#include <osl/file.hxx>
#include <osl/file.hxx>
#include <vcl/embeddedfontshelper.hxx>
#include <vcl/embeddedfontshelper.hxx>
...
@@ -33,6 +35,7 @@
...
@@ -33,6 +35,7 @@
#include "fonthdl.hxx"
#include "fonthdl.hxx"
#include <xmloff/xmlimp.hxx>
#include <xmloff/xmlimp.hxx>
#include <xmloff/maptype.hxx>
#include <xmloff/maptype.hxx>
#include <xmloff/XMLBase64ImportContext.hxx>
using
namespace
::
com
::
sun
::
star
;
using
namespace
::
com
::
sun
::
star
;
...
@@ -251,6 +254,12 @@ SvXMLImportContext * XMLFontStyleContextFontFaceUri::CreateChildContext(
...
@@ -251,6 +254,12 @@ SvXMLImportContext * XMLFontStyleContextFontFaceUri::CreateChildContext(
{
{
if
(
nPrefix
==
XML_NAMESPACE_SVG
&&
IsXMLToken
(
rLocalName
,
XML_FONT_FACE_FORMAT
))
if
(
nPrefix
==
XML_NAMESPACE_SVG
&&
IsXMLToken
(
rLocalName
,
XML_FONT_FACE_FORMAT
))
return
new
XMLFontStyleContextFontFaceFormat
(
GetImport
(),
nPrefix
,
rLocalName
,
xAttrList
,
*
this
);
return
new
XMLFontStyleContextFontFaceFormat
(
GetImport
(),
nPrefix
,
rLocalName
,
xAttrList
,
*
this
);
if
(
linkPath
.
isEmpty
()
&&
(
nPrefix
==
XML_NAMESPACE_OFFICE
)
&&
IsXMLToken
(
rLocalName
,
XML_BINARY_DATA
)
)
{
mxBase64Stream
.
set
(
new
comphelper
::
OSequenceOutputStream
(
maFontData
)
);
if
(
mxBase64Stream
.
is
()
)
return
new
XMLBase64ImportContext
(
GetImport
(),
nPrefix
,
rLocalName
,
xAttrList
,
mxBase64Stream
);
}
return
SvXMLImportContext
::
CreateChildContext
(
nPrefix
,
rLocalName
,
xAttrList
);
return
SvXMLImportContext
::
CreateChildContext
(
nPrefix
,
rLocalName
,
xAttrList
);
}
}
...
@@ -276,9 +285,9 @@ const char* EOT_FORMAT = "embedded-opentype";
...
@@ -276,9 +285,9 @@ const char* EOT_FORMAT = "embedded-opentype";
void
XMLFontStyleContextFontFaceUri
::
EndElement
()
void
XMLFontStyleContextFontFaceUri
::
EndElement
()
{
{
if
(
linkPath
.
getLength
()
==
0
)
if
(
(
linkPath
.
getLength
()
==
0
)
&&
(
maFontData
.
getLength
()
==
0
)
)
{
{
SAL_WARN
(
"xmloff"
,
"svg:font-face-uri tag with no link; ignoring."
);
SAL_WARN
(
"xmloff"
,
"svg:font-face-uri tag with no link
or base64 data
; ignoring."
);
return
;
return
;
}
}
bool
eot
;
bool
eot
;
...
@@ -298,7 +307,10 @@ void XMLFontStyleContextFontFaceUri::EndElement()
...
@@ -298,7 +307,10 @@ void XMLFontStyleContextFontFaceUri::EndElement()
SAL_WARN
(
"xmloff"
,
"Unknown format of embedded font; assuming TTF."
);
SAL_WARN
(
"xmloff"
,
"Unknown format of embedded font; assuming TTF."
);
eot
=
false
;
eot
=
false
;
}
}
handleEmbeddedFont
(
linkPath
,
eot
);
if
(
maFontData
.
getLength
()
==
0
)
handleEmbeddedFont
(
linkPath
,
eot
);
else
handleEmbeddedFont
(
maFontData
,
eot
);
}
}
void
XMLFontStyleContextFontFaceUri
::
handleEmbeddedFont
(
const
OUString
&
url
,
bool
eot
)
void
XMLFontStyleContextFontFaceUri
::
handleEmbeddedFont
(
const
OUString
&
url
,
bool
eot
)
...
@@ -328,6 +340,15 @@ void XMLFontStyleContextFontFaceUri::handleEmbeddedFont( const OUString& url, bo
...
@@ -328,6 +340,15 @@ void XMLFontStyleContextFontFaceUri::handleEmbeddedFont( const OUString& url, bo
SAL_WARN
(
"xmloff"
,
"External URL for font file not handled."
);
SAL_WARN
(
"xmloff"
,
"External URL for font file not handled."
);
}
}
void
XMLFontStyleContextFontFaceUri
::
handleEmbeddedFont
(
const
::
css
::
uno
::
Sequence
<
sal_Int8
>&
rData
,
const
bool
eot
)
{
const
uno
::
Reference
<
io
::
XInputStream
>
xInput
(
new
comphelper
::
SequenceInputStream
(
rData
)
);
const
OUString
fontName
=
font
.
familyName
();
if
(
EmbeddedFontsHelper
::
addEmbeddedFont
(
xInput
,
fontName
,
"?"
,
std
::
vector
<
unsigned
char
>
(),
eot
)
)
GetImport
().
NotifyEmbeddedFontRead
();
xInput
->
closeInput
();
}
SvXMLStyleContext
*
XMLFontStylesContext
::
CreateStyleChildContext
(
SvXMLStyleContext
*
XMLFontStylesContext
::
CreateStyleChildContext
(
sal_uInt16
nPrefix
,
sal_uInt16
nPrefix
,
const
OUString
&
rLocalName
,
const
OUString
&
rLocalName
,
...
...
xmloff/source/style/XMLFontStylesContext_impl.hxx
Dosyayı görüntüle @
0a049685
...
@@ -22,6 +22,10 @@
...
@@ -22,6 +22,10 @@
#include <xmloff/xmlstyle.hxx>
#include <xmloff/xmlstyle.hxx>
namespace
com
{
namespace
sun
{
namespace
star
{
namespace
io
{
class
XOutputStream
;
}
}
}
}
/// Handles <style:font-face>
/// Handles <style:font-face>
class
XMLFontStyleContextFontFace
:
public
SvXMLStyleContext
class
XMLFontStyleContextFontFace
:
public
SvXMLStyleContext
{
{
...
@@ -91,7 +95,11 @@ class XMLFontStyleContextFontFaceUri : public SvXMLStyleContext
...
@@ -91,7 +95,11 @@ class XMLFontStyleContextFontFaceUri : public SvXMLStyleContext
const
XMLFontStyleContextFontFace
&
font
;
const
XMLFontStyleContextFontFace
&
font
;
OUString
format
;
OUString
format
;
OUString
linkPath
;
OUString
linkPath
;
::
css
::
uno
::
Sequence
<
sal_Int8
>
maFontData
;
::
css
::
uno
::
Reference
<
::
css
::
io
::
XOutputStream
>
mxBase64Stream
;
void
handleEmbeddedFont
(
const
OUString
&
url
,
bool
eot
);
void
handleEmbeddedFont
(
const
OUString
&
url
,
bool
eot
);
void
handleEmbeddedFont
(
const
::
css
::
uno
::
Sequence
<
sal_Int8
>&
rData
,
bool
eot
);
public
:
public
:
TYPEINFO_OVERRIDE
();
TYPEINFO_OVERRIDE
();
...
...
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