summaryrefslogtreecommitdiff
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-19 16:42:13 +0200
commitabd92f37ee5840cc46bf26c4bfabc22ef5457ebe (patch)
tree9725ec979d14b9d702c6869d1a46fc31d5e7d318
parente72e79dfa3342482214b37435550e534cfdfc08e (diff)
sd::ViewShell::GetTextSelection: fix text/richtext handling
Change-Id: If7d75d48667cd48d9426b02a38d2cf539b248d26
-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 6ec221990884..55c4426c05fc 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 e3b83144db49..f8c45b5a912f 100644
--- a/sd/source/ui/view/viewshel.cxx
+++ b/sd/source/ui/view/viewshel.cxx
@@ -597,6 +597,12 @@ OString ViewShell::GetTextSelection(const 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;
}