diff options
author | Katarina Behrens <Katarina.Behrens@cib.de> | 2016-06-28 22:29:52 +0200 |
---|---|---|
committer | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2016-08-18 02:39:10 +0200 |
commit | 04a200cf8e578a9f41d4511f31c1ee16fec4556d (patch) | |
tree | 2e7a83ce05cfb7e381eaeb6f30d7ef1d57fbbffd /sc | |
parent | 34029d980bb7f213c766d42381f57c78df14ae17 (diff) |
screenshots: don't crash on opening csv import dlg
Change-Id: I1ff56d79f7ff31317187cf077380481f1ef44366
Diffstat (limited to 'sc')
-rw-r--r-- | sc/qa/unit/screenshots/screenshots.cxx | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/sc/qa/unit/screenshots/screenshots.cxx b/sc/qa/unit/screenshots/screenshots.cxx index ee12727e369f..68d2814397d1 100644 --- a/sc/qa/unit/screenshots/screenshots.cxx +++ b/sc/qa/unit/screenshots/screenshots.cxx @@ -96,6 +96,8 @@ private: ScDocShellRef xDocSh; ScTabViewShell* pViewShell; ScAbstractDialogFactory* pFact; + + std::unique_ptr<ScImportStringStream> pStream; }; ScScreenshotTest::ScScreenshotTest() @@ -138,6 +140,9 @@ void ScScreenshotTest::initializeWithDoc(const char* pName) pFact = ScAbstractDialogFactory::Create(); CPPUNIT_ASSERT_MESSAGE("Failed to create dialog factory", pFact); + + const OUString aCsv("some, strings, here, separated, by, commas"); + pStream.reset( new ScImportStringStream( aCsv) ); } VclAbstractDialog* ScScreenshotTest::createDialogByID( sal_uInt32 nID ) @@ -240,13 +245,11 @@ VclAbstractDialog* ScScreenshotTest::createDialogByID( sal_uInt32 nID ) break; } - //case 12: - //{ - // const OUString aCsv("some, strings, here, separated, by, commas"); - // ScImportStringStream aStream( aCsv ); - // pReturnDialog = pFact->CreateScImportAsciiDlg( OUString(), &aStream, SC_PASTETEXT ); - // break; - //} + case 13: + { + pReturnDialog = pFact->CreateScImportAsciiDlg( OUString(), pStream.get(), SC_PASTETEXT ); + break; + } //ScopedVclPtrInstance<ScShareDocumentDlg> pDlg14( pViewShell->GetDialogParent(), &rViewData ); //ScopedVclPtrInstance<ScTableProtectionDlg> pDlg16(pViewShell->GetDialogParent()); default: @@ -290,7 +293,7 @@ void ScScreenshotTest::testOpeningModalDialogs() { initializeWithDoc("empty.ods"); - const sal_uInt32 nDialogs = 13; + const sal_uInt32 nDialogs = 14; for ( sal_uInt32 i = 0; i < nDialogs; i++ ) { |