summaryrefslogtreecommitdiff
path: root/sc/source/ui/docshell/docsh.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2023-01-12 10:19:24 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2023-01-12 14:46:29 +0000
commit0ef626f2ff72c62ee42e74e2b58174c047e384cd (patch)
tree340e7159b07866c884a776282726af8a8a8e16b5 /sc/source/ui/docshell/docsh.cxx
parent5fd2f0b93bd7d38a277823bfc251c71da7a6f490 (diff)
override GetModel in ScDocShell
so we can avoid dynamic_cast and XUnoTunnel in various places Change-Id: I1f524270a8030106a2058691c3d89b90d46ed26f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145391 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source/ui/docshell/docsh.cxx')
-rw-r--r--sc/source/ui/docshell/docsh.cxx6
1 files changed, 2 insertions, 4 deletions
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index 2f2f3521ae4e..071c2530f61b 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -503,8 +503,7 @@ bool ScDocShell::LoadXML( SfxMedium* pLoadMedium, const css::uno::Reference< css
//if the document was not generated by LibreOffice, do hard recalc in case some other document
//generator saved cached formula results that differ from LibreOffice's calculated results or
//did not use cached formula results.
- uno::Reference<document::XDocumentPropertiesSupplier> xDPS(GetModel(), uno::UNO_QUERY_THROW);
- uno::Reference<document::XDocumentProperties> xDocProps = xDPS->getDocumentProperties();
+ uno::Reference<document::XDocumentProperties> xDocProps = GetModel()->getDocumentProperties();
ScRecalcOptions nRecalcMode =
static_cast<ScRecalcOptions>(officecfg::Office::Calc::Formula::Load::ODFRecalcMode::get());
@@ -896,7 +895,6 @@ void ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
bChangedViewSettings = true;
}
- uno::Reference< frame::XStorable > xStor( GetModel(), uno::UNO_QUERY_THROW );
// TODO/LATER: More entries from the MediaDescriptor might be interesting for the merge
uno::Sequence< beans::PropertyValue > aValues{
comphelper::makePropertyValue(
@@ -922,7 +920,7 @@ void ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint )
}
SC_MOD()->SetInSharedDocSaving( true );
- xStor->storeToURL( GetSharedFileURL(), aValues );
+ GetModel()->storeToURL( GetSharedFileURL(), aValues );
SC_MOD()->SetInSharedDocSaving( false );
if ( bChangedViewSettings )