Ignore:
Timestamp:
2009-11-21T15:48:35+01:00 (15 years ago)
Author:
stoecker
Message:

fix for subprojections

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/preferences/ProjectionPreference.java

    r2327 r2491  
    164164            coll = null;
    165165            Main.proj = new Mercator();
     166            name = Main.proj.getClass().getName();
    166167        }
    167168        if(!Main.proj.equals(oldProj) && b != null)
     
    171172        }
    172173        Main.pref.putCollection("projection.sub", coll);
    173         if(coll != null && projHasPrefs(Main.proj))
     174        String sname = name.substring(name.lastIndexOf(".")+1);
     175        Main.pref.putCollection("projection.sub."+sname, coll);
     176        if(projHasPrefs(Main.proj))
    174177            ((ProjectionSubPrefs) Main.proj).setPreferences(coll);
    175178    }
     
    205208        for (int i = 0; i < projectionCombo.getItemCount(); ++i) {
    206209            Projection proj = (Projection)projectionCombo.getItemAt(i);
    207             if (proj.getClass().getName().equals(Main.pref.get("projection", Mercator.class.getName()))) {
     210            String name = proj.getClass().getName();
     211            String sname = name.substring(name.lastIndexOf(".")+1);
     212            if(projHasPrefs(proj))
     213                ((ProjectionSubPrefs) proj).setPreferences(Main.pref.getCollection("projection.sub."+sname, null));
     214            if (name.equals(Main.pref.get("projection", Mercator.class.getName()))) {
    208215                projectionCombo.setSelectedIndex(i);
    209216                selectedProjectionChanged(proj);
Note: See TracChangeset for help on using the changeset viewer.