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 | |
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')
-rw-r--r-- | include/sax/tools/converter.hxx | 22 | ||||
-rw-r--r-- | include/sfx2/dinfdlg.hxx | 12 |
2 files changed, 27 insertions, 7 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 diff --git a/include/sfx2/dinfdlg.hxx b/include/sfx2/dinfdlg.hxx index c0758b56bc00..5752b2c4c09b 100644 --- a/include/sfx2/dinfdlg.hxx +++ b/include/sfx2/dinfdlg.hxx @@ -16,8 +16,10 @@ * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef _SFX_DINFDLG_HXX -#define _SFX_DINFDLG_HXX +#ifndef SFX_DINFDLG_HXX +#define SFX_DINFDLG_HXX + +#include <boost/optional/optional.hpp> #include "sal/config.h" #include "sfx2/dllapi.h" @@ -285,6 +287,8 @@ private: CustomPropertyLine* m_pLine; public: + ::boost::optional<sal_Int16> m_TZ; + inline CustomPropertiesDateField( Window* pParent, const ResId& rResId, CustomPropertyLine* pLine ) : DateField( pParent, rResId ), m_pLine( pLine ) {} @@ -297,9 +301,11 @@ private: CustomPropertyLine* m_pLine; public: + bool m_isUTC; + inline CustomPropertiesTimeField( Window* pParent, const ResId& rResId, CustomPropertyLine* pLine ) : - TimeField( pParent, rResId ), m_pLine( pLine ) {} + TimeField( pParent, rResId ), m_pLine( pLine ), m_isUTC(false) {} inline CustomPropertyLine* GetLine() const { return m_pLine; } }; |