Hey all, 2010/12/8 Koen Deforche <[email protected]>
> Hey Magnus, > > 2010/12/3 Magnus Arntzen <[email protected]>: > > Actually, this alone gives fatal errors: > > > > WRegExp rx("Hello(World"); //by purpose give an unmatched unescaped > > parenthesis > > > > Before I can check validity with rx.isValid(), the session is destroyed. > > [error] Error during event handling: Unmatched ( or \( > > [fatal] Unmatched ( or \( > > > > Suggestions? Is this a bug, or do I need to test the user input before > > passed to WSortFilterProxyModel->setFilterRegExp() ? > > I've fixed WRegExp so that passing it an invalid regular expession > makes isValid() return false but does not throw an exception. > I don't think that invalid regular expression should be considered as invalid invariant. In fact WRegExp::WRegExp explicitly sets valid_ to false. So it is a valid state of WRegExp instance itself with invalid regular expression which can became valid after another call of WRegExp::setPattern. Exceptions should be thrown only in case of error. Therefore, there is no need to throw. > Regards, > koen > > > ------------------------------------------------------------------------------ > This SF Dev2Dev email is sponsored by: > > WikiLeaks The End of the Free Internet > http://p.sf.net/sfu/therealnews-com > _______________________________________________ > witty-interest mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/witty-interest > -- // Dmitriy.
------------------------------------------------------------------------------ Oracle to DB2 Conversion Guide: Learn learn about native support for PL/SQL, new data types, scalar functions, improved concurrency, built-in packages, OCI, SQL*Plus, data movement tools, best practices and more. http://p.sf.net/sfu/oracle-sfdev2dev
_______________________________________________ witty-interest mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/witty-interest
