< prev index next >
src/java.desktop/share/classes/javax/swing/text/html/CSS.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
--- 1,7 ----
/*
! * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
*** 3371,3383 ****
int lastMargin = 0;
int totalSpacing = 0;
int n = iter.getCount();
int adjustmentWeightsCount = LayoutIterator.WorstAdjustmentWeight + 1;
//max gain we can get adjusting elements with adjustmentWeight <= i
! long gain[] = new long[adjustmentWeightsCount];
//max loss we can get adjusting elements with adjustmentWeight <= i
! long loss[] = new long[adjustmentWeightsCount];
for (int i = 0; i < adjustmentWeightsCount; i++) {
gain[i] = loss[i] = 0;
}
for (int i = 0; i < n; i++) {
--- 3371,3383 ----
int lastMargin = 0;
int totalSpacing = 0;
int n = iter.getCount();
int adjustmentWeightsCount = LayoutIterator.WorstAdjustmentWeight + 1;
//max gain we can get adjusting elements with adjustmentWeight <= i
! long[] gain = new long[adjustmentWeightsCount];
//max loss we can get adjusting elements with adjustmentWeight <= i
! long[] loss = new long[adjustmentWeightsCount];
for (int i = 0; i < adjustmentWeightsCount; i++) {
gain[i] = loss[i] = 0;
}
for (int i = 0; i < n; i++) {
*** 3412,3422 ****
*/
// determine the adjustment to be made
int allocated = targetSpan - totalSpacing;
long desiredAdjustment = allocated - preferred;
! long adjustmentsArray[] = (desiredAdjustment > 0) ? gain : loss;
desiredAdjustment = Math.abs(desiredAdjustment);
int adjustmentLevel = 0;
for (;adjustmentLevel <= LayoutIterator.WorstAdjustmentWeight;
adjustmentLevel++) {
// adjustmentsArray[] is sorted. I do not bother about
--- 3412,3422 ----
*/
// determine the adjustment to be made
int allocated = targetSpan - totalSpacing;
long desiredAdjustment = allocated - preferred;
! long[] adjustmentsArray = (desiredAdjustment > 0) ? gain : loss;
desiredAdjustment = Math.abs(desiredAdjustment);
int adjustmentLevel = 0;
for (;adjustmentLevel <= LayoutIterator.WorstAdjustmentWeight;
adjustmentLevel++) {
// adjustmentsArray[] is sorted. I do not bother about
< prev index next >