Subversion Repositories tpanel

Rev

Rev 449 | Rev 474 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 449 Rev 456
Line 729... Line 729...
729
    string part, oldPart;
729
    string part, oldPart;
730
 
730
 
731
    if (str.empty())
731
    if (str.empty())
732
        return lines;
732
        return lines;
733
 
733
 
734
    words = StrSplit(str, " \n");
734
    words = StrSplit(str, " ");
735
    MSG_DEBUG("Found " << words.size() << " words.");
735
    MSG_DEBUG("Found " << words.size() << " words.");
736
    vector<string>::iterator iter;
736
    vector<string>::iterator iter;
737
 
737
 
738
    if (words.size() == 0)
738
    if (words.size() == 0)
739
        return lines;
739
        return lines;
Line 747... Line 747...
747
 
747
 
748
        for (iter = words.begin(); iter != words.end(); ++iter)
748
        for (iter = words.begin(); iter != words.end(); ++iter)
749
        {
749
        {
750
            size_t pos = 0;
750
            size_t pos = 0;
751
 
751
 
752
            if ((pos = iter->find("|")) != string::npos && pos > 0)
752
            if (((pos = iter->find("|")) != string::npos || (pos = iter->find("\n")) != string::npos) && pos > 0)
753
            {
753
            {
754
                string left = iter->substr(0, pos);
754
                string left = iter->substr(0, pos);
755
                string right = iter->substr(pos);
755
                string right = iter->substr(pos);
756
                *iter = left;
756
                *iter = left;
757
                ++iter;
757
                ++iter;
Line 772... Line 772...
772
    for (iter = words.begin(); iter != words.end(); ++iter)
772
    for (iter = words.begin(); iter != words.end(); ++iter)
773
    {
773
    {
774
        size_t pos;
774
        size_t pos;
775
        bool lineBreak = false;
775
        bool lineBreak = false;
776
 
776
 
777
        if ((pos = iter->find("|")) != string::npos)
777
        if ((pos = iter->find("|")) != string::npos || (pos = iter->find("\n")) != string::npos)
778
        {
778
        {
779
            *iter = iter->substr(1);
779
            *iter = iter->substr(1);
780
            lineBreak = true;
780
            lineBreak = true;
781
        }
781
        }
782
 
782
 
Line 806... Line 806...
806
                    if (rect.width() > (width - 8))
806
                    if (rect.width() > (width - 8))
807
                    {
807
                    {
808
                        lines.push_back(sample.substr(0, sample.length() - 1)); // Cut off the last character because it is already out of bounds.
808
                        lines.push_back(sample.substr(0, sample.length() - 1)); // Cut off the last character because it is already out of bounds.
809
                        start = i;                                              // Set the new start of the string
809
                        start = i;                                              // Set the new start of the string
810
                        i--;                                                    // We must repeat the last character
810
                        i--;                                                    // We must repeat the last character
811
                        p = 0;                                                // Reset the pition counter
811
                        p = 0;                                                  // Reset the position counter
812
                        sample = sample.substr(sample.length() - 1);            // Put the last character into the part.
812
                        sample = sample.substr(sample.length() - 1);            // Put the last character into the part.
813
 
813
 
814
                        if (lines.size() >= (size_t)maxLines)                   // Break if we've reached the maximum of lines
814
                        if (lines.size() >= (size_t)maxLines)                   // Break if we've reached the maximum of lines
815
                            return lines;
815
                            return lines;
816
                    }
816
                    }