diff options
Diffstat (limited to 'sw/source/core')
112 files changed, 533 insertions, 658 deletions
diff --git a/sw/source/core/access/accmap.cxx b/sw/source/core/access/accmap.cxx index 71c4a1e7e63b..b4c0782d42b8 100644 --- a/sw/source/core/access/accmap.cxx +++ b/sw/source/core/access/accmap.cxx @@ -673,7 +673,7 @@ class SwAccPreviewData input parameter - constant reference to the preview window size in TWIP; needed to determine the visible part of the logic page rectangle */ - void AdjustLogicPgRectToVisibleArea( SwRect& _iorLogicPgSwRect, + static void AdjustLogicPgRectToVisibleArea( SwRect& _iorLogicPgSwRect, const SwRect& _rPreviewPgSwRect, const Size& _rPreviewWinSize ); diff --git a/sw/source/core/access/accpara.hxx b/sw/source/core/access/accpara.hxx index 52f3a2e4706d..d0e53dccda8f 100644 --- a/sw/source/core/access/accpara.hxx +++ b/sw/source/core/access/accpara.hxx @@ -96,7 +96,7 @@ class SwAccessibleParagraph : /// get the (accessible) text string (requires frame; check before) OUString GetString(); - OUString GetDescription(); + static OUString GetDescription(); // get the current care position sal_Int32 GetCaretPos(); @@ -121,16 +121,16 @@ class SwAccessibleParagraph : // methods for checking the parameter range: // does nPos point to a char? - bool IsValidChar(sal_Int32 nPos, sal_Int32 nLength); + static bool IsValidChar(sal_Int32 nPos, sal_Int32 nLength); // does nPos point to a position? (may be behind the last character) - bool IsValidPosition(sal_Int32 nPos, sal_Int32 nLength); + static bool IsValidPosition(sal_Int32 nPos, sal_Int32 nLength); // is nBegin...nEnd a valid range? (nEnd points past the last character) - bool IsValidRange(sal_Int32 nBegin, sal_Int32 nEnd, sal_Int32 nLength); + static bool IsValidRange(sal_Int32 nBegin, sal_Int32 nEnd, sal_Int32 nLength); // Ensure ordered range (i.e. nBegin is smaller then nEnd) - void OrderRange(sal_Int32& nBegin, sal_Int32& nEnd) + static void OrderRange(sal_Int32& nBegin, sal_Int32& nEnd) { if( nBegin > nEnd ) { @@ -214,7 +214,7 @@ protected: bool GetLineBoundary( com::sun::star::i18n::Boundary& rBound, const OUString& rText, sal_Int32 nPos ); - bool GetParagraphBoundary( com::sun::star::i18n::Boundary& rBound, + static bool GetParagraphBoundary( com::sun::star::i18n::Boundary& rBound, const OUString& rText, sal_Int32 nPos ); bool GetAttributeBoundary( com::sun::star::i18n::Boundary& rBound, diff --git a/sw/source/core/access/accportions.cxx b/sw/source/core/access/accportions.cxx index 8eadf58e11dd..f9359fe76666 100644 --- a/sw/source/core/access/accportions.cxx +++ b/sw/source/core/access/accportions.cxx @@ -397,7 +397,7 @@ sal_Int32 SwAccessiblePortionData::GetModelPosition( sal_Int32 nPos ) const void SwAccessiblePortionData::FillBoundary( Boundary& rBound, const Positions_t& rPositions, - size_t nPos ) const + size_t nPos ) { rBound.startPos = rPositions[nPos]; rBound.endPos = rPositions[nPos+1]; @@ -405,7 +405,7 @@ void SwAccessiblePortionData::FillBoundary( size_t SwAccessiblePortionData::FindBreak( const Positions_t& rPositions, - sal_Int32 nValue ) const + sal_Int32 nValue ) { OSL_ENSURE( rPositions.size() >= 2, "need min + max value" ); OSL_ENSURE( rPositions[0] <= nValue, "need min value" ); @@ -462,7 +462,7 @@ size_t SwAccessiblePortionData::FindBreak( size_t SwAccessiblePortionData::FindLastBreak( const Positions_t& rPositions, - sal_Int32 nValue ) const + sal_Int32 nValue ) { size_t nResult = FindBreak( rPositions, nValue ); diff --git a/sw/source/core/access/accportions.hxx b/sw/source/core/access/accportions.hxx index 3db82a68c540..d3f879862b05 100644 --- a/sw/source/core/access/accportions.hxx +++ b/sw/source/core/access/accportions.hxx @@ -71,15 +71,15 @@ class SwAccessiblePortionData : public SwPortionHandler /// returns the index of the first position whose value is smaller /// or equal, and whose following value is equal or larger - size_t FindBreak( const Positions_t& rPositions, sal_Int32 nValue ) const; + static size_t FindBreak( const Positions_t& rPositions, sal_Int32 nValue ); /// like FindBreak, but finds the last equal or larger position - size_t FindLastBreak( const Positions_t& rPositions, sal_Int32 nValue ) const; + static size_t FindLastBreak( const Positions_t& rPositions, sal_Int32 nValue ); /// fill the boundary with the values from rPositions[nPos] - void FillBoundary(com::sun::star::i18n::Boundary& rBound, + static void FillBoundary(com::sun::star::i18n::Boundary& rBound, const Positions_t& rPositions, - size_t nPos ) const; + size_t nPos ); /// Access to portion attributes bool IsPortionAttrSet( size_t nPortionNo, sal_uInt8 nAttr ) const; diff --git a/sw/source/core/bastyp/SwSmartTagMgr.cxx b/sw/source/core/bastyp/SwSmartTagMgr.cxx index 7781c8085dea..468bd72ce3b0 100644 --- a/sw/source/core/bastyp/SwSmartTagMgr.cxx +++ b/sw/source/core/bastyp/SwSmartTagMgr.cxx @@ -53,7 +53,7 @@ void SwSmartTagMgr::modified( const lang::EventObject& rEO ) throw( RuntimeExcep SolarMutexGuard aGuard; // Installed recognizers have changed. We remove all existing smart tags: - SW_MOD()->CheckSpellChanges( false, true, true, true ); + SwModule::CheckSpellChanges( false, true, true, true ); SmartTagMgr::modified( rEO ); } @@ -63,7 +63,7 @@ void SwSmartTagMgr::changesOccurred( const util::ChangesEvent& rEvent ) throw( R SolarMutexGuard aGuard; // Configuration has changed. We remove all existing smart tags: - SW_MOD()->CheckSpellChanges( false, true, true, true ); + SwModule::CheckSpellChanges( false, true, true, true ); SmartTagMgr::changesOccurred( rEvent ); } diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx index 2085aaad4bac..98e3360c8515 100644 --- a/sw/source/core/crsr/crsrsh.cxx +++ b/sw/source/core/crsr/crsrsh.cxx @@ -605,7 +605,7 @@ void SwCrsrShell::ExtendedSelectAll(bool bFootnotes) pPos->nContent.Assign( rNodes.GoNext( &pPos->nNode ), 0 ); pPos = m_pCurCrsr->GetMark(); pPos->nNode = rNodes.GetEndOfContent(); - SwCntntNode* pCNd = rNodes.GoPrevious( &pPos->nNode ); + SwCntntNode* pCNd = SwNodes::GoPrevious( &pPos->nNode ); pPos->nContent.Assign( pCNd, pCNd ? pCNd->Len() : 0 ); } @@ -616,7 +616,7 @@ bool SwCrsrShell::ExtendedSelectedAll(bool bFootnotes) SwCntntNode* pStart = rNodes.GoNext(&nNode); nNode = rNodes.GetEndOfContent(); - SwCntntNode* pEnd = rNodes.GoPrevious(&nNode); + SwCntntNode* pEnd = SwNodes::GoPrevious(&nNode); if (!pStart || !pEnd) return false; @@ -2435,7 +2435,7 @@ bool SwCrsrShell::IsEndOfDoc() const SwNodeIndex aIdx( GetDoc()->GetNodes().GetEndOfContent(), -1 ); SwCntntNode* pCNd = aIdx.GetNode().GetCntntNode(); if( !pCNd ) - pCNd = GetDoc()->GetNodes().GoPrevious( &aIdx ); + pCNd = SwNodes::GoPrevious( &aIdx ); return aIdx == m_pCurCrsr->GetPoint()->nNode && pCNd->Len() == m_pCurCrsr->GetPoint()->nContent.GetIndex(); @@ -2883,19 +2883,22 @@ bool SwCrsrShell::FindValidCntntNode( bool bOnlyText ) ( !IsReadOnlyAvailable() && pSectNd->GetSection().IsProtectFlag() )) ) { - typedef SwCntntNode* (SwNodes:: *FNGoSection)( SwNodeIndex *, bool, bool ) const; - FNGoSection funcGoSection = &SwNodes::GoNextSection; - bOk = false; - + bool bGoNextSection = true; for( int nLoopCnt = 0; !bOk && nLoopCnt < 2; ++nLoopCnt ) { bool bContinue; do { bContinue = false; - while( 0 != ( pCNd = (rNds.*funcGoSection)( &rNdIdx, - true, !IsReadOnlyAvailable() )) ) + for (;;) { + if (bGoNextSection) + pCNd = rNds.GoNextSection( &rNdIdx, + true, !IsReadOnlyAvailable() ); + else + pCNd = SwNodes::GoPrevSection( &rNdIdx, + true, !IsReadOnlyAvailable() ); + if ( pCNd == 0) break; // moved inside a table -> check if it is protected if( pCNd->FindTableNode() ) { @@ -2939,7 +2942,7 @@ bool SwCrsrShell::FindValidCntntNode( bool bOnlyText ) if( !bOk ) { if( !nLoopCnt ) - funcGoSection = &SwNodes::GoPrevSection; + bGoNextSection = false; rNdIdx = nNdIdx; } } @@ -3272,7 +3275,7 @@ void SwCrsrShell::ClearUpCrsrs() SwNodes & aNodes = GetDoc()->GetNodes(); const SwNode* pStart = lcl_NodeContext( pStartCrsr->GetPoint()->nNode.GetNode() ); SwNodeIndex aIdx( pStartCrsr->GetPoint()->nNode ); - SwNode * pNode = aNodes.GoPrevious(&aIdx); + SwNode * pNode = SwNodes::GoPrevious(&aIdx); if( pNode == NULL || lcl_NodeContext( *pNode ) != pStart ) aNodes.GoNext( &aIdx ); if( pNode == NULL || lcl_NodeContext( *pNode ) != pStart ) @@ -3309,7 +3312,7 @@ OUString SwCrsrShell::GetCrsrDescr() const if (IsMultiSelection()) aResult += SW_RES(STR_MULTISEL); else - aResult = GetDoc()->GetPaMDescr(*GetCrsr()); + aResult = SwDoc::GetPaMDescr(*GetCrsr()); return aResult; } diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx index b0caa5609db3..32ceba63ebbd 100644 --- a/sw/source/core/crsr/crstrvl.cxx +++ b/sw/source/core/crsr/crstrvl.cxx @@ -107,7 +107,7 @@ void SwCrsrShell::MoveCrsrToNum() /// go to next/previous point on the same level bool SwCrsrShell::GotoNextNum() { - if (!GetDoc()->GotoNextNum( *m_pCurCrsr->GetPoint() )) + if (!SwDoc::GotoNextNum( *m_pCurCrsr->GetPoint() )) return false; MoveCrsrToNum(); return true; @@ -115,7 +115,7 @@ bool SwCrsrShell::GotoNextNum() bool SwCrsrShell::GotoPrevNum() { - if (!GetDoc()->GotoPrevNum( *m_pCurCrsr->GetPoint() )) + if (!SwDoc::GotoPrevNum( *m_pCurCrsr->GetPoint() )) return false; MoveCrsrToNum(); return true; @@ -364,7 +364,7 @@ bool SwCrsrShell::GotoTOXMarkBase() bool bRet = false; SwTOXMarks aMarks; - sal_uInt16 nCnt = GetDoc()->GetCurTOXMark( *m_pCurCrsr->GetPoint(), aMarks ); + sal_uInt16 nCnt = SwDoc::GetCurTOXMark( *m_pCurCrsr->GetPoint(), aMarks ); if( nCnt ) { // Take the 1. and get the index type. Search in its dependency list @@ -802,7 +802,7 @@ bool SwCrsrShell::GotoFld( const SwFmtFld& rFld ) SwTxtFld * SwCrsrShell::GetTxtFldAtPos( const SwPosition* pPos, - const bool bIncludeInputFldAtStart ) const + const bool bIncludeInputFldAtStart ) { SwTxtFld* pTxtFld = NULL; @@ -817,7 +817,7 @@ SwTxtFld * SwCrsrShell::GetTxtFldAtPos( SwField* SwCrsrShell::GetFieldAtCrsr( const SwPaM* pCrsr, - const bool bIncludeInputFldAtStart ) const + const bool bIncludeInputFldAtStart ) { SwField* pFieldAtCrsr = NULL; @@ -869,7 +869,7 @@ bool SwCrsrShell::CrsrInsideInputFld() const return false; } -bool SwCrsrShell::PosInsideInputFld( const SwPosition& rPos ) const +bool SwCrsrShell::PosInsideInputFld( const SwPosition& rPos ) { return dynamic_cast<const SwTxtInputFld*>(GetTxtFldAtPos( &rPos, false )) != NULL; } @@ -885,7 +885,7 @@ bool SwCrsrShell::DocPtInsideInputFld( const Point& rDocPt ) const return false; } -sal_Int32 SwCrsrShell::StartOfInputFldAtPos( const SwPosition& rPos ) const +sal_Int32 SwCrsrShell::StartOfInputFldAtPos( const SwPosition& rPos ) { const SwTxtInputFld* pTxtInputFld = dynamic_cast<const SwTxtInputFld*>(GetTxtFldAtPos( &rPos, true )); if ( pTxtInputFld == NULL ) @@ -896,7 +896,7 @@ sal_Int32 SwCrsrShell::StartOfInputFldAtPos( const SwPosition& rPos ) const return pTxtInputFld->GetStart(); } -sal_Int32 SwCrsrShell::EndOfInputFldAtPos( const SwPosition& rPos ) const +sal_Int32 SwCrsrShell::EndOfInputFldAtPos( const SwPosition& rPos ) { const SwTxtInputFld* pTxtInputFld = dynamic_cast<const SwTxtInputFld*>(GetTxtFldAtPos( &rPos, true )); if ( pTxtInputFld == NULL ) @@ -2034,7 +2034,7 @@ const SwRangeRedline* SwCrsrShell::_GotoRedline( sal_uInt16 nArrPos, bool bSelec pIdx = &m_pCurCrsr->GetPoint()->nNode; if( !pIdx->GetNode().IsCntntNode() && - 0 != ( pCNd = GetDoc()->GetNodes().GoPrevSection( pIdx, + 0 != ( pCNd = SwNodes::GoPrevSection( pIdx, true, IsReadOnlyAvailable() )) ) { if( *pIdx >= m_pCurCrsr->GetMark()->nNode ) diff --git a/sw/source/core/crsr/pam.cxx b/sw/source/core/crsr/pam.cxx index be811b4c03d3..d09e1f3a90ad 100644 --- a/sw/source/core/crsr/pam.cxx +++ b/sw/source/core/crsr/pam.cxx @@ -309,7 +309,7 @@ SwCntntNode* GoNextNds( SwNodeIndex* pIdx, bool bChk ) SwCntntNode* GoPreviousNds( SwNodeIndex * pIdx, bool bChk ) { SwNodeIndex aIdx( *pIdx ); - SwCntntNode* pNd = aIdx.GetNodes().GoPrevious( &aIdx ); + SwCntntNode* pNd = SwNodes::GoPrevious( &aIdx ); if( pNd ) { if( bChk && 1 != pIdx->GetIndex() - aIdx.GetIndex() && @@ -790,7 +790,7 @@ SwCntntNode* GetNode( SwPaM & rPam, bool& rbFirst, SwMoveFn fnMove, { pNd = bSrchForward ? rNodes.GoNextSection( &aPos.nNode, true, !bInReadOnly ) - : rNodes.GoPrevSection( &aPos.nNode, true, !bInReadOnly ); + : SwNodes::GoPrevSection( &aPos.nNode, true, !bInReadOnly ); if( pNd ) { aPos.nContent.Assign( pNd, ::GetSttOrEnd( bSrchForward,*pNd )); @@ -842,10 +842,10 @@ void GoStartSection( SwPosition * pPos ) { // jump to section's beginning SwNodes& rNodes = pPos->nNode.GetNodes(); - sal_uInt16 nLevel = rNodes.GetSectionLevel( pPos->nNode ); + sal_uInt16 nLevel = SwNodes::GetSectionLevel( pPos->nNode ); if( pPos->nNode < rNodes.GetEndOfContent().StartOfSectionIndex() ) nLevel--; - do { rNodes.GoStartOfSection( &pPos->nNode ); } while( nLevel-- ); + do { SwNodes::GoStartOfSection( &pPos->nNode ); } while( nLevel-- ); // already on a CntntNode pPos->nNode.GetNode().GetCntntNode()->MakeStartIndex( &pPos->nContent ); @@ -856,10 +856,10 @@ void GoEndSection( SwPosition * pPos ) { // jump to section's beginning/end SwNodes& rNodes = pPos->nNode.GetNodes(); - sal_uInt16 nLevel = rNodes.GetSectionLevel( pPos->nNode ); + sal_uInt16 nLevel = SwNodes::GetSectionLevel( pPos->nNode ); if( pPos->nNode < rNodes.GetEndOfContent().StartOfSectionIndex() ) nLevel--; - do { rNodes.GoEndOfSection( &pPos->nNode ); } while( nLevel-- ); + do { SwNodes::GoEndOfSection( &pPos->nNode ); } while( nLevel-- ); // now on a EndNode, thus to the previous CntntNode if( GoPreviousNds( &pPos->nNode, true ) ) @@ -979,8 +979,7 @@ bool GoCurrSection( SwPaM & rPam, SwMoveFn fnMove ) { SwPosition& rPos = *rPam.GetPoint(); SwPosition aSavePos( rPos ); // position for comparison - SwNodes& rNds = aSavePos.nNode.GetNodes(); - (rNds.*fnMove->fnSection)( &rPos.nNode ); + (fnMove->fnSection)( &rPos.nNode ); SwCntntNode *pNd; if( 0 == ( pNd = rPos.nNode.GetNode().GetCntntNode()) && 0 == ( pNd = (*fnMove->fnNds)( &rPos.nNode, true )) ) @@ -998,8 +997,7 @@ bool GoNextSection( SwPaM & rPam, SwMoveFn fnMove ) { SwPosition& rPos = *rPam.GetPoint(); SwPosition aSavePos( rPos ); // position for comparison - SwNodes& rNds = aSavePos.nNode.GetNodes(); - rNds.GoEndOfSection( &rPos.nNode ); + SwNodes::GoEndOfSection( &rPos.nNode ); // no other CntntNode existent? if( !GoInCntnt( rPam, fnMoveForward ) ) @@ -1007,7 +1005,7 @@ bool GoNextSection( SwPaM & rPam, SwMoveFn fnMove ) rPos = aSavePos; // do not change cursor return false; } - (rNds.*fnMove->fnSection)( &rPos.nNode ); + (fnMove->fnSection)( &rPos.nNode ); SwCntntNode *pNd = rPos.nNode.GetNode().GetCntntNode(); rPos.nContent.Assign( pNd, ::GetSttOrEnd( fnMove == fnMoveForward, *pNd ) ); @@ -1018,8 +1016,7 @@ bool GoPrevSection( SwPaM & rPam, SwMoveFn fnMove ) { SwPosition& rPos = *rPam.GetPoint(); SwPosition aSavePos( rPos ); // position for comparison - SwNodes& rNds = aSavePos.nNode.GetNodes(); - rNds.GoStartOfSection( &rPos.nNode ); + SwNodes::GoStartOfSection( &rPos.nNode ); // no further CntntNode existent? if( !GoInCntnt( rPam, fnMoveBackward )) @@ -1027,7 +1024,7 @@ bool GoPrevSection( SwPaM & rPam, SwMoveFn fnMove ) rPos = aSavePos; // do not change cursor return false; } - (rNds.*fnMove->fnSection)( &rPos.nNode ); + (fnMove->fnSection)( &rPos.nNode ); SwCntntNode *pNd = rPos.nNode.GetNode().GetCntntNode(); rPos.nContent.Assign( pNd, ::GetSttOrEnd( fnMove == fnMoveForward, *pNd )); diff --git a/sw/source/core/crsr/swcrsr.cxx b/sw/source/core/crsr/swcrsr.cxx index dcca20dbf38c..0000eb965aa5 100644 --- a/sw/source/core/crsr/swcrsr.cxx +++ b/sw/source/core/crsr/swcrsr.cxx @@ -265,12 +265,12 @@ bool SwCursor::IsSelOvr( int eFlags ) bool bGoNxt = m_pSavePos->nNode < rPtIdx.GetIndex(); SwCntntNode* pCNd = bGoNxt ? rNds.GoNextSection( &rPtIdx, bSkipOverHiddenSections, bSkipOverProtectSections) - : rNds.GoPrevSection( &rPtIdx, bSkipOverHiddenSections, bSkipOverProtectSections); + : SwNodes::GoPrevSection( &rPtIdx, bSkipOverHiddenSections, bSkipOverProtectSections); if( !pCNd && ( nsSwCursorSelOverFlags::SELOVER_ENABLEREVDIREKTION & eFlags )) { bGoNxt = !bGoNxt; pCNd = bGoNxt ? rNds.GoNextSection( &rPtIdx, bSkipOverHiddenSections, bSkipOverProtectSections) - : rNds.GoPrevSection( &rPtIdx, bSkipOverHiddenSections, bSkipOverProtectSections); + : SwNodes::GoPrevSection( &rPtIdx, bSkipOverHiddenSections, bSkipOverProtectSections); } bool bIsValidPos = 0 != pCNd; @@ -504,7 +504,7 @@ bool SwCursor::IsSelOvr( int eFlags ) pMyNd->StartOfSectionNode()->IsSectionNode() ) ) { pMyNd = bSelTop - ? rNds.GoPrevSection( &GetPoint()->nNode,true,false ) + ? SwNodes::GoPrevSection( &GetPoint()->nNode,true,false ) : rNds.GoNextSection( &GetPoint()->nNode,true,false ); /* #i12312# Handle failure of Go{Prev|Next}Section */ @@ -883,7 +883,7 @@ static bool lcl_MakeSelFwrd( const SwNode& rSttNd, const SwNode& rEndNd, rPam.SetMark(); rPam.GetPoint()->nNode = rEndNd; - pCNd = rNds.GoPrevious( &rPam.GetPoint()->nNode ); + pCNd = SwNodes::GoPrevious( &rPam.GetPoint()->nNode ); if( !pCNd ) return false; pCNd->MakeEndIndex( &rPam.GetPoint()->nContent ); @@ -903,7 +903,7 @@ static bool lcl_MakeSelBkwrd( const SwNode& rSttNd, const SwNode& rEndNd, if( !bFirst ) { rPam.GetPoint()->nNode = rSttNd; - pCNd = rNds.GoPrevious( &rPam.GetPoint()->nNode ); + pCNd = SwNodes::GoPrevious( &rPam.GetPoint()->nNode ); if( !pCNd ) return false; pCNd->MakeEndIndex( &rPam.GetPoint()->nContent ); @@ -1092,7 +1092,7 @@ void SwCursor::FillFindPos( SwDocPositions ePos, SwPosition& rPos ) const break; case DOCPOS_END: rPos.nNode = rNds.GetEndOfContent(); - pCNd = rNds.GoPrevious( &rPos.nNode ); + pCNd = SwNodes::GoPrevious( &rPos.nNode ); bIsStart = false; break; case DOCPOS_OTHERSTART: @@ -1101,7 +1101,7 @@ void SwCursor::FillFindPos( SwDocPositions ePos, SwPosition& rPos ) const break; case DOCPOS_OTHEREND: rPos.nNode = *rNds.GetEndOfContent().StartOfSectionNode(); - pCNd = rNds.GoPrevious( &rPos.nNode ); + pCNd = SwNodes::GoPrevious( &rPos.nNode ); bIsStart = false; break; default: @@ -2195,7 +2195,7 @@ SwCursor* SwTableCursor::MakeBoxSels( SwCursor* pAktCrsr ) aIdx.Assign( *pSttNd->EndOfSectionNode(), - 1 ); if( !( pNd = &aIdx.GetNode())->IsCntntNode() ) - pNd = rNds.GoPrevSection( &aIdx, true, false ); + pNd = SwNodes::GoPrevSection( &aIdx, true, false ); pPos = pCur->GetPoint(); if (pNd && pNd != &pPos->nNode.GetNode()) @@ -2240,7 +2240,7 @@ SwCursor* SwTableCursor::MakeBoxSels( SwCursor* pAktCrsr ) SwPosition* pPos = pNew->GetPoint(); pPos->nNode.Assign( *pSttNd->EndOfSectionNode(), - 1 ); if( !( pNd = &pPos->nNode.GetNode())->IsCntntNode() ) - pNd = rNds.GoPrevSection( &pPos->nNode, true, false ); + pNd = SwNodes::GoPrevSection( &pPos->nNode, true, false ); pPos->nContent.Assign(static_cast<SwCntntNode*>(pNd), pNd ? static_cast<SwCntntNode*>(pNd)->Len() : 0); } diff --git a/sw/source/core/crsr/trvlreg.cxx b/sw/source/core/crsr/trvlreg.cxx index 09bf2b519710..92d40ed3e3a5 100644 --- a/sw/source/core/crsr/trvlreg.cxx +++ b/sw/source/core/crsr/trvlreg.cxx @@ -65,7 +65,7 @@ bool GotoPrevRegion( SwPaM& rCurCrsr, SwPosRegion fnPosRegion, else { aIdx = *pNd->EndOfSectionNode(); - SwCntntNode* pCNd = pNd->GetNodes().GoPrevSection( &aIdx, + SwCntntNode* pCNd = SwNodes::GoPrevSection( &aIdx, true, !bInReadOnly ); if( !pCNd ) { @@ -119,7 +119,7 @@ bool GotoNextRegion( SwPaM& rCurCrsr, SwPosRegion fnPosRegion, else { aIdx = *pNd->EndOfSectionNode(); - SwCntntNode* pCNd = pNd->GetNodes().GoPrevSection( &aIdx, + SwCntntNode* pCNd = SwNodes::GoPrevSection( &aIdx, true, !bInReadOnly ); if( !pCNd ) { @@ -149,7 +149,7 @@ bool GotoCurrRegion( SwPaM& rCurCrsr, SwPosRegion fnPosRegion, if( bMoveBackward ) { SwNodeIndex aIdx( *pNd->EndOfSectionNode() ); - pCNd = pNd->GetNodes().GoPrevSection( &aIdx, true, !bInReadOnly ); + pCNd = SwNodes::GoPrevSection( &aIdx, true, !bInReadOnly ); } else { @@ -182,7 +182,7 @@ bool GotoCurrRegionAndSkip( SwPaM& rCurCrsr, SwPosRegion fnPosRegion, if( bMoveBackward ) // to the end of the section { SwNodeIndex aIdx( *pNd->EndOfSectionNode() ); - pCNd = pNd->GetNodes().GoPrevSection( &aIdx, true, !bInReadOnly ); + pCNd = SwNodes::GoPrevSection( &aIdx, true, !bInReadOnly ); if( !pCNd ) return false; pPos->nNode = aIdx; diff --git a/sw/source/core/crsr/trvltbl.cxx b/sw/source/core/crsr/trvltbl.cxx index d545fd846dd1..33d29140a431 100644 --- a/sw/source/core/crsr/trvltbl.cxx +++ b/sw/source/core/crsr/trvltbl.cxx @@ -92,8 +92,7 @@ bool SwCrsrShell::GoNextCell( bool bAppendLine ) // the document might change; w/o Action views would not be notified static_cast<SwEditShell*>(this)->StartAllAction(); - bRet = mpDoc->InsertRow( pTblNd->GetTable(). - SelLineFromBox( pTableBox, aBoxes, false )); + bRet = mpDoc->InsertRow( SwTable::SelLineFromBox( pTableBox, aBoxes, false )); static_cast<SwEditShell*>(this)->EndAllAction(); } } @@ -434,11 +433,10 @@ static bool lcl_FindPrevCell( SwNodeIndex& rIdx, bool bInReadOnly ) return false; } - SwNodes& rNds = aTmp.GetNode().GetNodes(); SwCntntNode* pCNd = aTmp.GetNode().GetCntntNode(); if( !pCNd ) - pCNd = rNds.GoPrevious( &aTmp ); + pCNd = SwNodes::GoPrevious( &aTmp ); if ( !pCNd ) return false; @@ -459,7 +457,7 @@ static bool lcl_FindPrevCell( SwNodeIndex& rIdx, bool bInReadOnly ) pCNd = aTmp.GetNode().GetCntntNode(); if( 0 == pCNd ) - pCNd = rNds.GoPrevious( &aTmp ); + pCNd = SwNodes::GoPrevious( &aTmp ); if ( !pCNd ) return false; diff --git a/sw/source/core/crsr/viscrs.cxx b/sw/source/core/crsr/viscrs.cxx index a67aa8815e42..b30639d237df 100644 --- a/sw/source/core/crsr/viscrs.cxx +++ b/sw/source/core/crsr/viscrs.cxx @@ -391,7 +391,7 @@ void SwSelPaintRects::HighlightInputFld() if (m_bShowTxtInputFldOverlay) { SwTxtInputFld* pCurTxtInputFldAtCrsr = - dynamic_cast<SwTxtInputFld*>(GetShell()->GetTxtFldAtPos( GetShell()->GetCrsr()->Start(), false )); + dynamic_cast<SwTxtInputFld*>(SwCrsrShell::GetTxtFldAtPos( GetShell()->GetCrsr()->Start(), false )); if ( pCurTxtInputFldAtCrsr != NULL ) { SwTxtNode* pTxtNode = pCurTxtInputFldAtCrsr->GetpTxtNode(); diff --git a/sw/source/core/doc/CntntIdxStore.cxx b/sw/source/core/doc/CntntIdxStore.cxx index 25d4ca3ec8f1..79bf10cd1897 100644 --- a/sw/source/core/doc/CntntIdxStore.cxx +++ b/sw/source/core/doc/CntntIdxStore.cxx @@ -183,9 +183,9 @@ namespace inline void RestoreUnoCrsrs(updater_t& rUpdater); inline void SaveShellCrsrs(SwDoc* pDoc, sal_uLong nNode, sal_Int32 nCntnt); inline void RestoreShellCrsrs(updater_t& rUpdater); - inline const SwPosition& GetRightMarkPos(::sw::mark::IMark* pMark, bool bOther) + static inline const SwPosition& GetRightMarkPos(::sw::mark::IMark* pMark, bool bOther) { return bOther ? pMark->GetOtherMarkPos() : pMark->GetMarkPos(); }; - inline void SetRightMarkPos(MarkBase* pMark, bool bOther, const SwPosition* const pPos) + static inline void SetRightMarkPos(MarkBase* pMark, bool bOther, const SwPosition* const pPos) { bOther ? pMark->SetOtherMarkPos(*pPos) : pMark->SetMarkPos(*pPos); }; }; static inline void lcl_ChkPaM( std::vector<PaMEntry>& rPaMEntries, const sal_uLong nNode, const sal_Int32 nCntnt, SwPaM& rPaM, const bool bPoint) diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx b/sw/source/core/doc/DocumentContentOperationsManager.cxx index e940caf60a96..562b54ebb628 100644 --- a/sw/source/core/doc/DocumentContentOperationsManager.cxx +++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx @@ -1653,7 +1653,7 @@ DocumentContentOperationsManager::CopyRange( SwPaM& rPam, SwPosition& rPos, cons { ::sw::UndoGuard const undoGuard(pDoc->GetIDocumentUndoRedo()); - SwStartNode* pSttNd = pDoc->GetNodes().MakeEmptySection( + SwStartNode* pSttNd = SwNodes::MakeEmptySection( SwNodeIndex( m_rDoc.GetNodes().GetEndOfAutotext() )); aPam.GetPoint()->nNode = *pSttNd->EndOfSectionNode(); // copy without Frames @@ -1661,8 +1661,7 @@ DocumentContentOperationsManager::CopyRange( SwPaM& rPam, SwPosition& rPos, cons aPam.GetPoint()->nNode = pDoc->GetNodes().GetEndOfAutotext(); aPam.SetMark(); - SwCntntNode* pNode = - pDoc->GetNodes().GoPrevious( &aPam.GetMark()->nNode ); + SwCntntNode* pNode = SwNodes::GoPrevious( &aPam.GetMark()->nNode ); pNode->MakeEndIndex( &aPam.GetMark()->nContent ); aPam.GetPoint()->nNode = *aPam.GetNode().StartOfSectionNode(); @@ -1727,7 +1726,7 @@ void DocumentContentOperationsManager::DeleteSection( SwNode *pNode ) { // move all Crsr/StkCrsr/UnoCrsr out of the to-be-deleted area SwNodeIndex aMvStt( aSttIdx, 1 ); - m_rDoc.CorrAbs( aMvStt, aEndIdx, SwPosition( aSttIdx ), true ); + SwDoc::CorrAbs( aMvStt, aEndIdx, SwPosition( aSttIdx ), true ); } m_rDoc.GetNodes().DelNodes( aSttIdx, aEndIdx.GetIndex() - aSttIdx.GetIndex() + 1 ); @@ -1841,7 +1840,7 @@ bool DocumentContentOperationsManager::DelFullPara( SwPaM& rPam ) } else { - m_rDoc.CorrAbs( aRg.aStart, aRg.aEnd, *rPam.GetPoint(), true ); + SwDoc::CorrAbs( aRg.aStart, aRg.aEnd, *rPam.GetPoint(), true ); } // What's with Flys? @@ -2571,7 +2570,7 @@ SwFlyFrmFmt* DocumentContentOperationsManager::Insert( const SwPaM &rRg, { if( !pFrmFmt ) pFrmFmt = m_rDoc.getIDocumentStylePoolAccess().GetFrmFmtFromPool( RES_POOLFRM_GRAPHIC ); - SwGrfNode* pSwGrfNode = m_rDoc.GetNodes().MakeGrfNode( + SwGrfNode* pSwGrfNode = SwNodes::MakeGrfNode( SwNodeIndex( m_rDoc.GetNodes().GetEndOfAutotext() ), rGrfName, rFltName, pGraphic, m_rDoc.GetDfltGrfFmtColl() ); @@ -2587,7 +2586,7 @@ SwFlyFrmFmt* DocumentContentOperationsManager::Insert( const SwPaM &rRg, const G { if( !pFrmFmt ) pFrmFmt = m_rDoc.getIDocumentStylePoolAccess().GetFrmFmtFromPool( RES_POOLFRM_GRAPHIC ); - SwGrfNode* pSwGrfNode = m_rDoc.GetNodes().MakeGrfNode( + SwGrfNode* pSwGrfNode = SwNodes::MakeGrfNode( SwNodeIndex( m_rDoc.GetNodes().GetEndOfAutotext() ), rGrfObj, m_rDoc.GetDfltGrfFmtColl() ); SwFlyFrmFmt* pSwFlyFrmFmt = _InsNoTxtNode( *rRg.GetPoint(), pSwGrfNode, diff --git a/sw/source/core/doc/DocumentFieldsManager.cxx b/sw/source/core/doc/DocumentFieldsManager.cxx index 847a96b1d0b5..a3fe65064e19 100644 --- a/sw/source/core/doc/DocumentFieldsManager.cxx +++ b/sw/source/core/doc/DocumentFieldsManager.cxx @@ -1330,9 +1330,7 @@ void DocumentFieldsManager::SetFixFields( bool bOnlyTimeDate, const DateTime* pN { bChgd = true; SwAuthorField* pAuthorFld = static_cast<SwAuthorField*>(pFmtFld->GetField()); - pAuthorFld->SetExpansion( static_cast<SwAuthorFieldType*>( - pAuthorFld->GetTyp())->Expand( - pAuthorFld->GetFormat() ) ); + pAuthorFld->SetExpansion( SwAuthorFieldType::Expand( pAuthorFld->GetFormat() ) ); } break; @@ -1341,8 +1339,7 @@ void DocumentFieldsManager::SetFixFields( bool bOnlyTimeDate, const DateTime* pN { bChgd = true; SwExtUserField* pExtUserFld = static_cast<SwExtUserField*>(pFmtFld->GetField()); - pExtUserFld->SetExpansion( static_cast<SwExtUserFieldType*>( - pExtUserFld->GetTyp())->Expand( + pExtUserFld->SetExpansion( SwExtUserFieldType::Expand( pExtUserFld->GetSubType(), pExtUserFld->GetFormat())); } diff --git a/sw/source/core/doc/DocumentLayoutManager.cxx b/sw/source/core/doc/DocumentLayoutManager.cxx index fbb264665d4a..ad23762a0c85 100644 --- a/sw/source/core/doc/DocumentLayoutManager.cxx +++ b/sw/source/core/doc/DocumentLayoutManager.cxx @@ -399,7 +399,7 @@ SwFrmFmt *DocumentLayoutManager::CopyLayoutFmt( SwNodeRange aRg( rCSttNd, 1, *rCSttNd.EndOfSectionNode() ); SwNodeIndex aIdx( m_rDoc.GetNodes().GetEndOfAutotext() ); - SwStartNode* pSttNd = m_rDoc.GetNodes().MakeEmptySection( aIdx, SwFlyStartNode ); + SwStartNode* pSttNd = SwNodes::MakeEmptySection( aIdx, SwFlyStartNode ); // Set the Anchor/CntntIndex first. // Within the copying part, we can access the values (DrawFmt in Headers and Footers) diff --git a/sw/source/core/doc/DocumentRedlineManager.cxx b/sw/source/core/doc/DocumentRedlineManager.cxx index 38918b0320c0..eda520584d73 100644 --- a/sw/source/core/doc/DocumentRedlineManager.cxx +++ b/sw/source/core/doc/DocumentRedlineManager.cxx @@ -2347,7 +2347,7 @@ const SwRangeRedline* DocumentRedlineManager::SelNextRedline( SwPaM& rPam ) cons if( !pEnd->nNode.GetNode().IsCntntNode() ) { SwNodeIndex aTmp( pEnd->nNode ); - SwCntntNode* pCNd = m_rDoc.GetNodes().GoPrevSection( &aTmp ); + SwCntntNode* pCNd = SwNodes::GoPrevSection( &aTmp ); if( !pCNd || ( aTmp == rSttPos.nNode && pCNd->Len() == rSttPos.nContent.GetIndex() )) pFnd = 0; @@ -2416,7 +2416,7 @@ const SwRangeRedline* DocumentRedlineManager::SelNextRedline( SwPaM& rPam ) cons { pIdx = &rPam.GetPoint()->nNode; if( !pIdx->GetNode().IsCntntNode() && - 0 != ( pCNd = m_rDoc.GetNodes().GoPrevSection( pIdx )) ) + 0 != ( pCNd = SwNodes::GoPrevSection( pIdx )) ) { if( *pIdx >= rPam.GetMark()->nNode ) rPam.GetPoint()->nContent.Assign( pCNd, pCNd->Len() ); @@ -2525,7 +2525,7 @@ const SwRangeRedline* DocumentRedlineManager::SelPrevRedline( SwPaM& rPam ) cons SwCntntNode* pCNd; SwNodeIndex* pIdx = &rPam.GetMark()->nNode; if( !pIdx->GetNode().IsCntntNode() && - 0 != ( pCNd = m_rDoc.GetNodes().GoPrevSection( pIdx )) ) + 0 != ( pCNd = SwNodes::GoPrevSection( pIdx )) ) { if( *pIdx >= rPam.GetPoint()->nNode ) rPam.GetMark()->nContent.Assign( pCNd, pCNd->Len() ); diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx index eaf04103ca09..80de11eebe8d 100644 --- a/sw/source/core/doc/doc.cxx +++ b/sw/source/core/doc/doc.cxx @@ -1406,7 +1406,7 @@ bool SwDoc::RemoveInvisibleContent() aPam.GetPoint()->nContent.Assign( pCNd, 0 ); aPam.SetMark(); aPam.GetPoint()->nNode = *pSectNd->EndOfSectionNode(); - pCNd = GetNodes().GoPrevious( + pCNd = SwNodes::GoPrevious( &aPam.GetPoint()->nNode ); aPam.GetPoint()->nContent.Assign( pCNd, pCNd->Len() ); @@ -1539,7 +1539,7 @@ bool SwDoc::ConvertFieldsToText() if (pTxtField && pTxtField->Which() == RES_TXTATR_INPUTFIELD) { SwPosition &rEndPos = *aInsertPam.GetPoint(); - rEndPos.nContent = GetDocShell()->GetWrtShell()->EndOfInputFldAtPos( *aInsertPam.End() ); + rEndPos.nContent = SwCrsrShell::EndOfInputFldAtPos( *aInsertPam.End() ); } else { @@ -1637,7 +1637,7 @@ void SwDoc::ChgTOX(SwTOXBase & rTOX, const SwTOXBase & rNew) } } -OUString SwDoc::GetPaMDescr(const SwPaM & rPam) const +OUString SwDoc::GetPaMDescr(const SwPaM & rPam) { if (&rPam.GetNode(true) == &rPam.GetNode(false)) { diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx index a7ed67a63426..ea6621ca0cae 100644 --- a/sw/source/core/doc/docbm.cxx +++ b/sw/source/core/doc/docbm.cxx @@ -131,7 +131,7 @@ namespace if ( pNode == NULL ) { SwNodeIndex aStt = SwNodeIndex(rStt); - pNode = rStt.GetNodes().GoPrevious(&aStt); + pNode = SwNodes::GoPrevious(&aStt); bPosAtEndOfNode = true; } if ( pNode != NULL ) @@ -1344,7 +1344,7 @@ void _DelBookmarks( { bStt = false; pRStt->nNode = rStt; - if( 0 == ( pCNd = pDoc->GetNodes().GoPrevious( &pRStt->nNode )) ) + if( 0 == ( pCNd = SwNodes::GoPrevious( &pRStt->nNode )) ) { pRStt->nNode = pREnd->nNode; pCNd = pRStt->nNode.GetNode().GetCntntNode(); @@ -1362,7 +1362,7 @@ void _DelBookmarks( { bool bStt = false; SwCntntNode* pCNd = pREnd->nNode.GetNode().GetCntntNode(); - if( !pCNd && 0 == ( pCNd = pDoc->GetNodes().GoPrevious( &pREnd->nNode )) ) + if( !pCNd && 0 == ( pCNd = SwNodes::GoPrevious( &pREnd->nNode )) ) { bStt = true; pREnd->nNode = rEnd; diff --git a/sw/source/core/doc/doccomp.cxx b/sw/source/core/doc/doccomp.cxx index c9d59c971447..e53e37c09409 100644 --- a/sw/source/core/doc/doccomp.cxx +++ b/sw/source/core/doc/doccomp.cxx @@ -74,8 +74,8 @@ private: SwPaM *pInsRing, *pDelRing; - sal_uLong PrevIdx( const SwNode* pNd ); - sal_uLong NextIdx( const SwNode* pNd ); + static sal_uLong PrevIdx( const SwNode* pNd ); + static sal_uLong NextIdx( const SwNode* pNd ); vector< CompareLine* > aLines; bool m_bRecordDiff; @@ -265,7 +265,7 @@ private: int *pPos1, *pPos2; int nCnt1, nCnt2; // number of words - void CalcPositions( int *pPos, const SwTxtNode *pTxtNd, int &nCnt ); + static void CalcPositions( int *pPos, const SwTxtNode *pTxtNd, int &nCnt ); public: WordArrayComparator( const SwTxtNode *pNode1, const SwTxtNode *pNode2 ); @@ -326,7 +326,7 @@ protected: int nEnd1 = 0, int nStt2 = 0, int nEnd2 = 0 ); public: - int IgnoreIsolatedPieces( int *pLcs1, int *pLcs2, int nLen1, int nLen2, + static int IgnoreIsolatedPieces( int *pLcs1, int *pLcs2, int nLen1, int nLen2, int nLcsLen, int nPieceLen ); }; @@ -1319,7 +1319,7 @@ bool SwCompareLine::ChangesInLine( const SwCompareLine& rLine, if( CmpOptions.nIgnoreLen ) { - nLcsLen = aSeq.IgnoreIsolatedPieces( &aTmpLcsDst[0], &aTmpLcsSrc[0], + nLcsLen = CommonSubseq::IgnoreIsolatedPieces( &aTmpLcsDst[0], &aTmpLcsSrc[0], aCmp.GetLen1(), aCmp.GetLen2(), nLcsLen, CmpOptions.nIgnoreLen ); } @@ -1336,7 +1336,7 @@ bool SwCompareLine::ChangesInLine( const SwCompareLine& rLine, if( CmpOptions.nIgnoreLen ) { - nLcsLen = aSeq.IgnoreIsolatedPieces( &aLcsDst[0], &aLcsSrc[0], nDstLen, + nLcsLen = CommonSubseq::IgnoreIsolatedPieces( &aLcsDst[0], &aLcsSrc[0], nDstLen, nSrcLen, nLcsLen, CmpOptions.nIgnoreLen ); } diff --git a/sw/source/core/doc/docdesc.cxx b/sw/source/core/doc/docdesc.cxx index 17f27487831f..a92b2d242e11 100644 --- a/sw/source/core/doc/docdesc.cxx +++ b/sw/source/core/doc/docdesc.cxx @@ -286,7 +286,7 @@ void SwDoc::CopyMasterHeader(const SwPageDesc &rChged, const SwFmtHeader &rHead, // is copied, and the Index to the StartNode is set to // the left or first header attribute. SwNodeIndex aTmp( GetNodes().GetEndOfAutotext() ); - SwStartNode* pSttNd = GetNodes().MakeEmptySection( aTmp, SwHeaderStartNode ); + SwStartNode* pSttNd = SwNodes::MakeEmptySection( aTmp, SwHeaderStartNode ); SwNodeRange aRange( aRCnt.GetCntntIdx()->GetNode(), 0, *aRCnt.GetCntntIdx()->GetNode().EndOfSectionNode() ); aTmp = *pSttNd->EndOfSectionNode(); @@ -358,7 +358,7 @@ void SwDoc::CopyMasterFooter(const SwPageDesc &rChged, const SwFmtFooter &rFoot, // is copied, and the Index to the StartNode is set to // the left footer attribute. SwNodeIndex aTmp( GetNodes().GetEndOfAutotext() ); - SwStartNode* pSttNd = GetNodes().MakeEmptySection( aTmp, SwFooterStartNode ); + SwStartNode* pSttNd = SwNodes::MakeEmptySection( aTmp, SwFooterStartNode ); SwNodeRange aRange( aRCnt.GetCntntIdx()->GetNode(), 0, *aRCnt.GetCntntIdx()->GetNode().EndOfSectionNode() ); aTmp = *pSttNd->EndOfSectionNode(); diff --git a/sw/source/core/doc/docedt.cxx b/sw/source/core/doc/docedt.cxx index 9095f525699e..287c8d1ea1c4 100644 --- a/sw/source/core/doc/docedt.cxx +++ b/sw/source/core/doc/docedt.cxx @@ -795,7 +795,7 @@ void SwDoc::DeleteAutoCorrExceptWord() mpACEWord = 0; } -void SwDoc::CountWords( const SwPaM& rPaM, SwDocStat& rStat ) const +void SwDoc::CountWords( const SwPaM& rPaM, SwDocStat& rStat ) { // This is a modified version of SwDoc::TransliterateText const SwPosition* pStt = rPaM.Start(); diff --git a/sw/source/core/doc/docfld.cxx b/sw/source/core/doc/docfld.cxx index 0bfeee404a6d..f3b6fe66679c 100644 --- a/sw/source/core/doc/docfld.cxx +++ b/sw/source/core/doc/docfld.cxx @@ -396,7 +396,7 @@ const SwDBData& SwDoc::GetDBDesc() } } if(maDBData.sDataSource.isEmpty()) - maDBData = GetDBManager()->GetAddressDBName(); + maDBData = SwDBManager::GetAddressDBName(); #endif return maDBData; } diff --git a/sw/source/core/doc/docfly.cxx b/sw/source/core/doc/docfly.cxx index a7a4adf534ff..53edd19eed14 100644 --- a/sw/source/core/doc/docfly.cxx +++ b/sw/source/core/doc/docfly.cxx @@ -671,7 +671,7 @@ bool SwDoc::SetFrmFmtToFly( SwFrmFmt& rFmt, SwFrmFmt& rNewFmt, } void SwDoc::GetGrfNms( const SwFlyFrmFmt& rFmt, OUString* pGrfName, - OUString* pFltName ) const + OUString* pFltName ) { SwNodeIndex aIdx( *rFmt.GetCntnt().GetCntntIdx(), 1 ); const SwGrfNode* pGrfNd = aIdx.GetNode().GetGrfNode(); diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx index 1dbcb1358144..227b0530ac97 100644 --- a/sw/source/core/doc/docfmt.cxx +++ b/sw/source/core/doc/docfmt.cxx @@ -1371,7 +1371,7 @@ void SwDoc::CopyPageDescHeaderFooterImpl( bool bCpyHeader, { SwNodeIndex aTmpIdx( GetNodes().GetEndOfAutotext() ); const SwNodes& rSrcNds = rSrcFmt.GetDoc()->GetNodes(); - SwStartNode* pSttNd = GetNodes().MakeEmptySection( aTmpIdx, + SwStartNode* pSttNd = SwNodes::MakeEmptySection( aTmpIdx, bCpyHeader ? SwHeaderStartNode : SwFooterStartNode ); @@ -1598,7 +1598,7 @@ void SwDoc::ReplaceStyles( const SwDoc& rSource, bool bIncludePageStyles ) } SwFmt* SwDoc::FindFmtByName( const SwFmtsBase& rFmtArr, - const OUString& rName ) const + const OUString& rName ) { SwFmt* pFnd = 0; for( size_t n = 0; n < rFmtArr.GetFmtCount(); ++n ) diff --git a/sw/source/core/doc/docnum.cxx b/sw/source/core/doc/docnum.cxx index aeff01cd1e25..9b4e5efedcd8 100644 --- a/sw/source/core/doc/docnum.cxx +++ b/sw/source/core/doc/docnum.cxx @@ -1919,7 +1919,7 @@ bool SwDoc::MoveParagraph( const SwPaM& rPam, long nOffset, bool bIsOutlMv ) { // We need to remove the last empty Node again aIdx = aInsPos.nNode; - SwCntntNode* pCNd = GetNodes().GoPrevious( &aInsPos.nNode ); + SwCntntNode* pCNd = SwNodes::GoPrevious( &aInsPos.nNode ); aInsPos.nContent.Assign( pCNd, pCNd ? pCNd->Len() : 0 ); // All, that are in the to-be-deleted Node, need to be @@ -2074,7 +2074,7 @@ bool SwDoc::NumOrNoNum( const SwNodeIndex& rIdx, bool bDel ) return bResult; } -SwNumRule* SwDoc::GetNumRuleAtPos( const SwPosition& rPos ) const +SwNumRule* SwDoc::GetNumRuleAtPos( const SwPosition& rPos ) { SwNumRule* pRet = NULL; SwTxtNode* pTNd = rPos.nNode.GetNode().GetTxtNode(); diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx index 20db6623ddd9..421333156160 100644 --- a/sw/source/core/doc/docredln.cxx +++ b/sw/source/core/doc/docredln.cxx @@ -1170,7 +1170,7 @@ void SwRangeRedline::MoveToSection() } else { - pSttNd = rNds.MakeEmptySection( SwNodeIndex( rNds.GetEndOfRedlines() ), + pSttNd = SwNodes::MakeEmptySection( SwNodeIndex( rNds.GetEndOfRedlines() ), SwNormalStartNode ); SwPosition aPos( *pSttNd->EndOfSectionNode() ); @@ -1243,7 +1243,7 @@ void SwRangeRedline::CopyToSection() } else { - pSttNd = rNds.MakeEmptySection( SwNodeIndex( rNds.GetEndOfRedlines() ), + pSttNd = SwNodes::MakeEmptySection( SwNodeIndex( rNds.GetEndOfRedlines() ), SwNormalStartNode ); if( pCEndNd ) diff --git a/sw/source/core/doc/docsort.cxx b/sw/source/core/doc/docsort.cxx index 799981638ff6..3637d34ddc61 100644 --- a/sw/source/core/doc/docsort.cxx +++ b/sw/source/core/doc/docsort.cxx @@ -103,7 +103,7 @@ SwSortElement::~SwSortElement() { } -double SwSortElement::StrToDouble( const OUString& rStr ) const +double SwSortElement::StrToDouble( const OUString& rStr ) { if( !pLclData ) pLclData = new LocaleDataWrapper( LanguageTag( *pLocale )); diff --git a/sw/source/core/doc/doctxm.cxx b/sw/source/core/doc/doctxm.cxx index 8b6ff3100105..e26b20ff59f6 100644 --- a/sw/source/core/doc/doctxm.cxx +++ b/sw/source/core/doc/doctxm.cxx @@ -111,7 +111,7 @@ sal_uInt16 SwDoc::GetTOIKeys( SwTOIKeyType eTyp, std::vector<OUString>& rArr ) c /// Get current table of contents Mark. sal_uInt16 SwDoc::GetCurTOXMark( const SwPosition& rPos, - SwTOXMarks& rArr ) const + SwTOXMarks& rArr ) { // search on Position rPos for all SwTOXMarks SwTxtNode *const pTxtNd = rPos.nNode.GetNode().GetTxtNode(); @@ -434,7 +434,7 @@ SwTOXBase* SwDoc::GetCurTOX( const SwPosition& rPos ) return 0; } -const SwAttrSet& SwDoc::GetTOXBaseAttrSet(const SwTOXBase& rTOXBase) const +const SwAttrSet& SwDoc::GetTOXBaseAttrSet(const SwTOXBase& rTOXBase) { OSL_ENSURE( rTOXBase.ISA( SwTOXBaseSection ), "no TOXBaseSection!" ); const SwTOXBaseSection& rTOXSect = static_cast<const SwTOXBaseSection&>(rTOXBase); @@ -740,7 +740,7 @@ bool SwTOXBaseSection::SetPosAtStartEnd( SwPosition& rPos, bool bAtStart ) const else { rPos.nNode = *pSectNd->EndOfSectionNode(); - pCNd = pSectNd->GetDoc()->GetNodes().GoPrevious( &rPos.nNode ); + pCNd = SwNodes::GoPrevious( &rPos.nNode ); if( pCNd ) nC = pCNd->Len(); } rPos.nContent.Assign( pCNd, nC ); @@ -818,7 +818,7 @@ void SwTOXBaseSection::Update(const SfxItemSet* pAttr, // determine page description of content before table-of-content SwNodeIndex aIdx( *pSectNd ); pDefaultPageDesc = - pSectNd->GetNodes().GoPrevious( &aIdx )->FindPageDesc( false ); + SwNodes::GoPrevious( &aIdx )->FindPageDesc( false ); } if ( !pDefaultPageDesc ) @@ -875,7 +875,7 @@ void SwTOXBaseSection::Update(const SfxItemSet* pAttr, } --aEndIdx; SwPosition aPos( aEndIdx, SwIndex( pFirstEmptyNd, 0 )); - pDoc->CorrAbs( aSttIdx, aEndIdx, aPos, true ); + SwDoc::CorrAbs( aSttIdx, aEndIdx, aPos, true ); // delete flys in whole range including start node which requires // giving the node before start node as Mark parameter, hence -1. @@ -1005,7 +1005,7 @@ void SwTOXBaseSection::Update(const SfxItemSet* pAttr, if( !aCorPam.Move( fnMoveForward ) ) aCorPam.Move( fnMoveBackward ); SwNodeIndex aEndIdx( aInsPos, 1 ); - pDoc->CorrAbs( aInsPos, aEndIdx, *aCorPam.GetPoint(), true ); + SwDoc::CorrAbs( aInsPos, aEndIdx, *aCorPam.GetPoint(), true ); // Task 70995 - save and restore PageDesc and Break Attributes if( pFirstEmptyNd->HasSwAttrSet() ) @@ -1886,10 +1886,10 @@ void SwTOXBaseSection::InsertSorted(SwTOXSortTabBase* pNew) { // Own entry for double entries or keywords if( pOld->GetType() == TOX_SORT_CUSTOM && - pNew->GetOptions() & nsSwTOIOptions::TOI_KEY_AS_ENTRY) + SwTOXSortTabBase::GetOptions() & nsSwTOIOptions::TOI_KEY_AS_ENTRY) continue; - if(!(pNew->GetOptions() & nsSwTOIOptions::TOI_SAME_ENTRY)) + if(!(SwTOXSortTabBase::GetOptions() & nsSwTOIOptions::TOI_SAME_ENTRY)) { // Own entry aSortArr.insert(aSortArr.begin() + i, pNew); return; diff --git a/sw/source/core/doc/list.cxx b/sw/source/core/doc/list.cxx index 276def0ba06d..a35d90e55478 100644 --- a/sw/source/core/doc/list.cxx +++ b/sw/source/core/doc/list.cxx @@ -41,7 +41,7 @@ class SwListImpl void InsertListItem( SwNodeNum& rNodeNum, const int nLevel ); - void RemoveListItem( SwNodeNum& rNodeNum ); + static void RemoveListItem( SwNodeNum& rNodeNum ); void InvalidateListTree(); void ValidateListTree(); @@ -241,7 +241,7 @@ void SwList::InsertListItem( SwNodeNum& rNodeNum, void SwList::RemoveListItem( SwNodeNum& rNodeNum ) { - mpListImpl->RemoveListItem( rNodeNum ); + SwListImpl::RemoveListItem( rNodeNum ); } void SwList::InvalidateListTree() diff --git a/sw/source/core/doc/number.cxx b/sw/source/core/doc/number.cxx index 667d165eb3df..8a01ce7cd0e6 100644 --- a/sw/source/core/doc/number.cxx +++ b/sw/source/core/doc/number.cxx @@ -1104,7 +1104,7 @@ namespace numfunc void SetToDefault(); /** returns sequence of default bullet configuration property names */ - uno::Sequence<OUString> GetPropNames() const; + static uno::Sequence<OUString> GetPropNames(); /** loads default bullet configuration properties and applies values to internal data */ @@ -1180,7 +1180,7 @@ namespace numfunc mnLevelChars[9] = 0x2022; } - uno::Sequence<OUString> SwDefBulletConfig::GetPropNames() const + uno::Sequence<OUString> SwDefBulletConfig::GetPropNames() { uno::Sequence<OUString> aPropNames(13); OUString* pNames = aPropNames.getArray(); @@ -1323,7 +1323,7 @@ namespace numfunc void SetToDefault(); /** returns sequence of configuration property names */ - com::sun::star::uno::Sequence<OUString> GetPropNames() const; + static com::sun::star::uno::Sequence<OUString> GetPropNames(); /** loads configuration properties and applies values to internal data */ void LoadConfig(); @@ -1362,7 +1362,7 @@ namespace numfunc mbChangeIndentOnTabAtFirstPosOfFirstListItem = true; } - com::sun::star::uno::Sequence<OUString> SwNumberingUIBehaviorConfig::GetPropNames() const + com::sun::star::uno::Sequence<OUString> SwNumberingUIBehaviorConfig::GetPropNames() { com::sun::star::uno::Sequence<OUString> aPropNames(1); OUString* pNames = aPropNames.getArray(); diff --git a/sw/source/core/doc/poolfmt.cxx b/sw/source/core/doc/poolfmt.cxx index 2af05755144e..8165c82807fb 100644 --- a/sw/source/core/doc/poolfmt.cxx +++ b/sw/source/core/doc/poolfmt.cxx @@ -123,7 +123,7 @@ bool SwDoc::IsUsed( const SwModify& rModify ) const } // See if the NumRule is used -bool SwDoc::IsUsed( const SwNumRule& rRule ) const +bool SwDoc::IsUsed( const SwNumRule& rRule ) { bool bUsed = rRule.GetTxtNodeListSize() > 0 || rRule.GetParagraphStyleListSize() > 0; diff --git a/sw/source/core/doc/tblafmt.cxx b/sw/source/core/doc/tblafmt.cxx index f3a732c4a2c8..a260ddfae52b 100644 --- a/sw/source/core/doc/tblafmt.cxx +++ b/sw/source/core/doc/tblafmt.cxx @@ -878,7 +878,7 @@ void SwTableAutoFmt::StoreTableProperties(const SwTable &table) SwEditShell *pShell = pDoc->GetEditShell(); SwFmtRowSplit *pRowSplit = 0; - pDoc->GetRowSplit(*pShell->getShellCrsr(false), pRowSplit); + SwDoc::GetRowSplit(*pShell->getShellCrsr(false), pRowSplit); m_bRowSplit = pRowSplit && pRowSplit->GetValue(); delete pRowSplit; pRowSplit = 0; diff --git a/sw/source/core/doc/tblcpy.cxx b/sw/source/core/doc/tblcpy.cxx index 8dbd5725b8d7..8d0d7d70cbd8 100644 --- a/sw/source/core/doc/tblcpy.cxx +++ b/sw/source/core/doc/tblcpy.cxx @@ -551,9 +551,9 @@ static void lcl_CpyBox( const SwTable& rCpyTbl, const SwTableBox* pCpyBox, // Move Bookmarks { SwPosition aMvPos( aInsIdx ); - SwCntntNode* pCNd = pDoc->GetNodes().GoPrevious( &aMvPos.nNode ); + SwCntntNode* pCNd = SwNodes::GoPrevious( &aMvPos.nNode ); aMvPos.nContent.Assign( pCNd, pCNd->Len() ); - pDoc->CorrAbs( aInsIdx, aEndNdIdx, aMvPos, false ); + SwDoc::CorrAbs( aInsIdx, aEndNdIdx, aMvPos, false ); } // If we still have FlyFrames hanging around, delete them too @@ -1041,7 +1041,7 @@ static void _FndCntntLine( const SwTableLine* pLine, SwSelBoxes* pPara ) // Find all Boxes with content in this Box SwSelBoxes& SwTable::SelLineFromBox( const SwTableBox* pBox, - SwSelBoxes& rBoxes, bool bToTop ) const + SwSelBoxes& rBoxes, bool bToTop ) { SwTableLine* pLine = const_cast<SwTableLine*>(pBox->GetUpper()); if( bToTop ) diff --git a/sw/source/core/docnode/ndsect.cxx b/sw/source/core/docnode/ndsect.cxx index 9bb5888dad8d..5f7b6df7aba1 100644 --- a/sw/source/core/docnode/ndsect.cxx +++ b/sw/source/core/docnode/ndsect.cxx @@ -84,7 +84,7 @@ static bool lcl_IsInSameTblBox( SwNodes& _rNds, do { if ( _bPrev - ? !_rNds.GoPrevSection( &aChkIdx, false, false ) + ? !SwNodes::GoPrevSection( &aChkIdx, false, false ) : !_rNds.GoNextSection( &aChkIdx, false, false ) ) { OSL_FAIL( "<lcl_IsInSameTblBox(..)> - no previous/next!" ); @@ -134,7 +134,7 @@ static void lcl_CheckEmptyLayFrm( SwNodes& rNds, SwSectionData& rSectionData, const SwNode& rStt, const SwNode& rEnd ) { SwNodeIndex aIdx( rStt ); - if( !rNds.GoPrevSection( &aIdx, true, false ) || + if( !SwNodes::GoPrevSection( &aIdx, true, false ) || !CheckNodesRange( rStt, aIdx, true ) || // #i21457# !lcl_IsInSameTblBox( rNds, rStt, true )) @@ -386,7 +386,7 @@ SwDoc::InsertSwSection(SwPaM const& rRange, SwSectionData & rNewData, } sal_uInt16 SwDoc::IsInsRegionAvailable( const SwPaM& rRange, - const SwNode** ppSttNd ) const + const SwNode** ppSttNd ) { sal_uInt16 nRet = 1; if( rRange.HasMark() ) @@ -498,7 +498,7 @@ sal_uInt16 SwDoc::IsInsRegionAvailable( const SwPaM& rRange, return nRet; } -SwSection* SwDoc::GetCurrSection( const SwPosition& rPos ) const +SwSection* SwDoc::GetCurrSection( const SwPosition& rPos ) { const SwSectionNode* pSectNd = rPos.nNode.GetNode().FindSectionNode(); if( pSectNd ) @@ -1067,7 +1067,7 @@ void SwSectionNode::MakeFrms(const SwNodeIndex & rIdx ) if( !pCNd ) { aIdx = *this; - pCNd = rNds.GoPrevSection(&aIdx, true, false); + pCNd = SwNodes::GoPrevSection(&aIdx, true, false); if (!pCNd) return; } @@ -1203,7 +1203,7 @@ void SwSectionNode::DelFrms() // Or else the Fly/TblBox Frame does not have a Lower! { SwNodeIndex aIdx( *this ); - if( !rNds.GoPrevSection( &aIdx, true, false ) || + if( !SwNodes::GoPrevSection( &aIdx, true, false ) || !CheckNodesRange( *this, aIdx, true ) || // #i21457# !lcl_IsInSameTblBox( rNds, *this, true )) diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx index 78afb54d14d2..208aefcbdb25 100644 --- a/sw/source/core/docnode/ndtbl.cxx +++ b/sw/source/core/docnode/ndtbl.cxx @@ -381,7 +381,7 @@ const SwTable* SwDoc::InsertTable( const SwInsertTableOptions& rInsTblOpts, pCntntNd (aka the node the table is inserted at) thus causing SwNodes::InsertTable to propagate an adjust item if necessary. */ - SwTableNode *pTblNd = GetNodes().InsertTable( + SwTableNode *pTblNd = SwNodes::InsertTable( rPos.nNode, nCols, pBodyColl, @@ -2457,7 +2457,7 @@ void SwTableNode::RemoveRedlines() } void SwDoc::GetTabCols( SwTabCols &rFill, const SwCursor* pCrsr, - const SwCellFrm* pBoxFrm ) const + const SwCellFrm* pBoxFrm ) { const SwTableBox* pBox = 0; SwTabFrm *pTab = 0; @@ -2535,7 +2535,7 @@ static bool lcl_IsFrmInColumn( const SwCellFrm& rFrm, SwSelBoxes& rBoxes ) } void SwDoc::GetTabRows( SwTabCols &rFill, const SwCursor* , - const SwCellFrm* pBoxFrm ) const + const SwCellFrm* pBoxFrm ) { OSL_ENSURE( pBoxFrm, "GetTabRows called without pBoxFrm" ); diff --git a/sw/source/core/docnode/ndtbl1.cxx b/sw/source/core/docnode/ndtbl1.cxx index 25705e22922b..fe857d4f538a 100644 --- a/sw/source/core/docnode/ndtbl1.cxx +++ b/sw/source/core/docnode/ndtbl1.cxx @@ -316,7 +316,7 @@ void SwDoc::SetRowSplit( const SwCursor& rCursor, const SwFmtRowSplit &rNew ) } } -void SwDoc::GetRowSplit( const SwCursor& rCursor, SwFmtRowSplit *& rpSz ) const +void SwDoc::GetRowSplit( const SwCursor& rCursor, SwFmtRowSplit *& rpSz ) { rpSz = 0; @@ -388,7 +388,7 @@ void SwDoc::SetRowHeight( const SwCursor& rCursor, const SwFmtFrmSize &rNew ) } } -void SwDoc::GetRowHeight( const SwCursor& rCursor, SwFmtFrmSize *& rpSz ) const +void SwDoc::GetRowHeight( const SwCursor& rCursor, SwFmtFrmSize *& rpSz ) { rpSz = 0; @@ -493,7 +493,7 @@ void SwDoc::SetRowBackground( const SwCursor& rCursor, const SvxBrushItem &rNew } } -bool SwDoc::GetRowBackground( const SwCursor& rCursor, SvxBrushItem &rToFill ) const +bool SwDoc::GetRowBackground( const SwCursor& rCursor, SvxBrushItem &rToFill ) { bool bRet = false; SwTableNode* pTblNd = rCursor.GetPoint()->nNode.GetNode().FindTableNode(); @@ -905,7 +905,7 @@ void SwDoc::SetTabLineStyle( const SwCursor& rCursor, } } -void SwDoc::GetTabBorders( const SwCursor& rCursor, SfxItemSet& rSet ) const +void SwDoc::GetTabBorders( const SwCursor& rCursor, SfxItemSet& rSet ) { SwCntntNode* pCntNd = rCursor.GetPoint()->nNode.GetNode().GetCntntNode(); SwTableNode* pTblNd = pCntNd ? pCntNd->FindTableNode() : 0; @@ -1170,7 +1170,7 @@ void SwDoc::SetBoxAttr( const SwCursor& rCursor, const SfxPoolItem &rNew ) } } -bool SwDoc::GetBoxAttr( const SwCursor& rCursor, SfxPoolItem& rToFill ) const +bool SwDoc::GetBoxAttr( const SwCursor& rCursor, SfxPoolItem& rToFill ) { bool bRet = false; SwTableNode* pTblNd = rCursor.GetPoint()->nNode.GetNode().FindTableNode(); @@ -1228,7 +1228,7 @@ void SwDoc::SetBoxAlign( const SwCursor& rCursor, sal_uInt16 nAlign ) SetBoxAttr( rCursor, aVertOri ); } -sal_uInt16 SwDoc::GetBoxAlign( const SwCursor& rCursor ) const +sal_uInt16 SwDoc::GetBoxAlign( const SwCursor& rCursor ) { sal_uInt16 nAlign = USHRT_MAX; SwTableNode* pTblNd = rCursor.GetPoint()->nNode.GetNode().FindTableNode(); diff --git a/sw/source/core/docnode/node.cxx b/sw/source/core/docnode/node.cxx index 5810b1e1145d..7ad39abd8184 100644 --- a/sw/source/core/docnode/node.cxx +++ b/sw/source/core/docnode/node.cxx @@ -370,7 +370,7 @@ bool SwNode::IsInVisibleArea( SwViewShell const * pSh ) const else if( ND_ENDNODE & nNodeType ) { SwNodeIndex aIdx( *EndOfSectionNode() ); - pNd = GetNodes().GoPrevious( &aIdx ); + pNd = SwNodes::GoPrevious( &aIdx ); } else pNd = GetCntntNode(); @@ -472,7 +472,7 @@ const SwPageDesc* SwNode::FindPageDesc( bool bCalcLay, else if( ND_ENDNODE & nNodeType ) { SwNodeIndex aIdx( *EndOfSectionNode() ); - pNode = GetNodes().GoPrevious( &aIdx ); + pNode = SwNodes::GoPrevious( &aIdx ); } else { diff --git a/sw/source/core/docnode/nodes.cxx b/sw/source/core/docnode/nodes.cxx index 08068945af12..25f94bf74fc6 100644 --- a/sw/source/core/docnode/nodes.cxx +++ b/sw/source/core/docnode/nodes.cxx @@ -364,7 +364,7 @@ void SwNodes::ChgNode( SwNodeIndex& rDelPos, sal_uLong nSz, { OSL_ENSURE( false, "here, something wrong happened" ); aFrmNdIdx = rNds.GetEndOfContent(); - pFrmNd = rNds.GoPrevSection( &aFrmNdIdx, true, false ); + pFrmNd = SwNodes::GoPrevSection( &aFrmNdIdx, true, false ); if( pFrmNd && !static_cast<SwCntntNode*>(pFrmNd)->HasWriterListeners() ) pFrmNd = 0; OSL_ENSURE( pFrmNd, "ChgNode() - no FrameNode found" ); @@ -1248,14 +1248,15 @@ void SwNodes::Delete(const SwNodeIndex &rIndex, sal_uLong nNodes) * @param rIdx position of the node * @return section level at the given position */ -sal_uInt16 SwNodes::GetSectionLevel(const SwNodeIndex &rIdx) const { +sal_uInt16 SwNodes::GetSectionLevel(const SwNodeIndex &rIdx) +{ // special treatment for 1st Node if(rIdx == 0) return 1; // no recursion! This calles a SwNode::GetSectionLevel (missing "s") return rIdx.GetNode().GetSectionLevel(); } -void SwNodes::GoStartOfSection(SwNodeIndex *pIdx) const +void SwNodes::GoStartOfSection(SwNodeIndex *pIdx) { // after the next start node SwNodeIndex aTmp( *pIdx->GetNode().StartOfSectionNode(), +1 ); @@ -1273,7 +1274,7 @@ void SwNodes::GoStartOfSection(SwNodeIndex *pIdx) const (*pIdx) = aTmp; // is on a ContentNode } -void SwNodes::GoEndOfSection(SwNodeIndex *pIdx) const +void SwNodes::GoEndOfSection(SwNodeIndex *pIdx) { if( !pIdx->GetNode().IsEndNode() ) (*pIdx) = *pIdx->GetNode().EndOfSectionNode(); @@ -1296,7 +1297,7 @@ SwCntntNode* SwNodes::GoNext(SwNodeIndex *pIdx) const return static_cast<SwCntntNode*>(pNd); } -SwCntntNode* SwNodes::GoPrevious(SwNodeIndex *pIdx) const +SwCntntNode* SwNodes::GoPrevious(SwNodeIndex *pIdx) { if( !pIdx->GetIndex() ) return 0; @@ -1434,7 +1435,7 @@ static bool lcl_HighestLevel( const SwNodePtr& rpNode, void * pPara ) */ sal_uInt16 HighestLevel( SwNodes & rNodes, const SwNodeRange & rRange ) { - HighLevel aPara( rNodes.GetSectionLevel( rRange.aStart )); + HighLevel aPara( SwNodes::GetSectionLevel( rRange.aStart )); rNodes.ForEach( rRange.aStart, rRange.aEnd, lcl_HighestLevel, &aPara ); return aPara.nTop; @@ -1981,7 +1982,7 @@ SwCntntNode* SwNodes::GoNextSection( SwNodeIndex * pIdx, ///@see SwNodes::GoNextSection (TODO: seems to be C&P programming here) SwCntntNode* SwNodes::GoPrevSection( SwNodeIndex * pIdx, - bool bSkipHidden, bool bSkipProtect ) const + bool bSkipHidden, bool bSkipProtect ) { bool bFirst = true; SwNodeIndex aTmp( *pIdx ); diff --git a/sw/source/core/docnode/section.cxx b/sw/source/core/docnode/section.cxx index a5707dc74a97..e993c42204a3 100644 --- a/sw/source/core/docnode/section.cxx +++ b/sw/source/core/docnode/section.cxx @@ -651,7 +651,7 @@ SwSectionFmt::~SwSectionFmt() // If it was a linked Section, we need to make all Child Links // visible again if( rSect.IsConnected() ) - rSect.MakeChildLinksVisible( *pSectNd ); + SwSection::MakeChildLinksVisible( *pSectNd ); // Check whether we need to be visible, before deleting the Nodes if( rSect.IsHiddenFlag() ) @@ -1228,7 +1228,7 @@ static void lcl_UpdateLinksInSect( SwBaseLink& rUpdLnk, SwSectionNode& rSectNd ) SwPosition aPos( aIdx, SwIndex( pNewNd, 0 )); --aPos.nNode; - pDoc->CorrAbs( aIdx, aEndIdx, aPos, true ); + SwDoc::CorrAbs( aIdx, aEndIdx, aPos, true ); pPam = new SwPaM( aPos ); @@ -1485,7 +1485,7 @@ void SwIntrnlSectRefLink::Closed() // Make all Links within the Section visible again SwSectionNode* pSectNd = rSectFmt.GetSectionNode( false ); if( pSectNd ) - pSectNd->GetSection().MakeChildLinksVisible( *pSectNd ); + SwSection::MakeChildLinksVisible( *pSectNd ); if( pESh ) pESh->EndAllAction(); diff --git a/sw/source/core/draw/dview.cxx b/sw/source/core/draw/dview.cxx index 58a14d8696df..4361ade375a0 100644 --- a/sw/source/core/draw/dview.cxx +++ b/sw/source/core/draw/dview.cxx @@ -308,7 +308,7 @@ SdrObject* SwDrawView::GetMaxToBtmObj(SdrObject* pObj) const /// determine maximal order number for a 'child' object of given 'parent' object sal_uInt32 SwDrawView::_GetMaxChildOrdNum( const SwFlyFrm& _rParentObj, - const SdrObject* _pExclChildObj ) const + const SdrObject* _pExclChildObj ) { sal_uInt32 nMaxChildOrdNum = _rParentObj.GetDrawObj()->GetOrdNum(); diff --git a/sw/source/core/edit/acorrect.cxx b/sw/source/core/edit/acorrect.cxx index cb05ac3ab61f..eb877fb67121 100644 --- a/sw/source/core/edit/acorrect.cxx +++ b/sw/source/core/edit/acorrect.cxx @@ -44,7 +44,7 @@ class _PaMIntoCrsrShellRing SwPaM* pPrevDelPam; SwPaM* pPrevCrsr; - void RemoveFromRing( SwPaM& rPam, SwPaM* pPrev ); + static void RemoveFromRing( SwPaM& rPam, SwPaM* pPrev ); public: _PaMIntoCrsrShellRing( SwCrsrShell& rSh, SwPaM& rCrsr, SwPaM& rPam ); ~_PaMIntoCrsrShellRing(); diff --git a/sw/source/core/edit/autofmt.cxx b/sw/source/core/edit/autofmt.cxx index 6a1de5b508f8..729a37529eca 100644 --- a/sw/source/core/edit/autofmt.cxx +++ b/sw/source/core/edit/autofmt.cxx @@ -147,7 +147,7 @@ class SwAutoFormat return *m_pCharClass; } - bool IsSpace( const sal_Unicode c ) const + static bool IsSpace( const sal_Unicode c ) { return (' ' == c || '\t' == c || 0x0a == c|| 0x3000 == c /* Jap. space */); } void SetColl( sal_uInt16 nId, bool bHdLineOrText = false ); @@ -156,7 +156,7 @@ class SwAutoFormat // TxtNode methods const SwTxtNode* GetNextNode() const; - bool IsEmptyLine( const SwTxtNode& rNd ) const + static bool IsEmptyLine( const SwTxtNode& rNd ) { return rNd.GetTxt().isEmpty() || rNd.GetTxt().getLength() == GetLeadingBlanks( rNd.GetTxt() ); } @@ -164,14 +164,14 @@ class SwAutoFormat bool IsFastFullLine( const SwTxtNode& ) const; bool IsNoAlphaLine( const SwTxtNode&) const; bool IsEnumericChar( const SwTxtNode&) const; - bool IsBlanksInString( const SwTxtNode&) const; + static bool IsBlanksInString( const SwTxtNode&); sal_uInt16 CalcLevel( const SwTxtNode&, sal_uInt16 *pDigitLvl = 0 ) const; sal_Int32 GetBigIndent( sal_Int32& rAktSpacePos ) const; - OUString DelLeadingBlanks(const OUString& rStr) const; - OUString DelTrailingBlanks( const OUString& rStr ) const; - sal_Int32 GetLeadingBlanks( const OUString& rStr ) const; - sal_Int32 GetTrailingBlanks( const OUString& rStr ) const; + static OUString DelLeadingBlanks(const OUString& rStr); + static OUString DelTrailingBlanks( const OUString& rStr ); + static sal_Int32 GetLeadingBlanks( const OUString& rStr ); + static sal_Int32 GetTrailingBlanks( const OUString& rStr ); bool IsFirstCharCapital( const SwTxtNode& rNd ) const; sal_uInt16 GetDigitLevel( const SwTxtNode& rTxtNd, sal_Int32& rPos, @@ -187,8 +187,8 @@ class SwAutoFormat void BuildNegIndent( SwTwips nSpaces ); void BuildHeadLine( sal_uInt16 nLvl ); - bool HasSelBlanks( SwPaM& rPam ) const; - bool HasBreakAttr( const SwTxtNode& ) const; + static bool HasSelBlanks( SwPaM& rPam ); + static bool HasBreakAttr( const SwTxtNode& ); void DeleteSel( SwPaM& rPam ); bool DeleteCurNxtPara( const OUString& rNxtPara ); /// delete in the node start and/or end @@ -214,7 +214,7 @@ class SwAutoFormat } /// is a dot at the end ?? - bool IsSentenceAtEnd( const SwTxtNode& rTxtNd ) const; + static bool IsSentenceAtEnd( const SwTxtNode& rTxtNd ); bool DoUnderline(); bool DoTable(); @@ -404,7 +404,7 @@ bool SwAutoFormat::IsEnumericChar( const SwTxtNode& rNd ) const return USHRT_MAX != GetDigitLevel( rNd, nBlnks ); } -bool SwAutoFormat::IsBlanksInString( const SwTxtNode& rNd ) const +bool SwAutoFormat::IsBlanksInString( const SwTxtNode& rNd ) { // Search more than 5 consecutive blanks/tabs in the string. OUString sTmp( DelLeadingBlanks(rNd.GetTxt()) ); @@ -661,7 +661,7 @@ bool SwAutoFormat::DoTable() return 1 < aPosArr.size(); } -OUString SwAutoFormat::DelLeadingBlanks( const OUString& rStr ) const +OUString SwAutoFormat::DelLeadingBlanks( const OUString& rStr ) { sal_Int32 nL, n; for( nL = rStr.getLength(), n = 0; n < nL && IsSpace( rStr[n] ); ++n ) @@ -671,7 +671,7 @@ OUString SwAutoFormat::DelLeadingBlanks( const OUString& rStr ) const return rStr; } -OUString SwAutoFormat::DelTrailingBlanks( const OUString& rStr ) const +OUString SwAutoFormat::DelTrailingBlanks( const OUString& rStr ) { sal_Int32 nL = rStr.getLength(), n = nL; if( !nL ) @@ -684,7 +684,7 @@ OUString SwAutoFormat::DelTrailingBlanks( const OUString& rStr ) const return rStr; } -sal_Int32 SwAutoFormat::GetLeadingBlanks( const OUString& rStr ) const +sal_Int32 SwAutoFormat::GetLeadingBlanks( const OUString& rStr ) { sal_Int32 nL; sal_Int32 n; @@ -694,7 +694,7 @@ sal_Int32 SwAutoFormat::GetLeadingBlanks( const OUString& rStr ) const return n; } -sal_Int32 SwAutoFormat::GetTrailingBlanks( const OUString& rStr ) const +sal_Int32 SwAutoFormat::GetTrailingBlanks( const OUString& rStr ) { sal_Int32 nL = rStr.getLength(), n = nL; if( !nL ) @@ -991,7 +991,7 @@ void SwAutoFormat::SetColl( sal_uInt16 nId, bool bHdLineOrText ) m_pDoc->SetTxtFmtCollByAutoFmt( *m_aDelPam.GetPoint(), nId, &aSet ); } -bool SwAutoFormat::HasSelBlanks( SwPaM& rPam ) const +bool SwAutoFormat::HasSelBlanks( SwPaM& rPam ) { // Is there a Blank at the beginning or end? // Do not delete it, it will be inserted again. @@ -1015,7 +1015,7 @@ bool SwAutoFormat::HasSelBlanks( SwPaM& rPam ) const return true; } -bool SwAutoFormat::HasBreakAttr( const SwTxtNode& rTxtNd ) const +bool SwAutoFormat::HasBreakAttr( const SwTxtNode& rTxtNd ) { const SfxItemSet* pSet = rTxtNd.GetpSwAttrSet(); if( !pSet ) @@ -1034,7 +1034,7 @@ bool SwAutoFormat::HasBreakAttr( const SwTxtNode& rTxtNd ) const } /// Is there a dot at the end? -bool SwAutoFormat::IsSentenceAtEnd( const SwTxtNode& rTxtNd ) const +bool SwAutoFormat::IsSentenceAtEnd( const SwTxtNode& rTxtNd ) { const OUString& rStr = rTxtNd.GetTxt(); sal_Int32 n = rStr.getLength(); diff --git a/sw/source/core/edit/editsh.cxx b/sw/source/core/edit/editsh.cxx index 08fb7de31e44..74a7be25ed56 100644 --- a/sw/source/core/edit/editsh.cxx +++ b/sw/source/core/edit/editsh.cxx @@ -299,7 +299,7 @@ void SwEditShell::GetGrfNms( OUString* pGrfName, OUString* pFltName, { OSL_ENSURE( pGrfName || pFltName, "No parameters" ); if( pFmt ) - GetDoc()->GetGrfNms( *pFmt, pGrfName, pFltName ); + SwDoc::GetGrfNms( *pFmt, pGrfName, pFltName ); else { SwGrfNode *pGrfNode = _GetGrfNode(); @@ -1044,7 +1044,7 @@ void SwEditShell::CountWords( SwDocStat& rStat ) const for(SwPaM& rPaM : GetCrsr()->GetRingContainer()) { if( rPaM.HasMark() ) - GetDoc()->CountWords( rPaM, rStat ); + SwDoc::CountWords( rPaM, rStat ); } } diff --git a/sw/source/core/edit/edlingu.cxx b/sw/source/core/edit/edlingu.cxx index edd5d3217845..5b1c2d993700 100644 --- a/sw/source/core/edit/edlingu.cxx +++ b/sw/source/core/edit/edlingu.cxx @@ -155,7 +155,7 @@ public: class SwHyphIter : public SwLinguIter { bool bOldIdle; - void DelSoftHyph( SwPaM &rPam ); + static void DelSoftHyph( SwPaM &rPam ); public: SwHyphIter() : bOldIdle(false) {} @@ -167,7 +167,7 @@ public: uno::Any Continue( sal_uInt16* pPageCnt, sal_uInt16* pPageSt ); - bool IsAuto(); + static bool IsAuto(); void InsertSoftHyph( const sal_Int32 nHyphPos ); void ShowSelection(); }; @@ -490,7 +490,7 @@ uno::Any SwHyphIter::Continue( sal_uInt16* pPageCnt, sal_uInt16* pPageSt ) if( bAuto && xHyphWord.is() ) { - pMySh->InsertSoftHyph( xHyphWord->getHyphenationPos() + 1); + SwEditShell::InsertSoftHyph( xHyphWord->getHyphenationPos() + 1); } } while( bAuto && xHyphWord.is() ); //end of do-while bGoOn = !xHyphWord.is() && GetCrsrCnt() > 1; @@ -571,7 +571,7 @@ void SwHyphIter::InsertSoftHyph( const sal_Int32 nHyphPos ) pCrsr->SetMark(); } -bool SwEditShell::HasLastSentenceGotGrammarChecked() const +bool SwEditShell::HasLastSentenceGotGrammarChecked() { bool bTextWasGrammarChecked = false; if (pSpellIter) @@ -589,12 +589,12 @@ bool SwEditShell::HasLastSentenceGotGrammarChecked() const return bTextWasGrammarChecked; } -bool SwEditShell::HasConvIter() const +bool SwEditShell::HasConvIter() { return 0 != pConvIter; } -bool SwEditShell::HasHyphIter() const +bool SwEditShell::HasHyphIter() { return 0 != pHyphIter; } diff --git a/sw/source/core/edit/ednumber.cxx b/sw/source/core/edit/ednumber.cxx index 0617ef2d3698..2cb0d45c9c66 100644 --- a/sw/source/core/edit/ednumber.cxx +++ b/sw/source/core/edit/ednumber.cxx @@ -332,7 +332,7 @@ bool SwEditShell::NumUpDown( bool bDown ) bool SwEditShell::IsFirstOfNumRuleAtCrsrPos() const { - return GetDoc()->IsFirstOfNumRuleAtPos( *GetCrsr()->GetPoint() ); + return SwDoc::IsFirstOfNumRuleAtPos( *GetCrsr()->GetPoint() ); } // -> #i23725#, #i90078# @@ -362,7 +362,7 @@ void SwEditShell::SetIndent(short nIndent, const SwPosition & rPos) { StartAllAction(); - SwNumRule *pCurNumRule = GetDoc()->GetNumRuleAtPos(rPos); + SwNumRule *pCurNumRule = SwDoc::GetNumRuleAtPos(rPos); if (pCurNumRule) { @@ -426,7 +426,7 @@ void SwEditShell::GetCurrentOutlineLevels( sal_uInt8& rUpper, sal_uInt8& rLower aCrsr.SetMark(); if( pCrsr->HasMark() ) *aCrsr.GetPoint() = *pCrsr->End(); - GetDoc()->GotoNextNum( *aCrsr.GetPoint(), false, &rUpper, &rLower ); + SwDoc::GotoNextNum( *aCrsr.GetPoint(), false, &rUpper, &rLower ); } bool SwEditShell::MoveNumParas( bool bUpperLower, bool bUpperLeft ) @@ -443,7 +443,7 @@ bool SwEditShell::MoveNumParas( bool bUpperLower, bool bUpperLeft ) bool bRet = false; sal_uInt8 nUpperLevel, nLowerLevel; - if( GetDoc()->GotoNextNum( *aCrsr.GetPoint(), false, + if( SwDoc::GotoNextNum( *aCrsr.GetPoint(), false, &nUpperLevel, &nLowerLevel )) { if( bUpperLower ) @@ -455,7 +455,7 @@ bool SwEditShell::MoveNumParas( bool bUpperLower, bool bUpperLeft ) if( bUpperLeft ) // move up { SwPosition aPos( *aCrsr.GetMark() ); - if( GetDoc()->GotoPrevNum( aPos, false ) ) + if( SwDoc::GotoPrevNum( aPos, false ) ) nOffset = aPos.nNode.GetIndex() - aCrsr.GetMark()->nNode.GetIndex(); else @@ -690,7 +690,7 @@ sal_uInt8 SwEditShell::GetNumLevel() const const SwNumRule* SwEditShell::GetNumRuleAtCurrCrsrPos() const { - return GetDoc()->GetNumRuleAtPos( *GetCrsr()->GetPoint() ); + return SwDoc::GetNumRuleAtPos( *GetCrsr()->GetPoint() ); } const SwNumRule* SwEditShell::GetNumRuleAtCurrentSelection() const @@ -704,7 +704,7 @@ const SwNumRule* SwEditShell::GetNumRuleAtCurrentSelection() const for ( SwNodeIndex aNode = rCurrentCrsr.Start()->nNode; aNode <= aEndNode; ++aNode ) { - const SwNumRule* pNumRule = GetDoc()->GetNumRuleAtPos( SwPosition( aNode ) ); + const SwNumRule* pNumRule = SwDoc::GetNumRuleAtPos( SwPosition( aNode ) ); if ( pNumRule == NULL ) { continue; diff --git a/sw/source/core/edit/edsect.cxx b/sw/source/core/edit/edsect.cxx index 028a6f2e4a0f..6dadbaa05a83 100644 --- a/sw/source/core/edit/edsect.cxx +++ b/sw/source/core/edit/edsect.cxx @@ -63,7 +63,7 @@ bool SwEditShell::IsInsRegionAvailable() const if( pCrsr->GetNext() != pCrsr ) return false; if( pCrsr->HasMark() ) - return 0 != GetDoc()->IsInsRegionAvailable( *pCrsr ); + return 0 != SwDoc::IsInsRegionAvailable( *pCrsr ); return true; } @@ -73,7 +73,7 @@ const SwSection* SwEditShell::GetCurrSection() const if( IsTableMode() ) return 0; - return GetDoc()->GetCurrSection( *GetCrsr()->GetPoint() ); + return SwDoc::GetCurrSection( *GetCrsr()->GetPoint() ); } /** Deliver the responsible area of the columns. diff --git a/sw/source/core/edit/edtox.cxx b/sw/source/core/edit/edtox.cxx index fdc6253b9b83..879285db36ff 100644 --- a/sw/source/core/edit/edtox.cxx +++ b/sw/source/core/edit/edtox.cxx @@ -92,10 +92,10 @@ void SwEditShell::DeleteTOXMark( SwTOXMark* pMark ) /// Collect all listing markers sal_uInt16 SwEditShell::GetCurTOXMarks(SwTOXMarks& rMarks) const { - return GetDoc()->GetCurTOXMark( *GetCrsr()->Start(), rMarks ); + return SwDoc::GetCurTOXMark( *GetCrsr()->Start(), rMarks ); } -bool SwEditShell::IsTOXBaseReadonly(const SwTOXBase& rTOXBase) const +bool SwEditShell::IsTOXBaseReadonly(const SwTOXBase& rTOXBase) { OSL_ENSURE( rTOXBase.ISA( SwTOXBaseSection ), "no TOXBaseSection!" ); const SwTOXBaseSection& rTOXSect = static_cast<const SwTOXBaseSection&>(rTOXBase); @@ -199,7 +199,7 @@ bool SwEditShell::UpdateTableOf( const SwTOXBase& rTOX, const SfxItemSet* pSet ) /// Get current listing before or at the Cursor const SwTOXBase* SwEditShell::GetCurTOX() const { - return GetDoc()->GetCurTOX( *GetCrsr()->GetPoint() ); + return SwDoc::GetCurTOX( *GetCrsr()->GetPoint() ); } bool SwEditShell::DeleteTOX( const SwTOXBase& rTOXBase, bool bDelNodes ) diff --git a/sw/source/core/fields/cellfml.cxx b/sw/source/core/fields/cellfml.cxx index 78e71c63987c..51858645b8fa 100644 --- a/sw/source/core/fields/cellfml.cxx +++ b/sw/source/core/fields/cellfml.cxx @@ -697,7 +697,7 @@ OUString SwTableFormula::ScanString( FnScanFormula fnFormula, const SwTable& rTb return aStr; } -const SwTable* SwTableFormula::FindTable( SwDoc& rDoc, const OUString& rNm ) const +const SwTable* SwTableFormula::FindTable( SwDoc& rDoc, const OUString& rNm ) { const SwFrmFmts& rTblFmts = *rDoc.GetTblFrmFmts(); const SwTable* pTmpTbl = 0, *pRet = 0; @@ -916,7 +916,7 @@ void SwTableFormula::_GetFmlBoxes( const SwTable& rTbl, OUString& , void SwTableFormula::GetBoxes( const SwTableBox& rSttBox, const SwTableBox& rEndBox, - SwSelBoxes& rBoxes ) const + SwSelBoxes& rBoxes ) { // get all selected boxes via layout const SwLayoutFrm *pStt, *pEnd; diff --git a/sw/source/core/fields/docufld.cxx b/sw/source/core/fields/docufld.cxx index 0fb8f398194d..b95df32bbe63 100644 --- a/sw/source/core/fields/docufld.cxx +++ b/sw/source/core/fields/docufld.cxx @@ -321,7 +321,7 @@ SwAuthorFieldType::SwAuthorFieldType() { } -OUString SwAuthorFieldType::Expand(sal_uLong nFmt) const +OUString SwAuthorFieldType::Expand(sal_uLong nFmt) { SvtUserOptions& rOpt = SW_MOD()->GetUserOptions(); if((nFmt & 0xff) == AF_NAME) @@ -338,14 +338,14 @@ SwFieldType* SwAuthorFieldType::Copy() const SwAuthorField::SwAuthorField(SwAuthorFieldType* pTyp, sal_uInt32 nFmt) : SwField(pTyp, nFmt) { - aContent = static_cast<SwAuthorFieldType*>(GetTyp())->Expand(GetFormat()); + aContent = SwAuthorFieldType::Expand(GetFormat()); } OUString SwAuthorField::Expand() const { if (!IsFixed()) const_cast<SwAuthorField*>(this)->aContent = - static_cast<SwAuthorFieldType*>(GetTyp())->Expand(GetFormat()); + SwAuthorFieldType::Expand(GetFormat()); return aContent; } @@ -1846,7 +1846,7 @@ SwFieldType* SwExtUserFieldType::Copy() const return pTyp; } -OUString SwExtUserFieldType::Expand(sal_uInt16 nSub, sal_uInt32 ) const +OUString SwExtUserFieldType::Expand(sal_uInt16 nSub, sal_uInt32 ) { sal_uInt16 nRet = USHRT_MAX; switch(nSub) @@ -1884,13 +1884,13 @@ OUString SwExtUserFieldType::Expand(sal_uInt16 nSub, sal_uInt32 ) const SwExtUserField::SwExtUserField(SwExtUserFieldType* pTyp, sal_uInt16 nSubTyp, sal_uInt32 nFmt) : SwField(pTyp, nFmt), nType(nSubTyp) { - aContent = static_cast<SwExtUserFieldType*>(GetTyp())->Expand(nType, GetFormat()); + aContent = SwExtUserFieldType::Expand(nType, GetFormat()); } OUString SwExtUserField::Expand() const { if (!IsFixed()) - const_cast<SwExtUserField*>(this)->aContent = static_cast<SwExtUserFieldType*>(GetTyp())->Expand(nType, GetFormat()); + const_cast<SwExtUserField*>(this)->aContent = SwExtUserFieldType::Expand(nType, GetFormat()); return aContent; } diff --git a/sw/source/core/fields/reffld.cxx b/sw/source/core/fields/reffld.cxx index 94d5521576a1..4b99ae860dd8 100644 --- a/sw/source/core/fields/reffld.cxx +++ b/sw/source/core/fields/reffld.cxx @@ -497,7 +497,7 @@ void SwGetRefField::UpdateField( const SwTxtFld* pFldTxtAttr ) // #i81002# OUString SwGetRefField::MakeRefNumStr( const SwTxtNode& rTxtNodeOfField, const SwTxtNode& rTxtNodeOfReferencedItem, - const sal_uInt32 nRefNumFormat ) const + const sal_uInt32 nRefNumFormat ) { if ( rTxtNodeOfReferencedItem.HasNumber() && rTxtNodeOfReferencedItem.IsCountedInList() ) @@ -928,10 +928,10 @@ private: bool bInit; void Init(SwDoc& rDoc, SwDoc& rDestDoc, bool bField ); - void GetNoteIdsFromDoc( SwDoc& rDoc, std::set<sal_uInt16> &rIds ); + static void GetNoteIdsFromDoc( SwDoc& rDoc, std::set<sal_uInt16> &rIds ); void GetFieldIdsFromDoc( SwDoc& rDoc, std::set<sal_uInt16> &rIds ); void AddId( sal_uInt16 id, sal_uInt16 seqNum ); - sal_uInt16 GetFirstUnusedId( std::set<sal_uInt16> &rIds ); + static sal_uInt16 GetFirstUnusedId( std::set<sal_uInt16> &rIds ); public: _RefIdsMap( const OUString& rName ) : aName( rName ), bInit( false ) {} diff --git a/sw/source/core/frmedt/fefly1.cxx b/sw/source/core/frmedt/fefly1.cxx index 72aa28d41cc1..0636002c3eb3 100644 --- a/sw/source/core/frmedt/fefly1.cxx +++ b/sw/source/core/frmedt/fefly1.cxx @@ -99,7 +99,6 @@ static bool lcl_SetNewFlyPos( const SwNode& rNode, SwFmtAnchor& rAnchor, } static bool lcl_FindAnchorPos( - SwEditShell& rEditShell, SwDoc& rDoc, const Point& rPt, const SwFrm& rFrm, @@ -146,9 +145,9 @@ static bool lcl_FindAnchorPos( } else { - if ( rEditShell.PosInsideInputFld( aPos ) ) + if ( SwCrsrShell::PosInsideInputFld( aPos ) ) { - aPos.nContent = rEditShell.StartOfInputFldAtPos( aPos ); + aPos.nContent = SwCrsrShell::StartOfInputFldAtPos( aPos ); } } } @@ -196,7 +195,6 @@ static bool lcl_FindAnchorPos( //! also used in unoframe.cxx bool sw_ChkAndSetNewAnchor( - SwEditShell& rEditShell, const SwFlyFrm& rFly, SfxItemSet& rSet ) { @@ -218,7 +216,7 @@ bool sw_ChkAndSetNewAnchor( "forbidden anchor change in Head/Foot." ); #endif - return ::lcl_FindAnchorPos( rEditShell, *pDoc, rFly.Frm().Pos(), rFly, rSet ); + return ::lcl_FindAnchorPos( *pDoc, rFly.Frm().Pos(), rFly, rSet ); } void SwFEShell::SelectFlyFrm( SwFlyFrm& rFrm, bool bNew ) @@ -879,7 +877,7 @@ void SwFEShell::InsertDrawObj( SdrObject& rDrawObj, const Point aRelPos( rInsertPosition.X() - pFrm->Frm().Left(), rInsertPosition.Y() - pFrm->Frm().Top() ); rDrawObj.SetRelativePos( aRelPos ); - ::lcl_FindAnchorPos( *this, *GetDoc(), rInsertPosition, *pFrm, rFlyAttrSet ); + ::lcl_FindAnchorPos( *GetDoc(), rInsertPosition, *pFrm, rFlyAttrSet ); } // insert drawing object into the document creating a new <SwDrawFrmFmt> instance SwDrawFrmFmt* pFmt = GetDoc()->getIDocumentContentOperations().InsertDrawObj( aPam, rDrawObj, rFlyAttrSet ); @@ -1041,7 +1039,7 @@ bool SwFEShell::SetFlyFrmAttr( SfxItemSet& rSet ) const Point aPt( pFly->Frm().Pos() ); if( SfxItemState::SET == rSet.GetItemState( RES_ANCHOR, false )) - sw_ChkAndSetNewAnchor( *this, *pFly, rSet ); + sw_ChkAndSetNewAnchor( *pFly, rSet ); SwFlyFrmFmt* pFlyFmt = (SwFlyFrmFmt*)pFly->GetFmt(); if( GetDoc()->SetFlyFrmAttr( *pFlyFmt, rSet )) @@ -1182,7 +1180,7 @@ void SwFEShell::SetFrmFmt( SwFrmFmt *pNewFmt, bool bKeepOrient, Point* pDocPos ) { pSet = new SfxItemSet( GetDoc()->GetAttrPool(), aFrmFmtSetRange ); pSet->Put( *pItem ); - if( !sw_ChkAndSetNewAnchor( *this, *pFly, *pSet )) + if( !sw_ChkAndSetNewAnchor( *pFly, *pSet )) delete pSet, pSet = 0; } diff --git a/sw/source/core/frmedt/fetab.cxx b/sw/source/core/frmedt/fetab.cxx index 24062749c174..d78f1b7d28f5 100644 --- a/sw/source/core/frmedt/fetab.cxx +++ b/sw/source/core/frmedt/fetab.cxx @@ -86,7 +86,7 @@ class TblWait const ::std::unique_ptr<SwWait> m_pWait; // this seems really fishy: do some locking, if an arbitrary number of lines is exceeded static const size_t our_kLineLimit = 20; - bool ShouldWait(size_t nCnt, SwFrm *pFrm, size_t nCnt2) + static bool ShouldWait(size_t nCnt, SwFrm *pFrm, size_t nCnt2) { return our_kLineLimit < nCnt || our_kLineLimit < nCnt2 || (pFrm && our_kLineLimit < pFrm->ImplFindTabFrm()->GetTable()->GetTabLines().size()); } public: TblWait(size_t nCnt, SwFrm *pFrm, SwDocShell &rDocShell, size_t nCnt2 = 0) @@ -571,7 +571,7 @@ void SwFEShell::_GetTabCols( SwTabCols &rToFill, const SwFrm *pBox ) const } if ( !pLastCols ) { - GetDoc()->GetTabCols( rToFill, 0, static_cast<const SwCellFrm*>(pBox) ); + SwDoc::GetTabCols( rToFill, 0, static_cast<const SwCellFrm*>(pBox) ); pLastCols = new SwTabCols( rToFill ); pColumnCacheLastTable = pTab->GetTable(); @@ -627,7 +627,7 @@ void SwFEShell::_GetTabRows( SwTabCols &rToFill, const SwFrm *pBox ) const } if ( !pLastRows ) { - GetDoc()->GetTabRows( rToFill, 0, static_cast<const SwCellFrm*>(pBox) ); + SwDoc::GetTabRows( rToFill, 0, static_cast<const SwCellFrm*>(pBox) ); pLastRows = new SwTabCols( rToFill ); pRowCacheLastTable = pTab->GetTable(); @@ -723,7 +723,7 @@ void SwFEShell::SetRowSplit( const SwFmtRowSplit& rNew ) void SwFEShell::GetRowSplit( SwFmtRowSplit*& rpSz ) const { - GetDoc()->GetRowSplit( *getShellCrsr( false ), rpSz ); + SwDoc::GetRowSplit( *getShellCrsr( false ), rpSz ); } void SwFEShell::SetRowHeight( const SwFmtFrmSize &rNew ) @@ -736,7 +736,7 @@ void SwFEShell::SetRowHeight( const SwFmtFrmSize &rNew ) void SwFEShell::GetRowHeight( SwFmtFrmSize *& rpSz ) const { - GetDoc()->GetRowHeight( *getShellCrsr( false ), rpSz ); + SwDoc::GetRowHeight( *getShellCrsr( false ), rpSz ); } bool SwFEShell::BalanceRowHeight( bool bTstOnly ) @@ -760,7 +760,7 @@ void SwFEShell::SetRowBackground( const SvxBrushItem &rNew ) bool SwFEShell::GetRowBackground( SvxBrushItem &rToFill ) const { - return GetDoc()->GetRowBackground( *getShellCrsr( false ), rToFill ); + return SwDoc::GetRowBackground( *getShellCrsr( false ), rToFill ); } void SwFEShell::SetTabBorders( const SfxItemSet& rSet ) @@ -783,7 +783,7 @@ void SwFEShell::SetTabLineStyle( const Color* pColor, bool bSetLine, void SwFEShell::GetTabBorders( SfxItemSet& rSet ) const { - GetDoc()->GetTabBorders( *getShellCrsr( false ), rSet ); + SwDoc::GetTabBorders( *getShellCrsr( false ), rSet ); } void SwFEShell::SetBoxBackground( const SvxBrushItem &rNew ) @@ -796,7 +796,7 @@ void SwFEShell::SetBoxBackground( const SvxBrushItem &rNew ) bool SwFEShell::GetBoxBackground( SvxBrushItem &rToFill ) const { - return GetDoc()->GetBoxAttr( *getShellCrsr( false ), rToFill ); + return SwDoc::GetBoxAttr( *getShellCrsr( false ), rToFill ); } void SwFEShell::SetBoxDirection( const SvxFrameDirectionItem& rNew ) @@ -809,7 +809,7 @@ void SwFEShell::SetBoxDirection( const SvxFrameDirectionItem& rNew ) bool SwFEShell::GetBoxDirection( SvxFrameDirectionItem& rToFill ) const { - return GetDoc()->GetBoxAttr( *getShellCrsr( false ), rToFill ); + return SwDoc::GetBoxAttr( *getShellCrsr( false ), rToFill ); } void SwFEShell::SetBoxAlign( sal_uInt16 nAlign ) @@ -822,7 +822,7 @@ void SwFEShell::SetBoxAlign( sal_uInt16 nAlign ) sal_uInt16 SwFEShell::GetBoxAlign() const { - return GetDoc()->GetBoxAlign( *getShellCrsr( false ) ); + return SwDoc::GetBoxAlign( *getShellCrsr( false ) ); } void SwFEShell::SetTabBackground( const SvxBrushItem &rNew ) @@ -889,7 +889,7 @@ bool SwFEShell::HasBoxSelection() const SwCntntNode* pCNd = aIdx.GetNode().GetCntntNode(); if( !pCNd ) { - pCNd = GetDoc()->GetNodes().GoPrevious( &aIdx ); + pCNd = SwNodes::GoPrevious( &aIdx ); OSL_ENSURE( pCNd, "no ContentNode in box ??" ); } if( pPam->GetMark()->nContent == pCNd->Len() ) @@ -1957,7 +1957,7 @@ bool SwFEShell::IsNumLabel( const Point &rPt, int nMaxOffset ) // #i42921# bool SwFEShell::IsVerticalModeAtNdAndPos( const SwTxtNode& _rTxtNode, - const Point& _rDocPos ) const + const Point& _rDocPos ) { bool bRet( false ); diff --git a/sw/source/core/graphic/ndgrf.cxx b/sw/source/core/graphic/ndgrf.cxx index 28629cce65bb..8a5833c7e058 100644 --- a/sw/source/core/graphic/ndgrf.cxx +++ b/sw/source/core/graphic/ndgrf.cxx @@ -944,7 +944,7 @@ SwCntntNode* SwGrfNode::MakeCopy( SwDoc* pDoc, const SwNodeIndex& rIdx ) const sFilter = "DDE"; } - SwGrfNode* pGrfNd = pDoc->GetNodes().MakeGrfNode( rIdx, sFile, sFilter, + SwGrfNode* pGrfNd = SwNodes::MakeGrfNode( rIdx, sFile, sFilter, &aTmpGrf, pColl, const_cast<SwAttrSet*>(GetpSwAttrSet()) ); pGrfNd->SetTitle( GetTitle() ); diff --git a/sw/source/core/inc/SwXMLTextBlocks.hxx b/sw/source/core/inc/SwXMLTextBlocks.hxx index 5845ecc0466d..d2c8abc5d0bb 100644 --- a/sw/source/core/inc/SwXMLTextBlocks.hxx +++ b/sw/source/core/inc/SwXMLTextBlocks.hxx @@ -54,7 +54,7 @@ public: SwXMLTextBlocks( const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >&, const OUString& rFile ); void AddName( const OUString&, const OUString&, const OUString&, bool bOnlyTxt = false ); virtual void AddName( const OUString&, const OUString&, bool bOnlyTxt = false ) SAL_OVERRIDE; - OUString GeneratePackageName ( const OUString& rShort ); + static OUString GeneratePackageName ( const OUString& rShort ); virtual ~SwXMLTextBlocks(); virtual sal_uLong Delete( sal_uInt16 ) SAL_OVERRIDE; virtual sal_uLong Rename( sal_uInt16, const OUString&, const OUString& ) SAL_OVERRIDE; diff --git a/sw/source/core/inc/UndoBookmark.hxx b/sw/source/core/inc/UndoBookmark.hxx index c4215e2e6a8c..82524568d3d6 100644 --- a/sw/source/core/inc/UndoBookmark.hxx +++ b/sw/source/core/inc/UndoBookmark.hxx @@ -87,7 +87,7 @@ public: private: virtual SwRewriter GetRewriter() const SAL_OVERRIDE; - void Rename( ::sw::UndoRedoContext &, const OUString& sFrom, const OUString& sTo ); + static void Rename( ::sw::UndoRedoContext &, const OUString& sFrom, const OUString& sTo ); virtual void UndoImpl( ::sw::UndoRedoContext & ) SAL_OVERRIDE; virtual void RedoImpl( ::sw::UndoRedoContext & ) SAL_OVERRIDE; }; diff --git a/sw/source/core/inc/UndoTable.hxx b/sw/source/core/inc/UndoTable.hxx index b4263bcdf4dd..31a3502457a3 100644 --- a/sw/source/core/inc/UndoTable.hxx +++ b/sw/source/core/inc/UndoTable.hxx @@ -278,7 +278,7 @@ class SwUndoTblCpyTbl : public SwUndo //b6341295: When redlining is active, PrepareRedline has to create the //redlining attributes for the new and the old table cell content - SwUndo* PrepareRedline( SwDoc* pDoc, const SwTableBox& rBox, + static SwUndo* PrepareRedline( SwDoc* pDoc, const SwTableBox& rBox, const SwPosition& rPos, bool& rJoin, bool bRedo ); public: diff --git a/sw/source/core/inc/anchoredobjectposition.hxx b/sw/source/core/inc/anchoredobjectposition.hxx index 7b8b34b9d038..d10b3bca9125 100644 --- a/sw/source/core/inc/anchoredobjectposition.hxx +++ b/sw/source/core/inc/anchoredobjectposition.hxx @@ -126,9 +126,9 @@ namespace objectpositioning #i11860# */ - SwTwips _GetTopForObjPos( const SwFrm& _rFrm, + static SwTwips _GetTopForObjPos( const SwFrm& _rFrm, const SwRectFn& _fnRect, - const bool _bVert ) const; + const bool _bVert ); void _GetVertAlignmentValues( const SwFrm& _rVertOrientFrm, const SwFrm& _rPageAlignLayFrm, @@ -287,10 +287,10 @@ namespace objectpositioning optional input/output parameter (default value NULL) - if set, relative alignment, that is toggled, if needed. */ - void _ToggleHoriOrientAndAlign( const bool _bToggleLeftRight, + static void _ToggleHoriOrientAndAlign( const bool _bToggleLeftRight, sal_Int16& _ioeHoriOrient, sal_Int16& _iopeRelOrient - ) const; + ); /** determine alignment values for horizontal position of object @@ -438,9 +438,9 @@ namespace objectpositioning <_eRelOrient1> has to be drawn aside an object with an alignment <_eRelOrient2> */ - bool _Minor( sal_Int16 _eRelOrient1, + static bool _Minor( sal_Int16 _eRelOrient1, sal_Int16 _eRelOrient2, - bool _bLeft ) const; + bool _bLeft ); public: virtual void CalcPosition() = 0; diff --git a/sw/source/core/inc/docsort.hxx b/sw/source/core/inc/docsort.hxx index 27c79a15aa7e..b4e4ef338735 100644 --- a/sw/source/core/inc/docsort.hxx +++ b/sw/source/core/inc/docsort.hxx @@ -85,7 +85,7 @@ struct SwSortElement bool operator==(const SwSortElement& ) const; bool operator<(const SwSortElement& ) const; - double StrToDouble(const OUString& rStr) const; + static double StrToDouble(const OUString& rStr); private: int keycompare(const SwSortElement& rCmp, sal_uInt16 nKey) const; }; diff --git a/sw/source/core/inc/dview.hxx b/sw/source/core/inc/dview.hxx index e9a8569a6f58..bce6d1867dcf 100644 --- a/sw/source/core/inc/dview.hxx +++ b/sw/source/core/inc/dview.hxx @@ -50,8 +50,8 @@ class SwDrawView : public FmFormView optional input parameter - 'child' object, which will not be considered on the calculation of the maximal order number */ - sal_uInt32 _GetMaxChildOrdNum( const SwFlyFrm& _rParentObj, - const SdrObject* _pExclChildObj = 0L ) const; + static sal_uInt32 _GetMaxChildOrdNum( const SwFlyFrm& _rParentObj, + const SdrObject* _pExclChildObj = 0L ); /** method to move 'repeated' objects of the given moved object to the according level diff --git a/sw/source/core/inc/fefly.hxx b/sw/source/core/inc/fefly.hxx index 0c51868d6773..6ab335a436d7 100644 --- a/sw/source/core/inc/fefly.hxx +++ b/sw/source/core/inc/fefly.hxx @@ -20,7 +20,7 @@ #ifndef INCLUDED_SW_SOURCE_CORE_INC_FEFLY_HXX #define INCLUDED_SW_SOURCE_CORE_INC_FEFLY_HXX -bool sw_ChkAndSetNewAnchor( SwEditShell& rEditShell, const SwFlyFrm& rFly, SfxItemSet& rSet ); +bool sw_ChkAndSetNewAnchor( const SwFlyFrm& rFly, SfxItemSet& rSet ); #endif diff --git a/sw/source/core/inc/fntcache.hxx b/sw/source/core/inc/fntcache.hxx index 6755965d0f91..8e2109411599 100644 --- a/sw/source/core/inc/fntcache.hxx +++ b/sw/source/core/inc/fntcache.hxx @@ -45,7 +45,7 @@ public: ) {} inline SwFntObj *First( ); - inline SwFntObj *Next( SwFntObj *pFntObj); + static inline SwFntObj *Next( SwFntObj *pFntObj); void Flush(); }; diff --git a/sw/source/core/inc/frame.hxx b/sw/source/core/inc/frame.hxx index fe3ec9190905..bc729ca77ab0 100644 --- a/sw/source/core/inc/frame.hxx +++ b/sw/source/core/inc/frame.hxx @@ -844,7 +844,7 @@ public: // #i65250# inline sal_uInt32 GetFrmId() const { return mnFrmId; } - inline sal_uInt32 GetLastFrmId() const { return mnLastFrmId; } + static inline sal_uInt32 GetLastFrmId() { return mnLastFrmId; } // NEW TABELS // Some functions for covered/covering table cells. This way unnessessary diff --git a/sw/source/core/inc/frminf.hxx b/sw/source/core/inc/frminf.hxx index c62932be149d..15aa7e908d93 100644 --- a/sw/source/core/inc/frminf.hxx +++ b/sw/source/core/inc/frminf.hxx @@ -31,7 +31,7 @@ class SwTxtFrmInfo const SwTxtFrm *pFrm; // Where does the text (w/o whitespaces) start (document is global!)? - SwTwips GetLineStart( const SwTxtCursor &rLine ) const; + static SwTwips GetLineStart( const SwTxtCursor &rLine ); public: inline SwTxtFrmInfo( const SwTxtFrm *pTxtFrm ) : pFrm(pTxtFrm) { } diff --git a/sw/source/core/inc/ftnboss.hxx b/sw/source/core/inc/ftnboss.hxx index bd0efb9c02b9..c8edcc2424b9 100644 --- a/sw/source/core/inc/ftnboss.hxx +++ b/sw/source/core/inc/ftnboss.hxx @@ -83,7 +83,7 @@ public: const SwFtnFrm *FindFirstFtn( SwCntntFrm* ) const; SwFtnContFrm *FindNearestFtnCont( bool bDontLeave = false ); - void ChangeFtnRef( const SwCntntFrm *pOld, const SwTxtFtn *, + static void ChangeFtnRef( const SwCntntFrm *pOld, const SwTxtFtn *, SwCntntFrm *pNew ); void RearrangeFtns( const SwTwips nDeadLine, const bool bLock = false, const SwTxtFtn *pAttr = 0 ); diff --git a/sw/source/core/inc/layact.hxx b/sw/source/core/inc/layact.hxx index 96bf9a10bbe6..a08fec3dbdd4 100644 --- a/sw/source/core/inc/layact.hxx +++ b/sw/source/core/inc/layact.hxx @@ -111,7 +111,7 @@ class SwLayAction bool _TurboAction( const SwCntntFrm * ); void InternalAction(); - SwPageFrm *CheckFirstVisPage( SwPageFrm *pPage ); + static SwPageFrm *CheckFirstVisPage( SwPageFrm *pPage ); bool RemoveEmptyBrowserPages(); diff --git a/sw/source/core/inc/pamtyp.hxx b/sw/source/core/inc/pamtyp.hxx index 32a47199341c..68f0ddf9be3f 100644 --- a/sw/source/core/inc/pamtyp.hxx +++ b/sw/source/core/inc/pamtyp.hxx @@ -66,7 +66,7 @@ typedef bool (SwPosition:: *CmpOp)( const SwPosition& ) const; typedef const SwTxtAttr* (*GetHint)( const SwpHints&, sal_uInt16&, sal_Int32 ); typedef bool (utl::TextSearch:: *SearchTxt)( const OUString&, sal_Int32*, sal_Int32*, ::com::sun::star::util::SearchResult* ); -typedef void (SwNodes:: *MvSection)( SwNodeIndex * ) const; +typedef void (*MvSection)( SwNodeIndex * ); struct SwMoveFnCollection { diff --git a/sw/source/core/inc/rootfrm.hxx b/sw/source/core/inc/rootfrm.hxx index 63f8faafdb03..cbb5c1f8896e 100644 --- a/sw/source/core/inc/rootfrm.hxx +++ b/sw/source/core/inc/rootfrm.hxx @@ -251,7 +251,7 @@ public: * Makes sure that, starting from the passed Page, all page-bound Frames * are on the right Page (pagenumber). */ - void AssertPageFlys( SwPageFrm * ); + static void AssertPageFlys( SwPageFrm * ); /// Invalidate all Cntnt, Size or PrtArea void InvalidateAllCntnt( sal_uInt8 nInvalidate = INV_SIZE ); diff --git a/sw/source/core/inc/swcache.hxx b/sw/source/core/inc/swcache.hxx index 6657b1ca85f7..20f06eb8244c 100644 --- a/sw/source/core/inc/swcache.hxx +++ b/sw/source/core/inc/swcache.hxx @@ -113,7 +113,7 @@ public: sal_uInt16 GetCurMax() const { return nCurMax; } inline SwCacheObj *First() { return pRealFirst; } inline SwCacheObj *Last() { return pLast; } - inline SwCacheObj *Next( SwCacheObj *pCacheObj); + static inline SwCacheObj *Next( SwCacheObj *pCacheObj); inline SwCacheObj* operator[](sal_uInt16 nIndex) { return m_aCacheObjects[nIndex]; } inline sal_uInt16 size() { return m_aCacheObjects.size(); } }; diff --git a/sw/source/core/inc/txmsrt.hxx b/sw/source/core/inc/txmsrt.hxx index f1e62ad165df..aa25f2e77d7b 100644 --- a/sw/source/core/inc/txmsrt.hxx +++ b/sw/source/core/inc/txmsrt.hxx @@ -138,7 +138,7 @@ struct SwTOXSortTabBase virtual ~SwTOXSortTabBase() {} sal_uInt16 GetType() const { return nType; } - sal_uInt16 GetOptions() const { return nOpt; } + static sal_uInt16 GetOptions() { return nOpt; } virtual void FillText( SwTxtNode& rNd, const SwIndex& rInsPos, sal_uInt16 nAuthField = 0) const; virtual sal_uInt16 GetLevel() const = 0; diff --git a/sw/source/core/inc/txtfrm.hxx b/sw/source/core/inc/txtfrm.hxx index 75884362bbb5..7fe60f1be2a6 100644 --- a/sw/source/core/inc/txtfrm.hxx +++ b/sw/source/core/inc/txtfrm.hxx @@ -151,8 +151,8 @@ class SwTxtFrm: public SwCntntFrm bool CalcFollow( const sal_Int32 nTxtOfst ); // Corrects the position from which we need to format - sal_Int32 FindBrk(const OUString &rTxt, const sal_Int32 nStart, - const sal_Int32 nEnd) const; + static sal_Int32 FindBrk(const OUString &rTxt, const sal_Int32 nStart, + const sal_Int32 nEnd); // inline branch SwTwips _GetFtnFrmHeight() const; @@ -222,7 +222,7 @@ public: void Init(); /// Is called by FormatSpelling() - SwRect _AutoSpell( const SwCntntNode*, const SwViewOption&, sal_Int32 ); + SwRect _AutoSpell( const SwCntntNode*, sal_Int32 ); /// Is called by FormatSpelling() SwRect SmartTagScan( SwCntntNode* , sal_Int32 ); diff --git a/sw/source/core/inc/wrong.hxx b/sw/source/core/inc/wrong.hxx index 03b28a9559b4..10a030982f32 100644 --- a/sw/source/core/inc/wrong.hxx +++ b/sw/source/core/inc/wrong.hxx @@ -77,7 +77,7 @@ private: SwWrongArea() : mnPos(0), mnLen(0), mpSubList(NULL), mColor(0,0,0), mLineType(WRONGAREA_WAVE) {} - Color getSmartColor ( com::sun::star::uno::Reference< com::sun::star::container::XStringKeyMap > xPropertyBag) + static Color getSmartColor ( com::sun::star::uno::Reference< com::sun::star::container::XStringKeyMap > xPropertyBag) { try { @@ -103,7 +103,7 @@ private: return SwViewOption::GetSmarttagColor( ); } - WrongAreaLineType getSmartLineType( com::sun::star::uno::Reference< com::sun::star::container::XStringKeyMap > xPropertyBag ) + static WrongAreaLineType getSmartLineType( com::sun::star::uno::Reference< com::sun::star::container::XStringKeyMap > xPropertyBag ) { try { @@ -137,7 +137,7 @@ private: return WRONGAREA_DASHED; } - Color getWrongAreaColor(WrongListType listType, + static Color getWrongAreaColor(WrongListType listType, com::sun::star::uno::Reference< com::sun::star::container::XStringKeyMap > xPropertyBag ) { if (WRONGLIST_SPELL == listType) @@ -156,7 +156,7 @@ private: return SwViewOption::GetSpellColor(); } - WrongAreaLineType getWrongAreaLineType(WrongListType listType, + static WrongAreaLineType getWrongAreaLineType(WrongListType listType, com::sun::star::uno::Reference< com::sun::star::container::XStringKeyMap > xPropertyBag ) { if (WRONGLIST_SPELL == listType) @@ -185,7 +185,7 @@ class SwWrongList sal_Int32 nBeginInvalid; // Start of the invalid range sal_Int32 nEndInvalid; // End of the invalid range - void ShiftLeft( sal_Int32 &rPos, sal_Int32 nStart, sal_Int32 nEnd ) + static void ShiftLeft( sal_Int32 &rPos, sal_Int32 nStart, sal_Int32 nEnd ) { if( rPos > nStart ) rPos = rPos > nEnd ? rPos - nEnd + nStart : nStart; } void _Invalidate( sal_Int32 nBegin, sal_Int32 nEnd ); diff --git a/sw/source/core/layout/dbg_lay.cxx b/sw/source/core/layout/dbg_lay.cxx index c24d63771381..6421cda7ea56 100644 --- a/sw/source/core/layout/dbg_lay.cxx +++ b/sw/source/core/layout/dbg_lay.cxx @@ -133,7 +133,7 @@ class SwImplProtocol void _Record( const SwFrm* pFrm, sal_uLong nFunction, sal_uLong nAct, void* pParam ); bool NewStream(); void CheckLine( OString& rLine ); - void SectFunc( OStringBuffer& rOut, const SwFrm* pFrm, sal_uLong nAct, void* pParam ); + static void SectFunc( OStringBuffer& rOut, const SwFrm* pFrm, sal_uLong nAct, void* pParam ); public: SwImplProtocol(); ~SwImplProtocol(); diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx index 9cb3dae26eb3..234f2b97838f 100644 --- a/sw/source/core/layout/frmtool.cxx +++ b/sw/source/core/layout/frmtool.cxx @@ -2706,7 +2706,7 @@ SwPageFrm * InsertNewPage( SwPageDesc &rDesc, SwFrm *pUpper, pRet->Paste( pUpper, pSibling ); pRet->PreparePage( bFtn ); if ( pRet->GetNext() ) - static_cast<SwRootFrm*>(pRet->GetUpper())->AssertPageFlys( pRet ); + SwRootFrm::AssertPageFlys( pRet ); return pRet; } diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx index af7fee2e3a3a..88e5fe02f028 100644 --- a/sw/source/core/layout/layact.cxx +++ b/sw/source/core/layout/layact.cxx @@ -1934,7 +1934,7 @@ bool SwLayIdle::_DoIdleJob( const SwCntntFrm *pCnt, IdleJobType eJob ) { case ONLINE_SPELLING : { - SwRect aRepaint( const_cast<SwTxtFrm*>(static_cast<const SwTxtFrm*>(pCnt))->_AutoSpell( pCntntNode, *pSh->GetViewOptions(), nTxtPos ) ); + SwRect aRepaint( const_cast<SwTxtFrm*>(static_cast<const SwTxtFrm*>(pCnt))->_AutoSpell( pCntntNode, nTxtPos ) ); bPageValid = bPageValid && !pTxtNode->IsWrongDirty(); if( !bPageValid ) bAllValid = false; @@ -2022,7 +2022,7 @@ bool SwLayIdle::DoIdleJob( IdleJobType eJob, bool bVisAreaOnly ) return false; break; case AUTOCOMPLETE_WORDS : - if( !pViewOptions->IsAutoCompleteWords() || + if( !SwViewOption::IsAutoCompleteWords() || SwDoc::GetAutoCompleteWords().IsLockWordLstLocked()) return false; break; @@ -2273,7 +2273,7 @@ SwLayIdle::SwLayIdle( SwRootFrm *pRt, SwViewShellImp *pI ) : const SwViewShell* pViewShell = pImp->GetShell(); // See conditions in DoIdleJob() const bool bSpell = rVOpt.IsOnlineSpell(); - const bool bACmplWrd = rVOpt.IsAutoCompleteWords(); + const bool bACmplWrd = SwViewOption::IsAutoCompleteWords(); const bool bWordCount = pViewShell->getIDocumentStatistics()->GetDocStat().bModified; const bool bSmartTags = !pViewShell->GetDoc()->GetDocShell()->IsHelpDocument() && !pViewShell->GetDoc()->isXForms() && diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx index a81602962ce8..85bbbf2eb700 100644 --- a/sw/source/core/layout/pagechg.cxx +++ b/sw/source/core/layout/pagechg.cxx @@ -1117,7 +1117,7 @@ void SwFrm::CheckPageDescs( SwPageFrm *pStart, bool bNotifyFields, SwPageFrm** p } pRoot->SetAssertFlyPages(); - pRoot->AssertPageFlys( pStart ); + SwRootFrm::AssertPageFlys( pStart ); if ( bNotifyFields && (!pImp || !pImp->IsUpdateExpFlds()) ) { @@ -1242,7 +1242,7 @@ SwPageFrm *SwFrm::InsertPage( SwPageFrm *pPrevPage, bool bFtn ) } } else - pRoot->AssertPageFlys( pSibling ); + SwRootFrm::AssertPageFlys( pSibling ); } // For the update of page numbering fields, nDocPos provides diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index be5fb3f9c861..d7c8d214c232 100644 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -4400,7 +4400,7 @@ void SwTabFrm::Paint(SwRect const& rRect, SwPrintData const*const) const aTabRect.Pos() += Frm().Pos(); SwRect aTabOutRect( rRect ); aTabOutRect.Intersection( aTabRect ); - pViewOption->DrawRect( gProp.pSGlobalShell->GetOut(), aTabOutRect, COL_LIGHTGRAY ); + SwViewOption::DrawRect( gProp.pSGlobalShell->GetOut(), aTabOutRect, COL_LIGHTGRAY ); } const_cast<SwTabFrm*>(this)->ResetComplete(); } diff --git a/sw/source/core/layout/trvlfrm.cxx b/sw/source/core/layout/trvlfrm.cxx index d777c3d7f807..bc127de45b4b 100644 --- a/sw/source/core/layout/trvlfrm.cxx +++ b/sw/source/core/layout/trvlfrm.cxx @@ -2584,7 +2584,7 @@ void SwRootFrm::CalcFrmRects(SwShellCrsr &rCrsr) else { SwNodeIndex idx( nodes.GetEndOfContent()); - if( SwCntntNode* last = nodes.GoPrevious( &idx )) + if( SwCntntNode* last = SwNodes::GoPrevious( &idx )) inSelection = *pEndPos == SwPosition( *last, last->Len()); } } diff --git a/sw/source/core/objectpositioning/anchoredobjectposition.cxx b/sw/source/core/objectpositioning/anchoredobjectposition.cxx index 3ac1d9686c80..c7b916abace4 100644 --- a/sw/source/core/objectpositioning/anchoredobjectposition.cxx +++ b/sw/source/core/objectpositioning/anchoredobjectposition.cxx @@ -154,7 +154,7 @@ SwTwips SwAnchoredObjectPosition::ToCharTopOfLine() const */ SwTwips SwAnchoredObjectPosition::_GetTopForObjPos( const SwFrm& _rFrm, const SwRectFn& _fnRect, - const bool _bVert ) const + const bool _bVert ) { SwTwips nTopOfFrmForObjPos = (_rFrm.Frm().*_fnRect->fnGetTop)(); @@ -684,7 +684,7 @@ void SwAnchoredObjectPosition::_ToggleHoriOrientAndAlign( const bool _bToggleLeftRight, sal_Int16& _ioeHoriOrient, sal_Int16& _iopeRelOrient - ) const + ) { if( _bToggleLeftRight ) { @@ -1036,7 +1036,7 @@ bool SwAnchoredObjectPosition::_DrawAsideFly( const SwFlyFrm* _pFly, */ bool SwAnchoredObjectPosition::_Minor( sal_Int16 _eRelOrient1, sal_Int16 _eRelOrient2, - bool _bLeft ) const + bool _bLeft ) { bool bRetVal; diff --git a/sw/source/core/ole/ndole.cxx b/sw/source/core/ole/ndole.cxx index 2952981039d4..6ab016466875 100644 --- a/sw/source/core/ole/ndole.cxx +++ b/sw/source/core/ole/ndole.cxx @@ -69,7 +69,7 @@ private: typedef std::deque<SwOLEObj *> OleObjects_t; OleObjects_t m_OleObjects; sal_Int32 m_nLRU_InitSize; - uno::Sequence< OUString > GetPropertyNames(); + static uno::Sequence< OUString > GetPropertyNames(); virtual void ImplCommit() SAL_OVERRIDE; diff --git a/sw/source/core/table/swtable.cxx b/sw/source/core/table/swtable.cxx index 7b49f5d3318c..685fcfa1be6e 100644 --- a/sw/source/core/table/swtable.cxx +++ b/sw/source/core/table/swtable.cxx @@ -86,7 +86,7 @@ class SwTableBox_Impl long mnRowSpan; bool mbDummyFlag; - void SetNewCol( Color** ppCol, const Color* pNewCol ); + static void SetNewCol( Color** ppCol, const Color* pNewCol ); public: SwTableBox_Impl() : mpUserColor(0), mpNumFmtColor(0), mnRowSpan(1), mbDummyFlag( false ) {} diff --git a/sw/source/core/text/frmform.cxx b/sw/source/core/text/frmform.cxx index aa18669f4e4c..0e2b9e79a4e9 100644 --- a/sw/source/core/text/frmform.cxx +++ b/sw/source/core/text/frmform.cxx @@ -62,7 +62,7 @@ class FormatLevel public: inline FormatLevel() { ++nLevel; } inline ~FormatLevel() { --nLevel; } - inline sal_uInt16 GetLevel() const { return nLevel; } + static inline sal_uInt16 GetLevel() { return nLevel; } static bool LastLevel() { return 10 < nLevel; } }; sal_uInt16 FormatLevel::nLevel = 0; @@ -624,13 +624,13 @@ SwCntntFrm *SwTxtFrm::JoinFrm() { if( !pEndBoss ) pEndBoss = pFoll->FindFtnBossFrm(); - pEndBoss->ChangeFtnRef( pFoll, static_cast<const SwTxtFtn*>(pHt), this ); + SwFtnBossFrm::ChangeFtnRef( pFoll, static_cast<const SwTxtFtn*>(pHt), this ); } else { if( !pFtnBoss ) pFtnBoss = pFoll->FindFtnBossFrm( true ); - pFtnBoss->ChangeFtnRef( pFoll, static_cast<const SwTxtFtn*>(pHt), this ); + SwFtnBossFrm::ChangeFtnRef( pFoll, static_cast<const SwTxtFtn*>(pHt), this ); } SetFtn( true ); } @@ -717,13 +717,13 @@ SwCntntFrm *SwTxtFrm::SplitFrm( const sal_Int32 nTxtPos ) { if( !pEndBoss ) pEndBoss = FindFtnBossFrm(); - pEndBoss->ChangeFtnRef( this, static_cast<const SwTxtFtn*>(pHt), pNew ); + SwFtnBossFrm::ChangeFtnRef( this, static_cast<const SwTxtFtn*>(pHt), pNew ); } else { if( !pFtnBoss ) pFtnBoss = FindFtnBossFrm( true ); - pFtnBoss->ChangeFtnRef( this, static_cast<const SwTxtFtn*>(pHt), pNew ); + SwFtnBossFrm::ChangeFtnRef( this, static_cast<const SwTxtFtn*>(pHt), pNew ); } pNew->SetFtn( true ); } @@ -1739,7 +1739,7 @@ void SwTxtFrm::Format( const SwBorderAttrs * ) SetEmpty( false ); // In order to not get confused by nested Formats FormatLevel aLevel; - if( 12 == aLevel.GetLevel() ) + if( 12 == FormatLevel::GetLevel() ) return; // We could be possibly not allowed to alter the format information diff --git a/sw/source/core/text/frminf.cxx b/sw/source/core/text/frminf.cxx index 61b5560b4501..2c813eafe51b 100644 --- a/sw/source/core/text/frminf.cxx +++ b/sw/source/core/text/frminf.cxx @@ -83,7 +83,7 @@ bool SwTxtFrmInfo::IsFilled( const sal_uInt8 nPercent ) const } // Where does the text start (without whitespace)? (document global) -SwTwips SwTxtFrmInfo::GetLineStart( const SwTxtCursor &rLine ) const +SwTwips SwTxtFrmInfo::GetLineStart( const SwTxtCursor &rLine ) { const sal_Int32 nTxtStart = rLine.GetTxtStart(); if( rLine.GetStart() == nTxtStart ) diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx index 768ad633658c..75ea6b0a916c 100644 --- a/sw/source/core/text/inftxt.cxx +++ b/sw/source/core/text/inftxt.cxx @@ -1005,7 +1005,7 @@ void SwTxtPaintInfo::DrawPostIts( const SwLinePortion&, bool bScript ) const Size aSize; Point aTmp; - const sal_uInt16 nPostItsWidth = m_pOpt->GetPostItsWidth( GetOut() ); + const sal_uInt16 nPostItsWidth = SwViewOption::GetPostItsWidth( GetOut() ); const sal_uInt16 nFontHeight = m_pFnt->GetHeight( m_pVsh, *GetOut() ); const sal_uInt16 nFontAscent = m_pFnt->GetAscent( m_pVsh, *GetOut() ); @@ -1041,7 +1041,7 @@ void SwTxtPaintInfo::DrawPostIts( const SwLinePortion&, bool bScript ) const GetTxtFrm()->SwitchHorizontalToVertical( aTmpRect ); const Rectangle aRect( aTmpRect.SVRect() ); - m_pOpt->PaintPostIts( const_cast<OutputDevice*>(GetOut()), aRect, bScript ); + SwViewOption::PaintPostIts( const_cast<OutputDevice*>(GetOut()), aRect, bScript ); } } diff --git a/sw/source/core/text/itrform2.hxx b/sw/source/core/text/itrform2.hxx index 7a6053fb2655..ad2b7f54cfbf 100644 --- a/sw/source/core/text/itrform2.hxx +++ b/sw/source/core/text/itrform2.hxx @@ -231,7 +231,7 @@ public: * the portions' part. Removing left or right border. * @param rPortion drop portion for merge **/ - void MergeCharacterBorder( SwDropPortion& rPortion ); + static void MergeCharacterBorder( SwDropPortion& rPortion ); /** * Merge border of the line portion with setting the portion's diff --git a/sw/source/core/text/porexp.cxx b/sw/source/core/text/porexp.cxx index 5e9e10a41a12..31d6da800f01 100644 --- a/sw/source/core/text/porexp.cxx +++ b/sw/source/core/text/porexp.cxx @@ -102,7 +102,7 @@ SwLinePortion *SwBlankPortion::Compress() { return this; } * Causes problems with Fly */ sal_uInt16 SwBlankPortion::MayUnderflow( const SwTxtFormatInfo &rInf, - sal_Int32 nIdx, bool bUnderflow ) const + sal_Int32 nIdx, bool bUnderflow ) { if( rInf.StopUnderflow() ) return 0; @@ -220,7 +220,7 @@ void SwPostItsPortion::Paint( const SwTxtPaintInfo &rInf ) const sal_uInt16 SwPostItsPortion::GetViewWidth( const SwTxtSizeInfo &rInf ) const { // Unbelievable: PostIts are always visible - return rInf.OnWin() ? rInf.GetOpt().GetPostItsWidth( rInf.GetOut() ) : 0; + return rInf.OnWin() ? SwViewOption::GetPostItsWidth( rInf.GetOut() ) : 0; } bool SwPostItsPortion::Format( SwTxtFormatInfo &rInf ) diff --git a/sw/source/core/text/porexp.hxx b/sw/source/core/text/porexp.hxx index 4e637ed9a0db..8ecf8c5ea9b7 100644 --- a/sw/source/core/text/porexp.hxx +++ b/sw/source/core/text/porexp.hxx @@ -55,8 +55,8 @@ public: virtual void FormatEOL( SwTxtFormatInfo &rInf ) SAL_OVERRIDE; virtual bool Format( SwTxtFormatInfo &rInf ) SAL_OVERRIDE; virtual void Paint( const SwTxtPaintInfo &rInf ) const SAL_OVERRIDE; - sal_uInt16 MayUnderflow( const SwTxtFormatInfo &rInf, sal_Int32 nIdx, - bool bUnderflow ) const; + static sal_uInt16 MayUnderflow( const SwTxtFormatInfo &rInf, sal_Int32 nIdx, + bool bUnderflow ); // Accessibility: pass information about this portion to the PortionHandler virtual void HandlePortion( SwPortionHandler& rPH ) const SAL_OVERRIDE; diff --git a/sw/source/core/text/portxt.cxx b/sw/source/core/text/portxt.cxx index 3573b0f51483..691a7161fafc 100644 --- a/sw/source/core/text/portxt.cxx +++ b/sw/source/core/text/portxt.cxx @@ -420,8 +420,7 @@ bool SwTxtPortion::_Format( SwTxtFormatInfo &rInf ) aGuess.BreakPos() != rInf.GetLineStart() && ( !bFirstPor || rInf.GetFly() || rInf.GetLast()->IsFlyPortion() || rInf.IsFirstMulti() ) && - ( !rInf.GetLast()->IsBlankPortion() || static_cast<SwBlankPortion*>( - rInf.GetLast())->MayUnderflow( rInf, rInf.GetIdx()-1, true ))) + ( !rInf.GetLast()->IsBlankPortion() || SwBlankPortion::MayUnderflow( rInf, rInf.GetIdx()-1, true ))) { // case C1 (former BreakUnderflow()) BreakUnderflow( rInf ); } diff --git a/sw/source/core/text/redlnitr.hxx b/sw/source/core/text/redlnitr.hxx index 48fe9d8a1101..90e3bc5f5881 100644 --- a/sw/source/core/text/redlnitr.hxx +++ b/sw/source/core/text/redlnitr.hxx @@ -40,7 +40,7 @@ class SwExtend sal_Int32 nEnd; bool _Leave( SwFont& rFnt, sal_Int32 nNew ); bool Inside() const { return ( nPos >= nStart && nPos < nEnd ); } - void ActualizeFont( SwFont &rFnt, sal_uInt16 nAttr ); + static void ActualizeFont( SwFont &rFnt, sal_uInt16 nAttr ); public: SwExtend( const std::vector<sal_uInt16> &rA, sal_Int32 nSt ) : pFnt(0), rArr( rA ), nStart( nSt ), nPos( COMPLETE_STRING ), nEnd( nStart + rA.size() ) {} diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx index 608b579f6f45..aa5e3c77f429 100644 --- a/sw/source/core/text/txtfrm.cxx +++ b/sw/source/core/text/txtfrm.cxx @@ -657,7 +657,7 @@ void SwTxtFrm::HideAndShowObjects() */ sal_Int32 SwTxtFrm::FindBrk( const OUString &rTxt, const sal_Int32 nStart, - const sal_Int32 nEnd ) const + const sal_Int32 nEnd ) { sal_Int32 nFound = nStart; const sal_Int32 nEndLine = std::min( nEnd, rTxt.getLength() - 1 ); diff --git a/sw/source/core/text/txtftn.cxx b/sw/source/core/text/txtftn.cxx index 8e7c23cdf197..9505b649538b 100644 --- a/sw/source/core/text/txtftn.cxx +++ b/sw/source/core/text/txtftn.cxx @@ -647,7 +647,7 @@ void SwTxtFrm::ConnectFtn( SwTxtFtn *pFtn, const SwTwips nDeadLine ) GetNode()->getIDocumentLayoutAccess()->GetLayouter()->CollectEndnote( pNew ); } else if( pSrcFrm != this ) - pBoss->ChangeFtnRef( pSrcFrm, pFtn, this ); + SwFtnBossFrm::ChangeFtnRef( pSrcFrm, pFtn, this ); bInFtnConnect = false; return; } @@ -668,7 +668,7 @@ void SwTxtFrm::ConnectFtn( SwTxtFtn *pFtn, const SwTwips nDeadLine ) if( !pSrcFrm ) pBoss->AppendFtn( this, pFtn ); else if( pSrcFrm != this ) - pBoss->ChangeFtnRef( pSrcFrm, pFtn, this ); + SwFtnBossFrm::ChangeFtnRef( pSrcFrm, pFtn, this ); bInFtnConnect = false; return; } @@ -697,7 +697,7 @@ void SwTxtFrm::ConnectFtn( SwTxtFtn *pFtn, const SwTwips nDeadLine ) // If the Footnote has been registered to a Follow, we need to // rewire it now too if ( pSrcFrm != this ) - pBoss->ChangeFtnRef( pSrcFrm, pFtn, this ); + SwFtnBossFrm::ChangeFtnRef( pSrcFrm, pFtn, this ); // We have some room left, so the Footnote can grow if ( pFtnFrm->GetFollow() && nDiff > 0 ) @@ -739,7 +739,7 @@ void SwTxtFrm::ConnectFtn( SwTxtFtn *pFtn, const SwTwips nDeadLine ) pSrcBoss->MoveFtns( pSrcFrm, this, pFtn ); } else - pBoss->ChangeFtnRef( pSrcFrm, pFtn, this ); + SwFtnBossFrm::ChangeFtnRef( pSrcFrm, pFtn, this ); } } diff --git a/sw/source/core/text/xmldump.cxx b/sw/source/core/text/xmldump.cxx index d32219987adc..aab4a3badde7 100644 --- a/sw/source/core/text/xmldump.cxx +++ b/sw/source/core/text/xmldump.cxx @@ -29,7 +29,7 @@ class XmlPortionDumper:public SwPortionHandler xmlTextWriterPtr writer; sal_Int32 ofs; - const char* getTypeName( sal_uInt16 nType ) + static const char* getTypeName( sal_uInt16 nType ) { switch ( nType ) { diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx index e4726abcb48d..452e43a7ce72 100644 --- a/sw/source/core/txtnode/fntcache.cxx +++ b/sw/source/core/txtnode/fntcache.cxx @@ -2245,7 +2245,7 @@ SwFntAccess::SwFntAccess( const void* &rMagic, pFntObj->GetPropWidth() == static_cast<SwSubFont const *>(pOwn)->GetPropWidth() && ( !pFntObj->pPrinter || pFntObj->pPrinter == pOut ) ) ) - pFntObj = pFntCache->Next( pFntObj ); + pFntObj = SwFntCache::Next( pFntObj ); if( pFntObj && pFntObj->pPrinter.get() != pOut ) { @@ -2256,7 +2256,7 @@ SwFntAccess::SwFntAccess( const void* &rMagic, pTmpObj->GetZoom()==nZoom && pTmpObj->pPrinter==pOut && pTmpObj->GetPropWidth() == static_cast<SwSubFont const *>(pOwn)->GetPropWidth() ) ) - pTmpObj = pFntCache->Next( pTmpObj ); + pTmpObj = SwFntCache::Next( pTmpObj ); if( pTmpObj ) pFntObj = pTmpObj; } diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx index a454edf1328f..2d70627a6bfc 100644 --- a/sw/source/core/txtnode/ndtxt.cxx +++ b/sw/source/core/txtnode/ndtxt.cxx @@ -4076,7 +4076,7 @@ void SwTxtNode::RemoveFromList() { if ( IsInList() ) { - mpList->RemoveListItem( *mpNodeNum ); + SwList::RemoveListItem( *mpNodeNum ); mpList = 0; delete mpNodeNum; mpNodeNum = 0L; diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx index ef0f681114e3..90c8fcdb763e 100644 --- a/sw/source/core/txtnode/txtedt.cxx +++ b/sw/source/core/txtnode/txtedt.cxx @@ -1220,7 +1220,7 @@ bool SwTxtNode::Convert( SwConversionArgs &rArgs ) // Die Aehnlichkeiten zu SwTxtNode::Spell sind beabsichtigt ... // ACHTUNG: Ev. Bugs in beiden Routinen fixen! -SwRect SwTxtFrm::_AutoSpell( const SwCntntNode* pActNode, const SwViewOption& rViewOpt, sal_Int32 nActPos ) +SwRect SwTxtFrm::_AutoSpell( const SwCntntNode* pActNode, sal_Int32 nActPos ) { SwRect aRect; #if OSL_DEBUG_LEVEL > 1 @@ -1258,7 +1258,7 @@ SwRect SwTxtFrm::_AutoSpell( const SwCntntNode* pActNode, const SwViewOption& rV sal_Int32 nInvEnd = 0; const bool bAddAutoCmpl = pNode->IsAutoCompleteWordDirty() && - rViewOpt.IsAutoCompleteWords(); + SwViewOption::IsAutoCompleteWords(); if( pNode->GetWrong() ) { diff --git a/sw/source/core/undo/rolbck.cxx b/sw/source/core/undo/rolbck.cxx index 60e5111d6093..dc726a5cfe67 100644 --- a/sw/source/core/undo/rolbck.cxx +++ b/sw/source/core/undo/rolbck.cxx @@ -432,7 +432,7 @@ SwHistorySetFootnote::SwHistorySetFootnote( SwTxtFtn* pTxtFtn, sal_uLong nNodePo SwNodeIndex aSttIdx( *pTxtFtn->GetStartNode() ); pTxtFtn->SetStartNode( 0, false ); - m_pUndo->SaveSection( pDoc, aSttIdx ); + m_pUndo->SaveSection( aSttIdx ); m_nNodeIndex = pSaveNd->GetIndex(); } diff --git a/sw/source/core/undo/unattr.cxx b/sw/source/core/undo/unattr.cxx index eac70f8dd101..86f44f280dd2 100644 --- a/sw/source/core/undo/unattr.cxx +++ b/sw/source/core/undo/unattr.cxx @@ -67,46 +67,32 @@ SwUndoFmtAttrHelper::SwUndoFmtAttrHelper( SwFmt& rFmt, bool bSvDrwPt ) void SwUndoFmtAttrHelper::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) { - if( pOld ) - { - if ( pOld->Which() == RES_OBJECTDYING ) - { + if( pOld ) { + if ( pOld->Which() == RES_OBJECTDYING ) { CheckRegistration( pOld, pNew ); - } - else if ( pNew ) - { - if( POOLATTR_END >= pOld->Which() ) - { - if ( GetUndo() ) - { + } else if ( pNew ) { + if( POOLATTR_END >= pOld->Which() ) { + if ( GetUndo() ) { m_pUndo->PutAttr( *pOld ); - } - else - { + } else { m_pUndo.reset( new SwUndoFmtAttr( *pOld, - *static_cast<SwFmt*>(GetRegisteredInNonConst()), m_bSaveDrawPt ) ); + *static_cast<SwFmt*>(GetRegisteredInNonConst()), m_bSaveDrawPt ) ); } - } - else if ( RES_ATTRSET_CHG == pOld->Which() ) - { - if ( GetUndo() ) - { + } else if ( RES_ATTRSET_CHG == pOld->Which() ) { + if ( GetUndo() ) { SfxItemIter aIter( - *(static_cast<const SwAttrSetChg*>(pOld))->GetChgSet() ); + *(static_cast<const SwAttrSetChg*>(pOld))->GetChgSet() ); const SfxPoolItem* pItem = aIter.GetCurItem(); - while ( pItem ) - { + while ( pItem ) { m_pUndo->PutAttr( *pItem ); if( aIter.IsAtEnd() ) break; pItem = aIter.NextItem(); } - } - else - { + } else { m_pUndo.reset( new SwUndoFmtAttr( - *static_cast<const SwAttrSetChg*>(pOld)->GetChgSet(), - *static_cast<SwFmt*>(GetRegisteredInNonConst()), m_bSaveDrawPt ) ); + *static_cast<const SwAttrSetChg*>(pOld)->GetChgSet(), + *static_cast<SwFmt*>(GetRegisteredInNonConst()), m_bSaveDrawPt ) ); } } } @@ -118,7 +104,7 @@ SwUndoFmtAttr::SwUndoFmtAttr( const SfxItemSet& rOldSet, bool bSaveDrawPt ) : SwUndo( UNDO_INSFMTATTR ) , m_pFmt( &rChgFmt ) - // #i56253# + // #i56253# , m_pOldSet( new SfxItemSet( rOldSet ) ) , m_nNodeIndex( 0 ) , m_nFmtWhich( rChgFmt.Which() ) @@ -143,32 +129,22 @@ SwUndoFmtAttr::SwUndoFmtAttr( const SfxPoolItem& rItem, SwFmt& rChgFmt, void SwUndoFmtAttr::Init() { // treat change of anchor specially - if ( SfxItemState::SET == m_pOldSet->GetItemState( RES_ANCHOR, false )) - { + if ( SfxItemState::SET == m_pOldSet->GetItemState( RES_ANCHOR, false )) { SaveFlyAnchor( m_bSaveDrawPt ); - } - else if ( RES_FRMFMT == m_nFmtWhich ) - { + } else if ( RES_FRMFMT == m_nFmtWhich ) { SwDoc* pDoc = m_pFmt->GetDoc(); - if ( pDoc->GetTblFrmFmts()->Contains( m_pFmt )) - { + if ( pDoc->GetTblFrmFmts()->Contains( m_pFmt )) { // Table Format: save table position, table formats are volatile! SwTable * pTbl = SwIterator<SwTable,SwFmt>( *m_pFmt ).First(); - if ( pTbl ) - { + if ( pTbl ) { m_nNodeIndex = pTbl->GetTabSortBoxes()[ 0 ]->GetSttNd() - ->FindTableNode()->GetIndex(); + ->FindTableNode()->GetIndex(); } - } - else if ( pDoc->GetSections().Contains( m_pFmt )) - { + } else if ( pDoc->GetSections().Contains( m_pFmt )) { m_nNodeIndex = m_pFmt->GetCntnt().GetCntntIdx()->GetIndex(); - } - else if ( 0 != dynamic_cast< SwTableBoxFmt* >( m_pFmt ) ) - { + } else if ( 0 != dynamic_cast< SwTableBoxFmt* >( m_pFmt ) ) { SwTableBox * pTblBox = SwIterator<SwTableBox,SwFmt>( *m_pFmt ).First(); - if ( pTblBox ) - { + if ( pTblBox ) { m_nNodeIndex = pTblBox->GetSttIdx(); } } @@ -191,39 +167,30 @@ void SwUndoFmtAttr::UndoImpl(::sw::UndoRedoContext & rContext) // restored, all other attributes are also restored. // Thus, keep track of its restoration bool bAnchorAttrRestored( false ); - if ( SfxItemState::SET == m_pOldSet->GetItemState( RES_ANCHOR, false )) - { + if ( SfxItemState::SET == m_pOldSet->GetItemState( RES_ANCHOR, false )) { bAnchorAttrRestored = RestoreFlyAnchor(rContext); - if ( bAnchorAttrRestored ) - { + if ( bAnchorAttrRestored ) { // Anchor attribute successful restored. // Thus, keep anchor position for redo SaveFlyAnchor(); - } - else - { + } else { // Anchor attribute not restored due to invalid anchor position. // Thus, delete anchor attribute. m_pOldSet->ClearItem( RES_ANCHOR ); } } - if ( !bAnchorAttrRestored ) - { + if ( !bAnchorAttrRestored ) { SwUndoFmtAttrHelper aTmp( *m_pFmt, m_bSaveDrawPt ); m_pFmt->SetFmtAttr( *m_pOldSet ); - if ( aTmp.GetUndo() ) - { + if ( aTmp.GetUndo() ) { // transfer ownership of helper object's old set m_pOldSet = std::move(aTmp.GetUndo()->m_pOldSet); - } - else - { + } else { m_pOldSet->ClearItem(); } - if ( RES_FLYFRMFMT == m_nFmtWhich || RES_DRAWFRMFMT == m_nFmtWhich ) - { + if ( RES_FLYFRMFMT == m_nFmtWhich || RES_DRAWFRMFMT == m_nFmtWhich ) { rContext.SetSelections(static_cast<SwFrmFmt*>(m_pFmt), 0); } } @@ -324,57 +291,46 @@ void SwUndoFmtAttr::RepeatImpl(::sw::RepeatContext & rContext) SwDoc & rDoc(rContext.GetDoc()); - switch ( m_nFmtWhich ) - { - case RES_GRFFMTCOLL: - { - SwNoTxtNode *const pNd = - rContext.GetRepeatPaM().GetNode().GetNoTxtNode(); - if( pNd ) - { - rDoc.SetAttr( m_pFmt->GetAttrSet(), *pNd->GetFmtColl() ); - } + switch ( m_nFmtWhich ) { + case RES_GRFFMTCOLL: { + SwNoTxtNode *const pNd = + rContext.GetRepeatPaM().GetNode().GetNoTxtNode(); + if( pNd ) { + rDoc.SetAttr( m_pFmt->GetAttrSet(), *pNd->GetFmtColl() ); } - break; + } + break; - case RES_TXTFMTCOLL: - { - SwTxtNode *const pNd = - rContext.GetRepeatPaM().GetNode().GetTxtNode(); - if( pNd ) - { - rDoc.SetAttr( m_pFmt->GetAttrSet(), *pNd->GetFmtColl() ); - } + case RES_TXTFMTCOLL: { + SwTxtNode *const pNd = + rContext.GetRepeatPaM().GetNode().GetTxtNode(); + if( pNd ) { + rDoc.SetAttr( m_pFmt->GetAttrSet(), *pNd->GetFmtColl() ); } - break; - - case RES_FLYFRMFMT: - { - // Check if the cursor is in a flying frame - // Steps: search in all FlyFrmFormats for the FlyCntnt attribute - // and validate if the cursor is in the respective section - SwFrmFmt *const pFly = - rContext.GetRepeatPaM().GetNode().GetFlyFmt(); - if( pFly ) - { - // Bug 43672: do not set all attributes! - if (SfxItemState::SET == - m_pFmt->GetAttrSet().GetItemState( RES_CNTNT )) - { - SfxItemSet aTmpSet( m_pFmt->GetAttrSet() ); - aTmpSet.ClearItem( RES_CNTNT ); - if( aTmpSet.Count() ) - { - rDoc.SetAttr( aTmpSet, *pFly ); - } - } - else - { - rDoc.SetAttr( m_pFmt->GetAttrSet(), *pFly ); + } + break; + + case RES_FLYFRMFMT: { + // Check if the cursor is in a flying frame + // Steps: search in all FlyFrmFormats for the FlyCntnt attribute + // and validate if the cursor is in the respective section + SwFrmFmt *const pFly = + rContext.GetRepeatPaM().GetNode().GetFlyFmt(); + if( pFly ) { + // Bug 43672: do not set all attributes! + if (SfxItemState::SET == + m_pFmt->GetAttrSet().GetItemState( RES_CNTNT )) { + SfxItemSet aTmpSet( m_pFmt->GetAttrSet() ); + aTmpSet.ClearItem( RES_CNTNT ); + if( aTmpSet.Count() ) { + rDoc.SetAttr( aTmpSet, *pFly ); } + } else { + rDoc.SetAttr( m_pFmt->GetAttrSet(), *pFly ); } - break; } + break; + } } } @@ -382,8 +338,7 @@ SwRewriter SwUndoFmtAttr::GetRewriter() const { SwRewriter aRewriter; - if (m_pFmt) - { + if (m_pFmt) { aRewriter.AddRule(UndoArg1, m_pFmt->GetName()); } @@ -393,8 +348,7 @@ SwRewriter SwUndoFmtAttr::GetRewriter() const void SwUndoFmtAttr::PutAttr( const SfxPoolItem& rItem ) { m_pOldSet->Put( rItem ); - if ( RES_ANCHOR == rItem.Which() ) - { + if ( RES_ANCHOR == rItem.Which() ) { SaveFlyAnchor( m_bSaveDrawPt ); } } @@ -402,12 +356,10 @@ void SwUndoFmtAttr::PutAttr( const SfxPoolItem& rItem ) void SwUndoFmtAttr::SaveFlyAnchor( bool bSvDrwPt ) { // Format is valid, otherwise you would not reach this point here - if( bSvDrwPt ) - { - if ( RES_DRAWFRMFMT == m_pFmt->Which() ) - { + if( bSvDrwPt ) { + if ( RES_DRAWFRMFMT == m_pFmt->Which() ) { Point aPt( static_cast<SwFrmFmt*>(m_pFmt)->FindSdrObject() - ->GetRelativePos() ); + ->GetRelativePos() ); // store old value as attribute, to keep SwUndoFmtAttr small m_pOldSet->Put( SwFmtFrmSize( ATT_VAR_SIZE, aPt.X(), aPt.Y() ) ); } @@ -419,8 +371,7 @@ void SwUndoFmtAttr::SaveFlyAnchor( bool bSvDrwPt ) return; sal_Int32 nCntnt = 0; - switch( rAnchor.GetAnchorId() ) - { + switch( rAnchor.GetAnchorId() ) { case FLY_AS_CHAR: case FLY_AT_CHAR: nCntnt = rAnchor.GetCntntAnchor()->nContent.GetIndex(); @@ -449,15 +400,13 @@ bool SwUndoFmtAttr::RestoreFlyAnchor(::sw::UndoRedoContext & rContext) static_cast<const SwFmtAnchor&>( m_pOldSet->Get( RES_ANCHOR, false ) ); SwFmtAnchor aNewAnchor( rAnchor.GetAnchorId() ); - if (FLY_AT_PAGE != rAnchor.GetAnchorId()) - { + if (FLY_AT_PAGE != rAnchor.GetAnchorId()) { SwNode* pNd = pDoc->GetNodes()[ m_nNodeIndex ]; if ( (FLY_AT_FLY == rAnchor.GetAnchorId()) - ? ( !pNd->IsStartNode() || (SwFlyStartNode != - static_cast<SwStartNode*>(pNd)->GetStartNodeType()) ) - : !pNd->IsTxtNode() ) - { + ? ( !pNd->IsStartNode() || (SwFlyStartNode != + static_cast<SwStartNode*>(pNd)->GetStartNodeType()) ) + : !pNd->IsTxtNode() ) { // #i35443# - invalid position. // Thus, anchor attribute not restored return false; @@ -465,38 +414,31 @@ bool SwUndoFmtAttr::RestoreFlyAnchor(::sw::UndoRedoContext & rContext) SwPosition aPos( *pNd ); if ((FLY_AS_CHAR == rAnchor.GetAnchorId()) || - (FLY_AT_CHAR == rAnchor.GetAnchorId())) - { + (FLY_AT_CHAR == rAnchor.GetAnchorId())) { aPos.nContent.Assign( static_cast<SwTxtNode*>(pNd), rAnchor.GetPageNum() ); - if ( aPos.nContent.GetIndex() > pNd->GetTxtNode()->GetTxt().getLength()) - { + if ( aPos.nContent.GetIndex() > pNd->GetTxtNode()->GetTxt().getLength()) { // #i35443# - invalid position. // Thus, anchor attribute not restored return false; } } aNewAnchor.SetAnchor( &aPos ); - } - else + } else aNewAnchor.SetPageNum( rAnchor.GetPageNum() ); Point aDrawSavePt, aDrawOldPt; - if( pDoc->getIDocumentLayoutAccess().GetCurrentViewShell() ) - { - if( RES_DRAWFRMFMT == pFrmFmt->Which() ) - { + if( pDoc->getIDocumentLayoutAccess().GetCurrentViewShell() ) { + if( RES_DRAWFRMFMT == pFrmFmt->Which() ) { // get the old cached value const SwFmtFrmSize& rOldSize = static_cast<const SwFmtFrmSize&>( - m_pOldSet->Get( RES_FRM_SIZE ) ); + m_pOldSet->Get( RES_FRM_SIZE ) ); aDrawSavePt.X() = rOldSize.GetWidth(); aDrawSavePt.Y() = rOldSize.GetHeight(); m_pOldSet->ClearItem( RES_FRM_SIZE ); // write the current value into cache aDrawOldPt = pFrmFmt->FindSdrObject()->GetRelativePos(); - } - else - { + } else { pFrmFmt->DelFrms(); // delete Frms } } @@ -504,8 +446,7 @@ bool SwUndoFmtAttr::RestoreFlyAnchor(::sw::UndoRedoContext & rContext) const SwFmtAnchor &rOldAnch = pFrmFmt->GetAnchor(); // #i54336# // Consider case, that as-character anchored object has moved its anchor position. - if (FLY_AS_CHAR == rOldAnch.GetAnchorId()) - { + if (FLY_AS_CHAR == rOldAnch.GetAnchorId()) { // With InCntnts it's tricky: the text attribute needs to be deleted. // Unfortunately, this not only destroys the Frms but also the format. // To prevent that, first detach the connection between attribute and @@ -530,20 +471,16 @@ bool SwUndoFmtAttr::RestoreFlyAnchor(::sw::UndoRedoContext & rContext) m_pOldSet->Put( aNewAnchor ); SwUndoFmtAttrHelper aTmp( *m_pFmt, m_bSaveDrawPt ); m_pFmt->SetFmtAttr( *m_pOldSet ); - if ( aTmp.GetUndo() ) - { + if ( aTmp.GetUndo() ) { m_nNodeIndex = aTmp.GetUndo()->m_nNodeIndex; // transfer ownership of helper object's old set m_pOldSet = std::move(aTmp.GetUndo()->m_pOldSet); - } - else - { + } else { m_pOldSet->ClearItem(); } } - if ( RES_DRAWFRMFMT == pFrmFmt->Which() ) - { + if ( RES_DRAWFRMFMT == pFrmFmt->Which() ) { SwDrawContact *pCont = static_cast<SwDrawContact*>(pFrmFmt->FindContactObj()); // The Draw model also prepared an Undo object for its right positioning @@ -551,10 +488,9 @@ bool SwUndoFmtAttr::RestoreFlyAnchor(::sw::UndoRedoContext & rContext) // change of the Contact object by setting the anchor. SdrObject* pObj = pCont->GetMaster(); - if( pCont->GetAnchorFrm() && !pObj->IsInserted() ) - { + if( pCont->GetAnchorFrm() && !pObj->IsInserted() ) { OSL_ENSURE( pDoc->getIDocumentDrawModelAccess().GetDrawModel(), - "RestoreFlyAnchor without DrawModel" ); + "RestoreFlyAnchor without DrawModel" ); pDoc->getIDocumentDrawModelAccess().GetDrawModel()->GetPage( 0 )->InsertObject( pObj ); } pObj->SetRelativePos( aDrawSavePt ); @@ -564,8 +500,7 @@ bool SwUndoFmtAttr::RestoreFlyAnchor(::sw::UndoRedoContext & rContext) SwFmtFrmSize( ATT_VAR_SIZE, aDrawOldPt.X(), aDrawOldPt.Y() ) ); } - if (FLY_AS_CHAR == aNewAnchor.GetAnchorId()) - { + if (FLY_AS_CHAR == aNewAnchor.GetAnchorId()) { const SwPosition* pPos = aNewAnchor.GetCntntAnchor(); SwTxtNode* pTxtNd = pPos->nNode.GetNode().GetTxtNode(); OSL_ENSURE( pTxtNd, "no Text Node at position." ); @@ -589,8 +524,7 @@ SwUndoFmtResetAttr::SwUndoFmtResetAttr( SwFmt& rChangedFormat, , m_nWhichId( nWhichId ) { const SfxPoolItem* pItem = 0; - if (rChangedFormat.GetItemState(nWhichId, false, &pItem ) == SfxItemState::SET && pItem) - { + if (rChangedFormat.GetItemState(nWhichId, false, &pItem ) == SfxItemState::SET && pItem) { m_pOldItem.reset( pItem->Clone() ); } } @@ -601,16 +535,14 @@ SwUndoFmtResetAttr::~SwUndoFmtResetAttr() void SwUndoFmtResetAttr::UndoImpl(::sw::UndoRedoContext &) { - if ( m_pOldItem.get() ) - { + if ( m_pOldItem.get() ) { m_pChangedFormat->SetFmtAttr( *m_pOldItem ); } } void SwUndoFmtResetAttr::RedoImpl(::sw::UndoRedoContext &) { - if ( m_pOldItem.get() ) - { + if ( m_pOldItem.get() ) { m_pChangedFormat->ResetFmtAttr( m_nWhichId ); } } @@ -643,11 +575,9 @@ void SwUndoResetAttr::UndoImpl(::sw::UndoRedoContext & rContext) m_pHistory->SetTmpEnd( m_pHistory->Count() ); if ((RES_CONDTXTFMTCOLL == m_nFormatId) && - (nSttNode == nEndNode) && (nSttCntnt == nEndCntnt)) - { + (nSttNode == nEndNode) && (nSttCntnt == nEndCntnt)) { SwTxtNode* pTNd = rDoc.GetNodes()[ nSttNode ]->GetTxtNode(); - if( pTNd ) - { + if( pTNd ) { SwIndex aIdx( pTNd, nSttCntnt ); pTNd->DontExpandFmt( aIdx, false ); } @@ -661,8 +591,7 @@ void SwUndoResetAttr::RedoImpl(::sw::UndoRedoContext & rContext) SwDoc & rDoc = rContext.GetDoc(); SwPaM & rPam = AddUndoRedoPaM(rContext); - switch ( m_nFormatId ) - { + switch ( m_nFormatId ) { case RES_CHRFMT: rDoc.RstTxtAttrs(rPam); break; @@ -675,54 +604,45 @@ void SwUndoResetAttr::RedoImpl(::sw::UndoRedoContext & rContext) break; case RES_TXTATR_TOXMARK: // special treatment for TOXMarks - { - SwTOXMarks aArr; - SwNodeIndex aIdx( rDoc.GetNodes(), nSttNode ); - SwPosition aPos( aIdx, SwIndex( aIdx.GetNode().GetCntntNode(), - nSttCntnt )); - - sal_uInt16 nCnt = rDoc.GetCurTOXMark( aPos, aArr ); - if( nCnt ) - { - if( 1 < nCnt ) - { - // search for the right one - SwHistoryHint* pHHint = (GetHistory())[ 0 ]; - if( pHHint && HSTRY_SETTOXMARKHNT == pHHint->Which() ) - { - while( nCnt ) - { - if ( static_cast<SwHistorySetTOXMark*>(pHHint) - ->IsEqual( *aArr[ --nCnt ] ) ) - { - ++nCnt; - break; - } + { + SwTOXMarks aArr; + SwNodeIndex aIdx( rDoc.GetNodes(), nSttNode ); + SwPosition aPos( aIdx, SwIndex( aIdx.GetNode().GetCntntNode(), + nSttCntnt )); + + sal_uInt16 nCnt = SwDoc::GetCurTOXMark( aPos, aArr ); + if( nCnt ) { + if( 1 < nCnt ) { + // search for the right one + SwHistoryHint* pHHint = (GetHistory())[ 0 ]; + if( pHHint && HSTRY_SETTOXMARKHNT == pHHint->Which() ) { + while( nCnt ) { + if ( static_cast<SwHistorySetTOXMark*>(pHHint) + ->IsEqual( *aArr[ --nCnt ] ) ) { + ++nCnt; + break; } } - else - nCnt = 0; - } - // found one, thus delete it - if( nCnt-- ) - { - rDoc.DeleteTOXMark( aArr[ nCnt ] ); - } + } else + nCnt = 0; + } + // found one, thus delete it + if( nCnt-- ) { + rDoc.DeleteTOXMark( aArr[ nCnt ] ); } } - break; + } + break; } } void SwUndoResetAttr::RepeatImpl(::sw::RepeatContext & rContext) { - if (m_nFormatId < RES_FMT_BEGIN) - { + if (m_nFormatId < RES_FMT_BEGIN) { return; } - switch ( m_nFormatId ) - { + switch ( m_nFormatId ) { case RES_CHRFMT: rContext.GetDoc().RstTxtAttrs(rContext.GetRepeatPaM()); break; @@ -769,23 +689,20 @@ SwUndoAttr::~SwUndoAttr() void SwUndoAttr::SaveRedlineData( const SwPaM& rPam, bool bIsCntnt ) { SwDoc* pDoc = rPam.GetDoc(); - if ( pDoc->getIDocumentRedlineAccess().IsRedlineOn() ) - { + if ( pDoc->getIDocumentRedlineAccess().IsRedlineOn() ) { m_pRedlineData.reset( new SwRedlineData( bIsCntnt - ? nsRedlineType_t::REDLINE_INSERT - : nsRedlineType_t::REDLINE_FORMAT, - pDoc->getIDocumentRedlineAccess().GetRedlineAuthor() ) ); + ? nsRedlineType_t::REDLINE_INSERT + : nsRedlineType_t::REDLINE_FORMAT, + pDoc->getIDocumentRedlineAccess().GetRedlineAuthor() ) ); } m_pRedlineSaveData.reset( new SwRedlineSaveDatas ); - if ( !FillSaveDataForFmt( rPam, *m_pRedlineSaveData )) - { + if ( !FillSaveDataForFmt( rPam, *m_pRedlineSaveData )) { m_pRedlineSaveData.reset(0); } SetRedlineMode( pDoc->getIDocumentRedlineAccess().GetRedlineMode() ); - if ( bIsCntnt ) - { + if ( bIsCntnt ) { m_nNodeIndex = rPam.GetPoint()->nNode.GetIndex(); } } @@ -796,33 +713,28 @@ void SwUndoAttr::UndoImpl(::sw::UndoRedoContext & rContext) RemoveIdx( *pDoc ); - if( IDocumentRedlineAccess::IsRedlineOn( GetRedlineMode() ) ) - { + if( IDocumentRedlineAccess::IsRedlineOn( GetRedlineMode() ) ) { SwPaM aPam(pDoc->GetNodes().GetEndOfContent()); - if ( ULONG_MAX != m_nNodeIndex ) - { + if ( ULONG_MAX != m_nNodeIndex ) { aPam.DeleteMark(); aPam.GetPoint()->nNode = m_nNodeIndex; aPam.GetPoint()->nContent.Assign( aPam.GetCntntNode(), nSttCntnt ); aPam.SetMark(); ++aPam.GetPoint()->nContent; pDoc->getIDocumentRedlineAccess().DeleteRedline(aPam, false, USHRT_MAX); - } - else - { + } else { // remove all format redlines, will be recreated if needed SetPaM(aPam); pDoc->getIDocumentRedlineAccess().DeleteRedline(aPam, false, nsRedlineType_t::REDLINE_FORMAT); - if ( m_pRedlineSaveData.get() ) - { + if ( m_pRedlineSaveData.get() ) { SetSaveData( *pDoc, *m_pRedlineSaveData ); } } } const bool bToLast = (1 == m_AttrSet.Count()) - && (RES_TXTATR_FIELD <= *m_AttrSet.GetRanges()) - && (*m_AttrSet.GetRanges() <= RES_TXTATR_ANNOTATION); + && (RES_TXTATR_FIELD <= *m_AttrSet.GetRanges()) + && (*m_AttrSet.GetRanges() <= RES_TXTATR_ANNOTATION); // restore old values m_pHistory->TmpRollback( pDoc, 0, !bToLast ); @@ -835,17 +747,14 @@ void SwUndoAttr::UndoImpl(::sw::UndoRedoContext & rContext) void SwUndoAttr::RepeatImpl(::sw::RepeatContext & rContext) { // RefMarks are not repeat capable - if ( SfxItemState::SET != m_AttrSet.GetItemState( RES_TXTATR_REFMARK, false ) ) - { + if ( SfxItemState::SET != m_AttrSet.GetItemState( RES_TXTATR_REFMARK, false ) ) { rContext.GetDoc().getIDocumentContentOperations().InsertItemSet( rContext.GetRepeatPaM(), - m_AttrSet, m_nInsertFlags ); - } - else if ( 1 < m_AttrSet.Count() ) - { + m_AttrSet, m_nInsertFlags ); + } else if ( 1 < m_AttrSet.Count() ) { SfxItemSet aTmpSet( m_AttrSet ); aTmpSet.ClearItem( RES_TXTATR_REFMARK ); rContext.GetDoc().getIDocumentContentOperations().InsertItemSet( rContext.GetRepeatPaM(), - aTmpSet, m_nInsertFlags ); + aTmpSet, m_nInsertFlags ); } } @@ -855,32 +764,25 @@ void SwUndoAttr::RedoImpl(::sw::UndoRedoContext & rContext) SwPaM & rPam = AddUndoRedoPaM(rContext); if ( m_pRedlineData.get() && - IDocumentRedlineAccess::IsRedlineOn( GetRedlineMode() ) ) - { + IDocumentRedlineAccess::IsRedlineOn( GetRedlineMode() ) ) { RedlineMode_t eOld = rDoc.getIDocumentRedlineAccess().GetRedlineMode(); rDoc.getIDocumentRedlineAccess().SetRedlineMode_intern(static_cast<RedlineMode_t>( eOld & ~nsRedlineMode_t::REDLINE_IGNORE)); rDoc.getIDocumentContentOperations().InsertItemSet( rPam, m_AttrSet, m_nInsertFlags ); - if ( ULONG_MAX != m_nNodeIndex ) - { + if ( ULONG_MAX != m_nNodeIndex ) { rPam.SetMark(); - if ( rPam.Move( fnMoveBackward ) ) - { + if ( rPam.Move( fnMoveBackward ) ) { rDoc.getIDocumentRedlineAccess().AppendRedline( new SwRangeRedline( *m_pRedlineData, rPam ), true); } rPam.DeleteMark(); - } - else - { + } else { rDoc.getIDocumentRedlineAccess().AppendRedline( new SwRangeRedline( *m_pRedlineData, rPam ), true); } rDoc.getIDocumentRedlineAccess().SetRedlineMode_intern( eOld ); - } - else - { + } else { rDoc.getIDocumentContentOperations().InsertItemSet( rPam, m_AttrSet, m_nInsertFlags ); } } @@ -891,58 +793,47 @@ void SwUndoAttr::RemoveIdx( SwDoc& rDoc ) return ; SwNodes& rNds = rDoc.GetNodes(); - for ( sal_uInt16 n = 0; n < m_pHistory->Count(); ++n ) - { + for ( sal_uInt16 n = 0; n < m_pHistory->Count(); ++n ) { sal_Int32 nCntnt = 0; sal_uLong nNode = 0; SwHistoryHint* pHstHnt = (*m_pHistory)[ n ]; - switch ( pHstHnt->Which() ) - { - case HSTRY_RESETTXTHNT: - { - SwHistoryResetTxt * pHistoryHint - = static_cast<SwHistoryResetTxt*>(pHstHnt); - if ( RES_TXTATR_FTN == pHistoryHint->GetWhich() ) - { - nNode = pHistoryHint->GetNode(); - nCntnt = pHistoryHint->GetCntnt(); - } - } - break; + switch ( pHstHnt->Which() ) { + case HSTRY_RESETTXTHNT: { + SwHistoryResetTxt * pHistoryHint + = static_cast<SwHistoryResetTxt*>(pHstHnt); + if ( RES_TXTATR_FTN == pHistoryHint->GetWhich() ) { + nNode = pHistoryHint->GetNode(); + nCntnt = pHistoryHint->GetCntnt(); + } + } + break; - case HSTRY_RESETATTRSET: - { - SwHistoryResetAttrSet * pHistoryHint - = static_cast<SwHistoryResetAttrSet*>(pHstHnt); - nCntnt = pHistoryHint->GetCntnt(); - if ( COMPLETE_STRING != nCntnt ) - { - const std::vector<sal_uInt16>& rArr = pHistoryHint->GetArr(); - for ( size_t i = rArr.size(); i; ) - { - if ( RES_TXTATR_FTN == rArr[ --i ] ) - { - nNode = pHistoryHint->GetNode(); - break; - } - } + case HSTRY_RESETATTRSET: { + SwHistoryResetAttrSet * pHistoryHint + = static_cast<SwHistoryResetAttrSet*>(pHstHnt); + nCntnt = pHistoryHint->GetCntnt(); + if ( COMPLETE_STRING != nCntnt ) { + const std::vector<sal_uInt16>& rArr = pHistoryHint->GetArr(); + for ( size_t i = rArr.size(); i; ) { + if ( RES_TXTATR_FTN == rArr[ --i ] ) { + nNode = pHistoryHint->GetNode(); + break; } } - break; + } + } + break; - default: - break; + default: + break; } - if( nNode ) - { + if( nNode ) { SwTxtNode* pTxtNd = rNds[ nNode ]->GetTxtNode(); - if( pTxtNd ) - { + if( pTxtNd ) { SwTxtAttr *const pTxtHt = pTxtNd->GetTxtAttrForCharAt(nCntnt, RES_TXTATR_FTN); - if( pTxtHt ) - { + if( pTxtHt ) { // ok, so get values SwTxtFtn* pFtn = static_cast<SwTxtFtn*>(pTxtHt); RemoveIdxFromSection( rDoc, pFtn->GetStartNode()->GetIndex() ); @@ -957,17 +848,13 @@ SwUndoDefaultAttr::SwUndoDefaultAttr( const SfxItemSet& rSet ) : SwUndo( UNDO_SETDEFTATTR ) { const SfxPoolItem* pItem; - if( SfxItemState::SET == rSet.GetItemState( RES_PARATR_TABSTOP, false, &pItem ) ) - { + if( SfxItemState::SET == rSet.GetItemState( RES_PARATR_TABSTOP, false, &pItem ) ) { // store separately, because it may change! m_pTabStop.reset( static_cast<SvxTabStopItem*>(pItem->Clone()) ); - if ( 1 != rSet.Count() ) // are there more attributes? - { + if ( 1 != rSet.Count() ) { // are there more attributes? m_pOldSet.reset( new SfxItemSet( rSet ) ); } - } - else - { + } else { m_pOldSet.reset( new SfxItemSet( rSet ) ); } } @@ -979,22 +866,19 @@ SwUndoDefaultAttr::~SwUndoDefaultAttr() void SwUndoDefaultAttr::UndoImpl(::sw::UndoRedoContext & rContext) { SwDoc & rDoc = rContext.GetDoc(); - if ( m_pOldSet.get() ) - { + if ( m_pOldSet.get() ) { SwUndoFmtAttrHelper aTmp( - *const_cast<SwTxtFmtColl*>(rDoc.GetDfltTxtFmtColl()) ); + *const_cast<SwTxtFmtColl*>(rDoc.GetDfltTxtFmtColl()) ); rDoc.SetDefault( *m_pOldSet ); m_pOldSet.reset( 0 ); - if ( aTmp.GetUndo() ) - { + if ( aTmp.GetUndo() ) { // transfer ownership of helper object's old set m_pOldSet = std::move(aTmp.GetUndo()->m_pOldSet); } } - if ( m_pTabStop.get() ) - { + if ( m_pTabStop.get() ) { SvxTabStopItem* pOld = static_cast<SvxTabStopItem*>( - rDoc.GetDefault( RES_PARATR_TABSTOP ).Clone() ); + rDoc.GetDefault( RES_PARATR_TABSTOP ).Clone() ); rDoc.SetDefault( *m_pTabStop ); m_pTabStop.reset( pOld ); } @@ -1006,7 +890,7 @@ void SwUndoDefaultAttr::RedoImpl(::sw::UndoRedoContext & rContext) } SwUndoMoveLeftMargin::SwUndoMoveLeftMargin( - const SwPaM& rPam, bool bFlag, bool bMod ) + const SwPaM& rPam, bool bFlag, bool bMod ) : SwUndo( bFlag ? UNDO_INC_LEFTMARGIN : UNDO_DEC_LEFTMARGIN ) , SwUndRng( rPam ) , m_pHistory( new SwHistory ) @@ -1035,19 +919,19 @@ void SwUndoMoveLeftMargin::RedoImpl(::sw::UndoRedoContext & rContext) SwPaM & rPam = AddUndoRedoPaM(rContext); rDoc.MoveLeftMargin( rPam, - GetId() == UNDO_INC_LEFTMARGIN, m_bModulus ); + GetId() == UNDO_INC_LEFTMARGIN, m_bModulus ); } void SwUndoMoveLeftMargin::RepeatImpl(::sw::RepeatContext & rContext) { SwDoc & rDoc = rContext.GetDoc(); rDoc.MoveLeftMargin(rContext.GetRepeatPaM(), GetId() == UNDO_INC_LEFTMARGIN, - m_bModulus ); + m_bModulus ); } SwUndoChangeFootNote::SwUndoChangeFootNote( - const SwPaM& rRange, const OUString& rTxt, - sal_uInt16 nNum, bool bIsEndNote ) + const SwPaM& rRange, const OUString& rTxt, + sal_uInt16 nNum, bool bIsEndNote ) : SwUndo( UNDO_CHGFTN ), SwUndRng( rRange ) , m_pHistory( new SwHistory() ) , m_Text( rTxt ) diff --git a/sw/source/core/undo/undobj.cxx b/sw/source/core/undo/undobj.cxx index 92fd62153f9b..36d70c64f1d9 100644 --- a/sw/source/core/undo/undobj.cxx +++ b/sw/source/core/undo/undobj.cxx @@ -114,7 +114,7 @@ void SwUndo::RemoveIdxFromSection( SwDoc& rDoc, sal_uLong nSttIdx, SwNodeIndex aEndIdx( rDoc.GetNodes(), pEndIdx ? *pEndIdx : aIdx.GetNode().EndOfSectionIndex() ); SwPosition aPos( rDoc.GetNodes().GetEndOfPostIts() ); - rDoc.CorrAbs( aIdx, aEndIdx, aPos, true ); + SwDoc::CorrAbs( aIdx, aEndIdx, aPos, true ); } void SwUndo::RemoveIdxFromRange( SwPaM& rPam, bool bMoveNext ) @@ -138,10 +138,10 @@ void SwUndo::RemoveIdxFromRange( SwPaM& rPam, bool bMoveNext ) } } - rPam.GetDoc()->CorrAbs( aStt, aEnd, *rPam.GetPoint(), true ); + SwDoc::CorrAbs( aStt, aEnd, *rPam.GetPoint(), true ); } else - rPam.GetDoc()->CorrAbs( rPam, *pEnd, true ); + SwDoc::CorrAbs( rPam, *pEnd, true ); } void SwUndo::RemoveIdxRel( sal_uLong nIdx, const SwPosition& rPos ) @@ -801,14 +801,13 @@ SwUndoSaveSection::~SwUndoSaveSection() delete pRedlSaveData; } -void SwUndoSaveSection::SaveSection( SwDoc* pDoc, const SwNodeIndex& rSttIdx ) +void SwUndoSaveSection::SaveSection( const SwNodeIndex& rSttIdx ) { SwNodeRange aRg( rSttIdx.GetNode(), *rSttIdx.GetNode().EndOfSectionNode() ); - SaveSection( pDoc, aRg ); + SaveSection( aRg ); } void SwUndoSaveSection::SaveSection( - SwDoc* pDoc, const SwNodeRange& rRange ) { SwPaM aPam( rRange.aStart, rRange.aEnd ); @@ -820,7 +819,7 @@ void SwUndoSaveSection::SaveSection( SwNodeIndex aSttIdx( aPam.Start()->nNode.GetNode() ); SwNodeIndex aEndIdx( aPam.End()->nNode.GetNode() ); SwNodeIndex aMvStt( aEndIdx, 1 ); - pDoc->CorrAbs( aSttIdx, aEndIdx, SwPosition( aMvStt ), true ); + SwDoc::CorrAbs( aSttIdx, aEndIdx, SwPosition( aMvStt ), true ); } pRedlSaveData = new SwRedlineSaveDatas; @@ -854,7 +853,7 @@ void SwUndoSaveSection::RestoreSection( SwDoc* pDoc, SwNodeIndex* pIdx, SwNodeIndex aSttIdx( pDoc->GetNodes(), nStartPos ); // move the content from UndoNodes array into Fly - SwStartNode* pSttNd = pDoc->GetNodes().MakeEmptySection( aSttIdx, + SwStartNode* pSttNd = SwNodes::MakeEmptySection( aSttIdx, (SwStartNodeType)nSectType ); RestoreSection( pDoc, SwNodeIndex( *pSttNd->EndOfSectionNode() )); @@ -920,7 +919,7 @@ SwRedlineSaveData::SwRedlineSaveData( if ( rRedl.GetContentIdx() ) { // than move section into UndoArray and memorize it - SaveSection( rRedl.GetDoc(), *rRedl.GetContentIdx() ); + SaveSection( *rRedl.GetContentIdx() ); rRedl.SetContentIdx( 0 ); } break; @@ -1132,7 +1131,7 @@ bool IsDestroyFrameAnchoredAtChar(SwPosition const & rAnchorPos, else { SwNodeIndex idx( nodes.GetEndOfContent()); - if( SwCntntNode* last = nodes.GoPrevious( &idx )) + if( SwCntntNode* last = SwNodes::GoPrevious( &idx )) inSelection = rEnd == SwPosition( *last, last->Len()); } } diff --git a/sw/source/core/undo/undobj1.cxx b/sw/source/core/undo/undobj1.cxx index 9977593e02a7..8f22cc711af2 100644 --- a/sw/source/core/undo/undobj1.cxx +++ b/sw/source/core/undo/undobj1.cxx @@ -167,7 +167,7 @@ void SwUndoFlyBase::DelFly( SwDoc* pDoc ) const SwFmtCntnt& rCntnt = pFrmFmt->GetCntnt(); OSL_ENSURE( rCntnt.GetCntntIdx(), "Fly ohne Inhalt" ); - SaveSection( pDoc, *rCntnt.GetCntntIdx() ); + SaveSection( *rCntnt.GetCntntIdx() ); const_cast<SwFmtCntnt&>(rCntnt).SetNewCntntIdx( (const SwNodeIndex*)0 ); } // OD 02.07.2003 #108784# - remove 'master' drawing object from drawing page @@ -276,7 +276,7 @@ void SwUndoInsLayFmt::UndoImpl(::sw::UndoRedoContext & rContext) aIdx.GetNode().EndOfSectionIndex() ); SwIndex aIndex( pNode, mnCrsrSaveIndexPos ); SwPosition aPos( *pNode, aIndex ); - rDoc.CorrAbs( aIdx, aEndIdx, aPos, true ); + SwDoc::CorrAbs( aIdx, aEndIdx, aPos, true ); bRemoveIdx = false; } } diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx index fe957e5ba0fc..160b169107b8 100644 --- a/sw/source/core/undo/untbl.cxx +++ b/sw/source/core/undo/untbl.cxx @@ -642,7 +642,7 @@ void SwUndoTblToTxt::RedoImpl(::sw::UndoRedoContext & rContext) ++aSaveIdx; SwCntntNode* pCNd = aSaveIdx.GetNode().GetCntntNode(); if( !pCNd && 0 == ( pCNd = rDoc.GetNodes().GoNext( &aSaveIdx ) ) && - 0 == ( pCNd = rDoc.GetNodes().GoPrevious( &aSaveIdx )) ) + 0 == ( pCNd = SwNodes::GoPrevious( &aSaveIdx )) ) { OSL_FAIL( "Where is the TextNode now?" ); } @@ -1663,7 +1663,7 @@ void SwUndoTblNdsChg::SaveSection( SwStartNode* pSttNd ) SwTableNode* pTblNd = pSttNd->FindTableNode(); SwUndoSaveSection* pSave = new SwUndoSaveSection; - pSave->SaveSection( pSttNd->GetDoc(), SwNodeIndex( *pSttNd )); + pSave->SaveSection( SwNodeIndex( *pSttNd )); pDelSects->push_back( pSave ); nSttNode = pTblNd->GetIndex(); @@ -2050,7 +2050,7 @@ CHECKTABLE(pTblNd->GetTable()) // delete indices from section { SwNodeIndex aTmpIdx( *pBox->GetSttNd() ); - rDoc.CorrAbs( SwNodeIndex( aTmpIdx, 1 ), + SwDoc::CorrAbs( SwNodeIndex( aTmpIdx, 1 ), SwNodeIndex( *aTmpIdx.GetNode().EndOfSectionNode() ), SwPosition( aTmpIdx, SwIndex( 0, 0 )), true ); } @@ -2923,7 +2923,7 @@ void SwUndoSplitTbl::UndoImpl(::sw::UndoRedoContext & rContext) { SwSelBoxes aSelBoxes; SwTableBox* pBox = rTbl.GetTblBox( nTblNode + nOffset + 1 ); - rTbl.SelLineFromBox( pBox, aSelBoxes, true ); + SwTable::SelLineFromBox( pBox, aSelBoxes, true ); _FndBox aTmpBox( 0, 0 ); aTmpBox.SetTableLines( aSelBoxes, rTbl ); aTmpBox.DelFrms( rTbl ); diff --git a/sw/source/core/unocore/unocrsr.cxx b/sw/source/core/unocore/unocrsr.cxx index 3d755db9a874..36764284c518 100644 --- a/sw/source/core/unocore/unocrsr.cxx +++ b/sw/source/core/unocore/unocrsr.cxx @@ -157,7 +157,7 @@ bool SwUnoCrsr::IsSelOvr( int eFlags ) rPtIdx.Assign( *pInvalidNode, -1 ); if( !rPtIdx.GetNode().IsCntntNode() && - ( !pDoc->GetNodes().GoPrevSection( &rPtIdx ) || + ( !SwNodes::GoPrevSection( &rPtIdx ) || rPtIdx < *pOldSttNd ) ) break; } diff --git a/sw/source/core/unocore/unocrsrhelper.cxx b/sw/source/core/unocore/unocrsrhelper.cxx index b33e0f141ba3..5cb72e3549cd 100644 --- a/sw/source/core/unocore/unocrsrhelper.cxx +++ b/sw/source/core/unocore/unocrsrhelper.cxx @@ -459,7 +459,7 @@ bool getCrsrPropertyValue(const SfxItemPropertySimpleEntry& rEntry getNumberingProperty(rPam, eNewState, pAny); else { - if( !rPam.GetDoc()->GetNumRuleAtPos( *rPam.GetPoint() ) ) + if( !SwDoc::GetNumRuleAtPos( *rPam.GetPoint() ) ) eNewState = PropertyState_DEFAULT_VALUE; } break; @@ -490,7 +490,7 @@ bool getCrsrPropertyValue(const SfxItemPropertySimpleEntry& rEntry break; case FN_UNO_DOCUMENT_INDEX: { - SwTOXBase* pBase = rPam.GetDoc()->GetCurTOX( + SwTOXBase* pBase = SwDoc::GetCurTOX( *rPam.Start() ); if( pBase ) { @@ -578,7 +578,7 @@ bool getCrsrPropertyValue(const SfxItemPropertySimpleEntry& rEntry break; case FN_UNO_TEXT_SECTION: { - SwSection* pSect = rPam.GetDoc()->GetCurrSection(*rPam.GetPoint()); + SwSection* pSect = SwDoc::GetCurrSection(*rPam.GetPoint()); if(pSect) { if( pAny ) @@ -880,7 +880,7 @@ void setNumberingProperty(const Any& rValue, SwPaM& rPam) void getNumberingProperty(SwPaM& rPam, PropertyState& eState, Any * pAny ) { - const SwNumRule* pNumRule = rPam.GetDoc()->GetNumRuleAtPos( *rPam.GetPoint() ); + const SwNumRule* pNumRule = SwDoc::GetNumRuleAtPos( *rPam.GetPoint() ); if(pNumRule) { uno::Reference< XIndexReplace > xNum = new SwXNumberingRules(*pNumRule); diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx index 31d7266b119e..28e9d968b95e 100644 --- a/sw/source/core/unocore/unodraw.cxx +++ b/sw/source/core/unocore/unodraw.cxx @@ -806,7 +806,7 @@ uno::Reference< drawing::XShapeGroup > SwXDrawPage::group(const uno::Reference< pPage->GetDrawView()->UnmarkAll(); if(pContact) { - uno::Reference< uno::XInterface > xInt = pPage->GetInterface( pContact->GetMaster() ); + uno::Reference< uno::XInterface > xInt = SwFmDrawPage::GetInterface( pContact->GetMaster() ); xRet = uno::Reference< drawing::XShapeGroup >(xInt, uno::UNO_QUERY); } pDoc->GetIDocumentUndoRedo().EndUndo( UNDO_END, NULL ); diff --git a/sw/source/core/unocore/unofield.cxx b/sw/source/core/unocore/unofield.cxx index a77085a0e8f9..f4056a03af99 100644 --- a/sw/source/core/unocore/unofield.cxx +++ b/sw/source/core/unocore/unofield.cxx @@ -2536,7 +2536,7 @@ void SAL_CALL SwXTextField::update() throw (uno::RuntimeException, std::exceptio case RES_EXTUSERFLD: { SwExtUserField* pExtUserFld = static_cast<SwExtUserField*>(pFld); - pExtUserFld->SetExpansion( static_cast<SwExtUserFieldType*>(pFld->GetTyp())->Expand( + pExtUserFld->SetExpansion( SwExtUserFieldType::Expand( pExtUserFld->GetSubType(), pExtUserFld->GetFormat() ) ); } @@ -2545,7 +2545,7 @@ void SAL_CALL SwXTextField::update() throw (uno::RuntimeException, std::exceptio case RES_AUTHORFLD: { SwAuthorField* pAuthorFld = static_cast<SwAuthorField*>(pFld); - pAuthorFld->SetExpansion( static_cast<SwAuthorFieldType*>(pFld->GetTyp())->Expand( + pAuthorFld->SetExpansion( SwAuthorFieldType::Expand( pAuthorFld->GetFormat() ) ); } break; diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx index cbb6b94659ff..db5f34caf150 100644 --- a/sw/source/core/unocore/unoframe.cxx +++ b/sw/source/core/unocore/unoframe.cxx @@ -1544,7 +1544,7 @@ void SwXFrame::setPropertyValue(const :: OUString& rPropertyName, const :: uno:: pSet = new SfxItemSet( pDoc->GetAttrPool(), aFrmFmtSetRange ); pSet->Put( *pItem ); if ( pFmt->GetDoc()->GetEditShell() != NULL - && !sw_ChkAndSetNewAnchor( *(pFmt->GetDoc()->GetEditShell()), *pFly, *pSet ) ) + && !sw_ChkAndSetNewAnchor( *pFly, *pSet ) ) delete pSet, pSet = 0; } } @@ -1562,7 +1562,7 @@ void SwXFrame::setPropertyValue(const :: OUString& rPropertyName, const :: uno:: OUString sGrfName; OUString sFltName; GraphicObject *pGrfObj = 0; - pFmt->GetDoc()->GetGrfNms( *static_cast<SwFlyFrmFmt*>(pFmt), &sGrfName, &sFltName ); + SwDoc::GetGrfNms( *static_cast<SwFlyFrmFmt*>(pFmt), &sGrfName, &sFltName ); OUString sTmp; aValue >>= sTmp; UnoActionContext aAction(pFmt->GetDoc()); @@ -1930,7 +1930,7 @@ void SwXFrame::setPropertyValue(const :: OUString& rPropertyName, const :: uno:: aSet.Put( *pItem ); if ( pFmt->GetDoc()->GetEditShell() != NULL ) { - sw_ChkAndSetNewAnchor( *(pFmt->GetDoc()->GetEditShell()), *pFly, aSet ); + sw_ChkAndSetNewAnchor( *pFly, aSet ); } } } @@ -2061,7 +2061,7 @@ uno::Any SwXFrame::getPropertyValue(const OUString& rPropertyName) throw uno::RuntimeException(); if( pGrfNode->IsGrfLink() ) { - pFmt->GetDoc()->GetGrfNms( *static_cast<SwFlyFrmFmt*>(pFmt), &sGrfName, 0 ); + SwDoc::GetGrfNms( *static_cast<SwFlyFrmFmt*>(pFmt), &sGrfName, 0 ); } else { @@ -2099,7 +2099,7 @@ uno::Any SwXFrame::getPropertyValue(const OUString& rPropertyName) else if( FN_UNO_GRAPHIC_FILTER == pEntry->nWID ) { OUString sFltName; - pFmt->GetDoc()->GetGrfNms( *static_cast<SwFlyFrmFmt*>(pFmt), 0, &sFltName ); + SwDoc::GetGrfNms( *static_cast<SwFlyFrmFmt*>(pFmt), 0, &sFltName ); aAny <<= sFltName; } else if( FN_UNO_GRAPHIC == pEntry->nWID ) diff --git a/sw/source/core/unocore/unoidx.cxx b/sw/source/core/unocore/unoidx.cxx index bd498a3606c2..d5c96944789e 100644 --- a/sw/source/core/unocore/unoidx.cxx +++ b/sw/source/core/unocore/unoidx.cxx @@ -853,7 +853,7 @@ throw (beans::UnknownPropertyException, beans::PropertyVetoException, if (WID_PRIMARY_KEY > pEntry->nWID) { const SwAttrSet& rSet = - m_pImpl->m_pDoc->GetTOXBaseAttrSet(rTOXBase); + SwDoc::GetTOXBaseAttrSet(rTOXBase); SfxItemSet aAttrSet(rSet); m_pImpl->m_rPropSet.setPropertyValue( rPropertyName, rValue, aAttrSet); @@ -1207,7 +1207,7 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException, if(WID_PRIMARY_KEY > pEntry->nWID) { const SwAttrSet& rSet = - m_pImpl->m_pDoc->GetTOXBaseAttrSet(*pTOXBase); + SwDoc::GetTOXBaseAttrSet(*pTOXBase); aRet = m_pImpl->m_rPropSet.getPropertyValue( rPropertyName, rSet); } @@ -1355,7 +1355,7 @@ throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) // this now needs to return TRUE ::sw::XTextRangeToSwPaM(aPam, xTextRange); - const SwTOXBase* pOld = pDoc->GetCurTOX( *aPam.Start() ); + const SwTOXBase* pOld = SwDoc::GetCurTOX( *aPam.Start() ); if (pOld) { throw lang::IllegalArgumentException(); diff --git a/sw/source/core/unocore/unoportenum.cxx b/sw/source/core/unocore/unoportenum.cxx index 9e292197fd35..7d899fd81d7d 100644 --- a/sw/source/core/unocore/unoportenum.cxx +++ b/sw/source/core/unocore/unoportenum.cxx @@ -701,7 +701,7 @@ typedef boost::shared_ptr < SwXRedlinePortion_Impl > struct RedlineCompareStruct { - const SwPosition& getPosition ( const SwXRedlinePortion_ImplSharedPtr &r ) + static const SwPosition& getPosition ( const SwXRedlinePortion_ImplSharedPtr &r ) { return *(r->m_bStart ? r->m_pRedline->Start() : r->m_pRedline->End()); } diff --git a/sw/source/core/unocore/unosect.cxx b/sw/source/core/unocore/unosect.cxx index 2a4de5c79413..6942fa1f3a31 100644 --- a/sw/source/core/unocore/unosect.cxx +++ b/sw/source/core/unocore/unosect.cxx @@ -312,7 +312,7 @@ throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) // caller wants an index header section, but will only // give him one if a) we are inside an index, and b) said // index doesn't yet have a header section. - const SwTOXBase* pBase = aPam.GetDoc()->GetCurTOX(*aPam.Start()); + const SwTOXBase* pBase = SwDoc::GetCurTOX(*aPam.Start()); // are we inside an index? if (pBase) diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx index e9f8a89996c9..49119026c467 100644 --- a/sw/source/core/unocore/unostyle.cxx +++ b/sw/source/core/unocore/unostyle.cxx @@ -1039,7 +1039,7 @@ public: bool GetProperty(const OUString& rName, uno::Any*& rpAny); bool ClearProperty( const OUString& rPropertyName ); void ClearAllProperties( ); - void GetProperty(const OUString &rPropertyName, const uno::Reference < beans::XPropertySet > &rxPropertySet, uno::Any& rAny ); + static void GetProperty(const OUString &rPropertyName, const uno::Reference < beans::XPropertySet > &rxPropertySet, uno::Any& rAny ); const PropertyEntryVector_t& GetPropertyVector() const {return aPropertyEntries; } @@ -2680,7 +2680,7 @@ uno::Sequence< uno::Any > SAL_CALL SwXStyle::GetPropertyValues_Impl( break; case SFX_STYLE_FAMILY_PARA: case SFX_STYLE_FAMILY_PAGE: - pPropImpl->GetProperty ( pNames[nProp], mxStyleData, pRet[ nProp ] ); + SwStyleProperties_Impl::GetProperty ( pNames[nProp], mxStyleData, pRet[ nProp ] ); break; case SFX_STYLE_FAMILY_CHAR: case SFX_STYLE_FAMILY_FRAME : @@ -3917,7 +3917,7 @@ uno::Sequence< uno::Any > SAL_CALL SwXPageStyle::GetPropertyValues_Impl( if ( !pAny ) { - GetPropImpl()->GetProperty(rPropName, mxStyleData, pRet[nProp]); + SwStyleProperties_Impl::GetProperty(rPropName, mxStyleData, pRet[nProp]); } else { diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx index 1a50542c6042..93c9072f9eac 100644 --- a/sw/source/core/unocore/unotbl.cxx +++ b/sw/source/core/unocore/unotbl.cxx @@ -1645,7 +1645,7 @@ void SwXTextTableCursor::setPropertyValue(const OUString& rPropertyName, const u case FN_UNO_TABLE_CELL_BACKGROUND: { SvxBrushItem aBrush(RES_BACKGROUND); - pDoc->GetBoxAttr(*pUnoCrsr, aBrush); + SwDoc::GetBoxAttr(*pUnoCrsr, aBrush); aBrush.PutValue(aValue, pEntry->nMemberId); pDoc->SetBoxAttr(*pUnoCrsr, aBrush); @@ -1704,7 +1704,7 @@ uno::Any SwXTextTableCursor::getPropertyValue(const OUString& rPropertyName) case FN_UNO_TABLE_CELL_BACKGROUND: { SvxBrushItem aBrush(RES_BACKGROUND); - if (rTblCrsr.GetDoc()->GetBoxAttr(*pUnoCrsr, aBrush)) + if (SwDoc::GetBoxAttr(*pUnoCrsr, aBrush)) aBrush.QueryValue(aResult, pEntry->nMemberId); } break; @@ -1759,7 +1759,7 @@ public: Impl() : m_Listeners(m_Mutex) { } // note: lock mutex before calling this to avoid concurrent update - std::pair<sal_uInt16, sal_uInt16> ThrowIfComplex(SwXTextTable &rThis) + static std::pair<sal_uInt16, sal_uInt16> ThrowIfComplex(SwXTextTable &rThis) { sal_uInt16 const nRowCount(rThis.getRowCount()); sal_uInt16 const nColCount(rThis.getColumnCount()); @@ -2274,7 +2274,7 @@ uno::Sequence< uno::Sequence< uno::Any > > SAL_CALL SwXTextTable::getDataArray() throw (uno::RuntimeException, std::exception) { SolarMutexGuard aGuard; - std::pair<sal_uInt16, sal_uInt16> const RowsAndColumns(m_pImpl->ThrowIfComplex(*this)); + std::pair<sal_uInt16, sal_uInt16> const RowsAndColumns(SwXTextTable::Impl::ThrowIfComplex(*this)); uno::Reference<sheet::XCellRangeData> const xAllRange( getCellRangeByPosition(0, 0, RowsAndColumns.second-1, RowsAndColumns.first-1), uno::UNO_QUERY); @@ -2285,7 +2285,7 @@ void SAL_CALL SwXTextTable::setDataArray(const uno::Sequence< uno::Sequence< uno throw (uno::RuntimeException, std::exception) { SolarMutexGuard aGuard; - std::pair<sal_uInt16, sal_uInt16> const RowsAndColumns(m_pImpl->ThrowIfComplex(*this)); + std::pair<sal_uInt16, sal_uInt16> const RowsAndColumns(SwXTextTable::Impl::ThrowIfComplex(*this)); uno::Reference<sheet::XCellRangeData> const xAllRange( getCellRangeByPosition(0, 0, RowsAndColumns.second-1, RowsAndColumns.first-1), uno::UNO_QUERY); @@ -2296,7 +2296,7 @@ uno::Sequence< uno::Sequence< double > > SwXTextTable::getData() throw( uno::RuntimeException, std::exception ) { SolarMutexGuard aGuard; - std::pair<sal_uInt16, sal_uInt16> const RowsAndColumns(m_pImpl->ThrowIfComplex(*this)); + std::pair<sal_uInt16, sal_uInt16> const RowsAndColumns(SwXTextTable::Impl::ThrowIfComplex(*this)); uno::Reference<chart::XChartDataArray> const xAllRange( getCellRangeByPosition(0, 0, RowsAndColumns.second-1, RowsAndColumns.first-1), uno::UNO_QUERY); @@ -2308,7 +2308,7 @@ void SwXTextTable::setData(const uno::Sequence< uno::Sequence< double > >& rData throw( uno::RuntimeException, std::exception ) { SolarMutexGuard aGuard; - std::pair<sal_uInt16, sal_uInt16> const RowsAndColumns(m_pImpl->ThrowIfComplex(*this)); + std::pair<sal_uInt16, sal_uInt16> const RowsAndColumns(SwXTextTable::Impl::ThrowIfComplex(*this)); uno::Reference<chart::XChartDataArray> const xAllRange( getCellRangeByPosition(0, 0, RowsAndColumns.second-1, RowsAndColumns.first-1), uno::UNO_QUERY); @@ -2322,7 +2322,7 @@ uno::Sequence<OUString> SwXTextTable::getRowDescriptions() throw(uno::RuntimeException, std::exception) { SolarMutexGuard aGuard; - std::pair<sal_uInt16, sal_uInt16> const RowsAndColumns(m_pImpl->ThrowIfComplex(*this)); + std::pair<sal_uInt16, sal_uInt16> const RowsAndColumns(SwXTextTable::Impl::ThrowIfComplex(*this)); uno::Reference<chart::XChartDataArray> const xAllRange( getCellRangeByPosition(0, 0, RowsAndColumns.second-1, RowsAndColumns.first-1), uno::UNO_QUERY); @@ -2334,7 +2334,7 @@ void SwXTextTable::setRowDescriptions(const uno::Sequence<OUString>& rRowDesc) throw(uno::RuntimeException, std::exception) { SolarMutexGuard aGuard; - std::pair<sal_uInt16, sal_uInt16> const RowsAndColumns(m_pImpl->ThrowIfComplex(*this)); + std::pair<sal_uInt16, sal_uInt16> const RowsAndColumns(SwXTextTable::Impl::ThrowIfComplex(*this)); uno::Reference<chart::XChartDataArray> const xAllRange( getCellRangeByPosition(0, 0, RowsAndColumns.second-1, RowsAndColumns.first-1), uno::UNO_QUERY); @@ -2346,7 +2346,7 @@ uno::Sequence<OUString> SwXTextTable::getColumnDescriptions() throw(uno::RuntimeException, std::exception) { SolarMutexGuard aGuard; - std::pair<sal_uInt16, sal_uInt16> const RowsAndColumns(m_pImpl->ThrowIfComplex(*this)); + std::pair<sal_uInt16, sal_uInt16> const RowsAndColumns(SwXTextTable::Impl::ThrowIfComplex(*this)); uno::Reference<chart::XChartDataArray> const xAllRange( getCellRangeByPosition(0, 0, RowsAndColumns.second-1, RowsAndColumns.first-1), uno::UNO_QUERY); @@ -2358,7 +2358,7 @@ void SwXTextTable::setColumnDescriptions(const uno::Sequence<OUString>& rColumnD throw(uno::RuntimeException, std::exception) { SolarMutexGuard aGuard; - std::pair<sal_uInt16, sal_uInt16> const RowsAndColumns(m_pImpl->ThrowIfComplex(*this)); + std::pair<sal_uInt16, sal_uInt16> const RowsAndColumns(SwXTextTable::Impl::ThrowIfComplex(*this)); uno::Reference<chart::XChartDataArray> const xAllRange( getCellRangeByPosition(0, 0, RowsAndColumns.second-1, RowsAndColumns.first-1), uno::UNO_QUERY); @@ -2788,7 +2788,7 @@ uno::Any SwXTextTable::getPropertyValue(const OUString& rPropertyName) SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER, 0); aSet.Put(SvxBoxInfoItem( SID_ATTR_BORDER_INNER )); - pDoc->GetTabBorders(rCrsr, aSet); + SwDoc::GetTabBorders(rCrsr, aSet); const SvxBoxInfoItem& rBoxInfoItem = static_cast<const SvxBoxInfoItem&>(aSet.Get(SID_ATTR_BORDER_INNER)); const SvxBoxItem& rBox = static_cast<const SvxBoxItem&>(aSet.Get(RES_BOX)); @@ -3308,7 +3308,7 @@ void SwXCellRange::setPropertyValue(const OUString& rPropertyName, const uno::An case FN_UNO_TABLE_CELL_BACKGROUND: { SvxBrushItem aBrush( RES_BACKGROUND ); - pDoc->GetBoxAttr( *pTblCrsr, aBrush ); + SwDoc::GetBoxAttr( *pTblCrsr, aBrush ); ((SfxPoolItem&)aBrush).PutValue(aValue, pEntry->nMemberId); pDoc->SetBoxAttr( *pTblCrsr, aBrush ); @@ -3339,7 +3339,7 @@ void SwXCellRange::setPropertyValue(const OUString& rPropertyName, const uno::An aBoxInfo.SetValid(nValid, true); aSet.Put(aBoxInfo); - pDoc->GetTabBorders(rCrsr, aSet); + SwDoc::GetTabBorders(rCrsr, aSet); aSet.Put(aBoxInfo); SvxBoxItem aBoxItem(static_cast<const SvxBoxItem&>(aSet.Get(RES_BOX))); @@ -3416,7 +3416,7 @@ uno::Any SwXCellRange::getPropertyValue(const OUString& rPropertyName) case FN_UNO_TABLE_CELL_BACKGROUND: { SvxBrushItem aBrush( RES_BACKGROUND ); - if(pTblCrsr->GetDoc()->GetBoxAttr( *pTblCrsr, aBrush )) + if(SwDoc::GetBoxAttr( *pTblCrsr, aBrush )) aBrush.QueryValue(aRet, pEntry->nMemberId); } @@ -3429,7 +3429,7 @@ uno::Any SwXCellRange::getPropertyValue(const OUString& rPropertyName) SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER, 0); aSet.Put(SvxBoxInfoItem( SID_ATTR_BORDER_INNER )); - pDoc->GetTabBorders(*pTblCrsr, aSet); + SwDoc::GetTabBorders(*pTblCrsr, aSet); const SvxBoxItem& rBoxItem = static_cast<const SvxBoxItem&>(aSet.Get(RES_BOX)); rBoxItem.QueryValue(aRet, pEntry->nMemberId); } diff --git a/sw/source/core/unocore/unotext.cxx b/sw/source/core/unocore/unotext.cxx index 3374de07a4e5..04bc9a2f9cbe 100644 --- a/sw/source/core/unocore/unotext.cxx +++ b/sw/source/core/unocore/unotext.cxx @@ -1848,7 +1848,7 @@ void SwXText::Impl::ConvertCell( SwNodeRange aTmpRange(aStartCellPam.Start()->nNode, aEndCellPam.End()->nNode); SwNodeRange * pCorrectedRange = - m_pDoc->GetNodes().ExpandRangeForTableBox(aTmpRange); + SwNodes::ExpandRangeForTableBox(aTmpRange); if (pCorrectedRange != NULL) { diff --git a/sw/source/core/view/vnew.cxx b/sw/source/core/view/vnew.cxx index 096265b5f3ef..03bd9c6405b1 100644 --- a/sw/source/core/view/vnew.cxx +++ b/sw/source/core/view/vnew.cxx @@ -107,7 +107,7 @@ void SwViewShell::Init( const SwViewOption *pNewOpt ) SAL_INFO( "sw.core", "View::Init - after InitPrt" ); if( GetWin() ) { - mpOpt->Init( GetWin() ); + SwViewOption::Init( GetWin() ); GetWin()->SetFillColor(); GetWin()->SetBackground(); GetWin()->SetLineColor(); |