diff options
Diffstat (limited to 'xfa/fwl/theme/cfwl_widgettp.cpp')
-rw-r--r-- | xfa/fwl/theme/cfwl_widgettp.cpp | 42 |
1 files changed, 16 insertions, 26 deletions
diff --git a/xfa/fwl/theme/cfwl_widgettp.cpp b/xfa/fwl/theme/cfwl_widgettp.cpp index fe63780c39..48d4118ed9 100644 --- a/xfa/fwl/theme/cfwl_widgettp.cpp +++ b/xfa/fwl/theme/cfwl_widgettp.cpp @@ -98,17 +98,15 @@ void CFWL_WidgetTP::FinalizeTTO() { void CFWL_WidgetTP::DrawBorder(CXFA_Graphics* pGraphics, const CFX_RectF* pRect, CFX_Matrix* pMatrix) { - if (!pGraphics) - return; - if (!pRect) + if (!pGraphics || !pRect) return; + CXFA_Path path; path.AddRectangle(pRect->left, pRect->top, pRect->width, pRect->height); path.AddRectangle(pRect->left + 1, pRect->top + 1, pRect->width - 2, pRect->height - 2); pGraphics->SaveGraphState(); - CXFA_Color crFill(ArgbEncode(255, 0, 0, 0)); - pGraphics->SetFillColor(&crFill); + pGraphics->SetFillColor(CXFA_Color(ArgbEncode(255, 0, 0, 0))); pGraphics->FillPath(&path, FXFILL_ALTERNATE, pMatrix); pGraphics->RestoreGraphState(); } @@ -123,15 +121,13 @@ void CFWL_WidgetTP::FillSoildRect(CXFA_Graphics* pGraphics, FX_ARGB fillColor, const CFX_RectF* pRect, CFX_Matrix* pMatrix) { - if (!pGraphics) + if (!pGraphics || !pRect) return; - if (!pRect) - return; - pGraphics->SaveGraphState(); - CXFA_Color crFill(fillColor); - pGraphics->SetFillColor(&crFill); + CXFA_Path path; path.AddRectangle(pRect->left, pRect->top, pRect->width, pRect->height); + pGraphics->SaveGraphState(); + pGraphics->SetFillColor(CXFA_Color(fillColor)); pGraphics->FillPath(&path, FXFILL_WINDING, pMatrix); pGraphics->RestoreGraphState(); } @@ -153,8 +149,7 @@ void CFWL_WidgetTP::DrawAxialShading(CXFA_Graphics* pGraphics, CFX_PointF endPoint(fx2, fy2); CXFA_Shading shading(begPoint, endPoint, false, false, beginColor, endColor); pGraphics->SaveGraphState(); - CXFA_Color color1(&shading); - pGraphics->SetFillColor(&color1); + pGraphics->SetFillColor(CXFA_Color(&shading)); pGraphics->FillPath(path, fillMode, pMatrix); pGraphics->RestoreGraphState(); } @@ -162,17 +157,15 @@ void CFWL_WidgetTP::DrawAxialShading(CXFA_Graphics* pGraphics, void CFWL_WidgetTP::DrawFocus(CXFA_Graphics* pGraphics, const CFX_RectF* pRect, CFX_Matrix* pMatrix) { - if (!pGraphics) - return; - if (!pRect) + if (!pGraphics || !pRect) return; - pGraphics->SaveGraphState(); - CXFA_Color cr(0xFF000000); - pGraphics->SetStrokeColor(&cr); + float DashPattern[2] = {1, 1}; - pGraphics->SetLineDash(0.0f, DashPattern, 2); CXFA_Path path; path.AddRectangle(pRect->left, pRect->top, pRect->width, pRect->height); + pGraphics->SaveGraphState(); + pGraphics->SetStrokeColor(CXFA_Color(0xFF000000)); + pGraphics->SetLineDash(0.0f, DashPattern, 2); pGraphics->StrokePath(&path, pMatrix); pGraphics->RestoreGraphState(); } @@ -227,8 +220,7 @@ void CFWL_WidgetTP::DrawArrow(CXFA_Graphics* pGraphics, break; } } - CXFA_Color cr(argSign); - pGraphics->SetFillColor(&cr); + pGraphics->SetFillColor(CXFA_Color(argSign)); pGraphics->FillPath(&path, FXFILL_WINDING, pMatrix); } @@ -236,9 +228,9 @@ void CFWL_WidgetTP::DrawBtn(CXFA_Graphics* pGraphics, const CFX_RectF* pRect, FWLTHEME_STATE eState, CFX_Matrix* pMatrix) { - CXFA_Path path; InitializeArrowColorData(); + CXFA_Path path; float fRight = pRect->right(); float fBottom = pRect->bottom(); path.AddRectangle(pRect->left, pRect->top, pRect->width, pRect->height); @@ -247,9 +239,7 @@ void CFWL_WidgetTP::DrawBtn(CXFA_Graphics* pGraphics, m_pColorData->clrEnd[eState - 1], &path, FXFILL_WINDING, pMatrix); - CXFA_Color rcStroke; - rcStroke.Set(m_pColorData->clrBorder[eState - 1]); - pGraphics->SetStrokeColor(&rcStroke); + pGraphics->SetStrokeColor(CXFA_Color(m_pColorData->clrBorder[eState - 1])); pGraphics->StrokePath(&path, pMatrix); } |