From c1636911c84f948e542f445d3c7495e6df185912 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Wed, 1 Feb 2012 19:09:29 -0800 Subject: EXP-1862 : Make LLClipboard an LLSingleton and clean up the internals (set up for toolbar and never used) --- indra/llui/llclipboard.cpp | 6 ------ 1 file changed, 6 deletions(-) (limited to 'indra/llui/llclipboard.cpp') diff --git a/indra/llui/llclipboard.cpp b/indra/llui/llclipboard.cpp index 6910b962a1..984c4ec5fb 100644 --- a/indra/llui/llclipboard.cpp +++ b/indra/llui/llclipboard.cpp @@ -40,7 +40,6 @@ LLClipboard gClipboard; LLClipboard::LLClipboard() { - mSourceItem = NULL; } @@ -135,8 +134,3 @@ BOOL LLClipboard::canPastePrimaryString() const { return LLView::getWindow()->isPrimaryTextAvailable(); } - -void LLClipboard::setSourceObject(const LLUUID& source_id, LLAssetType::EType type) -{ - mSourceItem = new LLInventoryObject (source_id, LLUUID::null, type, ""); -} -- cgit v1.2.3 From db824cff75696c42fff80ba29dbb60f12d10a1da Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Fri, 3 Feb 2012 18:38:03 -0800 Subject: EXP-1862 : Suppress LLInventoryClipboard, move its functions to the unified LLClipboard and use this only --- indra/llui/llclipboard.cpp | 102 +++++++++++++++++++++++++++++++++++++-------- 1 file changed, 84 insertions(+), 18 deletions(-) (limited to 'indra/llui/llclipboard.cpp') diff --git a/indra/llui/llclipboard.cpp b/indra/llui/llclipboard.cpp index 984c4ec5fb..8917dc2d88 100644 --- a/indra/llui/llclipboard.cpp +++ b/indra/llui/llclipboard.cpp @@ -34,44 +34,104 @@ #include "llview.h" #include "llwindow.h" -// Global singleton -LLClipboard gClipboard; +LLClipboard::LLClipboard() +: mCutMode(false) +{ +} +LLClipboard::~LLClipboard() +{ + reset(); +} -LLClipboard::LLClipboard() +void LLClipboard::add(const LLUUID& object) { + mObjects.put(object); } +void LLClipboard::store(const LLUUID& object) +{ + reset(); + mObjects.put(object); +} -LLClipboard::~LLClipboard() +void LLClipboard::store(const LLDynamicArray& inv_objects) { + reset(); + S32 count = inv_objects.count(); + for(S32 i = 0; i < count; i++) + { + mObjects.put(inv_objects[i]); + } +} + +void LLClipboard::cut(const LLUUID& object) +{ + if(!mCutMode && !mObjects.empty()) + { + //looks like there are some stored items, reset clipboard state + reset(); + } + mCutMode = true; + add(object); +} +void LLClipboard::retrieve(LLDynamicArray& inv_objects) const +{ + inv_objects.reset(); + S32 count = mObjects.count(); + for(S32 i = 0; i < count; i++) + { + inv_objects.put(mObjects[i]); + } +} + +void LLClipboard::reset() +{ + mObjects.reset(); + mCutMode = false; +} + +// returns true if the clipboard has something pasteable in it. +BOOL LLClipboard::hasContents() const +{ + return (mObjects.count() > 0); } void LLClipboard::copyFromSubstring(const LLWString &src, S32 pos, S32 len, const LLUUID& source_id ) { - mSourceID = source_id; + reset(); + if (source_id.notNull()) + { + store(source_id); + } mString = src.substr(pos, len); + llinfos << "Merov debug : copyFromSubstring, string = " << wstring_to_utf8str(mString) << ", uuid = " << (hasContents() ? mObjects[0] : LLUUID::null) << llendl; LLView::getWindow()->copyTextToClipboard( mString ); } void LLClipboard::copyFromString(const LLWString &src, const LLUUID& source_id ) { - mSourceID = source_id; + reset(); + if (source_id.notNull()) + { + store(source_id); + } mString = src; + llinfos << "Merov debug : copyFromString, string = " << wstring_to_utf8str(mString) << ", uuid = " << (hasContents() ? mObjects[0] : LLUUID::null) << llendl; LLView::getWindow()->copyTextToClipboard( mString ); } const LLWString& LLClipboard::getPasteWString( LLUUID* source_id ) { - if( mSourceID.notNull() ) + if (hasContents()) { LLWString temp_string; LLView::getWindow()->pasteTextFromClipboard(temp_string); - if( temp_string != mString ) + if (temp_string != mString) { - mSourceID.setNull(); + reset(); mString = temp_string; } } @@ -80,11 +140,13 @@ const LLWString& LLClipboard::getPasteWString( LLUUID* source_id ) LLView::getWindow()->pasteTextFromClipboard(mString); } - if( source_id ) + if (source_id) { - *source_id = mSourceID; + *source_id = (hasContents() ? mObjects[0] : LLUUID::null); } + llinfos << "Merov debug : getPasteWString, string = " << wstring_to_utf8str(mString) << ", uuid = " << (hasContents() ? mObjects[0] : LLUUID::null) << llendl; + return mString; } @@ -97,7 +159,11 @@ BOOL LLClipboard::canPasteString() const void LLClipboard::copyFromPrimarySubstring(const LLWString &src, S32 pos, S32 len, const LLUUID& source_id ) { - mSourceID = source_id; + reset(); + if (source_id.notNull()) + { + store(source_id); + } mString = src.substr(pos, len); LLView::getWindow()->copyTextToPrimary( mString ); } @@ -105,14 +171,14 @@ void LLClipboard::copyFromPrimarySubstring(const LLWString &src, S32 pos, S32 le const LLWString& LLClipboard::getPastePrimaryWString( LLUUID* source_id ) { - if( mSourceID.notNull() ) + if (hasContents()) { LLWString temp_string; LLView::getWindow()->pasteTextFromPrimary(temp_string); - if( temp_string != mString ) + if (temp_string != mString) { - mSourceID.setNull(); + reset(); mString = temp_string; } } @@ -121,11 +187,11 @@ const LLWString& LLClipboard::getPastePrimaryWString( LLUUID* source_id ) LLView::getWindow()->pasteTextFromPrimary(mString); } - if( source_id ) + if (source_id) { - *source_id = mSourceID; + *source_id = (hasContents() ? mObjects[0] : LLUUID::null); } - + return mString; } -- cgit v1.2.3 From 9761375ac244af36635899c73e99efc46b68b589 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Mon, 6 Feb 2012 15:43:53 -0800 Subject: EXP-1841 : Refactoring of LLClipboard, simplify the API and make it behave like a normal clipboard. --- indra/llui/llclipboard.cpp | 112 +++++++++++++-------------------------------- 1 file changed, 31 insertions(+), 81 deletions(-) (limited to 'indra/llui/llclipboard.cpp') diff --git a/indra/llui/llclipboard.cpp b/indra/llui/llclipboard.cpp index 8917dc2d88..5c8db29ae4 100644 --- a/indra/llui/llclipboard.cpp +++ b/indra/llui/llclipboard.cpp @@ -91,112 +91,62 @@ void LLClipboard::reset() mCutMode = false; } -// returns true if the clipboard has something pasteable in it. +// Returns true if the LL Clipboard has pasteable items in it BOOL LLClipboard::hasContents() const { return (mObjects.count() > 0); } - -void LLClipboard::copyFromSubstring(const LLWString &src, S32 pos, S32 len, const LLUUID& source_id ) +// Copy the input string to the LL and the system clipboard +bool LLClipboard::copyToClipboard(const LLWString &src, S32 pos, S32 len, bool use_primary) { reset(); - if (source_id.notNull()) - { - store(source_id); - } mString = src.substr(pos, len); - llinfos << "Merov debug : copyFromSubstring, string = " << wstring_to_utf8str(mString) << ", uuid = " << (hasContents() ? mObjects[0] : LLUUID::null) << llendl; - LLView::getWindow()->copyTextToClipboard( mString ); + return (use_primary ? LLView::getWindow()->copyTextToPrimary(mString) : LLView::getWindow()->copyTextToClipboard(mString)); } -void LLClipboard::copyFromString(const LLWString &src, const LLUUID& source_id ) +// Copy the input uuid to the LL clipboard +// Convert the uuid to string and copy that string to the system clipboard if legit +bool LLClipboard::copyToClipboard(const LLUUID& src, const LLAssetType::EType type) { + bool res = false; reset(); - if (source_id.notNull()) - { - store(source_id); - } - mString = src; - llinfos << "Merov debug : copyFromString, string = " << wstring_to_utf8str(mString) << ", uuid = " << (hasContents() ? mObjects[0] : LLUUID::null) << llendl; - LLView::getWindow()->copyTextToClipboard( mString ); -} - -const LLWString& LLClipboard::getPasteWString( LLUUID* source_id ) -{ - if (hasContents()) + if (src.notNull()) { - LLWString temp_string; - LLView::getWindow()->pasteTextFromClipboard(temp_string); - - if (temp_string != mString) + res = true; + if (LLAssetType::lookupIsAssetIDKnowable(type)) { - reset(); - mString = temp_string; + LLWString source = utf8str_to_wstring(src.asString()); + res = copyToClipboard(source, 0, source.size()); + } + if (res) + { + store(src); } } - else - { - LLView::getWindow()->pasteTextFromClipboard(mString); - } - - if (source_id) - { - *source_id = (hasContents() ? mObjects[0] : LLUUID::null); - } - - llinfos << "Merov debug : getPasteWString, string = " << wstring_to_utf8str(mString) << ", uuid = " << (hasContents() ? mObjects[0] : LLUUID::null) << llendl; - - return mString; -} - - -BOOL LLClipboard::canPasteString() const -{ - return LLView::getWindow()->isClipboardTextAvailable(); -} - - -void LLClipboard::copyFromPrimarySubstring(const LLWString &src, S32 pos, S32 len, const LLUUID& source_id ) -{ - reset(); - if (source_id.notNull()) - { - store(source_id); - } - mString = src.substr(pos, len); - LLView::getWindow()->copyTextToPrimary( mString ); + return res; } - -const LLWString& LLClipboard::getPastePrimaryWString( LLUUID* source_id ) +// Copy the System clipboard to the output string. +// Manage the LL Clipboard / System clipboard consistency +bool LLClipboard::pasteFromClipboard(LLWString &dst, bool use_primary) { - if (hasContents()) + bool res = (use_primary ? LLView::getWindow()->pasteTextFromPrimary(dst) : LLView::getWindow()->pasteTextFromClipboard(dst)); + if (res) { - LLWString temp_string; - LLView::getWindow()->pasteTextFromPrimary(temp_string); - - if (temp_string != mString) + if (dst != mString) { + // Invalidate the LL clipboard if the System had a different string in it (i.e. some copy/cut was done in some other app) reset(); - mString = temp_string; } + mString = dst; } - else - { - LLView::getWindow()->pasteTextFromPrimary(mString); - } - - if (source_id) - { - *source_id = (hasContents() ? mObjects[0] : LLUUID::null); - } - - return mString; + return res; } - -BOOL LLClipboard::canPastePrimaryString() const +// Return true if there's something on the System clipboard +bool LLClipboard::isTextAvailable(bool use_primary) const { - return LLView::getWindow()->isPrimaryTextAvailable(); + return (use_primary ? LLView::getWindow()->isPrimaryTextAvailable() : LLView::getWindow()->isClipboardTextAvailable()); } + -- cgit v1.2.3 From c744603af9b53c6bc73fefbd56de68cf2778ed70 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Tue, 7 Feb 2012 17:13:24 -0800 Subject: EXP-1873 : Implement cut in the inventory contextual menu. Works without deleting the items but simply dimming them and moving them. Doesn't work for folders yet. --- indra/llui/llclipboard.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'indra/llui/llclipboard.cpp') diff --git a/indra/llui/llclipboard.cpp b/indra/llui/llclipboard.cpp index 5c8db29ae4..a2a3f7f285 100644 --- a/indra/llui/llclipboard.cpp +++ b/indra/llui/llclipboard.cpp @@ -97,6 +97,12 @@ BOOL LLClipboard::hasContents() const return (mObjects.count() > 0); } +// Returns true if the input uuid is in the list of clipboard objects +bool LLClipboard::isOnClipboard(const LLUUID& object) const +{ + return (mObjects.find(object) != LLDynamicArray::FAIL); +} + // Copy the input string to the LL and the system clipboard bool LLClipboard::copyToClipboard(const LLWString &src, S32 pos, S32 len, bool use_primary) { -- cgit v1.2.3 From ee3c3c15b714f8f68e98a2d4064afaec665bd64a Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Tue, 7 Feb 2012 22:46:04 -0800 Subject: EXP-1841 : Final deep scrub on LLClipboard API, clean up the use of copy and cut everywhere. --- indra/llui/llclipboard.cpp | 96 ++++++++++++++++++++++------------------------ 1 file changed, 46 insertions(+), 50 deletions(-) (limited to 'indra/llui/llclipboard.cpp') diff --git a/indra/llui/llclipboard.cpp b/indra/llui/llclipboard.cpp index a2a3f7f285..7794a0537f 100644 --- a/indra/llui/llclipboard.cpp +++ b/indra/llui/llclipboard.cpp @@ -35,8 +35,8 @@ #include "llwindow.h" LLClipboard::LLClipboard() -: mCutMode(false) { + reset(); } LLClipboard::~LLClipboard() @@ -44,55 +44,59 @@ LLClipboard::~LLClipboard() reset(); } -void LLClipboard::add(const LLUUID& object) +void LLClipboard::reset() { - mObjects.put(object); + mObjects.reset(); + mCutMode = false; + mString = LLWString(); } -void LLClipboard::store(const LLUUID& object) +// Copy the input uuid to the LL clipboard +bool LLClipboard::copyToClipboard(const LLUUID& src, const LLAssetType::EType type) { reset(); - mObjects.put(object); + return addToClipboard(src, type); } -void LLClipboard::store(const LLDynamicArray& inv_objects) +// Add the input uuid to the LL clipboard +// Convert the uuid to string and concatenate that string to the system clipboard if legit +bool LLClipboard::addToClipboard(const LLUUID& src, const LLAssetType::EType type) { - reset(); - S32 count = inv_objects.count(); - for(S32 i = 0; i < count; i++) + bool res = false; + if (src.notNull()) { - mObjects.put(inv_objects[i]); + res = true; + if (LLAssetType::lookupIsAssetIDKnowable(type)) + { + LLWString source = utf8str_to_wstring(src.asString()); + res = addToClipboard(source, 0, source.size()); + } + if (res) + { + mObjects.put(src); + } } + return res; } -void LLClipboard::cut(const LLUUID& object) +bool LLClipboard::pasteFromClipboard(LLDynamicArray& inv_objects) const { - if(!mCutMode && !mObjects.empty()) - { - //looks like there are some stored items, reset clipboard state - reset(); - } - mCutMode = true; - add(object); -} -void LLClipboard::retrieve(LLDynamicArray& inv_objects) const -{ - inv_objects.reset(); + bool res = false; S32 count = mObjects.count(); - for(S32 i = 0; i < count; i++) + if (count > 0) { - inv_objects.put(mObjects[i]); + res = true; + inv_objects.reset(); + for (S32 i = 0; i < count; i++) + { + inv_objects.put(mObjects[i]); + } } -} - -void LLClipboard::reset() -{ - mObjects.reset(); - mCutMode = false; + return res; } // Returns true if the LL Clipboard has pasteable items in it -BOOL LLClipboard::hasContents() const +bool LLClipboard::hasContents() const { return (mObjects.count() > 0); } @@ -107,30 +111,22 @@ bool LLClipboard::isOnClipboard(const LLUUID& object) const bool LLClipboard::copyToClipboard(const LLWString &src, S32 pos, S32 len, bool use_primary) { reset(); - mString = src.substr(pos, len); - return (use_primary ? LLView::getWindow()->copyTextToPrimary(mString) : LLView::getWindow()->copyTextToClipboard(mString)); + return addToClipboard(src, pos, len, use_primary); } -// Copy the input uuid to the LL clipboard -// Convert the uuid to string and copy that string to the system clipboard if legit -bool LLClipboard::copyToClipboard(const LLUUID& src, const LLAssetType::EType type) +// Concatenate the input string to the LL and the system clipboard +bool LLClipboard::addToClipboard(const LLWString &src, S32 pos, S32 len, bool use_primary) { - bool res = false; - reset(); - if (src.notNull()) + const LLWString sep(utf8str_to_wstring(std::string(", "))); + if (mString.length() == 0) { - res = true; - if (LLAssetType::lookupIsAssetIDKnowable(type)) - { - LLWString source = utf8str_to_wstring(src.asString()); - res = copyToClipboard(source, 0, source.size()); - } - if (res) - { - store(src); - } + mString = src.substr(pos, len); } - return res; + else + { + mString = mString + sep + src.substr(pos, len); + } + return (use_primary ? LLView::getWindow()->copyTextToPrimary(mString) : LLView::getWindow()->copyTextToClipboard(mString)); } // Copy the System clipboard to the output string. -- cgit v1.2.3 From 91f77318db63d4b2560390551306056c4a6cc2d5 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Wed, 8 Feb 2012 15:44:02 -0800 Subject: EXP-1873 : Implement the hiding of cut items on the clipboard --- indra/llui/llclipboard.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'indra/llui/llclipboard.cpp') diff --git a/indra/llui/llclipboard.cpp b/indra/llui/llclipboard.cpp index 7794a0537f..ee1f1aa816 100644 --- a/indra/llui/llclipboard.cpp +++ b/indra/llui/llclipboard.cpp @@ -34,7 +34,8 @@ #include "llview.h" #include "llwindow.h" -LLClipboard::LLClipboard() +LLClipboard::LLClipboard() : + mState(0) { reset(); } @@ -46,6 +47,7 @@ LLClipboard::~LLClipboard() void LLClipboard::reset() { + mState++; mObjects.reset(); mCutMode = false; mString = LLWString(); @@ -74,6 +76,7 @@ bool LLClipboard::addToClipboard(const LLUUID& src, const LLAssetType::EType typ if (res) { mObjects.put(src); + mState++; } } return res; @@ -126,6 +129,7 @@ bool LLClipboard::addToClipboard(const LLWString &src, S32 pos, S32 len, bool us { mString = mString + sep + src.substr(pos, len); } + mState++; return (use_primary ? LLView::getWindow()->copyTextToPrimary(mString) : LLView::getWindow()->copyTextToClipboard(mString)); } -- cgit v1.2.3 From bb6ace0672fa5e1c47c534ba74396ef04daa408b Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Fri, 17 Feb 2012 14:42:12 -0800 Subject: EXP-1902, EXP-1903 : Move items cut to the trash when clipboard reset. --- indra/llui/llclipboard.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'indra/llui/llclipboard.cpp') diff --git a/indra/llui/llclipboard.cpp b/indra/llui/llclipboard.cpp index ee1f1aa816..e0729366cc 100644 --- a/indra/llui/llclipboard.cpp +++ b/indra/llui/llclipboard.cpp @@ -47,9 +47,17 @@ LLClipboard::~LLClipboard() void LLClipboard::reset() { + // Increment the clipboard state mState++; + // Call the cleanup function (if any) before releasing the object list + if (mCutMode && mCleanupCallback) + { + mCleanupCallback(); + } + // Clear the clipboard mObjects.reset(); mCutMode = false; + mCleanupCallback = NULL; mString = LLWString(); } -- cgit v1.2.3 From 44c66e11ccee4f8370dc9cf2a87c44e323c9c68d Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Thu, 1 Mar 2012 21:57:16 -0800 Subject: EXP-1841 : Use std::vector instead of LLDynamicArray in LLClipboard. --- indra/llui/llclipboard.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'indra/llui/llclipboard.cpp') diff --git a/indra/llui/llclipboard.cpp b/indra/llui/llclipboard.cpp index e0729366cc..037b9cb254 100644 --- a/indra/llui/llclipboard.cpp +++ b/indra/llui/llclipboard.cpp @@ -55,7 +55,7 @@ void LLClipboard::reset() mCleanupCallback(); } // Clear the clipboard - mObjects.reset(); + mObjects.clear(); mCutMode = false; mCleanupCallback = NULL; mString = LLWString(); @@ -83,24 +83,24 @@ bool LLClipboard::addToClipboard(const LLUUID& src, const LLAssetType::EType typ } if (res) { - mObjects.put(src); + mObjects.push_back(src); mState++; } } return res; } -bool LLClipboard::pasteFromClipboard(LLDynamicArray& inv_objects) const +bool LLClipboard::pasteFromClipboard(std::vector& inv_objects) const { bool res = false; - S32 count = mObjects.count(); + S32 count = mObjects.size(); if (count > 0) { res = true; - inv_objects.reset(); + inv_objects.clear(); for (S32 i = 0; i < count; i++) { - inv_objects.put(mObjects[i]); + inv_objects.push_back(mObjects[i]); } } return res; @@ -109,13 +109,14 @@ bool LLClipboard::pasteFromClipboard(LLDynamicArray& inv_objects) const // Returns true if the LL Clipboard has pasteable items in it bool LLClipboard::hasContents() const { - return (mObjects.count() > 0); + return (mObjects.size() > 0); } // Returns true if the input uuid is in the list of clipboard objects bool LLClipboard::isOnClipboard(const LLUUID& object) const { - return (mObjects.find(object) != LLDynamicArray::FAIL); + std::vector::const_iterator iter = std::find(mObjects.begin(), mObjects.end(), object); + return (iter != mObjects.end()); } // Copy the input string to the LL and the system clipboard -- cgit v1.2.3 From a41507eef0a79731d1894ccf3179da6165f310ab Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Thu, 1 Mar 2012 23:10:06 -0800 Subject: EXP-1841 : change mState to mGeneration in LLClipboard. --- indra/llui/llclipboard.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'indra/llui/llclipboard.cpp') diff --git a/indra/llui/llclipboard.cpp b/indra/llui/llclipboard.cpp index 037b9cb254..75c197463c 100644 --- a/indra/llui/llclipboard.cpp +++ b/indra/llui/llclipboard.cpp @@ -35,7 +35,7 @@ #include "llwindow.h" LLClipboard::LLClipboard() : - mState(0) + mGeneration(0) { reset(); } @@ -47,8 +47,8 @@ LLClipboard::~LLClipboard() void LLClipboard::reset() { - // Increment the clipboard state - mState++; + // Increment the clipboard count + mGeneration++; // Call the cleanup function (if any) before releasing the object list if (mCutMode && mCleanupCallback) { @@ -84,7 +84,7 @@ bool LLClipboard::addToClipboard(const LLUUID& src, const LLAssetType::EType typ if (res) { mObjects.push_back(src); - mState++; + mGeneration++; } } return res; @@ -138,7 +138,7 @@ bool LLClipboard::addToClipboard(const LLWString &src, S32 pos, S32 len, bool us { mString = mString + sep + src.substr(pos, len); } - mState++; + mGeneration++; return (use_primary ? LLView::getWindow()->copyTextToPrimary(mString) : LLView::getWindow()->copyTextToClipboard(mString)); } -- cgit v1.2.3 From 5170f18d3cecc757cae2779d9e271272e24d160b Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Thu, 8 Mar 2012 21:06:00 -0800 Subject: EXP-1917 : Suppress clean up callback now that we move things to the trash immediately --- indra/llui/llclipboard.cpp | 6 ------ 1 file changed, 6 deletions(-) (limited to 'indra/llui/llclipboard.cpp') diff --git a/indra/llui/llclipboard.cpp b/indra/llui/llclipboard.cpp index 75c197463c..cc5b219e6f 100644 --- a/indra/llui/llclipboard.cpp +++ b/indra/llui/llclipboard.cpp @@ -49,15 +49,9 @@ void LLClipboard::reset() { // Increment the clipboard count mGeneration++; - // Call the cleanup function (if any) before releasing the object list - if (mCutMode && mCleanupCallback) - { - mCleanupCallback(); - } // Clear the clipboard mObjects.clear(); mCutMode = false; - mCleanupCallback = NULL; mString = LLWString(); } -- cgit v1.2.3 From 5cf3f8e3c813d978f318fd59ad422c75b3e171cd Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Fri, 9 Mar 2012 14:20:31 -0800 Subject: EXP-1913 : Prevent text clipboard to zap inventory clipboard --- indra/llui/llclipboard.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'indra/llui/llclipboard.cpp') diff --git a/indra/llui/llclipboard.cpp b/indra/llui/llclipboard.cpp index cc5b219e6f..53b1b855de 100644 --- a/indra/llui/llclipboard.cpp +++ b/indra/llui/llclipboard.cpp @@ -116,7 +116,6 @@ bool LLClipboard::isOnClipboard(const LLUUID& object) const // Copy the input string to the LL and the system clipboard bool LLClipboard::copyToClipboard(const LLWString &src, S32 pos, S32 len, bool use_primary) { - reset(); return addToClipboard(src, pos, len, use_primary); } @@ -132,7 +131,6 @@ bool LLClipboard::addToClipboard(const LLWString &src, S32 pos, S32 len, bool us { mString = mString + sep + src.substr(pos, len); } - mGeneration++; return (use_primary ? LLView::getWindow()->copyTextToPrimary(mString) : LLView::getWindow()->copyTextToClipboard(mString)); } -- cgit v1.2.3 From 8a792a86fad7c610651b964d164b8f099c790562 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Fri, 9 Mar 2012 17:34:30 -0800 Subject: EXP-1913 : Suppress the text concatenation on clipboard, unused and confusing. --- indra/llui/llclipboard.cpp | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'indra/llui/llclipboard.cpp') diff --git a/indra/llui/llclipboard.cpp b/indra/llui/llclipboard.cpp index 53b1b855de..7bf62b5bfc 100644 --- a/indra/llui/llclipboard.cpp +++ b/indra/llui/llclipboard.cpp @@ -122,15 +122,7 @@ bool LLClipboard::copyToClipboard(const LLWString &src, S32 pos, S32 len, bool u // Concatenate the input string to the LL and the system clipboard bool LLClipboard::addToClipboard(const LLWString &src, S32 pos, S32 len, bool use_primary) { - const LLWString sep(utf8str_to_wstring(std::string(", "))); - if (mString.length() == 0) - { - mString = src.substr(pos, len); - } - else - { - mString = mString + sep + src.substr(pos, len); - } + mString = src.substr(pos, len); return (use_primary ? LLView::getWindow()->copyTextToPrimary(mString) : LLView::getWindow()->copyTextToClipboard(mString)); } -- cgit v1.2.3 From 9dfb6284df315588b0a387725965e3626d63784c Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Tue, 13 Mar 2012 21:37:54 -0700 Subject: EXP-1924 : Relax the cconsistency policy between text and UUID on the clipboard. --- indra/llui/llclipboard.cpp | 5 ----- 1 file changed, 5 deletions(-) (limited to 'indra/llui/llclipboard.cpp') diff --git a/indra/llui/llclipboard.cpp b/indra/llui/llclipboard.cpp index 7bf62b5bfc..14173fdbb0 100644 --- a/indra/llui/llclipboard.cpp +++ b/indra/llui/llclipboard.cpp @@ -133,11 +133,6 @@ bool LLClipboard::pasteFromClipboard(LLWString &dst, bool use_primary) bool res = (use_primary ? LLView::getWindow()->pasteTextFromPrimary(dst) : LLView::getWindow()->pasteTextFromClipboard(dst)); if (res) { - if (dst != mString) - { - // Invalidate the LL clipboard if the System had a different string in it (i.e. some copy/cut was done in some other app) - reset(); - } mString = dst; } return res; -- cgit v1.2.3