# HG changeset patch # Parent fed52b12210b4fdebc8730b16703fbd77ababbb3 #i112795# ignore empty windows when inserting dock diff -r fed52b12210b sfx2/source/dialog/splitwin.cxx --- a/sfx2/source/dialog/splitwin.cxx Tue Jun 29 18:26:16 2010 +0200 +++ b/sfx2/source/dialog/splitwin.cxx Tue Jun 29 18:27:19 2010 +0200 @@ -618,6 +618,7 @@ // 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; @@ -631,6 +632,7 @@ // 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 ); @@ -646,11 +648,15 @@ 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 );