diff options
| author | Krzysztof Kosi??ski <tweenk.pl@gmail.com> | 2010-01-14 08:13:09 +0000 |
|---|---|---|
| committer | Krzysztof KosiĆski <tweenk.pl@gmail.com> | 2010-01-14 08:13:09 +0000 |
| commit | 7f7da4643d6909af5cd58b2f24846774e3af509b (patch) | |
| tree | 1fec13b3616ecc90fb251bb9e643aefc43c80c43 /src/text-editing.cpp | |
| parent | Some additional docs (diff) | |
| parent | Initial cut of disabling floating windows on window managers with problems. (diff) | |
| download | inkscape-7f7da4643d6909af5cd58b2f24846774e3af509b.tar.gz inkscape-7f7da4643d6909af5cd58b2f24846774e3af509b.zip | |
* Merge from trunk
* Update to new snapping API
* Modify the join action slightly
(bzr r8846.2.11)
Diffstat (limited to 'src/text-editing.cpp')
| -rw-r--r-- | src/text-editing.cpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/text-editing.cpp b/src/text-editing.cpp index 2bdee4c10..e93ebdffa 100644 --- a/src/text-editing.cpp +++ b/src/text-editing.cpp @@ -1843,6 +1843,37 @@ void sp_te_apply_style(SPItem *text, Inkscape::Text::Layout::iterator const &sta text->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_STYLE_MODIFIED_FLAG); } +bool is_part_of_text_subtree (SPObject *obj) +{ + return (SP_IS_TSPAN(obj) + || SP_IS_TEXT(obj) + || SP_IS_FLOWTEXT(obj) + || SP_IS_FLOWTSPAN(obj) + || SP_IS_FLOWDIV(obj) + || SP_IS_FLOWPARA(obj) + || SP_IS_FLOWLINE(obj) + || SP_IS_FLOWREGIONBREAK(obj)); +} + +bool is_top_level_text_object (SPObject *obj) +{ + return (SP_IS_TEXT(obj) + || SP_IS_FLOWTEXT(obj)); +} + +bool has_visible_text (SPObject *obj) +{ + if (SP_IS_STRING(obj) && !SP_STRING(obj)->string.empty()) + return true; // maybe we should also check that it's not all whitespace? + + for (SPObject const *child = obj->firstChild() ; child ; child = SP_OBJECT_NEXT(child)) { + if (has_visible_text((SPObject *) child)) + return true; + } + + return false; +} + /* Local Variables: mode:c++ |
