summaryrefslogtreecommitdiff
path: root/indra/llui/lltexteditor.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/lltexteditor.cpp
parentdb824cff75696c42fff80ba29dbb60f12d10a1da (diff)
EXP-1841 : Refactoring of LLClipboard, simplify the API and make it behave like a normal clipboard.
Diffstat (limited to 'indra/llui/lltexteditor.cpp')
-rw-r--r--indra/llui/lltexteditor.cpp20
1 files changed, 6 insertions, 14 deletions
diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp
index 22a577cda8..ffe012c110 100644
--- a/indra/llui/lltexteditor.cpp
+++ b/indra/llui/lltexteditor.cpp
@@ -1332,7 +1332,7 @@ void LLTextEditor::cut()
}
S32 left_pos = llmin( mSelectionStart, mSelectionEnd );
S32 length = llabs( mSelectionStart - mSelectionEnd );
- LLClipboard::getInstance()->copyFromSubstring( getWText(), left_pos, length, mSourceID );
+ LLClipboard::getInstance()->copyToClipboard( getWText(), left_pos, length);
deleteSelection( FALSE );
onKeyStroke();
@@ -1352,12 +1352,12 @@ void LLTextEditor::copy()
}
S32 left_pos = llmin( mSelectionStart, mSelectionEnd );
S32 length = llabs( mSelectionStart - mSelectionEnd );
- LLClipboard::getInstance()->copyFromSubstring(getWText(), left_pos, length, mSourceID);
+ LLClipboard::getInstance()->copyToClipboard(getWText(), left_pos, length);
}
BOOL LLTextEditor::canPaste() const
{
- return !mReadOnly && LLClipboard::getInstance()->canPasteString();
+ return !mReadOnly && LLClipboard::getInstance()->isTextAvailable();
}
// paste from clipboard
@@ -1393,16 +1393,8 @@ void LLTextEditor::pasteHelper(bool is_primary)
return;
}
- LLUUID source_id;
LLWString paste;
- if (is_primary)
- {
- paste = LLClipboard::getInstance()->getPastePrimaryWString(&source_id);
- }
- else
- {
- paste = LLClipboard::getInstance()->getPasteWString(&source_id);
- }
+ LLClipboard::getInstance()->pasteFromClipboard(paste, is_primary);
if (paste.empty())
{
@@ -1475,12 +1467,12 @@ void LLTextEditor::copyPrimary()
}
S32 left_pos = llmin( mSelectionStart, mSelectionEnd );
S32 length = llabs( mSelectionStart - mSelectionEnd );
- LLClipboard::getInstance()->copyFromPrimarySubstring(getWText(), left_pos, length, mSourceID);
+ LLClipboard::getInstance()->copyToClipboard(getWText(), left_pos, length, true);
}
BOOL LLTextEditor::canPastePrimary() const
{
- return !mReadOnly && LLClipboard::getInstance()->canPastePrimaryString();
+ return !mReadOnly && LLClipboard::getInstance()->isTextAvailable(true);
}
void LLTextEditor::updatePrimary()