summaryrefslogtreecommitdiff
path: root/sd/source/ui
diff options
context:
space:
mode:
Diffstat (limited to 'sd/source/ui')
-rw-r--r--sd/source/ui/inc/DrawViewShell.hxx5
-rw-r--r--sd/source/ui/inc/unomodel.hxx3
-rw-r--r--sd/source/ui/unoidl/unomodel.cxx16
-rw-r--r--sd/source/ui/view/drviews4.cxx2
-rw-r--r--sd/source/ui/view/drviews5.cxx2
-rw-r--r--sd/source/ui/view/drviewsa.cxx1
-rw-r--r--sd/source/ui/view/drviewsk.cxx25
7 files changed, 48 insertions, 6 deletions
diff --git a/sd/source/ui/inc/DrawViewShell.hxx b/sd/source/ui/inc/DrawViewShell.hxx
index 15f1dc9888c3..d3047cdeaf94 100644
--- a/sd/source/ui/inc/DrawViewShell.hxx
+++ b/sd/source/ui/inc/DrawViewShell.hxx
@@ -28,6 +28,7 @@
#include <unotools/caserotate.hxx>
#include <unotools/options.hxx>
#include <sddllapi.h>
+#include <viewopt.hxx>
namespace svx::sidebar { class SelectionChangeHandler; }
namespace com::sun::star::lang { class XEventListener; }
@@ -373,6 +374,7 @@ public:
bool IsInSwitchPage() const { return mbIsInSwitchPage; }
+ const SdViewOptions& GetViewOptions() const { return maViewOptions; }
//move this method to ViewShell.
//void NotifyAccUpdate();
protected:
@@ -498,8 +500,7 @@ private:
::std::unique_ptr< AnnotationManager > mpAnnotationManager;
::std::unique_ptr< ViewOverlayManager > mpViewOverlayManager;
std::vector<std::unique_ptr<SdrExternalToolEdit>> m_ExternalEdits;
- // The colour of the area behind the slide (used to be called "Wiese")
- Color mnAppBackgroundColor;
+ SdViewOptions maViewOptions;
};
/// Merge the background properties together and deposit the result in rMergeAttr
diff --git a/sd/source/ui/inc/unomodel.hxx b/sd/source/ui/inc/unomodel.hxx
index ba2602b86e60..f31d93b97420 100644
--- a/sd/source/ui/inc/unomodel.hxx
+++ b/sd/source/ui/inc/unomodel.hxx
@@ -284,6 +284,9 @@ public:
/// @see vcl::ITiledRenderable::setPaintTextEdit().
virtual void setPaintTextEdit(bool bPaint) override { mbPaintTextEdit = bPaint; }
+ /// @see vcl::ITiledRenderable::getViewRenderState().
+ OString getViewRenderState() override;
+
// XComponent
/** This dispose implementation releases the resources held by the
diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx
index 37c650d4a465..f53144d14775 100644
--- a/sd/source/ui/unoidl/unomodel.cxx
+++ b/sd/source/ui/unoidl/unomodel.cxx
@@ -2233,6 +2233,7 @@ void SdXImpressDocument::paintTile( VirtualDevice& rDevice,
{
if(SdrPageView* pSdrPageView = pDrawView->GetSdrPageView())
{
+ pSdrPageView->SetApplicationDocumentColor(pViewSh->GetViewOptions().mnDocBackgroundColor);
patchedPageWindow = pSdrPageView->FindPageWindow(*getDocWindow()->GetOutDev());
temporaryPaintWindow.reset(new SdrPaintWindow(*pDrawView, rDevice));
if (patchedPageWindow)
@@ -2301,6 +2302,21 @@ void SdXImpressDocument::paintTile( VirtualDevice& rDevice,
comphelper::LibreOfficeKit::setTiledPainting(false);
}
+OString SdXImpressDocument::getViewRenderState()
+{
+ OStringBuffer aState;
+ DrawViewShell* pView = GetViewShell();
+ if (pView)
+ {
+ const SdViewOptions& pVOpt = pView->GetViewOptions();
+ aState.append(';');
+
+ OString aThemeName = OUStringToOString(pVOpt.msColorSchemeName, RTL_TEXTENCODING_UTF8);
+ aState.append(aThemeName);
+ }
+ return aState.makeStringAndClear();
+}
+
void SdXImpressDocument::selectPart(int nPart, int nSelect)
{
DrawViewShell* pViewSh = GetViewShell();
diff --git a/sd/source/ui/view/drviews4.cxx b/sd/source/ui/view/drviews4.cxx
index b21789c80137..8919a52d380f 100644
--- a/sd/source/ui/view/drviews4.cxx
+++ b/sd/source/ui/view/drviews4.cxx
@@ -401,7 +401,7 @@ void DrawViewShell::MouseMove(const MouseEvent& rMEvt, ::sd::Window* pWin)
if (GetDoc())
{
ConfigureAppBackgroundColor();
- mpDrawView->SetApplicationBackgroundColor( mnAppBackgroundColor );
+ mpDrawView->SetApplicationBackgroundColor( GetViewOptions().mnAppBackgroundColor );
}
ViewShell::MouseMove(rMEvt, pWin);
diff --git a/sd/source/ui/view/drviews5.cxx b/sd/source/ui/view/drviews5.cxx
index 0ad1a18a6c2c..4ca53557cac1 100644
--- a/sd/source/ui/view/drviews5.cxx
+++ b/sd/source/ui/view/drviews5.cxx
@@ -412,7 +412,7 @@ void DrawViewShell::Paint(const ::tools::Rectangle& rRect, ::sd::Window* pWin)
GetDoc()->GetDrawOutliner().SetDefaultLanguage( GetDoc()->GetLanguage( EE_CHAR_LANGUAGE ) );
// Set Application Background color for usage in SdrPaintView(s)
- mpDrawView->SetApplicationBackgroundColor( mnAppBackgroundColor );
+ mpDrawView->SetApplicationBackgroundColor( GetViewOptions().mnAppBackgroundColor );
/* This is done before each text edit, so why not do it before every paint.
The default language is only used if the outliner only contains one
diff --git a/sd/source/ui/view/drviewsa.cxx b/sd/source/ui/view/drviewsa.cxx
index dbc410ca2545..2868c38d6c90 100644
--- a/sd/source/ui/view/drviewsa.cxx
+++ b/sd/source/ui/view/drviewsa.cxx
@@ -129,6 +129,7 @@ DrawViewShell::DrawViewShell( ViewShellBase& rViewShellBase, vcl::Window* pParen
ConfigureAppBackgroundColor();
SD_MOD()->GetColorConfig().AddListener(this);
+ maViewOptions.mnDocBackgroundColor = SD_MOD()->GetColorConfig().GetColorValue(svtools::DOCCOLOR).nColor;
}
DrawViewShell::~DrawViewShell()
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;
}
}