summaryrefslogtreecommitdiff
path: root/xmloff/source/text/txtfldi.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'xmloff/source/text/txtfldi.cxx')
-rw-r--r--xmloff/source/text/txtfldi.cxx33
1 files changed, 32 insertions, 1 deletions
diff --git a/xmloff/source/text/txtfldi.cxx b/xmloff/source/text/txtfldi.cxx
index 3b8b551b92..d47e813c34 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);