diff options
author | Lionel Elie Mamane <lionel@mamane.lu> | 2013-08-06 08:38:20 +0200 |
---|---|---|
committer | Lionel Elie Mamane <lionel@mamane.lu> | 2013-08-06 08:38:20 +0200 |
commit | e232878701402b8e13f5b8e45b1bfb85bbd1ec8c (patch) | |
tree | 818f892c601e9321add5781b17b4f01f834a6fdb | |
parent | 09a8fb1d90964d51d93a7e23a8d4af832fa614af (diff) |
IN PROGRESS: UnoControlModel::read/write nanosecondsprivate/lmamane/timedate-controls-nanosecond
with backwards compatibility
Change-Id: I5288bf844d396341baba45d1b4a5ef8b3c8e7a6d
-rw-r--r-- | toolkit/source/controls/unocontrolmodel.cxx | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/toolkit/source/controls/unocontrolmodel.cxx b/toolkit/source/controls/unocontrolmodel.cxx index 0578e2c81db0..21e394f73b6d 100644 --- a/toolkit/source/controls/unocontrolmodel.cxx +++ b/toolkit/source/controls/unocontrolmodel.cxx @@ -58,7 +58,7 @@ using namespace ::com::sun::star::i18n; using ::com::sun::star::awt::FontDescriptor; -#define UNOCONTROL_STREAMVERSION (short)2 +#define UNOCONTROL_STREAMVERSION (short)3 static void lcl_ImplMergeFontProperty( FontDescriptor& rFD, sal_uInt16 nPropId, const Any& rValue ) { @@ -770,7 +770,24 @@ void UnoControlModel::read( const ::com::sun::star::uno::Reference< ::com::sun:: sal_Bool bIsVoid = InStream->readBoolean(); if ( !bIsVoid ) { - if ( maData.find( nPropId ) != maData.end() ) + if ( nVersion < 3 && + ( nPropId == BASEPROPERTY_TIME || + nPropId == BASEPROPERTY_TIMEMAX || + nPropId == BASEPROPERTY_TIMEMIN )) + { + sal_Int64 n = InStream->readLong(); + n *= ::Time::NanosPerCenti; + aValue <<= ::Time(n).getUNOTime(); + } + else if ( nVersion < 3 && + ( nPropId == BASEPROPERTY_DATE || + nPropId == BASEPROPERTY_DATEMIN || + nPropId == BASEPROPERTY_DATEMAX )) + { + sal_Int32 n = InStream->readLong(); + aValue <<= ::Date(n).getUNODate(); + } + else if ( maData.find( nPropId ) != maData.end() ) { const ::com::sun::star::uno::Type* pType = GetPropertyType( nPropId ); if ( *pType == ::getBooleanCppuType() ) |