summaryrefslogtreecommitdiff
path: root/xmloff
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 /xmloff
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 'xmloff')
-rw-r--r--xmloff/inc/pch/precompiled_xo.hxx2
-rw-r--r--xmloff/source/style/XMLFontAutoStylePool.cxx13
-rw-r--r--xmloff/source/style/XMLFontStylesContext.cxx8
3 files changed, 8 insertions, 15 deletions
diff --git a/xmloff/inc/pch/precompiled_xo.hxx b/xmloff/inc/pch/precompiled_xo.hxx
index aeffb54ed465..d13eef387807 100644
--- a/xmloff/inc/pch/precompiled_xo.hxx
+++ b/xmloff/inc/pch/precompiled_xo.hxx
@@ -550,7 +550,7 @@
#include <unotools/streamwrap.hxx>
#include <unotools/syslocale.hxx>
#include <utility>
-#include <vcl/embeddedfontshelper.hxx>
+#include <vcl/temporaryfonts.hxx>
#include <vector>
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/xmloff/source/style/XMLFontAutoStylePool.cxx b/xmloff/source/style/XMLFontAutoStylePool.cxx
index e8c33aafdd71..9163ef593476 100644
--- a/xmloff/source/style/XMLFontAutoStylePool.cxx
+++ b/xmloff/source/style/XMLFontAutoStylePool.cxx
@@ -25,7 +25,7 @@
#include "fonthdl.hxx"
#include <xmloff/xmlexp.hxx>
#include <xmloff/XMLFontAutoStylePool.hxx>
-#include <vcl/embeddedfontshelper.hxx>
+#include <vcl/temporaryfonts.hxx>
#include <osl/file.hxx>
#include <com/sun/star/embed/ElementModes.hpp>
@@ -276,25 +276,18 @@ void XMLFontAutoStylePool::exportXML()
{
std::vector< OUString > fileUrls;
static const char* const styles[] = { "", "b", "i", "bi" };
- static const FontWeight weight[] = { WEIGHT_NORMAL, WEIGHT_BOLD, WEIGHT_NORMAL, WEIGHT_BOLD };
- static const FontItalic italic[] = { ITALIC_NONE, ITALIC_NONE, ITALIC_NORMAL, ITALIC_NORMAL };
- assert( SAL_N_ELEMENTS( styles ) == SAL_N_ELEMENTS( italic ));
- assert( SAL_N_ELEMENTS( styles ) == SAL_N_ELEMENTS( weight ));
for( unsigned int j = 0;
j < SAL_N_ELEMENTS( styles );
++j )
{
- OUString fileUrl = EmbeddedFontsHelper::fontFileUrl( pEntry->GetFamilyName(), pEntry->GetFamily(),
- italic[ j ], weight[ j ], pEntry->GetPitch(), pEntry->GetEncoding());
- if( fileUrl.isEmpty())
- continue;
+ OUString fileUrl = TemporaryFonts::fileUrlForFont( pEntry->GetFamilyName(), styles[ j ] );
if( !fontFilesMap.count( fileUrl ))
{
OUString docUrl = embedFontFile( fileUrl, styles[ j ] );
if( !docUrl.isEmpty())
fontFilesMap[ fileUrl ] = docUrl;
else
- continue; // --> failed to embed
+ continue; // --> failed (most probably this font is not embedded)
}
fileUrls.push_back( fileUrl );
}
diff --git a/xmloff/source/style/XMLFontStylesContext.cxx b/xmloff/source/style/XMLFontStylesContext.cxx
index f269284f3319..86433b8480db 100644
--- a/xmloff/source/style/XMLFontStylesContext.cxx
+++ b/xmloff/source/style/XMLFontStylesContext.cxx
@@ -26,7 +26,7 @@
#include <osl/file.hxx>
#include <rtl/logfile.hxx>
-#include <vcl/embeddedfontshelper.hxx>
+#include <vcl/temporaryfonts.hxx>
#include <xmloff/nmspmap.hxx>
#include "xmloff/xmlnmspe.hxx"
@@ -241,7 +241,7 @@ void XMLFontStyleContextFontFaceUri::handleEmbeddedFont( const OUString& url )
OUString fontName = font.familyName();
const char* style = "";
// OOXML needs to know what kind of style the font is (regular, italic, bold, bold-italic),
- // and the EmbeddedFontsHelper class is modelled after it. But ODF doesn't (need to) include
+ // and the TemporaryFonts class is modelled after it. But ODF doesn't (need to) include
// this information, so try to guess from the name (LO encodes the style), otherwise
// go with regular and hope it works.
if( url.endsWithIgnoreAsciiCase( "bi.ttf" ))
@@ -258,7 +258,7 @@ void XMLFontStyleContextFontFaceUri::handleEmbeddedFont( const OUString& url )
if( url.indexOf( '/' ) > -1 ) // TODO what if more levels?
storage.set( storage->openStorageElement( url.copy( 0, url.indexOf( '/' )),
::embed::ElementModes::READ ), uno::UNO_QUERY_THROW );
- OUString fileUrl = EmbeddedFontsHelper::fileUrlForTemporaryFont( fontName, style );
+ OUString fileUrl = TemporaryFonts::fileUrlForFont( fontName, style );
osl::File file( fileUrl );
switch( file.open( osl_File_OpenFlag_Create | osl_File_OpenFlag_Write ))
{
@@ -291,7 +291,7 @@ void XMLFontStyleContextFontFaceUri::handleEmbeddedFont( const OUString& url )
osl::File::remove( fileUrl );
return;
}
- EmbeddedFontsHelper::activateFont( fontName, fileUrl );
+ TemporaryFonts::activateFont( fontName, fileUrl );
GetImport().NotifyEmbeddedFontRead();
}
else