コード例 #1
0
 public override void WriteBorderProps(RPLStyleProps rplStyleProps, Style style)
 {
     if (!this.SpecialBorderHandling)
     {
         base.WriteBorderProps(rplStyleProps, style);
     }
 }
コード例 #2
0
 internal override void WriteItemNonSharedStyleProps(RPLStyleProps styleProps, Style styleDef, StyleInstance style, StyleAttributeNames styleAtt, PageContext pageContext)
 {
     if (styleAtt == StyleAttributeNames.BackgroundColor)
     {
         WriteStyleProp(styleDef, style, styleProps, StyleAttributeNames.BackgroundColor, 34);
     }
 }
コード例 #3
0
 public override void WriteItemNonSharedStyleProp(RPLStyleProps rplStyleProps, Style styleDef, StyleInstance style, StyleAttributeNames styleAttribute, PageContext pageContext)
 {
     if (styleAttribute == StyleAttributeNames.BackgroundColor)
     {
         base.WriteStyleProp(styleDef, style, rplStyleProps, StyleAttributeNames.BackgroundColor, 34);
     }
 }
コード例 #4
0
 public override void WriteItemSharedStyleProps(RPLStyleProps rplStyleProps, Style style, PageContext pageContext)
 {
     PageItem.WriteStyleProp(style, rplStyleProps, StyleAttributeNames.PaddingBottom, 18);
     PageItem.WriteStyleProp(style, rplStyleProps, StyleAttributeNames.PaddingLeft, 15);
     PageItem.WriteStyleProp(style, rplStyleProps, StyleAttributeNames.PaddingRight, 16);
     PageItem.WriteStyleProp(style, rplStyleProps, StyleAttributeNames.PaddingTop, 17);
 }
コード例 #5
0
 internal override void WriteBorderProps(RPLStyleProps rplStyleProps, Style style)
 {
     if (!SpecialBorderHandling)
     {
         base.WriteBorderProps(rplStyleProps, style);
     }
 }
コード例 #6
0
        private static void FillBottomBorderProperties(RPLStyleProps style, IExcelGenerator excel, ref BorderProperties bottomBorder)
        {
            BorderProperties currBorder = FillBorderProperties(excel, null, bottomBorder, ExcelBorderPart.Bottom, style[5], style[10], style[0]);

            currBorder = FillBorderProperties(excel, currBorder, bottomBorder, ExcelBorderPart.Bottom, style[9], style[14], style[4]);
            if (currBorder != null)
            {
                bottomBorder = currBorder;
            }
        }
コード例 #7
0
        private static void FillRightBorderProperties(RPLStyleProps style, IExcelGenerator excel, ref BorderProperties rightBorder)
        {
            BorderProperties currBorder = FillBorderProperties(excel, null, rightBorder, ExcelBorderPart.Right, style[5], style[10], style[0]);

            currBorder = FillBorderProperties(excel, currBorder, rightBorder, ExcelBorderPart.Right, style[7], style[12], style[2]);
            if (currBorder != null)
            {
                rightBorder = currBorder;
            }
        }
コード例 #8
0
        private static void FillTopBorderProperties(RPLStyleProps style, IExcelGenerator excel, ref BorderProperties topBorder)
        {
            BorderProperties currBorder = FillBorderProperties(excel, null, topBorder, ExcelBorderPart.Top, style[5], style[10], style[0]);

            currBorder = FillBorderProperties(excel, currBorder, topBorder, ExcelBorderPart.Top, style[8], style[13], style[3]);
            if (currBorder != null)
            {
                topBorder = currBorder;
            }
        }
コード例 #9
0
        private static void FillLeftBorderProperties(RPLStyleProps style, IExcelGenerator excel, ref BorderProperties leftBorder)
        {
            BorderProperties currBorder = FillBorderProperties(excel, null, leftBorder, ExcelBorderPart.Left, style[5], style[10], style[0]);

            currBorder = FillBorderProperties(excel, currBorder, leftBorder, ExcelBorderPart.Left, style[6], style[11], style[1]);
            if (currBorder != null)
            {
                leftBorder = currBorder;
            }
        }
コード例 #10
0
 internal static void FillAllBorders(RPLStyleProps style, ref BorderProperties leftBorder, ref BorderProperties rightBorder, ref BorderProperties topBorder, ref BorderProperties bottomBorder, ref IColor backgroundColor, IExcelGenerator excel)
 {
     if (style[34] != null && !style[34].Equals("Transparent"))
     {
         backgroundColor = excel.AddColor((string)style[34]);
     }
     FillLeftBorderProperties(style, excel, ref leftBorder);
     FillRightBorderProperties(style, excel, ref rightBorder);
     FillTopBorderProperties(style, excel, ref topBorder);
     FillBottomBorderProperties(style, excel, ref bottomBorder);
 }
コード例 #11
0
 public override void WriteNonSharedStyleProp(RPLStyleProps rplStyleProps, Style styleDef, StyleInstance style, StyleAttributeNames styleAttribute, PageContext pageContext)
 {
     if (!this.SpecialBorderHandling)
     {
         base.WriteNonSharedStyleProp(rplStyleProps, styleDef, style, styleAttribute, pageContext);
     }
     else
     {
         this.WriteItemNonSharedStyleProp(rplStyleProps, styleDef, style, styleAttribute, pageContext);
     }
 }
コード例 #12
0
		internal override void WriteItemNonSharedStyleProps(RPLStyleProps rplStyleProps, Style styleDef, StyleInstance style, StyleAttributeNames styleAtt, PageContext pageContext)
		{
			switch (styleAtt)
			{
			case StyleAttributeNames.BackgroundColor:
				WriteStyleProp(styleDef, style, rplStyleProps, StyleAttributeNames.BackgroundColor, 34);
				break;
			case StyleAttributeNames.BackgroundImage:
				WriteBackgroundImage(styleDef, writeShared: false, rplStyleProps, pageContext);
				break;
			}
		}
コード例 #13
0
        public override void WriteItemNonSharedStyleProp(RPLStyleProps rplStyleProps, Style styleDef, StyleInstance style, StyleAttributeNames styleAtt, PageContext pageContext)
        {
            switch (styleAtt)
            {
            case StyleAttributeNames.BackgroundColor:
                base.WriteStyleProp(styleDef, style, rplStyleProps, StyleAttributeNames.BackgroundColor, 34);
                break;

            case StyleAttributeNames.BackgroundImage:
                this.WriteBackgroundImage(rplStyleProps, styleDef, false, pageContext);
                break;
            }
        }
コード例 #14
0
        internal override void WriteNonSharedStyleProp(RPLStyleProps rplStyleProps, Style styleDef, StyleInstance style, StyleAttributeNames styleAttribute, PageContext pageContext)
        {
            switch (styleAttribute)
            {
            case StyleAttributeNames.TextAlign:
                WriteStyleProp(styleDef, style, rplStyleProps, styleAttribute, 25);
                break;

            case StyleAttributeNames.LineHeight:
                WriteStyleProp(styleDef, style, rplStyleProps, styleAttribute, 28);
                break;
            }
        }
コード例 #15
0
 public override void WriteItemSharedStyleProps(RPLStyleProps rplStyleProps, Style style, PageContext pageContext)
 {
     base.WriteStyleProp(style, rplStyleProps, StyleAttributeNames.FontStyle, 19);
     base.WriteStyleProp(style, rplStyleProps, StyleAttributeNames.FontFamily, 20);
     base.WriteStyleProp(style, rplStyleProps, StyleAttributeNames.FontSize, 21);
     base.WriteStyleProp(style, rplStyleProps, StyleAttributeNames.FontWeight, 22);
     base.WriteStyleProp(style, rplStyleProps, StyleAttributeNames.Format, 23);
     base.WriteStyleProp(style, rplStyleProps, StyleAttributeNames.TextDecoration, 24);
     base.WriteStyleProp(style, rplStyleProps, StyleAttributeNames.Color, 27);
     base.WriteStyleProp(style, rplStyleProps, StyleAttributeNames.Language, 32);
     base.WriteStyleProp(style, rplStyleProps, StyleAttributeNames.Calendar, 38);
     base.WriteStyleProp(style, rplStyleProps, StyleAttributeNames.NumeralLanguage, 36);
     base.WriteStyleProp(style, rplStyleProps, StyleAttributeNames.NumeralVariant, 37);
 }
コード例 #16
0
        public override bool NeedsToWriteNullStyle(StyleWriterMode mode)
        {
            RPLParagraph paragraph = this.m_paragraph;

            switch (mode)
            {
            case StyleWriterMode.NonShared:
            {
                RPLParagraphProps rPLParagraphProps = paragraph.ElementProps as RPLParagraphProps;
                if (rPLParagraphProps.LeftIndent == null && rPLParagraphProps.RightIndent == null && rPLParagraphProps.SpaceBefore == null && rPLParagraphProps.SpaceAfter == null && rPLParagraphProps.HangingIndent == null)
                {
                    RPLStyleProps nonSharedStyle = this.m_textBox.ElementProps.NonSharedStyle;
                    if (!this.m_outputSharedInNonShared)
                    {
                        break;
                    }
                    return(true);
                }
                return(true);
            }

            case StyleWriterMode.Shared:
            {
                if (this.m_outputSharedInNonShared)
                {
                    return(false);
                }
                RPLParagraphPropsDef rPLParagraphPropsDef = paragraph.ElementProps.Definition as RPLParagraphPropsDef;
                if (rPLParagraphPropsDef.LeftIndent == null && rPLParagraphPropsDef.RightIndent == null && rPLParagraphPropsDef.SpaceBefore == null && rPLParagraphPropsDef.SpaceAfter == null && rPLParagraphPropsDef.HangingIndent == null)
                {
                    IRPLStyle sharedStyle = this.m_textBox.ElementPropsDef.SharedStyle;
                    if (sharedStyle == null)
                    {
                        break;
                    }
                    if (!HTML5Renderer.IsDirectionRTL(sharedStyle))
                    {
                        break;
                    }
                    return(true);
                }
                return(true);
            }
            }
            return(false);
        }
コード例 #17
0
        internal void WriteItemStyle(RPLWriter rplWriter, PageContext pageContext)
        {
            if (rplWriter == null)
            {
                return;
            }
            Style style = m_source.Style;

            if (style == null)
            {
                return;
            }
            BinaryWriter binaryWriter = rplWriter.BinaryWriter;

            if (binaryWriter != null)
            {
                WriteSharedStyle(binaryWriter, style, pageContext);
                StyleInstance style2 = m_source.Instance.Style;
                if (style2 != null)
                {
                    WriteNonSharedStyleWithoutTag(binaryWriter, style, style2, pageContext);
                }
                binaryWriter.Write(byte.MaxValue);
                return;
            }
            RPLPageLayout pageLayout = m_pageLayout;

            if (pageLayout != null)
            {
                RPLStyleProps rPLStyleProps  = WriteSharedStyle(style, pageContext);
                RPLStyleProps rPLStyleProps2 = null;
                StyleInstance style3         = m_source.Instance.Style;
                if (style3 != null)
                {
                    rPLStyleProps2 = WriteNonSharedStyle(style, style3, pageContext);
                }
                if (rPLStyleProps != null || rPLStyleProps2 != null)
                {
                    pageLayout.Style = new RPLElementStyle(rPLStyleProps2, rPLStyleProps);
                }
            }
        }
コード例 #18
0
        public override void WriteItemNonSharedStyleProps(RPLStyleProps rplStyleProps, Style styleDef, StyleInstance style, StyleAttributeNames styleAtt, PageContext pageContext)
        {
            switch (styleAtt)
            {
            case StyleAttributeNames.PaddingBottom:
                base.WriteStyleProp(styleDef, style, rplStyleProps, StyleAttributeNames.PaddingBottom, 18);
                break;

            case StyleAttributeNames.PaddingLeft:
                base.WriteStyleProp(styleDef, style, rplStyleProps, StyleAttributeNames.PaddingLeft, 15);
                break;

            case StyleAttributeNames.PaddingRight:
                base.WriteStyleProp(styleDef, style, rplStyleProps, StyleAttributeNames.PaddingRight, 16);
                break;

            case StyleAttributeNames.PaddingTop:
                base.WriteStyleProp(styleDef, style, rplStyleProps, StyleAttributeNames.PaddingTop, 17);
                break;
            }
        }
コード例 #19
0
 public void WriteItemStyle(RPLWriter rplWriter, PageContext pageContext)
 {
     if (rplWriter != null)
     {
         Style style = this.m_source.Style;
         if (style != null)
         {
             BinaryWriter binaryWriter = rplWriter.BinaryWriter;
             if (binaryWriter != null)
             {
                 base.WriteSharedStyle(binaryWriter, style, pageContext);
                 StyleInstance style2 = this.m_source.Instance.Style;
                 if (style2 != null)
                 {
                     this.WriteNonSharedStyleWithoutTag(binaryWriter, style, style2, pageContext);
                 }
                 binaryWriter.Write((byte)255);
             }
             else
             {
                 RPLPageLayout pageLayout = this.m_pageLayout;
                 if (pageLayout != null)
                 {
                     RPLStyleProps rPLStyleProps  = base.WriteSharedStyle(style, pageContext);
                     RPLStyleProps rPLStyleProps2 = null;
                     StyleInstance style3         = this.m_source.Instance.Style;
                     if (style3 != null)
                     {
                         rPLStyleProps2 = this.WriteNonSharedStyle(style, style3, pageContext);
                     }
                     if (rPLStyleProps == null && rPLStyleProps2 == null)
                     {
                         return;
                     }
                     pageLayout.Style = new RPLElementStyle(rPLStyleProps2, rPLStyleProps);
                 }
             }
         }
     }
 }
コード例 #20
0
        internal void WriteElementStyle(RPLWriter rplWriter, PageContext pageContext)
        {
            if (rplWriter == null)
            {
                return;
            }
            Style style = m_source.Style;

            if (style == null)
            {
                return;
            }
            BinaryWriter binaryWriter = rplWriter.BinaryWriter;

            if (binaryWriter != null)
            {
                WriteSharedStyle(binaryWriter, style, pageContext, 6);
                StyleInstance styleInstance = GetStyleInstance(m_source, null);
                if (styleInstance != null)
                {
                    WriteNonSharedStyle(binaryWriter, style, styleInstance, pageContext, null, null);
                }
                binaryWriter.Write(byte.MaxValue);
                return;
            }
            RPLPageLayout pageLayout     = rplWriter.Report.RPLPaginatedPages[0].PageLayout;
            RPLStyleProps rPLStyleProps  = WriteSharedStyle(style, pageContext);
            RPLStyleProps rPLStyleProps2 = null;
            StyleInstance styleInstance2 = GetStyleInstance(m_source, null);

            if (styleInstance2 != null)
            {
                rPLStyleProps2 = WriteNonSharedStyle(style, styleInstance2, pageContext, null);
            }
            if (rPLStyleProps != null || rPLStyleProps2 != null)
            {
                pageLayout.Style = new RPLElementStyle(rPLStyleProps2, rPLStyleProps);
            }
        }
コード例 #21
0
 public void WriteElementStyle(RPLWriter rplWriter, PageContext pageContext)
 {
     if (rplWriter != null)
     {
         Style style = base.m_source.Style;
         if (style != null)
         {
             BinaryWriter binaryWriter = rplWriter.BinaryWriter;
             if (binaryWriter != null)
             {
                 this.WriteSharedStyle(binaryWriter, style, pageContext, 6);
                 StyleInstance styleInstance = base.GetStyleInstance(base.m_source, null);
                 if (styleInstance != null)
                 {
                     this.WriteNonSharedStyle(binaryWriter, style, styleInstance, pageContext, null, null);
                 }
                 binaryWriter.Write((byte)255);
             }
             else
             {
                 RPLPageLayout pageLayout     = rplWriter.Report.RPLPaginatedPages[0].PageLayout;
                 RPLStyleProps rPLStyleProps  = this.WriteSharedStyle(style, pageContext);
                 RPLStyleProps rPLStyleProps2 = null;
                 StyleInstance styleInstance2 = base.GetStyleInstance(base.m_source, null);
                 if (styleInstance2 != null)
                 {
                     rPLStyleProps2 = this.WriteNonSharedStyle(style, styleInstance2, pageContext, null);
                 }
                 if (rPLStyleProps == null && rPLStyleProps2 == null)
                 {
                     return;
                 }
                 pageLayout.Style = new RPLElementStyle(rPLStyleProps2, rPLStyleProps);
             }
         }
     }
 }
コード例 #22
0
 public BorderInfo(RPLStyleProps style, bool omitBorderTop, bool omitBorderBottom, IExcelGenerator excel)
 {
     this.m_omitBorderTop    = omitBorderTop;
     this.m_omitBorderBottom = omitBorderBottom;
     BorderInfo.FillAllBorders(style, ref this.m_leftBorder, ref this.m_rightBorder, ref this.m_topBorder, ref this.m_bottomBorder, ref this.m_backgroundColor, excel);
 }
コード例 #23
0
 internal BorderInfo(RPLStyleProps style, bool omitBorderTop, bool omitBorderBottom, IExcelGenerator excel)
 {
     m_omitBorderTop    = omitBorderTop;
     m_omitBorderBottom = omitBorderBottom;
     FillAllBorders(style, ref m_leftBorder, ref m_rightBorder, ref m_topBorder, ref m_bottomBorder, ref m_backgroundColor, excel);
 }
コード例 #24
0
 public override void WriteItemSharedStyleProps(RPLStyleProps styleProps, Style style, PageContext pageContext)
 {
     base.WriteStyleProp(style, styleProps, StyleAttributeNames.BackgroundColor, 34);
 }
コード例 #25
0
        public void WriteElementProps(RPLParagraphProps elemProps, PageContext pageContext)
        {
            Hashtable            itemPropsStart       = pageContext.ItemPropsStart;
            RPLParagraphPropsDef rPLParagraphPropsDef = pageContext.Common.GetFromCache <RPLParagraphPropsDef>(this.m_source.ID, out itemPropsStart);

            if (rPLParagraphPropsDef == null)
            {
                rPLParagraphPropsDef             = new RPLParagraphPropsDef();
                rPLParagraphPropsDef.SharedStyle = new RPLStyleProps();
                this.WriteSharedStyles(new StyleWriterOM(rPLParagraphPropsDef.SharedStyle), this.m_source.Style);
                if (this.m_source.ListLevel != null && !this.m_source.ListLevel.IsExpression)
                {
                    rPLParagraphPropsDef.ListLevel = this.m_source.ListLevel.Value;
                }
                if (this.m_source.ListStyle != null && !this.m_source.ListStyle.IsExpression)
                {
                    rPLParagraphPropsDef.ListStyle = (RPLFormat.ListStyles)StyleEnumConverter.Translate(this.m_source.ListStyle.Value);
                }
                if (this.m_source.LeftIndent != null && !this.m_source.LeftIndent.IsExpression)
                {
                    rPLParagraphPropsDef.LeftIndent = new RPLReportSize(this.m_source.LeftIndent.Value.ToString());
                }
                if (this.m_source.RightIndent != null && !this.m_source.RightIndent.IsExpression)
                {
                    rPLParagraphPropsDef.RightIndent = new RPLReportSize(this.m_source.RightIndent.Value.ToString());
                }
                if (this.m_source.HangingIndent != null && !this.m_source.HangingIndent.IsExpression)
                {
                    rPLParagraphPropsDef.HangingIndent = new RPLReportSize(this.m_source.HangingIndent.Value.ToString());
                }
                if (this.m_source.SpaceBefore != null && !this.m_source.SpaceBefore.IsExpression)
                {
                    rPLParagraphPropsDef.SpaceBefore = new RPLReportSize(this.m_source.SpaceBefore.Value.ToString());
                }
                if (this.m_source.SpaceAfter != null && !this.m_source.SpaceAfter.IsExpression)
                {
                    rPLParagraphPropsDef.SpaceAfter = new RPLReportSize(this.m_source.SpaceAfter.Value.ToString());
                }
                rPLParagraphPropsDef.ID          = this.m_source.ID;
                itemPropsStart[this.m_source.ID] = rPLParagraphPropsDef;
            }
            elemProps.Definition = rPLParagraphPropsDef;
            if (this.m_leftIndent != null)
            {
                elemProps.LeftIndent = new RPLReportSize(this.m_leftIndent.ToString());
            }
            if (this.m_rightIndent != null)
            {
                elemProps.RightIndent = new RPLReportSize(this.m_rightIndent.ToString());
            }
            if (this.m_hangingIndent != null)
            {
                elemProps.HangingIndent = new RPLReportSize(this.m_hangingIndent.ToString());
            }
            if (this.m_listStyle.HasValue)
            {
                elemProps.ListStyle = this.m_listStyle.Value;
            }
            if (this.m_listLevel.HasValue)
            {
                elemProps.ListLevel = this.m_listLevel.Value;
            }
            if (this.m_spaceBefore != null)
            {
                elemProps.SpaceBefore = new RPLReportSize(this.m_spaceBefore.ToString());
            }
            if (this.m_spaceAfter != null)
            {
                elemProps.SpaceAfter = new RPLReportSize(this.m_spaceAfter.ToString());
            }
            elemProps.ParagraphNumber = this.m_paragraphNumber;
            elemProps.FirstLine       = this.m_firstLine;
            elemProps.UniqueName      = this.m_uniqueName;
            RPLStyleProps rPLStyleProps = null;

            if (this.m_styles != null)
            {
                rPLStyleProps = new RPLStyleProps();
                StyleWriter styleWriter = new StyleWriterOM(rPLStyleProps);
                styleWriter.WriteAll(this.m_styles);
            }
            elemProps.NonSharedStyle = rPLStyleProps;
        }
コード例 #26
0
 internal override void WriteItemSharedStyleProps(RPLStyleProps rplStyleProps, Style style, PageContext pageContext)
 {
     WriteStyleProp(style, rplStyleProps, StyleAttributeNames.BackgroundColor, 34);
     WriteBackgroundImage(rplStyleProps, style, writeShared: true, pageContext);
 }
コード例 #27
0
 internal override void WriteBorderProps(RPLStyleProps rplStyleProps, Style style)
 {
 }
コード例 #28
0
 internal override void WriteBackgroundImage(RPLStyleProps rplStyleProps, Style style, bool writeShared, PageContext pageContext)
 {
 }
コード例 #29
0
 public override void WriteBorderProps(RPLStyleProps rplStyleProps, Style style)
 {
 }
コード例 #30
0
 internal override void WriteItemSharedStyleProps(RPLStyleProps rplStyleProps, Style style, PageContext pageContext)
 {
     WriteStyleProp(style, rplStyleProps, StyleAttributeNames.TextAlign, 25);
     WriteStyleProp(style, rplStyleProps, StyleAttributeNames.LineHeight, 28);
 }