Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(17)

Unified Diff: third_party/liblouis/nacl_wrapper/liblouis_wrapper.cc

Issue 2954413003: Support rich line output in both speech and braille (Closed)
Patch Set: Fix browser test Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/liblouis/nacl_wrapper/liblouis_wrapper.cc
diff --git a/third_party/liblouis/nacl_wrapper/liblouis_wrapper.cc b/third_party/liblouis/nacl_wrapper/liblouis_wrapper.cc
index be51c13b8571511dedc9bcc828bfa44a9fb159bf..514ab668b97dcbc83a076444a0a5db2aecf52c39 100644
--- a/third_party/liblouis/nacl_wrapper/liblouis_wrapper.cc
+++ b/third_party/liblouis/nacl_wrapper/liblouis_wrapper.cc
@@ -140,6 +140,8 @@ bool LibLouisWrapper::Translate(const TranslationParams& params,
out_cursor_position_ptr = &out_cursor_position;
}
+ std::vector<unsigned char> form_type_map(params.form_type_map);
+
// Invoke liblouis. Do this in a loop since we can't precalculate the
// translated size. We add an extra slot in the output buffer so that
// common cases like single digits or capital letters won't always trigger
@@ -152,11 +154,11 @@ bool LibLouisWrapper::Translate(const TranslationParams& params,
outlen = outalloc;
outbuf.resize(outalloc);
braille_to_text.resize(outalloc);
- int result = lou_translate(params.table_names.c_str(),
- &inbuf[0], &inlen, &outbuf[0], &outlen,
- NULL /* typeform */, NULL /* spacing */,
- &text_to_braille[0], &braille_to_text[0],
- out_cursor_position_ptr, dotsIO /* mode */);
+ form_type_map.resize(outalloc);
+ int result = lou_translate(
+ params.table_names.c_str(), &inbuf[0], &inlen, &outbuf[0], &outlen,
+ &form_type_map[0], NULL /* spacing */, &text_to_braille[0],
+ &braille_to_text[0], out_cursor_position_ptr, dotsIO /* mode */);
if (result == 0) {
// TODO(jbroman): log this
return false;
« no previous file with comments | « third_party/liblouis/nacl_wrapper/liblouis_instance.cc ('k') | third_party/liblouis/nacl_wrapper/translation_params.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698