You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by ar...@apache.org on 2013/03/30 14:50:16 UTC

svn commit: r1462756 - /openoffice/trunk/main/sfx2/source/doc/objstor.cxx

Author: arielch
Date: Sat Mar 30 13:50:15 2013
New Revision: 1462756

URL: http://svn.apache.org/r1462756
Log:
i95421 - Set MediaType when storing thumbnail.png

Modified:
    openoffice/trunk/main/sfx2/source/doc/objstor.cxx

Modified: openoffice/trunk/main/sfx2/source/doc/objstor.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sfx2/source/doc/objstor.cxx?rev=1462756&r1=1462755&r2=1462756&view=diff
==============================================================================
--- openoffice/trunk/main/sfx2/source/doc/objstor.cxx (original)
+++ openoffice/trunk/main/sfx2/source/doc/objstor.cxx Sat Mar 30 13:50:15 2013
@@ -3705,16 +3705,20 @@ sal_Bool SfxObjectShell::GenerateAndStor
 
     try {
         uno::Reference< embed::XStorage > xThumbnailStor =
-                                        xStor->openStorageElement( ::rtl::OUString::createFromAscii( "Thumbnails" ),
+                                        xStor->openStorageElement( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Thumbnails")),
                                                                     embed::ElementModes::READWRITE );
         if ( xThumbnailStor.is() )
         {
             uno::Reference< io::XStream > xStream = xThumbnailStor->openStreamElement(
-                                                        ::rtl::OUString::createFromAscii( "thumbnail.png" ),
+                                                        ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("thumbnail.png")),
                                                         embed::ElementModes::READWRITE );
 
             if ( xStream.is() && WriteThumbnail( bEncrypted, bSigned, bIsTemplate, xStream ) )
             {
+                uno::Reference< beans::XPropertySet > xPropSet( xStream, uno::UNO_QUERY );
+                if ( xPropSet.is() )
+                    xPropSet->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("MediaType")),
+                                                uno::makeAny( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("image/png"))));
                 uno::Reference< embed::XTransactedObject > xTransact( xThumbnailStor, uno::UNO_QUERY_THROW );
                 xTransact->commit();
                 bResult = sal_True;