summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorPedro Giffuni <pfg@apache.org>2011-10-29 18:56:46 +0000
committerPedro Giffuni <pfg@apache.org>2011-10-29 18:56:46 +0000
commit6d654a7134333add9452925384b2623e387eb62b (patch)
tree7b14473ad345e9ad4c5d0606e19a58fa8da319ac /sfx2
parente426ce85ecb7c6c83d88909c09c7d1828007459f (diff)
i112795 - sfx2: dock windows change position after restart of the app. Translate some debug messages while here.
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/dialog/splitwin.cxx15
1 files changed, 10 insertions, 5 deletions
diff --git a/sfx2/source/dialog/splitwin.cxx b/sfx2/source/dialog/splitwin.cxx
index 2eb332f9d5d9..55f51febf8bb 100644
--- a/sfx2/source/dialog/splitwin.cxx
+++ b/sfx2/source/dialog/splitwin.cxx
@@ -611,13 +611,13 @@ void SfxSplitWindow::InsertWindow( SfxDockingWindow* pDockWin, const Size& rSize
pDock->bNewLine = bNewLine;
pDock->pWin = pDockWin;
- DBG_ASSERT( nPos==0 || !bNewLine, "Falsche Paramenter!");
+ DBG_ASSERT( nPos==0 || !bNewLine, "Wrong Parameter!");
if ( bNewLine )
nPos = 0;
// Das Fenster mu\s vor dem ersten Fenster eingef"ugt werden, das die
// gleiche oder eine gr"o\sere Position hat als pDockWin.
- sal_uInt16 nCount = pDockArr->Count();
+ sal_uInt16 nLastWindowIdx(0);
// Wenn gar kein Fenster gefunden wird, wird als erstes eingef"ugt
sal_uInt16 nInsertPos = 0;
@@ -631,26 +631,31 @@ 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;
sal_uInt16 nL=0, nP=0;
GetWindowPos( pD->pWin, nL, nP );
if ( (nL == nLine && nP == nPos) || nL > nLine )
{
- DBG_ASSERT( nL == nLine || bNewLine || nPos > 0, "Falsche Parameter!" );
+ DBG_ASSERT( nL == nLine || bNewLine || nPos > 0, "Wrong Parameter!" );
if ( nL == nLine && nPos == 0 && !bNewLine )
{
- DBG_ASSERT(pD->bNewLine, "Keine neue Zeile?");
+ DBG_ASSERT(pD->bNewLine, "No new line?");
// Das Fenster wird auf nPos==0 eingeschoben
pD->bNewLine = sal_False;
pDock->bNewLine = sal_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 );