[Libreoffice-commits] core.git: sdext/source

Vort vvort at yandex.ru
Fri Apr 11 04:14:15 PDT 2014


 sdext/source/pdfimport/tree/drawtreevisiting.cxx |   16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

New commits:
commit 54b8eb252a3380d9d6e3cec26463e7a257790651
Author: Vort <vvort at yandex.ru>
Date:   Thu Apr 10 10:48:05 2014 +0300

    fdo#35064 PDF Import: Add support for simple text scaling
    
    Change-Id: I81ff611f5f326c7ef97a75011cec4f4144d2cca4
    Reviewed-on: https://gerrit.libreoffice.org/8916
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sdext/source/pdfimport/tree/drawtreevisiting.cxx b/sdext/source/pdfimport/tree/drawtreevisiting.cxx
index 98a677e..723d091 100644
--- a/sdext/source/pdfimport/tree/drawtreevisiting.cxx
+++ b/sdext/source/pdfimport/tree/drawtreevisiting.cxx
@@ -908,9 +908,23 @@ void DrawXmlFinalizer::visit( TextElement& elem, const std::list< Element* >::co
     aFontProps[ "fo:font-size" ]            = aFSize;
     aFontProps[ "style:font-size-asian" ]   = aFSize;
     aFontProps[ "style:font-size-complex" ] = aFSize;
+
     // color
     const GraphicsContext& rGC = m_rProcessor.getGraphicsContext( elem.GCId );
-    aFontProps[ "fo:color" ]                 =  getColorString( rFont.isOutline ? rGC.LineColor : rGC.FillColor );
+    aFontProps[ "fo:color" ] = getColorString( rFont.isOutline ? rGC.LineColor : rGC.FillColor );
+
+    // scale
+    double fRotate, fShearX;
+    basegfx::B2DTuple aScale, aTranslation;
+    rGC.Transformation.decompose(aScale, aTranslation, fRotate, fShearX);
+    double textScale = -100 * aScale.getX() / aScale.getY();
+    if (((textScale >= 1) && (textScale <= 99)) ||
+        ((textScale >= 101) && (textScale <= 999)))
+    {
+        aBuf.append(textScale);
+        aBuf.appendAscii("%");
+        aFontProps[ "style:text-scale" ] = aBuf.makeStringAndClear();
+    }
 
     StyleContainer::Style aStyle( "style:style", aProps );
     StyleContainer::Style aSubStyle( "style:text-properties", aFontProps );


More information about the Libreoffice-commits mailing list