예제 #1
0
        internal override void Process(DocxNode node, ref Paragraph paragraph, Dictionary <string, object> properties)
        {
            if (node.IsNull() || node.Parent == null || IsHidden(node))
            {
                return;
            }

            paragraph = null;

            Paragraph hrParagraph = node.Parent.AppendChild(new Paragraph());

            OnParagraphCreated(node, hrParagraph);

            if (hrParagraph.ParagraphProperties == null)
            {
                hrParagraph.ParagraphProperties = new ParagraphProperties();
            }

            ParagraphBorders paragraphBorders = new ParagraphBorders();

            DocxBorder.ApplyDefaultBorder <TopBorder>(paragraphBorders);
            hrParagraph.ParagraphProperties.Append(paragraphBorders);

            Run run = hrParagraph.AppendChild(new Run(new Text()));

            RunCreated(node, run);
        }
예제 #2
0
        internal override void Process(DocxNode node, ref Paragraph paragraph)
        {
            if (node.IsNull() || node.Parent == null || !CanConvert(node) || IsHidden(node))
            {
                return;
            }

            paragraph = null;

            if (node.HasChildren)
            {
                Table table = new Table();
                DocxTableProperties tableProperties = new DocxTableProperties();

                tableProperties.FetchTableProperties(node);
                tableProperties.ApplyTableProperties(table, node);

                foreach (DocxNode child in node.Children)
                {
                    if (string.Compare(child.Tag, DocxTableProperties.trName, StringComparison.InvariantCultureIgnoreCase) == 0)
                    {
                        node.CopyExtentedStyles(child);
                        ProcessTr(child, table, tableProperties);
                    }
                    else if (tableProperties.IsGroupElement(child.Tag))
                    {
                        node.CopyExtentedStyles(child);
                        ProcessGroupElement(child, table, tableProperties);
                    }
                }

                node.Parent.Append(table);
            }
        }
예제 #3
0
        internal override void Process(DocxNode node, ref Paragraph paragraph, Dictionary <string, object> properties)
        {
            if (node.IsNull() || !CanConvert(node) || IsHidden(node))
            {
                return;
            }

            paragraph = null;
            int levelIndex = properties.ContainsKey(levelIndexName) ? Convert.ToInt32(properties[levelIndexName]) : 0;

            if (node.HasChildren)
            {
                short numberId = gNumberId = ++context.ListNumberId;

                InitNumberDefinitions(levelIndex);

                var newProperties = properties.ToDictionary(x => x.Key, x => x.Value);
                newProperties[levelIndexName] = levelIndex + 1;

                foreach (DocxNode child in node.Children)
                {
                    //Dirty hack to maintain the level since these elements are singleton. When it traverse to inner html elements, the level will increment
                    //then, when it goes back to more root elements, we have to reset the level to its previous state.
                    gLevelIndex = levelIndex;
                    gNumberId   = numberId;

                    if (string.Compare(child.Tag, liName, StringComparison.InvariantCultureIgnoreCase) == 0)
                    {
                        node.CopyExtentedStyles(child);
                        ProcessLi(child, node.Parent, newProperties);
                    }
                }
            }
        }
예제 #4
0
        private void ProcessChild(DocxNode node)
        {
            if (node.IsNull())
            {
                return;
            }

            Paragraph paragraph = node.Parent.AppendChild(new Paragraph());
            OnParagraphCreated(node, paragraph);

            foreach (DocxNode child in node.Children)
            {
                if (child.IsText && !IsEmptyText(child.InnerHtml))
                {
                    Run run = paragraph.AppendChild(new Run(new Text()
                    {
                        Text = ClearHtml(child.InnerHtml),
                        Space = SpaceProcessingModeValues.Preserve
                    }));

                    RunCreated(node, run);
                }
                else
                {
                    child.ParagraphNode = node;
                    child.Parent = node.Parent;
                    node.CopyExtentedStyles(child);
                    ProcessChild(child, ref paragraph);
                }
            }
        }
예제 #5
0
        private void ProcessChild(DocxNode node, Dictionary <string, object> properties)
        {
            if (node.IsNull())
            {
                return;
            }

            Paragraph paragraph = node.Parent.AppendChild(new Paragraph());

            OnParagraphCreated(node, paragraph);

            foreach (DocxNode child in node.Children)
            {
                if (child.IsText && !IsEmptyText(child.InnerHtml))
                {
                    Run run = paragraph.AppendChild(new Run(new Text()
                    {
                        Text  = ClearHtml(child.InnerHtml),
                        Space = SpaceProcessingModeValues.Preserve
                    }));

                    RunCreated(node, run);
                }
                else
                {
                    child.ParagraphNode = node;
                    child.Parent        = node.Parent;
                    node.CopyExtentedStyles(child);
                    ProcessChild(child, ref paragraph, properties);
                }
            }
        }
예제 #6
0
        internal override void Process(DocxNode node, ref Paragraph paragraph)
        {
            if (node.IsNull() || !CanConvert(node) || IsHidden(node))
            {
                return;
            }

            paragraph = null;

            if (node.HasChildren)
            {
                numberFormat = GetNumberFormat(node);

                InitNumberDefinitions(numberFormat);

                foreach (DocxNode child in node.Children)
                {
                    if (string.Compare(child.Tag, liName, StringComparison.InvariantCultureIgnoreCase) == 0)
                    {
                        node.CopyExtentedStyles(child);
                        ProcessLi(child, node.Parent, numberFormat);
                    }
                }
            }
        }
예제 #7
0
        internal override void Process(DocxNode node, ref Paragraph paragraph)
        {
            if (node.IsNull() || node.Parent == null || IsHidden(node))
            {
                return;
            }

            ProcessElement(node, ref paragraph);
        }
예제 #8
0
        internal override void Process(DocxNode node, ref Paragraph paragraph)
        {
            if (node.IsNull() || node.Parent == null || IsHidden(node))
            {
                return;
            }

            ProcessElement(node, ref paragraph);
        }
예제 #9
0
        internal override void Process(DocxNode node, ref Paragraph paragraph, Dictionary <string, object> properties)
        {
            if (node.IsNull() || node.Parent == null || IsHidden(node))
            {
                return;
            }

            ProcessElement(node, ref paragraph, properties);
        }
예제 #10
0
        internal void CopyExtentedStyles(DocxNode toNode)
        {
            if (toNode.IsNull())
            {
                return;
            }

            toNode.SetExtentedStyles(this.extentedStyles);
        }
예제 #11
0
        internal override void Process(DocxNode node, ref Paragraph paragraph)
        {
            if (node.IsNull() || IsHidden(node))
            {
                return;
            }

            string link = node.ExtractAttributeValue(href);

            link = CleanUrl(link);

            if (Uri.IsWellFormedUriString(link, UriKind.Absolute))
            {
                Uri uri = new Uri(link);

                var relationship = context.MainDocumentPart.AddHyperlinkRelationship(uri, uri.IsAbsoluteUri);

                var hyperLink = new Hyperlink()
                {
                    History = true, Id = relationship.Id
                };

                foreach (DocxNode child in node.Children)
                {
                    if (child.IsText)
                    {
                        if (!IsEmptyText(child.InnerHtml))
                        {
                            Run run = hyperLink.AppendChild <Run>(new Run(new Text()
                            {
                                Text  = ClearHtml(child.InnerHtml),
                                Space = SpaceProcessingModeValues.Preserve
                            }));

                            run.RunProperties = new RunProperties((new RunStyle()
                            {
                                Val = "Hyperlink"
                            }));
                            RunCreated(node, run);
                        }
                    }
                    else
                    {
                        child.Parent = hyperLink;
                        node.CopyExtentedStyles(child);
                        ProcessTextElement(child);
                    }
                }

                CreateParagraph(node, ref paragraph);
                paragraph.Append(hyperLink);
            }
            else
            {
                ProcessNonLinkText(node, ref paragraph);
            }
        }
예제 #12
0
        internal override void Process(DocxNode node, ref Paragraph paragraph, Dictionary <string, object> properties)
        {
            if (node.IsNull() || IsHidden(node))
            {
                return;
            }

            node.SetExtentedStyle(DocxFontStyle.fontWeight, DocxFontStyle.bold);

            ProcessElement(node, ref paragraph, properties);
        }
예제 #13
0
        internal override void Process(DocxNode node, ref Paragraph paragraph, Dictionary <string, object> properties)
        {
            if (node.IsNull() || IsHidden(node))
            {
                return;
            }

            node.SetExtentedStyle(DocxAlignment.verticalAlign, DocxAlignment.super);

            ProcessElement(node, ref paragraph, properties);
        }
예제 #14
0
        internal override void Process(DocxNode node, ref Paragraph paragraph)
        {
            if (node.IsNull() || IsHidden(node))
            {
                return;
            }

            SetStyle(node);

            ProcessElement(node, ref paragraph);
        }
예제 #15
0
        internal override void Process(DocxNode node, ref Paragraph paragraph)
        {
            if (node.IsNull() || IsHidden(node))
            {
                return;
            }

            node.SetExtentedStyle(DocxFontStyle.fontWeight, DocxFontStyle.bold);

            ProcessElement(node, ref paragraph);
        }
예제 #16
0
        internal override void Process(DocxNode node, ref Paragraph paragraph)
        {
            if (node.IsNull() || IsHidden(node))
            {
                return;
            }

            SetStyle(node);

            ProcessElement(node, ref paragraph);
        }
예제 #17
0
        internal override void Process(DocxNode node, ref Paragraph paragraph, Dictionary <string, object> properties)
        {
            if (node.IsNull() || IsHidden(node))
            {
                return;
            }

            node.SetExtentedStyle(DocxFontStyle.textDecoration, DocxFontStyle.lineThrough);

            ProcessElement(node, ref paragraph, properties);
        }
예제 #18
0
        internal override void Process(DocxNode node, ref Paragraph paragraph)
        {
            if (node.IsNull() || IsHidden(node))
            {
                return;
            }

            node.SetExtentedStyle(DocxFontStyle.fontWeight, DocxFontStyle.bold);

            ProcessElement(node, ref paragraph);
        }
예제 #19
0
        internal override void Process(DocxNode node, ref Paragraph paragraph)
        {
            if (node.IsNull() || IsHidden(node))
            {
                return;
            }

            node.SetExtentedStyle(DocxFontStyle.textDecoration, DocxFontStyle.lineThrough);

            ProcessElement(node, ref paragraph);
        }
예제 #20
0
        internal override void Process(DocxNode node, ref Paragraph paragraph)
        {
            if (node.IsNull() || IsHidden(node))
            {
                return;
            }
            
            node.SetExtentedStyle(DocxFontStyle.textDecoration, DocxFontStyle.underLine);

            ProcessElement(node, ref paragraph);
        }
예제 #21
0
        internal override void Process(DocxNode node, ref Paragraph paragraph)
        {
            if (node.IsNull() || IsHidden(node))
            {
                return;
            }

            node.SetExtentedStyle(DocxAlignment.verticalAlign, DocxAlignment.sub);

            ProcessElement(node, ref paragraph);
        }
예제 #22
0
        internal override void Process(DocxNode node, ref Paragraph paragraph)
        {
            if (node.IsNull() || IsHidden(node))
            {
                return;
            }

            node.SetExtentedStyle(DocxAlignment.verticalAlign, DocxAlignment.sub);

            ProcessElement(node, ref paragraph);
        }
예제 #23
0
        internal override void Process(DocxNode node, ref Paragraph paragraph)
        {
            if (node.IsNull() || node.Parent == null || IsHidden(node))
            {
                return;
            }

            paragraph = null;
            Paragraph headerParagraph = null;

            ProcessBlockElement(node, ref headerParagraph);
        }
예제 #24
0
        internal override void Process(DocxNode node, ref Paragraph paragraph)
        {
            if (node.IsNull() || node.Parent == null || IsHidden(node))
            {
                return;
            }

            paragraph = null;
            Paragraph headerParagraph = null;

            ProcessBlockElement(node, ref headerParagraph);
        }
예제 #25
0
        internal override void Process(DocxNode node, ref Paragraph paragraph)
        {
            if (node.IsNull() || node.Parent == null || IsHidden(node))
            {
                return;
            }

            //Div creates it's own new paragraph. So old paragraph ends here and creats another one after this div 
            //if there any text!
            paragraph = null;
            Paragraph divParagraph = null;

            ProcessBlockElement(node, ref divParagraph);
        }
예제 #26
0
        internal override void Process(DocxNode node, ref Paragraph paragraph)
        {
            if (node.IsNull() || node.Parent == null || IsHidden(node))
            {
                return;
            }

            //Div creates it's own new paragraph. So old paragraph ends here and creats another one after this div
            //if there any text!
            paragraph = null;
            Paragraph divParagraph = null;

            ProcessBlockElement(node, ref divParagraph);
        }
예제 #27
0
        internal override void Process(DocxNode node, ref Paragraph paragraph, Dictionary <string, object> properties)
        {
            if (node.IsNull() || node.Parent == null || IsHidden(node))
            {
                return;
            }

            paragraph = null;
            Paragraph headerParagraph = null;

            ApplyStyle(node);

            ProcessBlockElement(node, ref headerParagraph, properties);
        }
예제 #28
0
        internal override void Process(DocxNode node, ref Paragraph paragraph)
        {
            if (!node.IsNull() && node.Parent != null || IsHidden(node))
            {
                if (paragraph == null)
                {
                    paragraph = node.Parent.AppendChild(new Paragraph());
                    OnParagraphCreated(node.ParagraphNode, paragraph);
                }

                Run run = paragraph.AppendChild(new Run(new Break()));
                RunCreated(node, run);
            }
        }
예제 #29
0
        internal override void Process(DocxNode node, ref Paragraph paragraph)
		{
            if (!node.IsNull() && node.Parent != null || IsHidden(node))
			{
				if (paragraph == null)
				{
                    paragraph = node.Parent.AppendChild(new Paragraph());
                    OnParagraphCreated(node.ParagraphNode, paragraph);
				}
				
				Run run = paragraph.AppendChild(new Run(new Break()));
                RunCreated(node, run);
			}
		}
예제 #30
0
        internal override void Process(DocxNode node, ref Paragraph paragraph)
        {
            if (node.IsNull() || node.Parent == null || IsHidden(node))
            {
                return;
            }

            //Address tag also creats a new block element. Thus clear the existing paragraph
            paragraph = null;
            Paragraph addrParagraph = null;
            node.SetExtentedStyle(DocxFontStyle.fontStyle, DocxFontStyle.italic);

            ProcessBlockElement(node, ref addrParagraph);
        }
예제 #31
0
        internal override void Process(DocxNode node, ref Paragraph paragraph)
        {
            if (node.IsNull() || node.Parent == null || IsHidden(node))
            {
                return;
            }

            paragraph = null;
            Paragraph centerParagraph = null;
            node.SetExtentedStyle(DocxAlignment.textAlign, DocxAlignment.center);

            node.SetExtentedStyle(DocxAlignment.textAlign, DocxAlignment.center);

            ProcessBlockElement(node, ref centerParagraph);
        }
예제 #32
0
        internal override void Process(DocxNode node, ref Paragraph paragraph)
        {
            if (node.IsNull() || node.Parent == null || IsHidden(node))
            {
                return;
            }

            //Address tag also creats a new block element. Thus clear the existing paragraph
            paragraph = null;
            Paragraph addrParagraph = null;

            node.SetExtentedStyle(DocxFontStyle.fontStyle, DocxFontStyle.italic);

            ProcessBlockElement(node, ref addrParagraph);
        }
예제 #33
0
        internal override void Process(DocxNode node, ref Paragraph paragraph, Dictionary <string, object> properties)
        {
            if (node.IsNull() || node.Parent == null || IsHidden(node))
            {
                return;
            }

            paragraph = null;
            Paragraph centerParagraph = null;

            node.SetExtentedStyle(DocxAlignment.textAlign, DocxAlignment.center);

            node.SetExtentedStyle(DocxAlignment.textAlign, DocxAlignment.center);

            ProcessBlockElement(node, ref centerParagraph, properties);
        }
예제 #34
0
        internal override void Process(DocxNode node, ref Paragraph paragraph)
        {
            if (node.IsNull() || node.Parent == null || IsHidden(node))
            {
                return;
            }

            paragraph = null;
            Paragraph centerParagraph = null;

            node.SetExtentedStyle(DocxAlignment.textAlign, DocxAlignment.center);

            node.SetExtentedStyle(DocxAlignment.textAlign, DocxAlignment.center);

            ProcessBlockElement(node, ref centerParagraph);
        }
예제 #35
0
        internal override void Process(DocxNode node, ref Paragraph paragraph)
        {
            if (node.IsNull() || node.Parent == null || IsHidden(node))
            {
                return;
            }

            foreach (DocxNode child in node.Children)
            {
                if (child.IsText)
                {
                    if (!IsEmptyText(child.InnerHtml))
                    {
                        ApplyOpenQuoteIfEmpty(node, ref paragraph);

                        Run run = paragraph.AppendChild(new Run(new Text()
                        {
                            Text  = ClearHtml(child.InnerHtml),
                            Space = SpaceProcessingModeValues.Preserve
                        }));

                        RunCreated(node, run);
                    }
                }
                else
                {
                    child.ParagraphNode = node.ParagraphNode;
                    child.Parent        = node.Parent;
                    node.CopyExtentedStyles(child);
                    ApplyOpenQuoteIfEmpty(node, ref paragraph);
                    ProcessChild(child, ref paragraph);
                }
            }

            if (paragraph != null && hasOpenQuote)
            {
                paragraph.AppendChild(new Run(new Text()
                {
                    Text = "\""
                }));
            }
        }
예제 #36
0
        internal override void Process(DocxNode node, ref Paragraph paragraph, Dictionary <string, object> properties)
        {
            if (node.IsNull() || !CanConvert(node) || IsHidden(node))
            {
                return;
            }

            paragraph = null;
            int levelIndex = properties.ContainsKey(levelIndexName) ? Convert.ToInt32(properties[levelIndexName]) : 0;

            if (abstractNum == null)
            {
                InitNumberDefinitions();
            }

            if (node.HasChildren)
            {
                NumberFormatValues numberFormat = GetNumberFormat(node);

                int levelId = gLevelId = gNextLevelId++;

                DefineLevel(numberFormat, levelIndex);

                var newProperties = properties.ToDictionary(x => x.Key, x => x.Value);
                newProperties[levelIndexName] = levelIndex + 1;

                foreach (DocxNode child in node.Children)
                {
                    gLevelIndex = levelIndex;
                    gLevelId    = levelId;

                    if (string.Compare(child.Tag, liName, StringComparison.InvariantCultureIgnoreCase) == 0)
                    {
                        node.CopyExtentedStyles(child);
                        ProcessLi(child, node.Parent, newProperties);
                    }
                }
            }
        }
예제 #37
0
        internal override void Process(DocxNode node, ref Paragraph paragraph)
        {
            if (node.IsNull() || node.Parent == null || IsHidden(node))
            {
                return;
            }

            foreach (DocxNode child in node.Children)
            {
                if (child.IsText)
                {
                    if (!IsEmptyText(child.InnerHtml))
                    {
                        ApplyOpenQuoteIfEmpty(node, ref paragraph);

                        Run run = paragraph.AppendChild(new Run(new Text()
                        {
                            Text = ClearHtml(child.InnerHtml),
                            Space = SpaceProcessingModeValues.Preserve
                        }));

                        RunCreated(node, run);
                    }
                }
                else
                {
                    child.ParagraphNode = node.ParagraphNode;
                    child.Parent = node.Parent;
                    node.CopyExtentedStyles(child);
                    ApplyOpenQuoteIfEmpty(node, ref paragraph);
                    ProcessChild(child, ref paragraph);
                }
            }

            if (paragraph != null && hasOpenQuote)
            {
                paragraph.AppendChild(new Run(new Text() { Text = "\"" }));
            }
        }
예제 #38
0
        internal override void Process(DocxNode node, ref Paragraph paragraph)
        {
            if (node.IsNull() || node.Parent == null || !CanConvert(node) || IsHidden(node))
            {
                return;
            }

            if (!node.HasChildren)
            {
                return;
            }

            paragraph = null;

            //Add an empty paragraph to set default margin top
            SetMarginTop(node.Parent);

            foreach (DocxNode child in node.Children)
            {
                if (string.Compare(child.Tag, "dt", StringComparison.InvariantCultureIgnoreCase) == 0)
                {
                    child.Parent = node.Parent;
                    node.CopyExtentedStyles(child);
                    ProcessChild(child);
                }
                else if (string.Compare(child.Tag, "dd", StringComparison.InvariantCultureIgnoreCase) == 0)
                {
                    node.CopyExtentedStyles(child);
                    SetDDProperties(child);
                    child.Parent = node.Parent;
                    ProcessChild(child);
                }
            }

            //Add an empty paragraph at the end to set default margin bottom
            SetMarginBottom(node.Parent);
        }
예제 #39
0
        internal override void Process(DocxNode node, ref Paragraph paragraph, Dictionary <string, object> properties)
        {
            if (node.IsNull() || node.Parent == null || !CanConvert(node) || IsHidden(node))
            {
                return;
            }

            if (!node.HasChildren)
            {
                return;
            }

            paragraph = null;

            //Add an empty paragraph to set default margin top
            SetMarginTop(node.Parent);

            foreach (DocxNode child in node.Children)
            {
                if (string.Compare(child.Tag, "dt", StringComparison.InvariantCultureIgnoreCase) == 0)
                {
                    child.Parent = node.Parent;
                    node.CopyExtentedStyles(child);
                    ProcessChild(child, properties);
                }
                else if (string.Compare(child.Tag, "dd", StringComparison.InvariantCultureIgnoreCase) == 0)
                {
                    node.CopyExtentedStyles(child);
                    SetDDProperties(child);
                    child.Parent = node.Parent;
                    ProcessChild(child, properties);
                }
            }

            //Add an empty paragraph at the end to set default margin bottom
            SetMarginBottom(node.Parent);
        }
예제 #40
0
        internal override void Process(DocxNode node, ref Paragraph paragraph)
		{
            if (node.IsNull() || node.Parent == null || IsHidden(node))
			{
				return;
			}
			
			paragraph = null;

            Paragraph hrParagraph = node.Parent.AppendChild(new Paragraph());
            OnParagraphCreated(node, hrParagraph);
				
			if (hrParagraph.ParagraphProperties == null)
			{
				hrParagraph.ParagraphProperties = new ParagraphProperties();
			}
				
			ParagraphBorders paragraphBorders = new ParagraphBorders();
			DocxBorder.ApplyDefaultBorder<TopBorder>(paragraphBorders);
			hrParagraph.ParagraphProperties.Append(paragraphBorders);
				
			Run run = hrParagraph.AppendChild(new Run(new Text()));
            RunCreated(node, run);
		}
예제 #41
0
        internal void CopyExtentedStyles(DocxNode toNode)
        {
            if (toNode.IsNull())
            {
                return;
            }

            toNode.SetExtentedStyles(this.extentedStyles);
        }
예제 #42
0
        internal override void Process(DocxNode node, ref Paragraph paragraph)
        {
            if (node.IsNull() || IsHidden(node))
            {
                return;
            }

            string link = node.ExtractAttributeValue(href);

            link = CleanUrl(link);

            if (Uri.IsWellFormedUriString(link, UriKind.Absolute))
            {
                Uri uri = new Uri(link);

                var relationship = context.MainDocumentPart.AddHyperlinkRelationship(uri, uri.IsAbsoluteUri);

                var hyperLink = new Hyperlink() { History = true, Id = relationship.Id };

                foreach (DocxNode child in node.Children)
                {
                    if (child.IsText)
                    {
                        if (!IsEmptyText(child.InnerHtml))
                        {
                            Run run = hyperLink.AppendChild<Run>(new Run(new Text()
                             {
                                 Text = ClearHtml(child.InnerHtml),
                                 Space = SpaceProcessingModeValues.Preserve
                             }));

                            run.RunProperties = new RunProperties((new RunStyle() { Val = "Hyperlink" }));
                            RunCreated(node, run);
                        }
                    }
                    else
                    {
                        child.Parent = hyperLink;
                        node.CopyExtentedStyles(child);
                        ProcessTextElement(child);
                    }
                }

                CreateParagraph(node, ref paragraph);
                paragraph.Append(hyperLink);
            }
            else
            {
                ProcessNonLinkText(node, ref paragraph);
            }
        }
예제 #43
0
        internal override void Process(DocxNode node, ref Paragraph paragraph)
        {
            if (node.IsNull() || !CanConvert(node) || IsHidden(node))
            {
                return;
            }

            paragraph = null;

            if (node.HasChildren)
            {
                numberFormat = GetNumberFormat(node);

                InitNumberDefinitions(numberFormat);

                foreach (DocxNode child in node.Children)
                {
                    if (string.Compare(child.Tag, liName, StringComparison.InvariantCultureIgnoreCase) == 0)
                    {
                        node.CopyExtentedStyles(child);
                        ProcessLi(child, node.Parent, numberFormat);
                    }
                }
            }
        }
예제 #44
0
        internal override void Process(DocxNode node, ref Paragraph paragraph)
        {
            if (node.IsNull() || node.Parent == null || !CanConvert(node) || IsHidden(node))
            {
                return;
            }

            paragraph = null;

            if (node.HasChildren)
            {
                Table table = new Table();
                DocxTableProperties tableProperties = new DocxTableProperties();

                tableProperties.FetchTableProperties(node);
                tableProperties.ApplyTableProperties(table, node);

                foreach (DocxNode child in node.Children)
                {
                    if (string.Compare(child.Tag, DocxTableProperties.trName, StringComparison.InvariantCultureIgnoreCase) == 0)
                    {
                        node.CopyExtentedStyles(child);
                        ProcessTr(child, table, tableProperties);
                    }
                    else if (string.Compare(child.Tag, DocxTableProperties.tbody, StringComparison.InvariantCultureIgnoreCase) == 0)
                    {
                        node.CopyExtentedStyles(child);
                        ProcessTBody(child, table, tableProperties);
                    }
                }

                node.Parent.Append(table);
            }
        }