@@ -759,6 +759,47 @@ private static AncestorIndents CalculateParagraphIndentsFromAncestors(Configurab
759
759
return new AncestorIndents ( parentNode , GetLeadingIndent ( exportStyleInfo ) , GetHangingIndentIfAny ( exportStyleInfo ) ) ;
760
760
}
761
761
762
+ /// <summary>
763
+ /// Gets the indentation information for a Table.
764
+ /// </summary>
765
+ /// <param name="tableAlignment">Returns the table alignment.</param>
766
+ /// <returns>Returns the indentation value.</returns>
767
+ internal static int GetTableIndentInfo ( ReadOnlyPropertyTable propertyTable , ConfigurableDictionaryNode config , ref TableRowAlignmentValues tableAlignment )
768
+ {
769
+ var style = config . Parent ? . Style ;
770
+ var styleSheet = FontHeightAdjuster . StyleSheetFromPropertyTable ( propertyTable ) ;
771
+ if ( style == null || styleSheet == null || ! styleSheet . Styles . Contains ( style ) )
772
+ {
773
+ return 0 ;
774
+ }
775
+
776
+ var projectStyle = styleSheet . Styles [ style ] ;
777
+ var exportStyleInfo = new ExportStyleInfo ( projectStyle ) ;
778
+
779
+ // Get the indentation value.
780
+ int indentVal = 0 ;
781
+ var hangingIndent = 0.0f ;
782
+ if ( exportStyleInfo . HasFirstLineIndent )
783
+ {
784
+ var firstLineIndentValue = MilliPtToTwentiPt ( exportStyleInfo . FirstLineIndent ) ;
785
+ if ( firstLineIndentValue < 0.0f )
786
+ {
787
+ hangingIndent = firstLineIndentValue ;
788
+ }
789
+ }
790
+ if ( exportStyleInfo . HasLeadingIndent || hangingIndent < 0.0f )
791
+ {
792
+ var leadingIndent = CalculateMarginLeft ( exportStyleInfo , new AncestorIndents ( 0.0f , 0.0f ) , hangingIndent ) ;
793
+ indentVal = ( int ) leadingIndent ;
794
+ }
795
+
796
+ // Get the alignment direction.
797
+ tableAlignment = exportStyleInfo . DirectionIsRightToLeft == TriStateBool . triTrue ?
798
+ TableRowAlignmentValues . Right : TableRowAlignmentValues . Left ;
799
+
800
+ return indentVal ;
801
+ }
802
+
762
803
private static float CalculateMarginLeft ( ExportStyleInfo exportStyleInfo , AncestorIndents ancestorIndents ,
763
804
float hangingIndent )
764
805
{
@@ -958,46 +999,6 @@ private static int MilliPtToEighthPt(int millipoints)
958
999
return ( int ) Math . Round ( ( float ) millipoints / 125 , 0 ) ;
959
1000
}
960
1001
961
- /// <summary>
962
- /// Gets the indentation information for a Table.
963
- /// </summary>
964
- /// <param name="tableAlignment">Returns the table alignment.</param>
965
- /// <returns>Returns the indentation value.</returns>
966
- internal static int GetTableIndentInfo ( ReadOnlyPropertyTable propertyTable , ref TableRowAlignmentValues tableAlignment )
967
- {
968
- var styleSheet = FontHeightAdjuster . StyleSheetFromPropertyTable ( propertyTable ) ;
969
- if ( styleSheet == null || ! styleSheet . Styles . Contains ( WordStylesGenerator . DictionaryNormal ) )
970
- {
971
- return 0 ;
972
- }
973
-
974
- var projectStyle = styleSheet . Styles [ WordStylesGenerator . DictionaryNormal ] ;
975
- var exportStyleInfo = new ExportStyleInfo ( projectStyle ) ;
976
-
977
- // Get the indentation value.
978
- int indentVal = 0 ;
979
- var hangingIndent = 0.0f ;
980
- if ( exportStyleInfo . HasFirstLineIndent )
981
- {
982
- var firstLineIndentValue = MilliPtToTwentiPt ( exportStyleInfo . FirstLineIndent ) ;
983
- if ( firstLineIndentValue < 0.0f )
984
- {
985
- hangingIndent = firstLineIndentValue ;
986
- }
987
- }
988
- if ( exportStyleInfo . HasLeadingIndent || hangingIndent < 0.0f )
989
- {
990
- var leadingIndent = CalculateMarginLeft ( exportStyleInfo , new AncestorIndents ( 0.0f , 0.0f ) , hangingIndent ) ;
991
- indentVal = ( int ) leadingIndent ;
992
- }
993
-
994
- // Get the alignment direction.
995
- tableAlignment = exportStyleInfo . DirectionIsRightToLeft == TriStateBool . triTrue ?
996
- TableRowAlignmentValues . Right : TableRowAlignmentValues . Left ;
997
-
998
- return indentVal ;
999
- }
1000
-
1001
1002
private class AncestorIndents
1002
1003
{
1003
1004
public AncestorIndents ( float margin , float textIndent ) : this ( null , margin , textIndent )
0 commit comments