[PATCH libreoffice-4-0] fdo#47951 work around underlying cause

Lionel Elie Mamane (via Code Review) gerrit at gerrit.libreoffice.org
Sun May 19 04:25:33 PDT 2013


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/3959

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/59/3959/1

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
---
M sw/source/ui/envelp/mailmrge.cxx
1 file changed, 8 insertions(+), 8 deletions(-)



diff --git a/sw/source/ui/envelp/mailmrge.cxx b/sw/source/ui/envelp/mailmrge.cxx
index 4a675dc..d2a1d49 100644
--- a/sw/source/ui/envelp/mailmrge.cxx
+++ b/sw/source/ui/envelp/mailmrge.cxx
@@ -210,6 +210,14 @@
     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;
@@ -360,14 +368,6 @@
     aToNF.SetModifyHdl(aLk);
     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(rtl::OUString("EMAIL"));
 

-- 
To view, visit https://gerrit.libreoffice.org/3959
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I628d9b870df2bbc402637818f987637d3bd62897
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: libreoffice-4-0
Gerrit-Owner: Lionel Elie Mamane <lionel at mamane.lu>



More information about the LibreOffice mailing list