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:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user