private void ProcessBorders(GdiWriter writer, RPLElementStyle style, RectangleF position, RectangleF bounds, byte state) { RPLFormat.BorderStyles stylePropertyValueBorderStyle = SharedRenderer.GetStylePropertyValueBorderStyle(style, 5, RPLFormat.BorderStyles.None); BorderLeft.Style = SharedRenderer.GetStylePropertyValueBorderStyle(style, 6, stylePropertyValueBorderStyle); BorderTop.Style = SharedRenderer.GetStylePropertyValueBorderStyle(style, 8, stylePropertyValueBorderStyle); BorderRight.Style = SharedRenderer.GetStylePropertyValueBorderStyle(style, 7, stylePropertyValueBorderStyle); BorderBottom.Style = SharedRenderer.GetStylePropertyValueBorderStyle(style, 9, stylePropertyValueBorderStyle); if (BorderLeft.Style == RPLFormat.BorderStyles.None && BorderTop.Style == RPLFormat.BorderStyles.None && BorderRight.Style == RPLFormat.BorderStyles.None && BorderBottom.Style == RPLFormat.BorderStyles.None) { return; } float reportSizeStyleMM = SharedRenderer.GetReportSizeStyleMM(style, 10); BorderLeft.Width = SharedRenderer.GetReportSizeStyleMM(style, 11); if (float.IsNaN(BorderLeft.Width) && !float.IsNaN(reportSizeStyleMM)) { BorderLeft.Width = reportSizeStyleMM; } BorderTop.Width = SharedRenderer.GetReportSizeStyleMM(style, 13); if (float.IsNaN(BorderTop.Width) && !float.IsNaN(reportSizeStyleMM)) { BorderTop.Width = reportSizeStyleMM; } BorderRight.Width = SharedRenderer.GetReportSizeStyleMM(style, 12); if (float.IsNaN(BorderRight.Width) && !float.IsNaN(reportSizeStyleMM)) { BorderRight.Width = reportSizeStyleMM; } BorderBottom.Width = SharedRenderer.GetReportSizeStyleMM(style, 14); if (float.IsNaN(BorderBottom.Width) && !float.IsNaN(reportSizeStyleMM)) { BorderBottom.Width = reportSizeStyleMM; } if (!float.IsNaN(BorderLeft.Width) || !float.IsNaN(BorderTop.Width) || !float.IsNaN(BorderRight.Width) || !float.IsNaN(BorderBottom.Width)) { Color reportColorStyle = SharedRenderer.GetReportColorStyle(style, 0); BorderLeft.Color = SharedRenderer.GetReportColorStyle(style, 1); if (BorderLeft.Color == Color.Empty && reportColorStyle != Color.Empty) { BorderLeft.Color = reportColorStyle; } BorderTop.Color = SharedRenderer.GetReportColorStyle(style, 3); if (BorderTop.Color == Color.Empty && reportColorStyle != Color.Empty) { BorderTop.Color = reportColorStyle; } BorderRight.Color = SharedRenderer.GetReportColorStyle(style, 2); if (BorderRight.Color == Color.Empty && reportColorStyle != Color.Empty) { BorderRight.Color = reportColorStyle; } BorderBottom.Color = SharedRenderer.GetReportColorStyle(style, 4); if (BorderBottom.Color == Color.Empty && reportColorStyle != Color.Empty) { BorderBottom.Color = reportColorStyle; } if (!(BorderLeft.Color == Color.Empty) || !(BorderTop.Color == Color.Empty) || !(BorderRight.Color == Color.Empty) || !(BorderBottom.Color == Color.Empty)) { RenderingItem.ProcessBorders(writer, ref BorderTop, ref BorderLeft, ref BorderBottom, ref BorderRight, position, bounds, state); } } }
internal void ProcessBorders(GdiWriter writer, RPLItemProps properties, RectangleF bounds, byte state) { RPLFormat.BorderStyles stylePropertyValueBorderStyle = SharedRenderer.GetStylePropertyValueBorderStyle(properties, 5, RPLFormat.BorderStyles.None); m_borderLeft.Style = SharedRenderer.GetStylePropertyValueBorderStyle(properties, 6, stylePropertyValueBorderStyle); m_borderRight.Style = SharedRenderer.GetStylePropertyValueBorderStyle(properties, 7, stylePropertyValueBorderStyle); m_borderTop.Style = SharedRenderer.GetStylePropertyValueBorderStyle(properties, 8, stylePropertyValueBorderStyle); m_borderBottom.Style = SharedRenderer.GetStylePropertyValueBorderStyle(properties, 9, stylePropertyValueBorderStyle); if (m_borderLeft.Style == RPLFormat.BorderStyles.None && m_borderRight.Style == RPLFormat.BorderStyles.None && m_borderTop.Style == RPLFormat.BorderStyles.None && m_borderBottom.Style == RPLFormat.BorderStyles.None) { return; } float stylePropertyValueSizeMM = GdiContext.GetStylePropertyValueSizeMM(properties, 10); m_borderLeft.Width = GdiContext.GetStylePropertyValueSizeMM(properties, 11); if (float.IsNaN(m_borderLeft.Width) && !float.IsNaN(stylePropertyValueSizeMM)) { m_borderLeft.Width = stylePropertyValueSizeMM; } m_borderRight.Width = GdiContext.GetStylePropertyValueSizeMM(properties, 12); if (float.IsNaN(m_borderRight.Width) && !float.IsNaN(stylePropertyValueSizeMM)) { m_borderRight.Width = stylePropertyValueSizeMM; } m_borderTop.Width = GdiContext.GetStylePropertyValueSizeMM(properties, 13); if (float.IsNaN(m_borderTop.Width) && !float.IsNaN(stylePropertyValueSizeMM)) { m_borderTop.Width = stylePropertyValueSizeMM; } m_borderBottom.Width = GdiContext.GetStylePropertyValueSizeMM(properties, 14); if (float.IsNaN(m_borderBottom.Width) && !float.IsNaN(stylePropertyValueSizeMM)) { m_borderBottom.Width = stylePropertyValueSizeMM; } if (!float.IsNaN(m_borderLeft.Width) || !float.IsNaN(m_borderRight.Width) || !float.IsNaN(m_borderTop.Width) || !float.IsNaN(m_borderBottom.Width)) { Color stylePropertyValueColor = GdiContext.GetStylePropertyValueColor(properties, 0); m_borderLeft.Color = GdiContext.GetStylePropertyValueColor(properties, 1); if (m_borderLeft.Color == Color.Empty && stylePropertyValueColor != Color.Empty) { m_borderLeft.Color = stylePropertyValueColor; } m_borderRight.Color = GdiContext.GetStylePropertyValueColor(properties, 2); if (m_borderRight.Color == Color.Empty && stylePropertyValueColor != Color.Empty) { m_borderRight.Color = stylePropertyValueColor; } m_borderTop.Color = GdiContext.GetStylePropertyValueColor(properties, 3); if (m_borderTop.Color == Color.Empty && stylePropertyValueColor != Color.Empty) { m_borderTop.Color = stylePropertyValueColor; } m_borderBottom.Color = GdiContext.GetStylePropertyValueColor(properties, 4); if (m_borderBottom.Color == Color.Empty && stylePropertyValueColor != Color.Empty) { m_borderBottom.Color = stylePropertyValueColor; } if (!(m_borderLeft.Color == Color.Empty) || !(m_borderRight.Color == Color.Empty) || !(m_borderTop.Color == Color.Empty) || !(m_borderBottom.Color == Color.Empty)) { ProcessBorders(writer, ref m_borderTop, ref m_borderLeft, ref m_borderBottom, ref m_borderRight, base.Position, bounds, state); } } }