diff --git a/include/svtools/tabbar.hxx b/include/svtools/tabbar.hxx index 8735e0728599..948e60b3596b 100644 --- a/include/svtools/tabbar.hxx +++ b/include/svtools/tabbar.hxx @@ -496,6 +496,7 @@ public: void SetSelectHdl( const Link& rLink ) { maSelectHdl = rLink; } void SetSplitHdl( const Link& rLink ) { maSplitHdl = rLink; } void SetScrollAreaContextHdl( const Link& rLink ) { maScrollAreaContextHdl = rLink; } + void SetAddButtonEnabled(bool bAddButtonEnabled); // accessibility virtual css::uno::Reference CreateAccessible() override; diff --git a/sc/source/ui/view/tabview5.cxx b/sc/source/ui/view/tabview5.cxx index d83d4206198d..6db05da9c94e 100644 --- a/sc/source/ui/view/tabview5.cxx +++ b/sc/source/ui/view/tabview5.cxx @@ -383,6 +383,7 @@ void ScTabView::UpdateLayerLocks() pDrawView->SetLayerLocked( pLayer->GetName(), bProt || bShared ); pDrawView->SetLayerVisible( pLayer->GetName(), false); } + pTabControl->SetAddButtonEnabled(aViewData.GetDocument().IsDocEditable()); } void ScTabView::DrawDeselectAll() diff --git a/svtools/source/control/tabbar.cxx b/svtools/source/control/tabbar.cxx index 5e5aba4af172..a1a074c4470a 100644 --- a/svtools/source/control/tabbar.cxx +++ b/svtools/source/control/tabbar.cxx @@ -2494,6 +2494,11 @@ tools::Rectangle TabBar::GetPageArea() const Size(mnLastOffX - mnOffX + 1, GetSizePixel().Height() - mnOffY)); } +void TabBar::SetAddButtonEnabled(bool bAddButtonEnabled) +{ + mpImpl->mxButtonBox->m_xAddButton->set_sensitive(bAddButtonEnabled); +} + css::uno::Reference TabBar::CreateAccessible() { return mpImpl->maAccessibleFactory.getFactory().createAccessibleTabBar(*this);