tdf#131951: automatically increase buffer size

This will reduce number of string concatenations
and therefore reading time of large data chunks.

Change-Id: I6d59ba60270511edf03a604aef06dab0a1de2478
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92456
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92647
Tested-by: Jenkins
diff --git a/svtools/source/svhtml/parhtml.cxx b/svtools/source/svhtml/parhtml.cxx
index 6ce2365..3f50197e 100644
--- a/svtools/source/svhtml/parhtml.cxx
+++ b/svtools/source/svhtml/parhtml.cxx
@@ -593,11 +593,6 @@
                    // Space is protected because it's not a delimiter between
                    // options.
                    sTmpBuffer.append( '\\' );
                    if( MAX_LEN == sTmpBuffer.getLength() )
                    {
                        aToken += sTmpBuffer;
                        sTmpBuffer.setLength(0);
                    }
                }
                if( IsParserWorking() )
                {
@@ -634,11 +629,6 @@
            {
                // mark within tags
                sTmpBuffer.append( '\\' );
                if( MAX_LEN == sTmpBuffer.getLength() )
                {
                    aToken += sTmpBuffer;
                    sTmpBuffer.setLength(0);
                }
            }
            sTmpBuffer.append( '\\' );
            break;
@@ -761,11 +751,7 @@
                    // All remaining characters make their way into the text.
                        sTmpBuffer.appendUtf32( nNextCh );
                    }
                    if( MAX_LEN == sTmpBuffer.getLength() )
                    {
                        aToken += sTmpBuffer;
                        sTmpBuffer.setLength(0);
                    }

                    if( ( sal_Unicode(EOF) == (nNextCh = GetNextChar()) &&
                          rInput.eof() ) ||
                        !IsParserWorking() )
@@ -779,12 +765,6 @@
            }
        }

        if( MAX_LEN == sTmpBuffer.getLength() )
        {
            aToken += sTmpBuffer;
            sTmpBuffer.setLength(0);
        }

        if( bContinue && bNextCh )
            nNextCh = GetNextChar();
    }