From 0fe38dd0061aa987cea240f46dab045189a79a90 Mon Sep 17 00:00:00 2001 From: PavelRatushnyi Date: Sat, 26 Aug 2017 15:58:08 +0300 Subject: [PATCH] Remove unnecessary method --- .../measurementtool/MeasurementToolFragment.java | 14 +++----------- .../measurementtool/command/AddPointCommand.java | 6 ------ 2 files changed, 3 insertions(+), 17 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolFragment.java b/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolFragment.java index e090f0cc4e..174cc4a058 100644 --- a/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolFragment.java +++ b/OsmAnd/src/net/osmand/plus/measurementtool/MeasurementToolFragment.java @@ -862,7 +862,7 @@ public class MeasurementToolFragment extends Fragment { if (measurementLayer != null) { int selectedPoint = editingCtx.getSelectedPointPosition(); //after = 1; before = 1; int pointsCount = editingCtx.getPointsCount(); //after = 2; before = 1; - if (addPointToPosition(editingCtx.getPointsCount())) { //выбрать вторую точку + if (addCenterPoint()) { //выбрать вторую точку if (selectedPoint == pointsCount) { editingCtx.splitSegments(editingCtx.getPointsCount() - 1); } else { @@ -949,19 +949,11 @@ public class MeasurementToolFragment extends Fragment { } } - private void addCenterPoint() { - MeasurementToolLayer measurementLayer = getMeasurementLayer(); - if (measurementLayer != null) { - editingCtx.getCommandManager().execute(new AddPointCommand(measurementLayer, true)); - doAddOrMovePointCommonStuff(); - } - } - - private boolean addPointToPosition(int position) { + private boolean addCenterPoint() { boolean added = false; MeasurementToolLayer measurementLayer = getMeasurementLayer(); if (measurementLayer != null) { - added = editingCtx.getCommandManager().execute(new AddPointCommand(measurementLayer, position)); + added = editingCtx.getCommandManager().execute(new AddPointCommand(measurementLayer, true)); doAddOrMovePointCommonStuff(); } return added; diff --git a/OsmAnd/src/net/osmand/plus/measurementtool/command/AddPointCommand.java b/OsmAnd/src/net/osmand/plus/measurementtool/command/AddPointCommand.java index ab95a2d261..9545142528 100644 --- a/OsmAnd/src/net/osmand/plus/measurementtool/command/AddPointCommand.java +++ b/OsmAnd/src/net/osmand/plus/measurementtool/command/AddPointCommand.java @@ -9,12 +9,6 @@ public class AddPointCommand extends MeasurementModeCommand { private WptPt point; private boolean center; - public AddPointCommand(MeasurementToolLayer measurementLayer, int position) { - this.measurementLayer = measurementLayer; - this.center = true; - this.position = position; - } - public AddPointCommand(MeasurementToolLayer measurementLayer, boolean center) { this.measurementLayer = measurementLayer; this.center = center;