From b29483560306e6a6fec8dfe2c8622060b0ef2cd1 Mon Sep 17 00:00:00 2001 From: "yogesh.bharate001" Date: Thu, 30 Apr 2015 16:17:31 +0530 Subject: tdf#90955: CharKerning i.e spc is not exported after RT. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Problem Description: - CharKerning i.e spacing between characters/letter is not exported after roundtrip. XML Difference: Original: After Roundtrip: spc is missing after RT. Change-Id: I8bcefd6f0d0e3a1825618bece6f563792633a272 Solution: added support for spc. Reviewed-on: https://gerrit.libreoffice.org/15575 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- oox/source/export/drawingml.cxx | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'oox') diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx index 7862bf8da1b8..484c90b51519 100644 --- a/oox/source/export/drawingml.cxx +++ b/oox/source/export/drawingml.cxx @@ -1183,10 +1183,21 @@ void DrawingML::WriteRunProperties( Reference< XPropertySet > rRun, bool bIsFiel const char* cap = NULL; sal_Int32 nSize = 1800; sal_Int32 nCharEscapement = 0; + sal_Int32 nCharKerning = 0; if( GETA( CharHeight ) ) nSize = (sal_Int32) (100*(*static_cast(mAny.getValue()))); + if( GETA( CharKerning ) ) + nCharKerning = (sal_Int32)(*static_cast(mAny.getValue())); + /** While setting values in propertymap, + * CharKerning converted using GetTextSpacingPoint + * i.e set @ http://opengrok.libreoffice.org/xref/core/oox/source/drawingml/textcharacterproperties.cxx#129 + * therefore to get original value CharKerning need to be convert. + * http://opengrok.libreoffice.org/xref/core/oox/source/drawingml/drawingmltypes.cxx#95 + **/ + nCharKerning = ((nCharKerning * 720)-360) / 254; + if ( ( bComplex && GETA( CharWeightComplex ) ) || GETA( CharWeight ) ) { if ( *static_cast(mAny.getValue()) >= awt::FontWeight::SEMIBOLD ) @@ -1324,6 +1335,7 @@ void DrawingML::WriteRunProperties( Reference< XPropertySet > rRun, bool bIsFiel XML_i, italic, XML_lang, usLanguage.isEmpty() ? NULL : USS( usLanguage ), XML_sz, IS( nSize ), + XML_spc, nCharKerning > 0 ? IS(nCharKerning) : NULL, XML_strike, strikeout, XML_u, underline, XML_baseline, nCharEscapement == 0 ? NULL : IS( nCharEscapement*1000 ), -- cgit