diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-02-12 10:12:03 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-02-13 11:00:17 +0100 |
commit | a2b687a88feedfae0087bfc999b3cf49b9d3d24b (patch) | |
tree | 1615bf7094f106a4f92ee4aa460599a2c84282bf /editeng | |
parent | ad6d9bce1126997750d3c3c2606d28164d63d1d8 (diff) |
Pointer is pointless
since it is just a wrapper around PointerStyle
Change-Id: I51f065e0d4ad8bd91f5c84c5819048c720a19267
Reviewed-on: https://gerrit.libreoffice.org/67711
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/editeng/editview.cxx | 2 | ||||
-rw-r--r-- | editeng/source/editeng/impedit.hxx | 24 | ||||
-rw-r--r-- | editeng/source/outliner/outlvw.cxx | 11 |
3 files changed, 20 insertions, 17 deletions
diff --git a/editeng/source/editeng/editview.cxx b/editeng/source/editeng/editview.cxx index 713028a67d0b..18408c38d9bf 100644 --- a/editeng/source/editeng/editview.cxx +++ b/editeng/source/editeng/editview.cxx @@ -399,7 +399,7 @@ const tools::Rectangle& EditView::GetOutputArea() const return pImpEditView->GetOutputArea(); } -const Pointer& EditView::GetPointer() const +PointerStyle EditView::GetPointer() const { return pImpEditView->GetPointer(); } diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx index b85046088c41..a1e332f6db05 100644 --- a/editeng/source/editeng/impedit.hxx +++ b/editeng/source/editeng/impedit.hxx @@ -39,6 +39,7 @@ #include <tools/fract.hxx> #include <vcl/idle.hxx> #include <vcl/commandevent.hxx> +#include <vcl/ptrstyle.hxx> #include <vcl/dndhelp.hxx> #include <svl/ondemand.hxx> @@ -60,6 +61,7 @@ #include <o3tl/deleter.hxx> #include <o3tl/typed_flags_set.hxx> +#include <boost/optional.hpp> #include <memory> #include <vector> @@ -236,7 +238,7 @@ private: EditEngine* pEditEngine; VclPtr<vcl::Window> pOutWin; EditView::OutWindowSet aOutWindowSet; - std::unique_ptr<Pointer> pPointer; + boost::optional<PointerStyle> mxPointer; std::unique_ptr<DragAndDropInfo> pDragAndDropInfo; css::uno::Reference< css::datatransfer::dnd::XDragSourceListener > mxDnDListener; @@ -350,7 +352,7 @@ public: void SetSelectionMode( EESelectionMode eMode ); - inline const Pointer& GetPointer(); + inline PointerStyle GetPointer(); inline vcl::Cursor* GetCursor(); @@ -1196,24 +1198,24 @@ inline sal_uInt16 ImpEditEngine::GetYValue( sal_uInt16 nYValue ) const return static_cast<sal_uInt16>(static_cast<long>(nYValue)*nStretchY/100); } -inline const Pointer& ImpEditView::GetPointer() +inline PointerStyle ImpEditView::GetPointer() { - if ( !pPointer ) + if ( !mxPointer ) { - pPointer.reset( new Pointer( IsVertical() ? PointerStyle::TextVertical : PointerStyle::Text ) ); - return *pPointer; + mxPointer = IsVertical() ? PointerStyle::TextVertical : PointerStyle::Text; + return *mxPointer; } - if(PointerStyle::Text == pPointer->GetStyle() && IsVertical()) + if(PointerStyle::Text == *mxPointer && IsVertical()) { - pPointer.reset( new Pointer(PointerStyle::TextVertical) ); + mxPointer = PointerStyle::TextVertical; } - else if(PointerStyle::TextVertical == pPointer->GetStyle() && !IsVertical()) + else if(PointerStyle::TextVertical == *mxPointer && !IsVertical()) { - pPointer.reset( new Pointer(PointerStyle::Text) ); + mxPointer = PointerStyle::Text; } - return *pPointer; + return *mxPointer; } inline vcl::Cursor* ImpEditView::GetCursor() diff --git a/editeng/source/outliner/outlvw.cxx b/editeng/source/outliner/outlvw.cxx index 1b7013839aeb..7e6c463836c9 100644 --- a/editeng/source/outliner/outlvw.cxx +++ b/editeng/source/outliner/outlvw.cxx @@ -42,6 +42,7 @@ #include <editeng/numitem.hxx> #include <vcl/window.hxx> #include <vcl/event.hxx> +#include <vcl/ptrstyle.hxx> #include <svl/itemset.hxx> #include <svl/eitem.hxx> #include <editeng/editstat.hxx> @@ -292,7 +293,7 @@ bool OutlinerView::MouseMove( const MouseEvent& rMEvt ) if( !pEditView->GetOutputArea().IsInside( aMousePosWin ) ) return false; - Pointer aPointer = GetPointer( rMEvt.GetPosPixel() ); + PointerStyle aPointer = GetPointer( rMEvt.GetPosPixel() ); pEditView->GetWindow()->SetPointer( aPointer ); return pEditView->MouseMove( rMEvt ); } @@ -307,7 +308,7 @@ bool OutlinerView::MouseButtonDown( const MouseEvent& rMEvt ) if( !pEditView->GetOutputArea().IsInside( aMousePosWin ) ) return false; - Pointer aPointer = GetPointer( rMEvt.GetPosPixel() ); + PointerStyle aPointer = GetPointer( rMEvt.GetPosPixel() ); pEditView->GetWindow()->SetPointer( aPointer ); MouseTarget eTarget; @@ -355,7 +356,7 @@ bool OutlinerView::MouseButtonUp( const MouseEvent& rMEvt ) if( !pEditView->GetOutputArea().IsInside( aMousePosWin ) ) return false; - Pointer aPointer = GetPointer( rMEvt.GetPosPixel() ); + PointerStyle aPointer = GetPointer( rMEvt.GetPosPixel() ); pEditView->GetWindow()->SetPointer( aPointer ); return pEditView->MouseButtonUp( rMEvt ); @@ -729,7 +730,7 @@ SfxStyleSheet* OutlinerView::GetStyleSheet() return pEditView->GetStyleSheet(); } -Pointer OutlinerView::GetPointer( const Point& rPosPixel ) +PointerStyle OutlinerView::GetPointer( const Point& rPosPixel ) { MouseTarget eTarget; ImpCheckMousePos( rPosPixel, eTarget ); @@ -748,7 +749,7 @@ Pointer OutlinerView::GetPointer( const Point& rPosPixel ) ePointerStyle = PointerStyle::Move; } - return Pointer( ePointerStyle ); + return ePointerStyle; } |