diff options
author | Richard Nelson <richard@lindenlab.com> | 2009-10-15 19:56:45 +0000 |
---|---|---|
committer | Richard Nelson <richard@lindenlab.com> | 2009-10-15 19:56:45 +0000 |
commit | 5edb4f2171fb92ff64913459a63afb20474db25a (patch) | |
tree | 2a32ae948197921d81f90de735637df8c758c96a /indra/llui | |
parent | 56fed69c4a5c801e46b61f85e6e01fcd302ae2e5 (diff) |
removed requirement for specializing ParamCompare on boost::function types
eliminated usage of iterator_range from LLInitParam
made LLTextEditor::addChar consistent with truncate in counting text bytes (not including null terminator)
EXT-1494 - Avatar profile description text truncated to 255 characters
reviewed by Leyla
Diffstat (limited to 'indra/llui')
-rw-r--r-- | indra/llui/lllineeditor.cpp | 17 | ||||
-rw-r--r-- | indra/llui/lllineeditor.h | 11 | ||||
-rw-r--r-- | indra/llui/llscrollbar.cpp | 12 | ||||
-rw-r--r-- | indra/llui/llscrollbar.h | 7 | ||||
-rw-r--r-- | indra/llui/lltexteditor.cpp | 2 | ||||
-rw-r--r-- | indra/llui/llui.cpp | 13 | ||||
-rw-r--r-- | indra/llui/llui.h | 7 | ||||
-rw-r--r-- | indra/llui/lluictrl.cpp | 21 | ||||
-rw-r--r-- | indra/llui/lluictrl.h | 17 | ||||
-rw-r--r-- | indra/llui/lluiimage.cpp | 3 | ||||
-rw-r--r-- | indra/llui/lluiimage.h | 6 |
11 files changed, 17 insertions, 99 deletions
diff --git a/indra/llui/lllineeditor.cpp b/indra/llui/lllineeditor.cpp index 0db515ab41..e053477d58 100644 --- a/indra/llui/lllineeditor.cpp +++ b/indra/llui/lllineeditor.cpp @@ -2514,20 +2514,3 @@ LLWString LLLineEditor::getConvertedText() const } return text; } - -namespace LLInitParam -{ - template<> - bool ParamCompare<LLLinePrevalidateFunc>::equals(const LLLinePrevalidateFunc &a, const LLLinePrevalidateFunc &b) - { - return false; - } - - template<> - bool ParamCompare<boost::function<void (LLLineEditor *)> >::equals( - const boost::function<void (LLLineEditor *)> &a, - const boost::function<void (LLLineEditor *)> &b) - { - return false; - } -} diff --git a/indra/llui/lllineeditor.h b/indra/llui/lllineeditor.h index 6e81969f00..3d7bbdff89 100644 --- a/indra/llui/lllineeditor.h +++ b/indra/llui/lllineeditor.h @@ -391,15 +391,4 @@ private: }; // end class LLLineEditor -namespace LLInitParam -{ - template<> - bool ParamCompare<LLLinePrevalidateFunc>::equals( - const LLLinePrevalidateFunc &a, const LLLinePrevalidateFunc &b); - - template<> - bool ParamCompare<boost::function<void (LLLineEditor *)> >::equals( - const boost::function<void (LLLineEditor *)> &a, const boost::function<void (LLLineEditor *)> &b); -} - #endif // LL_LINEEDITOR_ diff --git a/indra/llui/llscrollbar.cpp b/indra/llui/llscrollbar.cpp index 7db34a0608..cb4147709d 100644 --- a/indra/llui/llscrollbar.cpp +++ b/indra/llui/llscrollbar.cpp @@ -640,15 +640,3 @@ void LLScrollbar::onLineDownBtnPressed( const LLSD& data ) { changeLine( mStepSize, TRUE ); } - - -namespace LLInitParam -{ - template<> - bool ParamCompare<boost::function<void (S32, LLScrollbar*)> >::equals( - const boost::function<void (S32, LLScrollbar*)> &a, - const boost::function<void (S32, LLScrollbar*)> &b) - { - return false; - } -} diff --git a/indra/llui/llscrollbar.h b/indra/llui/llscrollbar.h index e4c5712fb7..2e95779624 100644 --- a/indra/llui/llscrollbar.h +++ b/indra/llui/llscrollbar.h @@ -167,11 +167,4 @@ private: }; -namespace LLInitParam -{ - template<> - bool ParamCompare<boost::function<void (S32, LLScrollbar*)> >::equals( - const boost::function<void (S32, LLScrollbar*)> &a, const boost::function<void (S32, LLScrollbar*)> &b); -} - #endif // LL_SCROLLBAR_H diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index 74373e7803..74ffad0f53 100644 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -990,7 +990,7 @@ void LLTextEditor::removeChar() // Add a single character to the text S32 LLTextEditor::addChar(S32 pos, llwchar wc) { - if ( (wstring_utf8_length( getWText() ) + wchar_utf8_length( wc )) >= mMaxTextByteLength) + if ( (wstring_utf8_length( getWText() ) + wchar_utf8_length( wc )) > mMaxTextByteLength) { make_ui_sound("UISndBadKeystroke"); return 0; diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp index 9a90ee267e..ec9220a984 100644 --- a/indra/llui/llui.cpp +++ b/indra/llui/llui.cpp @@ -1918,16 +1918,11 @@ namespace LLInitParam declare("blue", LLColor4::blue); } - template<> - class ParamCompare<const LLFontGL*> + bool ParamCompare<const LLFontGL*, boost::false_type>::equals(const LLFontGL* a, const LLFontGL* b) { - public: - static bool equals(const LLFontGL* a, const LLFontGL* b) - { - return !(a->getFontDesc() < b->getFontDesc()) - && !(b->getFontDesc() < a->getFontDesc()); - } - }; + return !(a->getFontDesc() < b->getFontDesc()) + && !(b->getFontDesc() < a->getFontDesc()); + } TypedParam<const LLFontGL*>::TypedParam(BlockDescriptor& descriptor, const char* _name, const LLFontGL*const value, ParamDescriptor::validation_func_t func, S32 min_count, S32 max_count) : super_t(descriptor, _name, value, func, min_count, max_count), diff --git a/indra/llui/llui.h b/indra/llui/llui.h index f071e8dc47..db18957a97 100644 --- a/indra/llui/llui.h +++ b/indra/llui/llui.h @@ -437,6 +437,13 @@ namespace LLInitParam }; template<> + struct ParamCompare<const LLFontGL*, boost::false_type> + { + static bool equals(const LLFontGL* a, const LLFontGL* b); + }; + + + template<> class TypedParam<LLCoordGL> : public BlockValue<LLCoordGL> { diff --git a/indra/llui/lluictrl.cpp b/indra/llui/lluictrl.cpp index 84b1c92097..0faff5eff6 100644 --- a/indra/llui/lluictrl.cpp +++ b/indra/llui/lluictrl.cpp @@ -849,24 +849,3 @@ BOOL LLUICtrl::getTentative() const // virtual void LLUICtrl::setColor(const LLColor4& color) { } - - -namespace LLInitParam -{ - template<> - bool ParamCompare<LLUICtrl::commit_callback_t>::equals( - const LLUICtrl::commit_callback_t &a, - const LLUICtrl::commit_callback_t &b) - { - return false; - } - - - template<> - bool ParamCompare<LLUICtrl::enable_callback_t>::equals( - const LLUICtrl::enable_callback_t &a, - const LLUICtrl::enable_callback_t &b) - { - return false; - } -} diff --git a/indra/llui/lluictrl.h b/indra/llui/lluictrl.h index 1d34cb39ec..45fe47772b 100644 --- a/indra/llui/lluictrl.h +++ b/indra/llui/lluictrl.h @@ -327,21 +327,4 @@ private: class DefaultTabGroupFirstSorter; }; -namespace LLInitParam -{ - template<> - bool ParamCompare<LLUICtrl::commit_callback_t>::equals( - const LLUICtrl::commit_callback_t &a, - const LLUICtrl::commit_callback_t &b); - - template<> - bool ParamCompare<LLUICtrl::enable_callback_t>::equals( - const LLUICtrl::enable_callback_t &a, - const LLUICtrl::enable_callback_t &b); - - template<> - bool ParamCompare<LLLazyValue<LLColor4> >::equals( - const LLLazyValue<LLColor4> &a, const LLLazyValue<LLColor4> &b); -} - #endif // LL_LLUICTRL_H diff --git a/indra/llui/lluiimage.cpp b/indra/llui/lluiimage.cpp index ab0d65e731..51828e5731 100644 --- a/indra/llui/lluiimage.cpp +++ b/indra/llui/lluiimage.cpp @@ -152,8 +152,7 @@ namespace LLInitParam } - template<> - bool ParamCompare<LLUIImage*>::equals( + bool ParamCompare<LLUIImage*, boost::false_type>::equals( LLUIImage* const &a, LLUIImage* const &b) { diff --git a/indra/llui/lluiimage.h b/indra/llui/lluiimage.h index 4ec24e98dc..9f505bea79 100644 --- a/indra/llui/lluiimage.h +++ b/indra/llui/lluiimage.h @@ -108,8 +108,10 @@ namespace LLInitParam // Need custom comparison function for our test app, which only loads // LLUIImage* as NULL. template<> - bool ParamCompare<LLUIImage*>::equals( - LLUIImage* const &a, LLUIImage* const &b); + struct ParamCompare<LLUIImage*, boost::false_type> + { + static bool equals(LLUIImage* const &a, LLUIImage* const &b); + }; } typedef LLPointer<LLUIImage> LLUIImagePtr; |