This is an automated email from the ASF dual-hosted git repository.

damjan pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/openoffice.git


The following commit(s) were added to refs/heads/trunk by this push:
     new dbea4404ca Allow pasting SVG graphics into OpenOffice.
dbea4404ca is described below

commit dbea4404ca2c86a3a74294e262e6584c3e450818
Author: Damjan Jovanovic <dam...@apache.org>
AuthorDate: Fri Feb 23 20:46:47 2024 +0200

    Allow pasting SVG graphics into OpenOffice.
    
    Patch by: me
---
 main/svtools/source/misc/transfer.cxx | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/main/svtools/source/misc/transfer.cxx 
b/main/svtools/source/misc/transfer.cxx
index 5f83b0527b..e10123880e 100644
--- a/main/svtools/source/misc/transfer.cxx
+++ b/main/svtools/source/misc/transfer.cxx
@@ -1970,6 +1970,20 @@ sal_Bool TransferableDataHelper::GetGDIMetaFile( const 
DataFlavor& rFlavor, GDIM
                }
        }
 
+       if( !bRet &&
+               HasFormat( SOT_FORMATSTR_ID_SVG ) &&
+               SotExchange::GetFormatDataFlavor( SOT_FORMATSTR_ID_SVG, 
aSubstFlavor ) &&
+               GetSotStorageStream( aSubstFlavor, xStm ) )
+       {
+               Graphic aGraphic;
+
+               if( GraphicConverter::Import( *xStm, aGraphic ) == ERRCODE_NONE 
)
+               {
+                       rMtf = aGraphic.GetGDIMetaFile();
+                       bRet = sal_True;
+               }
+       }
+
        return bRet;
 }
 

Reply via email to