summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a5b9671)
raw | patch | inline | side by side (parent: a5b9671)
author | joncruz <joncruz@users.sourceforge.net> | |
Mon, 29 May 2006 16:12:36 +0000 (16:12 +0000) | ||
committer | joncruz <joncruz@users.sourceforge.net> | |
Mon, 29 May 2006 16:12:36 +0000 (16:12 +0000) |
ChangeLog | patch | blob | history | |
src/desktop.cpp | patch | blob | history | |
src/dialogs/layers-panel.cpp | patch | blob | history | |
src/layer-manager.cpp | patch | blob | history |
diff --git a/ChangeLog b/ChangeLog
index f9a908f017c09140ef9bac6ac1b55f9b095f7140..4a6b28a802952ed2aea65926f7478b1450bdf0ec 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
+2006-05-29 Jon A. Cruz <jon@joncruz.org>
+
+ * src/desktop.cpp, src/layer-manager.cpp, src/dialogs/layers-panel.cpp:
+ Workaround to avoid assertion upon file revert.
+
2006-05-28 Bryce <bryce@bryceharrington.org>
* sp-marker.cpp: Adding documentation
2006-05-28 Jon A. Cruz <jon@joncruz.org>
- * src/layer-manager.cpp, src/layer-manager.cpp,
+ * src/layer-manager.cpp, src/layer-manager.h,
src/preferences-skeleton.h, src/ui/dialog/inkscape-preferences.cpp,
src/ui/dialog/inkscape-preferences.h,
src/widgets/layer-selector.cpp, src/dialogs/layers-panel.cpp:
diff --git a/src/desktop.cpp b/src/desktop.cpp
index b1dbae1187b5284b00e05cfc85cd8b8b62fb186f..17ce0907c67e3c6ffc8b9d8cb761737f74248885 100644 (file)
--- a/src/desktop.cpp
+++ b/src/desktop.cpp
*/
void SPDesktop::setCurrentLayer(SPObject *object) {
g_return_if_fail(SP_IS_GROUP(object));
- g_return_if_fail( currentRoot() == object || currentRoot()->isAncestorOf(object));
+ g_return_if_fail( currentRoot() == object || (currentRoot() && currentRoot()->isAncestorOf(object)) );
// printf("Set Layer to ID: %s\n", SP_OBJECT_ID(object));
_layer_hierarchy->setBottom(object);
}
index cdcafbbc1c5d80d9b9a97dc1ac68627247027003..a09ce152724821604c93ba30dde9191a0a98aeae 100644 (file)
void LayersPanel::_pushTreeSelectionToCurrent()
{
SPObject* inTree = _selectedLayer();
- if ( inTree ) {
- SPObject* curr = _desktop->currentLayer();
- if ( curr != inTree ) {
- _mgr->setCurrentLayer( inTree );
+ // TODO hunt down the possible API abuse in getting NULL
+ if ( _desktop->currentRoot() ) {
+ if ( inTree ) {
+ SPObject* curr = _desktop->currentLayer();
+ if ( curr != inTree ) {
+ _mgr->setCurrentLayer( inTree );
+ }
+ } else {
+ _mgr->setCurrentLayer( _desktop->doc()->root );
}
- } else {
- _mgr->setCurrentLayer( _desktop->doc()->root );
}
}
diff --git a/src/layer-manager.cpp b/src/layer-manager.cpp
index e2e40340f6dff1d4d94e3594eba369429aa21585..61b0e15bb08cf3c00769f0b830aace539d0b7840 100644 (file)
--- a/src/layer-manager.cpp
+++ b/src/layer-manager.cpp
void LayerManager::setCurrentLayer( SPObject* obj )
{
- _desktop->setCurrentLayer( obj );
+ //g_return_if_fail( _desktop->currentRoot() );
+ if ( _desktop->currentRoot() ) {
+ _desktop->setCurrentLayer( obj );
- if ( prefs_get_int_attribute_limited("options.selection", "layerdeselect", 1, 0, 1) ) {
- sp_desktop_selection( _desktop )->clear();
+ if ( prefs_get_int_attribute_limited("options.selection", "layerdeselect", 1, 0, 1) ) {
+ sp_desktop_selection( _desktop )->clear();
+ }
}
}