tools/source/fsys/urlobj.cxx |   42 ++++++++++++++++++++++--------------------
 vcl/win/gdi/salfont.cxx      |    6 +++---
 2 files changed, 25 insertions(+), 23 deletions(-)

New commits:
commit 0600affd91ca799c75354a8c63d2b40373b08996
Author:     Noel Grandin <noelgran...@gmail.com>
AuthorDate: Mon Nov 22 18:01:36 2021 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Fri Nov 26 09:14:48 2021 +0100

    tdf#133835 speedup calc autofilter (10)
    
    Remove more temporary buffers in INetURLObject::setAbsURIRef
    
    Change-Id: I3c5430937e3365a15b396504226d3bbdd39c4cc1
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125668
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/tools/source/fsys/urlobj.cxx b/tools/source/fsys/urlobj.cxx
index 7e29adc7d1c7..8c3d2845eab2 100644
--- a/tools/source/fsys/urlobj.cxx
+++ b/tools/source/fsys/urlobj.cxx
@@ -1419,18 +1419,17 @@ bool INetURLObject::setAbsURIRef(OUString const & 
rTheAbsURIRef,
     }
 
     // Parse <path>
-    OUStringBuffer aSynPath(256);
+    sal_Int32 nBeforePathLength = m_aAbsURIRef.getLength();
     if (!parsePath(m_eScheme, &pPos, pEnd, eMechanism, eCharset,
                    bSkippedInitialSlash, nSegmentDelimiter,
                    nAltSegmentDelimiter,
                    getSchemeInfo().m_bQuery ? '?' : 0x80000000,
-                   nFragmentDelimiter, aSynPath))
+                   nFragmentDelimiter, m_aAbsURIRef))
     {
         setInvalid();
         return false;
     }
-    m_aPath.set(m_aAbsURIRef, aSynPath.makeStringAndClear(),
-        m_aAbsURIRef.getLength());
+    m_aPath = SubString(nBeforePathLength, m_aAbsURIRef.getLength() - 
nBeforePathLength);
 
     // Parse ?<query>
     if (getSchemeInfo().m_bQuery && pPos < pEnd && *pPos == '?')
@@ -2951,7 +2950,7 @@ bool INetURLObject::parsePath(INetProtocol eScheme,
     DBG_ASSERT(pBegin, "INetURLObject::parsePath(): Null output param");
 
     sal_Unicode const * pPos = *pBegin;
-
+    const sal_Int32 nSynPathBeforeLen = rSynPath.getLength();
     switch (eScheme)
     {
         case INetProtocol::NotValid:
@@ -2959,7 +2958,7 @@ bool INetURLObject::parsePath(INetProtocol eScheme,
 
         case INetProtocol::Ftp:
             if (pPos < pEnd && *pPos != '/' && *pPos != nFragmentDelimiter)
-                return false;
+                goto failed;
             while (pPos < pEnd && *pPos != nFragmentDelimiter)
             {
                 EscapeType eEscapeType;
@@ -2968,7 +2967,7 @@ bool INetURLObject::parsePath(INetProtocol eScheme,
                 appendUCS4(rSynPath, nUTF32, eEscapeType,
                            PART_HTTP_PATH, eCharset, true);
             }
-            if (rSynPath.isEmpty())
+            if (rSynPath.getLength() - nSynPathBeforeLen == 0)
                 rSynPath.append('/');
             break;
 
@@ -2978,7 +2977,7 @@ bool INetURLObject::parsePath(INetProtocol eScheme,
         case INetProtocol::Smb:
         case INetProtocol::Cmis:
             if (pPos < pEnd && *pPos != '/' && *pPos != nFragmentDelimiter)
-                return false;
+                goto failed;
             while (pPos < pEnd && *pPos != nQueryDelimiter
                    && *pPos != nFragmentDelimiter)
             {
@@ -2988,7 +2987,7 @@ bool INetURLObject::parsePath(INetProtocol eScheme,
                 appendUCS4(rSynPath, nUTF32, eEscapeType,
                            PART_HTTP_PATH, eCharset, true);
             }
-            if (rSynPath.isEmpty())
+            if (rSynPath.getLength() - nSynPathBeforeLen == 0)
                 rSynPath.append('/');
             break;
 
@@ -2999,7 +2998,7 @@ bool INetURLObject::parsePath(INetProtocol eScheme,
             else if (pPos < pEnd
                      && *pPos != nSegmentDelimiter
                      && *pPos != nAltSegmentDelimiter)
-                return false;
+                goto failed;
             while (pPos < pEnd && *pPos != nFragmentDelimiter)
             {
                 EscapeType eEscapeType;
@@ -3018,8 +3017,8 @@ bool INetURLObject::parsePath(INetProtocol eScheme,
                                  || *pPos == nFragmentDelimiter
                                  || *pPos == nSegmentDelimiter
                                  || *pPos == nAltSegmentDelimiter)
-                             && rSynPath.getLength() == 2
-                             && rtl::isAsciiAlpha(rSynPath[1]))
+                             && rSynPath.getLength() - nSynPathBeforeLen == 2
+                             && rtl::isAsciiAlpha(rSynPath[nSynPathBeforeLen + 
1]))
                     {
                         // A first segment of <ALPHA "|"> is translated to
                         // <ALPHA ":">:
@@ -3030,7 +3029,7 @@ bool INetURLObject::parsePath(INetProtocol eScheme,
                 appendUCS4(rSynPath, nUTF32, eEscapeType,
                            PART_PCHAR, eCharset, true);
             }
-            if (rSynPath.isEmpty())
+            if (rSynPath.getLength() - nSynPathBeforeLen == 0)
                 rSynPath.append('/');
             break;
         }
@@ -3074,7 +3073,7 @@ bool INetURLObject::parsePath(INetProtocol eScheme,
             else
             {
                 if (*pPos != '/')
-                    return false;
+                    goto failed;
                 while (pPos < pEnd && *pPos != nQueryDelimiter
                        && *pPos != nFragmentDelimiter)
                 {
@@ -3106,7 +3105,7 @@ bool INetURLObject::parsePath(INetProtocol eScheme,
         case INetProtocol::VndSunStarPkg:
             if (pPos < pEnd && *pPos != '/'
                 && *pPos != nQueryDelimiter && *pPos != nFragmentDelimiter)
-                return false;
+                goto failed;
             while (pPos < pEnd && *pPos != nQueryDelimiter
                    && *pPos != nFragmentDelimiter)
             {
@@ -3119,7 +3118,7 @@ bool INetURLObject::parsePath(INetProtocol eScheme,
                     appendUCS4(rSynPath, nUTF32, eEscapeType,
                                PART_PCHAR, eCharset, false);
             }
-            if (rSynPath.isEmpty())
+            if (rSynPath.getLength() - nSynPathBeforeLen == 0)
                 rSynPath.append('/');
             break;
 
@@ -3127,7 +3126,7 @@ bool INetURLObject::parsePath(INetProtocol eScheme,
         case INetProtocol::VndSunStarExpand:
         {
             if (pPos == pEnd || *pPos == nFragmentDelimiter)
-                return false;
+                goto failed;
             Part ePart = PART_URIC_NO_SLASH;
             while (pPos != pEnd && *pPos != nFragmentDelimiter)
             {
@@ -3145,7 +3144,7 @@ bool INetURLObject::parsePath(INetProtocol eScheme,
             if (pPos < pEnd)
             {
                 if (*pPos != '/' || pEnd - pPos > 1)
-                    return false;
+                    goto failed;
                 ++pPos;
             }
             rSynPath.append('/');
@@ -3153,7 +3152,7 @@ bool INetURLObject::parsePath(INetProtocol eScheme,
 
         case INetProtocol::VndSunStarTdoc:
             if (pPos == pEnd || *pPos != '/')
-                return false;
+                goto failed;
             while (pPos < pEnd && *pPos != nFragmentDelimiter)
             {
                 EscapeType eEscapeType;
@@ -3178,7 +3177,7 @@ bool INetURLObject::parsePath(INetProtocol eScheme,
                            PART_URIC, eCharset, true);
             }
             if (rSynPath.isEmpty())
-                return false;
+                goto failed;
             break;
         default:
             OSL_ASSERT(false);
@@ -3187,6 +3186,9 @@ bool INetURLObject::parsePath(INetProtocol eScheme,
 
     *pBegin = pPos;
     return true;
+failed:
+    rSynPath.setLength(nSynPathBeforeLen);
+    return false;
 }
 
 bool INetURLObject::setPath(OUString const & rThePath,
commit c1d0b2ec10ee10127409a6e085b26fdc86d426ad
Author:     Stephan Bergmann <sberg...@redhat.com>
AuthorDate: Fri Nov 26 08:18:37 2021 +0100
Commit:     Stephan Bergmann <sberg...@redhat.com>
CommitDate: Fri Nov 26 09:14:34 2021 +0100

    -Werror,-Wreorder-ctor
    
    Change-Id: Ie0a1036f57bc1449dda324b99fd83170969958a5
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125856
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sberg...@redhat.com>

diff --git a/vcl/win/gdi/salfont.cxx b/vcl/win/gdi/salfont.cxx
index 7e3197807d10..7682def12661 100644
--- a/vcl/win/gdi/salfont.cxx
+++ b/vcl/win/gdi/salfont.cxx
@@ -1474,10 +1474,10 @@ class ScopedFontHDC final
 {
 public:
     explicit ScopedFontHDC(WinSalGraphics& rGraphics, const 
vcl::font::PhysicalFontFace& rFontFace)
-        : m_hDC(nullptr)
-        , m_hOrigFont(nullptr)
         // use height=1000 for easier debugging (to match psprint's font units)
-        , m_aFSP(rFontFace, Size(0,1000), 1000.0, 0, false)
+        : m_aFSP(rFontFace, Size(0,1000), 1000.0, 0, false)
+        , m_hDC(nullptr)
+        , m_hOrigFont(nullptr)
     {
         m_hDC = CreateCompatibleDC(rGraphics.getHDC());
         if (!m_hDC)

Reply via email to