diff options
| author | Marc Jeanmougin <marc@jeanmougin.fr> | 2015-04-29 20:51:23 +0000 |
|---|---|---|
| committer | Marc Jeanmougin <mc@M0nst3r.bouyguesbox.fr> | 2015-04-29 20:51:23 +0000 |
| commit | 5163b1155c85c040b55f28c771f6d12bcd483765 (patch) | |
| tree | 79afe1546f86f49fe1dc8fd625e125c0646bc59b /src/path-chemistry.cpp | |
| parent | merge with trunk (diff) | |
| parent | Better solution picking (diff) | |
| download | inkscape-5163b1155c85c040b55f28c771f6d12bcd483765.tar.gz inkscape-5163b1155c85c040b55f28c771f6d12bcd483765.zip | |
updated with trunk
(bzr r13922.1.19)
Diffstat (limited to 'src/path-chemistry.cpp')
| -rw-r--r-- | src/path-chemistry.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/path-chemistry.cpp b/src/path-chemistry.cpp index bb313ef1a..8d2695b85 100644 --- a/src/path-chemistry.cpp +++ b/src/path-chemistry.cpp @@ -354,9 +354,7 @@ bool sp_item_list_to_curves(const std::vector<SPItem*> &items, std::vector<SPItem*>& selected, std::vector<Inkscape::XML::Node*> &to_select, bool skip_all_lpeitems) { bool did = false; - for (std::vector<SPItem*>::const_iterator i = items.begin(); i != items.end(); i++){ - SPItem *item = *i; g_assert(item != NULL); SPDocument *document = item->document; @@ -475,6 +473,9 @@ sp_selected_item_to_curved_repr(SPItem *item, guint32 /*text_grouping_policy*/) if (dynamic_cast<SPText *>(item) || dynamic_cast<SPFlowtext *>(item)) { // Special treatment for text: convert each glyph to separate path, then group the paths Inkscape::XML::Node *g_repr = xml_doc->createElement("svg:g"); + + Glib::ustring original_text; // To save original text of accessibility. + g_repr->setAttribute("transform", item->getRepr()->attribute("transform")); /* Mask */ gchar *mask_str = (gchar *) item->getRepr()->attribute("mask"); @@ -495,6 +496,8 @@ sp_selected_item_to_curved_repr(SPItem *item, guint32 /*text_grouping_policy*/) Inkscape::Text::Layout::iterator iter = te_get_layout(item)->begin(); do { + original_text += (gunichar)te_get_layout(item)->characterAt( iter ); + Inkscape::Text::Layout::iterator iter_next = iter; iter_next.nextGlyph(); // iter_next is one glyph ahead from iter if (iter == iter_next) @@ -534,6 +537,11 @@ sp_selected_item_to_curved_repr(SPItem *item, guint32 /*text_grouping_policy*/) p_repr->setAttribute("style", style_str.c_str()); g_repr->appendChild(p_repr); + + // For accessibility, store original string + if( original_text.size() > 0 ) { + g_repr->setAttribute("aria-label", original_text.c_str() ); + } Inkscape::GC::release(p_repr); if (iter == te_get_layout(item)->end()) |
