From d668270c13fcad8ae6e0fdfdf063a16be6083243 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Wed, 13 Jul 2011 18:24:48 -0700 Subject: EXP-880 FIX Enable navigation chrome in search floater fixed regression where preferred content size was no longer being respected --- indra/llxuixml/llinitparam.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'indra/llxuixml/llinitparam.h') diff --git a/indra/llxuixml/llinitparam.h b/indra/llxuixml/llinitparam.h index 35c889b69f..7c4d4c8a43 100644 --- a/indra/llxuixml/llinitparam.h +++ b/indra/llxuixml/llinitparam.h @@ -1775,8 +1775,8 @@ namespace LLInitParam void serializeBlock(Parser& parser, Parser::name_stack_t name_stack = Parser::name_stack_t(), const BaseBlock* diff_block = NULL) const { - const self_t& typed_param = static_cast(*this); - const self_t* diff_param = static_cast(diff_block); + const derived_t& typed_param = static_cast(*this); + const derived_t* diff_param = static_cast(diff_block); std::string key = typed_param.getValueName(); @@ -1801,6 +1801,8 @@ namespace LLInitParam // be exported as , since it was probably the intent of the user to // be specific about the RGB color values. This also fixes an issue where we distinguish // between rect.left not being provided and rect.left being explicitly set to 0 (same as default) + const_cast(typed_param).updateBlockFromValue(); + block_t::serializeBlock(parser, name_stack, NULL); } } @@ -1863,7 +1865,7 @@ namespace LLInitParam mValueAge = VALUE_AUTHORITATIVE; mValue = val; typed_param.clearValueName(); - static_cast(const_cast(this))->updateBlockFromValue(); + static_cast(this)->updateBlockFromValue(); } value_assignment_t getValue() const -- cgit v1.2.3 From 7dd8dc8be61ec40e33c40b9b37b8f45335df25c4 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 14 Jul 2011 20:57:32 -0700 Subject: EXP-880 FIX Enable navigation chrome in search floater fixed regression where profile window wasn't using requested size --- indra/llxuixml/llinitparam.h | 39 ++++++++++++++++++++++----------------- 1 file changed, 22 insertions(+), 17 deletions(-) (limited to 'indra/llxuixml/llinitparam.h') diff --git a/indra/llxuixml/llinitparam.h b/indra/llxuixml/llinitparam.h index 7c4d4c8a43..194ef8af6a 100644 --- a/indra/llxuixml/llinitparam.h +++ b/indra/llxuixml/llinitparam.h @@ -740,7 +740,6 @@ namespace LLInitParam if (src_typed_param.isProvided() && (overwrite || !dst_typed_param.isProvided())) { - dst_typed_param.clearValueName(); dst_typed_param.set(src_typed_param.getValue()); return true; } @@ -1744,33 +1743,29 @@ namespace LLInitParam : mValue(value), mValueAge(VALUE_AUTHORITATIVE), mKeyVersion(0), - mValidatedVersion(-1) + mValidatedVersion(-1), + mValidated(false) {} bool deserializeBlock(Parser& parser, Parser::name_stack_range_t name_stack, S32 generation) { derived_t& typed_param = static_cast(*this); - // type to apply parse direct value T + // try to parse direct value T if (name_stack.first == name_stack.second) { if(parser.readValue(typed_param.mValue)) { - typed_param.clearValueName(); typed_param.mValueAge = VALUE_AUTHORITATIVE; - typed_param.updateBlockFromValue(); + typed_param.updateBlockFromValue(false); + + typed_param.clearValueName(); return true; } } // fall back on parsing block components for T - // if we deserialized at least one component... - if (typed_param.BaseBlock::deserializeBlock(parser, name_stack, generation)) - { - return true; - } - - return false; + return typed_param.BaseBlock::deserializeBlock(parser, name_stack, generation); } void serializeBlock(Parser& parser, Parser::name_stack_t name_stack = Parser::name_stack_t(), const BaseBlock* diff_block = NULL) const @@ -1801,9 +1796,20 @@ namespace LLInitParam // be exported as , since it was probably the intent of the user to // be specific about the RGB color values. This also fixes an issue where we distinguish // between rect.left not being provided and rect.left being explicitly set to 0 (same as default) - const_cast(typed_param).updateBlockFromValue(); - block_t::serializeBlock(parser, name_stack, NULL); + if (typed_param.mValueAge == VALUE_AUTHORITATIVE) + { + // if the value is authoritative but the parser doesn't accept the value type + // go ahead and make a copy, and splat the value out to its component params + // and serialize those params + derived_t copy(typed_param); + copy.updateBlockFromValue(true); + copy.block_t::serializeBlock(parser, name_stack, NULL); + } + else + { + block_t::serializeBlock(parser, name_stack, NULL); + } } } } @@ -1852,7 +1858,7 @@ namespace LLInitParam { BaseBlock::paramChanged(changed_param, user_provided); if (user_provided) - { + { // a parameter changed, so our value is out of date mValueAge = VALUE_NEEDS_UPDATE; } @@ -1865,7 +1871,7 @@ namespace LLInitParam mValueAge = VALUE_AUTHORITATIVE; mValue = val; typed_param.clearValueName(); - static_cast(this)->updateBlockFromValue(); + static_cast(this)->updateBlockFromValue(false); } value_assignment_t getValue() const @@ -1920,7 +1926,6 @@ namespace LLInitParam mutable bool mValidated; // lazy validation flag private: - mutable T mValue; mutable EValueAge mValueAge; }; -- cgit v1.2.3