Beispiel #1
0
bool WEXPORT MFamily::hasSwitches( bool setable )
{
    int icount = _switches.count();
    for( int i=0; i<icount; i++ ) {
        MSwitch* sw = (MSwitch*)_switches[i];
        if( !setable || sw->isSetable() ) {
            return( true );
        }
    }
    return( false );
}
Beispiel #2
0
bool WEXPORT MFamily::hasSwitches( bool setable )
{
    int icount = _switches.count();
    for( int i=0; i<icount; i++ ) {
        MSwitch* sw = (MSwitch*)_switches[i];
        if( !setable || ( sw->text().size() > 0 && sw->text()[0] != ' ' ) ) {
            return TRUE;
        }
    }
    return FALSE;
}
Beispiel #3
0
MSwitch* WEXPORT MFamily::findSwitch( WString& switchtag )
{
    int icount = _switches.count();
    for( int i=0; i<icount; i++ ) {
        MSwitch* sw = (MSwitch*)_switches[i];
        WString tag;
        sw->getTag( tag );
        if( tag == switchtag ) {
            return sw;
        }
        sw->getCompatibleTag( tag );
        if( !stricmp( tag, switchtag ) ) {
            return sw;
        }
    }
    return NULL;
}
Beispiel #4
0
void MFamily::addSwitches( WVList& list, const char* mask, bool setable )
{
    MSwitch* lastSw = NULL;
    int icount = _switches.count();
    for( int i=0; i<icount; i++ ) {
        MSwitch* sw = (MSwitch*)_switches[i];
        bool hasText = sw->hasText();
        if( !setable || hasText ) {
            if( !lastSw || !hasText || lastSw->text() != sw->text() ) {
                if( sw->addSwitch( list, mask ) ) {
                    lastSw = sw;
                }
            }
        }
    }
}
Beispiel #5
0
MSwitch* WEXPORT MFamily::findSwitch( MTool *tool, WString& switchtag, long fixed_version )
{
    //
    // Open Watcom IDE configuration/project files are buggy
    // There are many switch ID's which were changed by incompatible way
    // IDE uses various hacks to fix it later instead of proper solution
    // It is very hard to detect what was broken in each OW version because
    // there vere no change to version number of project files
    //
#if CUR_CFG_VERSION < 5
    tool = tool;
#endif
    int icount = _switches.count();
    bool isSetable = ( switchtag.size() > MASK_SIZE && switchtag[MASK_SIZE] != ' ' );
    if( fixed_version == 0 || !isSetable ) {
        for( int i = 0; i < icount; i++ ) {
            MSwitch* sw = (MSwitch*)_switches[i];
            if( sw->isTagEqual( switchtag ) ) {
                return( sw );
            }
        }
    } else {
        for( int i = 0; i < icount; i++ ) {
            MSwitch* sw = (MSwitch*)_switches[i];
            if( !sw->isSetable() )
                continue;
#if CUR_CFG_VERSION > 4
            // upgrade switchtag to current configuration files version
            if( _config->version() > 4 || fixed_version < 41 ) {
                // check for old text
                if( sw->isTagEqual( tool, switchtag, 1 ) ) {
                    sw->getTag( switchtag );
                    return( sw );
                }
                // check for current text
                if( sw->isTagEqual( tool, switchtag ) ) {
                    sw->getTag( switchtag );
                    return( sw );
                }
                continue;
            }
#endif
            if( sw->isTagEqual( switchtag ) ) {
                return( sw );
            }
            //
            // hack for buggy version of configuration/project files
            //
            if( _config->version() == 4 || fixed_version == 40 ) {
                if( sw->isTagEqual( switchtag, 1 ) ) {
                    // upgrade switchtag to current configuration files version
                    sw->getTag( switchtag );
                    return( sw );
                }
            }
        }
    }
    return( NULL );
}