[Libreoffice-commits] core.git: svtools/source

Mike Kaganski (via logerrit) logerrit at kemper.freedesktop.org
Mon Nov 16 09:00:46 UTC 2020


 svtools/source/dialogs/insdlg.cxx |   21 +++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)

New commits:
commit 600dfc9d39883b4150b7d773a5a2de483a4c94b6
Author:     Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Mon Nov 16 10:28:40 2020 +0300
Commit:     Mike Kaganski <mike.kaganski at collabora.com>
CommitDate: Mon Nov 16 10:00:02 2020 +0100

    tdf#138229: make OleObjectDescriptor match OBJECTDESCRIPTOR on _WIN64
    
    ... broken since tools::Long is 64-bit on that platform, and thus
    Point and Size are not equal to POINTL and SIZEL.
    
    Change-Id: I8cf53f778ece89415687c6966d8e079fb0cf6189
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105910
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>
    Tested-by: Jenkins

diff --git a/svtools/source/dialogs/insdlg.cxx b/svtools/source/dialogs/insdlg.cxx
index 4c0701406ed8..4698d4f186c8 100644
--- a/svtools/source/dialogs/insdlg.cxx
+++ b/svtools/source/dialogs/insdlg.cxx
@@ -34,6 +34,14 @@
 
 using namespace ::com::sun::star;
 
+#if defined _WIN32
+#include <prewin.h>
+#include <oleidl.h>
+#include <postwin.h>
+#else
+typedef Size SIZEL;
+typedef Point POINTL;
+#endif
 
 // this struct conforms to the Microsoft
 // OBJECTDESCRIPTOR -> see oleidl.h
@@ -46,13 +54,22 @@ struct OleObjectDescriptor
     sal_uInt32  cbSize;
     ClsId       clsid;
     sal_uInt32  dwDrawAspect;
-    Size        sizel;
-    Point       pointl;
+    SIZEL       sizel;
+    POINTL      pointl;
     sal_uInt32  dwStatus;
     sal_uInt32  dwFullUserTypeName;
     sal_uInt32  dwSrcOfCopy;
 };
 
+#if defined _WIN32
+static_assert(sizeof(OleObjectDescriptor) == sizeof(OBJECTDESCRIPTOR));
+// check the two fields that we use here
+static_assert(offsetof(OleObjectDescriptor, dwFullUserTypeName)
+              == offsetof(OBJECTDESCRIPTOR, dwFullUserTypeName));
+static_assert(offsetof(OleObjectDescriptor, dwSrcOfCopy)
+              == offsetof(OBJECTDESCRIPTOR, dwSrcOfCopy));
+#endif
+
 }
 
 /********************** SvObjectServerList ********************************


More information about the Libreoffice-commits mailing list