JRStyle originalStyle = stylesMap.getStyle(name);
if (originalStyle != null)
{
//found a previous external style with the same name
//renaming the previous style
JRBaseStyle style = (JRBaseStyle) get(originalStyle);
String newName;
int suf = 1;
do
{
newName = name + suf;
++suf;
}
while(stylesMap.containsStyle(newName));
style.rename(newName);
stylesMap.renamed(name, newName);
}
}