Kaydet (Commit) 6b5481c0 authored tarafından Noel Grandin's avatar Noel Grandin Kaydeden (comit) Markus Mohrhard

fdo#82312 - Excel chart has a wrong size

bug introduced in commit 0c7f3527
"remove SvStream::operator>> methods"

Change-Id: I72a1c05b3a4a3f3a250055775eb2d35b3114406d
Reviewed-on: https://gerrit.libreoffice.org/13151Reviewed-by: 's avatarMarkus Mohrhard <markus.mohrhard@googlemail.com>
Tested-by: 's avatarMarkus Mohrhard <markus.mohrhard@googlemail.com>
üst 64f45731
...@@ -146,6 +146,7 @@ public: ...@@ -146,6 +146,7 @@ public:
//test shape import //test shape import
void testControlImport(); void testControlImport();
void testChartImportODS(); void testChartImportODS();
void testChartImportXLS();
void testNumberFormatHTML(); void testNumberFormatHTML();
void testNumberFormatCSV(); void testNumberFormatCSV();
...@@ -215,6 +216,7 @@ public: ...@@ -215,6 +216,7 @@ public:
CPPUNIT_TEST(testRowIndex1BasedXLSX); CPPUNIT_TEST(testRowIndex1BasedXLSX);
CPPUNIT_TEST(testControlImport); CPPUNIT_TEST(testControlImport);
CPPUNIT_TEST(testChartImportODS); CPPUNIT_TEST(testChartImportODS);
CPPUNIT_TEST(testChartImportXLS);
CPPUNIT_TEST(testDataBarODS); CPPUNIT_TEST(testDataBarODS);
CPPUNIT_TEST(testDataBarXLSX); CPPUNIT_TEST(testDataBarXLSX);
...@@ -1503,6 +1505,23 @@ void ScFiltersTest::testChartImportODS() ...@@ -1503,6 +1505,23 @@ void ScFiltersTest::testChartImportODS()
xDocSh->DoClose(); xDocSh->DoClose();
} }
void ScFiltersTest::testChartImportXLS()
{
ScDocShellRef xDocSh = loadDoc("chartx.", XLS);
CPPUNIT_ASSERT_MESSAGE("Failed to load chartx.xls.", xDocSh.Is());
ScDocument& rDoc = xDocSh->GetDocument();
// Retrieve the chart object instance from the 2nd page (for the 2nd sheet).
const SdrOle2Obj* pOleObj = getSingleChartObject(rDoc, 0);
CPPUNIT_ASSERT_MESSAGE("Failed to retrieve a chart object from the 2nd sheet.", pOleObj);
CPPUNIT_ASSERT_EQUAL(11148L, pOleObj->GetLogicRect().getWidth());
CPPUNIT_ASSERT_EQUAL(8635L, pOleObj->GetLogicRect().getHeight());
xDocSh->DoClose();
}
void ScFiltersTest::testNumberFormatHTML() void ScFiltersTest::testNumberFormatHTML()
{ {
ScDocShellRef xDocSh = loadDoc("numberformat.", HTML); ScDocShellRef xDocSh = loadDoc("numberformat.", HTML);
...@@ -2679,3 +2698,4 @@ CPPUNIT_TEST_SUITE_REGISTRATION(ScFiltersTest); ...@@ -2679,3 +2698,4 @@ CPPUNIT_TEST_SUITE_REGISTRATION(ScFiltersTest);
CPPUNIT_PLUGIN_IMPLEMENT(); CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -321,6 +321,26 @@ inline SvStream& operator>>( SvStream& rStrm, XclObjAnchor& rAnchor ) ...@@ -321,6 +321,26 @@ inline SvStream& operator>>( SvStream& rStrm, XclObjAnchor& rAnchor )
return rStrm; return rStrm;
} }
// creates read method for XclImpStream
template< typename StreamType >
StreamType& operator>>( StreamType& rStrm, XclObjAnchor& rAnchor )
{
sal_uInt16 tmpFirstRow, tmpTY, tmpLastRow, tmpBY;
rStrm
>> rAnchor.maFirst.mnCol >> rAnchor.mnLX
>> tmpFirstRow >> tmpTY
>> rAnchor.maLast.mnCol >> rAnchor.mnRX
>> tmpLastRow >> tmpBY;
rAnchor.maFirst.mnRow = static_cast<sal_uInt32> (tmpFirstRow);
rAnchor.mnTY = static_cast<sal_uInt32> (tmpTY);
rAnchor.maLast.mnRow = static_cast<sal_uInt32> (tmpLastRow);
rAnchor.mnBY = static_cast<sal_uInt32> (tmpBY);
return rStrm;
}
template< typename StreamType > template< typename StreamType >
StreamType& operator<<( StreamType& rStrm, const XclObjAnchor& rAnchor ) StreamType& operator<<( StreamType& rStrm, const XclObjAnchor& rAnchor )
{ {
......
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