Date: prev next · Thread: first prev next last
2011 Archives by date, by thread · List index


Petr Mladek píše v Po 24. 10. 2011 v 11:23 +0200:
Could you please test the attached patch? You might apply it using:
 
   git am 0001-activation-order-crashes-address-database-fdo-41022.patch

It did not sort the very last element "FaxNumber" from the sample
document.

Well, it was a simple "insert sort" algorithm but it was written somehow
complicated way. I have simplified it, see the attached patch.

It works here. Could you please try it?

Best Regards,
Petr
From e7698add6ba6bda362e50b343cac0682167fbcca Mon Sep 17 00:00:00 2001
From: julien2412 <serval2412@yahoo.fr>
Date: Mon, 24 Oct 2011 14:46:13 +0200
Subject: [PATCH] activation order crashes address database (fdo#41022)

---
 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 d5c2f06..86604f9 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();
-- 
1.7.3.4


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.