diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2020-09-21 08:04:00 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2020-09-21 09:46:12 +0200 |
commit | df86ec5d465875a5c59017c24578ca9153440d0b (patch) | |
tree | 08053538a6d2d31f505ac7e3cb831a2689aa6391 /sw/source/core/fields | |
parent | de59062d95605e5c91d687e3441399ffb05ff2dc (diff) |
sw: prefix members of SwGlblDocContent, SwIntrnlRefLink, SwPostItField ...
... and SwTextAPIEditSource
See tdf#94879 for motivation.
Change-Id: If9af8e5fb5d750547a1be9229f69bb79ae4bb0e2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103080
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'sw/source/core/fields')
-rw-r--r-- | sw/source/core/fields/ddefld.cxx | 41 | ||||
-rw-r--r-- | sw/source/core/fields/docufld.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/fields/textapi.cxx | 74 |
3 files changed, 60 insertions, 59 deletions
diff --git a/sw/source/core/fields/ddefld.cxx b/sw/source/core/fields/ddefld.cxx index 0b80f7feb2ae..9c4ba9c762cb 100644 --- a/sw/source/core/fields/ddefld.cxx +++ b/sw/source/core/fields/ddefld.cxx @@ -45,11 +45,12 @@ namespace { class SwIntrnlRefLink : public SwBaseLink { - SwDDEFieldType& rFieldType; + SwDDEFieldType& m_rFieldType; + public: - SwIntrnlRefLink( SwDDEFieldType& rType, SfxLinkUpdateMode nUpdateType ) - : SwBaseLink( nUpdateType, SotClipboardFormatId::STRING ), - rFieldType( rType ) + SwIntrnlRefLink(SwDDEFieldType& rType, SfxLinkUpdateMode nUpdateType) + : SwBaseLink(nUpdateType, SotClipboardFormatId::STRING) + , m_rFieldType(rType) {} virtual void Closed() override; @@ -87,9 +88,9 @@ public: if( bDel ) sStr = sStr.copy( 0, n ); - rFieldType.SetExpansion( sStr ); + m_rFieldType.SetExpansion(sStr); // set Expansion first! (otherwise this flag will be deleted) - rFieldType.SetCRLFDelFlag( bDel ); + m_rFieldType.SetCRLFDelFlag(bDel); } break; @@ -98,20 +99,20 @@ public: return SUCCESS; } - OSL_ENSURE( rFieldType.GetDoc(), "no pDoc" ); + OSL_ENSURE(m_rFieldType.GetDoc(), "no pDoc"); // no dependencies left? - if( rFieldType.HasWriterListeners() && !rFieldType.IsModifyLocked() && !ChkNoDataFlag() ) + if (m_rFieldType.HasWriterListeners() && !m_rFieldType.IsModifyLocked() && !ChkNoDataFlag()) { - SwViewShell* pSh = rFieldType.GetDoc()->getIDocumentLayoutAccess().GetCurrentViewShell(); - SwEditShell* pESh = rFieldType.GetDoc()->GetEditShell(); + SwViewShell* pSh = m_rFieldType.GetDoc()->getIDocumentLayoutAccess().GetCurrentViewShell(); + SwEditShell* pESh = m_rFieldType.GetDoc()->GetEditShell(); // Search for fields. If no valid found, disconnect. SwMsgPoolItem aUpdateDDE( RES_UPDATEDDETBL ); - rFieldType.LockModify(); + m_rFieldType.LockModify(); std::vector<SwFormatField*> vFields; - rFieldType.GatherFields(vFields, false); + m_rFieldType.GatherFields(vFields, false); if(vFields.size()) { if(pESh) @@ -127,7 +128,7 @@ public: pFormatField->UpdateTextNode( nullptr, &aUpdateDDE ); } - rFieldType.UnlockModify(); + m_rFieldType.UnlockModify(); if(vFields.size()) { @@ -146,15 +147,15 @@ public: void SwIntrnlRefLink::Closed() { - if( rFieldType.GetDoc() && !rFieldType.GetDoc()->IsInDtor() ) + if (m_rFieldType.GetDoc() && !m_rFieldType.GetDoc()->IsInDtor()) { // advise goes, convert all fields into text? - SwViewShell* pSh = rFieldType.GetDoc()->getIDocumentLayoutAccess().GetCurrentViewShell(); - SwEditShell* pESh = rFieldType.GetDoc()->GetEditShell(); + SwViewShell* pSh = m_rFieldType.GetDoc()->getIDocumentLayoutAccess().GetCurrentViewShell(); + SwEditShell* pESh = m_rFieldType.GetDoc()->GetEditShell(); if( pESh ) { pESh->StartAllAction(); - pESh->FieldToText( &rFieldType ); + pESh->FieldToText(&m_rFieldType); pESh->EndAllAction(); } else @@ -173,15 +174,15 @@ const SwNode* SwIntrnlRefLink::GetAnchor() const { // here, any anchor of the normal NodesArray should be sufficient const SwNode* pNd = nullptr; - rFieldType.CallSwClientNotify(sw::LinkAnchorSearchHint(rFieldType.GetDoc()->GetNodes(), pNd)); + m_rFieldType.CallSwClientNotify( + sw::LinkAnchorSearchHint(m_rFieldType.GetDoc()->GetNodes(), pNd)); return pNd; } bool SwIntrnlRefLink::IsInRange( sal_uLong nSttNd, sal_uLong nEndNd ) const { bool bInRange = false; - rFieldType.CallSwClientNotify(sw::InRangeSearchHint( - nSttNd, nEndNd, bInRange)); + m_rFieldType.CallSwClientNotify(sw::InRangeSearchHint(nSttNd, nEndNd, bInRange)); return bInRange; } diff --git a/sw/source/core/fields/docufld.cxx b/sw/source/core/fields/docufld.cxx index 8529b27a05ad..35bf08b5a96e 100644 --- a/sw/source/core/fields/docufld.cxx +++ b/sw/source/core/fields/docufld.cxx @@ -1720,7 +1720,7 @@ std::unique_ptr<SwFieldType> SwPostItFieldType::Copy() const // PostIt field -sal_uInt32 SwPostItField::m_nLastPostItId = 1; +sal_uInt32 SwPostItField::s_nLastPostItId = 1; SwPostItField::SwPostItField( SwPostItFieldType* pT, const OUString& rAuthor, @@ -1739,7 +1739,7 @@ SwPostItField::SwPostItField( SwPostItFieldType* pT, , m_aDateTime( rDateTime ) , m_bResolved( bResolved ) { - m_nPostItId = nPostItId == 0 ? m_nLastPostItId++ : nPostItId; + m_nPostItId = nPostItId == 0 ? s_nLastPostItId++ : nPostItId; } SwPostItField::~SwPostItField() diff --git a/sw/source/core/fields/textapi.cxx b/sw/source/core/fields/textapi.cxx index 070e1041f449..e0eb014d303a 100644 --- a/sw/source/core/fields/textapi.cxx +++ b/sw/source/core/fields/textapi.cxx @@ -84,8 +84,8 @@ SwTextAPIEditSource::SwTextAPIEditSource( const SwTextAPIEditSource& rSource ) : SvxEditSource( *this ) { // shallow copy; uses internal refcounting - pImpl = rSource.pImpl; - pImpl->mnRef++; + m_pImpl = rSource.m_pImpl; + m_pImpl->mnRef++; } std::unique_ptr<SvxEditSource> SwTextAPIEditSource::Clone() const @@ -99,93 +99,93 @@ void SwTextAPIEditSource::UpdateData() } SwTextAPIEditSource::SwTextAPIEditSource(SwDoc* pDoc) -: pImpl(new SwTextAPIEditSource_Impl) +: m_pImpl(new SwTextAPIEditSource_Impl) { - pImpl->mpPool = &pDoc->GetDocShell()->GetPool(); - pImpl->mpDoc = pDoc; - pImpl->mnRef = 1; + m_pImpl->mpPool = &pDoc->GetDocShell()->GetPool(); + m_pImpl->mpDoc = pDoc; + m_pImpl->mnRef = 1; } SwTextAPIEditSource::~SwTextAPIEditSource() { - if (!--pImpl->mnRef) - delete pImpl; + if (!--m_pImpl->mnRef) + delete m_pImpl; } void SwTextAPIEditSource::Dispose() { - pImpl->mpPool=nullptr; - pImpl->mpDoc=nullptr; - pImpl->mpTextForwarder.reset(); - pImpl->mpOutliner.reset(); + m_pImpl->mpPool=nullptr; + m_pImpl->mpDoc=nullptr; + m_pImpl->mpTextForwarder.reset(); + m_pImpl->mpOutliner.reset(); } SvxTextForwarder* SwTextAPIEditSource::GetTextForwarder() { - if( !pImpl->mpPool ) + if( !m_pImpl->mpPool ) return nullptr; // mpPool == 0 can be used to flag this as disposed - if( !pImpl->mpOutliner ) + if( !m_pImpl->mpOutliner ) { //init draw model first - pImpl->mpDoc->getIDocumentDrawModelAccess().GetOrCreateDrawModel(); - pImpl->mpOutliner.reset(new Outliner(pImpl->mpPool, OutlinerMode::TextObject)); - pImpl->mpDoc->SetCalcFieldValueHdl(pImpl->mpOutliner.get()); + m_pImpl->mpDoc->getIDocumentDrawModelAccess().GetOrCreateDrawModel(); + m_pImpl->mpOutliner.reset(new Outliner(m_pImpl->mpPool, OutlinerMode::TextObject)); + m_pImpl->mpDoc->SetCalcFieldValueHdl(m_pImpl->mpOutliner.get()); } - if( !pImpl->mpTextForwarder ) + if( !m_pImpl->mpTextForwarder ) { - pImpl->mpTextForwarder.reset(new SvxOutlinerForwarder(*pImpl->mpOutliner, false)); + m_pImpl->mpTextForwarder.reset(new SvxOutlinerForwarder(*m_pImpl->mpOutliner, false)); } - return pImpl->mpTextForwarder.get(); + return m_pImpl->mpTextForwarder.get(); } void SwTextAPIEditSource::SetText( OutlinerParaObject const & rText ) { - if ( pImpl->mpPool ) + if ( m_pImpl->mpPool ) { - if( !pImpl->mpOutliner ) + if( !m_pImpl->mpOutliner ) { //init draw model first - pImpl->mpDoc->getIDocumentDrawModelAccess().GetOrCreateDrawModel(); - pImpl->mpOutliner.reset(new Outliner(pImpl->mpPool, OutlinerMode::TextObject)); - pImpl->mpDoc->SetCalcFieldValueHdl(pImpl->mpOutliner.get()); + m_pImpl->mpDoc->getIDocumentDrawModelAccess().GetOrCreateDrawModel(); + m_pImpl->mpOutliner.reset(new Outliner(m_pImpl->mpPool, OutlinerMode::TextObject)); + m_pImpl->mpDoc->SetCalcFieldValueHdl(m_pImpl->mpOutliner.get()); } - pImpl->mpOutliner->SetText( rText ); + m_pImpl->mpOutliner->SetText( rText ); } } void SwTextAPIEditSource::SetString( const OUString& rText ) { - if ( !pImpl->mpPool ) + if ( !m_pImpl->mpPool ) return; - if( !pImpl->mpOutliner ) + if( !m_pImpl->mpOutliner ) { //init draw model first - pImpl->mpDoc->getIDocumentDrawModelAccess().GetOrCreateDrawModel(); - pImpl->mpOutliner.reset(new Outliner(pImpl->mpPool, OutlinerMode::TextObject)); - pImpl->mpDoc->SetCalcFieldValueHdl(pImpl->mpOutliner.get()); + m_pImpl->mpDoc->getIDocumentDrawModelAccess().GetOrCreateDrawModel(); + m_pImpl->mpOutliner.reset(new Outliner(m_pImpl->mpPool, OutlinerMode::TextObject)); + m_pImpl->mpDoc->SetCalcFieldValueHdl(m_pImpl->mpOutliner.get()); } else - pImpl->mpOutliner->Clear(); - pImpl->mpOutliner->Insert( rText ); + m_pImpl->mpOutliner->Clear(); + m_pImpl->mpOutliner->Insert( rText ); } std::unique_ptr<OutlinerParaObject> SwTextAPIEditSource::CreateText() { - if ( pImpl->mpPool && pImpl->mpOutliner ) - return pImpl->mpOutliner->CreateParaObject(); + if ( m_pImpl->mpPool && m_pImpl->mpOutliner ) + return m_pImpl->mpOutliner->CreateParaObject(); else return nullptr; } OUString SwTextAPIEditSource::GetText() const { - if ( pImpl->mpPool && pImpl->mpOutliner ) - return pImpl->mpOutliner->GetEditEngine().GetText(); + if ( m_pImpl->mpPool && m_pImpl->mpOutliner ) + return m_pImpl->mpOutliner->GetEditEngine().GetText(); else return OUString(); } |