27#include <svx/svxids.hrc>
33#include <com/sun/star/lang/IllegalArgumentException.hpp>
37using namespace css::uno;
40#define DEFAULT_VALUE 0
42#define MAX_DURCH 31680
45#define MAX_SC_SD 116220200
46#define NEGA_MAXVALUE -10000000
50 const css::uno::Reference<css::frame::XFrame>& rxFrame,
52 const css::uno::Reference<css::ui::XSidebar>& rxSidebar)
54 if (pParent ==
nullptr)
55 throw lang::IllegalArgumentException(
"no parent Window given to ParaPropertyPanel::Create",
nullptr, 0);
57 throw lang::IllegalArgumentException(
"no XFrame given to ParaPropertyPanel::Create",
nullptr, 1);
58 if (pBindings ==
nullptr)
59 throw lang::IllegalArgumentException(
"no SfxBindings given to ParaPropertyPanel::Create",
nullptr, 2);
61 return std::make_unique<ParaPropertyPanel>(pParent, rxFrame, pBindings, rxSidebar);
168 aMargin.
SetTextLeft(mxLeftIndent->GetCoreValue(m_eLRSpaceUnit));
169 aMargin.
SetRight(mxRightIndent->GetCoreValue(m_eLRSpaceUnit));
173 SID_ATTR_PARA_LRSPACE, SfxCallMode::RECORD, { &aMargin });
181 aMargin.
SetUpper(
static_cast<sal_uInt16
>(mxTopDist->GetCoreValue(m_eULSpaceUnit)));
182 aMargin.
SetLower(
static_cast<sal_uInt16
>(mxBottomDist->GetCoreValue(m_eULSpaceUnit)));
185 SID_ATTR_PARA_ULSPACE, SfxCallMode::RECORD, { &aMargin });
196 case SID_ATTR_METRIC:
213 case SID_ATTR_PARA_LRSPACE:
217 case SID_ATTR_PARA_ULSPACE:
253 bool bDisabled = eState == SfxItemState::DISABLED;
258 if (pState && eState >= SfxItemState::DEFAULT)
315 else if (eState != SfxItemState::DISABLED )
330 bool bDisabled = eState == SfxItemState::DISABLED;
334 if( pState && eState >= SfxItemState::DEFAULT )
346 mxTopDist->set_value( nVal, FieldUnit::MM_100TH );
352 else if (eState != SfxItemState::DISABLED )
364 if ( pState && eState >= SfxItemState::DEFAULT )
383 SAL_WARN(
"svx.sidebar",
"GetModuleFieldUnit(): no module found");
392 const css::uno::Reference<css::frame::XFrame>& rxFrame,
394 css::uno::Reference<css::ui::XSidebar> xSidebar)
395 :
PanelLayout(pParent,
"ParaPropertyPanel",
"svx/ui/sidebarparagraph.ui"),
397 mxTBxHorzAlign(m_xBuilder->weld_toolbar(
"horizontalalignment")),
399 mxTBxVertAlign(m_xBuilder->weld_toolbar(
"verticalalignment")),
402 mxTBxNumBullet(m_xBuilder->weld_toolbar(
"numberbullet")),
404 mxTBxBackColor(m_xBuilder->weld_toolbar(
"backgroundcolor")),
406 mxTBxWriteDirection(m_xBuilder->weld_toolbar(
"writedirection")),
408 mxTBxParaSpacing(m_xBuilder->weld_toolbar(
"paraspacing")),
410 mxTBxLineSpacing(m_xBuilder->weld_toolbar(
"linespacing")),
412 mxTBxIndent(m_xBuilder->weld_toolbar(
"indent")),
415 mxTopDist(m_xBuilder->weld_metric_spin_button(
"aboveparaspacing",
FieldUnit::
CM)),
416 mxBottomDist(m_xBuilder->weld_metric_spin_button(
"belowparaspacing",
FieldUnit::
CM)),
417 mxLeftIndent(m_xBuilder->weld_metric_spin_button(
"beforetextindent",
FieldUnit::
CM)),
418 mxRightIndent(m_xBuilder->weld_metric_spin_button(
"aftertextindent",
FieldUnit::
CM)),
419 mxFLineIndent(m_xBuilder->weld_metric_spin_button(
"firstlineindent",
FieldUnit::
CM)),
427 maLRSpaceControl (SID_ATTR_PARA_LRSPACE,*pBindings,*this),
428 maULSpaceControl (SID_ATTR_PARA_ULSPACE, *pBindings,*this),
429 m_aMetricCtl (SID_ATTR_METRIC, *pBindings,*this),
430 mpBindings(pBindings),
431 mxSidebar(
std::move(xSidebar))
#define CombinedEnumContext(a, e)
SAL_WARN_UNUSED_RESULT Point LogicToLogic(const Point &rPtSource, const MapMode *pMapModeSource, const MapMode *pMapModeDest) const
SfxDispatcher * GetDispatcher() const
MapUnit GetCoreMetric() const
const SfxPoolItem * ExecuteList(sal_uInt16 nSlot, SfxCallMode nCall, std::initializer_list< SfxPoolItem const * > args, std::initializer_list< SfxPoolItem const * > internalargs=std::initializer_list< SfxPoolItem const * >())
SfxModule * GetModule() const
const SfxPoolItem * GetItem(sal_uInt16 nSlotId) const
static SAL_WARN_UNUSED_RESULT SfxViewFrame * Current()
virtual SfxObjectShell * GetObjectShell() override
short GetTextFirstLineOffset() const
void SetRight(const tools::Long nR, const sal_uInt16 nProp=100)
tools::Long GetRight() const
void SetTextLeft(const tools::Long nL, const sal_uInt16 nProp=100)
tools::Long GetTextLeft() const
void SetTextFirstLineOffset(const short nF, const sal_uInt16 nProp=100)
void SetLower(const sal_uInt16 nL, const sal_uInt16 nProp=100)
sal_uInt16 GetUpper() const
void SetUpper(const sal_uInt16 nU, const sal_uInt16 nProp=100)
sal_uInt16 GetLower() const
sal_Int32 GetCombinedContext_DI() const
void padWidthForSidebar(weld::Toolbar &rToolbar, const css::uno::Reference< css::frame::XFrame > &rFrame)
void limitWidthForSidebar(weld::SpinButton &rSpinButton)
virtual SfxBindings & GetBindings() override
#define LINK(Instance, Class, Member)
#define SAL_WARN(area, stream)
constexpr Point convert(const Point &rPoint, o3tl::Length eFrom, o3tl::Length eTo)
SVT_DLLPUBLIC FieldUnit MapToFieldUnit(const MapUnit eUnit)