From f5882e84653a181744fa379996b76a65050beab4 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Mon, 1 Aug 2022 08:17:00 +0200 Subject: sw: prefix members of SwBreakDlg, SwCondCollPage, SwDropCapsPage and ... ... SwDropCapsPict See tdf#94879 for motivation. Change-Id: I2aefa925964745680529815a729d3a60b29fc545 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137666 Reviewed-by: Miklos Vajna Tested-by: Jenkins --- sw/source/ui/chrdlg/break.cxx | 30 ++++++------- sw/source/ui/chrdlg/drpcps.cxx | 86 +++++++++++++++++++------------------- sw/source/ui/chrdlg/swuiccoll.cxx | 2 +- sw/source/uibase/inc/break.hxx | 12 +++--- sw/source/uibase/inc/drpcps.hxx | 16 +++---- sw/source/uibase/inc/swuiccoll.hxx | 4 +- 6 files changed, 75 insertions(+), 75 deletions(-) diff --git a/sw/source/ui/chrdlg/break.cxx b/sw/source/ui/chrdlg/break.cxx index 8c1c6a0ccbfc..34048c256459 100644 --- a/sw/source/ui/chrdlg/break.cxx +++ b/sw/source/ui/chrdlg/break.cxx @@ -34,25 +34,25 @@ void SwBreakDlg::rememberResult() { - nKind = 0; + m_nKind = 0; if (m_xLineBtn->get_active()) { - nKind = 1; + m_nKind = 1; m_eClear = static_cast(m_xLineClearBox->get_active()); } else if(m_xColumnBtn->get_active()) - nKind = 2; + m_nKind = 2; else if(m_xPageBtn->get_active()) { - nKind = 3; + m_nKind = 3; const int nPos = m_xPageCollBox->get_active(); if (nPos != 0 && nPos != -1) { m_aTemplate = m_xPageCollBox->get_active_text(); - oPgNum.reset(); + m_oPgNum.reset(); if (m_xPageNumBox->get_active()) { - oPgNum = o3tl::narrowing(m_xPageNumEdit->get_value()); + m_oPgNum = o3tl::narrowing(m_xPageNumEdit->get_value()); } } } @@ -97,9 +97,9 @@ IMPL_LINK_NOARG(SwBreakDlg, OkHdl, weld::Button&, void) // position 0 says 'Without'. const SwPageDesc *pPageDesc; if (nPos != 0 && nPos != -1) - pPageDesc = rSh.FindPageDescByName(m_xPageCollBox->get_active_text(), true); + pPageDesc = m_rSh.FindPageDescByName(m_xPageCollBox->get_active_text(), true); else - pPageDesc = &rSh.GetPageDesc(rSh.GetCurPageDesc()); + pPageDesc = &m_rSh.GetPageDesc(m_rSh.GetCurPageDesc()); OSL_ENSURE(pPageDesc, "Page description not found."); const sal_uInt16 nUserPage = sal_uInt16(m_xPageNumEdit->get_value()); @@ -137,9 +137,9 @@ SwBreakDlg::SwBreakDlg(weld::Window *pParent, SwWrtShell &rS) , m_xPageNumBox(m_xBuilder->weld_check_button("pagenumcb")) , m_xPageNumEdit(m_xBuilder->weld_spin_button("pagenumsb")) , m_xOkBtn(m_xBuilder->weld_button("ok")) - , rSh(rS) - , nKind(0) - , bHtmlMode(0 != ::GetHtmlMode(rS.GetView().GetDocShell())) + , m_rSh(rS) + , m_nKind(0) + , m_bHtmlMode(0 != ::GetHtmlMode(rS.GetView().GetDocShell())) { Link aLk = LINK(this, SwBreakDlg, ToggleHdl); m_xPageBtn->connect_toggled(aLk); @@ -152,10 +152,10 @@ SwBreakDlg::SwBreakDlg(weld::Window *pParent, SwWrtShell &rS) m_xPageNumEdit->connect_value_changed(LINK(this, SwBreakDlg, PageNumModifyHdl)); // Insert page description to Listbox - const size_t nCount = rSh.GetPageDescCnt(); + const size_t nCount = m_rSh.GetPageDescCnt(); for (size_t i = 0; i < nCount; ++i) { - const SwPageDesc &rPageDesc = rSh.GetPageDesc(i); + const SwPageDesc &rPageDesc = m_rSh.GetPageDesc(i); ::InsertStringSorted("", rPageDesc.GetName(), *m_xPageCollBox, 1 ); } @@ -177,13 +177,13 @@ SwBreakDlg::SwBreakDlg(weld::Window *pParent, SwWrtShell &rS) void SwBreakDlg::CheckEnable() { bool bEnable = true; - if ( bHtmlMode ) + if ( m_bHtmlMode ) { m_xColumnBtn->set_sensitive(false); m_xPageCollBox->set_sensitive(false); bEnable = false; } - else if(rSh.GetFrameType(nullptr,true) + else if(m_rSh.GetFrameType(nullptr,true) & (FrameTypeFlags::FLY_ANY | FrameTypeFlags::HEADER | FrameTypeFlags::FOOTER | FrameTypeFlags::FOOTNOTE)) { m_xPageBtn->set_sensitive(false); diff --git a/sw/source/ui/chrdlg/drpcps.cxx b/sw/source/ui/chrdlg/drpcps.cxx index 1ecb6cefeddc..46389d886c8c 100644 --- a/sw/source/ui/chrdlg/drpcps.cxx +++ b/sw/source/ui/chrdlg/drpcps.cxx @@ -55,7 +55,7 @@ using namespace css; using namespace css::uno; using namespace css::lang; -const WhichRangesContainer SwDropCapsPage::aPageRg(svl::Items); +const WhichRangesContainer SwDropCapsPage::s_aPageRg(svl::Items); void SwDropCapsPict::SetText( const OUString& rT ) { @@ -171,8 +171,8 @@ bool SwDropCapsPict::GetNextScriptSegment(size_t &nIdx, sal_Int32 &start, sal_In void SwDropCapsPict::GetFontSettings( const SwDropCapsPage& _rPage, vcl::Font& _rFont, sal_uInt16 _nWhich ) { - SfxItemSet aSet( _rPage.rSh.GetAttrPool(), _nWhich, _nWhich); - _rPage.rSh.GetCurAttr(aSet); + SfxItemSet aSet( _rPage.m_rSh.GetAttrPool(), _nWhich, _nWhich); + _rPage.m_rSh.GetCurAttr(aSet); SvxFontItem aFormatFont(static_cast( aSet.Get(_nWhich))); _rFont.SetFamily(aFormatFont.GetFamily()); @@ -194,17 +194,17 @@ void SwDropCapsPict::UpdatePaintSettings() if (mpPage) { // tdf#135244: preview generation should not jump document view - auto aLock(mpPage->rSh.GetView().GetDocShell()->LockAllViews()); + auto aLock(mpPage->m_rSh.GetView().GetDocShell()->LockAllViews()); if (!mpPage->m_xTemplateBox->get_active()) { // query the Font at paragraph's beginning - mpPage->rSh.Push(); - mpPage->rSh.SttCursorMove(); - mpPage->rSh.ClearMark(); + mpPage->m_rSh.Push(); + mpPage->m_rSh.SttCursorMove(); + mpPage->m_rSh.ClearMark(); SwWhichPara pSwuifnParaCurr = GoCurrPara; SwMoveFnCollection const & pSwuifnParaStart = fnParaStart; - mpPage->rSh.MovePara(pSwuifnParaCurr,pSwuifnParaStart); + mpPage->m_rSh.MovePara(pSwuifnParaCurr,pSwuifnParaStart); // normal GetFontSettings( *mpPage, aFont, RES_CHRATR_FONT ); @@ -214,13 +214,13 @@ void SwDropCapsPict::UpdatePaintSettings() // CTL GetFontSettings( *mpPage, maCTLFont, RES_CHRATR_CTL_FONT ); - mpPage->rSh.EndCursorMove(); - mpPage->rSh.Pop(SwCursorShell::PopMode::DeleteCurrent); + mpPage->m_rSh.EndCursorMove(); + mpPage->m_rSh.Pop(SwCursorShell::PopMode::DeleteCurrent); } else { // query Font at character template - SwCharFormat *pFormat = mpPage->rSh.GetCharStyle( + SwCharFormat *pFormat = mpPage->m_rSh.GetCharStyle( mpPage->m_xTemplateBox->get_active_text(), SwWrtShell::GETSTYLE_CREATEANY ); OSL_ENSURE(pFormat, "character style doesn't exist!"); @@ -347,29 +347,29 @@ void SwDropCapsPict::CheckScript() maScriptText = maText; maScriptChanges.clear(); - if( !xBreak.is() ) + if( !m_xBreak.is() ) { Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext(); - xBreak = css::i18n::BreakIterator::create(xContext); + m_xBreak = css::i18n::BreakIterator::create(xContext); } - sal_Int16 nScript = xBreak->getScriptType( maText, 0 ); + sal_Int16 nScript = m_xBreak->getScriptType( maText, 0 ); sal_Int32 nChg = 0; if( css::i18n::ScriptType::WEAK == nScript ) { - nChg = xBreak->endOfScript( maText, nChg, nScript ); + nChg = m_xBreak->endOfScript( maText, nChg, nScript ); if( nChg < maText.getLength() ) - nScript = xBreak->getScriptType( maText, nChg ); + nScript = m_xBreak->getScriptType( maText, nChg ); else nScript = css::i18n::ScriptType::LATIN; } for(;;) { - nChg = xBreak->endOfScript( maText, nChg, nScript ); + nChg = m_xBreak->endOfScript( maText, nChg, nScript ); maScriptChanges.emplace_back(nScript, nChg ); if( nChg >= maText.getLength() || nChg < 0 ) break; - nScript = xBreak->getScriptType( maText, nChg ); + nScript = m_xBreak->getScriptType( maText, nChg ); } } @@ -460,9 +460,9 @@ SwDropCapsDlg::SwDropCapsDlg(weld::Window *pParent, const SfxItemSet &rSet) SwDropCapsPage::SwDropCapsPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet &rSet) : SfxTabPage(pPage, pController, "modules/swriter/ui/dropcapspage.ui", "DropCapPage", &rSet) - , bModified(false) - , bFormat(true) - , rSh(::GetActiveView()->GetWrtShell()) + , m_bModified(false) + , m_bFormat(true) + , m_rSh(::GetActiveView()->GetWrtShell()) , m_xDropCapsBox(m_xBuilder->weld_check_button("checkCB_SWITCH")) , m_xWholeWordCB(m_xBuilder->weld_check_button("checkCB_WORD")) , m_xSwitchText(m_xBuilder->weld_label("labelFT_DROPCAPS")) @@ -482,18 +482,18 @@ SwDropCapsPage::SwDropCapsPage(weld::Container* pPage, weld::DialogController* p SetExchangeSupport(); const sal_uInt16 nHtmlMode = ::GetHtmlMode(static_cast(SfxObjectShell::Current())); - bHtmlMode = (nHtmlMode & HTMLMODE_ON) != 0; + m_bHtmlMode = (nHtmlMode & HTMLMODE_ON) != 0; // tdf#92154 limit comboBOX_TEMPLATE length const int nMaxWidth(m_xTemplateBox->get_approximate_digit_width() * 50); m_xTemplateBox->set_size_request(nMaxWidth , -1); // In the template dialog the text is not influenceable - m_xTextText->set_sensitive(!bFormat); - m_xTextEdit->set_sensitive(!bFormat); + m_xTextText->set_sensitive(!m_bFormat); + m_xTextEdit->set_sensitive(!m_bFormat); // Metrics - SetFieldUnit(*m_xDistanceField, GetDfltMetric(bHtmlMode)); + SetFieldUnit(*m_xDistanceField, GetDfltMetric(m_bHtmlMode)); // Install handler Link aValueChangedLk = LINK(this, SwDropCapsPage, ValueChangedHdl); @@ -526,9 +526,9 @@ std::unique_ptr SwDropCapsPage::Create(weld::Container* pPage, weld: bool SwDropCapsPage::FillItemSet(SfxItemSet *rSet) { - if (bModified) + if (m_bModified) FillSet(*rSet); - return bModified; + return m_bModified; } void SwDropCapsPage::Reset(const SfxItemSet *rSet) @@ -549,7 +549,7 @@ void SwDropCapsPage::Reset(const SfxItemSet *rSet) m_xDistanceField->set_value(0, FieldUnit::TWIP); } - ::FillCharStyleListBox(*m_xTemplateBox, rSh.GetView().GetDocShell(), true); + ::FillCharStyleListBox(*m_xTemplateBox, m_rSh.GetView().GetDocShell(), true); m_xTemplateBox->insert_text(0, SwResId(SW_STR_NONE)); @@ -566,11 +566,11 @@ void SwDropCapsPage::Reset(const SfxItemSet *rSet) // Enable controls m_xDropCapsBox->set_active(aFormatDrop.GetLines() > 1); const sal_Int32 nVal = m_xDropCapsField->get_value(); - if (bFormat) + if (m_bFormat) m_xTextEdit->set_text(GetDefaultString(nVal)); else { - m_xTextEdit->set_text(rSh.GetDropText(nVal)); + m_xTextEdit->set_text(m_rSh.GetDropText(nVal)); m_xTextEdit->set_sensitive(true); m_xTextText->set_sensitive(true); } @@ -581,14 +581,14 @@ void SwDropCapsPage::Reset(const SfxItemSet *rSet) sal_uInt16(m_xDistanceField->denormalize(m_xDistanceField->get_value(FieldUnit::TWIP)))); ClickHdl(*m_xDropCapsBox); - bModified = false; + m_bModified = false; } IMPL_LINK_NOARG(SwDropCapsPage, ClickHdl, weld::Toggleable&, void) { bool bChecked = m_xDropCapsBox->get_active(); - m_xWholeWordCB->set_sensitive(bChecked && !bHtmlMode); + m_xWholeWordCB->set_sensitive(bChecked && !m_bHtmlMode); m_xSwitchText->set_sensitive(bChecked && !m_xWholeWordCB->get_active()); m_xDropCapsField->set_sensitive(bChecked && !m_xWholeWordCB->get_active()); @@ -598,8 +598,8 @@ IMPL_LINK_NOARG(SwDropCapsPage, ClickHdl, weld::Toggleable&, void) m_xDistanceField->set_sensitive( bChecked ); m_xTemplateText->set_sensitive( bChecked ); m_xTemplateBox->set_sensitive( bChecked ); - m_xTextEdit->set_sensitive( bChecked && !bFormat ); - m_xTextText->set_sensitive( bChecked && !bFormat ); + m_xTextEdit->set_sensitive( bChecked && !m_bFormat ); + m_xTextText->set_sensitive( bChecked && !m_bFormat ); if ( bChecked ) { @@ -609,7 +609,7 @@ IMPL_LINK_NOARG(SwDropCapsPage, ClickHdl, weld::Toggleable&, void) else m_aPict.SetText(""); - bModified = true; + m_bModified = true; } IMPL_LINK_NOARG(SwDropCapsPage, WholeWordHdl, weld::Toggleable&, void) @@ -619,7 +619,7 @@ IMPL_LINK_NOARG(SwDropCapsPage, WholeWordHdl, weld::Toggleable&, void) ValueChangedHdl(*m_xDropCapsField); - bModified = true; + m_bModified = true; } void SwDropCapsPage::ModifyEntry(const weld::Entry& rEdit) @@ -634,12 +634,12 @@ void SwDropCapsPage::ModifyEntry(const weld::Entry& rEdit) : 0; bool bSetText = false; - if (bFormat || rSh.GetDropText(1).isEmpty()) + if (m_bFormat || m_rSh.GetDropText(1).isEmpty()) sPreview = GetDefaultString(nVal); else { bSetText = true; - sPreview = rSh.GetDropText(nVal); + sPreview = m_rSh.GetDropText(nVal); } OUString sEdit(m_xTextEdit->get_text()); @@ -668,7 +668,7 @@ void SwDropCapsPage::ModifyEntry(const weld::Entry& rEdit) else m_aPict.SetDistance(o3tl::narrowing(m_xDistanceField->denormalize(m_xDistanceField->get_value(FieldUnit::TWIP)))); - bModified = true; + m_bModified = true; } IMPL_LINK(SwDropCapsPage, ModifyHdl, weld::Entry&, rEdit, void) @@ -689,12 +689,12 @@ IMPL_LINK(SwDropCapsPage, MetricValueChangedHdl, weld::MetricSpinButton&, rEdit, IMPL_LINK_NOARG(SwDropCapsPage, SelectHdl, weld::ComboBox&, void) { m_aPict.UpdatePaintSettings(); - bModified = true; + m_bModified = true; } void SwDropCapsPage::FillSet( SfxItemSet &rSet ) { - if(!bModified) + if(!m_bModified) return; SwFormatDrop aFormat; @@ -710,7 +710,7 @@ void SwDropCapsPage::FillSet( SfxItemSet &rSet ) // template if (m_xTemplateBox->get_active()) - aFormat.SetCharFormat(rSh.GetCharStyle(m_xTemplateBox->get_active_text())); + aFormat.SetCharFormat(m_rSh.GetCharStyle(m_xTemplateBox->get_active_text())); } else { @@ -726,7 +726,7 @@ void SwDropCapsPage::FillSet( SfxItemSet &rSet ) // hard text formatting // Bug 24974: in designer/template catalog this doesn't make sense!! - if (!bFormat && m_xDropCapsBox->get_active()) + if (!m_bFormat && m_xDropCapsBox->get_active()) { OUString sText(m_xTextEdit->get_text()); diff --git a/sw/source/ui/chrdlg/swuiccoll.cxx b/sw/source/ui/chrdlg/swuiccoll.cxx index 2b1aca870165..2a478a5c9111 100644 --- a/sw/source/ui/chrdlg/swuiccoll.cxx +++ b/sw/source/ui/chrdlg/swuiccoll.cxx @@ -33,7 +33,7 @@ #include -const WhichRangesContainer SwCondCollPage::m_aPageRg(svl::Items); +const WhichRangesContainer SwCondCollPage::s_aPageRg(svl::Items); SwCondCollPage::SwCondCollPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet &rSet) : SfxTabPage(pPage, pController, "modules/swriter/ui/conditionpage.ui", "ConditionPage", &rSet) diff --git a/sw/source/uibase/inc/break.hxx b/sw/source/uibase/inc/break.hxx index 79cf295eb353..0e39075107e4 100644 --- a/sw/source/uibase/inc/break.hxx +++ b/sw/source/uibase/inc/break.hxx @@ -39,13 +39,13 @@ class SwBreakDlg final : public weld::GenericDialogController std::unique_ptr m_xPageNumEdit; std::unique_ptr m_xOkBtn; - SwWrtShell& rSh; + SwWrtShell& m_rSh; OUString m_aTemplate; - sal_uInt16 nKind; - ::std::optional oPgNum; + sal_uInt16 m_nKind; + ::std::optional m_oPgNum; std::optional m_eClear; - bool bHtmlMode; + bool m_bHtmlMode; DECL_LINK(ToggleHdl, weld::Toggleable&, void); DECL_LINK(ChangeHdl, weld::ComboBox&, void); @@ -59,8 +59,8 @@ class SwBreakDlg final : public weld::GenericDialogController public: SwBreakDlg(weld::Window* pParent, SwWrtShell& rSh); const OUString& GetTemplateName() const { return m_aTemplate; } - sal_uInt16 GetKind() const { return nKind; } - const ::std::optional& GetPageNumber() const { return oPgNum; } + sal_uInt16 GetKind() const { return m_nKind; } + const ::std::optional& GetPageNumber() const { return m_oPgNum; } const std::optional& GetClear() const { return m_eClear; } }; diff --git a/sw/source/uibase/inc/drpcps.hxx b/sw/source/uibase/inc/drpcps.hxx index d1b0a09d082a..7eca0dbd7958 100644 --- a/sw/source/uibase/inc/drpcps.hxx +++ b/sw/source/uibase/inc/drpcps.hxx @@ -65,7 +65,7 @@ class SwDropCapsPict final : public weld::CustomWidgetController SvxFont maCJKFont; SvxFont maCTLFont; Size maTextSize; - css::uno::Reference< css::i18n::XBreakIterator > xBreak; + css::uno::Reference< css::i18n::XBreakIterator > m_xBreak; virtual void Paint(vcl::RenderContext& /*rRenderContext*/, const tools::Rectangle &rRect) override; void CheckScript(); @@ -112,11 +112,11 @@ class SwDropCapsPage final : public SfxTabPage friend class SwDropCapsPict; SwDropCapsPict m_aPict; - bool bModified; - bool bFormat; - bool bHtmlMode; + bool m_bModified; + bool m_bFormat; + bool m_bHtmlMode; - SwWrtShell &rSh; + SwWrtShell &m_rSh; std::unique_ptr m_xDropCapsBox; std::unique_ptr m_xWholeWordCB; @@ -144,20 +144,20 @@ friend class SwDropCapsPict; DECL_LINK(SelectHdl, weld::ComboBox&, void); DECL_LINK(WholeWordHdl, weld::Toggleable&, void); - static const WhichRangesContainer aPageRg; + static const WhichRangesContainer s_aPageRg; public: SwDropCapsPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet &rSet); virtual ~SwDropCapsPage() override; static std::unique_ptr Create(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet *rSet); - static WhichRangesContainer GetRanges() { return aPageRg; } + static WhichRangesContainer GetRanges() { return s_aPageRg; } virtual bool FillItemSet( SfxItemSet *rSet) override; virtual void Reset (const SfxItemSet *rSet) override; - void SetFormat(bool bSet){bFormat = bSet;} + void SetFormat(bool bSet){m_bFormat = bSet;} }; #endif diff --git a/sw/source/uibase/inc/swuiccoll.hxx b/sw/source/uibase/inc/swuiccoll.hxx index 66cd1410115e..aff7f533ab11 100644 --- a/sw/source/uibase/inc/swuiccoll.hxx +++ b/sw/source/uibase/inc/swuiccoll.hxx @@ -50,14 +50,14 @@ class SwCondCollPage final : public SfxTabPage void AssignRemove(const weld::Widget*); void SelectHdl(const weld::Widget*); - static const WhichRangesContainer m_aPageRg; + static const WhichRangesContainer s_aPageRg; public: SwCondCollPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet &rSet); virtual ~SwCondCollPage() override; static std::unique_ptr Create(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet *rSet); - static WhichRangesContainer GetRanges() { return m_aPageRg; } + static WhichRangesContainer GetRanges() { return s_aPageRg; } virtual bool FillItemSet( SfxItemSet *rSet) override; virtual void Reset (const SfxItemSet *rSet) override; -- cgit