[Libreoffice-commits] core.git: 3 commits - include/sfx2 include/svx svx/source
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Thu May 23 15:35:17 UTC 2019
include/sfx2/childwin.hxx | 8
include/svx/graphctl.hxx | 121 -------
svx/source/dialog/graphctl.cxx | 704 -----------------------------------------
3 files changed, 5 insertions(+), 828 deletions(-)
New commits:
commit 220b7bd84934389f4f71c3f59daa94ff138fe33d
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Wed May 22 16:35:19 2019 +0100
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Thu May 23 17:34:14 2019 +0200
rename SvxGraphCtrlUserCall back to GraphCtrlUserCall
Change-Id: I9c348e34a07ab269217f35633cb3a54ea4f7cf68
Reviewed-on: https://gerrit.libreoffice.org/72804
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/include/svx/graphctl.hxx b/include/svx/graphctl.hxx
index 1fa7adc4b3c4..4b9a30671ac1 100644
--- a/include/svx/graphctl.hxx
+++ b/include/svx/graphctl.hxx
@@ -29,13 +29,13 @@
class SvxGraphCtrl;
-class SvxGraphCtrlUserCall : public SdrObjUserCall
+class GraphCtrlUserCall : public SdrObjUserCall
{
SvxGraphCtrl& rWin;
public:
- SvxGraphCtrlUserCall(SvxGraphCtrl& rGraphWin)
+ GraphCtrlUserCall(SvxGraphCtrl& rGraphWin)
: rWin(rGraphWin)
{}
@@ -47,7 +47,7 @@ class SvxGraphCtrlAccessibleContext;
class SVX_DLLPUBLIC SvxGraphCtrl : public weld::CustomWidgetController
{
friend class SvxGraphCtrlView;
- friend class SvxGraphCtrlUserCall;
+ friend class GraphCtrlUserCall;
Graphic aGraphic;
ScopedVclPtrInstance<VirtualDevice> xVD;
@@ -58,7 +58,7 @@ class SVX_DLLPUBLIC SvxGraphCtrl : public weld::CustomWidgetController
MapMode const aMap100;
Size aGraphSize;
Point aMousePos;
- std::unique_ptr<SvxGraphCtrlUserCall> pUserCall;
+ std::unique_ptr<GraphCtrlUserCall> pUserCall;
SdrObjKind eObjKind;
sal_uInt16 nPolyEdit;
bool bEditMode;
diff --git a/svx/source/dialog/graphctl.cxx b/svx/source/dialog/graphctl.cxx
index b5e8023d825f..60a2a306128a 100644
--- a/svx/source/dialog/graphctl.cxx
+++ b/svx/source/dialog/graphctl.cxx
@@ -36,7 +36,7 @@
#include <svx/svdpage.hxx>
#include <svx/sdrpaintwindow.hxx>
-void SvxGraphCtrlUserCall::Changed( const SdrObject& rObj, SdrUserCallType eType, const tools::Rectangle& /*rOldBoundRect*/ )
+void GraphCtrlUserCall::Changed( const SdrObject& rObj, SdrUserCallType eType, const tools::Rectangle& /*rOldBoundRect*/ )
{
switch( eType )
{
@@ -65,7 +65,7 @@ SvxGraphCtrl::SvxGraphCtrl(weld::Dialog* pDialog)
, mbInIdleUpdate(false)
, mpDialog(pDialog)
{
- pUserCall.reset(new SvxGraphCtrlUserCall( *this ));
+ pUserCall.reset(new GraphCtrlUserCall( *this ));
aUpdateIdle.SetPriority( TaskPriority::LOWEST );
aUpdateIdle.SetInvokeHandler( LINK( this, SvxGraphCtrl, UpdateHdl ) );
aUpdateIdle.Start();
commit 2d428f28a1a6aa301b2243ed3ab936109582b2d3
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Wed May 22 16:33:50 2019 +0100
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Thu May 23 17:33:53 2019 +0200
remove now unused GraphCtrl
Change-Id: I6d4aca59d5f9e24521876c36853b663b65a2d200
Reviewed-on: https://gerrit.libreoffice.org/72803
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/include/svx/graphctl.hxx b/include/svx/graphctl.hxx
index d6b1d2de553e..1fa7adc4b3c4 100644
--- a/include/svx/graphctl.hxx
+++ b/include/svx/graphctl.hxx
@@ -27,21 +27,6 @@
#include <svx/svdview.hxx>
#include <svx/svdobj.hxx>
-class GraphCtrl;
-
-class GraphCtrlUserCall : public SdrObjUserCall
-{
- GraphCtrl& rWin;
-
-public:
-
- GraphCtrlUserCall(GraphCtrl& rGraphWin)
- : rWin(rGraphWin)
- {}
-
- virtual void Changed(const SdrObject& rObj, SdrUserCallType eType, const tools::Rectangle& rOldBoundRect) override;
-};
-
class SvxGraphCtrl;
class SvxGraphCtrlUserCall : public SdrObjUserCall
@@ -59,84 +44,6 @@ public:
class SvxGraphCtrlAccessibleContext;
-class SVX_DLLPUBLIC GraphCtrl : public Control
-{
- friend class GraphCtrlView;
- friend class GraphCtrlUserCall;
-
- Graphic aGraphic;
- Idle aUpdateIdle;
- Link<GraphCtrl*,void> aMousePosLink;
- Link<GraphCtrl*,void> aGraphSizeLink;
- Link<GraphCtrl*,void> aUpdateLink;
- MapMode const aMap100;
- Size aGraphSize;
- Point aMousePos;
- std::unique_ptr<GraphCtrlUserCall> pUserCall;
- SdrObjKind eObjKind;
- sal_uInt16 nPolyEdit;
- bool bEditMode;
- bool mbSdrMode;
- bool mbInIdleUpdate;
-
- DECL_LINK( UpdateHdl, Timer*, void );
-
- rtl::Reference<SvxGraphCtrlAccessibleContext> mpAccContext;
-
-protected:
-
- std::unique_ptr<SdrModel> pModel;
- std::unique_ptr<SdrView> pView;
-
- virtual void Paint( vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect ) override;
- virtual void Resize() override;
- virtual void KeyInput(const KeyEvent& rKEvt) override;
- virtual void MouseButtonDown(const MouseEvent& rMEvt) override;
- virtual void MouseButtonUp(const MouseEvent& rMEvt) override;
- virtual void MouseMove(const MouseEvent& rMEvt) override;
-
- virtual void InitSdrModel();
-
- virtual void SdrObjCreated( const SdrObject& rObj );
- virtual void SdrObjChanged( const SdrObject& rObj );
- virtual void MarkListHasChanged();
-
- SdrObjUserCall* GetSdrUserCall() { return pUserCall.get(); }
-
-public:
-
- GraphCtrl( vcl::Window* pParent, WinBits nStyle );
- virtual ~GraphCtrl() override;
- virtual void dispose() override;
-
- void SetGraphic( const Graphic& rGraphic, bool bNewModel = true );
- const Graphic& GetGraphic() const { return aGraphic; }
- const Size& GetGraphicSize() const { return aGraphSize; }
-
- const Point& GetMousePos() const { return aMousePos; }
-
- void SetEditMode( const bool bEditMode );
-
- void SetPolyEditMode( const sal_uInt16 nPolyEdit );
- sal_uInt16 GetPolyEditMode() const { return nPolyEdit; }
-
- void SetObjKind( const SdrObjKind eObjKind );
-
- SdrModel* GetSdrModel() const { return pModel.get(); }
- SdrView* GetSdrView() const { return pView.get(); }
- SdrObject* GetSelectedSdrObject() const;
- bool IsChanged() const { return mbSdrMode && pModel->IsChanged(); }
-
- void SetMousePosLink( const Link<GraphCtrl*,void>& rLink ) { aMousePosLink = rLink; }
-
- void SetGraphSizeLink( const Link<GraphCtrl*,void>& rLink ) { aGraphSizeLink = rLink; }
-
- void SetUpdateLink( const Link<GraphCtrl*,void>& rLink ) { aUpdateLink = rLink; }
- void QueueIdleUpdate();
-
- void SetSdrMode(bool b);
-};
-
class SVX_DLLPUBLIC SvxGraphCtrl : public weld::CustomWidgetController
{
friend class SvxGraphCtrlView;
@@ -222,26 +129,6 @@ public:
virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessible() override;
};
-class GraphCtrlView : public SdrView
-{
- GraphCtrl& rGraphCtrl;
-
-protected:
-
- virtual void MarkListHasChanged() override
- {
- SdrView::MarkListHasChanged();
- rGraphCtrl.MarkListHasChanged();
- }
-
-public:
- GraphCtrlView(SdrModel& rSdrModel, GraphCtrl* pWindow)
- : SdrView(rSdrModel, pWindow)
- , rGraphCtrl(*pWindow)
- {
- }
-};
-
class SvxGraphCtrlView : public SdrView
{
SvxGraphCtrl& rGraphCtrl;
diff --git a/svx/source/dialog/graphctl.cxx b/svx/source/dialog/graphctl.cxx
index fea3d733157b..b5e8023d825f 100644
--- a/svx/source/dialog/graphctl.cxx
+++ b/svx/source/dialog/graphctl.cxx
@@ -36,25 +36,6 @@
#include <svx/svdpage.hxx>
#include <svx/sdrpaintwindow.hxx>
-void GraphCtrlUserCall::Changed( const SdrObject& rObj, SdrUserCallType eType, const tools::Rectangle& /*rOldBoundRect*/ )
-{
- switch( eType )
- {
- case SdrUserCallType::MoveOnly:
- case SdrUserCallType::Resize:
- rWin.SdrObjChanged( rObj );
- break;
-
- case SdrUserCallType::Inserted:
- rWin.SdrObjCreated( rObj );
- break;
-
- default:
- break;
- }
- rWin.QueueIdleUpdate();
-}
-
void SvxGraphCtrlUserCall::Changed( const SdrObject& rObj, SdrUserCallType eType, const tools::Rectangle& /*rOldBoundRect*/ )
{
switch( eType )
@@ -74,689 +55,6 @@ void SvxGraphCtrlUserCall::Changed( const SdrObject& rObj, SdrUserCallType eType
rWin.QueueIdleUpdate();
}
-GraphCtrl::GraphCtrl( vcl::Window* pParent, WinBits nStyle ) :
- Control ( pParent, nStyle ),
- aUpdateIdle ( "svx GraphCtrl Update" ),
- aMap100 ( MapUnit::Map100thMM ),
- eObjKind ( OBJ_NONE ),
- nPolyEdit ( 0 ),
- bEditMode ( false ),
- mbSdrMode ( false ),
- mbInIdleUpdate ( false )
-{
- pUserCall.reset(new GraphCtrlUserCall( *this ));
- aUpdateIdle.SetPriority( TaskPriority::LOWEST );
- aUpdateIdle.SetInvokeHandler( LINK( this, GraphCtrl, UpdateHdl ) );
- aUpdateIdle.Start();
- EnableRTL( false );
-}
-
-GraphCtrl::~GraphCtrl()
-{
- disposeOnce();
-}
-
-void GraphCtrl::dispose()
-{
- aUpdateIdle.Stop();
-
- if( mpAccContext.is() )
- {
- mpAccContext.clear();
- }
- pView.reset();
- pModel.reset();
- pUserCall.reset();
- Control::dispose();
-}
-
-void GraphCtrl::SetSdrMode(bool bSdrMode)
-{
- mbSdrMode = bSdrMode;
-
- const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
- SetBackground( Wallpaper( rStyleSettings.GetWindowColor() ) );
- SetMapMode( aMap100 );
-
- pView.reset();
- pModel.reset();
-
- if ( mbSdrMode )
- InitSdrModel();
-
- QueueIdleUpdate();
-}
-
-void GraphCtrl::InitSdrModel()
-{
- SolarMutexGuard aGuard;
-
- SdrPage* pPage;
-
- // destroy old junk
- pView.reset();
- pModel.reset();
-
- // Creating a Model
- pModel.reset(new SdrModel(nullptr, nullptr, true));
- pModel->GetItemPool().FreezeIdRanges();
- pModel->SetScaleUnit( aMap100.GetMapUnit() );
- pModel->SetScaleFraction( Fraction( 1, 1 ) );
- pModel->SetDefaultFontHeight( 500 );
-
- pPage = new SdrPage( *pModel );
-
- pPage->SetSize( aGraphSize );
- pPage->SetBorder( 0, 0, 0, 0 );
- pModel->InsertPage( pPage );
- pModel->SetChanged( false );
-
- // Creating a View
- pView.reset(new GraphCtrlView(*pModel, this));
- pView->SetWorkArea( tools::Rectangle( Point(), aGraphSize ) );
- pView->EnableExtendedMouseEventDispatcher( true );
- pView->ShowSdrPage(pView->GetModel()->GetPage(0));
- pView->SetFrameDragSingles();
- pView->SetMarkedPointsSmooth( SdrPathSmoothKind::Symmetric );
- pView->SetEditMode();
-
- // #i72889# set needed flags
- pView->SetPagePaintingAllowed(false);
- pView->SetBufferedOutputAllowed(true);
- pView->SetBufferedOverlayAllowed(true);
-
- // Tell the accessibility object about the changes.
- if (mpAccContext.is())
- mpAccContext->setModelAndView (pModel.get(), pView.get());
-}
-
-void GraphCtrl::SetGraphic( const Graphic& rGraphic, bool bNewModel )
-{
- aGraphic = rGraphic;
-
- if ( aGraphic.GetPrefMapMode().GetMapUnit() == MapUnit::MapPixel )
- aGraphSize = Application::GetDefaultDevice()->PixelToLogic( aGraphic.GetPrefSize(), aMap100 );
- else
- aGraphSize = OutputDevice::LogicToLogic( aGraphic.GetPrefSize(), aGraphic.GetPrefMapMode(), aMap100 );
-
- if ( mbSdrMode && bNewModel )
- InitSdrModel();
-
- aGraphSizeLink.Call( this );
-
- Resize();
-
- Invalidate();
- QueueIdleUpdate();
-}
-
-void GraphCtrl::Resize()
-{
- Control::Resize();
-
- if ( aGraphSize.Width() && aGraphSize.Height() )
- {
- MapMode aDisplayMap( aMap100 );
- Point aNewPos;
- Size aNewSize;
- const Size aWinSize = PixelToLogic( GetOutputSizePixel(), aDisplayMap );
- const long nWidth = aWinSize.Width();
- const long nHeight = aWinSize.Height();
- double fGrfWH = static_cast<double>(aGraphSize.Width()) / aGraphSize.Height();
- double fWinWH = static_cast<double>(nWidth) / nHeight;
-
- // Adapt Bitmap to Thumb size
- if ( fGrfWH < fWinWH)
- {
- aNewSize.setWidth( static_cast<long>( static_cast<double>(nHeight) * fGrfWH ) );
- aNewSize.setHeight( nHeight );
- }
- else
- {
- aNewSize.setWidth( nWidth );
- aNewSize.setHeight( static_cast<long>( static_cast<double>(nWidth) / fGrfWH ) );
- }
-
- aNewPos.setX( ( nWidth - aNewSize.Width() ) >> 1 );
- aNewPos.setY( ( nHeight - aNewSize.Height() ) >> 1 );
-
- // Implementing MapMode for Engine
- aDisplayMap.SetScaleX( Fraction( aNewSize.Width(), aGraphSize.Width() ) );
- aDisplayMap.SetScaleY( Fraction( aNewSize.Height(), aGraphSize.Height() ) );
-
- aDisplayMap.SetOrigin( LogicToLogic( aNewPos, aMap100, aDisplayMap ) );
- SetMapMode( aDisplayMap );
- }
-
- Invalidate();
-}
-
-void GraphCtrl::Paint( vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect)
-{
- // #i72889# used split repaint to be able to paint an own background
- // even to the buffered view
- const bool bGraphicValid(GraphicType::NONE != aGraphic.GetType());
-
- if (mbSdrMode)
- {
- SdrPaintWindow* pPaintWindow = pView->BeginCompleteRedraw(&rRenderContext);
-
- if (bGraphicValid)
- {
- vcl::RenderContext& rTarget = pPaintWindow->GetTargetOutputDevice();
-
- rTarget.SetBackground(GetBackground());
- rTarget.Erase();
-
- aGraphic.Draw(&rTarget, Point(), aGraphSize);
- }
-
- const vcl::Region aRepaintRegion(rRect);
- pView->DoCompleteRedraw(*pPaintWindow, aRepaintRegion);
- pView->EndCompleteRedraw(*pPaintWindow, true);
- }
- else
- {
- // #i73381# in non-SdrMode, paint to local directly
- if(bGraphicValid)
- {
- aGraphic.Draw(&rRenderContext, Point(), aGraphSize);
- }
- }
-}
-
-void GraphCtrl::SdrObjChanged( const SdrObject& )
-{
- QueueIdleUpdate();
-}
-
-void GraphCtrl::SdrObjCreated( const SdrObject& )
-{
- QueueIdleUpdate();
-}
-
-void GraphCtrl::MarkListHasChanged()
-{
- QueueIdleUpdate();
-}
-
-void GraphCtrl::KeyInput( const KeyEvent& rKEvt )
-{
- vcl::KeyCode aCode( rKEvt.GetKeyCode() );
- bool bProc = false;
-
- Dialog* pDialog = GetParentDialog();
-
- switch ( aCode.GetCode() )
- {
- case KEY_DELETE:
- case KEY_BACKSPACE:
- {
- if ( mbSdrMode )
- {
- pView->DeleteMarked();
- bProc = true;
- if (!pView->AreObjectsMarked() && pDialog)
- pDialog->GrabFocusToFirstControl();
- }
- }
- break;
-
- case KEY_ESCAPE:
- {
- if ( mbSdrMode )
- {
- bool bGrabFocusToFirstControl = true;
- if ( pView->IsAction() )
- {
- pView->BrkAction();
- bGrabFocusToFirstControl = false;
- }
- else if ( pView->AreObjectsMarked() )
- {
- const SdrHdlList& rHdlList = pView->GetHdlList();
- SdrHdl* pHdl = rHdlList.GetFocusHdl();
-
- if(pHdl)
- {
- const_cast<SdrHdlList&>(rHdlList).ResetFocusHdl();
- bGrabFocusToFirstControl = false;
- }
- }
- if (bGrabFocusToFirstControl && pDialog)
- pDialog->GrabFocusToFirstControl();
- bProc = true;
- }
- }
- break;
-
- case KEY_F11:
- case KEY_TAB:
- {
- if( mbSdrMode )
- {
- if( !aCode.IsMod1() && !aCode.IsMod2() )
- {
- bool bForward = !aCode.IsShift();
- // select next object
- if ( ! pView->MarkNextObj( bForward ))
- {
- // At first or last object. Cycle to the other end
- // of the list.
- pView->UnmarkAllObj();
- pView->MarkNextObj (bForward);
- }
- bProc = true;
- }
- else if(aCode.IsMod1())
- {
- // select next handle
- const SdrHdlList& rHdlList = pView->GetHdlList();
- bool bForward(!aCode.IsShift());
-
- const_cast<SdrHdlList&>(rHdlList).TravelFocusHdl(bForward);
-
- bProc = true;
- }
- }
- }
- break;
-
- case KEY_END:
- {
-
- if ( aCode.IsMod1() )
- {
- // mark last object
- pView->UnmarkAllObj();
- pView->MarkNextObj();
-
- bProc = true;
- }
- }
- break;
-
- case KEY_HOME:
- {
- if ( aCode.IsMod1() )
- {
- pView->UnmarkAllObj();
- pView->MarkNextObj(true);
-
- bProc = true;
- }
- }
- break;
-
- case KEY_UP:
- case KEY_DOWN:
- case KEY_LEFT:
- case KEY_RIGHT:
- {
- long nX = 0;
- long nY = 0;
-
- if (aCode.GetCode() == KEY_UP)
- {
- // Scroll up
- nX = 0;
- nY =-1;
- }
- else if (aCode.GetCode() == KEY_DOWN)
- {
- // Scroll down
- nX = 0;
- nY = 1;
- }
- else if (aCode.GetCode() == KEY_LEFT)
- {
- // Scroll left
- nX =-1;
- nY = 0;
- }
- else if (aCode.GetCode() == KEY_RIGHT)
- {
- // Scroll right
- nX = 1;
- nY = 0;
- }
-
- if (pView->AreObjectsMarked() && !aCode.IsMod1() )
- {
- if(aCode.IsMod2())
- {
- // move in 1 pixel distance
- Size aLogicSizeOnePixel = PixelToLogic(Size(1,1));
- nX *= aLogicSizeOnePixel.Width();
- nY *= aLogicSizeOnePixel.Height();
- }
- else
- {
- // old, fixed move distance
- nX *= 100;
- nY *= 100;
- }
-
- // II
- const SdrHdlList& rHdlList = pView->GetHdlList();
- SdrHdl* pHdl = rHdlList.GetFocusHdl();
-
- if(nullptr == pHdl)
- {
- // restrict movement to WorkArea
- const tools::Rectangle& rWorkArea = pView->GetWorkArea();
-
- if(!rWorkArea.IsEmpty())
- {
- tools::Rectangle aMarkRect(pView->GetMarkedObjRect());
- aMarkRect.Move(nX, nY);
-
- if(!aMarkRect.IsInside(rWorkArea))
- {
- if(aMarkRect.Left() < rWorkArea.Left())
- {
- nX += rWorkArea.Left() - aMarkRect.Left();
- }
-
- if(aMarkRect.Right() > rWorkArea.Right())
- {
- nX -= aMarkRect.Right() - rWorkArea.Right();
- }
-
- if(aMarkRect.Top() < rWorkArea.Top())
- {
- nY += rWorkArea.Top() - aMarkRect.Top();
- }
-
- if(aMarkRect.Bottom() > rWorkArea.Bottom())
- {
- nY -= aMarkRect.Bottom() - rWorkArea.Bottom();
- }
- }
- }
-
- // no handle selected
- if(0 != nX || 0 != nY)
- {
- pView->MoveAllMarked(Size(nX, nY));
- }
- }
- else
- {
- // move handle with index nHandleIndex
- if (nX || nY)
- {
- // now move the Handle (nX, nY)
- Point aStartPoint(pHdl->GetPos());
- Point aEndPoint(pHdl->GetPos() + Point(nX, nY));
- const SdrDragStat& rDragStat = pView->GetDragStat();
-
- // start dragging
- pView->BegDragObj(aStartPoint, nullptr, pHdl, 0);
-
- if(pView->IsDragObj())
- {
- bool bWasNoSnap = rDragStat.IsNoSnap();
- bool bWasSnapEnabled = pView->IsSnapEnabled();
-
- // switch snapping off
- if(!bWasNoSnap)
- const_cast<SdrDragStat&>(rDragStat).SetNoSnap();
- if(bWasSnapEnabled)
- pView->SetSnapEnabled(false);
-
- pView->MovAction(aEndPoint);
- pView->EndDragObj();
-
- // restore snap
- if(!bWasNoSnap)
- const_cast<SdrDragStat&>(rDragStat).SetNoSnap(bWasNoSnap);
- if(bWasSnapEnabled)
- pView->SetSnapEnabled(bWasSnapEnabled);
- }
- }
- }
-
- bProc = true;
- }
- }
- break;
-
- case KEY_SPACE:
- {
- const SdrHdlList& rHdlList = pView->GetHdlList();
- SdrHdl* pHdl = rHdlList.GetFocusHdl();
-
- if(pHdl)
- {
- if(pHdl->GetKind() == SdrHdlKind::Poly)
- {
- // rescue ID of point with focus
- sal_uInt32 nPol(pHdl->GetPolyNum());
- sal_uInt32 nPnt(pHdl->GetPointNum());
-
- if(pView->IsPointMarked(*pHdl))
- {
- if(rKEvt.GetKeyCode().IsShift())
- {
- pView->UnmarkPoint(*pHdl);
- }
- }
- else
- {
- if(!rKEvt.GetKeyCode().IsShift())
- {
- pView->UnmarkAllPoints();
- }
-
- pView->MarkPoint(*pHdl);
- }
-
- if(nullptr == rHdlList.GetFocusHdl())
- {
- // restore point with focus
- SdrHdl* pNewOne = nullptr;
-
- for(size_t a = 0; !pNewOne && a < rHdlList.GetHdlCount(); ++a)
- {
- SdrHdl* pAct = rHdlList.GetHdl(a);
-
- if(pAct
- && pAct->GetKind() == SdrHdlKind::Poly
- && pAct->GetPolyNum() == nPol
- && pAct->GetPointNum() == nPnt)
- {
- pNewOne = pAct;
- }
- }
-
- if(pNewOne)
- {
- const_cast<SdrHdlList&>(rHdlList).SetFocusHdl(pNewOne);
- }
- }
-
- bProc = true;
- }
- }
- }
- break;
-
- default:
- break;
- }
-
- if ( !bProc )
- Control::KeyInput( rKEvt );
- else
- ReleaseMouse();
-
- QueueIdleUpdate();
-}
-
-void GraphCtrl::MouseButtonDown( const MouseEvent& rMEvt )
-{
- if ( mbSdrMode && ( rMEvt.GetClicks() < 2 ) )
- {
- const Point aLogPt( PixelToLogic( rMEvt.GetPosPixel() ) );
-
- if ( !tools::Rectangle( Point(), aGraphSize ).IsInside( aLogPt ) && !pView->IsEditMode() )
- Control::MouseButtonDown( rMEvt );
- else
- {
- // Get Focus for key inputs
- GrabFocus();
-
- if ( nPolyEdit )
- {
- SdrViewEvent aVEvt;
- SdrHitKind eHit = pView->PickAnything( rMEvt, SdrMouseEventKind::BUTTONDOWN, aVEvt );
-
- if ( nPolyEdit == SID_BEZIER_INSERT && eHit == SdrHitKind::MarkedObject )
- pView->BegInsObjPoint( aLogPt, rMEvt.IsMod1());
- else
- pView->MouseButtonDown( rMEvt, this );
- }
- else
- pView->MouseButtonDown( rMEvt, this );
- }
-
- SdrObject* pCreateObj = pView->GetCreateObj();
-
- // We want to realize the insert
- if ( pCreateObj && !pCreateObj->GetUserCall() )
- pCreateObj->SetUserCall( pUserCall.get() );
-
- SetPointer( pView->GetPreferredPointer( aLogPt, this ) );
- }
- else
- Control::MouseButtonDown( rMEvt );
-
- QueueIdleUpdate();
-}
-
-void GraphCtrl::MouseMove(const MouseEvent& rMEvt)
-{
- const Point aLogPos( PixelToLogic( rMEvt.GetPosPixel() ) );
-
- if ( mbSdrMode )
- {
- pView->MouseMove( rMEvt, this );
-
- if( ( SID_BEZIER_INSERT == nPolyEdit ) &&
- !pView->PickHandle( aLogPos ) &&
- !pView->IsInsObjPoint() )
- {
- SetPointer( PointerStyle::Cross );
- }
- else
- SetPointer( pView->GetPreferredPointer( aLogPos, this ) );
- }
- else
- Control::MouseButtonUp( rMEvt );
-
- if ( aMousePosLink.IsSet() )
- {
- if ( tools::Rectangle( Point(), aGraphSize ).IsInside( aLogPos ) )
- aMousePos = aLogPos;
- else
- aMousePos = Point();
-
- aMousePosLink.Call( this );
- }
-
- QueueIdleUpdate();
-}
-
-void GraphCtrl::MouseButtonUp(const MouseEvent& rMEvt)
-{
- if ( mbSdrMode )
- {
- if ( pView->IsInsObjPoint() )
- pView->EndInsObjPoint( SdrCreateCmd::ForceEnd );
- else
- pView->MouseButtonUp( rMEvt, this );
-
- ReleaseMouse();
- SetPointer( pView->GetPreferredPointer( PixelToLogic( rMEvt.GetPosPixel() ), this ) );
- }
- else
- Control::MouseButtonUp( rMEvt );
-
- QueueIdleUpdate();
-}
-
-SdrObject* GraphCtrl::GetSelectedSdrObject() const
-{
- SdrObject* pSdrObj = nullptr;
-
- if ( mbSdrMode )
- {
- const SdrMarkList& rMarkList = pView->GetMarkedObjectList();
-
- if ( rMarkList.GetMarkCount() == 1 )
- pSdrObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
- }
-
- return pSdrObj;
-}
-
-void GraphCtrl::SetEditMode( const bool _bEditMode )
-{
- if ( mbSdrMode )
- {
- bEditMode = _bEditMode;
- pView->SetEditMode( bEditMode );
- eObjKind = OBJ_NONE;
- pView->SetCurrentObj( sal::static_int_cast< sal_uInt16 >( eObjKind ) );
- }
- else
- bEditMode = false;
-
- QueueIdleUpdate();
-}
-
-void GraphCtrl::SetPolyEditMode( const sal_uInt16 _nPolyEdit )
-{
- if ( mbSdrMode && ( _nPolyEdit != nPolyEdit ) )
- {
- nPolyEdit = _nPolyEdit;
- pView->SetFrameDragSingles( nPolyEdit == 0 );
- }
- else
- nPolyEdit = 0;
-
- QueueIdleUpdate();
-}
-
-void GraphCtrl::SetObjKind( const SdrObjKind _eObjKind )
-{
- if ( mbSdrMode )
- {
- bEditMode = false;
- pView->SetEditMode( bEditMode );
- eObjKind = _eObjKind;
- pView->SetCurrentObj( sal::static_int_cast< sal_uInt16 >( eObjKind ) );
- }
- else
- eObjKind = OBJ_NONE;
-
- QueueIdleUpdate();
-}
-
-IMPL_LINK( GraphCtrl, UpdateHdl, Timer *, , void )
-{
- mbInIdleUpdate = true;
- aUpdateLink.Call( this );
- mbInIdleUpdate = false;
-}
-
-void GraphCtrl::QueueIdleUpdate()
-{
- if (!mbInIdleUpdate)
- aUpdateIdle.Start();
-}
-
SvxGraphCtrl::SvxGraphCtrl(weld::Dialog* pDialog)
: aUpdateIdle("svx GraphCtrl Update")
, aMap100(MapUnit::Map100thMM)
commit 80606c1706ef0fcb77ad4afcd0c1dbc298a5afc4
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Wed May 22 16:27:52 2019 +0100
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Thu May 23 17:33:30 2019 +0200
SFX_IMPL_FLOATINGWINDOW_WITHID is now unused
Change-Id: I93f3dccb1aac4a018f5a5dd7af61024306099675
Reviewed-on: https://gerrit.libreoffice.org/72802
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/include/sfx2/childwin.hxx b/include/sfx2/childwin.hxx
index ce6dcb47b5fe..626b2c85a298 100644
--- a/include/sfx2/childwin.hxx
+++ b/include/sfx2/childwin.hxx
@@ -282,14 +282,6 @@ public:
static_cast<SfxFloatingWindow*>(GetWindow())->FillInfo( aInfo ); \
return aInfo; }
-#define SFX_IMPL_FLOATINGWINDOW_WITHID(Class, MyID) \
- SFX_IMPL_CHILDWINDOW_WITHID(Class, MyID) \
- SfxChildWinInfo Class::GetInfo() const \
- { \
- SfxChildWinInfo aInfo = SfxChildWindow::GetInfo(); \
- static_cast<SfxFloatingWindow*>(GetWindow())->FillInfo( aInfo ); \
- return aInfo; }
-
#define SFX_IMPL_MODELESSDIALOGCONTOLLER_WITHID(Class, MyID) \
SFX_IMPL_CHILDWINDOW_WITHID(Class, MyID) \
SfxChildWinInfo Class::GetInfo() const \
More information about the Libreoffice-commits
mailing list