Kaydet (Commit) 9f7b508e 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 52a02a39
...@@ -303,6 +303,9 @@ void SdTiledRenderingTest::testGetTextSelection() ...@@ -303,6 +303,9 @@ void SdTiledRenderingTest::testGetTextSelection()
rEditView.SetSelection(aWordSelection); rEditView.SetSelection(aWordSelection);
// Did we indeed manage to copy the selected text? // Did we indeed manage to copy the selected text?
CPPUNIT_ASSERT_EQUAL(OString("Shape"), pXImpressDocument->getTextSelection("text/plain;charset=utf-8")); 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() void SdTiledRenderingTest::testSetGraphicSelection()
......
...@@ -611,6 +611,12 @@ OString ViewShell::GetTextSelection(OString aMimeType) ...@@ -611,6 +611,12 @@ OString ViewShell::GetTextSelection(OString aMimeType)
else else
aRet = OString(reinterpret_cast<const sal_Char *>(aString.getStr()), aString.getLength() * sizeof(sal_Unicode)); 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; 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