// we need to append by hand
// TODO: documentation is unclear here, that we have to insert by hand
int nCount = xGroups.getCount();
xGroups.insertByIndex(nCount, xGroup);
final XSection xGroupSection = xGroup.getHeader();
copyGroupProperties(nCount);
Rectangle aRect = new Rectangle();
aRect.X = nLeftPageIndent + getLeftGroupIndent(i);
SectionObject aSO = getDesignTemplate().getGroupLabel(i);
int nLabelHeight = 0;
// if (aSO != null)
// {
nLabelHeight = aSO.getHeight(500);
aRect = insertLabel(xGroupSection, getTitleFromFieldName(m_aGroupNames[i]), aRect, nLabelWidth, aSO);
// }
// else
// {
// nLabelHeight = 500;
// aRect = insertBoldLabel(xGroupSection, getTitleFromFieldName(m_aGroupNames[i]), aRect, nLabelWidth);
// }
final String sGroupName = convertToFieldName(m_aGroupNames[i]);
aSO = getDesignTemplate().getGroupTextField(i);
insertFormattedField(xGroupSection, sGroupName, aRect, nFieldWidth, aSO);
// draw a line under the label/formattedfield
aRect.X = nLeftPageIndent + getLeftGroupIndent(i);
aRect.Y = nLabelHeight;
final int nLineWidth = getPageWidth() - getRightPageIndent() - aRect.X;
final int nLineHeight = 250;
insertHorizontalLine(xGroupSection, aRect, nLineWidth, nLineHeight);
xGroupSection.setHeight(nLabelHeight + nLineHeight);
}
catch (com.sun.star.uno.Exception e)
{
// TODO: Exception not set.
}