Changeset 13845 in josm for trunk/src/org


Ignore:
Timestamp:
2018-05-26T17:53:54+02:00 (6 years ago)
Author:
Don-vip
Message:

fix #16321, see #10047 - mapcss metadata is required

Location:
trunk/src/org/openstreetmap/josm/gui/mappaint
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/mappaint/MapPaintStyles.java

    r13815 r13845  
    315315            if (source.active) {
    316316                loadStyleForFirstTime(source);
     317            } else {
     318                source.loadStyleSource(true);
    317319            }
    318320        }
  • trunk/src/org/openstreetmap/josm/gui/mappaint/StyleSource.java

    r13815 r13845  
    101101
    102102    /**
     103     * Loads the complete style source.
     104     */
     105    public void loadStyleSource() {
     106        loadStyleSource(false);
     107    }
     108
     109    /**
    103110     * Loads the style source.
    104      */
    105     public abstract void loadStyleSource();
     111     * @param metadataOnly if {@code true}, only metadata are loaded
     112     * @since 13845
     113     */
     114    public abstract void loadStyleSource(boolean metadataOnly);
    106115
    107116    /**
  • trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSStyleSource.java

    r13815 r13845  
    413413
    414414    @Override
    415     public void loadStyleSource() {
     415    public void loadStyleSource(boolean metadataOnly) {
    416416        STYLE_SOURCE_LOCK.writeLock().lock();
    417417        try {
     
    436436
    437437                    loadMeta();
    438                     loadCanvas();
    439                     loadSettings();
     438                    if (!metadataOnly) {
     439                        loadCanvas();
     440                        loadSettings();
     441                    }
    440442                    // remove "areaStyle" pseudo classes intended only for validator (causes StackOverflowError otherwise)
    441443                    removeAreaStyleClasses();
     
    455457                Logging.error(e);
    456458                logError(new ParseException(e.getMessage())); // allow e to be garbage collected, it links to the entire token stream
     459            }
     460            if (metadataOnly) {
     461                return;
    457462            }
    458463            // optimization: filter rules for different primitive types
Note: See TracChangeset for help on using the changeset viewer.