summaryrefslogtreecommitdiff
path: root/sc/source/ui
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/ui')
-rw-r--r--sc/source/ui/inc/tabview.hxx1
-rw-r--r--sc/source/ui/view/tabcont.cxx8
-rw-r--r--sc/source/ui/view/tabview3.cxx5
-rw-r--r--sc/source/ui/view/viewfunc.cxx3
4 files changed, 17 insertions, 0 deletions
diff --git a/sc/source/ui/inc/tabview.hxx b/sc/source/ui/inc/tabview.hxx
index 9fc8d311f3e0..0424a639759c 100644
--- a/sc/source/ui/inc/tabview.hxx
+++ b/sc/source/ui/inc/tabview.hxx
@@ -500,6 +500,7 @@ public:
void UpdateScrollBars();
void SetNewVisArea();
+ void SetTabProtectionSymbol( SCTAB nTab, const bool bProtect ); // for protection icon of a tab on tabbar
void InvalidateAttribs();
diff --git a/sc/source/ui/view/tabcont.cxx b/sc/source/ui/view/tabcont.cxx
index 592d052167b6..1aba21d2cf9a 100644
--- a/sc/source/ui/view/tabcont.cxx
+++ b/sc/source/ui/view/tabcont.cxx
@@ -61,6 +61,10 @@ ScTabControl::ScTabControl( vcl::Window* pParent, ScViewData* pData )
InsertPage( static_cast<sal_uInt16>(i)+1, aString, TabBarPageBits::Blue);
else
InsertPage( static_cast<sal_uInt16>(i)+1, aString );
+
+ if ( pDoc->IsTabProtected(i) )
+ SetProtectionSymbol(static_cast<sal_uInt16>(i)+1, true);
+
if ( !pDoc->IsDefaultTabBgColor(i) )
{
aTabBgColor = pDoc->GetTabBgColor(i);
@@ -368,6 +372,10 @@ void ScTabControl::UpdateStatus()
InsertPage(static_cast<sal_uInt16>(i)+1, aString, TabBarPageBits::Blue);
else
InsertPage( static_cast<sal_uInt16>(i)+1, aString );
+
+ if ( pDoc->IsTabProtected(i) )
+ SetProtectionSymbol(static_cast<sal_uInt16>(i)+1, true);
+
if ( !pDoc->IsDefaultTabBgColor(i) )
{
aTabBgColor = pDoc->GetTabBgColor(i);
diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx
index 5ea1054821a0..84c945552677 100644
--- a/sc/source/ui/view/tabview3.cxx
+++ b/sc/source/ui/view/tabview3.cxx
@@ -460,6 +460,11 @@ void ScTabView::CellContentChanged()
aViewData.GetViewShell()->UpdateInputHandler();
}
+void ScTabView::SetTabProtectionSymbol( SCTAB nTab, const bool bProtect )
+{
+ pTabControl->SetProtectionSymbol( static_cast<sal_uInt16>(nTab)+1, bProtect);
+}
+
void ScTabView::SelectionChanged()
{
SfxViewFrame* pViewFrame = aViewData.GetViewShell()->GetViewFrame();
diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx
index b09c15316d17..591e2ef0b1c7 100644
--- a/sc/source/ui/view/viewfunc.cxx
+++ b/sc/source/ui/view/viewfunc.cxx
@@ -2496,6 +2496,7 @@ void ScViewFunc::ProtectSheet( SCTAB nTab, const ScTableProtection& rProtect )
if (bUndo)
pDocSh->GetUndoManager()->LeaveListAction();
+ SetTabProtectionSymbol(nTab, true);
UpdateLayerLocks(); //! broadcast to all views
}
@@ -2560,6 +2561,8 @@ bool ScViewFunc::Unprotect( SCTAB nTab, const OUString& rPassword )
pDocSh->GetUndoManager()->LeaveListAction();
}
+ SetTabProtectionSymbol(nTab, false);
+
if (bChanged)
UpdateLayerLocks(); //! broadcast to all views