Resolves: rhbz#1089377 crash on loading a specific rtf

f41
Caolán McNamara 11 years ago
parent edebd1faf6
commit 6224646e4e

@ -0,0 +1,118 @@
From 195e3a757e98c58ee9e0dd428cd3dbce58ed99b7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
Date: Tue, 22 Apr 2014 17:23:26 +0100
Subject: [PATCH] Resolves: rhbz#1089377 crash on loading a specific rtf
(cherry picked from commit 5aeaba2e6592dab0404301dcef644144f82ffcbf)
Change-Id: I26864f3a2247f5d7184f395cfed91eaf92e36295
---
writerfilter/source/dmapper/NumberingManager.cxx | 5 ++-
writerfilter/source/rtftok/rtfsdrimport.cxx | 48 ++++++++++++++++++------
2 files changed, 40 insertions(+), 13 deletions(-)
diff --git a/writerfilter/source/dmapper/NumberingManager.cxx b/writerfilter/source/dmapper/NumberingManager.cxx
index 7a1787c..6038df6 100644
--- a/writerfilter/source/dmapper/NumberingManager.cxx
+++ b/writerfilter/source/dmapper/NumberingManager.cxx
@@ -531,6 +531,9 @@ OUString ListDef::GetStyleName( sal_Int32 nId )
uno::Sequence< uno::Sequence< beans::PropertyValue > > ListDef::GetPropertyValues( )
{
+ if (!m_pAbstractDef)
+ return uno::Sequence< uno::Sequence< beans::PropertyValue > >();
+
// [1] Call the same method on the abstract list
uno::Sequence< uno::Sequence< beans::PropertyValue > > aAbstract = m_pAbstractDef->GetPropertyValues( );
@@ -603,7 +606,7 @@ void ListDef::CreateNumberingRules( DomainMapper& rDMapper,
uno::Sequence< uno::Sequence< beans::PropertyValue > > aProps = GetPropertyValues( );
- sal_Int32 nAbstLevels = m_pAbstractDef->Size( );
+ sal_Int32 nAbstLevels = m_pAbstractDef ? m_pAbstractDef->Size() : 0;
sal_Int16 nLevel = 0;
while ( nLevel < nAbstLevels )
{
diff --git a/writerfilter/source/rtftok/rtfsdrimport.cxx b/writerfilter/source/rtftok/rtfsdrimport.cxx
index fa147d7..7788414 100644
--- a/writerfilter/source/rtftok/rtfsdrimport.cxx
+++ b/writerfilter/source/rtftok/rtfsdrimport.cxx
@@ -194,16 +194,16 @@ void RTFSdrImport::applyProperty(uno::Reference<drawing::XShape> xShape, OUStrin
xPropertySet->setPropertyValue("RotateAngle", uno::makeAny(sal_Int32(NormAngle360(nRotation * -1))));
}
- if (nHoriOrient != 0)
+ if (nHoriOrient != 0 && xPropertySet.is())
xPropertySet->setPropertyValue("HoriOrient", uno::makeAny(nHoriOrient));
- if (nVertOrient != 0)
+ if (nVertOrient != 0 && xPropertySet.is())
xPropertySet->setPropertyValue("VertOrient", uno::makeAny(nVertOrient));
- if (obFitShapeToText)
+ if (obFitShapeToText && xPropertySet.is())
{
xPropertySet->setPropertyValue("SizeType", uno::makeAny(*obFitShapeToText ? text::SizeType::MIN : text::SizeType::FIX));
xPropertySet->setPropertyValue("FrameIsAutomaticHeight", uno::makeAny(*obFitShapeToText));
}
- if (!bFilled)
+ if (!bFilled && xPropertySet.is())
{
if (m_bTextFrame)
xPropertySet->setPropertyValue("BackColorTransparency", uno::makeAny(sal_Int32(100)));
@@ -459,21 +459,45 @@ void RTFSdrImport::resolve(RTFShape& rShape, bool bClose)
}
// These are in EMU, convert to mm100.
else if (i->first == "dxTextLeft")
- xPropertySet->setPropertyValue("LeftBorderDistance", uno::makeAny(i->second.toInt32() / 360));
+ {
+ if (xPropertySet.is())
+ xPropertySet->setPropertyValue("LeftBorderDistance", uno::makeAny(i->second.toInt32() / 360));
+ }
else if (i->first == "dyTextTop")
- xPropertySet->setPropertyValue("TopBorderDistance", uno::makeAny(i->second.toInt32() / 360));
+ {
+ if (xPropertySet.is())
+ xPropertySet->setPropertyValue("TopBorderDistance", uno::makeAny(i->second.toInt32() / 360));
+ }
else if (i->first == "dxTextRight")
- xPropertySet->setPropertyValue("RightBorderDistance", uno::makeAny(i->second.toInt32() / 360));
+ {
+ if (xPropertySet.is())
+ xPropertySet->setPropertyValue("RightBorderDistance", uno::makeAny(i->second.toInt32() / 360));
+ }
else if (i->first == "dyTextBottom")
- xPropertySet->setPropertyValue("BottomBorderDistance", uno::makeAny(i->second.toInt32() / 360));
+ {
+ if (xPropertySet.is())
+ xPropertySet->setPropertyValue("BottomBorderDistance", uno::makeAny(i->second.toInt32() / 360));
+ }
else if (i->first == "dxWrapDistLeft")
- xPropertySet->setPropertyValue("LeftMargin", uno::makeAny(i->second.toInt32() / 360));
+ {
+ if (xPropertySet.is())
+ xPropertySet->setPropertyValue("LeftMargin", uno::makeAny(i->second.toInt32() / 360));
+ }
else if (i->first == "dyWrapDistTop")
- xPropertySet->setPropertyValue("TopMargin", uno::makeAny(i->second.toInt32() / 360));
+ {
+ if (xPropertySet.is())
+ xPropertySet->setPropertyValue("TopMargin", uno::makeAny(i->second.toInt32() / 360));
+ }
else if (i->first == "dxWrapDistRight")
- xPropertySet->setPropertyValue("RightMargin", uno::makeAny(i->second.toInt32() / 360));
+ {
+ if (xPropertySet.is())
+ xPropertySet->setPropertyValue("RightMargin", uno::makeAny(i->second.toInt32() / 360));
+ }
else if (i->first == "dyWrapDistBottom")
- xPropertySet->setPropertyValue("BottomMargin", uno::makeAny(i->second.toInt32() / 360));
+ {
+ if (xPropertySet.is())
+ xPropertySet->setPropertyValue("BottomMargin", uno::makeAny(i->second.toInt32() / 360));
+ }
else if (i->first == "fillType")
{
switch (i->second.toInt32())
--
1.9.0

@ -43,7 +43,7 @@ Summary: Free Software Productivity Suite
Name: libreoffice
Epoch: 1
Version: %{libo_version}.1
Release: 3%{?libo_prerelease}%{?dist}
Release: 4%{?libo_prerelease}%{?dist}
License: (MPLv1.1 or LGPLv3+) and LGPLv3 and LGPLv2+ and BSD and (MPLv1.1 or GPLv2 or LGPLv2 or Netscape) and Public Domain and ASL 2.0 and Artistic and MPLv2.0
Group: Applications/Productivity
URL: http://www.libreoffice.org/default/
@ -299,6 +299,7 @@ Patch32: 0001-every-even-numbered-print-job-is-reported-as-failed.patch
Patch33: 0001-Related-rhbz-1088625-PresenterPaintManager-seen-as-N.patch
Patch34: 0001-table-not-resizing-when-rows-columns-added-to-it.patch
Patch35: 0001-Fix-fdo-71423-crash-while-editing-Impress-tables.patch
Patch36: 0001-Resolves-rhbz-1089377-crash-on-loading-a-specific-rt.patch
%define instdir %{_libdir}
%define baseinstdir %{instdir}/libreoffice
@ -2290,6 +2291,9 @@ update-desktop-database %{_datadir}/applications &> /dev/null || :
%endif
%changelog
* Tue Apr 22 2014 Caolán McNamara <caolanm@redhat.com> - 1:4.2.4.1-4
- Resolves: rhbz#1089377 crash on loading a specific rtf
* Tue Apr 22 2014 Caolán McNamara <caolanm@redhat.com> - 1:4.2.4.1-3
- sometimes tables in impress don't resize when adding rows
- Resolves: fdo#71423 crash while editing Impress tables

Loading…
Cancel
Save