diff options
Diffstat (limited to 'indra/llui')
| -rw-r--r-- | indra/llui/llcheckboxctrl.h | 1 | ||||
| -rw-r--r-- | indra/llui/lllineeditor.cpp | 27 | ||||
| -rw-r--r-- | indra/llui/lllineeditor.h | 4 | ||||
| -rw-r--r-- | indra/llui/llresizebar.cpp | 6 | ||||
| -rw-r--r-- | indra/llui/lltabcontainer.cpp | 2 | ||||
| -rw-r--r-- | indra/llui/lltextbase.cpp | 8 | 
6 files changed, 38 insertions, 10 deletions
diff --git a/indra/llui/llcheckboxctrl.h b/indra/llui/llcheckboxctrl.h index 2f8e8fdd23..b14e66b915 100644 --- a/indra/llui/llcheckboxctrl.h +++ b/indra/llui/llcheckboxctrl.h @@ -107,6 +107,7 @@ public:  	std::string			getLabel() const;  	void				setFont( const LLFontGL* font ) { mFont = font; } +	const LLFontGL*		getFont() { return mFont; }  	virtual void		setControlName(const std::string& control_name, LLView* context); diff --git a/indra/llui/lllineeditor.cpp b/indra/llui/lllineeditor.cpp index 75905d0927..c2f91ff7e0 100644 --- a/indra/llui/lllineeditor.cpp +++ b/indra/llui/lllineeditor.cpp @@ -84,8 +84,8 @@ void LLLineEditor::PrevalidateNamedFuncs::declareValues()  	declare("non_negative_s32", LLLineEditor::prevalidateNonNegativeS32);  	declare("alpha_num", LLLineEditor::prevalidateAlphaNum);  	declare("alpha_num_space", LLLineEditor::prevalidateAlphaNumSpace); -	declare("printable_not_pipe", LLLineEditor::prevalidatePrintableNotPipe); -	declare("printable_no_space", LLLineEditor::prevalidatePrintableNoSpace); +	declare("ascii_printable_no_pipe", LLLineEditor::prevalidateASCIIPrintableNoPipe); +	declare("ascii_printable_no_space", LLLineEditor::prevalidateASCIIPrintableNoSpace);  }  LLLineEditor::Params::Params() @@ -2186,20 +2186,28 @@ BOOL LLLineEditor::prevalidateAlphaNumSpace(const LLWString &str)  	return rv;  } +// Used for most names of things stored on the server, due to old file-formats +// that used the pipe (|) for multiline text storage.  Examples include +// inventory item names, parcel names, object names, etc.  // static -BOOL LLLineEditor::prevalidatePrintableNotPipe(const LLWString &str) +BOOL LLLineEditor::prevalidateASCIIPrintableNoPipe(const LLWString &str)  {  	BOOL rv = TRUE;  	S32 len = str.length();  	if(len == 0) return rv;  	while(len--)  	{ -		if('|' == str[len]) +		llwchar wc = str[len]; +		if (wc < 0x20 +			|| wc > 0x7f +			|| wc == '|')  		{  			rv = FALSE;  			break;  		} -		if(!((' ' == str[len]) || LLStringOps::isAlnum((char)str[len]) || LLStringOps::isPunct((char)str[len]))) +		if(!(wc == ' ' +			 || LLStringOps::isAlnum((char)wc) +			 || LLStringOps::isPunct((char)wc) ) )  		{  			rv = FALSE;  			break; @@ -2209,15 +2217,19 @@ BOOL LLLineEditor::prevalidatePrintableNotPipe(const LLWString &str)  } +// Used for avatar names  // static -BOOL LLLineEditor::prevalidatePrintableNoSpace(const LLWString &str) +BOOL LLLineEditor::prevalidateASCIIPrintableNoSpace(const LLWString &str)  {  	BOOL rv = TRUE;  	S32 len = str.length();  	if(len == 0) return rv;  	while(len--)  	{ -		if(LLStringOps::isSpace(str[len])) +		llwchar wc = str[len]; +		if (wc < 0x20 +			|| wc > 0x7f +			|| LLStringOps::isSpace(wc))  		{  			rv = FALSE;  			break; @@ -2232,6 +2244,7 @@ BOOL LLLineEditor::prevalidatePrintableNoSpace(const LLWString &str)  	return rv;  } +  // static  BOOL LLLineEditor::prevalidateASCII(const LLWString &str)  { diff --git a/indra/llui/lllineeditor.h b/indra/llui/lllineeditor.h index d3daa941cf..4474963b1a 100644 --- a/indra/llui/lllineeditor.h +++ b/indra/llui/lllineeditor.h @@ -235,8 +235,8 @@ public:  	static BOOL		prevalidateNonNegativeS32(const LLWString &str);  	static BOOL		prevalidateAlphaNum(const LLWString &str );  	static BOOL		prevalidateAlphaNumSpace(const LLWString &str ); -	static BOOL		prevalidatePrintableNotPipe(const LLWString &str);  -	static BOOL		prevalidatePrintableNoSpace(const LLWString &str); +	static BOOL		prevalidateASCIIPrintableNoPipe(const LLWString &str);  +	static BOOL		prevalidateASCIIPrintableNoSpace(const LLWString &str);  	static BOOL		prevalidateASCII(const LLWString &str);  	static BOOL		postvalidateFloat(const std::string &str); diff --git a/indra/llui/llresizebar.cpp b/indra/llui/llresizebar.cpp index 304ac64f31..a7cf9be277 100644 --- a/indra/llui/llresizebar.cpp +++ b/indra/llui/llresizebar.cpp @@ -143,6 +143,12 @@ BOOL LLResizeBar::handleHover(S32 x, S32 y, MASK mask)  		if( valid_rect.localPointInRect( screen_x, screen_y ) && mResizingView )  		{ +			// undock floater when user resize it +			if (((LLFloater*)getParent())->isDocked()) +			{ +				((LLFloater*)getParent())->setDocked(false, false); +			} +  			// Resize the parent  			LLRect orig_rect = mResizingView->getRect();  			LLRect scaled_rect = orig_rect; diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp index 44eff8d357..f5d8174820 100644 --- a/indra/llui/lltabcontainer.cpp +++ b/indra/llui/lltabcontainer.cpp @@ -391,7 +391,7 @@ void LLTabContainer::draw()  						mNextArrowBtn->setFlashing( TRUE );  					}  				} -			}
 +			}  			idx++;  		} diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index caaf47240f..cd795282f9 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -2380,6 +2380,14 @@ bool LLNormalTextSegment::getDimensions(S32 first_char, S32 num_chars, S32& widt  	width = mStyle->getFont()->getWidth(text.c_str(), mStart + first_char, num_chars);  	// if last character is a newline, then return true, forcing line break  	llwchar last_char = text[mStart + first_char + num_chars - 1]; + +	LLUIImagePtr image = mStyle->getImage(); +	if( image.notNull()) +	{ +		width += image->getWidth(); +		height = llmax(height, image->getHeight()); +	} +  	return num_chars >= 1 && last_char == '\n';  }  | 
