diff options
-rw-r--r-- | desktop/source/lib/init.cxx | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 900e50f75c40..b69986d0ad01 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -58,6 +58,7 @@ #include <comphelper/propertysequence.hxx> #include <comphelper/scopeguard.hxx> #include <comphelper/threadpool.hxx> +#include <comphelper/sequenceashashmap.hxx> #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/container/XNameAccess.hpp> @@ -2126,6 +2127,15 @@ void setLanguageAndLocale(OUString const & aLangISO) aLocalOptions.Commit(); } +void setFormatSpecificFilterData(OUString const & sFormat, comphelper::SequenceAsHashMap & rFilterDataMap) +{ + if (sFormat == "pdf") + { + // always export bookmarks, which is needed for annotations + rFilterDataMap["ExportBookmarks"] <<= true; + } +} + } // anonymous namespace // Wonder global state ... @@ -2556,25 +2566,19 @@ static int doc_saveAs(LibreOfficeKitDocument* pThis, const char* sUrl, const cha aFilterOptions = comphelper::string::convertCommaSeparated(aFilteredOptionSeq); aSaveMediaDescriptor[MediaDescriptor::PROP_FILTEROPTIONS()] <<= aFilterOptions; - if(!watermarkText.isEmpty() || bFullSheetPreview) - { - uno::Sequence< beans::PropertyValue > aFilterData( static_cast<int>(bFullSheetPreview) + static_cast<int>(!watermarkText.isEmpty()) ); + comphelper::SequenceAsHashMap aFilterDataMap; - if (!watermarkText.isEmpty()) - { - aFilterData[ 0 ].Name = "TiledWatermark"; - aFilterData[ 0 ].Value <<= watermarkText; - } + setFormatSpecificFilterData(sFormat, aFilterDataMap); - if (bFullSheetPreview) - { - int nOptIndex = static_cast<int>(!watermarkText.isEmpty()); + if (!watermarkText.isEmpty()) + aFilterDataMap["TiledWatermark"] <<= watermarkText; - aFilterData[ nOptIndex ].Name = "SinglePageSheets"; - aFilterData[ nOptIndex ].Value <<= true; - } + if (bFullSheetPreview) + aFilterDataMap["SinglePageSheets"] <<= true; - aSaveMediaDescriptor["FilterData"] <<= aFilterData; + if (!aFilterDataMap.empty()) + { + aSaveMediaDescriptor["FilterData"] <<= aFilterDataMap.getAsConstPropertyValueList(); } // add interaction handler too |