summaryrefslogtreecommitdiff
path: root/sd/source/ui/view/drviewsk.cxx
diff options
context:
space:
mode:
authorParis Oplopoios <paris.oplopoios@collabora.com>2023-04-12 04:23:56 +0300
committerParis Oplopoios <parisoplop@gmail.com>2023-05-10 13:07:10 +0200
commitfc87b725d5e29f40d78f2ca7c20a2b516bcfa29a (patch)
treea75041663aab254b6387c513b04c50eb80b79dd4 /sd/source/ui/view/drviewsk.cxx
parent6c9b0e2438802980ff31a67286afa453f1d3b4d0 (diff)
Add view options class in Draw
Add SdViewOptions class in Draw to hold the view state and manage view separation in tiled rendering mode Change-Id: I1546fa536555b3262217ff4be163a48b958b7a33 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150249 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com> (cherry picked from commit fa2fdc90d5fba9420cbb475f8c88423124c158ec) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151519 Tested-by: Jenkins Reviewed-by: Paris Oplopoios <parisoplop@gmail.com>
Diffstat (limited to 'sd/source/ui/view/drviewsk.cxx')
-rw-r--r--sd/source/ui/view/drviewsk.cxx25
1 files changed, 23 insertions, 2 deletions
diff --git a/sd/source/ui/view/drviewsk.cxx b/sd/source/ui/view/drviewsk.cxx
index 9daeecc02e4f..673416aff4f7 100644
--- a/sd/source/ui/view/drviewsk.cxx
+++ b/sd/source/ui/view/drviewsk.cxx
@@ -8,15 +8,36 @@
*/
#include <DrawViewShell.hxx>
+#include <ViewShellBase.hxx>
#include <sdmod.hxx>
#include <comphelper/lok.hxx>
+#include <comphelper/servicehelper.hxx>
+#include <sfx2/lokhelper.hxx>
+#include <LibreOfficeKit/LibreOfficeKitEnums.h>
+#include <unomodel.hxx>
namespace sd {
void DrawViewShell::ConfigurationChanged( utl::ConfigurationBroadcaster* pCb, ConfigurationHints )
{
- ConfigureAppBackgroundColor( dynamic_cast<svtools::ColorConfig*>(pCb) );
+ svtools::ColorConfig *pColorConfig = dynamic_cast<svtools::ColorConfig*>(pCb);
+ ConfigureAppBackgroundColor(pColorConfig);
+ SfxViewShell* pCurrentShell = SfxViewShell::Current();
+ if (comphelper::LibreOfficeKit::isActive() && pCurrentShell)
+ {
+ DrawViewShell* pCurrentDrawShell = nullptr;
+ ViewShellBase* pShellBase = dynamic_cast<ViewShellBase*>(pCurrentShell);
+ if(pShellBase)
+ pCurrentDrawShell = dynamic_cast<DrawViewShell*>(pShellBase->GetMainViewShell().get());
+ pCurrentDrawShell->maViewOptions.mnDocBackgroundColor = pColorConfig->GetColorValue(svtools::DOCCOLOR).nColor;
+ pCurrentDrawShell->maViewOptions.msColorSchemeName = pColorConfig->GetCurrentSchemeName();
+ SdXImpressDocument* pDoc = comphelper::getFromUnoTunnel<SdXImpressDocument>(pCurrentShell->GetCurrentDocument());
+ SfxLokHelper::notifyViewRenderState(pCurrentShell, pDoc);
+ Color aFillColor(pColorConfig->GetColorValue(svtools::APPBACKGROUND).nColor);
+ SfxViewShell::Current()->libreOfficeKitViewCallback(LOK_CALLBACK_APPLICATION_BACKGROUND_COLOR,
+ aFillColor.AsRGBHexString().toUtf8());
+ }
}
void DrawViewShell::ConfigureAppBackgroundColor( svtools::ColorConfig *pColorConfig )
@@ -29,7 +50,7 @@ void DrawViewShell::ConfigureAppBackgroundColor( svtools::ColorConfig *pColorCon
// tdf#87905 Use darker background color for master view
if (meEditMode == EditMode::MasterPage)
aFillColor.DecreaseLuminance( 64 );
- mnAppBackgroundColor = aFillColor;
+ maViewOptions.mnAppBackgroundColor = aFillColor;
}
}