22#include <editeng/editids.hrc>
26#include <sfx2/sfxsids.hrc>
37#define DEFAULT_LINE_SPACING 200
38#define FIX_DIST_DEF 283
39#define LINESPACE_1 100
40#define LINESPACE_15 150
41#define LINESPACE_2 200
42#define LINESPACE_115 115
46#define LLINESPACE_115 1
47#define LLINESPACE_15 2
49#define LLINESPACE_PROP 4
50#define LLINESPACE_MIN 5
51#define LLINESPACE_DURCH 6
52#define LLINESPACE_FIX 7
54#define MIN_FIXED_DISTANCE 28
59 :
WeldToolbarPopup(pControl->getFrameInterface(), pParent,
"svx/ui/paralinespacingcontrol.ui",
"ParaLineSpacingControl")
62 , mxSpacing1Button(m_xBuilder->weld_button(
"spacing_1"))
63 , mxSpacing115Button(m_xBuilder->weld_button(
"spacing_115"))
64 , mxSpacing15Button(m_xBuilder->weld_button(
"spacing_15"))
65 , mxSpacing2Button(m_xBuilder->weld_button(
"spacing_2"))
66 , mxLineDist(m_xBuilder->weld_combo_box(
"line_dist"))
67 , mxLineDistLabel(m_xBuilder->weld_label(
"value_label"))
68 , mxLineDistAtPercentBox(m_xBuilder->weld_metric_spin_button(
"percent_box",
FieldUnit::
PERCENT))
69 , mxLineDistAtMetricBox(m_xBuilder->weld_metric_spin_button(
"metric_box",
FieldUnit::
CM))
70 , mpActLineDistFld(mxLineDistAtPercentBox.
get())
129 const bool bItemStateSet(
nullptr != pCurrent);
132 : SfxItemState::DEFAULT);
136 if( bItemStateSet && (eState == SfxItemState::DEFAULT || eState == SfxItemState::SET) )
141 MapUnit eUnit = MapUnit::Map100thMM;
143 ==
"com.sun.star.text.TextDocument")
144 eUnit = MapUnit::MapTwip;
149 case SvxLineSpaceRule::Auto:
155 case SvxInterLineSpaceRule::Off:
159 case SvxInterLineSpaceRule::Prop:
185 case SvxInterLineSpaceRule::Fix:
196 case SvxLineSpaceRule::Fix:
203 case SvxLineSpaceRule::Min:
213 else if( bItemStateSet && eState == SfxItemState::DISABLED )
317 UpdateMetricFields();
358 pViewFrm->GetBindings().GetDispatcher()->ExecuteList(
359 SID_ATTR_PARA_LINESPACE, SfxCallMode::RECORD, { &aSpacing });
412 if (&rControl == mxSpacing1Button.get())
416 else if (&rControl == mxSpacing115Button.get())
420 else if (&rControl == mxSpacing15Button.get())
424 else if (&rControl == mxSpacing2Button.get())
438 pViewFrm->GetBindings().GetDispatcher()->ExecuteList(
439 SID_ATTR_PARA_LINESPACE, SfxCallMode::RECORD, { &aSpacing });
#define MIN_FIXED_DISTANCE
#define DEFAULT_LINE_SPACING
sal_uInt16 GetValue() const
SfxDispatcher * GetDispatcher() const
SfxItemState QueryState(sal_uInt16 nSID, const SfxPoolItem *&rpState)
const css::uno::Reference< css::frame::XFrame > & GetFrameInterface() const
static FieldUnit GetCurrentFieldUnit()
static SAL_WARN_UNUSED_RESULT SfxViewFrame * Current()
SfxBindings & GetBindings()
SfxFrame & GetFrame() const
void SetPropLineSpace(const sal_uInt16 nProp)
void SetInterLineSpaceRule(SvxInterLineSpaceRule e)
sal_uInt16 GetPropLineSpace() const
SvxInterLineSpaceRule GetInterLineSpaceRule() const
SvxLineSpaceRule GetLineSpaceRule() const
sal_uInt16 GetLineHeight() const
void SetLineSpaceRule(SvxLineSpaceRule e)
void SetLineHeight(const sal_uInt16 nHeight)
short GetInterLineSpace() const
void SetInterLineSpace(const short nSpace)
std::unique_ptr< weld::Button > mxSpacing1Button
void SelectEntryPos(sal_Int32 nPos)
Set the entry and update the metric fields.
weld::MetricSpinButton * mpActLineDistFld
void Initialize()
Setup the widgets with values from the document.
std::unique_ptr< weld::Button > mxSpacing115Button
virtual void GrabFocus() override
virtual ~ParaLineSpacingControl() override
std::unique_ptr< weld::ComboBox > mxLineDist
std::unique_ptr< weld::Label > mxLineDistLabel
std::unique_ptr< weld::MetricSpinButton > mxLineDistAtMetricBox
void ExecuteLineSpace()
Take the values from the widgets, and update the paragraph accordingly.
std::unique_ptr< weld::Button > mxSpacing2Button
std::unique_ptr< weld::Button > mxSpacing15Button
rtl::Reference< SvxLineSpacingToolBoxControl > mxControl
void ExecuteLineSpacing(sal_Int32 aEntry)
For the buttons - set the values, and close the popup.
std::unique_ptr< weld::MetricSpinButton > mxLineDistAtPercentBox
void UpdateMetricFields()
Set mpActlineDistFld and visibility of mpLineDist* fields according to what is just selected.
static void SetLineSpace(SvxLineSpacingItem &rLineSpace, sal_Int32 eSpace, tools::Long lValue=0)
Set one particular value.
#define LINK(Instance, Class, Member)
IMPL_LINK(HangulHanjaConversionDialog, ClickByCharacterHdl, weld::Toggleable &, rBox, void)
IMPL_LINK_NOARG(SuggestionDisplay, SelectSuggestionValueSetHdl, ValueSet *, void)
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
OUString GetModuleIdentifier(const Reference< frame::XFrame > &rxFrame)
SVT_DLLPUBLIC sal_Int64 GetCoreValue(const weld::MetricSpinButton &rField, MapUnit eUnit)
SVT_DLLPUBLIC void SetMetricValue(weld::MetricSpinButton &rField, sal_Int64 nCoreValue, MapUnit eUnit)
SVT_DLLPUBLIC void SetFieldUnit(weld::MetricSpinButton &rCtrl, FieldUnit eUnit, bool bAll=false)
constexpr OUStringLiteral PERCENT(u"Percent")