summaryrefslogtreecommitdiff
path: root/indra/llui/llclipboard.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llui/llclipboard.cpp')
-rw-r--r--indra/llui/llclipboard.cpp41
1 files changed, 41 insertions, 0 deletions
diff --git a/indra/llui/llclipboard.cpp b/indra/llui/llclipboard.cpp
index 8a7a214048..2cb8197a67 100644
--- a/indra/llui/llclipboard.cpp
+++ b/indra/llui/llclipboard.cpp
@@ -93,3 +93,44 @@ BOOL LLClipboard::canPasteString() const
{
return LLView::getWindow()->isClipboardTextAvailable();
}
+
+
+void LLClipboard::copyFromPrimarySubstring(const LLWString &src, S32 pos, S32 len, const LLUUID& source_id )
+{
+ mSourceID = source_id;
+ mString = src.substr(pos, len);
+ LLView::getWindow()->copyTextToPrimary( mString );
+}
+
+
+const LLWString& LLClipboard::getPastePrimaryWString( LLUUID* source_id )
+{
+ if( mSourceID.notNull() )
+ {
+ LLWString temp_string;
+ LLView::getWindow()->pasteTextFromPrimary(temp_string);
+
+ if( temp_string != mString )
+ {
+ mSourceID.setNull();
+ mString = temp_string;
+ }
+ }
+ else
+ {
+ LLView::getWindow()->pasteTextFromPrimary(mString);
+ }
+
+ if( source_id )
+ {
+ *source_id = mSourceID;
+ }
+
+ return mString;
+}
+
+
+BOOL LLClipboard::canPastePrimaryString() const
+{
+ return LLView::getWindow()->isPrimaryTextAvailable();
+}