[Libreoffice-commits] .: sc/source
Kohei Yoshida
kohei at kemper.freedesktop.org
Tue Oct 12 21:38:27 PDT 2010
sc/source/ui/inc/tabcont.hxx | 1 +
sc/source/ui/view/tabcont.cxx | 17 +++++++++++++++--
sc/source/ui/view/tabview3.cxx | 3 +++
3 files changed, 19 insertions(+), 2 deletions(-)
New commits:
commit 319964cc550b757ccc3472e3403a21992a070cc1
Author: Kohei Yoshida <kyoshida at novell.com>
Date: Wed Oct 13 00:37:10 2010 -0400
Remove the "insert new sheet" tab when the document is in read-only mode.
When the document is in read-only mode, we shouldn't show the insert
sheet tab. (fdo#30678)
diff --git a/sc/source/ui/inc/tabcont.hxx b/sc/source/ui/inc/tabcont.hxx
index 77dfecc..0156085 100644
--- a/sc/source/ui/inc/tabcont.hxx
+++ b/sc/source/ui/inc/tabcont.hxx
@@ -76,6 +76,7 @@ public:
using TabBar::StartDrag;
+ void UpdateInputContext();
void UpdateStatus();
void ActivateView(BOOL bActivate);
diff --git a/sc/source/ui/view/tabcont.cxx b/sc/source/ui/view/tabcont.cxx
index 2f122da..0c8bd8e 100644
--- a/sc/source/ui/view/tabcont.cxx
+++ b/sc/source/ui/view/tabcont.cxx
@@ -54,8 +54,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 +95,7 @@ ScTabControl::ScTabControl( Window* pParent, ScViewData* pData ) :
SetSplitHdl( LINK( pViewData->GetView(), ScTabView, TabBarResize ) );
EnableEditMode();
+ UpdateInputContext();
}
ScTabControl::~ScTabControl()
@@ -297,6 +299,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();
diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx
index 1f75304..231acfa 100644
--- a/sc/source/ui/view/tabview3.cxx
+++ b/sc/source/ui/view/tabview3.cxx
@@ -2610,6 +2610,9 @@ void ScTabView::UpdateInputContext()
ScGridWindow* pWin = pGridWin[aViewData.GetActivePart()];
if (pWin)
pWin->UpdateInputContext();
+
+ if (pTabControl)
+ pTabControl->UpdateInputContext();
}
// GetGridWidth - Breite eines Ausgabebereichs (fuer ViewData)
More information about the Libreoffice-commits
mailing list