summaryrefslogtreecommitdiff
path: root/vcl/win
diff options
context:
space:
mode:
authorKhaled Hosny <khaledhosny@eglug.org>2017-03-04 00:51:15 +0200
committerKhaled Hosny <khaledhosny@eglug.org>2017-03-04 02:47:50 +0200
commitbaf3940bcafbb1acbaf75e1149e4895986f4c50f (patch)
tree6d0cb9208a87447ad59ee97bbc75efcb00bb9897 /vcl/win
parent6cb9e6dad798ec59f055aebe84a9c4a21e4be40d (diff)
Avoid needless dynamic_cast’s
It is all CommonSalLayout() for sometime now. Change-Id: I3d4ad56df195f51242c3d007bc5257c071a03a50
Diffstat (limited to 'vcl/win')
-rw-r--r--vcl/win/gdi/winlayout.cxx19
1 files changed, 6 insertions, 13 deletions
diff --git a/vcl/win/gdi/winlayout.cxx b/vcl/win/gdi/winlayout.cxx
index 193d4b6b9459..4847d67b03a5 100644
--- a/vcl/win/gdi/winlayout.cxx
+++ b/vcl/win/gdi/winlayout.cxx
@@ -265,7 +265,7 @@ TextOutRenderer & TextOutRenderer::get(bool bUseDWrite)
}
-bool ExTextOutRenderer::operator ()(SalLayout const &rLayout, HDC hDC,
+bool ExTextOutRenderer::operator ()(CommonSalLayout const &rLayout, HDC hDC,
const Rectangle* pRectToErase,
Point* pPos, int* pGetNextGlypInfo)
{
@@ -274,8 +274,7 @@ bool ExTextOutRenderer::operator ()(SalLayout const &rLayout, HDC hDC,
HFONT hFont = static_cast<HFONT>(GetCurrentObject( hDC, OBJ_FONT ));
HFONT hAltFont = nullptr;
bool bUseAltFont = false;
- const CommonSalLayout* pCSL = dynamic_cast<const CommonSalLayout*>(&rLayout);
- if (pCSL && pCSL->getFontSelData().mbVertical)
+ if (rLayout.getFontSelData().mbVertical)
{
LOGFONTW aLogFont;
GetObjectW(hFont, sizeof(LOGFONTW), &aLogFont);
@@ -343,7 +342,7 @@ D2DWriteTextOutRenderer::~D2DWriteTextOutRenderer()
CleanupModules();
}
-bool D2DWriteTextOutRenderer::operator ()(SalLayout const &rLayout, HDC hDC,
+bool D2DWriteTextOutRenderer::operator ()(CommonSalLayout const &rLayout, HDC hDC,
const Rectangle* pRectToErase,
Point* pPos, int* pGetNextGlypInfo)
{
@@ -368,11 +367,8 @@ bool D2DWriteTextOutRenderer::operator ()(SalLayout const &rLayout, HDC hDC,
bool bGlyphs = false;
if (succeeded)
{
- bool bVertical = false;
float nYDiff = 0.0f;
- const CommonSalLayout* pCSL = dynamic_cast<const CommonSalLayout*>(&rLayout);
- if (pCSL)
- bVertical = pCSL->getFontSelData().mbVertical;
+ bool bVertical = rLayout.getFontSelData().mbVertical;
if (bVertical)
{
@@ -527,7 +523,7 @@ bool D2DWriteTextOutRenderer::GetDWriteFaceFromHDC(HDC hDC, IDWriteFontFace ** p
return succeeded;
}
-bool D2DWriteTextOutRenderer::GetDWriteInkBox(SalLayout const &rLayout, Rectangle & rOut) const
+bool D2DWriteTextOutRenderer::GetDWriteInkBox(CommonSalLayout const &rLayout, Rectangle & rOut) const
{
rOut.SetEmpty();
@@ -551,11 +547,8 @@ bool D2DWriteTextOutRenderer::GetDWriteInkBox(SalLayout const &rLayout, Rectangl
if (aBoxes.empty())
return false;
- bool bVertical = false;
double nYDiff = 0.0f;
- const CommonSalLayout* pCSL = dynamic_cast<const CommonSalLayout*>(&rLayout);
- if (pCSL)
- bVertical = pCSL->getFontSelData().mbVertical;
+ bool bVertical = rLayout.getFontSelData().mbVertical;
if (bVertical)
{