summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Tardon <dtardon@redhat.com>2010-10-11 10:27:09 +0200
committerDavid Tardon <dtardon@redhat.com>2010-10-11 10:27:09 +0200
commitdcf3e7e4c5dce22c674376702c09b4f0c55b446d (patch)
tree97b6a232886864a6b8bc624931a8e27183568688
parent2fa48bb8062c69505acbcfa36554a8c1d2718f2d (diff)
#i112795# ignore empty windows when inserting dock
-rw-r--r--sfx2/source/dialog/splitwin.cxx8
1 files changed, 7 insertions, 1 deletions
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 );