diff options
author | Jacek Antonelli | 2008-09-06 18:24:57 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-09-06 18:25:07 -0500 |
commit | 798d367d54a6c6379ad355bd8345fa40e31e7fe9 (patch) | |
tree | 1921f1708cd0240648c97bc02df2c2ab5f2fc41e /linden/indra/newview/llviewertexteditor.cpp | |
parent | Second Life viewer sources 1.20.15 (diff) | |
download | meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.zip meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.gz meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.bz2 meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.xz |
Second Life viewer sources 1.21.0-RC
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/llviewertexteditor.cpp | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/linden/indra/newview/llviewertexteditor.cpp b/linden/indra/newview/llviewertexteditor.cpp index e1c56a6..8a55b3f 100644 --- a/linden/indra/newview/llviewertexteditor.cpp +++ b/linden/indra/newview/llviewertexteditor.cpp | |||
@@ -108,7 +108,7 @@ public: | |||
108 | LLPreviewNotecard* preview; | 108 | LLPreviewNotecard* preview; |
109 | preview = new LLPreviewNotecard("preview notecard", | 109 | preview = new LLPreviewNotecard("preview notecard", |
110 | rect, | 110 | rect, |
111 | LLString("Embedded Note: ") + item->getName(), | 111 | std::string("Embedded Note: ") + item->getName(), |
112 | item->getUUID(), | 112 | item->getUUID(), |
113 | LLUUID::null, | 113 | LLUUID::null, |
114 | item->getAssetUUID(), | 114 | item->getAssetUUID(), |
@@ -561,10 +561,10 @@ struct LLNotecardCopyInfo | |||
561 | // Member functions | 561 | // Member functions |
562 | // | 562 | // |
563 | 563 | ||
564 | LLViewerTextEditor::LLViewerTextEditor(const LLString& name, | 564 | LLViewerTextEditor::LLViewerTextEditor(const std::string& name, |
565 | const LLRect& rect, | 565 | const LLRect& rect, |
566 | S32 max_length, | 566 | S32 max_length, |
567 | const LLString& default_text, | 567 | const std::string& default_text, |
568 | const LLFontGL* font, | 568 | const LLFontGL* font, |
569 | BOOL allow_embedded_items) | 569 | BOOL allow_embedded_items) |
570 | : LLTextEditor(name, rect, max_length, default_text, font, allow_embedded_items), | 570 | : LLTextEditor(name, rect, max_length, default_text, font, allow_embedded_items), |
@@ -581,7 +581,7 @@ LLViewerTextEditor::LLViewerTextEditor(const LLString& name, | |||
581 | //LLMenuGL* menu = LLUICtrlFactory::getInstance()->buildMenu("menu_slurl.xml", this); | 581 | //LLMenuGL* menu = LLUICtrlFactory::getInstance()->buildMenu("menu_slurl.xml", this); |
582 | //if (!menu) | 582 | //if (!menu) |
583 | //{ | 583 | //{ |
584 | // menu = new LLMenuGL(""); | 584 | // menu = new LLMenuGL(LLStringUtil::null); |
585 | //} | 585 | //} |
586 | //menu->setBackgroundColor(gColors.getColor("MenuPopupBgColor")); | 586 | //menu->setBackgroundColor(gColors.getColor("MenuPopupBgColor")); |
587 | //// menu->setVisible(FALSE); | 587 | //// menu->setVisible(FALSE); |
@@ -608,7 +608,7 @@ void LLViewerTextEditor::makePristine() | |||
608 | 608 | ||
609 | /////////////////////////////////////////////////////////////////// | 609 | /////////////////////////////////////////////////////////////////// |
610 | 610 | ||
611 | BOOL LLViewerTextEditor::handleToolTip(S32 x, S32 y, LLString& msg, LLRect* sticky_rect_screen) | 611 | BOOL LLViewerTextEditor::handleToolTip(S32 x, S32 y, std::string& msg, LLRect* sticky_rect_screen) |
612 | { | 612 | { |
613 | for (child_list_const_iter_t child_iter = getChildList()->begin(); | 613 | for (child_list_const_iter_t child_iter = getChildList()->begin(); |
614 | child_iter != getChildList()->end(); ++child_iter) | 614 | child_iter != getChildList()->end(); ++child_iter) |
@@ -1068,7 +1068,7 @@ BOOL LLViewerTextEditor::handleDoubleClick(S32 x, S32 y, MASK mask) | |||
1068 | BOOL LLViewerTextEditor::handleDragAndDrop(S32 x, S32 y, MASK mask, | 1068 | BOOL LLViewerTextEditor::handleDragAndDrop(S32 x, S32 y, MASK mask, |
1069 | BOOL drop, EDragAndDropType cargo_type, void *cargo_data, | 1069 | BOOL drop, EDragAndDropType cargo_type, void *cargo_data, |
1070 | EAcceptance *accept, | 1070 | EAcceptance *accept, |
1071 | LLString& tooltip_msg) | 1071 | std::string& tooltip_msg) |
1072 | { | 1072 | { |
1073 | BOOL handled = FALSE; | 1073 | BOOL handled = FALSE; |
1074 | 1074 | ||
@@ -1084,7 +1084,7 @@ BOOL LLViewerTextEditor::handleDragAndDrop(S32 x, S32 y, MASK mask, | |||
1084 | if (drop) | 1084 | if (drop) |
1085 | { | 1085 | { |
1086 | LLInventoryItem *item = (LLInventoryItem *)cargo_data; | 1086 | LLInventoryItem *item = (LLInventoryItem *)cargo_data; |
1087 | LLString name = item->getName(); | 1087 | std::string name = item->getName(); |
1088 | appendText(name, true, true); | 1088 | appendText(name, true, true); |
1089 | } | 1089 | } |
1090 | *accept = ACCEPT_YES_COPY_SINGLE; | 1090 | *accept = ACCEPT_YES_COPY_SINGLE; |
@@ -1165,7 +1165,7 @@ BOOL LLViewerTextEditor::handleDragAndDrop(S32 x, S32 y, MASK mask, | |||
1165 | return handled; | 1165 | return handled; |
1166 | } | 1166 | } |
1167 | 1167 | ||
1168 | void LLViewerTextEditor::setASCIIEmbeddedText(const LLString& instr) | 1168 | void LLViewerTextEditor::setASCIIEmbeddedText(const std::string& instr) |
1169 | { | 1169 | { |
1170 | LLWString wtext; | 1170 | LLWString wtext; |
1171 | const U8* buffer = (U8*)(instr.c_str()); | 1171 | const U8* buffer = (U8*)(instr.c_str()); |
@@ -1187,7 +1187,7 @@ void LLViewerTextEditor::setASCIIEmbeddedText(const LLString& instr) | |||
1187 | setWText(wtext); | 1187 | setWText(wtext); |
1188 | } | 1188 | } |
1189 | 1189 | ||
1190 | void LLViewerTextEditor::setEmbeddedText(const LLString& instr) | 1190 | void LLViewerTextEditor::setEmbeddedText(const std::string& instr) |
1191 | { | 1191 | { |
1192 | LLWString wtext = utf8str_to_wstring(instr); | 1192 | LLWString wtext = utf8str_to_wstring(instr); |
1193 | for (S32 i=0; i<(S32)wtext.size(); i++) | 1193 | for (S32 i=0; i<(S32)wtext.size(); i++) |
@@ -1202,7 +1202,7 @@ void LLViewerTextEditor::setEmbeddedText(const LLString& instr) | |||
1202 | setWText(wtext); | 1202 | setWText(wtext); |
1203 | } | 1203 | } |
1204 | 1204 | ||
1205 | LLString LLViewerTextEditor::getEmbeddedText() | 1205 | std::string LLViewerTextEditor::getEmbeddedText() |
1206 | { | 1206 | { |
1207 | #if 1 | 1207 | #if 1 |
1208 | // New version (Version 2) | 1208 | // New version (Version 2) |
@@ -1218,12 +1218,12 @@ LLString LLViewerTextEditor::getEmbeddedText() | |||
1218 | } | 1218 | } |
1219 | outtextw.push_back(wch); | 1219 | outtextw.push_back(wch); |
1220 | } | 1220 | } |
1221 | LLString outtext = wstring_to_utf8str(outtextw); | 1221 | std::string outtext = wstring_to_utf8str(outtextw); |
1222 | return outtext; | 1222 | return outtext; |
1223 | #else | 1223 | #else |
1224 | // Old version (Version 1) | 1224 | // Old version (Version 1) |
1225 | mEmbeddedItemList->copyUsedCharsToIndexed(); | 1225 | mEmbeddedItemList->copyUsedCharsToIndexed(); |
1226 | LLString outtext; | 1226 | std::string outtext; |
1227 | for (S32 i=0; i<(S32)mWText.size(); i++) | 1227 | for (S32 i=0; i<(S32)mWText.size(); i++) |
1228 | { | 1228 | { |
1229 | llwchar wch = mWText[i]; | 1229 | llwchar wch = mWText[i]; |
@@ -1242,9 +1242,9 @@ LLString LLViewerTextEditor::getEmbeddedText() | |||
1242 | #endif | 1242 | #endif |
1243 | } | 1243 | } |
1244 | 1244 | ||
1245 | LLString LLViewerTextEditor::appendTime(bool prepend_newline) | 1245 | std::string LLViewerTextEditor::appendTime(bool prepend_newline) |
1246 | { | 1246 | { |
1247 | U32 utc_time; | 1247 | time_t utc_time; |
1248 | utc_time = time_corrected(); | 1248 | utc_time = time_corrected(); |
1249 | 1249 | ||
1250 | // There's only one internal tm buffer. | 1250 | // There's only one internal tm buffer. |
@@ -1254,7 +1254,7 @@ LLString LLViewerTextEditor::appendTime(bool prepend_newline) | |||
1254 | // it's daylight savings time there. | 1254 | // it's daylight savings time there. |
1255 | timep = utc_to_pacific_time(utc_time, gPacificDaylightTime); | 1255 | timep = utc_to_pacific_time(utc_time, gPacificDaylightTime); |
1256 | 1256 | ||
1257 | LLString text = llformat("[%d:%02d] ", timep->tm_hour, timep->tm_min); | 1257 | std::string text = llformat("[%d:%02d] ", timep->tm_hour, timep->tm_min); |
1258 | appendColoredText(text, false, prepend_newline, LLColor4::grey); | 1258 | appendColoredText(text, false, prepend_newline, LLColor4::grey); |
1259 | 1259 | ||
1260 | return text; | 1260 | return text; |
@@ -1411,8 +1411,8 @@ void LLViewerTextEditor::openEmbeddedSound( LLInventoryItem* item ) | |||
1411 | 1411 | ||
1412 | void LLViewerTextEditor::openEmbeddedLandmark( LLInventoryItem* item ) | 1412 | void LLViewerTextEditor::openEmbeddedLandmark( LLInventoryItem* item ) |
1413 | { | 1413 | { |
1414 | LLString title = | 1414 | std::string title = |
1415 | LLString(" ") + LLLandmarkBridge::prefix() + item->getName(); | 1415 | std::string(" ") + LLLandmarkBridge::prefix() + item->getName(); |
1416 | open_landmark((LLViewerInventoryItem*)item, title, FALSE, item->getUUID(), TRUE); | 1416 | open_landmark((LLViewerInventoryItem*)item, title, FALSE, item->getUUID(), TRUE); |
1417 | } | 1417 | } |
1418 | 1418 | ||
@@ -1519,13 +1519,13 @@ bool LLViewerTextEditor::hasEmbeddedInventory() | |||
1519 | 1519 | ||
1520 | //////////////////////////////////////////////////////////////////////////// | 1520 | //////////////////////////////////////////////////////////////////////////// |
1521 | 1521 | ||
1522 | BOOL LLViewerTextEditor::importBuffer( const LLString& buffer ) | 1522 | BOOL LLViewerTextEditor::importBuffer( const char* buffer, S32 length ) |
1523 | { | 1523 | { |
1524 | LLMemoryStream str((U8*)buffer.c_str(), buffer.length()); | 1524 | LLMemoryStream str((U8*)buffer, length); |
1525 | return importStream(str); | 1525 | return importStream(str); |
1526 | } | 1526 | } |
1527 | 1527 | ||
1528 | BOOL LLViewerTextEditor::exportBuffer( LLString& buffer ) | 1528 | BOOL LLViewerTextEditor::exportBuffer( std::string& buffer ) |
1529 | { | 1529 | { |
1530 | LLNotecard nc(LLNotecard::MAX_SIZE); | 1530 | LLNotecard nc(LLNotecard::MAX_SIZE); |
1531 | 1531 | ||
@@ -1547,7 +1547,7 @@ BOOL LLViewerTextEditor::exportBuffer( LLString& buffer ) | |||
1547 | 1547 | ||
1548 | LLView* LLViewerTextEditor::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) | 1548 | LLView* LLViewerTextEditor::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) |
1549 | { | 1549 | { |
1550 | LLString name("text_editor"); | 1550 | std::string name("text_editor"); |
1551 | node->getAttributeString("name", name); | 1551 | node->getAttributeString("name", name); |
1552 | 1552 | ||
1553 | LLRect rect; | 1553 | LLRect rect; |
@@ -1561,8 +1561,8 @@ LLView* LLViewerTextEditor::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlF | |||
1561 | 1561 | ||
1562 | LLFontGL* font = LLView::selectFont(node); | 1562 | LLFontGL* font = LLView::selectFont(node); |
1563 | 1563 | ||
1564 | // LLString text = node->getValue(); | 1564 | // std::string text = node->getValue(); |
1565 | LLString text = node->getTextContents().substr(0, max_text_length - 1); | 1565 | std::string text = node->getTextContents().substr(0, max_text_length - 1); |
1566 | 1566 | ||
1567 | if (text.size() > max_text_length) | 1567 | if (text.size() > max_text_length) |
1568 | { | 1568 | { |
@@ -1573,7 +1573,7 @@ LLView* LLViewerTextEditor::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlF | |||
1573 | LLViewerTextEditor* text_editor = new LLViewerTextEditor(name, | 1573 | LLViewerTextEditor* text_editor = new LLViewerTextEditor(name, |
1574 | rect, | 1574 | rect, |
1575 | max_text_length, | 1575 | max_text_length, |
1576 | "", | 1576 | LLStringUtil::null, |
1577 | font, | 1577 | font, |
1578 | allow_embedded_items); | 1578 | allow_embedded_items); |
1579 | 1579 | ||