[Libreoffice-commits] core.git: Branch 'aoo/trunk' - sfx2/source

Ariel Constenla-Haile arielch at apache.org
Sat Mar 30 17:41:03 PDT 2013


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

New commits:
commit 399f004135b506ac2c23307c46c7a0053d77fa17
Author: Ariel Constenla-Haile <arielch at apache.org>
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;


More information about the Libreoffice-commits mailing list