2025.6.1
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#include "HXmlElement.h"
|
||||
|
||||
#ifdef COMPUTE_RTF_STRING
|
||||
#include <A3DSDKIncludes.h>
|
||||
# include <A3DSDKIncludes.h>
|
||||
#endif
|
||||
|
||||
HXmlElement* HXmlElement::add_element( const char* pcText)
|
||||
@@ -10,6 +10,7 @@ HXmlElement* HXmlElement::add_element( const char* pcText)
|
||||
this->LinkEndChild( psElement);
|
||||
return psElement;
|
||||
}
|
||||
|
||||
HXmlElement* HXmlElement::add_element_with_id( const char* pcText, const char* pcTextId)
|
||||
{
|
||||
HXmlElement* psElement = new HXmlElement(pcText);
|
||||
@@ -17,50 +18,52 @@ HXmlElement* HXmlElement::add_element_with_id( const char* pcText, const char* p
|
||||
psElement->SetAttribute("id", pcTextId);
|
||||
return psElement;
|
||||
}
|
||||
|
||||
HXmlElement* HXmlElement::add_header( const char* pcText)
|
||||
{
|
||||
HXmlElement* psElementHeader = this->add_element("h2");
|
||||
psElementHeader->LinkEndChild( new TiXmlText(pcText));
|
||||
return psElementHeader;
|
||||
}
|
||||
|
||||
#ifdef COMPUTE_RTF_STRING
|
||||
void HXmlElement::add_value( const char* pcValue, bool bRTF)
|
||||
{
|
||||
if(bRTF == false)
|
||||
{
|
||||
this->LinkEndChild( new TiXmlText(pcValue));
|
||||
LinkEndChild( new TiXmlText(pcValue));
|
||||
}
|
||||
char acAttributValue[1024];
|
||||
//A3DVoid* pRTFData = NULL;
|
||||
A3DUTF8Char* pRTFString = (A3DUTF8Char*)pcValue;
|
||||
A3DMkpRTFField* pRTF = NULL;
|
||||
|
||||
if (A3DMkpRTFFieldCreate(pRTFString, &pRTF) == A3D_SUCCESS)
|
||||
A3DMkpRTFField* pRTF = NULL;
|
||||
|
||||
if (A3DMkpRTFFieldCreate(pRTFString, &pRTF) == A3D_SUCCESS)
|
||||
{
|
||||
A3DMkpRTFFieldData sRTFFieldData;
|
||||
A3DMkpRTFFieldData sRTFFieldData;
|
||||
A3D_INITIALIZE_DATA(A3DRTFFieldData, sRTFFieldData);
|
||||
|
||||
//add_element( "rtf - ");
|
||||
while (A3DMkpRTFFieldGet(pRTF, &sRTFFieldData) == A3D_SUCCESS)
|
||||
while (A3DMkpRTFFieldGet(pRTF, &sRTFFieldData) == A3D_SUCCESS)
|
||||
{
|
||||
if(sRTFFieldData.m_pcFamilyName)
|
||||
sprintf(acAttributValue, "font-family:%s;", sRTFFieldData.m_pcFamilyName);
|
||||
this->SetAttribute("style", acAttributValue);
|
||||
this->LinkEndChild(new TiXmlText(sRTFFieldData.m_pcText));
|
||||
SetAttribute("style", acAttributValue);
|
||||
LinkEndChild(new TiXmlText(sRTFFieldData.m_pcText));
|
||||
|
||||
A3DMkpRTFFieldGet(NULL, &sRTFFieldData);
|
||||
A3DMkpRTFFieldGet(NULL, &sRTFFieldData);
|
||||
}
|
||||
//add_element( " -");
|
||||
|
||||
A3DMkpRTFFieldDelete(pRTF);
|
||||
A3DMkpRTFFieldDelete(pRTF);
|
||||
}
|
||||
}
|
||||
#else
|
||||
#else // ifdef COMPUTE_RTF_STRING
|
||||
void HXmlElement::add_value( const char* pcValue, bool /*bRTF*/)
|
||||
{
|
||||
this->LinkEndChild( new TiXmlText(pcValue));
|
||||
}
|
||||
#endif
|
||||
#endif // ifdef COMPUTE_RTF_STRING
|
||||
|
||||
void HXmlElement::add_value(double dValue, int idecimal)
|
||||
{
|
||||
@@ -68,12 +71,14 @@ void HXmlElement::add_value(double dValue, int idecimal)
|
||||
snprintf(acValue,sizeof(acValue), "%.*f", idecimal, dValue);
|
||||
return add_value(acValue);
|
||||
}
|
||||
|
||||
void HXmlElement::add_value(int iValue)
|
||||
{
|
||||
char acValue[1024];
|
||||
snprintf(acValue, sizeof(acValue), " %d", iValue);
|
||||
return add_value(acValue);
|
||||
}
|
||||
|
||||
HXmlElement* HXmlElement::add_element_and_value( char* pcText, const char* pcValue, bool bRTF)
|
||||
{
|
||||
HXmlElement* psElement = new HXmlElement(pcText);
|
||||
@@ -104,9 +109,7 @@ HXmlElement* HXmlElement::add_element_and_value( char* pcText, double dValue, in
|
||||
return add_element_and_value( pcText, acValue);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void HXmlTableRow::add_cell( char* pcText, int span_count)
|
||||
void HXmlTableRow::add_cell( const char* pcText, int span_count)
|
||||
{
|
||||
TiXmlElement* psCell = add_element( "TD");
|
||||
psCell->LinkEndChild( new TiXmlText(pcText));
|
||||
@@ -123,8 +126,7 @@ void HXmlTableRow::add_cell( char* pcText, int span_count)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void HXmlTableRow::add_cell( char* pcText, int row_span, int col_span)
|
||||
void HXmlTableRow::add_cell( const char* pcText, int row_span, int col_span)
|
||||
{
|
||||
TiXmlElement* psCell = add_element( "TD");
|
||||
psCell->LinkEndChild( new TiXmlText(pcText));
|
||||
@@ -141,6 +143,7 @@ void HXmlTableRow::add_cell_double( double dValue, int span_count)
|
||||
snprintf(acValue, sizeof(acValue), "%f", dValue);
|
||||
add_cell( acValue, span_count);
|
||||
}
|
||||
|
||||
void HXmlTableRow::add_cell_int( int iValue, int span_count)
|
||||
{
|
||||
char acValue[1024];
|
||||
@@ -155,10 +158,7 @@ void HXmlTableRow::add_cell_double_formated( double dValue, int idecimal, int sp
|
||||
add_cell( acValue, span_count);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void HXmlTableRow::add_rtf_cell( char* /*pcText*/, int span_count)
|
||||
{
|
||||
add_cell( "rtf", span_count);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user