[Libreoffice-commits] core.git: writerfilter/qa writerfilter/source
Justin Luth
justin_luth at sil.org
Wed Aug 16 06:50:26 UTC 2017
writerfilter/qa/cppunittests/rtftok/data/fail/topcontext-3.rtf | 28 ++++++++++
writerfilter/source/dmapper/DomainMapper_Impl.cxx | 13 +++-
2 files changed, 39 insertions(+), 2 deletions(-)
New commits:
commit b6e0fcf85696b65aff160661a6f89d84a4e27962
Author: Justin Luth <justin_luth at sil.org>
Date: Fri Aug 11 12:50:37 2017 -0400
DomainMapper_Impl: add check for m_xTextFactory.is() where missing.
To test: make CppunitTest_writerfilter_rtftok
These crash triggering instances were hidden by the presense of \super
in topcontext-2.rtf - so I copied it, and only removed \super.
My fix for tdf#109382 triggered a unit test failure for one
missing m_xTextFactory. It seemed safe enough to test for all of them
that aren't in try/catch blocks, not just for the specific
instance I can prove with the test.
Change-Id: I1e317e05f9bcbbb14360941ce07af1bdf0edac6a
Reviewed-on: https://gerrit.libreoffice.org/41060
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
diff --git a/writerfilter/qa/cppunittests/rtftok/data/fail/topcontext-3.rtf b/writerfilter/qa/cppunittests/rtftok/data/fail/topcontext-3.rtf
new file mode 100644
index 000000000000..112162397f43
--- /dev/null
+++ b/writerfilter/qa/cppunittests/rtftok/data/fail/topcontext-3.rtf
@@ -0,0 +1,28 @@
+{\ul\001ll\fJ
+ {Ystylesheet;{;}}
+{bbbbbbbbbbbbbbbbb{O\00\80\00\tc\DD\00\FFDD\BED at DDD\F7bTr\00\00*i\\FF\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FB\FF\
+\\\BD\EB||){Tb\FD\00\00\00p\FFA\00\00\00r \00\00\00\BB
+\88\83AA4A\FC\E5C\E5\F5\E5\E5\FF\80\E5\E5\E5\D3O<BZ\
+\D\00
+\EA\00\00\00\FFbT\9B\85\00{rbNNNNNNNNNNNNNNNNN\E5\E5\E5\E5\E5\E5\E5\E5\E5IA\00\FFiH\\
+\T\\\E7\00\ED(\\92\DEs\\F0 \82\AA\AA =\00V n\E7\00\ect\00\00\00\B1\B1\B1w^w\AAuu\00\00
+\d\00\00\00\00\00\00\FFbTUUQVUߘ\98U\00DF\F6\F63#\99\00\00\98\AC\98\98\00\00 x\95es\E4\B7\D3\\00\80w\80\FF\00\AAd\FF\00*\00菋\8B\8BM`I\00 \00\80\v\U\i\F8\F8\AB\98\D8\\91\sect\\F0\F0\F0\F0\F0\F0\F0ec\F0\F0\F0 \8B\00\8B\8B\8BOOOMII\C2\C2\EC\FEw{O\00\80\00d<tR}\\iL@\A4u{\E8A\00剉\89\89\89\89\89\89\{O\86]UvII<OOOOOOOOOOMI:\C2\C2\00\00\00\00\EC\F1w{O\00\80\00d\t\B5}\\iL\\00\89k \FF\DF\DF\DF\DF\DD\DF\DF\DF\DF\00 \8EiE \E5\q\FA{P\00zri\A2\00\DD\00\AAe{\00\C0DDDD\8FDD\BED\00\E8\f\\i\\FF\E9\FF\9Bc\F1[\8\00\EB{\98
+\DFh\FF\\00\\\BD\E1||||Z|||||\A1\FD\98\98\98\98\98\98\8F\90\98\98\D8\tc}ww\00\tc}\\i\FE\\00/k շ\D3\\FF\FF}wX\EB\tc}\\iL\\9F\00/k \F6\FF\FE\FFE\FF\FF\FE\E8KK\00\00\00 \00\E6ii{ۜ\80\85
+\80\q\FA\00\00\FA\F8\E5 ގ|^
+\E5\E5\E5\E5C\E5\E5\E5\E5\FF\80\E5\E5\E5\D3\E5
+BZ\
+\t\00
+\E5\FF\FFi\00
+\ \FA>\006\FA\00\00\EB\F8\E5 \00\00\\98\00xtesշ\D3^t000c\00\00\00\00ppu\00\00\00\00\00\E5\D1\E5\80\00\00\00\FA\F8\E5'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb{O\00\80\00\tc\A5\\iL\\00\E5\F2\E5\E5\E5\80\E8\E5\E5\E5\FF\FFbTUEQU\00\00\00\00\80\00\00\AD\E5\E5\E5\E5C\00\00\00\E5\E5\E5\E5\E5\E5I \00\{P\FFig\\
+{O\00\80\00d<tR\T\ect\00\00\.AK\EF
+\F\80\FF
+\\\E5\FF\FF\i"\00\FFw\F4\F2\D9\00\89\89\89s\89\89k\89\8AigQ\hhhhhhhA\\00Ad\00\FFiI \00iI d\00\00\009\FFH\E2\F8\006\FA\00\00 \00NNNNNNNNNNNNNNNNNNNNN\00\B6\FA\E5[\
+\Z\
+6\006\D3\00\80\E5\FF\ig\FB~\9Fo
+^
+\E5\E5\E4\E5C\E5\E5\E5\E5\E5\E5\E5\E5\E5\E5IA\00\FFiH\\
+\T\\EAd\00\FF\iI \00\E8\00\\\
+\R\xKKKKKKKKKKKKKKKKKKKKKKKKK\FF\\\F8\FF\FA\00\82\00\00\00rd\00\00ppp\FF\i\\FF\FF\A0\00\00\00%C
+\FF\FF\00}g ~\80\00\80xxxxxxxxxxig\\
+\\%\E5\E5\E5\E5\E5\E5\E5\C6\E5\E5tes\E4\B7\D3\\00\80}\E5\E5,TgU\\00~
+\\006\00
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 589dbf1b6770..2cd7f7fff6c2 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -2761,7 +2761,7 @@ uno::Reference<beans::XPropertySet> DomainMapper_Impl::FindOrCreateFieldMaster(c
//get the master
xMaster.set(xFieldMasterAccess->getByName(sFieldMasterName), uno::UNO_QUERY_THROW);
}
- else
+ else if( m_xTextFactory.is() )
{
//create the master
xMaster.set( m_xTextFactory->createInstance(sFieldMasterService), uno::UNO_QUERY_THROW);
@@ -4145,7 +4145,7 @@ void DomainMapper_Impl::CloseFieldCommand()
xFieldProperties->setPropertyValue(
getPropertyName( PROP_REFERENCE_FIELD_PART ), uno::makeAny( nFieldPart ));
}
- else
+ else if( m_xTextFactory.is() )
{
xFieldInterface = m_xTextFactory->createInstance("com.sun.star.text.TextField.GetExpression");
xFieldProperties.set(xFieldInterface, uno::UNO_QUERY);
@@ -4306,6 +4306,9 @@ void DomainMapper_Impl::CloseFieldCommand()
break;
case FIELD_XE:
{
+ if( !m_xTextFactory.is() )
+ break;
+
uno::Reference< beans::XPropertySet > xTC(
m_xTextFactory->createInstance(
OUString::createFromAscii(aIt->second.cFieldServiceName)),
@@ -4332,6 +4335,9 @@ void DomainMapper_Impl::CloseFieldCommand()
break;
case FIELD_CITATION:
{
+ if( !m_xTextFactory.is() )
+ break;
+
xFieldInterface = m_xTextFactory->createInstance(
OUString::createFromAscii(aIt->second.cFieldServiceName));
uno::Reference< beans::XPropertySet > xTC(xFieldInterface,
@@ -4353,6 +4359,9 @@ void DomainMapper_Impl::CloseFieldCommand()
case FIELD_TC :
{
+ if( !m_xTextFactory.is() )
+ break;
+
uno::Reference< beans::XPropertySet > xTC(
m_xTextFactory->createInstance(
OUString::createFromAscii(aIt->second.cFieldServiceName)),
More information about the Libreoffice-commits
mailing list