23#include <svx/svxids.hrc>
24#include <svx/strings.hrc>
26#include <bitmaps.hlst>
36#define IID_BOTTOMLOCK 1
44 SID_ATTR_ALIGN_STACKED, SID_ATTR_ALIGN_LINEBREAK,
45 SID_ATTR_ALIGN_INDENT, SID_ATTR_ALIGN_INDENT,
46 SID_ATTR_ALIGN_DEGREES, SID_ATTR_ALIGN_DEGREES,
47 SID_ATTR_ALIGN_LOCKPOS, SID_ATTR_ALIGN_LOCKPOS,
48 SID_ATTR_ALIGN_HYPHENATION, SID_ATTR_ALIGN_HYPHENATION,
49 SID_ATTR_FRAMEDIRECTION, SID_ATTR_FRAMEDIRECTION,
50 SID_ATTR_ALIGN_ASIANVERTICAL, SID_ATTR_ALIGN_ASIANVERTICAL,
51 SID_ATTR_ALIGN_SHRINKTOFIT, SID_ATTR_ALIGN_SHRINKTOFIT,
52 SID_ATTR_ALIGN_HOR_JUSTIFY, SID_ATTR_ALIGN_VER_JUSTIFY>);
57template<
typename JustContainerType,
typename JustEnumType>
58void lcl_MaybeResetAlignToDistro(
66 JustContainerType eVal =
static_cast<JustContainerType
>(
p->GetEnumValue());
77 if (eMethod == SvxCellJustifyMethod::Distribute)
87 if (rLB.
find_id(OUString::number(nListId)) == -1)
93 eJM = SvxCellJustifyMethod::Distribute;
97 if (rOldItem.GetValue() == eJM)
110 :
SfxTabPage(pPage, pController,
"cui/ui/cellalignment.ui",
"CellAlignPage", &rCoreAttrs)
111 , m_aVsRefEdge(nullptr)
113 , m_xLbHorAlign(m_xBuilder->weld_combo_box(
"comboboxHorzAlign"))
114 , m_xFtIndent(m_xBuilder->weld_label(
"labelIndent"))
115 , m_xEdIndent(m_xBuilder->weld_metric_spin_button(
"spinIndentFrom",
FieldUnit::
POINT))
116 , m_xFtVerAlign(m_xBuilder->weld_label(
"labelVertAlign"))
117 , m_xLbVerAlign(m_xBuilder->weld_combo_box(
"comboboxVertAlign"))
119 , m_xFtRotate(m_xBuilder->weld_label(
"labelDegrees"))
120 , m_xNfRotate(m_xBuilder->weld_metric_spin_button(
"spinDegrees",
FieldUnit::
DEGREE))
121 , m_xFtRefEdge(m_xBuilder->weld_label(
"labelRefEdge"))
123 , m_xCbStacked(m_xBuilder->weld_check_button(
"checkVertStack"))
124 , m_xCbAsianMode(m_xBuilder->weld_check_button(
"checkAsianMode"))
126 , m_xBtnWrap(m_xBuilder->weld_check_button(
"checkWrapTextAuto"))
127 , m_xBtnHyphen(m_xBuilder->weld_check_button(
"checkHyphActive"))
128 , m_xBtnShrink(m_xBuilder->weld_check_button(
"checkShrinkFitCellSize"))
131 , m_xFtBotLock(m_xBuilder->weld_label(
"labelSTR_BOTTOMLOCK"))
132 , m_xFtTopLock(m_xBuilder->weld_label(
"labelSTR_TOPLOCK"))
133 , m_xFtCelLock(m_xBuilder->weld_label(
"labelSTR_CELLLOCK"))
134 , m_xFtABCD(m_xBuilder->weld_label(
"labelABCD"))
135 , m_xAlignmentFrame(m_xBuilder->weld_widget(
"alignment"))
136 , m_xOrientFrame(m_xBuilder->weld_widget(
"orientation"))
137 , m_xPropertiesFrame(m_xBuilder->weld_widget(
"properties"))
138 , m_xVsRefEdge(new
weld::CustomWeld(*m_xBuilder,
"references", m_aVsRefEdge))
140 , m_xCtrlDialWin(new
weld::CustomWeld(*m_xBuilder,
"dialcontrol", *m_xCtrlDial))
176 return std::make_unique<AlignmentTabPage>(pPage, pController, *rAttrSet);
185 sal_uInt16 nWhich =
GetWhich(SID_ATTR_ALIGN_HOR_JUSTIFY);
192 eJustify = SvxCellHorJustify::Standard;
195 eJustify = SvxCellHorJustify::Left;
198 eJustify = SvxCellHorJustify::Center;
201 eJustify = SvxCellHorJustify::Right;
205 eJustify = SvxCellHorJustify::Block;
208 eJustify = SvxCellHorJustify::Repeat;
214 else if (SfxItemState::DEFAULT == rOldSet.
GetItemState(nWhich,
false))
217 nWhich =
GetWhich(SID_ATTR_ALIGN_INDENT);
221 *
rSet, SID_ATTR_ALIGN_INDENT));
223 std::unique_ptr<SfxUInt16Item> pNewIndentItem(pIndentItem->
Clone());
224 pNewIndentItem->SetValue(
m_xEdIndent->get_value(FieldUnit::TWIP));
225 rSet->
Put(std::move(pNewIndentItem));
228 else if (SfxItemState::DEFAULT == rOldSet.
GetItemState(nWhich,
false))
231 nWhich =
GetWhich(SID_ATTR_ALIGN_VER_JUSTIFY);
238 eJustify = SvxCellVerJustify::Standard;
241 eJustify = SvxCellVerJustify::Top;
244 eJustify = SvxCellVerJustify::Center;
247 eJustify = SvxCellVerJustify::Bottom;
251 eJustify = SvxCellVerJustify::Block;
257 else if (SfxItemState::DEFAULT == rOldSet.
GetItemState(nWhich,
false))
260 nWhich =
GetWhich(SID_ATTR_ALIGN_DEGREES);
264 *
rSet, SID_ATTR_ALIGN_DEGREES));
266 std::unique_ptr<SdrAngleItem> pNewAngleItem(pAngleItem->
Clone());
267 pNewAngleItem->SetValue(
m_xCtrlDial->GetRotation());
268 rSet->
Put(std::move(pNewAngleItem));
271 else if (SfxItemState::DEFAULT == rOldSet.
GetItemState(nWhich,
false))
294 else if (SfxItemState::DEFAULT == rOldSet.
GetItemState(nWhichLockPos,
false))
297 nWhich =
GetWhich(SID_ATTR_ALIGN_STACKED);
301 *
rSet, SID_ATTR_ALIGN_STACKED));
303 std::unique_ptr<SfxBoolItem> pNewStackItem(pStackItem->
Clone());
305 rSet->
Put(std::move(pNewStackItem));
308 else if (SfxItemState::DEFAULT == rOldSet.
GetItemState(nWhich,
false))
311 nWhich =
GetWhich(SID_ATTR_ALIGN_ASIANVERTICAL);
317 else if (SfxItemState::DEFAULT == rOldSet.
GetItemState(nWhich,
false))
320 nWhich =
GetWhich(SID_ATTR_ALIGN_LINEBREAK);
321 if (
m_xBtnWrap->get_state_changed_from_saved())
324 *
rSet, SID_ATTR_ALIGN_LINEBREAK));
326 std::unique_ptr<SfxBoolItem> pNewWrapItem(pWrapItem->
Clone());
327 pNewWrapItem->SetValue(
m_xBtnWrap->get_active());
328 rSet->
Put(std::move(pNewWrapItem));
331 else if (SfxItemState::DEFAULT == rOldSet.
GetItemState(nWhich,
false))
334 nWhich =
GetWhich(SID_ATTR_ALIGN_HYPHENATION);
338 *
rSet, SID_ATTR_ALIGN_HYPHENATION));
340 std::unique_ptr<SfxBoolItem> pNewHyphItem(pHyphItem->
Clone());
342 rSet->
Put(std::move(pNewHyphItem));
345 else if (SfxItemState::DEFAULT == rOldSet.
GetItemState(nWhich,
false))
348 nWhich =
GetWhich(SID_ATTR_ALIGN_SHRINKTOFIT);
352 *
rSet, SID_ATTR_ALIGN_SHRINKTOFIT));
354 std::unique_ptr<SfxBoolItem> pNewShrinkItem(pShrinkItem->
Clone());
356 rSet->
Put(std::move(pNewShrinkItem));
359 else if (SfxItemState::DEFAULT == rOldSet.
GetItemState(nWhich,
false))
364 nWhich =
GetWhich(SID_ATTR_FRAMEDIRECTION);
371 else if (SfxItemState::DEFAULT == rOldSet.
GetItemState(nWhich,
false))
397 case SfxItemState::UNKNOWN:
401 case SfxItemState::DISABLED:
405 case SfxItemState::DONTCARE:
409 case SfxItemState::DEFAULT:
410 case SfxItemState::SET:
432 sal_uInt16 nWhich =
GetWhich(SID_ATTR_ALIGN_HOR_JUSTIFY);
436 case SfxItemState::UNKNOWN:
439 case SfxItemState::DISABLED:
442 case SfxItemState::DONTCARE:
445 case SfxItemState::DEFAULT:
446 case SfxItemState::SET:
449 switch (rJustifyItem.GetValue())
451 case SvxCellHorJustify::Standard:
454 case SvxCellHorJustify::Left:
457 case SvxCellHorJustify::Center:
460 case SvxCellHorJustify::Right:
463 case SvxCellHorJustify::Block:
466 case SvxCellHorJustify::Repeat:
474 nWhich =
GetWhich(SID_ATTR_ALIGN_INDENT);
478 case SfxItemState::UNKNOWN:
482 case SfxItemState::DISABLED:
485 case SfxItemState::DONTCARE:
488 case SfxItemState::DEFAULT:
489 case SfxItemState::SET:
497 nWhich =
GetWhich(SID_ATTR_ALIGN_VER_JUSTIFY);
501 case SfxItemState::UNKNOWN:
505 case SfxItemState::DISABLED:
508 case SfxItemState::DONTCARE:
511 case SfxItemState::DEFAULT:
512 case SfxItemState::SET:
515 switch (rJustifyItem.GetValue())
517 case SvxCellVerJustify::Standard:
520 case SvxCellVerJustify::Top:
523 case SvxCellVerJustify::Center:
526 case SvxCellVerJustify::Bottom:
529 case SvxCellVerJustify::Block:
537 nWhich =
GetWhich(SID_ATTR_ALIGN_DEGREES);
541 case SfxItemState::UNKNOWN:
545 case SfxItemState::DISABLED:
549 case SfxItemState::DONTCARE:
552 case SfxItemState::DEFAULT:
553 case SfxItemState::SET:
561 nWhich =
GetWhich(SID_ATTR_ALIGN_LOCKPOS);
565 case SfxItemState::UNKNOWN:
568 case SfxItemState::DISABLED:
571 case SfxItemState::DONTCARE:
574 case SfxItemState::DEFAULT:
575 case SfxItemState::SET:
578 switch (rRotateModeItem.GetValue())
580 case SvxRotateMode::SVX_ROTATE_MODE_STANDARD:
583 case SvxRotateMode::SVX_ROTATE_MODE_TOP:
586 case SvxRotateMode::SVX_ROTATE_MODE_BOTTOM:
599 nWhich =
GetWhich(SID_ATTR_FRAMEDIRECTION);
603 case SfxItemState::UNKNOWN:
606 case SfxItemState::DISABLED:
609 case SfxItemState::DONTCARE:
612 case SfxItemState::DEFAULT:
613 case SfxItemState::SET:
625 if (eHorJustifyMethodState == SfxItemState::UNKNOWN)
629 if (nDistribId != -1)
635 lcl_MaybeResetAlignToDistro<SvxCellHorJustify, SvxCellHorJustify>(
638 SvxCellHorJustify::Block);
643 if (eVerJustifyMethodState == SfxItemState::UNKNOWN)
647 if (nDistribId != -1)
653 lcl_MaybeResetAlignToDistro<SvxCellVerJustify, SvxCellVerJustify>(
656 SvxCellVerJustify::Block);
672 return DeactivateRC::LeavePage;
680 Image aBottomLock(StockImage::Yes, RID_SVXBMP_BOTTOMLOCK);
681 Image aTopLock(StockImage::Yes, RID_SVXBMP_TOPLOCK);
682 Image aCellLock(StockImage::Yes, RID_SVXBMP_CELLLOCK);
698 const sal_Int32 nHorAlign =
m_xLbHorAlign->get_active_id().toInt32();
734 m_xNfRotate->set_sensitive(!bHorFill && !bStackedText);
752 return eMethodOld != eMethodNew;
757 m_aStackedState.ButtonToggled(rToggle);
758 UpdateEnableControls();
763 m_aAsianModeState.ButtonToggled(rToggle);
768 m_aWrapState.ButtonToggled(rToggle);
769 UpdateEnableControls();
774 m_aHyphenState.ButtonToggled(rToggle);
779 m_aShrinkState.ButtonToggled(rToggle);
784 UpdateEnableControls();
#define ALIGNDLG_HORALIGN_STD
#define ALIGNDLG_VERALIGN_STD
#define ALIGNDLG_HORALIGN_RIGHT
#define ALIGNDLG_VERALIGN_BLOCK
#define ALIGNDLG_HORALIGN_LEFT
#define ALIGNDLG_VERALIGN_BOTTOM
#define ALIGNDLG_VERALIGN_DISTRIBUTED
#define ALIGNDLG_VERALIGN_TOP
#define ALIGNDLG_HORALIGN_BLOCK
#define ALIGNDLG_HORALIGN_CENTER
#define ALIGNDLG_HORALIGN_FILL
#define ALIGNDLG_VERALIGN_MID
#define ALIGNDLG_HORALIGN_DISTRIBUTED
sal_uInt16 GetValue() const
virtual SdrAngleItem * Clone(SfxItemPool *pPool=nullptr) const override
Degree100 GetValue() const
virtual SfxBoolItem * Clone(SfxItemPool *=nullptr) const override
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
void InvalidateItem(sal_uInt16 nWhich)
virtual void Reset(const SfxItemSet *)
const SfxItemSet & GetItemSet() const
void SetExchangeSupport()
virtual bool FillItemSet(SfxItemSet *)
const SfxPoolItem * GetOldItem(const SfxItemSet &rSet, sal_uInt16 nSlot, bool bDeep=true)
sal_uInt16 GetWhich(sal_uInt16 nSlot, bool bDeep=true) const
virtual SfxUInt16Item * Clone(SfxItemPool *=nullptr) const override
void InsertItem(sal_uInt16 nItemId, const Image &rImage)
void SetStyle(WinBits nStyle)
void SelectItem(sal_uInt16 nItemId)
sal_uInt16 GetSelectedItemId() const
void SetColCount(sal_uInt16 nNewCols=1)
bool IsValueChangedFromSaved() const
std::unique_ptr< weld::CheckButton > m_xCbStacked
std::unique_ptr< weld::Label > m_xFtBotLock
bool HasAlignmentChanged(const SfxItemSet &rNew, TypedWhichId< SfxEnumItemInterface > nWhich) const
std::unique_ptr< weld::Label > m_xFtCelLock
std::unique_ptr< weld::Label > m_xFtVerAlign
std::unique_ptr< weld::ComboBox > m_xLbHorAlign
std::unique_ptr< weld::Label > m_xFtTopLock
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
std::unique_ptr< weld::CheckButton > m_xBtnWrap
weld::TriStateEnabled m_aStackedState
std::unique_ptr< weld::CheckButton > m_xBtnHyphen
weld::TriStateEnabled m_aHyphenState
std::unique_ptr< weld::CustomWeld > m_xVsRefEdge
void UpdateEnableControls()
weld::TriStateEnabled m_aShrinkState
std::unique_ptr< svx::FrameDirectionListBox > m_xLbFrameDir
std::unique_ptr< weld::Widget > m_xPropertiesFrame
std::unique_ptr< weld::CheckButton > m_xBtnShrink
std::unique_ptr< weld::Label > m_xFtRotate
std::unique_ptr< weld::MetricSpinButton > m_xEdIndent
std::unique_ptr< weld::Label > m_xFtABCD
weld::TriStateEnabled m_aAsianModeState
std::unique_ptr< weld::MetricSpinButton > m_xNfRotate
weld::TriStateEnabled m_aWrapState
static const WhichRangesContainer s_pRanges
std::unique_ptr< weld::CheckButton > m_xCbAsianMode
std::unique_ptr< weld::Widget > m_xOrientFrame
std::unique_ptr< weld::Widget > m_xAlignmentFrame
virtual ~AlignmentTabPage() override
std::unique_ptr< weld::Label > m_xFtIndent
std::unique_ptr< weld::CustomWeld > m_xCtrlDialWin
std::unique_ptr< weld::ComboBox > m_xLbVerAlign
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rAttrSet)
std::unique_ptr< weld::Label > m_xFtRefEdge
virtual void Reset(const SfxItemSet *rSet) override
virtual bool FillItemSet(SfxItemSet *rSet) override
std::unique_ptr< DialControl > m_xCtrlDial
AlignmentTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rCoreSet)
virtual OUString get_active_id() const=0
virtual int find_id(const OUString &rId) const=0
virtual void set_active_id(const OUString &rStr)=0
void set_state(TriState eState)
SVXCORE_DLLPUBLIC OUString SvxResId(TranslateId aId)
#define LINK(Instance, Class, Member)
bool IsVerticalTextEnabled()
static constexpr auto Items
IMPL_LINK(ClassificationDialog, SelectClassificationHdl, weld::ComboBox &, rBox, void)
IMPL_LINK_NOARG(ClassificationDialog, OnAsyncExpandHdl, void *, void)