diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2024-12-17 11:17:13 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2024-12-17 13:15:32 +0100 |
commit | 7d1b00c9924765624e0e3e5bdf947f3e30317ff8 (patch) | |
tree | 97178f0a6b1f8ade39ad33fbc39a2bae0875620e /sw/source/ui | |
parent | 37edf62981acf8b73a70d645755e8cdbc9bbcd3f (diff) |
use more concrete UNO in sw
Change-Id: I664c7eff512625f988a2a278062719d3084845dd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178645
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/ui')
-rw-r--r-- | sw/source/ui/dbui/mmlayoutpage.cxx | 5 | ||||
-rw-r--r-- | sw/source/ui/index/cntex.cxx | 21 |
2 files changed, 10 insertions, 16 deletions
diff --git a/sw/source/ui/dbui/mmlayoutpage.cxx b/sw/source/ui/dbui/mmlayoutpage.cxx index e4fc8b02b1fd..4948cdfe5c59 100644 --- a/sw/source/ui/dbui/mmlayoutpage.cxx +++ b/sw/source/ui/dbui/mmlayoutpage.cxx @@ -591,12 +591,11 @@ IMPL_LINK_NOARG(SwMailMergeLayoutPage, PreviewLoadedHdl_Impl, SwOneExampleFrame& { m_xExampleContainerWIN->show(); - Reference< XModel > & xModel = m_xExampleFrame->GetModel(); + rtl::Reference< SwXTextDocument > & xModel = m_xExampleFrame->GetModel(); //now the ViewOptions should be set properly Reference< XViewSettingsSupplier > xSettings(xModel->getCurrentController(), UNO_QUERY); m_xViewProperties = xSettings->getViewSettings(); - auto pXDoc = comphelper::getFromUnoTunnel<SwXTextDocument>(xModel); - SwDocShell* pDocShell = pXDoc->GetDocShell(); + SwDocShell* pDocShell = xModel->GetDocShell(); m_pExampleWrtShell = pDocShell->GetWrtShell(); OSL_ENSURE(m_pExampleWrtShell, "No SwWrtShell found!"); if(!m_pExampleWrtShell) diff --git a/sw/source/ui/index/cntex.cxx b/sw/source/ui/index/cntex.cxx index 663926af3fe9..b83d453c3844 100644 --- a/sw/source/ui/index/cntex.cxx +++ b/sw/source/ui/index/cntex.cxx @@ -39,6 +39,7 @@ #include <SwStyleNameMapper.hxx> #include <swuicnttab.hxx> +#include <unoidxcoll.hxx> using namespace ::com::sun::star; using namespace ::com::sun::star::text; @@ -86,16 +87,13 @@ IMPL_LINK_NOARG(SwMultiTOXTabDialog, CreateExample_Hdl, SwOneExampleFrame&, void { try { - uno::Reference< frame::XModel > & xModel = m_xExampleFrame->GetModel(); - auto pDoc = comphelper::getFromUnoTunnel<SwXTextDocument>(xModel); + rtl::Reference< SwXTextDocument > & xDoc = m_xExampleFrame->GetModel(); - if( pDoc ) - pDoc->GetDocShell()->LoadStyles_( *m_rWrtShell.GetView().GetDocShell(), true ); + if( xDoc ) + xDoc->GetDocShell()->LoadStyles_( *m_rWrtShell.GetView().GetDocShell(), true ); - uno::Reference< text::XTextSectionsSupplier > xSectionSupplier( - xModel, uno::UNO_QUERY); uno::Reference< container::XNameAccess > xSections = - xSectionSupplier->getTextSections(); + xDoc->getTextSections(); for(int i = 0; i < 7; ++i ) { @@ -103,8 +101,7 @@ IMPL_LINK_NOARG(SwMultiTOXTabDialog, CreateExample_Hdl, SwOneExampleFrame&, void uno::Any aSection = xSections->getByName( sTmp ); aSection >>= m_vTypeData[i].m_oIndexSections->xContainerSection; } - uno::Reference< text::XDocumentIndexesSupplier > xIdxSupp(xModel, uno::UNO_QUERY); - uno::Reference< container::XIndexAccess > xIdxs = xIdxSupp->getDocumentIndexes(); + rtl::Reference< SwXDocumentIndexes > xIdxs = xDoc->getSwDocumentIndexes(); int n = xIdxs->getCount(); while(n) { @@ -144,7 +141,7 @@ void SwMultiTOXTabDialog::CreateOrUpdateExample( OSL_ENSURE(m_vTypeData[nTOXIndex].m_oIndexSections && m_vTypeData[nTOXIndex].m_oIndexSections->xContainerSection.is(), "Section not created"); - uno::Reference< frame::XModel > & xModel = m_xExampleFrame->GetModel(); + rtl::Reference< SwXTextDocument > & xModel = m_xExampleFrame->GetModel(); bool bInitialCreate = true; if(!m_vTypeData[nTOXIndex].m_oIndexSections->xDocumentIndex.is()) { @@ -155,11 +152,9 @@ void SwMultiTOXTabDialog::CreateOrUpdateExample( xAnchor = xAnchor->getStart(); uno::Reference< text::XTextCursor > xCursor = xAnchor->getText()->createTextCursorByRange(xAnchor); - uno::Reference< lang::XMultiServiceFactory > xFact(xModel, uno::UNO_QUERY); - OUString sIndexTypeName(OUString::createFromAscii( IndexServiceNames[ nTOXIndex <= TOX_AUTHORITIES ? nTOXIndex : TOX_USER] )); - m_vTypeData[nTOXIndex].m_oIndexSections->xDocumentIndex.set(xFact->createInstance(sIndexTypeName), uno::UNO_QUERY); + m_vTypeData[nTOXIndex].m_oIndexSections->xDocumentIndex.set(xModel->createInstance(sIndexTypeName), uno::UNO_QUERY); uno::Reference< text::XTextContent > xContent = m_vTypeData[nTOXIndex].m_oIndexSections->xDocumentIndex; xCursor->getText()->insertTextContent(xCursor, xContent, false); } |