From c1c309d37c5129ef291becd5821d9aff3991a828 Mon Sep 17 00:00:00 2001
From: Stephan Bergmann <sbergman@redhat.com>
Date: Thu, 16 Apr 2015 16:06:43 +0200
Subject: Replace "sc design mode" sal_uInt8 with TriState

...used values were 0, 1, and SC_FORCEMODE_NONE = 0xff

Change-Id: Id6303b77a11d22c3d19cb22c3b5838cc7cec624f
---
 sc/source/ui/inc/prevwsh.hxx   | 4 ++--
 sc/source/ui/inc/tabview.hxx   | 4 +---
 sc/source/ui/inc/tabvwsh.hxx   | 2 +-
 sc/source/ui/view/prevwsh.cxx  | 5 +++--
 sc/source/ui/view/tabview5.cxx | 4 ++--
 sc/source/ui/view/tabvwsh4.cxx | 4 ++--
 6 files changed, 11 insertions(+), 12 deletions(-)

(limited to 'sc')

diff --git a/sc/source/ui/inc/prevwsh.hxx b/sc/source/ui/inc/prevwsh.hxx
index d8bec53db738..b17ff47669cc 100644
--- a/sc/source/ui/inc/prevwsh.hxx
+++ b/sc/source/ui/inc/prevwsh.hxx
@@ -47,7 +47,7 @@ class ScPreviewShell: public SfxViewShell
     vcl::Window*         pCorner;
 
     ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > aSourceData;  // ViewData
-    sal_uInt8           nSourceDesignMode;      // form design mode from TabView
+    TriState        nSourceDesignMode;      // form design mode from TabView
     SvxZoomType     eZoom;
     long            nMaxVertPos;
 
@@ -102,7 +102,7 @@ public:
 
     ::com::sun::star::uno::Sequence < ::com::sun::star::beans::PropertyValue >
                     GetSourceData() const       { return aSourceData; }
-    sal_uInt8           GetSourceDesignMode() const { return nSourceDesignMode; }
+    TriState        GetSourceDesignMode() const { return nSourceDesignMode; }
 
     virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) SAL_OVERRIDE;
 
diff --git a/sc/source/ui/inc/tabview.hxx b/sc/source/ui/inc/tabview.hxx
index 8d6010ab2cdf..ddb45e281de8 100644
--- a/sc/source/ui/inc/tabview.hxx
+++ b/sc/source/ui/inc/tabview.hxx
@@ -60,8 +60,6 @@ namespace chart2 { namespace data {
     struct HighlightedRange;
 }}}}}
 
-#define SC_FORCEMODE_NONE   0xff
-
 //      Help - Window
 
 class ScCornerButton : public vcl::Window
@@ -221,7 +219,7 @@ protected:
     bool            IsDrawTextEdit() const;
     void            DrawEnableAnim(bool bSet);
 
-    void            MakeDrawView( sal_uInt8 nForceDesignMode = SC_FORCEMODE_NONE );
+    void            MakeDrawView( TriState nForceDesignMode = TRISTATE_INDET );
 
     void            HideNoteMarker();
 
diff --git a/sc/source/ui/inc/tabvwsh.hxx b/sc/source/ui/inc/tabvwsh.hxx
index 81e800450180..06476e3fe8d2 100644
--- a/sc/source/ui/inc/tabvwsh.hxx
+++ b/sc/source/ui/inc/tabvwsh.hxx
@@ -182,7 +182,7 @@ private:
     OUString   maScope;
 
 private:
-    void    Construct( sal_uInt8 nForceDesignMode = SC_FORCEMODE_NONE );
+    void    Construct( TriState nForceDesignMode = TRISTATE_INDET );
 
     SfxShell*       GetMySubShell() const;
 
diff --git a/sc/source/ui/view/prevwsh.cxx b/sc/source/ui/view/prevwsh.cxx
index 9760de2aa91f..49500b78eaed 100644
--- a/sc/source/ui/view/prevwsh.cxx
+++ b/sc/source/ui/view/prevwsh.cxx
@@ -152,7 +152,7 @@ ScPreviewShell::ScPreviewShell( SfxViewFrame* pViewFrame,
     SfxViewShell( pViewFrame, SfxViewShellFlags::CAN_PRINT | SfxViewShellFlags::HAS_PRINTOPTIONS ),
     pDocShell( static_cast<ScDocShell*>(pViewFrame->GetObjectShell()) ),
     mpFrameWindow(NULL),
-    nSourceDesignMode( SC_FORCEMODE_NONE ),
+    nSourceDesignMode( TRISTATE_INDET ),
     nMaxVertPos(0),
     pAccessibilityBroadcaster( NULL )
 {
@@ -174,7 +174,8 @@ ScPreviewShell::ScPreviewShell( SfxViewFrame* pViewFrame,
         //  (only if draw view exists)
         SdrView* pDrawView = pTabViewShell->GetSdrView();
         if ( pDrawView )
-            nSourceDesignMode = pDrawView->IsDesignMode();
+            nSourceDesignMode
+                = pDrawView->IsDesignMode() ? TRISTATE_TRUE : TRISTATE_FALSE;
     }
 
     new ScPreviewObj(this);
diff --git a/sc/source/ui/view/tabview5.cxx b/sc/source/ui/view/tabview5.cxx
index 21694cbf3c8e..033fae392d3c 100644
--- a/sc/source/ui/view/tabview5.cxx
+++ b/sc/source/ui/view/tabview5.cxx
@@ -196,7 +196,7 @@ ScTabView::~ScTabView()
     delete pTabControl;
 }
 
-void ScTabView::MakeDrawView( sal_uInt8 nForceDesignMode )
+void ScTabView::MakeDrawView( TriState nForceDesignMode )
 {
     if (!pDrawView)
     {
@@ -226,7 +226,7 @@ void ScTabView::MakeDrawView( sal_uInt8 nForceDesignMode )
 
         //  used when switching back from page preview: restore saved design mode state
         //  (otherwise, keep the default from the draw view ctor)
-        if ( nForceDesignMode != SC_FORCEMODE_NONE )
+        if ( nForceDesignMode != TRISTATE_INDET )
             pDrawView->SetDesignMode( nForceDesignMode );
 
         //  an der FormShell anmelden
diff --git a/sc/source/ui/view/tabvwsh4.cxx b/sc/source/ui/view/tabvwsh4.cxx
index 360e23b1e03b..429314fd7a2e 100644
--- a/sc/source/ui/view/tabvwsh4.cxx
+++ b/sc/source/ui/view/tabvwsh4.cxx
@@ -1447,7 +1447,7 @@ bool ScTabViewShell::KeyInput( const KeyEvent &rKeyEvent )
     return TabKeyInput( rKeyEvent );
 }
 
-void ScTabViewShell::Construct( sal_uInt8 nForceDesignMode )
+void ScTabViewShell::Construct( TriState nForceDesignMode )
 {
     SfxApplication* pSfxApp  = SfxGetpApp();
     ScDocShell* pDocSh = GetViewData().GetDocShell();
@@ -1703,7 +1703,7 @@ ScTabViewShell::ScTabViewShell( SfxViewFrame* pViewFrame,
     //  has to be shown by the sfx. ReadUserData is deferred until the first Activate call.
     //  old DesignMode state from form layer must be restored, too
 
-    sal_uInt8 nForceDesignMode = SC_FORCEMODE_NONE;
+    TriState nForceDesignMode = TRISTATE_INDET;
     if ( pOldSh && pOldSh->ISA( ScPreviewShell ) )
     {
         ScPreviewShell* pPreviewShell = static_cast<ScPreviewShell*>(pOldSh);
-- 
cgit