[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - 2 commits - embedserv/source extensions/source extensions/test sw/source

Michael Stahl mstahl at redhat.com
Tue Jun 7 07:24:00 UTC 2016


 embedserv/source/embed/docholder.cxx              |    2 +-
 extensions/source/ole/oleobjw.cxx                 |    2 +-
 extensions/source/ole/servprov.cxx                |   10 +++++-----
 extensions/source/ole/unoconversionutilities.hxx  |    6 ++++--
 extensions/test/ole/OleClient/funcs.cxx           |    2 +-
 extensions/test/ole/OleConverterVar1/convTest.cxx |    2 +-
 sw/source/uibase/utlui/unotools.cxx               |   13 ++++++-------
 7 files changed, 19 insertions(+), 18 deletions(-)

New commits:
commit 06235b5e79de9da786423ba3496b73d978a4e6c5
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed Jun 1 15:48:47 2016 +0200

    tdf#99827 sw: don't create AutoText dialog's preview doc ReadOnly
    
    Since commit 5334ff287c65f028753171c7b38da7ffbcebc1cc the framework
    refuses to create new documents as ReadOnly, so don't do that.
    
    (cherry picked from commit 6a8407d82d71083c8bdec6a106ba9092a5196cbe)
    
    Change-Id: I9d94ca9859baaf5407bad88a2b4b5b2e26b99b94
    Reviewed-on: https://gerrit.libreoffice.org/25986
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>

diff --git a/sw/source/uibase/utlui/unotools.cxx b/sw/source/uibase/utlui/unotools.cxx
index da7512c..9a3be2a 100644
--- a/sw/source/uibase/utlui/unotools.cxx
+++ b/sw/source/uibase/utlui/unotools.cxx
@@ -137,14 +137,13 @@ void SwOneExampleFrame::CreateControl()
             sTempURL = sArgumentURL;
         aURL <<= sTempURL;
 
-        uno::Sequence<beans::PropertyValue> aSeq(3);
+        uno::Sequence<beans::PropertyValue> aSeq(2);
         beans::PropertyValue* pValues = aSeq.getArray();
-        pValues[0].Name = "ReadOnly";
-        pValues[0].Value <<= true;
-        pValues[1].Name = "OpenFlags";
-        pValues[1].Value <<= OUString("-RB");
-        pValues[2].Name = "Referer";
-        pValues[2].Value <<= OUString("private:user");
+
+        pValues[0].Name = "OpenFlags";
+        pValues[0].Value <<= OUString("-RB");
+        pValues[1].Name = "Referer";
+        pValues[1].Value <<= OUString("private:user");
         uno::Any aArgs;
         aArgs.setValue(&aSeq, cppu::UnoType<uno::Sequence<beans::PropertyValue>>::get());
 
commit 46960352458bde1ec9e1f2307a674de9fc3bb08d
Author: Michael Stahl <mstahl at redhat.com>
Date:   Tue May 31 23:45:53 2016 +0200

    tdf#99643 OLE automation bridge: fix 64-bit pointer conversions
    
    XBridgeSupplier2::createBridge() is always called in-process and should
    therefore expect and create Anys with native-sized encoded pointers,
    so use sal_uIntPtr.
    
    Change-Id: Ia757ff38568b07de8085a1a9d323d806bcca0f63
    Note: Currently all calls in LO code are with source=UNO, target=OLE.
    (cherry picked from commit c11e60f11f34b12bf73a08a96634202a8d3aef0c)
    Reviewed-on: https://gerrit.libreoffice.org/25985
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>

diff --git a/embedserv/source/embed/docholder.cxx b/embedserv/source/embed/docholder.cxx
index 5568535..7708e1e 100644
--- a/embedserv/source/embed/docholder.cxx
+++ b/embedserv/source/embed/docholder.cxx
@@ -1035,7 +1035,7 @@ IDispatch* DocumentHolder::GetIDispatch()
                     bridge::ModelDependent::OLE );
 
                 if ( anyResult.getValueTypeClass() ==
-                     cppu::UnoType<sal_uInt32>::get().getTypeClass() )
+                     cppu::UnoType<sal_uIntPtr>::get().getTypeClass() )
                 {
                     VARIANT* pVariant = *(VARIANT**)anyResult.getValue();
                     if ( pVariant->vt == VT_DISPATCH )
diff --git a/extensions/source/ole/oleobjw.cxx b/extensions/source/ole/oleobjw.cxx
index b2fde4a..2a2b7eb 100644
--- a/extensions/source/ole/oleobjw.cxx
+++ b/extensions/source/ole/oleobjw.cxx
@@ -725,7 +725,7 @@ Any SAL_CALL IUnknownWrapper_Impl::createBridge( const Any& modelDepObject,
                 pVariant->punkVal->AddRef();
             }
 
-            ret.setValue((void*)&pVariant, cppu::UnoType<sal_uInt32>::get());
+            ret.setValue(static_cast<void*>(&pVariant), cppu::UnoType<sal_uIntPtr>::get());
         }
     }
 
diff --git a/extensions/source/ole/servprov.cxx b/extensions/source/ole/servprov.cxx
index 6d3d5fa..95b3bad 100644
--- a/extensions/source/ole/servprov.cxx
+++ b/extensions/source/ole/servprov.cxx
@@ -160,7 +160,7 @@ STDMETHODIMP ProviderOleWrapper_Impl::CreateInstance(IUnknown FAR* punkOuter,
                                         OLE);
 
 
-            if (oleAny.getValueTypeClass() == cppu::UnoType<sal_uInt32>::get().getTypeClass())
+            if (oleAny.getValueTypeClass() == cppu::UnoType<sal_uIntPtr>::get().getTypeClass())
             {
                 VARIANT* pVariant = *(VARIANT**)oleAny.getValue();
 
@@ -291,7 +291,7 @@ STDMETHODIMP OneInstanceOleWrapper_Impl::CreateInstance(IUnknown FAR* punkOuter,
                                         OLE);
 
 
-        if (oleAny.getValueTypeClass() == TypeClass_UNSIGNED_LONG)
+        if (oleAny.getValueTypeClass() == cppu::UnoType<sal_uIntPtr>::get().getTypeClass())
         {
             VARIANT* pVariant = *(VARIANT**)oleAny.getValue();
 
@@ -374,14 +374,14 @@ Any SAL_CALL OleConverter_Impl2::createBridge(const Any& modelDepObject,
                     CoTaskMemFree(pVariant);
                     throw IllegalArgumentException();
                 }
-                ret.setValue((void*) &pVariant, cppu::UnoType<sal_uInt32>::get());
+                ret.setValue(static_cast<void*>(&pVariant), cppu::UnoType<sal_uIntPtr>::get());
             }
             else
                 throw IllegalArgumentException();
         }
         else if (sourceModelType == OLE)
         {
-            if (modelDepObject.getValueType() != cppu::UnoType<sal_uInt32>::get())
+            if (modelDepObject.getValueType() != cppu::UnoType<sal_uIntPtr>::get())
             {
                 throw IllegalArgumentException();
             }
@@ -397,7 +397,7 @@ Any SAL_CALL OleConverter_Impl2::createBridge(const Any& modelDepObject,
                 }
                 else
                 {
-                    ret.setValue((void*) &pVariant, cppu::UnoType<sal_uInt32>::get());
+                    ret.setValue(static_cast<void*>(&pVariant), cppu::UnoType<sal_uIntPtr>::get());
                 }
             }
             else if (destModelType == UNO)
diff --git a/extensions/source/ole/unoconversionutilities.hxx b/extensions/source/ole/unoconversionutilities.hxx
index bdf61db..e1459b8 100644
--- a/extensions/source/ole/unoconversionutilities.hxx
+++ b/extensions/source/ole/unoconversionutilities.hxx
@@ -244,8 +244,10 @@ bool convertSelfToCom( T& unoInterface, VARIANT * pVar)
             Sequence<sal_Int8> seqId( arId, 16);
             Any anySource;
             anySource <<= xInt;
-            Any anyDisp=    xSupplier->createBridge( anySource, seqId, UNO, OLE);
-            if( anyDisp.getValueTypeClass() == TypeClass_UNSIGNED_LONG)
+            Any anyDisp = xSupplier->createBridge(anySource, seqId, UNO, OLE);
+
+            // due to global-process-id check this must be in-process pointer
+            if (anyDisp.getValueTypeClass() == cppu::UnoType<sal_uIntPtr>::get().getTypeClass())
             {
                 VARIANT* pvariant= *(VARIANT**)anyDisp.getValue();
                 HRESULT hr;
diff --git a/extensions/test/ole/OleClient/funcs.cxx b/extensions/test/ole/OleClient/funcs.cxx
index a67cdbb..8070b08 100644
--- a/extensions/test/ole/OleClient/funcs.cxx
+++ b/extensions/test/ole/OleClient/funcs.cxx
@@ -92,7 +92,7 @@ Reference<XInvocation> convertComObject( IUnknown* pUnk)
 
     Any any;
     CComVariant var( pUnk);
-    any <<= ( sal_uInt32)&var;
+    any <<= (sal_uIntPtr) &var;
     sal_uInt8 arId[16];
     rtl_getGlobalProcessId( arId);
     Any target= xSuppl->createBridge( any, Sequence<sal_Int8>( (sal_Int8*)arId, 16), OLE, UNO );
diff --git a/extensions/test/ole/OleConverterVar1/convTest.cxx b/extensions/test/ole/OleConverterVar1/convTest.cxx
index 112f8de..1c7538c 100644
--- a/extensions/test/ole/OleConverterVar1/convTest.cxx
+++ b/extensions/test/ole/OleConverterVar1/convTest.cxx
@@ -129,7 +129,7 @@ HRESULT doTest()
     rtl_getGlobalProcessId( arId);
     Any target= xSuppl->createBridge( any, Sequence<sal_Int8>( (sal_Int8*)arId, 16), UNO, OLE);
     CComDispatchDriver oletest;
-    if (target.getValueTypeClass() == cppu::UnoType<sal_uInt32>::get().getTypeClass())
+    if (target.getValueTypeClass() == cppu::UnoType<sal_uIntPtr>::get().getTypeClass())
     {
         VARIANT* pVariant = *(VARIANT**)target.getValue();
 


More information about the Libreoffice-commits mailing list