Beispiel #1
0
        private void CreateParagraphProperties()
        {
            // StyleParagraphProperties :
            // AdjustRightIndent, AutoSpaceDE, AutoSpaceDN, BiDi, ContextualSpacing, FrameProperties, Indentation, Justification, KeepLines, KeepNext, Kinsoku, MirrorIndents, NumberingProperties,
            // OutlineLevel, OverflowPunctuation, PageBreakBefore, ParagraphBorders, ParagraphPropertiesChange, Shading, SnapToGrid, SuppressAutoHyphens, SuppressLineNumbers, SuppressOverlap, TextBoxTightWrap, TextDirection,
            // TopLinePunctuation, WidowControl, WordWrap


            //StyleParagraphProperties
            BsonDocument spp = _sourceElement.zGet("StyleParagraphProperties").zAsBsonDocument();

            if (spp == null)
            {
                return;
            }

            //_paragraphProperties = new StyleParagraphProperties();
            _paragraphProperties = new OXmlStyleParagraphProperties();

            CreateSpacingBetweenLines(spp);

            BsonValue v = spp.zGet("TextAlignment");

            if (v != null)
            {
                // TextAlignment, <w:textAlignment>, Top, Center, Baseline, Bottom, Auto
                //_paragraphProperties.TextAlignment = new TextAlignment { Val = v.zAsString().zParseEnum<VerticalTextAlignmentValues>(ignoreCase: true) };
                _paragraphProperties.TextAlignment = v.zAsString().zParseEnum <VerticalTextAlignmentValues>(ignoreCase: true);
            }
            CreateTabs(spp);

            //if (_spacingBetweenLines != null)
            //{
            //    _paragraphProperties = new StyleParagraphProperties();
            //    //if (_spacingBetweenLines != null)
            //    //    _paragraphProperties.SpacingBetweenLines = _spacingBetweenLines;
            //    //if (_textAlignment != null)
            //    //    _paragraphProperties.TextAlignment = _textAlignment;
            //}
        }