本文整理汇总了C++中CNode::GetPrev方法的典型用法代码示例。如果您正苦于以下问题:C++ CNode::GetPrev方法的具体用法?C++ CNode::GetPrev怎么用?C++ CNode::GetPrev使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CNode
的用法示例。
在下文中一共展示了CNode::GetPrev方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RemoveChild
CNode* CParentNode::RemoveChild( long no )
{
CNode *pNode = GetChild( no );
if( pNode )
{
if( pNode->GetPrev() )
pNode->GetPrev()->SetNext( pNode->GetNext() );
if( pNode->GetNext() )
pNode->GetNext()->SetPrev( pNode->GetPrev() );
pNode->SetNext( NULL );
pNode->SetPrev( NULL );
pNode->SetParent( NULL );
m_children.remove( no );
}
return pNode;
}
示例2: InsertFromFrame
int InsertFromFrame( CFrameNode *pFrameNode, SelectNode &sn, int fUpCalc, SelectInfo *psi )
{
if( pFrameNode == NULL ) return -1;
if( pFrameNode->GetChildCount() == 1 )
{
Q_ASSERT( pFrameNode->GetFirstChild()->GetType() == NODE_LINE );
return ::InsertFromLine( (CLineNode*) pFrameNode->GetChild( 0 ), sn, fUpCalc, psi );
}
else
{
Q_ASSERT( pFrameNode->GetChildCount() > 0 );
BreakLine( sn, 0 );
CNode *pPrev = sn.GetNode()->GetPrev();
CNode *pNext = sn.GetNode();
Q_ASSERT( pPrev );
Q_ASSERT( pNext );
CParentNode *pParentNode = sn.GetNode()->GetParent();
int fRecalculateFull = (pFrameNode->GetLevel() != pParentNode->GetLevel());
QVector<CNode*> children;
pFrameNode->RecalculateSizeFull();
pFrameNode->RemoveOrCopyChildren( children );
if( psi )
{
psi->GetBegin().SetNode( children[ 0 ] );
psi->GetBegin().SetPosition( 0 );
psi->GetEnd() = sn;
}
pParentNode->InsertChildren( children,
pParentNode->GetChildIndex( sn.GetNode() ) );
if( pNext->GetPrev() == pPrev )
{
Q_ASSERT( 0 );
}
else
{
if( GlueLine( sn, pNext->GetPrev(), 0, NULL ) == 0 )
if( psi )
psi->GetEnd() = sn;
if( GlueLine( sn, pPrev, 0, NULL ) == 0 )
if( psi )
psi->GetBegin() = sn;
}
if( fRecalculateFull )
pParentNode->RecalculateSizeFull();
else
pParentNode->RecalculateSize( 0 );
if( pParentNode->GetParent() )
pParentNode->GetParent()->RecalculateSize( fUpCalc );
return 0;
}
}