summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-11-15 15:44:20 +0000
committerCaolán McNamara <caolanm@redhat.com>2017-11-15 17:08:23 +0100
commit41cd0bc2c4b72e1db116e27802a288b4c44ffc93 (patch)
tree0db58e2e7de381359f84d13713bf4f0cb34dcca7 /sw
parenta3df638a0c8ec1a5a318df96760119d99d2d66dc (diff)
crashtesting: assert on export of fdo59645-3.odt to docx
probably 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 ctl info I misread hAnsi as Asian the last time so thought CJK was already handled, handle it for real this time Change-Id: If57a3ca3f96a7b76f1fb8702a0d5071c0b3e5cd9 Reviewed-on: https://gerrit.libreoffice.org/44771 Reviewed-by: Serge Krot (CIB) <Serge.Krot@cib.de> Tested-by: Serge Krot (CIB) <Serge.Krot@cib.de>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 9ac659eba81f..98ddfcdc4ee5 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -6927,6 +6927,14 @@ void DocxAttributeOutput::CharBackground( const SvxBrushItem& rBrush )
void DocxAttributeOutput::CharFontCJK( const SvxFontItem& rFont )
{
+ if (m_pFontsAttrList && m_pFontsAttrList->hasAttribute(FSNS(XML_w, XML_eastAsia)))
+ {
+ // 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_eastAsia ), sFontNameUtf8.getStr() );