diff options
author | Noel Power <noel.power@novell.com> | 2010-10-06 10:16:27 +0100 |
---|---|---|
committer | Noel Power <noel.power@novell.com> | 2010-10-06 10:16:27 +0100 |
commit | 0b21b8b146fc4b982c7c9bbb866b9ff18a29332a (patch) | |
tree | 9b36a1dee6f92703604bcc86564568eefe711c22 /xmloff/source/forms | |
parent | 8d4d17664c9c6207fa35458075559d1fbfbfa2a5 (diff) |
initial commit for vba blob ( not including container_control stuff )
Diffstat (limited to 'xmloff/source/forms')
-rw-r--r-- | xmloff/source/forms/elementexport.cxx | 35 | ||||
-rw-r--r-- | xmloff/source/forms/formattributes.cxx | 8 | ||||
-rw-r--r-- | xmloff/source/forms/formattributes.hxx | 1 | ||||
-rw-r--r-- | xmloff/source/forms/layerimport.cxx | 2 | ||||
-rw-r--r-- | xmloff/source/forms/strings.hxx | 1 |
5 files changed, 45 insertions, 2 deletions
diff --git a/xmloff/source/forms/elementexport.cxx b/xmloff/source/forms/elementexport.cxx index 115b06c4c2ad..39a52251efe2 100644 --- a/xmloff/source/forms/elementexport.cxx +++ b/xmloff/source/forms/elementexport.cxx @@ -1107,6 +1107,39 @@ namespace xmloff } // ---------------------------------- + // the string properties + { + static sal_Int32 nStringPropertyAttributeIds[] = + { // attribute flags + SCA_GROUP_NAME + }; + static const ::rtl::OUString* pStringPropertyNames[] = + { // property names + &PROPERTY_GROUP_NAME + }; + + sal_Int32 nIdCount = sizeof( nStringPropertyAttributeIds ) / sizeof( nStringPropertyAttributeIds[0] ); + #if OSL_DEBUG_LEVEL > 0 + sal_Int32 nNameCount = sizeof( pStringPropertyNames ) / sizeof( pStringPropertyNames[0] ); + OSL_ENSURE( ( nIdCount == nNameCount ), + "OControlExport::exportSpecialAttributes: somebody tampered with the maps (2)!" ); + #endif + for ( i = 0; i < nIdCount; ++i ) + if ( nStringPropertyAttributeIds[i] & m_nIncludeSpecial ) + { + exportStringPropertyAttribute( + OAttributeMetaData::getSpecialAttributeNamespace( nStringPropertyAttributeIds[i] ), + OAttributeMetaData::getSpecialAttributeName( nStringPropertyAttributeIds[i] ), + *( pStringPropertyNames[i] ) + ); + #if OSL_DEBUG_LEVEL > 0 + // reset the bit for later checking + m_nIncludeSpecial = m_nIncludeSpecial & ~nStringPropertyAttributeIds[i]; + #endif + } + } + + // ---------------------------------- if ((SCA_MIN_VALUE | SCA_MAX_VALUE) & m_nIncludeSpecial) { // need to export the min value and the max value as attributes @@ -1564,6 +1597,8 @@ namespace xmloff } if ( m_xPropertyInfo->hasPropertyByName( PROPERTY_IMAGE_POSITION ) ) m_nIncludeSpecial |= SCA_IMAGE_POSITION; + if ( m_xPropertyInfo->hasPropertyByName( PROPERTY_GROUP_NAME ) ) + m_nIncludeSpecial |= SCA_GROUP_NAME; m_nIncludeDatabase = DA_DATA_FIELD | DA_INPUT_REQUIRED; m_nIncludeEvents = EA_CONTROL_EVENTS | EA_ON_CHANGE; break; diff --git a/xmloff/source/forms/formattributes.cxx b/xmloff/source/forms/formattributes.cxx index 0e2ef69ab9f8..fa51ffa9cfa2 100644 --- a/xmloff/source/forms/formattributes.cxx +++ b/xmloff/source/forms/formattributes.cxx @@ -192,6 +192,7 @@ namespace xmloff case SCA_MAX_VALUE: return "max-value"; case SCA_MIN_VALUE: return "min-value"; case SCA_VALIDATION: return "validation"; + case SCA_GROUP_NAME: return "group-name"; case SCA_MULTI_LINE: return "multi-line"; case SCA_AUTOMATIC_COMPLETION: return "auto-complete"; case SCA_MULTIPLE: return "multiple"; @@ -212,9 +213,12 @@ namespace xmloff } //--------------------------------------------------------------------- - sal_uInt16 OAttributeMetaData::getSpecialAttributeNamespace(sal_Int32 /*_nId*/) + sal_uInt16 OAttributeMetaData::getSpecialAttributeNamespace(sal_Int32 _nId) { - // nothing special here + switch( _nId ) + { + case SCA_GROUP_NAME: return XML_NAMESPACE_FORMX; + } return XML_NAMESPACE_FORM; } diff --git a/xmloff/source/forms/formattributes.hxx b/xmloff/source/forms/formattributes.hxx index 121476a9b21c..e8a5dfc170c9 100644 --- a/xmloff/source/forms/formattributes.hxx +++ b/xmloff/source/forms/formattributes.hxx @@ -123,6 +123,7 @@ namespace xmloff #define SCA_MAX_VALUE 0x00000002 #define SCA_MIN_VALUE 0x00000004 #define SCA_VALIDATION 0x00000008 + #define SCA_GROUP_NAME 0x00000010 #define SCA_MULTI_LINE 0x00000020 #define SCA_AUTOMATIC_COMPLETION 0x00000080 #define SCA_MULTIPLE 0x00000100 diff --git a/xmloff/source/forms/layerimport.cxx b/xmloff/source/forms/layerimport.cxx index 77d60f83ee49..8cc8f7012be2 100644 --- a/xmloff/source/forms/layerimport.cxx +++ b/xmloff/source/forms/layerimport.cxx @@ -95,6 +95,8 @@ OFormLayerXMLImport_Impl::OFormLayerXMLImport_Impl(SvXMLImport& _rImporter) m_aAttributeMetaData.addStringProperty( OAttributeMetaData::getCommonControlAttributeName(CCA_NAME), PROPERTY_NAME); m_aAttributeMetaData.addStringProperty( + OAttributeMetaData::getSpecialAttributeName(SCA_GROUP_NAME), PROPERTY_GROUP_NAME); + m_aAttributeMetaData.addStringProperty( OAttributeMetaData::getCommonControlAttributeName(CCA_IMAGE_DATA), PROPERTY_IMAGEURL); m_aAttributeMetaData.addStringProperty( OAttributeMetaData::getCommonControlAttributeName(CCA_LABEL), PROPERTY_LABEL); diff --git a/xmloff/source/forms/strings.hxx b/xmloff/source/forms/strings.hxx index 66a5f76786fe..92d82bc89832 100644 --- a/xmloff/source/forms/strings.hxx +++ b/xmloff/source/forms/strings.hxx @@ -205,6 +205,7 @@ namespace xmloff XMLFORM_CONSTASCII_STRING( PROPERTY_IMAGE_POSITION, "ImagePosition"); XMLFORM_CONSTASCII_STRING( PROPERTY_IMAGE_ALIGN, "ImageAlign"); XMLFORM_CONSTASCII_STRING( PROPERTY_SCALE_IMAGE, "ScaleImage"); + XMLFORM_CONSTASCII_STRING( PROPERTY_GROUP_NAME, "GroupName"); XMLFORM_CONSTASCII_STRING( PROPERTY_BOUND_CELL, "BoundCell"); XMLFORM_CONSTASCII_STRING( PROPERTY_LIST_CELL_RANGE, "CellRange"); |