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 | |
parent | CWS-TOOLING: integrate CWS killnonpro (diff) | |
parent | #i97029# duration dialog HelpId (diff) | |
download | core-2efe116f872503f423caa902857932fdacac4b04.tar.gz core-2efe116f872503f423caa902857932fdacac4b04.zip |
CWS-TOOLING: integrate CWS os137
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/inc/txtfldi.hxx | 5 | ||||
-rw-r--r-- | xmloff/source/text/txtflde.cxx | 11 | ||||
-rw-r--r-- | xmloff/source/text/txtfldi.cxx | 33 |
3 files changed, 46 insertions, 3 deletions
diff --git a/xmloff/inc/txtfldi.hxx b/xmloff/inc/txtfldi.hxx index b361081a7ce2..96e7e7fee238 100644 --- a/xmloff/inc/txtfldi.hxx +++ b/xmloff/inc/txtfldi.hxx @@ -745,6 +745,11 @@ class XMLUserDocInfoImportContext : public XMLSimpleDocInfoImportContext { rtl::OUString aName; const ::rtl::OUString sPropertyName; + const ::rtl::OUString sPropertyNumberFormat; + const ::rtl::OUString sPropertyIsFixedLanguage; + sal_Int32 nFormat; + sal_Bool bFormatOK; + sal_Bool bIsDefaultLanguage; public: 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); |