diff options
author | Jaskaran Singh <jvsg1303@gmail.com> | 2016-06-27 11:53:57 +0530 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2016-09-18 00:15:10 +0200 |
commit | 6fbd64d89794033d438a031da4b4f6d64af53afc (patch) | |
tree | 5cd3a74b3dcef53a3e61472cb290a942374474cb | |
parent | 7662f37e7ee9faf421ac3de3f627b3e772687967 (diff) |
Add functions for cell protection in orcus interface
Change-Id: I86111e9584e9d629d5fbb6a17c8936de719d190b
-rw-r--r-- | sc/source/filter/inc/orcusinterface.hxx | 2 | ||||
-rw-r--r-- | sc/source/filter/orcus/interface.cxx | 19 |
2 files changed, 15 insertions, 6 deletions
diff --git a/sc/source/filter/inc/orcusinterface.hxx b/sc/source/filter/inc/orcusinterface.hxx index df1e9ed99ae3..dfecde4aa08e 100644 --- a/sc/source/filter/inc/orcusinterface.hxx +++ b/sc/source/filter/inc/orcusinterface.hxx @@ -303,6 +303,8 @@ private: { bool mbHidden; bool mbLocked; + bool mbPrintContent; + bool mbFormulaHidden; protection(); void applyToItemSet(SfxItemSet& rSet) const; diff --git a/sc/source/filter/orcus/interface.cxx b/sc/source/filter/orcus/interface.cxx index dbcbf27ca9ef..c10a4e6e4c2e 100644 --- a/sc/source/filter/orcus/interface.cxx +++ b/sc/source/filter/orcus/interface.cxx @@ -31,6 +31,9 @@ #include <editeng/boxitem.hxx> #include <editeng/borderline.hxx> #include <editeng/lcolitem.hxx> +#include <editeng/charhiddenitem.hxx> +#include <editeng/protitem.hxx> +#include <editeng/prntitem.hxx> #include <formula/token.hxx> #include <tools/datetime.hxx> @@ -786,9 +789,13 @@ ScOrcusStyles::protection::protection(): { } -void ScOrcusStyles::protection::applyToItemSet(SfxItemSet& /*rSet*/) const +void ScOrcusStyles::protection::applyToItemSet(SfxItemSet& rSet) const { - (void)this; // loplugin:staticmethods + rSet.Put(SvxCharHiddenItem(mbHidden, ATTR_PROTECTION)); + + if (mbLocked) + rSet.Put(SvxProtectItem(ATTR_PROTECTION)); + rSet.Put(SvxPrintItem(ATTR_PROTECTION, mbPrintContent)); } ScOrcusStyles::border::border() @@ -1187,14 +1194,14 @@ void ScOrcusStyles::set_cell_locked(bool b) maCurrentProtection.mbLocked = b; } -void ScOrcusStyles::set_cell_print_content(bool /* b */) +void ScOrcusStyles::set_cell_print_content(bool b ) { - + maCurrentProtection.mbPrintContent = b; } -void ScOrcusStyles::set_cell_formula_hidden(bool /* b */) +void ScOrcusStyles::set_cell_formula_hidden(bool b ) { - + maCurrentProtection.mbFormulaHidden = b; } size_t ScOrcusStyles::commit_cell_protection() |