[Libreoffice-commits] core.git: Branch 'libreoffice-3-6' - sw/source

Lionel Elie Mamane lionel at mamane.lu
Tue May 21 10:43:46 PDT 2013


 sw/source/ui/envelp/mailmrge.cxx |   16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

New commits:
commit 08a9b322ae0069d563730cfd7d61f2dfa0af3a26
Author: Lionel Elie Mamane <lionel at mamane.lu>
Date:   Thu May 16 09:46:05 2013 +0200

    fdo#47951 work around underlying cause
    
    The true cause is that the flat text file database driver mishandles
    the case of two ResultSets being open on the same table: the moving
    commands of one impact the other.
    
    Since in this case:
    
     - one ResultSet is open by the dispatch of
       ".component:DB/DataSourceBrowser", that is the grid UI shown to the
       user, and that ResultSet is kept open to serve requests by the user
       to scroll;
    
     - the second ResultSet is opened by the call to
       pNewDBMgr->GetColumnNames
       and that ResultSet is closed by the time GetColumnNames returns
    
    We just swap the order of these calls to work around the underlying
    driver bug.
    
    Change-Id: I628d9b870df2bbc402637818f987637d3bd62897
    Reviewed-on: https://gerrit.libreoffice.org/3963
    Reviewed-by: Fridrich Strba <fridrich at documentfoundation.org>
    Tested-by: Fridrich Strba <fridrich at documentfoundation.org>

diff --git a/sw/source/ui/envelp/mailmrge.cxx b/sw/source/ui/envelp/mailmrge.cxx
index 14cc5b2..2c04b06 100644
--- a/sw/source/ui/envelp/mailmrge.cxx
+++ b/sw/source/ui/envelp/mailmrge.cxx
@@ -224,6 +224,14 @@ SwMailMergeDlg::SwMailMergeDlg(Window* pParent, SwWrtShell& rShell,
     aAttachED.Show(sal_False);
     aAttachPB.Show(sal_False);
 
+    SwNewDBMgr* pNewDBMgr = rSh.GetNewDBMgr();
+    if(_xConnection.is())
+        pNewDBMgr->GetColumnNames(&aAddressFldLB, _xConnection, rTableName);
+    else
+        pNewDBMgr->GetColumnNames(&aAddressFldLB, rDBName, rTableName);
+    for(sal_uInt16 nEntry = 0; nEntry < aAddressFldLB.GetEntryCount(); nEntry++)
+        aColumnLB.InsertEntry(aAddressFldLB.GetEntry(nEntry));
+
     Point aMailPos = aMailingRB.GetPosPixel();
     Point aFilePos = aFileRB.GetPosPixel();
     aFilePos.X() -= (aFilePos.X() - aMailPos.X()) /2;
@@ -375,14 +383,6 @@ SwMailMergeDlg::SwMailMergeDlg(Window* pParent, SwWrtShell& rShell,
     aFromNF.SetMax(SAL_MAX_INT32);
     aToNF.SetMax(SAL_MAX_INT32);
 
-    SwNewDBMgr* pNewDBMgr = rSh.GetNewDBMgr();
-    if(_xConnection.is())
-        pNewDBMgr->GetColumnNames(&aAddressFldLB, _xConnection, rTableName);
-    else
-        pNewDBMgr->GetColumnNames(&aAddressFldLB, rDBName, rTableName);
-    for(sal_uInt16 nEntry = 0; nEntry < aAddressFldLB.GetEntryCount(); nEntry++)
-        aColumnLB.InsertEntry(aAddressFldLB.GetEntry(nEntry));
-
     aAddressFldLB.SelectEntry(C2S("EMAIL"));
 
     String sPath(pModOpt->GetMailingPath());


More information about the Libreoffice-commits mailing list