Type xlsxPageLayout = Class
	Function Create(sheetobj, file, xml); overload;
	Begin
		sheet_ := sheetobj;
		file_  := file;
		xmlFile_ := xml;
	End;

	Function SetPageLayout(sheet, pageLayout);
	Begin
		marshal := pageLayout.Marshal();
		work_node := xmlFile_.FirstChild('worksheet');
		node := work_node.FirstChild('pageSetup');
		if not ifObj(node) then
		begin
			prev_node := class(TSXml).GetWorkSheetPrevNode(work_node, 'pageSetup');
			node := work_node.InsertAfterChild(prev_node, marshal);
		end
		else begin
			class(TSXml).UpdateNode(node, marshal['attributes'], marshal['children']);
		end
	End;

	Function GetPageLayout();
	Begin
		node := xmlFile_.FirstChild('worksheet').FirstChild('pageSetup');
		page_layout := TOfficeObj('TPageLayout');
		page_layout.RootObj := node;
		return page_layout;
	End

	class Function NewObject(sheetname, file);
	Begin
		o := file.WorkBook().GetSheetObj(sheetname);
		xml := file.WorkBook().GetSheetXmlfile(sheetname);
		if not ifObj(o) then return 0;
		return new xlsxPageLayout(o, file, xml);
	End;

private
	file_; //TSExcelFile对象
	sheet_;//XmlSheet对象
	xmlFile_; //sheet对应的xml对象
End;
