Ignore:
Timestamp:
Aug 2, 2000, 5:02:49 AM (25 years ago)
Author:
bird
Message:

Changed transformation of text to HTML. Only paragraphs.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/database/StateUpd.cpp

    r3917 r3919  
    1 /* $Id: StateUpd.cpp,v 1.28 2000-08-02 02:18:03 bird Exp $
     1/* $Id: StateUpd.cpp,v 1.29 2000-08-02 03:02:49 bird Exp $
    22 *
    33 * StateUpd - Scans source files for API functions and imports data on them.
     
    17501750             * Copy loop.
    17511751             */
     1752            int  cBlanks = 0;
    17521753            do
    17531754            {
    17541755                int i;
     1756
     1757                /*
     1758                 * new paragraph?.
     1759                 */
     1760                if (cBlanks == 1)
     1761                {
     1762                    strcpy(pszTarget, "<p>\n");
     1763                    pszTarget += 4;
     1764                }
     1765
     1766                /*
     1767                 * indent...?
     1768                 */
    17551769                for (i = psz - papszLines[iStart]; i < iStartColumn; i++)
    17561770                    *pszTarget++ = ' '; /* FIXME HTML and indenting... */
     
    17581772                strcpy(pszTarget, psz);
    17591773                trimR(pszTarget);
     1774                if (*pszTarget == '\0')
     1775                    cBlanks++;
     1776                else
     1777                    cBlanks = 0;
    17601778                pszTarget += strlen(pszTarget);
    1761                 if (fHTML)
    1762                     strcpy(pszTarget, "<BR>\n");
    1763                 else
    1764                     strcpy(pszTarget, "\n");
    1765                 pszTarget += strlen(pszTarget);
     1779                *pszTarget++ = '\n';
     1780                *pszTarget = '\0';
    17661781
    17671782                /* Next */
     
    17841799            {
    17851800                pszTarget--;
    1786                 while (pszTarget >= pszRet && (*pszTarget == '\n' || *pszTarget == ' '))
     1801                while ((pszTarget >= pszRet && (*pszTarget == '\n' || *pszTarget == ' '))
     1802                       || (pszTarget - 3 >= pszRet && strnicmp(pszTarget - 3, "<p>", 3) == 0)
     1803                       || (pszTarget - 4 >= pszRet && strnicmp(pszTarget - 4, "<br>",4) == 0)
     1804                       )
    17871805                {
    1788                     if (*pszTarget == '\n')
    1789                         pszTarget -= 4;
     1806                    if (*pszTarget != '\n' && *pszTarget != ' ')
     1807                        pszTarget -= pszTarget[3] == '<' ? 3 : 4;
    17901808                    *pszTarget-- = '\0';
    17911809                }
     
    18531871         * copy loop
    18541872         */
     1873        int cBlanks = 0;
    18551874        do
    18561875        {
     
    18671886
    18681887            /*
     1888             * new paragraph?.
     1889             */
     1890            if (cBlanks == 1)
     1891            {
     1892                strcpy(pszTarget, "<p>\n");
     1893                pszTarget += 4;
     1894            }
     1895
     1896            /*
    18691897             * Indent up to iStartColumn
    18701898             */
     
    18771905            strcpy(pszTarget, psz);
    18781906            trimR(pszTarget);
     1907            if (*pszTarget == '\0')
     1908                cBlanks++;
     1909            else
     1910                cBlanks = 0;
    18791911            pszTarget += strlen(pszTarget);
    1880             if (fHTML)
    1881                 strcpy(pszTarget, "<BR>\n");
    1882             else
    1883                 strcpy(pszTarget, "\n");
    1884             pszTarget += strlen(pszTarget);
     1912            *pszTarget++ = '\n';
     1913            *pszTarget = '\0';
    18851914
    18861915            /*
     
    19091938        {
    19101939            pszTarget--;
    1911             while (pszTarget >= pszRet && (*pszTarget == '\n' || *pszTarget == ' '))
    1912             {
    1913                 if (*pszTarget == '\n')
    1914                     pszTarget -= 4;
     1940            while ((pszTarget >= pszRet && (*pszTarget == '\n' || *pszTarget == ' '))
     1941                   || (pszTarget - 3 >= pszRet && strnicmp(pszTarget - 3, "<p>", 3) == 0)
     1942                   || (pszTarget - 4 >= pszRet && strnicmp(pszTarget - 4, "<br>",4) == 0)
     1943                   )
     1944            {
     1945                if (*pszTarget != '\n' && *pszTarget != ' ')
     1946                    pszTarget -= pszTarget[3] == '<' ? 3 : 4;
    19151947                *pszTarget-- = '\0';
    19161948            }
Note: See TracChangeset for help on using the changeset viewer.