summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2018-11-12 15:07:58 +0300
committerCaolán McNamara <caolanm@redhat.com>2018-11-19 16:02:28 +0100
commit7c7f46faa213d9c20bf5cebcc72b0f5dc86b0248 (patch)
tree4db4419052b8caeee9e3584ddf4913cdea8dc72f /sw/qa
parent21467c1c0fea676a33c7b7e75648947efea18fcb (diff)
tdf#120677: restore treatment of blanks in SwTextGuess::Guess
Before commit 0be3db28a4db4d2c81a5cb2edd48711eec55b51b, all non-breakable spaces were converted to plain spaces in SwTextSlot::SwTextSlot (see pInf->SetText call there). The mentioned commit has changed that to allow differentiating non-breakable spaces from other types of spaces (related to the fix of tdf#115067). This broke following processing of the NBSPs when they don't fit to line, causing infinite layout loop leading to OOM. This allows to restore old behavior to not call the break iterator for NBSP by explicitly checking for it. Change-Id: I36ab06abb66bbe65a5fc542c41e816a9f20a2dcf Reviewed-on: https://gerrit.libreoffice.org/63290 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> (cherry picked from commit 4bb28ad217ea9d6511b6921dcd3d28328edcb4d6) Reviewed-on: https://gerrit.libreoffice.org/63304 Tested-by: Xisco Faulí <xiscofauli@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw/qa')
-rw-r--r--sw/qa/extras/odfimport/data/tdf120677.fodt13
-rw-r--r--sw/qa/extras/odfimport/odfimport.cxx5
2 files changed, 18 insertions, 0 deletions
diff --git a/sw/qa/extras/odfimport/data/tdf120677.fodt b/sw/qa/extras/odfimport/data/tdf120677.fodt
new file mode 100644
index 000000000000..b2006828fb10
--- /dev/null
+++ b/sw/qa/extras/odfimport/data/tdf120677.fodt
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<office:document xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" office:version="1.2" office:mimetype="application/vnd.oasis.opendocument.text">
+ <office:body>
+ <office:text>
+ <text:p><draw:frame draw:name="Frame1" text:anchor-type="char" svg:width="0cm" svg:height="2cm">
+ <draw:text-box>
+ <text:p>. </text:p><!-- The "space" here is non-breaking space -->
+ </draw:text-box>
+ </draw:frame></text:p>
+ </office:text>
+ </office:body>
+</office:document> \ No newline at end of file
diff --git a/sw/qa/extras/odfimport/odfimport.cxx b/sw/qa/extras/odfimport/odfimport.cxx
index 3b879d9f82ff..88f3564e3be3 100644
--- a/sw/qa/extras/odfimport/odfimport.cxx
+++ b/sw/qa/extras/odfimport/odfimport.cxx
@@ -910,5 +910,10 @@ DECLARE_ODFIMPORT_TEST(testTdf116195, "tdf116195.odt")
);
}
+DECLARE_ODFIMPORT_TEST(testTdf120677, "tdf120677.fodt")
+{
+ // The document used to hang the layout, consuming memory until OOM
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */