[fbreader] Added ZLTextArea::selectionIsEmpty() and clearSelection()
This commit is contained in:
parent
48cb24f8a1
commit
c8bad41b7f
2 changed files with 13 additions and 2 deletions
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2004-2010 Geometer Plus <contact@geometerplus.com>
|
* Copyright (C) 2004-2010 Geometer Plus <contact@geometerplus.com>
|
||||||
* Copyright (C) 2016 Slava Monich <slava.monich@jolla.com>
|
* Copyright (C) 2016-2017 Slava Monich <slava.monich@jolla.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -69,6 +69,15 @@ void ZLTextArea::clear() {
|
||||||
myTextElementMap.clear();
|
myTextElementMap.clear();
|
||||||
myTreeNodeMap.clear();
|
myTreeNodeMap.clear();
|
||||||
|
|
||||||
|
clearSelection();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool ZLTextArea::selectionIsEmpty() const
|
||||||
|
{
|
||||||
|
return mySelectionModel.isNull() || mySelectionModel->isEmpty();
|
||||||
|
}
|
||||||
|
|
||||||
|
void ZLTextArea::clearSelection() const {
|
||||||
if (!mySelectionModel.isNull()) {
|
if (!mySelectionModel.isNull()) {
|
||||||
mySelectionModel->clear();
|
mySelectionModel->clear();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2004-2010 Geometer Plus <contact@geometerplus.com>
|
* Copyright (C) 2004-2010 Geometer Plus <contact@geometerplus.com>
|
||||||
* Copyright (C) 2016 Slava Monich <slava.monich@jolla.com>
|
* Copyright (C) 2016-2017 Slava Monich <slava.monich@jolla.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -89,6 +89,8 @@ public:
|
||||||
int paragraphIndexByCoordinates(int x, int y, bool absolute = true) const;
|
int paragraphIndexByCoordinates(int x, int y, bool absolute = true) const;
|
||||||
|
|
||||||
ZLTextSelectionModel &selectionModel();
|
ZLTextSelectionModel &selectionModel();
|
||||||
|
bool selectionIsEmpty() const;
|
||||||
|
void clearSelection() const;
|
||||||
|
|
||||||
void paint(ZLSize *size = 0);
|
void paint(ZLSize *size = 0);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue