fdo#78384: Fix for corruption if file contains symbols.
* 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. Change-Id: If5b79521c6a59aec02b165e8120dafdd472cdaeb Reviewed-on: https://gerrit.libreoffice.org/9281 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
This commit is contained in:
parent
decfecc3d2
commit
f51640c5f4
BIN
sw/qa/extras/ooxmlexport/data/fdo78384.docx
Normal file
BIN
sw/qa/extras/ooxmlexport/data/fdo78384.docx
Normal file
Binary file not shown.
@ -3321,6 +3321,13 @@ DECLARE_OOXMLEXPORT_TEST(testFDO78284, "fdo78284.docx")
|
|||||||
"image/png");
|
"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
|
#endif
|
||||||
|
|
||||||
CPPUNIT_PLUGIN_IMPLEMENT();
|
CPPUNIT_PLUGIN_IMPLEMENT();
|
||||||
|
@ -239,7 +239,7 @@ void DomainMapper::lcl_attribute(Id nName, Value & val)
|
|||||||
}
|
}
|
||||||
else //it's a _real_ symbol
|
else //it's a _real_ symbol
|
||||||
{
|
{
|
||||||
utext( reinterpret_cast < const sal_uInt8 * >( &nIntValue ), 1 );
|
m_pImpl->SetSymbolData(nIntValue);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case NS_ooxml::LN_CT_Sym_font:
|
case NS_ooxml::LN_CT_Sym_font:
|
||||||
@ -253,7 +253,16 @@ void DomainMapper::lcl_attribute(Id nName, Value & val)
|
|||||||
}
|
}
|
||||||
else //a real symbol
|
else //a real symbol
|
||||||
if (m_pImpl->GetTopContext())
|
if (m_pImpl->GetTopContext())
|
||||||
|
{
|
||||||
m_pImpl->GetTopContext()->Insert(PROP_CHAR_FONT_NAME, uno::makeAny( sStringValue ));
|
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;
|
break;
|
||||||
case NS_ooxml::LN_CT_Underline_val:
|
case NS_ooxml::LN_CT_Underline_val:
|
||||||
handleUnderlineType(nIntValue, m_pImpl->GetTopContext());
|
handleUnderlineType(nIntValue, m_pImpl->GetTopContext());
|
||||||
|
@ -164,6 +164,7 @@ DomainMapper_Impl::DomainMapper_Impl(
|
|||||||
m_bTOCPageRef(false),
|
m_bTOCPageRef(false),
|
||||||
m_bStartGenericField(false),
|
m_bStartGenericField(false),
|
||||||
m_bTextInserted(false),
|
m_bTextInserted(false),
|
||||||
|
m_nSymboldata(-1),
|
||||||
m_pLastSectionContext( ),
|
m_pLastSectionContext( ),
|
||||||
m_pLastCharacterContext(),
|
m_pLastCharacterContext(),
|
||||||
m_nCurrentTabStopIndex( 0 ),
|
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 )
|
void DomainMapper_Impl::SetIsLastParagraphInSection( bool bIsLast )
|
||||||
{
|
{
|
||||||
m_bIsLastParaInSection = bIsLast;
|
m_bIsLastParaInSection = bIsLast;
|
||||||
|
@ -331,6 +331,7 @@ private:
|
|||||||
BookmarkMap_t m_aBookmarkMap;
|
BookmarkMap_t m_aBookmarkMap;
|
||||||
|
|
||||||
_PageMar m_aPageMargins;
|
_PageMar m_aPageMargins;
|
||||||
|
sal_Int32 m_nSymboldata;
|
||||||
|
|
||||||
|
|
||||||
// TableManagers are stacked: one for each stream to avoid any confusion
|
// TableManagers are stacked: one for each stream to avoid any confusion
|
||||||
@ -466,6 +467,9 @@ public:
|
|||||||
bool GetIsTextFrameInserted();
|
bool GetIsTextFrameInserted();
|
||||||
void SetParaSectpr(bool bParaSectpr);
|
void SetParaSectpr(bool bParaSectpr);
|
||||||
bool GetParaSectpr();
|
bool GetParaSectpr();
|
||||||
|
|
||||||
|
void SetSymbolData( bool nSymbolData );
|
||||||
|
sal_Int32 GetSymbolData();
|
||||||
/// Setter method for m_bSdt.
|
/// Setter method for m_bSdt.
|
||||||
void SetSdt(bool bSdt);
|
void SetSdt(bool bSdt);
|
||||||
/// Getter method for m_bSdt.
|
/// Getter method for m_bSdt.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user