]> git.sesse.net Git - vlc/commitdiff
Cosmetics; shore up long winded code a bit in the activex plugin.
authorJP Dinger <jpd@videolan.org>
Thu, 21 May 2009 20:19:45 +0000 (22:19 +0200)
committerJP Dinger <jpd@videolan.org>
Mon, 25 May 2009 17:38:56 +0000 (19:38 +0200)
projects/activex/utils.cpp

index b96ea8fc4b49f06d91d1f97bcdaa2f3fc16e50ca..9c469db3aefcec57f94896730ecc04863d2a5156 100644 (file)
@@ -111,37 +111,25 @@ HRESULT GetObjectProperty(LPUNKNOWN object, DISPID dispID, VARIANT& v)
 
 HDC CreateDevDC(DVTARGETDEVICE *ptd)
 {
-    HDC hdc=NULL;
+    HDC hdc;
     if( NULL == ptd )
     {
         hdc = CreateDC(TEXT("DISPLAY"), NULL, NULL, NULL);
     }
     else
     {
-        LPDEVNAMES lpDevNames;
-        LPDEVMODE lpDevMode;
-        LPTSTR lpszDriverName;
-        LPTSTR lpszDeviceName;
-        LPTSTR lpszPortName;
+        LPDEVNAMES lpDevNames = (LPDEVNAMES) ptd; // offset for size field
+        LPDEVMODE  lpDevMode  = NULL;
 
-        lpDevNames = (LPDEVNAMES) ptd; // offset for size field
-
-        if (ptd->tdExtDevmodeOffset == 0)
-        {
-            lpDevMode = NULL;
-        }
-        else
-        {
+        if (ptd->tdExtDevmodeOffset != 0)
             lpDevMode  = (LPDEVMODE) ((LPTSTR)ptd + ptd->tdExtDevmodeOffset);
-        }
-
-        lpszDriverName = (LPTSTR) lpDevNames + ptd->tdDriverNameOffset;
-        lpszDeviceName = (LPTSTR) lpDevNames + ptd->tdDeviceNameOffset;
-        lpszPortName   = (LPTSTR) lpDevNames + ptd->tdPortNameOffset;
 
-        hdc = CreateDC(lpszDriverName, lpszDeviceName, lpszPortName, lpDevMode);
+        hdc = CreateDC( (LPTSTR) lpDevNames + ptd->tdDriverNameOffset,
+                        (LPTSTR) lpDevNames + ptd->tdDeviceNameOffset,
+                        (LPTSTR) lpDevNames + ptd->tdPortNameOffset,
+                        lpDevMode );
     }
-        return hdc;
+    return hdc;
 };
 
 #define HIMETRIC_PER_INCH 2540