summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorDavid Ostrovsky <david@ostrovsky.org>2013-02-21 23:33:10 +0100
committerDavid Ostrovsky <david@ostrovsky.org>2013-02-21 23:34:47 +0100
commitcad65120c6da901bf9fe33ab16ad22217efed0c0 (patch)
tree1689b74b1ca068d5d4e06b57ab9d35d0e009ee7d /sw
parenta07dd698bf8044db1c13dbd81a5bc6e62225788c (diff)
Revert "embed also system fonts when embedding fonts in a document"
that's enouph breakage for now. This reverts commit 596bd0f61f8cfc957410148ae221c62331067bdd. Change-Id: I992f439a9a099e47115a30b3d745848f3af09e5e
Diffstat (limited to 'sw')
-rw-r--r--sw/inc/pch/precompiled_msword.hxx2
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx21
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.hxx5
-rw-r--r--sw/source/filter/ww8/wrtw8sty.cxx2
4 files changed, 14 insertions, 16 deletions
diff --git a/sw/inc/pch/precompiled_msword.hxx b/sw/inc/pch/precompiled_msword.hxx
index e05919fcc59b..acacb8bdeaa2 100644
--- a/sw/inc/pch/precompiled_msword.hxx
+++ b/sw/inc/pch/precompiled_msword.hxx
@@ -252,7 +252,7 @@
#include <vcl/outdev.hxx>
#include <vcl/salbtype.hxx>
#include <vcl/svapp.hxx>
-#include <vcl/embeddedfontshelper.hxx>
+#include <vcl/temporaryfonts.hxx>
#include <vcl/vclenum.hxx>
#include <vcl/virdev.hxx>
#include <vcl/wmf.hxx>
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index b7e211ffb8e5..8a6e8bbbff0d 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -98,7 +98,7 @@
#include <txtinet.hxx>
#include <osl/file.hxx>
-#include <vcl/embeddedfontshelper.hxx>
+#include <vcl/temporaryfonts.hxx>
#include <com/sun/star/i18n/ScriptType.hpp>
#include <com/sun/star/chart2/XChartDocument.hpp>
@@ -3055,14 +3055,14 @@ void DocxAttributeOutput::FontPitchType( FontPitch ePitch ) const
FSEND );
}
-void DocxAttributeOutput::EmbedFont( const OUString& name, FontFamily family, FontPitch pitch, rtl_TextEncoding encoding )
+void DocxAttributeOutput::EmbedFont( const OUString& name )
{
if( !m_rExport.pDoc->get( IDocumentSettingAccess::EMBED_FONTS ))
return; // no font embedding with this document
- EmbedFontStyle( name, XML_embedRegular, family, ITALIC_NONE, WEIGHT_NORMAL, pitch, encoding );
- EmbedFontStyle( name, XML_embedBold, family, ITALIC_NONE, WEIGHT_BOLD, pitch, encoding );
- EmbedFontStyle( name, XML_embedItalic, family, ITALIC_NORMAL, WEIGHT_NORMAL, pitch, encoding );
- EmbedFontStyle( name, XML_embedBoldItalic, family, ITALIC_NORMAL, WEIGHT_BOLD, pitch, encoding );
+ EmbedFontStyle( name, XML_embedRegular, "" );
+ EmbedFontStyle( name, XML_embedBold, "b" );
+ EmbedFontStyle( name, XML_embedItalic, "i" );
+ EmbedFontStyle( name, XML_embedBoldItalic, "bi" );
}
static inline char toHexChar( int value )
@@ -3070,12 +3070,11 @@ static inline char toHexChar( int value )
return value >= 10 ? value + 'A' - 10 : value + '0';
}
-void DocxAttributeOutput::EmbedFontStyle( const OUString& name, int tag, FontFamily family, FontItalic italic,
- FontWeight weight, FontPitch pitch, rtl_TextEncoding encoding )
+void DocxAttributeOutput::EmbedFontStyle( const OUString& name, int tag, const char* style )
{
- OUString fontUrl = EmbeddedFontsHelper::fontFileUrl( name, family, italic, weight, pitch, encoding );
- if( fontUrl.isEmpty())
- return;
+ OUString fontUrl = TemporaryFonts::fileUrlForFont( name, style );
+ // If a temporary font file exists for this font, assume it was embedded
+ // and embed it again.
// TODO IDocumentSettingAccess::EMBED_SYSTEM_FONTS
osl::File file( fontUrl );
if( file.open( osl_File_OpenFlag_Read ) != osl::File::E_None )
diff --git a/sw/source/filter/ww8/docxattributeoutput.hxx b/sw/source/filter/ww8/docxattributeoutput.hxx
index 37a6d4ee124b..af94b1f8467a 100644
--- a/sw/source/filter/ww8/docxattributeoutput.hxx
+++ b/sw/source/filter/ww8/docxattributeoutput.hxx
@@ -244,7 +244,7 @@ public:
void FontPitchType( FontPitch ePitch ) const;
/// Write out the font into the document, if it's an embedded font.
- void EmbedFont( const OUString& name, FontFamily family, FontPitch pitch, rtl_TextEncoding encoding );
+ void EmbedFont( const OUString& name );
/// Definition of a numbering instance.
virtual void NumberingDefinition( sal_uInt16 nId, const SwNumRule &rRule );
@@ -326,8 +326,7 @@ private:
void WriteFFData( const FieldInfos& rInfos );
- void EmbedFontStyle( const OUString& name, int tag, FontFamily family, FontItalic italic, FontWeight weight,
- FontPitch pitch, rtl_TextEncoding encoding );
+ void EmbedFontStyle( const OUString& name, int tag, const char* style );
protected:
diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx
index 4c9e80f7ce8e..3d40f4e24c9e 100644
--- a/sw/source/filter/ww8/wrtw8sty.cxx
+++ b/sw/source/filter/ww8/wrtw8sty.cxx
@@ -718,7 +718,7 @@ void wwFont::WriteDocx( DocxAttributeOutput* rAttrOutput ) const
rAttrOutput->FontCharset( sw::ms::rtl_TextEncodingToWinCharset( meChrSet ), meChrSet );
rAttrOutput->FontFamilyType( meFamily );
rAttrOutput->FontPitchType( mePitch );
- rAttrOutput->EmbedFont( msFamilyNm, meFamily, mePitch, meChrSet );
+ rAttrOutput->EmbedFont( msFamilyNm );
rAttrOutput->EndFont();
}