Kaydet (Commit) c1c309d3 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Replace "sc design mode" sal_uInt8 with TriState

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

Change-Id: Id6303b77a11d22c3d19cb22c3b5838cc7cec624f
üst b8858399
...@@ -47,7 +47,7 @@ class ScPreviewShell: public SfxViewShell ...@@ -47,7 +47,7 @@ class ScPreviewShell: public SfxViewShell
vcl::Window* pCorner; vcl::Window* pCorner;
::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > aSourceData; // ViewData ::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; SvxZoomType eZoom;
long nMaxVertPos; long nMaxVertPos;
...@@ -102,7 +102,7 @@ public: ...@@ -102,7 +102,7 @@ public:
::com::sun::star::uno::Sequence < ::com::sun::star::beans::PropertyValue > ::com::sun::star::uno::Sequence < ::com::sun::star::beans::PropertyValue >
GetSourceData() const { return aSourceData; } 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; virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) SAL_OVERRIDE;
......
...@@ -60,8 +60,6 @@ namespace chart2 { namespace data { ...@@ -60,8 +60,6 @@ namespace chart2 { namespace data {
struct HighlightedRange; struct HighlightedRange;
}}}}} }}}}}
#define SC_FORCEMODE_NONE 0xff
// Help - Window // Help - Window
class ScCornerButton : public vcl::Window class ScCornerButton : public vcl::Window
...@@ -221,7 +219,7 @@ protected: ...@@ -221,7 +219,7 @@ protected:
bool IsDrawTextEdit() const; bool IsDrawTextEdit() const;
void DrawEnableAnim(bool bSet); void DrawEnableAnim(bool bSet);
void MakeDrawView( sal_uInt8 nForceDesignMode = SC_FORCEMODE_NONE ); void MakeDrawView( TriState nForceDesignMode = TRISTATE_INDET );
void HideNoteMarker(); void HideNoteMarker();
......
...@@ -182,7 +182,7 @@ private: ...@@ -182,7 +182,7 @@ private:
OUString maScope; OUString maScope;
private: private:
void Construct( sal_uInt8 nForceDesignMode = SC_FORCEMODE_NONE ); void Construct( TriState nForceDesignMode = TRISTATE_INDET );
SfxShell* GetMySubShell() const; SfxShell* GetMySubShell() const;
......
...@@ -152,7 +152,7 @@ ScPreviewShell::ScPreviewShell( SfxViewFrame* pViewFrame, ...@@ -152,7 +152,7 @@ ScPreviewShell::ScPreviewShell( SfxViewFrame* pViewFrame,
SfxViewShell( pViewFrame, SfxViewShellFlags::CAN_PRINT | SfxViewShellFlags::HAS_PRINTOPTIONS ), SfxViewShell( pViewFrame, SfxViewShellFlags::CAN_PRINT | SfxViewShellFlags::HAS_PRINTOPTIONS ),
pDocShell( static_cast<ScDocShell*>(pViewFrame->GetObjectShell()) ), pDocShell( static_cast<ScDocShell*>(pViewFrame->GetObjectShell()) ),
mpFrameWindow(NULL), mpFrameWindow(NULL),
nSourceDesignMode( SC_FORCEMODE_NONE ), nSourceDesignMode( TRISTATE_INDET ),
nMaxVertPos(0), nMaxVertPos(0),
pAccessibilityBroadcaster( NULL ) pAccessibilityBroadcaster( NULL )
{ {
...@@ -174,7 +174,8 @@ ScPreviewShell::ScPreviewShell( SfxViewFrame* pViewFrame, ...@@ -174,7 +174,8 @@ ScPreviewShell::ScPreviewShell( SfxViewFrame* pViewFrame,
// (only if draw view exists) // (only if draw view exists)
SdrView* pDrawView = pTabViewShell->GetSdrView(); SdrView* pDrawView = pTabViewShell->GetSdrView();
if ( pDrawView ) if ( pDrawView )
nSourceDesignMode = pDrawView->IsDesignMode(); nSourceDesignMode
= pDrawView->IsDesignMode() ? TRISTATE_TRUE : TRISTATE_FALSE;
} }
new ScPreviewObj(this); new ScPreviewObj(this);
......
...@@ -196,7 +196,7 @@ ScTabView::~ScTabView() ...@@ -196,7 +196,7 @@ ScTabView::~ScTabView()
delete pTabControl; delete pTabControl;
} }
void ScTabView::MakeDrawView( sal_uInt8 nForceDesignMode ) void ScTabView::MakeDrawView( TriState nForceDesignMode )
{ {
if (!pDrawView) if (!pDrawView)
{ {
...@@ -226,7 +226,7 @@ void ScTabView::MakeDrawView( sal_uInt8 nForceDesignMode ) ...@@ -226,7 +226,7 @@ void ScTabView::MakeDrawView( sal_uInt8 nForceDesignMode )
// used when switching back from page preview: restore saved design mode state // used when switching back from page preview: restore saved design mode state
// (otherwise, keep the default from the draw view ctor) // (otherwise, keep the default from the draw view ctor)
if ( nForceDesignMode != SC_FORCEMODE_NONE ) if ( nForceDesignMode != TRISTATE_INDET )
pDrawView->SetDesignMode( nForceDesignMode ); pDrawView->SetDesignMode( nForceDesignMode );
// an der FormShell anmelden // an der FormShell anmelden
......
...@@ -1447,7 +1447,7 @@ bool ScTabViewShell::KeyInput( const KeyEvent &rKeyEvent ) ...@@ -1447,7 +1447,7 @@ bool ScTabViewShell::KeyInput( const KeyEvent &rKeyEvent )
return TabKeyInput( rKeyEvent ); return TabKeyInput( rKeyEvent );
} }
void ScTabViewShell::Construct( sal_uInt8 nForceDesignMode ) void ScTabViewShell::Construct( TriState nForceDesignMode )
{ {
SfxApplication* pSfxApp = SfxGetpApp(); SfxApplication* pSfxApp = SfxGetpApp();
ScDocShell* pDocSh = GetViewData().GetDocShell(); ScDocShell* pDocSh = GetViewData().GetDocShell();
...@@ -1703,7 +1703,7 @@ ScTabViewShell::ScTabViewShell( SfxViewFrame* pViewFrame, ...@@ -1703,7 +1703,7 @@ ScTabViewShell::ScTabViewShell( SfxViewFrame* pViewFrame,
// has to be shown by the sfx. ReadUserData is deferred until the first Activate call. // 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 // 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 ) ) if ( pOldSh && pOldSh->ISA( ScPreviewShell ) )
{ {
ScPreviewShell* pPreviewShell = static_cast<ScPreviewShell*>(pOldSh); ScPreviewShell* pPreviewShell = static_cast<ScPreviewShell*>(pOldSh);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment