diff options
Diffstat (limited to 'sc/source/ui/view/tabcont.cxx')
-rw-r--r-- | sc/source/ui/view/tabcont.cxx | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/sc/source/ui/view/tabcont.cxx b/sc/source/ui/view/tabcont.cxx index 1048c903ec4a..daea22b78027 100644 --- a/sc/source/ui/view/tabcont.cxx +++ b/sc/source/ui/view/tabcont.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -54,8 +55,9 @@ //================================================================== ScTabControl::ScTabControl( Window* pParent, ScViewData* pData ) : - TabBar( pParent, WinBits( WB_BORDER | WB_3DLOOK | WB_SCROLL | WB_INSERTTAB | - WB_RANGESELECT | WB_MULTISELECT | WB_DRAG | WB_SIZEABLE ) ), + TabBar( pParent, + WinBits(WB_BORDER | WB_3DLOOK | WB_SCROLL | WB_RANGESELECT | + WB_MULTISELECT | WB_DRAG | WB_SIZEABLE) ), DropTargetHelper( this ), DragSourceHelper( this ), pViewData( pData ), @@ -94,6 +96,7 @@ ScTabControl::ScTabControl( Window* pParent, ScViewData* pData ) : SetSplitHdl( LINK( pViewData->GetView(), ScTabView, TabBarResize ) ); EnableEditMode(); + UpdateInputContext(); } ScTabControl::~ScTabControl() @@ -297,6 +300,17 @@ void ScTabControl::Select() } } +void ScTabControl::UpdateInputContext() +{ + ScDocument* pDoc = pViewData->GetDocument(); + WinBits nStyle = GetStyle(); + if (pDoc->GetDocumentShell()->IsReadOnly()) + // no insert sheet tab for readonly doc. + SetStyle((nStyle & ~WB_INSERTTAB)); + else + SetStyle((nStyle | WB_INSERTTAB)); +} + void ScTabControl::UpdateStatus() { ScDocument* pDoc = pViewData->GetDocument(); @@ -648,3 +662,4 @@ void ScTabControl::Mirror() +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |