diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-09-14 16:42:52 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-09-15 21:36:27 +0200 |
commit | bf3d1b8e8f89bfdb409c70cfea126f36474d4772 (patch) | |
tree | 9d496d04fc1bbd76c15ab215f947ac28587f0e1e /sc/source/ui/view/editsh.cxx | |
parent | 957adc83e67276805c6dcd7be1ea23c142c49306 (diff) |
establish that ScViewData::GetDocument can always return ScDocument&
we can only be ctored with a ScDocShell& or ScDocument&, and ScDocShell
provides a ScDocument& from its GetDocument() so we can always have a
ScDocument& when a public ctor has completed
some null checks can then be seen to be redundant and are removed
Change-Id: Ifaf39cb06e8dbce363999c05ee0aeb3ec4f00428
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102775
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sc/source/ui/view/editsh.cxx')
-rw-r--r-- | sc/source/ui/view/editsh.cxx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sc/source/ui/view/editsh.cxx b/sc/source/ui/view/editsh.cxx index fff2c90738b1..89e47e6e993e 100644 --- a/sc/source/ui/view/editsh.cxx +++ b/sc/source/ui/view/editsh.cxx @@ -433,11 +433,11 @@ void ScEditShell::Execute( SfxRequest& rReq ) { // if string contains WEAK characters, set all fonts SvtScriptType nSetScript; - ScDocument* pDoc = pViewData->GetDocument(); - if ( pDoc->HasStringWeakCharacters( aString ) ) + ScDocument& rDoc = pViewData->GetDocument(); + if ( rDoc.HasStringWeakCharacters( aString ) ) nSetScript = SvtScriptType::LATIN | SvtScriptType::ASIAN | SvtScriptType::COMPLEX; else - nSetScript = pDoc->GetStringScriptType( aString ); + nSetScript = rDoc.GetStringScriptType( aString ); SfxItemSet aSet( pTableView->GetEmptyItemSet() ); SvxScriptSetItem aSetItem( SID_ATTR_CHAR_FONT, GetPool() ); @@ -534,8 +534,8 @@ void ScEditShell::Execute( SfxRequest& rReq ) OUString aText = pEngine->GetText(); ESelection aSel = pEditView->GetSelection(); // current View - ScDocument* pDoc = pViewData->GetDocument(); - ScRefFinder aFinder(aText, pViewData->GetCurPos(), *pDoc, pDoc->GetAddressConvention()); + ScDocument& rDoc = pViewData->GetDocument(); + ScRefFinder aFinder(aText, pViewData->GetCurPos(), rDoc, rDoc.GetAddressConvention()); aFinder.ToggleRel( aSel.nStartPos, aSel.nEndPos ); if (aFinder.GetFound()) { |