11#include <com/sun/star/datatransfer/UnsupportedFlavorException.hpp>
19 const css::uno::Reference<css::datatransfer::XTransferable>& xTransferable, OString mimeType)
21 if (!xTransferable.is())
25 bool bConvert =
false;
31 mimeType =
"text/plain;charset=utf-16";
36 datatransfer::DataFlavor aFlavor;
37 aFlavor.MimeType = OUString::fromUtf8(mimeType);
38 if (mimeType ==
"text/plain;charset=utf-16")
43 if (!xTransferable.is() || !xTransferable->isDataFlavorSupported(aFlavor))
49 aAny = xTransferable->getTransferData(aFlavor);
51 catch (
const css::datatransfer::UnsupportedFlavorException&)
55 catch (
const css::uno::Exception&)
68 aRet = OString(
reinterpret_cast<const char*
>(aString.getStr()),
73 uno::Sequence<sal_Int8> aSequence;
75 aRet = OString(
reinterpret_cast<char*
>(aSequence.getArray()), aSequence.getLength());
css::uno::Type const & get()
OString OOO_DLLPUBLIC_TEST getTextSelection(const css::uno::Reference< css::datatransfer::XTransferable > &xTransferable, OString mimeType)
std::basic_string_view< charT, traits > getToken(std::basic_string_view< charT, traits > sv, charT delimiter, std::size_t &position)
OString OUStringToOString(std::u16string_view str, ConnectionSettings const *settings)
#define OOO_DLLPUBLIC_TEST