sw/source/core/doc/docedt.cxx | 4 ++-- sw/source/core/edit/edlingu.cxx | 3 +-- sw/source/filter/html/htmlgrin.cxx | 3 +-- sw/source/filter/ww8/ww8par.cxx | 3 +-- sw/source/uibase/app/applab.cxx | 3 +-- sw/source/uibase/uno/unomailmerge.cxx | 2 +- 6 files changed, 7 insertions(+), 11 deletions(-)
New commits: commit 00f052184fe39a0d86cc4ced54edfb64682aa4e2 Author: Mike Kaganski <mike.kagan...@collabora.com> AuthorDate: Thu Jun 12 08:29:50 2025 +0200 Commit: Mike Kaganski <mike.kagan...@collabora.com> CommitDate: Thu Jun 12 12:08:02 2025 +0200 Use less concrete UNO types :) In places where it makes more sense Change-Id: Id7f28a5fcea77c96872ca3572d31fb04f0c4e1b3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186397 Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com> Tested-by: Jenkins diff --git a/sw/source/core/doc/docedt.cxx b/sw/source/core/doc/docedt.cxx index 43449dee0543..5d584f2a326f 100644 --- a/sw/source/core/doc/docedt.cxx +++ b/sw/source/core/doc/docedt.cxx @@ -628,7 +628,7 @@ uno::Any SwDoc::Spell( SwPaM& rPaM, { if (const SwDocShell* pShell = GetDocShell()) { - rtl::Reference< SwXTextDocument > xDoc = pShell->GetBaseModel(); + uno::Reference<uno::XInterface> xDoc = pShell->GetModel(); // Expand the string: const ModelToViewHelper aConversionMap(*pNd->GetTextNode(), pLayout); const OUString& aExpandText = aConversionMap.getViewText(); @@ -643,7 +643,7 @@ uno::Any SwDoc::Spell( SwPaM& rPaM, { aConversionMap.ConvertToViewPosition( nBeginGrammarCheck ); aResult = xGCIterator->checkSentenceAtPosition( - cppu::getXWeak(xDoc.get()), xFlatPara, aExpandText, lang::Locale(), nBeginGrammarCheck, -1, -1 ); + xDoc, xFlatPara, aExpandText, lang::Locale(), nBeginGrammarCheck, -1, -1 ); lcl_syncGrammarError( *pNd->GetTextNode(), aResult, aConversionMap ); diff --git a/sw/source/core/edit/edlingu.cxx b/sw/source/core/edit/edlingu.cxx index b1c4d5e011c2..7b9bda1e0803 100644 --- a/sw/source/core/edit/edlingu.cxx +++ b/sw/source/core/edit/edlingu.cxx @@ -982,7 +982,6 @@ bool SwEditShell::GetGrammarCorrection( SwDocShell* pShell = mxDoc->GetDocShell(); if (!pShell) return bRes; - rtl::Reference< SwXTextDocument > xDoc = pShell->GetBaseModel(); // Expand the string: const ModelToViewHelper aConversionMap(*pNode, GetLayout()); @@ -997,7 +996,7 @@ bool SwEditShell::GetGrammarCorrection( const sal_Int32 nEndOfSentence = aConversionMap.ConvertToViewPosition( pWrong->getSentenceEnd( nBegin ) ); rResult = xGCIterator->checkSentenceAtPosition( - cppu::getXWeak(xDoc.get()), xFlatPara, aExpandText, lang::Locale(), nStartOfSentence, + pShell->GetModel(), xFlatPara, aExpandText, lang::Locale(), nStartOfSentence, nEndOfSentence == COMPLETE_STRING ? aExpandText.getLength() : nEndOfSentence, rErrorPosInText ); bRes = true; diff --git a/sw/source/filter/html/htmlgrin.cxx b/sw/source/filter/html/htmlgrin.cxx index 7e2f4480cf67..ad89b8ec2120 100644 --- a/sw/source/filter/html/htmlgrin.cxx +++ b/sw/source/filter/html/htmlgrin.cxx @@ -1576,8 +1576,7 @@ void SwHTMLParser::NotifyMacroEventRead() SwDocShell *pDocSh = m_xDoc->GetDocShell(); if (!pDocSh) return; - rtl::Reference<SwXTextDocument> const xModel(pDocSh->GetBaseModel()); - comphelper::DocumentInfo::notifyMacroEventRead(static_cast<SfxBaseModel*>(xModel.get())); + comphelper::DocumentInfo::notifyMacroEventRead(pDocSh->GetModel()); m_bNotifyMacroEventRead = true; } diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index 33b728a92b57..5c737d341e17 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -6780,8 +6780,7 @@ void SwWW8ImplReader::NotifyMacroEventRead() return; if (SwDocShell* pShell = m_rDoc.GetDocShell()) { - uno::Reference<frame::XModel> const xModel(static_cast<SfxBaseModel*>(pShell->GetBaseModel().get())); - comphelper::DocumentInfo::notifyMacroEventRead(xModel); + comphelper::DocumentInfo::notifyMacroEventRead(pShell->GetModel()); m_bNotifyMacroEventRead = true; } } diff --git a/sw/source/uibase/app/applab.cxx b/sw/source/uibase/app/applab.cxx index df3d501ba4ec..99fab4f7b27e 100644 --- a/sw/source/uibase/app/applab.cxx +++ b/sw/source/uibase/app/applab.cxx @@ -359,10 +359,9 @@ void SwModule::InsertLab(SfxRequest& rReq, bool bLabel) //fill the user fields if(!bLabel) { - rtl::Reference< SwXTextDocument > xModel = pSh->GetView().GetDocShell()->GetBaseModel(); OSL_ENSURE(pDialogFactory, "SwAbstractDialogFactory fail!"); SwLabDlgMethod SwLabDlgUpdateFieldInformation = pDialogFactory->GetSwLabDlgStaticMethod (); - SwLabDlgUpdateFieldInformation(static_cast<SfxBaseModel*>(xModel.get()), rItem); + SwLabDlgUpdateFieldInformation(pSh->GetView().GetDocShell()->GetModel(), rItem); } pFieldMgr->SetEvalExpFields(true); diff --git a/sw/source/uibase/uno/unomailmerge.cxx b/sw/source/uibase/uno/unomailmerge.cxx index 7dfd6aec47c6..fa80be500151 100644 --- a/sw/source/uibase/uno/unomailmerge.cxx +++ b/sw/source/uibase/uno/unomailmerge.cxx @@ -806,7 +806,7 @@ uno::Any SAL_CALL SwXMailMerge::execute( if (DBMGR_MERGE_SHELL == nMergeType) { - return Any( Reference<XModel>(static_cast<SfxBaseModel*>(aMergeDesc.pMailMergeConfigItem->GetTargetView()->GetDocShell()->GetBaseModel().get())) ); + return Any(aMergeDesc.pMailMergeConfigItem->GetTargetView()->GetDocShell()->GetModel()); } else return Any( true );