Simplify a bit
Change-Id: I92def0e5731d231583b9b03e351bc46949045b4a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165846 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
This commit is contained in:
@@ -252,7 +252,6 @@ void SVGFontExport::implEmbedFont( const vcl::Font& rFont )
|
||||
void SVGFontExport::implEmbedGlyph( OutputDevice const & rOut, const OUString& rCellStr )
|
||||
{
|
||||
tools::PolyPolygon aPolyPoly;
|
||||
const sal_Unicode nSpace = ' ';
|
||||
|
||||
if( !rOut.GetTextOutline( aPolyPoly, rCellStr ) )
|
||||
return;
|
||||
@@ -261,14 +260,10 @@ void SVGFontExport::implEmbedGlyph( OutputDevice const & rOut, const OUString& r
|
||||
|
||||
aPolyPoly.Scale( 1.0, -1.0 );
|
||||
|
||||
if( !rOut.GetTextBoundRect( aBoundRect, rCellStr ) )
|
||||
if (rCellStr == " " || !rOut.GetTextBoundRect(aBoundRect, rCellStr))
|
||||
aBoundRect = tools::Rectangle( Point( 0, 0 ), Size( rOut.GetTextWidth( rCellStr ), 0 ) );
|
||||
|
||||
mrExport.AddAttribute( XML_NAMESPACE_NONE, "unicode", rCellStr );
|
||||
|
||||
if( rCellStr[ 0 ] == nSpace && rCellStr.getLength() == 1 )
|
||||
aBoundRect = tools::Rectangle( Point( 0, 0 ), Size( rOut.GetTextWidth( OUString(' ') ), 0 ) );
|
||||
|
||||
mrExport.AddAttribute( XML_NAMESPACE_NONE, "horiz-adv-x", OUString::number( aBoundRect.GetWidth() ) );
|
||||
|
||||
const OUString aPathString( SVGActionWriter::GetPathString( aPolyPoly, false ) );
|
||||
|
Reference in New Issue
Block a user