Replaces reading of unnormalized value with the reading of percent value on value... 23/258023/1 accepted/tizen/unified/20210607.124334 submit/tizen/20210514.080747 submit/tizen/20210601.084003 submit/tizen/20210607.013021
authorLukasz Oleksak <l.oleksak@samsung.com>
Fri, 7 May 2021 15:28:57 +0000 (17:28 +0200)
committerLukasz Oleksak <l.oleksak@samsung.com>
Fri, 7 May 2021 15:28:57 +0000 (17:28 +0200)
Change-Id: I0a017f09292e41691dd2df573332b11747760d9a

src/screen_reader_spi.c

index abe64ff9c3f5aeb474f17dedcfbbd3901bd79c92..c476b8804d2ee4934bd1cc0dfa0eb256be015a2a 100644 (file)
@@ -175,42 +175,10 @@ static char *spi_on_caret_move_get_text(SpiData *spi, AtspiEvent *event)
 static char *spi_on_value_changed_get_text(SpiData *spi, AtspiEvent *event)
 {
        char *text_to_read = NULL;
-
        spi->currently_focused = event->source;
-
-       AtspiValue *value_interface = atspi_accessible_get_value_iface(spi->currently_focused);
-
-       if (value_interface) {
-               char *name = atspi_accessible_get_name(spi->currently_focused, NULL);
-               DEBUG("VALUE CHANGED WIDGET: %s", name);
-               g_free(name);
-
-               double current_temp_value = (double)atspi_value_get_current_value(value_interface, NULL);
-               //FIXME : This IDS value is not supported.
-               /*if (abs(current_temp_value - atspi_value_get_maximum_value(value_interface, NULL)) < EPS) {
-                       DEBUG("MAX VALUE REACHED");
-                       if (asprintf(&text_to_read, "%.2f %s", current_temp_value, _("IDS_REACHED_MAX_VAL")) < 0) {
-                               ERROR(MEMORY_ERROR);
-                               g_object_unref(value_interface);
-                               return NULL;
-                       }
-               } else if (abs(current_temp_value - atspi_value_get_minimum_value(value_interface, NULL)) < EPS) {
-                       DEBUG("MIN VALUE REACHED");
-                       if (asprintf(&text_to_read, "%.2f %s", current_temp_value, _("IDS_REACHED_MIN_VAL")) < 0) {
-                               ERROR(MEMORY_ERROR);
-                               g_object_unref(value_interface);
-                               return NULL;
-                       }
-               } else {*/
-               if (asprintf(&text_to_read, "%.2f", current_temp_value) < 0) {
-                       ERROR(MEMORY_ERROR);
-                       g_object_unref(value_interface);
-                       return NULL;
-               }
-               //}
-               g_object_unref(value_interface);
-       }
-
+       ReadingComposerData *rcd = reading_composer_data_get(spi->currently_focused);
+       text_to_read = reading_composer_percent_value_description_get(rcd);
+       reading_composer_data_free(rcd);
        return text_to_read;
 }