summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--editeng/source/editeng/editeng.cxx2
-rw-r--r--sc/source/filter/rtf/eeimpars.cxx4
2 files changed, 4 insertions, 2 deletions
diff --git a/editeng/source/editeng/editeng.cxx b/editeng/source/editeng/editeng.cxx
index bb09af238d99..3e3b691d207b 100644
--- a/editeng/source/editeng/editeng.cxx
+++ b/editeng/source/editeng/editeng.cxx
@@ -1492,6 +1492,8 @@ EditTextObject* EditEngine::CreateTextObject()
EditTextObject* EditEngine::CreateTextObject( const ESelection& rESelection )
{
EditSelection aSel( pImpEditEngine->CreateSel( rESelection ) );
+ if (aSel.IsInvalid())
+ return nullptr;
return pImpEditEngine->CreateTextObject( aSel );
}
diff --git a/sc/source/filter/rtf/eeimpars.cxx b/sc/source/filter/rtf/eeimpars.cxx
index f84cc987ef8d..cac30a4db058 100644
--- a/sc/source/filter/rtf/eeimpars.cxx
+++ b/sc/source/filter/rtf/eeimpars.cxx
@@ -400,10 +400,10 @@ void ScEEImport::WriteToDocument( bool bSizeColsRows, double nOutputFactor, SvNu
mpDoc->SetString(nCol, nRow, nTab, aStr, &aParam);
}
}
- else
+ else if (EditTextObject* pTextObject = mpEngine->CreateTextObject(pE->aSel))
{
// The cell will own the text object instance.
- mpDoc->SetEditText(ScAddress(nCol,nRow,nTab), mpEngine->CreateTextObject(pE->aSel));
+ mpDoc->SetEditText(ScAddress(nCol,nRow,nTab), pTextObject);
}
if ( !pE->maImageList.empty() )
bHasGraphics |= GraphicSize( nCol, nRow, pE );