diff options
author | julien2412 <serval2412@yahoo.fr> | 2011-10-24 14:46:13 +0200 |
---|---|---|
committer | Petr Mladek <pmladek@suse.cz> | 2011-10-24 15:51:28 +0200 |
commit | 09179e24c4e4eec135012a3cce5e1cffc42fae60 (patch) | |
tree | 976c6328b452383b654c77311353af0842433c93 /toolkit | |
parent | 3895c2e7c8b32bfde74e2dc391c6c195aae22fc7 (diff) |
activation order crashes address database (fdo#41022)
Diffstat (limited to 'toolkit')
-rw-r--r-- | toolkit/source/controls/stdtabcontroller.cxx | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/toolkit/source/controls/stdtabcontroller.cxx b/toolkit/source/controls/stdtabcontroller.cxx index 3065515415f3..082733f85652 100644 --- a/toolkit/source/controls/stdtabcontroller.cxx +++ b/toolkit/source/controls/stdtabcontroller.cxx @@ -262,6 +262,7 @@ void StdTabController::autoTabOrder( ) throw(RuntimeException) sal_uInt32 nCtrls = aCompSeq.getLength(); Reference< XWindow > * pComponents = aCompSeq.getArray(); + // insert sort algorithm ComponentEntryList aCtrls; size_t n; for ( n = 0; n < nCtrls; n++ ) @@ -277,15 +278,9 @@ void StdTabController::autoTabOrder( ) throw(RuntimeException) for ( nPos = 0; nPos < aCtrls.size(); nPos++ ) { ComponentEntry* pEntry = aCtrls[ nPos ]; - if ( pEntry->aPos.Y() >= pE->aPos.Y() ) - { - while ( pEntry && ( pEntry->aPos.Y() == pE->aPos.Y() ) - && ( pEntry->aPos.X() < pE->aPos.X() ) ) - { - pEntry = aCtrls[ ++nPos ]; - } - break; - } + if ( ( pEntry->aPos.Y() > pE->aPos.Y() ) || + ( ( pEntry->aPos.Y() == pE->aPos.Y() ) && ( pEntry->aPos.X() > pE->aPos.X() ) ) ) + break; } if ( nPos < aCtrls.size() ) { ComponentEntryList::iterator it = aCtrls.begin(); |