From dcf3e7e4c5dce22c674376702c09b4f0c55b446d Mon Sep 17 00:00:00 2001 From: David Tardon Date: Mon, 11 Oct 2010 10:27:09 +0200 Subject: #i112795# ignore empty windows when inserting dock --- sfx2/source/dialog/splitwin.cxx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sfx2/source/dialog/splitwin.cxx b/sfx2/source/dialog/splitwin.cxx index 37f43f797caf..12cf82bbfff5 100644 --- a/sfx2/source/dialog/splitwin.cxx +++ b/sfx2/source/dialog/splitwin.cxx @@ -614,6 +614,7 @@ void SfxSplitWindow::InsertWindow( SfxDockingWindow* pDockWin, const Size& rSize // Das Fenster mu\s vor dem ersten Fenster eingef"ugt werden, das die // gleiche oder eine gr"o\sere Position hat als pDockWin. USHORT nCount = pDockArr->Count(); + USHORT nLastWindowIdx(0); // Wenn gar kein Fenster gefunden wird, wird als erstes eingef"ugt USHORT nInsertPos = 0; @@ -627,6 +628,7 @@ void SfxSplitWindow::InsertWindow( SfxDockingWindow* pDockWin, const Size& rSize // Wenn kein geeignetes Fenster hinter der gew"unschten Einf"ugeposition // gefunden wird, wird am Ende eingef"ugt nInsertPos = nCount; + nLastWindowIdx = n; USHORT nL=0, nP=0; GetWindowPos( pD->pWin, nL, nP ); @@ -642,11 +644,15 @@ void SfxSplitWindow::InsertWindow( SfxDockingWindow* pDockWin, const Size& rSize pDock->bNewLine = TRUE; } - nInsertPos = n; + nInsertPos = n != 0 ? nLastWindowIdx + 1 : 0; // ignore all non-windows after the last window break; } } } + if (nInsertPos == nCount && nLastWindowIdx != nCount - 1) + { + nInsertPos = nLastWindowIdx + 1; // ignore all non-windows after the last window + } pDockArr->Insert(pDock, nInsertPos); InsertWindow_Impl( pDock, rSize, nLine, nPos, bNewLine ); -- cgit