diff options
-rw-r--r-- | sfx2/source/doc/oleprops.cxx | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sfx2/source/doc/oleprops.cxx b/sfx2/source/doc/oleprops.cxx index 3168c12db344..08fe42db1b07 100644 --- a/sfx2/source/doc/oleprops.cxx +++ b/sfx2/source/doc/oleprops.cxx @@ -927,10 +927,15 @@ void SfxOleSection::SetFileTimeValue( sal_Int32 nPropId, const util::DateTime& r void SfxOleSection::SetDateValue( sal_Int32 nPropId, const util::Date& rValue ) { + //Annoyingly MS2010 considers VT_DATE apparently as an invalid possibility, so here we use VT_FILETIME + //instead :-( if ( rValue.Year == 0 || rValue.Month == 0 || rValue.Day == 0 ) - SetProperty( SfxOlePropertyRef( new SfxOleDateProperty( nPropId, TIMESTAMP_INVALID_UTILDATE ) ) ); + SetProperty( SfxOlePropertyRef( new SfxOleFileTimeProperty( nPropId, TIMESTAMP_INVALID_UTILDATETIME ) ) ); else - SetProperty( SfxOlePropertyRef( new SfxOleDateProperty( nPropId, rValue ) ) ); + { + const util::DateTime aValue(0, 0, 0, 0, rValue.Day, rValue.Month, rValue.Year ); + SetProperty( SfxOlePropertyRef( new SfxOleFileTimeProperty( nPropId, aValue ) ) ); + } } void SfxOleSection::SetThumbnailValue( sal_Int32 nPropId, |