svtools/source/config/colorcfg.cxx |   31 ++++++++++++++++++++++++++++++-
 tools/source/debug/debug.cxx       |    5 ++---
 2 files changed, 32 insertions(+), 4 deletions(-)

New commits:
commit 7b0e8b9c8541250be65ce228b67ff5adb105b732
Author: Bjoern Michaelsen <bjoern.michael...@canonical.com>
Date:   Thu Jan 16 21:42:47 2014 +0100

    fdo#71511: in autodetected a11y HC mode, pull background color from theme
    
    - dark theme default to high contrast
    - as per fdo#35365, having a dark document background is inconvenient
      for non-a11y endusers
      - a11y standard require the (rather ugly) background for a11y
      - thus, when "automatically detect high contract mode of operating
        system"
          in Tools->Options->a11y is enabled, use the dark document
          background
            by default, otherwise use a white default
    
    Change-Id: Id8ad1eb3d57b3708ac5a241092208e3a8d98ade0

diff --git a/svtools/source/config/colorcfg.cxx 
b/svtools/source/config/colorcfg.cxx
index 850bd93..81a1b20 100644
--- a/svtools/source/config/colorcfg.cxx
+++ b/svtools/source/config/colorcfg.cxx
@@ -23,7 +23,9 @@
 #include <com/sun/star/uno/Sequence.hxx>
 #include <com/sun/star/lang/Locale.hpp>
 #include <com/sun/star/beans/PropertyValue.hpp>
+#include <comphelper/processfactory.hxx>
 #include <unotools/configitem.hxx>
+#include <unotools/confignode.hxx>
 #include <unotools/configpaths.hxx>
 #include <com/sun/star/uno/Sequence.h>
 #include <svl/poolitem.hxx>
@@ -64,6 +66,7 @@ class ColorConfig_Impl : public utl::ConfigItem
     sal_Bool            m_bEditMode;
     OUString       m_sIsVisible;
     OUString       m_sLoadedScheme;
+    bool m_bAutoDetectSystemHC;
 
     uno::Sequence< OUString> GetPropertyNames(const OUString& rScheme);
 public:
@@ -91,6 +94,7 @@ public:
     void                            SetModified(){ConfigItem::SetModified();}
     void                            
ClearModified(){ConfigItem::ClearModified();}
     void                            SettingsChanged();
+    bool GetAutoDetectSystemHC() {return m_bAutoDetectSystemHC;}
 
     // #100822#
     DECL_LINK( DataChangedEventListener, VclWindowEvent* );
@@ -183,7 +187,8 @@ uno::Sequence< OUString> 
ColorConfig_Impl::GetPropertyNames(const OUString& rSch
 ColorConfig_Impl::ColorConfig_Impl(sal_Bool bEditMode) :
     ConfigItem("Office.UI/ColorScheme"),
     m_bEditMode(bEditMode),
-    m_sIsVisible("/IsVisible")
+    m_sIsVisible("/IsVisible"),
+    m_bAutoDetectSystemHC(true)
 {
     if(!m_bEditMode)
     {
@@ -237,6 +242,15 @@ void ColorConfig_Impl::Load(const OUString& rScheme)
         if(pColorNames[nIndex].match(m_sIsVisible, 
pColorNames[nIndex].getLength() - m_sIsVisible.getLength()))
              m_aConfigValues[i / 2].bIsVisible = Any2Bool(pColors[nIndex++]);
     }
+    // fdo#71511: check if we are running in a11y autodetect
+    {
+        utl::OConfigurationNode aNode = 
utl::OConfigurationTreeRoot::tryCreateWithComponentContext(comphelper::getProcessComponentContext(),OUString("org.openoffice.Office.Common/Accessibility")
 );
+        if(aNode.isValid())
+        {
+            uno::Any aValue = 
aNode.getNodeValue(OUString("AutoDetectSystemHC"));
+            aValue >>= m_bAutoDetectSystemHC;
+        }
+    }
 }
 
 void    ColorConfig_Impl::Notify( const uno::Sequence<OUString>& )
@@ -466,6 +480,21 @@ Color ColorConfig::GetDefaultColor(ColorConfigEntry eEntry)
         default:
             aRet = aAutoColors[eEntry];
     }
+    // fdo#71511: if in autodetected a11y HC mode, do pull background color 
from theme
+    if(m_pImpl &&  m_pImpl->GetAutoDetectSystemHC())
+    {
+        switch(eEntry)
+        {
+            case DOCCOLOR :
+                aRet = 
Application::GetSettings().GetStyleSettings().GetWindowColor();
+                break;
+            case FONTCOLOR :
+                aRet = 
Application::GetSettings().GetStyleSettings().GetWindowTextColor();
+                break;
+            default:
+                break;
+        }
+    }
     return aRet;
 }
 
commit 43bfe1ecb8fe8fb3ed37d2b0d6ab2246e5ab55ba
Author: Bjoern Michaelsen <bjoern.michael...@canonical.com>
Date:   Thu Jan 16 21:35:41 2014 +0100

    always build an empty DbgUnhandledException, to allow debug=t builds 
without --enable-dbgutils

diff --git a/tools/source/debug/debug.cxx b/tools/source/debug/debug.cxx
index 19e789c..4a148b4 100644
--- a/tools/source/debug/debug.cxx
+++ b/tools/source/debug/debug.cxx
@@ -1588,10 +1588,9 @@ void DbgOutf( const sal_Char*, ... ) {}
 #endif
 
 
-#if OSL_DEBUG_LEVEL > 0
-
 TOOLS_DLLPUBLIC void DbgUnhandledException(const css::uno::Any & caught, const 
char* currentFunction, const char* fileAndLineNo)
 {
+#if OSL_DEBUG_LEVEL > 0
         OString sMessage( "caught an exception!" );
         sMessage += "\nin function:";
         sMessage += currentFunction;
@@ -1633,9 +1632,9 @@ TOOLS_DLLPUBLIC void DbgUnhandledException(const 
css::uno::Any & caught, const c
         SAL_DETAIL_LOG_FORMAT(
             SAL_DETAIL_ENABLE_LOG_WARN, SAL_DETAIL_LOG_LEVEL_WARN,
             "legacy.osl", fileAndLineNo, "%s", sMessage.getStr());
+#endif
 }
 
-#endif  // OSL_DEBUG_LEVEL
 
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to