include/sfx2/viewsh.hxx             |    2 --
 sc/source/ui/inc/tabvwsh.hxx        |    2 --
 sc/source/ui/view/tabvwshc.cxx      |    5 -----
 sd/source/ui/inc/ViewShellBase.hxx  |    2 --
 sd/source/ui/view/ViewShellBase.cxx |   12 ------------
 sfx2/source/appl/appserv.cxx        |   20 ++------------------
 sfx2/source/view/viewsh.cxx         |    6 ------
 sw/inc/view.hxx                     |    2 --
 sw/inc/viewopt.hxx                  |    2 +-
 sw/source/core/view/vnew.cxx        |   17 +----------------
 sw/source/uibase/uiview/viewprt.cxx |   14 --------------
 11 files changed, 4 insertions(+), 80 deletions(-)

New commits:
commit 6ada59c8a8b5e3357577ac00c5249bb61f926a89
Author:     Paris Oplopoios <paris.oplopo...@collabora.com>
AuthorDate: Fri Oct 13 15:55:51 2023 +0300
Commit:     Paris Oplopoios <parisop...@gmail.com>
CommitDate: Fri Oct 13 16:02:11 2023 +0200

    Revert "Make sure views get new themes on .uno:ChangeTheme"
    
    This reverts commit 884fd220d0025a92510d3ff4710c8c517c8f271e.
    
    Change-Id: If32a9d3bd922afe5611e5258987eec9ec685bc8e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157937
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Paris Oplopoios <parisop...@gmail.com>

diff --git a/include/sfx2/viewsh.hxx b/include/sfx2/viewsh.hxx
index 78f75b7067dd..2435caa52a47 100644
--- a/include/sfx2/viewsh.hxx
+++ b/include/sfx2/viewsh.hxx
@@ -409,8 +409,6 @@ public:
     virtual vcl::Window* GetEditWindowForActiveOLEObj() const override;
     /// Get a color config color from this view
     virtual ::Color GetColorConfigColor(svtools::ColorConfigEntry nColorType) 
const;
-    /// Get the color scheme name of this view
-    virtual OUString GetColorConfigName() const;
 
     /// Set the LibreOfficeKit language of this view.
     void SetLOKLanguageTag(const OUString& rBcp47LanguageTag);
diff --git a/sc/source/ui/inc/tabvwsh.hxx b/sc/source/ui/inc/tabvwsh.hxx
index 4bb7b79c9102..e1087d0d8b70 100644
--- a/sc/source/ui/inc/tabvwsh.hxx
+++ b/sc/source/ui/inc/tabvwsh.hxx
@@ -396,8 +396,6 @@ public:
     void NotifyCursor(SfxViewShell* pViewShell) const override;
     /// See SfxViewShell::GetColorConfigColor().
     ::Color GetColorConfigColor(svtools::ColorConfigEntry nColorType) const 
override;
-    /// See SfxViewShell::GetColorConfigName().
-    OUString GetColorConfigName() const override;
     /// Emits a LOK_CALLBACK_INVALIDATE_HEADER for all views whose current tab 
is equal to nCurrentTabIndex
     static void notifyAllViewsHeaderInvalidation(const SfxViewShell* 
pForViewShell, HeaderType eHeaderType, SCTAB nCurrentTabIndex);
     static bool isAnyEditViewInRange(const SfxViewShell* pForViewShell, bool 
bColumns, SCCOLROW nStart, SCCOLROW nEnd);
diff --git a/sc/source/ui/view/tabvwshc.cxx b/sc/source/ui/view/tabvwshc.cxx
index 517a00c8f2e1..3b50da7114cb 100644
--- a/sc/source/ui/view/tabvwshc.cxx
+++ b/sc/source/ui/view/tabvwshc.cxx
@@ -516,11 +516,6 @@ void ScTabViewShell::NotifyCursor(SfxViewShell* 
pOtherShell) const
     return {};
 }
 
-OUString ScTabViewShell::GetColorConfigName() const
-{
-    return GetViewData().GetOptions().GetColorSchemeName();
-}
-
 css::uno::Reference<css::datatransfer::XTransferable2> 
ScTabViewShell::GetClipData(vcl::Window* pWin)
 {
     SfxViewFrame* pViewFrame = nullptr;
diff --git a/sd/source/ui/inc/ViewShellBase.hxx 
b/sd/source/ui/inc/ViewShellBase.hxx
index 71522c7892d4..aa0346ea5b2f 100644
--- a/sd/source/ui/inc/ViewShellBase.hxx
+++ b/sd/source/ui/inc/ViewShellBase.hxx
@@ -223,8 +223,6 @@ public:
     void NotifyCursor(SfxViewShell* pViewShell) const override;
     /// See SfxViewShell::GetColorConfigColor().
     ::Color GetColorConfigColor(svtools::ColorConfigEntry nColorType) const 
override;
-    /// See SfxViewShell::GetColorConfigName().
-    OUString GetColorConfigName() const override;
 
     void setLOKVisibleArea(const ::tools::Rectangle& rArea) { maLOKVisibleArea 
= rArea; }
     virtual ::tools::Rectangle getLOKVisibleArea() const override { return 
maLOKVisibleArea; }
diff --git a/sd/source/ui/view/ViewShellBase.cxx 
b/sd/source/ui/view/ViewShellBase.cxx
index 0f9123f5c374..8b88da65aa1e 100644
--- a/sd/source/ui/view/ViewShellBase.cxx
+++ b/sd/source/ui/view/ViewShellBase.cxx
@@ -1091,18 +1091,6 @@ void ViewShellBase::NotifyCursor(SfxViewShell* 
pOtherShell) const
     return {};
 }
 
-OUString ViewShellBase::GetColorConfigName() const
-{
-    if (DrawViewShell* pCurrentDrawShell = 
dynamic_cast<DrawViewShell*>(GetMainViewShell().get()))
-    {
-        const SdViewOptions& rViewOptions = 
pCurrentDrawShell->GetViewOptions();
-        return rViewOptions.msColorSchemeName;
-    }
-
-    SAL_WARN("sd", "dynamic_cast to DrawViewShell failed");
-    return {};
-}
-
 //===== ViewShellBase::Implementation =========================================
 
 ViewShellBase::Implementation::Implementation (ViewShellBase& rBase)
diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx
index 7c322bc8109a..418bcb88430b 100644
--- a/sfx2/source/appl/appserv.cxx
+++ b/sfx2/source/appl/appserv.cxx
@@ -602,26 +602,10 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq )
                 SAL_WARN("sfx.appl", "FN_CHANGE_THEME: no theme name");
                 break;
             }
-
             const OUString& rSchemeName = pNewThemeArg->GetValue();
             svtools::EditableColorConfig aEditableConfig;
-
-            if (comphelper::LibreOfficeKit::isActive())
-            {
-                SfxViewShell* pCurrentShell = SfxViewShell::Current();
-                if (pCurrentShell && pCurrentShell->GetColorConfigName() != 
rSchemeName)
-                {
-                    aEditableConfig.LoadScheme(rSchemeName);
-                }
-            }
-            else
-            {
-                if (aEditableConfig.GetCurrentSchemeName() != rSchemeName)
-                {
-                    aEditableConfig.LoadScheme(rSchemeName);
-                }
-            }
-
+            if (aEditableConfig.GetCurrentSchemeName() != rSchemeName)
+                aEditableConfig.LoadScheme(rSchemeName);
             break;
         }
 
diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx
index 7fcb8c1920d8..a3b40dd8c7f8 100644
--- a/sfx2/source/view/viewsh.cxx
+++ b/sfx2/source/view/viewsh.cxx
@@ -2975,12 +2975,6 @@ vcl::Window* 
SfxViewShell::GetEditWindowForActiveOLEObj() const
     return {};
 }
 
-OUString SfxViewShell::GetColorConfigName() const
-{
-    SAL_WARN("sfx.view", "SfxViewShell::GetColorConfigName not overriden!");
-    return {};
-}
-
 void SfxViewShell::SetLOKLanguageTag(const OUString& rBcp47LanguageTag)
 {
     LanguageTag aTag(rBcp47LanguageTag, true);
diff --git a/sw/inc/view.hxx b/sw/inc/view.hxx
index b85920437d39..9e31e337206b 100644
--- a/sw/inc/view.hxx
+++ b/sw/inc/view.hxx
@@ -675,8 +675,6 @@ public:
     void NotifyCursor(SfxViewShell* pViewShell) const override;
     /// See SfxViewShell::GetColorConfigColor().
     ::Color GetColorConfigColor(svtools::ColorConfigEntry nColorType) const 
override;
-    /// See SfxViewShell::GetColorConfigName().
-    OUString GetColorConfigName() const override;
     void ShowUIElement(const OUString& sElementURL) const;
 
 
diff --git a/sw/inc/viewopt.hxx b/sw/inc/viewopt.hxx
index 3b667f24871d..6aaf24b65f39 100644
--- a/sw/inc/viewopt.hxx
+++ b/sw/inc/viewopt.hxx
@@ -854,7 +854,7 @@ public:
 
 inline bool SwViewOption::operator==( const SwViewOption &rOpt ) const
 {
-    return IsEqualFlags( rOpt ) && m_nZoom == rOpt.GetZoom() && m_aColorConfig 
== rOpt.m_aColorConfig && m_sThemeName == rOpt.m_sThemeName;
+    return IsEqualFlags( rOpt ) && m_nZoom == rOpt.GetZoom() && m_aColorConfig 
== rOpt.m_aColorConfig;
 }
 
 inline void SwViewOption::SetUIOptions( const SwViewOption& rVOpt )
diff --git a/sw/source/core/view/vnew.cxx b/sw/source/core/view/vnew.cxx
index dc975b023f76..b841134cc21a 100644
--- a/sw/source/core/view/vnew.cxx
+++ b/sw/source/core/view/vnew.cxx
@@ -42,7 +42,6 @@
 #include <ndgrf.hxx>
 #include <ndindex.hxx>
 #include <accessibilityoptions.hxx>
-#include <comphelper/lok.hxx>
 
 void SwViewShell::Init( const SwViewOption *pNewOpt )
 {
@@ -251,21 +250,7 @@ SwViewShell::SwViewShell( SwViewShell& rShell, vcl::Window 
*pWindow,
     bool bModified = mxDoc->getIDocumentState().IsModified();
 
     OutputDevice* pOrigOut = mpOut;
-
-    SwViewOption aNewOpt;
-
-    if ( rShell.GetViewOptions() )
-    {
-        aNewOpt = *rShell.GetViewOptions();
-    }
-
-    if ( comphelper::LibreOfficeKit::isActive() )
-    {
-        // Do not copy the color config in tiled rendering
-        aNewOpt.SetThemeName("Default");
-    }
-
-    Init( &aNewOpt ); // might change Outdev (InitPrt())
+    Init( rShell.GetViewOptions() ); // might change Outdev (InitPrt())
     mpOut = pOrigOut;
 
     if ( mbPreview )
diff --git a/sw/source/uibase/uiview/viewprt.cxx 
b/sw/source/uibase/uiview/viewprt.cxx
index 209b0e324a68..2e6bc417b49e 100644
--- a/sw/source/uibase/uiview/viewprt.cxx
+++ b/sw/source/uibase/uiview/viewprt.cxx
@@ -316,20 +316,6 @@ void SwView::NotifyCursor(SfxViewShell* pViewShell) const
     return {};
 }
 
-OUString SwView::GetColorConfigName() const
-{
-    if (const SwViewOption* pViewOptions = GetWrtShell().GetViewOptions())
-    {
-        return pViewOptions->GetThemeName();
-    }
-    else
-    {
-        SAL_WARN("sw", "GetViewOptions() returned nullptr");
-    }
-
-    return {};
-}
-
 // Create page printer/additions for SwView and SwPagePreview
 
 std::unique_ptr<SfxTabPage> CreatePrintOptionsPage(weld::Container* pPage, 
weld::DialogController* pController,

Reply via email to