summaryrefslogtreecommitdiff
path: root/svx/source/fmcomp/gridcols.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'svx/source/fmcomp/gridcols.cxx')
-rw-r--r--svx/source/fmcomp/gridcols.cxx33
1 files changed, 32 insertions, 1 deletions
diff --git a/svx/source/fmcomp/gridcols.cxx b/svx/source/fmcomp/gridcols.cxx
index f954068d4d..339cf12cbb 100644
--- a/svx/source/fmcomp/gridcols.cxx
+++ b/svx/source/fmcomp/gridcols.cxx
@@ -35,6 +35,7 @@
#include <comphelper/types.hxx>
#include "fmservs.hxx"
#include "svx/fmtools.hxx"
+using namespace ::com::sun::star::uno;
//------------------------------------------------------------------------------
const ::comphelper::StringSequence& getColumnTypes()
@@ -57,6 +58,36 @@ const ::comphelper::StringSequence& getColumnTypes()
return aColumnTypes;
}
+//------------------------------------------------------------------
+// Vergleichen von PropertyInfo
+extern "C" int
+#if defined( WNT )
+ __cdecl
+#endif
+#if defined( ICC ) && defined( OS2 )
+_Optlink
+#endif
+ NameCompare(const void* pFirst, const void* pSecond)
+{
+ return ((::rtl::OUString*)pFirst)->compareTo(*(::rtl::OUString*)pSecond);
+}
+
+namespace
+{
+ //------------------------------------------------------------------------------
+ sal_Int32 lcl_findPos(const ::rtl::OUString& aStr, const Sequence< ::rtl::OUString>& rList)
+ {
+ const ::rtl::OUString* pStrList = rList.getConstArray();
+ ::rtl::OUString* pResult = (::rtl::OUString*) bsearch(&aStr, (void*)pStrList, rList.getLength(), sizeof(::rtl::OUString),
+ &NameCompare);
+
+ if (pResult)
+ return (pResult - pStrList);
+ else
+ return -1;
+ }
+}
+
//------------------------------------------------------------------------------
sal_Int32 getColumnTypeByModelName(const ::rtl::OUString& aModelName)
{
@@ -79,7 +110,7 @@ sal_Int32 getColumnTypeByModelName(const ::rtl::OUString& aModelName)
: aModelName.copy(aCompatibleModelPrefix.getLength());
const ::comphelper::StringSequence& rColumnTypes = getColumnTypes();
- nTypeId = findPos(aColumnType, rColumnTypes);
+ nTypeId = lcl_findPos(aColumnType, rColumnTypes);
}
return nTypeId;
}