26 #include <osl/diagnose.h>
38 for (sal_uInt16
i = 0;
i < nCount; ++
i)
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);
84 OSL_ENSURE(nPos <
GetCount() - 1,
"column overindexed");
86 nRet = rCols[nPos].GetRight() + rCols[nPos + 1].GetLeft();
97 OSL_ENSURE(nPos <
GetCount() - 1,
"column overindexed");
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.");
std::vector< SwColumn > SwColumns
constexpr TypedWhichId< SwFormatCol > RES_COL(109)
void FitToActualSize(SwFormatCol &rCol, sal_uInt16 nWidth)
constexpr TypedWhichId< SwFormatFrameSize > RES_FRM_SIZE(89)
tools::Long GetRight() const
void SetActualWidth(sal_uInt16 nW)
short GetLineHeightPercent() const
sal_uInt16 GetColWidth(sal_uInt16 nIdx) const
void SetGutterWidth(sal_uInt16 nWidth, sal_uInt16 nPos=USHRT_MAX)
SwColMgr(const SfxItemSet &rSet)
tools::Long GetLeft() const
void SetCount(sal_uInt16 nCount, sal_uInt16 nGutterWidth)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
const o3tl::enumarray< SvxAdjust, unsigned short > aSvxToUnoAdjust USHRT_MAX
constexpr TypedWhichId< SvxLRSpaceItem > RES_LR_SPACE(91)
void SetColWidth(sal_uInt16 nIdx, sal_uInt16 nWidth)
SVXCORE_DLLPUBLIC MSO_SPT Get(const OUString &)
void SetLineWidthAndColor(SvxBorderLineStyle eStyle, sal_uLong nWidth, const Color &rCol)
sal_uInt16 GetGutterWidth(sal_uInt16 nPos=USHRT_MAX) const
sal_uInt16 GetCount() const
void SetLineHeightPercent(short nPercent)