Пример #1
0
int WPSList::Level::cmp(WPSList::Level const &levl) const
{
	int diff = cmpType(levl);
	if (diff) return diff;
	double fDiff = m_labelIndent-levl.m_labelIndent;
	if (fDiff < 0) return -1;
	if (fDiff > 0) return 1;
	fDiff = m_labelWidth-levl.m_labelWidth;
	if (fDiff < 0) return -1;
	if (fDiff > 0) return 1;
	diff = strcmp(m_bullet.cstr(),levl.m_bullet.cstr());
	if (diff) return diff;
	return 0;
}
Пример #2
0
// -----------------------------------------------------------------------------
// CCFContains::ParseL
// Construction with parsing from a DOM node.
// -----------------------------------------------------------------------------
//
CCFContains* CCFContains::ParseL( MCFOperationServices& aServices,
    CCFOperationNode* aParent,
    CMDXMLNode& aNode )
    {
    FUNC_LOG;

    if ( aNode.NodeName().CompareF( KScriptContainsName ) != 0 )
        {
        return NULL; // Cannot create contains operation from the given node.
        }

    TPtrC contextSource;
    TPtrC contextType;
    TCmpType cmpType( CCFContextOperation::EInvalidCmpType );
    TPtrC cmpValue;
    TInt contextLevelDelay( 0 );
    TBool argsOK = CFContextOperationUtils::ParseTwoComparisonArgs( aNode,
            contextSource,
            contextType,
            cmpType,
            cmpValue,
            contextLevelDelay );
    if ( cmpType != CCFContextOperation::EStringCmp )
        {
        argsOK = EFalse;
        }

    CCFContains* self = NULL;
    if ( argsOK )
        {
        self = NewL( aServices,
                aParent,
                contextType,
                contextSource,
                cmpValue );
        if ( contextLevelDelay )
            {
            self->iContextLevelDelay = contextLevelDelay;
            }
        }
    else
        {
        INFO( "CCFContains::ParseL - Unsupported arguments" );
        }

    CREATE_DOM_INFO( self, aNode );

    return self;
    }