diff options
Diffstat (limited to 'xmloff/source/xforms')
-rw-r--r-- | xmloff/source/xforms/SchemaRestrictionContext.cxx | 44 | ||||
-rw-r--r-- | xmloff/source/xforms/TokenContext.cxx | 2 | ||||
-rw-r--r-- | xmloff/source/xforms/XFormsBindContext.cxx | 22 | ||||
-rw-r--r-- | xmloff/source/xforms/XFormsModelContext.cxx | 4 | ||||
-rw-r--r-- | xmloff/source/xforms/XFormsSubmissionContext.cxx | 30 | ||||
-rw-r--r-- | xmloff/source/xforms/xformsapi.cxx | 24 | ||||
-rw-r--r-- | xmloff/source/xforms/xformsapi.hxx | 20 | ||||
-rw-r--r-- | xmloff/source/xforms/xformsexport.cxx | 167 | ||||
-rw-r--r-- | xmloff/source/xforms/xformsimport.cxx | 6 |
9 files changed, 159 insertions, 160 deletions
diff --git a/xmloff/source/xforms/SchemaRestrictionContext.cxx b/xmloff/source/xforms/SchemaRestrictionContext.cxx index b8c6027d2a13..6c8746f4ed26 100644 --- a/xmloff/source/xforms/SchemaRestrictionContext.cxx +++ b/xmloff/source/xforms/SchemaRestrictionContext.cxx @@ -125,7 +125,7 @@ void SchemaRestrictionContext::CreateDataType() mxDataType = Reference<XPropertySet>( mxRepository->cloneDataType( - lcl_getBasicTypeName( mxRepository, + xforms_getBasicTypeName( mxRepository, GetImport().GetNamespaceMap(), msBaseName ), msTypeName ), @@ -150,26 +150,26 @@ void SchemaRestrictionContext::HandleAttribute( typedef Any (*convert_t)( const OUString& ); -Any lcl_string( const OUString& rValue ) +Any xforms_string( const OUString& rValue ) { return makeAny( rValue ); } -Any lcl_int32( const OUString& rValue ) +Any xforms_int32( const OUString& rValue ) { sal_Int32 nValue; bool bSuccess = ::sax::Converter::convertNumber( nValue, rValue ); return bSuccess ? makeAny( nValue ) : Any(); } -Any lcl_int16( const OUString& rValue ) +Any xforms_int16( const OUString& rValue ) { sal_Int32 nValue; bool bSuccess = ::sax::Converter::convertNumber( nValue, rValue ); return bSuccess ? makeAny( static_cast<sal_Int16>( nValue ) ) : Any(); } -Any lcl_whitespace( const OUString& rValue ) +Any xforms_whitespace( const OUString& rValue ) { Any aValue; if( IsXMLToken( rValue, XML_PRESERVE ) ) @@ -181,14 +181,14 @@ Any lcl_whitespace( const OUString& rValue ) return aValue; } -Any lcl_double( const OUString& rValue ) +Any xforms_double( const OUString& rValue ) { double fValue; bool bSuccess = ::sax::Converter::convertDouble( fValue, rValue ); return bSuccess ? makeAny( fValue ) : Any(); } -Any lcl_date( const OUString& rValue ) +Any xforms_date( const OUString& rValue ) { Any aAny; @@ -209,14 +209,14 @@ Any lcl_date( const OUString& rValue ) return aAny; } -Any lcl_dateTime( const OUString& rValue ) +Any xforms_dateTime( const OUString& rValue ) { DateTime aDateTime; bool const bSuccess = ::sax::Converter::convertDateTime(aDateTime, rValue); return bSuccess ? makeAny( aDateTime ) : Any(); } -Any lcl_time( const OUString& rValue ) +Any xforms_time( const OUString& rValue ) { Any aAny; Duration aDuration; @@ -255,31 +255,31 @@ SvXMLImportContext* SchemaRestrictionContext::HandleChild( { case XML_LENGTH: sPropertyName = OUString(RTL_CONSTASCII_USTRINGPARAM("Length")); - pConvert = &lcl_int32; + pConvert = &xforms_int32; break; case XML_MINLENGTH: sPropertyName = OUString(RTL_CONSTASCII_USTRINGPARAM("MinLength")); - pConvert = &lcl_int32; + pConvert = &xforms_int32; break; case XML_MAXLENGTH: sPropertyName = OUString(RTL_CONSTASCII_USTRINGPARAM("MaxLength")); - pConvert = &lcl_int32; + pConvert = &xforms_int32; break; case XML_TOTALDIGITS: sPropertyName = OUString(RTL_CONSTASCII_USTRINGPARAM("TotalDigits")); - pConvert = &lcl_int32; + pConvert = &xforms_int32; break; case XML_FRACTIONDIGITS: sPropertyName =OUString(RTL_CONSTASCII_USTRINGPARAM("FractionDigits")); - pConvert = &lcl_int32; + pConvert = &xforms_int32; break; case XML_PATTERN: sPropertyName = OUString(RTL_CONSTASCII_USTRINGPARAM("Pattern")); - pConvert = &lcl_string; + pConvert = &xforms_string; break; case XML_WHITESPACE: sPropertyName = OUString(RTL_CONSTASCII_USTRINGPARAM("WhiteSpace")); - pConvert = &lcl_whitespace; + pConvert = &xforms_whitespace; break; case XML_MININCLUSIVE: case XML_MINEXCLUSIVE: @@ -309,7 +309,7 @@ SvXMLImportContext* SchemaRestrictionContext::HandleChild( } // second, type-dependent suffix + converter - switch( lcl_getTypeClass( mxRepository, + switch( xforms_getTypeClass( mxRepository, GetImport().GetNamespaceMap(), msBaseName ) ) { @@ -317,25 +317,25 @@ SvXMLImportContext* SchemaRestrictionContext::HandleChild( case com::sun::star::xsd::DataTypeClass::DOUBLE: case com::sun::star::xsd::DataTypeClass::FLOAT: sPropertyName += OUString(RTL_CONSTASCII_USTRINGPARAM("Double")); - pConvert = &lcl_double; + pConvert = &xforms_double; break; case com::sun::star::xsd::DataTypeClass::DATETIME: sPropertyName += OUString(RTL_CONSTASCII_USTRINGPARAM("DateTime")); - pConvert = &lcl_dateTime; + pConvert = &xforms_dateTime; break; case com::sun::star::xsd::DataTypeClass::DATE: sPropertyName += OUString(RTL_CONSTASCII_USTRINGPARAM("Date")); - pConvert = &lcl_date; + pConvert = &xforms_date; break; case com::sun::star::xsd::DataTypeClass::TIME: sPropertyName += OUString(RTL_CONSTASCII_USTRINGPARAM("Time")); - pConvert = &lcl_time; + pConvert = &xforms_time; break; case com::sun::star::xsd::DataTypeClass::gYear: case com::sun::star::xsd::DataTypeClass::gDay: case com::sun::star::xsd::DataTypeClass::gMonth: sPropertyName += OUString(RTL_CONSTASCII_USTRINGPARAM("Int")); - pConvert = &lcl_int16; + pConvert = &xforms_int16; break; case com::sun::star::xsd::DataTypeClass::STRING: diff --git a/xmloff/source/xforms/TokenContext.cxx b/xmloff/source/xforms/TokenContext.cxx index c88b700aade8..24f3fe2fd7f8 100644 --- a/xmloff/source/xforms/TokenContext.cxx +++ b/xmloff/source/xforms/TokenContext.cxx @@ -116,7 +116,7 @@ SvXMLImportContext* TokenContext::CreateChildContext( return pContext; } -bool lcl_IsWhiteSpace( sal_Unicode c ) +static bool lcl_IsWhiteSpace( sal_Unicode c ) { return c == sal_Unicode( ' ' ) || c == sal_Unicode( 0x09 ) diff --git a/xmloff/source/xforms/XFormsBindContext.cxx b/xmloff/source/xforms/XFormsBindContext.cxx index 1102cc44ec78..3f5f795b0819 100644 --- a/xmloff/source/xforms/XFormsBindContext.cxx +++ b/xmloff/source/xforms/XFormsBindContext.cxx @@ -71,7 +71,7 @@ static struct SvXMLTokenMapEntry aAttributeMap[] = }; // helper function; see below -void lcl_fillNamespaceContainer( const SvXMLNamespaceMap&, +static void lcl_fillNamespaceContainer( const SvXMLNamespaceMap&, Reference<XNameContainer>& ); XFormsBindContext::XFormsBindContext( @@ -99,29 +99,29 @@ void XFormsBindContext::HandleAttribute( sal_uInt16 nToken, switch( nToken ) { case XML_NODESET: - lcl_setValue( mxBinding, OUSTRING("BindingExpression"), rValue ); + xforms_setValue( mxBinding, OUSTRING("BindingExpression"), rValue ); break; case XML_ID: - lcl_setValue( mxBinding, OUSTRING("BindingID"), rValue ); + xforms_setValue( mxBinding, OUSTRING("BindingID"), rValue ); break; case XML_READONLY: - lcl_setValue( mxBinding, OUSTRING("ReadonlyExpression"), rValue ); + xforms_setValue( mxBinding, OUSTRING("ReadonlyExpression"), rValue ); break; case XML_RELEVANT: - lcl_setValue( mxBinding, OUSTRING("RelevantExpression"), rValue ); + xforms_setValue( mxBinding, OUSTRING("RelevantExpression"), rValue ); break; case XML_REQUIRED: - lcl_setValue( mxBinding, OUSTRING("RequiredExpression"), rValue ); + xforms_setValue( mxBinding, OUSTRING("RequiredExpression"), rValue ); break; case XML_CONSTRAINT: - lcl_setValue( mxBinding, OUSTRING("ConstraintExpression"), rValue ); + xforms_setValue( mxBinding, OUSTRING("ConstraintExpression"), rValue ); break; case XML_CALCULATE: - lcl_setValue( mxBinding, OUSTRING("CalculateExpression"), rValue ); + xforms_setValue( mxBinding, OUSTRING("CalculateExpression"), rValue ); break; case XML_TYPE: - lcl_setValue( mxBinding, OUSTRING("Type"), - makeAny( lcl_getTypeName( mxModel->getDataTypeRepository(), + xforms_setValue( mxBinding, OUSTRING("Type"), + makeAny( xforms_getTypeName( mxModel->getDataTypeRepository(), GetImport().GetNamespaceMap(), rValue ) ) ); break; @@ -159,7 +159,7 @@ SvXMLImportContext* XFormsBindContext::HandleChild( } -void lcl_fillNamespaceContainer( +static void lcl_fillNamespaceContainer( const SvXMLNamespaceMap& aMap, Reference<XNameContainer>& xContainer ) { diff --git a/xmloff/source/xforms/XFormsModelContext.cxx b/xmloff/source/xforms/XFormsModelContext.cxx index e526dc57c03f..8ec7753d7947 100644 --- a/xmloff/source/xforms/XFormsModelContext.cxx +++ b/xmloff/source/xforms/XFormsModelContext.cxx @@ -78,7 +78,7 @@ XFormsModelContext::XFormsModelContext( SvXMLImport& rImport, sal_uInt16 nPrefix, const OUString& rLocalName ) : TokenContext( rImport, nPrefix, rLocalName, aAttributes, aChildren ), - mxModel( lcl_createXFormsModel() ) + mxModel( xforms_createXFormsModel() ) { } @@ -156,7 +156,7 @@ void XFormsModelContext::EndElement() xUpdate->update(); GetImport().initXForms(); - lcl_addXFormsModel( GetImport().GetModel(), getModel() ); + xforms_addXFormsModel( GetImport().GetModel(), getModel() ); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/xforms/XFormsSubmissionContext.cxx b/xmloff/source/xforms/XFormsSubmissionContext.cxx index 2ee8c6fd0cf5..f4f16d770319 100644 --- a/xmloff/source/xforms/XFormsSubmissionContext.cxx +++ b/xmloff/source/xforms/XFormsSubmissionContext.cxx @@ -115,50 +115,50 @@ void XFormsSubmissionContext::HandleAttribute( sal_uInt16 nToken, switch( nToken ) { case XML_ID: - lcl_setValue( mxSubmission, OUSTRING("ID"), rValue ); + xforms_setValue( mxSubmission, OUSTRING("ID"), rValue ); break; case XML_BIND: - lcl_setValue( mxSubmission, OUSTRING("Bind"), rValue ); + xforms_setValue( mxSubmission, OUSTRING("Bind"), rValue ); break; case XML_REF: - lcl_setValue( mxSubmission, OUSTRING("Ref"), rValue ); + xforms_setValue( mxSubmission, OUSTRING("Ref"), rValue ); break; case XML_ACTION: - lcl_setValue( mxSubmission, OUSTRING("Action"), rValue ); + xforms_setValue( mxSubmission, OUSTRING("Action"), rValue ); break; case XML_METHOD: - lcl_setValue( mxSubmission, OUSTRING("Method"), rValue ); + xforms_setValue( mxSubmission, OUSTRING("Method"), rValue ); break; case XML_VERSION: - lcl_setValue( mxSubmission, OUSTRING("Version"), rValue ); + xforms_setValue( mxSubmission, OUSTRING("Version"), rValue ); break; case XML_INDENT: - lcl_setValue( mxSubmission, OUSTRING("Indent"), toBool( rValue ) ); + xforms_setValue( mxSubmission, OUSTRING("Indent"), toBool( rValue ) ); break; case XML_MEDIATYPE: - lcl_setValue( mxSubmission, OUSTRING("MediaType"), rValue ); + xforms_setValue( mxSubmission, OUSTRING("MediaType"), rValue ); break; case XML_ENCODING: - lcl_setValue( mxSubmission, OUSTRING("Encoding"), rValue ); + xforms_setValue( mxSubmission, OUSTRING("Encoding"), rValue ); break; case XML_OMIT_XML_DECLARATION: - lcl_setValue( mxSubmission, OUSTRING("OmitXmlDeclaration"), + xforms_setValue( mxSubmission, OUSTRING("OmitXmlDeclaration"), toBool( rValue ) ); break; case XML_STANDALONE: - lcl_setValue( mxSubmission, OUSTRING("Standalone"), toBool( rValue ) ); + xforms_setValue( mxSubmission, OUSTRING("Standalone"), toBool( rValue ) ); break; case XML_CDATA_SECTION_ELEMENTS: - lcl_setValue( mxSubmission, OUSTRING("CDataSectionElement"), rValue ); + xforms_setValue( mxSubmission, OUSTRING("CDataSectionElement"), rValue ); break; case XML_REPLACE: - lcl_setValue( mxSubmission, OUSTRING("Replace"), rValue ); + xforms_setValue( mxSubmission, OUSTRING("Replace"), rValue ); break; case XML_SEPARATOR: - lcl_setValue( mxSubmission, OUSTRING("Separator"), rValue ); + xforms_setValue( mxSubmission, OUSTRING("Separator"), rValue ); break; case XML_INCLUDENAMESPACEPREFIXES: - lcl_setValue( mxSubmission, OUSTRING("IncludeNamespacePrefixes"), rValue ); + xforms_setValue( mxSubmission, OUSTRING("IncludeNamespacePrefixes"), rValue ); break; default: OSL_FAIL( "unknown attribute" ); diff --git a/xmloff/source/xforms/xformsapi.cxx b/xmloff/source/xforms/xformsapi.cxx index f134b074c096..0e4f76eb5630 100644 --- a/xmloff/source/xforms/xformsapi.cxx +++ b/xmloff/source/xforms/xformsapi.cxx @@ -66,7 +66,7 @@ using com::sun::star::uno::Exception; using namespace com::sun::star; using namespace xmloff::token; -Reference<XPropertySet> lcl_createPropertySet( const OUString& rServiceName ) +static Reference<XPropertySet> lcl_createPropertySet( const OUString& rServiceName ) { Reference<XMultiServiceFactory> xFactory = getProcessServiceFactory(); DBG_ASSERT( xFactory.is(), "can't get service factory" ); @@ -78,12 +78,12 @@ Reference<XPropertySet> lcl_createPropertySet( const OUString& rServiceName ) return xModel; } -Reference<XPropertySet> lcl_createXFormsModel() +Reference<XPropertySet> xforms_createXFormsModel() { return lcl_createPropertySet( OUSTRING( "com.sun.star.xforms.Model" ) ); } -void lcl_addXFormsModel( +void xforms_addXFormsModel( const Reference<frame::XModel>& xDocument, const Reference<XPropertySet>& xModel ) { @@ -113,7 +113,7 @@ void lcl_addXFormsModel( (void)bSuccess; } -Reference<XPropertySet> lcl_findXFormsBindingOrSubmission( +static Reference<XPropertySet> lcl_findXFormsBindingOrSubmission( Reference<frame::XModel>& xDocument, const rtl::OUString& rBindingID, bool bBinding ) @@ -168,21 +168,21 @@ Reference<XPropertySet> lcl_findXFormsBindingOrSubmission( return xRet; } -Reference<XPropertySet> lcl_findXFormsBinding( +Reference<XPropertySet> xforms_findXFormsBinding( Reference<frame::XModel>& xDocument, const rtl::OUString& rBindingID ) { return lcl_findXFormsBindingOrSubmission( xDocument, rBindingID, true ); } -Reference<XPropertySet> lcl_findXFormsSubmission( +Reference<XPropertySet> xforms_findXFormsSubmission( Reference<frame::XModel>& xDocument, const rtl::OUString& rBindingID ) { return lcl_findXFormsBindingOrSubmission( xDocument, rBindingID, false ); } -void lcl_setValue( Reference<XPropertySet>& xPropertySet, +void xforms_setValue( Reference<XPropertySet>& xPropertySet, const OUString& rName, const Any rAny ) { @@ -207,7 +207,7 @@ static SvXMLTokenMapEntry aTypes[] = XML_TOKEN_MAP_END }; -sal_uInt16 lcl_getTypeClass( +sal_uInt16 xforms_getTypeClass( const Reference<XDataTypeRepository>& #ifdef DBG_UTIL xRepository @@ -282,7 +282,7 @@ sal_uInt16 lcl_getTypeClass( } -rtl::OUString lcl_getTypeName( +rtl::OUString xforms_getTypeName( const Reference<XDataTypeRepository>& xRepository, const SvXMLNamespaceMap& rNamespaceMap, const OUString& rXMLName ) @@ -293,10 +293,10 @@ rtl::OUString lcl_getTypeName( sal_uInt16 mnToken = aMap.Get( nPrefix, sLocalName ); return ( mnToken == XML_TOK_UNKNOWN ) ? rXMLName - : lcl_getBasicTypeName( xRepository, rNamespaceMap, rXMLName ); + : xforms_getBasicTypeName( xRepository, rNamespaceMap, rXMLName ); } -rtl::OUString lcl_getBasicTypeName( +rtl::OUString xforms_getBasicTypeName( const Reference<XDataTypeRepository>& xRepository, const SvXMLNamespaceMap& rNamespaceMap, const OUString& rXMLName ) @@ -306,7 +306,7 @@ rtl::OUString lcl_getBasicTypeName( { sTypeName = xRepository->getBasicDataType( - lcl_getTypeClass( xRepository, rNamespaceMap, rXMLName ) ) + xforms_getTypeClass( xRepository, rNamespaceMap, rXMLName ) ) ->getName(); } catch( const Exception& ) diff --git a/xmloff/source/xforms/xformsapi.hxx b/xmloff/source/xforms/xformsapi.hxx index bfe2fd51a7a0..2df567c95463 100644 --- a/xmloff/source/xforms/xformsapi.hxx +++ b/xmloff/source/xforms/xformsapi.hxx @@ -47,41 +47,41 @@ class SvXMLNamespaceMap; #define OUSTRING(msg) rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(msg)) -com::sun::star::uno::Reference<com::sun::star::beans::XPropertySet> lcl_createXFormsModel(); +com::sun::star::uno::Reference<com::sun::star::beans::XPropertySet> xforms_createXFormsModel(); -void lcl_addXFormsModel( +void xforms_addXFormsModel( const com::sun::star::uno::Reference<com::sun::star::frame::XModel>& xDocument, const com::sun::star::uno::Reference<com::sun::star::beans::XPropertySet>& xModel ); -com::sun::star::uno::Reference<com::sun::star::beans::XPropertySet> lcl_findXFormsBinding( com::sun::star::uno::Reference<com::sun::star::frame::XModel>&, const rtl::OUString& ); +com::sun::star::uno::Reference<com::sun::star::beans::XPropertySet> xforms_findXFormsBinding( com::sun::star::uno::Reference<com::sun::star::frame::XModel>&, const rtl::OUString& ); -com::sun::star::uno::Reference<com::sun::star::beans::XPropertySet> lcl_findXFormsSubmission( com::sun::star::uno::Reference<com::sun::star::frame::XModel>&, const rtl::OUString& ); +com::sun::star::uno::Reference<com::sun::star::beans::XPropertySet> xforms_findXFormsSubmission( com::sun::star::uno::Reference<com::sun::star::frame::XModel>&, const rtl::OUString& ); -void lcl_setValue( +void xforms_setValue( com::sun::star::uno::Reference<com::sun::star::beans::XPropertySet>& xPropSet, const rtl::OUString& rName, const com::sun::star::uno::Any rAny ); template<typename T> -void lcl_setValue( +void xforms_setValue( com::sun::star::uno::Reference<com::sun::star::beans::XPropertySet>& xPropSet, const rtl::OUString& rName, T& aValue ) { - lcl_setValue( xPropSet, rName, com::sun::star::uno::makeAny( aValue ) ); + xforms_setValue( xPropSet, rName, com::sun::star::uno::makeAny( aValue ) ); } -sal_uInt16 lcl_getTypeClass( +sal_uInt16 xforms_getTypeClass( const com::sun::star::uno::Reference<com::sun::star::xforms::XDataTypeRepository>& xRepository, const SvXMLNamespaceMap& rNamespaceMap, const rtl::OUString& rXMLName ); -rtl::OUString lcl_getTypeName( +rtl::OUString xforms_getTypeName( const com::sun::star::uno::Reference<com::sun::star::xforms::XDataTypeRepository>& xRepository, const SvXMLNamespaceMap& rNamespaceMap, const rtl::OUString& rXMLName ); -rtl::OUString lcl_getBasicTypeName( +rtl::OUString xforms_getBasicTypeName( const com::sun::star::uno::Reference<com::sun::star::xforms::XDataTypeRepository>& xRepository, const SvXMLNamespaceMap& rNamespaceMap, const rtl::OUString& rXMLName ); diff --git a/xmloff/source/xforms/xformsexport.cxx b/xmloff/source/xforms/xformsexport.cxx index 7016f6255ebe..53239c884528 100644 --- a/xmloff/source/xforms/xformsexport.cxx +++ b/xmloff/source/xforms/xformsexport.cxx @@ -132,33 +132,32 @@ typedef struct sal_uInt16 nToken; convert_t aConverter; } ExportTable; -void lcl_export( const Reference<XPropertySet>& rPropertySet, +static void lcl_export( const Reference<XPropertySet>& rPropertySet, SvXMLExport& rExport, const ExportTable* pTable ); #define TABLE_ENTRY(NAME,NAMESPACE,TOKEN,CONVERTER) { NAME,sizeof(NAME)-1,XML_NAMESPACE_##NAMESPACE,xmloff::token::XML_##TOKEN, CONVERTER } #define TABLE_END { NULL, 0, 0, 0, NULL } - // any conversion functions -OUString lcl_string( const Any& ); -OUString lcl_bool( const Any& ); -OUString lcl_whitespace( const Any& ); -template<typename T, void (*FUNC)( OUStringBuffer&, T )> OUString lcl_convert( const Any& ); -template<typename T, void (*FUNC)( OUStringBuffer&, const T& )> OUString lcl_convertRef( const Any& ); - -void lcl_formatDate( OUStringBuffer& aBuffer, const Date& aDate ); -void lcl_formatTime( OUStringBuffer& aBuffer, const com::sun::star::util::Time& aTime ); -void lcl_formatDateTime( OUStringBuffer& aBuffer, const DateTime& aDateTime ); - -convert_t lcl_int32 = &lcl_convert<sal_Int32,&::sax::Converter::convertNumber>; -convert_t lcl_double = &lcl_convert<double,&::sax::Converter::convertDouble>; -convert_t lcl_dateTime = &lcl_convertRef<DateTime,&lcl_formatDateTime>; -convert_t lcl_date = &lcl_convertRef<Date,&lcl_formatDate>; -convert_t lcl_time = &lcl_convertRef<com::sun::star::util::Time,&lcl_formatTime>; +OUString xforms_string( const Any& ); +OUString xforms_bool( const Any& ); +OUString xforms_whitespace( const Any& ); +template<typename T, void (*FUNC)( OUStringBuffer&, T )> OUString xforms_convert( const Any& ); +template<typename T, void (*FUNC)( OUStringBuffer&, const T& )> OUString xforms_convertRef( const Any& ); + +void xforms_formatDate( OUStringBuffer& aBuffer, const Date& aDate ); +void xforms_formatTime( OUStringBuffer& aBuffer, const com::sun::star::util::Time& aTime ); +void xforms_formatDateTime( OUStringBuffer& aBuffer, const DateTime& aDateTime ); + +convert_t xforms_int32 = &xforms_convert<sal_Int32,&::sax::Converter::convertNumber>; +convert_t xforms_double = &xforms_convert<double,&::sax::Converter::convertDouble>; +convert_t xforms_dateTime = &xforms_convertRef<DateTime,&xforms_formatDateTime>; +convert_t xforms_date = &xforms_convertRef<Date,&xforms_formatDate>; +convert_t xforms_time = &xforms_convertRef<com::sun::star::util::Time,&xforms_formatTime>; // other functions -OUString lcl_getXSDType( SvXMLExport& rExport, +static OUString lcl_getXSDType( SvXMLExport& rExport, const Reference<XPropertySet>& xType ); @@ -168,8 +167,8 @@ OUString lcl_getXSDType( SvXMLExport& rExport, static const ExportTable aXFormsModelTable[] = { - TABLE_ENTRY( "ID", NONE, ID, lcl_string ), - TABLE_ENTRY( "SchemaRef", NONE, SCHEMA, lcl_string ), + TABLE_ENTRY( "ID", NONE, ID, xforms_string ), + TABLE_ENTRY( "SchemaRef", NONE, SCHEMA, xforms_string ), TABLE_END }; @@ -229,7 +228,7 @@ void exportXFormsModel( SvXMLExport& rExport, static const ExportTable aXFormsInstanceTable[] = { - TABLE_ENTRY( "InstanceURL", NONE, SRC, lcl_string ), + TABLE_ENTRY( "InstanceURL", NONE, SRC, xforms_string ), TABLE_END }; @@ -276,15 +275,15 @@ void exportXFormsInstance( SvXMLExport& rExport, static const ExportTable aXFormsBindingTable[] = { - TABLE_ENTRY( "BindingID", NONE, ID, lcl_string ), - TABLE_ENTRY( "BindingExpression", NONE, NODESET, lcl_string ), - TABLE_ENTRY( "ReadonlyExpression", NONE, READONLY, lcl_string ), - TABLE_ENTRY( "RelevantExpression", NONE, RELEVANT, lcl_string ), - TABLE_ENTRY( "RequiredExpression", NONE, REQUIRED, lcl_string ), - TABLE_ENTRY( "ConstraintExpression", NONE, CONSTRAINT, lcl_string ), - TABLE_ENTRY( "CalculateExpression", NONE, CALCULATE, lcl_string ), + TABLE_ENTRY( "BindingID", NONE, ID, xforms_string ), + TABLE_ENTRY( "BindingExpression", NONE, NODESET, xforms_string ), + TABLE_ENTRY( "ReadonlyExpression", NONE, READONLY, xforms_string ), + TABLE_ENTRY( "RelevantExpression", NONE, RELEVANT, xforms_string ), + TABLE_ENTRY( "RequiredExpression", NONE, REQUIRED, xforms_string ), + TABLE_ENTRY( "ConstraintExpression", NONE, CONSTRAINT, xforms_string ), + TABLE_ENTRY( "CalculateExpression", NONE, CALCULATE, xforms_string ), // type handled separatly, for type name <-> XSD type conversion - // TABLE_ENTRY( "Type", NONE, TYPE, lcl_string ), + // TABLE_ENTRY( "Type", NONE, TYPE, xforms_string ), TABLE_END }; @@ -390,21 +389,21 @@ void exportXFormsBinding( SvXMLExport& rExport, static const ExportTable aXFormsSubmissionTable[] = { - TABLE_ENTRY( "ID", NONE, ID, lcl_string ), - TABLE_ENTRY( "Bind", NONE, BIND, lcl_string ), - TABLE_ENTRY( "Ref", NONE, REF, lcl_string ), - TABLE_ENTRY( "Action", NONE, ACTION, lcl_string ), - TABLE_ENTRY( "Method", NONE, METHOD, lcl_string ), - TABLE_ENTRY( "Version", NONE, VERSION, lcl_string ), - TABLE_ENTRY( "Indent", NONE, INDENT, lcl_bool ), - TABLE_ENTRY( "MediaType", NONE, MEDIATYPE, lcl_string ), - TABLE_ENTRY( "Encoding", NONE, ENCODING, lcl_string ), - TABLE_ENTRY( "OmitXmlDeclaration", NONE, OMIT_XML_DECLARATION, lcl_bool ), - TABLE_ENTRY( "Standalone", NONE, STANDALONE, lcl_bool ), - TABLE_ENTRY( "CDataSectionElement", NONE, CDATA_SECTION_ELEMENTS, lcl_string ), - TABLE_ENTRY( "Replace", NONE, REPLACE, lcl_string ), - TABLE_ENTRY( "Separator", NONE, SEPARATOR, lcl_string ), - TABLE_ENTRY( "IncludeNamespacePrefixes", NONE, INCLUDENAMESPACEPREFIXES, lcl_string ), + TABLE_ENTRY( "ID", NONE, ID, xforms_string ), + TABLE_ENTRY( "Bind", NONE, BIND, xforms_string ), + TABLE_ENTRY( "Ref", NONE, REF, xforms_string ), + TABLE_ENTRY( "Action", NONE, ACTION, xforms_string ), + TABLE_ENTRY( "Method", NONE, METHOD, xforms_string ), + TABLE_ENTRY( "Version", NONE, VERSION, xforms_string ), + TABLE_ENTRY( "Indent", NONE, INDENT, xforms_bool ), + TABLE_ENTRY( "MediaType", NONE, MEDIATYPE, xforms_string ), + TABLE_ENTRY( "Encoding", NONE, ENCODING, xforms_string ), + TABLE_ENTRY( "OmitXmlDeclaration", NONE, OMIT_XML_DECLARATION, xforms_bool ), + TABLE_ENTRY( "Standalone", NONE, STANDALONE, xforms_bool ), + TABLE_ENTRY( "CDataSectionElement", NONE, CDATA_SECTION_ELEMENTS, xforms_string ), + TABLE_ENTRY( "Replace", NONE, REPLACE, xforms_string ), + TABLE_ENTRY( "Separator", NONE, SEPARATOR, xforms_string ), + TABLE_ENTRY( "IncludeNamespacePrefixes", NONE, INCLUDENAMESPACEPREFIXES, xforms_string ), TABLE_END }; @@ -424,39 +423,39 @@ void exportXFormsSubmission( SvXMLExport& rExport, static const ExportTable aDataTypeFacetTable[] = { - TABLE_ENTRY( "Length", XSD, LENGTH, lcl_int32 ), - TABLE_ENTRY( "MinLength", XSD, MINLENGTH, lcl_int32 ), - TABLE_ENTRY( "MaxLength", XSD, MAXLENGTH, lcl_int32 ), - TABLE_ENTRY( "MinInclusiveInt", XSD, MININCLUSIVE, lcl_int32 ), - TABLE_ENTRY( "MinExclusiveInt", XSD, MINEXCLUSIVE, lcl_int32 ), - TABLE_ENTRY( "MaxInclusiveInt", XSD, MAXINCLUSIVE, lcl_int32 ), - TABLE_ENTRY( "MaxExclusiveInt", XSD, MAXEXCLUSIVE, lcl_int32 ), - TABLE_ENTRY( "MinInclusiveDouble", XSD, MININCLUSIVE, lcl_double ), - TABLE_ENTRY( "MinExclusiveDouble", XSD, MINEXCLUSIVE, lcl_double ), - TABLE_ENTRY( "MaxInclusiveDouble", XSD, MAXINCLUSIVE, lcl_double ), - TABLE_ENTRY( "MaxExclusiveDouble", XSD, MAXEXCLUSIVE, lcl_double ), - TABLE_ENTRY( "MinInclusiveDate", XSD, MININCLUSIVE, lcl_date ), - TABLE_ENTRY( "MinExclusiveDate", XSD, MINEXCLUSIVE, lcl_date ), - TABLE_ENTRY( "MaxInclusiveDate", XSD, MAXINCLUSIVE, lcl_date ), - TABLE_ENTRY( "MaxExclusiveDate", XSD, MAXEXCLUSIVE, lcl_date ), - TABLE_ENTRY( "MinInclusiveTime", XSD, MININCLUSIVE, lcl_time ), - TABLE_ENTRY( "MinExclusiveTime", XSD, MINEXCLUSIVE, lcl_time ), - TABLE_ENTRY( "MaxInclusiveTime", XSD, MAXINCLUSIVE, lcl_time ), - TABLE_ENTRY( "MaxExclusiveTime", XSD, MAXEXCLUSIVE, lcl_time ), - TABLE_ENTRY( "MinInclusiveDateTime", XSD, MININCLUSIVE, lcl_dateTime ), - TABLE_ENTRY( "MinExclusiveDateTime", XSD, MINEXCLUSIVE, lcl_dateTime ), - TABLE_ENTRY( "MaxInclusiveDateTime", XSD, MAXINCLUSIVE, lcl_dateTime ), - TABLE_ENTRY( "MaxExclusiveDateTime", XSD, MAXEXCLUSIVE, lcl_dateTime ), - TABLE_ENTRY( "Pattern", XSD, PATTERN, lcl_string ), + TABLE_ENTRY( "Length", XSD, LENGTH, xforms_int32 ), + TABLE_ENTRY( "MinLength", XSD, MINLENGTH, xforms_int32 ), + TABLE_ENTRY( "MaxLength", XSD, MAXLENGTH, xforms_int32 ), + TABLE_ENTRY( "MinInclusiveInt", XSD, MININCLUSIVE, xforms_int32 ), + TABLE_ENTRY( "MinExclusiveInt", XSD, MINEXCLUSIVE, xforms_int32 ), + TABLE_ENTRY( "MaxInclusiveInt", XSD, MAXINCLUSIVE, xforms_int32 ), + TABLE_ENTRY( "MaxExclusiveInt", XSD, MAXEXCLUSIVE, xforms_int32 ), + TABLE_ENTRY( "MinInclusiveDouble", XSD, MININCLUSIVE, xforms_double ), + TABLE_ENTRY( "MinExclusiveDouble", XSD, MINEXCLUSIVE, xforms_double ), + TABLE_ENTRY( "MaxInclusiveDouble", XSD, MAXINCLUSIVE, xforms_double ), + TABLE_ENTRY( "MaxExclusiveDouble", XSD, MAXEXCLUSIVE, xforms_double ), + TABLE_ENTRY( "MinInclusiveDate", XSD, MININCLUSIVE, xforms_date ), + TABLE_ENTRY( "MinExclusiveDate", XSD, MINEXCLUSIVE, xforms_date ), + TABLE_ENTRY( "MaxInclusiveDate", XSD, MAXINCLUSIVE, xforms_date ), + TABLE_ENTRY( "MaxExclusiveDate", XSD, MAXEXCLUSIVE, xforms_date ), + TABLE_ENTRY( "MinInclusiveTime", XSD, MININCLUSIVE, xforms_time ), + TABLE_ENTRY( "MinExclusiveTime", XSD, MINEXCLUSIVE, xforms_time ), + TABLE_ENTRY( "MaxInclusiveTime", XSD, MAXINCLUSIVE, xforms_time ), + TABLE_ENTRY( "MaxExclusiveTime", XSD, MAXEXCLUSIVE, xforms_time ), + TABLE_ENTRY( "MinInclusiveDateTime", XSD, MININCLUSIVE, xforms_dateTime ), + TABLE_ENTRY( "MinExclusiveDateTime", XSD, MINEXCLUSIVE, xforms_dateTime ), + TABLE_ENTRY( "MaxInclusiveDateTime", XSD, MAXINCLUSIVE, xforms_dateTime ), + TABLE_ENTRY( "MaxExclusiveDateTime", XSD, MAXEXCLUSIVE, xforms_dateTime ), + TABLE_ENTRY( "Pattern", XSD, PATTERN, xforms_string ), // ??? XML_ENUMERATION, - TABLE_ENTRY( "WhiteSpace", XSD, WHITESPACE, lcl_whitespace ), - TABLE_ENTRY( "TotalDigits", XSD, TOTALDIGITS, lcl_int32 ), - TABLE_ENTRY( "FractionDigits", XSD, FRACTIONDIGITS, lcl_int32 ), + TABLE_ENTRY( "WhiteSpace", XSD, WHITESPACE, xforms_whitespace ), + TABLE_ENTRY( "TotalDigits", XSD, TOTALDIGITS, xforms_int32 ), + TABLE_ENTRY( "FractionDigits", XSD, FRACTIONDIGITS, xforms_int32 ), TABLE_END }; // export facets through table; use the same table as lcl_export does -void lcl_exportDataTypeFacets( SvXMLExport& rExport, +static void lcl_exportDataTypeFacets( SvXMLExport& rExport, const Reference<XPropertySet>& rPropertySet, const ExportTable* pTable ) { @@ -484,7 +483,7 @@ void lcl_exportDataTypeFacets( SvXMLExport& rExport, } } -OUString lcl_getXSDType( SvXMLExport& rExport, +static OUString lcl_getXSDType( SvXMLExport& rExport, const Reference<XPropertySet>& xType ) { // we use string as default... @@ -545,7 +544,7 @@ OUString lcl_getXSDType( SvXMLExport& rExport, GetXMLToken( eToken ) ); } -void lcl_exportDataType( SvXMLExport& rExport, +static void lcl_exportDataType( SvXMLExport& rExport, const Reference<XPropertySet>& xType ) { // we do not need to export basic types; exit if we have one @@ -620,7 +619,7 @@ void exportXFormsSchemas( SvXMLExport& rExport, // helper functions // -void lcl_export( const Reference<XPropertySet>& rPropertySet, +static void lcl_export( const Reference<XPropertySet>& rPropertySet, SvXMLExport& rExport, const ExportTable* pTable ) { @@ -647,7 +646,7 @@ void lcl_export( const Reference<XPropertySet>& rPropertySet, // template<typename T, void (*FUNC)( OUStringBuffer&, T )> -OUString lcl_convert( const Any& rAny ) +OUString xforms_convert( const Any& rAny ) { OUStringBuffer aBuffer; T aData = T(); @@ -659,7 +658,7 @@ OUString lcl_convert( const Any& rAny ) } template<typename T, void (*FUNC)( OUStringBuffer&, const T& )> -OUString lcl_convertRef( const Any& rAny ) +OUString xforms_convertRef( const Any& rAny ) { OUStringBuffer aBuffer; T aData; @@ -670,14 +669,14 @@ OUString lcl_convertRef( const Any& rAny ) return aBuffer.makeStringAndClear(); } -OUString lcl_string( const Any& rAny ) +OUString xforms_string( const Any& rAny ) { OUString aResult; rAny >>= aResult; return aResult; } -OUString lcl_bool( const Any& rAny ) +OUString xforms_bool( const Any& rAny ) { bool bResult = bool(); if( rAny >>= bResult ) @@ -686,7 +685,7 @@ OUString lcl_bool( const Any& rAny ) return OUString(); } -void lcl_formatDate( OUStringBuffer& aBuffer, const Date& rDate ) +void xforms_formatDate( OUStringBuffer& aBuffer, const Date& rDate ) { aBuffer.append( static_cast<sal_Int32>( rDate.Year ) ); aBuffer.append( sal_Unicode('-') ); @@ -695,7 +694,7 @@ void lcl_formatDate( OUStringBuffer& aBuffer, const Date& rDate ) aBuffer.append( static_cast<sal_Int32>( rDate.Day ) ); } -void lcl_formatTime( OUStringBuffer& aBuffer, const com::sun::star::util::Time& rTime ) +void xforms_formatTime( OUStringBuffer& aBuffer, const com::sun::star::util::Time& rTime ) { Duration aDuration; aDuration.Hours = rTime.Hours; @@ -705,12 +704,12 @@ void lcl_formatTime( OUStringBuffer& aBuffer, const com::sun::star::util::Time& ::sax::Converter::convertDuration( aBuffer, aDuration ); } -void lcl_formatDateTime( OUStringBuffer& aBuffer, const DateTime& aDateTime ) +void xforms_formatDateTime( OUStringBuffer& aBuffer, const DateTime& aDateTime ) { ::sax::Converter::convertDateTime( aBuffer, aDateTime ); } -OUString lcl_whitespace( const Any& rAny ) +OUString xforms_whitespace( const Any& rAny ) { OUString sResult; sal_uInt16 n = sal_uInt16(); @@ -734,7 +733,7 @@ OUString lcl_whitespace( const Any& rAny ) /// return name of Binding -OUString lcl_getXFormsBindName( const Reference<XPropertySet>& xBinding ) +static OUString lcl_getXFormsBindName( const Reference<XPropertySet>& xBinding ) { OUString sProp( OUSTRING( "BindingID" ) ); diff --git a/xmloff/source/xforms/xformsimport.cxx b/xmloff/source/xforms/xformsimport.cxx index e8eebd5fd560..222318adbc85 100644 --- a/xmloff/source/xforms/xformsimport.cxx +++ b/xmloff/source/xforms/xformsimport.cxx @@ -81,7 +81,7 @@ void bindXFormsValueBinding( aPair.first, UNO_QUERY ); Reference<XValueBinding> xBinding( - lcl_findXFormsBinding( xModel, aPair.second ), + xforms_findXFormsBinding( xModel, aPair.second ), UNO_QUERY ); if( xBindable.is() && xBinding.is() ) @@ -106,7 +106,7 @@ void bindXFormsListBinding( aPair.first, UNO_QUERY ); Reference<XListEntrySource> xListEntrySource( - lcl_findXFormsBinding( xModel, aPair.second ), + xforms_findXFormsBinding( xModel, aPair.second ), UNO_QUERY ); if( xListEntrySink.is() && xListEntrySource.is() ) @@ -129,7 +129,7 @@ void bindXFormsSubmission( { Reference<XSubmissionSupplier> xSubmissionSupp( aPair.first, UNO_QUERY ); Reference<XSubmission> xSubmission( - lcl_findXFormsSubmission( xModel, aPair.second ), + xforms_findXFormsSubmission( xModel, aPair.second ), UNO_QUERY ); if( xSubmissionSupp.is() && xSubmission.is() ) |