                }

                double trailSpace = 0;
                if (cellIdx == endCell) {
                    // space after the rightmost cell
                    trailSpace = (hssfUnits > 0)
                        ? dim * (hssfUnits-endD)/(double)hssfUnits
                        : dim - endD;
                }