[Libreoffice-commits] core.git: Branch 'private/swe/libreoffice-5-2+backports' - sw/source

Caolán McNamara caolanm at redhat.com
Fri Nov 10 15:28:41 UTC 2017


 sw/source/filter/ww8/docxattributeoutput.cxx |    8 ++++++++
 1 file changed, 8 insertions(+)

New commits:
commit bdf371904773fe0dbb8223b84820e1afbb73ebd9
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Nov 8 14:02:11 2017 +0000

    crashtesting: assert on re-export of fdo55459-1.docx to docx
    
    since...
    
    commit 3f2e84b4bd0bbd936e0af845ba7cbf68cb2803d6
    Date:   Tue Oct 31 23:39:26 2017 +0100
    
        tdf#38778 Fix output of the font in DOC run
    
        The font information should be output before field declaration.
        Added unit test.
    
        tdf#38778 DOCX output: no double output of the font info
    
    need to also not double output the complex script font info as well
    as the western and asian info
    
    Change-Id: I7de098dff0b787b9825a509cec19d0161a3a0d8a
    Reviewed-on: https://gerrit.libreoffice.org/44465
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>
    Reviewed-on: https://gerrit.libreoffice.org/44580
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
    Tested-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>

diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 76de5cabb222..efe2eb9f36c0 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -6754,6 +6754,14 @@ void DocxAttributeOutput::CharWeightCJK( const SvxWeightItem& rWeight )
 
 void DocxAttributeOutput::CharFontCTL( const SvxFontItem& rFont )
 {
+    if (m_pFontsAttrList && m_pFontsAttrList->hasAttribute(FSNS(XML_w, XML_cs)))
+    {
+        // tdf#38778: do to fields output into DOC the font could be added before and after field declaration
+        // that all sub runs of the field will have correct font inside.
+        // For DOCX we should do not add the same font information twice in the same node
+        return;
+    }
+
     const OUString& sFontName(rFont.GetFamilyName());
     OString sFontNameUtf8 = OUStringToOString(sFontName, RTL_TEXTENCODING_UTF8);
     AddToAttrList( m_pFontsAttrList, FSNS( XML_w, XML_cs ), sFontNameUtf8.getStr() );


More information about the Libreoffice-commits mailing list