From a3eca22f5d1bc1848b6716fdd688f5f165ef5771 Mon Sep 17 00:00:00 2001
From: Björn Milcke <bm@openoffice.org>
Date: Thu, 1 Aug 2002 10:41:27 +0000
Subject: #101126# support high-contrast mode (change draw-mode)

---
 sfx2/source/doc/new.cxx | 31 +++++++++++++++++++++++++++++--
 1 file changed, 29 insertions(+), 2 deletions(-)

(limited to 'sfx2')

diff --git a/sfx2/source/doc/new.cxx b/sfx2/source/doc/new.cxx
index 41ddd67d8a74..fdfbc967d729 100644
--- a/sfx2/source/doc/new.cxx
+++ b/sfx2/source/doc/new.cxx
@@ -2,9 +2,9 @@
  *
  *  $RCSfile: new.cxx,v $
  *
- *  $Revision: 1.8 $
+ *  $Revision: 1.9 $
  *
- *  last change: $Author: mba $ $Date: 2002-07-08 07:38:48 $
+ *  last change: $Author: bm $ $Date: 2002-08-01 11:41:27 $
  *
  *  The Contents of this file are made available subject to the terms of
  *  either of the following licenses
@@ -142,7 +142,15 @@
 #ifndef _SV_WAITOBJ_HXX
 #include <vcl/waitobj.hxx>
 #endif
+#ifndef INCLUDED_SVTOOLS_ACCESSIBILITYOPTIONS_HXX
+#include <svtools/accessibilityoptions.hxx>
+#endif
 
+// Draw modes
+#define OUTPUT_DRAWMODE_COLOR       (DRAWMODE_DEFAULT)
+#define OUTPUT_DRAWMODE_GRAYSCALE   (DRAWMODE_GRAYLINE | DRAWMODE_GRAYFILL | DRAWMODE_BLACKTEXT | DRAWMODE_GRAYBITMAP | DRAWMODE_GRAYGRADIENT)
+#define OUTPUT_DRAWMODE_BLACKWHITE  (DRAWMODE_BLACKLINE | DRAWMODE_BLACKTEXT | DRAWMODE_WHITEFILL | DRAWMODE_GRAYBITMAP | DRAWMODE_WHITEGRADIENT)
+#define OUTPUT_DRAWMODE_CONTRAST    (DRAWMODE_SETTINGSLINE | DRAWMODE_SETTINGSFILL | DRAWMODE_SETTINGSTEXT | DRAWMODE_SETTINGSGRADIENT)
 
 //========================================================================
 
@@ -252,6 +260,11 @@ SfxPreviewWin::SfxPreviewWin(
     : Window(pParent, rResId), rDocShell( rDocSh )
 {
     SetHelpId( HID_PREVIEW_FRAME );
+
+    // adjust contrast mode initially
+    SvtAccessibilityOptions aAccOptions;
+    bool bUseContrast = aAccOptions.GetIsForDrawings() && GetSettings().GetStyleSettings().GetHighContrastMode();
+    SetDrawMode( bUseContrast ? OUTPUT_DRAWMODE_CONTRAST : OUTPUT_DRAWMODE_COLOR );
 }
 
 void SfxPreviewWin::Paint( const Rectangle& rRect )
@@ -261,6 +274,20 @@ void SfxPreviewWin::Paint( const Rectangle& rRect )
     delete pFile;
 }
 
+void SfxPreviewWin::DataChanged( const DataChangedEvent& rDCEvt )
+{
+    Window::DataChanged( rDCEvt );
+
+    if( (rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
+        (rDCEvt.GetFlags() & SETTINGS_STYLE) )
+    {
+        // adjust contrast mode initially
+        SvtAccessibilityOptions aAccOptions;
+        bool bUseContrast = aAccOptions.GetIsForDrawings() && GetSettings().GetStyleSettings().GetHighContrastMode();
+        SetDrawMode( bUseContrast ? OUTPUT_DRAWMODE_CONTRAST : OUTPUT_DRAWMODE_COLOR );
+    }
+}
+
 
 class SfxNewFileDialog_Impl
 {
-- 
cgit