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
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;
......
......@@ -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();
......
......@@ -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;
......
......@@ -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);
......
......@@ -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
......
......@@ -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);
......
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