diff --git a/0001-DOCX-import-fix-handling-of-dropdown-SDT-around-cell.patch b/0001-DOCX-import-fix-handling-of-dropdown-SDT-around-cell.patch new file mode 100644 index 0000000..4ae3f42 --- /dev/null +++ b/0001-DOCX-import-fix-handling-of-dropdown-SDT-around-cell.patch @@ -0,0 +1,82 @@ +From 5088f61598827693b7f0d90386a24d39325a186b Mon Sep 17 00:00:00 2001 +From: Miklos Vajna +Date: Thu, 18 Sep 2014 15:47:59 +0200 +Subject: [PATCH] DOCX import: fix handling of dropdown SDT around cell + +There were two problems here: + +1) The CT_SdtContentCell handlers didn't emit the usual +NS_ooxml::LN_CT_SdtBlock_sdtContent / +NS_ooxml::LN_CT_SdtBlock_sdtEndContent tokens, so the dropdown control +was not created (and then was created with the wrong anchor). + +2) In case the SDT was around the cell, the newline character was also +added to the text of the currently selected entry, resulting in an +invalid argument of SwXText::convertToTable(), so no table was created. + +(cherry picked from commit 419054c0f19acb323a0e51c7ef49a1a2d9f42ac8) + +Conflicts: + sw/qa/extras/ooxmlexport/ooxmlexport.cxx + writerfilter/source/dmapper/DomainMapper.cxx + writerfilter/source/ooxml/model.xml + +Change-Id: I4806626181f40c6d26ff7b25f5dbb863967d8077 +--- + writerfilter/source/dmapper/DomainMapper.cxx | 14 +++++++++++--- + writerfilter/source/ooxml/model.xml | 5 ++++- + 2 files changed, 15 insertions(+), 4 deletions(-) + +diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx +index 44efb59..baf91d9 100644 +--- a/writerfilter/source/dmapper/DomainMapper.cxx ++++ b/writerfilter/source/dmapper/DomainMapper.cxx +@@ -2768,10 +2768,18 @@ void DomainMapper::lcl_utext(const sal_uInt8 * data_, size_t len) + aBuffer.append( (const sal_Unicode *) data_, len); + sText = aBuffer.makeStringAndClear(); + ++ ++ bool bNewLine = len == 1 && (sText[0] == 0x0d || sText[0] == 0x07); + if (!m_pImpl->m_pSdtHelper->getDropDownItems().empty()) + { +- m_pImpl->m_pSdtHelper->getSdtTexts().append(sText); +- return; ++ if (bNewLine) ++ // Dropdown control has single-line texts, so in case of newline, create the control. ++ m_pImpl->m_pSdtHelper->createDropDownControl(); ++ else ++ { ++ m_pImpl->m_pSdtHelper->getSdtTexts().append(sText); ++ return; ++ } + } + else if (!m_pImpl->m_pSdtHelper->getDateFormat().isEmpty()) + { +@@ -2814,7 +2822,7 @@ void DomainMapper::lcl_utext(const sal_uInt8 * data_, size_t len) + { + m_pImpl->getTableManager().utext(data_, len); + +- if(len == 1 && (sText[0] == 0x0d || sText[0] == 0x07)) ++ if (bNewLine) + { + if (m_pImpl->m_bIgnoreNextPara) + { +diff --git a/writerfilter/source/ooxml/model.xml b/writerfilter/source/ooxml/model.xml +index 69ac296..3f4e71c 100644 +--- a/writerfilter/source/ooxml/model.xml ++++ b/writerfilter/source/ooxml/model.xml +@@ -25033,7 +25033,10 @@ + + + +- ++ ++ ++ ++ + + + +-- +2.1.0 + diff --git a/libreoffice.spec b/libreoffice.spec index bfcfbc8..feae828 100644 --- a/libreoffice.spec +++ b/libreoffice.spec @@ -376,6 +376,7 @@ Patch67: 0001-tdf-87400-sw-fix-SwIndexReg-assertion-in-AutoCorrect.patch Patch68: 0002-sw-fix-crash-on-SwUndoDelete-after-select-all-with-t.patch Patch69: 0003-rhbz-1205072-sw-resource-mangement-SNAFU-caused-by-S.patch Patch70: 0004-sw-fix-SwAccessibleParagraph-crash-on-delete.patch +Patch71: 0001-DOCX-import-fix-handling-of-dropdown-SDT-around-cell.patch %define instdir %{_libdir} %define baseinstdir %{instdir}/libreoffice @@ -2353,9 +2354,10 @@ update-desktop-database %{_datadir}/applications &> /dev/null || : %endif %changelog -* Fri Apr 24 2015 Caolán McNamara - 1:4.3.7.2-4.UNBUILT +* Fri Apr 24 2015 Caolán McNamara - 1:4.3.7.2-4 - Resolves: tdf#87400 ~SwIndexReg assertion in AutoCorrect - Resolves: rhbz#1205072 Writer crash when copying to clipboard +- Resolves: rhbz#1217569 import crash on loading specific .docx * Fri Apr 24 2015 Caolán McNamara - 1:4.3.7.2-3 - Resolves: rhbz#1198848 fix DOCX redline import crash