diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2023-10-28 20:23:00 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2023-10-28 21:41:24 +0200 |
commit | e7aa16be823877f2273e75a4e8fe646c28b73731 (patch) | |
tree | c3d49fb94d624a36de08969cd5dcf920a47aaec3 /starmath/source/unomodel.cxx | |
parent | 8dda6270f8b9af6fcfba2a3a935612ab5a81c247 (diff) |
Move Impl_Print from SmViewShell to SmDocShell
All functionality is in the latter, anyway. This move allows
to exclude dependency on existing views from SmModel::render.
Change-Id: I3dff855b7f25089439c8afc57904a25a48fd127b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158594
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'starmath/source/unomodel.cxx')
-rw-r--r-- | starmath/source/unomodel.cxx | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/starmath/source/unomodel.cxx b/starmath/source/unomodel.cxx index 114fb29e43d7..73f1c4b17715 100644 --- a/starmath/source/unomodel.cxx +++ b/starmath/source/unomodel.cxx @@ -1018,17 +1018,6 @@ void SAL_CALL SmModel::render( if (xModel != pDocSh->GetModel()) return; - //!! when called via API we may not have an active view - //!! thus we go and look for a view that can be used. - SfxViewShell* pViewSh = SfxViewShell::GetFirst( false /* search non-visible views as well*/, checkSfxViewShell<SmViewShell> ); - while (pViewSh && pViewSh->GetObjectShell() != pDocSh) - pViewSh = SfxViewShell::GetNext( *pViewSh, false /* search non-visible views as well*/, checkSfxViewShell<SmViewShell> ); - SmViewShell *pView = dynamic_cast< SmViewShell *>( pViewSh ); - SAL_WARN_IF( !pView, "starmath", "SmModel::render : no SmViewShell found" ); - - if (!pView) - return; - SmPrinterAccess aPrinterAccess( *pDocSh ); Size aPrtPaperSize; @@ -1072,7 +1061,7 @@ void SAL_CALL SmModel::render( m_pPrintUIOptions.reset(new SmPrintUIOptions); m_pPrintUIOptions->processProperties( rxOptions ); - pView->Impl_Print( *pOut, *m_pPrintUIOptions, OutputRect ); + pDocSh->Impl_Print(*pOut, *m_pPrintUIOptions, OutputRect); // release SmPrintUIOptions when everything is done. // That way, when SmPrintUIOptions is needed again it will read the latest configuration settings in its c-tor. |