23#include <com/sun/star/uno/Sequence.hxx>
30 static css::uno::Sequence<OUString> aColumnTypes = []()
32 css::uno::Sequence<OUString> tmp(10);
33 OUString* pNames = tmp.getArray();
53static int NameCompare(
const void* pFirst,
const void* pSecond)
55 return static_cast<OUString
const *
>(pFirst)->compareTo(*
static_cast<OUString
const *
>(pSecond));
63 sal_Int32 lcl_findPos(
const OUString& aStr,
const Sequence< OUString>& rList)
65 const OUString* pStrList = rList.getConstArray();
66 OUString* pResult =
static_cast<OUString*
>(bsearch(&aStr,
static_cast<void const *
>(pStrList), rList.getLength(),
sizeof(OUString),
70 return (pResult - pStrList);
79 static constexpr OUStringLiteral aModelPrefix(
u"com.sun.star.form.component.");
80 static constexpr OUStringLiteral aCompatibleModelPrefix(
u"stardiv.one.form.component.");
82 sal_Int32 nTypeId = -1;
87 sal_Int32 nPrefixPos = aModelName.indexOf(aModelPrefix);
89 sal_Int32 nCompatiblePrefixPos = aModelName.indexOf(aCompatibleModelPrefix);
90 DBG_ASSERT( (nPrefixPos != -1) || (nCompatiblePrefixPos != -1),
"::getColumnTypeByModelName() : wrong service!");
93 OUString aColumnType = (nPrefixPos != -1)
94 ? aModelName.copy(aModelPrefix.getLength())
95 : aModelName.copy(aCompatibleModelPrefix.getLength());
97 const css::uno::Sequence<OUString>& rColumnTypes =
getColumnTypes();
98 nTypeId = lcl_findPos(aColumnType, rColumnTypes);
#define DBG_ASSERT(sCon, aError)
constexpr OUStringLiteral FM_COMPONENT_EDIT
sal_Int32 getColumnTypeByModelName(const OUString &aModelName)
static int NameCompare(const void *pFirst, const void *pSecond)
static const css::uno::Sequence< OUString > & getColumnTypes()
#define FM_COL_FORMATTEDFIELD
#define TYPE_FORMATTEDFIELD
#define TYPE_NUMERICFIELD
#define TYPE_PATTERNFIELD
#define FM_COL_PATTERNFIELD
#define TYPE_CURRENCYFIELD
#define FM_COL_NUMERICFIELD
#define FM_COL_CURRENCYFIELD