diff --git a/sw/qa/extras/ooxmlexport/data/fdo78384.docx b/sw/qa/extras/ooxmlexport/data/fdo78384.docx new file mode 100644 index 000000000000..ee102648f16b Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/fdo78384.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index 4919d01f05cf..87097d944e79 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -3321,6 +3321,13 @@ DECLARE_OOXMLEXPORT_TEST(testFDO78284, "fdo78284.docx") "image/png"); } +DECLARE_OOXMLEXPORT_TEST(testFDO78384,"fdo78384.docx") +{ + xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + if (!pXmlDoc) + return; + assertXPath(pXmlDoc, "/w:document/w:body/w:p[1]/w:r[1]/w:rPr/w:rFonts","ascii","Wingdings"); +} #endif CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx index dd92026e0e54..3dfb3927cc50 100644 --- a/writerfilter/source/dmapper/DomainMapper.cxx +++ b/writerfilter/source/dmapper/DomainMapper.cxx @@ -239,7 +239,7 @@ void DomainMapper::lcl_attribute(Id nName, Value & val) } else //it's a _real_ symbol { - utext( reinterpret_cast < const sal_uInt8 * >( &nIntValue ), 1 ); + m_pImpl->SetSymbolData(nIntValue); } break; case NS_ooxml::LN_CT_Sym_font: @@ -253,7 +253,16 @@ void DomainMapper::lcl_attribute(Id nName, Value & val) } else //a real symbol if (m_pImpl->GetTopContext()) + { m_pImpl->GetTopContext()->Insert(PROP_CHAR_FONT_NAME, uno::makeAny( sStringValue )); + /* + * In case of symbol, symbol character get imported first and then font of symbols. + * So we are storing symbol character and when we parse symbol font then create UNO object for text. + */ + sal_Int32 symboldata = m_pImpl->GetSymbolData(); + utext( reinterpret_cast < const sal_uInt8 * >( &(symboldata) ), 1 ); + } + break; case NS_ooxml::LN_CT_Underline_val: handleUnderlineType(nIntValue, m_pImpl->GetTopContext()); diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index 410b064f525b..bb81d095bb53 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -164,6 +164,7 @@ DomainMapper_Impl::DomainMapper_Impl( m_bTOCPageRef(false), m_bStartGenericField(false), m_bTextInserted(false), + m_nSymboldata(-1), m_pLastSectionContext( ), m_pLastCharacterContext(), m_nCurrentTabStopIndex( 0 ), @@ -375,6 +376,16 @@ void DomainMapper_Impl::RemoveLastParagraph( ) } } +void DomainMapper_Impl::SetSymbolData( bool nSymbolData ) +{ + m_nSymboldata = nSymbolData; +} + +sal_Int32 DomainMapper_Impl::GetSymbolData() +{ + return m_nSymboldata; +} + void DomainMapper_Impl::SetIsLastParagraphInSection( bool bIsLast ) { m_bIsLastParaInSection = bIsLast; diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.hxx b/writerfilter/source/dmapper/DomainMapper_Impl.hxx index 2694a5108b39..0c1178ad6966 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.hxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.hxx @@ -331,6 +331,7 @@ private: BookmarkMap_t m_aBookmarkMap; _PageMar m_aPageMargins; + sal_Int32 m_nSymboldata; // TableManagers are stacked: one for each stream to avoid any confusion @@ -466,6 +467,9 @@ public: bool GetIsTextFrameInserted(); void SetParaSectpr(bool bParaSectpr); bool GetParaSectpr(); + + void SetSymbolData( bool nSymbolData ); + sal_Int32 GetSymbolData(); /// Setter method for m_bSdt. void SetSdt(bool bSdt); /// Getter method for m_bSdt.