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

New commits:
commit 7b51ad7697e91ff58de1fdeeec021647d0592a80
Author:     Oliver Specht <oliver.spe...@cib.de>
AuthorDate: Tue Apr 9 15:28:00 2024 +0200
Commit:     Thorsten Behrens <thorsten.behr...@allotropia.de>
CommitDate: Mon Oct 28 11:52:06 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/+/175715
    Reviewed-by: Thorsten Behrens <thorsten.behr...@allotropia.de>
    Tested-by: Thorsten Behrens <thorsten.behr...@allotropia.de>

diff --git a/svx/source/gallery2/galmisc.cxx b/svx/source/gallery2/galmisc.cxx
index 4d3ef2d5a619..ae60c7fc15f0 100644
--- a/svx/source/gallery2/galmisc.cxx
+++ b/svx/source/gallery2/galmisc.cxx
@@ -494,7 +494,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