summaryrefslogtreecommitdiff
path: root/indra/llui/lllineeditor.cpp
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2012-02-06 15:43:53 -0800
committerMerov Linden <merov@lindenlab.com>2012-02-06 15:43:53 -0800
commit9761375ac244af36635899c73e99efc46b68b589 (patch)
treefa48adfda40be0cced2c0425a09ddde99a1faf23 /indra/llui/lllineeditor.cpp
parentdb824cff75696c42fff80ba29dbb60f12d10a1da (diff)
EXP-1841 : Refactoring of LLClipboard, simplify the API and make it behave like a normal clipboard.
Diffstat (limited to 'indra/llui/lllineeditor.cpp')
-rw-r--r--indra/llui/lllineeditor.cpp19
1 files changed, 6 insertions, 13 deletions
diff --git a/indra/llui/lllineeditor.cpp b/indra/llui/lllineeditor.cpp
index 9292158b7c..e961cfb14f 100644
--- a/indra/llui/lllineeditor.cpp
+++ b/indra/llui/lllineeditor.cpp
@@ -1047,7 +1047,7 @@ void LLLineEditor::cut()
// Prepare for possible rollback
LLLineEditorRollback rollback( this );
- LLClipboard::getInstance()->copyFromSubstring( mText.getWString(), left_pos, length );
+ LLClipboard::getInstance()->copyToClipboard( mText.getWString(), left_pos, length );
deleteSelection();
// Validate new string and rollback the if needed.
@@ -1078,13 +1078,13 @@ void LLLineEditor::copy()
{
S32 left_pos = llmin( mSelectionStart, mSelectionEnd );
S32 length = llabs( mSelectionStart - mSelectionEnd );
- LLClipboard::getInstance()->copyFromSubstring( mText.getWString(), left_pos, length );
+ LLClipboard::getInstance()->copyToClipboard( mText.getWString(), left_pos, length );
}
}
BOOL LLLineEditor::canPaste() const
{
- return !mReadOnly && LLClipboard::getInstance()->canPasteString();
+ return !mReadOnly && LLClipboard::getInstance()->isTextAvailable();
}
void LLLineEditor::paste()
@@ -1115,14 +1115,7 @@ void LLLineEditor::pasteHelper(bool is_primary)
if (can_paste_it)
{
LLWString paste;
- if (is_primary)
- {
- paste = LLClipboard::getInstance()->getPastePrimaryWString();
- }
- else
- {
- paste = LLClipboard::getInstance()->getPasteWString();
- }
+ LLClipboard::getInstance()->pasteFromClipboard(paste, is_primary);
if (!paste.empty())
{
@@ -1209,13 +1202,13 @@ void LLLineEditor::copyPrimary()
{
S32 left_pos = llmin( mSelectionStart, mSelectionEnd );
S32 length = llabs( mSelectionStart - mSelectionEnd );
- LLClipboard::getInstance()->copyFromPrimarySubstring( mText.getWString(), left_pos, length );
+ LLClipboard::getInstance()->copyToClipboard( mText.getWString(), left_pos, length, true);
}
}
BOOL LLLineEditor::canPastePrimary() const
{
- return !mReadOnly && LLClipboard::getInstance()->canPastePrimaryString();
+ return !mReadOnly && LLClipboard::getInstance()->isTextAvailable(true);
}
void LLLineEditor::updatePrimary()