From 983af06ab85960dc5aeff773571e5597e8595796 Mon Sep 17 00:00:00 2001 From: teo_sarca Date: Sun, 4 Mar 2007 21:29:45 +0000 Subject: [PATCH] BF [ 1673590 ] report table - barcode overflows over next fields --- .../src/org/compiere/print/layout/BarcodeElement.java | 10 ++++++++++ print/src/org/compiere/print/layout/TableElement.java | 7 +++++++ 2 files changed, 17 insertions(+) diff --git a/print/src/org/compiere/print/layout/BarcodeElement.java b/print/src/org/compiere/print/layout/BarcodeElement.java index 05ca3dd9bb..c856fb4b5d 100644 --- a/print/src/org/compiere/print/layout/BarcodeElement.java +++ b/print/src/org/compiere/print/layout/BarcodeElement.java @@ -48,12 +48,15 @@ public class BarcodeElement extends PrintElement createBarcode(code, item); if (m_barcode == null) m_valid = false; + m_allowOverflow = item.isHeightOneLine(); // teo_sarca, [ 1673590 ] } // BarcodeElement /** Valid */ private boolean m_valid = true; /** Barcode */ private Barcode m_barcode = null; + /** Allow this field to overflow over next fields */// teo_sarca, [ 1673590 ] + private boolean m_allowOverflow = true; /** * Create Barcode @@ -175,6 +178,13 @@ public class BarcodeElement extends PrintElement return true; } // calculateSize + /** + * @author teo_sarca - [ 1673590 ] report table - barcode overflows over next fields + * @return can this element overflow over the next fields + */ + public boolean isAllowOverflow() { // + return m_allowOverflow; + } /** * Paint Element diff --git a/print/src/org/compiere/print/layout/TableElement.java b/print/src/org/compiere/print/layout/TableElement.java index c29e402fa8..34d196f20d 100644 --- a/print/src/org/compiere/print/layout/TableElement.java +++ b/print/src/org/compiere/print/layout/TableElement.java @@ -307,6 +307,13 @@ public class TableElement extends PrintElement dataSizes[row][col].addBelow( new Dimension((int)((BarcodeElement)dataItem).getWidth(), (int)((BarcodeElement)dataItem).getHeight())); + // Check if the overflow is allowed - teo_sarca, [ 1673590 ] + if (!((BarcodeElement)dataItem).isAllowOverflow()) { + float width = (float)Math.ceil(dataSizes[row][col].getWidth()); + if (colWidth < width) + colWidth = width; + } + continue; } // No Width Limitations