TextEditor: Resolve TODO and call Insert() and Remove()...

... which both already exist in the TextDocument API (stubbed out or
untested as they are).
This commit is contained in:
Stephan Aßmus
2014-01-19 15:56:07 +01:00
parent 13d17b5b01
commit 315dee6f22
2 changed files with 11 additions and 10 deletions
+8 -8
View File
@@ -237,23 +237,23 @@ TextEditor::KeyDown(KeyEvent event)
}
void
status_t
TextEditor::Insert(int32 offset, const BString& string)
{
if (!fEditingEnabled)
return;
if (!fEditingEnabled || fDocument.Get() == NULL)
return B_ERROR;
// TODO: ...
return fDocument->Insert(offset, string, fStyleAtCaret);
}
void
status_t
TextEditor::Remove(int32 offset, int32 length)
{
if (!fEditingEnabled)
return;
if (!fEditingEnabled || fDocument.Get() == NULL)
return B_ERROR;
// TODO: ...
return fDocument->Remove(offset, length);
}
+3 -2
View File
@@ -58,8 +58,8 @@ public:
virtual void KeyDown(KeyEvent event);
virtual void Insert(int32 offset, const BString& string);
virtual void Remove(int32 offset, int32 length);
virtual status_t Insert(int32 offset, const BString& string);
virtual status_t Remove(int32 offset, int32 length);
void LineUp(bool select);
void LineDown(bool select);
@@ -84,6 +84,7 @@ private:
bool updateSelectionStyle);
void _UpdateStyleAtCaret();
private:
TextDocumentRef fDocument;
TextDocumentLayoutRef fLayout;