mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-16 00:34:19 +00:00
Defaulted some constructors and copy assignment operators in AttributedString
This commit is contained in:
parent
9de863a272
commit
c723e56952
2 changed files with 10 additions and 46 deletions
|
|
@ -150,52 +150,12 @@ AttributedString::Attribute& AttributedString::Attribute::operator= (Attribute&&
|
|||
return *this;
|
||||
}
|
||||
|
||||
AttributedString::Attribute::Attribute (const Attribute& other) noexcept
|
||||
: range (other.range),
|
||||
font (other.font),
|
||||
colour (other.colour)
|
||||
{
|
||||
}
|
||||
|
||||
AttributedString::Attribute& AttributedString::Attribute::operator= (const Attribute& other) noexcept
|
||||
{
|
||||
range = other.range;
|
||||
font = other.font;
|
||||
colour = other.colour;
|
||||
return *this;
|
||||
}
|
||||
|
||||
AttributedString::Attribute::Attribute (Range<int> r, const Font& f, Colour c) noexcept
|
||||
: range (r), font (f), colour (c)
|
||||
{
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
AttributedString::AttributedString (const AttributedString& other)
|
||||
: text (other.text),
|
||||
lineSpacing (other.lineSpacing),
|
||||
justification (other.justification),
|
||||
wordWrap (other.wordWrap),
|
||||
readingDirection (other.readingDirection),
|
||||
attributes (other.attributes)
|
||||
{
|
||||
}
|
||||
|
||||
AttributedString& AttributedString::operator= (const AttributedString& other)
|
||||
{
|
||||
if (this != &other)
|
||||
{
|
||||
text = other.text;
|
||||
lineSpacing = other.lineSpacing;
|
||||
justification = other.justification;
|
||||
wordWrap = other.wordWrap;
|
||||
readingDirection = other.readingDirection;
|
||||
attributes = other.attributes;
|
||||
}
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
AttributedString::AttributedString (AttributedString&& other) noexcept
|
||||
: text (std::move (other.text)),
|
||||
lineSpacing (other.lineSpacing),
|
||||
|
|
|
|||
|
|
@ -43,13 +43,15 @@ class JUCE_API AttributedString
|
|||
{
|
||||
public:
|
||||
/** Creates an empty attributed string. */
|
||||
AttributedString() {}
|
||||
AttributedString() = default;
|
||||
|
||||
/** Creates an attributed string with the given text. */
|
||||
explicit AttributedString (const String& newString) { setText (newString); }
|
||||
|
||||
AttributedString (const AttributedString&);
|
||||
AttributedString& operator= (const AttributedString&);
|
||||
AttributedString (const AttributedString&) = default;
|
||||
AttributedString& operator= (const AttributedString&) = default;
|
||||
|
||||
// VS2013 can't default move constructors and assignments
|
||||
AttributedString (AttributedString&&) noexcept;
|
||||
AttributedString& operator= (AttributedString&&) noexcept;
|
||||
|
||||
|
|
@ -148,10 +150,12 @@ public:
|
|||
class JUCE_API Attribute
|
||||
{
|
||||
public:
|
||||
Attribute() noexcept {}
|
||||
Attribute() = default;
|
||||
|
||||
Attribute (const Attribute&) noexcept;
|
||||
Attribute& operator= (const Attribute&) noexcept;
|
||||
Attribute (const Attribute&) = default;
|
||||
Attribute& operator= (const Attribute&) = default;
|
||||
|
||||
// VS2013 can't default move constructors and assignments
|
||||
Attribute (Attribute&&) noexcept;
|
||||
Attribute& operator= (Attribute&&) noexcept;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue