diff options
Diffstat (limited to 'indra/llui')
| -rw-r--r-- | indra/llui/llbutton.cpp | 2 | ||||
| -rw-r--r-- | indra/llui/lleditmenuhandler.cpp | 7 | ||||
| -rw-r--r-- | indra/llui/lleditmenuhandler.h | 2 | ||||
| -rw-r--r-- | indra/llui/lllineeditor.cpp | 6 | ||||
| -rw-r--r-- | indra/llui/llscrolllistctrl.cpp | 5 | ||||
| -rw-r--r-- | indra/llui/lltexteditor.cpp | 20 | 
6 files changed, 17 insertions, 25 deletions
diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index 1d4dc35cee..33c6a8b6ac 100644 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -824,7 +824,7 @@ void LLButton::draw()  			x = text_right;  			break;  		case LLFontGL::HCENTER: -			x = getRect().getWidth() / 2; +			x = text_left + (text_width / 2);  			break;  		case LLFontGL::LEFT:  		default: diff --git a/indra/llui/lleditmenuhandler.cpp b/indra/llui/lleditmenuhandler.cpp index 821afae8fd..9d8af39a7a 100644 --- a/indra/llui/lleditmenuhandler.cpp +++ b/indra/llui/lleditmenuhandler.cpp @@ -37,3 +37,10 @@  /* static */  LLEditMenuHandler* LLEditMenuHandler::gEditMenuHandler = NULL; +LLEditMenuHandler::~LLEditMenuHandler() +{ +	if (gEditMenuHandler == this) +	{ +		gEditMenuHandler = NULL; +	} +}
\ No newline at end of file diff --git a/indra/llui/lleditmenuhandler.h b/indra/llui/lleditmenuhandler.h index 1de9c56afb..d72283cd99 100644 --- a/indra/llui/lleditmenuhandler.h +++ b/indra/llui/lleditmenuhandler.h @@ -38,7 +38,7 @@ class LLEditMenuHandler  {  public:  	// this is needed even though this is just an interface class. -	virtual ~LLEditMenuHandler() {}; +	virtual ~LLEditMenuHandler();  	virtual void	undo() {};  	virtual BOOL	canUndo() const { return FALSE; } diff --git a/indra/llui/lllineeditor.cpp b/indra/llui/lllineeditor.cpp index ce0c0befe0..843f72d8e4 100644 --- a/indra/llui/lllineeditor.cpp +++ b/indra/llui/lllineeditor.cpp @@ -190,12 +190,8 @@ LLLineEditor::~LLLineEditor()  {  	mCommitOnFocusLost = FALSE; +	// calls onCommit() while LLLineEditor still valid  	gFocusMgr.releaseFocusIfNeeded( this ); - -	if( gEditMenuHandler == this ) -	{ -		gEditMenuHandler = NULL; -	}  } diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp index bf0866a655..db0f2bd6e2 100644 --- a/indra/llui/llscrolllistctrl.cpp +++ b/indra/llui/llscrolllistctrl.cpp @@ -324,11 +324,6 @@ LLScrollListCtrl::~LLScrollListCtrl()  	delete mSortCallback;  	std::for_each(mItemList.begin(), mItemList.end(), DeletePointer()); - -	if( gEditMenuHandler == this ) -	{ -		gEditMenuHandler = NULL; -	}  } diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index 0f943831eb..a1cae4bb98 100644 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -303,12 +303,6 @@ LLTextEditor::~LLTextEditor()  {  	gFocusMgr.releaseFocusIfNeeded( this ); // calls onCommit() while LLTextEditor still valid -	// Route menu back to the default -	if( gEditMenuHandler == this ) -	{ -		gEditMenuHandler = NULL; -	} -  	// Scrollbar is deleted by LLView  	std::for_each(mUndoStack.begin(), mUndoStack.end(), DeletePointer()); @@ -1267,7 +1261,7 @@ BOOL LLTextEditor::handleNavigationKey(const KEY key, const MASK mask)  			break;  		}  	} - +	  	if (handled)  	{  		deselect(); @@ -1527,7 +1521,7 @@ BOOL LLTextEditor::handleControlKey(const KEY key, const MASK mask)  BOOL LLTextEditor::handleSpecialKey(const KEY key, const MASK mask)	 -{ +	{  	BOOL handled = TRUE;  	if (mReadOnly) return FALSE; @@ -1637,15 +1631,15 @@ BOOL LLTextEditor::handleKeyHere(KEY key, MASK mask )  	{  		return FALSE;  	} - +		  	if (mReadOnly && mScroller)  	{  		handled = (mScroller && mScroller->handleKeyHere( key, mask ))  				|| handleSelectionKey(key, mask)  				|| handleControlKey(key, mask); -	} -	else -	{ +		} +		else  +		{  		handled = handleNavigationKey( key, mask )  				|| handleSelectionKey(key, mask)  				|| handleControlKey(key, mask) @@ -2155,7 +2149,7 @@ void LLTextEditor::getCurrentLineAndColumn( S32* line, S32* col, BOOL include_wo  void LLTextEditor::autoIndent()  {  	// Count the number of spaces in the current line -	S32 line = getLineNumFromDocIndex(mCursorPos); +	S32 line = getLineNumFromDocIndex(mCursorPos, false);  	S32 line_start = getLineStart(line);  	S32 space_count = 0;  	S32 i;  | 
