summaryrefslogtreecommitdiffstats
path: root/src/text-editing.cpp
diff options
context:
space:
mode:
authorArcadie M. Cracan <acracan@gmail.com>2009-12-27 11:31:36 +0000
committerArcadie M. Cracan <acracan@gmail.com>2009-12-27 11:31:36 +0000
commit30eaa4a74569f4fc5ee802ee3883201379c18235 (patch)
treeaf9d0af2df52735f67a9f4af1a821f6d2fe2f242 /src/text-editing.cpp
parentConnector tool: make connectors avoid the convex hull of shapes. (diff)
parentWarning cleanup (diff)
downloadinkscape-30eaa4a74569f4fc5ee802ee3883201379c18235.tar.gz
inkscape-30eaa4a74569f4fc5ee802ee3883201379c18235.zip
Connector tool: make connectors avoid the convex hull of shapes.
(bzr r8857.1.2)
Diffstat (limited to 'src/text-editing.cpp')
-rw-r--r--src/text-editing.cpp31
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++