aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llui/llclipboard.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/llui/llclipboard.cpp')
-rw-r--r--linden/indra/llui/llclipboard.cpp41
1 files changed, 41 insertions, 0 deletions
diff --git a/linden/indra/llui/llclipboard.cpp b/linden/indra/llui/llclipboard.cpp
index d5255e7..f33f3fa 100644
--- a/linden/indra/llui/llclipboard.cpp
+++ b/linden/indra/llui/llclipboard.cpp
@@ -92,3 +92,44 @@ BOOL LLClipboard::canPasteString() const
92{ 92{
93 return LLView::getWindow()->isClipboardTextAvailable(); 93 return LLView::getWindow()->isClipboardTextAvailable();
94} 94}
95
96
97void LLClipboard::copyFromPrimarySubstring(const LLWString &src, S32 pos, S32 len, const LLUUID& source_id )
98{
99 mSourceID = source_id;
100 mString = src.substr(pos, len);
101 LLView::getWindow()->copyTextToPrimary( mString );
102}
103
104
105const LLWString& LLClipboard::getPastePrimaryWString( LLUUID* source_id )
106{
107 if( mSourceID.notNull() )
108 {
109 LLWString temp_string;
110 LLView::getWindow()->pasteTextFromPrimary(temp_string);
111
112 if( temp_string != mString )
113 {
114 mSourceID.setNull();
115 mString = temp_string;
116 }
117 }
118 else
119 {
120 LLView::getWindow()->pasteTextFromPrimary(mString);
121 }
122
123 if( source_id )
124 {
125 *source_id = mSourceID;
126 }
127
128 return mString;
129}
130
131
132BOOL LLClipboard::canPastePrimaryString() const
133{
134 return LLView::getWindow()->isPrimaryTextAvailable();
135}