33 LN_Value_doc_ST_DocProtect_none)
34 , m_bProtectForm(false)
35 , m_bRedlineProtection(false)
37 , m_bEnforcement(false)
38 , m_bFormatting(false)
39 , m_nCryptProviderType(NS_ooxml::LN_Value_doc_ST_CryptProv_rsaAES)
40 , m_sCryptAlgorithmClass(
"hash")
41 , m_sCryptAlgorithmType(
"typeAny")
50 int nIntValue = val.
getInt();
55 case NS_ooxml::LN_CT_DocProtect_edit:
63 case NS_ooxml::LN_Value_doc_ST_DocProtect_trackedChanges:
69 case NS_ooxml::LN_Value_doc_ST_DocProtect_forms:
72 case NS_ooxml::LN_Value_doc_ST_DocProtect_readOnly:
77 case NS_ooxml::LN_CT_DocProtect_enforcement:
80 case NS_ooxml::LN_CT_DocProtect_formatting:
83 case NS_ooxml::LN_AG_Password_cryptProviderType:
86 case NS_ooxml::LN_AG_Password_cryptAlgorithmClass:
87 if (nIntValue == NS_ooxml::LN_Value_doc_ST_AlgClass_hash)
90 case NS_ooxml::LN_AG_Password_cryptAlgorithmType:
91 if (nIntValue == NS_ooxml::LN_Value_doc_ST_AlgType_typeAny)
94 case NS_ooxml::LN_AG_Password_cryptAlgorithmSid:
97 case NS_ooxml::LN_AG_Password_cryptSpinCount:
100 case NS_ooxml::LN_AG_Password_hash:
103 case NS_ooxml::LN_AG_Password_salt:
119 std::vector<beans::PropertyValue> documentProtection;
125 beans::PropertyValue aValue;
126 aValue.Name =
"edit";
130 case NS_ooxml::LN_Value_doc_ST_DocProtect_none:
131 aValue.Value <<= OUString(
"none");
133 case NS_ooxml::LN_Value_doc_ST_DocProtect_readOnly:
134 aValue.Value <<= OUString(
"readOnly");
136 case NS_ooxml::LN_Value_doc_ST_DocProtect_comments:
137 aValue.Value <<= OUString(
"comments");
139 case NS_ooxml::LN_Value_doc_ST_DocProtect_trackedChanges:
140 aValue.Value <<= OUString(
"trackedChanges");
142 case NS_ooxml::LN_Value_doc_ST_DocProtect_forms:
143 aValue.Value <<= OUString(
"forms");
153 documentProtection.push_back(aValue);
159 beans::PropertyValue aValue;
160 aValue.Name =
"enforcement";
161 aValue.Value <<= OUString(
"1");
162 documentProtection.push_back(aValue);
168 beans::PropertyValue aValue;
169 aValue.Name =
"formatting";
170 aValue.Value <<= OUString(
"1");
171 documentProtection.push_back(aValue);
176 beans::PropertyValue aValue;
177 aValue.Name =
"cryptProviderType";
179 aValue.Value <<= OUString(
"rsaAES");
181 aValue.Value <<= OUString(
"rsaFull");
182 documentProtection.push_back(aValue);
187 beans::PropertyValue aValue;
188 aValue.Name =
"cryptAlgorithmClass";
190 documentProtection.push_back(aValue);
195 beans::PropertyValue aValue;
196 aValue.Name =
"cryptAlgorithmType";
198 documentProtection.push_back(aValue);
203 beans::PropertyValue aValue;
204 aValue.Name =
"cryptAlgorithmSid";
206 documentProtection.push_back(aValue);
211 beans::PropertyValue aValue;
212 aValue.Name =
"cryptSpinCount";
214 documentProtection.push_back(aValue);
219 beans::PropertyValue aValue;
220 aValue.Name =
"hash";
222 documentProtection.push_back(aValue);
227 beans::PropertyValue aValue;
228 aValue.Name =
"salt";
230 documentProtection.push_back(aValue);
An SPRM: Section, Paragraph and Run Modifier.
static TagLogger & getInstance()
void element(const std::string &name)
virtual int getInt() const =0
Returns integer representation of the value.
virtual OUString getString() const =0
Returns string representation of the value.
virtual ~DocumentProtection() override
sal_Int32 m_nCryptProviderType
Provider type.
bool m_bRedlineProtection
sal_Int32 m_CryptSpinCount
OUString m_sCryptAlgorithmType
OUString m_sRedlineProtectionKey
sal_Int32 m_nEdit
Document Editing Restrictions.
OUString m_sCryptAlgorithmClass
virtual void lcl_sprm(Sprm &sprm) override
css::uno::Sequence< css::beans::PropertyValue > toSequence() const
OUString m_sCryptAlgorithmSid
virtual void lcl_attribute(Id Name, Value &val) override
css::uno::Sequence< DstElementType > containerToSequence(const SrcType &i_Container)