1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-02-09 04:30:09 +00:00

Code clean-ups. Jucer development.

This commit is contained in:
Julian Storer 2010-05-12 23:42:49 +01:00
parent 22e02cf791
commit 1751beed57
145 changed files with 2247 additions and 1853 deletions

View file

@ -1161,7 +1161,7 @@ const String String::replaceSection (int index, int numCharsToReplace, const Str
if (index < 0)
{
// a negative index to replace from?
jassertfalse
jassertfalse;
index = 0;
}
@ -1180,7 +1180,7 @@ const String String::replaceSection (int index, int numCharsToReplace, const Str
{
// replacing beyond the end of the string?
index = len;
jassertfalse
jassertfalse;
}
numCharsToReplace = len - index;

View file

@ -142,7 +142,7 @@ void StringArray::addArray (const StringArray& otherArray, int startIndex, int n
{
if (startIndex < 0)
{
jassertfalse
jassertfalse;
startIndex = 0;
}

View file

@ -71,7 +71,7 @@ XmlElement::XmlElement (int /*dummy*/) throw()
{
}
XmlElement::XmlElement (const XmlElement& other) throw()
XmlElement::XmlElement (const XmlElement& other)
: tagName (other.tagName),
firstChildElement (0),
nextElement (0),
@ -80,7 +80,7 @@ XmlElement::XmlElement (const XmlElement& other) throw()
copyChildrenAndAttributesFrom (other);
}
XmlElement& XmlElement::operator= (const XmlElement& other) throw()
XmlElement& XmlElement::operator= (const XmlElement& other)
{
if (this != &other)
{
@ -95,7 +95,7 @@ XmlElement& XmlElement::operator= (const XmlElement& other) throw()
return *this;
}
void XmlElement::copyChildrenAndAttributesFrom (const XmlElement& other) throw()
void XmlElement::copyChildrenAndAttributesFrom (const XmlElement& other)
{
XmlElement* child = other.firstChildElement;
XmlElement* lastChild = 0;
@ -1080,7 +1080,7 @@ bool XmlElement::isTextElement() const throw()
static const juce_wchar* const juce_xmltextContentAttributeName = L"text";
const String XmlElement::getText() const throw()
const String& XmlElement::getText() const throw()
{
jassert (isTextElement()); // you're trying to get the text from an element that
// isn't actually a text element.. If this contains text sub-nodes, you
@ -1089,19 +1089,15 @@ const String XmlElement::getText() const throw()
return getStringAttribute (juce_xmltextContentAttributeName);
}
void XmlElement::setText (const String& newText) throw()
void XmlElement::setText (const String& newText)
{
if (isTextElement())
{
setAttribute (juce_xmltextContentAttributeName, newText);
}
else
{
jassertfalse // you can only change the text in a text element, not a normal one.
}
jassertfalse; // you can only change the text in a text element, not a normal one.
}
const String XmlElement::getAllSubText() const throw()
const String XmlElement::getAllSubText() const
{
String result;
String::Concatenator concatenator (result);
@ -1119,7 +1115,7 @@ const String XmlElement::getAllSubText() const throw()
}
const String XmlElement::getChildElementAllSubText (const String& childTagName,
const String& defaultReturnValue) const throw()
const String& defaultReturnValue) const
{
const XmlElement* const child = getChildByName (childTagName);
@ -1129,14 +1125,14 @@ const String XmlElement::getChildElementAllSubText (const String& childTagName,
return defaultReturnValue;
}
XmlElement* XmlElement::createTextElement (const String& text) throw()
XmlElement* XmlElement::createTextElement (const String& text)
{
XmlElement* const e = new XmlElement ((int) 0);
e->setAttribute (juce_xmltextContentAttributeName, text);
return e;
}
void XmlElement::addTextElement (const String& text) throw()
void XmlElement::addTextElement (const String& text)
{
addChildElement (createTextElement (text));
}

View file

@ -148,10 +148,10 @@ public:
explicit XmlElement (const String& tagName) throw();
/** Creates a (deep) copy of another element. */
XmlElement (const XmlElement& other) throw();
XmlElement (const XmlElement& other);
/** Creates a (deep) copy of another element. */
XmlElement& operator= (const XmlElement& other) throw();
XmlElement& operator= (const XmlElement& other);
/** Deleting an XmlElement will also delete all its child elements. */
~XmlElement() throw();
@ -249,7 +249,7 @@ public:
@see hasTagName
*/
inline const String& getTagName() const throw() { return tagName; }
inline const String& getTagName() const throw() { return tagName; }
/** Tests whether this element has a particular tag name.
@ -451,7 +451,7 @@ public:
@see getNextElement, isTextElement, forEachXmlChildElement
*/
inline XmlElement* getNextElement() const throw() { return nextElement; }
inline XmlElement* getNextElement() const throw() { return nextElement; }
/** Returns the next of this element's siblings which has the specified tag
name.
@ -595,7 +595,7 @@ public:
*/
template <class ElementComparator>
void sortChildElements (ElementComparator& comparator,
const bool retainOrderOfEquivalentItems = false) throw()
bool retainOrderOfEquivalentItems = false)
{
const int num = getNumChildElements();
@ -631,14 +631,14 @@ public:
@see isTextElement, getAllSubText, getChildElementAllSubText
*/
const String getText() const throw();
const String& getText() const throw();
/** Sets the text in a text element.
Note that this is only a valid call if this element is a text element. If it's
not, then no action will be performed.
*/
void setText (const String& newText) throw();
void setText (const String& newText);
/** Returns all the text from this element's child nodes.
@ -650,7 +650,7 @@ public:
@see isTextElement, getChildElementAllSubText, getText, addTextElement
*/
const String getAllSubText() const throw();
const String getAllSubText() const;
/** Returns all the sub-text of a named child element.
@ -661,13 +661,13 @@ public:
@see getAllSubText
*/
const String getChildElementAllSubText (const String& childTagName,
const String& defaultReturnValue) const throw();
const String& defaultReturnValue) const;
/** Appends a section of text to this element.
@see isTextElement, getText, getAllSubText
*/
void addTextElement (const String& text) throw();
void addTextElement (const String& text);
/** Removes all the text elements from this element.
@ -677,7 +677,7 @@ public:
/** Creates a text element that can be added to a parent element.
*/
static XmlElement* createTextElement (const String& text) throw();
static XmlElement* createTextElement (const String& text);
//==============================================================================
@ -705,7 +705,7 @@ private:
XmlAttributeNode* attributes;
XmlElement (int) throw();
void copyChildrenAndAttributesFrom (const XmlElement& other) throw();
void copyChildrenAndAttributesFrom (const XmlElement& other);
void writeElementAsText (OutputStream& out, int indentationLevel, int lineWrapLength) const;
void getChildElementsAsArray (XmlElement**) const throw();
void reorderChildElements (XmlElement** const, const int) throw();