Example #1
0
        private bool GetParagraphChildElements(Shape shape, PPTParagraph par, bool hasText, OpenXmlElement obj)
        {
            if (obj is Run)
            {
                Run run = (Run)obj;
                hasText = true;
                PPTRunProperties runProp = new PPTRunProperties(par.defaultRunProperties);
                runProp.Text = run.Text.Text;
                runProp.SetRunProperties(run.RunProperties, shape, ref effectShapes);
                runProp.FontSize = Math.Round(fontScale * runProp.FontSize / Globals.PercentageConstant);
                par.RunPropList.Add(runProp);
            }

            else if (obj is Field)
            {
                Field run = (Field)obj;
                hasText = true;
                PPTRunProperties runProp = new PPTRunProperties(par.defaultRunProperties);
                runProp.Text = run.Text.Text;
                runProp.SetRunProperties(run.RunProperties, shape, ref effectShapes);
                runProp.FontSize = Math.Round(fontScale * runProp.FontSize / Globals.PercentageConstant);
                par.RunPropList.Add(runProp);
            }

            else if (obj is Break)
            {
                Break            aBreak  = (Break)obj;
                PPTRunProperties runProp = new PPTRunProperties(par.defaultRunProperties);
                runProp.SetRunProperties(aBreak.RunProperties, shape, ref effectShapes);
                runProp.FontSize = Math.Round(fontScale * runProp.FontSize / Globals.PercentageConstant);
                runProp.isBreak  = true;
                par.RunPropList.Add(runProp);
            }
            return(hasText);
        }