diff options
author | Luboš Luňák <l.lunak@suse.cz> | 2013-02-01 14:26:36 +0100 |
---|---|---|
committer | Luboš Luňák <l.lunak@suse.cz> | 2013-02-01 14:26:36 +0100 |
commit | 989d0953a4d69bef3c8aba8e9dc7758194adcdc4 (patch) | |
tree | 678cdb4ca547e9b37248f1b3d5b54ea4e17286d5 /xmloff/inc | |
parent | 5ceaa68ca51c4d182210a28a64d574de6170b9ca (diff) |
basic support for embedded fonts in odt (fdo#42195)
There are still places that should be improved a bit, but this works.
Change-Id: Ieb7947a294ec95b6fd8cec2e8c4bc731e2594c42
Diffstat (limited to 'xmloff/inc')
-rw-r--r-- | xmloff/inc/xmloff/XMLFontAutoStylePool.hxx | 5 | ||||
-rw-r--r-- | xmloff/inc/xmloff/XMLFontStylesContext.hxx | 39 | ||||
-rw-r--r-- | xmloff/inc/xmloff/xmlimp.hxx | 2 | ||||
-rw-r--r-- | xmloff/inc/xmloff/xmltoken.hxx | 2 |
4 files changed, 47 insertions, 1 deletions
diff --git a/xmloff/inc/xmloff/XMLFontAutoStylePool.hxx b/xmloff/inc/xmloff/XMLFontAutoStylePool.hxx index 4fd666b50efc..8ed243daa321 100644 --- a/xmloff/inc/xmloff/XMLFontAutoStylePool.hxx +++ b/xmloff/inc/xmloff/XMLFontAutoStylePool.hxx @@ -37,6 +37,9 @@ class XMLOFF_DLLPUBLIC XMLFontAutoStylePool : public UniRefBase XMLFontAutoStylePool_Impl *pPool; XMLFontAutoStylePoolNames_Impl m_aNames; sal_uInt32 nName; + bool tryToEmbedFonts; + + OUString embedFontFile( const OUString& fontUrl, const char* style ); protected: @@ -44,7 +47,7 @@ protected: public: - XMLFontAutoStylePool( SvXMLExport& rExport ); + XMLFontAutoStylePool( SvXMLExport& rExport, bool tryToEmbedFonts = false ); ~XMLFontAutoStylePool(); ::rtl::OUString Add( diff --git a/xmloff/inc/xmloff/XMLFontStylesContext.hxx b/xmloff/inc/xmloff/XMLFontStylesContext.hxx index e48ae0a60c48..7a50fc76ee2f 100644 --- a/xmloff/inc/xmloff/XMLFontStylesContext.hxx +++ b/xmloff/inc/xmloff/XMLFontStylesContext.hxx @@ -121,12 +121,51 @@ public: sal_Int32 nPitchIdx, sal_Int32 nCharsetIdx ) const; + OUString familyName() const; + SvXMLImportContext * CreateChildContext( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & xAttrList ); }; +/// Handles <style:font-face-src> +class XMLFontStyleContextFontFaceSrc : public SvXMLImportContext +{ + const XMLFontStyleContext_Impl& font; +public: + + TYPEINFO(); + + XMLFontStyleContextFontFaceSrc( SvXMLImport& rImport, sal_uInt16 nPrfx, + const ::rtl::OUString& rLName, + const XMLFontStyleContext_Impl& font ); + + virtual SvXMLImportContext * CreateChildContext( + sal_uInt16 nPrefix, + const ::rtl::OUString& rLocalName, + const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & xAttrList ); +}; + +/// Handles <style:font-face-uri> +class XMLFontStyleContextFontFaceUri : public SvXMLStyleContext +{ + const XMLFontStyleContext_Impl& font; + void handleEmbeddedFont( const OUString& url ); +public: + + TYPEINFO(); + + XMLFontStyleContextFontFaceUri( SvXMLImport& rImport, sal_uInt16 nPrfx, + const ::rtl::OUString& rLName, + const ::com::sun::star::uno::Reference< + ::com::sun::star::xml::sax::XAttributeList > & xAttrList, + const XMLFontStyleContext_Impl& font ); + + virtual void SetAttribute( sal_uInt16 nPrefixKey, const OUString& rLocalName, + const OUString& rValue ); +}; + #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/inc/xmloff/xmlimp.hxx b/xmloff/inc/xmloff/xmlimp.hxx index d97fe847ceda..7e6381a867ad 100644 --- a/xmloff/inc/xmloff/xmlimp.hxx +++ b/xmloff/inc/xmloff/xmlimp.hxx @@ -453,6 +453,8 @@ public: @see <member>mbIsGraphicLoadOnDemandSupported</member> */ bool isGraphicLoadOnDemandSupported() const; + + virtual void NotifyEmbeddedFontRead() {}; }; inline UniReference< XMLTextImportHelper > SvXMLImport::GetTextImport() diff --git a/xmloff/inc/xmloff/xmltoken.hxx b/xmloff/inc/xmloff/xmltoken.hxx index c4dff1c69ae8..13b59fe083fb 100644 --- a/xmloff/inc/xmloff/xmltoken.hxx +++ b/xmloff/inc/xmloff/xmltoken.hxx @@ -2457,6 +2457,8 @@ namespace xmloff { namespace token { XML_SCRIPTS, XML_FONT_FACE_DECLS, XML_FONT_FACE, + XML_FONT_FACE_SRC, + XML_FONT_FACE_URI, XML_FONT_ADORNMENTS, XML_INCH, XML_SPACE_AFTER, |