[Libreoffice-commits] core.git: 2 commits - dbaccess/source forms/source svx/source

Lionel Elie Mamane lionel at mamane.lu
Fri May 27 13:52:25 UTC 2016


 dbaccess/source/ui/querydesign/querydlg.cxx |    4 +++-
 forms/source/component/FormComponent.cxx    |    2 +-
 svx/source/fmcomp/fmgridif.cxx              |   13 ++++++++++++-
 3 files changed, 16 insertions(+), 3 deletions(-)

New commits:
commit 51c8d22ec5e4d306f8f64afb355f95a23deb335d
Author: Lionel Elie Mamane <lionel at mamane.lu>
Date:   Fri May 27 15:37:18 2016 +0200

    tdf#93403 check for changed DataSource on all Controls on form reload
    
    1) OBoundControlModel: when reload() asks us to connect to database column,
       redo it even if it was previously done.
    
    2) FmXGridPeer: when getting Reloaded event that we subscribed to
       (and specifically from frm::ODatabaseFrom), pass along the event
       to all columns before we treat it. The columns (controls) are
       themselves subscribed to it, but they may get the event after us,
       which means our treatment still uses stale data, which we continue
       to display.
    
       The column controls should continue to subscribe by themselves for
       the case that they are not in a grid, but direct children of the
       form.
    
    Change-Id: I0cbcf2dc792e8650157a69ddc414d755de0e549a

diff --git a/forms/source/component/FormComponent.cxx b/forms/source/component/FormComponent.cxx
index 7d66f42..fd7b2c7 100644
--- a/forms/source/component/FormComponent.cxx
+++ b/forms/source/component/FormComponent.cxx
@@ -2039,7 +2039,7 @@ void OBoundControlModel::impl_connectDatabaseColumn_noNotify( bool _bFromReload
     OSL_ENSURE( xRowSet.is(), "OBoundControlModel::impl_connectDatabaseColumn_noNotify: no row set!" );
     if ( !xRowSet.is() )
         return;
-    if ( !hasField() )
+    if ( !hasField() || _bFromReload )
     {
         // connect to the column
         connectToField( xRowSet );
diff --git a/svx/source/fmcomp/fmgridif.cxx b/svx/source/fmcomp/fmgridif.cxx
index b1460e4..fbb6d18 100644
--- a/svx/source/fmcomp/fmgridif.cxx
+++ b/svx/source/fmcomp/fmgridif.cxx
@@ -1568,8 +1568,19 @@ void FmXGridPeer::unloading(const EventObject& /*aEvent*/) throw( RuntimeExcepti
 }
 
 
-void FmXGridPeer::reloaded(const EventObject& /*aEvent*/) throw( RuntimeException, std::exception )
+void FmXGridPeer::reloaded(const EventObject& aEvent) throw( RuntimeException, std::exception )
 {
+    {
+        const sal_Int32 cnt = m_xColumns->getCount();
+        for(sal_Int32 i=0; i<cnt; ++i)
+        {
+            Reference< XLoadListener> xll(m_xColumns->getByIndex(i), UNO_QUERY);
+            if(xll.is())
+            {
+                xll->reloaded(aEvent);
+            }
+        }
+    }
     updateGrid(m_xCursor);
 }
 
commit 0df3760bc2035a54454db9fe2774dca58c58593f
Author: Lionel Elie Mamane <lionel at mamane.lu>
Date:   Fri May 27 11:51:10 2016 +0200

    tdf#96516 do not increment position counter when an entry is removed
    
    Change-Id: I81a4455df1fd5962d0362f4e5fa3396764a0ae5a

diff --git a/dbaccess/source/ui/querydesign/querydlg.cxx b/dbaccess/source/ui/querydesign/querydlg.cxx
index dc743c0..3ea04b4 100644
--- a/dbaccess/source/ui/querydesign/querydlg.cxx
+++ b/dbaccess/source/ui/querydesign/querydlg.cxx
@@ -123,13 +123,15 @@ DlgQryJoin::DlgQryJoin( OQueryTableView * pParent,
     else
     {
         const sal_Int32 nCount = m_pLB_JoinType->GetEntryCount();
-        for (sal_Int32 i = 0; i < nCount; ++i)
+        for (sal_Int32 i = 0; i < nCount;)
         {
             const sal_IntPtr nJoinTyp = reinterpret_cast<sal_IntPtr>(m_pLB_JoinType->GetEntryData(i));
             if ( !bSupportFullJoin && nJoinTyp == ID_FULL_JOIN )
                 m_pLB_JoinType->RemoveEntry(i);
             else if ( !bSupportOuterJoin && (nJoinTyp == ID_LEFT_JOIN || nJoinTyp == ID_RIGHT_JOIN) )
                 m_pLB_JoinType->RemoveEntry(i);
+            else
+                ++i;
         }
 
         m_pTableControl->NotifyCellChange();


More information about the Libreoffice-commits mailing list