summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorGraeme Geldenhuys <graeme@mastermaths.co.za>2012-11-22 16:39:03 +0000
committerGraeme Geldenhuys <graeme@mastermaths.co.za>2012-11-22 17:17:23 +0000
commit62127dd81422fb19f92543e925fc82f8a08a34cf (patch)
tree5f669a94ec75701dbcce74270ddfb612560f8d88 /src/gui
parent9beea9c7f0355f1619cfabd1bddf889b99645154 (diff)
downloadfpGUI-62127dd81422fb19f92543e925fc82f8a08a34cf.tar.xz
Fixes bug #163 - SelectionText returns all text if there was no selection.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/fpg_memo.pas6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gui/fpg_memo.pas b/src/gui/fpg_memo.pas
index a4c3dc26..df16367b 100644
--- a/src/gui/fpg_memo.pas
+++ b/src/gui/fpg_memo.pas
@@ -1579,6 +1579,12 @@ var
st: integer;
s: TfpgString;
begin
+ if FSelEndLine = -1 then { no text is selected }
+ begin
+ Result := '';
+ Exit;
+ end;
+
if (FSelStartLine shl 16) + FSelStartPos <= (FSelEndLine shl 16) + FSelEndPos then
begin
selsl := FSelStartLine;