[Libreoffice-commits] core.git: include/svl svl/source

Stephan Bergmann sbergman at redhat.com
Fri Oct 7 11:55:32 UTC 2016


 include/svl/svdde.hxx       |   18 +++++++++++++-----
 svl/source/svdde/ddecli.cxx |    5 -----
 svl/source/svdde/ddeimp.hxx |    2 --
 svl/source/svdde/ddesvr.cxx |   28 ++++++++--------------------
 4 files changed, 21 insertions(+), 32 deletions(-)

New commits:
commit 7e68c64c1ed2cd14ccb4cf259831089c1aeb43b2
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Oct 7 13:51:50 2016 +0200

    Make _WIN32-only DDE code use proper HCONV
    
    ...instead of various integer types.  Revealed that the GetConvId functions were
    unused.
    
    Change-Id: I6c6427bd8c14166e58bed3405084e3919bdc97f9

diff --git a/include/svl/svdde.hxx b/include/svl/svdde.hxx
index fca3dfd..97301f4 100644
--- a/include/svl/svdde.hxx
+++ b/include/svl/svdde.hxx
@@ -20,12 +20,18 @@
 #ifndef INCLUDED_SVL_SVDDE_HXX
 #define INCLUDED_SVL_SVDDE_HXX
 
+#include <sal/config.h>
+
 #include <svl/svldllapi.h>
 #include <sot/exchange.hxx>
 #include <tools/solar.h>
 #include <tools/link.hxx>
 #include <vector>
 
+#if defined _WIN32
+#include <ddeml.h>
+#endif
+
 class DdeString;
 class DdeData;
 class DdeConnection;
@@ -182,7 +188,6 @@ public:
                     ~DdeConnection();
 
     long            GetError();
-    sal_IntPtr      GetConvId();
 
     static const std::vector<DdeConnection*>& GetConnections();
 
@@ -205,8 +210,10 @@ class SVL_DLLPUBLIC DdeItem
     DdeTopic*       pMyTopic;
     DdeItemImp*     pImpData;
 
-    void            IncMonitor( sal_uLong );
-    void            DecMonitor( sal_uLong );
+#if defined _WIN32
+    void            IncMonitor( HCONV );
+    void            DecMonitor( HCONV );
+#endif
 
 protected:
     sal_uInt8            nType;
@@ -238,7 +245,9 @@ public:
 
 class SVL_DLLPUBLIC DdeTopic
 {
-    SVL_DLLPRIVATE void Disconnect( sal_IntPtr );
+#if defined _WIN32
+    SVL_DLLPRIVATE void Disconnect( HCONV );
+#endif
 
 public:
     virtual DdeData* Get(SotClipboardFormatId);
@@ -265,7 +274,6 @@ public:
     virtual        ~DdeTopic();
 
     const OUString  GetName() const;
-    long            GetConvId();
 
     void            NotifyClient( const OUString& );
     bool            IsSystemTopic();
diff --git a/svl/source/svdde/ddecli.cxx b/svl/source/svdde/ddecli.cxx
index b6e5626..d81d57c 100644
--- a/svl/source/svdde/ddecli.cxx
+++ b/svl/source/svdde/ddecli.cxx
@@ -236,11 +236,6 @@ const OUString DdeConnection::GetTopicName()
     return pTopic->toOUString();
 }
 
-sal_IntPtr DdeConnection::GetConvId()
-{
-    return (sal_IntPtr)pImp->hConv;
-}
-
 const std::vector<DdeConnection*>& DdeConnection::GetConnections()
 {
     DdeInstData* pInst = ImpGetInstData();
diff --git a/svl/source/svdde/ddeimp.hxx b/svl/source/svdde/ddeimp.hxx
index 9584817..492f1dc 100644
--- a/svl/source/svdde/ddeimp.hxx
+++ b/svl/source/svdde/ddeimp.hxx
@@ -87,7 +87,6 @@ public:
     sal_uInt16          nRefCount;
     std::vector<DdeConnection*> aConnections;
     // Server
-    sal_IntPtr      hCurConvSvr;
     DWORD           hDdeInstSvr;
     short           nInstanceSvr;
     DdeServices*    pServicesSvr;
@@ -97,7 +96,6 @@ public:
 
     DdeInstData()
         : nRefCount(0)
-        , hCurConvSvr(0)
         , hDdeInstSvr(0)
         , nInstanceSvr(0)
         , pServicesSvr(NULL)
diff --git a/svl/source/svdde/ddesvr.cxx b/svl/source/svdde/ddesvr.cxx
index ea549b4..3607036 100644
--- a/svl/source/svdde/ddesvr.cxx
+++ b/svl/source/svdde/ddesvr.cxx
@@ -36,10 +36,10 @@ enum DdeItemType
 
 struct DdeItemImpData
 {
-    sal_uLong nHCnv;
+    HCONV nHCnv;
     sal_uInt16 nCnt;
 
-    explicit DdeItemImpData( sal_uLong nH ) : nHCnv( nH ), nCnt( 1 ) {}
+    explicit DdeItemImpData( HCONV nH ) : nHCnv( nH ), nCnt( 1 ) {}
 };
 
 class DdeItemImp {
@@ -194,7 +194,7 @@ HDDEDATA CALLBACK DdeInternal::SvrCallback(
 found:
     if ( nCode == XTYP_DISCONNECT)
     {
-        pC->pTopic->Disconnect( (sal_IntPtr) hConv );
+        pC->pTopic->Disconnect( hConv );
         for ( ConvList::iterator it = pService->pConv->begin();
               it != pService->pConv->end();
               ++it
@@ -226,7 +226,6 @@ found:
         (pTopic->aItem).clear();
 
     bool bRes = false;
-    pInst->hCurConvSvr = (sal_IntPtr)hConv;
     switch( nCode )
     {
     case XTYP_REQUEST:
@@ -287,7 +286,6 @@ found:
             else
                 bRes = pTopic->Put( &d );
         }
-        pInst->hCurConvSvr = 0;
         if ( bRes )
             return (HDDEDATA)DDE_FACK;
         else
@@ -328,15 +326,13 @@ found:
 
             if (pItem)
             {
-                pItem->IncMonitor( (sal_IntPtr)hConv );
-                pInst->hCurConvSvr = 0;
+                pItem->IncMonitor( hConv );
             }
         }
         return (HDDEDATA)sal_True;
 
     case XTYP_ADVSTOP:
-        pItem->DecMonitor( (sal_IntPtr)hConv );
-        pInst->hCurConvSvr = 0;
+        pItem->DecMonitor( hConv );
         return (HDDEDATA)sal_True;
 
     case XTYP_EXECUTE:
@@ -354,7 +350,6 @@ found:
             else
                 bRes = pTopic->Execute( &aName );
         }
-        pInst->hCurConvSvr = 0;
         if ( bRes )
             return (HDDEDATA)DDE_FACK;
         else
@@ -674,7 +669,7 @@ void DdeTopic::NotifyClient( const OUString& rItem )
     }
 }
 
-void DdeTopic::Disconnect( sal_IntPtr nId )
+void DdeTopic::Disconnect( HCONV nId )
 {
     std::vector<DdeItem*>::iterator iter;
     for (iter = aItems.begin(); iter != aItems.end(); ++iter)
@@ -696,13 +691,6 @@ bool DdeTopic::Execute( const OUString* )
     return false;
 }
 
-long DdeTopic::GetConvId()
-{
-    DdeInstData* pInst = ImpGetInstData();
-    DBG_ASSERT(pInst,"SVDDE:No instance data");
-    return pInst->hCurConvSvr;
-}
-
 bool DdeTopic::StartAdviseLoop()
 {
     return false;
@@ -762,7 +750,7 @@ void DdeItem::NotifyClient()
     }
 }
 
-void DdeItem::IncMonitor( sal_uLong nHCnv )
+void DdeItem::IncMonitor( HCONV nHCnv )
 {
     if( !pImpData )
     {
@@ -783,7 +771,7 @@ void DdeItem::IncMonitor( sal_uLong nHCnv )
     pImpData->push_back( DdeItemImpData( nHCnv ) );
 }
 
-void DdeItem::DecMonitor( sal_uLong nHCnv )
+void DdeItem::DecMonitor( HCONV nHCnv )
 {
     if( pImpData )
     {


More information about the Libreoffice-commits mailing list