[Libreoffice-commits] core.git: 2 commits - connectivity/source vcl/osx

Tor Lillqvist tml at collabora.com
Mon May 28 18:29:49 UTC 2018


 connectivity/source/drivers/firebird/PreparedStatement.cxx |    9 +++++-
 vcl/osx/vclnsapp.mm                                        |   18 -------------
 2 files changed, 8 insertions(+), 19 deletions(-)

New commits:
commit 2f7812a4fa1503bd8391cd8deb07d6606519e182
Author: Tor Lillqvist <tml at collabora.com>
Date:   Fri May 25 14:53:16 2018 +0300

    Bin ten year old temporary hack
    
    Cmd-W works just fine without any special handling at this low level,
    as far as I can see.
    
    Change-Id: Ib00964553984b7aeec89d9fab9fc425c08de910a
    Reviewed-on: https://gerrit.libreoffice.org/54917
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Tor Lillqvist <tml at collabora.com>

diff --git a/vcl/osx/vclnsapp.mm b/vcl/osx/vclnsapp.mm
index edf7549a0993..882ee3fb79a7 100644
--- a/vcl/osx/vclnsapp.mm
+++ b/vcl/osx/vclnsapp.mm
@@ -104,25 +104,7 @@ SAL_WNODEPRECATED_DECLARATIONS_PUSH
         if( pKeyWin && [pKeyWin isKindOfClass: [SalFrameWindow class]] )
         {
             AquaSalFrame* pFrame = [static_cast<SalFrameWindow*>(pKeyWin) getSalFrame];
-            // handle Cmd-W
-            // FIXME: the correct solution would be to handle this in framework
-            // in the menu code
-            // however that is currently being revised, so let's use a preliminary solution here
-            // this hack is based on assumption
-            // a) Cmd-W is the same in all languages in OOo's menu config
-            // b) Cmd-W is the same in all languages in on MacOS
-            // for now this seems to be true
             unsigned int nModMask = ([pEvent modifierFlags] & (NSShiftKeyMask|NSControlKeyMask|NSAlternateKeyMask|NSCommandKeyMask));
-            if( (pFrame->mnStyleMask & NSClosableWindowMask) != 0 )
-            {
-                if( nModMask == NSCommandKeyMask
-                    && [[pEvent charactersIgnoringModifiers] isEqualToString: @"w"] )
-                {
-                    [static_cast<SalFrameWindow*>(pFrame->getNSWindow()) windowShouldClose: nil];
-                    return;
-                }
-            }
-
             /*
              * #i98949# - Cmd-M miniaturize window, Cmd-Option-M miniaturize all windows
              */
commit 54ddc4ff4c2ff7e8b2c502d6b475cfdc9b8e3cec
Author: Julien Nabet <serval2412 at yahoo.fr>
Date:   Sat May 26 18:01:15 2018 +0200

    tdf#117446: FB mig, (VAR)BINARY, fix memory management
    
    By default, 8000 bytes are allocated for VARBINARY
    The pb is we can need more.
    See https://bugs.documentfoundation.org/show_bug.cgi?id=117446#c6
    
    Change-Id: I0ef5811dc01a587491bd9345129d1a41a4d9f095
    Reviewed-on: https://gerrit.libreoffice.org/54863
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Julien Nabet <serval2412 at yahoo.fr>

diff --git a/connectivity/source/drivers/firebird/PreparedStatement.cxx b/connectivity/source/drivers/firebird/PreparedStatement.cxx
index 0a43d5c93851..fee4029088f4 100644
--- a/connectivity/source/drivers/firebird/PreparedStatement.cxx
+++ b/connectivity/source/drivers/firebird/PreparedStatement.cxx
@@ -837,12 +837,19 @@ void SAL_CALL OPreparedStatement::setBytes(sal_Int32 nParameterIndex,
             setParameterNull(nParameterIndex, false);
             const sal_Int32 nMaxSize = 0xFFFF;
             Sequence<sal_Int8> xBytesCopy(xBytes);
-            // First 2 bytes indicate string size
             if (xBytesCopy.getLength() > nMaxSize)
             {
                 xBytesCopy.realloc( nMaxSize );
             }
             const short nSize = xBytesCopy.getLength();
+            // 8000 corresponds to value from lcl_addDefaultParameters
+            // in dbaccess/source/filter/hsqldb/createparser.cxx
+            if (nSize > 8000)
+            {
+                free(pVar->sqldata);
+                pVar->sqldata = static_cast<char *>(malloc(sizeof(char) * nSize + 2));
+            }
+            // First 2 bytes indicate string size
             memcpy(pVar->sqldata, &nSize, 2);
             // Actual data
             memcpy(pVar->sqldata + 2, xBytesCopy.getConstArray(), nSize);


More information about the Libreoffice-commits mailing list