summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a9808f4)
raw | patch | inline | side by side (parent: a9808f4)
author | joncruz <joncruz@users.sourceforge.net> | |
Mon, 3 Mar 2008 09:28:30 +0000 (09:28 +0000) | ||
committer | joncruz <joncruz@users.sourceforge.net> | |
Mon, 3 Mar 2008 09:28:30 +0000 (09:28 +0000) |
Fixes Bug #168586
src/layer-manager.cpp | patch | blob | history |
diff --git a/src/layer-manager.cpp b/src/layer-manager.cpp
index 2edc26de4104c41648ca251c43a188403c27d8ef..32a8b46ff0ee0717dbe236247f2dfb5884ca08b3 100644 (file)
--- a/src/layer-manager.cpp
+++ b/src/layer-manager.cpp
#include "sp-item-group.h"
#include "xml/node.h"
#include "xml/node-observer.h"
#include "sp-item-group.h"
#include "xml/node.h"
#include "xml/node-observer.h"
+#include "util/format.h"
// #include "debug/event-tracker.h"
// #include "debug/simple-event.h"
// #include "debug/event-tracker.h"
// #include "debug/simple-event.h"
typedef Debug::SimpleEvent<Debug::Event::OTHER> DebugLayer;
typedef Debug::SimpleEvent<Debug::Event::OTHER> DebugLayer;
+class DebugLayerNote : public DebugLayer {
+public:
+ DebugLayerNote(Util::ptr_shared<char> descr)
+ : DebugLayer(Util::share_static_string("layer-note"))
+ {
+ _addProperty("descr", descr);
+ }
+};
class DebugLayerRebuild : public DebugLayer {
public:
DebugLayerRebuild()
: DebugLayer(Util::share_static_string("rebuild-layers"))
{
class DebugLayerRebuild : public DebugLayer {
public:
DebugLayerRebuild()
: DebugLayer(Util::share_static_string("rebuild-layers"))
{
- _addProperty("simple", Util::share_static_string("foo"));
}
};
}
};
};
};
-}
+} // end of namespace
*/
LayerManager::LayerManager(SPDesktop *desktop)
*/
LayerManager::LayerManager(SPDesktop *desktop)
for ( GSList const *iter = layers; iter; iter = iter->next ) {
SPObject *layer = static_cast<SPObject *>(iter->data);
for ( GSList const *iter = layers; iter; iter = iter->next ) {
SPObject *layer = static_cast<SPObject *>(iter->data);
+// Debug::EventTracker<DebugLayerNote> tracker(Util::format("Examining %s", layer->label()));
bool needsAdd = false;
std::set<SPGroup*> additional;
bool needsAdd = false;
std::set<SPGroup*> additional;
if ( group->layerMode() == SPGroup::LAYER ) {
// If we have a layer-group as the one or a parent, ensure it is listed as a valid layer.
needsAdd &= ( g_slist_find(const_cast<GSList *>(layers), curr) != NULL );
if ( group->layerMode() == SPGroup::LAYER ) {
// If we have a layer-group as the one or a parent, ensure it is listed as a valid layer.
needsAdd &= ( g_slist_find(const_cast<GSList *>(layers), curr) != NULL );
+ if ( (!(group->repr)) || (!(group->repr->parent())) ) {
+ needsAdd = false;
+ }
} else {
// If a non-layer group is a parent of layer groups, then show it also as a layer.
// TODO add the magic Inkscape group mode?
} else {
// If a non-layer group is a parent of layer groups, then show it also as a layer.
// TODO add the magic Inkscape group mode?
- additional.insert(group);
+ if ( group->repr && group->repr->parent() ) {
+ additional.insert(group);
+ } else {
+ needsAdd = false;
+ }
}
}
}
}
}
}