summaryrefslogtreecommitdiff
path: root/indra/newview/llviewertexteditor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llviewertexteditor.cpp')
-rw-r--r--indra/newview/llviewertexteditor.cpp138
1 files changed, 69 insertions, 69 deletions
diff --git a/indra/newview/llviewertexteditor.cpp b/indra/newview/llviewertexteditor.cpp
index bb025fbcd2..0ab0265586 100644
--- a/indra/newview/llviewertexteditor.cpp
+++ b/indra/newview/llviewertexteditor.cpp
@@ -233,19 +233,19 @@ public:
}
F32 right_x;
- mStyle->getFont()->render(mLabel, 0, image_rect.mRight + EMBEDDED_ITEM_LABEL_PADDING, draw_rect.mTop, color, LLFontGL::LEFT, LLFontGL::TOP, LLFontGL::UNDERLINE, LLFontGL::NO_SHADOW, mLabel.length(), S32_MAX, &right_x);
+ mStyle->getFont()->render(mLabel, 0, image_rect.mRight + EMBEDDED_ITEM_LABEL_PADDING, draw_rect.mTop, color, LLFontGL::LEFT, LLFontGL::TOP, LLFontGL::UNDERLINE, LLFontGL::NO_SHADOW, static_cast<S32>(mLabel.length()), S32_MAX, &right_x);
return right_x;
}
/*virtual*/ bool canEdit() const { return false; }
- /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask)
+ /*virtual*/ bool handleHover(S32 x, S32 y, MASK mask)
{
LLUI::getInstance()->getWindow()->setCursor(UI_CURSOR_HAND);
- return TRUE;
+ return true;
}
- virtual BOOL handleToolTip(S32 x, S32 y, MASK mask )
+ virtual bool handleToolTip(S32 x, S32 y, MASK mask )
{
if (mItem->getThumbnailUUID().notNull())
{
@@ -259,15 +259,15 @@ public:
.create_callback(boost::bind(&LLInspectTextureUtil::createInventoryToolTip, _1))
.create_params(params));
- return TRUE;
+ return true;
}
if (!mToolTip.empty())
{
LLToolTipMgr::instance().show(mToolTip);
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
/*virtual*/ LLStyleConstSP getStyle() const { return mStyle; }
@@ -305,10 +305,10 @@ public:
// return true if there are no embedded items.
bool empty();
- BOOL insertEmbeddedItem(LLInventoryItem* item, llwchar* value, bool is_new);
- BOOL removeEmbeddedItem( llwchar ext_char );
+ bool insertEmbeddedItem(LLInventoryItem* item, llwchar* value, bool is_new);
+ bool removeEmbeddedItem( llwchar ext_char );
- BOOL hasEmbeddedItem(llwchar ext_char); // returns TRUE if /this/ editor has an entry for this item
+ bool hasEmbeddedItem(llwchar ext_char); // returns true if /this/ editor has an entry for this item
LLUIImagePtr getItemImage(llwchar ext_char) const;
void getEmbeddedItemList( std::vector<LLPointer<LLInventoryItem> >& items );
@@ -323,14 +323,14 @@ public:
void markSaved();
static LLPointer<LLInventoryItem> getEmbeddedItemPtr(llwchar ext_char); // returns pointer to item from static list
- static BOOL getEmbeddedItemSaved(llwchar ext_char); // returns whether item from static list is saved
+ static bool getEmbeddedItemSaved(llwchar ext_char); // returns whether item from static list is saved
private:
struct embedded_info_t
{
LLPointer<LLInventoryItem> mItemPtr;
- BOOL mSaved;
+ bool mSaved;
};
typedef std::map<llwchar, embedded_info_t > item_map_t;
static item_map_t sEntries;
@@ -375,7 +375,7 @@ bool LLEmbeddedItems::empty()
}
// Inserts a new unique entry
-BOOL LLEmbeddedItems::insertEmbeddedItem( LLInventoryItem* item, llwchar* ext_char, bool is_new)
+bool LLEmbeddedItems::insertEmbeddedItem( LLInventoryItem* item, llwchar* ext_char, bool is_new)
{
// Now insert a new one
llwchar wc_emb;
@@ -395,20 +395,20 @@ BOOL LLEmbeddedItems::insertEmbeddedItem( LLInventoryItem* item, llwchar* ext_ch
wc_emb = last->first;
if (wc_emb >= LLTextEditor::LAST_EMBEDDED_CHAR)
{
- return FALSE;
+ return false;
}
++wc_emb;
}
sEntries[wc_emb].mItemPtr = item;
- sEntries[wc_emb].mSaved = is_new ? FALSE : TRUE;
+ sEntries[wc_emb].mSaved = !is_new;
*ext_char = wc_emb;
mEmbeddedUsedChars.insert(wc_emb);
- return TRUE;
+ return true;
}
// Removes an entry (all entries are unique)
-BOOL LLEmbeddedItems::removeEmbeddedItem( llwchar ext_char )
+bool LLEmbeddedItems::removeEmbeddedItem( llwchar ext_char )
{
mEmbeddedUsedChars.erase(ext_char);
item_map_t::iterator iter = sEntries.find(ext_char);
@@ -416,9 +416,9 @@ BOOL LLEmbeddedItems::removeEmbeddedItem( llwchar ext_char )
{
sEntries.erase(ext_char);
sFreeEntries.push(ext_char);
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
// static
@@ -436,7 +436,7 @@ LLPointer<LLInventoryItem> LLEmbeddedItems::getEmbeddedItemPtr(llwchar ext_char)
}
// static
-BOOL LLEmbeddedItems::getEmbeddedItemSaved(llwchar ext_char)
+bool LLEmbeddedItems::getEmbeddedItemSaved(llwchar ext_char)
{
if( ext_char >= LLTextEditor::FIRST_EMBEDDED_CHAR && ext_char <= LLTextEditor::LAST_EMBEDDED_CHAR )
{
@@ -446,7 +446,7 @@ BOOL LLEmbeddedItems::getEmbeddedItemSaved(llwchar ext_char)
return iter->second.mSaved;
}
}
- return FALSE;
+ return false;
}
llwchar LLEmbeddedItems::getEmbeddedCharFromIndex(S32 index)
@@ -514,14 +514,14 @@ S32 LLEmbeddedItems::getIndexFromEmbeddedChar(llwchar wch)
}
}
-BOOL LLEmbeddedItems::hasEmbeddedItem(llwchar ext_char)
+bool LLEmbeddedItems::hasEmbeddedItem(llwchar ext_char)
{
std::set<llwchar>::iterator iter = mEmbeddedUsedChars.find(ext_char);
if (iter != mEmbeddedUsedChars.end())
{
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
@@ -606,7 +606,7 @@ void LLEmbeddedItems::markSaved()
for (std::set<llwchar>::iterator iter = mEmbeddedUsedChars.begin(); iter != mEmbeddedUsedChars.end(); ++iter)
{
llwchar wc = *iter;
- sEntries[wc].mSaved = TRUE;
+ sEntries[wc].mSaved = true;
}
}
@@ -616,13 +616,13 @@ class LLViewerTextEditor::TextCmdInsertEmbeddedItem : public LLTextBase::TextCmd
{
public:
TextCmdInsertEmbeddedItem( S32 pos, LLInventoryItem* item )
- : TextCmd(pos, FALSE),
+ : TextCmd(pos, false),
mExtCharValue(0)
{
mItem = item;
}
- virtual BOOL execute( LLTextBase* editor, S32* delta )
+ virtual bool execute( LLTextBase* editor, S32* delta )
{
LLViewerTextEditor* viewer_editor = (LLViewerTextEditor*)editor;
// Take this opportunity to remove any unused embedded items from this editor
@@ -634,7 +634,7 @@ public:
*delta = insert(editor, getPosition(), ws );
return (*delta != 0);
}
- return FALSE;
+ return false;
}
virtual S32 undo( LLTextBase* editor )
@@ -650,7 +650,7 @@ public:
insert(editor, getPosition(), ws );
return getPosition() + 1;
}
- virtual BOOL hasExtCharValue( llwchar value ) const
+ virtual bool hasExtCharValue( llwchar value ) const
{
return (value == mExtCharValue);
}
@@ -682,7 +682,7 @@ struct LLNotecardCopyInfo
LLViewerTextEditor::LLViewerTextEditor(const LLViewerTextEditor::Params& p)
: LLTextEditor(p),
mDragItemChar(0),
- mDragItemSaved(FALSE),
+ mDragItemSaved(false),
mInventoryCallback(new LLEmbeddedNotecardOpener)
{
mEmbeddedItemList = new LLEmbeddedItems(this);
@@ -707,14 +707,14 @@ void LLViewerTextEditor::makePristine()
LLTextEditor::makePristine();
}
-void LLViewerTextEditor::onVisibilityChange( BOOL new_visibility )
+void LLViewerTextEditor::onVisibilityChange( bool new_visibility )
{
LLUICtrl::onVisibilityChange(new_visibility);
}
-BOOL LLViewerTextEditor::handleMouseDown(S32 x, S32 y, MASK mask)
+bool LLViewerTextEditor::handleMouseDown(S32 x, S32 y, MASK mask)
{
- BOOL handled = FALSE;
+ bool handled = false;
// Let scrollbar have first dibs
handled = LLView::childrenHandleMouseDown(x, y, mask) != NULL;
@@ -723,7 +723,7 @@ BOOL LLViewerTextEditor::handleMouseDown(S32 x, S32 y, MASK mask)
{
if( allowsEmbeddedItems() )
{
- setCursorAtLocalPos( x, y, FALSE );
+ setCursorAtLocalPos( x, y, false );
llwchar wc = 0;
if (mCursorPos < getLength())
{
@@ -745,10 +745,10 @@ BOOL LLViewerTextEditor::handleMouseDown(S32 x, S32 y, MASK mask)
if (hasTabStop())
{
- setFocus( TRUE );
+ setFocus( true );
}
- handled = TRUE;
+ handled = true;
}
else
{
@@ -766,9 +766,9 @@ BOOL LLViewerTextEditor::handleMouseDown(S32 x, S32 y, MASK mask)
}
-BOOL LLViewerTextEditor::handleHover(S32 x, S32 y, MASK mask)
+bool LLViewerTextEditor::handleHover(S32 x, S32 y, MASK mask)
{
- BOOL handled = LLTextEditor::handleHover(x, y, mask);
+ bool handled = LLTextEditor::handleHover(x, y, mask);
if(hasMouseCapture() && mDragItem)
{
@@ -788,16 +788,16 @@ BOOL LLViewerTextEditor::handleHover(S32 x, S32 y, MASK mask)
return LLToolDragAndDrop::getInstance()->handleHover( x, y, mask );
}
getWindow()->setCursor(UI_CURSOR_HAND);
- handled = TRUE;
+ handled = true;
}
return handled;
}
-BOOL LLViewerTextEditor::handleMouseUp(S32 x, S32 y, MASK mask)
+bool LLViewerTextEditor::handleMouseUp(S32 x, S32 y, MASK mask)
{
- BOOL handled = FALSE;
+ bool handled = false;
if( hasMouseCapture() )
{
@@ -826,9 +826,9 @@ BOOL LLViewerTextEditor::handleMouseUp(S32 x, S32 y, MASK mask)
return handled;
}
-BOOL LLViewerTextEditor::handleDoubleClick(S32 x, S32 y, MASK mask)
+bool LLViewerTextEditor::handleDoubleClick(S32 x, S32 y, MASK mask)
{
- BOOL handled = FALSE;
+ bool handled = false;
// let scrollbar have first dibs
handled = LLView::childrenHandleDoubleClick(x, y, mask) != NULL;
@@ -837,15 +837,15 @@ BOOL LLViewerTextEditor::handleDoubleClick(S32 x, S32 y, MASK mask)
{
if( allowsEmbeddedItems() )
{
- S32 doc_index = getDocIndexFromLocalCoord(x, y, FALSE);
+ S32 doc_index = getDocIndexFromLocalCoord(x, y, false);
llwchar doc_char = getWText()[doc_index];
if (mEmbeddedItemList->hasEmbeddedItem(doc_char))
{
if( openEmbeddedItemAtPos( doc_index ))
{
deselect();
- setFocus( FALSE );
- return TRUE;
+ setFocus( false );
+ return true;
}
}
}
@@ -856,19 +856,19 @@ BOOL LLViewerTextEditor::handleDoubleClick(S32 x, S32 y, MASK mask)
// virtual
-BOOL LLViewerTextEditor::handleDragAndDrop(S32 x, S32 y, MASK mask,
- BOOL drop, EDragAndDropType cargo_type, void *cargo_data,
+bool LLViewerTextEditor::handleDragAndDrop(S32 x, S32 y, MASK mask,
+ bool drop, EDragAndDropType cargo_type, void *cargo_data,
EAcceptance *accept,
std::string& tooltip_msg)
{
- BOOL handled = FALSE;
+ bool handled = false;
LLToolDragAndDrop::ESource source = LLToolDragAndDrop::getInstance()->getSource();
if (LLToolDragAndDrop::SOURCE_NOTECARD == source)
{
// We currently do not handle dragging items from one notecard to another
// since items in a notecard must be in Inventory to be verified. See DEV-2891.
- return FALSE;
+ return false;
}
if (getEnabled() && acceptsTextInput())
@@ -918,10 +918,10 @@ BOOL LLViewerTextEditor::handleDragAndDrop(S32 x, S32 y, MASK mask,
{
deselect();
S32 old_cursor = mCursorPos;
- setCursorAtLocalPos( x, y, TRUE );
+ setCursorAtLocalPos( x, y, true );
S32 insert_pos = mCursorPos;
setCursorPos(old_cursor);
- BOOL inserted = insertEmbeddedItem( insert_pos, item );
+ bool inserted = insertEmbeddedItem( insert_pos, item );
if( inserted && (old_cursor > mCursorPos) )
{
setCursorPos(mCursorPos + 1);
@@ -951,7 +951,7 @@ BOOL LLViewerTextEditor::handleDragAndDrop(S32 x, S32 y, MASK mask,
*accept = ACCEPT_NO;
}
- handled = TRUE;
+ handled = true;
LL_DEBUGS("UserInput") << "dragAndDrop handled by LLViewerTextEditor " << getName() << LL_ENDL;
return handled;
@@ -1099,7 +1099,7 @@ void LLViewerTextEditor::findEmbeddedItemSegments(S32 start, S32 end)
}
}
-BOOL LLViewerTextEditor::openEmbeddedItemAtPos(S32 pos)
+bool LLViewerTextEditor::openEmbeddedItemAtPos(S32 pos)
{
if( pos < getLength())
{
@@ -1107,7 +1107,7 @@ BOOL LLViewerTextEditor::openEmbeddedItemAtPos(S32 pos)
LLPointer<LLInventoryItem> item = LLEmbeddedItems::getEmbeddedItemPtr( wc );
if( item )
{
- BOOL saved = LLEmbeddedItems::getEmbeddedItemSaved( wc );
+ bool saved = LLEmbeddedItems::getEmbeddedItemSaved( wc );
if (saved)
{
return openEmbeddedItem(item, wc);
@@ -1118,36 +1118,36 @@ BOOL LLViewerTextEditor::openEmbeddedItemAtPos(S32 pos)
}
}
}
- return FALSE;
+ return false;
}
-BOOL LLViewerTextEditor::openEmbeddedItem(LLPointer<LLInventoryItem> item, llwchar wc)
+bool LLViewerTextEditor::openEmbeddedItem(LLPointer<LLInventoryItem> item, llwchar wc)
{
switch( item->getType() )
{
case LLAssetType::AT_TEXTURE:
openEmbeddedTexture( item, wc );
- return TRUE;
+ return true;
case LLAssetType::AT_SOUND:
openEmbeddedSound( item, wc );
- return TRUE;
+ return true;
case LLAssetType::AT_LANDMARK:
openEmbeddedLandmark( item, wc );
- return TRUE;
+ return true;
case LLAssetType::AT_CALLINGCARD:
openEmbeddedCallingcard( item, wc );
- return TRUE;
+ return true;
case LLAssetType::AT_SETTINGS:
openEmbeddedSetting(item, wc);
- return TRUE;
+ return true;
case LLAssetType::AT_MATERIAL:
openEmbeddedGLTFMaterial(item, wc);
- return TRUE;
+ return true;
case LLAssetType::AT_NOTECARD:
case LLAssetType::AT_LSL_TEXT:
case LLAssetType::AT_CLOTHING:
@@ -1156,9 +1156,9 @@ BOOL LLViewerTextEditor::openEmbeddedItem(LLPointer<LLInventoryItem> item, llwch
case LLAssetType::AT_ANIMATION:
case LLAssetType::AT_GESTURE:
showCopyToInvDialog( item, wc );
- return TRUE;
+ return true;
default:
- return FALSE;
+ return false;
}
}
@@ -1254,7 +1254,7 @@ void LLViewerTextEditor::openEmbeddedGLTFMaterial(LLInventoryItem* item, llwchar
preview->setAuxItem(item);
preview->setNotecardInfo(mNotecardInventoryID, mObjectID);
preview->openFloater(floater_key);
- preview->setFocus(TRUE);
+ preview->setFocus(true);
}
}
@@ -1355,13 +1355,13 @@ bool LLViewerTextEditor::hasEmbeddedInventory()
////////////////////////////////////////////////////////////////////////////
-BOOL LLViewerTextEditor::importBuffer( const char* buffer, S32 length )
+bool LLViewerTextEditor::importBuffer( const char* buffer, S32 length )
{
LLMemoryStream str((U8*)buffer, length);
return importStream(str);
}
-BOOL LLViewerTextEditor::exportBuffer( std::string& buffer )
+bool LLViewerTextEditor::exportBuffer( std::string& buffer )
{
LLNotecard nc(LLNotecard::MAX_SIZE);
@@ -1378,6 +1378,6 @@ BOOL LLViewerTextEditor::exportBuffer( std::string& buffer )
buffer = out_stream.str();
- return TRUE;
+ return true;
}