summaryrefslogtreecommitdiff
path: root/editeng
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-07-27 12:06:16 +0200
committerNoel Grandin <noel@peralex.com>2015-07-28 08:35:34 +0200
commit4eeeec899f44d2010189251c0f09120ade202dd8 (patch)
tree244f1d354d70cc54697acdf05db0025b05d0aa27 /editeng
parent01075a7274bd3921501d382a71720581a48bfd66 (diff)
convert RGCHK constants to scoped enum
Change-Id: Iafeae0f85f751469900471cf8fccd5f763407890
Diffstat (limited to 'editeng')
-rw-r--r--editeng/source/editeng/editview.cxx2
-rw-r--r--editeng/source/editeng/impedit.cxx12
-rw-r--r--editeng/source/editeng/impedit.hxx3
3 files changed, 9 insertions, 8 deletions
diff --git a/editeng/source/editeng/editview.cxx b/editeng/source/editeng/editview.cxx
index 049c5a1eb256..d9e4431d1012 100644
--- a/editeng/source/editeng/editview.cxx
+++ b/editeng/source/editeng/editview.cxx
@@ -407,7 +407,7 @@ void EditView::HideCursor()
pImpEditView->libreOfficeKitCallback(LOK_CALLBACK_CURSOR_VISIBLE, OString::boolean(false).getStr());
}
-Pair EditView::Scroll( long ndX, long ndY, sal_uInt8 nRangeCheck )
+Pair EditView::Scroll( long ndX, long ndY, ScrollRangeCheck nRangeCheck )
{
return pImpEditView->Scroll( ndX, ndY, nRangeCheck );
}
diff --git a/editeng/source/editeng/impedit.cxx b/editeng/source/editeng/impedit.cxx
index b79a32667fe7..106888096a51 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -973,7 +973,7 @@ void ImpEditView::ShowCursor( bool bGotoCursor, bool bForceVisCursor, sal_uInt16
}
}
-Pair ImpEditView::Scroll( long ndX, long ndY, sal_uInt8 nRangeCheck )
+Pair ImpEditView::Scroll( long ndX, long ndY, ScrollRangeCheck nRangeCheck )
{
DBG_ASSERT( pEditEngine->pImpEditEngine->IsFormatted(), "Scroll: Not formatted!" );
if ( !ndX && !ndY )
@@ -999,13 +999,13 @@ Pair ImpEditView::Scroll( long ndX, long ndY, sal_uInt8 nRangeCheck )
aNewVisArea.Top() += ndX;
aNewVisArea.Bottom() += ndX;
}
- if ( ( nRangeCheck == RGCHK_PAPERSZ1 ) && ( aNewVisArea.Bottom() > (long)pEditEngine->pImpEditEngine->GetTextHeight() ) )
+ if ( ( nRangeCheck == ScrollRangeCheck::PaperWidthTextSize ) && ( aNewVisArea.Bottom() > (long)pEditEngine->pImpEditEngine->GetTextHeight() ) )
{
// GetTextHeight still optimizing!
long nDiff = pEditEngine->pImpEditEngine->GetTextHeight() - aNewVisArea.Bottom(); // negative
aNewVisArea.Move( 0, nDiff ); // could end up in the negative area...
}
- if ( ( aNewVisArea.Top() < 0 ) && ( nRangeCheck != RGCHK_NONE ) )
+ if ( ( aNewVisArea.Top() < 0 ) && ( nRangeCheck != ScrollRangeCheck::NONE ) )
aNewVisArea.Move( 0, -aNewVisArea.Top() );
// Horizontal:
@@ -1019,12 +1019,12 @@ Pair ImpEditView::Scroll( long ndX, long ndY, sal_uInt8 nRangeCheck )
aNewVisArea.Left() -= ndY;
aNewVisArea.Right() -= ndY;
}
- if ( ( nRangeCheck == RGCHK_PAPERSZ1 ) && ( aNewVisArea.Right() > (long)pEditEngine->pImpEditEngine->CalcTextWidth( false ) ) )
+ if ( ( nRangeCheck == ScrollRangeCheck::PaperWidthTextSize ) && ( aNewVisArea.Right() > (long)pEditEngine->pImpEditEngine->CalcTextWidth( false ) ) )
{
long nDiff = pEditEngine->pImpEditEngine->CalcTextWidth( false ) - aNewVisArea.Right(); // negative
aNewVisArea.Move( nDiff, 0 ); // could end up in the negative area...
}
- if ( ( aNewVisArea.Left() < 0 ) && ( nRangeCheck != RGCHK_NONE ) )
+ if ( ( aNewVisArea.Left() < 0 ) && ( nRangeCheck != ScrollRangeCheck::NONE ) )
aNewVisArea.Move( -aNewVisArea.Left(), 0 );
// The difference must be alignt on pixel (due to scroll!)
@@ -1953,7 +1953,7 @@ void ImpEditView::dragOver(const ::com::sun::star::datatransfer::dnd::DropTarget
if ( nScrollX || nScrollY )
{
HideDDCursor();
- Scroll( nScrollX, nScrollY, RGCHK_PAPERSZ1 );
+ Scroll( nScrollX, nScrollY, ScrollRangeCheck::PaperWidthTextSize );
}
}
diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx
index f78185b2cc1c..bb199c0c3f51 100644
--- a/editeng/source/editeng/impedit.hxx
+++ b/editeng/source/editeng/impedit.hxx
@@ -29,6 +29,7 @@
#include <editeng/SpellPortions.hxx>
#include <editeng/eedata.hxx>
#include "editeng/editeng.hxx"
+#include <editeng/editview.hxx>
#include <vcl/virdev.hxx>
#include <vcl/gdimtf.hxx>
#include <vcl/cursor.hxx>
@@ -347,7 +348,7 @@ public:
void RecalcOutputArea();
void ShowCursor( bool bGotoCursor, bool bForceVisCursor, sal_uInt16 nShowCursorFlags = 0 );
- Pair Scroll( long ndX, long ndY, sal_uInt8 nRangeCheck = RGCHK_NEG );
+ Pair Scroll( long ndX, long ndY, ScrollRangeCheck nRangeCheck = ScrollRangeCheck::NoNegative );
void SetInsertMode( bool bInsert );
bool IsInsertMode() const { return !( nControl & EVControlBits::OVERWRITE ); }