diff options
Diffstat (limited to 'sw/source/core/edit')
-rw-r--r-- | sw/source/core/edit/acorrect.cxx | 118 | ||||
-rw-r--r-- | sw/source/core/edit/autofmt.cxx | 804 | ||||
-rw-r--r-- | sw/source/core/edit/edatmisc.cxx | 28 | ||||
-rw-r--r-- | sw/source/core/edit/edattr.cxx | 206 | ||||
-rw-r--r-- | sw/source/core/edit/eddel.cxx | 22 | ||||
-rw-r--r-- | sw/source/core/edit/edfcol.cxx | 46 | ||||
-rw-r--r-- | sw/source/core/edit/edfld.cxx | 198 | ||||
-rw-r--r-- | sw/source/core/edit/edfldexp.cxx | 20 | ||||
-rw-r--r-- | sw/source/core/edit/edfmt.cxx | 74 | ||||
-rw-r--r-- | sw/source/core/edit/edglbldc.cxx | 40 | ||||
-rw-r--r-- | sw/source/core/edit/edglss.cxx | 80 | ||||
-rw-r--r-- | sw/source/core/edit/editsh.cxx | 222 | ||||
-rw-r--r-- | sw/source/core/edit/edlingu.cxx | 76 | ||||
-rw-r--r-- | sw/source/core/edit/ednumber.cxx | 124 | ||||
-rw-r--r-- | sw/source/core/edit/edredln.cxx | 10 | ||||
-rw-r--r-- | sw/source/core/edit/edsect.cxx | 60 | ||||
-rw-r--r-- | sw/source/core/edit/edtab.cxx | 154 | ||||
-rw-r--r-- | sw/source/core/edit/edtox.cxx | 22 | ||||
-rw-r--r-- | sw/source/core/edit/edundo.cxx | 22 | ||||
-rw-r--r-- | sw/source/core/edit/edws.cxx | 18 |
20 files changed, 1172 insertions, 1172 deletions
diff --git a/sw/source/core/edit/acorrect.cxx b/sw/source/core/edit/acorrect.cxx index c986957dd218..d3281eb391c2 100644 --- a/sw/source/core/edit/acorrect.cxx +++ b/sw/source/core/edit/acorrect.cxx @@ -101,7 +101,7 @@ SwAutoCorrDoc::~SwAutoCorrDoc() void SwAutoCorrDoc::DeleteSel( SwPaM& rDelPam ) { SwDoc* pDoc = rEditSh.GetDoc(); - if( pDoc->IsAutoFmtRedline() ) + if( pDoc->IsAutoFormatRedline() ) { // so that also the DelPam be moved, include it in the // Shell-Cursr-Ring !! @@ -125,14 +125,14 @@ bool SwAutoCorrDoc::Delete( sal_Int32 nStt, sal_Int32 nEnd ) return true; } -bool SwAutoCorrDoc::Insert( sal_Int32 nPos, const OUString& rTxt ) +bool SwAutoCorrDoc::Insert( sal_Int32 nPos, const OUString& rText ) { SwPaM aPam( rCrsr.GetPoint()->nNode.GetNode(), nPos ); - rEditSh.GetDoc()->getIDocumentContentOperations().InsertString( aPam, rTxt ); + rEditSh.GetDoc()->getIDocumentContentOperations().InsertString( aPam, rText ); if( !bUndoIdInitialized ) { bUndoIdInitialized = true; - if( 1 == rTxt.getLength() ) + if( 1 == rText.getLength() ) { rEditSh.StartUndo( UNDO_AUTOCORRECT ); ++m_nEndUndoCounter; @@ -141,12 +141,12 @@ bool SwAutoCorrDoc::Insert( sal_Int32 nPos, const OUString& rTxt ) return true; } -bool SwAutoCorrDoc::Replace( sal_Int32 nPos, const OUString& rTxt ) +bool SwAutoCorrDoc::Replace( sal_Int32 nPos, const OUString& rText ) { - return ReplaceRange( nPos, rTxt.getLength(), rTxt ); + return ReplaceRange( nPos, rText.getLength(), rText ); } -bool SwAutoCorrDoc::ReplaceRange( sal_Int32 nPos, sal_Int32 nSourceLength, const OUString& rTxt ) +bool SwAutoCorrDoc::ReplaceRange( sal_Int32 nPos, sal_Int32 nSourceLength, const OUString& rText ) { SwPaM* pPam = &rCrsr; if( pPam->GetPoint()->nContent.GetIndex() != nPos ) @@ -155,7 +155,7 @@ bool SwAutoCorrDoc::ReplaceRange( sal_Int32 nPos, sal_Int32 nSourceLength, const pPam->GetPoint()->nContent = nPos; } - SwTxtNode * const pNd = pPam->GetNode().GetTxtNode(); + SwTextNode * const pNd = pPam->GetNode().GetTextNode(); if ( !pNd ) { return false; @@ -163,12 +163,12 @@ bool SwAutoCorrDoc::ReplaceRange( sal_Int32 nPos, sal_Int32 nSourceLength, const // text attributes with dummy characters must not be replaced! bool bDoReplace = true; - sal_Int32 const nLen = rTxt.getLength(); + sal_Int32 const nLen = rText.getLength(); for ( sal_Int32 n = 0; n < nLen; ++n ) { - sal_Unicode const Char = pNd->GetTxt()[n + nPos]; + sal_Unicode const Char = pNd->GetText()[n + nPos]; if ( ( CH_TXTATR_BREAKWORD == Char || CH_TXTATR_INWORD == Char ) - && pNd->GetTxtAttrForCharAt( n + nPos ) ) + && pNd->GetTextAttrForCharAt( n + nPos ) ) { bDoReplace = false; break; @@ -179,11 +179,11 @@ bool SwAutoCorrDoc::ReplaceRange( sal_Int32 nPos, sal_Int32 nSourceLength, const { SwDoc* pDoc = rEditSh.GetDoc(); - if( pDoc->IsAutoFmtRedline() ) + if( pDoc->IsAutoFormatRedline() ) { - if (nPos == pNd->GetTxt().getLength()) // at the End do an Insert + if (nPos == pNd->GetText().getLength()) // at the End do an Insert { - pDoc->getIDocumentContentOperations().InsertString( *pPam, rTxt ); + pDoc->getIDocumentContentOperations().InsertString( *pPam, rText ); } else { @@ -191,31 +191,31 @@ bool SwAutoCorrDoc::ReplaceRange( sal_Int32 nPos, sal_Int32 nSourceLength, const pPam->SetMark(); pPam->GetPoint()->nContent = std::min<sal_Int32>( - pNd->GetTxt().getLength(), nPos + nSourceLength); - pDoc->getIDocumentContentOperations().ReplaceRange( *pPam, rTxt, false ); + pNd->GetText().getLength(), nPos + nSourceLength); + pDoc->getIDocumentContentOperations().ReplaceRange( *pPam, rText, false ); pPam->Exchange(); pPam->DeleteMark(); } } else { - if( nSourceLength != rTxt.getLength() ) + if( nSourceLength != rText.getLength() ) { pPam->SetMark(); pPam->GetPoint()->nContent = std::min<sal_Int32>( - pNd->GetTxt().getLength(), nPos + nSourceLength); - pDoc->getIDocumentContentOperations().ReplaceRange( *pPam, rTxt, false ); + pNd->GetText().getLength(), nPos + nSourceLength); + pDoc->getIDocumentContentOperations().ReplaceRange( *pPam, rText, false ); pPam->Exchange(); pPam->DeleteMark(); } else - pDoc->getIDocumentContentOperations().Overwrite( *pPam, rTxt ); + pDoc->getIDocumentContentOperations().Overwrite( *pPam, rText ); } if( bUndoIdInitialized ) { bUndoIdInitialized = true; - if( 1 == rTxt.getLength() ) + if( 1 == rText.getLength() ) { rEditSh.StartUndo( UNDO_AUTOCORRECT ); ++m_nEndUndoCounter; @@ -241,10 +241,10 @@ bool SwAutoCorrDoc::SetAttr( sal_Int32 nStt, sal_Int32 nEnd, sal_uInt16 nSlotId, { rItem.SetWhich( nWhich ); - SfxItemSet aSet( rPool, aCharFmtSetRange ); + SfxItemSet aSet( rPool, aCharFormatSetRange ); SetAllScriptItem( aSet, rItem ); - rEditSh.GetDoc()->SetFmtItemByAutoFmt( aPam, aSet ); + rEditSh.GetDoc()->SetFormatItemByAutoFormat( aPam, aSet ); if( bUndoIdInitialized ) bUndoIdInitialized = true; @@ -259,8 +259,8 @@ bool SwAutoCorrDoc::SetINetAttr( sal_Int32 nStt, sal_Int32 nEnd, const OUString& SfxItemSet aSet( rEditSh.GetDoc()->GetAttrPool(), RES_TXTATR_INETFMT, RES_TXTATR_INETFMT ); - aSet.Put( SwFmtINetFmt( rURL, OUString() )); - rEditSh.GetDoc()->SetFmtItemByAutoFmt( aPam, aSet ); + aSet.Put( SwFormatINetFormat( rURL, OUString() )); + rEditSh.GetDoc()->SetFormatItemByAutoFormat( aPam, aSet ); if( bUndoIdInitialized ) bUndoIdInitialized = true; return true; @@ -281,14 +281,14 @@ OUString const* SwAutoCorrDoc::GetPrevPara(bool const bAtNormalPos) else --(*pIdx); - SwTxtNode* pTNd = pIdx->GetNode().GetTxtNode(); - while (pTNd && !pTNd->GetTxt().getLength()) + SwTextNode* pTNd = pIdx->GetNode().GetTextNode(); + while (pTNd && !pTNd->GetText().getLength()) { --(*pIdx); - pTNd = pIdx->GetNode().GetTxtNode(); + pTNd = pIdx->GetNode().GetTextNode(); } if( pTNd && 0 == pTNd->GetAttrOutlineLevel() ) - pStr = & pTNd->GetTxt(); + pStr = & pTNd->GetText(); if( bUndoIdInitialized ) bUndoIdInitialized = true; @@ -305,8 +305,8 @@ bool SwAutoCorrDoc::ChgAutoCorrWord( sal_Int32& rSttPos, sal_Int32 nEndPos, // Found a beginning of a paragraph or a Blank, // search for the word Kuerzel (Shortcut) in the Auto - SwTxtNode* pTxtNd = rCrsr.GetNode().GetTxtNode(); - OSL_ENSURE( pTxtNd, "where is the TextNode?" ); + SwTextNode* pTextNd = rCrsr.GetNode().GetTextNode(); + OSL_ENSURE( pTextNd, "where is the TextNode?" ); bool bRet = false; if( nEndPos == rSttPos ) @@ -318,11 +318,11 @@ bool SwAutoCorrDoc::ChgAutoCorrWord( sal_Int32& rSttPos, sal_Int32 nEndPos, LanguageTag aLanguageTag( eLang); //JP 22.04.99: Bug 63883 - Special treatment for dots. - bool bLastCharIsPoint = nEndPos < pTxtNd->GetTxt().getLength() && - ('.' == pTxtNd->GetTxt()[nEndPos]); + bool bLastCharIsPoint = nEndPos < pTextNd->GetText().getLength() && + ('.' == pTextNd->GetText()[nEndPos]); const SvxAutocorrWord* pFnd = rACorrect.SearchWordsInList( - pTxtNd->GetTxt(), rSttPos, nEndPos, *this, aLanguageTag ); + pTextNd->GetText(), rSttPos, nEndPos, *this, aLanguageTag ); SwDoc* pDoc = rEditSh.GetDoc(); if( pFnd ) { @@ -347,7 +347,7 @@ bool SwAutoCorrDoc::ChgAutoCorrWord( sal_Int32& rSttPos, sal_Int32 nEndPos, if( USHRT_MAX != nPos && aTBlks.BeginGetDoc( nPos ) ) { DeleteSel( aPam ); - pDoc->DontExpandFmt( *aPam.GetPoint() ); + pDoc->DontExpandFormat( *aPam.GetPoint() ); if( pPara ) { @@ -357,22 +357,22 @@ bool SwAutoCorrDoc::ChgAutoCorrWord( sal_Int32& rSttPos, sal_Int32 nEndPos, SwDoc* pAutoDoc = aTBlks.GetDoc(); SwNodeIndex aSttIdx( pAutoDoc->GetNodes().GetEndOfExtras(), 1 ); - SwCntntNode* pCntntNd = pAutoDoc->GetNodes().GoNext( &aSttIdx ); + SwContentNode* pContentNd = pAutoDoc->GetNodes().GoNext( &aSttIdx ); SwPaM aCpyPam( aSttIdx ); - const SwTableNode* pTblNd = pCntntNd->FindTableNode(); - if( pTblNd ) + const SwTableNode* pTableNd = pContentNd->FindTableNode(); + if( pTableNd ) { aCpyPam.GetPoint()->nContent.Assign( 0, 0 ); - aCpyPam.GetPoint()->nNode = *pTblNd; + aCpyPam.GetPoint()->nNode = *pTableNd; } aCpyPam.SetMark(); // then until the end of the Nodes Array aCpyPam.GetPoint()->nNode.Assign( pAutoDoc->GetNodes().GetEndOfContent(), -1 ); - pCntntNd = aCpyPam.GetCntntNode(); + pContentNd = aCpyPam.GetContentNode(); aCpyPam.GetPoint()->nContent.Assign( - pCntntNd, (pCntntNd) ? pCntntNd->Len() : 0); + pContentNd, (pContentNd) ? pContentNd->Len() : 0); SwDontExpandItem aExpItem; aExpItem.SaveDontExpandItems( *aPam.GetPoint() ); @@ -384,7 +384,7 @@ bool SwAutoCorrDoc::ChgAutoCorrWord( sal_Int32& rSttPos, sal_Int32 nEndPos, if( pPara ) { ++(*pIdx); - pTxtNd = pIdx->GetNode().GetTxtNode(); + pTextNd = pIdx->GetNode().GetTextNode(); } bRet = true; } @@ -392,8 +392,8 @@ bool SwAutoCorrDoc::ChgAutoCorrWord( sal_Int32& rSttPos, sal_Int32 nEndPos, } } - if( bRet && pPara && pTxtNd ) - *pPara = pTxtNd->GetTxt(); + if( bRet && pPara && pTextNd ) + *pPara = pTextNd->GetText(); return bRet; } @@ -417,9 +417,9 @@ LanguageType SwAutoCorrDoc::GetLanguage( sal_Int32 nPos, bool bPrevPara ) const { LanguageType eRet = LANGUAGE_SYSTEM; - SwTxtNode* pNd = (( bPrevPara && pIdx ) + SwTextNode* pNd = (( bPrevPara && pIdx ) ? *pIdx - : rCrsr.GetPoint()->nNode ).GetNode().GetTxtNode(); + : rCrsr.GetPoint()->nNode ).GetNode().GetTextNode(); if( pNd ) eRet = pNd->GetLang( nPos, 0 ); @@ -460,35 +460,35 @@ SwDontExpandItem::~SwDontExpandItem() void SwDontExpandItem::SaveDontExpandItems( const SwPosition& rPos ) { - const SwTxtNode* pTxtNd = rPos.nNode.GetNode().GetTxtNode(); - if( pTxtNd ) + const SwTextNode* pTextNd = rPos.nNode.GetNode().GetTextNode(); + if( pTextNd ) { - pDontExpItems = new SfxItemSet( const_cast<SwDoc*>(pTxtNd->GetDoc())->GetAttrPool(), - aCharFmtSetRange ); + pDontExpItems = new SfxItemSet( const_cast<SwDoc*>(pTextNd->GetDoc())->GetAttrPool(), + aCharFormatSetRange ); const sal_Int32 n = rPos.nContent.GetIndex(); - if( !pTxtNd->GetAttr( *pDontExpItems, n, n, - n != pTxtNd->GetTxt().getLength() )) + if( !pTextNd->GetAttr( *pDontExpItems, n, n, + n != pTextNd->GetText().getLength() )) delete pDontExpItems, pDontExpItems = 0; } } void SwDontExpandItem::RestoreDontExpandItems( const SwPosition& rPos ) { - SwTxtNode* pTxtNd = rPos.nNode.GetNode().GetTxtNode(); - if( pTxtNd ) + SwTextNode* pTextNd = rPos.nNode.GetNode().GetTextNode(); + if( pTextNd ) { const sal_Int32 nStart = rPos.nContent.GetIndex(); - if( nStart == pTxtNd->GetTxt().getLength() ) - pTxtNd->FmtToTxtAttr( pTxtNd ); + if( nStart == pTextNd->GetText().getLength() ) + pTextNd->FormatToTextAttr( pTextNd ); - if( pTxtNd->GetpSwpHints() && pTxtNd->GetpSwpHints()->Count() ) + if( pTextNd->GetpSwpHints() && pTextNd->GetpSwpHints()->Count() ) { - const size_t nSize = pTxtNd->GetpSwpHints()->Count(); + const size_t nSize = pTextNd->GetpSwpHints()->Count(); sal_Int32 nAttrStart; for( size_t n = 0; n < nSize; ++n ) { - SwTxtAttr* pHt = pTxtNd->GetpSwpHints()->GetTextHint( n ); + SwTextAttr* pHt = pTextNd->GetpSwpHints()->GetTextHint( n ); nAttrStart = pHt->GetStart(); if( nAttrStart > nStart ) // beyond the area break; diff --git a/sw/source/core/edit/autofmt.cxx b/sw/source/core/edit/autofmt.cxx index 729a37529eca..af48083d1141 100644 --- a/sw/source/core/edit/autofmt.cxx +++ b/sw/source/core/edit/autofmt.cxx @@ -81,7 +81,7 @@ const int cnPosEnDash = 2, cnPosEmDash = 4; const sal_Unicode cStarSymbolEnDash = 0x2013; const sal_Unicode cStarSymbolEmDash = 0x2014; -SvxSwAutoFmtFlags* SwEditShell::s_pAutoFmtFlags = nullptr; +SvxSwAutoFormatFlags* SwEditShell::s_pAutoFormatFlags = nullptr; // Number of num-/bullet-paragraph templates. MAXLEVEL will soon be raised // to x, but not the number of templates. (Artifact from <= 4.0) @@ -89,21 +89,21 @@ const sal_uInt16 cnNumBullColls = 4; class SwAutoFormat { - SvxSwAutoFmtFlags m_aFlags; + SvxSwAutoFormatFlags m_aFlags; SwPaM m_aDelPam; // a Pam that can be used SwNodeIndex m_aNdIdx; // the index on the current TextNode SwNodeIndex m_aEndNdIdx; // index on the end of the area SwEditShell* m_pEditShell; SwDoc* m_pDoc; - SwTxtNode* m_pCurTxtNd; // the current TextNode - SwTxtFrm* m_pCurTxtFrm; // frame of the current TextNode + SwTextNode* m_pCurTextNd; // the current TextNode + SwTextFrm* m_pCurTextFrm; // frame of the current TextNode sal_uLong m_nEndNdIdx; // for the percentage-display mutable boost::scoped_ptr<CharClass> m_pCharClass; // Character classification mutable LanguageType m_eCharClassLang; sal_uInt16 m_nLastHeadLvl, m_nLastCalcHeadLvl; - sal_uInt16 m_nRedlAutoFmtSeqId; + sal_uInt16 m_nRedlAutoFormatSeqId; enum { @@ -154,18 +154,18 @@ class SwAutoFormat OUString GoNextPara(); bool HasObjects( const SwNode& rNd ); - // TxtNode methods - const SwTxtNode* GetNextNode() const; - static bool IsEmptyLine( const SwTxtNode& rNd ) - { return rNd.GetTxt().isEmpty() || - rNd.GetTxt().getLength() == GetLeadingBlanks( rNd.GetTxt() ); } - - bool IsOneLine( const SwTxtNode& ) const; - bool IsFastFullLine( const SwTxtNode& ) const; - bool IsNoAlphaLine( const SwTxtNode&) const; - bool IsEnumericChar( const SwTxtNode&) const; - static bool IsBlanksInString( const SwTxtNode&); - sal_uInt16 CalcLevel( const SwTxtNode&, sal_uInt16 *pDigitLvl = 0 ) const; + // TextNode methods + const SwTextNode* GetNextNode() const; + static bool IsEmptyLine( const SwTextNode& rNd ) + { return rNd.GetText().isEmpty() || + rNd.GetText().getLength() == GetLeadingBlanks( rNd.GetText() ); } + + bool IsOneLine( const SwTextNode& ) const; + bool IsFastFullLine( const SwTextNode& ) const; + bool IsNoAlphaLine( const SwTextNode&) const; + bool IsEnumericChar( const SwTextNode&) const; + static bool IsBlanksInString( const SwTextNode&); + sal_uInt16 CalcLevel( const SwTextNode&, sal_uInt16 *pDigitLvl = 0 ) const; sal_Int32 GetBigIndent( sal_Int32& rAktSpacePos ) const; static OUString DelLeadingBlanks(const OUString& rStr); @@ -173,12 +173,12 @@ class SwAutoFormat 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, + bool IsFirstCharCapital( const SwTextNode& rNd ) const; + sal_uInt16 GetDigitLevel( const SwTextNode& rTextNd, sal_Int32& rPos, OUString* pPrefix = 0, OUString* pPostfix = 0, OUString* pNumTypes = 0 ) const; /// get the FORMATED TextFrame - SwTxtFrm* GetFrm( const SwTxtNode& rTxtNd ) const; + SwTextFrm* GetFrm( const SwTextNode& rTextNd ) const; void BuildIndent(); void BuildText(); @@ -188,7 +188,7 @@ class SwAutoFormat void BuildHeadLine( sal_uInt16 nLvl ); static bool HasSelBlanks( SwPaM& rPam ); - static bool HasBreakAttr( const SwTxtNode& ); + static bool HasBreakAttr( const SwTextNode& ); void DeleteSel( SwPaM& rPam ); bool DeleteCurNxtPara( const OUString& rNxtPara ); /// delete in the node start and/or end @@ -202,31 +202,31 @@ class SwAutoFormat /// execute AutoCorrect on current TextNode void AutoCorrect( sal_Int32 nSttPos = 0 ); - bool CanJoin( const SwTxtNode* pTxtNd ) const + bool CanJoin( const SwTextNode* pTextNd ) const { - return !m_bEnd && pTxtNd && - !IsEmptyLine( *pTxtNd ) && - !IsNoAlphaLine( *pTxtNd) && - !IsEnumericChar( *pTxtNd ) && - ((COMPLETE_STRING - 50 - pTxtNd->GetTxt().getLength()) > - m_pCurTxtNd->GetTxt().getLength()) && - !HasBreakAttr( *pTxtNd ); + return !m_bEnd && pTextNd && + !IsEmptyLine( *pTextNd ) && + !IsNoAlphaLine( *pTextNd) && + !IsEnumericChar( *pTextNd ) && + ((COMPLETE_STRING - 50 - pTextNd->GetText().getLength()) > + m_pCurTextNd->GetText().getLength()) && + !HasBreakAttr( *pTextNd ); } /// is a dot at the end ?? - static bool IsSentenceAtEnd( const SwTxtNode& rTxtNd ); + static bool IsSentenceAtEnd( const SwTextNode& rTextNd ); bool DoUnderline(); bool DoTable(); - void _SetRedlineTxt( sal_uInt16 nId ); - bool SetRedlineTxt( sal_uInt16 nId ) - { if( m_aFlags.bWithRedlining ) _SetRedlineTxt( nId ); return true; } - bool ClearRedlineTxt() - { if( m_aFlags.bWithRedlining ) m_pDoc->GetDocumentRedlineManager().SetAutoFmtRedlineComment(0); return true; } + void _SetRedlineText( sal_uInt16 nId ); + bool SetRedlineText( sal_uInt16 nId ) + { if( m_aFlags.bWithRedlining ) _SetRedlineText( nId ); return true; } + bool ClearRedlineText() + { if( m_aFlags.bWithRedlining ) m_pDoc->GetDocumentRedlineManager().SetAutoFormatRedlineComment(0); return true; } public: - SwAutoFormat( SwEditShell* pEdShell, SvxSwAutoFmtFlags& rFlags, + SwAutoFormat( SwEditShell* pEdShell, SvxSwAutoFormatFlags& rFlags, SwNodeIndex* pSttNd = 0, SwNodeIndex* pEndNd = 0 ); }; @@ -237,30 +237,30 @@ const sal_Unicode* StrChr( const sal_Unicode* pSrc, sal_Unicode c ) return *pSrc ? pSrc : 0; } -SwTxtFrm* SwAutoFormat::GetFrm( const SwTxtNode& rTxtNd ) const +SwTextFrm* SwAutoFormat::GetFrm( const SwTextNode& rTextNd ) const { // get the Frame - const SwCntntFrm *pFrm = rTxtNd.getLayoutFrm( m_pEditShell->GetLayout() ); + const SwContentFrm *pFrm = rTextNd.getLayoutFrm( m_pEditShell->GetLayout() ); OSL_ENSURE( pFrm, "For Autoformat a Layout is needed" ); - if( m_aFlags.bAFmtByInput && !pFrm->IsValid() ) + if( m_aFlags.bAFormatByInput && !pFrm->IsValid() ) { SwRect aTmpFrm( pFrm->Frm() ); SwRect aTmpPrt( pFrm->Prt() ); pFrm->Calc(); if( pFrm->Frm() != aTmpFrm || pFrm->Prt() != aTmpPrt || - ( pFrm->IsTxtFrm() && !const_cast<SwTxtFrm*>(static_cast<const SwTxtFrm*>(pFrm))->Paint().IsEmpty() ) ) + ( pFrm->IsTextFrm() && !const_cast<SwTextFrm*>(static_cast<const SwTextFrm*>(pFrm))->Paint().IsEmpty() ) ) pFrm->SetCompletePaint(); } - return const_cast<SwTxtFrm*>(static_cast<const SwTxtFrm*>(pFrm))->GetFormatted(); + return const_cast<SwTextFrm*>(static_cast<const SwTextFrm*>(pFrm))->GetFormatted(); } -void SwAutoFormat::_SetRedlineTxt( sal_uInt16 nActionId ) +void SwAutoFormat::_SetRedlineText( sal_uInt16 nActionId ) { - OUString sTxt; + OUString sText; sal_uInt16 nSeqNo = 0; if( STR_AUTOFMTREDL_END > nActionId ) { - sTxt = SwViewShell::GetShellRes()->GetAutoFmtNameLst()[ nActionId ]; + sText = SwViewShell::GetShellRes()->GetAutoFormatNameLst()[ nActionId ]; switch( nActionId ) { case STR_AUTOFMTREDL_SET_NUMBULET: @@ -277,16 +277,16 @@ void SwAutoFormat::_SetRedlineTxt( sal_uInt16 nActionId ) case STR_AUTOFMTREDL_DASH: case STR_AUTOFMTREDL_ORDINAL: case STR_AUTOFMTREDL_NON_BREAK_SPACE: - nSeqNo = ++m_nRedlAutoFmtSeqId; + nSeqNo = ++m_nRedlAutoFormatSeqId; break; } } #if OSL_DEBUG_LEVEL > 0 else - sTxt = "Action text is missing"; + sText = "Action text is missing"; #endif - m_pDoc->GetDocumentRedlineManager().SetAutoFmtRedlineComment( &sTxt, nSeqNo ); + m_pDoc->GetDocumentRedlineManager().SetAutoFormatRedlineComment( &sText, nSeqNo ); } OUString SwAutoFormat::GoNextPara() @@ -311,7 +311,7 @@ OUString SwAutoFormat::GoNextPara() // not a TextNode -> // TableNode : skip table - // NoTxtNode : skip nodes + // NoTextNode : skip nodes // EndNode : at the end, terminate if( pNewNd->IsEndNode() ) { @@ -326,15 +326,15 @@ OUString SwAutoFormat::GoNextPara() if( rSect.IsHiddenFlag() || rSect.IsProtectFlag() ) m_aNdIdx = *pNewNd->EndOfSectionNode(); } - } while( !pNewNd->IsTxtNode() ); + } while( !pNewNd->IsTextNode() ); - if( !m_aFlags.bAFmtByInput ) + if( !m_aFlags.bAFormatByInput ) ::SetProgressState( m_aNdIdx.GetIndex() + m_nEndNdIdx - m_aEndNdIdx.GetIndex(), m_pDoc->GetDocShell() ); - m_pCurTxtNd = static_cast<SwTxtNode*>(pNewNd); - m_pCurTxtFrm = GetFrm( *m_pCurTxtNd ); - return m_pCurTxtNd->GetTxt(); + m_pCurTextNd = static_cast<SwTextNode*>(pNewNd); + m_pCurTextFrm = GetFrm( *m_pCurTextNd ); + return m_pCurTextNd->GetText(); } bool SwAutoFormat::HasObjects( const SwNode& rNd ) @@ -342,13 +342,13 @@ bool SwAutoFormat::HasObjects( const SwNode& rNd ) // Is there something bound to the paragraph in the paragraph // like borders, DrawObjects, ... bool bRet = false; - const SwFrmFmts& rFmts = *m_pDoc->GetSpzFrmFmts(); - for( auto pFrmFmt : rFmts ) + const SwFrameFormats& rFormats = *m_pDoc->GetSpzFrameFormats(); + for( auto pFrameFormat : rFormats ) { - const SwFmtAnchor& rAnchor = pFrmFmt->GetAnchor(); + const SwFormatAnchor& rAnchor = pFrameFormat->GetAnchor(); if ((FLY_AT_PAGE != rAnchor.GetAnchorId()) && - rAnchor.GetCntntAnchor() && - &rAnchor.GetCntntAnchor()->nNode.GetNode() == &rNd ) + rAnchor.GetContentAnchor() && + &rAnchor.GetContentAnchor()->nNode.GetNode() == &rNd ) { bRet = true; break; @@ -357,45 +357,45 @@ bool SwAutoFormat::HasObjects( const SwNode& rNd ) return bRet; } -const SwTxtNode* SwAutoFormat::GetNextNode() const +const SwTextNode* SwAutoFormat::GetNextNode() const { if( m_aNdIdx.GetIndex()+1 >= m_aEndNdIdx.GetIndex() ) return 0; - return m_pDoc->GetNodes()[ m_aNdIdx.GetIndex() + 1 ]->GetTxtNode(); + return m_pDoc->GetNodes()[ m_aNdIdx.GetIndex() + 1 ]->GetTextNode(); } -bool SwAutoFormat::IsOneLine( const SwTxtNode& rNd ) const +bool SwAutoFormat::IsOneLine( const SwTextNode& rNd ) const { - SwTxtFrmInfo aFInfo( GetFrm( rNd ) ); + SwTextFrmInfo aFInfo( GetFrm( rNd ) ); return aFInfo.IsOneLine(); } -bool SwAutoFormat::IsFastFullLine( const SwTxtNode& rNd ) const +bool SwAutoFormat::IsFastFullLine( const SwTextNode& rNd ) const { bool bRet = m_aFlags.bRightMargin; if( bRet ) { - SwTxtFrmInfo aFInfo( GetFrm( rNd ) ); + SwTextFrmInfo aFInfo( GetFrm( rNd ) ); bRet = aFInfo.IsFilled( m_aFlags.nRightMargin ); } return bRet; } -bool SwAutoFormat::IsEnumericChar( const SwTxtNode& rNd ) const +bool SwAutoFormat::IsEnumericChar( const SwTextNode& rNd ) const { - const OUString& rTxt = rNd.GetTxt(); - sal_Int32 nBlnks = GetLeadingBlanks( rTxt ); - const sal_Int32 nLen = rTxt.getLength() - nBlnks; + const OUString& rText = rNd.GetText(); + sal_Int32 nBlnks = GetLeadingBlanks( rText ); + const sal_Int32 nLen = rText.getLength() - nBlnks; if( !nLen ) return false; // -, +, * separated by blank ?? - if (2 < nLen && IsSpace(rTxt[nBlnks + 1])) + if (2 < nLen && IsSpace(rText[nBlnks + 1])) { - if (StrChr(pBulletChar, rTxt[nBlnks])) + if (StrChr(pBulletChar, rText[nBlnks])) return true; // Should there be a symbol font at the position? - SwTxtFrmInfo aFInfo( GetFrm( rNd ) ); + SwTextFrmInfo aFInfo( GetFrm( rNd ) ); if( aFInfo.IsBullet( nBlnks )) return true; } @@ -404,10 +404,10 @@ bool SwAutoFormat::IsEnumericChar( const SwTxtNode& rNd ) const return USHRT_MAX != GetDigitLevel( rNd, nBlnks ); } -bool SwAutoFormat::IsBlanksInString( const SwTxtNode& rNd ) +bool SwAutoFormat::IsBlanksInString( const SwTextNode& rNd ) { // Search more than 5 consecutive blanks/tabs in the string. - OUString sTmp( DelLeadingBlanks(rNd.GetTxt()) ); + OUString sTmp( DelLeadingBlanks(rNd.GetText()) ); const sal_Int32 nLen = sTmp.getLength(); sal_Int32 nIdx = 0; while (nIdx < nLen) @@ -426,28 +426,28 @@ bool SwAutoFormat::IsBlanksInString( const SwTxtNode& rNd ) return false; } -sal_uInt16 SwAutoFormat::CalcLevel( const SwTxtNode& rNd, sal_uInt16 *pDigitLvl ) const +sal_uInt16 SwAutoFormat::CalcLevel( const SwTextNode& rNd, sal_uInt16 *pDigitLvl ) const { sal_uInt16 nLvl = 0, nBlnk = 0; - const OUString& rTxt = rNd.GetTxt(); + const OUString& rText = rNd.GetText(); if( pDigitLvl ) *pDigitLvl = USHRT_MAX; - if( RES_POOLCOLL_TEXT_MOVE == rNd.GetTxtColl()->GetPoolFmtId() ) + if( RES_POOLCOLL_TEXT_MOVE == rNd.GetTextColl()->GetPoolFormatId() ) { - if( m_aFlags.bAFmtByInput ) + if( m_aFlags.bAFormatByInput ) { - nLvl = rNd.GetAutoFmtLvl(); - const_cast<SwTxtNode&>(rNd).SetAutoFmtLvl( 0 ); + nLvl = rNd.GetAutoFormatLvl(); + const_cast<SwTextNode&>(rNd).SetAutoFormatLvl( 0 ); if( nLvl ) return nLvl; } ++nLvl; } - for (sal_Int32 n = 0, nEnd = rTxt.getLength(); n < nEnd; ++n) + for (sal_Int32 n = 0, nEnd = rText.getLength(); n < nEnd; ++n) { - switch (rTxt[n]) + switch (rText[n]) { case ' ': if( 3 == ++nBlnk ) ++nLvl, nBlnk = 0; @@ -466,12 +466,12 @@ sal_uInt16 SwAutoFormat::CalcLevel( const SwTxtNode& rNd, sal_uInt16 *pDigitLvl sal_Int32 SwAutoFormat::GetBigIndent( sal_Int32& rAktSpacePos ) const { - SwTxtFrmInfo aFInfo( GetFrm( *m_pCurTxtNd ) ); - const SwTxtFrm* pNxtFrm = 0; + SwTextFrmInfo aFInfo( GetFrm( *m_pCurTextNd ) ); + const SwTextFrm* pNxtFrm = 0; if( !m_bMoreLines ) { - const SwTxtNode* pNxtNd = GetNextNode(); + const SwTextNode* pNxtNd = GetNextNode(); if( !CanJoin( pNxtNd ) || !IsOneLine( *pNxtNd ) ) return 0; @@ -481,9 +481,9 @@ sal_Int32 SwAutoFormat::GetBigIndent( sal_Int32& rAktSpacePos ) const return aFInfo.GetBigIndent( rAktSpacePos, pNxtFrm ); } -bool SwAutoFormat::IsNoAlphaLine( const SwTxtNode& rNd ) const +bool SwAutoFormat::IsNoAlphaLine( const SwTextNode& rNd ) const { - const OUString& rStr = rNd.GetTxt(); + const OUString& rStr = rNd.GetText(); if( rStr.isEmpty() ) return false; // or better: determine via number of AlphaNum and !AlphaNum characters @@ -507,13 +507,13 @@ bool SwAutoFormat::DoUnderline() if( !m_aFlags.bSetBorder ) return false; - OUString const& rTxt(m_pCurTxtNd->GetTxt()); + OUString const& rText(m_pCurTextNd->GetText()); int eState = 0; sal_Int32 nCnt = 0; - while (nCnt < rTxt.getLength()) + while (nCnt < rText.getLength()) { int eTmp = 0; - switch (rTxt[nCnt]) + switch (rText[nCnt]) { case '-': eTmp = 1; break; case '_': eTmp = 2; break; @@ -584,11 +584,11 @@ bool SwAutoFormat::DoUnderline() bool SwAutoFormat::DoTable() { - if( !m_aFlags.bCreateTable || !m_aFlags.bAFmtByInput || - m_pCurTxtNd->FindTableNode() ) + if( !m_aFlags.bCreateTable || !m_aFlags.bAFormatByInput || + m_pCurTextNd->FindTableNode() ) return false; - const OUString& rTmp = m_pCurTxtNd->GetTxt(); + const OUString& rTmp = m_pCurTextNd->GetText(); sal_Int32 nSttPlus = GetLeadingBlanks( rTmp ); sal_Int32 nEndPlus = GetTrailingBlanks( rTmp ); sal_Unicode cChar; @@ -598,7 +598,7 @@ bool SwAutoFormat::DoTable() ( '+' != ( cChar = rTmp[nEndPlus - 1]) && '|' != cChar )) return false; - SwTxtFrmInfo aInfo( m_pCurTxtFrm ); + SwTextFrmInfo aInfo( m_pCurTextFrm ); sal_Int32 n = nSttPlus; std::vector<sal_uInt16> aPosArr; @@ -632,7 +632,7 @@ bool SwAutoFormat::DoTable() sal_uInt16 nColCnt = aPosArr.size() - 1; SwTwips nSttPos = aPosArr[ 0 ]; sal_Int16 eHori; - switch( m_pCurTxtNd->GetSwAttrSet().GetAdjust().GetAdjust() ) + switch( m_pCurTextNd->GetSwAttrSet().GetAdjust().GetAdjust() ) { case SVX_ADJUST_CENTER: eHori = text::HoriOrientation::CENTER; break; case SVX_ADJUST_RIGHT: eHori = text::HoriOrientation::RIGHT; break; @@ -642,7 +642,7 @@ bool SwAutoFormat::DoTable() { eHori = text::HoriOrientation::NONE; // then - as last - we need to add the current frame width into the array - aPosArr.push_back( static_cast<sal_uInt16>(m_pCurTxtFrm->Frm().Width()) ); + aPosArr.push_back( static_cast<sal_uInt16>(m_pCurTextFrm->Frm().Width()) ); } else eHori = text::HoriOrientation::LEFT; @@ -705,15 +705,15 @@ sal_Int32 SwAutoFormat::GetTrailingBlanks( const OUString& rStr ) return ++n; } -bool SwAutoFormat::IsFirstCharCapital( const SwTxtNode& rNd ) const +bool SwAutoFormat::IsFirstCharCapital( const SwTextNode& rNd ) const { - const OUString& rTxt = rNd.GetTxt(); - for( sal_Int32 n = 0, nEnd = rTxt.getLength(); n < nEnd; ++n ) - if (!IsSpace(rTxt[n])) + const OUString& rText = rNd.GetText(); + for( sal_Int32 n = 0, nEnd = rText.getLength(); n < nEnd; ++n ) + if (!IsSpace(rText[n])) { CharClass& rCC = GetCharClass( rNd.GetSwAttrSet(). GetLanguage().GetLanguage() ); - sal_Int32 nCharType = rCC.getCharacterType( rTxt, n ); + sal_Int32 nCharType = rCC.getCharacterType( rText, n ); return CharClass::isLetterType( nCharType ) && 0 != ( i18n::KCharacterType::UPPER & nCharType ); @@ -721,11 +721,11 @@ bool SwAutoFormat::IsFirstCharCapital( const SwTxtNode& rNd ) const return false; } -sal_uInt16 SwAutoFormat::GetDigitLevel( const SwTxtNode& rNd, sal_Int32& rPos, +sal_uInt16 SwAutoFormat::GetDigitLevel( const SwTextNode& rNd, sal_Int32& rPos, OUString* pPrefix, OUString* pPostfix, OUString* pNumTypes ) const { // check for 1.) / 1. / 1.1.1 / (1). / (1) / .... - const OUString& rTxt = rNd.GetTxt(); + const OUString& rText = rNd.GetText(); sal_Int32 nPos = rPos; int eScan = NONE; @@ -737,9 +737,9 @@ sal_uInt16 SwAutoFormat::GetDigitLevel( const SwTxtNode& rNd, sal_Int32& rPos, CharClass& rCC = GetCharClass( rNd.GetSwAttrSet().GetLanguage().GetLanguage() ); - while (nPos < rTxt.getLength() && nDigitLvl < MAXLEVEL - 1) + while (nPos < rText.getLength() && nDigitLvl < MAXLEVEL - 1) { - const sal_Unicode cCurrentChar = rTxt[nPos]; + const sal_Unicode cCurrentChar = rText[nPos]; if( ('0' <= cCurrentChar && '9' >= cCurrentChar) || (0xff10 <= cCurrentChar && 0xff19 >= cCurrentChar) ) { @@ -771,12 +771,12 @@ sal_uInt16 SwAutoFormat::GetDigitLevel( const SwTxtNode& rNd, sal_Int32& rPos, nStart *= 10; nStart += cCurrentChar <= '9' ? cCurrentChar - '0' : cCurrentChar - 0xff10; } - else if( rCC.isAlpha( rTxt, nPos ) ) + else if( rCC.isAlpha( rText, nPos ) ) { bool bIsUpper = 0 != ( i18n::KCharacterType::UPPER & - rCC.getCharacterType( rTxt, nPos )); - sal_Unicode cLow = rCC.lowercase(rTxt, nPos, 1)[0], cNumTyp; + rCC.getCharacterType( rText, nPos )); + sal_Unicode cLow = rCC.lowercase(rText, nPos, 1)[0], cNumTyp; int eTmpScan; // Roman numbers are "mdclxvi". Since we want to start numbering with c or d more often, @@ -927,9 +927,9 @@ CHECK_ROMAN_5: nClosingParentheses++; // only if no numbers were read until here if( pPrefix && !( eScan & ( NO_DELIM | CHG )) ) - *pPrefix += OUString(rTxt[nPos]); + *pPrefix += OUString(rText[nPos]); else if( pPostfix ) - *pPostfix += OUString(rTxt[nPos]); + *pPostfix += OUString(rText[nPos]); if( NO_DELIM & eScan ) { @@ -947,7 +947,7 @@ CHECK_ROMAN_5: ++nPos; } if( !( CHG & eScan ) || rPos == nPos || - nPos == rTxt.getLength() || !IsSpace(rTxt[nPos]) || + nPos == rText.getLength() || !IsSpace(rText[nPos]) || (nOpeningParentheses > nClosingParentheses)) return USHRT_MAX; @@ -962,7 +962,7 @@ void SwAutoFormat::SetColl( sal_uInt16 nId, bool bHdLineOrText ) { m_aDelPam.DeleteMark(); m_aDelPam.GetPoint()->nNode = m_aNdIdx; - m_aDelPam.GetPoint()->nContent.Assign( m_pCurTxtNd, 0 ); + m_aDelPam.GetPoint()->nContent.Assign( m_pCurTextNd, 0 ); // keep hard tabs, alignment, language, hyphenation, DropCaps and nearly all frame attributes SfxItemSet aSet( m_pDoc->GetAttrPool(), @@ -972,9 +972,9 @@ void SwAutoFormat::SetColl( sal_uInt16 nId, bool bHdLineOrText ) RES_BACKGROUND, RES_SHADOW, 0 ); - if( m_pCurTxtNd->HasSwAttrSet() ) + if( m_pCurTextNd->HasSwAttrSet() ) { - aSet.Put( *m_pCurTxtNd->GetpSwAttrSet() ); + aSet.Put( *m_pCurTextNd->GetpSwAttrSet() ); // take HeaderLine/TextBody only if centered or right aligned, otherwise only justification SvxAdjustItem const * pAdj; if( SfxItemState::SET == aSet.GetItemState( RES_PARATR_ADJUST, @@ -988,7 +988,7 @@ void SwAutoFormat::SetColl( sal_uInt16 nId, bool bHdLineOrText ) } } - m_pDoc->SetTxtFmtCollByAutoFmt( *m_aDelPam.GetPoint(), nId, &aSet ); + m_pDoc->SetTextFormatCollByAutoFormat( *m_aDelPam.GetPoint(), nId, &aSet ); } bool SwAutoFormat::HasSelBlanks( SwPaM& rPam ) @@ -997,17 +997,17 @@ bool SwAutoFormat::HasSelBlanks( SwPaM& rPam ) // Do not delete it, it will be inserted again. SwPosition * pPos = rPam.End(); sal_Int32 nBlnkPos = pPos->nContent.GetIndex(); - SwTxtNode* pTxtNd = pPos->nNode.GetNode().GetTxtNode(); - if (nBlnkPos && nBlnkPos-- < pTxtNd->GetTxt().getLength() && - (' ' == pTxtNd->GetTxt()[nBlnkPos])) + SwTextNode* pTextNd = pPos->nNode.GetNode().GetTextNode(); + if (nBlnkPos && nBlnkPos-- < pTextNd->GetText().getLength() && + (' ' == pTextNd->GetText()[nBlnkPos])) --pPos->nContent; else { pPos = rPam.GetPoint() == pPos ? rPam.GetMark() : rPam.GetPoint(); nBlnkPos = pPos->nContent.GetIndex(); - pTxtNd = pPos->nNode.GetNode().GetTxtNode(); - if (nBlnkPos < pTxtNd->GetTxt().getLength() && - (' ' == pTxtNd->GetTxt()[nBlnkPos])) + pTextNd = pPos->nNode.GetNode().GetTextNode(); + if (nBlnkPos < pTextNd->GetText().getLength() && + (' ' == pTextNd->GetText()[nBlnkPos])) ++pPos->nContent; else return false; @@ -1015,28 +1015,28 @@ bool SwAutoFormat::HasSelBlanks( SwPaM& rPam ) return true; } -bool SwAutoFormat::HasBreakAttr( const SwTxtNode& rTxtNd ) +bool SwAutoFormat::HasBreakAttr( const SwTextNode& rTextNd ) { - const SfxItemSet* pSet = rTxtNd.GetpSwAttrSet(); + const SfxItemSet* pSet = rTextNd.GetpSwAttrSet(); if( !pSet ) return false; const SfxPoolItem* pItem; if( SfxItemState::SET == pSet->GetItemState( RES_BREAK, false, &pItem ) - && SVX_BREAK_NONE != static_cast<const SvxFmtBreakItem*>(pItem)->GetBreak() ) + && SVX_BREAK_NONE != static_cast<const SvxFormatBreakItem*>(pItem)->GetBreak() ) return true; if( SfxItemState::SET == pSet->GetItemState( RES_PAGEDESC, false, &pItem ) - && static_cast<const SwFmtPageDesc*>(pItem)->GetPageDesc() - && nsUseOnPage::PD_NONE != static_cast<const SwFmtPageDesc*>(pItem)->GetPageDesc()->GetUseOn() ) + && static_cast<const SwFormatPageDesc*>(pItem)->GetPageDesc() + && nsUseOnPage::PD_NONE != static_cast<const SwFormatPageDesc*>(pItem)->GetPageDesc()->GetUseOn() ) return true; return false; } /// Is there a dot at the end? -bool SwAutoFormat::IsSentenceAtEnd( const SwTxtNode& rTxtNd ) +bool SwAutoFormat::IsSentenceAtEnd( const SwTextNode& rTextNd ) { - const OUString& rStr = rTxtNd.GetTxt(); + const OUString& rStr = rTextNd.GetText(); sal_Int32 n = rStr.getLength(); if( !n ) return true; @@ -1049,27 +1049,27 @@ bool SwAutoFormat::IsSentenceAtEnd( const SwTxtNode& rTxtNd ) /// Delete beginning and/or end in a node void SwAutoFormat::DeleteCurrentParagraph( bool bStart, bool bEnd ) { - if( m_aFlags.bAFmtByInput - ? m_aFlags.bAFmtByInpDelSpacesAtSttEnd - : m_aFlags.bAFmtDelSpacesAtSttEnd ) + if( m_aFlags.bAFormatByInput + ? m_aFlags.bAFormatByInpDelSpacesAtSttEnd + : m_aFlags.bAFormatDelSpacesAtSttEnd ) { // delete blanks at the end of the current and at the beginning of the next one m_aDelPam.DeleteMark(); m_aDelPam.GetPoint()->nNode = m_aNdIdx; sal_Int32 nPos(0); - if( bStart && 0 != ( nPos = GetLeadingBlanks( m_pCurTxtNd->GetTxt() ))) + if( bStart && 0 != ( nPos = GetLeadingBlanks( m_pCurTextNd->GetText() ))) { - m_aDelPam.GetPoint()->nContent.Assign( m_pCurTxtNd, 0 ); + m_aDelPam.GetPoint()->nContent.Assign( m_pCurTextNd, 0 ); m_aDelPam.SetMark(); m_aDelPam.GetPoint()->nContent = nPos; DeleteSel( m_aDelPam ); m_aDelPam.DeleteMark(); } - if (bEnd && m_pCurTxtNd->GetTxt().getLength() != - ( nPos = GetTrailingBlanks( m_pCurTxtNd->GetTxt() )) ) + if (bEnd && m_pCurTextNd->GetText().getLength() != + ( nPos = GetTrailingBlanks( m_pCurTextNd->GetText() )) ) { m_aDelPam.GetPoint()->nContent.Assign( - m_pCurTxtNd, m_pCurTxtNd->GetTxt().getLength()); + m_pCurTextNd, m_pCurTextNd->GetText().getLength()); m_aDelPam.SetMark(); m_aDelPam.GetPoint()->nContent = nPos; DeleteSel( m_aDelPam ); @@ -1084,7 +1084,7 @@ void SwAutoFormat::DeleteSel( SwPaM& rDelPam ) { // Add to Shell-Cursor-Ring so that DelPam will be moved as well! SwPaM* pShCrsr = m_pEditShell->_GetCrsr(); - SwPaM aTmp( *m_pCurTxtNd, 0, pShCrsr ); + SwPaM aTmp( *m_pCurTextNd, 0, pShCrsr ); SwPaM* pPrev = rDelPam.GetPrev(); rDelPam.GetRingContainer().merge( pShCrsr->GetRingContainer() ); @@ -1101,7 +1101,7 @@ void SwAutoFormat::DeleteSel( SwPaM& rDelPam ) } while( p != pPrev ); m_aNdIdx = aTmp.GetPoint()->nNode; - m_pCurTxtNd = m_aNdIdx.GetNode().GetTxtNode(); + m_pCurTextNd = m_aNdIdx.GetNode().GetTextNode(); } else m_pEditShell->DeleteSel( rDelPam ); @@ -1112,17 +1112,17 @@ bool SwAutoFormat::DeleteCurNxtPara( const OUString& rNxtPara ) // delete blanks at the end of the current and at the beginning of the next one m_aDelPam.DeleteMark(); m_aDelPam.GetPoint()->nNode = m_aNdIdx; - m_aDelPam.GetPoint()->nContent.Assign( m_pCurTxtNd, - GetTrailingBlanks( m_pCurTxtNd->GetTxt() ) ); + m_aDelPam.GetPoint()->nContent.Assign( m_pCurTextNd, + GetTrailingBlanks( m_pCurTextNd->GetText() ) ); m_aDelPam.SetMark(); ++m_aDelPam.GetPoint()->nNode; - SwTxtNode* pTNd = m_aDelPam.GetNode().GetTxtNode(); + SwTextNode* pTNd = m_aDelPam.GetNode().GetTextNode(); if( !pTNd ) { // then delete only up to end of the paragraph --m_aDelPam.GetPoint()->nNode; - m_aDelPam.GetPoint()->nContent = m_pCurTxtNd->GetTxt().getLength(); + m_aDelPam.GetPoint()->nContent = m_pCurTextNd->GetText().getLength(); } else m_aDelPam.GetPoint()->nContent.Assign( pTNd, @@ -1141,24 +1141,24 @@ bool SwAutoFormat::DeleteCurNxtPara( const OUString& rNxtPara ) void SwAutoFormat::DelEmptyLine( bool bTstNextPara ) { - SetRedlineTxt( STR_AUTOFMTREDL_DEL_EMPTY_PARA ); + SetRedlineText( STR_AUTOFMTREDL_DEL_EMPTY_PARA ); // delete blanks in empty paragraph m_aDelPam.DeleteMark(); m_aDelPam.GetPoint()->nNode = m_aNdIdx; m_aDelPam.GetPoint()->nContent.Assign( - m_pCurTxtNd, m_pCurTxtNd->GetTxt().getLength() ); + m_pCurTextNd, m_pCurTextNd->GetText().getLength() ); m_aDelPam.SetMark(); --m_aDelPam.GetMark()->nNode; - SwTxtNode* pTNd = m_aDelPam.GetNode( false ).GetTxtNode(); + SwTextNode* pTNd = m_aDelPam.GetNode( false ).GetTextNode(); if( pTNd ) // first use the previous text node - m_aDelPam.GetMark()->nContent.Assign(pTNd, pTNd->GetTxt().getLength()); + m_aDelPam.GetMark()->nContent.Assign(pTNd, pTNd->GetText().getLength()); else if( bTstNextPara ) { // then try the next (at the beginning of a Doc, table cells, borders, ...) m_aDelPam.GetMark()->nNode += 2; - pTNd = m_aDelPam.GetNode( false ).GetTxtNode(); + pTNd = m_aDelPam.GetNode( false ).GetTextNode(); if( pTNd ) { m_aDelPam.GetMark()->nContent.Assign( pTNd, 0 ); @@ -1169,28 +1169,28 @@ void SwAutoFormat::DelEmptyLine( bool bTstNextPara ) { m_aDelPam.GetMark()->nNode = m_aNdIdx; m_aDelPam.GetMark()->nContent = 0; - pTNd = m_pCurTxtNd; + pTNd = m_pCurTextNd; } if( pTNd ) DeleteSel( m_aDelPam ); m_aDelPam.DeleteMark(); - ClearRedlineTxt(); + ClearRedlineText(); } void SwAutoFormat::DelMoreLinesBlanks( bool bWithLineBreaks ) { - if( m_aFlags.bAFmtByInput - ? m_aFlags.bAFmtByInpDelSpacesBetweenLines - : m_aFlags.bAFmtDelSpacesBetweenLines ) + if( m_aFlags.bAFormatByInput + ? m_aFlags.bAFormatByInpDelSpacesBetweenLines + : m_aFlags.bAFormatDelSpacesBetweenLines ) { // delete all blanks on the left and right of the indentation m_aDelPam.DeleteMark(); m_aDelPam.GetPoint()->nNode = m_aNdIdx; - m_aDelPam.GetPoint()->nContent.Assign( m_pCurTxtNd, 0 ); + m_aDelPam.GetPoint()->nContent.Assign( m_pCurTextNd, 0 ); - SwTxtFrmInfo aFInfo( m_pCurTxtFrm ); - aFInfo.GetSpaces( m_aDelPam, !m_aFlags.bAFmtByInput || bWithLineBreaks ); + SwTextFrmInfo aFInfo( m_pCurTextFrm ); + aFInfo.GetSpaces( m_aDelPam, !m_aFlags.bAFormatByInput || bWithLineBreaks ); do { SwPaM* pNxt = m_aDelPam.GetNext(); @@ -1218,15 +1218,15 @@ void SwAutoFormat::DelPrevPara() { m_aDelPam.DeleteMark(); m_aDelPam.GetPoint()->nNode = m_aNdIdx; - m_aDelPam.GetPoint()->nContent.Assign( m_pCurTxtNd, 0 ); + m_aDelPam.GetPoint()->nContent.Assign( m_pCurTextNd, 0 ); m_aDelPam.SetMark(); --m_aDelPam.GetPoint()->nNode; - SwTxtNode* pTNd = m_aDelPam.GetNode().GetTxtNode(); + SwTextNode* pTNd = m_aDelPam.GetNode().GetTextNode(); if( pTNd ) { // use the previous text node first - m_aDelPam.GetPoint()->nContent.Assign(pTNd, pTNd->GetTxt().getLength()); + m_aDelPam.GetPoint()->nContent.Assign(pTNd, pTNd->GetText().getLength()); DeleteSel( m_aDelPam ); } m_aDelPam.DeleteMark(); @@ -1234,28 +1234,28 @@ void SwAutoFormat::DelPrevPara() void SwAutoFormat::BuildIndent() { - SetRedlineTxt( STR_AUTOFMTREDL_SET_TMPL_INDENT ); + SetRedlineText( STR_AUTOFMTREDL_SET_TMPL_INDENT ); // read all succeeding paragraphs that belong to this indentation bool bBreak = true; if( m_bMoreLines ) DelMoreLinesBlanks( true ); else - bBreak = !IsFastFullLine( *m_pCurTxtNd ) || - IsBlanksInString( *m_pCurTxtNd ) || - IsSentenceAtEnd( *m_pCurTxtNd ); + bBreak = !IsFastFullLine( *m_pCurTextNd ) || + IsBlanksInString( *m_pCurTextNd ) || + IsSentenceAtEnd( *m_pCurTextNd ); SetColl( RES_POOLCOLL_TEXT_IDENT ); if( !bBreak ) { - SetRedlineTxt( STR_AUTOFMTREDL_DEL_MORELINES ); - const SwTxtNode* pNxtNd = GetNextNode(); + SetRedlineText( STR_AUTOFMTREDL_DEL_MORELINES ); + const SwTextNode* pNxtNd = GetNextNode(); if( pNxtNd && !m_bEnd ) { do { bBreak = !IsFastFullLine( *pNxtNd ) || IsBlanksInString( *pNxtNd ) || IsSentenceAtEnd( *pNxtNd ); - if( DeleteCurNxtPara( pNxtNd->GetTxt() )) + if( DeleteCurNxtPara( pNxtNd->GetText() )) { m_pDoc->getIDocumentContentOperations().InsertString( m_aDelPam, OUString(' ') ); } @@ -1272,30 +1272,30 @@ void SwAutoFormat::BuildIndent() void SwAutoFormat::BuildTextIndent() { - SetRedlineTxt( STR_AUTOFMTREDL_SET_TMPL_TEXT_INDENT); + SetRedlineText( STR_AUTOFMTREDL_SET_TMPL_TEXT_INDENT); // read all succeeding paragraphs that belong to this indentation bool bBreak = true; if( m_bMoreLines ) DelMoreLinesBlanks( true ); else - bBreak = !IsFastFullLine( *m_pCurTxtNd ) || - IsBlanksInString( *m_pCurTxtNd ) || - IsSentenceAtEnd( *m_pCurTxtNd ); + bBreak = !IsFastFullLine( *m_pCurTextNd ) || + IsBlanksInString( *m_pCurTextNd ) || + IsSentenceAtEnd( *m_pCurTextNd ); - if( m_aFlags.bAFmtByInput ) - m_pCurTxtNd->SetAutoFmtLvl( (sal_uInt8)CalcLevel( *m_pCurTxtNd ) ); + if( m_aFlags.bAFormatByInput ) + m_pCurTextNd->SetAutoFormatLvl( (sal_uInt8)CalcLevel( *m_pCurTextNd ) ); SetColl( RES_POOLCOLL_TEXT_MOVE ); if( !bBreak ) { - SetRedlineTxt( STR_AUTOFMTREDL_DEL_MORELINES ); - const SwTxtNode* pNxtNd = GetNextNode(); + SetRedlineText( STR_AUTOFMTREDL_DEL_MORELINES ); + const SwTextNode* pNxtNd = GetNextNode(); while( CanJoin( pNxtNd ) && CalcLevel( *pNxtNd ) ) { bBreak = !IsFastFullLine( *pNxtNd ) || IsBlanksInString( *pNxtNd ) || IsSentenceAtEnd( *pNxtNd ); - if( DeleteCurNxtPara( pNxtNd->GetTxt() ) ) + if( DeleteCurNxtPara( pNxtNd->GetText() ) ) { m_pDoc->getIDocumentContentOperations().InsertString( m_aDelPam, OUString(' ') ); } @@ -1310,32 +1310,32 @@ void SwAutoFormat::BuildTextIndent() void SwAutoFormat::BuildText() { - SetRedlineTxt( STR_AUTOFMTREDL_SET_TMPL_TEXT ); + SetRedlineText( STR_AUTOFMTREDL_SET_TMPL_TEXT ); // read all succeeding paragraphs that belong to this text without indentation bool bBreak = true; if( m_bMoreLines ) DelMoreLinesBlanks(); else - bBreak = !IsFastFullLine( *m_pCurTxtNd ) || - IsBlanksInString( *m_pCurTxtNd ) || - IsSentenceAtEnd( *m_pCurTxtNd ); + bBreak = !IsFastFullLine( *m_pCurTextNd ) || + IsBlanksInString( *m_pCurTextNd ) || + IsSentenceAtEnd( *m_pCurTextNd ); SetColl( RES_POOLCOLL_TEXT, true ); if( !bBreak ) { - SetRedlineTxt( STR_AUTOFMTREDL_DEL_MORELINES ); - const SwTxtNode* pNxtNd = GetNextNode(); + SetRedlineText( STR_AUTOFMTREDL_DEL_MORELINES ); + const SwTextNode* pNxtNd = GetNextNode(); while( CanJoin( pNxtNd ) && !CalcLevel( *pNxtNd ) ) { bBreak = !IsFastFullLine( *pNxtNd ) || IsBlanksInString( *pNxtNd ) || IsSentenceAtEnd( *pNxtNd ); - if( DeleteCurNxtPara( pNxtNd->GetTxt() ) ) + if( DeleteCurNxtPara( pNxtNd->GetText() ) ) { m_pDoc->getIDocumentContentOperations().InsertString( m_aDelPam, OUString(' ') ); } if( bBreak ) break; - const SwTxtNode* pCurrNode = pNxtNd; + const SwTextNode* pCurrNode = pNxtNd; pNxtNd = GetNextNode(); if(!pNxtNd || pCurrNode == pNxtNd) break; @@ -1347,32 +1347,32 @@ void SwAutoFormat::BuildText() void SwAutoFormat::BuildEnum( sal_uInt16 nLvl, sal_uInt16 nDigitLevel ) { - SetRedlineTxt( STR_AUTOFMTREDL_SET_NUMBULET ); + SetRedlineText( STR_AUTOFMTREDL_SET_NUMBULET ); bool bBreak = true; // first, determine current indentation and frame width - SwTwips nFrmWidth = m_pCurTxtFrm->Prt().Width();; - SwTwips nLeftTxtPos; + SwTwips nFrmWidth = m_pCurTextFrm->Prt().Width();; + SwTwips nLeftTextPos; { sal_Int32 nPos(0); - while (nPos < m_pCurTxtNd->GetTxt().getLength() && - IsSpace(m_pCurTxtNd->GetTxt()[nPos])) + while (nPos < m_pCurTextNd->GetText().getLength() && + IsSpace(m_pCurTextNd->GetText()[nPos])) { ++nPos; } - SwTxtFrmInfo aInfo( m_pCurTxtFrm ); - nLeftTxtPos = aInfo.GetCharPos(nPos); - nLeftTxtPos -= m_pCurTxtNd->GetSwAttrSet().GetLRSpace().GetLeft(); + SwTextFrmInfo aInfo( m_pCurTextFrm ); + nLeftTextPos = aInfo.GetCharPos(nPos); + nLeftTextPos -= m_pCurTextNd->GetSwAttrSet().GetLRSpace().GetLeft(); } if( m_bMoreLines ) DelMoreLinesBlanks(); else - bBreak = !IsFastFullLine( *m_pCurTxtNd ) || - IsBlanksInString( *m_pCurTxtNd ) || - IsSentenceAtEnd( *m_pCurTxtNd ); + bBreak = !IsFastFullLine( *m_pCurTextNd ) || + IsBlanksInString( *m_pCurTextNd ) || + IsSentenceAtEnd( *m_pCurTextNd ); bool bRTL = m_pEditShell->IsInRightToLeftText(); DeleteCurrentParagraph( true, true ); @@ -1385,27 +1385,27 @@ void SwAutoFormat::BuildEnum( sal_uInt16 nLvl, sal_uInt16 nDigitLevel ) numfunc::GetDefaultPositionAndSpaceMode() ); const SwNumRule* pCur = 0; - if( m_aFlags.bSetNumRule && 0 != (pCur = m_pCurTxtNd->GetNumRule()) ) + if( m_aFlags.bSetNumRule && 0 != (pCur = m_pCurTextNd->GetNumRule()) ) aRule = *pCur; // replace bullet character with defined one - const OUString& rStr = m_pCurTxtNd->GetTxt(); - sal_Int32 nTxtStt = 0; + const OUString& rStr = m_pCurTextNd->GetText(); + sal_Int32 nTextStt = 0; const sal_Unicode* pFndBulletChr; if( m_aFlags.bChgEnumNum && 2 < rStr.getLength() && - 0 != ( pFndBulletChr = StrChr( pBulletChar, rStr[ nTxtStt ] )) - && IsSpace( rStr[ nTxtStt + 1 ] ) ) + 0 != ( pFndBulletChr = StrChr( pBulletChar, rStr[ nTextStt ] )) + && IsSpace( rStr[ nTextStt + 1 ] ) ) { - if( m_aFlags.bAFmtByInput ) + if( m_aFlags.bAFormatByInput ) { if( m_aFlags.bSetNumRule ) { - SwCharFmt* pCFmt = m_pDoc->getIDocumentStylePoolAccess().GetCharFmtFromPool( + SwCharFormat* pCFormat = m_pDoc->getIDocumentStylePoolAccess().GetCharFormatFromPool( RES_POOLCHR_BUL_LEVEL ); bChgBullet = true; // Was the format already somewhere adjusted? - if( !aRule.GetNumFmt( nLvl ) ) + if( !aRule.GetNumFormat( nLvl ) ) { int nBulletPos = pFndBulletChr - pBulletChar; sal_Unicode cBullChar; @@ -1430,29 +1430,29 @@ void SwAutoFormat::BuildEnum( sal_uInt16 nLvl, sal_uInt16 nDigitLevel ) sal_uInt16 nAbsPos = lBullIndent; sal_uInt16 nSpaceSteps = nLvl - ? sal_uInt16(nLeftTxtPos / nLvl) + ? sal_uInt16(nLeftTextPos / nLvl) : lBullIndent; for( sal_uInt8 n = 0; n < MAXLEVEL; ++n, nAbsPos = nAbsPos + nSpaceSteps ) { - SwNumFmt aFmt( aRule.Get( n ) ); - aFmt.SetBulletFont( pBullFnt ); - aFmt.SetBulletChar( cBullChar ); - aFmt.SetNumberingType(SVX_NUM_CHAR_SPECIAL); + SwNumFormat aFormat( aRule.Get( n ) ); + aFormat.SetBulletFont( pBullFnt ); + aFormat.SetBulletChar( cBullChar ); + aFormat.SetNumberingType(SVX_NUM_CHAR_SPECIAL); // #i93908# clear suffix for bullet lists - aFmt.SetPrefix(OUString()); - aFmt.SetSuffix(OUString()); - aFmt.SetFirstLineOffset( lBullFirstLineOffset ); - aFmt.SetAbsLSpace( nAbsPos ); - if( !aFmt.GetCharFmt() ) - aFmt.SetCharFmt( pCFmt ); + aFormat.SetPrefix(OUString()); + aFormat.SetSuffix(OUString()); + aFormat.SetFirstLineOffset( lBullFirstLineOffset ); + aFormat.SetAbsLSpace( nAbsPos ); + if( !aFormat.GetCharFormat() ) + aFormat.SetCharFormat( pCFormat ); if( bRTL ) - aFmt.SetNumAdjust( SVX_ADJUST_RIGHT ); + aFormat.SetNumAdjust( SVX_ADJUST_RIGHT ); - aRule.Set( n, aFmt ); + aRule.Set( n, aFormat ); if( n == nLvl && nFrmWidth < ( nSpaceSteps * MAXLEVEL ) ) - nSpaceSteps = static_cast<sal_uInt16>(( nFrmWidth - nLeftTxtPos ) / + nSpaceSteps = static_cast<sal_uInt16>(( nFrmWidth - nLeftTextPos ) / ( MAXLEVEL - nLvl )); } } @@ -1472,14 +1472,14 @@ void SwAutoFormat::BuildEnum( sal_uInt16 nLvl, sal_uInt16 nDigitLevel ) // it is determined by the indentation level. OUString aPostfix, aPrefix, aNumTypes; - if( USHRT_MAX != ( nDigitLevel = GetDigitLevel( *m_pCurTxtNd, nTxtStt, + if( USHRT_MAX != ( nDigitLevel = GetDigitLevel( *m_pCurTextNd, nTextStt, &aPrefix, &aPostfix, &aNumTypes )) ) { bChgEnum = true; // Level 0 and Indentation, determine level by left indentation and default NumIndent - if( !nDigitLevel && nLeftTxtPos ) - nLvl = std::min( sal_uInt16( nLeftTxtPos / lNumIndent ), + if( !nDigitLevel && nLeftTextPos ) + nLvl = std::min( sal_uInt16( nLeftTextPos / lNumIndent ), sal_uInt16( MAXLEVEL - 1 ) ); else nLvl = nDigitLevel; @@ -1489,73 +1489,73 @@ void SwAutoFormat::BuildEnum( sal_uInt16 nLvl, sal_uInt16 nDigitLevel ) { if( !pCur ) // adjust NumRule if it is new { - SwCharFmt* pCFmt = m_pDoc->getIDocumentStylePoolAccess().GetCharFmtFromPool( + SwCharFormat* pCFormat = m_pDoc->getIDocumentStylePoolAccess().GetCharFormatFromPool( RES_POOLCHR_NUM_LEVEL ); if( !nDigitLevel ) { - SwNumFmt aFmt( aRule.Get( nLvl ) ); - aFmt.SetStart( static_cast<sal_uInt16>(aPrefix.getToken( 1, + SwNumFormat aFormat( aRule.Get( nLvl ) ); + aFormat.SetStart( static_cast<sal_uInt16>(aPrefix.getToken( 1, (sal_Unicode)1 ).toInt32())); - aFmt.SetPrefix( aPrefix.getToken( 0, (sal_Unicode)1 )); - aFmt.SetSuffix( aPostfix.getToken( 0, (sal_Unicode)1 )); - aFmt.SetIncludeUpperLevels( 0 ); + aFormat.SetPrefix( aPrefix.getToken( 0, (sal_Unicode)1 )); + aFormat.SetSuffix( aPostfix.getToken( 0, (sal_Unicode)1 )); + aFormat.SetIncludeUpperLevels( 0 ); - if( !aFmt.GetCharFmt() ) - aFmt.SetCharFmt( pCFmt ); + if( !aFormat.GetCharFormat() ) + aFormat.SetCharFormat( pCFormat ); if( !aNumTypes.isEmpty() ) - aFmt.SetNumberingType(aNumTypes[ 0 ] - '0'); + aFormat.SetNumberingType(aNumTypes[ 0 ] - '0'); if( bRTL ) - aFmt.SetNumAdjust( SVX_ADJUST_RIGHT ); - aRule.Set( nLvl, aFmt ); + aFormat.SetNumAdjust( SVX_ADJUST_RIGHT ); + aRule.Set( nLvl, aFormat ); } else { - sal_uInt16 nSpaceSteps = nLvl ? sal_uInt16(nLeftTxtPos / nLvl) : 0; + sal_uInt16 nSpaceSteps = nLvl ? sal_uInt16(nLeftTextPos / nLvl) : 0; sal_uInt8 n; for( n = 0; n <= nLvl; ++n ) { - SwNumFmt aFmt( aRule.Get( n ) ); + SwNumFormat aFormat( aRule.Get( n ) ); - aFmt.SetStart( static_cast<sal_uInt16>(aPrefix.getToken( n+1, + aFormat.SetStart( static_cast<sal_uInt16>(aPrefix.getToken( n+1, (sal_Unicode)1 ).toInt32() )); if( !n ) - aFmt.SetPrefix( aPrefix.getToken( n, (sal_Unicode)1 )); - aFmt.SetSuffix( aPostfix.getToken( n, (sal_Unicode)1 )); - aFmt.SetIncludeUpperLevels( MAXLEVEL ); + aFormat.SetPrefix( aPrefix.getToken( n, (sal_Unicode)1 )); + aFormat.SetSuffix( aPostfix.getToken( n, (sal_Unicode)1 )); + aFormat.SetIncludeUpperLevels( MAXLEVEL ); if( n < aNumTypes.getLength() ) - aFmt.SetNumberingType((aNumTypes[ n ] - '0')); + aFormat.SetNumberingType((aNumTypes[ n ] - '0')); - aFmt.SetAbsLSpace( sal_uInt16( nSpaceSteps * n ) + aFormat.SetAbsLSpace( sal_uInt16( nSpaceSteps * n ) + lNumIndent ); - if( !aFmt.GetCharFmt() ) - aFmt.SetCharFmt( pCFmt ); + if( !aFormat.GetCharFormat() ) + aFormat.SetCharFormat( pCFormat ); if( bRTL ) - aFmt.SetNumAdjust( SVX_ADJUST_RIGHT ); + aFormat.SetNumAdjust( SVX_ADJUST_RIGHT ); - aRule.Set( n, aFmt ); + aRule.Set( n, aFormat ); } // Does it fit completely into the frame? bool bDefStep = nFrmWidth < (nSpaceSteps * MAXLEVEL); for( ; n < MAXLEVEL; ++n ) { - SwNumFmt aFmt( aRule.Get( n ) ); - aFmt.SetIncludeUpperLevels( MAXLEVEL ); + SwNumFormat aFormat( aRule.Get( n ) ); + aFormat.SetIncludeUpperLevels( MAXLEVEL ); if( bDefStep ) - aFmt.SetAbsLSpace( sal_uInt16( (nLeftTxtPos + + aFormat.SetAbsLSpace( sal_uInt16( (nLeftTextPos + SwNumRule::GetNumIndent(static_cast<sal_uInt8>(n-nLvl))))); else - aFmt.SetAbsLSpace( sal_uInt16( nSpaceSteps * n ) + aFormat.SetAbsLSpace( sal_uInt16( nSpaceSteps * n ) + lNumIndent ); - aRule.Set( n, aFmt ); + aRule.Set( n, aFormat ); } } } } - else if( !m_aFlags.bAFmtByInput ) + else if( !m_aFlags.bAFormatByInput ) SetColl( static_cast<sal_uInt16>(RES_POOLCOLL_NUM_LEVEL1 + ( std::min( nLvl, cnNumBullColls ) * 4 ) )); else bChgEnum = false; @@ -1568,34 +1568,34 @@ void SwAutoFormat::BuildEnum( sal_uInt16 nLvl, sal_uInt16 nDigitLevel ) if( m_aFlags.bSetNumRule ) { - if( m_aFlags.bAFmtByInput ) + if( m_aFlags.bAFormatByInput ) { m_aDelPam.SetMark(); ++m_aDelPam.GetMark()->nNode; - m_aDelPam.GetNode(false).GetTxtNode()->SetAttrListLevel( nLvl ); + m_aDelPam.GetNode(false).GetTextNode()->SetAttrListLevel( nLvl ); } - m_pCurTxtNd->SetAttrListLevel(nLvl); - m_pCurTxtNd->SetNumLSpace( true ); + m_pCurTextNd->SetAttrListLevel(nLvl); + m_pCurTextNd->SetNumLSpace( true ); // start new list m_pDoc->SetNumRule( m_aDelPam, aRule, true ); m_aDelPam.DeleteMark(); - m_aDelPam.GetPoint()->nContent.Assign( m_pCurTxtNd, 0 ); + m_aDelPam.GetPoint()->nContent.Assign( m_pCurTextNd, 0 ); } else - m_aDelPam.GetPoint()->nContent.Assign( m_pCurTxtNd, - bChgEnum ? nTxtStt : 0 ); + m_aDelPam.GetPoint()->nContent.Assign( m_pCurTextNd, + bChgEnum ? nTextStt : 0 ); m_aDelPam.SetMark(); if ( bChgBullet ) - nTxtStt += 2; + nTextStt += 2; - while( nTxtStt < rStr.getLength() && IsSpace( rStr[ nTxtStt ] )) - nTxtStt++; + while( nTextStt < rStr.getLength() && IsSpace( rStr[ nTextStt ] )) + nTextStt++; - m_aDelPam.GetPoint()->nContent = nTxtStt; + m_aDelPam.GetPoint()->nContent = nTextStt; DeleteSel( m_aDelPam ); if( !m_aFlags.bSetNumRule ) @@ -1605,7 +1605,7 @@ void SwAutoFormat::BuildEnum( sal_uInt16 nLvl, sal_uInt16 nDigitLevel ) sChgStr = OUString( m_aFlags.cBullet ) + sChgStr; m_pDoc->getIDocumentContentOperations().InsertString( m_aDelPam, sChgStr ); - SfxItemSet aSet( m_pDoc->GetAttrPool(), aTxtNodeSetRange ); + SfxItemSet aSet( m_pDoc->GetAttrPool(), aTextNodeSetRange ); if( bChgBullet ) { m_aDelPam.GetPoint()->nContent = 0; @@ -1618,7 +1618,7 @@ void SwAutoFormat::BuildEnum( sal_uInt16 nLvl, sal_uInt16 nDigitLevel ) m_aFlags.aBulletFont.GetPitch(), m_aFlags.aBulletFont.GetCharSet(), RES_CHRATR_FONT ) ); - m_pDoc->SetFmtItemByAutoFmt( m_aDelPam, aSet ); + m_pDoc->SetFormatItemByAutoFormat( m_aDelPam, aSet ); m_aDelPam.DeleteMark(); nAutoCorrPos = 2; aSet.ClearItem(); @@ -1626,7 +1626,7 @@ void SwAutoFormat::BuildEnum( sal_uInt16 nLvl, sal_uInt16 nDigitLevel ) SvxTabStopItem aTStops( RES_PARATR_TABSTOP ); aTStops.Insert( SvxTabStop( 0 ) ); aSet.Put( aTStops ); - m_pDoc->SetFmtItemByAutoFmt( m_aDelPam, aSet ); + m_pDoc->SetFormatItemByAutoFormat( m_aDelPam, aSet ); } } @@ -1636,20 +1636,20 @@ void SwAutoFormat::BuildEnum( sal_uInt16 nLvl, sal_uInt16 nDigitLevel ) return; } - const SwTxtNode* pNxtNd = GetNextNode(); + const SwTextNode* pNxtNd = GetNextNode(); while( CanJoin( pNxtNd ) && nLvl == CalcLevel( *pNxtNd ) ) { - SetRedlineTxt( STR_AUTOFMTREDL_DEL_MORELINES ); + SetRedlineText( STR_AUTOFMTREDL_DEL_MORELINES ); bBreak = !IsFastFullLine( *pNxtNd ) || IsBlanksInString( *pNxtNd ) || IsSentenceAtEnd( *pNxtNd ); - if( DeleteCurNxtPara( pNxtNd->GetTxt() ) ) + if( DeleteCurNxtPara( pNxtNd->GetText() ) ) { m_pDoc->getIDocumentContentOperations().InsertString( m_aDelPam, OUString(' ') ); } if( bBreak ) break; - const SwTxtNode* pCurrNode = pNxtNd; + const SwTextNode* pCurrNode = pNxtNd; pNxtNd = GetNextNode(); if(!pNxtNd || pCurrNode == pNxtNd) break; @@ -1660,27 +1660,27 @@ void SwAutoFormat::BuildEnum( sal_uInt16 nLvl, sal_uInt16 nDigitLevel ) void SwAutoFormat::BuildNegIndent( SwTwips nSpaces ) { - SetRedlineTxt( STR_AUTOFMTREDL_SET_TMPL_NEG_INDENT ); + SetRedlineText( STR_AUTOFMTREDL_SET_TMPL_NEG_INDENT ); // Test of contraposition (n words, divided by spaces/tabs, with same indentation in 2nd line) // read all succeeding paragraphs that belong to this enumeration bool bBreak = true; sal_Int32 nSpacePos = 0; - const sal_Int32 nTxtPos = GetBigIndent( nSpacePos ); + const sal_Int32 nTextPos = GetBigIndent( nSpacePos ); if( m_bMoreLines ) DelMoreLinesBlanks( true ); else - bBreak = !IsFastFullLine( *m_pCurTxtNd ) || - ( !nTxtPos && IsBlanksInString( *m_pCurTxtNd )) || - IsSentenceAtEnd( *m_pCurTxtNd ); + bBreak = !IsFastFullLine( *m_pCurTextNd ) || + ( !nTextPos && IsBlanksInString( *m_pCurTextNd )) || + IsSentenceAtEnd( *m_pCurTextNd ); - SetColl( static_cast<sal_uInt16>( nTxtPos + SetColl( static_cast<sal_uInt16>( nTextPos ? RES_POOLCOLL_CONFRONTATION : RES_POOLCOLL_TEXT_NEGIDENT ) ); - if( nTxtPos ) + if( nTextPos ) { - const OUString& rStr = m_pCurTxtNd->GetTxt(); + const OUString& rStr = m_pCurTextNd->GetText(); bool bInsTab = true; if ('\t' == rStr[nSpacePos+1]) // leave tab alone @@ -1702,7 +1702,7 @@ void SwAutoFormat::BuildNegIndent( SwTwips nSpaces ) m_aDelPam.DeleteMark(); m_aDelPam.GetPoint()->nNode = m_aNdIdx; - m_aDelPam.GetPoint()->nContent.Assign( m_pCurTxtNd, nSpacePos ); + m_aDelPam.GetPoint()->nContent.Assign( m_pCurTextNd, nSpacePos ); // delete old Spaces, etc. if( nSpaceStt < nSpacePos ) @@ -1719,9 +1719,9 @@ void SwAutoFormat::BuildNegIndent( SwTwips nSpaces ) if( !bBreak ) { - SetRedlineTxt( STR_AUTOFMTREDL_DEL_MORELINES ); - SwTxtFrmInfo aFInfo( m_pCurTxtFrm ); - const SwTxtNode* pNxtNd = GetNextNode(); + SetRedlineText( STR_AUTOFMTREDL_DEL_MORELINES ); + SwTextFrmInfo aFInfo( m_pCurTextFrm ); + const SwTextNode* pNxtNd = GetNextNode(); while( CanJoin( pNxtNd ) && 20 < std::abs( (long)(nSpaces - aFInfo.SetFrm( GetFrm( *pNxtNd ) ).GetLineStart() )) @@ -1730,7 +1730,7 @@ void SwAutoFormat::BuildNegIndent( SwTwips nSpaces ) bBreak = !IsFastFullLine( *pNxtNd ) || IsBlanksInString( *pNxtNd ) || IsSentenceAtEnd( *pNxtNd ); - if( DeleteCurNxtPara( pNxtNd->GetTxt() ) ) + if( DeleteCurNxtPara( pNxtNd->GetText() ) ) { m_pDoc->getIDocumentContentOperations().InsertString( m_aDelPam, OUString(' ') ); } @@ -1747,16 +1747,16 @@ void SwAutoFormat::BuildHeadLine( sal_uInt16 nLvl ) { if( m_aFlags.bWithRedlining ) { - OUString sTxt(SwViewShell::GetShellRes()->GetAutoFmtNameLst()[ + OUString sText(SwViewShell::GetShellRes()->GetAutoFormatNameLst()[ STR_AUTOFMTREDL_SET_TMPL_HEADLINE ] ); - sTxt = sTxt.replaceAll( "$(ARG1)", OUString::number( nLvl + 1 ) ); - m_pDoc->GetDocumentRedlineManager().SetAutoFmtRedlineComment( &sTxt ); + sText = sText.replaceAll( "$(ARG1)", OUString::number( nLvl + 1 ) ); + m_pDoc->GetDocumentRedlineManager().SetAutoFormatRedlineComment( &sText ); } SetColl( static_cast<sal_uInt16>(RES_POOLCOLL_HEADLINE1 + nLvl ), true ); - if( m_aFlags.bAFmtByInput ) + if( m_aFlags.bAFormatByInput ) { - SwTxtFmtColl& rNxtColl = m_pCurTxtNd->GetTxtColl()->GetNextTxtFmtColl(); + SwTextFormatColl& rNxtColl = m_pCurTextNd->GetTextColl()->GetNextTextFormatColl(); DelPrevPara(); @@ -1765,8 +1765,8 @@ void SwAutoFormat::BuildHeadLine( sal_uInt16 nLvl ) m_aDelPam.DeleteMark(); m_aDelPam.GetPoint()->nNode = m_aNdIdx.GetIndex() + 1; - m_aDelPam.GetPoint()->nContent.Assign( m_aDelPam.GetCntntNode(), 0 ); - m_pDoc->SetTxtFmtColl( m_aDelPam, &rNxtColl ); + m_aDelPam.GetPoint()->nContent.Assign( m_aDelPam.GetContentNode(), 0 ); + m_pDoc->SetTextFormatColl( m_aDelPam, &rNxtColl ); } else { @@ -1783,7 +1783,7 @@ void SwAutoFormat::AutoCorrect( sal_Int32 nPos ) bool bReplaceQuote = ( aSvxFlags & ChgQuotes ) > 0; bool bReplaceSglQuote = ( aSvxFlags & ChgSglQuotes ) > 0; - if( m_aFlags.bAFmtByInput || + if( m_aFlags.bAFormatByInput || (!m_aFlags.bAutoCorrect && !bReplaceQuote && !bReplaceSglQuote && !m_aFlags.bCptlSttSntnc && !m_aFlags.bCptlSttWrd && !m_aFlags.bChgOrdinalNumber && @@ -1791,8 +1791,8 @@ void SwAutoFormat::AutoCorrect( sal_Int32 nPos ) !m_aFlags.bChgWeightUnderl && !m_aFlags.bAddNonBrkSpace) ) return; - const OUString* pTxt = &m_pCurTxtNd->GetTxt(); - if (nPos >= pTxt->getLength()) + const OUString* pText = &m_pCurTextNd->GetText(); + if (nPos >= pText->getLength()) return; bool bGetLanguage = m_aFlags.bChgOrdinalNumber || @@ -1802,11 +1802,11 @@ void SwAutoFormat::AutoCorrect( sal_Int32 nPos ) m_aDelPam.DeleteMark(); m_aDelPam.GetPoint()->nNode = m_aNdIdx; - m_aDelPam.GetPoint()->nContent.Assign( m_pCurTxtNd, 0 ); + m_aDelPam.GetPoint()->nContent.Assign( m_pCurTextNd, 0 ); SwAutoCorrDoc aACorrDoc( *m_pEditShell, m_aDelPam ); - SwTxtFrmInfo aFInfo( 0 ); + SwTextFrmInfo aFInfo( 0 ); sal_Int32 nSttPos, nLastBlank = nPos; bool bFirst = m_aFlags.bCptlSttSntnc, bFirstSent = bFirst; @@ -1815,22 +1815,22 @@ void SwAutoFormat::AutoCorrect( sal_Int32 nPos ) CharClass& rAppCC = GetAppCharClass(); do { - while (nPos < pTxt->getLength() && IsSpace(cChar = (*pTxt)[nPos])) + while (nPos < pText->getLength() && IsSpace(cChar = (*pText)[nPos])) ++nPos; - if (nPos == pTxt->getLength()) + if (nPos == pText->getLength()) break; // das wars if( ( ( bReplaceQuote && '\"' == cChar ) || ( bReplaceSglQuote && '\'' == cChar ) ) && - (!nPos || ' ' == (*pTxt)[nPos-1])) + (!nPos || ' ' == (*pText)[nPos-1])) { // beachte: Sonderfall Symbolfonts !!! if( !aFInfo.GetFrm() ) - aFInfo.SetFrm( GetFrm( *m_pCurTxtNd ) ); + aFInfo.SetFrm( GetFrm( *m_pCurTextNd ) ); if( !aFInfo.IsBullet( nPos )) { - SetRedlineTxt( STR_AUTOFMTREDL_TYPO ); + SetRedlineText( STR_AUTOFMTREDL_TYPO ); m_aDelPam.GetPoint()->nContent = nPos; bool bSetHardBlank = false; @@ -1849,8 +1849,8 @@ void SwAutoFormat::AutoCorrect( sal_Int32 nPos ) if( m_aFlags.bWithRedlining ) { m_aNdIdx = m_aDelPam.GetPoint()->nNode; - m_pCurTxtNd = m_aNdIdx.GetNode().GetTxtNode(); - pTxt = &m_pCurTxtNd->GetTxt(); + m_pCurTextNd = m_aNdIdx.GetNode().GetTextNode(); + pText = &m_pCurTextNd->GetText(); m_aDelPam.SetMark(); aFInfo.SetFrm( 0 ); } @@ -1867,10 +1867,10 @@ void SwAutoFormat::AutoCorrect( sal_Int32 nPos ) bool bCallACorr = false; int bBreak = 0; - if (nPos && IsSpace((*pTxt)[nPos-1])) + if (nPos && IsSpace((*pText)[nPos-1])) nLastBlank = nPos; - for (nSttPos = nPos; !bBreak && nPos < pTxt->getLength(); ++nPos) - switch (cChar = (*pTxt)[nPos]) + for (nSttPos = nPos; !bBreak && nPos < pText->getLength(); ++nPos) + switch (cChar = (*pText)[nPos]) { case '\"': case '\'': @@ -1878,10 +1878,10 @@ void SwAutoFormat::AutoCorrect( sal_Int32 nPos ) { // consider Symbolfonts! if( !aFInfo.GetFrm() ) - aFInfo.SetFrm( GetFrm( *m_pCurTxtNd ) ); + aFInfo.SetFrm( GetFrm( *m_pCurTextNd ) ); if( !aFInfo.IsBullet( nPos )) { - SetRedlineTxt( STR_AUTOFMTREDL_TYPO ); + SetRedlineText( STR_AUTOFMTREDL_TYPO ); bool bSetHardBlank = false; m_aDelPam.GetPoint()->nContent = nPos; OUString sReplace( pATst->GetQuote( aACorrDoc, @@ -1900,8 +1900,8 @@ void SwAutoFormat::AutoCorrect( sal_Int32 nPos ) if( m_aFlags.bWithRedlining ) { m_aNdIdx = m_aDelPam.GetPoint()->nNode; - m_pCurTxtNd = m_aNdIdx.GetNode().GetTxtNode(); - pTxt = &m_pCurTxtNd->GetTxt(); + m_pCurTextNd = m_aNdIdx.GetNode().GetTextNode(); + pText = &m_pCurTextNd->GetText(); m_aDelPam.SetMark(); m_aDelPam.DeleteMark(); aFInfo.SetFrm( 0 ); @@ -1925,33 +1925,33 @@ void SwAutoFormat::AutoCorrect( sal_Int32 nPos ) { // consider Symbolfonts! if( !aFInfo.GetFrm() ) - aFInfo.SetFrm( GetFrm( *m_pCurTxtNd ) ); + aFInfo.SetFrm( GetFrm( *m_pCurTextNd ) ); if( !aFInfo.IsBullet( nPos )) { - SetRedlineTxt( '*' == cChar + SetRedlineText( '*' == cChar ? STR_AUTOFMTREDL_BOLD : STR_AUTOFMTREDL_UNDER ); - sal_Unicode cBlank = nSttPos ? (*pTxt)[nSttPos - 1] : 0; + sal_Unicode cBlank = nSttPos ? (*pText)[nSttPos - 1] : 0; m_aDelPam.GetPoint()->nContent = nPos; - if( pATst->FnChgWeightUnderl( aACorrDoc, *pTxt, + if( pATst->FnChgWeightUnderl( aACorrDoc, *pText, nSttPos, nPos )) { if( m_aFlags.bWithRedlining ) { m_aNdIdx = m_aDelPam.GetPoint()->nNode; - m_pCurTxtNd = m_aNdIdx.GetNode().GetTxtNode(); - pTxt = &m_pCurTxtNd->GetTxt(); + m_pCurTextNd = m_aNdIdx.GetNode().GetTextNode(); + pText = &m_pCurTextNd->GetText(); m_aDelPam.SetMark(); m_aDelPam.DeleteMark(); aFInfo.SetFrm( 0 ); } - //#125102# in case of the mode REDLINE_SHOW_DELETE the ** are still contained in pTxt + //#125102# in case of the mode REDLINE_SHOW_DELETE the ** are still contained in pText if(0 == (m_pDoc->getIDocumentRedlineAccess().GetRedlineMode() & nsRedlineMode_t::REDLINE_SHOW_DELETE)) nPos = m_aDelPam.GetPoint()->nContent.GetIndex() - 1; // Was a character deleted before starting? - if (cBlank && cBlank != (*pTxt)[nSttPos - 1]) + if (cBlank && cBlank != (*pText)[nSttPos - 1]) --nSttPos; } } @@ -1961,11 +1961,11 @@ void SwAutoFormat::AutoCorrect( sal_Int32 nPos ) if ( m_aFlags.bAddNonBrkSpace ) { LanguageType eLang = bGetLanguage - ? m_pCurTxtNd->GetLang( nSttPos ) + ? m_pCurTextNd->GetLang( nSttPos ) : LANGUAGE_SYSTEM; - SetRedlineTxt( STR_AUTOFMTREDL_NON_BREAK_SPACE ); - if ( pATst->FnAddNonBrkSpace( aACorrDoc, *pTxt, nSttPos, nPos, eLang ) ) + SetRedlineText( STR_AUTOFMTREDL_NON_BREAK_SPACE ); + if ( pATst->FnAddNonBrkSpace( aACorrDoc, *pText, nSttPos, nPos, eLang ) ) --nPos; } break; @@ -1977,7 +1977,7 @@ void SwAutoFormat::AutoCorrect( sal_Int32 nPos ) bFirstSent = true; /* fallthrough */ default: - if( !( rAppCC.isLetterNumeric( *pTxt, nPos ) + if( !( rAppCC.isLetterNumeric( *pText, nPos ) || '/' == cChar )) // '/' should not be a word separator (e.g. '1/2' needs to be handled as one word for replacement) { --nPos; // revert ++nPos which was decremented in for loop @@ -1988,7 +1988,7 @@ void SwAutoFormat::AutoCorrect( sal_Int32 nPos ) if( nPos == nSttPos ) { - if (++nPos == pTxt->getLength()) + if (++nPos == pText->getLength()) bCallACorr = true; } else @@ -1998,7 +1998,7 @@ void SwAutoFormat::AutoCorrect( sal_Int32 nPos ) { bCallACorr = false; m_aDelPam.GetPoint()->nContent = nPos; - SetRedlineTxt( STR_AUTOFMTREDL_USE_REPLACE ); + SetRedlineText( STR_AUTOFMTREDL_USE_REPLACE ); if( m_aFlags.bAutoCorrect && aACorrDoc.ChgAutoCorrWord( nSttPos, nPos, *pATst, 0 ) ) { @@ -2007,8 +2007,8 @@ void SwAutoFormat::AutoCorrect( sal_Int32 nPos ) if( m_aFlags.bWithRedlining ) { m_aNdIdx = m_aDelPam.GetPoint()->nNode; - m_pCurTxtNd = m_aNdIdx.GetNode().GetTxtNode(); - pTxt = &m_pCurTxtNd->GetTxt(); + m_pCurTextNd = m_aNdIdx.GetNode().GetTextNode(); + pText = &m_pCurTextNd->GetText(); m_aDelPam.SetMark(); m_aDelPam.DeleteMark(); } @@ -2017,39 +2017,39 @@ void SwAutoFormat::AutoCorrect( sal_Int32 nPos ) } LanguageType eLang = bGetLanguage - ? m_pCurTxtNd->GetLang( nSttPos ) + ? m_pCurTextNd->GetLang( nSttPos ) : LANGUAGE_SYSTEM; if ( m_aFlags.bAddNonBrkSpace ) { - SetRedlineTxt( STR_AUTOFMTREDL_NON_BREAK_SPACE ); - pATst->FnAddNonBrkSpace( aACorrDoc, *pTxt, nSttPos, nPos, eLang ); + SetRedlineText( STR_AUTOFMTREDL_NON_BREAK_SPACE ); + pATst->FnAddNonBrkSpace( aACorrDoc, *pText, nSttPos, nPos, eLang ); } if( ( m_aFlags.bChgOrdinalNumber && - SetRedlineTxt( STR_AUTOFMTREDL_ORDINAL ) && - pATst->FnChgOrdinalNumber( aACorrDoc, *pTxt, nSttPos, nPos, eLang ) ) || + SetRedlineText( STR_AUTOFMTREDL_ORDINAL ) && + pATst->FnChgOrdinalNumber( aACorrDoc, *pText, nSttPos, nPos, eLang ) ) || ( m_aFlags.bChgToEnEmDash && - SetRedlineTxt( STR_AUTOFMTREDL_DASH ) && - pATst->FnChgToEnEmDash( aACorrDoc, *pTxt, nSttPos, nPos, eLang ) ) || + SetRedlineText( STR_AUTOFMTREDL_DASH ) && + pATst->FnChgToEnEmDash( aACorrDoc, *pText, nSttPos, nPos, eLang ) ) || ( m_aFlags.bSetINetAttr && - (nPos == pTxt->getLength() || IsSpace((*pTxt)[nPos])) && - SetRedlineTxt( STR_AUTOFMTREDL_DETECT_URL ) && - pATst->FnSetINetAttr( aACorrDoc, *pTxt, nLastBlank, nPos, eLang ) ) ) + (nPos == pText->getLength() || IsSpace((*pText)[nPos])) && + SetRedlineText( STR_AUTOFMTREDL_DETECT_URL ) && + pATst->FnSetINetAttr( aACorrDoc, *pText, nLastBlank, nPos, eLang ) ) ) nPos = m_aDelPam.GetPoint()->nContent.GetIndex(); else { // two capital letters at the beginning of a word? if( m_aFlags.bCptlSttWrd ) { - SetRedlineTxt( STR_AUTOFMTREDL_CPTL_STT_WORD ); - pATst->FnCptlSttWrd( aACorrDoc, *pTxt, nSttPos, nPos, eLang ); + SetRedlineText( STR_AUTOFMTREDL_CPTL_STT_WORD ); + pATst->FnCptlSttWrd( aACorrDoc, *pText, nSttPos, nPos, eLang ); } // capital letter at the beginning of a sentence? if( m_aFlags.bCptlSttSntnc && bFirst ) { - SetRedlineTxt( STR_AUTOFMTREDL_CPTL_STT_SENT ); - pATst->FnCptlSttSntnc( aACorrDoc, *pTxt, true, nSttPos, nPos, eLang); + SetRedlineText( STR_AUTOFMTREDL_CPTL_STT_SENT ); + pATst->FnCptlSttSntnc( aACorrDoc, *pText, true, nSttPos, nPos, eLang); } bFirst = bFirstSent; @@ -2058,18 +2058,18 @@ void SwAutoFormat::AutoCorrect( sal_Int32 nPos ) if( m_aFlags.bWithRedlining ) { m_aNdIdx = m_aDelPam.GetPoint()->nNode; - m_pCurTxtNd = m_aNdIdx.GetNode().GetTxtNode(); - pTxt = &m_pCurTxtNd->GetTxt(); + m_pCurTextNd = m_aNdIdx.GetNode().GetTextNode(); + pText = &m_pCurTextNd->GetText(); m_aDelPam.SetMark(); m_aDelPam.DeleteMark(); } } } - } while (nPos < pTxt->getLength()); - ClearRedlineTxt(); + } while (nPos < pText->getLength()); + ClearRedlineText(); } -SwAutoFormat::SwAutoFormat( SwEditShell* pEdShell, SvxSwAutoFmtFlags& rFlags, +SwAutoFormat::SwAutoFormat( SwEditShell* pEdShell, SvxSwAutoFormatFlags& rFlags, SwNodeIndex* pSttNd, SwNodeIndex* pEndNd ) : m_aFlags( rFlags ), m_aDelPam( pEdShell->GetDoc()->GetNodes().GetEndOfExtras() ), @@ -2077,18 +2077,18 @@ SwAutoFormat::SwAutoFormat( SwEditShell* pEdShell, SvxSwAutoFmtFlags& rFlags, m_aEndNdIdx( pEdShell->GetDoc()->GetNodes().GetEndOfContent() ), m_pEditShell( pEdShell ), m_pDoc( pEdShell->GetDoc() ), - m_pCurTxtNd( 0 ), m_pCurTxtFrm( 0 ), - m_nRedlAutoFmtSeqId( 0 ) + m_pCurTextNd( 0 ), m_pCurTextFrm( 0 ), + m_nRedlAutoFormatSeqId( 0 ) { OSL_ENSURE( (pSttNd && pEndNd) || (!pSttNd && !pEndNd), "Got no area" ); - if( m_aFlags.bSetNumRule && !m_aFlags.bAFmtByInput ) + if( m_aFlags.bSetNumRule && !m_aFlags.bAFormatByInput ) m_aFlags.bSetNumRule = false; - bool bReplaceStyles = !m_aFlags.bAFmtByInput || m_aFlags.bReplaceStyles; + bool bReplaceStyles = !m_aFlags.bAFormatByInput || m_aFlags.bReplaceStyles; - const SwTxtNode* pNxtNd = 0; + const SwTextNode* pNxtNd = 0; bool bNxtEmpty = false; bool bNxtAlpha = false; sal_uInt16 nNxtLevel = 0; @@ -2102,7 +2102,7 @@ SwAutoFormat::SwAutoFormat( SwEditShell* pEdShell, SvxSwAutoFmtFlags& rFlags, ++m_aEndNdIdx; // check the previous TextNode - pNxtNd = m_aNdIdx.GetNode().GetTxtNode(); + pNxtNd = m_aNdIdx.GetNode().GetTextNode(); m_bEmptyLine = !pNxtNd || IsEmptyLine( *pNxtNd ) || IsNoAlphaLine( *pNxtNd ); @@ -2115,7 +2115,7 @@ SwAutoFormat::SwAutoFormat( SwEditShell* pEdShell, SvxSwAutoFmtFlags& rFlags, // set value for percentage display m_nEndNdIdx = m_aEndNdIdx.GetIndex(); - if( !m_aFlags.bAFmtByInput ) + if( !m_aFlags.bAFormatByInput ) ::StartProgress( STR_STATSTR_AUTOFORMAT, m_aNdIdx.GetIndex(), m_nEndNdIdx = m_aEndNdIdx.GetIndex(), m_pDoc->GetDocShell() ); @@ -2123,7 +2123,7 @@ SwAutoFormat::SwAutoFormat( SwEditShell* pEdShell, SvxSwAutoFmtFlags& rFlags, RedlineMode_t eRedlMode = m_pDoc->getIDocumentRedlineAccess().GetRedlineMode(), eOldMode = eRedlMode; if( m_aFlags.bWithRedlining ) { - m_pDoc->SetAutoFmtRedline( true ); + m_pDoc->SetAutoFormatRedline( true ); eRedlMode = (RedlineMode_t)(nsRedlineMode_t::REDLINE_ON | nsRedlineMode_t::REDLINE_SHOW_INSERT); } else @@ -2142,7 +2142,7 @@ SwAutoFormat::SwAutoFormat( SwEditShell* pEdShell, SvxSwAutoFmtFlags& rFlags, sal_uInt16 nDigitLvl = 0; // set defaults - SwTxtFrmInfo aFInfo( 0 ); + SwTextFrmInfo aFInfo( 0 ); // This is the automat for autoformatting m_eStat = READ_NEXT_PARA; @@ -2158,9 +2158,9 @@ SwAutoFormat::SwAutoFormat( SwEditShell* pEdShell, SvxSwAutoFmtFlags& rFlags, break; case TST_EMPTY_LINE: - if( IsEmptyLine( *m_pCurTxtNd ) ) + if( IsEmptyLine( *m_pCurTextNd ) ) { - if( m_aFlags.bDelEmptyNode && !HasObjects( *m_pCurTxtNd ) ) + if( m_aFlags.bDelEmptyNode && !HasObjects( *m_pCurTextNd ) ) { m_bEmptyLine = true; sal_uLong nOldCnt = m_pDoc->GetNodes().Count(); @@ -2176,10 +2176,10 @@ SwAutoFormat::SwAutoFormat( SwEditShell* pEdShell, SvxSwAutoFmtFlags& rFlags, break; case TST_ALPHA_LINE: - if( IsNoAlphaLine( *m_pCurTxtNd )) + if( IsNoAlphaLine( *m_pCurTextNd )) { // recognize a table definition +---+---+ - if( m_aFlags.bAFmtByInput && m_aFlags.bCreateTable && DoTable() ) + if( m_aFlags.bAFormatByInput && m_aFlags.bCreateTable && DoTable() ) { //JP 30.09.96: DoTable() builds on PopCrsr and MoveCrsr after AutoFormat! pEdShell->Pop( false ); @@ -2205,7 +2205,7 @@ SwAutoFormat::SwAutoFormat( SwEditShell* pEdShell, SvxSwAutoFmtFlags& rFlags, case GET_ALL_INFO: { - if( m_pCurTxtNd->GetNumRule() ) + if( m_pCurTextNd->GetNumRule() ) { // do nothing in numbering, go to next m_bEmptyLine = false; @@ -2216,14 +2216,14 @@ SwAutoFormat::SwAutoFormat( SwEditShell* pEdShell, SvxSwAutoFmtFlags& rFlags, break; } - aFInfo.SetFrm( m_pCurTxtFrm ); + aFInfo.SetFrm( m_pCurTextFrm ); // so far: if there were templates assigned, keep these and go to next node - sal_uInt16 nPoolId = m_pCurTxtNd->GetTxtColl()->GetPoolFmtId(); - if( IsPoolUserFmt( nPoolId ) + sal_uInt16 nPoolId = m_pCurTextNd->GetTextColl()->GetPoolFormatId(); + if( IsPoolUserFormat( nPoolId ) ? !m_aFlags.bChgUserColl : ( RES_POOLCOLL_STANDARD != nPoolId && - ( !m_aFlags.bAFmtByInput || + ( !m_aFlags.bAFormatByInput || (RES_POOLCOLL_TEXT_MOVE != nPoolId && RES_POOLCOLL_TEXT != nPoolId )) )) { @@ -2232,21 +2232,21 @@ SwAutoFormat::SwAutoFormat( SwEditShell* pEdShell, SvxSwAutoFmtFlags& rFlags, } // check for hard spaces or LRSpaces set by the template - if( IsPoolUserFmt( nPoolId ) || + if( IsPoolUserFormat( nPoolId ) || RES_POOLCOLL_STANDARD == nPoolId ) { short nSz; SvxLRSpaceItem const * pLRSpace; - if( SfxItemState::SET == m_pCurTxtNd->GetSwAttrSet(). + if( SfxItemState::SET == m_pCurTextNd->GetSwAttrSet(). GetItemState( RES_LR_SPACE, true, reinterpret_cast<const SfxPoolItem**>(&pLRSpace) ) && - ( 0 != (nSz = pLRSpace->GetTxtFirstLineOfst()) || - 0 != pLRSpace->GetTxtLeft() ) ) + ( 0 != (nSz = pLRSpace->GetTextFirstLineOfst()) || + 0 != pLRSpace->GetTextLeft() ) ) { // exception: numbering/enumation can have an indentation - if( IsEnumericChar( *m_pCurTxtNd )) + if( IsEnumericChar( *m_pCurTextNd )) { - nLevel = CalcLevel( *m_pCurTxtNd, &nDigitLvl ); + nLevel = CalcLevel( *m_pCurTextNd, &nDigitLvl ); if( nLevel >= MAXLEVEL ) nLevel = MAXLEVEL-1; BuildEnum( nLevel, nDigitLvl ); @@ -2264,7 +2264,7 @@ SwAutoFormat::SwAutoFormat( SwEditShell* pEdShell, SvxSwAutoFmtFlags& rFlags, BuildIndent(); else if( 0 > nSz ) // negative 1st line indentation BuildNegIndent( aFInfo.GetLineStart() ); - else if( pLRSpace->GetTxtLeft() ) // is indentation + else if( pLRSpace->GetTextLeft() ) // is indentation BuildTextIndent(); } m_eStat = READ_NEXT_PARA; @@ -2272,8 +2272,8 @@ SwAutoFormat::SwAutoFormat( SwEditShell* pEdShell, SvxSwAutoFmtFlags& rFlags, } } - nLevel = CalcLevel( *m_pCurTxtNd, &nDigitLvl ); - m_bMoreLines = !IsOneLine( *m_pCurTxtNd ); + nLevel = CalcLevel( *m_pCurTextNd, &nDigitLvl ); + m_bMoreLines = !IsOneLine( *m_pCurTextNd ); pNxtNd = GetNextNode(); if( pNxtNd ) { @@ -2281,7 +2281,7 @@ SwAutoFormat::SwAutoFormat( SwEditShell* pEdShell, SvxSwAutoFmtFlags& rFlags, bNxtAlpha = IsNoAlphaLine( *pNxtNd ); nNxtLevel = CalcLevel( *pNxtNd ); - if( !m_bEmptyLine && HasBreakAttr( *m_pCurTxtNd ) ) + if( !m_bEmptyLine && HasBreakAttr( *m_pCurTextNd ) ) m_bEmptyLine = true; if( !bNxtEmpty && HasBreakAttr( *pNxtNd ) ) bNxtEmpty = true; @@ -2303,7 +2303,7 @@ SwAutoFormat::SwAutoFormat( SwEditShell* pEdShell, SvxSwAutoFmtFlags& rFlags, if( !bReplaceStyles ) break; - const OUString sClrStr( DelLeadingBlanks(m_pCurTxtNd->GetTxt()) ); + const OUString sClrStr( DelLeadingBlanks(m_pCurTextNd->GetText()) ); if( sClrStr.isEmpty() ) { @@ -2313,8 +2313,8 @@ SwAutoFormat::SwAutoFormat( SwEditShell* pEdShell, SvxSwAutoFmtFlags& rFlags, } // check if headline - if( !m_bEmptyLine || !IsFirstCharCapital( *m_pCurTxtNd ) || - IsBlanksInString( *m_pCurTxtNd ) ) + if( !m_bEmptyLine || !IsFirstCharCapital( *m_pCurTextNd ) || + IsBlanksInString( *m_pCurTextNd ) ) break; m_bEmptyLine = false; @@ -2355,7 +2355,7 @@ SwAutoFormat::SwAutoFormat( SwEditShell* pEdShell, SvxSwAutoFmtFlags& rFlags, } m_nLastCalcHeadLvl = nLevel; - if( m_aFlags.bAFmtByInput ) + if( m_aFlags.bAFormatByInput ) BuildHeadLine( nLevel ); else BuildHeadLine( m_nLastHeadLvl ); @@ -2369,7 +2369,7 @@ SwAutoFormat::SwAutoFormat( SwEditShell* pEdShell, SvxSwAutoFmtFlags& rFlags, case TST_ENUMERIC: { m_bEmptyLine = false; - if( IsEnumericChar( *m_pCurTxtNd )) + if( IsEnumericChar( *m_pCurTextNd )) { if( nLevel >= MAXLEVEL ) nLevel = MAXLEVEL-1; @@ -2467,16 +2467,16 @@ SwAutoFormat::SwAutoFormat( SwEditShell* pEdShell, SvxSwAutoFmtFlags& rFlags, DelMoreLinesBlanks( false ); // handle hard attributes - if( m_pCurTxtNd->HasSwAttrSet() ) + if( m_pCurTextNd->HasSwAttrSet() ) { short nSz; SvxLRSpaceItem const * pLRSpace; if( bReplaceStyles && - SfxItemState::SET == m_pCurTxtNd->GetSwAttrSet(). + SfxItemState::SET == m_pCurTextNd->GetSwAttrSet(). GetItemState( RES_LR_SPACE, false, reinterpret_cast<const SfxPoolItem**>(&pLRSpace) ) && - ( 0 != (nSz = pLRSpace->GetTxtFirstLineOfst()) || - 0 != pLRSpace->GetTxtLeft() ) ) + ( 0 != (nSz = pLRSpace->GetTextFirstLineOfst()) || + 0 != pLRSpace->GetTextLeft() ) ) { // then use one of our templates if( 0 < nSz ) // positive 1st line indentation @@ -2485,7 +2485,7 @@ SwAutoFormat::SwAutoFormat( SwEditShell* pEdShell, SvxSwAutoFmtFlags& rFlags, { BuildNegIndent( aFInfo.GetLineStart() ); } - else if( pLRSpace->GetTxtLeft() ) // is indentation + else if( pLRSpace->GetTextLeft() ) // is indentation BuildTextIndent(); else BuildText(); @@ -2501,18 +2501,18 @@ SwAutoFormat::SwAutoFormat( SwEditShell* pEdShell, SvxSwAutoFmtFlags& rFlags, } if( m_aFlags.bWithRedlining ) - m_pDoc->SetAutoFmtRedline( false ); + m_pDoc->SetAutoFormatRedline( false ); m_pDoc->getIDocumentRedlineAccess().SetRedlineMode( eOldMode ); // restore undo (in case it has been changed) m_pDoc->GetIDocumentUndoRedo().DoUndo(bUndoState); // disable display of percentage again - if( !m_aFlags.bAFmtByInput ) + if( !m_aFlags.bAFormatByInput ) ::EndProgress( m_pDoc->GetDocShell() ); } -void SwEditShell::AutoFormat( const SvxSwAutoFmtFlags* pAFlags ) +void SwEditShell::AutoFormat( const SvxSwAutoFormatFlags* pAFlags ) { boost::scoped_ptr<SwWait> pWait; @@ -2520,11 +2520,11 @@ void SwEditShell::AutoFormat( const SvxSwAutoFmtFlags* pAFlags ) StartAllAction(); StartUndo( UNDO_AUTOFORMAT ); - SvxSwAutoFmtFlags aAFFlags; // use default values or add params? + SvxSwAutoFormatFlags aAFFlags; // use default values or add params? if( pAFlags ) { aAFFlags = *pAFlags; - if( !aAFFlags.bAFmtByInput ) + if( !aAFFlags.bAFormatByInput ) pWait.reset(new SwWait( *GetDoc()->GetDocShell(), true )); } @@ -2536,21 +2536,21 @@ void SwEditShell::AutoFormat( const SvxSwAutoFmtFlags* pAFlags ) { if( rPaM.HasMark() ) { - SwAutoFormat aFmt( this, aAFFlags, &(rPaM.Start()->nNode), + SwAutoFormat aFormat( this, aAFFlags, &(rPaM.Start()->nNode), &(rPaM.End()->nNode) ); } } } else { - SwAutoFormat aFmt( this, aAFFlags ); + SwAutoFormat aFormat( this, aAFFlags ); } EndUndo( UNDO_AUTOFORMAT ); EndAllAction(); } -void SwEditShell::AutoFmtBySplitNode() +void SwEditShell::AutoFormatBySplitNode() { SET_CURR_SHELL( this ); SwPaM* pCrsr = GetCrsr(); @@ -2561,20 +2561,20 @@ void SwEditShell::AutoFmtBySplitNode() bool bRange = false; pCrsr->SetMark(); - SwIndex* pCntnt = &pCrsr->GetMark()->nContent; - if( pCntnt->GetIndex() ) + SwIndex* pContent = &pCrsr->GetMark()->nContent; + if( pContent->GetIndex() ) { - *pCntnt = 0; + *pContent = 0; bRange = true; } else { // then go one node backwards SwNodeIndex m_aNdIdx( pCrsr->GetMark()->nNode, -1 ); - SwTxtNode* pTxtNd = m_aNdIdx.GetNode().GetTxtNode(); - if (pTxtNd && !pTxtNd->GetTxt().isEmpty()) + SwTextNode* pTextNd = m_aNdIdx.GetNode().GetTextNode(); + if (pTextNd && !pTextNd->GetText().isEmpty()) { - pCntnt->Assign( pTxtNd, 0 ); + pContent->Assign( pTextNd, 0 ); pCrsr->GetMark()->nNode = m_aNdIdx; bRange = true; } @@ -2584,9 +2584,9 @@ void SwEditShell::AutoFmtBySplitNode() { Push(); // save cursor - SvxSwAutoFmtFlags aAFFlags = *GetAutoFmtFlags(); // use default values so far + SvxSwAutoFormatFlags aAFFlags = *GetAutoFormatFlags(); // use default values so far - SwAutoFormat aFmt( this, aAFFlags, &pCrsr->GetMark()->nNode, + SwAutoFormat aFormat( this, aAFFlags, &pCrsr->GetMark()->nNode, &pCrsr->GetPoint()->nNode ); //JP 30.09.96: DoTable() builds on PopCrsr and MoveCrsr! @@ -2601,27 +2601,27 @@ void SwEditShell::AutoFmtBySplitNode() } } -SvxSwAutoFmtFlags* SwEditShell::GetAutoFmtFlags() +SvxSwAutoFormatFlags* SwEditShell::GetAutoFormatFlags() { - if (!s_pAutoFmtFlags) - s_pAutoFmtFlags = new SvxSwAutoFmtFlags; + if (!s_pAutoFormatFlags) + s_pAutoFormatFlags = new SvxSwAutoFormatFlags; - return s_pAutoFmtFlags; + return s_pAutoFormatFlags; } -void SwEditShell::SetAutoFmtFlags(SvxSwAutoFmtFlags * pFlags) +void SwEditShell::SetAutoFormatFlags(SvxSwAutoFormatFlags * pFlags) { - SvxSwAutoFmtFlags* pEditFlags = GetAutoFmtFlags(); + SvxSwAutoFormatFlags* pEditFlags = GetAutoFormatFlags(); pEditFlags->bSetNumRule = pFlags->bSetNumRule; pEditFlags->bChgEnumNum = pFlags->bChgEnumNum; pEditFlags->bSetBorder = pFlags->bSetBorder; pEditFlags->bCreateTable = pFlags->bCreateTable; pEditFlags->bReplaceStyles = pFlags->bReplaceStyles; - pEditFlags->bAFmtByInpDelSpacesAtSttEnd = - pFlags->bAFmtByInpDelSpacesAtSttEnd; - pEditFlags->bAFmtByInpDelSpacesBetweenLines = - pFlags->bAFmtByInpDelSpacesBetweenLines; + pEditFlags->bAFormatByInpDelSpacesAtSttEnd = + pFlags->bAFormatByInpDelSpacesAtSttEnd; + pEditFlags->bAFormatByInpDelSpacesBetweenLines = + pFlags->bAFormatByInpDelSpacesBetweenLines; //JP 15.12.98: copy BulletChar and Font into "normal" ones // because AutoFormat can only work with the latter! diff --git a/sw/source/core/edit/edatmisc.cxx b/sw/source/core/edit/edatmisc.cxx index 8a798195e6b0..f0312a8f26ba 100644 --- a/sw/source/core/edit/edatmisc.cxx +++ b/sw/source/core/edit/edatmisc.cxx @@ -58,11 +58,11 @@ void SwEditShell::GCAttr() { if ( !rPaM.HasMark() ) { - SwTxtNode *const pTxtNode = - rPaM.GetPoint()->nNode.GetNode().GetTxtNode(); - if (pTxtNode) + SwTextNode *const pTextNode = + rPaM.GetPoint()->nNode.GetNode().GetTextNode(); + if (pTextNode) { - pTxtNode->GCAttr(); + pTextNode->GCAttr(); } } else @@ -71,8 +71,8 @@ void SwEditShell::GCAttr() SwNodeIndex aIdx( rPaM.Start()->nNode ); SwNode* pNd = &aIdx.GetNode(); do { - if( pNd->IsTxtNode() ) - static_cast<SwTxtNode*>(pNd)->GCAttr(); + if( pNd->IsTextNode() ) + static_cast<SwTextNode*>(pNd)->GCAttr(); } while( 0 != ( pNd = GetDoc()->GetNodes().GoNext( &aIdx )) && aIdx <= rEnd ); @@ -81,18 +81,18 @@ void SwEditShell::GCAttr() } /// Set the attribute as new default attribute in the document. -void SwEditShell::SetDefault( const SfxPoolItem& rFmtHint ) +void SwEditShell::SetDefault( const SfxPoolItem& rFormatHint ) { // 7502: Action-Parenthesis StartAllAction(); - GetDoc()->SetDefault( rFmtHint ); + GetDoc()->SetDefault( rFormatHint ); EndAllAction(); } /// request the default attribute in this document. -const SfxPoolItem& SwEditShell::GetDefault( sal_uInt16 nFmtHint ) const +const SfxPoolItem& SwEditShell::GetDefault( sal_uInt16 nFormatHint ) const { - return GetDoc()->GetDefault( nFmtHint ); + return GetDoc()->GetDefault( nFormatHint ); } void SwEditShell::SetAttrItem( const SfxPoolItem& rHint, SetAttrMode nFlags ) @@ -102,12 +102,12 @@ void SwEditShell::SetAttrItem( const SfxPoolItem& rHint, SetAttrMode nFlags ) SwPaM* pCrsr = GetCrsr(); if( pCrsr->GetNext() != pCrsr ) // Ring of Cursors { - bool bIsTblMode = IsTableMode(); + bool bIsTableMode = IsTableMode(); GetDoc()->GetIDocumentUndoRedo().StartUndo(UNDO_INSATTR, NULL); for(SwPaM& rPaM : GetCrsr()->GetRingContainer()) { - if( rPaM.HasMark() && ( bIsTblMode || + if( rPaM.HasMark() && ( bIsTableMode || *rPaM.GetPoint() != *rPaM.GetMark() )) { GetDoc()->getIDocumentContentOperations().InsertPoolItem(rPaM, rHint, nFlags ); @@ -133,12 +133,12 @@ void SwEditShell::SetAttrSet( const SfxItemSet& rSet, SetAttrMode nFlags, SwPaM* StartAllAction(); if( pCrsr->GetNext() != pCrsr ) // Ring of Cursors { - bool bIsTblMode = IsTableMode(); + bool bIsTableMode = IsTableMode(); GetDoc()->GetIDocumentUndoRedo().StartUndo(UNDO_INSATTR, NULL); for(SwPaM& rTmpCrsr : pCrsr->GetRingContainer()) { - if( rTmpCrsr.HasMark() && ( bIsTblMode || + if( rTmpCrsr.HasMark() && ( bIsTableMode || *rTmpCrsr.GetPoint() != *rTmpCrsr.GetMark() )) { GetDoc()->getIDocumentContentOperations().InsertItemSet(rTmpCrsr, rSet, nFlags ); diff --git a/sw/source/core/edit/edattr.cxx b/sw/source/core/edit/edattr.cxx index 19b1074c6b51..759cfc84b104 100644 --- a/sw/source/core/edit/edattr.cxx +++ b/sw/source/core/edit/edattr.cxx @@ -78,15 +78,15 @@ bool SwEditShell::GetPaMAttr( SwPaM* pPaM, SfxItemSet& rSet, // the attributes to get are those from the numbering format. if (rCurrentPaM.IsInFrontOfLabel()) { - SwTxtNode * pTxtNd = rCurrentPaM.GetPoint()->nNode.GetNode().GetTxtNode(); + SwTextNode * pTextNd = rCurrentPaM.GetPoint()->nNode.GetNode().GetTextNode(); - if (pTxtNd) + if (pTextNd) { - SwNumRule * pNumRule = pTxtNd->GetNumRule(); + SwNumRule * pNumRule = pTextNd->GetNumRule(); if (pNumRule) { - int nListLevel = pTxtNd->GetActualListLevel(); + int nListLevel = pTextNd->GetActualListLevel(); if (nListLevel < 0) nListLevel = 0; @@ -94,13 +94,13 @@ bool SwEditShell::GetPaMAttr( SwPaM* pPaM, SfxItemSet& rSet, if (nListLevel >= MAXLEVEL) nListLevel = MAXLEVEL - 1; - const OUString & aCharFmtName = - pNumRule->Get(static_cast<sal_uInt16>(nListLevel)).GetCharFmtName(); - SwCharFmt * pCharFmt = - GetDoc()->FindCharFmtByName(aCharFmtName); + const OUString & aCharFormatName = + pNumRule->Get(static_cast<sal_uInt16>(nListLevel)).GetCharFormatName(); + SwCharFormat * pCharFormat = + GetDoc()->FindCharFormatByName(aCharFormatName); - if (pCharFmt) - rSet.Put(pCharFmt->GetAttrSet()); + if (pCharFormat) + rSet.Put(pCharFormat->GetAttrSet()); } } @@ -137,16 +137,16 @@ bool SwEditShell::GetPaMAttr( SwPaM* pPaM, SfxItemSet& rSet, const sal_Int32 nStt = (n == nSttNd) ? nSttCnt : 0; const sal_Int32 nEnd = (n == nEndNd) ? nEndCnt - : pNd->GetTxtNode()->GetTxt().getLength(); + : pNd->GetTextNode()->GetText().getLength(); - static_cast<SwTxtNode*>(pNd)->GetAttr( *pSet, nStt, nEnd, + static_cast<SwTextNode*>(pNd)->GetAttr( *pSet, nStt, nEnd, false, true, bMergeIndentValuesOfNumRule ); } break; case ND_GRFNODE: case ND_OLENODE: - static_cast<SwCntntNode*>(pNd)->GetAttr( *pSet ); + static_cast<SwContentNode*>(pNd)->GetAttr( *pSet ); break; default: @@ -207,10 +207,10 @@ bool SwEditShell::GetPaMParAttr( SwPaM* pPaM, SfxItemSet& rSet ) const // get the node SwNode* pNd = GetDoc()->GetNodes()[ n ]; - if( pNd->IsTxtNode() ) + if( pNd->IsTextNode() ) { // get the node (paragraph) attributes - static_cast<SwCntntNode*>(pNd)->GetAttr(*pSet); + static_cast<SwContentNode*>(pNd)->GetAttr(*pSet); if( pSet != &rSet && aSet.Count() ) { @@ -232,12 +232,12 @@ bool SwEditShell::GetPaMParAttr( SwPaM* pPaM, SfxItemSet& rSet ) const return true; } -SwTxtFmtColl* SwEditShell::GetCurTxtFmtColl( ) const +SwTextFormatColl* SwEditShell::GetCurTextFormatColl( ) const { - return GetPaMTxtFmtColl( GetCrsr() ); + return GetPaMTextFormatColl( GetCrsr() ); } -SwTxtFmtColl* SwEditShell::GetPaMTxtFmtColl( SwPaM* pPaM ) const +SwTextFormatColl* SwEditShell::GetPaMTextFormatColl( SwPaM* pPaM ) const { // number of nodes the function have explored so far sal_uInt16 numberOfLookup = 0; @@ -265,14 +265,14 @@ SwTxtFmtColl* SwEditShell::GetPaMTxtFmtColl( SwPaM* pPaM ) const if (numberOfLookup >= getMaxLookup()) return NULL; - if( pNd->IsTxtNode() ) + if( pNd->IsTextNode() ) { // if it's a text node get its named paragraph format - SwTxtFmtColl* pFmt = pNd->GetTxtNode()->GetTxtColl(); + SwTextFormatColl* pFormat = pNd->GetTextNode()->GetTextColl(); // if the paragraph format exist stop here and return it - if( pFmt != NULL ) - return pFmt; + if( pFormat != NULL ) + return pFormat; } } } @@ -300,32 +300,32 @@ std::vector<std::pair< const SfxPoolItem*, std::unique_ptr<SwPaM> >> SwEditShell for( sal_uLong n = nSttNd; n <= nEndNd; ++n ) { SwNode* pNd = GetDoc()->GetNodes()[ n ]; - if( pNd->IsTxtNode() ) + if( pNd->IsTextNode() ) { - SwTxtNode* pTxtNd = static_cast< SwTxtNode* >( pNd ); + SwTextNode* pTextNd = static_cast< SwTextNode* >( pNd ); const sal_Int32 nStt = (n == nSttNd) ? nSttCnt : 0; const sal_Int32 nEnd = (n == nEndNd) - ? nEndCnt : pTxtNd->GetTxt().getLength(); - const SwScriptInfo* pScriptInfo = SwScriptInfo::GetScriptInfo( *pTxtNd ); + ? nEndCnt : pTextNd->GetText().getLength(); + const SwScriptInfo* pScriptInfo = SwScriptInfo::GetScriptInfo( *pTextNd ); sal_uInt8 nScript = pScriptInfo ? pScriptInfo->ScriptType( nStt ) : css::i18n::ScriptType::WEAK; nWhich = GetWhichOfScript( nWhich, nScript ); // item from attribute set - if( pTxtNd->HasSwAttrSet() ) + if( pTextNd->HasSwAttrSet() ) { pNewPaM = new SwPaM(*pNd, nStt, *pNd, nEnd); - pItem = pTxtNd->GetSwAttrSet().GetItem( nWhich ); + pItem = pTextNd->GetSwAttrSet().GetItem( nWhich ); vItem.push_back( std::make_pair( pItem, std::unique_ptr<SwPaM>(pNewPaM) ) ); } - if( !pTxtNd->HasHints() ) + if( !pTextNd->HasHints() ) continue; // items with limited range - const size_t nSize = pTxtNd->GetpSwpHints()->Count(); + const size_t nSize = pTextNd->GetpSwpHints()->Count(); for( size_t m = 0; m < nSize; m++ ) { - const SwTxtAttr* pHt = (*pTxtNd->GetpSwpHints())[m]; + const SwTextAttr* pHt = (*pTextNd->GetpSwpHints())[m]; if( pHt->Which() == RES_TXTATR_AUTOFMT || pHt->Which() == RES_TXTATR_CHARFMT || pHt->Which() == RES_TXTATR_INETFMT ) @@ -341,7 +341,7 @@ std::vector<std::pair< const SfxPoolItem*, std::unique_ptr<SwPaM> >> SwEditShell nScript = pScriptInfo ? pScriptInfo->ScriptType( nStt ) : css::i18n::ScriptType::WEAK; nWhich = GetWhichOfScript( nWhich, nScript ); - const SfxItemSet* pAutoSet = CharFmt::GetItemSet( pHt->GetAttr() ); + const SfxItemSet* pAutoSet = CharFormat::GetItemSet( pHt->GetAttr() ); if( pAutoSet ) { SfxItemIter aItemIter( *pAutoSet ); @@ -366,7 +366,7 @@ std::vector<std::pair< const SfxPoolItem*, std::unique_ptr<SwPaM> >> SwEditShell pItem = aItemIter.NextItem(); } // default item - if( !pItem && !pTxtNd->HasSwAttrSet() ) + if( !pItem && !pTextNd->HasSwAttrSet() ) { pNewPaM = new SwPaM(*pNd, nStt, *pNd, nEnd); pItem = pAutoSet->GetPool()->GetPoolDefaultItem( nWhich ); @@ -381,27 +381,27 @@ std::vector<std::pair< const SfxPoolItem*, std::unique_ptr<SwPaM> >> SwEditShell return vItem; } -bool SwEditShell::GetCurFtn( SwFmtFtn* pFillFtn ) +bool SwEditShell::GetCurFootnote( SwFormatFootnote* pFillFootnote ) { // The cursor must be positioned on the current footnotes anchor: SwPaM* pCrsr = GetCrsr(); - SwTxtNode* pTxtNd = pCrsr->GetNode().GetTxtNode(); - if( !pTxtNd ) + SwTextNode* pTextNd = pCrsr->GetNode().GetTextNode(); + if( !pTextNd ) return false; - SwTxtAttr *const pFtn = pTxtNd->GetTxtAttrForCharAt( + SwTextAttr *const pFootnote = pTextNd->GetTextAttrForCharAt( pCrsr->GetPoint()->nContent.GetIndex(), RES_TXTATR_FTN); - if( pFtn && pFillFtn ) + if( pFootnote && pFillFootnote ) { // Transfer data from the attribute - const SwFmtFtn &rFtn = static_cast<SwTxtFtn*>(pFtn)->GetFtn(); - pFillFtn->SetNumber( rFtn ); - pFillFtn->SetEndNote( rFtn.IsEndNote() ); + const SwFormatFootnote &rFootnote = static_cast<SwTextFootnote*>(pFootnote)->GetFootnote(); + pFillFootnote->SetNumber( rFootnote ); + pFillFootnote->SetEndNote( rFootnote.IsEndNote() ); } - return 0 != pFtn; + return 0 != pFootnote; } -bool SwEditShell::SetCurFtn( const SwFmtFtn& rFillFtn ) +bool SwEditShell::SetCurFootnote( const SwFormatFootnote& rFillFootnote ) { bool bChgd = false; StartAllAction(); @@ -409,7 +409,7 @@ bool SwEditShell::SetCurFtn( const SwFmtFtn& rFillFtn ) for(SwPaM& rCrsr : GetCrsr()->GetRingContainer()) { bChgd |= - mpDoc->SetCurFtn( rCrsr, rFillFtn.GetNumStr(), rFillFtn.GetNumber(), rFillFtn.IsEndNote() ); + mpDoc->SetCurFootnote( rCrsr, rFillFootnote.GetNumStr(), rFillFootnote.GetNumber(), rFillFootnote.IsEndNote() ); } @@ -417,49 +417,49 @@ bool SwEditShell::SetCurFtn( const SwFmtFtn& rFillFtn ) return bChgd; } -bool SwEditShell::HasFtns( bool bEndNotes ) const +bool SwEditShell::HasFootnotes( bool bEndNotes ) const { - const SwFtnIdxs &rIdxs = mpDoc->GetFtnIdxs(); + const SwFootnoteIdxs &rIdxs = mpDoc->GetFootnoteIdxs(); for ( auto pIdx : rIdxs ) { - const SwFmtFtn &rFtn = pIdx->GetFtn(); - if ( bEndNotes == rFtn.IsEndNote() ) + const SwFormatFootnote &rFootnote = pIdx->GetFootnote(); + if ( bEndNotes == rFootnote.IsEndNote() ) return true; } return false; } /// Give a List of all footnotes and their beginning texts -size_t SwEditShell::GetSeqFtnList( SwSeqFldList& rList, bool bEndNotes ) +size_t SwEditShell::GetSeqFootnoteList( SwSeqFieldList& rList, bool bEndNotes ) { rList.Clear(); - const size_t nFtnCnt = mpDoc->GetFtnIdxs().size(); - SwTxtFtn* pTxtFtn; - for( size_t n = 0; n < nFtnCnt; ++n ) + const size_t nFootnoteCnt = mpDoc->GetFootnoteIdxs().size(); + SwTextFootnote* pTextFootnote; + for( size_t n = 0; n < nFootnoteCnt; ++n ) { - pTxtFtn = mpDoc->GetFtnIdxs()[ n ]; - const SwFmtFtn& rFtn = pTxtFtn->GetFtn(); - if ( rFtn.IsEndNote() != bEndNotes ) + pTextFootnote = mpDoc->GetFootnoteIdxs()[ n ]; + const SwFormatFootnote& rFootnote = pTextFootnote->GetFootnote(); + if ( rFootnote.IsEndNote() != bEndNotes ) continue; - SwNodeIndex* pIdx = pTxtFtn->GetStartNode(); + SwNodeIndex* pIdx = pTextFootnote->GetStartNode(); if( pIdx ) { SwNodeIndex aIdx( *pIdx, 1 ); - SwTxtNode* pTxtNd = aIdx.GetNode().GetTxtNode(); - if( !pTxtNd ) - pTxtNd = static_cast<SwTxtNode*>(mpDoc->GetNodes().GoNext( &aIdx )); + SwTextNode* pTextNd = aIdx.GetNode().GetTextNode(); + if( !pTextNd ) + pTextNd = static_cast<SwTextNode*>(mpDoc->GetNodes().GoNext( &aIdx )); - if( pTxtNd ) + if( pTextNd ) { - OUString sTxt( rFtn.GetViewNumStr( *mpDoc )); - if( !sTxt.isEmpty() ) - sTxt += " "; - sTxt += pTxtNd->GetExpandTxt( 0, -1 ); + OUString sText( rFootnote.GetViewNumStr( *mpDoc )); + if( !sText.isEmpty() ) + sText += " "; + sText += pTextNd->GetExpandText( 0, -1 ); - _SeqFldLstElem* pNew = new _SeqFldLstElem( sTxt, - pTxtFtn->GetSeqRefNo() ); + _SeqFieldLstElem* pNew = new _SeqFieldLstElem( sText, + pTextFootnote->GetSeqRefNo() ); while( rList.InsertSort( pNew ) ) pNew->sDlgEntry += " "; } @@ -488,15 +488,15 @@ bool SwEditShell::IsMoveLeftMargin( bool bRight, bool bModulus ) const if( nSttNd > nEndNd ) std::swap(nSttNd, nEndNd); - SwCntntNode* pCNd; + SwContentNode* pCNd; for( sal_uLong n = nSttNd; bRet && n <= nEndNd; ++n ) - if( 0 != ( pCNd = GetDoc()->GetNodes()[ n ]->GetTxtNode() )) + if( 0 != ( pCNd = GetDoc()->GetNodes()[ n ]->GetTextNode() )) { const SvxLRSpaceItem& rLS = static_cast<const SvxLRSpaceItem&>( pCNd->GetAttr( RES_LR_SPACE )); if( bRight ) { - long nNext = rLS.GetTxtLeft() + nDefDist; + long nNext = rLS.GetTextLeft() + nDefDist; if( bModulus ) nNext = ( nNext / nDefDist ) * nDefDist; SwFrm* pFrm = pCNd->getLayoutFrm( GetLayout() ); @@ -555,7 +555,7 @@ static inline SvtScriptType lcl_SetScriptFlags( sal_uInt16 nType ) } } -static bool lcl_IsNoEndTxtAttrAtPos( const SwTxtNode& rTNd, sal_Int32 nPos, +static bool lcl_IsNoEndTextAttrAtPos( const SwTextNode& rTNd, sal_Int32 nPos, SvtScriptType &rScrpt, bool bInSelection, bool bNum ) { bool bRet = false; @@ -569,7 +569,7 @@ static bool lcl_IsNoEndTxtAttrAtPos( const SwTxtNode& rTNd, sal_Int32 nPos, if ( rTNd.IsInList() ) { OSL_ENSURE( rTNd.GetNumRule(), - "<lcl_IsNoEndTxtAttrAtPos(..)> - no list style found at text node. Serious defect -> please inform OD." ); + "<lcl_IsNoEndTextAttrAtPos(..)> - no list style found at text node. Serious defect -> please inform OD." ); const SwNumRule* pNumRule = rTNd.GetNumRule(); if(pNumRule) { @@ -581,11 +581,11 @@ static bool lcl_IsNoEndTxtAttrAtPos( const SwTxtNode& rTNd, sal_Int32 nPos, if (nListLevel >= MAXLEVEL) nListLevel = MAXLEVEL - 1; - const SwNumFmt &rNumFmt = pNumRule->Get( static_cast<sal_uInt16>(nListLevel) ); - if( SVX_NUM_BITMAP != rNumFmt.GetNumberingType() ) + const SwNumFormat &rNumFormat = pNumRule->Get( static_cast<sal_uInt16>(nListLevel) ); + if( SVX_NUM_BITMAP != rNumFormat.GetNumberingType() ) { - if ( SVX_NUM_CHAR_SPECIAL == rNumFmt.GetNumberingType() ) - sExp = OUString(rNumFmt.GetBulletChar()); + if ( SVX_NUM_CHAR_SPECIAL == rNumFormat.GetNumberingType() ) + sExp = OUString(rNumFormat.GetBulletChar()); else sExp = rTNd.GetNumString(); } @@ -594,19 +594,19 @@ static bool lcl_IsNoEndTxtAttrAtPos( const SwTxtNode& rTNd, sal_Int32 nPos, } // and fields - if (nPos < rTNd.GetTxt().getLength() && CH_TXTATR_BREAKWORD == rTNd.GetTxt()[nPos]) + if (nPos < rTNd.GetText().getLength() && CH_TXTATR_BREAKWORD == rTNd.GetText()[nPos]) { - const SwTxtAttr* const pAttr = rTNd.GetTxtAttrForCharAt( nPos ); + const SwTextAttr* const pAttr = rTNd.GetTextAttrForCharAt( nPos ); if (pAttr) { bRet = true; // all other than fields can be // defined as weak-script ? if ( RES_TXTATR_FIELD == pAttr->Which() ) { - const SwField* const pFld = pAttr->GetFmtFld().GetField(); - if (pFld) + const SwField* const pField = pAttr->GetFormatField().GetField(); + if (pField) { - sExp += pFld->ExpandField(true); + sExp += pField->ExpandField(true); } } } @@ -647,7 +647,7 @@ SvtScriptType SwEditShell::GetScriptType() const : rPaM.GetMark(); if( pStt == pEnd || *pStt == *pEnd ) { - const SwTxtNode* pTNd = pStt->nNode.GetNode().GetTxtNode(); + const SwTextNode* pTNd = pStt->nNode.GetNode().GetTextNode(); if( pTNd ) { // try to get SwScriptInfo @@ -665,16 +665,16 @@ SvtScriptType SwEditShell::GetScriptType() const sal_uInt16 nScript; - if (!pTNd->GetTxt().isEmpty()) + if (!pTNd->GetText().isEmpty()) { nScript = pScriptInfo ? pScriptInfo->ScriptType( nPos ) : - g_pBreakIt->GetBreakIter()->getScriptType( pTNd->GetTxt(), nPos ); + g_pBreakIt->GetBreakIter()->getScriptType( pTNd->GetText(), nPos ); } else nScript = SvtLanguageOptions::GetI18NScriptTypeOfLanguage( GetAppLanguage() ); - if( !lcl_IsNoEndTxtAttrAtPos( *pTNd, nPos, nRet, false, false )) + if( !lcl_IsNoEndTextAttrAtPos( *pTNd, nPos, nRet, false, false )) nRet |= lcl_SetScriptFlags( nScript ); } } @@ -683,10 +683,10 @@ SvtScriptType SwEditShell::GetScriptType() const sal_uLong nEndIdx = pEnd->nNode.GetIndex(); SwNodeIndex aIdx( pStt->nNode ); for( ; aIdx.GetIndex() <= nEndIdx; ++aIdx ) - if( aIdx.GetNode().IsTxtNode() ) + if( aIdx.GetNode().IsTextNode() ) { - const SwTxtNode* pTNd = aIdx.GetNode().GetTxtNode(); - const OUString& rTxt = pTNd->GetTxt(); + const SwTextNode* pTNd = aIdx.GetNode().GetTextNode(); + const OUString& rText = pTNd->GetText(); // try to get SwScriptInfo const SwScriptInfo* pScriptInfo = SwScriptInfo::GetScriptInfo( *pTNd ); @@ -696,12 +696,12 @@ SvtScriptType SwEditShell::GetScriptType() const : 0; sal_Int32 nEndPos = aIdx == nEndIdx ? pEnd->nContent.GetIndex() - : rTxt.getLength(); + : rText.getLength(); - OSL_ENSURE( nEndPos <= rTxt.getLength(), + OSL_ENSURE( nEndPos <= rText.getLength(), "Index outside the range - endless loop!" ); - if (nEndPos > rTxt.getLength()) - nEndPos = rTxt.getLength(); + if (nEndPos > rText.getLength()) + nEndPos = rText.getLength(); sal_uInt16 nScript; while( nChg < nEndPos ) @@ -709,27 +709,27 @@ SvtScriptType SwEditShell::GetScriptType() const nScript = pScriptInfo ? pScriptInfo->ScriptType( nChg ) : g_pBreakIt->GetBreakIter()->getScriptType( - rTxt, nChg ); + rText, nChg ); - if( !lcl_IsNoEndTxtAttrAtPos( *pTNd, nChg, nRet, true, - 0 == nChg && rTxt.getLength() == nEndPos)) + if( !lcl_IsNoEndTextAttrAtPos( *pTNd, nChg, nRet, true, + 0 == nChg && rText.getLength() == nEndPos)) nRet |= lcl_SetScriptFlags( nScript ); if( (SvtScriptType::LATIN | SvtScriptType::ASIAN | SvtScriptType::COMPLEX) == nRet ) break; - sal_Int32 nFldPos = nChg+1; + sal_Int32 nFieldPos = nChg+1; nChg = pScriptInfo ? pScriptInfo->NextScriptChg( nChg ) : g_pBreakIt->GetBreakIter()->endOfScript( - rTxt, nChg, nScript ); + rText, nChg, nScript ); - nFldPos = rTxt.indexOf( - CH_TXTATR_BREAKWORD, nFldPos); - if ((-1 != nFldPos) && (nFldPos < nChg)) - nChg = nFldPos; + nFieldPos = rText.indexOf( + CH_TXTATR_BREAKWORD, nFieldPos); + if ((-1 != nFieldPos) && (nFieldPos < nChg)) + nChg = nFieldPos; } if( (SvtScriptType::LATIN | SvtScriptType::ASIAN | SvtScriptType::COMPLEX) == nRet ) @@ -751,7 +751,7 @@ sal_uInt16 SwEditShell::GetCurLang() const { const SwPaM* pCrsr = GetCrsr(); const SwPosition& rPos = *pCrsr->GetPoint(); - const SwTxtNode* pTNd = rPos.nNode.GetNode().GetTxtNode(); + const SwTextNode* pTNd = rPos.nNode.GetNode().GetTextNode(); sal_uInt16 nLang; if( pTNd ) { @@ -771,7 +771,7 @@ sal_uInt16 SwEditShell::GetScalingOfSelectedText() const { const SwPaM* pCrsr = GetCrsr(); const SwPosition* pStt = pCrsr->Start(); - const SwTxtNode* pTNd = pStt->nNode.GetNode().GetTxtNode(); + const SwTextNode* pTNd = pStt->nNode.GetNode().GetTextNode(); OSL_ENSURE( pTNd, "no textnode available" ); sal_uInt16 nScaleWidth; @@ -783,7 +783,7 @@ sal_uInt16 SwEditShell::GetScalingOfSelectedText() const const sal_Int32 nStt = pStt->nContent.GetIndex(); const sal_Int32 nEnd = pStt->nNode == pEnd->nNode ? pEnd->nContent.GetIndex() - : pTNd->GetTxt().getLength(); + : pTNd->GetText().getLength(); nScaleWidth = pTNd->GetScalingOfSelectedText( nStt, nEnd ); } else diff --git a/sw/source/core/edit/eddel.cxx b/sw/source/core/edit/eddel.cxx index 48c376f63b7b..04c68f5e0447 100644 --- a/sw/source/core/edit/eddel.cxx +++ b/sw/source/core/edit/eddel.cxx @@ -71,21 +71,21 @@ void SwEditShell::DeleteSel( SwPaM& rPam, bool* pUndo ) { // then go to the end of the selection aDelPam.GetPoint()->nNode = rEndNd; - aDelPam.Move( fnMoveBackward, fnGoCntnt ); + aDelPam.Move( fnMoveBackward, fnGoContent ); } // skip protected boxes - if( !rNd.IsCntntNode() || + if( !rNd.IsContentNode() || !rNd.IsInProtectSect() ) { // delete everything GetDoc()->getIDocumentContentOperations().DeleteAndJoin( aDelPam ); - SaveTblBoxCntnt( aDelPam.GetPoint() ); + SaveTableBoxContent( aDelPam.GetPoint() ); } if( !pEndSelPos ) // at the end of a selection break; aDelPam.DeleteMark(); - aDelPam.Move( fnMoveForward, fnGoCntnt ); // next box + aDelPam.Move( fnMoveForward, fnGoContent ); // next box } while( pEndSelPos ); } else @@ -104,7 +104,7 @@ void SwEditShell::DeleteSel( SwPaM& rPam, bool* pUndo ) } // delete everything GetDoc()->getIDocumentContentOperations().DeleteAndJoin(*pPam); - SaveTblBoxCntnt( pPam->GetPoint() ); + SaveTableBoxContent( pPam->GetPoint() ); } // Selection is not needed anymore @@ -115,7 +115,7 @@ long SwEditShell::Delete() { SET_CURR_SHELL( this ); long nRet = 0; - if ( !HasReadonlySel() || CrsrInsideInputFld() ) + if ( !HasReadonlySel() || CrsrInsideInputField() ) { StartAllAction(); @@ -260,7 +260,7 @@ bool SwEditShell::Copy( SwEditShell* pDestShell ) SwPaM* pCrsr = pDestShell->GetCrsr(); pCrsr->SetMark(); pCrsr->GetPoint()->nNode = aSttNdIdx.GetIndex()+1; - pCrsr->GetPoint()->nContent.Assign( pCrsr->GetCntntNode(),nSttCntIdx); + pCrsr->GetPoint()->nContent.Assign( pCrsr->GetContentNode(),nSttCntIdx); pCrsr->Exchange(); } else @@ -275,9 +275,9 @@ bool SwEditShell::Copy( SwEditShell* pDestShell ) for(SwPaM& rCmp : pDestShell->GetCrsr()->GetRingContainer()) { OSL_ENSURE( rCmp.GetPoint()->nContent.GetIdxReg() - == rCmp.GetCntntNode(), "Point in wrong Node" ); + == rCmp.GetContentNode(), "Point in wrong Node" ); OSL_ENSURE( rCmp.GetMark()->nContent.GetIdxReg() - == rCmp.GetCntntNode(false), "Mark in wrong Node" ); + == rCmp.GetContentNode(false), "Mark in wrong Node" ); bool bTst = *rCmp.GetPoint() == *rCmp.GetMark(); (void) bTst; } @@ -288,7 +288,7 @@ bool SwEditShell::Copy( SwEditShell* pDestShell ) pDestShell->GetDoc()->GetIDocumentUndoRedo().EndUndo( UNDO_END, NULL ); pDestShell->EndAllAction(); - pDestShell->SaveTblBoxCntnt( pDestShell->GetCrsr()->GetPoint() ); + pDestShell->SaveTableBoxContent( pDestShell->GetCrsr()->GetPoint() ); return bRet; } @@ -316,7 +316,7 @@ bool SwEditShell::Replace( const OUString& rNewStr, bool bRegExpRplc ) { bRet = GetDoc()->getIDocumentContentOperations().ReplaceRange( rPaM, rNewStr, bRegExpRplc ) || bRet; - SaveTblBoxCntnt( rPaM.GetPoint() ); + SaveTableBoxContent( rPaM.GetPoint() ); } } diff --git a/sw/source/core/edit/edfcol.cxx b/sw/source/core/edit/edfcol.cxx index 0f1dd3366d47..b263122a5127 100644 --- a/sw/source/core/edit/edfcol.cxx +++ b/sw/source/core/edit/edfcol.cxx @@ -32,26 +32,26 @@ #include <swundo.hxx> #include <docary.hxx> -SwTxtFmtColl& SwEditShell::GetDfltTxtFmtColl() const +SwTextFormatColl& SwEditShell::GetDfltTextFormatColl() const { - return *static_cast<SwTxtFmtColl*>( (GetDoc()->GetDfltTxtFmtColl())); + return *static_cast<SwTextFormatColl*>( (GetDoc()->GetDfltTextFormatColl())); } -sal_uInt16 SwEditShell::GetTxtFmtCollCount() const +sal_uInt16 SwEditShell::GetTextFormatCollCount() const { - return GetDoc()->GetTxtFmtColls()->size(); + return GetDoc()->GetTextFormatColls()->size(); } -SwTxtFmtColl& SwEditShell::GetTxtFmtColl( sal_uInt16 nFmtColl) const +SwTextFormatColl& SwEditShell::GetTextFormatColl( sal_uInt16 nFormatColl) const { - return *((*(GetDoc()->GetTxtFmtColls()))[nFmtColl]); + return *((*(GetDoc()->GetTextFormatColls()))[nFormatColl]); } // #i62675# -void SwEditShell::SetTxtFmtColl(SwTxtFmtColl *pFmt, +void SwEditShell::SetTextFormatColl(SwTextFormatColl *pFormat, const bool bResetListAttrs) { - SwTxtFmtColl *pLocal = pFmt? pFmt: (*GetDoc()->GetTxtFmtColls())[0]; + SwTextFormatColl *pLocal = pFormat? pFormat: (*GetDoc()->GetTextFormatColls())[0]; StartAllAction(); SwRewriter aRewriter; @@ -64,16 +64,16 @@ void SwEditShell::SetTxtFmtColl(SwTxtFmtColl *pFmt, if ( !rPaM.HasReadonlySel( GetViewOptions()->IsFormView() ) ) { // Change the paragraph style to pLocal and remove all direct paragraph formatting. - GetDoc()->SetTxtFmtColl( rPaM, pLocal, true, bResetListAttrs ); + GetDoc()->SetTextFormatColl( rPaM, pLocal, true, bResetListAttrs ); // If there are hints on the nodes which cover the whole node, then remove those, too. SwPaM aPaM(*rPaM.Start(), *rPaM.End()); - if (SwTxtNode* pEndTxtNode = aPaM.End()->nNode.GetNode().GetTxtNode()) + if (SwTextNode* pEndTextNode = aPaM.End()->nNode.GetNode().GetTextNode()) { aPaM.Start()->nContent = 0; - aPaM.End()->nContent = pEndTxtNode->GetTxt().getLength(); + aPaM.End()->nContent = pEndTextNode->GetText().getLength(); } - GetDoc()->RstTxtAttrs(aPaM, /*bInclRefToxMark=*/false, /*bExactRange=*/true); + GetDoc()->RstTextAttrs(aPaM, /*bInclRefToxMark=*/false, /*bExactRange=*/true); } } @@ -81,29 +81,29 @@ void SwEditShell::SetTxtFmtColl(SwTxtFmtColl *pFmt, EndAllAction(); } -SwTxtFmtColl* SwEditShell::MakeTxtFmtColl(const OUString& rFmtCollName, - SwTxtFmtColl* pParent) +SwTextFormatColl* SwEditShell::MakeTextFormatColl(const OUString& rFormatCollName, + SwTextFormatColl* pParent) { - SwTxtFmtColl *pColl; + SwTextFormatColl *pColl; if ( pParent == 0 ) - pParent = &GetTxtFmtColl(0); - if ( (pColl=GetDoc()->MakeTxtFmtColl(rFmtCollName, pParent)) == 0 ) + pParent = &GetTextFormatColl(0); + if ( (pColl=GetDoc()->MakeTextFormatColl(rFormatCollName, pParent)) == 0 ) { - OSL_FAIL( "MakeTxtFmtColl failed" ); + OSL_FAIL( "MakeTextFormatColl failed" ); } return pColl; } -void SwEditShell::FillByEx(SwTxtFmtColl* pColl, bool bReset) +void SwEditShell::FillByEx(SwTextFormatColl* pColl, bool bReset) { if( bReset ) { - pColl->ResetAllFmtAttr(); + pColl->ResetAllFormatAttr(); } SwPaM * pCrsr = GetCrsr(); - SwCntntNode * pCnt = pCrsr->GetCntntNode(); + SwContentNode * pCnt = pCrsr->GetContentNode(); const SfxItemSet* pSet = pCnt->GetpSwAttrSet(); if( pSet ) { @@ -133,10 +133,10 @@ void SwEditShell::FillByEx(SwTxtFmtColl* pColl, bool bReset) aSet.ClearItem( RES_PARATR_NUMRULE ); if( aSet.Count() ) - GetDoc()->ChgFmt(*pColl, aSet ); + GetDoc()->ChgFormat(*pColl, aSet ); } else - GetDoc()->ChgFmt(*pColl, *pSet ); + GetDoc()->ChgFormat(*pColl, *pSet ); } } diff --git a/sw/source/core/edit/edfld.cxx b/sw/source/core/edit/edfld.cxx index 1afc33ca31d2..3bc69b30c123 100644 --- a/sw/source/core/edit/edfld.cxx +++ b/sw/source/core/edit/edfld.cxx @@ -42,19 +42,19 @@ #include <IDocumentContentOperations.hxx> /// count field types with a ResId, if 0 count all -sal_uInt16 SwEditShell::GetFldTypeCount(sal_uInt16 nResId, bool bUsed ) const +sal_uInt16 SwEditShell::GetFieldTypeCount(sal_uInt16 nResId, bool bUsed ) const { - const SwFldTypes* pFldTypes = GetDoc()->getIDocumentFieldsAccess().GetFldTypes(); + const SwFieldTypes* pFieldTypes = GetDoc()->getIDocumentFieldsAccess().GetFieldTypes(); if(nResId == USHRT_MAX) { if(!bUsed) - return static_cast<sal_uInt16>(pFldTypes->size()); + return static_cast<sal_uInt16>(pFieldTypes->size()); sal_uInt16 nUsed = 0; - for ( const auto pFldType : *pFldTypes ) + for ( const auto pFieldType : *pFieldTypes ) { - if(IsUsed(*pFldType)) + if(IsUsed(*pFieldType)) nUsed++; } return nUsed; @@ -62,32 +62,32 @@ sal_uInt16 SwEditShell::GetFldTypeCount(sal_uInt16 nResId, bool bUsed ) const // all types with the same ResId sal_uInt16 nIdx = 0; - for(const auto pFldType : *pFldTypes) + for(const auto pFieldType : *pFieldTypes) { // same ResId -> increment index - if(pFldType->Which() == nResId) + if(pFieldType->Which() == nResId) nIdx++; } return nIdx; } /// get field types with a ResId, if 0 get all -SwFieldType* SwEditShell::GetFldType(sal_uInt16 nFld, sal_uInt16 nResId, bool bUsed ) const +SwFieldType* SwEditShell::GetFieldType(sal_uInt16 nField, sal_uInt16 nResId, bool bUsed ) const { - const SwFldTypes* pFldTypes = GetDoc()->getIDocumentFieldsAccess().GetFldTypes(); + const SwFieldTypes* pFieldTypes = GetDoc()->getIDocumentFieldsAccess().GetFieldTypes(); - if(nResId == USHRT_MAX && nFld < pFldTypes->size()) + if(nResId == USHRT_MAX && nField < pFieldTypes->size()) { if(!bUsed) - return (*pFldTypes)[nFld]; + return (*pFieldTypes)[nField]; - SwFldTypes::size_type nUsed = 0; - for ( const auto pFldType : *pFldTypes ) + SwFieldTypes::size_type nUsed = 0; + for ( const auto pFieldType : *pFieldTypes ) { - if(IsUsed(*pFldType)) + if(IsUsed(*pFieldType)) { - if(nUsed == nFld) - return pFldType; + if(nUsed == nField) + return pFieldType; nUsed++; } } @@ -95,15 +95,15 @@ SwFieldType* SwEditShell::GetFldType(sal_uInt16 nFld, sal_uInt16 nResId, bool bU } sal_uInt16 nIdx = 0; - for(const auto pFldType : *pFldTypes) + for(const auto pFieldType : *pFieldTypes) { // same ResId -> increment index - if(pFldType->Which() == nResId) + if(pFieldType->Which() == nResId) { - if (!bUsed || IsUsed(*pFldType)) + if (!bUsed || IsUsed(*pFieldType)) { - if(nIdx == nFld) - return pFldType; + if(nIdx == nField) + return pFieldType; nIdx++; } } @@ -112,50 +112,50 @@ SwFieldType* SwEditShell::GetFldType(sal_uInt16 nFld, sal_uInt16 nResId, bool bU } /// get first type with given ResId and name -SwFieldType* SwEditShell::GetFldType(sal_uInt16 nResId, const OUString& rName) const +SwFieldType* SwEditShell::GetFieldType(sal_uInt16 nResId, const OUString& rName) const { - return GetDoc()->getIDocumentFieldsAccess().GetFldType( nResId, rName, false ); + return GetDoc()->getIDocumentFieldsAccess().GetFieldType( nResId, rName, false ); } /// delete field type -void SwEditShell::RemoveFldType(sal_uInt16 nFld, sal_uInt16 nResId) +void SwEditShell::RemoveFieldType(sal_uInt16 nField, sal_uInt16 nResId) { if( USHRT_MAX == nResId ) { - GetDoc()->getIDocumentFieldsAccess().RemoveFldType(nFld); + GetDoc()->getIDocumentFieldsAccess().RemoveFieldType(nField); return; } - const SwFldTypes* pFldTypes = GetDoc()->getIDocumentFieldsAccess().GetFldTypes(); + const SwFieldTypes* pFieldTypes = GetDoc()->getIDocumentFieldsAccess().GetFieldTypes(); sal_uInt16 nIdx = 0; - const SwFldTypes::size_type nSize = pFldTypes->size(); - for( SwFldTypes::size_type i = 0; i < nSize; ++i ) + const SwFieldTypes::size_type nSize = pFieldTypes->size(); + for( SwFieldTypes::size_type i = 0; i < nSize; ++i ) // Gleiche ResId -> Index erhoehen - if( (*pFldTypes)[i]->Which() == nResId && nIdx++ == nFld ) + if( (*pFieldTypes)[i]->Which() == nResId && nIdx++ == nField ) { - GetDoc()->getIDocumentFieldsAccess().RemoveFldType( i ); + GetDoc()->getIDocumentFieldsAccess().RemoveFieldType( i ); return; } } /// delete field type based on its name -void SwEditShell::RemoveFldType(sal_uInt16 nResId, const OUString& rStr) +void SwEditShell::RemoveFieldType(sal_uInt16 nResId, const OUString& rStr) { - const SwFldTypes* pFldTypes = GetDoc()->getIDocumentFieldsAccess().GetFldTypes(); - const SwFldTypes::size_type nSize = pFldTypes->size(); + const SwFieldTypes* pFieldTypes = GetDoc()->getIDocumentFieldsAccess().GetFieldTypes(); + const SwFieldTypes::size_type nSize = pFieldTypes->size(); const CharClass& rCC = GetAppCharClass(); OUString aTmp( rCC.lowercase( rStr )); - for(SwFldTypes::size_type i = 0; i < nSize; ++i) + for(SwFieldTypes::size_type i = 0; i < nSize; ++i) { // same ResId -> increment index - SwFieldType* pFldType = (*pFldTypes)[i]; - if( pFldType->Which() == nResId ) + SwFieldType* pFieldType = (*pFieldTypes)[i]; + if( pFieldType->Which() == nResId ) { - if( aTmp == rCC.lowercase( pFldType->GetName() ) ) + if( aTmp == rCC.lowercase( pFieldType->GetName() ) ) { - GetDoc()->getIDocumentFieldsAccess().RemoveFldType(i); + GetDoc()->getIDocumentFieldsAccess().RemoveFieldType(i); return; } } @@ -187,11 +187,11 @@ void SwEditShell::FieldToText( SwFieldType* pType ) } /// add a field at the cursor position -void SwEditShell::Insert2(SwField& rFld, const bool bForceExpandHints) +void SwEditShell::Insert2(SwField& rField, const bool bForceExpandHints) { SET_CURR_SHELL( this ); StartAllAction(); - SwFmtFld aFld( rFld ); + SwFormatField aField( rField ); const SetAttrMode nInsertFlags = (bForceExpandHints) ? SetAttrMode::FORCEHINTEXPAND @@ -199,7 +199,7 @@ void SwEditShell::Insert2(SwField& rFld, const bool bForceExpandHints) for(SwPaM& rPaM : GetCrsr()->GetRingContainer()) // for each PaM { - const bool bSuccess(GetDoc()->getIDocumentContentOperations().InsertPoolItem(rPaM, aFld, nInsertFlags)); + const bool bSuccess(GetDoc()->getIDocumentContentOperations().InsertPoolItem(rPaM, aField, nInsertFlags)); OSL_ENSURE( bSuccess, "Doc->Insert(Field) failed"); (void) bSuccess; } @@ -208,11 +208,11 @@ void SwEditShell::Insert2(SwField& rFld, const bool bForceExpandHints) } /// Are the PaMs positioned on fields? -static SwTxtFld* lcl_FindInputFld( SwDoc* pDoc, SwField& rFld ) +static SwTextField* lcl_FindInputField( SwDoc* pDoc, SwField& rField ) { // Search field via its address. For input fields this needs to be done in protected fields. - SwTxtFld* pTFld = 0; - if( RES_INPUTFLD == rFld.Which() ) + SwTextField* pTField = 0; + if( RES_INPUTFLD == rField.Which() ) { const sal_uInt32 nMaxItems = pDoc->GetAttrPool().GetItemCount2( RES_TXTATR_INPUTFIELD ); @@ -220,15 +220,15 @@ static SwTxtFld* lcl_FindInputFld( SwDoc* pDoc, SwField& rFld ) { const SfxPoolItem* pItem = NULL; if( 0 != (pItem = pDoc->GetAttrPool().GetItem2( RES_TXTATR_INPUTFIELD, n ) ) - && static_cast<const SwFmtFld*>(pItem)->GetField() == &rFld ) + && static_cast<const SwFormatField*>(pItem)->GetField() == &rField ) { - pTFld = const_cast<SwFmtFld*>(static_cast<const SwFmtFld*>(pItem))->GetTxtFld(); + pTField = const_cast<SwFormatField*>(static_cast<const SwFormatField*>(pItem))->GetTextField(); break; } } } - else if( RES_SETEXPFLD == rFld.Which() - && static_cast<SwSetExpField&>(rFld).GetInputFlag() ) + else if( RES_SETEXPFLD == rField.Which() + && static_cast<SwSetExpField&>(rField).GetInputFlag() ) { const sal_uInt32 nMaxItems = pDoc->GetAttrPool().GetItemCount2( RES_TXTATR_FIELD ); @@ -236,52 +236,52 @@ static SwTxtFld* lcl_FindInputFld( SwDoc* pDoc, SwField& rFld ) { const SfxPoolItem* pItem = NULL; if( 0 != (pItem = pDoc->GetAttrPool().GetItem2( RES_TXTATR_FIELD, n ) ) - && static_cast<const SwFmtFld*>(pItem)->GetField() == &rFld ) + && static_cast<const SwFormatField*>(pItem)->GetField() == &rField ) { - pTFld = const_cast<SwFmtFld*>(static_cast<const SwFmtFld*>(pItem))->GetTxtFld(); + pTField = const_cast<SwFormatField*>(static_cast<const SwFormatField*>(pItem))->GetTextField(); break; } } } - return pTFld; + return pTField; } -void SwEditShell::UpdateFlds( SwField &rFld ) +void SwEditShell::UpdateFields( SwField &rField ) { SET_CURR_SHELL( this ); StartAllAction(); { // // If there are no selections so take the value of the current cursor position. - SwMsgPoolItem* pMsgHnt = 0; - SwRefMarkFldUpdate aRefMkHt( GetOut() ); - sal_uInt16 nFldWhich = rFld.GetTyp()->Which(); - if( RES_GETREFFLD == nFldWhich ) - pMsgHnt = &aRefMkHt; + SwMsgPoolItem* pMsgHint = 0; + SwRefMarkFieldUpdate aRefMkHt( GetOut() ); + sal_uInt16 nFieldWhich = rField.GetTyp()->Which(); + if( RES_GETREFFLD == nFieldWhich ) + pMsgHint = &aRefMkHt; SwPaM* pCrsr = GetCrsr(); - SwTxtFld *pTxtFld; - SwFmtFld *pFmtFld; + SwTextField *pTextField; + SwFormatField *pFormatField; if ( !pCrsr->IsMultiSelection() && !pCrsr->HasMark()) { - pTxtFld = GetTxtFldAtPos( pCrsr->Start(), true ); + pTextField = GetTextFieldAtPos( pCrsr->Start(), true ); - if (!pTxtFld) // #i30221# - pTxtFld = lcl_FindInputFld( GetDoc(), rFld); + if (!pTextField) // #i30221# + pTextField = lcl_FindInputField( GetDoc(), rField); - if (pTxtFld != 0) - GetDoc()->getIDocumentFieldsAccess().UpdateFld(pTxtFld, rFld, pMsgHnt, true); + if (pTextField != 0) + GetDoc()->getIDocumentFieldsAccess().UpdateField(pTextField, rField, pMsgHint, true); } // bOkay (instead of return because of EndAllAction) becomes false, // 1) if only one PaM has more than one field or // 2) if there are mixed field types bool bOkay = true; - bool bTblSelBreak = false; + bool bTableSelBreak = false; - SwMsgPoolItem aFldHint( RES_TXTATR_FIELD ); // Search-Hint - SwMsgPoolItem aAnnotationFldHint( RES_TXTATR_ANNOTATION ); - SwMsgPoolItem aInputFldHint( RES_TXTATR_INPUTFIELD ); + SwMsgPoolItem aFieldHint( RES_TXTATR_FIELD ); // Search-Hint + SwMsgPoolItem aAnnotationFieldHint( RES_TXTATR_ANNOTATION ); + SwMsgPoolItem aInputFieldHint( RES_TXTATR_INPUTFIELD ); for(SwPaM& rPaM : GetCrsr()->GetRingContainer()) // for each PaM { if( rPaM.HasMark() && bOkay ) // ... with selection @@ -298,36 +298,36 @@ void SwEditShell::UpdateFlds( SwField &rFld ) * the loop terminates because Start = End. */ - // Search for SwTxtFld ... + // Search for SwTextField ... while( bOkay && pCurStt->nContent != pCurEnd->nContent - && ( aPam.Find( aFldHint, false, fnMoveForward, &aCurPam, true ) - || aPam.Find( aAnnotationFldHint, false, fnMoveForward, &aCurPam ) - || aPam.Find( aInputFldHint, false, fnMoveForward, &aCurPam ) ) ) + && ( aPam.Find( aFieldHint, false, fnMoveForward, &aCurPam, true ) + || aPam.Find( aAnnotationFieldHint, false, fnMoveForward, &aCurPam ) + || aPam.Find( aInputFieldHint, false, fnMoveForward, &aCurPam ) ) ) { // if only one PaM has more than one field ... if( aPam.Start()->nContent != pCurStt->nContent ) bOkay = false; - if( 0 != (pTxtFld = GetTxtFldAtPos( pCurStt, true )) ) + if( 0 != (pTextField = GetTextFieldAtPos( pCurStt, true )) ) { - pFmtFld = const_cast<SwFmtFld*>(&pTxtFld->GetFmtFld()); - SwField *pCurFld = pFmtFld->GetField(); + pFormatField = const_cast<SwFormatField*>(&pTextField->GetFormatField()); + SwField *pCurField = pFormatField->GetField(); // if there are mixed field types - if( pCurFld->GetTyp()->Which() != - rFld.GetTyp()->Which() ) + if( pCurField->GetTyp()->Which() != + rField.GetTyp()->Which() ) bOkay = false; - bTblSelBreak = GetDoc()->getIDocumentFieldsAccess().UpdateFld(pTxtFld, rFld, - pMsgHnt, false); + bTableSelBreak = GetDoc()->getIDocumentFieldsAccess().UpdateField(pTextField, rField, + pMsgHint, false); } // The search area is reduced by the found area: ++pCurStt->nContent; } } - if( bTblSelBreak ) // If table section and table formula are updated -> finish + if( bTableSelBreak ) // If table section and table formula are updated -> finish break; } @@ -364,11 +364,11 @@ void SwEditShell::ChangeDBFields( const std::vector<OUString>& rOldNames, } /// Update all expression fields -void SwEditShell::UpdateExpFlds(bool bCloseDB) +void SwEditShell::UpdateExpFields(bool bCloseDB) { SET_CURR_SHELL( this ); StartAllAction(); - GetDoc()->getIDocumentFieldsAccess().UpdateExpFlds(NULL, true); + GetDoc()->getIDocumentFieldsAccess().UpdateExpFields(NULL, true); if (bCloseDB) { #if HAVE_FEATURE_DBCONNECTIVITY @@ -388,27 +388,27 @@ SwDBManager* SwEditShell::GetDBManager() const } /// insert field type -SwFieldType* SwEditShell::InsertFldType(const SwFieldType& rFldType) +SwFieldType* SwEditShell::InsertFieldType(const SwFieldType& rFieldType) { - return GetDoc()->getIDocumentFieldsAccess().InsertFldType(rFldType); + return GetDoc()->getIDocumentFieldsAccess().InsertFieldType(rFieldType); } -void SwEditShell::LockExpFlds() +void SwEditShell::LockExpFields() { - GetDoc()->getIDocumentFieldsAccess().LockExpFlds(); + GetDoc()->getIDocumentFieldsAccess().LockExpFields(); } -void SwEditShell::UnlockExpFlds() +void SwEditShell::UnlockExpFields() { - GetDoc()->getIDocumentFieldsAccess().UnlockExpFlds(); + GetDoc()->getIDocumentFieldsAccess().UnlockExpFields(); } -void SwEditShell::SetFldUpdateFlags( SwFldUpdateFlags eFlags ) +void SwEditShell::SetFieldUpdateFlags( SwFieldUpdateFlags eFlags ) { getIDocumentSettingAccess()->setFieldUpdateFlags( eFlags ); } -SwFldUpdateFlags SwEditShell::GetFldUpdateFlags(bool bDocSettings) const +SwFieldUpdateFlags SwEditShell::GetFieldUpdateFlags(bool bDocSettings) const { return getIDocumentSettingAccess()->getFieldUpdateFlags( !bDocSettings ); } @@ -430,25 +430,25 @@ void SwEditShell::ChangeAuthorityData(const SwAuthEntry* pNewData) bool SwEditShell::IsAnyDatabaseFieldInDoc()const { - const SwFldTypes * pFldTypes = GetDoc()->getIDocumentFieldsAccess().GetFldTypes(); - for(const auto pFldType : *pFldTypes) + const SwFieldTypes * pFieldTypes = GetDoc()->getIDocumentFieldsAccess().GetFieldTypes(); + for(const auto pFieldType : *pFieldTypes) { - if(IsUsed(*pFldType)) + if(IsUsed(*pFieldType)) { - switch(pFldType->Which()) + switch(pFieldType->Which()) { case RES_DBFLD: case RES_DBNEXTSETFLD: case RES_DBNUMSETFLD: case RES_DBSETNUMBERFLD: { - SwIterator<SwFmtFld,SwFieldType> aIter( *pFldType ); - SwFmtFld* pFld = aIter.First(); - while(pFld) + SwIterator<SwFormatField,SwFieldType> aIter( *pFieldType ); + SwFormatField* pField = aIter.First(); + while(pField) { - if(pFld->IsFldInDoc()) + if(pField->IsFieldInDoc()) return true; - pFld = aIter.Next(); + pField = aIter.Next(); } } break; diff --git a/sw/source/core/edit/edfldexp.cxx b/sw/source/core/edit/edfldexp.cxx index 52de1dea2de2..74a7ae9204ae 100644 --- a/sw/source/core/edit/edfldexp.cxx +++ b/sw/source/core/edit/edfldexp.cxx @@ -37,25 +37,25 @@ using namespace com::sun::star; bool SwEditShell::IsFieldDataSourceAvailable(OUString& rUsedDataSource) const { - const SwFldTypes * pFldTypes = GetDoc()->getIDocumentFieldsAccess().GetFldTypes(); + const SwFieldTypes * pFieldTypes = GetDoc()->getIDocumentFieldsAccess().GetFieldTypes(); uno::Reference<uno::XComponentContext> xContext( ::comphelper::getProcessComponentContext() ); uno::Reference<sdb::XDatabaseContext> xDBContext = sdb::DatabaseContext::create(xContext); - for(const auto pFldType : *pFldTypes) + for(const auto pFieldType : *pFieldTypes) { - if(IsUsed(*pFldType)) + if(IsUsed(*pFieldType)) { - switch(pFldType->Which()) + switch(pFieldType->Which()) { case RES_DBFLD: { - SwIterator<SwFmtFld,SwFieldType> aIter( *pFldType ); - SwFmtFld* pFmtFld = aIter.First(); - while(pFmtFld) + SwIterator<SwFormatField,SwFieldType> aIter( *pFieldType ); + SwFormatField* pFormatField = aIter.First(); + while(pFormatField) { - if(pFmtFld->IsFldInDoc()) + if(pFormatField->IsFieldInDoc()) { const SwDBData& rData = - static_cast<SwDBFieldType*>(pFmtFld->GetField()->GetTyp())->GetDBData(); + static_cast<SwDBFieldType*>(pFormatField->GetField()->GetTyp())->GetDBData(); try { return xDBContext->getByName(rData.sDataSource).hasValue(); @@ -66,7 +66,7 @@ bool SwEditShell::IsFieldDataSourceAvailable(OUString& rUsedDataSource) const return false; } } - pFmtFld = aIter.Next(); + pFormatField = aIter.Next(); } } break; diff --git a/sw/source/core/edit/edfmt.cxx b/sw/source/core/edit/edfmt.cxx index 1c94fb77e469..a8502effbda2 100644 --- a/sw/source/core/edit/edfmt.cxx +++ b/sw/source/core/edit/edfmt.cxx @@ -29,41 +29,41 @@ #include "ndtxt.hxx" #include "hints.hxx" -sal_uInt16 SwEditShell::GetCharFmtCount() const +sal_uInt16 SwEditShell::GetCharFormatCount() const { - return GetDoc()->GetCharFmts()->size(); + return GetDoc()->GetCharFormats()->size(); } -SwCharFmt& SwEditShell::GetCharFmt(sal_uInt16 nFmt) const +SwCharFormat& SwEditShell::GetCharFormat(sal_uInt16 nFormat) const { - return *((*(GetDoc()->GetCharFmts()))[nFmt]); + return *((*(GetDoc()->GetCharFormats()))[nFormat]); } -SwCharFmt* SwEditShell::GetCurCharFmt() const +SwCharFormat* SwEditShell::GetCurCharFormat() const { - SwCharFmt *pFmt = 0; + SwCharFormat *pFormat = 0; SfxItemSet aSet( GetDoc()->GetAttrPool(), RES_TXTATR_CHARFMT, RES_TXTATR_CHARFMT ); const SfxPoolItem* pItem; if( GetCurAttr( aSet ) && SfxItemState::SET == aSet.GetItemState( RES_TXTATR_CHARFMT, false, &pItem ) ) - pFmt = static_cast<const SwFmtCharFmt*>(pItem)->GetCharFmt(); + pFormat = static_cast<const SwFormatCharFormat*>(pItem)->GetCharFormat(); - return pFmt; + return pFormat; } -void SwEditShell::FillByEx(SwCharFmt* pCharFmt, bool bReset) +void SwEditShell::FillByEx(SwCharFormat* pCharFormat, bool bReset) { if ( bReset ) { - pCharFmt->ResetAllFmtAttr(); + pCharFormat->ResetAllFormatAttr(); } SwPaM* pPam = GetCrsr(); - const SwCntntNode* pCNd = pPam->GetCntntNode(); - if( pCNd->IsTxtNode() ) + const SwContentNode* pCNd = pPam->GetContentNode(); + if( pCNd->IsTextNode() ) { - SwTxtNode const*const pTxtNode(pCNd->GetTxtNode()); + SwTextNode const*const pTextNode(pCNd->GetTextNode()); sal_Int32 nStt; sal_Int32 nEnd; if( pPam->HasMark() ) @@ -90,54 +90,54 @@ void SwEditShell::FillByEx(SwCharFmt* pCharFmt, bool bReset) nStt = 0; } else - nEnd = pTxtNode->GetTxt().getLength(); + nEnd = pTextNode->GetText().getLength(); } } else nStt = nEnd = pPam->GetPoint()->nContent.GetIndex(); SfxItemSet aSet( mpDoc->GetAttrPool(), - pCharFmt->GetAttrSet().GetRanges() ); - pTxtNode->GetAttr( aSet, nStt, nEnd ); - pCharFmt->SetFmtAttr( aSet ); + pCharFormat->GetAttrSet().GetRanges() ); + pTextNode->GetAttr( aSet, nStt, nEnd ); + pCharFormat->SetFormatAttr( aSet ); } else if( pCNd->HasSwAttrSet() ) - pCharFmt->SetFmtAttr( *pCNd->GetpSwAttrSet() ); + pCharFormat->SetFormatAttr( *pCNd->GetpSwAttrSet() ); } -size_t SwEditShell::GetTblFrmFmtCount(bool bUsed) const +size_t SwEditShell::GetTableFrameFormatCount(bool bUsed) const { - return GetDoc()->GetTblFrmFmtCount(bUsed); + return GetDoc()->GetTableFrameFormatCount(bUsed); } -SwFrmFmt& SwEditShell::GetTblFrmFmt(size_t nFmt, bool bUsed ) const +SwFrameFormat& SwEditShell::GetTableFrameFormat(size_t nFormat, bool bUsed ) const { - return GetDoc()->GetTblFrmFmt(nFmt, bUsed ); + return GetDoc()->GetTableFrameFormat(nFormat, bUsed ); } -OUString SwEditShell::GetUniqueTblName() const +OUString SwEditShell::GetUniqueTableName() const { - return GetDoc()->GetUniqueTblName(); + return GetDoc()->GetUniqueTableName(); } -SwCharFmt* SwEditShell::MakeCharFmt( const OUString& rName, - SwCharFmt* pDerivedFrom ) +SwCharFormat* SwEditShell::MakeCharFormat( const OUString& rName, + SwCharFormat* pDerivedFrom ) { if( !pDerivedFrom ) - pDerivedFrom = GetDoc()->GetDfltCharFmt(); + pDerivedFrom = GetDoc()->GetDfltCharFormat(); - return GetDoc()->MakeCharFmt( rName, pDerivedFrom ); + return GetDoc()->MakeCharFormat( rName, pDerivedFrom ); } -SwTxtFmtColl* SwEditShell::GetTxtCollFromPool( sal_uInt16 nId ) +SwTextFormatColl* SwEditShell::GetTextCollFromPool( sal_uInt16 nId ) { - return GetDoc()->getIDocumentStylePoolAccess().GetTxtCollFromPool( nId ); + return GetDoc()->getIDocumentStylePoolAccess().GetTextCollFromPool( nId ); } /// return the requested automatic format - base-class ! -SwFmt* SwEditShell::GetFmtFromPool( sal_uInt16 nId ) +SwFormat* SwEditShell::GetFormatFromPool( sal_uInt16 nId ) { - return GetDoc()->getIDocumentStylePoolAccess().GetFmtFromPool( nId ); + return GetDoc()->getIDocumentStylePoolAccess().GetFormatFromPool( nId ); } SwPageDesc* SwEditShell::GetPageDescFromPool( sal_uInt16 nId ) @@ -150,19 +150,19 @@ bool SwEditShell::IsUsed( const SwModify& rModify ) const return mpDoc->IsUsed( rModify ); } -const SwFlyFrmFmt* SwEditShell::FindFlyByName( const OUString& rName, sal_uInt8 nNdTyp ) const +const SwFlyFrameFormat* SwEditShell::FindFlyByName( const OUString& rName, sal_uInt8 nNdTyp ) const { return mpDoc->FindFlyByName(rName, nNdTyp); } -SwCharFmt* SwEditShell::FindCharFmtByName( const OUString& rName ) const +SwCharFormat* SwEditShell::FindCharFormatByName( const OUString& rName ) const { - return mpDoc->FindCharFmtByName( rName ); + return mpDoc->FindCharFormatByName( rName ); } -SwTxtFmtColl* SwEditShell::FindTxtFmtCollByName( const OUString& rName ) const +SwTextFormatColl* SwEditShell::FindTextFormatCollByName( const OUString& rName ) const { - return mpDoc->FindTxtFmtCollByName( rName ); + return mpDoc->FindTextFormatCollByName( rName ); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/edit/edglbldc.cxx b/sw/source/core/edit/edglbldc.cxx index 5666b73e3a8e..a5311bd8bce8 100644 --- a/sw/source/core/edit/edglbldc.cxx +++ b/sw/source/core/edit/edglbldc.cxx @@ -60,11 +60,11 @@ void SwEditShell::GetGlobalDocContent( SwGlblDocContents& rArr ) const // then all linked areas on the topmost level SwDoc* pMyDoc = GetDoc(); - const SwSectionFmts& rSectFmts = pMyDoc->GetSections(); + const SwSectionFormats& rSectFormats = pMyDoc->GetSections(); - for( auto n = rSectFmts.size(); n; ) + for( auto n = rSectFormats.size(); n; ) { - const SwSection* pSect = rSectFmts[ --n ]->GetGlobalDocSection(); + const SwSection* pSect = rSectFormats[ --n ]->GetGlobalDocSection(); if( pSect ) { SwGlblDocContent* pNew; @@ -95,7 +95,7 @@ void SwEditShell::GetGlobalDocContent( SwGlblDocContents& rArr ) const // Search from StartPos until rNew.DocPos for a content node. // If one exists then a dummy entry is needed. for( ; nSttIdx < rNew.GetDocPos(); ++nSttIdx ) - if( ( pNd = pMyDoc->GetNodes()[ nSttIdx ])->IsCntntNode() + if( ( pNd = pMyDoc->GetNodes()[ nSttIdx ])->IsContentNode() || pNd->IsSectionNode() || pNd->IsTableNode() ) { SwGlblDocContent* pNew = new SwGlblDocContent( nSttIdx ); @@ -116,7 +116,7 @@ void SwEditShell::GetGlobalDocContent( SwGlblDocContents& rArr ) const { sal_uLong nNdEnd = pMyDoc->GetNodes().GetEndOfContent().GetIndex(); for( ; nSttIdx < nNdEnd; ++nSttIdx ) - if( ( pNd = pMyDoc->GetNodes()[ nSttIdx ])->IsCntntNode() + if( ( pNd = pMyDoc->GetNodes()[ nSttIdx ])->IsContentNode() || pNd->IsSectionNode() || pNd->IsTableNode() ) { SwGlblDocContent* pNew = new SwGlblDocContent( nSttIdx ); @@ -151,15 +151,15 @@ bool SwEditShell::InsertGlobalDocContent( const SwGlblDocContent& rInsPos, bool bEndUndo = false; SwDoc* pMyDoc = GetDoc(); - SwTxtNode *const pTxtNd = rPos.nNode.GetNode().GetTxtNode(); - if( pTxtNd ) - rPos.nContent.Assign( pTxtNd, 0 ); + SwTextNode *const pTextNd = rPos.nNode.GetNode().GetTextNode(); + if( pTextNd ) + rPos.nContent.Assign( pTextNd, 0 ); else { bEndUndo = true; pMyDoc->GetIDocumentUndoRedo().StartUndo( UNDO_START, NULL ); --rPos.nNode; - pMyDoc->getIDocumentContentOperations().AppendTxtNode( rPos ); + pMyDoc->getIDocumentContentOperations().AppendTextNode( rPos ); pCrsr->SetMark(); } @@ -192,16 +192,16 @@ bool SwEditShell::InsertGlobalDocContent( const SwGlblDocContent& rInsPos, bool bEndUndo = false; SwDoc* pMyDoc = GetDoc(); - SwTxtNode* pTxtNd = rPos.nNode.GetNode().GetTxtNode(); - if (pTxtNd && pTxtNd->GetTxt().getLength() && rPos.nNode.GetIndex() + 1 != + SwTextNode* pTextNd = rPos.nNode.GetNode().GetTextNode(); + if (pTextNd && pTextNd->GetText().getLength() && rPos.nNode.GetIndex() + 1 != pMyDoc->GetNodes().GetEndOfContent().GetIndex() ) - rPos.nContent.Assign( pTxtNd, 0 ); + rPos.nContent.Assign( pTextNd, 0 ); else { bEndUndo = true; pMyDoc->GetIDocumentUndoRedo().StartUndo( UNDO_START, NULL ); --rPos.nNode; - pMyDoc->getIDocumentContentOperations().AppendTxtNode( rPos ); + pMyDoc->getIDocumentContentOperations().AppendTextNode( rPos ); } InsertTableOf( rTOX ); @@ -232,7 +232,7 @@ bool SwEditShell::InsertGlobalDocContent( const SwGlblDocContent& rInsPos ) rPos.nContent.Assign( 0, 0 ); SwDoc* pMyDoc = GetDoc(); - pMyDoc->getIDocumentContentOperations().AppendTxtNode( rPos ); + pMyDoc->getIDocumentContentOperations().AppendTextNode( rPos ); EndAllAction(); return true; } @@ -262,7 +262,7 @@ bool SwEditShell::DeleteGlobalDocContent( const SwGlblDocContents& rArr , rPos.nNode = nDelIdx - 1; rPos.nContent.Assign( 0, 0 ); - pMyDoc->getIDocumentContentOperations().AppendTxtNode( rPos ); + pMyDoc->getIDocumentContentOperations().AppendTextNode( rPos ); ++nDelIdx; } @@ -291,8 +291,8 @@ bool SwEditShell::DeleteGlobalDocContent( const SwGlblDocContents& rArr , case GLBLDOC_SECTION: { - SwSectionFmt* pSectFmt = const_cast<SwSectionFmt*>(rDelPos.GetSection()->GetFmt()); - pMyDoc->DelSectionFmt( pSectFmt, true ); + SwSectionFormat* pSectFormat = const_cast<SwSectionFormat*>(rDelPos.GetSection()->GetFormat()); + pMyDoc->DelSectionFormat( pSectFormat, true ); } break; } @@ -355,7 +355,7 @@ bool SwEditShell::GotoGlobalDocContent( const SwGlblDocContent& rPos ) rCrsrPos.nNode = rPos.GetDocPos(); SwDoc* pMyDoc = GetDoc(); - SwCntntNode * pCNd = rCrsrPos.nNode.GetNode().GetCntntNode(); + SwContentNode * pCNd = rCrsrPos.nNode.GetNode().GetContentNode(); if( !pCNd ) pCNd = pMyDoc->GetNodes().GoNext( &rCrsrPos.nNode ); @@ -377,7 +377,7 @@ SwGlblDocContent::SwGlblDocContent( const SwTOXBaseSection* pTOX ) eType = GLBLDOC_TOXBASE; PTR.pTOX = pTOX; - const SwSectionNode* pSectNd = pTOX->GetFmt()->GetSectionNode(); + const SwSectionNode* pSectNd = pTOX->GetFormat()->GetSectionNode(); nDocPos = pSectNd ? pSectNd->GetIndex() : 0; } @@ -386,7 +386,7 @@ SwGlblDocContent::SwGlblDocContent( const SwSection* pSect ) eType = GLBLDOC_SECTION; PTR.pSect = pSect; - const SwSectionNode* pSectNd = pSect->GetFmt()->GetSectionNode(); + const SwSectionNode* pSectNd = pSect->GetFormat()->GetSectionNode(); nDocPos = pSectNd ? pSectNd->GetIndex() : 0; } diff --git a/sw/source/core/edit/edglss.cxx b/sw/source/core/edit/edglss.cxx index 56475875d8b3..3ef28d49d274 100644 --- a/sw/source/core/edit/edglss.cxx +++ b/sw/source/core/edit/edglss.cxx @@ -45,7 +45,7 @@ void SwEditShell::InsertGlossary( SwTextBlocks& rGlossary, const OUString& rStr /// convert current selection into text block and add to the text block document, incl. templates sal_uInt16 SwEditShell::MakeGlossary( SwTextBlocks& rBlks, const OUString& rName, const OUString& rShortName, - bool bSaveRelFile, const OUString* pOnlyTxt ) + bool bSaveRelFile, const OUString* pOnlyText ) { SwDoc* pGDoc = rBlks.GetDoc(); @@ -57,8 +57,8 @@ sal_uInt16 SwEditShell::MakeGlossary( SwTextBlocks& rBlks, const OUString& rName } rBlks.SetBaseURL( sBase ); - if( pOnlyTxt ) - return rBlks.PutText( rShortName, rName, *pOnlyTxt ); + if( pOnlyText ) + return rBlks.PutText( rShortName, rName, *pOnlyText ); rBlks.ClearDoc(); if( rBlks.BeginPutDoc( rShortName, rName ) ) @@ -76,7 +76,7 @@ sal_uInt16 SwEditShell::SaveGlossaryDoc( SwTextBlocks& rBlock, const OUString& rName, const OUString& rShortName, bool bSaveRelFile, - bool bOnlyTxt ) + bool bOnlyText ) { StartAllAction(); @@ -92,28 +92,28 @@ sal_uInt16 SwEditShell::SaveGlossaryDoc( SwTextBlocks& rBlock, rBlock.SetBaseURL( sBase ); sal_uInt16 nRet = USHRT_MAX; - if( bOnlyTxt ) + if( bOnlyText ) { KillPams(); SwPaM* pCrsr = GetCrsr(); SwNodeIndex aStt( pMyDoc->GetNodes().GetEndOfExtras(), 1 ); - SwCntntNode* pCntntNd = pMyDoc->GetNodes().GoNext( &aStt ); - const SwNode* pNd = pCntntNd->FindTableNode(); + SwContentNode* pContentNd = pMyDoc->GetNodes().GoNext( &aStt ); + const SwNode* pNd = pContentNd->FindTableNode(); if( !pNd ) - pNd = pCntntNd; + pNd = pContentNd; pCrsr->GetPoint()->nNode = *pNd; - if( pNd == pCntntNd ) - pCrsr->GetPoint()->nContent.Assign( pCntntNd, 0 ); + if( pNd == pContentNd ) + pCrsr->GetPoint()->nContent.Assign( pContentNd, 0 ); pCrsr->SetMark(); // then until the end of the Node array pCrsr->GetPoint()->nNode = pMyDoc->GetNodes().GetEndOfContent().GetIndex()-1; - pCntntNd = pCrsr->GetCntntNode(); - if( pCntntNd ) - pCrsr->GetPoint()->nContent.Assign( pCntntNd, pCntntNd->Len() ); + pContentNd = pCrsr->GetContentNode(); + if( pContentNd ) + pCrsr->GetPoint()->nContent.Assign( pContentNd, pContentNd->Len() ); OUString sBuf; if( GetSelectedText( sBuf, GETSELTXT_PARABRK_TO_ONLYCR ) && !sBuf.isEmpty() ) @@ -125,21 +125,21 @@ sal_uInt16 SwEditShell::SaveGlossaryDoc( SwTextBlocks& rBlock, if( rBlock.BeginPutDoc( rShortName, rName ) ) { SwNodeIndex aStt( pMyDoc->GetNodes().GetEndOfExtras(), 1 ); - SwCntntNode* pCntntNd = pMyDoc->GetNodes().GoNext( &aStt ); - const SwNode* pNd = pCntntNd->FindTableNode(); - if( !pNd ) pNd = pCntntNd; + SwContentNode* pContentNd = pMyDoc->GetNodes().GoNext( &aStt ); + const SwNode* pNd = pContentNd->FindTableNode(); + if( !pNd ) pNd = pContentNd; SwPaM aCpyPam( *pNd ); aCpyPam.SetMark(); // then until the end of the nodes array aCpyPam.GetPoint()->nNode = pMyDoc->GetNodes().GetEndOfContent().GetIndex()-1; - pCntntNd = aCpyPam.GetCntntNode(); + pContentNd = aCpyPam.GetContentNode(); aCpyPam.GetPoint()->nContent.Assign( - pCntntNd, (pCntntNd) ? pCntntNd->Len() : 0); + pContentNd, (pContentNd) ? pContentNd->Len() : 0); aStt = pGDoc->GetNodes().GetEndOfExtras(); - pCntntNd = pGDoc->GetNodes().GoNext( &aStt ); - SwPosition aInsPos( aStt, SwIndex( pCntntNd )); + pContentNd = pGDoc->GetNodes().GoNext( &aStt ); + SwPosition aInsPos( aStt, SwIndex( pContentNd )); pMyDoc->getIDocumentContentOperations().CopyRange( aCpyPam, aInsPos, /*bCopyAll=*/false, /*bCheckPos=*/true ); nRet = rBlock.PutDoc(); @@ -157,7 +157,7 @@ bool SwEditShell::_CopySelToDoc( SwDoc* pInsDoc, SwNodeIndex* pSttNd ) SwNodes& rNds = pInsDoc->GetNodes(); SwNodeIndex aIdx( rNds.GetEndOfContent(), -1 ); - SwCntntNode *const pContentNode = aIdx.GetNode().GetCntntNode(); + SwContentNode *const pContentNode = aIdx.GetNode().GetContentNode(); SwPosition aPos( aIdx, SwIndex(pContentNode, (pContentNode) ? pContentNode->Len() : 0)); @@ -171,7 +171,7 @@ bool SwEditShell::_CopySelToDoc( SwDoc* pInsDoc, SwNodeIndex* pSttNd ) bool bRet = false; SET_CURR_SHELL( this ); - pInsDoc->getIDocumentFieldsAccess().LockExpFlds(); + pInsDoc->getIDocumentFieldsAccess().LockExpFields(); if( IsTableMode() ) { @@ -179,26 +179,26 @@ bool SwEditShell::_CopySelToDoc( SwDoc* pInsDoc, SwNodeIndex* pSttNd ) // selected boxes. The sizes are corrected on a percentage basis. // search boxes using the layout - SwTableNode* pTblNd; + SwTableNode* pTableNd; SwSelBoxes aBoxes; - GetTblSel( *this, aBoxes ); - if( !aBoxes.empty() && 0 != (pTblNd = const_cast<SwTableNode*>(aBoxes[0] + GetTableSel( *this, aBoxes ); + if( !aBoxes.empty() && 0 != (pTableNd = const_cast<SwTableNode*>(aBoxes[0] ->GetSttNd()->FindTableNode()) )) { // check if the table name can be copied - bool bCpyTblNm = aBoxes.size() == pTblNd->GetTable().GetTabSortBoxes().size(); - if( bCpyTblNm ) + bool bCpyTableNm = aBoxes.size() == pTableNd->GetTable().GetTabSortBoxes().size(); + if( bCpyTableNm ) { - const OUString rTblName = pTblNd->GetTable().GetFrmFmt()->GetName(); - const SwFrmFmts& rTblFmts = *pInsDoc->GetTblFrmFmts(); - for( auto n = rTblFmts.size(); n; ) - if( rTblFmts[ --n ]->GetName() == rTblName ) + const OUString rTableName = pTableNd->GetTable().GetFrameFormat()->GetName(); + const SwFrameFormats& rTableFormats = *pInsDoc->GetTableFrameFormats(); + for( auto n = rTableFormats.size(); n; ) + if( rTableFormats[ --n ]->GetName() == rTableName ) { - bCpyTblNm = false; + bCpyTableNm = false; break; } } - bRet = pInsDoc->InsCopyOfTbl( aPos, aBoxes, 0, bCpyTblNm, false ); + bRet = pInsDoc->InsCopyOfTable( aPos, aBoxes, 0, bCpyTableNm, false ); } else bRet = false; @@ -214,12 +214,12 @@ bool SwEditShell::_CopySelToDoc( SwDoc* pInsDoc, SwNodeIndex* pSttNd ) { if( !rPaM.HasMark() ) { - SwCntntNode *const pNd = rPaM.GetCntntNode(); + SwContentNode *const pNd = rPaM.GetContentNode(); if (0 != pNd && - ( bColSel || !pNd->GetTxtNode() ) ) + ( bColSel || !pNd->GetTextNode() ) ) { rPaM.SetMark(); - rPaM.Move( fnMoveForward, fnGoCntnt ); + rPaM.Move( fnMoveForward, fnGoContent ); bRet = GetDoc()->getIDocumentContentOperations().CopyRange( rPaM, aPos, /*bCopyAll=*/false, /*bCheckPos=*/true ) || bRet; rPaM.Exchange(); @@ -246,9 +246,9 @@ bool SwEditShell::_CopySelToDoc( SwDoc* pInsDoc, SwNodeIndex* pSttNd ) } } - pInsDoc->getIDocumentFieldsAccess().UnlockExpFlds(); - if( !pInsDoc->getIDocumentFieldsAccess().IsExpFldsLocked() ) - pInsDoc->getIDocumentFieldsAccess().UpdateExpFlds(NULL, true); + pInsDoc->getIDocumentFieldsAccess().UnlockExpFields(); + if( !pInsDoc->getIDocumentFieldsAccess().IsExpFieldsLocked() ) + pInsDoc->getIDocumentFieldsAccess().UpdateExpFields(NULL, true); // set the saved Node position back to the correct Node if( bRet && pSttNd ) @@ -266,7 +266,7 @@ bool SwEditShell::GetSelectedText( OUString &rBuf, int nHndlParaBrk ) GetCrsr(); // creates all cursors if needed if( IsSelOnePara() ) { - rBuf = GetSelTxt(); + rBuf = GetSelText(); if( GETSELTXT_PARABRK_TO_BLANK == nHndlParaBrk ) { rBuf = rBuf.replaceAll(OUString(0x0a), " "); diff --git a/sw/source/core/edit/editsh.cxx b/sw/source/core/edit/editsh.cxx index 74a7be25ed56..72d76a34b384 100644 --- a/sw/source/core/edit/editsh.cxx +++ b/sw/source/core/edit/editsh.cxx @@ -74,7 +74,7 @@ void SwEditShell::Insert( sal_Unicode c, bool bOnlyCurrCrsr ) OSL_ENSURE( bSuccess, "Doc->Insert() failed." ); (void) bSuccess; - SaveTblBoxCntnt( rPaM.GetPoint() ); + SaveTableBoxContent( rPaM.GetPoint() ); if( bOnlyCurrCrsr ) break; @@ -104,13 +104,13 @@ void SwEditShell::Insert2(const OUString &rStr, const bool bForceExpandHints ) GetDoc()->UpdateRsid( rCurrentCrsr, rStr.getLength() ); // Set paragraph rsid if beginning of paragraph - SwTxtNode *const pTxtNode = - rCurrentCrsr.GetPoint()->nNode.GetNode().GetTxtNode(); - if( pTxtNode && pTxtNode->Len() == 1) - GetDoc()->UpdateParRsid( pTxtNode ); + SwTextNode *const pTextNode = + rCurrentCrsr.GetPoint()->nNode.GetNode().GetTextNode(); + if( pTextNode && pTextNode->Len() == 1) + GetDoc()->UpdateParRsid( pTextNode ); } - SaveTblBoxCntnt( rCurrentCrsr.GetPoint() ); + SaveTableBoxContent( rCurrentCrsr.GetPoint() ); } } @@ -123,7 +123,7 @@ void SwEditShell::Insert2(const OUString &rStr, const bool bForceExpandHints ) if ( ! bDoNotSetBidiLevel ) { SwNode& rNode = pTmpCrsr->GetPoint()->nNode.GetNode(); - if ( rNode.IsTxtNode() ) + if ( rNode.IsTextNode() ) { SwIndex& rIdx = pTmpCrsr->GetPoint()->nContent; sal_Int32 nPos = rIdx.GetIndex(); @@ -131,25 +131,25 @@ void SwEditShell::Insert2(const OUString &rStr, const bool bForceExpandHints ) if ( nPrevPos ) --nPrevPos; - SwScriptInfo* pSI = SwScriptInfo::GetScriptInfo( static_cast<SwTxtNode&>(rNode), true ); + SwScriptInfo* pSI = SwScriptInfo::GetScriptInfo( static_cast<SwTextNode&>(rNode), true ); sal_uInt8 nLevel = 0; if ( ! pSI ) { // seems to be an empty paragraph. Point aPt; - SwCntntFrm* pFrm = - static_cast<SwTxtNode&>(rNode).getLayoutFrm( GetLayout(), &aPt, pTmpCrsr->GetPoint(), + SwContentFrm* pFrm = + static_cast<SwTextNode&>(rNode).getLayoutFrm( GetLayout(), &aPt, pTmpCrsr->GetPoint(), false ); SwScriptInfo aScriptInfo; - aScriptInfo.InitScriptInfo( static_cast<SwTxtNode&>(rNode), pFrm->IsRightToLeft() ); + aScriptInfo.InitScriptInfo( static_cast<SwTextNode&>(rNode), pFrm->IsRightToLeft() ); nLevel = aScriptInfo.DirType( nPrevPos ); } else { if ( COMPLETE_STRING != pSI->GetInvalidityA() ) - pSI->InitScriptInfo( static_cast<SwTxtNode&>(rNode) ); + pSI->InitScriptInfo( static_cast<SwTextNode&>(rNode) ); nLevel = pSI->DirType( nPrevPos ); } @@ -171,7 +171,7 @@ void SwEditShell::Overwrite(const OUString &rStr) { OSL_FAIL( "Doc->getIDocumentContentOperations().Overwrite(Str) failed." ); } - SaveTblBoxCntnt( rPaM.GetPoint() ); + SaveTableBoxContent( rPaM.GetPoint() ); } EndAllAction(); } @@ -191,15 +191,15 @@ long SwEditShell::SplitNode( bool bAutoFormat, bool bCheckTableStart ) GetDoc()->GetIDocumentUndoRedo().EndUndo(UNDO_EMPTY, NULL); if( bAutoFormat ) - AutoFmtBySplitNode(); + AutoFormatBySplitNode(); - ClearTblBoxCntnt(); + ClearTableBoxContent(); EndAllAction(); return 1L; } -bool SwEditShell::AppendTxtNode() +bool SwEditShell::AppendTextNode() { bool bRet = false; StartAllAction(); @@ -208,12 +208,12 @@ bool SwEditShell::AppendTxtNode() for(SwPaM& rPaM : GetCrsr()->GetRingContainer()) { GetDoc()->ClearBoxNumAttrs( rPaM.GetPoint()->nNode ); - bRet = GetDoc()->getIDocumentContentOperations().AppendTxtNode( *rPaM.GetPoint()) || bRet; + bRet = GetDoc()->getIDocumentContentOperations().AppendTextNode( *rPaM.GetPoint()) || bRet; } GetDoc()->GetIDocumentUndoRedo().EndUndo(UNDO_EMPTY, NULL); - ClearTblBoxCntnt(); + ClearTableBoxContent(); EndAllAction(); return bRet; @@ -270,13 +270,13 @@ sal_uInt16 SwEditShell::GetGraphicType() const // GetMark is not set or points to the same graphic bool SwEditShell::GetGrfSize(Size& rSz) const { - SwNoTxtNode* pNoTxtNd; + SwNoTextNode* pNoTextNd; SwPaM* pCurrentCrsr = GetCrsr(); if( ( !pCurrentCrsr->HasMark() || pCurrentCrsr->GetPoint()->nNode == pCurrentCrsr->GetMark()->nNode ) - && 0 != ( pNoTxtNd = pCurrentCrsr->GetNode().GetNoTxtNode() ) ) + && 0 != ( pNoTextNd = pCurrentCrsr->GetNode().GetNoTextNode() ) ) { - rSz = pNoTxtNd->GetTwipSize(); + rSz = pNoTextNd->GetTwipSize(); return true; } return false; @@ -295,11 +295,11 @@ void SwEditShell::ReRead( const OUString& rGrfName, const OUString& rFltName, /// Returns the name and the filter name of a graphic if the pointer is on a graphic. /// If a String-pointer is != 0 then return corresponding name. void SwEditShell::GetGrfNms( OUString* pGrfName, OUString* pFltName, - const SwFlyFrmFmt* pFmt ) const + const SwFlyFrameFormat* pFormat ) const { OSL_ENSURE( pGrfName || pFltName, "No parameters" ); - if( pFmt ) - SwDoc::GetGrfNms( *pFmt, pGrfName, pFltName ); + if( pFormat ) + SwDoc::GetGrfNms( *pFormat, pGrfName, pFltName ); else { SwGrfNode *pGrfNode = _GetGrfNode(); @@ -310,33 +310,33 @@ void SwEditShell::GetGrfNms( OUString* pGrfName, OUString* pFltName, const tools::PolyPolygon *SwEditShell::GetGraphicPolygon() const { - SwNoTxtNode *pNd = GetCrsr()->GetNode().GetNoTxtNode(); + SwNoTextNode *pNd = GetCrsr()->GetNode().GetNoTextNode(); return pNd->HasContour(); } void SwEditShell::SetGraphicPolygon( const tools::PolyPolygon *pPoly ) { - SwNoTxtNode *pNd = GetCrsr()->GetNode().GetNoTxtNode(); + SwNoTextNode *pNd = GetCrsr()->GetNode().GetNoTextNode(); StartAllAction(); pNd->SetContour( pPoly ); SwFlyFrm *pFly = static_cast<SwFlyFrm*>(pNd->getLayoutFrm(GetLayout())->GetUpper()); - const SwFmtSurround &rSur = pFly->GetFmt()->GetSurround(); - pFly->GetFmt()->NotifyClients( &rSur, &rSur ); + const SwFormatSurround &rSur = pFly->GetFormat()->GetSurround(); + pFly->GetFormat()->NotifyClients( &rSur, &rSur ); GetDoc()->getIDocumentState().SetModified(); EndAllAction(); } void SwEditShell::ClearAutomaticContour() { - SwNoTxtNode *pNd = GetCrsr()->GetNode().GetNoTxtNode(); - OSL_ENSURE( pNd, "is no NoTxtNode!" ); + SwNoTextNode *pNd = GetCrsr()->GetNode().GetNoTextNode(); + OSL_ENSURE( pNd, "is no NoTextNode!" ); if( pNd->HasAutomaticContour() ) { StartAllAction(); pNd->SetContour( NULL, false ); SwFlyFrm *pFly = static_cast<SwFlyFrm*>(pNd->getLayoutFrm(GetLayout())->GetUpper()); - const SwFmtSurround &rSur = pFly->GetFmt()->GetSurround(); - pFly->GetFmt()->NotifyClients( &rSur, &rSur ); + const SwFormatSurround &rSur = pFly->GetFormat()->GetSurround(); + pFly->GetFormat()->NotifyClients( &rSur, &rSur ); GetDoc()->getIDocumentState().SetModified(); EndAllAction(); } @@ -371,7 +371,7 @@ bool SwEditShell::HasOLEObj( const OUString &rName ) const ++aIdx; SwNode& rNd = aIdx.GetNode(); if( rNd.IsOLENode() && - rName == static_cast<SwOLENode&>(rNd).GetChartTblName() && + rName == static_cast<SwOLENode&>(rNd).GetChartTableName() && static_cast<SwOLENode&>(rNd).getLayoutFrm( GetLayout() ) ) return true; @@ -384,7 +384,7 @@ void SwEditShell::SetChartName( const OUString &rName ) { SwOLENode *pONd = GetCrsr()->GetNode().GetOLENode(); OSL_ENSURE( pONd, "ChartNode not found" ); - pONd->SetChartTblName( rName ); + pONd->SetChartTableName( rName ); } void SwEditShell::UpdateCharts( const OUString &rName ) @@ -393,16 +393,16 @@ void SwEditShell::UpdateCharts( const OUString &rName ) } /// change table name -void SwEditShell::SetTableName( SwFrmFmt& rTblFmt, const OUString &rNewName ) +void SwEditShell::SetTableName( SwFrameFormat& rTableFormat, const OUString &rNewName ) { - GetDoc()->SetTableName( rTblFmt, rNewName ); + GetDoc()->SetTableName( rTableFormat, rNewName ); } /// request current word OUString SwEditShell::GetCurWord() { const SwPaM& rPaM = *GetCrsr(); - const SwTxtNode* pNd = rPaM.GetNode().GetTxtNode(); + const SwTextNode* pNd = rPaM.GetNode().GetTextNode(); OUString aString = pNd ? pNd->GetCurWord(rPaM.GetPoint()->nContent.GetIndex()) : OUString(); @@ -427,7 +427,7 @@ const SwDocStat& SwEditShell::GetUpdatedDocStat() // OPT: eddocinl.cxx /// get the reference of a given name in the Doc -const SwFmtRefMark* SwEditShell::GetRefMark( const OUString& rName ) const +const SwFormatRefMark* SwEditShell::GetRefMark( const OUString& rName ) const { return GetDoc()->GetRefMark( rName ); } @@ -438,7 +438,7 @@ sal_uInt16 SwEditShell::GetRefMarks( std::vector<OUString>* pStrings ) const return GetDoc()->GetRefMarks( pStrings ); } -OUString SwEditShell::GetDropTxt( const sal_Int32 nChars ) const +OUString SwEditShell::GetDropText( const sal_Int32 nChars ) const { /* * pb: made changes for #i74939# @@ -446,7 +446,7 @@ OUString SwEditShell::GetDropTxt( const sal_Int32 nChars ) const * always return a string even though there is a selection */ - OUString aTxt; + OUString aText; SwPaM* pCrsr = GetCrsr(); if ( IsMultiSelection() ) { @@ -473,22 +473,22 @@ OUString SwEditShell::GetDropTxt( const sal_Int32 nChars ) const } } - SwTxtNode* pTxtNd = pCrsr->GetNode( !pCrsr->HasMark() ).GetTxtNode(); - if( pTxtNd ) + SwTextNode* pTextNd = pCrsr->GetNode( !pCrsr->HasMark() ).GetTextNode(); + if( pTextNd ) { - sal_Int32 nDropLen = pTxtNd->GetDropLen( nChars ); + sal_Int32 nDropLen = pTextNd->GetDropLen( nChars ); if( nDropLen ) - aTxt = pTxtNd->GetTxt().copy(0, nDropLen); + aText = pTextNd->GetText().copy(0, nDropLen); } - return aTxt; + return aText; } -void SwEditShell::ReplaceDropTxt( const OUString &rStr, SwPaM* pPaM ) +void SwEditShell::ReplaceDropText( const OUString &rStr, SwPaM* pPaM ) { SwPaM* pCrsr = pPaM ? pPaM : GetCrsr(); if( pCrsr->GetPoint()->nNode == pCrsr->GetMark()->nNode && - pCrsr->GetNode().GetTxtNode()->IsTxtNode() ) + pCrsr->GetNode().GetTextNode()->IsTextNode() ) { StartAllAction(); @@ -511,18 +511,18 @@ OUString SwEditShell::Calculate() for(SwPaM& rCurrentPaM : GetCrsr()->GetNext()->GetRingContainer()) { - SwTxtNode* pTxtNd = rCurrentPaM.GetNode().GetTxtNode(); - if(pTxtNd) + SwTextNode* pTextNd = rCurrentPaM.GetNode().GetTextNode(); + if(pTextNd) { const SwPosition *pStart = rCurrentPaM.Start(), *pEnd = rCurrentPaM.End(); const sal_Int32 nStt = pStart->nContent.GetIndex(); - OUString aStr = pTxtNd->GetExpandTxt( nStt, pEnd->nContent. + OUString aStr = pTextNd->GetExpandText( nStt, pEnd->nContent. GetIndex() - nStt ); aStr = rCC.lowercase( aStr ); sal_Unicode ch; - bool bValidFlds = false; + bool bValidFields = false; sal_Int32 nPos = 0; while( nPos < aStr.getLength() ) @@ -545,12 +545,12 @@ OUString SwEditShell::Calculate() (::Find( sVar, aCalc.GetVarTable(),TBLSZ) || aCalc.VarLook( sVar )) ) { - if( !bValidFlds ) + if( !bValidFields ) { - GetDoc()->getIDocumentFieldsAccess().FldsToCalc( aCalc, + GetDoc()->getIDocumentFieldsAccess().FieldsToCalc( aCalc, pStart->nNode.GetIndex(), pStart->nContent.GetIndex() ); - bValidFlds = true; + bValidFields = true; } aFormel += "(" + aCalc.GetStrResult( aCalc.VarLook( sVar )->nValue ) + ")"; } @@ -598,22 +598,22 @@ Graphic SwEditShell::GetIMapGraphic() const } else { - SwFlyFrm* pFlyFrm = rNd.GetCntntNode()->getLayoutFrm( GetLayout() )->FindFlyFrm(); + SwFlyFrm* pFlyFrm = rNd.GetContentNode()->getLayoutFrm( GetLayout() )->FindFlyFrm(); if(pFlyFrm) - aRet = pFlyFrm->GetFmt()->MakeGraphic(); + aRet = pFlyFrm->GetFormat()->MakeGraphic(); } } return aRet; } -bool SwEditShell::InsertURL( const SwFmtINetFmt& rFmt, const OUString& rStr, bool bKeepSelection ) +bool SwEditShell::InsertURL( const SwFormatINetFormat& rFormat, const OUString& rStr, bool bKeepSelection ) { // URL and hint text (directly or via selection) necessary - if( rFmt.GetValue().isEmpty() || ( rStr.isEmpty() && !HasSelection() ) ) + if( rFormat.GetValue().isEmpty() || ( rStr.isEmpty() && !HasSelection() ) ) return false; StartAllAction(); GetDoc()->GetIDocumentUndoRedo().StartUndo( UNDO_UI_INSERT_URLTXT, NULL); - bool bInsTxt = true; + bool bInsText = true; if( !rStr.isEmpty() ) { @@ -621,24 +621,24 @@ bool SwEditShell::InsertURL( const SwFmtINetFmt& rFmt, const OUString& rStr, boo if( pCrsr->HasMark() && *pCrsr->GetPoint() != *pCrsr->GetMark() ) { // Selection existent, multi selection? - bool bDelTxt = true; + bool bDelText = true; if( !pCrsr->IsMultiSelection() ) { // einfach Selection -> Text ueberpruefen - const OUString sTxt(comphelper::string::stripEnd(GetSelTxt(), ' ')); - if( sTxt == rStr ) - bDelTxt = bInsTxt = false; + const OUString sText(comphelper::string::stripEnd(GetSelText(), ' ')); + if( sText == rStr ) + bDelText = bInsText = false; } - else if( rFmt.GetValue() == rStr ) // Are Name and URL equal? - bDelTxt = bInsTxt = false; + else if( rFormat.GetValue() == rStr ) // Are Name and URL equal? + bDelText = bInsText = false; - if( bDelTxt ) + if( bDelText ) Delete(); } - else if( pCrsr->IsMultiSelection() && rFmt.GetValue() == rStr ) - bInsTxt = false; + else if( pCrsr->IsMultiSelection() && rFormat.GetValue() == rStr ) + bInsText = false; - if( bInsTxt ) + if( bInsText ) { Insert2( rStr ); SetMark(); @@ -646,15 +646,15 @@ bool SwEditShell::InsertURL( const SwFmtINetFmt& rFmt, const OUString& rStr, boo } } else - bInsTxt = false; + bInsText = false; - SetAttrItem( rFmt ); - if (bInsTxt && !IsCrsrPtAtEnd()) + SetAttrItem( rFormat ); + if (bInsText && !IsCrsrPtAtEnd()) SwapPam(); if(!bKeepSelection) ClearMark(); - if( bInsTxt ) - DontExpandFmt(); + if( bInsText ) + DontExpandFormat(); GetDoc()->GetIDocumentUndoRedo().EndUndo( UNDO_UI_INSERT_URLTXT, NULL ); EndAllAction(); return true; @@ -664,26 +664,26 @@ void SwEditShell::GetINetAttrs( SwGetINetAttrs& rArr ) { rArr.clear(); - const SwTxtNode* pTxtNd; - const SwCharFmts* pFmts = GetDoc()->GetCharFmts(); - for( auto n = pFmts->size(); 1 < n; ) + const SwTextNode* pTextNd; + const SwCharFormats* pFormats = GetDoc()->GetCharFormats(); + for( auto n = pFormats->size(); 1 < n; ) { - SwIterator<SwTxtINetFmt,SwCharFmt> aIter(*(*pFmts)[--n]); - for( SwTxtINetFmt* pFnd = aIter.First(); pFnd; pFnd = aIter.Next() ) + SwIterator<SwTextINetFormat,SwCharFormat> aIter(*(*pFormats)[--n]); + for( SwTextINetFormat* pFnd = aIter.First(); pFnd; pFnd = aIter.Next() ) { - if( 0 != ( pTxtNd = pFnd->GetpTxtNode()) && - pTxtNd->GetNodes().IsDocNodes() ) + if( 0 != ( pTextNd = pFnd->GetpTextNode()) && + pTextNd->GetNodes().IsDocNodes() ) { - SwTxtINetFmt& rAttr = *pFnd; - OUString sTxt( pTxtNd->GetExpandTxt( rAttr.GetStart(), + SwTextINetFormat& rAttr = *pFnd; + OUString sText( pTextNd->GetExpandText( rAttr.GetStart(), *rAttr.GetEnd() - rAttr.GetStart() ) ); - sTxt = comphelper::string::remove(sTxt, 0x0a); - sTxt = comphelper::string::strip(sTxt, ' '); + sText = comphelper::string::remove(sText, 0x0a); + sText = comphelper::string::strip(sText, ' '); - if( !sTxt.isEmpty() ) + if( !sText.isEmpty() ) { - SwGetINetAttr* pNew = new SwGetINetAttr( sTxt, rAttr ); + SwGetINetAttr* pNew = new SwGetINetAttr( sText, rAttr ); rArr.push_back( pNew ); } } @@ -695,17 +695,17 @@ void SwEditShell::GetINetAttrs( SwGetINetAttrs& rArr ) /// latter is needed for drag & drop) bool SwEditShell::DelINetAttrWithText() { - bool bRet = SelectTxtAttr( RES_TXTATR_INETFMT, false ); + bool bRet = SelectTextAttr( RES_TXTATR_INETFMT, false ); if( bRet ) DeleteSel( *GetCrsr() ); return bRet; } /// Set the DontExpand flag at the text character attributes -bool SwEditShell::DontExpandFmt() +bool SwEditShell::DontExpandFormat() { bool bRet = false; - if( !IsTableMode() && GetDoc()->DontExpandFmt( *GetCrsr()->GetPoint() )) + if( !IsTableMode() && GetDoc()->DontExpandFormat( *GetCrsr()->GetPoint() )) { bRet = true; CallChgLnk(); @@ -743,7 +743,7 @@ void SwEditShell::SetNumberingRestart() sal_uLong nEndNd = pEndPos->nNode.GetIndex(); if( nCurrNd <= nEndNd ) { - SwCntntFrm* pCntFrm; + SwContentFrm* pCntFrm; bool bGoOn = true; // iterate over all paragraphs while( bGoOn ) @@ -752,27 +752,27 @@ void SwEditShell::SetNumberingRestart() switch( pNd->GetNodeType() ) { case ND_TEXTNODE: - if( 0 != ( pCntFrm = static_cast<SwTxtNode*>(pNd)->getLayoutFrm( GetLayout() )) ) + if( 0 != ( pCntFrm = static_cast<SwTextNode*>(pNd)->getLayoutFrm( GetLayout() )) ) { // skip hidden frames - ignore protection! - if( !static_cast<SwTxtFrm*>(pCntFrm)->IsHiddenNow() ) + if( !static_cast<SwTextFrm*>(pCntFrm)->IsHiddenNow() ) { // if the node is numbered and the starting value of the numbering equals the // start value of the numbering rule then set this value as hard starting value // get the node num // OD 2005-11-09 - SwTxtNode* pTxtNd( pNd->GetTxtNode() ); - SwNumRule* pNumRule( pTxtNd->GetNumRule() ); + SwTextNode* pTextNd( pNd->GetTextNode() ); + SwNumRule* pNumRule( pTextNd->GetNumRule() ); bool bIsNodeNum = - ( pNumRule && pTxtNd->GetNum() && - ( pTxtNd->HasNumber() || pTxtNd->HasBullet() ) && - pTxtNd->IsCountedInList() && - !pTxtNd->IsListRestart() ); + ( pNumRule && pTextNd->GetNum() && + ( pTextNd->HasNumber() || pTextNd->HasBullet() ) && + pTextNd->IsCountedInList() && + !pTextNd->IsListRestart() ); if (bIsNodeNum) { - int nListLevel = pTxtNd->GetActualListLevel(); + int nListLevel = pTextNd->GetActualListLevel(); if (nListLevel < 0) nListLevel = 0; @@ -780,7 +780,7 @@ void SwEditShell::SetNumberingRestart() if (nListLevel >= MAXLEVEL) nListLevel = MAXLEVEL - 1; - bIsNodeNum = pTxtNd->GetNum()->GetNumber() == + bIsNodeNum = pTextNd->GetNum()->GetNumber() == pNumRule->Get( static_cast<sal_uInt16>(nListLevel) ).GetStart(); } if (bIsNodeNum) @@ -820,8 +820,8 @@ sal_uInt16 SwEditShell::GetLineCount( bool bActPos ) SwPaM* pPam = GetCrsr(); SwNodeIndex& rPtIdx = pPam->GetPoint()->nNode; SwNodeIndex aStart( rPtIdx ); - SwCntntNode* pCNd; - SwCntntFrm *pCntFrm = 0; + SwContentNode* pCNd; + SwContentFrm *pCntFrm = 0; sal_uLong nTmpPos; if( !bActPos ) @@ -831,13 +831,13 @@ sal_uInt16 SwEditShell::GetLineCount( bool bActPos ) aStart = nTmpPos + 1; else { - if( 0 != ( pCNd = pPam->GetCntntNode() ) && + if( 0 != ( pCNd = pPam->GetContentNode() ) && 0 != ( pCntFrm = pCNd->getLayoutFrm( GetLayout() ) ) ) { const SwStartNode *pTmp; if( pCntFrm->IsInFly() ) // Fly pTmp = pCNd->FindFlyStartNode(); - else if( pCntFrm->IsInFtn() ) // Footnote + else if( pCntFrm->IsInFootnote() ) // Footnote pTmp = pCNd->FindFootnoteStartNode(); else { // Footer/Header @@ -860,11 +860,11 @@ sal_uInt16 SwEditShell::GetLineCount( bool bActPos ) while( 0 != ( pCNd = GetDoc()->GetNodes().GoNextSection( &aStart, true, false )) && ( !bActPos || aStart <= rPtIdx ) ) { - if( 0 != ( pCntFrm = pCNd->getLayoutFrm( GetLayout() ) ) && pCntFrm->IsTxtFrm() ) + if( 0 != ( pCntFrm = pCNd->getLayoutFrm( GetLayout() ) ) && pCntFrm->IsTextFrm() ) { const sal_Int32 nActPos = bActPos && aStart == rPtIdx ? pPam->GetPoint()->nContent.GetIndex() : COMPLETE_STRING; - nRet = nRet + static_cast<SwTxtFrm*>(pCntFrm)->GetLineCount( nActPos ); + nRet = nRet + static_cast<SwTextFrm*>(pCntFrm)->GetLineCount( nActPos ); } } return nRet; @@ -886,16 +886,16 @@ long SwEditShell::MergeDoc( const SwDoc& rDoc ) return nRet; } -const SwFtnInfo& SwEditShell::GetFtnInfo() const +const SwFootnoteInfo& SwEditShell::GetFootnoteInfo() const { - return GetDoc()->GetFtnInfo(); + return GetDoc()->GetFootnoteInfo(); } -void SwEditShell::SetFtnInfo(const SwFtnInfo& rInfo) +void SwEditShell::SetFootnoteInfo(const SwFootnoteInfo& rInfo) { StartAllAction(); SET_CURR_SHELL( this ); - GetDoc()->SetFtnInfo(rInfo); + GetDoc()->SetFootnoteInfo(rInfo); CallChgLnk(); EndAllAction(); } diff --git a/sw/source/core/edit/edlingu.cxx b/sw/source/core/edit/edlingu.cxx index 5b1c2d993700..0371f88528d3 100644 --- a/sw/source/core/edit/edlingu.cxx +++ b/sw/source/core/edit/edlingu.cxx @@ -178,8 +178,8 @@ static SwHyphIter* pHyphIter = 0; // With that we save a GetFrm() in Hyphenate. // Caution: There are external declaration to these pointers in txtedt.cxx! -const SwTxtNode *pLinguNode; - SwTxtFrm *pLinguFrm; +const SwTextNode *pLinguNode; + SwTextFrm *pLinguFrm; SwLinguIter::SwLinguIter() : pSh(0) @@ -214,7 +214,7 @@ void SwLinguIter::_Start( SwEditShell *pShell, SwDocPositions eStart, bSetCurr = 0 != GetCurr(); nCrsrCnt = pSh->GetCrsrCnt(); if( pSh->IsTableMode() ) - pSh->TblCrsrToCursor(); + pSh->TableCrsrToCursor(); pSh->Push(); sal_uInt16 n; @@ -530,7 +530,7 @@ void SwHyphIter::DelSoftHyph( SwPaM &rPam ) const SwPosition* pStt = rPam.Start(); const sal_Int32 nStart = pStt->nContent.GetIndex(); const sal_Int32 nEnd = rPam.End()->nContent.GetIndex(); - SwTxtNode *pNode = pStt->nNode.GetNode().GetTxtNode(); + SwTextNode *pNode = pStt->nNode.GetNode().GetTextNode(); pNode->DelSoftHyph( nStart, nEnd ); } @@ -721,8 +721,8 @@ uno::Any SwEditShell::SpellContinue( * - add nLastHyphLen onto SelectionStart * - iterate over all selected areas * - pDoc->Hyphenate() iterates over all Nodes of a selection - * - pTxtNode->Hyphenate() calls SwTxtFrm::Hyphenate of the EditShell - * - SwTxtFrm:Hyphenate() iterates over all rows of the Pam + * - pTextNode->Hyphenate() calls SwTextFrm::Hyphenate of the EditShell + * - SwTextFrm:Hyphenate() iterates over all rows of the Pam * - LineIter::Hyphenate() sets the Hyphenator and the Pam based on * the to be separated word. * - Returns true if there is a hyphenation and false if the Pam is processed. @@ -831,10 +831,10 @@ uno::Reference< XSpellAlternatives > SwPosition aPos( *pCrsr->GetPoint() ); Point aPt( *pPt ); SwCrsrMoveState eTmpState( MV_SETONLYTEXT ); - SwTxtNode *pNode; + SwTextNode *pNode; SwWrongList *pWrong; if( GetLayout()->GetCrsrOfst( &aPos, aPt, &eTmpState ) && - 0 != (pNode = aPos.nNode.GetNode().GetTxtNode()) && + 0 != (pNode = aPos.nNode.GetNode().GetTextNode()) && 0 != (pWrong = pNode->GetWrong()) && !pNode->IsInProtectSect() ) { @@ -842,7 +842,7 @@ uno::Reference< XSpellAlternatives > sal_Int32 nLen = 1; if( pWrong->InWrongWord(nBegin,nLen) && !pNode->IsSymbol(nBegin) ) { - const OUString aText(pNode->GetTxt().copy(nBegin, nLen)); + const OUString aText(pNode->GetText().copy(nBegin, nLen)); OUString aWord( aText ); aWord = comphelper::string::remove(aWord, CH_TXTATR_BREAKWORD); aWord = comphelper::string::remove(aWord, CH_TXTATR_INWORD); @@ -912,13 +912,13 @@ uno::Reference< XSpellAlternatives > SwRect aStartRect; SwCrsrMoveState aState; aState.bRealWidth = true; - SwCntntNode* pCntntNode = pCrsr->GetCntntNode(); - SwCntntFrm *pCntntFrame = pCntntNode->getLayoutFrm( GetLayout(), pPt, pCrsr->GetPoint(), false); + SwContentNode* pContentNode = pCrsr->GetContentNode(); + SwContentFrm *pContentFrame = pContentNode->getLayoutFrm( GetLayout(), pPt, pCrsr->GetPoint(), false); - pCntntFrame->GetCharRect( aStartRect, *pCrsr->GetPoint(), &aState ); + pContentFrame->GetCharRect( aStartRect, *pCrsr->GetPoint(), &aState ); rContent = nWordEnd - 1; SwRect aEndRect; - pCntntFrame->GetCharRect( aEndRect, *pCrsr->GetPoint(),&aState ); + pContentFrame->GetCharRect( aEndRect, *pCrsr->GetPoint(),&aState ); rSelectRect = aStartRect.Union( aEndRect ); Pop(false); } @@ -943,10 +943,10 @@ bool SwEditShell::GetGrammarCorrection( SwPosition aPos( *pCrsr->GetPoint() ); Point aPt( *pPt ); SwCrsrMoveState eTmpState( MV_SETONLYTEXT ); - SwTxtNode *pNode; + SwTextNode *pNode; SwGrammarMarkUp *pWrong; if( GetLayout()->GetCrsrOfst( &aPos, aPt, &eTmpState ) && - 0 != (pNode = aPos.nNode.GetNode().GetTxtNode()) && + 0 != (pNode = aPos.nNode.GetNode().GetTextNode()) && 0 != (pWrong = pNode->GetGrammarCheck()) && !pNode->IsInProtectSect() ) { @@ -954,7 +954,7 @@ bool SwEditShell::GetGrammarCorrection( sal_Int32 nLen = 1; if (pWrong->InWrongWord(nBegin, nLen)) { - const OUString aText(pNode->GetTxt().copy(nBegin, nLen)); + const OUString aText(pNode->GetText().copy(nBegin, nLen)); uno::Reference< linguistic2::XProofreadingIterator > xGCIterator( mpDoc->GetGCIterator() ); if (xGCIterator.is()) @@ -1036,13 +1036,13 @@ bool SwEditShell::GetGrammarCorrection( SwRect aStartRect; SwCrsrMoveState aState; aState.bRealWidth = true; - SwCntntNode* pCntntNode = pCrsr->GetCntntNode(); - SwCntntFrm *pCntntFrame = pCntntNode->getLayoutFrm( GetLayout(), pPt, pCrsr->GetPoint(), false); + SwContentNode* pContentNode = pCrsr->GetContentNode(); + SwContentFrm *pContentFrame = pContentNode->getLayoutFrm( GetLayout(), pPt, pCrsr->GetPoint(), false); - pCntntFrame->GetCharRect( aStartRect, *pCrsr->GetPoint(), &aState ); + pContentFrame->GetCharRect( aStartRect, *pCrsr->GetPoint(), &aState ); rContent = nWordEnd - 1; SwRect aEndRect; - pCntntFrame->GetCharRect( aEndRect, *pCrsr->GetPoint(),&aState ); + pContentFrame->GetCharRect( aEndRect, *pCrsr->GetPoint(),&aState ); rSelectRect = aStartRect.Union( aEndRect ); Pop(false); } @@ -1262,21 +1262,21 @@ static SpellContentPositions lcl_CollectDeletedRedlines(SwEditShell* pSh) { SwPaM *pCrsr = pSh->GetCrsr(); const SwPosition* pStartPos = pCrsr->Start(); - const SwTxtNode* pTxtNode = pCrsr->GetNode().GetTxtNode(); + const SwTextNode* pTextNode = pCrsr->GetNode().GetTextNode(); - sal_uInt16 nAct = pDoc->getIDocumentRedlineAccess().GetRedlinePos( *pTxtNode, USHRT_MAX ); + sal_uInt16 nAct = pDoc->getIDocumentRedlineAccess().GetRedlinePos( *pTextNode, USHRT_MAX ); const sal_Int32 nStartIndex = pStartPos->nContent.GetIndex(); - for ( ; nAct < pDoc->getIDocumentRedlineAccess().GetRedlineTbl().size(); nAct++ ) + for ( ; nAct < pDoc->getIDocumentRedlineAccess().GetRedlineTable().size(); nAct++ ) { - const SwRangeRedline* pRed = pDoc->getIDocumentRedlineAccess().GetRedlineTbl()[ nAct ]; + const SwRangeRedline* pRed = pDoc->getIDocumentRedlineAccess().GetRedlineTable()[ nAct ]; - if ( pRed->Start()->nNode > pTxtNode->GetIndex() ) + if ( pRed->Start()->nNode > pTextNode->GetIndex() ) break; if( nsRedlineType_t::REDLINE_DELETE == pRed->GetType() ) { sal_Int32 nStart_, nEnd_; - pRed->CalcStartEnd( pTxtNode->GetIndex(), nStart_, nEnd_ ); + pRed->CalcStartEnd( pTextNode->GetIndex(), nStart_, nEnd_ ); sal_Int32 nStart = nStart_; sal_Int32 nEnd = nEnd_; if(nStart >= nStartIndex || nEnd >= nStartIndex) @@ -1427,7 +1427,7 @@ bool SwSpellIter::SpellSentence(svx::SpellPortions& rPortions, bool bIsGrammarCh pMySh->GoEndSentence(); if( bGrammarErrorFound ) { - const ModelToViewHelper aConversionMap(static_cast<SwTxtNode&>(pCrsr->GetNode())); + const ModelToViewHelper aConversionMap(static_cast<SwTextNode&>(pCrsr->GetNode())); OUString aExpandText = aConversionMap.getViewText(); sal_Int32 nSentenceEnd = aConversionMap.ConvertToViewPosition( aGrammarResult.nBehindEndOfSentencePosition ); @@ -1437,7 +1437,7 @@ bool SwSpellIter::SpellSentence(svx::SpellPortions& rPortions, bool bIsGrammarCh if( pCrsr->End()->nContent.GetIndex() < nSentenceEnd ) { pCrsr->End()->nContent.Assign( - pCrsr->End()->nNode.GetNode().GetCntntNode(), nSentenceEnd); + pCrsr->End()->nNode.GetNode().GetContentNode(), nSentenceEnd); } } @@ -1622,7 +1622,7 @@ void SwSpellIter::AddPortion(uno::Reference< XSpellAlternatives > xAlt, // iterate over the text to find changes in language // set the mark equal to the point *pCrsr->GetMark() = aStart; - SwTxtNode* pTxtNode = pCrsr->GetNode().GetTxtNode(); + SwTextNode* pTextNode = pCrsr->GetNode().GetTextNode(); LanguageType eStartLanguage = lcl_GetLanguage(*GetSh()); SpellContentPosition aNextRedline = lcl_FindNextDeletedRedline( rDeletedRedlines, aStart.nContent.GetIndex() ); @@ -1631,7 +1631,7 @@ void SwSpellIter::AddPortion(uno::Reference< XSpellAlternatives > xAlt, // select until the end of the current redline const sal_Int32 nEnd = aEnd.nContent.GetIndex() < aNextRedline.nRight ? aEnd.nContent.GetIndex() : aNextRedline.nRight; - pCrsr->GetPoint()->nContent.Assign( pTxtNode, nEnd ); + pCrsr->GetPoint()->nContent.Assign( pTextNode, nEnd ); CreatePortion(xAlt, pGrammarResult, false, true); aStart = *pCrsr->End(); // search for next redline @@ -1647,13 +1647,13 @@ void SwSpellIter::AddPortion(uno::Reference< XSpellAlternatives > xAlt, bool bField = false; // read the character at the current position to check if it's a field sal_Unicode const cChar = - pTxtNode->GetTxt()[pCrsr->GetMark()->nContent.GetIndex()]; + pTextNode->GetText()[pCrsr->GetMark()->nContent.GetIndex()]; if( CH_TXTATR_BREAKWORD == cChar || CH_TXTATR_INWORD == cChar) { - const SwTxtAttr* pTxtAttr = pTxtNode->GetTxtAttrForCharAt( + const SwTextAttr* pTextAttr = pTextNode->GetTextAttrForCharAt( pCrsr->GetMark()->nContent.GetIndex() ); - const sal_uInt16 nWhich = pTxtAttr - ? pTxtAttr->Which() + const sal_uInt16 nWhich = pTextAttr + ? pTextAttr->Which() : static_cast<sal_uInt16>(RES_TXTATR_END); switch (nWhich) { @@ -1708,7 +1708,7 @@ void SwSpellIter::AddPortion(uno::Reference< XSpellAlternatives > xAlt, // select until the end of the current redline const sal_Int32 nEnd = aEnd.nContent.GetIndex() < aNextRedline.nRight ? aEnd.nContent.GetIndex() : aNextRedline.nRight; - pCrsr->GetPoint()->nContent.Assign( pTxtNode, nEnd ); + pCrsr->GetPoint()->nContent.Assign( pTextNode, nEnd ); CreatePortion(xAlt, pGrammarResult, false, true); aStart = *pCrsr->End(); // search for next redline @@ -1726,7 +1726,7 @@ void SwSpellIter::AddPortion(uno::Reference< XSpellAlternatives > xAlt, void SwEditShell::IgnoreGrammarErrorAt( SwPaM& rErrorPosition ) { - SwTxtNode *pNode; + SwTextNode *pNode; SwWrongList *pWrong; SwNodeIndex aIdx = rErrorPosition.Start()->nNode; SwNodeIndex aEndIdx = rErrorPosition.Start()->nNode; @@ -1734,7 +1734,7 @@ void SwEditShell::IgnoreGrammarErrorAt( SwPaM& rErrorPosition ) sal_Int32 nEnd = COMPLETE_STRING; while( aIdx <= aEndIdx ) { - pNode = aIdx.GetNode().GetTxtNode(); + pNode = aIdx.GetNode().GetTextNode(); if( pNode ) { if( aIdx == aEndIdx ) nEnd = rErrorPosition.End()->nContent.GetIndex(); @@ -1744,7 +1744,7 @@ void SwEditShell::IgnoreGrammarErrorAt( SwPaM& rErrorPosition ) pWrong = pNode->GetWrong(); if( pWrong ) pWrong->RemoveEntry( nStart, nEnd ); - SwTxtFrm::repaintTextFrames( *pNode ); + SwTextFrm::repaintTextFrames( *pNode ); } ++aIdx; nStart = 0; diff --git a/sw/source/core/edit/ednumber.cxx b/sw/source/core/edit/ednumber.cxx index 2cb0d45c9c66..847747b4709f 100644 --- a/sw/source/core/edit/ednumber.cxx +++ b/sw/source/core/edit/ednumber.cxx @@ -100,10 +100,10 @@ SwPaM& SwPamRanges::SetPam( size_type nArrPos, SwPaM& rPam ) OSL_ASSERT( nArrPos < Count() ); const SwPamRange& rTmp = (*this)[ nArrPos ]; rPam.GetPoint()->nNode = rTmp.nStart; - rPam.GetPoint()->nContent.Assign( rPam.GetCntntNode(), 0 ); + rPam.GetPoint()->nContent.Assign( rPam.GetContentNode(), 0 ); rPam.SetMark(); rPam.GetPoint()->nNode = rTmp.nEnd; - rPam.GetPoint()->nContent.Assign( rPam.GetCntntNode(), 0 ); + rPam.GetPoint()->nContent.Assign( rPam.GetContentNode(), 0 ); return rPam; } @@ -150,9 +150,9 @@ bool SwEditShell::NoNum() bool SwEditShell::SelectionHasNumber() const { bool bResult = HasNumber(); - const SwTxtNode * pTxtNd = - GetCrsr()->GetPoint()->nNode.GetNode().GetTxtNode(); - if (!bResult && pTxtNd && pTxtNd->Len()==0 && !pTxtNd->GetNumRule()) { + const SwTextNode * pTextNd = + GetCrsr()->GetPoint()->nNode.GetNode().GetTextNode(); + if (!bResult && pTextNd && pTextNd->Len()==0 && !pTextNd->GetNumRule()) { SwPamRanges aRangeArr( *GetCrsr() ); SwPaM aPam( *GetCrsr()->GetPoint() ); for( SwPamRanges::size_type n = 0; n < aRangeArr.Count(); ++n ) @@ -167,15 +167,15 @@ bool SwEditShell::SelectionHasNumber() const } for (sal_uInt32 nPos = nStt; nPos<=nEnd; nPos++) { - pTxtNd = mpDoc->GetNodes()[nPos]->GetTxtNode(); - if (pTxtNd && pTxtNd->Len()!=0) + pTextNd = mpDoc->GetNodes()[nPos]->GetTextNode(); + if (pTextNd && pTextNd->Len()!=0) { - bResult = pTxtNd->HasNumber(); + bResult = pTextNd->HasNumber(); // #b6340308# special case: outline numbered, not counted paragraph if ( bResult && - pTxtNd->GetNumRule() == GetDoc()->GetOutlineNumRule() && - !pTxtNd->IsCountedInList() ) + pTextNd->GetNumRule() == GetDoc()->GetOutlineNumRule() && + !pTextNd->IsCountedInList() ) { bResult = false; } @@ -196,9 +196,9 @@ bool SwEditShell::SelectionHasNumber() const bool SwEditShell::SelectionHasBullet() const { bool bResult = HasBullet(); - const SwTxtNode * pTxtNd = - GetCrsr()->GetPoint()->nNode.GetNode().GetTxtNode(); - if (!bResult && pTxtNd && pTxtNd->Len()==0 && !pTxtNd->GetNumRule()) { + const SwTextNode * pTextNd = + GetCrsr()->GetPoint()->nNode.GetNode().GetTextNode(); + if (!bResult && pTextNd && pTextNd->Len()==0 && !pTextNd->GetNumRule()) { SwPamRanges aRangeArr( *GetCrsr() ); SwPaM aPam( *GetCrsr()->GetPoint() ); for( SwPamRanges::size_type n = 0; n < aRangeArr.Count(); ++n ) @@ -213,10 +213,10 @@ bool SwEditShell::SelectionHasBullet() const } for (sal_uInt32 nPos = nStt; nPos<=nEnd; nPos++) { - pTxtNd = mpDoc->GetNodes()[nPos]->GetTxtNode(); - if (pTxtNd && pTxtNd->Len()!=0) + pTextNd = mpDoc->GetNodes()[nPos]->GetTextNode(); + if (pTextNd && pTextNd->Len()!=0) { - bResult = pTxtNd->HasBullet(); + bResult = pTextNd->HasBullet(); if (!bResult) { break; @@ -235,17 +235,17 @@ bool SwEditShell::HasNumber() const { bool bResult = false; - const SwTxtNode * pTxtNd = - GetCrsr()->GetPoint()->nNode.GetNode().GetTxtNode(); + const SwTextNode * pTextNd = + GetCrsr()->GetPoint()->nNode.GetNode().GetTextNode(); - if (pTxtNd) + if (pTextNd) { - bResult = pTxtNd->HasNumber(); + bResult = pTextNd->HasNumber(); // special case: outline numbered, not counted paragraph if ( bResult && - pTxtNd->GetNumRule() == GetDoc()->GetOutlineNumRule() && - !pTxtNd->IsCountedInList() ) + pTextNd->GetNumRule() == GetDoc()->GetOutlineNumRule() && + !pTextNd->IsCountedInList() ) { bResult = false; } @@ -258,12 +258,12 @@ bool SwEditShell::HasBullet() const { bool bResult = false; - const SwTxtNode * pTxtNd = - GetCrsr()->GetPoint()->nNode.GetNode().GetTxtNode(); + const SwTextNode * pTextNd = + GetCrsr()->GetPoint()->nNode.GetNode().GetTextNode(); - if (pTxtNd) + if (pTextNd) { - bResult = pTxtNd->HasBullet(); + bResult = pTextNd->HasBullet(); } return bResult; @@ -344,8 +344,8 @@ void SwEditShell::ChangeIndentOfAllListLevels( const short nDiff ) if ( pCurNumRule != NULL ) { SwNumRule aRule(*pCurNumRule); - const SwNumFmt& aRootNumFmt(aRule.Get(0)); - if( nDiff > 0 || aRootNumFmt.GetIndentAt() + nDiff > 0) // fdo#42708 + const SwNumFormat& aRootNumFormat(aRule.Get(0)); + if( nDiff > 0 || aRootNumFormat.GetIndentAt() + nDiff > 0) // fdo#42708 { // #i90078# aRule.ChangeIndent( nDiff ); @@ -373,11 +373,11 @@ void SwEditShell::SetIndent(short nIndent, const SwPosition & rPos) } else { - const SwTxtNode* pTxtNode = rPos.nNode.GetNode().GetTxtNode(); - if ( pTxtNode != NULL - && pTxtNode->GetActualListLevel() >= 0 ) + const SwTextNode* pTextNode = rPos.nNode.GetNode().GetTextNode(); + if ( pTextNode != NULL + && pTextNode->GetActualListLevel() >= 0 ) { - aRule.SetIndent( nIndent, static_cast< sal_uInt16 >( pTxtNode->GetActualListLevel() ) ); + aRule.SetIndent( nIndent, static_cast< sal_uInt16 >( pTextNode->GetActualListLevel() ) ); } } @@ -413,9 +413,9 @@ int SwEditShell::GetCurrentParaOutlineLevel( ) const int nLevel = 0; SwPaM* pCrsr = GetCrsr(); - const SwTxtNode* pTxtNd = pCrsr->GetNode().GetTxtNode(); - if( pTxtNd ) - nLevel = pTxtNd->GetAttrOutlineLevel(); + const SwTextNode* pTextNd = pCrsr->GetNode().GetTextNode(); + if( pTextNd ) + nLevel = pTextNd->GetAttrOutlineLevel(); return nLevel; } @@ -465,15 +465,15 @@ bool SwEditShell::MoveNumParas( bool bUpperLower, bool bUpperLeft ) ( pNd = GetDoc()->GetNodes()[ nIdx ])->IsSectionNode() || ( pNd->IsEndNode() && pNd->StartOfSectionNode()->IsSectionNode()))) --nIdx; - if( GetDoc()->GetNodes()[ nIdx ]->IsTxtNode() ) + if( GetDoc()->GetNodes()[ nIdx ]->IsTextNode() ) nOffset = nIdx - nStt; } } else // move down { - const SwNumRule* pOrig = aCrsr.GetNode(false).GetTxtNode()->GetNumRule(); - if( aCrsr.GetNode().IsTxtNode() && - pOrig == aCrsr.GetNode().GetTxtNode()->GetNumRule() ) + const SwNumRule* pOrig = aCrsr.GetNode(false).GetTextNode()->GetNumRule(); + if( aCrsr.GetNode().IsTextNode() && + pOrig == aCrsr.GetNode().GetTextNode()->GetNumRule() ) { sal_uLong nStt = aCrsr.GetPoint()->nNode.GetIndex(), nIdx = nStt+1; @@ -483,8 +483,8 @@ bool SwEditShell::MoveNumParas( bool bUpperLower, bool bUpperLeft ) if (pNd->IsSectionNode() || ( pNd->IsEndNode() && pNd->StartOfSectionNode()->IsSectionNode()) || - ( pNd->IsTxtNode() && pOrig == static_cast<const SwTxtNode*>(pNd)->GetNumRule() && - static_cast<const SwTxtNode*>(pNd)->GetActualListLevel() > nUpperLevel )) + ( pNd->IsTextNode() && pOrig == static_cast<const SwTextNode*>(pNd)->GetNumRule() && + static_cast<const SwTextNode*>(pNd)->GetActualListLevel() > nUpperLevel )) { ++nIdx; } @@ -495,7 +495,7 @@ bool SwEditShell::MoveNumParas( bool bUpperLower, bool bUpperLeft ) } } - if( nStt == nIdx || !GetDoc()->GetNodes()[ nIdx ]->IsTxtNode() ) + if( nStt == nIdx || !GetDoc()->GetNodes()[ nIdx ]->IsTextNode() ) nOffset = 1; else nOffset = nIdx - nStt; @@ -558,7 +558,7 @@ bool SwEditShell::IsProtectedOutlinePara() const { bool bRet = false; const SwNode& rNd = GetCrsr()->Start()->nNode.GetNode(); - if( rNd.IsTxtNode() ) + if( rNd.IsTextNode() ) { const SwOutlineNodes& rOutlNd = GetDoc()->GetNodes().GetOutLineNds(); SwNodePtr pNd = const_cast<SwNodePtr>(&rNd); @@ -572,7 +572,7 @@ bool SwEditShell::IsProtectedOutlinePara() const { SwNodePtr pTmpNd = rOutlNd[ nPos ]; - int nTmpLvl = pTmpNd->GetTxtNode()->GetAttrOutlineLevel(); + int nTmpLvl = pTmpNd->GetTextNode()->GetAttrOutlineLevel(); OSL_ENSURE( nTmpLvl >= 0 && nTmpLvl <= MAXLEVEL, "<SwEditShell::IsProtectedOutlinePara()>" ); @@ -653,10 +653,10 @@ bool SwEditShell::IsNoNum( bool bChkStart ) const && !HasSelection() && ( !bChkStart || IsSttPara() ) ) { - const SwTxtNode* pTxtNd = GetCrsr()->GetNode().GetTxtNode(); - if ( pTxtNd != NULL ) + const SwTextNode* pTextNd = GetCrsr()->GetNode().GetTextNode(); + if ( pTextNd != NULL ) { - bResult = !pTxtNd->IsCountedInList(); + bResult = !pTextNd->IsCountedInList(); } } @@ -669,19 +669,19 @@ sal_uInt8 SwEditShell::GetNumLevel() const sal_uInt8 nLevel = MAXLEVEL; SwPaM* pCrsr = GetCrsr(); - const SwTxtNode* pTxtNd = pCrsr->GetNode().GetTxtNode(); + const SwTextNode* pTextNd = pCrsr->GetNode().GetTextNode(); - OSL_ENSURE( pTxtNd, "GetNumLevel() without text node" ); - if ( pTxtNd == NULL ) + OSL_ENSURE( pTextNd, "GetNumLevel() without text node" ); + if ( pTextNd == NULL ) return nLevel; - const SwNumRule* pRule = pTxtNd->GetNumRule(); + const SwNumRule* pRule = pTextNd->GetNumRule(); if ( pRule != NULL ) { - const int nListLevelOfTxtNode( pTxtNd->GetActualListLevel() ); - if ( nListLevelOfTxtNode >= 0 ) + const int nListLevelOfTextNode( pTextNd->GetActualListLevel() ); + if ( nListLevelOfTextNode >= 0 ) { - nLevel = static_cast<sal_uInt8>( nListLevelOfTxtNode ); + nLevel = static_cast<sal_uInt8>( nListLevelOfTextNode ); } } @@ -780,10 +780,10 @@ OUString SwEditShell::GetUniqueNumRuleName( const OUString* pChkStr, bool bAutoN return GetDoc()->GetUniqueNumRuleName( pChkStr, bAutoNum ); } -void SwEditShell::ChgNumRuleFmts( const SwNumRule& rRule ) +void SwEditShell::ChgNumRuleFormats( const SwNumRule& rRule ) { StartAllAction(); - GetDoc()->ChgNumRuleFmts( rRule ); + GetDoc()->ChgNumRuleFormats( rRule ); EndAllAction(); } @@ -817,8 +817,8 @@ void SwEditShell::SetNumRuleStart( bool bFlag, SwPaM* pPaM ) bool SwEditShell::IsNumRuleStart( SwPaM* pPaM ) const { SwPaM* pCrsr = pPaM ? pPaM : GetCrsr( ); - const SwTxtNode* pTxtNd = pCrsr->GetNode().GetTxtNode(); - return pTxtNd && pTxtNd->IsListRestart(); + const SwTextNode* pTextNd = pCrsr->GetNode().GetTextNode(); + return pTextNd && pTextNd->IsListRestart(); } void SwEditShell::SetNodeNumStart( sal_uInt16 nStt, SwPaM* pPaM ) @@ -844,13 +844,13 @@ void SwEditShell::SetNodeNumStart( sal_uInt16 nStt, SwPaM* pPaM ) sal_uInt16 SwEditShell::GetNodeNumStart( SwPaM* pPaM ) const { SwPaM* pCrsr = pPaM ? pPaM : GetCrsr(); - const SwTxtNode* pTxtNd = pCrsr->GetNode().GetTxtNode(); + const SwTextNode* pTextNd = pCrsr->GetNode().GetTextNode(); // correction: check, if list restart value is set at text node and - // use new method <SwTxtNode::GetAttrListRestartValue()>. + // use new method <SwTextNode::GetAttrListRestartValue()>. // return USHRT_MAX, if no list restart value is found. - if ( pTxtNd && pTxtNd->HasAttrListRestartValue() ) + if ( pTextNd && pTextNd->HasAttrListRestartValue() ) { - return static_cast<sal_uInt16>(pTxtNd->GetAttrListRestartValue()); + return static_cast<sal_uInt16>(pTextNd->GetAttrListRestartValue()); } return USHRT_MAX; } diff --git a/sw/source/core/edit/edredln.cxx b/sw/source/core/edit/edredln.cxx index c5bc2a46acaf..47be00cacd46 100644 --- a/sw/source/core/edit/edredln.cxx +++ b/sw/source/core/edit/edredln.cxx @@ -49,12 +49,12 @@ bool SwEditShell::IsRedlineOn() const sal_uInt16 SwEditShell::GetRedlineCount() const { - return GetDoc()->getIDocumentRedlineAccess().GetRedlineTbl().size(); + return GetDoc()->getIDocumentRedlineAccess().GetRedlineTable().size(); } const SwRangeRedline& SwEditShell::GetRedline( sal_uInt16 nPos ) const { - return *GetDoc()->getIDocumentRedlineAccess().GetRedlineTbl()[ nPos ]; + return *GetDoc()->getIDocumentRedlineAccess().GetRedlineTable()[ nPos ]; } static void lcl_InvalidateAll( SwViewShell* pSh ) @@ -143,10 +143,10 @@ void SwEditShell::UpdateRedlineAttr() */ sal_uInt16 SwEditShell::FindRedlineOfData( const SwRedlineData& rData ) const { - const SwRedlineTbl& rTbl = GetDoc()->getIDocumentRedlineAccess().GetRedlineTbl(); + const SwRedlineTable& rTable = GetDoc()->getIDocumentRedlineAccess().GetRedlineTable(); - for( sal_uInt16 i = 0, nCnt = rTbl.size(); i < nCnt; ++i ) - if( &rTbl[ i ]->GetRedlineData() == &rData ) + for( sal_uInt16 i = 0, nCnt = rTable.size(); i < nCnt; ++i ) + if( &rTable[ i ]->GetRedlineData() == &rData ) return i; return USHRT_MAX; } diff --git a/sw/source/core/edit/edsect.cxx b/sw/source/core/edit/edsect.cxx index 6dadbaa05a83..f508e1e5dc0d 100644 --- a/sw/source/core/edit/edsect.cxx +++ b/sw/source/core/edit/edsect.cxx @@ -88,7 +88,7 @@ SwSection* SwEditShell::GetAnySection( bool bOutOfTab, const Point* pPt ) SwPosition aPos( *GetCrsr()->GetPoint() ); Point aPt( *pPt ); GetLayout()->GetCrsrOfst( &aPos, aPt ); - SwCntntNode *pNd = aPos.nNode.GetNode().GetCntntNode(); + SwContentNode *pNd = aPos.nNode.GetNode().GetContentNode(); pFrm = pNd->getLayoutFrm( GetLayout(), pPt ); } else @@ -100,7 +100,7 @@ SwSection* SwEditShell::GetAnySection( bool bOutOfTab, const Point* pPt ) { SwSectionFrm* pSect = pFrm->FindSctFrm(); OSL_ENSURE( pSect, "GetAnySection: Where's my Sect?" ); - if( pSect->IsInFtn() && pSect->GetUpper()->IsInSct() ) + if( pSect->IsInFootnote() && pSect->GetUpper()->IsInSct() ) { pSect = pSect->GetUpper()->FindSctFrm(); OSL_ENSURE( pSect, "GetAnySection: Where's my SectFrm?" ); @@ -110,24 +110,24 @@ SwSection* SwEditShell::GetAnySection( bool bOutOfTab, const Point* pPt ) return NULL; } -size_t SwEditShell::GetSectionFmtCount() const +size_t SwEditShell::GetSectionFormatCount() const { return GetDoc()->GetSections().size(); } bool SwEditShell::IsAnySectionInDoc( bool bChkReadOnly, bool bChkHidden, bool bChkTOX ) const { - const SwSectionFmts& rFmts = GetDoc()->GetSections(); + const SwSectionFormats& rFormats = GetDoc()->GetSections(); - for( const SwSectionFmt* pFmt : rFmts ) + for( const SwSectionFormat* pFormat : rFormats ) { SectionType eTmpType; - if( pFmt->IsInNodesArr() && + if( pFormat->IsInNodesArr() && (bChkTOX || - ( (eTmpType = pFmt->GetSection()->GetType()) != TOX_CONTENT_SECTION + ( (eTmpType = pFormat->GetSection()->GetType()) != TOX_CONTENT_SECTION && TOX_HEADER_SECTION != eTmpType ) ) ) { - const SwSection& rSect = *pFmt->GetSection(); + const SwSection& rSect = *pFormat->GetSection(); if( (!bChkReadOnly && !bChkHidden ) || (bChkReadOnly && rSect.IsProtectFlag() ) || (bChkHidden && rSect.IsHiddenFlag() ) ) @@ -137,21 +137,21 @@ bool SwEditShell::IsAnySectionInDoc( bool bChkReadOnly, bool bChkHidden, bool bC return false; } -size_t SwEditShell::GetSectionFmtPos( const SwSectionFmt& rFmt ) const +size_t SwEditShell::GetSectionFormatPos( const SwSectionFormat& rFormat ) const { - SwSectionFmt* pFmt = const_cast<SwSectionFmt*>(&rFmt); - return GetDoc()->GetSections().GetPos( pFmt ); + SwSectionFormat* pFormat = const_cast<SwSectionFormat*>(&rFormat); + return GetDoc()->GetSections().GetPos( pFormat ); } -const SwSectionFmt& SwEditShell::GetSectionFmt(size_t nFmt) const +const SwSectionFormat& SwEditShell::GetSectionFormat(size_t nFormat) const { - return *GetDoc()->GetSections()[ nFmt ]; + return *GetDoc()->GetSections()[ nFormat ]; } -void SwEditShell::DelSectionFmt(size_t nFmt) +void SwEditShell::DelSectionFormat(size_t nFormat) { StartAllAction(); - GetDoc()->DelSectionFmt( GetDoc()->GetSections()[ nFmt ] ); + GetDoc()->DelSectionFormat( GetDoc()->GetSections()[ nFormat ] ); // Call the AttrChangeNotify on the UI page. CallChgLnk(); EndAllAction(); @@ -173,10 +173,10 @@ OUString SwEditShell::GetUniqueSectionName( const OUString* pChkStr ) const } void SwEditShell::SetSectionAttr( const SfxItemSet& rSet, - SwSectionFmt* pSectFmt ) + SwSectionFormat* pSectFormat ) { - if( pSectFmt ) - _SetSectionAttr( *pSectFmt, rSet ); + if( pSectFormat ) + _SetSectionAttr( *pSectFormat, rSet ); else { // for all section in the selection @@ -192,10 +192,10 @@ void SwEditShell::SetSectionAttr( const SfxItemSet& rSet, if( pSttSectNd || pEndSectNd ) { if( pSttSectNd ) - _SetSectionAttr( *pSttSectNd->GetSection().GetFmt(), + _SetSectionAttr( *pSttSectNd->GetSection().GetFormat(), rSet ); if( pEndSectNd && pSttSectNd != pEndSectNd ) - _SetSectionAttr( *pEndSectNd->GetSection().GetFmt(), + _SetSectionAttr( *pEndSectNd->GetSection().GetFormat(), rSet ); if( pSttSectNd && pEndSectNd ) @@ -215,7 +215,7 @@ void SwEditShell::SetSectionAttr( const SfxItemSet& rSet, || ( aSIdx.GetNode().IsEndNode() && 0 != ( pSttSectNd = aSIdx.GetNode(). StartOfSectionNode()->GetSectionNode())) ) - _SetSectionAttr( *pSttSectNd->GetSection().GetFmt(), + _SetSectionAttr( *pSttSectNd->GetSection().GetFormat(), rSet ); ++aSIdx; } @@ -226,7 +226,7 @@ void SwEditShell::SetSectionAttr( const SfxItemSet& rSet, } } -void SwEditShell::_SetSectionAttr( SwSectionFmt& rSectFmt, +void SwEditShell::_SetSectionAttr( SwSectionFormat& rSectFormat, const SfxItemSet& rSet ) { StartAllAction(); @@ -234,10 +234,10 @@ void SwEditShell::_SetSectionAttr( SwSectionFmt& rSectFmt, { SfxItemSet aSet(rSet); aSet.ClearItem(RES_CNTNT); - GetDoc()->SetAttr( aSet, rSectFmt ); + GetDoc()->SetAttr( aSet, rSectFormat ); } else - GetDoc()->SetAttr( rSet, rSectFmt ); + GetDoc()->SetAttr( rSet, rSectFormat ); // Call the AttrChangeNotify on the UI page. CallChgLnk(); @@ -256,10 +256,10 @@ sal_uInt16 SwEditShell::GetFullSelectedSectionCount() const const SwPosition* pStt = rPaM.Start(), * pEnd = rPaM.End(); - const SwCntntNode* pCNd; + const SwContentNode* pCNd; // check the selection, if Start at Node begin and End at Node end if( pStt->nContent.GetIndex() || - ( 0 == ( pCNd = pEnd->nNode.GetNode().GetCntntNode() )) || + ( 0 == ( pCNd = pEnd->nNode.GetNode().GetContentNode() )) || pCNd->Len() != pEnd->nContent.GetIndex() ) { nRet = 0; @@ -351,7 +351,7 @@ static const SwNode* lcl_SpecialInsertNode(const SwPosition* pCurrentPos) // - we're at or just before a start node // - there are only start nodes between the current and pInnermostNode SwNodeIndex aBegin( pCurrentPos->nNode ); - if( rCurrentNode.IsCntntNode() && + if( rCurrentNode.IsContentNode() && (pCurrentPos->nContent.GetIndex() == 0)) --aBegin; while( (aBegin != pInnermostNode->GetIndex()) && @@ -364,9 +364,9 @@ static const SwNode* lcl_SpecialInsertNode(const SwPosition* pCurrentPos) // - there are only end nodes between the current node and // pInnermostNode's end node SwNodeIndex aEnd( pCurrentPos->nNode ); - if( rCurrentNode.IsCntntNode() && + if( rCurrentNode.IsContentNode() && ( pCurrentPos->nContent.GetIndex() == - rCurrentNode.GetCntntNode()->Len() ) ) + rCurrentNode.GetContentNode()->Len() ) ) ++aEnd; while( (aEnd != pInnermostNode->EndOfSectionNode()->GetIndex()) && aEnd.GetNode().IsEndNode() ) @@ -415,7 +415,7 @@ bool SwEditShell::DoSpecialInsert() SwPosition aInsertPos( aInsertIndex ); // insert a new text node, and set the cursor - bRet = GetDoc()->getIDocumentContentOperations().AppendTxtNode( aInsertPos ); + bRet = GetDoc()->getIDocumentContentOperations().AppendTextNode( aInsertPos ); *pCursorPos = aInsertPos; // call AttrChangeNotify for the UI diff --git a/sw/source/core/edit/edtab.cxx b/sw/source/core/edit/edtab.cxx index 39693a8923d6..d6c8ec33d14c 100644 --- a/sw/source/core/edit/edtab.cxx +++ b/sw/source/core/edit/edtab.cxx @@ -90,10 +90,10 @@ bool ConvertTableToText( const SwTableNode *pConstTableNode, sal_Unicode cCh ) } //End for bug #i119954# -const SwTable& SwEditShell::InsertTable( const SwInsertTableOptions& rInsTblOpts, +const SwTable& SwEditShell::InsertTable( const SwInsertTableOptions& rInsTableOpts, sal_uInt16 nRows, sal_uInt16 nCols, sal_Int16 eAdj, - const SwTableAutoFmt* pTAFmt ) + const SwTableAutoFormat* pTAFormat ) { StartAllAction(); SwPosition* pPos = GetCrsr()->GetPoint(); @@ -107,9 +107,9 @@ const SwTable& SwEditShell::InsertTable( const SwInsertTableOptions& rInsTblOpts // If called from a shell the adjust item is propagated // from pPos to the new content nodes in the table. - const SwTable *pTable = GetDoc()->InsertTable( rInsTblOpts, *pPos, + const SwTable *pTable = GetDoc()->InsertTable( rInsTableOpts, *pPos, nRows, nCols, - eAdj, pTAFmt, + eAdj, pTAFormat, 0, true ); if( bEndUndo ) EndUndo( UNDO_END ); @@ -118,10 +118,10 @@ const SwTable& SwEditShell::InsertTable( const SwInsertTableOptions& rInsTblOpts return *pTable; } -bool SwEditShell::TextToTable( const SwInsertTableOptions& rInsTblOpts, +bool SwEditShell::TextToTable( const SwInsertTableOptions& rInsTableOpts, sal_Unicode cCh, sal_Int16 eAdj, - const SwTableAutoFmt* pTAFmt ) + const SwTableAutoFormat* pTAFormat ) { SwWait aWait( *GetDoc()->GetDocShell(), true ); bool bRet = false; @@ -129,8 +129,8 @@ bool SwEditShell::TextToTable( const SwInsertTableOptions& rInsTblOpts, for(SwPaM& rPaM : GetCrsr()->GetRingContainer()) { if( rPaM.HasMark() ) - bRet |= 0 != GetDoc()->TextToTable( rInsTblOpts, rPaM, cCh, - eAdj, pTAFmt ); + bRet |= 0 != GetDoc()->TextToTable( rInsTableOpts, rPaM, cCh, + eAdj, pTAFormat ); } EndAllAction(); return bRet; @@ -141,26 +141,26 @@ bool SwEditShell::TableToText( sal_Unicode cCh ) SwWait aWait( *GetDoc()->GetDocShell(), true ); bool bRet = false; SwPaM* pCrsr = GetCrsr(); - const SwTableNode* pTblNd = - GetDoc()->IsIdxInTbl( pCrsr->GetPoint()->nNode ); + const SwTableNode* pTableNd = + GetDoc()->IsIdxInTable( pCrsr->GetPoint()->nNode ); if( IsTableMode() ) { ClearMark(); pCrsr = GetCrsr(); } - else if( !pTblNd || pCrsr->GetNext() != pCrsr ) + else if( !pTableNd || pCrsr->GetNext() != pCrsr ) return bRet; // TL_CHART2: // tell the charts about the table to be deleted and have them use their own data - GetDoc()->getIDocumentChartDataProviderAccess().CreateChartInternalDataProviders( &pTblNd->GetTable() ); + GetDoc()->getIDocumentChartDataProviderAccess().CreateChartInternalDataProviders( &pTableNd->GetTable() ); StartAllAction(); // move current Cursor out of the listing area - SwNodeIndex aTabIdx( *pTblNd ); + SwNodeIndex aTabIdx( *pTableNd ); pCrsr->DeleteMark(); - pCrsr->GetPoint()->nNode = *pTblNd->EndOfSectionNode(); + pCrsr->GetPoint()->nNode = *pTableNd->EndOfSectionNode(); pCrsr->GetPoint()->nContent.Assign( 0, 0 ); // move sPoint and Mark out of the area! pCrsr->SetMark(); @@ -168,14 +168,14 @@ bool SwEditShell::TableToText( sal_Unicode cCh ) //Modified for bug #i119954# Application crashed if undo/redo covert nest table to text StartUndo(); - bRet = ConvertTableToText( pTblNd, cCh ); + bRet = ConvertTableToText( pTableNd, cCh ); EndUndo(); //End for bug #i119954# pCrsr->GetPoint()->nNode = aTabIdx; - SwCntntNode* pCNd = pCrsr->GetCntntNode(); + SwContentNode* pCNd = pCrsr->GetContentNode(); if( !pCNd ) - pCrsr->Move( fnMoveForward, fnGoCntnt ); + pCrsr->Move( fnMoveForward, fnGoContent ); else pCrsr->GetPoint()->nContent.Assign( pCNd, 0 ); @@ -198,7 +198,7 @@ bool SwEditShell::IsTextToTableAvailable() const if( nStt > nEnd ) { sal_uLong n = nStt; nStt = nEnd; nEnd = n; } for( ; nStt <= nEnd; ++nStt ) - if( !GetDoc()->GetNodes()[ nStt ]->IsTxtNode() ) + if( !GetDoc()->GetNodes()[ nStt ]->IsTextNode() ) { bOnlyText = false; break; @@ -212,7 +212,7 @@ bool SwEditShell::IsTextToTableAvailable() const return bOnlyText; } -void SwEditShell::InsertDDETable( const SwInsertTableOptions& rInsTblOpts, +void SwEditShell::InsertDDETable( const SwInsertTableOptions& rInsTableOpts, SwDDEFieldType* pDDEType, sal_uInt16 nRows, sal_uInt16 nCols, sal_Int16 eAdj ) @@ -228,15 +228,15 @@ void SwEditShell::InsertDDETable( const SwInsertTableOptions& rInsTblOpts, GetDoc()->getIDocumentContentOperations().SplitNode( *pPos, false ); } - const SwInsertTableOptions aInsTblOpts( rInsTblOpts.mnInsMode | tabopts::DEFAULT_BORDER, - rInsTblOpts.mnRowsToRepeat ); - SwTable* pTbl = const_cast<SwTable*>(GetDoc()->InsertTable( aInsTblOpts, *pPos, + const SwInsertTableOptions aInsTableOpts( rInsTableOpts.mnInsMode | tabopts::DEFAULT_BORDER, + rInsTableOpts.mnRowsToRepeat ); + SwTable* pTable = const_cast<SwTable*>(GetDoc()->InsertTable( aInsTableOpts, *pPos, nRows, nCols, eAdj )); - SwTableNode* pTblNode = const_cast<SwTableNode*>(pTbl->GetTabSortBoxes()[ 0 ]-> + SwTableNode* pTableNode = const_cast<SwTableNode*>(pTable->GetTabSortBoxes()[ 0 ]-> GetSttNd()->FindTableNode()); - SwDDETable* pDDETbl = new SwDDETable( *pTbl, pDDEType ); - pTblNode->SetNewTable( pDDETbl ); // setze die DDE-Tabelle + SwDDETable* pDDETable = new SwDDETable( *pTable, pDDEType ); + pTableNode->SetNewTable( pDDETable ); // setze die DDE-Tabelle if( bEndUndo ) EndUndo( UNDO_END ); @@ -247,17 +247,17 @@ void SwEditShell::InsertDDETable( const SwInsertTableOptions& rInsTblOpts, /** update fields of a listing */ void SwEditShell::UpdateTable() { - const SwTableNode* pTblNd = IsCrsrInTbl(); + const SwTableNode* pTableNd = IsCrsrInTable(); // Keine Arme keine Kekse - if( pTblNd ) + if( pTableNd ) { StartAllAction(); if( DoesUndo() ) StartUndo(); - EndAllTblBoxEdit(); - SwTableFmlUpdate aTblUpdate( &pTblNd->GetTable() ); - GetDoc()->getIDocumentFieldsAccess().UpdateTblFlds( &aTblUpdate ); + EndAllTableBoxEdit(); + SwTableFormulaUpdate aTableUpdate( &pTableNd->GetTable() ); + GetDoc()->getIDocumentFieldsAccess().UpdateTableFields( &aTableUpdate ); if( DoesUndo() ) EndUndo(); EndAllAction(); @@ -266,24 +266,24 @@ void SwEditShell::UpdateTable() // get/set Change Mode -TblChgMode SwEditShell::GetTblChgMode() const +TableChgMode SwEditShell::GetTableChgMode() const { - TblChgMode eMode; - const SwTableNode* pTblNd = IsCrsrInTbl(); - if( pTblNd ) - eMode = pTblNd->GetTable().GetTblChgMode(); + TableChgMode eMode; + const SwTableNode* pTableNd = IsCrsrInTable(); + if( pTableNd ) + eMode = pTableNd->GetTable().GetTableChgMode(); else - eMode = GetTblChgDefaultMode(); + eMode = GetTableChgDefaultMode(); return eMode; } -void SwEditShell::SetTblChgMode( TblChgMode eMode ) +void SwEditShell::SetTableChgMode( TableChgMode eMode ) { - const SwTableNode* pTblNd = IsCrsrInTbl(); + const SwTableNode* pTableNd = IsCrsrInTable(); - if( pTblNd ) + if( pTableNd ) { - const_cast<SwTable&>(pTblNd->GetTable()).SetTblChgMode( eMode ); + const_cast<SwTable&>(pTableNd->GetTable()).SetTableChgMode( eMode ); if( !GetDoc()->getIDocumentState().IsModified() ) // Bug 57028 { GetDoc()->GetIDocumentUndoRedo().SetUndoNoResetModified(); @@ -292,11 +292,11 @@ void SwEditShell::SetTblChgMode( TblChgMode eMode ) } } -bool SwEditShell::GetTblBoxFormulaAttrs( SfxItemSet& rSet ) const +bool SwEditShell::GetTableBoxFormulaAttrs( SfxItemSet& rSet ) const { SwSelBoxes aBoxes; if( IsTableMode() ) - ::GetTblSelCrs( *this, aBoxes ); + ::GetTableSelCrs( *this, aBoxes ); else { do { @@ -315,30 +315,30 @@ bool SwEditShell::GetTblBoxFormulaAttrs( SfxItemSet& rSet ) const for (size_t n = 0; n < aBoxes.size(); ++n) { const SwTableBox* pSelBox = aBoxes[ n ]; - const SwTableBoxFmt* pTblFmt = static_cast<SwTableBoxFmt*>(pSelBox->GetFrmFmt()); + const SwTableBoxFormat* pTableFormat = static_cast<SwTableBoxFormat*>(pSelBox->GetFrameFormat()); if( !n ) { // Convert formulae into external presentation - const SwTable& rTbl = pSelBox->GetSttNd()->FindTableNode()->GetTable(); + const SwTable& rTable = pSelBox->GetSttNd()->FindTableNode()->GetTable(); - SwTableFmlUpdate aTblUpdate( &rTbl ); - aTblUpdate.eFlags = TBL_BOXNAME; - static_cast<SwDoc*>(GetDoc())->getIDocumentFieldsAccess().UpdateTblFlds( &aTblUpdate ); + SwTableFormulaUpdate aTableUpdate( &rTable ); + aTableUpdate.eFlags = TBL_BOXNAME; + static_cast<SwDoc*>(GetDoc())->getIDocumentFieldsAccess().UpdateTableFields( &aTableUpdate ); - rSet.Put( pTblFmt->GetAttrSet() ); + rSet.Put( pTableFormat->GetAttrSet() ); } else - rSet.MergeValues( pTblFmt->GetAttrSet() ); + rSet.MergeValues( pTableFormat->GetAttrSet() ); } return 0 != rSet.Count(); } -void SwEditShell::SetTblBoxFormulaAttrs( const SfxItemSet& rSet ) +void SwEditShell::SetTableBoxFormulaAttrs( const SfxItemSet& rSet ) { SET_CURR_SHELL( this ); SwSelBoxes aBoxes; if( IsTableMode() ) - ::GetTblSelCrs( *this, aBoxes ); + ::GetTableSelCrs( *this, aBoxes ); else { do { @@ -356,13 +356,13 @@ void SwEditShell::SetTblBoxFormulaAttrs( const SfxItemSet& rSet ) // When setting a formula, do not check further! if( SfxItemState::SET == rSet.GetItemState( RES_BOXATR_FORMULA )) - ClearTblBoxCntnt(); + ClearTableBoxContent(); StartAllAction(); GetDoc()->GetIDocumentUndoRedo().StartUndo( UNDO_START, NULL ); for (size_t n = 0; n < aBoxes.size(); ++n) { - GetDoc()->SetTblBoxFormulaAttrs( *aBoxes[ n ], rSet ); + GetDoc()->SetTableBoxFormulaAttrs( *aBoxes[ n ], rSet ); } GetDoc()->GetIDocumentUndoRedo().EndUndo( UNDO_END, NULL ); EndAllAction(); @@ -386,26 +386,26 @@ bool SwEditShell::IsTableBoxTextFormat() const if( !pBox ) return false; - sal_uInt32 nFmt = 0; + sal_uInt32 nFormat = 0; const SfxPoolItem* pItem; - if( SfxItemState::SET == pBox->GetFrmFmt()->GetAttrSet().GetItemState( + if( SfxItemState::SET == pBox->GetFrameFormat()->GetAttrSet().GetItemState( RES_BOXATR_FORMAT, true, &pItem )) { - nFmt = static_cast<const SwTblBoxNumFormat*>(pItem)->GetValue(); - return GetDoc()->GetNumberFormatter()->IsTextFormat( nFmt ) || - static_cast<sal_uInt32>(css::util::NumberFormat::TEXT) == nFmt; + nFormat = static_cast<const SwTableBoxNumFormat*>(pItem)->GetValue(); + return GetDoc()->GetNumberFormatter()->IsTextFormat( nFormat ) || + static_cast<sal_uInt32>(css::util::NumberFormat::TEXT) == nFormat; } - sal_uLong nNd = pBox->IsValidNumTxtNd(); + sal_uLong nNd = pBox->IsValidNumTextNd(); if( ULONG_MAX == nNd ) return true; - const OUString& rTxt = GetDoc()->GetNodes()[ nNd ]->GetTxtNode()->GetTxt(); - if( rTxt.isEmpty() ) + const OUString& rText = GetDoc()->GetNodes()[ nNd ]->GetTextNode()->GetText(); + if( rText.isEmpty() ) return false; double fVal; - return !GetDoc()->GetNumberFormatter()->IsNumberFormat( rTxt, nFmt, fVal ); + return !GetDoc()->GetNumberFormatter()->IsNumberFormat( rText, nFormat, fVal ); } OUString SwEditShell::GetTableBoxText() const @@ -424,8 +424,8 @@ OUString SwEditShell::GetTableBoxText() const } sal_uLong nNd; - if( pBox && ULONG_MAX != ( nNd = pBox->IsValidNumTxtNd() ) ) - sRet = GetDoc()->GetNodes()[ nNd ]->GetTxtNode()->GetTxt(); + if( pBox && ULONG_MAX != ( nNd = pBox->IsValidNumTextNd() ) ) + sRet = GetDoc()->GetNodes()[ nNd ]->GetTextNode()->GetText(); } return sRet; } @@ -470,22 +470,22 @@ bool SwEditShell::CanMergeTable( bool bWithPrev, bool* pChkNxtPrv ) const { bool bRet = false; const SwPaM *pCrsr = GetCrsr(); - const SwTableNode* pTblNd = pCrsr->GetNode().FindTableNode(); - if( pTblNd && !pTblNd->GetTable().ISA( SwDDETable )) + const SwTableNode* pTableNd = pCrsr->GetNode().FindTableNode(); + if( pTableNd && !pTableNd->GetTable().ISA( SwDDETable )) { - bool bNew = pTblNd->GetTable().IsNewModel(); + bool bNew = pTableNd->GetTable().IsNewModel(); const SwNodes& rNds = GetDoc()->GetNodes(); if( pChkNxtPrv ) { - const SwTableNode* pChkNd = rNds[ pTblNd->GetIndex() - 1 ]->FindTableNode(); + const SwTableNode* pChkNd = rNds[ pTableNd->GetIndex() - 1 ]->FindTableNode(); if( pChkNd && !pChkNd->GetTable().ISA( SwDDETable ) && bNew == pChkNd->GetTable().IsNewModel() && // Consider table in table case - pChkNd->EndOfSectionIndex() == pTblNd->GetIndex() - 1 ) + pChkNd->EndOfSectionIndex() == pTableNd->GetIndex() - 1 ) *pChkNxtPrv = true, bRet = true; // using Prev is possible else { - pChkNd = rNds[ pTblNd->EndOfSectionIndex() + 1 ]->GetTableNode(); + pChkNd = rNds[ pTableNd->EndOfSectionIndex() + 1 ]->GetTableNode(); if( pChkNd && !pChkNd->GetTable().ISA( SwDDETable ) && bNew == pChkNd->GetTable().IsNewModel() ) *pChkNxtPrv = false, bRet = true; // using Next is possible @@ -493,20 +493,20 @@ bool SwEditShell::CanMergeTable( bool bWithPrev, bool* pChkNxtPrv ) const } else { - const SwTableNode* pTmpTblNd = 0; + const SwTableNode* pTmpTableNd = 0; if( bWithPrev ) { - pTmpTblNd = rNds[ pTblNd->GetIndex() - 1 ]->FindTableNode(); + pTmpTableNd = rNds[ pTableNd->GetIndex() - 1 ]->FindTableNode(); // Consider table in table case - if ( pTmpTblNd && pTmpTblNd->EndOfSectionIndex() != pTblNd->GetIndex() - 1 ) - pTmpTblNd = 0; + if ( pTmpTableNd && pTmpTableNd->EndOfSectionIndex() != pTableNd->GetIndex() - 1 ) + pTmpTableNd = 0; } else - pTmpTblNd = rNds[ pTblNd->EndOfSectionIndex() + 1 ]->GetTableNode(); + pTmpTableNd = rNds[ pTableNd->EndOfSectionIndex() + 1 ]->GetTableNode(); - bRet = pTmpTblNd && !pTmpTblNd->GetTable().ISA( SwDDETable ) && - bNew == pTmpTblNd->GetTable().IsNewModel(); + bRet = pTmpTableNd && !pTmpTableNd->GetTable().ISA( SwDDETable ) && + bNew == pTmpTableNd->GetTable().IsNewModel(); } } return bRet; diff --git a/sw/source/core/edit/edtox.cxx b/sw/source/core/edit/edtox.cxx index 879285db36ff..7babb2d3a588 100644 --- a/sw/source/core/edit/edtox.cxx +++ b/sw/source/core/edit/edtox.cxx @@ -111,7 +111,7 @@ void SwEditShell::SetTOXBaseReadonly(const SwTOXBase& rTOXBase, bool bReadonly) SwSectionData aSectionData(rTOXSect); aSectionData.SetProtectFlag(bReadonly); - UpdateSection( GetSectionFmtPos( *rTOXSect.GetFmt() ), aSectionData, 0 ); + UpdateSection( GetSectionFormatPos( *rTOXSect.GetFormat() ), aSectionData, 0 ); } const SwTOXBase* SwEditShell::GetDefaultTOXBase( TOXTypes eTyp, bool bCreate ) @@ -161,7 +161,7 @@ bool SwEditShell::UpdateTableOf( const SwTOXBase& rTOX, const SfxItemSet* pSet ) OSL_ENSURE( rTOX.ISA( SwTOXBaseSection ), "no TOXBaseSection!" ); SwTOXBaseSection* pTOX = const_cast<SwTOXBaseSection*>(static_cast<const SwTOXBaseSection*>(&rTOX)); OSL_ENSURE(pTOX, "no current listing"); - if( pTOX && 0 != pTOX->GetFmt()->GetSectionNode() ) + if( pTOX && 0 != pTOX->GetFormat()->GetSectionNode() ) { SwDoc* pMyDoc = GetDoc(); SwDocShell* pDocSh = pMyDoc->GetDocShell(); @@ -223,13 +223,13 @@ sal_uInt16 SwEditShell::GetTOIKeys( SwTOIKeyType eTyp, std::vector<OUString>& rA sal_uInt16 SwEditShell::GetTOXCount() const { - const SwSectionFmts& rFmts = GetDoc()->GetSections(); + const SwSectionFormats& rFormats = GetDoc()->GetSections(); sal_uInt16 nRet = 0; - for( auto n = rFmts.size(); n; ) + for( auto n = rFormats.size(); n; ) { - const SwSection* pSect = rFmts[ --n ]->GetSection(); + const SwSection* pSect = rFormats[ --n ]->GetSection(); if( TOX_CONTENT_SECTION == pSect->GetType() && - pSect->GetFmt()->GetSectionNode() ) + pSect->GetFormat()->GetSectionNode() ) ++nRet; } return nRet; @@ -237,13 +237,13 @@ sal_uInt16 SwEditShell::GetTOXCount() const const SwTOXBase* SwEditShell::GetTOX( sal_uInt16 nPos ) const { - const SwSectionFmts& rFmts = GetDoc()->GetSections(); + const SwSectionFormats& rFormats = GetDoc()->GetSections(); sal_uInt16 nCnt {0}; - for( const SwSectionFmt *pFmt : rFmts ) + for( const SwSectionFormat *pFormat : rFormats ) { - const SwSection* pSect = pFmt->GetSection(); + const SwSection* pSect = pFormat->GetSection(); if( TOX_CONTENT_SECTION == pSect->GetType() && - pSect->GetFmt()->GetSectionNode() && + pSect->GetFormat()->GetSectionNode() && nCnt++ == nPos ) { OSL_ENSURE( pSect->ISA( SwTOXBaseSection ), "no TOXBaseSection!" ); @@ -295,7 +295,7 @@ void SwEditShell::ApplyAutoMark() SwTOXMark::InsertTOXMarks( aMarks, *pTOXType ); for( SwTOXMark* pMark : aMarks ) { - if(pMark->IsAutoGenerated() && pMark->GetTxtTOXMark()) + if(pMark->IsAutoGenerated() && pMark->GetTextTOXMark()) // mba: test iteration; objects are deleted in iteration DeleteTOXMark(pMark); } diff --git a/sw/source/core/edit/edundo.cxx b/sw/source/core/edit/edundo.cxx index f657c0609c4f..3a3944e01b29 100644 --- a/sw/source/core/edit/edundo.cxx +++ b/sw/source/core/edit/edundo.cxx @@ -53,15 +53,15 @@ void SwEditShell::HandleUndoRedoContext(::sw::UndoRedoContext & rContext) return; } - SwFrmFmt * pSelFmt(0); + SwFrameFormat * pSelFormat(0); SdrMarkList * pMarkList(0); - rContext.GetSelections(pSelFmt, pMarkList); + rContext.GetSelections(pSelFormat, pMarkList); - if (pSelFmt) // select frame + if (pSelFormat) // select frame { - if (RES_DRAWFRMFMT == pSelFmt->Which()) + if (RES_DRAWFRMFMT == pSelFormat->Which()) { - SdrObject* pSObj = pSelFmt->FindSdrObject(); + SdrObject* pSObj = pSelFormat->FindSdrObject(); static_cast<SwFEShell*>(this)->SelectObj( pSObj->GetCurrentBoundRect().Center() ); } @@ -69,14 +69,14 @@ void SwEditShell::HandleUndoRedoContext(::sw::UndoRedoContext & rContext) { Point aPt; SwFlyFrm *const pFly = - static_cast<SwFlyFrmFmt*>(pSelFmt)->GetFrm(& aPt, false); + static_cast<SwFlyFrameFormat*>(pSelFormat)->GetFrm(& aPt, false); if (pFly) { // fdo#36681: Invalidate the content and layout to refresh // the picture anchoring properly SwPageFrm* pPageFrm = pFly->FindPageFrmOfAnchor(); pPageFrm->InvalidateFlyLayout(); - pPageFrm->InvalidateCntnt(); + pPageFrm->InvalidateContent(); static_cast<SwFEShell*>(this)->SelectFlyFrm(*pFly, true); } @@ -121,7 +121,7 @@ bool SwEditShell::Undo(sal_uInt16 const nCount) Push(); // Destroy stored TableBoxPtr. A dection is only permitted for the new "Box"! - ClearTblBoxCntnt(); + ClearTableBoxContent(); const RedlineMode_t eOld = GetDoc()->getIDocumentRedlineAccess().GetRedlineMode(); @@ -146,7 +146,7 @@ bool SwEditShell::Undo(sal_uInt16 const nCount) GetDoc()->getIDocumentRedlineAccess().CompressRedlines(); // automatic detection of the new "Box" - SaveTblBoxCntnt(); + SaveTableBoxContent(); } EndAllAction(); @@ -177,7 +177,7 @@ bool SwEditShell::Redo(sal_uInt16 const nCount) Push(); // Destroy stored TableBoxPtr. A dection is only permitted for the new "Box"! - ClearTblBoxCntnt(); + ClearTableBoxContent(); RedlineMode_t eOld = GetDoc()->getIDocumentRedlineAccess().GetRedlineMode(); @@ -198,7 +198,7 @@ bool SwEditShell::Redo(sal_uInt16 const nCount) GetDoc()->getIDocumentRedlineAccess().CompressRedlines(); // automatic detection of the new "Box" - SaveTblBoxCntnt(); + SaveTableBoxContent(); } EndAllAction(); diff --git a/sw/source/core/edit/edws.cxx b/sw/source/core/edit/edws.cxx index 8320085184ab..2303e07a3a45 100644 --- a/sw/source/core/edit/edws.cxx +++ b/sw/source/core/edit/edws.cxx @@ -128,7 +128,7 @@ sal_uInt16 SwEditShell::GetCntType() const bool SwEditShell::HasOtherCnt() const { - if ( !GetDoc()->GetSpzFrmFmts()->empty() ) + if ( !GetDoc()->GetSpzFrameFormats()->empty() ) return true; const SwNodes &rNds = GetDoc()->GetNodes(); @@ -169,10 +169,10 @@ SwMvContext::~SwMvContext() m_rShell.EndCrsrMove(); } -SwFrmFmt *SwEditShell::GetTableFmt() // fastest test on a table +SwFrameFormat *SwEditShell::GetTableFormat() // fastest test on a table { - const SwTableNode* pTblNd = IsCrsrInTbl(); - return pTblNd ? (SwFrmFmt*)pTblNd->GetTable().GetFrmFmt() : 0; + const SwTableNode* pTableNd = IsCrsrInTable(); + return pTableNd ? (SwFrameFormat*)pTableNd->GetTable().GetFrameFormat() : 0; } // TODO: Why is this called 3x for a new document? @@ -242,16 +242,16 @@ void SwEditShell::AutoCorrect( SvxAutoCorrect& rACorr, bool bInsert, StartAllAction(); SwPaM* pCrsr = getShellCrsr( true ); - SwTxtNode* pTNd = pCrsr->GetNode().GetTxtNode(); + SwTextNode* pTNd = pCrsr->GetNode().GetTextNode(); SwAutoCorrDoc aSwAutoCorrDoc( *this, *pCrsr, cChar ); // FIXME: this _must_ be called with reference to the actual node text! - OUString const& rNodeText(pTNd->GetTxt()); + OUString const& rNodeText(pTNd->GetText()); rACorr.DoAutoCorrect( aSwAutoCorrDoc, rNodeText, pCrsr->GetPoint()->nContent.GetIndex(), cChar, bInsert, GetWin() ); if( cChar ) - SaveTblBoxCntnt( pCrsr->GetPoint() ); + SaveTableBoxContent( pCrsr->GetPoint() ); EndAllAction(); } @@ -267,12 +267,12 @@ bool SwEditShell::GetPrevAutoCorrWord( SvxAutoCorrect& rACorr, OUString& rWord ) bool bRet; SwPaM* pCrsr = getShellCrsr( true ); const sal_Int32 nPos = pCrsr->GetPoint()->nContent.GetIndex(); - SwTxtNode* pTNd = pCrsr->GetNode().GetTxtNode(); + SwTextNode* pTNd = pCrsr->GetNode().GetTextNode(); if( pTNd && nPos ) { SwAutoCorrDoc aSwAutoCorrDoc( *this, *pCrsr, 0 ); bRet = rACorr.GetPrevAutoCorrWord( aSwAutoCorrDoc, - pTNd->GetTxt(), nPos, rWord ); + pTNd->GetText(), nPos, rWord ); } else bRet = false; |