diff options
Diffstat (limited to 'linden/indra/newview/llviewertexteditor.cpp')
-rw-r--r-- | linden/indra/newview/llviewertexteditor.cpp | 32 |
1 files changed, 22 insertions, 10 deletions
diff --git a/linden/indra/newview/llviewertexteditor.cpp b/linden/indra/newview/llviewertexteditor.cpp index f84c875..826c411 100644 --- a/linden/indra/newview/llviewertexteditor.cpp +++ b/linden/indra/newview/llviewertexteditor.cpp | |||
@@ -4,6 +4,7 @@ | |||
4 | * | 4 | * |
5 | * Copyright (c) 2001-2007, Linden Research, Inc. | 5 | * Copyright (c) 2001-2007, Linden Research, Inc. |
6 | * | 6 | * |
7 | * Second Life Viewer Source Code | ||
7 | * The source code in this file ("Source Code") is provided by Linden Lab | 8 | * The source code in this file ("Source Code") is provided by Linden Lab |
8 | * to you under the terms of the GNU General Public License, version 2.0 | 9 | * to you under the terms of the GNU General Public License, version 2.0 |
9 | * ("GPL"), unless you have obtained a separate licensing agreement | 10 | * ("GPL"), unless you have obtained a separate licensing agreement |
@@ -342,7 +343,16 @@ void LLEmbeddedItems::bindEmbeddedChars( const LLFontGL* font ) | |||
342 | } | 343 | } |
343 | break; | 344 | break; |
344 | case LLAssetType::AT_CLOTHING: img_name = "inv_item_clothing.tga"; break; | 345 | case LLAssetType::AT_CLOTHING: img_name = "inv_item_clothing.tga"; break; |
345 | case LLAssetType::AT_OBJECT: img_name = "inv_item_object.tga"; break; | 346 | case LLAssetType::AT_OBJECT: |
347 | if (item->getFlags() & LLInventoryItem::II_FLAGS_OBJECT_HAS_MULTIPLE_ITEMS) | ||
348 | { | ||
349 | img_name = "inv_item_object_multi.tga"; | ||
350 | } | ||
351 | else | ||
352 | { | ||
353 | img_name = "inv_item_object.tga"; | ||
354 | } | ||
355 | break; | ||
346 | case LLAssetType::AT_NOTECARD: img_name = "inv_item_notecard.tga"; break; | 356 | case LLAssetType::AT_NOTECARD: img_name = "inv_item_notecard.tga"; break; |
347 | case LLAssetType::AT_LSL_TEXT: img_name = "inv_item_script.tga"; break; | 357 | case LLAssetType::AT_LSL_TEXT: img_name = "inv_item_script.tga"; break; |
348 | case LLAssetType::AT_BODYPART: img_name = "inv_item_bodypart.tga"; break; | 358 | case LLAssetType::AT_BODYPART: img_name = "inv_item_bodypart.tga"; break; |
@@ -594,7 +604,7 @@ BOOL LLViewerTextEditor::handleMouseDown(S32 x, S32 y, MASK mask) | |||
594 | { | 604 | { |
595 | mDragItem = item_at_pos; | 605 | mDragItem = item_at_pos; |
596 | mDragItemSaved = LLEmbeddedItems::getEmbeddedItemSaved(wc); | 606 | mDragItemSaved = LLEmbeddedItems::getEmbeddedItemSaved(wc); |
597 | gFocusMgr.setMouseCapture( this, NULL ); | 607 | gFocusMgr.setMouseCapture( this ); |
598 | mMouseDownX = x; | 608 | mMouseDownX = x; |
599 | mMouseDownY = y; | 609 | mMouseDownY = y; |
600 | S32 screen_x; | 610 | S32 screen_x; |
@@ -656,7 +666,7 @@ BOOL LLViewerTextEditor::handleMouseDown(S32 x, S32 y, MASK mask) | |||
656 | setCursorAtLocalPos( x, y, TRUE ); | 666 | setCursorAtLocalPos( x, y, TRUE ); |
657 | startSelection(); | 667 | startSelection(); |
658 | } | 668 | } |
659 | gFocusMgr.setMouseCapture( this, &LLTextEditor::onMouseCaptureLost ); | 669 | gFocusMgr.setMouseCapture( this ); |
660 | } | 670 | } |
661 | 671 | ||
662 | handled = TRUE; | 672 | handled = TRUE; |
@@ -686,7 +696,7 @@ BOOL LLViewerTextEditor::handleHover(S32 x, S32 y, MASK mask) | |||
686 | } | 696 | } |
687 | if( getVisible() ) | 697 | if( getVisible() ) |
688 | { | 698 | { |
689 | if(gFocusMgr.getMouseCapture() == this ) | 699 | if(hasMouseCapture() ) |
690 | { | 700 | { |
691 | if( mIsSelecting ) | 701 | if( mIsSelecting ) |
692 | { | 702 | { |
@@ -839,7 +849,7 @@ BOOL LLViewerTextEditor::handleMouseUp(S32 x, S32 y, MASK mask) | |||
839 | // Delay cursor flashing | 849 | // Delay cursor flashing |
840 | mKeystrokeTimer.reset(); | 850 | mKeystrokeTimer.reset(); |
841 | 851 | ||
842 | if( gFocusMgr.getMouseCapture() == this ) | 852 | if( hasMouseCapture() ) |
843 | { | 853 | { |
844 | if (mDragItem) | 854 | if (mDragItem) |
845 | { | 855 | { |
@@ -852,7 +862,7 @@ BOOL LLViewerTextEditor::handleMouseUp(S32 x, S32 y, MASK mask) | |||
852 | } | 862 | } |
853 | } | 863 | } |
854 | mDragItem = NULL; | 864 | mDragItem = NULL; |
855 | gFocusMgr.setMouseCapture( NULL, NULL ); | 865 | gFocusMgr.setMouseCapture( NULL ); |
856 | handled = TRUE; | 866 | handled = TRUE; |
857 | } | 867 | } |
858 | 868 | ||
@@ -1443,12 +1453,14 @@ BOOL LLViewerTextEditor::exportBuffer( LLString& buffer ) | |||
1443 | { | 1453 | { |
1444 | LLNotecard nc(LLNotecard::MAX_SIZE); | 1454 | LLNotecard nc(LLNotecard::MAX_SIZE); |
1445 | 1455 | ||
1446 | std::vector<LLPointer<LLInventoryItem> > embedded_items; | 1456 | // Get the embedded text and update the item list to just be the used items |
1447 | mEmbeddedItemList->getEmbeddedItemList(embedded_items); | ||
1448 | |||
1449 | nc.setItems(embedded_items); | ||
1450 | nc.setText(getEmbeddedText()); | 1457 | nc.setText(getEmbeddedText()); |
1451 | 1458 | ||
1459 | // Now get the used items and copy the list to the notecard | ||
1460 | std::vector<LLPointer<LLInventoryItem> > embedded_items; | ||
1461 | mEmbeddedItemList->getEmbeddedItemList(embedded_items); | ||
1462 | nc.setItems(embedded_items); | ||
1463 | |||
1452 | std::stringstream out_stream; | 1464 | std::stringstream out_stream; |
1453 | nc.exportStream(out_stream); | 1465 | nc.exportStream(out_stream); |
1454 | 1466 | ||