diff options
| author | Jon A. Cruz <jon@joncruz.org> | 2010-10-03 02:58:14 +0000 |
|---|---|---|
| committer | Jon A. Cruz <jon@joncruz.org> | 2010-10-03 02:58:14 +0000 |
| commit | 47b0fbd1448f100035c0505527623c62dd8427ca (patch) | |
| tree | feebabfd1dbca5a0a045b2fcc9631a5593075ad2 /src/text-editing.cpp | |
| parent | Implement snapping in the text tool (diff) | |
| download | inkscape-47b0fbd1448f100035c0505527623c62dd8427ca.tar.gz inkscape-47b0fbd1448f100035c0505527623c62dd8427ca.zip | |
Warning cleanup.
(bzr r9811)
Diffstat (limited to 'src/text-editing.cpp')
| -rw-r--r-- | src/text-editing.cpp | 54 |
1 files changed, 31 insertions, 23 deletions
diff --git a/src/text-editing.cpp b/src/text-editing.cpp index 372f5026d..76cf5e15b 100644 --- a/src/text-editing.cpp +++ b/src/text-editing.cpp @@ -972,30 +972,36 @@ sp_te_adjust_kerning_screen (SPItem *item, Inkscape::Text::Layout::iterator cons item->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG); } -void -sp_te_adjust_dx (SPItem *item, Inkscape::Text::Layout::iterator const &start, Inkscape::Text::Layout::iterator const &end, SPDesktop *desktop, double delta) +void sp_te_adjust_dx(SPItem *item, Inkscape::Text::Layout::iterator const &start, Inkscape::Text::Layout::iterator const &end, SPDesktop * /*desktop*/, double delta) { - unsigned char_index; + unsigned char_index = 0; TextTagAttributes *attributes = text_tag_attributes_at_position(item, std::min(start, end), &char_index); - if (attributes) attributes->addToDx(char_index, delta); + if (attributes) { + attributes->addToDx(char_index, delta); + } if (start != end) { attributes = text_tag_attributes_at_position(item, std::max(start, end), &char_index); - if (attributes) attributes->addToDx(char_index, -delta); + if (attributes) { + attributes->addToDx(char_index, -delta); + } } item->updateRepr(); item->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG); } -void -sp_te_adjust_dy (SPItem *item, Inkscape::Text::Layout::iterator const &start, Inkscape::Text::Layout::iterator const &end, SPDesktop *desktop, double delta) +void sp_te_adjust_dy(SPItem *item, Inkscape::Text::Layout::iterator const &start, Inkscape::Text::Layout::iterator const &end, SPDesktop * /*desktop*/, double delta) { - unsigned char_index; + unsigned char_index = 0; TextTagAttributes *attributes = text_tag_attributes_at_position(item, std::min(start, end), &char_index); - if (attributes) attributes->addToDy(char_index, delta); + if (attributes) { + attributes->addToDy(char_index, delta); + } if (start != end) { attributes = text_tag_attributes_at_position(item, std::max(start, end), &char_index); - if (attributes) attributes->addToDy(char_index, -delta); + if (attributes) { + attributes->addToDy(char_index, -delta); + } } item->updateRepr(); @@ -1041,23 +1047,25 @@ sp_te_adjust_rotation(SPItem *text, Inkscape::Text::Layout::iterator const &star text->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG); } -void -sp_te_set_rotation(SPItem *text, Inkscape::Text::Layout::iterator const &start, Inkscape::Text::Layout::iterator const &end, SPDesktop */*desktop*/, gdouble degrees) +void sp_te_set_rotation(SPItem *text, Inkscape::Text::Layout::iterator const &start, Inkscape::Text::Layout::iterator const &end, SPDesktop */*desktop*/, gdouble degrees) { - unsigned char_index; + unsigned char_index = 0; TextTagAttributes *attributes = text_tag_attributes_at_position(text, std::min(start, end), &char_index); - if (attributes == NULL) return; - - if (start != end) { - for (Inkscape::Text::Layout::iterator it = std::min(start, end) ; it != std::max(start, end) ; it.nextCharacter()) { - attributes = text_tag_attributes_at_position(text, it, &char_index); - if (attributes) attributes->setRotate(char_index, degrees); + if (attributes != NULL) { + if (start != end) { + for (Inkscape::Text::Layout::iterator it = std::min(start, end) ; it != std::max(start, end) ; it.nextCharacter()) { + attributes = text_tag_attributes_at_position(text, it, &char_index); + if (attributes) { + attributes->setRotate(char_index, degrees); + } + } + } else { + attributes->setRotate(char_index, degrees); } - } else - attributes->setRotate(char_index, degrees); - text->updateRepr(); - text->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG); + text->updateRepr(); + text->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG); + } } void |
