Fix corrupted text in poorman slider
UpdateText must return a pointer to a fixed buffer, whcih BString.String isn't, if the sctring is modified. Copy the data to a char* we can use as a fixed position buffer.
This commit is contained in:
@@ -25,5 +25,6 @@ StatusSlider::UpdateText() const
|
|||||||
{
|
{
|
||||||
fStr.Truncate(0);
|
fStr.Truncate(0);
|
||||||
fFormat.Format(fStr, Value());
|
fFormat.Format(fStr, Value());
|
||||||
return fStr.String();
|
strcpy(fPattern, fStr.String());
|
||||||
|
return fPattern;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ public:
|
|||||||
virtual const char* UpdateText() const;
|
virtual const char* UpdateText() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
mutable char fPattern[256];
|
||||||
BMessageFormat fFormat;
|
BMessageFormat fFormat;
|
||||||
mutable BString fStr;
|
mutable BString fStr;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user