25#include <svx/svxids.hrc>
32#define FRM_VALID_LEFT 0x01
33#define FRM_VALID_RIGHT 0x02
34#define FRM_VALID_TOP 0x04
35#define FRM_VALID_BOTTOM 0x08
36#define FRM_VALID_HINNER 0x10
37#define FRM_VALID_VINNER 0x20
38#define FRM_VALID_OUTER 0x0f
39#define FRM_VALID_ALL 0xff
42 :
WeldToolbarPopup(nullptr, pParent,
"modules/scalc/ui/floatingborderstyle.ui",
"FloatingBorderStyle")
43 , maToolButton(pParent, rId)
44 , mpDispatcher(pDispatcher)
45 , mxTBBorder1(m_xBuilder->weld_toolbar(
"border1"))
46 , mxTBBorder2(m_xBuilder->weld_toolbar(
"border2"))
47 , mxTBBorder3(m_xBuilder->weld_toolbar(
"border3"))
48 , mxTBBorder4(m_xBuilder->weld_toolbar(
"border4"))
74 SvxBoxItem aBorderOuter( SID_ATTR_BORDER_OUTER );
83 SvxLineItem aLineItem1( SID_ATTR_BORDER_DIAG_BLTR );
84 SvxLineItem aLineItem2( SID_ATTR_BORDER_DIAG_TLBR );
87 mpDispatcher->ExecuteList(
88 SID_ATTR_BORDER_DIAG_BLTR, SfxCallMode::RECORD, { &aLineItem1 });
89 mpDispatcher->ExecuteList(
90 SID_ATTR_BORDER_DIAG_TLBR, SfxCallMode::RECORD, { &aLineItem2 });
92 else if (rId ==
"all")
94 pLeft = pRight = pTop = pBottom = &theDefLine;
95 aBorderInner.
SetLine( &theDefLine, SvxBoxInfoItemLine::HORI );
96 aBorderInner.
SetLine( &theDefLine, SvxBoxInfoItemLine::VERT );
99 else if (rId ==
"outside")
101 pLeft = pRight = pTop = pBottom = &theDefLine;
104 else if (rId ==
"thickbox")
107 pLeft = pRight = pTop = pBottom = &theDefLine;
111 aBorderOuter.
SetLine( pLeft, SvxBoxItemLine::LEFT );
112 aBorderOuter.
SetLine( pRight, SvxBoxItemLine::RIGHT );
113 aBorderOuter.
SetLine( pTop, SvxBoxItemLine::TOP );
114 aBorderOuter.
SetLine( pBottom, SvxBoxItemLine::BOTTOM );
122 aBorderInner.
SetValid( SvxBoxInfoItemValidFlags::DISTANCE );
123 aBorderInner.
SetValid( SvxBoxInfoItemValidFlags::DISABLE,
false );
125 mpDispatcher->ExecuteList(
126 SID_ATTR_BORDER, SfxCallMode::RECORD, { &aBorderOuter, &aBorderInner });
128 maToolButton.set_inactive();
136 SvxLineItem aLineItem( SID_ATTR_BORDER_DIAG_BLTR );
138 mpDispatcher->ExecuteList(
139 SID_ATTR_BORDER_DIAG_BLTR, SfxCallMode::RECORD, { &aLineItem });
141 else if (rId ==
"diagdown")
144 SvxLineItem aLineItem( SID_ATTR_BORDER_DIAG_TLBR );
146 mpDispatcher->ExecuteList(
147 SID_ATTR_BORDER_DIAG_TLBR, SfxCallMode::RECORD, { &aLineItem });
151 SvxBoxItem aBorderOuter( SID_ATTR_BORDER_OUTER );
164 else if (rId ==
"right")
168 pRight = &theDefLine;
177 else if (rId ==
"top")
182 else if (rId ==
"bottom")
184 pBottom = &theDefLine;
187 else if (rId ==
"topbottom")
189 pTop = pBottom = &theDefLine;
192 else if (rId ==
"leftright")
194 pLeft = pRight = &theDefLine;
197 aBorderOuter.
SetLine( pLeft, SvxBoxItemLine::LEFT );
198 aBorderOuter.
SetLine( pRight, SvxBoxItemLine::RIGHT );
199 aBorderOuter.
SetLine( pTop, SvxBoxItemLine::TOP );
200 aBorderOuter.
SetLine( pBottom, SvxBoxItemLine::BOTTOM );
208 aBorderInner.
SetValid( SvxBoxInfoItemValidFlags::DISTANCE );
209 aBorderInner.
SetValid( SvxBoxInfoItemValidFlags::DISABLE,
false );
211 mpDispatcher->ExecuteList(
212 SID_ATTR_BORDER, SfxCallMode::RECORD, { &aBorderOuter, &aBorderInner});
215 maToolButton.set_inactive();
220 SvxBoxItem aBorderOuter( SID_ATTR_BORDER_OUTER );
222 std::unique_ptr<editeng::SvxBorderLine> pTop;
223 std::unique_ptr<editeng::SvxBorderLine> pBottom;
225 using namespace ::com::sun::star::table::BorderLineStyle;
229 if (rId ==
"thickbottom")
234 else if (rId ==
"doublebottom")
241 else if (rId ==
"topthickbottom")
247 else if (rId ==
"topdoublebottom")
256 aBorderOuter.
SetLine( pTop.get(), SvxBoxItemLine::TOP );
257 aBorderOuter.
SetLine( pBottom.get(), SvxBoxItemLine::BOTTOM );
258 aBorderOuter.
SetLine(
nullptr, SvxBoxItemLine::LEFT );
259 aBorderOuter.
SetLine(
nullptr, SvxBoxItemLine::RIGHT );
267 aBorderInner.
SetValid( SvxBoxInfoItemValidFlags::DISTANCE );
268 aBorderInner.
SetValid( SvxBoxInfoItemValidFlags::DISABLE,
false );
270 mpDispatcher->ExecuteList(
271 SID_ATTR_BORDER, SfxCallMode::RECORD, { &aBorderOuter, &aBorderInner });
276 maToolButton.set_inactive();
static bool GetLayoutRTL()
static const sal_Int16 Thin
static const sal_Int16 Hairline
static const sal_Int16 Thick
void SetValid(SvxBoxInfoItemValidFlags nValid, bool bValid=true)
void SetLine(const editeng::SvxBorderLine *pNew, SvxBoxInfoItemLine nLine)
void SetLine(const editeng::SvxBorderLine *pNew, SvxBoxItemLine nLine)
void SetLine(const editeng::SvxBorderLine *pNew)
void SetWidth(tools::Long nWidth)
#define LINK(Instance, Class, Member)