summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2016-01-19 09:27:19 +0100
committerTomaž Vajngerl <quikee@gmail.com>2016-02-12 20:37:43 +0000
commit10a142356a4cdb487da10d83857e4b50a0452a5b (patch)
treebf1495141d2dc5f517f6ab292734c60e3dd4e30e
parent7f93dba17d397c5bf265504e8fbecd6b615e1787 (diff)
tdf#85523 DOCX import: fix unexpected extra char at comment end
Change-Id: Ic3eb073d11a395a81b90fd1a9292d6ecf2940c09 (cherry picked from commit 39969defa29948d77565a7cd8a3471baaec8f35d) Reviewed-on: https://gerrit.libreoffice.org/22306 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
-rw-r--r--sw/qa/extras/ooxmlimport/data/tdf85523.docxbin0 -> 21015 bytes
-rw-r--r--sw/qa/extras/ooxmlimport/ooxmlimport.cxx8
-rw-r--r--writerfilter/source/dmapper/DomainMapper_Impl.cxx3
3 files changed, 10 insertions, 1 deletions
diff --git a/sw/qa/extras/ooxmlimport/data/tdf85523.docx b/sw/qa/extras/ooxmlimport/data/tdf85523.docx
new file mode 100644
index 000000000000..cd31ae43e442
--- /dev/null
+++ b/sw/qa/extras/ooxmlimport/data/tdf85523.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index a83d683da96a..424e5f6d120c 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -2114,6 +2114,14 @@ DECLARE_OOXMLIMPORT_TEST(testAnnotationFormatting, "annotation-formatting.docx")
CPPUNIT_ASSERT_EQUAL(awt::FontUnderline::SINGLE, getProperty<sal_Int16>(getRun(xParagraph, 1), "CharUnderline"));
}
+DECLARE_OOXMLIMPORT_TEST(testTdf85523, "tdf85523.docx")
+{
+ auto xTextField = getProperty< uno::Reference<beans::XPropertySet> >(getRun(getParagraph(1), 6), "TextField");
+ auto xText = getProperty< uno::Reference<text::XText> >(xTextField, "TextRange");
+ // This was "commentX": an unexpected extra char was added at the comment end.
+ getParagraphOfText(1, xText, "comment");
+}
+
DECLARE_OOXMLIMPORT_TEST(testDMLGroupShapeRunFonts, "dml-groupshape-runfonts.docx")
{
// Fonts defined by w:rFonts was not imported and so the font specified by a:fontRef was used.
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 363d300fca2a..02a965a682d1 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -1139,9 +1139,10 @@ void DomainMapper_Impl::finishParagraph( PropertyMapPtr pPropertyMap )
else
{
uno::Reference<text::XTextCursor> xCursor;
- if (m_bParaHadField)
+ if (m_bParaHadField && !m_bIsInComments)
{
// Workaround to make sure char props of the field are not lost.
+ // Not relevant for editeng-based comments.
OUString sMarker("X");
xCursor = xTextAppend->getText()->createTextCursor();
if (xCursor.is())