1.7.2: Problem with old config and docking windows

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

1.7.2: Problem with old config and docking windows

Felix Natter
hello Dimitry,

with an older 1.7.x config,
org.freeplane.main.application.MapViewDockingWindows.getContainingDockedWindow(Component)
returns null.

I have attached my config, and a patch which "fixes" the issue (simple
defensive programming, might break functionality). Maybe a new property
was introduced without a default value?

BTW: Is there an estimate when 1.7.x will be released?
I'd like to get this into Debian 10.

Cheers and Best Regards,
--
Felix Natter
debian/rules!

diff --git a/freeplane/src/main/java/org/freeplane/main/application/MapViewDockingWindows.java b/freeplane/src/main/java/org/freeplane/main/application/MapViewDockingWindows.java
index 021bd0979..041642d42 100644
--- a/freeplane/src/main/java/org/freeplane/main/application/MapViewDockingWindows.java
+++ b/freeplane/src/main/java/org/freeplane/main/application/MapViewDockingWindows.java
@@ -253,15 +253,18 @@ class MapViewDockingWindows implements IMapViewChangeListener {
  for (int i = 0; i < mapViews.size(); ++i) {
  if (mapViews.get(i) == pNewMap) {
  View dockedView = getContainingDockedWindow(pNewMap);
- Frame window = JOptionPane.getFrameForComponent(dockedView);
- int frameState = window.getExtendedState();
- if((frameState & Frame.ICONIFIED) != 0)
- window.setExtendedState(frameState & ~Frame.ICONIFIED);
- if(dockedView.isMinimized())
- dockedView.restore();
- else
- dockedView.restoreFocus();
- focusMapViewLater((MapView) pNewMap);
+ if (dockedView != null)
+ {
+ Frame window = JOptionPane.getFrameForComponent(dockedView);
+ int frameState = window.getExtendedState();
+ if((frameState & Frame.ICONIFIED) != 0)
+ window.setExtendedState(frameState & ~Frame.ICONIFIED);
+ if(dockedView.isMinimized())
+ dockedView.restore();
+ else
+ dockedView.restoreFocus();
+ focusMapViewLater((MapView) pNewMap);
+ }
  return;
  }
  }
@@ -306,10 +309,14 @@ class MapViewDockingWindows implements IMapViewChangeListener {
  for (int i = 0; i < mapViews.size(); ++i) {
  if (mapViews.get(i) == pOldMapView) {
  mPaneSelectionUpdate = false;
- getContainingDockedWindow(pOldMapView).close();
- mapViews.remove(i);
- mPaneSelectionUpdate = true;
- rootWindow.repaint();
+ View dockedView = getContainingDockedWindow(pOldMapView);
+ if (dockedView != null)
+ {
+ dockedView.close();
+ mapViews.remove(i);
+ mPaneSelectionUpdate = true;
+ rootWindow.repaint();
+ }
  return;
  }
  }
@@ -417,7 +424,10 @@ class MapViewDockingWindows implements IMapViewChangeListener {
  if (mapViewComponent instanceof MapView ) {
             String title = createTitle(mapViewComponent);
             View containingDockedWindow = getContainingDockedWindow(mapViewComponent);
- containingDockedWindow.getViewProperties().setTitle(title);
+            if (containingDockedWindow != null)
+            {
+ containingDockedWindow.getViewProperties().setTitle(title);
+            }
             }
  }
     }

1.7.x-docking-view-bug.tar.gz (7K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: 1.7.2: Problem with old config and docking windows

Dimitry Polivaev
Administrator
Hello Felix,

thank you for the bug report. I tried to fix it in https://github.com/freeplane/freeplane/commit/9ea81055e3ea18c65d4f38e9ef7ca7f2ece8ea49

I shall create the preview with the fix tomorrow morning.

I do not believe in "defensive programming". I think that bugs should be visible and get fixed.

I would like to release 1.7.2 as soon as possible. I think our power user community is not big enough to wait for bug reports.
However if people here could test the latest version I would be great.

Regards,
Dimirty
Reply | Threaded
Open this post in threaded view
|

Re: 1.7.2: Problem with old config and docking windows

Felix Natter
hi Dimitry,

thanks - I can confirm that this fixes the issue.

To me, 1.7.2 looks good, and I will continue testing.

Thanks and Best Regards,
Felix