[Libreoffice-commits] .: sfx2/source

Thorsten Behrens thorsten at kemper.freedesktop.org
Fri Oct 15 16:12:23 PDT 2010


 sfx2/source/doc/objstor.cxx |    4 ++++
 1 file changed, 4 insertions(+)

New commits:
commit 62c0947bfc47357a97ccba359769406b657a351a
Author: Thorsten Behrens <tbehrens at novell.com>
Date:   Sat Oct 16 01:02:47 2010 +0200

    Fix missing media-type for ODF thumbnails
    
    As per ODF 1.2 Part 3, 4.8.10:
    
    A manifest:media-type attribute should be present for all files and
    directories where a MIME media type exists for the content of the
    file...
    
    So added "image/png" for the thumbnails there.

diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 7cc9fea..ab89ae8 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -3684,6 +3684,10 @@ sal_Bool SfxObjectShell::WriteThumbnail( sal_Bool bEncrypted,
             uno::Reference< io::XTruncate > xTruncate( xStream->getOutputStream(), uno::UNO_QUERY_THROW );
             xTruncate->truncate();
 
+            uno::Reference < beans::XPropertySet > xSet( xStream, uno::UNO_QUERY );
+            if ( xSet.is() )
+                xSet->setPropertyValue( ::rtl::OUString::createFromAscii("MediaType"), 
+                                        uno::makeAny( ::rtl::OUString::createFromAscii("image/png") ) );
             if ( bEncrypted )
             {
                 sal_uInt16 nResID = GraphicHelper::getThumbnailReplacementIDByFactoryName_Impl(


More information about the Libreoffice-commits mailing list