summaryrefslogtreecommitdiff
path: root/libreofficekit
diff options
context:
space:
mode:
authorMihai Varga <mihai.varga@collabora.com>2015-07-22 16:21:08 +0300
committerJan Holesovsky <kendy@collabora.com>2015-08-03 10:42:51 +0200
commitef6d95bc75b06573bf5342933b1ac35aada5dbc8 (patch)
tree838c72e5b753da26e5be8820616ab30892e72a9f /libreofficekit
parent82436291303dacfb3e9ea2f41c53eb057df9ee30 (diff)
tiledrendering: added getPartName method for calc
This method is used to get the sheet's name and to display it in the tabs (sheet selector) I've also added an unit test for it and uncommented a similar one Change-Id: Ia866815c594a873812c71a6c86e303c869e1f093 Reviewed-on: https://gerrit.libreoffice.org/17294 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Diffstat (limited to 'libreofficekit')
-rw-r--r--libreofficekit/qa/data/calc_sheetnames.odsbin0 -> 6966 bytes
-rw-r--r--libreofficekit/qa/unit/tiledrendering.cxx24
2 files changed, 21 insertions, 3 deletions
diff --git a/libreofficekit/qa/data/calc_sheetnames.ods b/libreofficekit/qa/data/calc_sheetnames.ods
new file mode 100644
index 000000000000..f6627a058499
--- /dev/null
+++ b/libreofficekit/qa/data/calc_sheetnames.ods
Binary files differ
diff --git a/libreofficekit/qa/unit/tiledrendering.cxx b/libreofficekit/qa/unit/tiledrendering.cxx
index 63eb756b9d20..fb2f7416ba34 100644
--- a/libreofficekit/qa/unit/tiledrendering.cxx
+++ b/libreofficekit/qa/unit/tiledrendering.cxx
@@ -65,8 +65,9 @@ public:
void testDocumentLoadFail( Office* pOffice );
void testDocumentTypes( Office* pOffice );
-#if 0
void testImpressSlideNames( Office* pOffice );
+ void testCalcSheetNames( Office* pOffice );
+#if 0
void testOverlay( Office* pOffice );
#endif
@@ -90,8 +91,9 @@ void TiledRenderingTest::runAllTests()
testDocumentLoadFail( pOffice.get() );
testDocumentTypes( pOffice.get() );
-#if 0
testImpressSlideNames( pOffice.get() );
+ testCalcSheetNames( pOffice.get() );
+#if 0
testOverlay( pOffice.get() );
#endif
}
@@ -142,7 +144,6 @@ void TiledRenderingTest::testDocumentTypes( Office* pOffice )
// TODO: do this for all supported document types
}
-#if 0
void TiledRenderingTest::testImpressSlideNames( Office* pOffice )
{
const string sDocPath = m_sSrcRoot + "/libreofficekit/qa/data/impress_slidenames.odp";
@@ -164,6 +165,23 @@ void TiledRenderingTest::testImpressSlideNames( Office* pOffice )
// have a localised version of "Slide 3".
}
+void TiledRenderingTest::testCalcSheetNames( Office* pOffice )
+{
+ const string sDocPath = m_sSrcRoot + "/libreofficekit/qa/data/calc_sheetnames.ods";
+ const string sLockFile = m_sSrcRoot +"/libreofficekit/qa/data/.~lock.calc_sheetnames.ods#";
+
+ // FIXME: LOK will fail when trying to open a locked file
+ remove( sLockFile.c_str() );
+
+ scoped_ptr< Document> pDocument( pOffice->documentLoad( sDocPath.c_str() ) );
+
+ CPPUNIT_ASSERT( pDocument->getParts() == 3 );
+ CPPUNIT_ASSERT( strcmp( pDocument->getPartName( 0 ), "TestText1" ) == 0 );
+ CPPUNIT_ASSERT( strcmp( pDocument->getPartName( 1 ), "TestText2" ) == 0 );
+ CPPUNIT_ASSERT( strcmp( pDocument->getPartName( 2 ), "Sheet3" ) == 0 );
+}
+
+#if 0
static void dumpRGBABitmap( const OUString& rPath, const unsigned char* pBuffer,
const int nWidth, const int nHeight )
{