summaryrefslogtreecommitdiff
path: root/unotools
diff options
context:
space:
mode:
authorTamás Zolnai <tamas.zolnai@collabora.com>2019-06-20 13:40:58 +0200
committerTamás Zolnai <tamas.zolnai@collabora.com>2019-06-20 14:23:21 +0200
commitdac99f6818e6e68198896e93835760b82df2703e (patch)
tree234451159ffe71e299083097122d307b6bf3f840 /unotools
parentf5946cd499f7d7de40b03f453f5b1c52e31a29fc (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. Reviewed-on: https://gerrit.libreoffice.org/69678 Tested-by: Jenkins Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com> (cherry picked from commit 41dc917b9b55b8c0c4307ffc58a1fb7257df2b69) Change-Id: I2f882723841162add01be9d3f7285a5162a60331
Diffstat (limited to 'unotools')
-rw-r--r--unotools/source/config/fltrcfg.cxx27
1 files changed, 21 insertions, 6 deletions
diff --git a/unotools/source/config/fltrcfg.cxx b/unotools/source/config/fltrcfg.cxx
index 32a61fdae8a1..605239d62ced 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();
}
@@ -306,7 +309,7 @@ const Sequence<OUString>& GetPropertyNames()
static Sequence<OUString> aNames;
if(!aNames.getLength())
{
- int nCount = 14;
+ int nCount = 15;
aNames.realloc(nCount);
static const char* aPropNames[] =
{
@@ -323,7 +326,8 @@ const Sequence<OUString>& GetPropertyNames()
"Export/EnableWordPreview", // 10
"Import/ImportWWFieldsAsEnhancedFields", // 11
"Import/SmartArtToShapes", // 12
- "Export/CharBackgroundToHighlighting" // 13
+ "Export/CharBackgroundToHighlighting", // 13
+ "Import/CreateMSOLockFiles" // 14
};
OUString* pNames = aNames.getArray();
for(int i = 0; i < nCount; i++)
@@ -365,6 +369,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");
}
@@ -632,7 +637,6 @@ bool SvtFilterOptions::IsEnableWordPreview() const
return pImpl->IsFlag( ConfigFlags::EnableWordPreview );
}
-
bool SvtFilterOptions::IsCharBackground2Highlighting() const
{
return pImpl->IsFlag( ConfigFlags::CharBackgroundToHighlighting );
@@ -655,4 +659,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: */