From 427197e66fb2dba27dc848534ffde0ca2f33ab01 Mon Sep 17 00:00:00 2001 From: dfighter1985 Date: Mon, 13 Aug 2012 01:58:39 +0200 Subject: [PATCH] CHANGED: #1471 CGroupTable fields can now be serialized. --- code/nel/include/nel/gui/group_table.h | 1 + code/nel/src/gui/group_table.cpp | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/code/nel/include/nel/gui/group_table.h b/code/nel/include/nel/gui/group_table.h index cadc742bf..6c1533d87 100644 --- a/code/nel/include/nel/gui/group_table.h +++ b/code/nel/include/nel/gui/group_table.h @@ -150,6 +150,7 @@ namespace NLGUI std::string getProperties( const std::string &name ) const; void setProperty( const std::string &name, const std::string &value ); + xmlNodePtr serialize( xmlNodePtr parentNode, const char *type ) const; protected: diff --git a/code/nel/src/gui/group_table.cpp b/code/nel/src/gui/group_table.cpp index ca90c161f..38b8ba51f 100644 --- a/code/nel/src/gui/group_table.cpp +++ b/code/nel/src/gui/group_table.cpp @@ -1306,6 +1306,27 @@ namespace NLGUI CInterfaceGroup::setProperty( name, value ); } + + xmlNodePtr CGroupTable::serialize( xmlNodePtr parentNode, const char *type ) const + { + xmlNodePtr node = CInterfaceGroup::serialize( parentNode, type ); + if( node == NULL ) + return NULL; + + xmlSetProp( node, BAD_CAST "type", BAD_CAST "table" ); + xmlSetProp( node, BAD_CAST "border", BAD_CAST toString( Border ).c_str() ); + xmlSetProp( node, BAD_CAST "cellpadding", BAD_CAST toString( CellPadding ).c_str() ); + xmlSetProp( node, BAD_CAST "cellspacing", BAD_CAST toString( CellSpacing ).c_str() ); + xmlSetProp( node, BAD_CAST "bgcolor", BAD_CAST toString( BgColor ).c_str() ); + + if( ForceWidthMin != 0 ) + xmlSetProp( node, BAD_CAST "width", BAD_CAST toString( ForceWidthMin ).c_str() ); + else + xmlSetProp( node, BAD_CAST "width", BAD_CAST toString( TableRatio * 100.0f ).c_str() ); + + return node; + } + // ------------------------------------------------------------------------------------------------ bool CGroupTable::parse (xmlNodePtr cur, CInterfaceGroup * parentGroup) {