diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2019-07-22 09:48:46 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2019-08-02 11:41:50 -0400 |
commit | c4bebdc659bd922831db28cbb59c62291d327b2f (patch) | |
tree | 2e5dbc6ea3d572a17b4cf6dc2a8267d81b54d5a4 /desktop | |
parent | ed9bdfaf472d4a208d855897f3cc12497a5176a9 (diff) |
lok: share more of the clipboard mime-type handling code.
Change-Id: I98fc9fa0fd1b5afa00c33b642d2d504eab0b62ba
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/source/lib/lokclipboard.cxx | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/desktop/source/lib/lokclipboard.cxx b/desktop/source/lib/lokclipboard.cxx index c85ac029406c..2c155c121d91 100644 --- a/desktop/source/lib/lokclipboard.cxx +++ b/desktop/source/lib/lokclipboard.cxx @@ -189,20 +189,7 @@ LOKTransferable::LOKTransferable(const size_t nInCount, const char** pInMimeType m_aFlavors = css::uno::Sequence<css::datatransfer::DataFlavor>(nInCount); for (size_t i = 0; i < nInCount; ++i) { - OUString aMimeType = OUString::fromUtf8(pInMimeTypes[i]); - - // cf. sot/source/base/exchange.cxx for these two exceptional types. - if (aMimeType.startsWith("text/plain")) - { - aMimeType = "text/plain;charset=utf-16"; - m_aFlavors[i].DataType = cppu::UnoType<OUString>::get(); - } - else if (aMimeType == "application/x-libreoffice-tsvc") - m_aFlavors[i].DataType = cppu::UnoType<OUString>::get(); - else - m_aFlavors[i].DataType = cppu::UnoType<uno::Sequence<sal_Int8>>::get(); - m_aFlavors[i].MimeType = aMimeType; - m_aFlavors[i].HumanPresentableName = aMimeType; + initFlavourFromMime(m_aFlavors[i], OUString::fromUtf8(pInMimeTypes[i])); uno::Any aContent; if (m_aFlavors[i].DataType == cppu::UnoType<OUString>::get()) |