diff options
-rw-r--r-- | sc/qa/unit/tiledrendering/tiledrendering.cxx | 10 | ||||
-rw-r--r-- | sc/source/ui/view/viewfun3.cxx | 2 |
2 files changed, 9 insertions, 3 deletions
diff --git a/sc/qa/unit/tiledrendering/tiledrendering.cxx b/sc/qa/unit/tiledrendering/tiledrendering.cxx index 6e47eefd5cd0..65844f2546f8 100644 --- a/sc/qa/unit/tiledrendering/tiledrendering.cxx +++ b/sc/qa/unit/tiledrendering/tiledrendering.cxx @@ -407,7 +407,7 @@ void ScTiledRenderingTest::testRowColumnSelections() // When we copy this, we don't get anything useful, but we must not crash // (used to happen) aResult = apitest::helper::transferable::getTextSelection(pModelObj->getSelection(), "text/plain;charset=utf-8"); - CPPUNIT_ASSERT_EQUAL(OString(), aResult); + CPPUNIT_ASSERT_EQUAL(OString("9"), aResult); // TODO check that we really selected what we wanted here @@ -419,7 +419,7 @@ void ScTiledRenderingTest::testRowColumnSelections() // When we copy this, we don't get anything useful, but we must not crash // (used to happen) aResult = apitest::helper::transferable::getTextSelection(pModelObj->getSelection(), "text/plain;charset=utf-8"); - CPPUNIT_ASSERT_EQUAL(OString(), aResult); + CPPUNIT_ASSERT_EQUAL(OString("1"), aResult); // TODO check that we really selected what we wanted here @@ -4154,6 +4154,12 @@ void ScTiledRenderingTest::testCopyMultiSelection() // Make sure we get A1+A3 instead of an error: CPPUNIT_ASSERT(xTransferable.is()); + + // Also make sure that just 2 cells is classified as a simple selection: + uno::Reference<datatransfer::XTransferable2> xTransferable2(xTransferable, uno::UNO_QUERY); + CPPUNIT_ASSERT(xTransferable2.is()); + // Without the fix, the text selection was complex. + CPPUNIT_ASSERT(!xTransferable2->isComplex()); } } diff --git a/sc/source/ui/view/viewfun3.cxx b/sc/source/ui/view/viewfun3.cxx index 769805d5d32a..6540e8f15f6f 100644 --- a/sc/source/ui/view/viewfun3.cxx +++ b/sc/source/ui/view/viewfun3.cxx @@ -464,7 +464,7 @@ rtl::Reference<ScTransferObj> ScViewFunc::CopyToTransferable() { ScDocumentUniquePtr pClipDoc(new ScDocument(SCDOCMODE_CLIP)); // This takes care of the input line and calls CopyToClipMultiRange() for us. - CopyToClip(pClipDoc.get(), /*bCut=*/false, /*bApi=*/true); + CopyToClip(pClipDoc.get(), aRange, /*bCut=*/false, /*bApi=*/true); TransferableObjectDescriptor aObjDesc; return new ScTransferObj(std::move(pClipDoc), std::move(aObjDesc)); } |