using com::sun::star::uno::Reference; using com::sun::star::uno::Exception; using com::sun::star::uno::Any; usingnamespace com::sun::star; using com::sun::star::util::Duration; using com::sun::star::xml::sax::XFastAttributeList; using com::sun::star::xforms::XDataTypeRepository; usingnamespace xmloff::token;
// determine property name + suitable converter
OUString sPropertyName;
convert_t pConvert = nullptr; switch( nElementToken & TOKEN_MASK )
{ case XML_LENGTH:
sPropertyName = "Length";
pConvert = &xforms_int32; break; case XML_MINLENGTH:
sPropertyName = "MinLength";
pConvert = &xforms_int32; break; case XML_MAXLENGTH:
sPropertyName = "MaxLength";
pConvert = &xforms_int32; break; case XML_TOTALDIGITS:
sPropertyName = "TotalDigits";
pConvert = &xforms_int32; break; case XML_FRACTIONDIGITS:
sPropertyName = "FractionDigits";
pConvert = &xforms_int32; break; case XML_PATTERN:
sPropertyName = "Pattern";
pConvert = &xforms_string; break; case XML_WHITESPACE:
sPropertyName = "WhiteSpace";
pConvert = &xforms_whitespace; break; case XML_MININCLUSIVE: case XML_MINEXCLUSIVE: case XML_MAXINCLUSIVE: case XML_MAXEXCLUSIVE:
{ // these attributes are mapped to different properties. // To determine the property name, we use an attribute // dependent prefix and a type dependent suffix. The // converter is only type dependent.
// first, attribute-dependent prefix switch( nElementToken & TOKEN_MASK )
{ case XML_MININCLUSIVE:
sPropertyName = "MinInclusive"; break; case XML_MINEXCLUSIVE:
sPropertyName = "MinExclusive"; break; case XML_MAXINCLUSIVE:
sPropertyName = "MaxInclusive"; break; case XML_MAXEXCLUSIVE:
sPropertyName = "MaxExclusive"; break;
}
// second, type-dependent suffix + converter switch( xforms_getTypeClass( mxRepository,
GetImport().GetNamespaceMap(),
msBaseName ) )
{ case css::xsd::DataTypeClass::DECIMAL: case css::xsd::DataTypeClass::DOUBLE: case css::xsd::DataTypeClass::FLOAT:
sPropertyName += "Double";
pConvert = &xforms_double; break; case css::xsd::DataTypeClass::DATETIME:
sPropertyName += "DateTime";
pConvert = &xforms_dateTime; break; case css::xsd::DataTypeClass::DATE:
sPropertyName += "Date";
pConvert = &xforms_date; break; case css::xsd::DataTypeClass::TIME:
sPropertyName += "Time";
pConvert = &xforms_time; break; case css::xsd::DataTypeClass::gYear: case css::xsd::DataTypeClass::gDay: case css::xsd::DataTypeClass::gMonth:
sPropertyName += "Int";
pConvert = &xforms_int16; break;
case css::xsd::DataTypeClass::STRING: case css::xsd::DataTypeClass::anyURI: case css::xsd::DataTypeClass::BOOLEAN: // invalid: These shouldn't have min/max-inclusive break;
/* data types not yet supported: casecss::xsd::DataTypeClass::DURATION: casecss::xsd::DataTypeClass::gYearMonth: casecss::xsd::DataTypeClass::gMonthDay: casecss::xsd::DataTypeClass::hexBinary: casecss::xsd::DataTypeClass::base64Binary: casecss::xsd::DataTypeClass::QName: casecss::xsd::DataTypeClass::NOTATION:
*/
}
} break;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.