[Libreoffice-commits] .: svx/source

Fridrich Strba fridrich at kemper.freedesktop.org
Thu Feb 10 00:43:32 PST 2011


 svx/source/form/fmshimp.cxx |   19 ++++++-------------
 svx/source/inc/fmshimp.hxx  |    8 ++++++--
 2 files changed, 12 insertions(+), 15 deletions(-)

New commits:
commit afac9c6c62f474e5646e3a0931b68b0c65d58870
Author: Nigel Hawkins <n.hawkins-KK0ffGbhmjU at public.gmane.org>
Date:   Wed Feb 9 14:32:28 2011 +0000

    Remove InvalidSlot svArray stuff in FmXFormShell

diff --git a/svx/source/form/fmshimp.cxx b/svx/source/form/fmshimp.cxx
index aa36fa5..32a3c9d 100644
--- a/svx/source/form/fmshimp.cxx
+++ b/svx/source/form/fmshimp.cxx
@@ -116,6 +116,7 @@
 
 #include <algorithm>
 #include <functional>
+#include <vector>
 
 // wird fuer Invalidate verwendet -> mitpflegen
 sal_uInt16 DatabaseSlotMap[] =
@@ -1050,9 +1051,8 @@ void FmXFormShell::InvalidateSlot( sal_Int16 nId, sal_Bool bWithId )
     ::osl::MutexGuard aGuard(m_aInvalidationSafety);
     if (m_nLockSlotInvalidation)
     {
-        m_arrInvalidSlots.Insert(nId, m_arrInvalidSlots.Count());
         BYTE nFlags = ( bWithId ? 0x01 : 0 );
-        m_arrInvalidSlots_Flags.Insert(nFlags, m_arrInvalidSlots_Flags.Count());
+        m_arrInvalidSlots.push_back( InvalidSlotInfo(nId, nFlags) );
     }
     else
         if (nId)
@@ -1090,21 +1090,14 @@ IMPL_LINK(FmXFormShell, OnInvalidateSlots, void*, EMPTYARG)
     ::osl::MutexGuard aGuard(m_aInvalidationSafety);
     m_nInvalidationEvent = 0;
 
-    DBG_ASSERT(m_arrInvalidSlots.Count() == m_arrInvalidSlots_Flags.Count(),
-        "FmXFormShell::OnInvalidateSlots : inconsistent slot arrays !");
-    BYTE nFlags;
-    for (sal_Int16 i=0; i<m_arrInvalidSlots.Count(); ++i)
+    for (std::vector<InvalidSlotInfo>::const_iterator i = m_arrInvalidSlots.begin(); i < m_arrInvalidSlots.end(); ++i)
     {
-        nFlags = m_arrInvalidSlots_Flags[i];
-
-        if (m_arrInvalidSlots[i])
-            m_pShell->GetViewShell()->GetViewFrame()->GetBindings().Invalidate(m_arrInvalidSlots[i], sal_True, (nFlags & 0x01));
+        if (i->id)
+            m_pShell->GetViewShell()->GetViewFrame()->GetBindings().Invalidate(i->id, sal_True, (i->flags & 0x01));
         else
             m_pShell->GetViewShell()->GetViewFrame()->GetBindings().InvalidateShell(*m_pShell);
     }
-
-    m_arrInvalidSlots.Remove(0, m_arrInvalidSlots.Count());
-    m_arrInvalidSlots_Flags.Remove(0, m_arrInvalidSlots_Flags.Count());
+    m_arrInvalidSlots.clear();
     return 0L;
 }
 
diff --git a/svx/source/inc/fmshimp.hxx b/svx/source/inc/fmshimp.hxx
index c085544..8ae5b1b 100644
--- a/svx/source/inc/fmshimp.hxx
+++ b/svx/source/inc/fmshimp.hxx
@@ -180,8 +180,12 @@ class SAL_DLLPRIVATE FmXFormShell   :public FmXFormShell_BASE
         // We enable a permanent cursor for the grid we found a searched text, it's disabled in the next "found" event.
     FmFormArray			m_aSearchForms;
 
-    SvUShorts	m_arrInvalidSlots;
-    SvBytes		m_arrInvalidSlots_Flags;
+    struct InvalidSlotInfo {
+        USHORT id;
+        BYTE   flags;
+        inline InvalidSlotInfo(USHORT slotId, BYTE flgs) : id(slotId), flags(flgs) {};
+    };
+    std::vector<InvalidSlotInfo> m_arrInvalidSlots;
         // we explicitly switch off the propbrw before leaving the design mode
         // this flag tells us if we have to switch it on again when reentering
 


More information about the Libreoffice-commits mailing list