Code

Super duper mega (fun!) commit: replaced encoding=utf-8 with fileencoding=utf-8 in...
[inkscape.git] / src / layer-manager.cpp
index fe0d4190484ee637ff9927f93250dd5344aa8ff7..1e1bb8c339ae9e9f9f8770e907e5ab6ac9fcc66b 100644 (file)
@@ -126,12 +126,12 @@ LayerManager::LayerManager(SPDesktop *desktop)
 {
     _layer_connection = desktop->connectCurrentLayerChanged( sigc::mem_fun(*this, &LayerManager::_selectedLayerChanged) );
 
-    sigc::bound_mem_functor1<void, Inkscape::LayerManager, Document*> first = sigc::mem_fun(*this, &LayerManager::_setDocument);
+    sigc::bound_mem_functor1<void, Inkscape::LayerManager, SPDocument*> first = sigc::mem_fun(*this, &LayerManager::_setDocument);
 
     // This next line has problems on gcc 4.0.2
-    sigc::slot<void, Document*> base2 = first;
+    sigc::slot<void, SPDocument*> base2 = first;
 
-    sigc::slot<void,SPDesktop*,Document*> slot2 = sigc::hide<0>( base2 );
+    sigc::slot<void,SPDesktop*,SPDocument*> slot2 = sigc::hide<0>( base2 );
     _document_connection = desktop->connectDocumentReplaced( slot2 );
 
     _setDocument(desktop->doc());
@@ -142,6 +142,7 @@ LayerManager::~LayerManager()
     _layer_connection.disconnect();
     _document_connection.disconnect();
     _resource_connection.disconnect();
+    _document = 0;
 }
 
 void LayerManager::setCurrentLayer( SPObject* obj )
@@ -211,7 +212,7 @@ void LayerManager::renameLayer( SPObject* obj, gchar const *label, bool uniquify
 
 
 
-void LayerManager::_setDocument(Document *document) {
+void LayerManager::_setDocument(SPDocument *document) {
     if (_document) {
         _resource_connection.disconnect();
     }
@@ -315,7 +316,7 @@ void LayerManager::_rebuild() {
                 LayerWatcher *eye = new LayerWatcher(this, layer, connection);
                 _watchers.push_back( eye );
                 SP_OBJECT_REPR(layer)->addObserver(*eye);
-                
+
                 _addOne(layer);
             }
         }
@@ -340,4 +341,4 @@ void LayerManager::_selectedLayerChanged(SPObject *layer)
   fill-column:99
   End:
 */
-// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :
+// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :