@@ -300,7 +300,7 @@ void document_manager::navigate_to_section(bool next) const {
300300 }
301301 const long offset = static_cast <long >(result.offset );
302302 text_ctrl->SetInsertionPoint (offset);
303- const wxString current_line = rust_to_wx (session_get_line_text (*tab-> get_session (), offset ));
303+ const wxString current_line = rust_to_wx (rust::String (result. marker_text ));
304304 if (result.wrapped )
305305 speak ((next ? _ (" Wrapping to start. " ) : _ (" Wrapping to end. " )) + current_line);
306306 else
@@ -347,7 +347,7 @@ void document_manager::navigate_to_page(bool next) const {
347347 }
348348 const long offset = static_cast <long >(result.offset );
349349 text_ctrl->SetInsertionPoint (offset);
350- const wxString current_line = rust_to_wx (session_get_line_text (*tab-> get_session (), offset ));
350+ const wxString current_line = rust_to_wx (rust::String (result. marker_text ));
351351 wxString message = wxString::Format (_ (" Page %d: %s" ), result.marker_index + 1 , current_line);
352352 if (result.wrapped ) message = (next ? _ (" Wrapping to start. " ) : _ (" Wrapping to end. " )) + message;
353353 speak (message);
@@ -433,10 +433,7 @@ void document_manager::navigate_to_link(bool next) const {
433433 }
434434 const long offset = static_cast <long >(result.offset );
435435 text_ctrl->SetInsertionPoint (offset);
436- wxString link_text = rust_to_wx (rust::String (result.marker_text ));
437- if (link_text.IsEmpty ()) {
438- link_text = rust_to_wx (session_get_line_text (*tab->get_session (), offset));
439- }
436+ const wxString link_text = rust_to_wx (rust::String (result.marker_text ));
440437 wxString message = link_text + _ (" link" );
441438 if (result.wrapped ) message = (next ? _ (" Wrapping to start. " ) : _ (" Wrapping to end. " )) + message;
442439 speak (message);
@@ -518,7 +515,7 @@ void document_manager::navigate_to_list(bool next) const {
518515 }
519516 const long offset = static_cast <long >(result.offset );
520517 text_ctrl->SetInsertionPoint (offset);
521- const wxString current_line = rust_to_wx (session_get_line_text (*tab-> get_session (), offset ));
518+ const wxString current_line = rust_to_wx (rust::String (result. marker_text ));
522519 wxString message = current_line;
523520 if (result.wrapped ) message = (next ? _ (" Wrapping to start. " ) : _ (" Wrapping to end. " )) + message;
524521 speak (message);
@@ -548,7 +545,7 @@ void document_manager::navigate_to_list_item(bool next) const {
548545 }
549546 const long offset = static_cast <long >(result.offset );
550547 text_ctrl->SetInsertionPoint (offset);
551- const wxString current_line = rust_to_wx (session_get_line_text (*tab-> get_session (), offset ));
548+ const wxString current_line = rust_to_wx (rust::String (result. marker_text ));
552549 wxString message = current_line;
553550 if (result.wrapped ) message = (next ? _ (" Wrapping to start. " ) : _ (" Wrapping to end. " )) + message;
554551 speak (message);
@@ -874,9 +871,6 @@ void document_manager::navigate_to_table(bool next) const {
874871 text_ctrl->SetInsertionPoint (offset);
875872 // Use marker_text (caption or first row) if available, otherwise use line text.
876873 wxString message = rust_to_wx (rust::String (result.marker_text ));
877- if (message.IsEmpty ()) {
878- message = rust_to_wx (session_get_line_text (*tab->get_session (), offset));
879- }
880874 if (result.wrapped ) message = (next ? _ (" Wrapping to start. " ) : _ (" Wrapping to end. " )) + message;
881875 speak (message);
882876}
0 commit comments