Commit 31f95846 authored by JP Dinger's avatar JP Dinger

Cosmetics; shore up long winded code a bit in the activex plugin.

parent 9f857cd6
...@@ -111,35 +111,23 @@ HRESULT GetObjectProperty(LPUNKNOWN object, DISPID dispID, VARIANT& v) ...@@ -111,35 +111,23 @@ HRESULT GetObjectProperty(LPUNKNOWN object, DISPID dispID, VARIANT& v)
HDC CreateDevDC(DVTARGETDEVICE *ptd) HDC CreateDevDC(DVTARGETDEVICE *ptd)
{ {
HDC hdc=NULL; HDC hdc;
if( NULL == ptd ) if( NULL == ptd )
{ {
hdc = CreateDC(TEXT("DISPLAY"), NULL, NULL, NULL); hdc = CreateDC(TEXT("DISPLAY"), NULL, NULL, NULL);
} }
else else
{ {
LPDEVNAMES lpDevNames; LPDEVNAMES lpDevNames = (LPDEVNAMES) ptd; // offset for size field
LPDEVMODE lpDevMode; LPDEVMODE lpDevMode = NULL;
LPTSTR lpszDriverName;
LPTSTR lpszDeviceName;
LPTSTR lpszPortName;
lpDevNames = (LPDEVNAMES) ptd; // offset for size field if (ptd->tdExtDevmodeOffset != 0)
if (ptd->tdExtDevmodeOffset == 0)
{
lpDevMode = NULL;
}
else
{
lpDevMode = (LPDEVMODE) ((LPTSTR)ptd + ptd->tdExtDevmodeOffset); 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;
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment