diff options
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/inc/txtflde.hxx | 6 | ||||
-rw-r--r-- | xmloff/source/text/txtflde.cxx | 22 | ||||
-rw-r--r-- | xmloff/source/text/txtfldi.cxx | 4 |
3 files changed, 27 insertions, 5 deletions
diff --git a/xmloff/inc/txtflde.hxx b/xmloff/inc/txtflde.hxx index 6d5b38755fa1..6728690074d0 100644 --- a/xmloff/inc/txtflde.hxx +++ b/xmloff/inc/txtflde.hxx @@ -366,6 +366,12 @@ protected: sal_Bool bIsDate, /// export as date (rather than date/time)? sal_uInt16 nPrefix = XML_NAMESPACE_TEXT); /// attribute name prefix + /// export time or dateTime + void ProcessTimeOrDateTime( + enum ::xmloff::token::XMLTokenEnum eXMLName, /// attribute token + const ::com::sun::star::util::DateTime& rTime, /// date/time value + sal_uInt16 nPrefix = XML_NAMESPACE_TEXT); /// attribute name prefix + /// export all attributes for bibliography data fields void ProcessBibliographyData( const ::com::sun::star::uno::Reference < diff --git a/xmloff/source/text/txtflde.cxx b/xmloff/source/text/txtflde.cxx index 4c5ebb43d7ad..cc9ca75cfc8a 100644 --- a/xmloff/source/text/txtflde.cxx +++ b/xmloff/source/text/txtflde.cxx @@ -1261,17 +1261,17 @@ void XMLTextFieldExport::ExportFieldHelper( if (xPropSetInfo->hasPropertyByName(sPropertyDateTimeValue)) { // no value -> current time - ProcessDateTime(XML_TIME_VALUE, + ProcessTimeOrDateTime(XML_TIME_VALUE, GetDateTimeProperty(sPropertyDateTimeValue, rPropSet), - sal_False ); + XML_NAMESPACE_TEXT); } if (xPropSetInfo->hasPropertyByName(sPropertyDateTime)) { // no value -> current time - ProcessDateTime(XML_TIME_VALUE, + ProcessTimeOrDateTime(XML_TIME_VALUE, GetDateTimeProperty(sPropertyDateTime,rPropSet), - sal_False ); + XML_NAMESPACE_TEXT); } if (xPropSetInfo->hasPropertyByName(sPropertyIsFixed)) { @@ -2674,6 +2674,20 @@ void XMLTextFieldExport::ProcessDateTime(enum XMLTokenEnum eName, } } +/// export a time or dateTime +void XMLTextFieldExport::ProcessTimeOrDateTime(enum XMLTokenEnum eName, + const util::DateTime& rTime, + sal_uInt16 nPrefix) +{ + OUStringBuffer aBuffer; + + // date/time value + ::sax::Converter::convertTimeOrDateTime(aBuffer, rTime, 0); + + // output attribute + ProcessString(eName, aBuffer.makeStringAndClear(), sal_True, nPrefix); +} + SvXMLEnumMapEntry const aBibliographyDataTypeMap[] = { diff --git a/xmloff/source/text/txtfldi.cxx b/xmloff/source/text/txtfldi.cxx index 90553d6ac276..bea669e5bbca 100644 --- a/xmloff/source/text/txtfldi.cxx +++ b/xmloff/source/text/txtfldi.cxx @@ -1095,6 +1095,7 @@ void XMLTimeFieldImportContext::ProcessAttribute( { case XML_TOK_TEXTFIELD_TIME_VALUE: { + // FIXME double appears unused? double fTmp; if (GetImport().GetMM100UnitConverter(). convertDateTime(fTmp, sAttrValue)) @@ -1103,7 +1104,8 @@ void XMLTimeFieldImportContext::ProcessAttribute( bTimeOK = sal_True; } - if (::sax::Converter::parseDateTime(aDateTimeValue, 0, sAttrValue)) + if (::sax::Converter::parseTimeOrDateTime(aDateTimeValue, 0, + sAttrValue)) { bTimeOK = sal_True; } |