sw/qa/extras/ww8export/ww8export.cxx | 15 +++++++++++++++ sw/source/filter/ww8/ww8par.cxx | 2 ++ 2 files changed, 17 insertions(+)
New commits: commit 07966a9999b0b3f27e1adeea1f4c97b3ba2944fa Author: Mark Hung <mark...@gmail.com> Date: Sun Jul 10 22:55:51 2016 +0800 tdf#98739 recover CJK and CTL fonts after symbols. This fix what has been done in 203e3c0f1190473d2e587a0801dc9f3883a6874a , which set CJK and CTL font in SwWW8ImplReader::Read_Symbol but didn't close CJK and CTL fonts in SwWW8ImplReader::ReadChars. Change-Id: I7c1d3b2a284d00a524a61785a5a94ca2d589295e Reviewed-on: https://gerrit.libreoffice.org/27090 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Mark Hung <mark...@gmail.com> diff --git a/sw/qa/extras/ww8export/ww8export.cxx b/sw/qa/extras/ww8export/ww8export.cxx index 6ff9590..747f1e4 100644 --- a/sw/qa/extras/ww8export/ww8export.cxx +++ b/sw/qa/extras/ww8export/ww8export.cxx @@ -563,6 +563,21 @@ DECLARE_WW8EXPORT_TEST(testTdf92281, "tdf92281.doc") CPPUNIT_ASSERT_EQUAL(OUString("Wingdings"), getProperty<OUString>(xRun, "CharFontName")); CPPUNIT_ASSERT_EQUAL(OUString("Wingdings"), getProperty<OUString>(xRun, "CharFontNameAsian")); CPPUNIT_ASSERT_EQUAL(OUString("Wingdings"), getProperty<OUString>(xRun, "CharFontNameComplex")); + + uno::Reference<text::XText> xXText(getParagraph(1)->getText(), uno::UNO_QUERY); + uno::Reference<text::XTextCursor> xCursor( xXText->createTextCursor() , uno::UNO_QUERY ); + + xCursor->goRight( 5 , false ); + uno::Reference< beans::XPropertySet > xPropSet(xCursor, uno::UNO_QUERY); + OUString sPMingLiUFont= OUString( sal_Unicode( 26032 ) ) + + OUString( sal_Unicode( 32048 ) ) + + OUString( sal_Unicode( 26126 ) ) + + OUString( sal_Unicode( 39636 ) ) + + OUString(";PMingLiU"); + + CPPUNIT_ASSERT_EQUAL(OUString("Calibri"), getProperty<OUString>(xPropSet, "CharFontName")); + CPPUNIT_ASSERT_EQUAL(sPMingLiUFont , getProperty<OUString>(xPropSet, "CharFontNameAsian")); + CPPUNIT_ASSERT_EQUAL(OUString("Times New Roman"), getProperty<OUString>(xPropSet, "CharFontNameComplex")); } DECLARE_WW8EXPORT_TEST(testCommentedTable, "commented-table.doc") diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index 7e6f92e..f2276e1 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -3432,6 +3432,8 @@ bool SwWW8ImplReader::ReadChars(WW8_CP& rPos, WW8_CP nNextAttr, long nTextEnd, m_rDoc.getIDocumentContentOperations().InsertString( *m_pPaM, OUString(m_cSymbol) ); } m_pCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_CHRATR_FONT ); + m_pCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_CHRATR_CJK_FONT ); + m_pCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_CHRATR_CTL_FONT ); } m_pStrm->SeekRel( nEnd- rPos ); rPos = nEnd; // Ignore until attribute end _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits