summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--toolkit/source/controls/unocontrolmodel.cxx28
1 files changed, 28 insertions, 0 deletions
diff --git a/toolkit/source/controls/unocontrolmodel.cxx b/toolkit/source/controls/unocontrolmodel.cxx
index 0578e2c81db0..782922bb5464 100644
--- a/toolkit/source/controls/unocontrolmodel.cxx
+++ b/toolkit/source/controls/unocontrolmodel.cxx
@@ -627,6 +627,21 @@ void UnoControlModel::write( const ::com::sun::star::uno::Reference< ::com::sun:
OutStream->writeBoolean( aFD.WordLineMode );
OutStream->writeShort( aFD.Type );
}
+ else if ( rType == cppu::UnoType<css::util::Date>::get() )
+ {
+ css::util::Date d;
+ rValue >>= d;
+ OutStream->writeLong(d.Day + 100 * d.Month + 10000 * d.Year);
+ // YYYYMMDD
+ }
+ else if ( rType == cppu::UnoType<css::util::Time>::get() )
+ {
+ css::util::Time t;
+ rValue >>= t;
+ OutStream->writeLong(
+ t.NanoSeconds / 1000000 + 100 * t.Seconds
+ + 10000 * t.Minutes + 1000000 * t.Hours); // HHMMSShh
+ }
else if ( rType == ::getCppuType((const ::com::sun::star::uno::Sequence< OUString>*)0 ) )
{
::com::sun::star::uno::Sequence< OUString> aSeq;
@@ -829,6 +844,19 @@ void UnoControlModel::read( const ::com::sun::star::uno::Reference< ::com::sun::
aFD.Type = InStream->readShort();
aValue <<= aFD;
}
+ else if ( *pType == cppu::UnoType<css::util::Date>::get() )
+ {
+ sal_Int32 n = InStream->readLong(); // YYYYMMDD
+ aValue <<= css::util::Date(
+ n % 100, (n / 100) % 100, n / 10000);
+ }
+ else if ( *pType == cppu::UnoType<css::util::Time>::get() )
+ {
+ sal_Int32 n = InStream->readLong(); // HHMMSShh
+ aValue <<= css::util::Time(
+ (n % 100) * 1000000, (n / 100) % 100, (n / 10000) % 100,
+ n / 1000000, false);
+ }
else if ( *pType == ::getCppuType((const ::com::sun::star::uno::Sequence< OUString>*)0 ) )
{
long nEntries = InStream->readLong();