private void generateRangeCoordinatesRecursive(final List<String> vars, final int idx, final String praefix, final List<Pair<String, Geopoint>> result) {
        if (idx < vars.size()) {
            final String var = vars.get(idx);
            final VariableMap.VariableState state = varList.getState(var);
            for (int i = 0; i < Objects.requireNonNull(Objects.requireNonNull(state).getFormula()).getRangeIndexSize(); i++) {
                varList.setRangeIndex(var, i);
                generateRangeCoordinatesRecursive(vars, idx + 1, (praefix == null ? "" : praefix + ", ") + var + "=" + varList.getValue(var), result);
            }
            varList.setRangeIndex(var, 0);
        } else {
            final Geopoint gp = calcCoord.calculateGeopoint(varList::getValue);
            if (gp != null) {
                result.add(new Pair<>(praefix, gp));
            }
        }
    }
Save the current state of the calculator such that it can be restored after screen rotation (or similar)
main/src/main/java/cgeo/geocaching/ui/dialog/CoordinatesCalculateGlobalDialog.java