package org.zkoss.zss.model.impl.html;

import org.zkoss.poi.ss.usermodel.ClientAnchor;

public class LayoutUnitConversionHelper {
	
	
    //TODO: must follow the formula of spec
    public static int convertWidthToPixel(int columnWidth) {
		return columnWidth/34;
	}
    
	// TODO Auto-generated method stub
	public static int convertHeightToPixel(int height) {
		return height/20;
	}

//	public static int getChartWidth(XSheet sheet, ClientAnchor anchor) {
//		short startCol = anchor.getCol1();
//		short endCol = anchor.getCol2();
//		
//		int totalWidth = 0;
//		for(int i = startCol ; i <= endCol ; i++){
//			totalWidth += sheet.getColumnWidth(i);
//		}
//		return convertWidthToPixel(totalWidth);
//	}
//
//	public static int getChartHeight(XSheet sheet, ClientAnchor anchor) {
//		int startRow = anchor.getRow1();
//		int endRow = anchor.getRow2();
//		int totalHeight = 0 ;
//		for(int i = startRow; i<= endRow ; i++){
//			totalHeight += sheet.getRow(i).getHeight();
//		}
//		return convertHeightToPixel(totalHeight);
//	}

}
