Kaydet (Commit) ed8a337c authored tarafından Kohei Yoshida's avatar Kohei Yoshida Kaydeden (comit) Kohei Yoshida

tdf#104383: prevent crash during file load.

Apparently xView may be null sometimes.

Change-Id: Icef81159eeaf5c9bdb0a91e036019b820952d20b
Reviewed-on: https://gerrit.libreoffice.org/35304Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarKohei Yoshida <libreoffice@kohei.us>
üst a18017ed
......@@ -4233,8 +4233,20 @@ ScVbaRange::ApplicationRange( const uno::Reference< uno::XComponentContext >& xC
}
}
uno::Reference< sheet::XSpreadsheetView > xView( getCurrentExcelDoc(xContext)->getCurrentController(), uno::UNO_QUERY );
uno::Reference< table::XCellRange > xSheetRange( xView->getActiveSheet(), uno::UNO_QUERY_THROW );
uno::Reference<table::XCellRange> xSheetRange;
try
{
uno::Reference<sheet::XSpreadsheetView> xView(
getCurrentExcelDoc(xContext)->getCurrentController(), uno::UNO_QUERY_THROW);
xSheetRange.set(xView->getActiveSheet(), uno::UNO_QUERY_THROW);
}
catch (const uno::Exception&)
{
return uno::Reference<excel::XRange>();
}
ScVbaRange* pRange = new ScVbaRange( excel::getUnoSheetModuleObj( xSheetRange ), xContext, xSheetRange );
uno::Reference< excel::XRange > xVbSheetRange( pRange );
return pRange->Range( Cell1, Cell2, true );
......
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