summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/source/filter/html/wrthtml.cxx118
-rw-r--r--sw/source/filter/html/wrthtml.hxx2
2 files changed, 95 insertions, 25 deletions
diff --git a/sw/source/filter/html/wrthtml.cxx b/sw/source/filter/html/wrthtml.cxx
index 2f83734aee37..e5ac25005de0 100644
--- a/sw/source/filter/html/wrthtml.cxx
+++ b/sw/source/filter/html/wrthtml.cxx
@@ -194,49 +194,117 @@ void SwHTMLWriter::SetupFilterOptions(SfxMedium& rMedium)
const OUString sFilterOptions = static_cast<const SfxStringItem*>(pItem)->GetValue();
SetupFilterOptions(sFilterOptions);
- comphelper::SequenceAsHashMap aStoreMap(rMedium.GetArgs());
- auto it = aStoreMap.find("RTFOLEMimeType");
- if (it == aStoreMap.end())
- {
- return;
- }
-
- it->second >>= m_aRTFOLEMimeType;
+ SetupFilterFromPropertyValues(rMedium.GetArgs());
}
void SwHTMLWriter::SetupFilterOptions(const OUString& rFilterOptions)
{
- if (rFilterOptions == "SkipImages")
+ comphelper::SequenceAsHashMap aStoreMap;
+ if (rFilterOptions.indexOf("SkipImages") >= 0)
{
- mbSkipImages = true;
+ aStoreMap["SkipImages"] <<= true;
}
- else if (rFilterOptions == "SkipHeaderFooter")
+ else if (rFilterOptions.indexOf("SkipHeaderFooter") >= 0)
{
- mbSkipHeaderFooter = true;
+ aStoreMap["SkipHeaderFooter"] <<= true;
}
- else if (rFilterOptions == "EmbedImages")
+ else if (rFilterOptions.indexOf("EmbedImages") >= 0)
{
- mbEmbedImages = true;
+ aStoreMap["EmbedImages"] <<= true;
}
- const uno::Sequence<OUString> aOptionSeq = comphelper::string::convertCommaSeparated(rFilterOptions);
+ // this option can be "on" together with any of above
+ if (rFilterOptions.indexOf("NoLineLimit") >= 0)
+ {
+ aStoreMap["NoLineLimit"] <<= true;
+ }
+
+ const uno::Sequence<OUString> aOptionSeq
+ = comphelper::string::convertCommaSeparated(rFilterOptions);
const OUString aXhtmlNsKey("xhtmlns=");
for (const auto& rOption : aOptionSeq)
{
if (rOption == "XHTML")
- mbXHTML = true;
+ {
+ aStoreMap["XHTML"] <<= true;
+ }
else if (rOption.startsWith(aXhtmlNsKey))
{
- maNamespace = rOption.copy(aXhtmlNsKey.getLength()).toUtf8();
- if (maNamespace == "reqif-xhtml")
- {
- mbReqIF = true;
- // XHTML is always just a fragment inside ReqIF.
- mbSkipHeaderFooter = true;
- }
- // XHTML namespace implies XHTML.
- mbXHTML = true;
+ aStoreMap["XhtmlNs"] <<= rOption.copy(aXhtmlNsKey.getLength());
+ }
+ }
+
+ SetupFilterFromPropertyValues(aStoreMap.getAsConstPropertyValueList());
+}
+
+void SwHTMLWriter::SetupFilterFromPropertyValues(
+ const css::uno::Sequence<css::beans::PropertyValue>& rPropertyValues)
+{
+ comphelper::SequenceAsHashMap aStoreMap(rPropertyValues);
+ auto it = aStoreMap.find("RTFOLEMimeType");
+ if (it != aStoreMap.end())
+ {
+ it->second >>= m_aRTFOLEMimeType;
+ }
+
+ it = aStoreMap.find("SkipImages");
+ if (it != aStoreMap.end())
+ {
+ bool bVal{};
+ it->second >>= bVal;
+ mbSkipImages = bVal;
+ }
+
+ it = aStoreMap.find("SkipHeaderFooter");
+ if (it != aStoreMap.end())
+ {
+ bool bVal{};
+ it->second >>= bVal;
+ mbSkipHeaderFooter = bVal;
+ }
+
+ it = aStoreMap.find("EmbedImages");
+ if (it != aStoreMap.end())
+ {
+ bool bVal{};
+ it->second >>= bVal;
+ mbEmbedImages = bVal;
+ }
+
+ it = aStoreMap.find("NoLineLimit");
+ if (it != aStoreMap.end())
+ {
+ bool bVal{};
+ it->second >>= bVal;
+ if (bVal)
+ {
+ m_nWhishLineLen = -1;
+ }
+ }
+
+ it = aStoreMap.find("XHTML");
+ if (it != aStoreMap.end())
+ {
+ bool bVal{};
+ it->second >>= bVal;
+ mbXHTML = bVal;
+ }
+
+ it = aStoreMap.find("XhtmlNs");
+ if (it != aStoreMap.end())
+ {
+ OUString aVal;
+ it->second >>= aVal;
+
+ maNamespace = aVal.toUtf8();
+ if (maNamespace == "reqif-xhtml")
+ {
+ mbReqIF = true;
+ // XHTML is always just a fragment inside ReqIF.
+ mbSkipHeaderFooter = true;
}
+ // XHTML namespace implies XHTML.
+ mbXHTML = true;
}
}
diff --git a/sw/source/filter/html/wrthtml.hxx b/sw/source/filter/html/wrthtml.hxx
index ef5226f95674..0774efc41da1 100644
--- a/sw/source/filter/html/wrthtml.hxx
+++ b/sw/source/filter/html/wrthtml.hxx
@@ -288,6 +288,8 @@ class SW_DLLPUBLIC SwHTMLWriter : public Writer
protected:
ErrCode WriteStream() override;
void SetupFilterOptions(SfxMedium& rMedium) override;
+ void SetupFilterFromPropertyValues(
+ const css::uno::Sequence<css::beans::PropertyValue>& rPropertyValues);
public:
std::vector<OUString> m_aImgMapNames; // written image maps