diff options
author | Tamás Zolnai <tamas.zolnai@collabora.com> | 2017-03-28 19:24:49 +0200 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2017-04-18 20:14:53 +0200 |
commit | 253e2035474b830c07bf327ca7204fa362312a47 (patch) | |
tree | cd7536d37cb85713bf3baaff9a5156804ab68555 /sd | |
parent | 3526b7c0db27cb8e333d30813b79982873aa4501 (diff) |
tdf#105286: Implement text rotation for Impress tables
Typo: TopToBotton -> TopToBottom
Change-Id: I1b4d3ab9ec1d1383d76a56c9662ffeeb9fe69655
Reviewed-on: https://gerrit.libreoffice.org/36014
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
(cherry picked from commit 334e6e2f1ad3da319be0849ec426aa64b18cb599)
Add SvxTextRotateItem inherited from SvxCharRotatItem
I will be use it later for text rotation inside a table.
Change-Id: I4cbaf05953b0e71331d2f3fdb45b7c4254a2b8cc
Reviewed-on: https://gerrit.libreoffice.org/36021
Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Tested-by: Tamás Zolnai <tamas.zolnai@collabora.com>
(cherry picked from commit 1e30d2aface12a31687e5a27126e2061efd4b0cd)
Introduce text rotation for Impress tables
* Introduce new table property for text rotation
* Support only two rotation angle (270° and 90°)
* Implement editing and rendering of 270° rotated
text (90° rotation was already implemented)
(cherry picked from commit c671094154ecec6f3ba5beea9d26ff0d2d4d86ad)
Change-Id: Ifc2e0f171e9c840e86b365e9af2c30aa97ecd92e
Implement RotateAngle API property for Impress table cells
(cherry picked from commit a0755ab8772d01797f4945016a978a2bbd8fdf20)
Change-Id: I01379c0fc21e8fe294bc882bf824f64502863ff4
tdf#100926: PPTX import of table with rotated text
(cherry picked from commit 2436cf17304f25c7d34da52a321d6da0e9011d19)
Change-Id: I05a8e979ac11b179e15784023032a56edc5b569b
ODF import / export of rotated text in Impress table
(cherry picked from commit bcb371b1a830442610ad7fda476eda5271427a50)
Change-Id: I57136e32ed2db5e405a45e8e4bad1b8d459b7ae8
Fix vertical text and bitmap bullet rendering
Change-Id: I881fce0511c81b164516d68f72c7e750687d4e0e
(cherry picked from commit 15ac3f9f4dc65fc0c6020284064e3725956f5d0a)
Diffstat (limited to 'sd')
-rwxr-xr-x | sd/qa/unit/data/pptx/tdf100926.pptx | bin | 0 -> 32382 bytes | |||
-rwxr-xr-x | sd/qa/unit/data/pptx/tdf100926_ODP.pptx | bin | 0 -> 32382 bytes | |||
-rw-r--r-- | sd/qa/unit/export-tests.cxx | 31 | ||||
-rw-r--r-- | sd/qa/unit/import-tests.cxx | 28 | ||||
-rw-r--r-- | sd/source/ui/func/futext.cxx | 4 |
5 files changed, 62 insertions, 1 deletions
diff --git a/sd/qa/unit/data/pptx/tdf100926.pptx b/sd/qa/unit/data/pptx/tdf100926.pptx Binary files differnew file mode 100755 index 000000000000..71627394ec84 --- /dev/null +++ b/sd/qa/unit/data/pptx/tdf100926.pptx diff --git a/sd/qa/unit/data/pptx/tdf100926_ODP.pptx b/sd/qa/unit/data/pptx/tdf100926_ODP.pptx Binary files differnew file mode 100755 index 000000000000..71627394ec84 --- /dev/null +++ b/sd/qa/unit/data/pptx/tdf100926_ODP.pptx diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx index 797bf36d6192..df0da159aacf 100644 --- a/sd/qa/unit/export-tests.cxx +++ b/sd/qa/unit/export-tests.cxx @@ -92,6 +92,7 @@ public: void testTdf62176(); void testTransparentBackground(); void testEmbeddedPdf(); + void testTdf100926(); CPPUNIT_TEST_SUITE(SdExportTest); @@ -106,6 +107,7 @@ public: CPPUNIT_TEST(testTdf62176); CPPUNIT_TEST(testTransparentBackground); CPPUNIT_TEST(testEmbeddedPdf); + CPPUNIT_TEST(testTdf100926); CPPUNIT_TEST_SUITE_END(); @@ -552,6 +554,35 @@ void SdExportTest::testEmbeddedPdf() #endif } +void SdExportTest::testTdf100926() +{ + sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/tdf100926_ODP.pptx"), PPTX); + + xDocShRef = saveAndReload(xDocShRef.get(), ODP); + + const SdrPage* pPage = GetPage(1, xDocShRef); + CPPUNIT_ASSERT(pPage != nullptr); + + sdr::table::SdrTableObj *pTableObj = dynamic_cast<sdr::table::SdrTableObj*>(pPage->GetObj(0)); + CPPUNIT_ASSERT(pTableObj != nullptr); + uno::Reference< table::XCellRange > xTable(pTableObj->getTable(), uno::UNO_QUERY_THROW); + + sal_Int32 nRotation = 0; + uno::Reference< beans::XPropertySet > xCell(xTable->getCellByPosition(0, 0), uno::UNO_QUERY_THROW); + xCell->getPropertyValue("RotateAngle") >>= nRotation; + CPPUNIT_ASSERT_EQUAL(sal_Int32(27000), nRotation); + + xCell.set(xTable->getCellByPosition(1, 0), uno::UNO_QUERY_THROW); + xCell->getPropertyValue("RotateAngle") >>= nRotation; + CPPUNIT_ASSERT_EQUAL(sal_Int32(9000), nRotation); + + xCell.set(xTable->getCellByPosition(2, 0), uno::UNO_QUERY_THROW); + xCell->getPropertyValue("RotateAngle") >>= nRotation; + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), nRotation); + + xDocShRef->DoClose(); +} + CPPUNIT_TEST_SUITE_REGISTRATION(SdExportTest); CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx index df0e639c7265..27d15c0ec22b 100644 --- a/sd/qa/unit/import-tests.cxx +++ b/sd/qa/unit/import-tests.cxx @@ -142,6 +142,7 @@ public: void testTdf104015(); void testTdf104201(); void testTdf104445(); + void testTdf100926(); bool checkPattern(sd::DrawDocShellRef& rDocRef, int nShapeNumber, std::vector<sal_uInt8>& rExpected); void testPatternImport(); @@ -205,6 +206,7 @@ public: CPPUNIT_TEST(testTdf104201); CPPUNIT_TEST(testTdf104445); CPPUNIT_TEST(testPatternImport); + CPPUNIT_TEST(testTdf100926); CPPUNIT_TEST_SUITE_END(); }; @@ -2109,6 +2111,32 @@ void SdImportTest::testPatternImport() xDocRef->DoClose(); } +void SdImportTest::testTdf100926() +{ + sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/tdf100926.pptx"), PPTX); + const SdrPage* pPage = GetPage(1, xDocShRef); + CPPUNIT_ASSERT(pPage != nullptr); + + sdr::table::SdrTableObj *pTableObj = dynamic_cast<sdr::table::SdrTableObj*>(pPage->GetObj(0)); + CPPUNIT_ASSERT(pTableObj != nullptr); + uno::Reference< table::XCellRange > xTable(pTableObj->getTable(), uno::UNO_QUERY_THROW); + + sal_Int32 nRotation = 0; + uno::Reference< beans::XPropertySet > xCell(xTable->getCellByPosition(0, 0), uno::UNO_QUERY_THROW); + xCell->getPropertyValue("RotateAngle") >>= nRotation; + CPPUNIT_ASSERT_EQUAL(sal_Int32(27000), nRotation); + + xCell.set(xTable->getCellByPosition(1, 0), uno::UNO_QUERY_THROW); + xCell->getPropertyValue("RotateAngle") >>= nRotation; + CPPUNIT_ASSERT_EQUAL(sal_Int32(9000), nRotation); + + xCell.set(xTable->getCellByPosition(2, 0), uno::UNO_QUERY_THROW); + xCell->getPropertyValue("RotateAngle") >>= nRotation; + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), nRotation); + + xDocShRef->DoClose(); +} + CPPUNIT_TEST_SUITE_REGISTRATION(SdImportTest); CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sd/source/ui/func/futext.cxx b/sd/source/ui/func/futext.cxx index 37fb65c97943..cb9bdc3c8120 100644 --- a/sd/source/ui/func/futext.cxx +++ b/sd/source/ui/func/futext.cxx @@ -1055,7 +1055,9 @@ void FuText::SetInEditMode(const MouseEvent& rMEvt, bool bQuickDrag) if( pTextObj ) { OutlinerParaObject* pOPO = pTextObj->GetOutlinerParaObject(); - if( ( pOPO && pOPO->IsVertical() ) || (nSlotId == SID_ATTR_CHAR_VERTICAL) || (nSlotId == SID_TEXT_FITTOSIZE_VERTICAL) ) + if( pOPO && pOPO->IsVertical() ) + pOutl->SetVertical( true, pOPO->IsTopToBottom()); + else if (nSlotId == SID_ATTR_CHAR_VERTICAL || nSlotId == SID_TEXT_FITTOSIZE_VERTICAL) pOutl->SetVertical( true ); if( pTextObj->getTextCount() > 1 ) |