Subversion Repositories DevTools

Rev

Rev 2098 | Rev 2102 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2098 Rev 2100
Line 666... Line 666...
666
         char seperator = ',';
666
         char seperator = ',';
667
         string tableTitle = "";
667
         string tableTitle = "";
668
         bool gotSeperator = false;
668
         bool gotSeperator = false;
669
         bool gotTitle = false;
669
         bool gotTitle = false;
670
        
670
        
-
 
671
         ArrayList colWidths = new ArrayList();
-
 
672
         int indent = 0;
-
 
673
 
671
         // Scan the notes content line by line looking for table parameters and counting
674
         // Scan the notes content line by line looking for table parameters and counting
672
         // the number of table rows (which is not specified as an explicit table parameter).
675
         // the number of table rows (which is not specified as an explicit table parameter).
673
         int s_ElementsConsumedByTableParams = 0;
676
         int s_ElementsConsumedByTableParams = 0;
674
         foreach(string s in EA_DocGenTable)
677
         foreach(string s in EA_DocGenTable)
675
         {
678
         {
Line 695... Line 698...
695
                  {
698
                  {
696
                     MessageBox.Show( "Table Element Serialisation Failed - bad column count" );
699
                     MessageBox.Show( "Table Element Serialisation Failed - bad column count" );
697
                     break;
700
                     break;
698
                  }
701
                  }
699
               }
702
               }
-
 
703
 
700
               else if (gotSeperator == false && s.StartsWith("seperator"))
704
               else if (gotSeperator == false && s.StartsWith("seperator"))
701
               {
705
               {
702
                  s_ElementsConsumedByTableParams++;
706
                  s_ElementsConsumedByTableParams++;
703
                  seperator = EA_Utils.options.getOptionValue(s, seperator);
707
                  seperator = EA_Utils.options.getOptionValue(s, seperator);
704
                  gotSeperator = true;
708
                  gotSeperator = true;
705
               }
709
               }
-
 
710
 
-
 
711
               else if (s.StartsWith("widths"))
-
 
712
               {
-
 
713
                  s_ElementsConsumedByTableParams++;
-
 
714
                  string optValStr = EA_Utils.options.getOptionValue(s, "");
-
 
715
 
-
 
716
                  string width_delimStr = ",";
-
 
717
                  char [] width_delim = width_delimStr.ToCharArray();
-
 
718
 
-
 
719
                  string [] width_strings = optValStr.Split(width_delim, 50);
-
 
720
 
-
 
721
                  foreach (string ws in width_strings)
-
 
722
                  {
-
 
723
                     if (ws.Length > 0 && ws != "\n" && ws != "\r" )
-
 
724
                     {
-
 
725
                        colWidths.Add( System.Convert.ToDouble(ws) );
-
 
726
                     }
-
 
727
                  }
-
 
728
               }
-
 
729
               else if (s.StartsWith("indent"))
-
 
730
               {
-
 
731
                  s_ElementsConsumedByTableParams++;
-
 
732
                  indent = EA_Utils.options.getOptionValue(s, 0);
-
 
733
               }
706
               else
734
               else
707
               {
735
               {
708
                  rowCount++;
736
                  rowCount++;
709
               }
737
               }
710
            }
738
            }
Line 721... Line 749...
721
               // create the table in the word doc
749
               // create the table in the word doc
722
               int tableNum = TableUtils.Table_Create( tableTitle, rowCount, columnCount );
750
               int tableNum = TableUtils.Table_Create( tableTitle, rowCount, columnCount );
723
               Word.Table table = WordDocument.Tables[tableNum];
751
               Word.Table table = WordDocument.Tables[tableNum];
724
               object center = Word.WdParagraphAlignment.wdAlignParagraphCenter;
752
               object center = Word.WdParagraphAlignment.wdAlignParagraphCenter;
725
 
753
 
-
 
754
               int col = 1;
-
 
755
               foreach (double d in colWidths)
-
 
756
               {
-
 
757
                  if (col <= columnCount)
-
 
758
                     table.Columns[col].SetWidth( WordApp.CentimetersToPoints((float)d), Word.WdRulerStyle.wdAdjustNone );
-
 
759
                  col++;
-
 
760
               }
-
 
761
 
-
 
762
               if (indent > 0)
-
 
763
               {
-
 
764
                  table.Select();
-
 
765
                  while (indent > 0)
-
 
766
                  {
-
 
767
                     WordApp.Selection.Paragraphs.Indent();
-
 
768
                     indent--;
-
 
769
                  }
-
 
770
               }
-
 
771
 
726
               // scan the element notes again to extract the cell content and add it to the
772
               // scan the element notes again to extract the cell content and add it to the
727
               // table we just created.
773
               // table we just created.
728
               int row = 1;
774
               int row = 1;
729
               int col = 1;
775
               col = 0;
730
               foreach(string s in EA_DocGenTable)
776
               foreach(string s in EA_DocGenTable)
731
               {
777
               {
732
                  if (s.Length > 0 && s != "\n" && s != "\r" )
778
                  if (s.Length > 0 && s != "\n" && s != "\r" )
733
                  {
779
                  {
734
                     if (s_ElementsConsumedByTableParams > 0)
780
                     if (s_ElementsConsumedByTableParams > 0)