Kaydet (Commit) cf51ec84 authored tarafından Miklos Vajna's avatar Miklos Vajna

sd::ViewShell::GetTextSelection: fix text/richtext handling

Change-Id: If7d75d48667cd48d9426b02a38d2cf539b248d26
(cherry picked from commit abd92f37)
üst df3ccb24
......@@ -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()
......
......@@ -598,6 +598,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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment