summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2013-11-20 11:45:39 +0100
committerAndras Timar <andras.timar@collabora.com>2013-12-03 20:45:23 +0100
commit6837d5ef4120c964735ba1a5d4f47c5ba76d5c1c (patch)
treecc3b1ec2e72c247f9f22e4eafab822910ecc096a
parentCompiler warning. (diff)
downloadcore-6837d5ef4120c964735ba1a5d4f47c5ba76d5c1c.tar.gz
core-6837d5ef4120c964735ba1a5d4f47c5ba76d5c1c.zip
bnc#837302: Allow insertion of redlines with an empty author.
No idea why that was not allowed (since the initial import in 2000), we need it for interoperability. Signed-off-by: Andras Timar <andras.timar@collabora.com> Conflicts: sw/qa/extras/ooxmlexport/ooxmlexport.cxx sw/source/core/doc/docredln.cxx Change-Id: I475fa63f9a4a3219a2b898b6f7d81e0603d32c18 Reviewed-on: https://gerrit.libreoffice.org/6897 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> Signed-off-by: Andras Timar <andras.timar@collabora.com>
-rw-r--r--sw/qa/extras/ooxmlexport/data/bnc837302.docxbin0 -> 13904 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport.cxx13
-rw-r--r--sw/source/core/doc/docredln.cxx3
3 files changed, 14 insertions, 2 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/bnc837302.docx b/sw/qa/extras/ooxmlexport/data/bnc837302.docx
new file mode 100644
index 000000000000..9d0c0af68b8f
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/bnc837302.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index c1bb45e40de4..d7a5c8bc5527 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -77,6 +77,7 @@ public:
void testBnc834035();
void testCp1000015();
void testFdo70812();
+ void testBnc837302();
CPPUNIT_TEST_SUITE(Test);
#if !defined(MACOSX) && !defined(WNT)
@@ -138,6 +139,7 @@ void Test::run()
{"bnc834035.odt", &Test::testBnc834035},
{"cp1000015.odt", &Test::testCp1000015},
{"fdo70812.docx", &Test::testFdo70812},
+ {"bnc837302.docx", &Test::testBnc837302},
};
// Don't test the first import of these, for some reason those tests fail
const char* aBlacklist[] = {
@@ -789,6 +791,17 @@ void Test::testFdo70812()
getParagraph(1, "Sample pages document.");
}
+void Test::testBnc837302()
+{
+ // The problem was that text with empty author was not inserted as a redline
+ uno::Reference<text::XTextRange> xParagraph = getParagraph(1);
+
+ // previously 'AAA' was not an own run
+ getRun(xParagraph, 3, "AAA");
+ // interestingly the 'Insert' is set on the _previous_ run
+ CPPUNIT_ASSERT_EQUAL(OUString("Insert"), getProperty<OUString>(getRun(xParagraph, 2), "RedlineType"));
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(Test);
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx
index a6a92a144543..1e9a073523d8 100644
--- a/sw/source/core/doc/docredln.cxx
+++ b/sw/source/core/doc/docredln.cxx
@@ -293,8 +293,7 @@ bool SwDoc::AppendRedline( SwRedline* pNewRedl, bool bCallDelete )
bool bError = true;
_CHECK_REDLINE( this )
- if( IsRedlineOn() && !IsShowOriginal( meRedlineMode ) &&
- pNewRedl->GetAuthorString().Len() )
+ if (IsRedlineOn() && !IsShowOriginal(meRedlineMode))
{
pNewRedl->InvalidateRange();