Kaydet (Commit) 482ac12a authored tarafından Caolán McNamara's avatar Caolán McNamara

member can be a ref instead of a pointer

Change-Id: Idb0c27933b42f3aef65f0bce098f9bd7a81dc034
üst 4f75ad50
...@@ -104,7 +104,7 @@ void FuConstArc::Activate() ...@@ -104,7 +104,7 @@ void FuConstArc::Activate()
pView->SetCurrentObj( sal::static_int_cast<sal_uInt16>( aObjKind ) ); pView->SetCurrentObj( sal::static_int_cast<sal_uInt16>( aObjKind ) );
aOldPointer = pWindow->GetPointer(); aOldPointer = pWindow->GetPointer();
pViewShell->SetActivePointer( aNewPointer ); rViewShell.SetActivePointer( aNewPointer );
FuDraw::Activate(); FuDraw::Activate();
} }
...@@ -112,7 +112,7 @@ void FuConstArc::Activate() ...@@ -112,7 +112,7 @@ void FuConstArc::Activate()
void FuConstArc::Deactivate() void FuConstArc::Deactivate()
{ {
FuDraw::Deactivate(); FuDraw::Deactivate();
pViewShell->SetActivePointer( aOldPointer ); rViewShell.SetActivePointer( aOldPointer );
} }
// Create default drawing objects via keyboard // Create default drawing objects via keyboard
......
...@@ -108,7 +108,7 @@ void FuConstCustomShape::Activate() ...@@ -108,7 +108,7 @@ void FuConstCustomShape::Activate()
aNewPointer = Pointer( PointerStyle::DrawRect ); aNewPointer = Pointer( PointerStyle::DrawRect );
aOldPointer = pWindow->GetPointer(); aOldPointer = pWindow->GetPointer();
pViewShell->SetActivePointer( aNewPointer ); rViewShell.SetActivePointer( aNewPointer );
SdrLayer* pLayer = pView->GetModel()->GetLayerAdmin().GetLayerPerID(SC_LAYER_CONTROLS); SdrLayer* pLayer = pView->GetModel()->GetLayerAdmin().GetLayerPerID(SC_LAYER_CONTROLS);
if (pLayer) if (pLayer)
...@@ -125,7 +125,7 @@ void FuConstCustomShape::Deactivate() ...@@ -125,7 +125,7 @@ void FuConstCustomShape::Deactivate()
if (pLayer) if (pLayer)
pView->SetActiveLayer( pLayer->GetName() ); pView->SetActiveLayer( pLayer->GetName() );
pViewShell->SetActivePointer( aOldPointer ); rViewShell.SetActivePointer( aOldPointer );
} }
// Create default drawing objects via keyboard // Create default drawing objects via keyboard
......
...@@ -158,7 +158,7 @@ void FuConstPolygon::Activate() ...@@ -158,7 +158,7 @@ void FuConstPolygon::Activate()
aNewPointer = Pointer( PointerStyle::DrawPolygon ); aNewPointer = Pointer( PointerStyle::DrawPolygon );
aOldPointer = pWindow->GetPointer(); aOldPointer = pWindow->GetPointer();
pViewShell->SetActivePointer( aNewPointer ); rViewShell.SetActivePointer( aNewPointer );
} }
void FuConstPolygon::Deactivate() void FuConstPolygon::Deactivate()
...@@ -169,7 +169,7 @@ void FuConstPolygon::Deactivate() ...@@ -169,7 +169,7 @@ void FuConstPolygon::Deactivate()
FuConstruct::Deactivate(); FuConstruct::Deactivate();
pViewShell->SetActivePointer( aOldPointer ); rViewShell.SetActivePointer( aOldPointer );
} }
// Create default drawing objects via keyboard // Create default drawing objects via keyboard
......
...@@ -207,7 +207,7 @@ void FuConstRectangle::Activate() ...@@ -207,7 +207,7 @@ void FuConstRectangle::Activate()
pView->SetCurrentObj(sal::static_int_cast<sal_uInt16>(aObjKind)); pView->SetCurrentObj(sal::static_int_cast<sal_uInt16>(aObjKind));
aOldPointer = pWindow->GetPointer(); aOldPointer = pWindow->GetPointer();
pViewShell->SetActivePointer( aNewPointer ); rViewShell.SetActivePointer( aNewPointer );
FuConstruct::Activate(); FuConstruct::Activate();
} }
...@@ -347,7 +347,7 @@ void FuConstRectangle::SetLineEnds(SfxItemSet& rAttr, const SdrObject& rObj, sal ...@@ -347,7 +347,7 @@ void FuConstRectangle::SetLineEnds(SfxItemSet& rAttr, const SdrObject& rObj, sal
void FuConstRectangle::Deactivate() void FuConstRectangle::Deactivate()
{ {
FuConstruct::Deactivate(); FuConstruct::Deactivate();
pViewShell->SetActivePointer( aOldPointer ); rViewShell.SetActivePointer( aOldPointer );
} }
// Create default drawing objects via keyboard // Create default drawing objects via keyboard
......
...@@ -53,7 +53,7 @@ FuConstruct::~FuConstruct() ...@@ -53,7 +53,7 @@ FuConstruct::~FuConstruct()
Point FuConstruct::CurrentGridSyncOffsetAndPos( Point& rInOutPos ) Point FuConstruct::CurrentGridSyncOffsetAndPos( Point& rInOutPos )
{ {
Point aRetGridOff; Point aRetGridOff;
ScViewData& rViewData = pViewShell->GetViewData(); ScViewData& rViewData = rViewShell.GetViewData();
ScDocument* pDoc = rViewData.GetDocument(); ScDocument* pDoc = rViewData.GetDocument();
if ( pDoc ) if ( pDoc )
{ {
...@@ -71,7 +71,7 @@ Point FuConstruct::CurrentGridSyncOffsetAndPos( Point& rInOutPos ) ...@@ -71,7 +71,7 @@ Point FuConstruct::CurrentGridSyncOffsetAndPos( Point& rInOutPos )
ScSplitPos eWhich = rViewData.GetActivePart(); ScSplitPos eWhich = rViewData.GetActivePart();
ScGridWindow* pGridWin = rViewData.GetActiveWin(); ScGridWindow* pGridWin = rViewData.GetActiveWin();
// and equiv screen pos // and equiv screen pos
Point aScreenPos = pViewShell->GetViewData().GetScrPos( aOldStt.Col(), aOldStt.Row(), eWhich, true ); Point aScreenPos = rViewShell.GetViewData().GetScrPos( aOldStt.Col(), aOldStt.Row(), eWhich, true );
MapMode aDrawMode = pGridWin->GetDrawMapMode(); MapMode aDrawMode = pGridWin->GetDrawMapMode();
Point aCurPosHmm = pGridWin->PixelToLogic(aScreenPos, aDrawMode ); Point aCurPosHmm = pGridWin->PixelToLogic(aScreenPos, aDrawMode );
Point aOff = ( rInOutPos - aCurPosHmm ); Point aOff = ( rInOutPos - aCurPosHmm );
...@@ -161,15 +161,15 @@ bool FuConstruct::MouseMove(const MouseEvent& rMEvt) ...@@ -161,15 +161,15 @@ bool FuConstruct::MouseMove(const MouseEvent& rMEvt)
if ( pHdl != nullptr ) if ( pHdl != nullptr )
{ {
pViewShell->SetActivePointer(pHdl->GetPointer()); rViewShell.SetActivePointer(pHdl->GetPointer());
} }
else if ( pView->IsMarkedHit(aPnt) ) else if ( pView->IsMarkedHit(aPnt) )
{ {
pViewShell->SetActivePointer(Pointer(PointerStyle::Move)); rViewShell.SetActivePointer(Pointer(PointerStyle::Move));
} }
else else
{ {
pViewShell->SetActivePointer( aNewPointer ); rViewShell.SetActivePointer( aNewPointer );
} }
} }
return true; return true;
...@@ -202,11 +202,11 @@ bool FuConstruct::MouseButtonUp(const MouseEvent& rMEvt) ...@@ -202,11 +202,11 @@ bool FuConstruct::MouseButtonUp(const MouseEvent& rMEvt)
bool bVertical = ( pOPO && pOPO->IsVertical() ); bool bVertical = ( pOPO && pOPO->IsVertical() );
sal_uInt16 nTextSlotId = bVertical ? SID_DRAW_TEXT_VERTICAL : SID_DRAW_TEXT; sal_uInt16 nTextSlotId = bVertical ? SID_DRAW_TEXT_VERTICAL : SID_DRAW_TEXT;
pViewShell->GetViewData().GetDispatcher(). rViewShell.GetViewData().GetDispatcher().
Execute(nTextSlotId, SfxCallMode::SLOT | SfxCallMode::RECORD); Execute(nTextSlotId, SfxCallMode::SLOT | SfxCallMode::RECORD);
// Get the created FuText now and change into EditModus // Get the created FuText now and change into EditModus
FuPoor* pPoor = pViewShell->GetViewData().GetView()->GetDrawFuncPtr(); FuPoor* pPoor = rViewShell.GetViewData().GetView()->GetDrawFuncPtr();
if ( pPoor && pPoor->GetSlotID() == nTextSlotId ) // has no RTTI if ( pPoor && pPoor->GetSlotID() == nTextSlotId ) // has no RTTI
{ {
FuText* pText = static_cast<FuText*>(pPoor); FuText* pText = static_cast<FuText*>(pPoor);
...@@ -253,7 +253,7 @@ bool FuConstruct::SimpleMouseButtonUp(const MouseEvent& rMEvt) ...@@ -253,7 +253,7 @@ bool FuConstruct::SimpleMouseButtonUp(const MouseEvent& rMEvt)
{ {
pView->MarkObj(aPnt, -2, false, rMEvt.IsMod1()); pView->MarkObj(aPnt, -2, false, rMEvt.IsMod1());
SfxDispatcher& rDisp = pViewShell->GetViewData().GetDispatcher(); SfxDispatcher& rDisp = rViewShell.GetViewData().GetDispatcher();
if ( pView->AreObjectsMarked() ) if ( pView->AreObjectsMarked() )
rDisp.Execute(SID_OBJECT_SELECT, SfxCallMode::SLOT | SfxCallMode::RECORD); rDisp.Execute(SID_OBJECT_SELECT, SfxCallMode::SLOT | SfxCallMode::RECORD);
else else
...@@ -280,7 +280,7 @@ bool FuConstruct::KeyInput(const KeyEvent& rKEvt) ...@@ -280,7 +280,7 @@ bool FuConstruct::KeyInput(const KeyEvent& rKEvt)
} }
else // end drawing mode else // end drawing mode
{ {
pViewShell->GetViewData().GetDispatcher(). rViewShell.GetViewData().GetDispatcher().
Execute(aSfxRequest.GetSlot(), SfxCallMode::SLOT | SfxCallMode::RECORD); Execute(aSfxRequest.GetSlot(), SfxCallMode::SLOT | SfxCallMode::RECORD);
} }
break; break;
......
...@@ -85,7 +85,7 @@ void FuConstUnoControl::Activate() ...@@ -85,7 +85,7 @@ void FuConstUnoControl::Activate()
aNewPointer = Pointer( PointerStyle::DrawRect ); aNewPointer = Pointer( PointerStyle::DrawRect );
aOldPointer = pWindow->GetPointer(); aOldPointer = pWindow->GetPointer();
pViewShell->SetActivePointer( aNewPointer ); rViewShell.SetActivePointer( aNewPointer );
SdrLayer* pLayer = pView->GetModel()->GetLayerAdmin().GetLayerPerID(SC_LAYER_CONTROLS); SdrLayer* pLayer = pView->GetModel()->GetLayerAdmin().GetLayerPerID(SC_LAYER_CONTROLS);
if (pLayer) if (pLayer)
...@@ -102,7 +102,7 @@ void FuConstUnoControl::Deactivate() ...@@ -102,7 +102,7 @@ void FuConstUnoControl::Deactivate()
if (pLayer) if (pLayer)
pView->SetActiveLayer( pLayer->GetName() ); pView->SetActiveLayer( pLayer->GetName() );
pViewShell->SetActivePointer( aOldPointer ); rViewShell.SetActivePointer( aOldPointer );
} }
// Create default drawing objects via keyboard // Create default drawing objects via keyboard
......
...@@ -88,7 +88,7 @@ void FuDraw::ResetModifiers() ...@@ -88,7 +88,7 @@ void FuDraw::ResetModifiers()
if (!pView) if (!pView)
return; return;
ScViewData& rViewData = pViewShell->GetViewData(); ScViewData& rViewData = rViewShell.GetViewData();
const ScViewOptions& rOpt = rViewData.GetOptions(); const ScViewOptions& rOpt = rViewData.GetOptions();
const ScGridOptions& rGrid = rOpt.GetGridOptions(); const ScGridOptions& rGrid = rOpt.GetGridOptions();
bool bGridOpt = rGrid.GetUseGridSnap(); bool bGridOpt = rGrid.GetUseGridSnap();
...@@ -138,7 +138,7 @@ bool FuDraw::MouseButtonUp(const MouseEvent& rMEvt) ...@@ -138,7 +138,7 @@ bool FuDraw::MouseButtonUp(const MouseEvent& rMEvt)
} }
// Process Keyboard events. Return true if an event is being handled // Process Keyboard events. Return true if an event is being handled
static bool lcl_KeyEditMode( SdrObject* pObj, ScTabViewShell* pViewShell, const KeyEvent* pInitialKey ) static bool lcl_KeyEditMode( SdrObject* pObj, ScTabViewShell& rViewShell, const KeyEvent* pInitialKey )
{ {
bool bReturn = false; bool bReturn = false;
if ( pObj && dynamic_cast<const SdrTextObj*>( pObj) != nullptr && dynamic_cast<const SdrUnoObj*>( pObj) == nullptr ) if ( pObj && dynamic_cast<const SdrTextObj*>( pObj) != nullptr && dynamic_cast<const SdrUnoObj*>( pObj) == nullptr )
...@@ -151,15 +151,15 @@ static bool lcl_KeyEditMode( SdrObject* pObj, ScTabViewShell* pViewShell, const ...@@ -151,15 +151,15 @@ static bool lcl_KeyEditMode( SdrObject* pObj, ScTabViewShell* pViewShell, const
sal_uInt16 nTextSlotId = bVertical ? SID_DRAW_TEXT_VERTICAL : SID_DRAW_TEXT; sal_uInt16 nTextSlotId = bVertical ? SID_DRAW_TEXT_VERTICAL : SID_DRAW_TEXT;
// don't switch shells if text shell is already active // don't switch shells if text shell is already active
FuPoor* pPoor = pViewShell->GetViewData().GetView()->GetDrawFuncPtr(); FuPoor* pPoor = rViewShell.GetViewData().GetView()->GetDrawFuncPtr();
if ( !pPoor || pPoor->GetSlotID() != nTextSlotId ) if ( !pPoor || pPoor->GetSlotID() != nTextSlotId )
{ {
pViewShell->GetViewData().GetDispatcher(). rViewShell.GetViewData().GetDispatcher().
Execute(nTextSlotId, SfxCallMode::SYNCHRON | SfxCallMode::RECORD); Execute(nTextSlotId, SfxCallMode::SYNCHRON | SfxCallMode::RECORD);
} }
// get the resulting FuText and set in edit mode // get the resulting FuText and set in edit mode
pPoor = pViewShell->GetViewData().GetView()->GetDrawFuncPtr(); pPoor = rViewShell.GetViewData().GetView()->GetDrawFuncPtr();
if ( pPoor && pPoor->GetSlotID() == nTextSlotId ) // no RTTI if ( pPoor && pPoor->GetSlotID() == nTextSlotId ) // no RTTI
{ {
FuText* pText = static_cast<FuText*>(pPoor); FuText* pText = static_cast<FuText*>(pPoor);
...@@ -174,18 +174,18 @@ static bool lcl_KeyEditMode( SdrObject* pObj, ScTabViewShell* pViewShell, const ...@@ -174,18 +174,18 @@ static bool lcl_KeyEditMode( SdrObject* pObj, ScTabViewShell* pViewShell, const
bool FuDraw::KeyInput(const KeyEvent& rKEvt) bool FuDraw::KeyInput(const KeyEvent& rKEvt)
{ {
bool bReturn = false; bool bReturn = false;
ScViewData& rViewData = pViewShell->GetViewData(); ScViewData& rViewData = rViewShell.GetViewData();
switch ( rKEvt.GetKeyCode().GetCode() ) switch ( rKEvt.GetKeyCode().GetCode() )
{ {
case KEY_ESCAPE: case KEY_ESCAPE:
if ( pViewShell->IsDrawTextShell() || aSfxRequest.GetSlot() == SID_DRAW_NOTEEDIT ) if ( rViewShell.IsDrawTextShell() || aSfxRequest.GetSlot() == SID_DRAW_NOTEEDIT )
{ {
// if object selected -> normal draw-shell, else turn off drawing // if object selected -> normal draw-shell, else turn off drawing
rViewData.GetDispatcher().Execute(aSfxRequest.GetSlot(), SfxCallMode::SLOT | SfxCallMode::RECORD); rViewData.GetDispatcher().Execute(aSfxRequest.GetSlot(), SfxCallMode::SLOT | SfxCallMode::RECORD);
bReturn = true; bReturn = true;
} }
else if ( pViewShell->IsDrawSelMode() ) else if ( rViewShell.IsDrawSelMode() )
{ {
pView->UnmarkAll(); pView->UnmarkAll();
rViewData.GetDispatcher().Execute(SID_OBJECT_SELECT, SfxCallMode::SLOT | SfxCallMode::RECORD); rViewData.GetDispatcher().Execute(SID_OBJECT_SELECT, SfxCallMode::SLOT | SfxCallMode::RECORD);
...@@ -202,7 +202,7 @@ bool FuDraw::KeyInput(const KeyEvent& rKEvt) ...@@ -202,7 +202,7 @@ bool FuDraw::KeyInput(const KeyEvent& rKEvt)
// while bezier editing, object is selected // while bezier editing, object is selected
if (!pView->AreObjectsMarked()) if (!pView->AreObjectsMarked())
pViewShell->SetDrawShell( false ); rViewShell.SetDrawShell( false );
bReturn = true; bReturn = true;
} }
...@@ -222,16 +222,16 @@ bool FuDraw::KeyInput(const KeyEvent& rKEvt) ...@@ -222,16 +222,16 @@ bool FuDraw::KeyInput(const KeyEvent& rKEvt)
const SdrMarkList& rMarkList = pView->GetMarkedObjectList(); const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
if( !pView->IsTextEdit() && 1 == rMarkList.GetMarkCount() ) if( !pView->IsTextEdit() && 1 == rMarkList.GetMarkCount() )
{ {
bool bOle = pViewShell->GetViewFrame()->GetFrame().IsInPlace(); bool bOle = rViewShell.GetViewFrame()->GetFrame().IsInPlace();
SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj(); SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
if( pObj && dynamic_cast<const SdrOle2Obj*>( pObj) != nullptr && !bOle ) if( pObj && dynamic_cast<const SdrOle2Obj*>( pObj) != nullptr && !bOle )
{ {
pViewShell->ActivateObject( static_cast< SdrOle2Obj* >( pObj ), 0 ); rViewShell.ActivateObject( static_cast< SdrOle2Obj* >( pObj ), 0 );
// consumed // consumed
bReturn = true; bReturn = true;
} }
else if ( lcl_KeyEditMode( pObj, pViewShell, nullptr ) ) // start text edit for suitable object else if ( lcl_KeyEditMode( pObj, rViewShell, nullptr ) ) // start text edit for suitable object
bReturn = true; bReturn = true;
} }
} }
...@@ -248,7 +248,7 @@ bool FuDraw::KeyInput(const KeyEvent& rKEvt) ...@@ -248,7 +248,7 @@ bool FuDraw::KeyInput(const KeyEvent& rKEvt)
if( !pView->IsTextEdit() && 1 == rMarkList.GetMarkCount() ) if( !pView->IsTextEdit() && 1 == rMarkList.GetMarkCount() )
{ {
SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj(); SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
if ( lcl_KeyEditMode( pObj, pViewShell, nullptr ) ) // start text edit for suitable object if ( lcl_KeyEditMode( pObj, rViewShell, nullptr ) ) // start text edit for suitable object
bReturn = true; bReturn = true;
} }
} }
...@@ -611,7 +611,7 @@ bool FuDraw::KeyInput(const KeyEvent& rKEvt) ...@@ -611,7 +611,7 @@ bool FuDraw::KeyInput(const KeyEvent& rKEvt)
SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj(); SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
// start text edit for suitable object, pass key event to OutlinerView // start text edit for suitable object, pass key event to OutlinerView
if ( lcl_KeyEditMode( pObj, pViewShell, &rKEvt ) ) if ( lcl_KeyEditMode( pObj, rViewShell, &rKEvt ) )
bReturn = true; bReturn = true;
} }
} }
...@@ -664,16 +664,16 @@ void FuDraw::ForcePointer(const MouseEvent* pMEvt) ...@@ -664,16 +664,16 @@ void FuDraw::ForcePointer(const MouseEvent* pMEvt)
if ( pView->IsTextEdit() ) if ( pView->IsTextEdit() )
{ {
pViewShell->SetActivePointer(Pointer(PointerStyle::Text)); // can't be ? rViewShell.SetActivePointer(Pointer(PointerStyle::Text)); // can't be ?
} }
else if ( pHdl ) else if ( pHdl )
{ {
pViewShell->SetActivePointer( rViewShell.SetActivePointer(
pView->GetPreferredPointer( aPnt, pWindow ) ); pView->GetPreferredPointer( aPnt, pWindow ) );
} }
else if ( pView->IsMarkedHit(aPnt) ) else if ( pView->IsMarkedHit(aPnt) )
{ {
pViewShell->SetActivePointer( Pointer(PointerStyle::Move) ); rViewShell.SetActivePointer( Pointer(PointerStyle::Move) );
} }
else if ( !bAlt && ( !pMEvt || !pMEvt->GetButtons() ) else if ( !bAlt && ( !pMEvt || !pMEvt->GetButtons() )
&& lcl_UrlHit( pView, aPosPixel, pWindow ) ) && lcl_UrlHit( pView, aPosPixel, pWindow ) )
...@@ -685,14 +685,14 @@ void FuDraw::ForcePointer(const MouseEvent* pMEvt) ...@@ -685,14 +685,14 @@ void FuDraw::ForcePointer(const MouseEvent* pMEvt)
{ {
// could be suppressed with ALT // could be suppressed with ALT
SdrObjMacroHitRec aHitRec; //! something missing ???? SdrObjMacroHitRec aHitRec; //! something missing ????
pViewShell->SetActivePointer( pObj->GetMacroPointer(aHitRec) ); rViewShell.SetActivePointer( pObj->GetMacroPointer(aHitRec) );
} }
else if ( !bAlt && pInfo && (!pInfo->GetMacro().isEmpty() || !pInfo->GetHlink().isEmpty()) ) else if ( !bAlt && pInfo && (!pInfo->GetMacro().isEmpty() || !pInfo->GetHlink().isEmpty()) )
pWindow->SetPointer( Pointer( PointerStyle::RefHand ) ); pWindow->SetPointer( Pointer( PointerStyle::RefHand ) );
else if ( IsDetectiveHit( aPnt ) ) else if ( IsDetectiveHit( aPnt ) )
pViewShell->SetActivePointer( Pointer( PointerStyle::Detective ) ); rViewShell.SetActivePointer( Pointer( PointerStyle::Detective ) );
else else
pViewShell->SetActivePointer( aNewPointer ); //! in Gridwin? rViewShell.SetActivePointer( aNewPointer ); //! in Gridwin?
} }
} }
......
...@@ -242,13 +242,13 @@ FuInsertOLE::FuInsertOLE(ScTabViewShell& rViewSh, vcl::Window* pWin, ScDrawView* ...@@ -242,13 +242,13 @@ FuInsertOLE::FuInsertOLE(ScTabViewShell& rViewSh, vcl::Window* pWin, ScDrawView*
if ( nSlot == SID_INSERT_OBJECT && pNameItem ) if ( nSlot == SID_INSERT_OBJECT && pNameItem )
{ {
SvGlobalName aClassName = pNameItem->GetValue(); SvGlobalName aClassName = pNameItem->GetValue();
xObj = pViewShell->GetViewFrame()->GetObjectShell()->GetEmbeddedObjectContainer().CreateEmbeddedObject( aClassName.GetByteSequence(), aName ); xObj = rViewShell.GetViewFrame()->GetObjectShell()->GetEmbeddedObjectContainer().CreateEmbeddedObject( aClassName.GetByteSequence(), aName );
} }
else if ( nSlot == SID_INSERT_SMATH ) else if ( nSlot == SID_INSERT_SMATH )
{ {
if ( SvtModuleOptions().IsMath() ) if ( SvtModuleOptions().IsMath() )
{ {
xObj = pViewShell->GetViewFrame()->GetObjectShell()->GetEmbeddedObjectContainer().CreateEmbeddedObject( SvGlobalName( SO3_SM_CLASSID_60 ).GetByteSequence(), aName ); xObj = rViewShell.GetViewFrame()->GetObjectShell()->GetEmbeddedObjectContainer().CreateEmbeddedObject( SvGlobalName( SO3_SM_CLASSID_60 ).GetByteSequence(), aName );
rReq.AppendItem( SfxGlobalNameItem( SID_INSERT_OBJECT, SvGlobalName( SO3_SM_CLASSID_60 ) ) ); rReq.AppendItem( SfxGlobalNameItem( SID_INSERT_OBJECT, SvGlobalName( SO3_SM_CLASSID_60 ) ) );
} }
} }
...@@ -266,7 +266,7 @@ FuInsertOLE::FuInsertOLE(ScTabViewShell& rViewSh, vcl::Window* pWin, ScDrawView* ...@@ -266,7 +266,7 @@ FuInsertOLE::FuInsertOLE(ScTabViewShell& rViewSh, vcl::Window* pWin, ScDrawView*
{ {
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
ScopedVclPtr<SfxAbstractInsertObjectDialog> pDlg( ScopedVclPtr<SfxAbstractInsertObjectDialog> pDlg(
pFact->CreateInsertObjectDialog( pViewShell->GetFrameWeld(), SC_MOD()->GetSlotPool()->GetSlot(nSlot)->GetCommandString(), pFact->CreateInsertObjectDialog( rViewShell.GetFrameWeld(), SC_MOD()->GetSlotPool()->GetSlot(nSlot)->GetCommandString(),
xStorage, &aServerLst )); xStorage, &aServerLst ));
if ( pDlg ) if ( pDlg )
{ {
...@@ -386,11 +386,11 @@ FuInsertOLE::FuInsertOLE(ScTabViewShell& rViewSh, vcl::Window* pWin, ScDrawView* ...@@ -386,11 +386,11 @@ FuInsertOLE::FuInsertOLE(ScTabViewShell& rViewSh, vcl::Window* pWin, ScDrawView*
if (bIsFromFile) if (bIsFromFile)
{ {
// Object selected, activate Draw-Shell // Object selected, activate Draw-Shell
pViewShell->SetDrawShell( true ); rViewShell.SetDrawShell( true );
} }
else else
{ {
pViewShell->ActivateObject(pObj, embed::EmbedVerbs::MS_OLEVERB_SHOW); rViewShell.ActivateObject(pObj, embed::EmbedVerbs::MS_OLEVERB_SHOW);
} }
} }
...@@ -483,7 +483,7 @@ FuInsertChart::FuInsertChart(ScTabViewShell& rViewSh, vcl::Window* pWin, ScDrawV ...@@ -483,7 +483,7 @@ FuInsertChart::FuInsertChart(ScTabViewShell& rViewSh, vcl::Window* pWin, ScDrawV
const sal_Int64 nAspect = embed::Aspects::MSOLE_CONTENT; const sal_Int64 nAspect = embed::Aspects::MSOLE_CONTENT;
uno::Reference < embed::XEmbeddedObject > xObj = uno::Reference < embed::XEmbeddedObject > xObj =
pViewShell->GetObjectShell()->GetEmbeddedObjectContainer().CreateEmbeddedObject( SvGlobalName( SO3_SCH_CLASSID_60 ).GetByteSequence(), aName ); rViewShell.GetObjectShell()->GetEmbeddedObjectContainer().CreateEmbeddedObject( SvGlobalName( SO3_SCH_CLASSID_60 ).GetByteSequence(), aName );
uno::Reference< css::chart2::data::XDataReceiver > xReceiver; uno::Reference< css::chart2::data::XDataReceiver > xReceiver;
uno::Reference< embed::XComponentSupplier > xCompSupp( xObj, uno::UNO_QUERY ); uno::Reference< embed::XComponentSupplier > xCompSupp( xObj, uno::UNO_QUERY );
...@@ -621,7 +621,7 @@ FuInsertChart::FuInsertChart(ScTabViewShell& rViewSh, vcl::Window* pWin, ScDrawV ...@@ -621,7 +621,7 @@ FuInsertChart::FuInsertChart(ScTabViewShell& rViewSh, vcl::Window* pWin, ScDrawV
//the controller will be unlocked by the dialog when the dialog is told to do so //the controller will be unlocked by the dialog when the dialog is told to do so
// only activate object if not called via API (e.g. macro) // only activate object if not called via API (e.g. macro)
pViewShell->ActivateObject(pObj, embed::EmbedVerbs::MS_OLEVERB_SHOW); rViewShell.ActivateObject(pObj, embed::EmbedVerbs::MS_OLEVERB_SHOW);
//open wizard //open wizard
//@todo get context from calc if that has one //@todo get context from calc if that has one
...@@ -661,7 +661,7 @@ FuInsertChart::FuInsertChart(ScTabViewShell& rViewSh, vcl::Window* pWin, ScDrawV ...@@ -661,7 +661,7 @@ FuInsertChart::FuInsertChart(ScTabViewShell& rViewSh, vcl::Window* pWin, ScDrawV
if ( aDialogSize.Width() > 0 && aDialogSize.Height() > 0 ) if ( aDialogSize.Width() > 0 && aDialogSize.Height() > 0 )
{ {
//calculate and set new position //calculate and set new position
Point aDialogPos = pViewShell->GetChartDialogPos( aDialogSize, aRect ); Point aDialogPos = rViewShell.GetChartDialogPos( aDialogSize, aRect );
xDialogProps->setPropertyValue("Position", xDialogProps->setPropertyValue("Position",
uno::makeAny( awt::Point(aDialogPos.getX(),aDialogPos.getY()) ) ); uno::makeAny( awt::Point(aDialogPos.getX(),aDialogPos.getY()) ) );
} }
...@@ -681,9 +681,8 @@ FuInsertChart::FuInsertChart(ScTabViewShell& rViewSh, vcl::Window* pWin, ScDrawV ...@@ -681,9 +681,8 @@ FuInsertChart::FuInsertChart(ScTabViewShell& rViewSh, vcl::Window* pWin, ScDrawV
if( nDialogRet == ui::dialogs::ExecutableDialogResults::CANCEL ) if( nDialogRet == ui::dialogs::ExecutableDialogResults::CANCEL )
{ {
// leave OLE inplace mode and unmark // leave OLE inplace mode and unmark
OSL_ASSERT( pViewShell );
OSL_ASSERT( pView ); OSL_ASSERT( pView );
pViewShell->DeactivateOle(); rViewShell.DeactivateOle();
pView->UnmarkAll(); pView->UnmarkAll();
// old page view pointer is invalid after switching sheets // old page view pointer is invalid after switching sheets
...@@ -705,7 +704,7 @@ FuInsertChart::FuInsertChart(ScTabViewShell& rViewSh, vcl::Window* pWin, ScDrawV ...@@ -705,7 +704,7 @@ FuInsertChart::FuInsertChart(ScTabViewShell& rViewSh, vcl::Window* pWin, ScDrawV
bAddUndo = false; // don't create the undo action for inserting bAddUndo = false; // don't create the undo action for inserting
// leave the draw shell // leave the draw shell
pViewShell->SetDrawShell( false ); rViewShell.SetDrawShell( false );
// reset marked cell area // reset marked cell area
...@@ -742,7 +741,7 @@ FuInsertChartFromFile::FuInsertChartFromFile(ScTabViewShell& rViewSh, vcl::Windo ...@@ -742,7 +741,7 @@ FuInsertChartFromFile::FuInsertChartFromFile(ScTabViewShell& rViewSh, vcl::Windo
rURL, comphelper::getProcessComponentContext()); rURL, comphelper::getProcessComponentContext());
comphelper::EmbeddedObjectContainer& rObjContainer = comphelper::EmbeddedObjectContainer& rObjContainer =
pViewShell->GetObjectShell()->GetEmbeddedObjectContainer(); rViewShell.GetObjectShell()->GetEmbeddedObjectContainer();
OUString aName; OUString aName;
uno::Reference< embed::XEmbeddedObject > xObj = rObjContainer.InsertEmbeddedObject( xStorage, aName ); uno::Reference< embed::XEmbeddedObject > xObj = rObjContainer.InsertEmbeddedObject( xStorage, aName );
...@@ -768,7 +767,7 @@ FuInsertChartFromFile::FuInsertChartFromFile(ScTabViewShell& rViewSh, vcl::Windo ...@@ -768,7 +767,7 @@ FuInsertChartFromFile::FuInsertChartFromFile(ScTabViewShell& rViewSh, vcl::Windo
pView->UnmarkAllObj(); pView->UnmarkAllObj();
pView->MarkObj( pObj, pPV ); pView->MarkObj( pObj, pPV );
pViewShell->ActivateObject(pObj, embed::EmbedVerbs::MS_OLEVERB_SHOW); rViewShell.ActivateObject(pObj, embed::EmbedVerbs::MS_OLEVERB_SHOW);
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
FuPoor::FuPoor(ScTabViewShell& rViewSh, vcl::Window* pWin, ScDrawView* pViewP, FuPoor::FuPoor(ScTabViewShell& rViewSh, vcl::Window* pWin, ScDrawView* pViewP,
SdrModel* pDoc, const SfxRequest& rReq) : SdrModel* pDoc, const SfxRequest& rReq) :
pView(pViewP), pView(pViewP),
pViewShell(&rViewSh), rViewShell(rViewSh),
pWindow(pWin), pWindow(pWin),
pDrDoc(pDoc), pDrDoc(pDoc),
aSfxRequest(rReq), aSfxRequest(rReq),
...@@ -89,27 +89,27 @@ void FuPoor::ForceScroll(const Point& aPixPos) ...@@ -89,27 +89,27 @@ void FuPoor::ForceScroll(const Point& aPixPos)
if ( aPixPos.Y() <= 0 ) dy = -1; if ( aPixPos.Y() <= 0 ) dy = -1;
if ( aPixPos.Y() >= aSize.Height() ) dy = 1; if ( aPixPos.Y() >= aSize.Height() ) dy = 1;
ScViewData& rViewData = pViewShell->GetViewData(); ScViewData& rViewData = rViewShell.GetViewData();
if ( rViewData.GetDocument()->IsNegativePage( rViewData.GetTabNo() ) ) if ( rViewData.GetDocument()->IsNegativePage( rViewData.GetTabNo() ) )
dx = -dx; dx = -dx;
ScSplitPos eWhich = rViewData.GetActivePart(); ScSplitPos eWhich = rViewData.GetActivePart();
if ( dx > 0 && rViewData.GetHSplitMode() == SC_SPLIT_FIX && WhichH(eWhich) == SC_SPLIT_LEFT ) if ( dx > 0 && rViewData.GetHSplitMode() == SC_SPLIT_FIX && WhichH(eWhich) == SC_SPLIT_LEFT )
{ {
pViewShell->ActivatePart( ( eWhich == SC_SPLIT_TOPLEFT ) ? rViewShell.ActivatePart( ( eWhich == SC_SPLIT_TOPLEFT ) ?
SC_SPLIT_TOPRIGHT : SC_SPLIT_BOTTOMRIGHT ); SC_SPLIT_TOPRIGHT : SC_SPLIT_BOTTOMRIGHT );
dx = 0; dx = 0;
} }
if ( dy > 0 && rViewData.GetVSplitMode() == SC_SPLIT_FIX && WhichV(eWhich) == SC_SPLIT_TOP ) if ( dy > 0 && rViewData.GetVSplitMode() == SC_SPLIT_FIX && WhichV(eWhich) == SC_SPLIT_TOP )
{ {
pViewShell->ActivatePart( ( eWhich == SC_SPLIT_TOPLEFT ) ? rViewShell.ActivatePart( ( eWhich == SC_SPLIT_TOPLEFT ) ?
SC_SPLIT_BOTTOMLEFT : SC_SPLIT_BOTTOMRIGHT ); SC_SPLIT_BOTTOMLEFT : SC_SPLIT_BOTTOMRIGHT );
dy = 0; dy = 0;
} }
if ( dx != 0 || dy != 0 ) if ( dx != 0 || dy != 0 )
{ {
pViewShell->ScrollLines(2*dx, 4*dy); rViewShell.ScrollLines(2*dx, 4*dy);
aScrollTimer.Start(); aScrollTimer.Start();
} }
} }
...@@ -185,7 +185,7 @@ IMPL_LINK_NOARG(FuPoor, DragHdl, void*, void) ...@@ -185,7 +185,7 @@ IMPL_LINK_NOARG(FuPoor, DragHdl, void*, void)
{ {
pWindow->ReleaseMouse(); pWindow->ReleaseMouse();
bIsInDragMode = true; bIsInDragMode = true;
pViewShell->GetScDrawView()->BeginDrag(pWindow, aMDPos); rViewShell.GetScDrawView()->BeginDrag(pWindow, aMDPos);
} }
} }
......
...@@ -191,7 +191,7 @@ bool FuSelection::MouseButtonDown(const MouseEvent& rMEvt) ...@@ -191,7 +191,7 @@ bool FuSelection::MouseButtonDown(const MouseEvent& rMEvt)
uno::Sequence< uno::Any > aInArgs; uno::Sequence< uno::Any > aInArgs;
pObjSh->CallXScript( pInfo->GetMacro(), pObjSh->CallXScript( pInfo->GetMacro(),
aInArgs, aRet, aOutArgsIndex, aOutArgs, true, &aCaller ); aInArgs, aRet, aOutArgsIndex, aOutArgs, true, &aCaller );
pViewShell->FakeButtonUp( pViewShell->GetViewData().GetActivePart() ); rViewShell.FakeButtonUp( rViewShell.GetViewData().GetActivePart() );
return true; // no CaptureMouse etc. return true; // no CaptureMouse etc.
} }
} }
...@@ -225,13 +225,13 @@ bool FuSelection::MouseButtonDown(const MouseEvent& rMEvt) ...@@ -225,13 +225,13 @@ bool FuSelection::MouseButtonDown(const MouseEvent& rMEvt)
if ( !sURL.isEmpty() ) if ( !sURL.isEmpty() )
{ {
ScGlobal::OpenURL( sURL, sTarget ); ScGlobal::OpenURL( sURL, sTarget );
pViewShell->FakeButtonUp( pViewShell->GetViewData().GetActivePart() ); rViewShell.FakeButtonUp( rViewShell.GetViewData().GetActivePart() );
return true; // no CaptureMouse etc. return true; // no CaptureMouse etc.
} }
// Is another object being edited in this view? // Is another object being edited in this view?
// (Editing is ended in MarkListHasChanged - test before UnmarkAll) // (Editing is ended in MarkListHasChanged - test before UnmarkAll)
SfxInPlaceClient* pClient = pViewShell->GetIPClient(); SfxInPlaceClient* pClient = rViewShell.GetIPClient();
bool bWasOleActive = ( pClient && pClient->IsObjectInPlaceActive() ); bool bWasOleActive = ( pClient && pClient->IsObjectInPlaceActive() );
// Selection // Selection
...@@ -266,12 +266,12 @@ bool FuSelection::MouseButtonDown(const MouseEvent& rMEvt) ...@@ -266,12 +266,12 @@ bool FuSelection::MouseButtonDown(const MouseEvent& rMEvt)
bReturn = true; bReturn = true;
} }
else // object at the edge else // object at the edge
if (pViewShell->IsDrawSelMode()) if (rViewShell.IsDrawSelMode())
bReturn = true; bReturn = true;
} }
else else
{ {
if (pViewShell->IsDrawSelMode()) if (rViewShell.IsDrawSelMode())
{ {
// select object // select object
...@@ -329,7 +329,7 @@ bool FuSelection::MouseButtonUp(const MouseEvent& rMEvt) ...@@ -329,7 +329,7 @@ bool FuSelection::MouseButtonUp(const MouseEvent& rMEvt)
SetMouseButtonCode(rMEvt.GetButtons()); SetMouseButtonCode(rMEvt.GetButtons());
bool bReturn = FuDraw::MouseButtonUp(rMEvt); bool bReturn = FuDraw::MouseButtonUp(rMEvt);
bool bOle = pViewShell->GetViewFrame()->GetFrame().IsInPlace(); bool bOle = rViewShell.GetViewFrame()->GetFrame().IsInPlace();
SdrObject* pObj = nullptr; SdrObject* pObj = nullptr;
if (aDragTimer.IsActive() ) if (aDragTimer.IsActive() )
...@@ -341,7 +341,7 @@ bool FuSelection::MouseButtonUp(const MouseEvent& rMEvt) ...@@ -341,7 +341,7 @@ bool FuSelection::MouseButtonUp(const MouseEvent& rMEvt)
Point aPnt( pWindow->PixelToLogic( rMEvt.GetPosPixel() ) ); Point aPnt( pWindow->PixelToLogic( rMEvt.GetPosPixel() ) );
bool bCopy = false; bool bCopy = false;
ScViewData& rViewData = pViewShell->GetViewData(); ScViewData& rViewData = rViewShell.GetViewData();
ScDocument* pDocument = rViewData.GetDocument(); ScDocument* pDocument = rViewData.GetDocument();
SdrPageView* pPageView = ( pView ? pView->GetSdrPageView() : nullptr ); SdrPageView* pPageView = ( pView ? pView->GetSdrPageView() : nullptr );
SdrPage* pPage = ( pPageView ? pPageView->GetPage() : nullptr ); SdrPage* pPage = ( pPageView ? pPageView->GetPage() : nullptr );
...@@ -428,7 +428,7 @@ bool FuSelection::MouseButtonUp(const MouseEvent& rMEvt) ...@@ -428,7 +428,7 @@ bool FuSelection::MouseButtonUp(const MouseEvent& rMEvt)
} }
// maybe consider OLE object // maybe consider OLE object
SfxInPlaceClient* pIPClient = pViewShell->GetIPClient(); SfxInPlaceClient* pIPClient = rViewShell.GetIPClient();
if (pIPClient) if (pIPClient)
{ {
...@@ -466,7 +466,7 @@ bool FuSelection::MouseButtonUp(const MouseEvent& rMEvt) ...@@ -466,7 +466,7 @@ bool FuSelection::MouseButtonUp(const MouseEvent& rMEvt)
{ {
if (static_cast<SdrOle2Obj*>(pObj)->GetObjRef().is()) if (static_cast<SdrOle2Obj*>(pObj)->GetObjRef().is())
{ {
pViewShell->ActivateObject( static_cast<SdrOle2Obj*>(pObj), 0 ); rViewShell.ActivateObject( static_cast<SdrOle2Obj*>(pObj), 0 );
} }
} }
} }
...@@ -481,11 +481,11 @@ bool FuSelection::MouseButtonUp(const MouseEvent& rMEvt) ...@@ -481,11 +481,11 @@ bool FuSelection::MouseButtonUp(const MouseEvent& rMEvt)
bool bVertical = ( pOPO && pOPO->IsVertical() ); bool bVertical = ( pOPO && pOPO->IsVertical() );
sal_uInt16 nTextSlotId = bVertical ? SID_DRAW_TEXT_VERTICAL : SID_DRAW_TEXT; sal_uInt16 nTextSlotId = bVertical ? SID_DRAW_TEXT_VERTICAL : SID_DRAW_TEXT;
pViewShell->GetViewData().GetDispatcher(). rViewShell.GetViewData().GetDispatcher().
Execute(nTextSlotId, SfxCallMode::SYNCHRON | SfxCallMode::RECORD); Execute(nTextSlotId, SfxCallMode::SYNCHRON | SfxCallMode::RECORD);
// Get the created FuText now and change into EditModus // Get the created FuText now and change into EditModus
FuPoor* pPoor = pViewShell->GetViewData().GetView()->GetDrawFuncPtr(); FuPoor* pPoor = rViewShell.GetViewData().GetView()->GetDrawFuncPtr();
if ( pPoor && pPoor->GetSlotID() == nTextSlotId ) // has no RTTI if ( pPoor && pPoor->GetSlotID() == nTextSlotId ) // has no RTTI
{ {
FuText* pText = static_cast<FuText*>(pPoor); FuText* pText = static_cast<FuText*>(pPoor);
...@@ -509,8 +509,8 @@ bool FuSelection::MouseButtonUp(const MouseEvent& rMEvt) ...@@ -509,8 +509,8 @@ bool FuSelection::MouseButtonUp(const MouseEvent& rMEvt)
// command handler for context menu follows after MouseButtonUp, // command handler for context menu follows after MouseButtonUp,
// therefore here the hard IsLeft call // therefore here the hard IsLeft call
if ( !bReturn && rMEvt.IsLeft() ) if ( !bReturn && rMEvt.IsLeft() )
if (pViewShell->IsDrawSelMode()) if (rViewShell.IsDrawSelMode())
pViewShell->GetViewData().GetDispatcher(). rViewShell.GetViewData().GetDispatcher().
Execute(SID_OBJECT_SELECT, SfxCallMode::SLOT | SfxCallMode::RECORD); Execute(SID_OBJECT_SELECT, SfxCallMode::SLOT | SfxCallMode::RECORD);
if ( bCopy && pDocument && pPage ) if ( bCopy && pDocument && pPage )
......
...@@ -62,8 +62,8 @@ bool FuSelection::TestDetective( const SdrPageView* pPV, const Point& rPos ) ...@@ -62,8 +62,8 @@ bool FuSelection::TestDetective( const SdrPageView* pPV, const Point& rPos )
Size(pView->GetHitTolerancePixel(),0)).Width()); Size(pView->GetHitTolerancePixel(),0)).Width());
if (SdrObjectPrimitiveHit(*pObject, rPos, nHitLog, *pPV, nullptr, false)) if (SdrObjectPrimitiveHit(*pObject, rPos, nHitLog, *pPV, nullptr, false))
{ {
ScViewData& rViewData = pViewShell->GetViewData(); ScViewData& rViewData = rViewShell.GetViewData();
ScSplitPos ePos = pViewShell->FindWindow( pWindow ); ScSplitPos ePos = rViewShell.FindWindow( pWindow );
Point aLineStart = pObject->GetPoint(0); Point aLineStart = pObject->GetPoint(0);
Point aLineEnd = pObject->GetPoint(1); Point aLineEnd = pObject->GetPoint(1);
Point aPixel = pWindow->LogicToPixel( aLineStart ); Point aPixel = pWindow->LogicToPixel( aLineStart );
...@@ -94,7 +94,7 @@ bool FuSelection::TestDetective( const SdrPageView* pPV, const Point& rPos ) ...@@ -94,7 +94,7 @@ bool FuSelection::TestDetective( const SdrPageView* pPV, const Point& rPos )
nDifX = nEndCol - nCurX; nDifX = nEndCol - nCurX;
nDifY = nEndRow - nCurY; nDifY = nEndRow - nCurY;
} }
pViewShell->MoveCursorRel( nDifX, nDifY, SC_FOLLOW_JUMP, false ); rViewShell.MoveCursorRel( nDifX, nDifY, SC_FOLLOW_JUMP, false );
bFound = true; bFound = true;
} }
...@@ -124,7 +124,7 @@ bool FuSelection::IsNoteCaptionClicked( const Point& rPos ) const ...@@ -124,7 +124,7 @@ bool FuSelection::IsNoteCaptionClicked( const Point& rPos ) const
SdrPageView* pPageView = pView ? pView->GetSdrPageView() : nullptr; SdrPageView* pPageView = pView ? pView->GetSdrPageView() : nullptr;
if( pPageView ) if( pPageView )
{ {
const ScViewData& rViewData = pViewShell->GetViewData(); const ScViewData& rViewData = rViewShell.GetViewData();
ScDocument& rDoc = *rViewData.GetDocument(); ScDocument& rDoc = *rViewData.GetDocument();
SCTAB nTab = rViewData.GetTabNo(); SCTAB nTab = rViewData.GetTabNo();
ScDocShell* pDocSh = rViewData.GetDocShell(); ScDocShell* pDocSh = rViewData.GetDocShell();
......
...@@ -201,7 +201,7 @@ bool FuText::MouseButtonDown(const MouseEvent& rMEvt) ...@@ -201,7 +201,7 @@ bool FuText::MouseButtonDown(const MouseEvent& rMEvt)
if ( pView->SdrBeginTextEdit(pObj, pPV, pWindow, true, pO.release()) ) if ( pView->SdrBeginTextEdit(pObj, pPV, pWindow, true, pO.release()) )
{ {
// subscribe EditEngine-UndoManager // subscribe EditEngine-UndoManager
pViewShell->SetDrawTextUndo( pUndoManager ); rViewShell.SetDrawTextUndo( pUndoManager );
OutlinerView* pOLV = pView->GetTextEditOutlinerView(); OutlinerView* pOLV = pView->GetTextEditOutlinerView();
if ( pOLV->MouseButtonDown(rMEvt) ) if ( pOLV->MouseButtonDown(rMEvt) )
...@@ -252,7 +252,7 @@ bool FuText::MouseButtonDown(const MouseEvent& rMEvt) ...@@ -252,7 +252,7 @@ bool FuText::MouseButtonDown(const MouseEvent& rMEvt)
} }
pView->SetDragMode(SdrDragMode::Move); pView->SetDragMode(SdrDragMode::Move);
SfxBindings& rBindings = pViewShell->GetViewFrame()->GetBindings(); SfxBindings& rBindings = rViewShell.GetViewFrame()->GetBindings();
rBindings.Invalidate( SID_OBJECT_ROTATE ); rBindings.Invalidate( SID_OBJECT_ROTATE );
rBindings.Invalidate( SID_OBJECT_MIRROR ); rBindings.Invalidate( SID_OBJECT_MIRROR );
} }
...@@ -287,7 +287,7 @@ bool FuText::MouseButtonDown(const MouseEvent& rMEvt) ...@@ -287,7 +287,7 @@ bool FuText::MouseButtonDown(const MouseEvent& rMEvt)
{ {
// Edit notes -> create no new text objects // Edit notes -> create no new text objects
// and leave text mode // and leave text mode
pViewShell->GetViewData().GetDispatcher(). rViewShell.GetViewData().GetDispatcher().
Execute(aSfxRequest.GetSlot(), SfxCallMode::SLOT | SfxCallMode::RECORD); Execute(aSfxRequest.GetSlot(), SfxCallMode::SLOT | SfxCallMode::RECORD);
} }
else else
...@@ -308,7 +308,7 @@ bool FuText::MouseButtonDown(const MouseEvent& rMEvt) ...@@ -308,7 +308,7 @@ bool FuText::MouseButtonDown(const MouseEvent& rMEvt)
else if (SdrObject* pObj = pView->PickObj(aMDPos, pView->getHitTolLog(), pPV, SdrSearchOptions::ALSOONMASTER | SdrSearchOptions::BEFOREMARK)) else if (SdrObject* pObj = pView->PickObj(aMDPos, pView->getHitTolLog(), pPV, SdrSearchOptions::ALSOONMASTER | SdrSearchOptions::BEFOREMARK))
{ {
pView->UnmarkAllObj(); pView->UnmarkAllObj();
ScViewData& rViewData = pViewShell->GetViewData(); ScViewData& rViewData = rViewShell.GetViewData();
rViewData.GetDispatcher().Execute(aSfxRequest.GetSlot(), SfxCallMode::SLOT | SfxCallMode::RECORD); rViewData.GetDispatcher().Execute(aSfxRequest.GetSlot(), SfxCallMode::SLOT | SfxCallMode::RECORD);
pView->MarkObj(pObj,pPV); pView->MarkObj(pObj,pPV);
...@@ -324,15 +324,15 @@ bool FuText::MouseButtonDown(const MouseEvent& rMEvt) ...@@ -324,15 +324,15 @@ bool FuText::MouseButtonDown(const MouseEvent& rMEvt)
{ {
pWindow->CaptureMouse(); pWindow->CaptureMouse();
// ForcePointer(&rMEvt); // ForcePointer(&rMEvt);
lcl_InvalidateAttribs( pViewShell->GetViewFrame()->GetBindings() ); lcl_InvalidateAttribs( rViewShell.GetViewFrame()->GetBindings() );
} }
pViewShell->SetActivePointer(pView->GetPreferredPointer( rViewShell.SetActivePointer(pView->GetPreferredPointer(
pWindow->PixelToLogic(rMEvt.GetPosPixel()), pWindow )); pWindow->PixelToLogic(rMEvt.GetPosPixel()), pWindow ));
if (!bStraightEnter) if (!bStraightEnter)
{ {
pView->UnmarkAll(); pView->UnmarkAll();
ScViewData& rViewData = pViewShell->GetViewData(); ScViewData& rViewData = rViewShell.GetViewData();
rViewData.GetDispatcher().Execute(aSfxRequest.GetSlot(), SfxCallMode::SLOT | SfxCallMode::RECORD); rViewData.GetDispatcher().Execute(aSfxRequest.GetSlot(), SfxCallMode::SLOT | SfxCallMode::RECORD);
} }
...@@ -341,7 +341,7 @@ bool FuText::MouseButtonDown(const MouseEvent& rMEvt) ...@@ -341,7 +341,7 @@ bool FuText::MouseButtonDown(const MouseEvent& rMEvt)
bool FuText::MouseMove(const MouseEvent& rMEvt) bool FuText::MouseMove(const MouseEvent& rMEvt)
{ {
pViewShell->SetActivePointer(pView->GetPreferredPointer( rViewShell.SetActivePointer(pView->GetPreferredPointer(
pWindow->PixelToLogic(rMEvt.GetPosPixel()), pWindow )); pWindow->PixelToLogic(rMEvt.GetPosPixel()), pWindow ));
if (aDragTimer.IsActive() ) if (aDragTimer.IsActive() )
...@@ -383,7 +383,7 @@ bool FuText::MouseButtonUp(const MouseEvent& rMEvt) ...@@ -383,7 +383,7 @@ bool FuText::MouseButtonUp(const MouseEvent& rMEvt)
aDragTimer.Stop(); aDragTimer.Stop();
} }
lcl_InvalidateAttribs( pViewShell->GetViewFrame()->GetBindings() ); lcl_InvalidateAttribs( rViewShell.GetViewFrame()->GetBindings() );
Point aPnt( pWindow->PixelToLogic( rMEvt.GetPosPixel() ) ); Point aPnt( pWindow->PixelToLogic( rMEvt.GetPosPixel() ) );
...@@ -456,7 +456,7 @@ bool FuText::MouseButtonUp(const MouseEvent& rMEvt) ...@@ -456,7 +456,7 @@ bool FuText::MouseButtonUp(const MouseEvent& rMEvt)
{ {
pView->MarkObj(aPnt, -2, false, rMEvt.IsMod1()); pView->MarkObj(aPnt, -2, false, rMEvt.IsMod1());
SfxDispatcher& rDisp = pViewShell->GetViewData().GetDispatcher(); SfxDispatcher& rDisp = rViewShell.GetViewData().GetDispatcher();
if ( pView->AreObjectsMarked() ) if ( pView->AreObjectsMarked() )
rDisp.Execute(SID_OBJECT_SELECT, SfxCallMode::SLOT | SfxCallMode::RECORD); rDisp.Execute(SID_OBJECT_SELECT, SfxCallMode::SLOT | SfxCallMode::RECORD);
else else
...@@ -476,7 +476,7 @@ bool FuText::MouseButtonUp(const MouseEvent& rMEvt) ...@@ -476,7 +476,7 @@ bool FuText::MouseButtonUp(const MouseEvent& rMEvt)
{ {
pView->MarkObj(aPnt, -2, false, rMEvt.IsMod1()); pView->MarkObj(aPnt, -2, false, rMEvt.IsMod1());
SfxDispatcher& rDisp = pViewShell->GetViewData().GetDispatcher(); SfxDispatcher& rDisp = rViewShell.GetViewData().GetDispatcher();
if ( pView->AreObjectsMarked() ) if ( pView->AreObjectsMarked() )
rDisp.Execute(SID_OBJECT_SELECT, SfxCallMode::SLOT | SfxCallMode::RECORD); rDisp.Execute(SID_OBJECT_SELECT, SfxCallMode::SLOT | SfxCallMode::RECORD);
else else
...@@ -490,7 +490,7 @@ bool FuText::MouseButtonUp(const MouseEvent& rMEvt) ...@@ -490,7 +490,7 @@ bool FuText::MouseButtonUp(const MouseEvent& rMEvt)
// switch mouse-pointer // switch mouse-pointer
void FuText::ForcePointer(const MouseEvent* /* pMEvt */) void FuText::ForcePointer(const MouseEvent* /* pMEvt */)
{ {
pViewShell->SetActivePointer( aNewPointer ); rViewShell.SetActivePointer( aNewPointer );
} }
// modify keyboard events // modify keyboard events
...@@ -502,7 +502,7 @@ bool FuText::KeyInput(const KeyEvent& rKEvt) ...@@ -502,7 +502,7 @@ bool FuText::KeyInput(const KeyEvent& rKEvt)
if ( pView->KeyInput(rKEvt, pWindow) ) if ( pView->KeyInput(rKEvt, pWindow) )
{ {
bReturn = true; bReturn = true;
lcl_InvalidateAttribs( pViewShell->GetViewFrame()->GetBindings() ); lcl_InvalidateAttribs( rViewShell.GetViewFrame()->GetBindings() );
} }
else else
{ {
...@@ -515,7 +515,7 @@ bool FuText::KeyInput(const KeyEvent& rKEvt) ...@@ -515,7 +515,7 @@ bool FuText::KeyInput(const KeyEvent& rKEvt)
void FuText::Activate() void FuText::Activate()
{ {
pView->SetDragMode(SdrDragMode::Move); pView->SetDragMode(SdrDragMode::Move);
SfxBindings& rBindings = pViewShell->GetViewFrame()->GetBindings(); SfxBindings& rBindings = rViewShell.GetViewFrame()->GetBindings();
rBindings.Invalidate( SID_OBJECT_ROTATE ); rBindings.Invalidate( SID_OBJECT_ROTATE );
rBindings.Invalidate( SID_OBJECT_MIRROR ); rBindings.Invalidate( SID_OBJECT_MIRROR );
...@@ -534,7 +534,7 @@ void FuText::Activate() ...@@ -534,7 +534,7 @@ void FuText::Activate()
aNewPointer = Pointer(PointerStyle::Text); aNewPointer = Pointer(PointerStyle::Text);
aOldPointer = pWindow->GetPointer(); aOldPointer = pWindow->GetPointer();
pViewShell->SetActivePointer( aNewPointer ); rViewShell.SetActivePointer( aNewPointer );
FuConstruct::Activate(); FuConstruct::Activate();
} }
...@@ -542,7 +542,7 @@ void FuText::Activate() ...@@ -542,7 +542,7 @@ void FuText::Activate()
void FuText::Deactivate() void FuText::Deactivate()
{ {
FuConstruct::Deactivate(); FuConstruct::Deactivate();
pViewShell->SetActivePointer( aOldPointer ); rViewShell.SetActivePointer( aOldPointer );
StopEditMode(); StopEditMode();
} }
...@@ -599,11 +599,11 @@ void FuText::SetInEditMode(SdrObject* pObj, const Point* pMousePixel, ...@@ -599,11 +599,11 @@ void FuText::SetInEditMode(SdrObject* pObj, const Point* pMousePixel,
// Toggle out of paste mode if we are in it, otherwise // Toggle out of paste mode if we are in it, otherwise
// pressing return in this object will instead go to the // pressing return in this object will instead go to the
// sheet and be considered an overwrite-cell instruction // sheet and be considered an overwrite-cell instruction
pViewShell->GetViewData().SetPasteMode(ScPasteFlags::NONE); rViewShell.GetViewData().SetPasteMode(ScPasteFlags::NONE);
pViewShell->UpdateCopySourceOverlay(); rViewShell.UpdateCopySourceOverlay();
// EditEngine-UndoManager anmelden // EditEngine-UndoManager anmelden
pViewShell->SetDrawTextUndo( pUndoManager ); rViewShell.SetDrawTextUndo( pUndoManager );
pView->SetEditMode(); pView->SetEditMode();
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
std::unique_ptr<SdrOutliner> FuText::MakeOutliner() std::unique_ptr<SdrOutliner> FuText::MakeOutliner()
{ {
ScViewData& rViewData = pViewShell->GetViewData(); ScViewData& rViewData = rViewShell.GetViewData();
std::unique_ptr<SdrOutliner> pOutl = SdrMakeOutliner(OutlinerMode::OutlineObject, *pDrDoc); std::unique_ptr<SdrOutliner> pOutl = SdrMakeOutliner(OutlinerMode::OutlineObject, *pDrDoc);
rViewData.UpdateOutlinerFlags(*pOutl); rViewData.UpdateOutlinerFlags(*pOutl);
......
...@@ -57,7 +57,7 @@ void FuText::StopEditMode() ...@@ -57,7 +57,7 @@ void FuText::StopEditMode()
if ( pObject->GetLayer() == SC_LAYER_INTERN ) if ( pObject->GetLayer() == SC_LAYER_INTERN )
pView->LockInternalLayer(); pView->LockInternalLayer();
ScViewData& rViewData = pViewShell->GetViewData(); ScViewData& rViewData = rViewShell.GetViewData();
ScDocument& rDoc = *rViewData.GetDocument(); ScDocument& rDoc = *rViewData.GetDocument();
ScDrawLayer* pDrawLayer = rDoc.GetDrawLayer(); ScDrawLayer* pDrawLayer = rDoc.GetDrawLayer();
OSL_ENSURE( pDrawLayer && (pDrawLayer == pDrDoc), "FuText::StopEditMode - missing or different drawing layers" ); OSL_ENSURE( pDrawLayer && (pDrawLayer == pDrDoc), "FuText::StopEditMode - missing or different drawing layers" );
...@@ -83,7 +83,7 @@ void FuText::StopEditMode() ...@@ -83,7 +83,7 @@ void FuText::StopEditMode()
if(pCalcUndo) if(pCalcUndo)
{ {
const OUString aUndoStr = ScResId( STR_UNDO_EDITNOTE ); const OUString aUndoStr = ScResId( STR_UNDO_EDITNOTE );
pUndoMgr->EnterListAction( aUndoStr, aUndoStr, 0, pViewShell->GetViewShellId() ); pUndoMgr->EnterListAction( aUndoStr, aUndoStr, 0, rViewShell.GetViewShellId() );
/* Note has been created before editing, if first undo action is /* Note has been created before editing, if first undo action is
an insert action. Needed below to decide whether to drop the an insert action. Needed below to decide whether to drop the
...@@ -112,7 +112,7 @@ void FuText::StopEditMode() ...@@ -112,7 +112,7 @@ void FuText::StopEditMode()
/*SdrEndTextEditKind eResult =*/ pView->SdrEndTextEdit( pNote != nullptr ); /*SdrEndTextEditKind eResult =*/ pView->SdrEndTextEdit( pNote != nullptr );
// or ScEndTextEdit (with drawview.hxx) // or ScEndTextEdit (with drawview.hxx)
pViewShell->SetDrawTextUndo( nullptr ); rViewShell.SetDrawTextUndo( nullptr );
vcl::Cursor* pCur = pWindow->GetCursor(); vcl::Cursor* pCur = pWindow->GetCursor();
if( pCur && pCur->IsVisible() ) if( pCur && pCur->IsVisible() )
......
...@@ -42,7 +42,7 @@ class FuPoor ...@@ -42,7 +42,7 @@ class FuPoor
{ {
protected: protected:
ScDrawView* pView; ScDrawView* pView;
ScTabViewShell* pViewShell; ScTabViewShell& rViewShell;
VclPtr<vcl::Window> pWindow; VclPtr<vcl::Window> pWindow;
SdrModel* pDrDoc; SdrModel* pDrDoc;
......
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