diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2020-07-13 09:01:38 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2020-07-13 09:48:06 +0200 |
commit | a78ed529e256f2a4bd8d3f82f324592834f5bb75 (patch) | |
tree | b2a894f23ca3ce63b0fa0ff1ad1afde909f8747c | |
parent | filter/graphic: create instances with uno constructors (diff) | |
download | core-a78ed529e256f2a4bd8d3f82f324592834f5bb75.tar.gz core-a78ed529e256f2a4bd8d3f82f324592834f5bb75.zip |
sw: prefix members of SwUndoField, SwUndoFieldFromAPI, ...
... SwUndoFieldFromDoc and SwXFrame
See tdf#94879 for motivation.
Change-Id: Iedf3b8d71f787036b29d0ed269e4d4d614128db9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98616
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
-rw-r--r-- | sw/inc/SwUndoField.hxx | 16 | ||||
-rw-r--r-- | sw/inc/unoframe.hxx | 8 | ||||
-rw-r--r-- | sw/source/core/undo/SwUndoField.cxx | 40 | ||||
-rw-r--r-- | sw/source/core/unocore/unoframe.cxx | 34 |
4 files changed, 49 insertions, 49 deletions
diff --git a/sw/inc/SwUndoField.hxx b/sw/inc/SwUndoField.hxx index 5b62429a1336..9abf8a49295e 100644 --- a/sw/inc/SwUndoField.hxx +++ b/sw/inc/SwUndoField.hxx @@ -29,11 +29,11 @@ class SwMsgPoolItem; class SwUndoField : public SwUndo { - sal_uLong nNodeIndex; - sal_Int32 nOffset; + sal_uLong m_nNodeIndex; + sal_Int32 m_nOffset; protected: - SwDoc * pDoc; + SwDoc * m_pDoc; SwPosition GetPosition(); public: @@ -43,9 +43,9 @@ public: class SwUndoFieldFromDoc final : public SwUndoField { - std::unique_ptr<SwField> pOldField, pNewField; - SwMsgPoolItem * pHint; - bool bUpdate; + std::unique_ptr<SwField> m_pOldField, m_pNewField; + SwMsgPoolItem * m_pHint; + bool m_bUpdate; void DoImpl(); @@ -63,8 +63,8 @@ public: class SwUndoFieldFromAPI final : public SwUndoField { - css::uno::Any aOldVal, aNewVal; - sal_uInt16 nWhich; + css::uno::Any m_aOldVal, m_aNewVal; + sal_uInt16 m_nWhich; void DoImpl(); diff --git a/sw/inc/unoframe.hxx b/sw/inc/unoframe.hxx index 1b9851e5d2e0..592c97378a0a 100644 --- a/sw/inc/unoframe.hxx +++ b/sw/inc/unoframe.hxx @@ -64,11 +64,11 @@ private: const SfxItemPropertySet* m_pPropSet; SwDoc* m_pDoc; - const FlyCntType eType; + const FlyCntType m_eType; // Descriptor-interface std::unique_ptr<BaseFrameProperties_Impl> m_pProps; - bool bIsDescriptor; + bool m_bIsDescriptor; OUString m_sName; sal_Int64 m_nDrawAspect; @@ -154,9 +154,9 @@ public: SwFrameFormat* GetFrameFormat() { return m_pFrameFormat; } - FlyCntType GetFlyCntType()const {return eType;} + FlyCntType GetFlyCntType()const {return m_eType;} - bool IsDescriptor() const {return bIsDescriptor;} + bool IsDescriptor() const {return m_bIsDescriptor;} void ResetDescriptor(); //copy text from a given source PaM static SdrObject *GetOrCreateSdrObject(SwFlyFrameFormat &rFormat); diff --git a/sw/source/core/undo/SwUndoField.cxx b/sw/source/core/undo/SwUndoField.cxx index 1eac1fa41068..3ab16ebe4ff3 100644 --- a/sw/source/core/undo/SwUndoField.cxx +++ b/sw/source/core/undo/SwUndoField.cxx @@ -35,9 +35,9 @@ using namespace ::com::sun::star::uno; SwUndoField::SwUndoField(const SwPosition & rPos ) : SwUndo(SwUndoId::FIELD, rPos.GetDoc()) { - nNodeIndex = rPos.nNode.GetIndex(); - nOffset = rPos.nContent.GetIndex(); - pDoc = rPos.GetDoc(); + m_nNodeIndex = rPos.nNode.GetIndex(); + m_nOffset = rPos.nContent.GetIndex(); + m_pDoc = rPos.GetDoc(); } SwUndoField::~SwUndoField() @@ -46,9 +46,9 @@ SwUndoField::~SwUndoField() SwPosition SwUndoField::GetPosition() { - SwNode * pNode = pDoc->GetNodes()[nNodeIndex]; + SwNode * pNode = m_pDoc->GetNodes()[m_nNodeIndex]; SwNodeIndex aNodeIndex(*pNode); - SwIndex aIndex(pNode->GetContentNode(), nOffset); + SwIndex aIndex(pNode->GetContentNode(), m_nOffset); SwPosition aResult(aNodeIndex, aIndex); return aResult; @@ -59,14 +59,14 @@ SwUndoFieldFromDoc::SwUndoFieldFromDoc(const SwPosition & rPos, const SwField & rNewField, SwMsgPoolItem * _pHint, bool _bUpdate) : SwUndoField(rPos) - , pOldField(rOldField.CopyField()) - , pNewField(rNewField.CopyField()) - , pHint(_pHint) - , bUpdate(_bUpdate) + , m_pOldField(rOldField.CopyField()) + , m_pNewField(rNewField.CopyField()) + , m_pHint(_pHint) + , m_bUpdate(_bUpdate) { - OSL_ENSURE(pOldField, "No old field!"); - OSL_ENSURE(pNewField, "No new field!"); - OSL_ENSURE(pDoc, "No document!"); + OSL_ENSURE(m_pOldField, "No old field!"); + OSL_ENSURE(m_pNewField, "No new field!"); + OSL_ENSURE(m_pDoc, "No document!"); } SwUndoFieldFromDoc::~SwUndoFieldFromDoc() @@ -80,7 +80,7 @@ void SwUndoFieldFromDoc::UndoImpl(::sw::UndoRedoContext &) if (pField) { - pDoc->getIDocumentFieldsAccess().UpdateField(pTextField, *pOldField, pHint, bUpdate); + m_pDoc->getIDocumentFieldsAccess().UpdateField(pTextField, *m_pOldField, m_pHint, m_bUpdate); } } @@ -91,11 +91,11 @@ void SwUndoFieldFromDoc::DoImpl() if (pField) { - pDoc->getIDocumentFieldsAccess().UpdateField(pTextField, *pNewField, pHint, bUpdate); + m_pDoc->getIDocumentFieldsAccess().UpdateField(pTextField, *m_pNewField, m_pHint, m_bUpdate); SwFormatField* pDstFormatField = const_cast<SwFormatField*>(&pTextField->GetFormatField()); - if (pDoc->getIDocumentFieldsAccess().GetFieldType(SwFieldIds::Postit, OUString(), false) == pDstFormatField->GetField()->GetTyp()) - pDoc->GetDocShell()->Broadcast( SwFormatFieldHint( pDstFormatField, SwFormatFieldHintWhich::INSERTED ) ); + if (m_pDoc->getIDocumentFieldsAccess().GetFieldType(SwFieldIds::Postit, OUString(), false) == pDstFormatField->GetField()->GetTyp()) + m_pDoc->GetDocShell()->Broadcast( SwFormatFieldHint( pDstFormatField, SwFormatFieldHintWhich::INSERTED ) ); } } @@ -106,14 +106,14 @@ void SwUndoFieldFromDoc::RedoImpl(::sw::UndoRedoContext &) void SwUndoFieldFromDoc::RepeatImpl(::sw::RepeatContext &) { - ::sw::UndoGuard const undoGuard(pDoc->GetIDocumentUndoRedo()); + ::sw::UndoGuard const undoGuard(m_pDoc->GetIDocumentUndoRedo()); DoImpl(); } SwUndoFieldFromAPI::SwUndoFieldFromAPI(const SwPosition & rPos, const Any & rOldVal, const Any & rNewVal, sal_uInt16 _nWhich) - : SwUndoField(rPos), aOldVal(rOldVal), aNewVal(rNewVal), nWhich(_nWhich) + : SwUndoField(rPos), m_aOldVal(rOldVal), m_aNewVal(rNewVal), m_nWhich(_nWhich) { } @@ -126,7 +126,7 @@ void SwUndoFieldFromAPI::UndoImpl(::sw::UndoRedoContext &) SwField * pField = sw::DocumentFieldsManager::GetFieldAtPos(GetPosition()); if (pField) - pField->PutValue(aOldVal, nWhich); + pField->PutValue(m_aOldVal, m_nWhich); } void SwUndoFieldFromAPI::DoImpl() @@ -134,7 +134,7 @@ void SwUndoFieldFromAPI::DoImpl() SwField * pField = sw::DocumentFieldsManager::GetFieldAtPos(GetPosition()); if (pField) - pField->PutValue(aNewVal, nWhich); + pField->PutValue(m_aNewVal, m_nWhich); } void SwUndoFieldFromAPI::RedoImpl(::sw::UndoRedoContext &) diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx index ba02dfcda14f..dcb6d0ede363 100644 --- a/sw/source/core/unocore/unoframe.cxx +++ b/sw/source/core/unocore/unoframe.cxx @@ -1195,8 +1195,8 @@ SwXFrame::SwXFrame(FlyCntType eSet, const ::SfxItemPropertySet* pSet, SwDoc *pDo , m_pFrameFormat(nullptr) , m_pPropSet(pSet) , m_pDoc(pDoc) - , eType(eSet) - , bIsDescriptor(true) + , m_eType(eSet) + , m_bIsDescriptor(true) , m_nDrawAspect(embed::Aspects::MSOLE_CONTENT) , m_nVisibleAreaWidth(0) , m_nVisibleAreaHeight(0) @@ -1215,7 +1215,7 @@ SwXFrame::SwXFrame(FlyCntType eSet, const ::SfxItemPropertySet* pSet, SwDoc *pDo aAny >>= mxStyleFamily; // In the derived class, we'll ask mxStyleFamily for the relevant default style // mxStyleFamily is initialised in the SwXFrame constructor - switch(eType) + switch(m_eType) { case FLYCNTTYPE_FRM: { @@ -1250,8 +1250,8 @@ SwXFrame::SwXFrame(SwFrameFormat& rFrameFormat, FlyCntType eSet, const ::SfxItem , m_pFrameFormat(&rFrameFormat) , m_pPropSet(pSet) , m_pDoc(nullptr) - , eType(eSet) - , bIsDescriptor(false) + , m_eType(eSet) + , m_bIsDescriptor(false) , m_nDrawAspect(embed::Aspects::MSOLE_CONTENT) , m_nVisibleAreaWidth(0) , m_nVisibleAreaHeight(0) @@ -1298,7 +1298,7 @@ OUString SwXFrame::getName() SwFrameFormat* pFormat = GetFrameFormat(); if(pFormat) return pFormat->GetName(); - if(!bIsDescriptor) + if(!m_bIsDescriptor) throw uno::RuntimeException(); return m_sName; } @@ -1315,7 +1315,7 @@ void SwXFrame::setName(const OUString& rName) throw uno::RuntimeException(); } } - else if(bIsDescriptor) + else if(m_bIsDescriptor) m_sName = rName; else throw uno::RuntimeException(); @@ -1327,7 +1327,7 @@ uno::Reference< beans::XPropertySetInfo > SwXFrame::getPropertySetInfo() static uno::Reference< beans::XPropertySetInfo > xFrameRef; static uno::Reference< beans::XPropertySetInfo > xGrfRef; static uno::Reference< beans::XPropertySetInfo > xOLERef; - switch(eType) + switch(m_eType) { case FLYCNTTYPE_FRM: if( !xFrameRef.is() ) @@ -1442,7 +1442,7 @@ void SwXFrame::setPropertyValue(const OUString& rPropertyName, const ::uno::Any& throw beans::PropertyVetoException("Property is read-only: " + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) ); SwDoc* pDoc = pFormat->GetDoc(); - if ( ((eType == FLYCNTTYPE_GRF) && isGRFATR(pEntry->nWID)) || + if ( ((m_eType == FLYCNTTYPE_GRF) && isGRFATR(pEntry->nWID)) || (FN_PARAM_CONTOUR_PP == pEntry->nWID) || (FN_UNO_IS_AUTOMATIC_CONTOUR == pEntry->nWID) || (FN_UNO_IS_PIXEL_CONTOUR == pEntry->nWID) ) @@ -1982,7 +1982,7 @@ uno::Any SwXFrame::getPropertyValue(const OUString& rPropertyName) } else if(pFormat) { - if( ((eType == FLYCNTTYPE_GRF) || (eType == FLYCNTTYPE_OLE)) && + if( ((m_eType == FLYCNTTYPE_GRF) || (m_eType == FLYCNTTYPE_OLE)) && (isGRFATR(pEntry->nWID) || pEntry->nWID == FN_PARAM_CONTOUR_PP || pEntry->nWID == FN_UNO_IS_AUTOMATIC_CONTOUR || @@ -2123,7 +2123,7 @@ uno::Any SwXFrame::getPropertyValue(const OUString& rPropertyName) GetOrCreateSdrObject(rFlyFormat); aAny <<= rFlyFormat.GetObjDescription(); } - else if(eType == FLYCNTTYPE_GRF && + else if(m_eType == FLYCNTTYPE_GRF && (rPropertyName == UNO_NAME_ACTUAL_SIZE)) { const SwNodeIndex* pIdx = pFormat->GetContent().GetContentIdx(); @@ -2413,7 +2413,7 @@ uno::Sequence< beans::PropertyState > SwXFrame::getPropertyStates( } else { - if ((eType == FLYCNTTYPE_GRF) && isGRFATR(pEntry->nWID)) + if ((m_eType == FLYCNTTYPE_GRF) && isGRFATR(pEntry->nWID)) { const SwNodeIndex* pIdx = pFormat->GetContent().GetContentIdx(); if(pIdx) @@ -2473,7 +2473,7 @@ void SwXFrame::setPropertyToDefault( const OUString& rPropertyName ) pEntry->nWID != FN_UNO_ANCHOR_TYPES && pEntry->nWID != FN_PARAM_LINK_DISPLAY_NAME) { - if ( (eType == FLYCNTTYPE_GRF) && isGRFATR(pEntry->nWID) ) + if ( (m_eType == FLYCNTTYPE_GRF) && isGRFATR(pEntry->nWID) ) { const SwNodeIndex* pIdx = pFormat->GetContent().GetContentIdx(); if(pIdx) @@ -2649,7 +2649,7 @@ uno::Reference< text::XTextRange > SwXFrame::getAnchor() void SwXFrame::ResetDescriptor() { - bIsDescriptor = false; + m_bIsDescriptor = false; mxStyleData.clear(); mxStyleFamily.clear(); m_pProps.reset(); @@ -2745,7 +2745,7 @@ void SwXFrame::attachToRange(uno::Reference<text::XTextRange> const& xTextRange, pParentFrameFormat = lcl_GetFrameFormat( *pStyle, pDoc ); SwFlyFrameFormat* pFormat = nullptr; - if( eType == FLYCNTTYPE_FRM) + if( m_eType == FLYCNTTYPE_FRM) { UnoActionContext aCont(pDoc); if (pCopySource) @@ -2787,9 +2787,9 @@ void SwXFrame::attachToRange(uno::Reference<text::XTextRange> const& xTextRange, pDoc->SetFlyName(*pFormat, m_sName); } // wake up the SwXTextFrame - static_cast<SwXTextFrame*>(this)->SetDoc( bIsDescriptor ? m_pDoc : GetFrameFormat()->GetDoc() ); + static_cast<SwXTextFrame*>(this)->SetDoc( m_bIsDescriptor ? m_pDoc : GetFrameFormat()->GetDoc() ); } - else if( eType == FLYCNTTYPE_GRF) + else if( m_eType == FLYCNTTYPE_GRF) { UnoActionContext aActionContext(pDoc); Graphic aGraphic; |