diff options
author | Vladimir Glazunov <vg@openoffice.org> | 2009-12-10 18:00:39 +0100 |
---|---|---|
committer | Vladimir Glazunov <vg@openoffice.org> | 2009-12-10 18:00:39 +0100 |
commit | 2efe116f872503f423caa902857932fdacac4b04 (patch) | |
tree | bf43f5d787ce8c6e3187fa699da81d3aba1582c5 /xmloff/source/text | |
parent | 4443370e8e3e49f32394a765c25148891799be2e (diff) | |
parent | cd613532c9a147e4b02c1bbc6c7fe84949c691b5 (diff) |
CWS-TOOLING: integrate CWS os137
Diffstat (limited to 'xmloff/source/text')
-rw-r--r-- | xmloff/source/text/txtflde.cxx | 11 | ||||
-rw-r--r-- | xmloff/source/text/txtfldi.cxx | 33 |
2 files changed, 41 insertions, 3 deletions
diff --git a/xmloff/source/text/txtflde.cxx b/xmloff/source/text/txtflde.cxx index e7cbc273c27a..05d3694462be 100644 --- a/xmloff/source/text/txtflde.cxx +++ b/xmloff/source/text/txtflde.cxx @@ -707,6 +707,7 @@ sal_Bool XMLTextFieldExport::IsStringField( case FIELD_ID_PAGENUMBER: case FIELD_ID_REFPAGE_SET: case FIELD_ID_REFPAGE_GET: + case FIELD_ID_DOCINFO_CUSTOM: // always number return sal_False; @@ -727,7 +728,6 @@ sal_Bool XMLTextFieldExport::IsStringField( case FIELD_ID_HIDDEN_PARAGRAPH: case FIELD_ID_DOCINFO_CREATION_AUTHOR: case FIELD_ID_DOCINFO_DESCRIPTION: - case FIELD_ID_DOCINFO_CUSTOM: case FIELD_ID_DOCINFO_PRINT_AUTHOR: case FIELD_ID_DOCINFO_TITLE: case FIELD_ID_DOCINFO_SUBJECT: @@ -880,6 +880,7 @@ void XMLTextFieldExport::ExportFieldAutoStyle( case FIELD_ID_USER_GET: case FIELD_ID_EXPRESSION: case FIELD_ID_TABLE_FORMULA: + case FIELD_ID_DOCINFO_CUSTOM: // register number format, if this is a numeric field if (! IsStringField(nToken, xPropSet)) { @@ -943,7 +944,6 @@ void XMLTextFieldExport::ExportFieldAutoStyle( case FIELD_ID_HIDDEN_PARAGRAPH: case FIELD_ID_DOCINFO_CREATION_AUTHOR: case FIELD_ID_DOCINFO_DESCRIPTION: - case FIELD_ID_DOCINFO_CUSTOM: case FIELD_ID_DOCINFO_PRINT_AUTHOR: case FIELD_ID_DOCINFO_TITLE: case FIELD_ID_DOCINFO_SUBJECT: @@ -1503,6 +1503,13 @@ void XMLTextFieldExport::ExportFieldHelper( case FIELD_ID_DOCINFO_CUSTOM: { + ProcessValueAndType(sal_False, // doesn't happen for text + GetIntProperty(sPropertyNumberFormat,rPropSet), + sEmpty, sEmpty, 0.0, // not used + sal_False, sal_False, sal_True, + ! GetOptionalBoolProperty( + sPropertyIsFixedLanguage, + rPropSet, xPropSetInfo, sal_False )); uno::Any aAny = rPropSet->getPropertyValue( sPropertyName ); ::rtl::OUString sName; aAny >>= sName; diff --git a/xmloff/source/text/txtfldi.cxx b/xmloff/source/text/txtfldi.cxx index 632fba8ddddd..f6f768312a94 100644 --- a/xmloff/source/text/txtfldi.cxx +++ b/xmloff/source/text/txtfldi.cxx @@ -2048,6 +2048,11 @@ XMLUserDocInfoImportContext::XMLUserDocInfoImportContext( sLocalName, nToken, sal_False, sal_False) , sPropertyName(RTL_CONSTASCII_USTRINGPARAM(sAPI_name)) + , sPropertyNumberFormat(RTL_CONSTASCII_USTRINGPARAM(sAPI_number_format)) + , sPropertyIsFixedLanguage(RTL_CONSTASCII_USTRINGPARAM(sAPI_is_fixed_language)) + , nFormat(0) + , bFormatOK(sal_False) + , bIsDefaultLanguage( sal_True ) { bValid = sal_False; } @@ -2058,6 +2063,17 @@ void XMLUserDocInfoImportContext::ProcessAttribute( { switch (nAttrToken) { + case XML_TOK_TEXTFIELD_DATA_STYLE_NAME: + { + sal_Int32 nKey = GetImportHelper().GetDataStyleKey( + sAttrValue, &bIsDefaultLanguage); + if (-1 != nKey) + { + nFormat = nKey; + bFormatOK = sal_True; + } + break; + } case XML_TOK_TEXTFIELD_NAME: { if (!bValid) @@ -2080,12 +2096,27 @@ void XMLUserDocInfoImportContext::PrepareField( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> & xPropertySet) { + uno::Any aAny; if ( aName.getLength() ) { - uno::Any aAny; aAny <<= aName; xPropertySet->setPropertyValue(sPropertyName, aAny); } + Reference<XPropertySetInfo> xPropertySetInfo( + xPropertySet->getPropertySetInfo()); + if (bFormatOK && + xPropertySetInfo->hasPropertyByName(sPropertyNumberFormat)) + { + aAny <<= nFormat; + xPropertySet->setPropertyValue(sPropertyNumberFormat, aAny); + + if( xPropertySetInfo->hasPropertyByName( sPropertyIsFixedLanguage ) ) + { + sal_Bool bIsFixedLanguage = ! bIsDefaultLanguage; + aAny.setValue( &bIsFixedLanguage, ::getBooleanCppuType() ); + xPropertySet->setPropertyValue( sPropertyIsFixedLanguage, aAny ); + } + } // call superclass to handle "fixed" XMLSimpleDocInfoImportContext::PrepareField(xPropertySet); |