972
973
item->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG);
976
sp_te_adjust_dx (SPItem *item, Inkscape::Text::Layout::iterator const &start, Inkscape::Text::Layout::iterator const &end, SPDesktop *desktop, double delta)
976
void sp_te_adjust_dx(SPItem *item, Inkscape::Text::Layout::iterator const &start, Inkscape::Text::Layout::iterator const &end, SPDesktop * /*desktop*/, double delta)
978
unsigned char_index = 0;
979
979
TextTagAttributes *attributes = text_tag_attributes_at_position(item, std::min(start, end), &char_index);
980
if (attributes) attributes->addToDx(char_index, delta);
981
attributes->addToDx(char_index, delta);
981
983
if (start != end) {
982
984
attributes = text_tag_attributes_at_position(item, std::max(start, end), &char_index);
983
if (attributes) attributes->addToDx(char_index, -delta);
986
attributes->addToDx(char_index, -delta);
986
990
item->updateRepr();
987
991
item->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG);
991
sp_te_adjust_dy (SPItem *item, Inkscape::Text::Layout::iterator const &start, Inkscape::Text::Layout::iterator const &end, SPDesktop *desktop, double delta)
994
void sp_te_adjust_dy(SPItem *item, Inkscape::Text::Layout::iterator const &start, Inkscape::Text::Layout::iterator const &end, SPDesktop * /*desktop*/, double delta)
996
unsigned char_index = 0;
994
997
TextTagAttributes *attributes = text_tag_attributes_at_position(item, std::min(start, end), &char_index);
995
if (attributes) attributes->addToDy(char_index, delta);
999
attributes->addToDy(char_index, delta);
996
1001
if (start != end) {
997
1002
attributes = text_tag_attributes_at_position(item, std::max(start, end), &char_index);
998
if (attributes) attributes->addToDy(char_index, -delta);
1004
attributes->addToDy(char_index, -delta);
1001
1008
item->updateRepr();
1041
1048
text->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG);
1045
sp_te_set_rotation(SPItem *text, Inkscape::Text::Layout::iterator const &start, Inkscape::Text::Layout::iterator const &end, SPDesktop */*desktop*/, gdouble degrees)
1051
void sp_te_set_rotation(SPItem *text, Inkscape::Text::Layout::iterator const &start, Inkscape::Text::Layout::iterator const &end, SPDesktop */*desktop*/, gdouble degrees)
1047
unsigned char_index;
1053
unsigned char_index = 0;
1048
1054
TextTagAttributes *attributes = text_tag_attributes_at_position(text, std::min(start, end), &char_index);
1049
if (attributes == NULL) return;
1052
for (Inkscape::Text::Layout::iterator it = std::min(start, end) ; it != std::max(start, end) ; it.nextCharacter()) {
1053
attributes = text_tag_attributes_at_position(text, it, &char_index);
1054
if (attributes) attributes->setRotate(char_index, degrees);
1055
if (attributes != NULL) {
1057
for (Inkscape::Text::Layout::iterator it = std::min(start, end) ; it != std::max(start, end) ; it.nextCharacter()) {
1058
attributes = text_tag_attributes_at_position(text, it, &char_index);
1060
attributes->setRotate(char_index, degrees);
1064
attributes->setRotate(char_index, degrees);
1057
attributes->setRotate(char_index, degrees);
1060
text->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG);
1068
text->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG);
1283
1292
parent_style = sp_style_write_string(parent_spstyle, SP_STYLE_FLAG_ALWAYS);
1284
1293
sp_style_unref(parent_spstyle);
1286
Glib::ustring child_style_construction(parent_style);
1295
Glib::ustring child_style_construction;
1287
1296
while (child != parent) {
1288
1297
// FIXME: this assumes that child's style is only in style= whereas it can also be in css attributes!
1289
1298
char const *style_text = SP_OBJECT_REPR(child)->attribute("style");
1290
1299
if (style_text && *style_text) {
1291
child_style_construction += ';';
1292
child_style_construction += style_text;
1300
child_style_construction.insert(0, style_text);
1301
child_style_construction.insert(0, 1, ';');
1294
1303
child = SP_OBJECT_PARENT(child);
1305
child_style_construction.insert(0, parent_style);
1296
1306
SPStyle *child_spstyle = sp_style_new(SP_OBJECT_DOCUMENT(parent));
1297
1307
sp_style_merge_from_style_string(child_spstyle, child_style_construction.c_str());
1298
1308
gchar *child_style = sp_style_write_string(child_spstyle, SP_STYLE_FLAG_ALWAYS);
1647
1657
SPCSSAttr *css_child_and_item = sp_repr_css_attr_new();
1648
1658
SPCSSAttr *css_child_only = sp_repr_css_attr_new();
1659
gchar const *item_style = SP_OBJECT_REPR(*item)->attribute("style");
1660
if (item_style && *item_style) {
1661
sp_repr_css_attr_add_from_string(css_child_and_item, item_style);
1649
1663
gchar const *child_style = SP_OBJECT_REPR(child)->attribute("style");
1650
1664
if (child_style && *child_style) {
1651
1665
sp_repr_css_attr_add_from_string(css_child_and_item, child_style);
1652
1666
sp_repr_css_attr_add_from_string(css_child_only, child_style);
1654
gchar const *item_style = SP_OBJECT_REPR(*item)->attribute("style");
1655
if (item_style && *item_style) {
1656
sp_repr_css_attr_add_from_string(css_child_and_item, item_style);
1658
1668
bool equal = css_attrs_are_equal(css_child_only, css_child_and_item);
1659
1669
sp_repr_css_attr_unref(css_child_and_item);
1660
1670
sp_repr_css_attr_unref(css_child_only);