protected void switchColorAndBackground()

in src/main/java/com/atlassian/uwc/converters/sharepoint/ColorConverter.java [106:139]


	protected void switchColorAndBackground(Element root) {
		String last = "";
		List content = root.content();
		for (int i = 0; i < content.size(); i++) {
			Node node = (Node) content.get(i);
			if (!(node instanceof Text)) continue;
			if ("".equals(node.getText().trim()) && 
					i > 0 &&
					content.get(i-1) instanceof Text) {
				Text textnode = (Text) content.get(i-1);
				textnode.setText(textnode.getText() + node.getText());
				content.remove(i);
				i--;
				continue;
			}
			else if (last != null && 
					last.trim().startsWith("{color:") &&
					node.getText().trim().startsWith("{panel:bgColor")) {
				switchNodes(content, i);
			}
			else if (last != null && 
					last.trim().equals("{panel}") && 
					node.getText().trim().equals("{color}")) {
				switchNodes(content, i);
			}
			last = ((Text) node).getText();
		}
		for (int i = 0; i < content.size(); i++) {
			Node node = (Node) content.get(i);
			if (node instanceof Element)
				switchColorAndBackground((Element) node);
		}
		
	}