summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaskaran Singh <jvsg1303@gmail.com>2016-06-27 11:53:57 +0530
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2016-08-23 00:52:22 +0200
commit1519c05c3b8c3ebcf14a84e07eab3b4cfaef081f (patch)
tree66b89966568895f156fc0960cbb9a2cbc7913a97
parent99d416216ca51c8dd0964667b7a6881f32e2bf77 (diff)
Add functions for cell protection in orcus interface
Change-Id: I86111e9584e9d629d5fbb6a17c8936de719d190b
-rw-r--r--sc/source/filter/inc/orcusinterface.hxx2
-rw-r--r--sc/source/filter/orcus/interface.cxx19
2 files changed, 15 insertions, 6 deletions
diff --git a/sc/source/filter/inc/orcusinterface.hxx b/sc/source/filter/inc/orcusinterface.hxx
index d5765dad313d..8457eb2705ba 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()