本文整理汇总了C++中FL_DocLayout::getStringFromFootnoteVal方法的典型用法代码示例。如果您正苦于以下问题:C++ FL_DocLayout::getStringFromFootnoteVal方法的具体用法?C++ FL_DocLayout::getStringFromFootnoteVal怎么用?C++ FL_DocLayout::getStringFromFootnoteVal使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FL_DocLayout
的用法示例。
在下文中一共展示了FL_DocLayout::getStringFromFootnoteVal方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: calculateValue
bool fp_FieldTOCNumRun::calculateValue(void)
{
UT_UCSChar sz_ucs_FieldValue[FPFIELD_MAX_LENGTH + 1];
//
// First Find page number.
//
PL_StruxDocHandle sdh = getBlock()->getStruxDocHandle();
PD_Document * pDoc = getBlock()->getDocument();
PT_DocPosition pos = pDoc->getStruxPosition(sdh)+1;
FL_DocLayout * pLayout = getBlock()->getDocLayout();
fl_BlockLayout * pBlockInDoc = pLayout->findBlockAtPosition(pos);
if(pBlockInDoc == NULL)
{
sz_ucs_FieldValue[0] = static_cast<UT_UCSChar>(' ');
sz_ucs_FieldValue[1] = 0;
return _setValue(sz_ucs_FieldValue);
}
fp_Line * pLine = static_cast<fp_Line *>(pBlockInDoc->getFirstContainer());
if(pLine == NULL)
{
sz_ucs_FieldValue[0] = static_cast<UT_UCSChar>(' ');
sz_ucs_FieldValue[1] = 0;
return _setValue(sz_ucs_FieldValue);
}
fp_Page * pPage = pLine->getPage();
UT_sint32 iPage = pLayout->findPage(pPage);
if( iPage < 0)
{
sz_ucs_FieldValue[0] = static_cast<UT_UCSChar>(' ');
sz_ucs_FieldValue[1] = 0;
return _setValue(sz_ucs_FieldValue);
}
iPage++; // Start from Page 1.
UT_String sVal("");
FootnoteType iType = getBlock()->getTOCNumType();
pLayout->getStringFromFootnoteVal(sVal,iPage,iType);
const char * psz = sVal.c_str();
bool bStop = false;
UT_sint32 i = 0;
sz_ucs_FieldValue[0] = static_cast<UT_UCSChar>(' ');
for(i=1; (i<FPFIELD_MAX_LENGTH) && !bStop; i++)
{
sz_ucs_FieldValue[i] = static_cast<UT_UCSChar>(*psz);
if(*psz == 0)
{
bStop = true;
}
else
{
psz++;
}
}
return _setValue(sz_ucs_FieldValue);
}
示例2: calculateValue
bool fp_FieldTOCNumRun::calculateValue(void)
{
UT_UCSChar sz_ucs_FieldValue[FPFIELD_MAX_LENGTH + 1];
//
// First Find page number.
//
pf_Frag_Strux* sdh = getBlock()->getStruxDocHandle();
PD_Document * pDoc = getBlock()->getDocument();
PT_DocPosition pos = pDoc->getStruxPosition(sdh)+1;
FL_DocLayout * pLayout = getBlock()->getDocLayout();
fl_BlockLayout * pBlockInDoc = pLayout->findBlockAtPosition(pos);
if(pBlockInDoc == NULL)
{
sz_ucs_FieldValue[0] = static_cast<UT_UCSChar>(' ');
sz_ucs_FieldValue[1] = 0;
return _setValue(sz_ucs_FieldValue);
}
fp_Line * pLine = static_cast<fp_Line *>(pBlockInDoc->getFirstContainer());
UT_sint32 kk = 0;
bool b_goodLine = false;
while (pLine && !b_goodLine)
{
for (kk = 0; kk < pLine->getNumRunsInLine(); kk++)
{
if(pLine->getRunFromIndex(kk)->getType() == FPRUN_TEXT)
{
b_goodLine = true;
break;
}
}
if (!b_goodLine)
{
pLine = static_cast<fp_Line *>(pLine->getNext());
}
}
if(pLine == NULL)
{
sz_ucs_FieldValue[0] = static_cast<UT_UCSChar>(' ');
sz_ucs_FieldValue[1] = 0;
return _setValue(sz_ucs_FieldValue);
}
fp_Page * pPage = pLine->getPage();
UT_sint32 iPage = pPage->getFieldPageNumber();
bool b_hasSetFieldPageNumber = false;
if(iPage < 0)
{
pPage->resetFieldPageNumber();
iPage = pPage->getFieldPageNumber();
b_hasSetFieldPageNumber = true;
if (iPage < 0)
{
sz_ucs_FieldValue[0] = static_cast<UT_UCSChar>(' ');
sz_ucs_FieldValue[1] = 0;
return _setValue(sz_ucs_FieldValue);
}
}
UT_String sVal("");
FootnoteType iType = getBlock()->getTOCNumType();
pLayout->getStringFromFootnoteVal(sVal,iPage,iType);
const char * psz = sVal.c_str();
if (b_hasSetFieldPageNumber)
{
// We need to set the field page number value to -1 so that we
// recalculate the page number next time we enter this function
pPage->setFieldPageNumber(-1);
}
bool bStop = false;
UT_sint32 i = 0;
sz_ucs_FieldValue[0] = static_cast<UT_UCSChar>(' ');
for(i=1; (i<FPFIELD_MAX_LENGTH) && !bStop; i++)
{
sz_ucs_FieldValue[i] = static_cast<UT_UCSChar>(*psz);
if(*psz == 0)
{
bStop = true;
}
else
{
psz++;
}
}
return _setValue(sz_ucs_FieldValue);
}