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)
|
TextEditor::Insert(int32 offset, const BString& string)
|
||||||
{
|
{
|
||||||
if (!fEditingEnabled)
|
if (!fEditingEnabled || fDocument.Get() == NULL)
|
||||||
return;
|
return B_ERROR;
|
||||||
|
|
||||||
// TODO: ...
|
return fDocument->Insert(offset, string, fStyleAtCaret);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
status_t
|
||||||
TextEditor::Remove(int32 offset, int32 length)
|
TextEditor::Remove(int32 offset, int32 length)
|
||||||
{
|
{
|
||||||
if (!fEditingEnabled)
|
if (!fEditingEnabled || fDocument.Get() == NULL)
|
||||||
return;
|
return B_ERROR;
|
||||||
|
|
||||||
// TODO: ...
|
return fDocument->Remove(offset, length);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -58,8 +58,8 @@ public:
|
|||||||
|
|
||||||
virtual void KeyDown(KeyEvent event);
|
virtual void KeyDown(KeyEvent event);
|
||||||
|
|
||||||
virtual void Insert(int32 offset, const BString& string);
|
virtual status_t Insert(int32 offset, const BString& string);
|
||||||
virtual void Remove(int32 offset, int32 length);
|
virtual status_t Remove(int32 offset, int32 length);
|
||||||
|
|
||||||
void LineUp(bool select);
|
void LineUp(bool select);
|
||||||
void LineDown(bool select);
|
void LineDown(bool select);
|
||||||
@@ -84,6 +84,7 @@ private:
|
|||||||
bool updateSelectionStyle);
|
bool updateSelectionStyle);
|
||||||
|
|
||||||
void _UpdateStyleAtCaret();
|
void _UpdateStyleAtCaret();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
TextDocumentRef fDocument;
|
TextDocumentRef fDocument;
|
||||||
TextDocumentLayoutRef fLayout;
|
TextDocumentLayoutRef fLayout;
|
||||||
|
|||||||
Reference in New Issue
Block a user