package org.eclipse.birt.report.engine.css.dom;

import org.eclipse.birt.report.engine.content.IStyle;
import org.w3c.dom.css.CSSValue;

/**
 * FixedStyle is a fixed image of styles. It simply holds all the style references.<br>
 * It avoids the cache and cascade computing facility provided by the ComputedStyle, which leads to unwanted behavior.<br>
 * The main drawback of this class is the memory consumption, since no cache is used. Use it with caution.
 */
public class FixedStyle extends AbstractStyle
{
	
	private CSSValue[] values = new CSSValue[NUMBER_OF_STYLE];

	public FixedStyle( AbstractStyle style )
	{
		super( style.engine );
		mergeStyle( style );
	}

	/**
	 * Merge style with current styles. New styles always overwrite the old ones, except the null values.
	 * @param style
	 */
	public void mergeStyle( IStyle style )
	{
		for(int i = 0; i < NUMBER_OF_STYLE; i++) 
		{
			CSSValue value = style.getProperty(i);
			if(value != null)
			{
				values[i] = style.getProperty( i );				
			}
		}
	}

	/**
	 * One should never change the value returned, may cause obscure bugs.
	 */
	@Override
	public CSSValue getProperty( int index )
	{
		return values[index];
	}

	@Override
	public void setProperty( int index, CSSValue value ) 
	{
		values[index] = value;
	}

	@Override
	public boolean isEmpty( ) 
	{
		for( CSSValue value : values )
		{
			if( value != null )
				return false;
		}
		return true;
	}

}

@@ -1132,28 +1132,16 @@
 %0D%0A%09 */%0D%0A
-%09@Override%0D%0A
 %09public 
@@ -1171,24 +1171,24 @@
 nt index )%0D%0A
+
 %09%7B%0D%0A%09%09return
@@ -1206,36 +1206,24 @@
 ex%5D;%0D%0A%09%7D%0D%0A%0D%0A
-%09@Override%0D%0A
 %09public void
@@ -1306,20 +1306,8 @@
 %0D%0A%0D%0A
-%09@Override%0D%0A
 %09pub

Fix one total cell format will affect the other total cells when export to excel and enable pivot table. (T 50403) Remove @Override annotations.