Pavel Sanda <[EMAIL PROTECTED]> writes:

I am a nit-pick and I know it... 

| diff --git a/src/frontends/qt4/GuiToolbar.cpp 
b/src/frontends/qt4/GuiToolbar.cpp
| index 9b727be..b518c54 100644
| --- a/src/frontends/qt4/GuiToolbar.cpp
| +++ b/src/frontends/qt4/GuiToolbar.cpp
| @@ -271,6 +272,29 @@ void GuiLayoutBox::set(docstring const & layout)
|  }
|  
|  
| +void GuiLayoutBox::addItemSort(QString const & item, bool sorted)
| +{
| +     int end = count();

end can be const

| +     // Let the default one be at the beginning
| +     int i = 1;
| +     if (!sorted || end<2 || (item[0].category() != 
QChar::Letter_Uppercase)) {

spaces around '<'
the parens around the '!=' is not needed (does it make things clearer?
imho no)

| +             addItem(item);
| +             return;
| +     }

Move 'i' down. Closer to first use.

| +
| +     for (setCurrentIndex(i); currentText() < item; ) {

remove the space between ';' and ')'

| +             if (currentText()[0].category() != QChar::Letter_Uppercase)
| +                     // e.g. --Separator--
| +                     break;

And now we are in multi-line terrritory, so add braces. :-)

| +             if (++i == end)
| +                     break;
| +             setCurrentIndex(i);
| +     }
| +
| +     insertItem(i, item);
| +}
| +
| +

-- 
        Lgb

Reply via email to