Fixes IDEMPIERE-5673 Wrong character causes java.awt.IllegalComponentStateException: This component must have a parent in order to determine its locale on reports (#1785)

This commit is contained in:
Carlos Ruiz 2023-04-24 12:14:28 +02:00 committed by GitHub
parent 274398fdd5
commit 5bf9301764
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -18,6 +18,7 @@ package org.compiere.print.layout;
import java.awt.Container; import java.awt.Container;
import java.awt.Graphics; import java.awt.Graphics;
import java.awt.IllegalComponentStateException;
import java.awt.Rectangle; import java.awt.Rectangle;
import java.awt.Shape; import java.awt.Shape;
import java.io.Externalizable; import java.io.Externalizable;
@ -102,7 +103,11 @@ public class HTMLRenderer extends View implements Externalizable
m_container = new Container(); m_container = new Container();
m_element = m_view.getElement(); m_element = m_view.getElement();
// initially layout to the preferred size // initially layout to the preferred size
try {
setSize(m_view.getPreferredSpan(X_AXIS), m_view.getPreferredSpan(Y_AXIS)); setSize(m_view.getPreferredSpan(X_AXIS), m_view.getPreferredSpan(Y_AXIS));
} catch (IllegalComponentStateException e) {
if (log.isLoggable(Level.INFO)) log.info("Exception ignored: " + e.toString() + " " + e.getLocalizedMessage());
}
} // HTMLRenderer } // HTMLRenderer
private int m_width; private int m_width;