sot/source/base/exchange.cxx | 4 ++-- vcl/win/dtrans/ftransl.cxx | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-)
New commits: commit 84c1c49d8699f4106168a524ce774f42ef843b1f Author: Mike Kaganski <[email protected]> AuthorDate: Sun Nov 9 16:46:51 2025 +0500 Commit: Mike Kaganski <[email protected]> CommitDate: Sun Nov 9 18:00:15 2025 +0100 Fix Unicode-dependent format names For application/x-openoffice-file, a change from FileName to FileNameW happened in commit 5fb9f4ffa9284c7248e2e82210506babaad4044d (tdf#145964: Windows format name is FileNameW for Unicode strings, 2021-12-01). But there I didn't fix aNativeFormatName value to match the string in MIME type, because I was confused that it co-incided with human-presentable name. Seeing what was used for application/x-openoffice-filename, I realized that these need to match the correct sormat string. Commit 558956dc811a1f0f07411e348f7081a467bbc3b5 (Drop UNICODE/_UNICODE defines, 2019-04-04) changed the meaning of UNICODE-dependent defines CFSTR_FILEDESCRIPTOR and CFSTR_FILENAME, used in the format list. This change fixes that by explicitly using *W strings. Other related commits are: - 52e1d0ca6ad38b4b4fdc77b0951ad26f0ac18ec5 Windows format name is UniformResourceLocatorW for Unicode strings, 2021-12-03 - f586839956d6937920aa377fe95854c1a0518d96 Windows format name is FileGroupDescriptorW for Unicode strings, 2021-12-03 Change-Id: Ic258e6311601ffe9d653bece17b7eef3a8f94f23 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193659 Tested-by: Jenkins Reviewed-by: Mike Kaganski <[email protected]> diff --git a/sot/source/base/exchange.cxx b/sot/source/base/exchange.cxx index b2a18e7f8fb2..cc0783303b14 100644 --- a/sot/source/base/exchange.cxx +++ b/sot/source/base/exchange.cxx @@ -53,7 +53,7 @@ const DataFlavor* FormatArray_Impl() /* 2 BITMAP*/ { u"application/x-openoffice-bitmap;windows_formatname=\"Bitmap\""_ustr, u"Bitmap"_ustr, cppu::UnoType<Sequence<sal_Int8>>::get() }, /* 3 GDIMETAFILE*/ { u"application/x-openoffice-gdimetafile;windows_formatname=\"GDIMetaFile\""_ustr, u"GDIMetaFile"_ustr, cppu::UnoType<Sequence<sal_Int8>>::get() }, /* 4 PRIVATE*/ { u"application/x-openoffice-private;windows_formatname=\"Private\""_ustr, u"Private"_ustr, cppu::UnoType<Sequence<sal_Int8>>::get() }, - /* 5 SIMPLE_FILE*/ { u"application/x-openoffice-file;windows_formatname=\"FileNameW\""_ustr, u"FileName"_ustr, cppu::UnoType<OUString>::get() }, + /* 5 SIMPLE_FILE*/ { u"application/x-openoffice-file;windows_formatname=\"FileNameW\""_ustr, u"FileNameW"_ustr, cppu::UnoType<OUString>::get() }, /* 6 FILE_LIST*/ { u"application/x-openoffice-filelist;windows_formatname=\"FileList\""_ustr, u"FileList"_ustr, cppu::UnoType<Sequence<sal_Int8>>::get() }, /* 7 EMPTY*/ { u""_ustr, u""_ustr, cppu::UnoType<Sequence<sal_Int8>>::get() }, /* 8 EMPTY*/ { u""_ustr, u""_ustr, cppu::UnoType<Sequence<sal_Int8>>::get() }, @@ -138,7 +138,7 @@ const DataFlavor* FormatArray_Impl() /* 87 EMBEDDED_OBJ*/ { u"application/x-openoffice-embedded-obj-xml;windows_formatname=\"Star Embedded Object (XML)\""_ustr, u"Star Embedded Object (XML)"_ustr, cppu::UnoType<Sequence<sal_Int8>>::get() }, /* 88 FILECONTENT*/ { u"application/x-openoffice-filecontent;windows_formatname=\"FileContents\""_ustr, u"FileContents"_ustr, cppu::UnoType<Sequence<sal_Int8>>::get() }, /* 89 FILEGRPDESCRIPTOR*/ { u"application/x-openoffice-filegrpdescriptor;windows_formatname=\"FileGroupDescriptorW\""_ustr, u"FileGroupDescriptor"_ustr, cppu::UnoType<Sequence<sal_Int8>>::get() }, - /* 90 FILENAME*/ { u"application/x-openoffice-filename;windows_formatname=\"FileNameW\""_ustr, u"FileName"_ustr, cppu::UnoType<OUString>::get() }, + /* 90 FILENAME*/ { u"application/x-openoffice-filename;windows_formatname=\"FileNameW\""_ustr, u"FileNameW"_ustr, cppu::UnoType<OUString>::get() }, /* 91 SD_OLE*/ { u"application/x-openoffice-sd-ole;windows_formatname=\"SD-OLE\""_ustr, u"SD-OLE"_ustr, cppu::UnoType<Sequence<sal_Int8>>::get() }, /* 92 EMBEDDED_OBJ_OLE*/ { u"application/x-openoffice-embedded-obj-ole;windows_formatname=\"Embedded Object\""_ustr, u"Embedded Object"_ustr, cppu::UnoType<Sequence<sal_Int8>>::get() }, /* 93 EMBED_SOURCE_OLE*/ { u"application/x-openoffice-embed-source-ole;windows_formatname=\"Embed Source\""_ustr, u"Embed Source"_ustr, cppu::UnoType<Sequence<sal_Int8>>::get() }, diff --git a/vcl/win/dtrans/ftransl.cxx b/vcl/win/dtrans/ftransl.cxx index 37ba8bc20db6..7cd94f9685ba 100644 --- a/vcl/win/dtrans/ftransl.cxx +++ b/vcl/win/dtrans/ftransl.cxx @@ -136,7 +136,7 @@ const std::array g_TranslTable { // SotClipboardFormatId::PRIVATE FormatEntry("application/x-openoffice-private;windows_formatname=\"Private\"", "Private"), // SotClipboardFormatId::SIMPLE_FILE - FormatEntry("application/x-openoffice-file;windows_formatname=\"FileNameW\"", "FileName", CppuType_String), + FormatEntry("application/x-openoffice-file;windows_formatname=\"FileNameW\"", "FileNameW", CppuType_String), // SotClipboardFormatId::RTF FormatEntry("text/rtf", "Rich Text Format"), // SotClipboardFormatId::DRAWING @@ -292,11 +292,11 @@ const std::array g_TranslTable { //SotClipboardFormatId::EMBEDDED_OBJ FormatEntry("application/x-openoffice-embedded-obj-xml;windows_formatname=\"Star Embedded Object (XML)\"", "Star Embedded Object (XML)"), //SotClipboardFormatId::FILECONTENT - FormatEntry("application/x-openoffice-filecontent;windows_formatname=\"" CFSTR_FILECONTENTS "\"", CFSTR_FILECONTENTS), + FormatEntry("application/x-openoffice-filecontent;windows_formatname=\"FileContents\"", "FileContents"), //SotClipboardFormatId::FILEGRPDESCRIPTOR - FormatEntry("application/x-openoffice-filegrpdescriptor;windows_formatname=\"" CFSTR_FILEDESCRIPTOR "\"", CFSTR_FILEDESCRIPTOR), + FormatEntry("application/x-openoffice-filegrpdescriptor;windows_formatname=\"FileGroupDescriptorW\"", "FileGroupDescriptorW"), //SotClipboardFormatId::FILENAME - FormatEntry("application/x-openoffice-filename;windows_formatname=\"" CFSTR_FILENAME "\"", CFSTR_FILENAME), + FormatEntry("application/x-openoffice-filename;windows_formatname=\"FileNameW\"", "FileNameW", CppuType_String), //SotClipboardFormatId::SD_OLE FormatEntry("application/x-openoffice-sd-ole;windows_formatname=\"SD-OLE\"", "SD-OLE"), //SotClipboardFormatId::EMBEDDED_OBJ_OLE @@ -324,7 +324,7 @@ const std::array g_TranslTable { //SotClipboardFormatId::SBA_REPORTEXCHANGE FormatEntry("application/x-openoffice-sba-reportexchange;windows_formatname=\"SBA_REPORTEXCHANGE\"", "SBA_REPORTEXCHANGE"), //SotClipboardFormatId::UNIFORMRESOURCELOCATOR - FormatEntry("application/x-openoffice-uniformresourcelocator;windows_formatname=\"UniformResourceLocatorW\"", "UniformResourceLocator", CppuType_String), + FormatEntry("application/x-openoffice-uniformresourcelocator;windows_formatname=\"UniformResourceLocatorW\"", "UniformResourceLocatorW", CppuType_String), //SotClipboardFormatId::STARCHARTDOCUMENT_50 FormatEntry("application/x-openoffice-starchartdocument-50;windows_formatname=\"StarChartDocument 5.0\"", "StarChartDocument 5.0"), //SotClipboardFormatId::GRAPHOBJ
