Ignore:
Timestamp:
05/16/08 11:17:55 (16 years ago)
Author:
ra33
Message:

Items that are completely off the screen to the left or above are no longer saved in the file

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/expeditee/agents/Format.java

    r48 r58  
    1010import org.expeditee.gui.FrameUtils;
    1111import org.expeditee.items.Item;
     12import org.expeditee.items.Text;
    1213
    1314/**
     
    3839                        e.printStackTrace();
    3940                }
    40 
    4141        }
    4242
     
    4646
    4747                ArrayList<ArrayList<Item>> columns = new ArrayList<ArrayList<Item>>();
    48                 for (int j = 0; j < start.getItems().size(); j++) {
    49                         Item i = start.getItems().get(j);
    5048
    51                         if (j > 0 && start.isNormalTextItem(i)) {
    52                                 int col = findColumn(columnHeads, i);
    53                                 // if this is the head of a new column
    54                                 if (col < 0) {
    55                                         columnHeads.add(i);
    56                                         columns.add(new ArrayList<Item>());
    57                                         // otherwise the column for this item has already been
    58                                         // found set the column to be the one we just added...
    59                                         col = columns.size() - 1;
    60                                 } else
    61                                         columns.get(col).add(i);
    62                         }
     49                for (Text t : start.getBodyTextItems(true)) {
     50                        int col = findColumn(columnHeads, t);
     51                        // if this is the head of a new column
     52                        if (col < 0) {
     53                                columnHeads.add(t);
     54                                columns.add(new ArrayList<Item>());
     55                                // otherwise the column for this item has already been
     56                                // found set the column to be the one we just added...
     57                                col = columns.size() - 1;
     58                        } else
     59                                columns.get(col).add(t);
    6360                }
    6461
     
    165162        @Override
    166163        protected void finalise(Frame start) {
    167                  if(_success) overwriteMessage("Formating complete.");
     164                if (_success)
     165                        overwriteMessage("Formating complete.");
    168166        }
    169167
Note: See TracChangeset for help on using the changeset viewer.