本文整理汇总了C++中CLayout::SetXProposed方法的典型用法代码示例。如果您正苦于以下问题:C++ CLayout::SetXProposed方法的具体用法?C++ CLayout::SetXProposed怎么用?C++ CLayout::SetXProposed使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CLayout
的用法示例。
在下文中一共展示了CLayout::SetXProposed方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Fmt
//.........这里部分代码省略.........
if(!pLS->_fMinMaxPass)
{
pdobj->_dvMinMaxDelta = 0;
objdim.dur = xWidth;
}
else
{
pdobj->_dvMinMaxDelta = xWidth - xMinWidth;
objdim.dur = xMinWidth;
}
if(pCF->HasCharGrid(TRUE))
{
long lCharGridSize = pLS->GetCharGridSize();
pdobj->_dvMinMaxDelta = pLS->GetClosestGridMultiple(lCharGridSize, pdobj->_dvMinMaxDelta);
objdim.dur = pLS->GetClosestGridMultiple(lCharGridSize, objdim.dur);
}
if(fOwnLine)
{
// If we are inside a something like say a PRE then too we do
// not terminate, because if there was a \r right after the ownline site
// then we will allow that \r to break the line. We do not check if the
// subsequent char is a \r because there might be goop(comments, hidden
// stuff etc etc) between this site and the \r. Hence here we just march
// forward and if we run into text or layout later on we will terminate
// the line then. This way we will eat up the goop if any in between.
if(!pLS->_fScanForCR)
{
COneRun* porOut;
COneRun* por = pLS->_listFree.GetFreeOneRun(plsrun);
if(!por)
{
lserr = lserrOutOfMemory;
goto Cleanup;
}
Assert(plsrun->IsNormalRun());
Assert(plsrun->_lscch == plsrun->_lscchOriginal);
por->_lscpBase += plsrun->_lscch;
// If this object has to be on its own line, then it clearly
// ends the current line.
lserr = pLS->TerminateLine(por, CLineServices::TL_ADDEOS, &porOut);
if(lserr != lserrNone)
{
goto Cleanup;
}
// Free the one run
pLS->_listFree.SpliceIn(por);
}
else
{
// Flip this bit so that we will setup pfmtres properly later on
fOwnLine = FALSE;
}
// If we have an 'ownline' site, by definition this is a breaking
// site, meaning we can (or more precisely should) break on either
// side of the site.
pdobj->_fIsBreakingSite = TRUE;
// NOTE(SujalP): Bug 65906.
// We originally used to set ourselves up to collect after space only
// for morphed elements. As it turns out, we want to collect after space
// from margins of _all_ ownline sites (including morphed elements),
// because margins for ownline-sites are not accounted for in
// VerticalAlignObjects (see CLayout::GetMarginInfo for more details --
// it returns 0 for ownline sites).
pLS->_pNodeForAfterSpace = pNodeLayout;
// All ownline sites have their x position to be 0
if(pElementLayout->HasFlag(TAGDESC_OWNLINE))
{
pLayout->SetXProposed(0);
}
}
if(fOwnLine)
{
*pfmtres = fmtrCompletedRun;
}
else
{
const long urWrappingWidth = max(pfmtin->lsfgi.urColumnMax, pLS->_xWrappingWidth);
*pfmtres = (pfmtin->lsfgi.fFirstOnLine ||
pfmtin->lsfgi.urPen+objdim.dur<=urWrappingWidth)?fmtrCompletedRun:fmtrExceededMargin;
}
// This is an accessor to the dnode, telling LS to set the dnode pointing
// to our dobj.
lserr = LsdnFinishRegular(pLS->_plsc, cchSite, pfmtin->lsfrun.plsrun,
pfmtin->lsfrun.plschp, (struct dobj*)pdobj, &objdim);
Cleanup:
return lserr;
}