Type xlsxAppProperty = Class
	Function Create(file); overload;
	Begin
		file_ := file;
	End;

	Function SetAppProps(appProps);
	Begin
		app_xml := file_.WorkBook().GetXmlFileObj('docProps/app.xml');
		node := app_xml.FirstChildElement('Properties');
		if not ifObj(node) then return array(1, "node::Properties can't be found");
		children_arr := appProps.Marshal()['children'];
		for i:=0 to length(children_arr)-1 do
		Begin
			if children_arr[i]['name'] in array('ScaleCrop', 'LinksUpToDate', 'SharedDoc', 'HyperlinksChanged') then
			Begin
				children_arr[i]['children'][0]['value'] := children_arr[i]['children'][0]['value'] ? "true" : "false";
			End
			delete_node := node.FirstChildElement(children_arr[i]['name']);
			node.InsertAfterChild(delete_node, children_arr[i]);
			node.DeleteChild(delete_node);
		End
		return array(0, '');
	End;

	Function GetAppProps();
	Begin
		app_xml := file_.WorkBook().GetXmlFileObj('docProps/app.xml');
		node := app_xml.FirstChildElement('Properties');
		marshal := node.Marshal()[0]['children'];
		reindex(marshal, marshal[:,'name']);
		app_props := TOfficeObj('TAppProperty');
		app_props.Application := marshal['Application']['children'][0]['value'];
		app_props.DocSecurity := marshal['DocSecurity']['children'][0]['value'];
		app_props.ScaleCrop := marshal['DocSecurity']['children'][0]['value'] = "false" ? 0 : 1;
		app_props.Company := marshal['Company']['children'][0]['value'];
		app_props.LinksUpToDate := marshal['LinksUpToDate']['children'][0]['value'] = "false" ? 0 : 1;
		app_props.SharedDoc := marshal['SharedDoc']['children'][0]['value'] = "false" ? 0 : 1;
		app_props.AppVersion := marshal['AppVersion']['children'][0]['value'];
		return array(0, app_props);
	End

	class Function NewObject(file);
	Begin
		return new xlsxAppProperty(file);
	End;

private
	file_; //TSExcelFile对象
End;
