summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2015-06-19 16:14:59 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-06-22 10:27:40 +0200
commit9f7b508e934f4bcfac62129b169ff11288e1c4cd (patch)
treee05c4b74aee1be073ff46010de12f3e830739c7d /sd
parent52a02a3980a0b5a55e922301d1b196fcbb3440f9 (diff)
sd::ViewShell::GetTextSelection: fix text/richtext handling
Change-Id: If7d75d48667cd48d9426b02a38d2cf539b248d26 (cherry picked from commit abd92f37ee5840cc46bf26c4bfabc22ef5457ebe)
Diffstat (limited to 'sd')
-rw-r--r--sd/qa/unit/tiledrendering/tiledrendering.cxx3
-rw-r--r--sd/source/ui/view/viewshel.cxx6
2 files changed, 9 insertions, 0 deletions
diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx b/sd/qa/unit/tiledrendering/tiledrendering.cxx
index c643b0be51c4..dad7c3e3c8cc 100644
--- a/sd/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx
@@ -303,6 +303,9 @@ void SdTiledRenderingTest::testGetTextSelection()
rEditView.SetSelection(aWordSelection);
// Did we indeed manage to copy the selected text?
CPPUNIT_ASSERT_EQUAL(OString("Shape"), pXImpressDocument->getTextSelection("text/plain;charset=utf-8"));
+
+ // Make sure returned RTF is not empty.
+ CPPUNIT_ASSERT(!OString(pXImpressDocument->getTextSelection("text/richtext")).isEmpty());
}
void SdTiledRenderingTest::testSetGraphicSelection()
diff --git a/sd/source/ui/view/viewshel.cxx b/sd/source/ui/view/viewshel.cxx
index b83fc35485e8..7b840f34dfa0 100644
--- a/sd/source/ui/view/viewshel.cxx
+++ b/sd/source/ui/view/viewshel.cxx
@@ -611,6 +611,12 @@ OString ViewShell::GetTextSelection(OString aMimeType)
else
aRet = OString(reinterpret_cast<const sal_Char *>(aString.getStr()), aString.getLength() * sizeof(sal_Unicode));
}
+ else
+ {
+ uno::Sequence<sal_Int8> aSequence;
+ aAny >>= aSequence;
+ aRet = OString(reinterpret_cast<sal_Char*>(aSequence.getArray()), aSequence.getLength());
+ }
return aRet;
}