diff --git a/bsc1174465.diff b/bsc1174465.diff new file mode 100644 index 0000000..170f29d --- /dev/null +++ b/bsc1174465.diff @@ -0,0 +1,117 @@ +From f767b83d1c5493815708135f0f2aec03e47615ac Mon Sep 17 00:00:00 2001 +From: Miklos Vajna +Date: Fri, 12 Feb 2021 17:22:57 +0100 +Subject: [PATCH] svx: fix import of multiple paragraphs into title shapes +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Title shapes try hard to have a single paragraph only, the Impress UI +inserts linebreaks instead of paragraphs breaks in +sd::FuText::KeyInput(), ever since commit +f47a9d9db3d06927380bb79b04bb6d4721a92d2b (initial import, 2000-09-18). +This matches the PowerPoint behavior. This is most visible when the +paragraph has a bullet associated with it. + +Interestingly you can still put multiple paragraphs into title shapes +using paste special -> plain text. + +In that case, it was inconsistent that we exported these multiple +paragraphs to ODP, but merged them to a single paragraph on import since +commit 0a783c1a041e2b74b7bf238d11ee2c303f6708f4 (#100190# don't allow +more then one paragraph on title text objects, 2002-06-25). + +This results in loosing your bullets on save + open, both in the ODP and +PPTX cases, since removeActionLock() on the XShape triggers this tweak. +Also, PowerPoint does not do this merging on import. So fix the problem +by removing the import-time tweak but leave the UI unchanged. + +(cherry picked from commit 043690eff82d5798774452a8364e1566b866a320) + +Change-Id: I6796f83c40e83f65cfb0f6c7e66069c3e08c1e2d +Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110900 +Tested-by: Jenkins +Reviewed-by: Gülşah Köse +Reviewed-by: Caolán McNamara +--- + svx/qa/unit/unodraw.cxx | 33 +++++++++++++++++++++++++++++++++ + svx/source/unodraw/unoshtxt.cxx | 12 ------------ + 2 files changed, 33 insertions(+), 12 deletions(-) + +diff --git a/svx/qa/unit/unodraw.cxx b/svx/qa/unit/unodraw.cxx +index 938e44f9ca21..d8e7c03183d1 100644 +--- a/svx/qa/unit/unodraw.cxx ++++ b/svx/qa/unit/unodraw.cxx +@@ -18,6 +18,7 @@ + #include + #include + #include ++#include + + #include + #include +@@ -175,6 +176,38 @@ CPPUNIT_TEST_FIXTURE(UnodrawTest, testTableShadowDirect) + // which has no shadow for cell text (only for cell borders and cell background). + assertXPath(pDocument, "//shadow//sdrblocktext", /*nNumberOfNodes=*/0); + } ++ ++CPPUNIT_TEST_FIXTURE(UnodrawTest, testTitleShapeBullets) ++{ ++ // Create a title shape with 2 paragraphs in it. ++ mxComponent = loadFromDesktop("private:factory/simpress", ++ "com.sun.star.presentation.PresentationDocument"); ++ uno::Reference xSupplier(mxComponent, uno::UNO_QUERY); ++ uno::Reference xDrawPages = xSupplier->getDrawPages(); ++ uno::Reference xDrawPage(xDrawPages->getByIndex(0), uno::UNO_QUERY); ++ // A default document contains a title shape and a text shape on the first slide. ++ uno::Reference xTitleShape(xDrawPage->getByIndex(0), uno::UNO_QUERY); ++ uno::Reference xTitleShapeInfo(xTitleShape, uno::UNO_QUERY); ++ CPPUNIT_ASSERT(xTitleShapeInfo->supportsService("com.sun.star.presentation.TitleTextShape")); ++ uno::Reference xTitleShapeText(xTitleShape, uno::UNO_QUERY); ++ uno::Reference xText = xTitleShapeText->getText(); ++ uno::Reference xCursor = xText->createTextCursor(); ++ xText->insertString(xCursor, "foo", /*bAbsorb=*/false); ++ xText->insertControlCharacter(xCursor, text::ControlCharacter::APPEND_PARAGRAPH, ++ /*bAbsorb=*/false); ++ xText->insertString(xCursor, "bar", /*bAbsorb=*/false); ++ ++ // Check that the title shape has 2 paragraphs. ++ uno::Reference xTextEA(xText, uno::UNO_QUERY); ++ uno::Reference xTextE = xTextEA->createEnumeration(); ++ // Has a first paragraph. ++ CPPUNIT_ASSERT(xTextE->hasMoreElements()); ++ xTextE->nextElement(); ++ // Has a second paragraph. ++ // Without the accompanying fix in place, this test would have failed, because the 2 paragraphs ++ // were merged together (e.g. 1 bullet instead of 2 bullets for bulleted paragraphs). ++ CPPUNIT_ASSERT(xTextE->hasMoreElements()); ++} + } + + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ +diff --git a/svx/source/unodraw/unoshtxt.cxx b/svx/source/unodraw/unoshtxt.cxx +index 7f2a8af49606..39cad52c073b 100644 +--- a/svx/source/unodraw/unoshtxt.cxx ++++ b/svx/source/unodraw/unoshtxt.cxx +@@ -780,18 +780,6 @@ void SvxTextEditSourceImpl::UpdateData() + { + if( mpOutliner->GetParagraphCount() != 1 || mpOutliner->GetEditEngine().GetTextLen( 0 ) ) + { +- if( mpOutliner->GetParagraphCount() > 1 ) +- { +- if (pTextObj->IsTextFrame() && pTextObj->GetTextKind() == OBJ_TITLETEXT) +- { +- while( mpOutliner->GetParagraphCount() > 1 ) +- { +- ESelection aSel( 0,mpOutliner->GetEditEngine().GetTextLen( 0 ), 1,0 ); +- mpOutliner->QuickInsertLineBreak( aSel ); +- } +- } +- } +- + pTextObj->NbcSetOutlinerParaObjectForText( mpOutliner->CreateParaObject(), mpText ); + } + else +-- +2.26.2 + diff --git a/libreoffice.changes b/libreoffice.changes index f719b7d..0161144 100644 --- a/libreoffice.changes +++ b/libreoffice.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri Feb 19 13:35:18 UTC 2021 - Andras Timar + +- Fix bsc#1174465 - LO-L3: Impress in TW (7.0.0.0-beta2) messes up bullet points + * bsc1174465.diff + ------------------------------------------------------------------- Fri Feb 12 08:07:45 UTC 2021 - Markéta Machová diff --git a/libreoffice.spec b/libreoffice.spec index 16cc489..973be19 100644 --- a/libreoffice.spec +++ b/libreoffice.spec @@ -103,6 +103,8 @@ Patch3: mediawiki-no-broken-help.diff Patch4: use-comphelper.patch # Bug 1177955 - LO-L3: SmartArt: text wrongly aligned, background boxes not quite right,... Patch10: bsc1177955.diff +# Bug 1174465 - LO-L3: Impress in TW (7.0.0.0-beta2) messes up bullet points +Patch11: bsc1174465.diff # try to save space by using hardlinks Patch990: install-with-hardlinks.diff # save time by relying on rpm check rather than doing stupid find+grep @@ -963,6 +965,7 @@ Provides %{langname} translations and additional resources (help files, etc.) fo %patch3 %patch4 -p1 %patch10 -p1 +%patch11 -p1 %patch990 -p1 %patch991 -p1