diff options
author | Noel Power <noel.power@suse.com> | 2013-02-20 17:27:32 +0000 |
---|---|---|
committer | Noel Power <noel.power@suse.com> | 2013-02-21 13:02:58 +0000 |
commit | 1d0f45ee2efb5dc8d3c40f33ba1494807c117729 (patch) | |
tree | 1831fb42b62eb2f829ca42d31ea64791d3870aae /sc/source/filter/xml/xmlfonte.cxx | |
parent | 868cb16417f7a4c9bdbb55b6262eddad3db6dc14 (diff) |
basic support for writing embedded fonts for calc docs
Diffstat (limited to 'sc/source/filter/xml/xmlfonte.cxx')
-rw-r--r-- | sc/source/filter/xml/xmlfonte.cxx | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/sc/source/filter/xml/xmlfonte.cxx b/sc/source/filter/xml/xmlfonte.cxx index ca936744bd92..0caca5501dab 100644 --- a/sc/source/filter/xml/xmlfonte.cxx +++ b/sc/source/filter/xml/xmlfonte.cxx @@ -35,7 +35,7 @@ class ScXMLFontAutoStylePool_Impl: public XMLFontAutoStylePool void AddFontItems(sal_uInt16* pWhichIds, sal_uInt8 nIdCount, const SfxItemPool* pItemPool, const sal_Bool bExportDefaults); public: - ScXMLFontAutoStylePool_Impl( ScXMLExport& rExport ); + ScXMLFontAutoStylePool_Impl( ScXMLExport& rExport, bool bBlockFontEmbedding ); }; @@ -69,8 +69,8 @@ void ScXMLFontAutoStylePool_Impl::AddFontItems(sal_uInt16* pWhichIds, sal_uInt8 } ScXMLFontAutoStylePool_Impl::ScXMLFontAutoStylePool_Impl( - ScXMLExport& rExportP ) : - XMLFontAutoStylePool( rExportP ) + ScXMLExport& rExportP, bool bBlockFontEmbedding ) : + XMLFontAutoStylePool( rExportP, bBlockFontEmbedding ) { sal_uInt16 aWhichIds[3] = { ATTR_FONT, ATTR_CJK_FONT, ATTR_CTL_FONT }; @@ -131,7 +131,16 @@ ScXMLFontAutoStylePool_Impl::ScXMLFontAutoStylePool_Impl( XMLFontAutoStylePool* ScXMLExport::CreateFontAutoStylePool() { - return new ScXMLFontAutoStylePool_Impl( *this ); + bool blockFontEmbedding = false; + // We write font info to both content.xml and styles.xml, but they are both + // written by different ScXMLExport instance, and would therefore write each + // font file twice without complicated checking for duplicates, so handle + // the embedding only in one of them. + if(( getExportFlags() & EXPORT_CONTENT ) == 0 ) + blockFontEmbedding = true; + if( !GetDocument()->IsUsingEmbededFonts()) + blockFontEmbedding = true; + return new ScXMLFontAutoStylePool_Impl( *this, !blockFontEmbedding ); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |