diff --git a/0001-Resolves-fdo-86449-backport-rtf-fixes.patch b/0001-Resolves-fdo-86449-backport-rtf-fixes.patch new file mode 100644 index 0000000..9d9e648 --- /dev/null +++ b/0001-Resolves-fdo-86449-backport-rtf-fixes.patch @@ -0,0 +1,41 @@ +From 237cb1cbcb67c37c0b9d72ebb8bcc3a7597e884d Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Wed, 20 Aug 2014 08:56:54 +0100 +Subject: [PATCH 1/2] Resolves: fdo#86449 backport rtf fixes + +empty Reference + +valgrind + bff + +(cherry picked from commit 0a42632a74596cbc781746931bf8f2650994b80f) + +empty m_aStates + +valgrind + bff + +(cherry picked from commit e3247719911f4e9b61ec43ea1c9ce04bcddc4ff8) + +Change-Id: Id3c039a46dec5d2d4a4642dfb53d23a76972dde2 +3bd526b7ebf0f4fce5d0c7054809e0dc2908e73f +Reviewed-on: https://gerrit.libreoffice.org/12965 +Reviewed-by: Miklos Vajna +Tested-by: Miklos Vajna +--- + writerfilter/source/rtftok/rtfdocumentimpl.cxx | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx +index ca34825..965f914 100644 +--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx ++++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx +@@ -5059,6 +5059,7 @@ int RTFDocumentImpl::popState() + case DESTINATION_SHAPEPROPERTYNAME: + case DESTINATION_SHAPEPROPERTYVALUE: + case DESTINATION_SHAPEPROPERTY: ++ if (!m_aStates.empty()) + { + m_aStates.top().aShape = aState.aShape; + m_aStates.top().aPicture = aState.aPicture; +-- +1.9.3 + diff --git a/0002-Resolves-fdo-86451-guard-all-the-tops-post-pop.patch b/0002-Resolves-fdo-86451-guard-all-the-tops-post-pop.patch new file mode 100644 index 0000000..fa084a0 --- /dev/null +++ b/0002-Resolves-fdo-86451-guard-all-the-tops-post-pop.patch @@ -0,0 +1,192 @@ +From 412e4879c5a1b3b65cc61bb54cb1f532ec01c4f4 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= +Date: Wed, 19 Nov 2014 12:14:08 +0000 +Subject: [PATCH 2/2] Resolves: fdo#86451 guard all the tops post pop + +Change-Id: I98be6f014893dfc7cee770c44cd9d0be32b39f5c +Reviewed-on: https://gerrit.libreoffice.org/12966 +Reviewed-by: Miklos Vajna +Tested-by: Miklos Vajna +--- + writerfilter/source/rtftok/rtfdocumentimpl.cxx | 84 ++++++++++++++++---------- + 1 file changed, 51 insertions(+), 33 deletions(-) + +diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx +index 965f914..25ac282 100644 +--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx ++++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx +@@ -4910,7 +4910,7 @@ int RTFDocumentImpl::popState() + case DESTINATION_PARAGRAPHNUMBERING: + { + RTFValue::Pointer_t pIdValue = aState.aTableAttributes.find(NS_rtf::LN_LSID); +- if (pIdValue.get()) ++ if (pIdValue.get() && !m_aStates.empty()) + { + // Abstract numbering + RTFSprms aLeveltextAttributes; +@@ -4979,18 +4979,21 @@ int RTFDocumentImpl::popState() + } + break; + case DESTINATION_PARAGRAPHNUMBERING_TEXTAFTER: ++ if (!m_aStates.empty()) + { + RTFValue::Pointer_t pValue(new RTFValue(aState.aDestinationText.makeStringAndClear(), true)); + m_aStates.top().aTableAttributes.set(NS_ooxml::LN_CT_LevelSuffix_val, pValue); + } + break; + case DESTINATION_PARAGRAPHNUMBERING_TEXTBEFORE: ++ if (!m_aStates.empty()) + { + RTFValue::Pointer_t pValue(new RTFValue(aState.aDestinationText.makeStringAndClear(), true)); + m_aStates.top().aTableAttributes.set(NS_ooxml::LN_CT_LevelText_val, pValue); + } + break; + case DESTINATION_LISTLEVEL: ++ if (!m_aStates.empty()) + { + RTFValue::Pointer_t pInnerValue(new RTFValue(m_aStates.top().nListLevelNum++)); + aState.aTableAttributes.set(NS_ooxml::LN_CT_Lvl_ilvl, pInnerValue); +@@ -5003,6 +5006,7 @@ int RTFDocumentImpl::popState() + } + break; + case DESTINATION_LFOLEVEL: ++ if (!m_aStates.empty()) + { + RTFValue::Pointer_t pInnerValue(new RTFValue(m_aStates.top().nListLevelNum++)); + aState.aTableAttributes.set(NS_ooxml::LN_CT_NumLvl_ilvl, pInnerValue); +@@ -5013,6 +5017,7 @@ int RTFDocumentImpl::popState() + break; + // list override table + case DESTINATION_LISTOVERRIDEENTRY: ++ if (!m_aStates.empty()) + { + if (m_aStates.top().nDestinationState == DESTINATION_LISTOVERRIDEENTRY) + { // copy properties upwards so upper popState inserts it +@@ -5029,32 +5034,38 @@ int RTFDocumentImpl::popState() + } + break; + case DESTINATION_LEVELTEXT: ++ if (!m_aStates.empty()) + { + RTFValue::Pointer_t pValue(new RTFValue(aState.aTableAttributes)); + m_aStates.top().aTableSprms.set(NS_ooxml::LN_CT_Lvl_lvlText, pValue); + } + break; + case DESTINATION_LEVELNUMBERS: +- m_aStates.top().aTableSprms = aState.aTableSprms; ++ if (!m_aStates.empty()) ++ m_aStates.top().aTableSprms = aState.aTableSprms; + break; + case DESTINATION_FIELDINSTRUCTION: +- m_aStates.top().nFieldStatus = FIELD_INSTRUCTION; ++ if (!m_aStates.empty()) ++ m_aStates.top().nFieldStatus = FIELD_INSTRUCTION; + break; + case DESTINATION_FIELDRESULT: +- m_aStates.top().nFieldStatus = FIELD_RESULT; ++ if (!m_aStates.empty()) ++ m_aStates.top().nFieldStatus = FIELD_RESULT; + break; + case DESTINATION_FIELD: + if (aState.nFieldStatus == FIELD_INSTRUCTION) + singleChar(0x15); + break; + case DESTINATION_SHAPEPROPERTYVALUEPICT: ++ if (!m_aStates.empty()) + { + m_aStates.top().aPicture = aState.aPicture; + m_aStates.top().aDestinationText = aState.aDestinationText; + } + break; + case DESTINATION_FALT: +- m_aStates.top().aTableSprms = aState.aTableSprms; ++ if (!m_aStates.empty()) ++ m_aStates.top().aTableSprms = aState.aTableSprms; + break; + case DESTINATION_SHAPEPROPERTYNAME: + case DESTINATION_SHAPEPROPERTYVALUE: +@@ -5069,19 +5080,23 @@ int RTFDocumentImpl::popState() + case DESTINATION_FLYMAINCONTENT: + case DESTINATION_SHPPICT: + case DESTINATION_SHAPE: +- m_aStates.top().aFrame = aState.aFrame; +- if (aState.nDestinationState == DESTINATION_SHPPICT && !m_aStates.empty() && m_aStates.top().nDestinationState == DESTINATION_LISTPICTURE) ++ if (!m_aStates.empty()) + { +- RTFSprms aAttributes; +- aAttributes.set(NS_ooxml::LN_CT_NumPicBullet_numPicBulletId, RTFValue::Pointer_t(new RTFValue(m_nListPictureId++))); +- RTFSprms aSprms; +- // Dummy value, real picture is already sent to dmapper. +- aSprms.set(NS_ooxml::LN_CT_NumPicBullet_pict, RTFValue::Pointer_t(new RTFValue(0))); +- RTFValue::Pointer_t pValue(new RTFValue(aAttributes, aSprms)); +- m_aListTableSprms.set(NS_ooxml::LN_CT_Numbering_numPicBullet, pValue, false); ++ m_aStates.top().aFrame = aState.aFrame; ++ if (aState.nDestinationState == DESTINATION_SHPPICT && m_aStates.top().nDestinationState == DESTINATION_LISTPICTURE) ++ { ++ RTFSprms aAttributes; ++ aAttributes.set(NS_ooxml::LN_CT_NumPicBullet_numPicBulletId, RTFValue::Pointer_t(new RTFValue(m_nListPictureId++))); ++ RTFSprms aSprms; ++ // Dummy value, real picture is already sent to dmapper. ++ aSprms.set(NS_ooxml::LN_CT_NumPicBullet_pict, RTFValue::Pointer_t(new RTFValue(0))); ++ RTFValue::Pointer_t pValue(new RTFValue(aAttributes, aSprms)); ++ m_aListTableSprms.set(NS_ooxml::LN_CT_Numbering_numPicBullet, pValue, false); ++ } + } + break; + case DESTINATION_TITLE: ++ if (!m_aStates.empty()) + { + if (m_aStates.top().nDestinationState == DESTINATION_TITLE) + // The parent is a title as well, just append what we have so far. +@@ -5092,26 +5107,29 @@ int RTFDocumentImpl::popState() + break; + case DESTINATION_SHAPETEXT: + // If we're leaving the shapetext group (it may have nested ones) and this is a shape, not an old drawingobject. +- if (m_aStates.top().nDestinationState != DESTINATION_SHAPETEXT && !m_aStates.top().aDrawingObject.bHadShapeText) ++ if (!m_aStates.empty()) + { +- m_aStates.top().bHadShapeText = true; +- if (!m_aStates.top().pCurrentBuffer) +- m_pSdrImport->close(); +- else +- m_aStates.top().pCurrentBuffer->push_back( +- Buf_t(BUFFER_ENDSHAPE)); +- } +- +- // It's allowed to declare these inside the the shape text, and they +- // are expected to have an effect for the whole shape. +- if (aState.aDrawingObject.nLeft) +- m_aStates.top().aDrawingObject.nLeft = aState.aDrawingObject.nLeft; +- if (aState.aDrawingObject.nTop) +- m_aStates.top().aDrawingObject.nTop = aState.aDrawingObject.nTop; +- if (aState.aDrawingObject.nRight) +- m_aStates.top().aDrawingObject.nRight = aState.aDrawingObject.nRight; +- if (aState.aDrawingObject.nBottom) +- m_aStates.top().aDrawingObject.nBottom = aState.aDrawingObject.nBottom; ++ if (m_aStates.top().nDestinationState != DESTINATION_SHAPETEXT && !m_aStates.top().aDrawingObject.bHadShapeText) ++ { ++ m_aStates.top().bHadShapeText = true; ++ if (!m_aStates.top().pCurrentBuffer) ++ m_pSdrImport->close(); ++ else ++ m_aStates.top().pCurrentBuffer->push_back( ++ Buf_t(BUFFER_ENDSHAPE)); ++ } ++ ++ // It's allowed to declare these inside the the shape text, and they ++ // are expected to have an effect for the whole shape. ++ if (aState.aDrawingObject.nLeft) ++ m_aStates.top().aDrawingObject.nLeft = aState.aDrawingObject.nLeft; ++ if (aState.aDrawingObject.nTop) ++ m_aStates.top().aDrawingObject.nTop = aState.aDrawingObject.nTop; ++ if (aState.aDrawingObject.nRight) ++ m_aStates.top().aDrawingObject.nRight = aState.aDrawingObject.nRight; ++ if (aState.aDrawingObject.nBottom) ++ m_aStates.top().aDrawingObject.nBottom = aState.aDrawingObject.nBottom; ++ } + break; + default: + { +-- +1.9.3 + diff --git a/libreoffice.spec b/libreoffice.spec index 98b02e9..66bcc00 100644 --- a/libreoffice.spec +++ b/libreoffice.spec @@ -36,7 +36,7 @@ Summary: Free Software Productivity Suite Name: libreoffice Epoch: 1 Version: %{libo_version}.2 -Release: 8%{?libo_prerelease}%{?dist} +Release: 9%{?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/ @@ -323,6 +323,8 @@ Patch67: 0001-Resolves-fdo-65634-improve-wheel-scrolling-sidebar-p.patch Patch68: 0001-Related-fdo-65634-make-sidebar-react-to-resizes-when.patch Patch69: 0001-table-layout-cache-returns-wrong-rectangle.patch Patch70: 0001-impress-tables-are-not-interactively-growing.patch +Patch71: 0001-Resolves-fdo-86449-backport-rtf-fixes.patch +Patch72: 0002-Resolves-fdo-86451-guard-all-the-tops-post-pop.patch %define instdir %{_libdir} %define baseinstdir %{instdir}/libreoffice @@ -2264,6 +2266,9 @@ update-desktop-database %{_datadir}/applications &> /dev/null || : %endif %changelog +* Wed Nov 19 2014 Caolán McNamara - 1:4.2.7.2-9 +- Resolves: rhbz#1165740 arbitrarily backport some rtf crash fixes + * Wed Nov 19 2014 Caolán McNamara - 1:4.2.7.2-8 - table resizing etc in impress is mangled