[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - 2 commits - sw/qa writerfilter/source
Miklos Vajna
vmiklos at collabora.co.uk
Wed May 14 06:10:07 PDT 2014
sw/qa/extras/ooxmlexport/data/fdo78384.docx |binary
sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 7 +++++++
writerfilter/source/dmapper/DomainMapper.cxx | 11 ++++++++++-
writerfilter/source/dmapper/DomainMapper_Impl.cxx | 11 +++++++++++
writerfilter/source/dmapper/DomainMapper_Impl.hxx | 4 ++++
5 files changed, 32 insertions(+), 1 deletion(-)
New commits:
commit 0ae0cc447a71102bb8cea0ecc3ea5af486165cca
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Wed May 14 09:54:22 2014 +0200
writerfilter: DomainMapper_Impl::SetSymbolData() should take an int
One wonders how did this work so far.
Change-Id: I6aee6a2f7e15c1c4931ca5d65b6ad39d025ff9ed
(cherry picked from commit 671eb12dee290607ed66f3b325f28e7bd4695cba)
Signed-off-by: Andras Timar <andras.timar at collabora.com>
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 92748f1..7f61328 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -325,7 +325,7 @@ void DomainMapper_Impl::RemoveLastParagraph( )
}
}
-void DomainMapper_Impl::SetSymbolData( bool nSymbolData )
+void DomainMapper_Impl::SetSymbolData( sal_Int32 nSymbolData )
{
m_nSymboldata = nSymbolData;
}
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.hxx b/writerfilter/source/dmapper/DomainMapper_Impl.hxx
index c8859a200..3c95a4c 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.hxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.hxx
@@ -461,7 +461,7 @@ public:
void SetParaSectpr(bool bParaSectpr);
bool GetParaSectpr();
- void SetSymbolData( bool nSymbolData );
+ void SetSymbolData( sal_Int32 nSymbolData );
sal_Int32 GetSymbolData();
/// Setter method for m_bSdt.
void SetSdt(bool bSdt);
commit ba4b62e10924f43136c8ce048ce8504b44c5ec61
Author: Rohit Deshmukh <rohit.deshmukh at synerzip.com>
Date: Thu May 8 16:33:44 2014 +0530
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.
Reviewed-on: https://gerrit.libreoffice.org/9281
Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos at collabora.co.uk>
(cherry picked from commit f51640c5f40d5132b396a9fb6589420383df1610)
Signed-off-by: Andras Timar <andras.timar at collabora.com>
Conflicts:
sw/qa/extras/ooxmlexport/ooxmlexport.cxx
writerfilter/source/dmapper/DomainMapper_Impl.cxx
Change-Id: If5b79521c6a59aec02b165e8120dafdd472cdaeb
diff --git a/sw/qa/extras/ooxmlexport/data/fdo78384.docx b/sw/qa/extras/ooxmlexport/data/fdo78384.docx
new file mode 100644
index 0000000..ee10264
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 7095ea2..ee5f974 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -2048,6 +2048,13 @@ DECLARE_OOXMLEXPORT_TEST(testFdo71785, "fdo71785.docx")
// crashtest
}
+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 c7625e3..4a520c8 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -893,7 +893,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_rtf::LN_CHAR: //footnote symbol character
@@ -911,7 +911,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 6591673..92748f1 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -152,6 +152,7 @@ DomainMapper_Impl::DomainMapper_Impl(
m_bIsFirstSection( true ),
m_bIsColumnBreakDeferred( false ),
m_bIsPageBreakDeferred( false ),
+ m_nSymboldata(-1),
m_pLastSectionContext( ),
m_pLastCharacterContext(),
m_nCurrentTabStopIndex( 0 ),
@@ -324,6 +325,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 6792be2..c8859a200 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.hxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.hxx
@@ -336,6 +336,7 @@ private:
BookmarkMap_t m_aBookmarkMap;
_PageMar m_aPageMargins;
+ sal_Int32 m_nSymboldata;
// TableManagers are stacked: one for each stream to avoid any confusion
@@ -459,6 +460,9 @@ public:
bool GetIsFirstParagraphInSection();
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.
More information about the Libreoffice-commits
mailing list