summaryrefslogtreecommitdiff
path: root/sc/source/ui/unoobj
diff options
context:
space:
mode:
authorParis Oplopoios <paris.oplopoios@collabora.com>2023-07-26 17:20:59 +0300
committerParis Oplopoios <parisoplop@gmail.com>2023-08-01 13:49:06 +0200
commit0004de149269ed2ab5423947b9930653f3da6038 (patch)
tree96532c04c136023b81d0572c37fab6c4c8b78414 /sc/source/ui/unoobj
parentf9631765c9dfd805ae486a94eacb69d307c9eef1 (diff)
Allow getViewRenderState to get from a specific view
getViewRenderState would get its output from the current view, make it so that it's possible to specify a specific view Change-Id: I279b215f8311b079c220c79b8b41c76bc0210154 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154943 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com> (cherry picked from commit eff5643dbc5bb9dfede530e8e07261bb9bdc98f0) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155046 Tested-by: Jenkins Reviewed-by: Paris Oplopoios <parisoplop@gmail.com>
Diffstat (limited to 'sc/source/ui/unoobj')
-rw-r--r--sc/source/ui/unoobj/docuno.cxx15
1 files changed, 13 insertions, 2 deletions
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index 66c2667a1a1f..fe1cf4dbe6b3 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -1254,10 +1254,21 @@ void ScModelObj::completeFunction(const OUString& rFunctionName)
}
}
-OString ScModelObj::getViewRenderState()
+OString ScModelObj::getViewRenderState(SfxViewShell* pViewShell)
{
OStringBuffer aState;
- ScViewData* pViewData = ScDocShell::GetViewData();
+ ScViewData* pViewData = nullptr;
+
+ if (pViewShell)
+ {
+ ScTabViewShell* pTabViewShell = dynamic_cast< ScTabViewShell*>(pViewShell);
+ if (pTabViewShell)
+ pViewData = &pTabViewShell->GetViewData();
+ }
+ else
+ {
+ pViewData = ScDocShell::GetViewData();
+ }
if (pViewData)
{