[Libreoffice-commits] core.git: include/svtools sc/source sd/source svtools/source sw/source

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Fri Jul 23 18:33:39 UTC 2021


 include/svtools/accessibilityoptions.hxx       |    1 -
 sc/source/ui/view/preview.cxx                  |    3 ++-
 sd/source/ui/view/sdview.cxx                   |    6 +++---
 sd/source/ui/view/sdwindow.cxx                 |    5 +++--
 svtools/source/config/accessibilityoptions.cxx |   21 ---------------------
 sw/source/core/txtnode/fntcache.cxx            |    3 ++-
 sw/source/core/view/vdraw.cxx                  |    3 ++-
 sw/source/core/view/viewimp.cxx                |    3 ++-
 sw/source/core/view/viewsh.cxx                 |    3 ++-
 9 files changed, 16 insertions(+), 32 deletions(-)

New commits:
commit 05773428c51c82a365e16589a1f8ca45823c6403
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Fri Jul 23 11:07:28 2021 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Fri Jul 23 20:33:05 2021 +0200

    use officecfg to retrieve GetIsForPagePreviews
    
    Change-Id: I9c7666a4456821e3a2051c8d645183f4e1c5eb55
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119412
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/include/svtools/accessibilityoptions.hxx b/include/svtools/accessibilityoptions.hxx
index 0cc485befb31..2733cfa0e7ee 100644
--- a/include/svtools/accessibilityoptions.hxx
+++ b/include/svtools/accessibilityoptions.hxx
@@ -35,7 +35,6 @@ public:
     virtual ~SvtAccessibilityOptions() override;
 
     // get & set config entries
-    bool        GetIsForPagePreviews() const;
     bool        GetIsAllowAnimatedGraphics() const;
     bool        GetIsAllowAnimatedText() const;
     bool        GetIsAutomaticFontColor() const;
diff --git a/sc/source/ui/view/preview.cxx b/sc/source/ui/view/preview.cxx
index f2faf59edd6b..db8dd50eab18 100644
--- a/sc/source/ui/view/preview.cxx
+++ b/sc/source/ui/view/preview.cxx
@@ -20,6 +20,7 @@
 #include <scitems.hxx>
 #include <editeng/eeitem.hxx>
 
+#include <officecfg/Office/Common.hxx>
 #include <svtools/colorcfg.hxx>
 #include <svx/fmview.hxx>
 #include <editeng/sizeitem.hxx>
@@ -392,7 +393,7 @@ void ScPreview::DoPrint( ScPreviewLocationData* pFillLocation )
         pPrintFunc->SetManualZoom(nZoom);
         pPrintFunc->SetDateTime(aDateTime);
         pPrintFunc->SetClearFlag(true);
-        pPrintFunc->SetUseStyleColor( pScMod->GetAccessOptions().GetIsForPagePreviews() );
+        pPrintFunc->SetUseStyleColor( officecfg::Office::Common::Accessibility::IsForPagePreviews::get() );
 
         pPrintFunc->SetDrawView( pDrawView.get() );
 
diff --git a/sd/source/ui/view/sdview.cxx b/sd/source/ui/view/sdview.cxx
index a4828a390300..c70107905b02 100644
--- a/sd/source/ui/view/sdview.cxx
+++ b/sd/source/ui/view/sdview.cxx
@@ -34,6 +34,7 @@
 
 #include <vcl/settings.hxx>
 
+#include <officecfg/Office/Common.hxx>
 #include <sfx2/dispatch.hxx>
 #include <svx/svdpagv.hxx>
 #include <svx/svdoutl.hxx>
@@ -1010,8 +1011,6 @@ void View::onAccessibilityOptionsChanged()
 
     const StyleSettings& rStyleSettings = pWindow->GetSettings().GetStyleSettings();
 
-    SvtAccessibilityOptions& aAccOptions = getAccessibilityOptions();
-
     if( mpViewSh->GetViewFrame() && mpViewSh->GetViewFrame()->GetDispatcher() )
     {
         sal_uInt16 nOutputSlot, nPreviewSlot;
@@ -1025,7 +1024,8 @@ void View::onAccessibilityOptionsChanged()
             nOutputSlot = SID_OUTPUT_QUALITY_COLOR;
         }
 
-        if( rStyleSettings.GetHighContrastMode() && aAccOptions.GetIsForPagePreviews() )
+        if( rStyleSettings.GetHighContrastMode()
+            && officecfg::Office::Common::Accessibility::IsForPagePreviews::get() )
         {
             nPreviewSlot = SID_PREVIEW_QUALITY_CONTRAST;
         }
diff --git a/sd/source/ui/view/sdwindow.cxx b/sd/source/ui/view/sdwindow.cxx
index 765bf7bed661..c69b0cf3211b 100644
--- a/sd/source/ui/view/sdwindow.cxx
+++ b/sd/source/ui/view/sdwindow.cxx
@@ -42,6 +42,7 @@
 #include <ViewShellBase.hxx>
 #include <uiobject.hxx>
 
+#include <officecfg/Office/Common.hxx>
 #include <sal/log.hxx>
 #include <tools/debug.hxx>
 #include <vcl/commandevent.hxx>
@@ -781,7 +782,6 @@ void Window::DataChanged( const DataChangedEvent& rDCEvt )
         if( mpViewShell )
         {
             const StyleSettings&    rStyleSettings = GetSettings().GetStyleSettings();
-            SvtAccessibilityOptions aAccOptions;
             DrawModeFlags           nOutputMode;
             sal_uInt16              nPreviewSlot;
 
@@ -790,7 +790,8 @@ void Window::DataChanged( const DataChangedEvent& rDCEvt )
             else
                 nOutputMode = sd::OUTPUT_DRAWMODE_COLOR;
 
-            if( rStyleSettings.GetHighContrastMode() && aAccOptions.GetIsForPagePreviews() )
+            if( rStyleSettings.GetHighContrastMode()
+                && officecfg::Office::Common::Accessibility::IsForPagePreviews::get() )
                 nPreviewSlot = SID_PREVIEW_QUALITY_CONTRAST;
             else
                 nPreviewSlot = SID_PREVIEW_QUALITY_COLOR;
diff --git a/svtools/source/config/accessibilityoptions.cxx b/svtools/source/config/accessibilityoptions.cxx
index 9bca2a25d52f..576d43a0b376 100644
--- a/svtools/source/config/accessibilityoptions.cxx
+++ b/svtools/source/config/accessibilityoptions.cxx
@@ -52,7 +52,6 @@ public:
     SvtAccessibilityOptions_Impl();
 
     void        SetVCLSettings();
-    bool        GetIsForPagePreviews() const;
     bool        GetIsHelpTipsDisappear() const;
     bool        GetIsAllowAnimatedGraphics() const;
     bool        GetIsAllowAnimatedText() const;
@@ -98,22 +97,6 @@ SvtAccessibilityOptions_Impl::SvtAccessibilityOptions_Impl()
     }
 }
 
-bool SvtAccessibilityOptions_Impl::GetIsForPagePreviews() const
-{
-    bool                                            bRet = true;
-
-    try
-    {
-        if(m_xNode.is())
-            m_xNode->getPropertyValue("IsForPagePreviews") >>= bRet;
-    }
-    catch(const css::uno::Exception&)
-    {
-        DBG_UNHANDLED_EXCEPTION("svtools.config");
-    }
-    return bRet;
-}
-
 bool SvtAccessibilityOptions_Impl::GetIsHelpTipsDisappear() const
 {
     bool                                            bRet = true;
@@ -375,10 +358,6 @@ SvtAccessibilityOptions::~SvtAccessibilityOptions()
     }
 }
 
-bool SvtAccessibilityOptions::GetIsForPagePreviews() const
-{
-    return sm_pSingleImplConfig->GetIsForPagePreviews();
-}
 bool SvtAccessibilityOptions::GetIsAllowAnimatedGraphics() const
 {
     return sm_pSingleImplConfig->GetIsAllowAnimatedGraphics();
diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx
index 9ceb04851ba1..bf9bb3785678 100644
--- a/sw/source/core/txtnode/fntcache.cxx
+++ b/sw/source/core/txtnode/fntcache.cxx
@@ -23,6 +23,7 @@
 #include <cstdint>
 
 #include <i18nlangtag/mslangid.hxx>
+#include <officecfg/Office/Common.hxx>
 #include <vcl/outdev.hxx>
 #include <vcl/lineinfo.hxx>
 #include <vcl/metric.hxx>
@@ -2689,7 +2690,7 @@ bool SwDrawTextInfo::ApplyAutoColor( vcl::Font* pFont )
                 // here we determine the preferred window text color for painting
                 const SwViewOption* pViewOption = GetShell()->GetViewOptions();
                 if(pViewOption->IsPagePreview() &&
-                        !SW_MOD()->GetAccessibilityOptions().GetIsForPagePreviews())
+                        !officecfg::Office::Common::Accessibility::IsForPagePreviews::get())
                     nNewColor = COL_BLACK;
                 else
                     // we take the font color from the appearance page
diff --git a/sw/source/core/view/vdraw.cxx b/sw/source/core/view/vdraw.cxx
index cbc86e76a1c2..ef739ec61768 100644
--- a/sw/source/core/view/vdraw.cxx
+++ b/sw/source/core/view/vdraw.cxx
@@ -17,6 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include <officecfg/Office/Common.hxx>
 #include <svx/svdmodel.hxx>
 #include <svx/svdpage.hxx>
 #include <swmodule.hxx>
@@ -102,7 +103,7 @@ void SwViewShellImp::PaintLayer( const SdrLayerID _nLayerID,
     DrawModeFlags nOldDrawMode = pOutDev->GetDrawMode();
     if( GetShell()->GetWin() &&
         Application::GetSettings().GetStyleSettings().GetHighContrastMode() &&
-        (!GetShell()->IsPreview()||SW_MOD()->GetAccessibilityOptions().GetIsForPagePreviews()))
+        (!GetShell()->IsPreview() || officecfg::Office::Common::Accessibility::IsForPagePreviews::get()))
     {
         pOutDev->SetDrawMode( nOldDrawMode | DrawModeFlags::SettingsLine | DrawModeFlags::SettingsFill |
                             DrawModeFlags::SettingsText | DrawModeFlags::SettingsGradient );
diff --git a/sw/source/core/view/viewimp.cxx b/sw/source/core/view/viewimp.cxx
index 3cadcfd3556a..16657bb0849a 100644
--- a/sw/source/core/view/viewimp.cxx
+++ b/sw/source/core/view/viewimp.cxx
@@ -29,6 +29,7 @@
 #include <svx/svdpage.hxx>
 #include <accmap.hxx>
 
+#include <officecfg/Office/Common.hxx>
 #include <pagepreviewlayout.hxx>
 #include <comphelper/lok.hxx>
 #include <tools/diagnose_ex.h>
@@ -253,7 +254,7 @@ Color SwViewShellImp::GetRetoucheColor() const
              COL_TRANSPARENT != rSh.GetViewOptions()->GetRetoucheColor() )
             aRet = rSh.GetViewOptions()->GetRetoucheColor();
         else if(rSh.GetViewOptions()->IsPagePreview()  &&
-                    !SW_MOD()->GetAccessibilityOptions().GetIsForPagePreviews())
+                    !officecfg::Office::Common::Accessibility::IsForPagePreviews::get())
             aRet = COL_WHITE;
         else
             aRet = SwViewOption::GetDocColor();
diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index 32a9332f1632..b8b292032db5 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -17,6 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include <officecfg/Office/Common.hxx>
 #include <com/sun/star/accessibility/XAccessible.hpp>
 #include <sfx2/viewfrm.hxx>
 #include <sfx2/progress.hxx>
@@ -2527,7 +2528,7 @@ void SwViewShell::ApplyAccessibilityOptions(SvtAccessibilityOptions const & rAcc
 {
     if (utl::ConfigManager::IsFuzzing())
         return;
-    if (mpOpt->IsPagePreview() && !rAccessibilityOptions.GetIsForPagePreviews())
+    if (mpOpt->IsPagePreview() && !officecfg::Office::Common::Accessibility::IsForPagePreviews::get())
     {
         mpAccOptions->SetAlwaysAutoColor(false);
         mpAccOptions->SetStopAnimatedGraphics(false);


More information about the Libreoffice-commits mailing list