From e3b61a4bc8771fb7ef2b21ac7c82892592d94ede Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Wed, 21 Jun 2017 11:56:49 +0200 Subject: loplugin:unusedfields in sw part4 Change-Id: I1ffd51ab74b2ca809153f07f8de85e9c490749fd Reviewed-on: https://gerrit.libreoffice.org/39042 Tested-by: Jenkins Reviewed-by: Noel Grandin --- sw/source/core/access/accportions.cxx | 10 +--------- sw/source/core/access/accportions.hxx | 1 - sw/source/core/doc/DocumentStateManager.cxx | 2 -- sw/source/core/doc/swserv.cxx | 2 -- sw/source/core/docnode/node.cxx | 4 ---- sw/source/core/edit/edlingu.cxx | 5 +---- sw/source/core/frmedt/tblsel.cxx | 4 ---- sw/source/core/inc/DocumentStateManager.hxx | 1 - sw/source/core/inc/drawfont.hxx | 20 -------------------- sw/source/core/inc/frame.hxx | 3 --- sw/source/core/inc/mvsave.hxx | 1 - sw/source/core/layout/wsfrm.cxx | 1 - sw/source/core/text/frmform.cxx | 2 -- sw/source/core/text/frmpaint.cxx | 4 ---- sw/source/core/text/inftxt.cxx | 7 ------- sw/source/core/text/inftxt.hxx | 3 --- sw/source/core/text/itrform2.cxx | 1 - sw/source/core/text/itrform2.hxx | 3 --- sw/source/core/text/porhyph.hxx | 1 - sw/source/core/text/txthyph.cxx | 4 +--- 20 files changed, 3 insertions(+), 76 deletions(-) diff --git a/sw/source/core/access/accportions.cxx b/sw/source/core/access/accportions.cxx index 43d9f428cb37..d66dbfb2216d 100644 --- a/sw/source/core/access/accportions.cxx +++ b/sw/source/core/access/accportions.cxx @@ -80,8 +80,7 @@ SwAccessiblePortionData::SwAccessiblePortionData( m_aPortionAttrs(), m_pSentences( nullptr ), m_nBeforePortions( 0 ), - m_bFinished( false ), - m_bLastIsSpecial( false ) + m_bFinished( false ) { OSL_ENSURE( m_pTextNode != nullptr, "Text node is needed!" ); @@ -120,8 +119,6 @@ void SwAccessiblePortionData::Text(sal_Int32 nLength, sal_uInt16 nType, sal_Int3 // update buffer + nModelPosition m_aBuffer.append( m_pTextNode->GetText().copy(m_nModelPosition, nLength) ); m_nModelPosition += nLength; - - m_bLastIsSpecial = false; } void SwAccessiblePortionData::SetAttrFieldType( sal_uInt16 nAttrFieldType ) @@ -210,11 +207,6 @@ void SwAccessiblePortionData::Special( // update buffer + nModelPosition m_aBuffer.append( sDisplay ); m_nModelPosition += nLength; - - // remember 'last' special portion (unless it's our own 'closing' - // portions from 'Finish()' - if( nType != POR_TERMINATE ) - m_bLastIsSpecial = true; } void SwAccessiblePortionData::LineBreak(sal_Int32 /*nWidth*/) diff --git a/sw/source/core/access/accportions.hxx b/sw/source/core/access/accportions.hxx index 93ffeba0d942..69d0259f760e 100644 --- a/sw/source/core/access/accportions.hxx +++ b/sw/source/core/access/accportions.hxx @@ -68,7 +68,6 @@ class SwAccessiblePortionData : public SwPortionHandler size_t m_nBeforePortions; /// # of portions before first model character bool m_bFinished; - bool m_bLastIsSpecial; /// set if last portion was 'Special()' /// returns the index of the first position whose value is smaller /// or equal, and whose following value is equal or larger diff --git a/sw/source/core/doc/DocumentStateManager.cxx b/sw/source/core/doc/DocumentStateManager.cxx index 04a865a3f70b..dd78cf58f3b9 100644 --- a/sw/source/core/doc/DocumentStateManager.cxx +++ b/sw/source/core/doc/DocumentStateManager.cxx @@ -31,7 +31,6 @@ DocumentStateManager::DocumentStateManager( SwDoc& i_rSwdoc ) : m_rDoc( i_rSwdoc ), mbEnableSetModified(true), mbModified(false), - mbLoaded(false), mbUpdateExpField(false), mbNewDoc(false), mbInCallModified(false) @@ -116,7 +115,6 @@ void DocumentStateManager::SetUpdateExpFieldStat(bool b) void DocumentStateManager::SetLoaded() { - mbLoaded = true; } } diff --git a/sw/source/core/doc/swserv.cxx b/sw/source/core/doc/swserv.cxx index f18d00453a65..8d00223b680f 100644 --- a/sw/source/core/doc/swserv.cxx +++ b/sw/source/core/doc/swserv.cxx @@ -285,14 +285,12 @@ void SwServerObject::SetDdeBookmark( ::sw::mark::IMark& rBookmark) SwDataChanged::SwDataChanged( const SwPaM& rPam ) : pPam( &rPam ), pPos( nullptr ), pDoc( rPam.GetDoc() ) { - nNode = rPam.GetPoint()->nNode.GetIndex(); nContent = rPam.GetPoint()->nContent.GetIndex(); } SwDataChanged::SwDataChanged( SwDoc* pDc, const SwPosition& rPos ) : pPam( nullptr ), pPos( &rPos ), pDoc( pDc ) { - nNode = rPos.nNode.GetIndex(); nContent = rPos.nContent.GetIndex(); } diff --git a/sw/source/core/docnode/node.cxx b/sw/source/core/docnode/node.cxx index 4866fb5cdaad..33f3ccd908c1 100644 --- a/sw/source/core/docnode/node.cxx +++ b/sw/source/core/docnode/node.cxx @@ -1354,11 +1354,7 @@ void SwContentNode::DelFrames( bool bIsDisposeAccTable ) pCFrame->FindMaster()->Prepare( PREP_FTN_GONE ); } } - //Set acc table dispose state - pFrame->SetAccTableDispose( bIsDisposeAccTable ); pFrame->Cut(); - //Set acc table dispose state to default value - pFrame->SetAccTableDispose( true ); SwFrame::DestroyFrame(pFrame); } diff --git a/sw/source/core/edit/edlingu.cxx b/sw/source/core/edit/edlingu.cxx index e75ee2dee152..cf20c8cb4ed0 100644 --- a/sw/source/core/edit/edlingu.cxx +++ b/sw/source/core/edit/edlingu.cxx @@ -114,7 +114,6 @@ class SwSpellIter : public SwLinguIter SpellContentPositions aLastPositions; bool bBackToStartOfSentence; - bool bMoveToEndOfSentence; void CreatePortion(uno::Reference< XSpellAlternatives > const & xAlt, linguistic2::ProofreadingResult* pGrammarResult, @@ -125,7 +124,7 @@ class SwSpellIter : public SwLinguIter const SpellContentPositions& rDeletedRedlines); public: SwSpellIter() : - bBackToStartOfSentence(false), bMoveToEndOfSentence(false) {} + bBackToStartOfSentence(false) {} void Start( SwEditShell *pSh, SwDocPositions eStart, SwDocPositions eEnd ); @@ -135,7 +134,6 @@ public: void ToSentenceStart(); const svx::SpellPortions& GetLastPortions() const { return aLastPortions;} const SpellContentPositions& GetLastPositions() const {return aLastPositions;} - void ContinueAfterThisSentence() { bMoveToEndOfSentence = true; } }; /// used for text conversion @@ -1107,7 +1105,6 @@ void SwEditShell::MoveContinuationPosToEndOfCheckedSentence() if (g_pSpellIter) { g_pSpellIter->SetCurr( new SwPosition( *g_pSpellIter->GetCurrX() ) ); - g_pSpellIter->ContinueAfterThisSentence(); } } diff --git a/sw/source/core/frmedt/tblsel.cxx b/sw/source/core/frmedt/tblsel.cxx index 5bdbcae41257..5cd20aa37c2c 100644 --- a/sw/source/core/frmedt/tblsel.cxx +++ b/sw/source/core/frmedt/tblsel.cxx @@ -2250,11 +2250,7 @@ void FndBox_::DelFrames( SwTable &rTable ) // next turn. static_cast(pTabFrame)->SetFollowFlowLine( false ); } - //Set acc table dispose state - pFrame->SetAccTableDispose( false/*bAccTableDispose*/ ); pFrame->Cut(); - //Set acc table dispose state to default value. - pFrame->SetAccTableDispose( true ); SwFrame::DestroyFrame(pFrame); } } diff --git a/sw/source/core/inc/DocumentStateManager.hxx b/sw/source/core/inc/DocumentStateManager.hxx index e79f94b042a4..a4c448b543fb 100644 --- a/sw/source/core/inc/DocumentStateManager.hxx +++ b/sw/source/core/inc/DocumentStateManager.hxx @@ -54,7 +54,6 @@ private: bool mbEnableSetModified; //< FALSE: changing document modification status (temporarily) locked bool mbModified ; //< TRUE: document has changed. - bool mbLoaded ; //< TRUE: Doc loaded. bool mbUpdateExpField; //< TRUE: Update expression fields. bool mbNewDoc ; //< TRUE: new Doc. bool mbInCallModified; //< TRUE: in Set/Reset-Modified link. diff --git a/sw/source/core/inc/drawfont.hxx b/sw/source/core/inc/drawfont.hxx index c93ad1d95172..63d63568313b 100644 --- a/sw/source/core/inc/drawfont.hxx +++ b/sw/source/core/inc/drawfont.hxx @@ -56,8 +56,6 @@ class SW_DLLPUBLIC SwDrawTextInfo SwFont *m_pFnt; SwUnderlineFont* m_pUnderFnt; sal_Int32* m_pHyphPos; - long m_nLeft; - long m_nRight; long m_nKanaDiff; sal_Int32 m_nIdx; sal_Int32 m_nLen; @@ -140,8 +138,6 @@ public: m_pSmartTags = nullptr; m_pFnt = nullptr; m_pHyphPos = nullptr; - m_nLeft = 0; - m_nRight = 0; m_nKanaDiff = 0; m_nOfst = 0; m_nAscent = 0; @@ -470,22 +466,6 @@ public: #endif } - void SetLeft( long nNew ) - { - m_nLeft = nNew; -#ifdef DBG_UTIL - m_bLeft = true; -#endif - } - - void SetRight( long nNew ) - { - m_nRight = nNew; -#ifdef DBG_UTIL - m_bRight = true; -#endif - } - void SetKanaDiff( long nNew ) { m_nKanaDiff = nNew; diff --git a/sw/source/core/inc/frame.hxx b/sw/source/core/inc/frame.hxx index 47512147f30e..50eac0865054 100644 --- a/sw/source/core/inc/frame.hxx +++ b/sw/source/core/inc/frame.hxx @@ -145,7 +145,6 @@ class SW_DLLPUBLIC SwFrame: public SwClient, public SfxBroadcaster // cache for (border) attributes static SwCache *mpCache; - bool mbIfAccTableShouldDisposing; bool mbInDtor; // #i65250# @@ -573,8 +572,6 @@ public: virtual Size ChgSize( const Size& aNewSize ); virtual void Cut() = 0; - //Add a method to change the acc table dispose state. - void SetAccTableDispose(bool bDispose) { mbIfAccTableShouldDisposing = bDispose;} virtual void Paste( SwFrame* pParent, SwFrame* pSibling = nullptr ) = 0; void ValidateLineNum() { mbValidLineNum = true; } diff --git a/sw/source/core/inc/mvsave.hxx b/sw/source/core/inc/mvsave.hxx index df770da67f67..ec1576e83db8 100644 --- a/sw/source/core/inc/mvsave.hxx +++ b/sw/source/core/inc/mvsave.hxx @@ -115,7 +115,6 @@ class SwDataChanged const SwPaM* pPam; const SwPosition* pPos; SwDoc* pDoc; - sal_uLong nNode; sal_Int32 nContent; public: diff --git a/sw/source/core/layout/wsfrm.cxx b/sw/source/core/layout/wsfrm.cxx index e8b74a653468..d84100681f61 100644 --- a/sw/source/core/layout/wsfrm.cxx +++ b/sw/source/core/layout/wsfrm.cxx @@ -55,7 +55,6 @@ using namespace ::com::sun::star; SwFrame::SwFrame( SwModify *pMod, SwFrame* pSib ) : SwClient( pMod ), - mbIfAccTableShouldDisposing( false ), //A member to identify if the acc table should dispose mbInDtor(false), mnFrameId( SwFrame::mnLastFrameId++ ), mpRoot( pSib ? pSib->getRootFrame() : nullptr ), diff --git a/sw/source/core/text/frmform.cxx b/sw/source/core/text/frmform.cxx index d35ef5bad1b1..dd34f2cb61f1 100644 --- a/sw/source/core/text/frmform.cxx +++ b/sw/source/core/text/frmform.cxx @@ -1217,8 +1217,6 @@ bool SwTextFrame::FormatLine( SwTextFormatter &rLine, const bool bPrev ) const_cast(rLine.GetCurr())->SetUnderscore( bHasUnderscore ); } - if( !bUnChg ) - rLine.SetChanges(); // Calculating the good ol' nDelta pPara->GetDelta() -= long(pNew->GetLen()) - long(nOldLen); diff --git a/sw/source/core/text/frmpaint.cxx b/sw/source/core/text/frmpaint.cxx index 0e9e3d0f86a9..b1c7e195bbf9 100644 --- a/sw/source/core/text/frmpaint.cxx +++ b/sw/source/core/text/frmpaint.cxx @@ -197,8 +197,6 @@ void SwExtraPainter::PaintExtra( SwTwips nY, long nAsc, long nMax, bool bRed ) aDrawInf.SetWrong( nullptr ); aDrawInf.SetGrammarCheck( nullptr ); aDrawInf.SetSmartTags( nullptr ); - aDrawInf.SetLeft( 0 ); - aDrawInf.SetRight( LONG_MAX ); aDrawInf.SetFrame( pTextFrame ); aDrawInf.SetFont( pFnt.get() ); aDrawInf.SetSnapToGrid( false ); @@ -551,8 +549,6 @@ bool SwTextFrame::PaintEmpty( const SwRect &rRect, bool bCheck ) const { const OUString aTmp( CH_PAR ); SwDrawTextInfo aDrawInf( pSh, *pSh->GetOut(), nullptr, aTmp, 0, 1 ); - aDrawInf.SetLeft( rRect.Left() ); - aDrawInf.SetRight( rRect.Right() ); aDrawInf.SetPos( aPos ); aDrawInf.SetSpace( 0 ); aDrawInf.SetKanaComp( 0 ); diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx index 2dbe5940fb15..caedd00c9819 100644 --- a/sw/source/core/text/inftxt.cxx +++ b/sw/source/core/text/inftxt.cxx @@ -617,9 +617,6 @@ void SwTextPaintInfo::DrawText_( const OUString &rText, const SwLinePortion &rPo SwDrawTextInfo aDrawInf( m_pFrame->getRootFrame()->GetCurrShell(), *m_pOut, pSI, rText, nStart, nLength, rPor.Width(), bBullet ); - aDrawInf.SetLeft( GetPaintRect().Left() ); - aDrawInf.SetRight( GetPaintRect().Right()); - aDrawInf.SetUnderFnt( m_pUnderFnt ); const long nSpaceAdd = ( rPor.IsBlankPortion() || rPor.IsDropPortion() || @@ -1410,8 +1407,6 @@ void SwTextFormatInfo::CtorInitTextFormatInfo( OutputDevice* pRenderContext, SwT m_bInterHyph = bNewInterHyph; //! needs to be done in this order - m_nMinLeading = 2; - m_nMinTrailing = 2; m_bAutoHyph = InitHyph(); m_bIgnoreFly = false; @@ -1552,8 +1547,6 @@ SwTextFormatInfo::SwTextFormatInfo( const SwTextFormatInfo& rInf, m_nLineNetHeight = 0; m_nForcedLeftMargin = 0; - m_nMinLeading = 0; - m_nMinTrailing = 0; m_bFull = false; m_bFootnoteDone = true; m_bErgoDone = true; diff --git a/sw/source/core/text/inftxt.hxx b/sw/source/core/text/inftxt.hxx index 4b3bf68d238a..131b3f2645f4 100644 --- a/sw/source/core/text/inftxt.hxx +++ b/sw/source/core/text/inftxt.hxx @@ -499,9 +499,6 @@ class SwTextFormatInfo : public SwTextPaintInfo sal_uInt16 m_nLineNetHeight; // line height without spacing sal_uInt16 m_nForcedLeftMargin; // Shift of left margin due to frame - sal_Int16 m_nMinLeading; // minimum number of chars before hyphenation point - sal_Int16 m_nMinTrailing; // minimum number of chars after hyphenation point - bool m_bFull : 1; // Line is full bool m_bFootnoteDone : 1; // Footnote already formatted bool m_bErgoDone : 1; // ErgoDone already formatted diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx index 4259c4bf8055..ef902be38e77 100644 --- a/sw/source/core/text/itrform2.cxx +++ b/sw/source/core/text/itrform2.cxx @@ -94,7 +94,6 @@ void SwTextFormatter::CtorInitTextFormatter( SwTextFrame *pNewFrame, SwTextForma bOnceMore = false; bFlyInCntBase = false; - bChanges = false; bTruncLines = false; nCntEndHyph = 0; nCntMidHyph = 0; diff --git a/sw/source/core/text/itrform2.hxx b/sw/source/core/text/itrform2.hxx index 71e3ecddfa05..28f19b9e78c1 100644 --- a/sw/source/core/text/itrform2.hxx +++ b/sw/source/core/text/itrform2.hxx @@ -41,7 +41,6 @@ class SwTextFormatter : public SwTextPainter sal_Int32 nRightScanIdx; // scanning for portion ends bool bOnceMore : 1; // Another round? bool bFlyInCntBase : 1; // Base reference that sets a character-bound frame - bool bChanges : 1; // Flag for calculating the repaint rectangle bool bTruncLines : 1; // Flag for extending the repaint rect, if needed bool bUnclipped : 1; // Flag whether repaint is larger than the fixed line height size_t m_nHintEndIndex; // HACK for TryNewNoLengthPortion @@ -203,8 +202,6 @@ public: bool IsOnceMore() const { return bOnceMore; } void SetOnceMore( bool bNew ) { bOnceMore = bNew; } - void SetChanges() { bChanges = true; } - bool HasTruncLines() const { return bTruncLines; } void SetTruncLines( bool bNew ) { bTruncLines = bNew; } diff --git a/sw/source/core/text/porhyph.hxx b/sw/source/core/text/porhyph.hxx index 212018c4d9d4..1c954224bddc 100644 --- a/sw/source/core/text/porhyph.hxx +++ b/sw/source/core/text/porhyph.hxx @@ -59,7 +59,6 @@ class SwSoftHyphPortion : public SwHyphPortion { bool bExpand; sal_uInt16 nViewWidth; - sal_uInt16 nHyphWidth; public: SwSoftHyphPortion(); diff --git a/sw/source/core/text/txthyph.cxx b/sw/source/core/text/txthyph.cxx index df41d00845ae..a2332827a431 100644 --- a/sw/source/core/text/txthyph.cxx +++ b/sw/source/core/text/txthyph.cxx @@ -389,7 +389,7 @@ void SwHyphStrPortion::HandlePortion( SwPortionHandler& rPH ) const SwLinePortion *SwSoftHyphPortion::Compress() { return this; } SwSoftHyphPortion::SwSoftHyphPortion() : - bExpand(false), nViewWidth(0), nHyphWidth(0) + bExpand(false), nViewWidth(0) { SetLen(1); SetWhichPor( POR_SOFTHYPH ); @@ -495,7 +495,6 @@ bool SwSoftHyphPortion::Format( SwTextFormatInfo &rInf ) if( !bFull ) { // By default, we do not have a width, but we do have a height - nHyphWidth = Width(); Width(0); } return bFull; @@ -518,7 +517,6 @@ void SwSoftHyphPortion::FormatEOL( SwTextFormatInfo &rInf ) rInf.X( rInf.X() - PrtWidth() ); rInf.SetIdx( rInf.GetIdx() - GetLen() ); const bool bFull = SwHyphPortion::Format( rInf ); - nHyphWidth = Width(); // Shady business: We're allowed to get wider, but a Fly is also // being processed, which needs a correct X position -- cgit v1.2.3