diff options
Diffstat (limited to 'sc/qa/unit/helper/qahelper.cxx')
-rw-r--r-- | sc/qa/unit/helper/qahelper.cxx | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/sc/qa/unit/helper/qahelper.cxx b/sc/qa/unit/helper/qahelper.cxx index 4ee21b98512b..b1d70b3e30d3 100644 --- a/sc/qa/unit/helper/qahelper.cxx +++ b/sc/qa/unit/helper/qahelper.cxx @@ -288,7 +288,7 @@ void testFormats(ScBootstrapFixture* pTest, ScDocument* pDoc, sal_Int32 nFormat) CPPUNIT_ASSERT_EQUAL(ScRangeList(ScRange(1,1,2,3,1,2)), rRange3); } -const SdrOle2Obj* getSingleChartObject(ScDocument& rDoc, sal_uInt16 nPage) +const SdrOle2Obj* getSingleOleObject(ScDocument& rDoc, sal_uInt16 nPage) { // Retrieve the chart object instance from the 2nd page (for the 2nd sheet). ScDrawLayer* pDrawLayer = rDoc.GetDrawLayer(); @@ -324,14 +324,23 @@ const SdrOle2Obj* getSingleChartObject(ScDocument& rDoc, sal_uInt16 nPage) return nullptr; } - const SdrOle2Obj& rOleObj = static_cast<const SdrOle2Obj&>(*pObj); - if (!rOleObj.IsChart()) + return static_cast<const SdrOle2Obj*>(pObj); +} + +const SdrOle2Obj* getSingleChartObject(ScDocument& rDoc, sal_uInt16 nPage) +{ + const SdrOle2Obj* pObj = getSingleOleObject(rDoc, nPage); + + if (!pObj) + return pObj; + + if (!pObj->IsChart()) { cout << "This should be a chart object." << endl; return nullptr; } - return &rOleObj; + return pObj; } std::vector<OUString> getChartRangeRepresentations(const SdrOle2Obj& rChartObj) |