From d63be9cce2494c855c076a37cab9843715346c46 Mon Sep 17 00:00:00 2001 From: Bartosz Kosiorek Date: Fri, 17 Sep 2010 19:06:31 +0200 Subject: svarray --- svx/source/form/fmsrcimp.cxx | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'svx/source/form/fmsrcimp.cxx') diff --git a/svx/source/form/fmsrcimp.cxx b/svx/source/form/fmsrcimp.cxx index a4bb5753e8bb..7904a4acae49 100644 --- a/svx/source/form/fmsrcimp.cxx +++ b/svx/source/form/fmsrcimp.cxx @@ -82,11 +82,6 @@ using namespace ::com::sun::star::i18n; using namespace ::com::sun::star::beans; using namespace ::svxform; -// *************************************************************************************************** - -// *************************************************************************************************** - -SV_IMPL_OBJARR(SvInt32Array, sal_Int32); //======================================================================== // = FmSearchThread @@ -848,7 +843,7 @@ void FmSearchEngine::Init(const ::rtl::OUString& sVisibleFields) // analyze the fields // additionally, create the mapping: because the list of used columns can be shorter than the list // of columns of the cursor, we need a mapping: "used column numer n" -> "cursor column m" - m_arrFieldMapping.Remove(0, m_arrFieldMapping.Count()); + m_arrFieldMapping.clear(); // important: The case of the columns does not need to be exact - for instance: // - a user created a form which works on a table, for which the driver returns a column name "COLUMN" @@ -912,7 +907,7 @@ void FmSearchEngine::Init(const ::rtl::OUString& sVisibleFields) // set the field selection back to the first pFieldNames = seqFieldNames.getArray();; DBG_ASSERT(nFoundIndex != -1, "FmSearchEngine::Init : Es wurden ungueltige Feldnamen angegeben !"); - m_arrFieldMapping.Insert(nFoundIndex, m_arrFieldMapping.Count()); + m_arrFieldMapping.push_back(nFoundIndex); } } catch(Exception&) @@ -1273,18 +1268,18 @@ void FmSearchEngine::RebuildUsedFields(sal_Int32 nFieldIndex, sal_Bool bForce) return; // (da ich keinen Wechsel des Iterators von aussen zulasse, heisst selber ::com::sun::star::sdbcx::Index auch immer selbe Spalte, also habe ich nix zu tun) - DBG_ASSERT((nFieldIndex >= -1) && (nFieldIndex= -1) && (nFieldIndex xFields; - for (sal_uInt16 i=0; i xSupplyCols(IFACECAST(m_xSearchCursor), UNO_QUERY); DBG_ASSERT(xSupplyCols.is(), "FmSearchEngine::RebuildUsedFields : invalid cursor (no columns supplier) !"); xFields = Reference< ::com::sun::star::container::XIndexAccess > (xSupplyCols->getColumns(), UNO_QUERY); - BuildAndInsertFieldInfo(xFields, m_arrFieldMapping.GetObject(i)); + BuildAndInsertFieldInfo(xFields, m_arrFieldMapping[i]); } } else @@ -1293,7 +1288,7 @@ void FmSearchEngine::RebuildUsedFields(sal_Int32 nFieldIndex, sal_Bool bForce) Reference< ::com::sun::star::sdbcx::XColumnsSupplier > xSupplyCols(IFACECAST(m_xSearchCursor), UNO_QUERY); DBG_ASSERT(xSupplyCols.is(), "FmSearchEngine::RebuildUsedFields : invalid cursor (no columns supplier) !"); xFields = Reference< ::com::sun::star::container::XIndexAccess > (xSupplyCols->getColumns(), UNO_QUERY); - BuildAndInsertFieldInfo(xFields, m_arrFieldMapping.GetObject((sal_uInt16)nFieldIndex)); + BuildAndInsertFieldInfo(xFields, m_arrFieldMapping[(sal_uInt16)nFieldIndex]); } m_nCurrentFieldIndex = nFieldIndex; -- cgit From 4b109aeea3e2d31da9eadff367587e8b61179889 Mon Sep 17 00:00:00 2001 From: Bartosz Kosiorek Date: Sun, 19 Sep 2010 23:40:28 +0200 Subject: Issue 112395, change comment to English --- svx/source/form/fmsrcimp.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'svx/source/form/fmsrcimp.cxx') diff --git a/svx/source/form/fmsrcimp.cxx b/svx/source/form/fmsrcimp.cxx index 7904a4acae49..9f14a4c94e85 100644 --- a/svx/source/form/fmsrcimp.cxx +++ b/svx/source/form/fmsrcimp.cxx @@ -906,7 +906,7 @@ void FmSearchEngine::Init(const ::rtl::OUString& sVisibleFields) } // set the field selection back to the first pFieldNames = seqFieldNames.getArray();; - DBG_ASSERT(nFoundIndex != -1, "FmSearchEngine::Init : Es wurden ungueltige Feldnamen angegeben !"); + DBG_ASSERT(nFoundIndex != -1, "FmSearchEngine::Init : Invalid field name were given !"); m_arrFieldMapping.push_back(nFoundIndex); } } -- cgit From 80226477b68c88c57568f4d501a90ec15c9a4b59 Mon Sep 17 00:00:00 2001 From: Bartosz Kosiorek Date: Thu, 23 Sep 2010 06:35:50 +0200 Subject: svarray: #i112395#: replace general cast to static_cast --- svx/source/form/fmsrcimp.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'svx/source/form/fmsrcimp.cxx') diff --git a/svx/source/form/fmsrcimp.cxx b/svx/source/form/fmsrcimp.cxx index 9f14a4c94e85..4720fc2e30de 100644 --- a/svx/source/form/fmsrcimp.cxx +++ b/svx/source/form/fmsrcimp.cxx @@ -1288,7 +1288,7 @@ void FmSearchEngine::RebuildUsedFields(sal_Int32 nFieldIndex, sal_Bool bForce) Reference< ::com::sun::star::sdbcx::XColumnsSupplier > xSupplyCols(IFACECAST(m_xSearchCursor), UNO_QUERY); DBG_ASSERT(xSupplyCols.is(), "FmSearchEngine::RebuildUsedFields : invalid cursor (no columns supplier) !"); xFields = Reference< ::com::sun::star::container::XIndexAccess > (xSupplyCols->getColumns(), UNO_QUERY); - BuildAndInsertFieldInfo(xFields, m_arrFieldMapping[(sal_uInt16)nFieldIndex]); + BuildAndInsertFieldInfo(xFields, m_arrFieldMapping[static_cast< size_t >(nFieldIndex)]); } m_nCurrentFieldIndex = nFieldIndex; -- cgit From c2a023ea84107f6505fb4a474178e25653587efe Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Sat, 23 Oct 2010 15:48:00 +0200 Subject: svarray: #i112395#: fix warnings, enable exceptions, etc. --- svx/source/form/fmsrcimp.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'svx/source/form/fmsrcimp.cxx') diff --git a/svx/source/form/fmsrcimp.cxx b/svx/source/form/fmsrcimp.cxx index 4720fc2e30de..ee870f0c29b0 100644 --- a/svx/source/form/fmsrcimp.cxx +++ b/svx/source/form/fmsrcimp.cxx @@ -1268,7 +1268,10 @@ void FmSearchEngine::RebuildUsedFields(sal_Int32 nFieldIndex, sal_Bool bForce) return; // (da ich keinen Wechsel des Iterators von aussen zulasse, heisst selber ::com::sun::star::sdbcx::Index auch immer selbe Spalte, also habe ich nix zu tun) - DBG_ASSERT((nFieldIndex >= -1) && (nFieldIndex= 0) && + (static_cast(nFieldIndex) < m_arrFieldMapping.size())), + "FmSearchEngine::RebuildUsedFields : nFieldIndex is invalid!"); // alle Felder, die ich durchsuchen muss, einsammeln m_arrUsedFields.clear(); if (nFieldIndex == -1) -- cgit