summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/qa/extras/ooxmlimport/data/tdf101626.docxbin0 -> 12420 bytes
-rw-r--r--sw/qa/extras/ooxmlimport/ooxmlimport.cxx21
-rw-r--r--writerfilter/source/dmapper/NumberingManager.cxx8
3 files changed, 28 insertions, 1 deletions
diff --git a/sw/qa/extras/ooxmlimport/data/tdf101626.docx b/sw/qa/extras/ooxmlimport/data/tdf101626.docx
new file mode 100644
index 000000000000..8cbf8036d18b
--- /dev/null
+++ b/sw/qa/extras/ooxmlimport/data/tdf101626.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index 58d0677c25c8..ce711756fd46 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -1374,6 +1374,27 @@ DECLARE_OOXMLIMPORT_TEST(testTdf96218, "tdf96218.docx")
CPPUNIT_ASSERT(!getProperty<bool>(getShape(1), "IsFollowingTextFlow"));
}
+DECLARE_OOXMLIMPORT_TEST(testTdf101626, "tdf101626.docx")
+{
+ // Transform soft-hyphen to hard-hyphen as list bulletChar to avoid missing ymbols in export
+ uno::Reference<beans::XPropertySet> xPropertySet(getStyles("NumberingStyles")->getByName("WWNum1"), uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> xLevels(xPropertySet->getPropertyValue("NumberingRules"), uno::UNO_QUERY);
+ uno::Sequence<beans::PropertyValue> aProps;
+ xLevels->getByIndex(0) >>= aProps; // 1st level
+
+ for (int i = 0; i < aProps.getLength(); ++i)
+ {
+ const beans::PropertyValue& rProp = aProps[i];
+
+ if (rProp.Name == "BulletChar")
+ {
+ // the bulletChar has to be 0x2d!
+ CPPUNIT_ASSERT_EQUAL(OUString("\x2d", 1, RTL_TEXTENCODING_UTF8), rProp.Value.get<OUString>());
+ return;
+ }
+ }
+}
+
// tests should only be added to ooxmlIMPORT *if* they fail round-tripping in ooxmlEXPORT
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/writerfilter/source/dmapper/NumberingManager.cxx b/writerfilter/source/dmapper/NumberingManager.cxx
index 3867b00754bf..965fd2705550 100644
--- a/writerfilter/source/dmapper/NumberingManager.cxx
+++ b/writerfilter/source/dmapper/NumberingManager.cxx
@@ -724,7 +724,13 @@ void ListsManager::lcl_attribute( Id nName, Value& rVal )
//the Writer supports only a number of upper levels to show, separators is always a dot
//and each level can have a prefix and a suffix
if(pCurrentLvl.get())
- pCurrentLvl->SetBulletChar( rVal.getString() );
+ {
+ //if the BulletChar is a soft-hyphen (0xad)
+ //replace it with a hard-hyphen (0x2d)
+ //-> this fixes missing hyphen export in PDF etc.
+ // see tdf#101626
+ pCurrentLvl->SetBulletChar( rVal.getString().replace( 0xad, 0x2d ) );
+ }
}
break;
case NS_ooxml::LN_CT_Lvl_start: