1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

TextLayout bugfix. Removed some unused functions.

This commit is contained in:
jules 2012-07-27 17:48:48 +01:00
parent 9afac59a60
commit 15c35b8ad8
3 changed files with 81 additions and 134 deletions

View file

@ -95,61 +95,6 @@ namespace ComponentBuilderHelpers
}
}
}
static void updateComponentColours (Component& component, const ValueTree& colourState)
{
NamedValueSet& properties = component.getProperties();
for (int i = properties.size(); --i >= 0;)
{
const Identifier name (properties.getName (i));
if (name.toString().startsWith ("jcclr_"))
{
const String colourName (name.toString().substring (6));
if (colourState [colourName].isVoid())
component.removeColour (colourName.getHexValue32());
}
}
for (int i = 0; i < colourState.getNumProperties(); ++i)
{
const Identifier colourName (colourState.getPropertyName (i));
const String colour (colourState [colourName].toString());
if (colour.isNotEmpty())
component.setColour (colourName.toString().getHexValue32(), Colour::fromString (colour));
}
}
template <class ComponentClass>
class StandardTypeHandler : public ComponentBuilder::TypeHandler
{
public:
StandardTypeHandler() : ComponentBuilder::TypeHandler (ComponentClass::Ids::tagType)
{}
Component* addNewComponentFromState (const ValueTree& state, Component* parent)
{
ComponentClass* const c = new ComponentClass();
if (parent != nullptr)
parent->addAndMakeVisible (c);
updateComponentFromState (c, state);
return c;
}
void updateComponentFromState (Component* component, const ValueTree& state)
{
ComponentClass* const c = dynamic_cast <ComponentClass*> (component);
jassert (c != nullptr);
c->setComponentID (state [ComponentBuilder::idProperty]);
c->refreshFromValueTree (state, *this->getBuilder());
}
};
}
//=============================================================================
@ -342,9 +287,3 @@ void ComponentBuilder::updateChildComponents (Component& parent, const ValueTree
componentsInOrder.getUnchecked(i)->toBehind (componentsInOrder.getUnchecked (i + 1));
}
}
static void updateMarkers (MarkerList* const list, const ValueTree& state)
{
if (list != nullptr)
MarkerList::ValueTreeWrapper (state).applyTo (*list);
}