summaryrefslogtreecommitdiff
path: root/sot
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2021-12-03 11:51:03 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2021-12-03 12:01:39 +0100
commitf586839956d6937920aa377fe95854c1a0518d96 (patch)
treee65d1888778e2b4e2436cf017cac34de642b7389 /sot
parentf0877e314ef28db2ff4d42706e2bc897acd96379 (diff)
Windows format name is FileGroupDescriptorW for Unicode strings
See also commit 5fb9f4ffa9284c7248e2e82210506babaad4044d tdf#145964: Windows format name is FileNameW for Unicode strings and commit 52e1d0ca6ad38b4b4fdc77b0951ad26f0ac18ec5 Windows format name is UniformResourceLocatorW for Unicode strings We don't use other standard clipboard formats which have W variants. Change-Id: I45afac76fe3db406c8a761f48eee9e931fd50d45 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126276 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sot')
-rw-r--r--sot/source/base/exchange.cxx2
-rw-r--r--sot/source/base/formats.cxx8
2 files changed, 5 insertions, 5 deletions
diff --git a/sot/source/base/exchange.cxx b/sot/source/base/exchange.cxx
index 3138d89de0aa..582ca49c5598 100644
--- a/sot/source/base/exchange.cxx
+++ b/sot/source/base/exchange.cxx
@@ -141,7 +141,7 @@ const DataFlavorRepresentation* FormatArray_Impl()
/* 86 SotClipboardFormatId::LINK_SOURCE*/ { "application/x-openoffice-link-source-xml;windows_formatname=\"Star Link Source (XML)\"", "Star Link Source (XML)", &cppu::UnoType<Sequence<sal_Int8>>::get() },
/* 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() },
+ /* 89 SotClipboardFormatId::FILEGRPDESCRIPTOR*/ { "application/x-openoffice-filegrpdescriptor;windows_formatname=\"FileGroupDescriptorW\"", "FileGroupDescriptor", &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() },
diff --git a/sot/source/base/formats.cxx b/sot/source/base/formats.cxx
index 8901064d6901..0b3d80120022 100644
--- a/sot/source/base/formats.cxx
+++ b/sot/source/base/formats.cxx
@@ -23,7 +23,7 @@
#include <sysformats.hxx>
#include <comphelper/classids.hxx>
#include <comphelper/fileformat.h>
-
+#include <o3tl/char16_t2wchar_t.hxx>
#include <tools/globname.hxx>
#include <tools/stream.hxx>
#include <com/sun/star/datatransfer/DataFlavor.hpp>
@@ -1359,12 +1359,12 @@ static bool CheckTransferableContext_Impl( const Reference< XTransferable >* pxT
if( aSeq.getLength() )
{
- FILEGROUPDESCRIPTOR const * pFDesc = reinterpret_cast<FILEGROUPDESCRIPTOR const *>(aSeq.getConstArray());
+ FILEGROUPDESCRIPTORW const * pFDesc = reinterpret_cast<FILEGROUPDESCRIPTORW const *>(aSeq.getConstArray());
if( pFDesc->cItems )
{
- OString sDesc( pFDesc->fgd[ 0 ].cFileName );
- bRet = 4 < sDesc.getLength() && sDesc.copy(sDesc.getLength()-4).equalsIgnoreAsciiCase(".URL");
+ OUString sDesc( o3tl::toU(pFDesc->fgd[ 0 ].cFileName) );
+ bRet = 4 < sDesc.getLength() && sDesc.endsWithIgnoreAsciiCase(".URL");
}
}
}