oleaut32: Get rid of duplicated condition check.
This commit is contained in:
parent
c69be3bfb9
commit
e800158ab0
|
@ -584,8 +584,6 @@ static int CALLBACK font_enum_proc(const LOGFONTW *elf, const TEXTMETRICW *ntm,
|
||||||
|
|
||||||
static void realize_font(OLEFontImpl *This)
|
static void realize_font(OLEFontImpl *This)
|
||||||
{
|
{
|
||||||
if (This->dirty)
|
|
||||||
{
|
|
||||||
LOGFONTW logFont;
|
LOGFONTW logFont;
|
||||||
INT fontHeight;
|
INT fontHeight;
|
||||||
WCHAR text_face[LF_FACESIZE];
|
WCHAR text_face[LF_FACESIZE];
|
||||||
|
@ -593,6 +591,8 @@ static void realize_font(OLEFontImpl *This)
|
||||||
HFONT old_font;
|
HFONT old_font;
|
||||||
TEXTMETRICW tm;
|
TEXTMETRICW tm;
|
||||||
|
|
||||||
|
if (!This->dirty) return;
|
||||||
|
|
||||||
text_face[0] = 0;
|
text_face[0] = 0;
|
||||||
|
|
||||||
if(This->gdiFont)
|
if(This->gdiFont)
|
||||||
|
@ -621,7 +621,6 @@ static void realize_font(OLEFontImpl *This)
|
||||||
if(data.avail_cs != -1) logFont.lfCharSet = data.avail_cs;
|
if(data.avail_cs != -1) logFont.lfCharSet = data.avail_cs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The height of the font returned by the get_Size property is the
|
* The height of the font returned by the get_Size property is the
|
||||||
* height of the font in points multiplied by 10000... Using some
|
* height of the font in points multiplied by 10000... Using some
|
||||||
|
@ -634,7 +633,6 @@ static void realize_font(OLEFontImpl *This)
|
||||||
|
|
||||||
fontHeight = MulDiv( This->description.cySize.s.Lo, This->cyLogical*635, This->cyHimetric*18 );
|
fontHeight = MulDiv( This->description.cySize.s.Lo, This->cyLogical*635, This->cyHimetric*18 );
|
||||||
|
|
||||||
|
|
||||||
logFont.lfHeight = ((fontHeight%10000L)>5000L) ? (-fontHeight/10000L) - 1 :
|
logFont.lfHeight = ((fontHeight%10000L)>5000L) ? (-fontHeight/10000L) - 1 :
|
||||||
(-fontHeight/10000L);
|
(-fontHeight/10000L);
|
||||||
logFont.lfItalic = This->description.fItalic;
|
logFont.lfItalic = This->description.fItalic;
|
||||||
|
@ -665,7 +663,6 @@ static void realize_font(OLEFontImpl *This)
|
||||||
/* While we have it handy, stash the realized font height for use by get_Size() */
|
/* While we have it handy, stash the realized font height for use by get_Size() */
|
||||||
This->nRealHeight = tm.tmHeight - tm.tmInternalLeading; /* corresponds to LOGFONT lfHeight */
|
This->nRealHeight = tm.tmHeight - tm.tmInternalLeading; /* corresponds to LOGFONT lfHeight */
|
||||||
SelectObject(hdc, old_font);
|
SelectObject(hdc, old_font);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
|
@ -683,7 +680,7 @@ static HRESULT WINAPI OLEFontImpl_get_Name(
|
||||||
if (pname==0)
|
if (pname==0)
|
||||||
return E_POINTER;
|
return E_POINTER;
|
||||||
|
|
||||||
if(this->dirty) realize_font(this);
|
realize_font(this);
|
||||||
|
|
||||||
if (this->description.lpstrName!=0)
|
if (this->description.lpstrName!=0)
|
||||||
*pname = SysAllocString(this->description.lpstrName);
|
*pname = SysAllocString(this->description.lpstrName);
|
||||||
|
@ -741,7 +738,7 @@ static HRESULT WINAPI OLEFontImpl_get_Size(
|
||||||
|
|
||||||
if (!psize) return E_POINTER;
|
if (!psize) return E_POINTER;
|
||||||
|
|
||||||
if(this->dirty) realize_font(this);
|
realize_font(this);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Convert realized font height in pixels to points descaled by current
|
* Convert realized font height in pixels to points descaled by current
|
||||||
|
@ -785,7 +782,7 @@ static HRESULT WINAPI OLEFontImpl_get_Bold(
|
||||||
|
|
||||||
if (!pbold) return E_POINTER;
|
if (!pbold) return E_POINTER;
|
||||||
|
|
||||||
if(this->dirty) realize_font(this);
|
realize_font(this);
|
||||||
|
|
||||||
*pbold = this->description.sWeight > 550;
|
*pbold = this->description.sWeight > 550;
|
||||||
|
|
||||||
|
@ -820,7 +817,7 @@ static HRESULT WINAPI OLEFontImpl_get_Italic(
|
||||||
if (pitalic==0)
|
if (pitalic==0)
|
||||||
return E_POINTER;
|
return E_POINTER;
|
||||||
|
|
||||||
if(this->dirty) realize_font(this);
|
realize_font(this);
|
||||||
|
|
||||||
*pitalic = this->description.fItalic;
|
*pitalic = this->description.fItalic;
|
||||||
|
|
||||||
|
@ -856,7 +853,7 @@ static HRESULT WINAPI OLEFontImpl_get_Underline(
|
||||||
if (punderline==0)
|
if (punderline==0)
|
||||||
return E_POINTER;
|
return E_POINTER;
|
||||||
|
|
||||||
if(this->dirty) realize_font(this);
|
realize_font(this);
|
||||||
|
|
||||||
*punderline = this->description.fUnderline;
|
*punderline = this->description.fUnderline;
|
||||||
|
|
||||||
|
@ -892,7 +889,7 @@ static HRESULT WINAPI OLEFontImpl_get_Strikethrough(
|
||||||
if (pstrikethrough==0)
|
if (pstrikethrough==0)
|
||||||
return E_POINTER;
|
return E_POINTER;
|
||||||
|
|
||||||
if(this->dirty) realize_font(this);
|
realize_font(this);
|
||||||
|
|
||||||
*pstrikethrough = this->description.fStrikethrough;
|
*pstrikethrough = this->description.fStrikethrough;
|
||||||
|
|
||||||
|
@ -928,7 +925,7 @@ static HRESULT WINAPI OLEFontImpl_get_Weight(
|
||||||
if (pweight==0)
|
if (pweight==0)
|
||||||
return E_POINTER;
|
return E_POINTER;
|
||||||
|
|
||||||
if(this->dirty) realize_font(this);
|
realize_font(this);
|
||||||
|
|
||||||
*pweight = this->description.sWeight;
|
*pweight = this->description.sWeight;
|
||||||
|
|
||||||
|
@ -964,7 +961,7 @@ static HRESULT WINAPI OLEFontImpl_get_Charset(
|
||||||
if (pcharset==0)
|
if (pcharset==0)
|
||||||
return E_POINTER;
|
return E_POINTER;
|
||||||
|
|
||||||
if(this->dirty) realize_font(this);
|
realize_font(this);
|
||||||
|
|
||||||
*pcharset = this->description.sCharset;
|
*pcharset = this->description.sCharset;
|
||||||
|
|
||||||
|
@ -999,7 +996,7 @@ static HRESULT WINAPI OLEFontImpl_get_hFont(
|
||||||
if (phfont==NULL)
|
if (phfont==NULL)
|
||||||
return E_POINTER;
|
return E_POINTER;
|
||||||
|
|
||||||
if(this->dirty) realize_font(this);
|
realize_font(this);
|
||||||
|
|
||||||
*phfont = this->gdiFont;
|
*phfont = this->gdiFont;
|
||||||
TRACE("Returning %p\n", *phfont);
|
TRACE("Returning %p\n", *phfont);
|
||||||
|
|
Loading…
Reference in New Issue