svx/source/gallery2/galmisc.cxx |    3 ++-
 vcl/win/dtrans/ftransl.cxx      |    2 ++
 2 files changed, 4 insertions(+), 1 deletion(-)

New commits:
commit c4aa95310d98a7f92ae799ead76c8b25ffca53b3
Author:     Oliver Specht <oliver.spe...@cib.de>
AuthorDate: Tue Apr 9 15:28:00 2024 +0200
Commit:     Thorsten Behrens <thorsten.behr...@allotropia.de>
CommitDate: Tue Nov 19 01:14:11 2024 +0100

    tdf#160267 Fix SVG and add PNG format from the clipboard
    
    Since 6c04b8356c0764ba8ac51448eee5ff577b08d9e2 SVG was added
    to the supported clipboard formats but it did not work.
    SVG support is now fixed and PNG format is added in the gallery.
    
    Change-Id: Ic9cb2eebfc37bd38605dfaa3a1c353a7532af357
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165908
    Tested-by: Jenkins
    Reviewed-by: Thorsten Behrens <thorsten.behr...@allotropia.de>

diff --git a/svx/source/gallery2/galmisc.cxx b/svx/source/gallery2/galmisc.cxx
index 6e80276c3aa6..cda1c9af2c71 100644
--- a/svx/source/gallery2/galmisc.cxx
+++ b/svx/source/gallery2/galmisc.cxx
@@ -489,7 +489,8 @@ bool GalleryTransferable::GetData( const 
datatransfer::DataFlavor& rFlavor, cons
     {
         bRet = SetGDIMetaFile( mpGraphicObject->GetGraphic().GetGDIMetaFile() 
);
     }
-    else if( ( SotClipboardFormatId::BITMAP == nFormat ) && mpGraphicObject )
+    else if( ( SotClipboardFormatId::BITMAP == nFormat || 
SotClipboardFormatId::PNG == nFormat)
+        && mpGraphicObject )
     {
         bRet = SetBitmapEx( mpGraphicObject->GetGraphic().GetBitmapEx(), 
rFlavor );
     }
diff --git a/vcl/win/dtrans/ftransl.cxx b/vcl/win/dtrans/ftransl.cxx
index 20056bba0ead..45dbb66696b8 100644
--- a/vcl/win/dtrans/ftransl.cxx
+++ b/vcl/win/dtrans/ftransl.cxx
@@ -338,6 +338,8 @@ const std::vector< FormatEntry > g_TranslTable {
         FormatEntry("image/bmp", "Windows Bitmap", nullptr, CF_INVALID, 
CPPUTYPE_DEFAULT),
     //SotClipboardFormatId::PNG
         FormatEntry("image/png", "PNG", nullptr, CF_INVALID, CPPUTYPE_DEFAULT),
+    //SotClipboardFormatId::SVG
+        FormatEntry("image/svg+xml", "image/svg+xml", nullptr, CF_INVALID, 
CPPUTYPE_DEFAULT),
     //SotClipboardFormatId::MATHML
         FormatEntry("application/mathml+xml", "MathML", nullptr, CF_INVALID, 
CPPUTYPE_DEFAULT),
     //SotClipboardFormatId::DUMMY3

Reply via email to