diff options
author | scito <info@scito.ch> | 2021-04-30 14:41:00 +0200 |
---|---|---|
committer | Heiko Tietze <heiko.tietze@documentfoundation.org> | 2021-05-03 11:39:20 +0200 |
commit | 02b72784e5601636d26c8e4592958c262efb1a7d (patch) | |
tree | d8e69282a79d4e5e0193f3c1e0e618e27be54452 /sc/qa/unit/uicalc | |
parent | 357b36c7797ca7ac249714e5ddca1f04e0228c0e (diff) |
tdf#102255 add .uno:PasteTransposed
The transpose uno command is added to the same places as .uno:PasteOnlyValue:
- menubar
- cell
- pagebreak
The icons are added with tdf#141866
Change-Id: I35a54390ee82ab1059007545188e9d175c3ea750
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114911
Tested-by: Jenkins
Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
Diffstat (limited to 'sc/qa/unit/uicalc')
-rw-r--r-- | sc/qa/unit/uicalc/uicalc.cxx | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/sc/qa/unit/uicalc/uicalc.cxx b/sc/qa/unit/uicalc/uicalc.cxx index 29417a3c4778..9b587a894af6 100644 --- a/sc/qa/unit/uicalc/uicalc.cxx +++ b/sc/qa/unit/uicalc/uicalc.cxx @@ -510,6 +510,40 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testMultiRangeCol) CPPUNIT_ASSERT_EQUAL(OUString(""), pDoc->GetString(ScAddress(2, 0, 0))); } +// Test the call of .uno:PasteTransposed (tdf#102255) +// Note: the transpose functionaly is tested in ucalc +CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testPasteTransposed) +{ + mxComponent = loadFromDesktop("private:factory/scalc"); + ScModelObj* pModelObj = dynamic_cast<ScModelObj*>(mxComponent.get()); + CPPUNIT_ASSERT(pModelObj); + ScDocument* pDoc = pModelObj->GetDocument(); + CPPUNIT_ASSERT(pDoc); + + insertStringToCell(*pModelObj, "A1", "1"); + insertStringToCell(*pModelObj, "A2", "2"); + insertStringToCell(*pModelObj, "A3", "3"); + + goToCell("A1:A3"); + + dispatchCommand(mxComponent, ".uno:Copy", {}); + + mxComponent->dispose(); + + // Open a new document + mxComponent = loadFromDesktop("private:factory/scalc"); + pModelObj = dynamic_cast<ScModelObj*>(mxComponent.get()); + CPPUNIT_ASSERT(pModelObj); + pDoc = pModelObj->GetDocument(); + CPPUNIT_ASSERT(pDoc); + + dispatchCommand(mxComponent, ".uno:PasteTransposed", {}); + + CPPUNIT_ASSERT_EQUAL(OUString("1"), pDoc->GetString(ScAddress(0, 0, 0))); // A1 + CPPUNIT_ASSERT_EQUAL(OUString("2"), pDoc->GetString(ScAddress(1, 0, 0))); // B1 + CPPUNIT_ASSERT_EQUAL(OUString("3"), pDoc->GetString(ScAddress(2, 0, 0))); // C1 +} + CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf131442) { mxComponent = loadFromDesktop("private:factory/scalc"); |