本文整理汇总了C++中CFX_WideString::Empty方法的典型用法代码示例。如果您正苦于以下问题:C++ CFX_WideString::Empty方法的具体用法?C++ CFX_WideString::Empty怎么用?C++ CFX_WideString::Empty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFX_WideString
的用法示例。
在下文中一共展示了CFX_WideString::Empty方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetFontInfo
FX_BOOL CXFA_FFConfigAcc::GetFontInfo(int32_t index,
CFX_WideString& wsFontFamily,
CFX_WideString& wsPsName,
FX_BOOL bBold,
FX_BOOL bItalic) {
if (index < 0 || index >= CountChildren()) {
return FALSE;
}
CXFA_Node* pFontNode = m_pPsMapNode->GetChild(index, XFA_ELEMENT_Font);
if (pFontNode == NULL) {
return FALSE;
}
wsFontFamily.Empty();
wsPsName.Empty();
bBold = FALSE;
bItalic = FALSE;
pFontNode->GetAttribute(XFA_ATTRIBUTE_Typeface, wsFontFamily);
pFontNode->GetAttribute(XFA_ATTRIBUTE_PsName, wsPsName);
CFX_WideString wsValue;
pFontNode->GetAttribute(XFA_ATTRIBUTE_Weight, wsValue);
wsValue.MakeLower();
if (wsValue == FX_WSTRC(L"bold")) {
bBold = TRUE;
}
pFontNode->GetAttribute(XFA_ATTRIBUTE_Posture, wsValue);
wsValue.MakeLower();
if (wsValue == FX_WSTRC(L"italic")) {
bItalic = TRUE;
}
return wsFontFamily.GetLength() > 0;
}
示例2: SetText
void CPWL_Edit::SetText(const FX_WCHAR* csText) {
CFX_WideString swText = csText;
if (HasFlag(PES_RICH)) {
CFX_ByteString sValue = CFX_ByteString::FromUnicode(swText);
if (CXML_Element* pXML =
CXML_Element::Parse(sValue.c_str(), sValue.GetLength())) {
int32_t nCount = pXML->CountChildren();
FX_BOOL bFirst = TRUE;
swText.Empty();
for (int32_t i = 0; i < nCount; i++) {
if (CXML_Element* pSubElement = pXML->GetElement(i)) {
CFX_ByteString tag = pSubElement->GetTagName();
if (tag.EqualNoCase("p")) {
int nChild = pSubElement->CountChildren();
CFX_WideString swSection;
for (int32_t j = 0; j < nChild; j++) {
swSection += pSubElement->GetContent(j);
}
if (bFirst)
bFirst = FALSE;
else
swText += FWL_VKEY_Return;
swText += swSection;
}
}
}
delete pXML;
}
}
m_pEdit->SetText(swText.c_str());
}
示例3:
int32_t XFA_FM2JS_Translate(const CFX_WideStringC& wsFormcalc,
CFX_WideTextBuf& wsJavascript,
CFX_WideString& wsError) {
if (wsFormcalc.IsEmpty()) {
wsJavascript.Clear();
wsError.Empty();
return 0;
}
int32_t status = 0;
CXFA_FMProgram program;
status = program.Init(wsFormcalc);
if (status) {
wsError = program.GetError().message;
return status;
}
status = program.ParseProgram();
if (status) {
wsError = program.GetError().message;
return status;
}
program.TranslateProgram(wsJavascript);
return 0;
}
示例4: XFA_GetNameExpression
void CXFA_NodeHelper::XFA_GetNameExpression(CXFA_Node* refNode,
CFX_WideString& wsName,
FX_BOOL bIsAllPath,
XFA_LOGIC_TYPE eLogicType) {
wsName.Empty();
if (bIsAllPath) {
XFA_GetNameExpression(refNode, wsName, FALSE, eLogicType);
CFX_WideString wsParent;
CXFA_Node* parent =
XFA_ResolveNodes_GetParent(refNode, XFA_LOGIC_NoTransparent);
while (parent != NULL) {
XFA_GetNameExpression(parent, wsParent, FALSE, eLogicType);
wsParent += L".";
wsParent += wsName;
wsName = wsParent;
parent = XFA_ResolveNodes_GetParent(parent, XFA_LOGIC_NoTransparent);
}
return;
} else {
CFX_WideStringC wsTagName;
CFX_WideString ws;
FX_BOOL bIsProperty = XFA_NodeIsProperty(refNode);
if (refNode->IsUnnamed() ||
(bIsProperty && refNode->GetClassID() != XFA_ELEMENT_PageSet)) {
refNode->GetClassName(wsTagName);
ws = wsTagName;
wsName.Format(L"#%s[%d]", (const FX_WCHAR*)ws,
XFA_GetIndex(refNode, eLogicType, bIsProperty, TRUE));
return;
}
ws = refNode->GetCData(XFA_ATTRIBUTE_Name);
ws.Replace(L".", L"\\.");
wsName.Format(L"%s[%d]", (const FX_WCHAR*)ws,
XFA_GetIndex(refNode, eLogicType, bIsProperty, FALSE));
}
}
示例5: NormalizeString
//.........这里部分代码省略.........
}
if(BidiChar->EndChar()) {
FX_INT32 ret = BidiChar->GetBidiInfo(start, count);
order.Add(start);
order.Add(count);
order.Add(ret);
if(!bR2L) {
if(ret == 2) {
nR2L++;
} else if(ret == 1) {
nL2R++;
}
}
}
if(nR2L > 0 && nR2L >= nL2R) {
bR2L = TRUE;
}
if(bR2L) {
int count = order.GetSize();
for(int j = count - 1; j > 0; j -= 3) {
int ret = order.GetAt(j);
int start = order.GetAt(j - 2);
int count1 = order.GetAt(j - 1);
if(ret == 2 || ret == 0) {
for(int i = start + count1 - 1; i >= start; i--) {
NormalizeCompositeChar(str[i], sBuffer);
}
} else {
i = j;
FX_BOOL bSymbol = FALSE;
while(i > 0 && order.GetAt(i) != 2) {
bSymbol = !order.GetAt(i);
i -= 3;
}
int end = start + count1 ;
int n = 0;
if(bSymbol) {
n = i + 6;
} else {
n = i + 3;
}
if(n >= j) {
for(int m = start; m < end; m++) {
sBuffer += str[m];
}
} else {
i = j;
j = n;
for(; n <= i; n += 3) {
int start = order.GetAt(n - 2);
int count1 = order.GetAt(n - 1);
int end = start + count1 ;
for(int m = start; m < end; m++) {
sBuffer += str[m];
}
}
}
}
}
} else {
int count = order.GetSize();
FX_BOOL bL2R = FALSE;
for(int j = 0; j < count; j += 3) {
int ret = order.GetAt(j + 2);
int start = order.GetAt(j);
int count1 = order.GetAt(j + 1);
if(ret == 2 || (j == 0 && ret == 0 && !bL2R)) {
int i = j + 3;
while(bR2L && i < count) {
if(order.GetAt(i + 2) == 1) {
break;
} else {
i += 3;
}
}
if(i == 3) {
j = -3;
bL2R = TRUE;
continue;
}
int end = str.GetLength() - 1;
if(i < count) {
end = order.GetAt(i) - 1;
}
j = i - 3;
for(int n = end; n >= start; n--) {
NormalizeCompositeChar(str[i], sBuffer);
}
} else {
int end = start + count1 ;
for(int i = start; i < end; i++) {
sBuffer += str[i];
}
}
}
}
str.Empty();
str += sBuffer;
BidiChar->Release();
}