diff options
author | Michael Stahl <mstahl@redhat.com> | 2013-07-11 17:27:06 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2013-07-15 15:23:25 +0200 |
commit | 20cbf5bd3042ed547408f324e020a3d6405705f7 (patch) | |
tree | 5aa9ef1f1b960bd4f5b1013e3db582916fc76c28 /include/sax/tools/converter.hxx | |
parent | 604aae1fd240254fe851d93dc35b5408bd13296c (diff) |
i#108348: support DateTimeWithTimezone in user defined Document Properties
- fix interface of sax::Converter to allow passing time zones
(rename the parsing methods while at it to reduce pointless overloading)
- SfxDocumentMetaData supports DateWithTimezone and DateTimeWithTimezone
in user-defined properties
- add some ugly hacks to SfxCustomPropertiesPage to preserve existing
time zones (which are not displayed in UI currently)
Change-Id: Ice94112b9d79c285f80b5beda15f0ace91db97f3
Diffstat (limited to 'include/sax/tools/converter.hxx')
-rw-r--r-- | include/sax/tools/converter.hxx | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/include/sax/tools/converter.hxx b/include/sax/tools/converter.hxx index 615308c9e418..1e89d2cea057 100644 --- a/include/sax/tools/converter.hxx +++ b/include/sax/tools/converter.hxx @@ -22,6 +22,8 @@ #include "sax/saxdllapi.h" +#include <boost/optional/optional.hpp> + #include <sal/types.h> #include <rtl/ustring.hxx> #include <rtl/ustrbuf.hxx> @@ -36,6 +38,8 @@ namespace com { namespace sun { namespace star { namespace util { struct Date; struct DateTime; + struct DateWithTimeZone; + struct DateTimeWithTimeZone; struct Duration; } } } } @@ -153,23 +157,33 @@ public: /** convert util::Date to ISO "date" string */ static void convertDate( OUStringBuffer& rBuffer, - const com::sun::star::util::Date& rDate ); + const com::sun::star::util::Date& rDate, + sal_Int16 const* pTimeZoneOffset); /** convert util::DateTime to ISO "date" or "dateTime" string */ static void convertDateTime( OUStringBuffer& rBuffer, const com::sun::star::util::DateTime& rDateTime, + sal_Int16 const* pTimeZoneOffset, bool bAddTimeIf0AM = false ); + static void convertDateTZ( OUStringBuffer& rBuffer, + com::sun::star::util::DateWithTimeZone const& rDate ); + + static void convertDateTimeTZ( OUStringBuffer& rBuffer, + com::sun::star::util::DateTimeWithTimeZone const& rDateTime ); + /** convert ISO "date" or "dateTime" string to util::DateTime */ - static bool convertDateTime( com::sun::star::util::DateTime& rDateTime, + static bool parseDateTime( com::sun::star::util::DateTime& rDateTime, + boost::optional<sal_Int16> * pTimeZoneOffset, const OUString& rString ); /** convert ISO "date" or "dateTime" string to util::DateTime or util::Date */ - static bool convertDateOrDateTime( - com::sun::star::util::Date & rDate, + static bool parseDateOrDateTime( + com::sun::star::util::Date * pDate, com::sun::star::util::DateTime & rDateTime, bool & rbDateTime, + boost::optional<sal_Int16> * pTimeZoneOffset, const OUString & rString ); /** gets the position of the first comma after npos in the string |