summaryrefslogtreecommitdiff
path: root/indra/llxuixml
diff options
context:
space:
mode:
authorrichard <none@none>2010-02-01 12:39:59 -0800
committerrichard <none@none>2010-02-01 12:39:59 -0800
commit45e700cb3ef9c56aaf373a8b4acafb4fc07a5972 (patch)
tree394d990d038387952d0668da989dd4d7da072c86 /indra/llxuixml
parentc339017d2e156a68f1e300a7668f2a9f6e6141f7 (diff)
parentf99a7b23ae0cee0d3e96b0b89d82e5c35bb07433 (diff)
merge
Diffstat (limited to 'indra/llxuixml')
-rw-r--r--indra/llxuixml/llinitparam.cpp10
-rw-r--r--indra/llxuixml/llinitparam.h3
-rw-r--r--indra/llxuixml/lluicolor.cpp14
-rw-r--r--indra/llxuixml/lluicolor.h8
4 files changed, 17 insertions, 18 deletions
diff --git a/indra/llxuixml/llinitparam.cpp b/indra/llxuixml/llinitparam.cpp
index d908c85da6..fb0a04dc58 100644
--- a/indra/llxuixml/llinitparam.cpp
+++ b/indra/llxuixml/llinitparam.cpp
@@ -84,8 +84,7 @@ namespace LLInitParam
// BaseBlock
//
BaseBlock::BaseBlock()
- : mLastChangedParam(0),
- mChangeVersion(0),
+ : mChangeVersion(0),
mBlockDescriptor(NULL)
{}
@@ -348,7 +347,6 @@ namespace LLInitParam
if (deserialize_func && deserialize_func(*paramp, p, name_stack, name_stack.first == name_stack.second ? -1 : name_stack.first->second))
{
- mLastChangedParam = (*it)->mParamHandle;
return true;
}
}
@@ -417,9 +415,11 @@ namespace LLInitParam
void BaseBlock::setLastChangedParam(const Param& last_param, bool user_provided)
{
- mLastChangedParam = getHandleFromParam(&last_param);
+ if (user_provided)
+ {
mChangeVersion++;
}
+ }
const std::string& BaseBlock::getParamName(const BlockDescriptor& block_data, const Param* paramp) const
{
@@ -472,7 +472,6 @@ namespace LLInitParam
{
Param* paramp = getParamFromHandle(it->mParamHandle);
param_changed |= merge_func(*paramp, *other_paramp, true);
- mLastChangedParam = it->mParamHandle;
}
}
return param_changed;
@@ -493,7 +492,6 @@ namespace LLInitParam
{
Param* paramp = getParamFromHandle(it->mParamHandle);
param_changed |= merge_func(*paramp, *other_paramp, false);
- mLastChangedParam = it->mParamHandle;
}
}
return param_changed;
diff --git a/indra/llxuixml/llinitparam.h b/indra/llxuixml/llinitparam.h
index a84e47f998..d264cea3b2 100644
--- a/indra/llxuixml/llinitparam.h
+++ b/indra/llxuixml/llinitparam.h
@@ -472,7 +472,6 @@ namespace LLInitParam
// Blocks can override this to do custom tracking of changes
virtual void setLastChangedParam(const Param& last_param, bool user_provided);
- const Param* getLastChangedParam() const { return mLastChangedParam ? getParamFromHandle(mLastChangedParam) : NULL; }
S32 getLastChangeVersion() const { return mChangeVersion; }
bool isDefault() const { return mChangeVersion == 0; }
@@ -507,7 +506,6 @@ namespace LLInitParam
bool fillFromImpl(BlockDescriptor& block_data, const BaseBlock& other);
// can be updated in getters
- mutable param_handle_t mLastChangedParam;
mutable S32 mChangeVersion;
BlockDescriptor* mBlockDescriptor; // most derived block descriptor
@@ -1734,6 +1732,7 @@ namespace LLInitParam
void set(value_assignment_t val, bool flag_as_provided = true)
{
Param::enclosingBlock().setLastChangedParam(*this, flag_as_provided);
+
// set param version number to be up to date, so we ignore block contents
mData.mLastParamVersion = BaseBlock::getLastChangeVersion();
diff --git a/indra/llxuixml/lluicolor.cpp b/indra/llxuixml/lluicolor.cpp
index 424d878a6b..0049ec055c 100644
--- a/indra/llxuixml/lluicolor.cpp
+++ b/indra/llxuixml/lluicolor.cpp
@@ -16,13 +16,15 @@ LLUIColor::LLUIColor()
{
}
-LLUIColor::LLUIColor(const LLColor4* color)
- :mColorPtr(color)
+
+LLUIColor::LLUIColor(const LLColor4& color)
+: mColor(color),
+ mColorPtr(NULL)
{
}
-LLUIColor::LLUIColor(const LLColor4& color)
- :mColor(color), mColorPtr(NULL)
+LLUIColor::LLUIColor(const LLUIColor* color)
+: mColorPtr(color)
{
}
@@ -32,14 +34,14 @@ void LLUIColor::set(const LLColor4& color)
mColorPtr = NULL;
}
-void LLUIColor::set(const LLColor4* color)
+void LLUIColor::set(const LLUIColor* color)
{
mColorPtr = color;
}
const LLColor4& LLUIColor::get() const
{
- return (mColorPtr == NULL ? mColor : *mColorPtr);
+ return (mColorPtr == NULL ? mColor : mColorPtr->get());
}
LLUIColor::operator const LLColor4& () const
diff --git a/indra/llxuixml/lluicolor.h b/indra/llxuixml/lluicolor.h
index bb0f786326..0ef2f78b24 100644
--- a/indra/llxuixml/lluicolor.h
+++ b/indra/llxuixml/lluicolor.h
@@ -22,11 +22,11 @@ class LLUIColor
{
public:
LLUIColor();
- LLUIColor(const LLColor4* color);
LLUIColor(const LLColor4& color);
+ LLUIColor(const LLUIColor* color);
void set(const LLColor4& color);
- void set(const LLColor4* color);
+ void set(const LLUIColor* color);
const LLColor4& get() const;
@@ -38,7 +38,7 @@ public:
private:
friend struct LLInitParam::ParamCompare<LLUIColor, false>;
- const LLColor4* mColorPtr;
+ const LLUIColor* mColorPtr;
LLColor4 mColor;
};
@@ -47,7 +47,7 @@ namespace LLInitParam
template<>
struct ParamCompare<LLUIColor, false>
{
- static bool equals(const class LLUIColor& a, const class LLUIColor& b);
+ static bool equals(const LLUIColor& a, const LLUIColor& b);
};
}