32#include <officecfg/Office/Common.hxx>
40 :
SfxTabPage(pPage, pController,
"modules/swriter/ui/numparapage.ui",
"NumParaPage", &rAttr)
41 , msOutlineNumbering(
SwResId(STR_OUTLINE_NUMBERING ))
43 , m_bCurNumrule(false)
44 , m_xOutlineStartBX(m_xBuilder->weld_widget(
"boxOUTLINE"))
45 , m_xOutlineLvLB(m_xBuilder->weld_combo_box(
"comboLB_OUTLINE_LEVEL"))
46 , m_xNumberStyleBX(m_xBuilder->weld_widget(
"boxNUMBER_STYLE"))
47 , m_xNumberStyleLB(m_xBuilder->weld_combo_box(
"comboLB_NUMBER_STYLE"))
48 , m_xEditNumStyleBtn(m_xBuilder->weld_button(
"editnumstyle"))
49 , m_xListLvBX(m_xBuilder->weld_widget(
"boxLIST_LEVEL"))
50 , m_xListLvLB(m_xBuilder->weld_combo_box(
"comboLB_LIST_LEVEL"))
51 , m_xNewStartCB(m_xBuilder->weld_check_button(
"checkCB_NEW_START"))
52 , m_xNewStartBX(m_xBuilder->weld_widget(
"boxNEW_START"))
53 , m_xNewStartNumberCB(m_xBuilder->weld_check_button(
"checkCB_NUMBER_NEW_START"))
54 , m_xNewStartNF(m_xBuilder->weld_spin_button(
"spinNF_NEW_START"))
55 , m_xCountParaFram(m_xBuilder->weld_widget(
"frameFL_COUNT_PARA"))
56 , m_xCountParaCB(m_xBuilder->weld_check_button(
"checkCB_COUNT_PARA"))
57 , m_xRestartParaCountCB(m_xBuilder->weld_check_button(
"checkCB_RESTART_PARACOUNT"))
58 , m_xRestartBX(m_xBuilder->weld_widget(
"boxRESTART_NO"))
59 , m_xRestartNF(m_xBuilder->weld_spin_button(
"spinNF_RESTART_PARA"))
71 pItem = pObjSh->GetItem(SID_HTML_MODE);
75 const sal_uInt16 nHtmlMode = pItem->
GetValue();
101 return std::make_unique<SwParagraphNumTabPage>(pPage, pController, *
rSet);
112 std::unique_ptr<SfxUInt16Item> pOutlineLv(pOldOutlineLv->
Clone());
113 pOutlineLv->SetValue( aOutlineLv );
114 rSet->
Put(std::move(pOutlineLv));
121 sal_Int16 nListLevel = std::max<sal_Int16>(1, aOutlineLv);
136 nListLevel = std::max<sal_Int16>(1,
m_xOutlineLvLB->get_active());
153 std::unique_ptr<SfxStringItem> pRule(pOldRule->
Clone());
154 pRule->SetValue(aStyle);
168 bNumberNewStartChecked && bNewStartChecked ? o3tl::narrowing<sal_uInt16>(
m_xNewStartNF->get_value()) : USHRT_MAX));
199 bool bHasNumberStyle =
false;
203 sal_Int16 nOutlineLv = 1;
204 if( eItemState >= SfxItemState::DEFAULT )
206 nOutlineLv =
rSet->
Get(
GetWhich(SID_ATTR_PARA_OUTLINE_LEVEL) ).GetValue();
216 if (eItemState >= SfxItemState::DEFAULT)
224 if ((!nOutlineLv && !nListLevel) || nListLevel == nOutlineLv - 1)
237 if( eItemState >= SfxItemState::DEFAULT )
243 if( aStyle ==
"Outline")
256 bHasNumberStyle =
true;
269 if(eItemState > SfxItemState::DEFAULT )
282 if( eItemState > SfxItemState::DEFAULT )
285 const bool bNotMax = USHRT_MAX != nNewStart;
302 m_xRestartNF->set_value(nStartValue == 0 ? 1 : nStartValue);
338 bool bEnable = m_xNewStartCB->get_active();
339 m_xNewStartNumberCB->set_sensitive(bEnable);
340 m_xNewStartNF->set_sensitive(bEnable && m_xNewStartNumberCB->get_active());
345 m_xRestartParaCountCB->set_sensitive(m_xCountParaCB->get_active());
347 bool bEnableRestartValue = m_xRestartParaCountCB->get_sensitive() &&
348 m_xRestartParaCountCB->get_active();
349 m_xRestartBX->set_sensitive(bEnableRestartValue);
354 int numSelectPos = m_xNumberStyleLB->get_active();
356 if (numSelectPos == 0 || numSelectPos == -1 || m_xNumberStyleLB->get_active_id() ==
"pseudo")
358 m_xEditNumStyleBtn->set_sensitive(
false);
359 m_xListLvBX->set_sensitive(
false);
363 m_xEditNumStyleBtn->set_sensitive(
true);
364 m_xListLvBX->set_sensitive(
true);
370 OUString aTemplName(m_xNumberStyleLB->get_active_text());
371 ExecuteEditNumStyle_Impl( SID_STYLE_EDIT, aTemplName, SfxStyleFamily::Pseudo );
385 SfxUInt16Item aFamily(SID_STYLE_FAMILY,
static_cast<sal_uInt16
>(nFamily));
388 if( !rStr.isEmpty() )
389 pItems[
nCount++ ] = &aItem;
390 pItems[
nCount++ ] = &aFamily;
392 pItems[
nCount++ ] =
nullptr;
396 css::uno::Any aAny(pDialogParent->
GetXWindow());
399 pInternalItems[ 0 ] = &aDialogParent;
400 pInternalItems[ 1 ] =
nullptr;
403 nId, SfxCallMode::SYNCHRON | SfxCallMode::RECORD,
404 pItems, 0, pInternalItems);
409 bool bEnable = m_bCurNumrule || rBox.get_active() > 0;
410 m_xNewStartCB->set_sensitive(bEnable);
411 NewStartHdl_Impl(*m_xNewStartCB);
sal_uInt16 GetValue() const
const SfxPoolItem * Execute(sal_uInt16 nSlot, SfxCallMode nCall=SfxCallMode::SLOT, const SfxPoolItem **pArgs=nullptr, sal_uInt16 nModi=0, const SfxPoolItem **pInternalArgs=nullptr)
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
static SAL_WARN_UNUSED_RESULT SfxObjectShell * Current()
SfxDispatcher * GetDispatcher() const
virtual SfxStringItem * Clone(SfxItemPool *=nullptr) const override
const SfxPoolItem * GetOldItem(const SfxItemSet &rSet, sal_uInt16 nSlot, bool bDeep=true)
weld::Window * GetFrameWeld() const
sal_uInt16 GetWhich(sal_uInt16 nSlot, bool bDeep=true) const
virtual SfxUInt16Item * Clone(SfxItemPool *=nullptr) const override
static SAL_WARN_UNUSED_RESULT SfxViewShell * Current()
std::unique_ptr< weld::Widget > m_xOutlineStartBX
std::unique_ptr< weld::ComboBox > m_xNumberStyleLB
std::unique_ptr< weld::SpinButton > m_xNewStartNF
std::unique_ptr< weld::Widget > m_xCountParaFram
std::unique_ptr< weld::CheckButton > m_xCountParaCB
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rSet)
std::unique_ptr< weld::CheckButton > m_xNewStartCB
std::unique_ptr< weld::ComboBox > m_xOutlineLvLB
virtual ~SwParagraphNumTabPage() override
virtual void Reset(const SfxItemSet *rSet) override
std::unique_ptr< weld::Widget > m_xNumberStyleBX
std::unique_ptr< weld::CheckButton > m_xNewStartNumberCB
std::unique_ptr< weld::CheckButton > m_xRestartParaCountCB
virtual bool FillItemSet(SfxItemSet *rSet) override
void ExecuteEditNumStyle_Impl(sal_uInt16 nId, const OUString &rStr, SfxStyleFamily nFamily)
static const WhichRangesContainer s_aPageRg
const OUString msOutlineNumbering
std::unique_ptr< weld::Button > m_xEditNumStyleBtn
std::unique_ptr< weld::ComboBox > m_xListLvLB
std::unique_ptr< weld::Widget > m_xListLvBX
virtual void ChangesApplied() override
std::unique_ptr< weld::Widget > m_xNewStartBX
std::unique_ptr< weld::SpinButton > m_xRestartNF
SwParagraphNumTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
virtual css::uno::Reference< css::awt::XWindow > GetXWindow()=0
#define FN_NUMBER_NEWSTART
#define FN_NUMBER_NEWSTART_AT
constexpr TypedWhichId< SfxInt16Item > RES_PARATR_LIST_LEVEL(83)
constexpr TypedWhichId< SwFormatLineNumber > RES_LINENUMBER(122)
#define LINK(Instance, Class, Member)
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
IMPL_LINK_NOARG(SwParagraphNumTabPage, NewStartHdl_Impl, weld::Toggleable &, void)
IMPL_LINK(SwParagraphNumTabPage, StyleHdl_Impl, weld::ComboBox &, rBox, void)
OUString SwResId(TranslateId aId)