sot/source/base/exchange.cxx |    4 ++--
 vcl/win/dtrans/ftransl.cxx   |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 5fb9f4ffa9284c7248e2e82210506babaad4044d
Author:     Mike Kaganski <mike.kagan...@collabora.com>
AuthorDate: Tue Nov 30 23:11:50 2021 +0200
Commit:     Mike Kaganski <mike.kagan...@collabora.com>
CommitDate: Wed Dec 1 06:51:20 2021 +0100

    tdf#145964: Windows format name is FileNameW for Unicode strings
    
    Otherwise SIMPLE_FILE clipboard format arrives encoded in ACP,
    and fails for any characters not representable in ACP.
    
    Change-Id: Ice8cfd98955e3ef49682aa21b41a313786b291f1
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126131
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com>

diff --git a/sot/source/base/exchange.cxx b/sot/source/base/exchange.cxx
index 18c5cd291f9a..2d26887557a6 100644
--- a/sot/source/base/exchange.cxx
+++ b/sot/source/base/exchange.cxx
@@ -57,7 +57,7 @@ const DataFlavorRepresentation* FormatArray_Impl()
         /*  2 SotClipboardFormatId::BITMAP*/                       { 
"application/x-openoffice-bitmap;windows_formatname=\"Bitmap\"", "Bitmap", 
&cppu::UnoType<Sequence<sal_Int8>>::get() },
         /*  3 SotClipboardFormatId::GDIMETAFILE*/                  { 
"application/x-openoffice-gdimetafile;windows_formatname=\"GDIMetaFile\"", 
"GDIMetaFile", &cppu::UnoType<Sequence<sal_Int8>>::get() },
         /*  4 SotClipboardFormatId::PRIVATE*/                      { 
"application/x-openoffice-private;windows_formatname=\"Private\"", "Private", 
&cppu::UnoType<Sequence<sal_Int8>>::get() },
-        /*  5 SotClipboardFormatId::SIMPLE_FILE*/                         { 
"application/x-openoffice-file;windows_formatname=\"FileName\"", "FileName", 
&cppu::UnoType<Sequence<sal_Int8>>::get() },
+        /*  5 SotClipboardFormatId::SIMPLE_FILE*/                         { 
"application/x-openoffice-file;windows_formatname=\"FileNameW\"", "FileName", 
&cppu::UnoType<OUString>::get() },
         /*  6 SotClipboardFormatId::FILE_LIST*/                    { 
"application/x-openoffice-filelist;windows_formatname=\"FileList\"", 
"FileList", &cppu::UnoType<Sequence<sal_Int8>>::get() },
         /*  7 EMPTY*/                                   { "", "", 
&cppu::UnoType<Sequence<sal_Int8>>::get() },
         /*  8 EMPTY*/                                   { "", "", 
&cppu::UnoType<Sequence<sal_Int8>>::get() },
@@ -142,7 +142,7 @@ const DataFlavorRepresentation* FormatArray_Impl()
         /* 87 SotClipboardFormatId::EMBEDDED_OBJ*/           { 
"application/x-openoffice-embedded-obj-xml;windows_formatname=\"Star Embedded 
Object (XML)\"", "Star Embedded Object (XML)", 
&cppu::UnoType<Sequence<sal_Int8>>::get() },
         /* 88 SotClipboardFormatId::FILECONTENT*/            { 
"application/x-openoffice-filecontent;windows_formatname=\"FileContents\"", 
"FileContents", &cppu::UnoType<Sequence<sal_Int8>>::get() },
         /* 89 SotClipboardFormatId::FILEGRPDESCRIPTOR*/      { 
"application/x-openoffice-filegrpdescriptor;windows_formatname=\"FileGroupDescriptor\"",
 "FileGroupDescriptor", &cppu::UnoType<Sequence<sal_Int8>>::get() },
-        /* 90 SotClipboardFormatId::FILENAME*/               { 
"application/x-openoffice-filename;windows_formatname=\"FileName\"", 
"FileName", &cppu::UnoType<Sequence<sal_Int8>>::get() },
+        /* 90 SotClipboardFormatId::FILENAME*/               { 
"application/x-openoffice-filename;windows_formatname=\"FileNameW\"", 
"FileName", &cppu::UnoType<OUString>::get() },
         /* 91 SotClipboardFormatId::SD_OLE*/                 { 
"application/x-openoffice-sd-ole;windows_formatname=\"SD-OLE\"", "SD-OLE", 
&cppu::UnoType<Sequence<sal_Int8>>::get() },
         /* 92 SotClipboardFormatId::EMBEDDED_OBJ_OLE*/       { 
"application/x-openoffice-embedded-obj-ole;windows_formatname=\"Embedded 
Object\"", "Embedded Object", &cppu::UnoType<Sequence<sal_Int8>>::get() },
         /* 93 SotClipboardFormatId::EMBED_SOURCE_OLE*/       { 
"application/x-openoffice-embed-source-ole;windows_formatname=\"Embed 
Source\"", "Embed Source", &cppu::UnoType<Sequence<sal_Int8>>::get() },
diff --git a/vcl/win/dtrans/ftransl.cxx b/vcl/win/dtrans/ftransl.cxx
index ea3735832e93..0fc4aa53f804 100644
--- a/vcl/win/dtrans/ftransl.cxx
+++ b/vcl/win/dtrans/ftransl.cxx
@@ -118,7 +118,7 @@ const std::vector< FormatEntry > g_TranslTable {
     // SotClipboardFormatId::PRIVATE
         
FormatEntry("application/x-openoffice-private;windows_formatname=\"Private\"", 
"Private", nullptr, CF_INVALID, CPPUTYPE_DEFAULT),
     // SotClipboardFormatId::SIMPLE_FILE
-        
FormatEntry("application/x-openoffice-file;windows_formatname=\"FileName\"", 
"FileName", nullptr, CF_INVALID, CPPUTYPE_DEFAULT),
+        
FormatEntry("application/x-openoffice-file;windows_formatname=\"FileNameW\"", 
"FileName", nullptr, CF_INVALID, CppuType_String),
     // SotClipboardFormatId::RTF
         FormatEntry("text/rtf", "Rich Text Format", nullptr, CF_INVALID, 
CPPUTYPE_DEFAULT),
     // SotClipboardFormatId::DRAWING

Reply via email to