https://issues.apache.org/ooo/show_bug.cgi?id=95421

Ariel Constenla-Haile <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]

--- Comment #3 from Ariel Constenla-Haile <[email protected]> ---
The mime type is never set in SfxObjectShell::GenerateAndStoreThumbnail
http://svn.apache.org/viewvc/openoffice/trunk/main/sfx2/source/doc/objstor.cxx?revision=1413471&view=markup#l3695

The fix is rather trivial:


sal_Bool SfxObjectShell::GenerateAndStoreThumbnail( sal_Bool bEncrypted,
                                                    sal_Bool bSigned,
                                                    sal_Bool bIsTemplate,
                                                    const uno::Reference<
embed::XStorage >& xStor )
{
    RTL_LOGFILE_CONTEXT( aLog, "sfx2 (mv76033)
SfxObjectShell::GenerateAndStoreThumbnail" );

    bIsInGenerateThumbnail = sal_True;//optimize thumbnail generate and store
procedure to improve odt saving performance, i120030

    sal_Bool bResult = sal_False;

    try {
        uno::Reference< embed::XStorage > xThumbnailStor =
                                        xStor->openStorageElement(
::rtl::OUString::createFromAscii( "Thumbnails" ),
                                                                   
embed::ElementModes::READWRITE );
        if ( xThumbnailStor.is() )
        {
            uno::Reference< io::XStream > xStream =
xThumbnailStor->openStreamElement(
                                                       
::rtl::OUString::createFromAscii( "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;
            }
        }
    }
    catch( uno::Exception& )
    {
    }

    bIsInGenerateThumbnail = sal_False;//optimize thumbnail generate and store
procedure to improve odt saving performance, i120030

    return bResult;
}

-- 
You are receiving this mail because:
You are on the CC list for the bug.
You are the assignee for the bug.

Reply via email to