summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorParis Oplopoios <paris.oplopoios@collabora.com>2023-07-26 17:20:59 +0300
committerMiklos Vajna <vmiklos@collabora.com>2023-07-31 09:33:11 +0200
commit8920dddd8096888a22274d4c3e9ab79d897d40ac (patch)
tree49eddb060407b88cef49a6f78159408a4528be34 /sd
parent893c42c07f1f76a487f95f9ffb551611bb2cff85 (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>
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/inc/unomodel.hxx2
-rw-r--r--sd/source/ui/unoidl/unomodel.cxx15
2 files changed, 14 insertions, 3 deletions
diff --git a/sd/source/ui/inc/unomodel.hxx b/sd/source/ui/inc/unomodel.hxx
index 3b00f1cb8d90..a2fe9415afa4 100644
--- a/sd/source/ui/inc/unomodel.hxx
+++ b/sd/source/ui/inc/unomodel.hxx
@@ -285,7 +285,7 @@ public:
virtual void setPaintTextEdit(bool bPaint) override { mbPaintTextEdit = bPaint; }
/// @see vcl::ITiledRenderable::getViewRenderState().
- OString getViewRenderState() override;
+ OString getViewRenderState(SfxViewShell* pViewShell = nullptr) override;
// XComponent
diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx
index 438d2a81faa0..6fc250ec8895 100644
--- a/sd/source/ui/unoidl/unomodel.cxx
+++ b/sd/source/ui/unoidl/unomodel.cxx
@@ -2325,10 +2325,21 @@ void SdXImpressDocument::paintTile( VirtualDevice& rDevice,
comphelper::LibreOfficeKit::setTiledPainting(false);
}
-OString SdXImpressDocument::getViewRenderState()
+OString SdXImpressDocument::getViewRenderState(SfxViewShell* pViewShell)
{
OStringBuffer aState;
- DrawViewShell* pView = GetViewShell();
+ DrawViewShell* pView = nullptr;
+
+ if (pViewShell)
+ {
+ ViewShellBase* pShellBase = dynamic_cast<ViewShellBase*>(pViewShell);
+ pView = dynamic_cast<DrawViewShell*>(pShellBase->GetMainViewShell().get());
+ }
+ else
+ {
+ pView = GetViewShell();
+ }
+
if (pView)
{
const SdViewOptions& pVOpt = pView->GetViewOptions();