26#include <osl/diagnose.h>
42 col.SetWishWidth(nTmp);
45 sal_uInt32
const borders =
col.GetLeft() +
col.GetRight();
48 auto const shrink = borders - nTmp;
49 auto const half = shrink / 2;
50 if (
col.GetLeft() <
col.GetRight())
52 auto const shrinkLeft =
std::min(sal_uInt32(
col.GetLeft()), half);
53 col.SetLeft(
col.GetLeft() - shrinkLeft);
54 col.SetRight(
col.GetRight() - (shrink - shrinkLeft));
58 auto const shrinkRight =
std::min(sal_uInt32(
col.GetRight()), half);
59 col.SetLeft(
col.GetLeft() - (shrink - shrinkRight));
60 col.SetRight(
col.GetRight() - shrinkRight);
80 if (
nPos == USHRT_MAX)
86 nRet = rCols[
nPos].GetRight() + rCols[
nPos + 1].GetLeft();
93 if (
nPos == USHRT_MAX)
99 sal_uInt16 nGutterWidth2 = nGutterWidth / 2;
100 rCols[
nPos].SetRight(nGutterWidth2);
101 rCols[
nPos + 1].SetLeft(nGutterWidth2);
112 OSL_ENSURE(nPercent <= 100,
"line height may be at most 100%");
119 OSL_ENSURE(nIdx <
GetCount(),
"Column array overindexed.");
125 OSL_ENSURE(nIdx <
GetCount(),
"Column array overindexed.");
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
tools::Long GetRight() const
tools::Long GetLeft() const
SwColMgr(const SfxItemSet &rSet)
short GetLineHeightPercent() const
sal_uInt16 GetCount() const
sal_uInt16 GetColWidth(sal_uInt16 nIdx) const
void SetLineWidthAndColor(SvxBorderLineStyle eStyle, sal_uLong nWidth, const Color &rCol)
void SetGutterWidth(sal_uInt16 nWidth, sal_uInt16 nPos=USHRT_MAX)
void SetCount(sal_uInt16 nCount, sal_uInt16 nGutterWidth)
sal_uInt16 GetGutterWidth(sal_uInt16 nPos=USHRT_MAX) const
void SetActualWidth(sal_uInt16 nW)
void SetColWidth(sal_uInt16 nIdx, sal_uInt16 nWidth)
void SetLineHeightPercent(short nPercent)
void FitToActualSize(SwFormatCol &rCol, sal_uInt16 nWidth)
std::vector< SwColumn > SwColumns
constexpr TypedWhichId< SwFormatFrameSize > RES_FRM_SIZE(89)
constexpr TypedWhichId< SwFormatCol > RES_COL(115)
constexpr TypedWhichId< SvxLRSpaceItem > RES_LR_SPACE(97)
RttiCompleteObjectLocator col
SVXCORE_DLLPUBLIC MSO_SPT Get(const OUString &)
SwNodeOffset min(const SwNodeOffset &a, const SwNodeOffset &b)
constexpr SwTwips DEF_GUTTER_WIDTH