sfx2/source/doc/objstor.cxx |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

New commits:
commit 399f004135b506ac2c23307c46c7a0053d77fa17
Author: Ariel Constenla-Haile <[email protected]>
Date:   Sat Mar 30 12:50:15 2013 +0000

    i95421 - Set MediaType when storing thumbnail.png

diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 776061a..6b1f76f 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -3705,16 +3705,20 @@ sal_Bool SfxObjectShell::GenerateAndStoreThumbnail( 
sal_Bool bEncrypted,
 
     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;
_______________________________________________
Libreoffice-commits mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to