summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport5.cxx6
-rw-r--r--writerfilter/source/dmapper/SettingsTable.cxx17
2 files changed, 23 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx
index 2e7fa5962fb8..470e47714940 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx
@@ -1007,6 +1007,12 @@ DECLARE_OOXMLEXPORT_TEST(tdf89991_revisionView, "tdf89991.docx")
{
assertXPath(pXmlSettings, "/w:settings/w:revisionView", "insDel", "0");
assertXPath(pXmlSettings, "/w:settings/w:revisionView", "formatting", "0");
+
+ // There was no compatibilityMode defined.
+ // 12: Use word processing features specified in ECMA-376. This is the default.
+ assertXPath(pXmlSettings, "/w:settings/w:compat/w:compatSetting[1]", "name", "compatibilityMode");
+ assertXPath(pXmlSettings, "/w:settings/w:compat/w:compatSetting[1]", "uri", "http://schemas.microsoft.com/office/word");
+ assertXPath(pXmlSettings, "/w:settings/w:compat/w:compatSetting[1]", "val", "12");
}
}
diff --git a/writerfilter/source/dmapper/SettingsTable.cxx b/writerfilter/source/dmapper/SettingsTable.cxx
index 7028f06e7fe9..71bff9b68dab 100644
--- a/writerfilter/source/dmapper/SettingsTable.cxx
+++ b/writerfilter/source/dmapper/SettingsTable.cxx
@@ -29,6 +29,7 @@
#include <com/sun/star/container/XNameContainer.hpp>
#include <com/sun/star/style/XStyle.hpp>
#include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
+#include <comphelper/propertysequence.hxx>
#include <comphelper/sequence.hxx>
#include <ooxml/resourceids.hxx>
#include "ConversionHelper.hxx"
@@ -683,6 +684,22 @@ uno::Sequence<beans::PropertyValue> const & SettingsTable::GetThemeFontLangPrope
uno::Sequence<beans::PropertyValue> SettingsTable::GetCompatSettings() const
{
+ if ( GetWordCompatibilityMode() == -1 )
+ {
+ // the default value for an undefined compatibilityMode is 12 (Word 2007)
+ uno::Sequence<beans::PropertyValue> aCompatSetting( comphelper::InitPropertySequence({
+ { "name", uno::Any(OUString("compatibilityMode")) },
+ { "uri", uno::Any(OUString("http://schemas.microsoft.com/office/word")) },
+ { "val", uno::Any(OUString("12")) } //12: Use word processing features specified in ECMA-376. This is the default.
+ }));
+
+ beans::PropertyValue aValue;
+ aValue.Name = "compatSetting";
+ aValue.Value <<= aCompatSetting;
+
+ m_pImpl->m_aCompatSettings.push_back(aValue);
+ }
+
return comphelper::containerToSequence(m_pImpl->m_aCompatSettings);
}