summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndras Timar <andras.timar@collabora.com>2013-10-16 09:29:56 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2013-10-16 13:21:32 +0200
commit7ee2ce24c4060e16b6aa852edfcbe5c531c89b6e (patch)
tree86d2f3c9b65e24f41091bc49c40b9e878902de4c
parentf9768de91e1d6e6c58cf8c09dd1a4dc23877c2ba (diff)
fdo#69548 do not remove last space from hyperlink target
Conflicts: sw/qa/extras/ooxmlimport/ooxmlimport.cxx Change-Id: I7efd68fe21dddd7d9262d3e0b7400db67504e6bc
-rw-r--r--sw/qa/extras/ooxmlimport/data/fdo69548.docxbin0 -> 3802 bytes
-rw-r--r--sw/qa/extras/ooxmlimport/ooxmlimport.cxx8
-rw-r--r--writerfilter/source/dmapper/DomainMapper_Impl.cxx10
3 files changed, 11 insertions, 7 deletions
diff --git a/sw/qa/extras/ooxmlimport/data/fdo69548.docx b/sw/qa/extras/ooxmlimport/data/fdo69548.docx
new file mode 100644
index 000000000000..6799f5ef26bf
--- /dev/null
+++ b/sw/qa/extras/ooxmlimport/data/fdo69548.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index 7fe9b40ab06c..fa5a4b6cd7f4 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -142,6 +142,7 @@ public:
void testFdo43093();
void testMultiColumnSeparator();
void testSmartart();
+ void testFdo69548();
CPPUNIT_TEST_SUITE(Test);
#if !defined(WNT)
@@ -247,6 +248,7 @@ void Test::run()
{"fdo43093.docx", &Test::testFdo43093},
{"multi-column-separator-with-line.docx", &Test::testMultiColumnSeparator},
{"smartart.docx", &Test::testSmartart},
+ {"fdo69548.docx", &Test::testFdo69548},
};
header();
for (unsigned int i = 0; i < SAL_N_ELEMENTS(aMethods); ++i)
@@ -1683,6 +1685,12 @@ void Test::testMultiColumnSeparator()
CPPUNIT_ASSERT(bValue);
}
+void Test::testFdo69548()
+{
+ // The problem was that the last space in target URL was removed
+ CPPUNIT_ASSERT_EQUAL(OUString("#this is a bookmark"), getProperty<OUString>(getRun(getParagraph(1), 1), "HyperLinkURL"));
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(Test);
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 1be428995d3c..2150362a9ee0 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -2225,14 +2225,10 @@ void FieldContext::AppendCommand(const OUString& rPart)
if (bInString)
{
- if (bInStringNext)
- {
- sPart += OUString(' ');
- sPart += sToken;
- }
- else
+ sPart += OUString(' ');
+ sPart += sToken;
+ if (!bInStringNext)
{
- sPart += sToken;
aResult.push_back(sPart);
}
}