diff options
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/ui/view/viewshel.cxx | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/sd/source/ui/view/viewshel.cxx b/sd/source/ui/view/viewshel.cxx index c0fb2aa674a6..09af5e774e4a 100644 --- a/sd/source/ui/view/viewshel.cxx +++ b/sd/source/ui/view/viewshel.cxx @@ -534,17 +534,10 @@ OString ViewShell::GetTextSelection(const OString& _aMimeType, OString& rUsedMim uno::Reference<datatransfer::XTransferable> xTransferable = rEditView.GetEditEngine()->CreateTransferable(rEditView.GetSelection()); // Take care of UTF-8 text here. - bool bConvert = false; - sal_Int32 nIndex = 0; OString aMimeType = _aMimeType; - if (aMimeType.getToken(0, ';', nIndex) == "text/plain") - { - if (aMimeType.getToken(0, ';', nIndex) == "charset=utf-8") - { - aMimeType = "text/plain;charset=utf-16"; - bConvert = true; - } - } + const bool bConvert{ aMimeType.startsWith("text/plain;charset=utf-8") }; + if (bConvert) + aMimeType = "text/plain;charset=utf-16"; datatransfer::DataFlavor aFlavor; aFlavor.MimeType = OUString::fromUtf8(aMimeType.getStr()); |