summaryrefslogtreecommitdiff
path: root/sc/source/ui/formdlg
diff options
context:
space:
mode:
authorNiklas Nebel <nn@openoffice.org>2001-11-28 19:36:32 +0000
committerNiklas Nebel <nn@openoffice.org>2001-11-28 19:36:32 +0000
commit6417cfa79f20a49fc7e762e850652b614faee2b0 (patch)
treedb5776ca2c558b2e93044a6a88dfbcc1303ba8c8 /sc/source/ui/formdlg
parentd5b39003bb9f5cc868ca664c805ee43041fd6199 (diff)
#94702# set initial splitter pos from StateChanged/INITSHOW
Diffstat (limited to 'sc/source/ui/formdlg')
-rw-r--r--sc/source/ui/formdlg/dwfunctr.cxx27
1 files changed, 17 insertions, 10 deletions
diff --git a/sc/source/ui/formdlg/dwfunctr.cxx b/sc/source/ui/formdlg/dwfunctr.cxx
index 60bbe1fc57a9..5e5d0970fd24 100644
--- a/sc/source/ui/formdlg/dwfunctr.cxx
+++ b/sc/source/ui/formdlg/dwfunctr.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: dwfunctr.cxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: nn $ $Date: 2000-09-22 18:54:44 $
+ * last change: $Author: nn $ $Date: 2001-11-28 20:36:32 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -1171,15 +1171,17 @@ void ScFunctionDockWin::Initialize(SfxChildWinInfo *pInfo)
if ( aStr.Len())
{
aSplitterInitPos=aPrivatSplit.GetPosPixel();
-
aSplitterInitPos.Y()=(USHORT) aStr.ToInt32();
xub_StrLen n1 = aStr.Search(';');
aStr.Erase(0, n1+1);
USHORT nSelPos=aStr.ToInt32();
aCatBox.SelectEntryPos(nSelPos);
SelHdl(&aCatBox);
- StateChanged(STATE_CHANGE_VISIBLE);
+ // if the window has already been shown (from SfxDockingWindow::Initialize if docked),
+ // set the splitter position now, otherwise it is set in StateChanged with type INITSHOW
+
+ UseSplitterInitPos();
}
}
@@ -1196,17 +1198,22 @@ void ScFunctionDockWin::FillInfo(SfxChildWinInfo& rInfo) const
rInfo.aExtraString += ')';
}
+void ScFunctionDockWin::UseSplitterInitPos()
+{
+ if ( IsVisible() && aPrivatSplit.IsEnabled() && aSplitterInitPos != Point() )
+ {
+ aPrivatSplit.MoveSplitTo(aSplitterInitPos);
+ aSplitterInitPos = Point(); // use only once
+ }
+}
+
void ScFunctionDockWin::StateChanged( StateChangedType nStateChange )
{
SfxDockingWindow::StateChanged( nStateChange );
- if(nStateChange == STATE_CHANGE_VISIBLE)
+ if (nStateChange == STATE_CHANGE_INITSHOW)
{
- if(IsVisible() && aPrivatSplit.IsEnabled() &&
- aSplitterInitPos != Point())
- {
- aPrivatSplit.MoveSplitTo(aSplitterInitPos);
- }
+ UseSplitterInitPos(); // set initial splitter position if necessary
}
}