diff options
author | Jan Holesovsky <kendy@collabora.com> | 2013-11-20 11:45:39 +0100 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2013-11-29 16:51:45 +0100 |
commit | 75f1b02da8712d1ce5041a751e907c4d79c408c6 (patch) | |
tree | fb5e943393e1071636a14ac790c8c262e2a9bd5e | |
parent | 54b092ba3d19fe4f91c0eaaa74bc697007b2768c (diff) |
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.
Conflicts:
sw/qa/extras/ooxmlexport/ooxmlexport.cxx
sw/source/core/doc/docredln.cxx
Change-Id: I475fa63f9a4a3219a2b898b6f7d81e0603d32c18
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/bnc837302.docx | bin | 0 -> 13904 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 13 | ||||
-rw-r--r-- | sw/source/core/doc/docredln.cxx | 3 |
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 Binary files differnew file mode 100644 index 000000000000..9d0c0af68b8f --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/bnc837302.docx diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index e578be8155ea..f68b3b62b900 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -66,6 +66,7 @@ public: void testTableBorders(); void testFdo51550(); void testN789482(); + void testBnc837302(); CPPUNIT_TEST_SUITE(Test); #if !defined(MACOSX) && !defined(WNT) @@ -104,6 +105,7 @@ void Test::run() {"table-borders.docx", &Test::testTableBorders}, {"fdo51550.odt", &Test::testFdo51550}, {"n789482.docx", &Test::testN789482}, + {"bnc837302.docx", &Test::testBnc837302}, }; // Don't test the first import of these, for some reason those tests fail const char* aBlacklist[] = { @@ -501,6 +503,17 @@ void Test::testN789482() getRun(xParagraph, 5, " After."); } +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 729d144d6ba8..d6edd762e0cc 100644 --- a/sw/source/core/doc/docredln.cxx +++ b/sw/source/core/doc/docredln.cxx @@ -297,8 +297,7 @@ bool SwDoc::AppendRedline( SwRedline* pNewRedl, bool bCallDelete ) bool bError = true; _CHECK_REDLINE( this ) - if( IsRedlineOn() && !IsShowOriginal( eRedlineMode ) && - pNewRedl->GetAuthorString().Len() ) + if (IsRedlineOn() && !IsShowOriginal(eRedlineMode)) { pNewRedl->InvalidateRange(); |