summaryrefslogtreecommitdiff
path: root/unotools
diff options
context:
space:
mode:
authorTamás Zolnai <tamas.zolnai@collabora.com>2019-03-25 13:28:27 +0100
committerTamás Zolnai <tamas.zolnai@collabora.com>2019-03-26 19:09:46 +0100
commit41dc917b9b55b8c0c4307ffc58a1fb7257df2b69 (patch)
tree52ea7fbb48fd3877c95c4efab76971cc48b27485 /unotools
parentcd19a7664a25eda786bb76feefb40ebcbf79a54d (diff)
Generate MSO lock files when the related MSO compat. option is set
Added a new compatibility option to the Tools -> Load / Save -> Microsoft. When this option is set on the UI or or set in the configuration files LO generates lock files for MSO supported file formats, similar to the lock files MSO generates itself. Change-Id: I2f882723841162add01be9d3f7285a5162a60331 Reviewed-on: https://gerrit.libreoffice.org/69678 Tested-by: Jenkins Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Diffstat (limited to 'unotools')
-rw-r--r--unotools/source/config/fltrcfg.cxx25
1 files changed, 20 insertions, 5 deletions
diff --git a/unotools/source/config/fltrcfg.cxx b/unotools/source/config/fltrcfg.cxx
index 89b8374a761d..387f691a6a0b 100644
--- a/unotools/source/config/fltrcfg.cxx
+++ b/unotools/source/config/fltrcfg.cxx
@@ -25,6 +25,7 @@
#include <tools/debug.hxx>
#include <tools/solar.h>
#include <osl/diagnose.h>
+#include <sal/log.hxx>
#include <com/sun/star/uno/Sequence.hxx>
@@ -54,10 +55,11 @@ enum class ConfigFlags {
UseEnhancedFields = 0x0100000,
WordWbctbl = 0x0200000,
SmartArtShapeLoad = 0x0400000,
- CharBackgroundToHighlighting = 0x8000000
+ CharBackgroundToHighlighting = 0x8000000,
+ CreateMSOLockFiles = 0x2000000
};
namespace o3tl {
- template<> struct typed_flags<ConfigFlags> : is_typed_flags<ConfigFlags, 0x87fff3f> {};
+ template<> struct typed_flags<ConfigFlags> : is_typed_flags<ConfigFlags, 0xf7fff3f> {};
}
class SvtAppFilterOptions_Impl : public utl::ConfigItem
@@ -246,7 +248,8 @@ struct SvtFilterOptions_Impl
ConfigFlags::ImpressSave |
ConfigFlags::UseEnhancedFields |
ConfigFlags::SmartArtShapeLoad |
- ConfigFlags::CharBackgroundToHighlighting;
+ ConfigFlags::CharBackgroundToHighlighting|
+ ConfigFlags::CreateMSOLockFiles;
Load();
}
@@ -318,7 +321,8 @@ const Sequence<OUString>& GetPropertyNames()
"Export/EnableWordPreview", // 10
"Import/ImportWWFieldsAsEnhancedFields", // 11
"Import/SmartArtToShapes", // 12
- "Export/CharBackgroundToHighlighting" // 13
+ "Export/CharBackgroundToHighlighting", // 13
+ "Import/CreateMSOLockFiles" // 14
};
return aNames;
}
@@ -356,6 +360,7 @@ static ConfigFlags lcl_GetFlag(sal_Int32 nProp)
case 11: nFlag = ConfigFlags::UseEnhancedFields; break;
case 12: nFlag = ConfigFlags::SmartArtShapeLoad; break;
case 13: nFlag = ConfigFlags::CharBackgroundToHighlighting; break;
+ case 14: nFlag = ConfigFlags::CreateMSOLockFiles; break;
default: OSL_FAIL("illegal value");
}
@@ -623,7 +628,6 @@ bool SvtFilterOptions::IsEnableWordPreview() const
return pImpl->IsFlag( ConfigFlags::EnableWordPreview );
}
-
bool SvtFilterOptions::IsCharBackground2Highlighting() const
{
return pImpl->IsFlag( ConfigFlags::CharBackgroundToHighlighting );
@@ -646,4 +650,15 @@ void SvtFilterOptions::SetCharBackground2Shading()
SetModified();
}
+bool SvtFilterOptions::IsMSOLockFileCreationIsEnabled() const
+{
+ return pImpl->IsFlag( ConfigFlags::CreateMSOLockFiles );
+}
+
+void SvtFilterOptions::EnableMSOLockFileCreation(bool bEnable)
+{
+ pImpl->SetFlag( ConfigFlags::CreateMSOLockFiles, bEnable );
+ SetModified();
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */