diff options
Diffstat (limited to 'sw/source/core/fields')
-rw-r--r-- | sw/source/core/fields/authfld.cxx | 52 | ||||
-rw-r--r-- | sw/source/core/fields/cellfml.cxx | 446 | ||||
-rw-r--r-- | sw/source/core/fields/chpfld.cxx | 52 | ||||
-rw-r--r-- | sw/source/core/fields/dbfld.cxx | 62 | ||||
-rw-r--r-- | sw/source/core/fields/ddefld.cxx | 78 | ||||
-rw-r--r-- | sw/source/core/fields/ddetbl.cxx | 58 | ||||
-rw-r--r-- | sw/source/core/fields/docufld.cxx | 394 | ||||
-rw-r--r-- | sw/source/core/fields/expfld.cxx | 250 | ||||
-rw-r--r-- | sw/source/core/fields/fldbas.cxx | 150 | ||||
-rw-r--r-- | sw/source/core/fields/flddat.cxx | 6 | ||||
-rw-r--r-- | sw/source/core/fields/fldlst.cxx | 68 | ||||
-rw-r--r-- | sw/source/core/fields/macrofld.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/fields/postithelper.cxx | 34 | ||||
-rw-r--r-- | sw/source/core/fields/reffld.cxx | 348 | ||||
-rw-r--r-- | sw/source/core/fields/tblcalc.cxx | 66 | ||||
-rw-r--r-- | sw/source/core/fields/usrfld.cxx | 24 |
16 files changed, 1046 insertions, 1046 deletions
diff --git a/sw/source/core/fields/authfld.cxx b/sw/source/core/fields/authfld.cxx index 2671f08c0035..ec4f7c4ae7d2 100644 --- a/sw/source/core/fields/authfld.cxx +++ b/sw/source/core/fields/authfld.cxx @@ -240,38 +240,38 @@ sal_uInt16 SwAuthorityFieldType::GetSequencePos(sal_IntPtr nHandle) if(m_SequArr.empty()) { SwTOXSortTabBases aSortArr; - SwIterator<SwFmtFld,SwFieldType> aIter( *this ); + SwIterator<SwFormatField,SwFieldType> aIter( *this ); SwTOXInternational aIntl(m_eLanguage, 0, m_sSortAlgorithm); - for( SwFmtFld* pFmtFld = aIter.First(); pFmtFld; pFmtFld = aIter.Next() ) + for( SwFormatField* pFormatField = aIter.First(); pFormatField; pFormatField = aIter.Next() ) { - const SwTxtFld* pTxtFld = pFmtFld->GetTxtFld(); - if(!pTxtFld || !pTxtFld->GetpTxtNode()) + const SwTextField* pTextField = pFormatField->GetTextField(); + if(!pTextField || !pTextField->GetpTextNode()) { #if OSL_DEBUG_LEVEL > 0 - if(nHandle == static_cast<SwAuthorityField*>(pFmtFld->GetField())->GetHandle()) + if(nHandle == static_cast<SwAuthorityField*>(pFormatField->GetField())->GetHandle()) bCurrentFieldWithoutTextNode = true; #endif continue; } - const SwTxtNode& rFldTxtNode = pTxtFld->GetTxtNode(); - SwPosition aFldPos(rFldTxtNode); - SwDoc& rDoc = *const_cast<SwDoc*>(rFldTxtNode.GetDoc()); - SwCntntFrm *pFrm = rFldTxtNode.getLayoutFrm( rDoc.getIDocumentLayoutAccess().GetCurrentLayout() ); - const SwTxtNode* pTxtNode = 0; + const SwTextNode& rFieldTextNode = pTextField->GetTextNode(); + SwPosition aFieldPos(rFieldTextNode); + SwDoc& rDoc = *const_cast<SwDoc*>(rFieldTextNode.GetDoc()); + SwContentFrm *pFrm = rFieldTextNode.getLayoutFrm( rDoc.getIDocumentLayoutAccess().GetCurrentLayout() ); + const SwTextNode* pTextNode = 0; if(pFrm && !pFrm->IsInDocBody()) - pTxtNode = GetBodyTxtNode( rDoc, aFldPos, *pFrm ); + pTextNode = GetBodyTextNode( rDoc, aFieldPos, *pFrm ); //if no text node could be found or the field is in the document //body the directly available text node will be used - if(!pTxtNode) - pTxtNode = &rFldTxtNode; - if (!pTxtNode->GetTxt().isEmpty() && - pTxtNode->getLayoutFrm( rDoc.getIDocumentLayoutAccess().GetCurrentLayout() ) && - pTxtNode->GetNodes().IsDocNodes() ) + if(!pTextNode) + pTextNode = &rFieldTextNode; + if (!pTextNode->GetText().isEmpty() && + pTextNode->getLayoutFrm( rDoc.getIDocumentLayoutAccess().GetCurrentLayout() ) && + pTextNode->GetNodes().IsDocNodes() ) { - SwTOXAuthority* pNew = new SwTOXAuthority( *pTxtNode, - *pFmtFld, aIntl ); + SwTOXAuthority* pNew = new SwTOXAuthority( *pTextNode, + *pFormatField, aIntl ); for(SwTOXSortTabBases::size_type i = 0; i < aSortArr.size(); ++i) { @@ -310,9 +310,9 @@ sal_uInt16 SwAuthorityFieldType::GetSequencePos(sal_IntPtr nHandle) for(const auto *pBase : aSortArr) { const SwTOXSortTabBase& rBase = *pBase; - SwFmtFld& rFmtFld = const_cast<SwTOXAuthority&>(static_cast<const SwTOXAuthority&>(rBase)).GetFldFmt(); - SwAuthorityField* pAFld = static_cast<SwAuthorityField*>(rFmtFld.GetField()); - m_SequArr.push_back(pAFld->GetHandle()); + SwFormatField& rFormatField = const_cast<SwTOXAuthority&>(static_cast<const SwTOXAuthority&>(rBase)).GetFieldFormat(); + SwAuthorityField* pAField = static_cast<SwAuthorityField*>(rFormatField.GetField()); + m_SequArr.push_back(pAField->GetHandle()); } for (SwTOXSortTabBases::const_iterator it = aSortArr.begin(); it != aSortArr.end(); ++it) delete *it; @@ -525,7 +525,7 @@ OUString SwAuthorityField::ConditionalExpand(ToxAuthorityField eField) const if( pAuthType->IsSequence() ) { - if(!pAuthType->GetDoc()->getIDocumentFieldsAccess().IsExpFldsLocked()) + if(!pAuthType->GetDoc()->getIDocumentFieldsAccess().IsExpFieldsLocked()) m_nTempSequencePos = pAuthType->GetSequencePos( m_nHandle ); if( m_nTempSequencePos >= 0 ) sRet += OUString::number( m_nTempSequencePos ); @@ -549,7 +549,7 @@ OUString SwAuthorityField::ExpandCitation(ToxAuthorityField eField) const if( pAuthType->IsSequence() ) { - if(!pAuthType->GetDoc()->getIDocumentFieldsAccess().IsExpFldsLocked()) + if(!pAuthType->GetDoc()->getIDocumentFieldsAccess().IsExpFieldsLocked()) m_nTempSequencePos = pAuthType->GetSequencePos( m_nHandle ); if( m_nTempSequencePos >= 0 ) sRet += OUString::number( m_nTempSequencePos ); @@ -693,10 +693,10 @@ bool SwAuthorityField::PutValue( const Any& rAny, sal_uInt16 /*nWhichId*/ ) return false; } -SwFieldType* SwAuthorityField::ChgTyp( SwFieldType* pFldTyp ) +SwFieldType* SwAuthorityField::ChgTyp( SwFieldType* pFieldTyp ) { SwAuthorityFieldType* pSrcTyp = static_cast<SwAuthorityFieldType*>(GetTyp()), - * pDstTyp = static_cast<SwAuthorityFieldType*>(pFldTyp); + * pDstTyp = static_cast<SwAuthorityFieldType*>(pFieldTyp); if( pSrcTyp != pDstTyp ) { @@ -705,7 +705,7 @@ SwFieldType* SwAuthorityField::ChgTyp( SwFieldType* pFldTyp ) pSrcTyp->RemoveField( m_nHandle ); m_nHandle = pDstTyp->GetHandle( nHdlPos ); pDstTyp->AddField( m_nHandle ); - SwField::ChgTyp( pFldTyp ); + SwField::ChgTyp( pFieldTyp ); } return pSrcTyp; } diff --git a/sw/source/core/fields/cellfml.cxx b/sw/source/core/fields/cellfml.cxx index 4e203494f29f..1010f0032b8e 100644 --- a/sw/source/core/fields/cellfml.cxx +++ b/sw/source/core/fields/cellfml.cxx @@ -56,11 +56,11 @@ enum static const SwFrm* lcl_GetBoxFrm( const SwTableBox& rBox ); static sal_Int32 lcl_GetLongBoxNum( OUString& rStr ); -static const SwTableBox* lcl_RelToBox( const SwTable& rTbl, +static const SwTableBox* lcl_RelToBox( const SwTable& rTable, const SwTableBox* pRefBox, const OUString& sGetName); -static OUString lcl_BoxNmToRel( const SwTable& rTbl, - const SwTableNode& rTblNd, +static OUString lcl_BoxNmToRel( const SwTable& rTable, + const SwTableNode& rTableNd, const OUString& sRefBoxNm, const OUString& sGetStr, bool bExtrnlNm); @@ -71,7 +71,7 @@ static OUString lcl_BoxNmToRel( const SwTable& rTbl, * formula then calculate it, if it starts with a field then get the value. * All other conditions return 0 (and an error?). */ -double SwTableBox::GetValue( SwTblCalcPara& rCalcPara ) const +double SwTableBox::GetValue( SwTableCalcPara& rCalcPara ) const { double nRet = 0; @@ -87,7 +87,7 @@ double SwTableBox::GetValue( SwTblCalcPara& rCalcPara ) const if( rCalcPara.IncStackCnt() ) return nRet; - rCalcPara.SetLastTblBox( this ); + rCalcPara.SetLastTableBox( this ); // Does it create a recursion? SwTableBox* pBox = const_cast<SwTableBox*>(this); @@ -95,96 +95,96 @@ double SwTableBox::GetValue( SwTblCalcPara& rCalcPara ) const return nRet; // already on the stack: error // re-start with this box - rCalcPara.SetLastTblBox( this ); + rCalcPara.SetLastTableBox( this ); rCalcPara.pBoxStk->insert( pBox ); // add do { // Middle-Check-Loop, so that we can jump from here. Used so that the box pointer // will be removed from stack at the end. - SwDoc* pDoc = GetFrmFmt()->GetDoc(); + SwDoc* pDoc = GetFrameFormat()->GetDoc(); const SfxPoolItem* pItem; - if( SfxItemState::SET == GetFrmFmt()->GetItemState( + if( SfxItemState::SET == GetFrameFormat()->GetItemState( RES_BOXATR_FORMULA, false, &pItem ) ) { rCalcPara.rCalc.SetCalcError( CALC_NOERR ); // reset status - if( !static_cast<const SwTblBoxFormula*>(pItem)->IsValid() ) + if( !static_cast<const SwTableBoxFormula*>(pItem)->IsValid() ) { // calculate - const SwTable* pTmp = rCalcPara.pTbl; - rCalcPara.pTbl = &pBox->GetSttNd()->FindTableNode()->GetTable(); - const_cast<SwTblBoxFormula*>(static_cast<const SwTblBoxFormula*>(pItem))->Calc( rCalcPara, nRet ); + const SwTable* pTmp = rCalcPara.pTable; + rCalcPara.pTable = &pBox->GetSttNd()->FindTableNode()->GetTable(); + const_cast<SwTableBoxFormula*>(static_cast<const SwTableBoxFormula*>(pItem))->Calc( rCalcPara, nRet ); if( !rCalcPara.IsStackOverflow() ) { - SwFrmFmt* pFmt = pBox->ClaimFrmFmt(); + SwFrameFormat* pFormat = pBox->ClaimFrameFormat(); SfxItemSet aTmp( pDoc->GetAttrPool(), RES_BOXATR_BEGIN,RES_BOXATR_END-1 ); - aTmp.Put( SwTblBoxValue( nRet ) ); - if( SfxItemState::SET != pFmt->GetItemState( RES_BOXATR_FORMAT )) - aTmp.Put( SwTblBoxNumFormat( 0 )); - pFmt->SetFmtAttr( aTmp ); + aTmp.Put( SwTableBoxValue( nRet ) ); + if( SfxItemState::SET != pFormat->GetItemState( RES_BOXATR_FORMAT )) + aTmp.Put( SwTableBoxNumFormat( 0 )); + pFormat->SetFormatAttr( aTmp ); } - rCalcPara.pTbl = pTmp; + rCalcPara.pTable = pTmp; } else - nRet = GetFrmFmt()->GetTblBoxValue().GetValue(); + nRet = GetFrameFormat()->GetTableBoxValue().GetValue(); break; } - else if( SfxItemState::SET == pBox->GetFrmFmt()->GetItemState( + else if( SfxItemState::SET == pBox->GetFrameFormat()->GetItemState( RES_BOXATR_VALUE, false, &pItem ) ) { rCalcPara.rCalc.SetCalcError( CALC_NOERR ); // reset status - nRet = static_cast<const SwTblBoxValue*>(pItem)->GetValue(); + nRet = static_cast<const SwTableBoxValue*>(pItem)->GetValue(); break; } - SwTxtNode* pTxtNd = pDoc->GetNodes()[ pSttNd->GetIndex() + 1 ]->GetTxtNode(); - if( !pTxtNd ) + SwTextNode* pTextNd = pDoc->GetNodes()[ pSttNd->GetIndex() + 1 ]->GetTextNode(); + if( !pTextNd ) break; sal_Int32 nSttPos = 0; - OUString sTxt = pTxtNd->GetTxt(); - while ( nSttPos < sTxt.getLength() && ( sTxt[nSttPos]==' ' || sTxt[nSttPos]=='\t' ) ) + OUString sText = pTextNd->GetText(); + while ( nSttPos < sText.getLength() && ( sText[nSttPos]==' ' || sText[nSttPos]=='\t' ) ) ++nSttPos; // if there is a calculation field at position 1, get the value of it - const bool bOK = nSttPos<sTxt.getLength(); - const sal_Unicode Char = bOK ? sTxt[nSttPos] : 0; + const bool bOK = nSttPos<sText.getLength(); + const sal_Unicode Char = bOK ? sText[nSttPos] : 0; if ( bOK && (Char==CH_TXTATR_BREAKWORD || Char==CH_TXTATR_INWORD) ) { - SwTxtFld * const pTxtFld = - static_txtattr_cast<SwTxtFld*>(pTxtNd->GetTxtAttrForCharAt(nSttPos, RES_TXTATR_FIELD)); - if ( pTxtFld == NULL ) + SwTextField * const pTextField = + static_txtattr_cast<SwTextField*>(pTextNd->GetTextAttrForCharAt(nSttPos, RES_TXTATR_FIELD)); + if ( pTextField == NULL ) break; rCalcPara.rCalc.SetCalcError( CALC_NOERR ); // reset status - const SwField* pFld = pTxtFld->GetFmtFld().GetField(); - switch ( pFld->GetTyp()->Which() ) + const SwField* pField = pTextField->GetFormatField().GetField(); + switch ( pField->GetTyp()->Which() ) { case RES_SETEXPFLD: - nRet = static_cast<const SwSetExpField*>(pFld)->GetValue(); + nRet = static_cast<const SwSetExpField*>(pField)->GetValue(); break; case RES_USERFLD: - nRet = static_cast<const SwUserField*>(pFld)->GetValue(); + nRet = static_cast<const SwUserField*>(pField)->GetValue(); break; case RES_TABLEFLD: { - SwTblField* pTblFld = const_cast<SwTblField*>(static_cast<const SwTblField*>(pFld)); - if( !pTblFld->IsValid() ) + SwTableField* pTableField = const_cast<SwTableField*>(static_cast<const SwTableField*>(pField)); + if( !pTableField->IsValid() ) { // use the right table! - const SwTable* pTmp = rCalcPara.pTbl; - rCalcPara.pTbl = &pTxtNd->FindTableNode()->GetTable(); - pTblFld->CalcField( rCalcPara ); - rCalcPara.pTbl = pTmp; + const SwTable* pTmp = rCalcPara.pTable; + rCalcPara.pTable = &pTextNd->FindTableNode()->GetTable(); + pTableField->CalcField( rCalcPara ); + rCalcPara.pTable = pTmp; } - nRet = pTblFld->GetValue(); + nRet = pTableField->GetValue(); } break; case RES_DATETIMEFLD: - nRet = static_cast<const SwDateTimeField*>( pFld )->GetValue(); + nRet = static_cast<const SwDateTimeField*>( pField )->GetValue(); break; case RES_JUMPEDITFLD: @@ -193,18 +193,18 @@ double SwTableBox::GetValue( SwTblCalcPara& rCalcPara ) const break; default: - nRet = rCalcPara.rCalc.Calculate( pFld->ExpandField(true) ).GetDouble(); + nRet = rCalcPara.rCalc.Calculate( pField->ExpandField(true) ).GetDouble(); } } - else if ( nSttPos < sTxt.getLength() + else if ( nSttPos < sText.getLength() && Char == CH_TXT_ATR_INPUTFIELDSTART ) { - const SwTxtInputFld * pTxtInputFld = - dynamic_cast< const SwTxtInputFld* >( - pTxtNd->GetTxtAttrAt( nSttPos, RES_TXTATR_INPUTFIELD, SwTxtNode::DEFAULT ) ); - if ( pTxtInputFld == NULL ) + const SwTextInputField * pTextInputField = + dynamic_cast< const SwTextInputField* >( + pTextNd->GetTextAttrAt( nSttPos, RES_TXTATR_INPUTFIELD, SwTextNode::DEFAULT ) ); + if ( pTextInputField == NULL ) break; - nRet = rCalcPara.rCalc.Calculate( pTxtInputFld->GetFieldContent() ).GetDouble(); + nRet = rCalcPara.rCalc.Calculate( pTextInputField->GetFieldContent() ).GetDouble(); } else { @@ -212,24 +212,24 @@ double SwTableBox::GetValue( SwTblCalcPara& rCalcPara ) const rCalcPara.rCalc.SetCalcError( CALC_NOERR ); // reset status double aNum = 0.0; - sTxt = bOK ? sTxt.copy( nSttPos ) : OUString(); - sal_uInt32 nFmtIndex = GetFrmFmt()->GetTblBoxNumFmt().GetValue(); + sText = bOK ? sText.copy( nSttPos ) : OUString(); + sal_uInt32 nFormatIndex = GetFrameFormat()->GetTableBoxNumFormat().GetValue(); - SvNumberFormatter* pNumFmtr = pDoc->GetNumberFormatter(); + SvNumberFormatter* pNumFormatr = pDoc->GetNumberFormatter(); - if( static_cast<sal_uInt32>(css::util::NumberFormat::TEXT) == nFmtIndex ) - nFmtIndex = 0; + if( static_cast<sal_uInt32>(css::util::NumberFormat::TEXT) == nFormatIndex ) + nFormatIndex = 0; // JP 22.04.98: Bug 49659 - special treatment for percentages - else if( !sTxt.isEmpty() && - css::util::NumberFormat::PERCENT == pNumFmtr->GetType( nFmtIndex )) + else if( !sText.isEmpty() && + css::util::NumberFormat::PERCENT == pNumFormatr->GetType( nFormatIndex )) { - sal_uInt32 nTmpFmt = 0; - if( pNumFmtr->IsNumberFormat( sTxt, nTmpFmt, aNum ) && - css::util::NumberFormat::NUMBER == pNumFmtr->GetType( nTmpFmt )) - sTxt += OUString('%'); + sal_uInt32 nTmpFormat = 0; + if( pNumFormatr->IsNumberFormat( sText, nTmpFormat, aNum ) && + css::util::NumberFormat::NUMBER == pNumFormatr->GetType( nTmpFormat )) + sText += OUString('%'); } - if( pNumFmtr->IsNumberFormat( sTxt, nFmtIndex, aNum )) + if( pNumFormatr->IsNumberFormat( sText, nFormatIndex, aNum )) nRet = aNum; } // ?? otherwise it is an error @@ -250,19 +250,19 @@ double SwTableBox::GetValue( SwTblCalcPara& rCalcPara ) const // structure needed for calculation of tables -SwTblCalcPara::SwTblCalcPara( SwCalc& rCalculator, const SwTable& rTable ) - : pLastTblBox( 0 ), nStackCnt( 0 ), nMaxSize( cMAXSTACKSIZE ), - rCalc( rCalculator ), pTbl( &rTable ) +SwTableCalcPara::SwTableCalcPara( SwCalc& rCalculator, const SwTable& rTable ) + : pLastTableBox( 0 ), nStackCnt( 0 ), nMaxSize( cMAXSTACKSIZE ), + rCalc( rCalculator ), pTable( &rTable ) { pBoxStk = new SwTableSortBoxes; } -SwTblCalcPara::~SwTblCalcPara() +SwTableCalcPara::~SwTableCalcPara() { delete pBoxStk; } -bool SwTblCalcPara::CalcWithStackOverflow() +bool SwTableCalcPara::CalcWithStackOverflow() { // If a stack overflow was detected, redo with last box. sal_uInt16 nSaveMaxSize = nMaxSize; @@ -271,7 +271,7 @@ bool SwTblCalcPara::CalcWithStackOverflow() sal_uInt16 nCnt = 0; SwTableBoxes aStackOverflows; do { - SwTableBox* pBox = const_cast<SwTableBox*>(pLastTblBox); + SwTableBox* pBox = const_cast<SwTableBox*>(pLastTableBox); nStackCnt = 0; rCalc.SetCalcError( CALC_NOERR ); aStackOverflows.insert( aStackOverflows.begin() + nCnt++, pBox ); @@ -310,10 +310,10 @@ SwTableFormula::~SwTableFormula() { } -void SwTableFormula::_MakeFormula( const SwTable& rTbl, OUString& rNewStr, +void SwTableFormula::_MakeFormula( const SwTable& rTable, OUString& rNewStr, OUString& rFirstBox, OUString* pLastBox, void* pPara ) const { - SwTblCalcPara* pCalcPara = static_cast<SwTblCalcPara*>(pPara); + SwTableCalcPara* pCalcPara = static_cast<SwTableCalcPara*>(pPara); if( pCalcPara->rCalc.IsCalcError() ) // stop if there is already an error set return; @@ -326,14 +326,14 @@ void SwTableFormula::_MakeFormula( const SwTable& rTbl, OUString& rNewStr, pEndBox = reinterpret_cast<SwTableBox*>(sal::static_int_cast<sal_IntPtr>(pLastBox->toInt64())); // Is it actually a valid pointer? - if( rTbl.GetTabSortBoxes().find( pEndBox ) == rTbl.GetTabSortBoxes().end() ) + if( rTable.GetTabSortBoxes().find( pEndBox ) == rTable.GetTabSortBoxes().end() ) pEndBox = 0; rFirstBox = rFirstBox.copy( pLastBox->getLength()+1 ); } SwTableBox* pSttBox = reinterpret_cast<SwTableBox*>( sal::static_int_cast<sal_IntPtr>(rFirstBox.toInt64())); // Is it actually a valid pointer? - if( rTbl.GetTabSortBoxes().find( pSttBox ) == rTbl.GetTabSortBoxes().end() ) + if( rTable.GetTabSortBoxes().find( pSttBox ) == rTable.GetTabSortBoxes().end() ) pSttBox = 0; rNewStr += " "; @@ -348,14 +348,14 @@ void SwTableFormula::_MakeFormula( const SwTable& rTbl, OUString& rNewStr, for (size_t n = 0; n < aBoxes.size() && !pCalcPara->rCalc.IsCalcError(); ++n) { - const SwTableBox* pTblBox = aBoxes[n]; - if ( pTblBox->getRowSpan() >= 1 ) + const SwTableBox* pTableBox = aBoxes[n]; + if ( pTableBox->getRowSpan() >= 1 ) { if( bDelim ) rNewStr += OUString(cListDelim); bDelim = true; rNewStr += pCalcPara->rCalc.GetStrResult( - pTblBox->GetValue( *pCalcPara ), false ); + pTableBox->GetValue( *pCalcPara ), false ); } } rNewStr += ")"; @@ -375,20 +375,20 @@ void SwTableFormula::_MakeFormula( const SwTable& rTbl, OUString& rNewStr, rNewStr += " "; } -void SwTableFormula::RelNmsToBoxNms( const SwTable& rTbl, OUString& rNewStr, +void SwTableFormula::RelNmsToBoxNms( const SwTable& rTable, OUString& rNewStr, OUString& rFirstBox, OUString* pLastBox, void* pPara ) const { // relative name w.r.t. box name (external presentation) SwNode* pNd = static_cast<SwNode*>(pPara); OSL_ENSURE( pNd, "Feld steht in keinem TextNode" ); - const SwTableBox *pBox = rTbl.GetTblBox( + const SwTableBox *pBox = rTable.GetTableBox( pNd->FindTableBoxStartNode()->GetIndex() ); rNewStr += OUString(rFirstBox[0]); // get label for the box rFirstBox = rFirstBox.copy(1); if( pLastBox ) { - const SwTableBox *pRelLastBox = lcl_RelToBox( rTbl, pBox, *pLastBox ); + const SwTableBox *pRelLastBox = lcl_RelToBox( rTable, pBox, *pLastBox ); if ( pRelLastBox ) rNewStr += pRelLastBox->GetName(); else @@ -397,7 +397,7 @@ void SwTableFormula::RelNmsToBoxNms( const SwTable& rTbl, OUString& rNewStr, rFirstBox = rFirstBox.copy( pLastBox->getLength()+1 ); } - const SwTableBox *pRelFirstBox = lcl_RelToBox( rTbl, pBox, rFirstBox ); + const SwTableBox *pRelFirstBox = lcl_RelToBox( rTable, pBox, rFirstBox ); if (pRelFirstBox) rNewStr += pRelFirstBox->GetName(); @@ -408,20 +408,20 @@ void SwTableFormula::RelNmsToBoxNms( const SwTable& rTbl, OUString& rNewStr, rNewStr += OUString(rFirstBox[ rFirstBox.getLength()-1 ]); } -void SwTableFormula::RelBoxNmsToPtr( const SwTable& rTbl, OUString& rNewStr, +void SwTableFormula::RelBoxNmsToPtr( const SwTable& rTable, OUString& rNewStr, OUString& rFirstBox, OUString* pLastBox, void* pPara ) const { // relative name w.r.t. box name (internal presentation) SwNode* pNd = static_cast<SwNode*>(pPara); OSL_ENSURE( pNd, "Field not placed in any Node" ); - const SwTableBox *pBox = rTbl.GetTblBox( + const SwTableBox *pBox = rTable.GetTableBox( pNd->FindTableBoxStartNode()->GetIndex() ); rNewStr += OUString(rFirstBox[0]); // get label for the box rFirstBox = rFirstBox.copy(1); if( pLastBox ) { - const SwTableBox *pRelLastBox = lcl_RelToBox( rTbl, pBox, *pLastBox ); + const SwTableBox *pRelLastBox = lcl_RelToBox( rTable, pBox, *pLastBox ); if ( pRelLastBox ) rNewStr += OUString::number(reinterpret_cast<sal_PtrDiff>(pRelLastBox)); else @@ -430,7 +430,7 @@ void SwTableFormula::RelBoxNmsToPtr( const SwTable& rTbl, OUString& rNewStr, rFirstBox = rFirstBox.copy( pLastBox->getLength()+1 ); } - const SwTableBox *pRelFirstBox = lcl_RelToBox( rTbl, pBox, rFirstBox ); + const SwTableBox *pRelFirstBox = lcl_RelToBox( rTable, pBox, rFirstBox ); if ( pRelFirstBox ) rNewStr += OUString::number(reinterpret_cast<sal_PtrDiff>(pRelFirstBox)); else @@ -440,18 +440,18 @@ void SwTableFormula::RelBoxNmsToPtr( const SwTable& rTbl, OUString& rNewStr, rNewStr += OUString(rFirstBox[ rFirstBox.getLength()-1 ]); } -void SwTableFormula::BoxNmsToRelNm( const SwTable& rTbl, OUString& rNewStr, +void SwTableFormula::BoxNmsToRelNm( const SwTable& rTable, OUString& rNewStr, OUString& rFirstBox, OUString* pLastBox, void* pPara ) const { // box name (external presentation) w.r.t. relative name SwNode* pNd = static_cast<SwNode*>(pPara); OSL_ENSURE( pNd, "Field not placed in any Node" ); - const SwTableNode* pTblNd = pNd->FindTableNode(); + const SwTableNode* pTableNd = pNd->FindTableNode(); OUString sRefBoxNm; - if( &pTblNd->GetTable() == &rTbl ) + if( &pTableNd->GetTable() == &rTable ) { - const SwTableBox *pBox = rTbl.GetTblBox( + const SwTableBox *pBox = rTable.GetTableBox( pNd->FindTableBoxStartNode()->GetIndex() ); OSL_ENSURE( pBox, "Field not placed in any Table" ); sRefBoxNm = pBox->GetName(); @@ -461,20 +461,20 @@ void SwTableFormula::BoxNmsToRelNm( const SwTable& rTbl, OUString& rNewStr, rFirstBox = rFirstBox.copy(1); if( pLastBox ) { - rNewStr += lcl_BoxNmToRel( rTbl, *pTblNd, sRefBoxNm, *pLastBox, + rNewStr += lcl_BoxNmToRel( rTable, *pTableNd, sRefBoxNm, *pLastBox, m_eNmType == EXTRNL_NAME ); rNewStr += ":"; rFirstBox = rFirstBox.copy( pLastBox->getLength()+1 ); } - rNewStr += lcl_BoxNmToRel( rTbl, *pTblNd, sRefBoxNm, rFirstBox, + rNewStr += lcl_BoxNmToRel( rTable, *pTableNd, sRefBoxNm, rFirstBox, m_eNmType == EXTRNL_NAME ); // get label for the box rNewStr += OUString(rFirstBox[ rFirstBox.getLength()-1 ]); } -void SwTableFormula::PtrToBoxNms( const SwTable& rTbl, OUString& rNewStr, +void SwTableFormula::PtrToBoxNms( const SwTable& rTable, OUString& rNewStr, OUString& rFirstBox, OUString* pLastBox, void* ) const { // area in these parentheses? @@ -487,7 +487,7 @@ void SwTableFormula::PtrToBoxNms( const SwTable& rTbl, OUString& rNewStr, pBox = reinterpret_cast<SwTableBox*>(sal::static_int_cast<sal_IntPtr>(pLastBox->toInt64())); // Is it actually a valid pointer? - if( rTbl.GetTabSortBoxes().find( pBox ) != rTbl.GetTabSortBoxes().end() ) + if( rTable.GetTabSortBoxes().find( pBox ) != rTable.GetTabSortBoxes().end() ) rNewStr += pBox->GetName(); else rNewStr += "?"; @@ -497,7 +497,7 @@ void SwTableFormula::PtrToBoxNms( const SwTable& rTbl, OUString& rNewStr, pBox = reinterpret_cast<SwTableBox*>(sal::static_int_cast<sal_IntPtr>(rFirstBox.toInt64())); // Is it actually a valid pointer? - if( rTbl.GetTabSortBoxes().find( pBox ) != rTbl.GetTabSortBoxes().end() ) + if( rTable.GetTabSortBoxes().find( pBox ) != rTable.GetTabSortBoxes().end() ) rNewStr += pBox->GetName(); else rNewStr += "?"; @@ -506,7 +506,7 @@ void SwTableFormula::PtrToBoxNms( const SwTable& rTbl, OUString& rNewStr, rNewStr += OUString(rFirstBox[ rFirstBox.getLength()-1 ]); } -void SwTableFormula::BoxNmsToPtr( const SwTable& rTbl, OUString& rNewStr, +void SwTableFormula::BoxNmsToPtr( const SwTable& rTable, OUString& rNewStr, OUString& rFirstBox, OUString* pLastBox, void* ) const { // area in these parentheses? @@ -516,30 +516,30 @@ void SwTableFormula::BoxNmsToPtr( const SwTable& rTbl, OUString& rNewStr, rFirstBox = rFirstBox.copy(1); if( pLastBox ) { - pBox = rTbl.GetTblBox( *pLastBox ); + pBox = rTable.GetTableBox( *pLastBox ); rNewStr += OUString::number(reinterpret_cast<sal_PtrDiff>(pBox)) + ":"; rFirstBox = rFirstBox.copy( pLastBox->getLength()+1 ); } - pBox = rTbl.GetTblBox( rFirstBox ); + pBox = rTable.GetTableBox( rFirstBox ); rNewStr += OUString::number(reinterpret_cast<sal_PtrDiff>(pBox)) + OUString(rFirstBox[ rFirstBox.getLength()-1 ]); // get label for the box } /// create external formula (for UI) -void SwTableFormula::PtrToBoxNm( const SwTable* pTbl ) +void SwTableFormula::PtrToBoxNm( const SwTable* pTable ) { const SwNode* pNd = 0; FnScanFormula fnFormula = 0; switch (m_eNmType) { case INTRNL_NAME: - if( pTbl ) + if( pTable ) fnFormula = &SwTableFormula::PtrToBoxNms; break; case REL_NAME: - if( pTbl ) + if( pTable ) { fnFormula = &SwTableFormula::RelNmsToBoxNms; pNd = GetNodeOfFormula(); @@ -548,23 +548,23 @@ void SwTableFormula::PtrToBoxNm( const SwTable* pTbl ) case EXTRNL_NAME: return; } - m_sFormula = ScanString( fnFormula, *pTbl, (void*)pNd ); + m_sFormula = ScanString( fnFormula, *pTable, (void*)pNd ); m_eNmType = EXTRNL_NAME; } /// create internal formula (in CORE) -void SwTableFormula::BoxNmToPtr( const SwTable* pTbl ) +void SwTableFormula::BoxNmToPtr( const SwTable* pTable ) { const SwNode* pNd = 0; FnScanFormula fnFormula = 0; switch (m_eNmType) { case EXTRNL_NAME: - if( pTbl ) + if( pTable ) fnFormula = &SwTableFormula::BoxNmsToPtr; break; case REL_NAME: - if( pTbl ) + if( pTable ) { fnFormula = &SwTableFormula::RelBoxNmsToPtr; pNd = GetNodeOfFormula(); @@ -573,12 +573,12 @@ void SwTableFormula::BoxNmToPtr( const SwTable* pTbl ) case INTRNL_NAME: return; } - m_sFormula = ScanString( fnFormula, *pTbl, (void*)pNd ); + m_sFormula = ScanString( fnFormula, *pTable, (void*)pNd ); m_eNmType = INTRNL_NAME; } /// create relative formula (for copy) -void SwTableFormula::ToRelBoxNm( const SwTable* pTbl ) +void SwTableFormula::ToRelBoxNm( const SwTable* pTable ) { const SwNode* pNd = 0; FnScanFormula fnFormula = 0; @@ -586,7 +586,7 @@ void SwTableFormula::ToRelBoxNm( const SwTable* pTbl ) { case INTRNL_NAME: case EXTRNL_NAME: - if( pTbl ) + if( pTable ) { fnFormula = &SwTableFormula::BoxNmsToRelNm; pNd = GetNodeOfFormula(); @@ -595,22 +595,22 @@ void SwTableFormula::ToRelBoxNm( const SwTable* pTbl ) case REL_NAME: return; } - m_sFormula = ScanString( fnFormula, *pTbl, (void*)pNd ); + m_sFormula = ScanString( fnFormula, *pTable, (void*)pNd ); m_eNmType = REL_NAME; } -OUString SwTableFormula::ScanString( FnScanFormula fnFormula, const SwTable& rTbl, +OUString SwTableFormula::ScanString( FnScanFormula fnFormula, const SwTable& rTable, void* pPara ) const { OUString aStr; - sal_Int32 nFml = 0; + sal_Int32 nFormula = 0; sal_Int32 nEnd = 0; do { // If the formula is preceded by a name, use this table! - const SwTable* pTbl = &rTbl; + const SwTable* pTable = &rTable; - sal_Int32 nStt = m_sFormula.indexOf( '<', nFml ); + sal_Int32 nStt = m_sFormula.indexOf( '<', nFormula ); if ( nStt>=0 ) { while ( nStt>=0 ) @@ -633,12 +633,12 @@ OUString SwTableFormula::ScanString( FnScanFormula fnFormula, const SwTable& rTb if (nStt<0 || nEnd<0 ) { // set the rest and finish - aStr += m_sFormula.copy(nFml); + aStr += m_sFormula.copy(nFormula); break; } // write beginning - aStr += m_sFormula.copy(nFml, nStt - nFml); + aStr += m_sFormula.copy(nFormula, nStt - nFormula); if (fnFormula) { @@ -652,27 +652,27 @@ OUString SwTableFormula::ScanString( FnScanFormula fnFormula, const SwTable& rTb (nSeparator = m_sFormula.indexOf( '.', nStt ))>=0 && nSeparator < nEnd ) { - OUString sTblNm( m_sFormula.copy( nStt, nEnd - nStt )); + OUString sTableNm( m_sFormula.copy( nStt, nEnd - nStt )); // If there are dots in the name, then they appear in pairs (e.g. A1.1.1)! - if( (comphelper::string::getTokenCount(sTblNm, '.') - 1) & 1 ) + if( (comphelper::string::getTokenCount(sTableNm, '.') - 1) & 1 ) { - sTblNm = sTblNm.copy( 0, nSeparator - nStt ); + sTableNm = sTableNm.copy( 0, nSeparator - nStt ); // when creating a formula the table name is unwanted if( fnFormula != (FnScanFormula)&SwTableFormula::_MakeFormula ) - aStr += sTblNm; + aStr += sTableNm; nStt = nSeparator; - sTblNm = sTblNm.copy( 1 ); // delete separator - if( sTblNm != rTbl.GetFrmFmt()->GetName() ) + sTableNm = sTableNm.copy( 1 ); // delete separator + if( sTableNm != rTable.GetFrameFormat()->GetName() ) { // then search for table const SwTable* pFnd = FindTable( - *rTbl.GetFrmFmt()->GetDoc(), - sTblNm ); + *rTable.GetFrameFormat()->GetDoc(), + sTableNm ); if( pFnd ) - pTbl = pFnd; + pTable = pFnd; // ?? OSL_ENSURE( pFnd, "No table found. What now?" ); } @@ -686,34 +686,34 @@ OUString SwTableFormula::ScanString( FnScanFormula fnFormula, const SwTable& rTb { // without opening parenthesis OUString aFirstBox( m_sFormula.copy( nStt+1, nSeparator - nStt - 1 )); - (this->*fnFormula)( *pTbl, aStr, sBox, &aFirstBox, pPara ); + (this->*fnFormula)( *pTable, aStr, sBox, &aFirstBox, pPara ); } else - (this->*fnFormula)( *pTbl, aStr, sBox, 0, pPara ); + (this->*fnFormula)( *pTable, aStr, sBox, 0, pPara ); } - nFml = nEnd+1; + nFormula = nEnd+1; } while( true ); return aStr; } const SwTable* SwTableFormula::FindTable( SwDoc& rDoc, const OUString& rNm ) { - const SwFrmFmts& rTblFmts = *rDoc.GetTblFrmFmts(); - const SwTable* pTmpTbl = 0, *pRet = 0; - for( auto nFmtCnt = rTblFmts.size(); nFmtCnt; ) + const SwFrameFormats& rTableFormats = *rDoc.GetTableFrameFormats(); + const SwTable* pTmpTable = 0, *pRet = 0; + for( auto nFormatCnt = rTableFormats.size(); nFormatCnt; ) { - SwFrmFmt* pFmt = rTblFmts[ --nFmtCnt ]; + SwFrameFormat* pFormat = rTableFormats[ --nFormatCnt ]; // if we are called from Sw3Writer, a number is dependent on the format name SwTableBox* pFBox; - if ( rNm.equals(pFmt->GetName().getToken(0, 0x0a)) && - 0 != ( pTmpTbl = SwTable::FindTable( pFmt ) ) && - 0 != (pFBox = pTmpTbl->GetTabSortBoxes()[0] ) && + if ( rNm.equals(pFormat->GetName().getToken(0, 0x0a)) && + 0 != ( pTmpTable = SwTable::FindTable( pFormat ) ) && + 0 != (pFBox = pTmpTable->GetTabSortBoxes()[0] ) && pFBox->GetSttNd() && pFBox->GetSttNd()->GetNodes().IsDocNodes() ) { // a table in the normal NodesArr - pRet = pTmpTbl; + pRet = pTmpTable; break; } } @@ -723,7 +723,7 @@ const SwTable* SwTableFormula::FindTable( SwDoc& rDoc, const OUString& rNm ) static const SwFrm* lcl_GetBoxFrm( const SwTableBox& rBox ) { SwNodeIndex aIdx( *rBox.GetSttNd() ); - SwCntntNode* pCNd = aIdx.GetNodes().GoNext( &aIdx ); + SwContentNode* pCNd = aIdx.GetNodes().GoNext( &aIdx ); OSL_ENSURE( pCNd, "Box has no TextNode" ); Point aPt; // get the first frame of the layout - table headline return pCNd->getLayoutFrm( pCNd->GetDoc()->getIDocumentLayoutAccess().GetCurrentLayout(), &aPt, NULL, false ); @@ -746,7 +746,7 @@ static sal_Int32 lcl_GetLongBoxNum( OUString& rStr ) return nRet; } -static const SwTableBox* lcl_RelToBox( const SwTable& rTbl, +static const SwTableBox* lcl_RelToBox( const SwTable& rTable, const SwTableBox* pRefBox, const OUString& _sGetName ) { @@ -762,7 +762,7 @@ static const SwTableBox* lcl_RelToBox( const SwTable& rTbl, sGetName = sGetName.copy( 1 ); - const SwTableLines* pLines = &rTbl.GetTabLines(); + const SwTableLines* pLines = &rTable.GetTabLines(); const SwTableBoxes* pBoxes; const SwTableLine* pLine; @@ -775,7 +775,7 @@ static const SwTableBox* lcl_RelToBox( const SwTable& rTbl, pLine = pBox->GetUpper(); } sal_uInt16 nSttBox = pLine->GetTabBoxes().GetPos( pBox ); - sal_uInt16 nSttLine = rTbl.GetTabLines().GetPos( pLine ); + sal_uInt16 nSttLine = rTable.GetTabLines().GetPos( pLine ); const sal_Int32 nBoxOffset = lcl_GetLongBoxNum( sGetName ) + nSttBox; const sal_Int32 nLineOffset = lcl_GetLongBoxNum( sGetName ) + nSttLine; @@ -827,12 +827,12 @@ static const SwTableBox* lcl_RelToBox( const SwTable& rTbl, else { // otherwise it is an absolute external presentation - pBox = rTbl.GetTblBox( sGetName ); + pBox = rTable.GetTableBox( sGetName ); } return pBox; } -static OUString lcl_BoxNmToRel( const SwTable& rTbl, const SwTableNode& rTblNd, +static OUString lcl_BoxNmToRel( const SwTable& rTable, const SwTableNode& rTableNd, const OUString& _sRefBoxNm, const OUString& _sTmp, bool bExtrnlNm ) { OUString sTmp = _sTmp; @@ -841,13 +841,13 @@ static OUString lcl_BoxNmToRel( const SwTable& rTbl, const SwTableNode& rTblNd, { // convert into external presentation SwTableBox* pBox = reinterpret_cast<SwTableBox*>(sal::static_int_cast<sal_IntPtr>(sTmp.toInt64())); - if( rTbl.GetTabSortBoxes().find( pBox ) == rTbl.GetTabSortBoxes().end() ) + if( rTable.GetTabSortBoxes().find( pBox ) == rTable.GetTabSortBoxes().end() ) return OUString('?'); sTmp = pBox->GetName(); } // If the formula is spanning over a table then keep external presentation - if( &rTbl == &rTblNd.GetTable() ) + if( &rTable == &rTableNd.GetTable() ) { long nBox = SwTable::_GetBoxNum( sTmp, true ); nBox -= SwTable::_GetBoxNum( sRefBoxNm, true ); @@ -871,16 +871,16 @@ static OUString lcl_BoxNmToRel( const SwTable& rTbl, const SwTableNode& rTblNd, return sTmp; } -void SwTableFormula::GetBoxesOfFormula( const SwTable& rTbl, +void SwTableFormula::GetBoxesOfFormula( const SwTable& rTable, SwSelBoxes& rBoxes ) { rBoxes.clear(); - BoxNmToPtr( &rTbl ); - ScanString( &SwTableFormula::_GetFmlBoxes, rTbl, &rBoxes ); + BoxNmToPtr( &rTable ); + ScanString( &SwTableFormula::_GetFormulaBoxes, rTable, &rBoxes ); } -void SwTableFormula::_GetFmlBoxes( const SwTable& rTbl, OUString& , +void SwTableFormula::_GetFormulaBoxes( const SwTable& rTable, OUString& , OUString& rFirstBox, OUString* pLastBox, void* pPara ) const { SwSelBoxes* pBoxes = static_cast<SwSelBoxes*>(pPara); @@ -893,14 +893,14 @@ void SwTableFormula::_GetFmlBoxes( const SwTable& rTbl, OUString& , pEndBox = reinterpret_cast<SwTableBox*>(sal::static_int_cast<sal_IntPtr>(pLastBox->toInt64())); // Is it actually a valid pointer? - if( rTbl.GetTabSortBoxes().find( pEndBox ) == rTbl.GetTabSortBoxes().end() ) + if( rTable.GetTabSortBoxes().find( pEndBox ) == rTable.GetTabSortBoxes().end() ) pEndBox = 0; rFirstBox = rFirstBox.copy( pLastBox->getLength()+1 ); } SwTableBox *pSttBox = reinterpret_cast<SwTableBox*>(sal::static_int_cast<sal_IntPtr>(rFirstBox.toInt64())); // Is it actually a valid pointer? - if( !pSttBox || rTbl.GetTabSortBoxes().find( pSttBox ) == rTbl.GetTabSortBoxes().end() ) + if( !pSttBox || rTable.GetTabSortBoxes().find( pSttBox ) == rTable.GetTabSortBoxes().end() ) return; if ( pEndBox ) // area? @@ -926,19 +926,19 @@ void SwTableFormula::GetBoxes( const SwTableBox& rSttBox, if( !pStt || !pEnd ) return ; // no valid selection - GetTblSel( pStt, pEnd, rBoxes, 0 ); + GetTableSel( pStt, pEnd, rBoxes, 0 ); - const SwTable* pTbl = pStt->FindTabFrm()->GetTable(); + const SwTable* pTable = pStt->FindTabFrm()->GetTable(); // filter headline boxes - if( pTbl->GetRowsToRepeat() > 0 ) + if( pTable->GetRowsToRepeat() > 0 ) { do { // middle-check loop const SwTableLine* pLine = rSttBox.GetUpper(); while( pLine->GetUpper() ) pLine = pLine->GetUpper()->GetUpper(); - if( pTbl->IsHeadline( *pLine ) ) + if( pTable->IsHeadline( *pLine ) ) break; // headline in this area! // maybe start and end are swapped @@ -946,7 +946,7 @@ void SwTableFormula::GetBoxes( const SwTableBox& rSttBox, while ( pLine->GetUpper() ) pLine = pLine->GetUpper()->GetUpper(); - if( pTbl->IsHeadline( *pLine ) ) + if( pTable->IsHeadline( *pLine ) ) break; // headline in this area! const SwTabFrm *pStartTable = pStt->FindTabFrm(); @@ -962,7 +962,7 @@ void SwTableFormula::GetBoxes( const SwTableBox& rSttBox, while( pLine->GetUpper() ) pLine = pLine->GetUpper()->GetUpper(); - if( pTbl->IsHeadline( *pLine ) ) + if( pTable->IsHeadline( *pLine ) ) rBoxes.erase( rBoxes.begin() + n-- ); } } while( false ); @@ -970,7 +970,7 @@ void SwTableFormula::GetBoxes( const SwTableBox& rSttBox, } /// Are all boxes valid that are referenced by the formula? -void SwTableFormula::_HasValidBoxes( const SwTable& rTbl, OUString& , +void SwTableFormula::_HasValidBoxes( const SwTable& rTable, OUString& , OUString& rFirstBox, OUString* pLastBox, void* pPara ) const { bool* pBValid = static_cast<bool*>(pPara); @@ -995,25 +995,25 @@ void SwTableFormula::_HasValidBoxes( const SwTable& rTbl, OUString& , { const SwNode* pNd = GetNodeOfFormula(); const SwTableBox* pBox = !pNd ? 0 - : const_cast<SwTableBox *>(rTbl.GetTblBox( + : const_cast<SwTableBox *>(rTable.GetTableBox( pNd->FindTableBoxStartNode()->GetIndex() )); if( pLastBox ) - pEndBox = const_cast<SwTableBox*>(lcl_RelToBox( rTbl, pBox, *pLastBox )); - pSttBox = const_cast<SwTableBox*>(lcl_RelToBox( rTbl, pBox, rFirstBox )); + pEndBox = const_cast<SwTableBox*>(lcl_RelToBox( rTable, pBox, *pLastBox )); + pSttBox = const_cast<SwTableBox*>(lcl_RelToBox( rTable, pBox, rFirstBox )); } break; case EXTRNL_NAME: if( pLastBox ) - pEndBox = const_cast<SwTableBox*>(rTbl.GetTblBox( *pLastBox )); - pSttBox = const_cast<SwTableBox*>(rTbl.GetTblBox( rFirstBox )); + pEndBox = const_cast<SwTableBox*>(rTable.GetTableBox( *pLastBox )); + pSttBox = const_cast<SwTableBox*>(rTable.GetTableBox( rFirstBox )); break; } // Are these valid pointers? if( ( pLastBox && - ( !pEndBox || rTbl.GetTabSortBoxes().find( pEndBox ) == rTbl.GetTabSortBoxes().end() ) ) || - ( !pSttBox || rTbl.GetTabSortBoxes().find( pSttBox ) == rTbl.GetTabSortBoxes().end() ) ) + ( !pEndBox || rTable.GetTabSortBoxes().find( pEndBox ) == rTable.GetTabSortBoxes().end() ) ) || + ( !pSttBox || rTable.GetTabSortBoxes().find( pSttBox ) == rTable.GetTabSortBoxes().end() ) ) *pBValid = false; } } @@ -1028,7 +1028,7 @@ bool SwTableFormula::HasValidBoxes() const return bRet; } -sal_uInt16 SwTableFormula::GetLnPosInTbl( const SwTable& rTbl, const SwTableBox* pBox ) +sal_uInt16 SwTableFormula::GetLnPosInTable( const SwTable& rTable, const SwTableBox* pBox ) { sal_uInt16 nRet = USHRT_MAX; if( pBox ) @@ -1036,57 +1036,57 @@ sal_uInt16 SwTableFormula::GetLnPosInTbl( const SwTable& rTbl, const SwTableBox* const SwTableLine* pLn = pBox->GetUpper(); while( pLn->GetUpper() ) pLn = pLn->GetUpper()->GetUpper(); - nRet = rTbl.GetTabLines().GetPos( pLn ); + nRet = rTable.GetTabLines().GetPos( pLn ); } return nRet; } -void SwTableFormula::_SplitMergeBoxNm( const SwTable& rTbl, OUString& rNewStr, +void SwTableFormula::_SplitMergeBoxNm( const SwTable& rTable, OUString& rNewStr, OUString& rFirstBox, OUString* pLastBox, void* pPara ) const { - SwTableFmlUpdate& rTblUpd = *static_cast<SwTableFmlUpdate*>(pPara); + SwTableFormulaUpdate& rTableUpd = *static_cast<SwTableFormulaUpdate*>(pPara); rNewStr += OUString(rFirstBox[0]); // get label for the box rFirstBox = rFirstBox.copy(1); - OUString sTblNm; - const SwTable* pTbl = &rTbl; + OUString sTableNm; + const SwTable* pTable = &rTable; - OUString* pTblNmBox = pLastBox ? pLastBox : &rFirstBox; + OUString* pTableNmBox = pLastBox ? pLastBox : &rFirstBox; - const sal_Int32 nLastBoxLen = pTblNmBox->getLength(); - const sal_Int32 nSeparator = pTblNmBox->indexOf('.'); + const sal_Int32 nLastBoxLen = pTableNmBox->getLength(); + const sal_Int32 nSeparator = pTableNmBox->indexOf('.'); if ( nSeparator>=0 && // If there are dots in the name, than these appear in pairs (e.g. A1.1.1)! - (comphelper::string::getTokenCount(*pTblNmBox, '.') - 1) & 1 ) + (comphelper::string::getTokenCount(*pTableNmBox, '.') - 1) & 1 ) { - sTblNm = pTblNmBox->copy( 0, nSeparator ); - *pTblNmBox = pTblNmBox->copy( nSeparator + 1); // remove dot - const SwTable* pFnd = FindTable( *rTbl.GetFrmFmt()->GetDoc(), sTblNm ); + sTableNm = pTableNmBox->copy( 0, nSeparator ); + *pTableNmBox = pTableNmBox->copy( nSeparator + 1); // remove dot + const SwTable* pFnd = FindTable( *rTable.GetFrameFormat()->GetDoc(), sTableNm ); if( pFnd ) - pTbl = pFnd; + pTable = pFnd; - if( TBL_MERGETBL == rTblUpd.eFlags ) + if( TBL_MERGETBL == rTableUpd.eFlags ) { if( pFnd ) { - if( pFnd == rTblUpd.DATA.pDelTbl ) + if( pFnd == rTableUpd.DATA.pDelTable ) { - if( rTblUpd.pTbl != &rTbl ) // not the current one - rNewStr += rTblUpd.pTbl->GetFrmFmt()->GetName() + "."; // set new table name - rTblUpd.bModified = true; + if( rTableUpd.pTable != &rTable ) // not the current one + rNewStr += rTableUpd.pTable->GetFrameFormat()->GetName() + "."; // set new table name + rTableUpd.bModified = true; } - else if( pFnd != rTblUpd.pTbl || - ( rTblUpd.pTbl != &rTbl && &rTbl != rTblUpd.DATA.pDelTbl)) - rNewStr += sTblNm + "."; // keep table name + else if( pFnd != rTableUpd.pTable || + ( rTableUpd.pTable != &rTable && &rTable != rTableUpd.DATA.pDelTable)) + rNewStr += sTableNm + "."; // keep table name else - rTblUpd.bModified = true; + rTableUpd.bModified = true; } else - rNewStr += sTblNm + "."; // keep table name + rNewStr += sTableNm + "."; // keep table name } } - if( pTblNmBox == pLastBox ) + if( pTableNmBox == pLastBox ) rFirstBox = rFirstBox.copy( nLastBoxLen + 1 ); SwTableBox* pSttBox = 0, *pEndBox = 0; @@ -1101,82 +1101,82 @@ void SwTableFormula::_SplitMergeBoxNm( const SwTable& rTbl, OUString& rNewStr, case REL_NAME: { const SwNode* pNd = GetNodeOfFormula(); - const SwTableBox* pBox = pNd ? pTbl->GetTblBox( + const SwTableBox* pBox = pNd ? pTable->GetTableBox( pNd->FindTableBoxStartNode()->GetIndex() ) : 0; if( pLastBox ) - pEndBox = const_cast<SwTableBox*>(lcl_RelToBox( *pTbl, pBox, *pLastBox )); - pSttBox = const_cast<SwTableBox*>(lcl_RelToBox( *pTbl, pBox, rFirstBox )); + pEndBox = const_cast<SwTableBox*>(lcl_RelToBox( *pTable, pBox, *pLastBox )); + pSttBox = const_cast<SwTableBox*>(lcl_RelToBox( *pTable, pBox, rFirstBox )); } break; case EXTRNL_NAME: if( pLastBox ) - pEndBox = const_cast<SwTableBox*>(pTbl->GetTblBox( *pLastBox )); - pSttBox = const_cast<SwTableBox*>(pTbl->GetTblBox( rFirstBox )); + pEndBox = const_cast<SwTableBox*>(pTable->GetTableBox( *pLastBox )); + pSttBox = const_cast<SwTableBox*>(pTable->GetTableBox( rFirstBox )); break; } - if( pLastBox && pTbl->GetTabSortBoxes().find( pEndBox ) == pTbl->GetTabSortBoxes().end() ) + if( pLastBox && pTable->GetTabSortBoxes().find( pEndBox ) == pTable->GetTabSortBoxes().end() ) pEndBox = 0; - if( pTbl->GetTabSortBoxes().find( pSttBox ) == pTbl->GetTabSortBoxes().end() ) + if( pTable->GetTabSortBoxes().find( pSttBox ) == pTable->GetTabSortBoxes().end() ) pSttBox = 0; - if( TBL_SPLITTBL == rTblUpd.eFlags ) + if( TBL_SPLITTBL == rTableUpd.eFlags ) { // Where are the boxes - in the old or in the new table? - bool bInNewTbl = false; + bool bInNewTable = false; if( pLastBox ) { // It is the "first" box in this selection. It determines if the formula is placed in // the new or the old table. - sal_uInt16 nEndLnPos = SwTableFormula::GetLnPosInTbl( *pTbl, pEndBox ), - nSttLnPos = SwTableFormula::GetLnPosInTbl( *pTbl, pSttBox ); + sal_uInt16 nEndLnPos = SwTableFormula::GetLnPosInTable( *pTable, pEndBox ), + nSttLnPos = SwTableFormula::GetLnPosInTable( *pTable, pSttBox ); if( USHRT_MAX != nSttLnPos && USHRT_MAX != nEndLnPos && - ((rTblUpd.nSplitLine <= nSttLnPos) == - (rTblUpd.nSplitLine <= nEndLnPos)) ) + ((rTableUpd.nSplitLine <= nSttLnPos) == + (rTableUpd.nSplitLine <= nEndLnPos)) ) { // stay in same table - bInNewTbl = rTblUpd.nSplitLine <= nEndLnPos && - pTbl == rTblUpd.pTbl; + bInNewTable = rTableUpd.nSplitLine <= nEndLnPos && + pTable == rTableUpd.pTable; } else { // this is definitely an invalid formula, also mark as modified for Undo - rTblUpd.bModified = true; + rTableUpd.bModified = true; if( pEndBox ) - bInNewTbl = USHRT_MAX != nEndLnPos && - rTblUpd.nSplitLine <= nEndLnPos && - pTbl == rTblUpd.pTbl; + bInNewTable = USHRT_MAX != nEndLnPos && + rTableUpd.nSplitLine <= nEndLnPos && + pTable == rTableUpd.pTable; } } else { - sal_uInt16 nSttLnPos = SwTableFormula::GetLnPosInTbl( *pTbl, pSttBox ); + sal_uInt16 nSttLnPos = SwTableFormula::GetLnPosInTable( *pTable, pSttBox ); // Put it in the new table? - bInNewTbl = USHRT_MAX != nSttLnPos && - rTblUpd.nSplitLine <= nSttLnPos && - pTbl == rTblUpd.pTbl; + bInNewTable = USHRT_MAX != nSttLnPos && + rTableUpd.nSplitLine <= nSttLnPos && + pTable == rTableUpd.pTable; } // formula goes into new table - if( rTblUpd.bBehindSplitLine ) + if( rTableUpd.bBehindSplitLine ) { - if( !bInNewTbl ) + if( !bInNewTable ) { - rTblUpd.bModified = true; - rNewStr += rTblUpd.pTbl->GetFrmFmt()->GetName() + "."; + rTableUpd.bModified = true; + rNewStr += rTableUpd.pTable->GetFrameFormat()->GetName() + "."; } - else if( !sTblNm.isEmpty() ) - rNewStr += sTblNm + "."; + else if( !sTableNm.isEmpty() ) + rNewStr += sTableNm + "."; } - else if( bInNewTbl ) + else if( bInNewTable ) { - rTblUpd.bModified = true; - rNewStr += *rTblUpd.DATA.pNewTblNm + "."; + rTableUpd.bModified = true; + rNewStr += *rTableUpd.DATA.pNewTableNm + "."; } - else if( !sTblNm.isEmpty() ) - rNewStr += sTblNm + "."; + else if( !sTableNm.isEmpty() ) + rNewStr += sTableNm + "."; } if( pLastBox ) @@ -1187,16 +1187,16 @@ void SwTableFormula::_SplitMergeBoxNm( const SwTable& rTbl, OUString& rNewStr, } /// Create external formula but remember that the formula is placed in a split/merged table -void SwTableFormula::ToSplitMergeBoxNm( SwTableFmlUpdate& rTblUpd ) +void SwTableFormula::ToSplitMergeBoxNm( SwTableFormulaUpdate& rTableUpd ) { - const SwTable* pTbl; + const SwTable* pTable; const SwNode* pNd = GetNodeOfFormula(); if( pNd && 0 != ( pNd = pNd->FindTableNode() )) - pTbl = &static_cast<const SwTableNode*>(pNd)->GetTable(); + pTable = &static_cast<const SwTableNode*>(pNd)->GetTable(); else - pTbl = rTblUpd.pTbl; + pTable = rTableUpd.pTable; - m_sFormula = ScanString( &SwTableFormula::_SplitMergeBoxNm, *pTbl, (void*)&rTblUpd ); + m_sFormula = ScanString( &SwTableFormula::_SplitMergeBoxNm, *pTable, (void*)&rTableUpd ); m_eNmType = INTRNL_NAME; } diff --git a/sw/source/core/fields/chpfld.cxx b/sw/source/core/fields/chpfld.cxx index 8f6d2d9f00e8..a6e898424cc8 100644 --- a/sw/source/core/fields/chpfld.cxx +++ b/sw/source/core/fields/chpfld.cxx @@ -63,8 +63,8 @@ SwFieldType* SwChapterFieldType::Copy() const // chapter field -SwChapterField::SwChapterField(SwChapterFieldType* pTyp, sal_uInt32 nFmt) - : SwField(pTyp, nFmt), nLevel( 0 ) +SwChapterField::SwChapterField(SwChapterFieldType* pTyp, sal_uInt32 nFormat) + : SwField(pTyp, nFormat), nLevel( 0 ) {} OUString SwChapterField::Expand() const @@ -99,41 +99,41 @@ SwField* SwChapterField::Copy() const // #i53420# void SwChapterField::ChangeExpansion(const SwFrm* pFrm, - const SwCntntNode* pCntntNode, + const SwContentNode* pContentNode, bool bSrchNum ) { OSL_ENSURE( pFrm, "In which frame am I?" ); - SwDoc* pDoc = const_cast<SwDoc*>(pCntntNode->GetDoc()); + SwDoc* pDoc = const_cast<SwDoc*>(pContentNode->GetDoc()); - const SwTxtNode* pTxtNode = dynamic_cast<const SwTxtNode*>(pCntntNode); - if ( !pTxtNode || !pFrm->IsInDocBody() ) + const SwTextNode* pTextNode = dynamic_cast<const SwTextNode*>(pContentNode); + if ( !pTextNode || !pFrm->IsInDocBody() ) { SwPosition aDummyPos( pDoc->GetNodes().GetEndOfContent() ); - pTxtNode = GetBodyTxtNode( *pDoc, aDummyPos, *pFrm ); + pTextNode = GetBodyTextNode( *pDoc, aDummyPos, *pFrm ); } - if ( pTxtNode ) + if ( pTextNode ) { - ChangeExpansion( *pTxtNode, bSrchNum ); + ChangeExpansion( *pTextNode, bSrchNum ); } } -void SwChapterField::ChangeExpansion(const SwTxtNode &rTxtNd, bool bSrchNum) +void SwChapterField::ChangeExpansion(const SwTextNode &rTextNd, bool bSrchNum) { sNumber.clear(); sTitle.clear(); sPost.clear(); sPre.clear(); - SwDoc* pDoc = const_cast<SwDoc*>(rTxtNd.GetDoc()); - const SwTxtNode *pTxtNd = rTxtNd.FindOutlineNodeOfLevel( nLevel ); - if( pTxtNd ) + SwDoc* pDoc = const_cast<SwDoc*>(rTextNd.GetDoc()); + const SwTextNode *pTextNd = rTextNd.FindOutlineNodeOfLevel( nLevel ); + if( pTextNd ) { if( bSrchNum ) { - const SwTxtNode* pONd = pTxtNd; + const SwTextNode* pONd = pTextNd; do { - if( pONd && pONd->GetTxtColl() ) + if( pONd && pONd->GetTextColl() ) { sal_uInt8 nPrevLvl = nLevel; @@ -146,13 +146,13 @@ void SwChapterField::ChangeExpansion(const SwTxtNode &rTxtNd, bool bSrchNum) else if( SVX_NUM_NUMBER_NONE != pDoc->GetOutlineNumRule() ->Get( nLevel ).GetNumberingType() ) { - pTxtNd = pONd; + pTextNd = pONd; break; } if( !nLevel-- ) break; - pONd = pTxtNd->FindOutlineNodeOfLevel( nLevel ); + pONd = pTextNd->FindOutlineNodeOfLevel( nLevel ); } else break; @@ -161,25 +161,25 @@ void SwChapterField::ChangeExpansion(const SwTxtNode &rTxtNd, bool bSrchNum) // get the number without Pre-/Post-fixstrings - if ( pTxtNd->IsOutline() ) + if ( pTextNd->IsOutline() ) { // correction of refactoring done by cws swnumtree: // retrieve numbering string without prefix and suffix strings // as stated in the above german comment. - sNumber = pTxtNd->GetNumString( false ); + sNumber = pTextNd->GetNumString( false ); - SwNumRule* pRule( pTxtNd->GetNumRule() ); - if ( pTxtNd->IsCountedInList() && pRule ) + SwNumRule* pRule( pTextNd->GetNumRule() ); + if ( pTextNd->IsCountedInList() && pRule ) { - int nListLevel = pTxtNd->GetActualListLevel(); + int nListLevel = pTextNd->GetActualListLevel(); if (nListLevel < 0) nListLevel = 0; if (nListLevel >= MAXLEVEL) nListLevel = MAXLEVEL - 1; - const SwNumFmt& rNFmt = pRule->Get(nListLevel); - sPost = rNFmt.GetSuffix(); - sPre = rNFmt.GetPrefix(); + const SwNumFormat& rNFormat = pRule->Get(nListLevel); + sPost = rNFormat.GetSuffix(); + sPre = rNFormat.GetPrefix(); } } else @@ -187,7 +187,7 @@ void SwChapterField::ChangeExpansion(const SwTxtNode &rTxtNd, bool bSrchNum) sNumber = "??"; } - sTitle = removeControlChars(pTxtNd->GetExpandTxt(0, -1, false, false, false, false)); + sTitle = removeControlChars(pTextNd->GetExpandText(0, -1, false, false, false, false)); } } diff --git a/sw/source/core/fields/dbfld.cxx b/sw/source/core/fields/dbfld.cxx index a971af328459..fa8969e1b7e0 100644 --- a/sw/source/core/fields/dbfld.cxx +++ b/sw/source/core/fields/dbfld.cxx @@ -89,11 +89,11 @@ void SwDBFieldType::ReleaseRef() if (--nRefCnt <= 0) { - size_t nPos = GetDoc()->getIDocumentFieldsAccess().GetFldTypes()->GetPos(this); + size_t nPos = GetDoc()->getIDocumentFieldsAccess().GetFieldTypes()->GetPos(this); if (nPos != SIZE_MAX) { - GetDoc()->getIDocumentFieldsAccess().RemoveFldType(nPos); + GetDoc()->getIDocumentFieldsAccess().RemoveFieldType(nPos); delete this; } } @@ -138,19 +138,19 @@ bool SwDBFieldType::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId ) if( sTmp != sColumn ) { sColumn = sTmp; - SwIterator<SwFmtFld,SwFieldType> aIter( *this ); - SwFmtFld* pFmtFld = aIter.First(); - while(pFmtFld) + SwIterator<SwFormatField,SwFieldType> aIter( *this ); + SwFormatField* pFormatField = aIter.First(); + while(pFormatField) { // field in Undo? - SwTxtFld *pTxtFld = pFmtFld->GetTxtFld(); - if(pTxtFld && pTxtFld->GetTxtNode().GetNodes().IsDocNodes() ) + SwTextField *pTextField = pFormatField->GetTextField(); + if(pTextField && pTextField->GetTextNode().GetNodes().IsDocNodes() ) { - SwDBField* pDBField = static_cast<SwDBField*>(pFmtFld->GetField()); + SwDBField* pDBField = static_cast<SwDBField*>(pFormatField->GetField()); pDBField->ClearInitialized(); pDBField->InitContent(); } - pFmtFld = aIter.Next(); + pFormatField = aIter.Next(); } } } @@ -166,10 +166,10 @@ bool SwDBFieldType::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId ) // database field -SwDBField::SwDBField(SwDBFieldType* pTyp, sal_uLong nFmt) - : SwValueField(pTyp, nFmt), +SwDBField::SwDBField(SwDBFieldType* pTyp, sal_uLong nFormat) + : SwValueField(pTyp, nFormat), nSubType(0), - bIsInBodyTxt(true), + bIsInBodyText(true), bValidValue(false), bInitialized(false) { @@ -218,7 +218,7 @@ SwField* SwDBField::Copy() const { SwDBField *pTmp = new SwDBField(static_cast<SwDBFieldType*>(GetTyp()), GetFormat()); pTmp->aContent = aContent; - pTmp->bIsInBodyTxt = bIsInBodyTxt; + pTmp->bIsInBodyText = bIsInBodyText; pTmp->bValidValue = bValidValue; pTmp->bInitialized = bInitialized; pTmp->nSubType = nSubType; @@ -263,7 +263,7 @@ SwFieldType* SwDBField::ChgTyp( SwFieldType* pNewType ) return pOld; } -bool SwDBField::FormatValue( SvNumberFormatter* pDocFormatter, OUString &aString, sal_uInt32 nFmt, +bool SwDBField::FormatValue( SvNumberFormatter* pDocFormatter, OUString &aString, sal_uInt32 nFormat, double &aNumber, sal_Int32 nColumnType, SwDBField *pField ) { bool bValidValue = false; @@ -293,7 +293,7 @@ bool SwDBField::FormatValue( SvNumberFormatter* pDocFormatter, OUString &aString else aNumber = aVal.GetDouble(); - if (nFmt && nFmt != SAL_MAX_UINT32 && !pDocFormatter->IsTextFormat(nFmt)) + if (nFormat && nFormat != SAL_MAX_UINT32 && !pDocFormatter->IsTextFormat(nFormat)) bValidValue = true; // because of bug #60339 not for all strings } else @@ -322,7 +322,7 @@ void SwDBField::Evaluate() if(!pMgr || !pMgr->IsDataSourceOpen(aTmpData.sDataSource, aTmpData.sCommand, true)) return ; - sal_uInt32 nFmt = 0; + sal_uInt32 nFormat = 0; // search corresponding column name OUString aColNm( static_cast<SwDBFieldType*>(GetTyp())->GetColumnName() ); @@ -330,14 +330,14 @@ void SwDBField::Evaluate() SvNumberFormatter* pDocFormatter = GetDoc()->GetNumberFormatter(); pMgr->GetMergeColumnCnt(aColNm, GetLanguage(), aContent, &nValue); if( !( nSubType & nsSwExtendedSubType::SUB_OWN_FMT ) ) - SetFormat( nFmt = pMgr->GetColumnFmt( aTmpData.sDataSource, aTmpData.sCommand, + SetFormat( nFormat = pMgr->GetColumnFormat( aTmpData.sDataSource, aTmpData.sCommand, aColNm, pDocFormatter, GetLanguage() )); sal_Int32 nColumnType = nValue == DBL_MAX ? 0 : pMgr->GetColumnType(aTmpData.sDataSource, aTmpData.sCommand, aColNm); - bValidValue = FormatValue( pDocFormatter, aContent, nFmt, nValue, nColumnType, this ); + bValidValue = FormatValue( pDocFormatter, aContent, nFormat, nValue, nColumnType, this ); if( DBL_MAX != nValue ) aContent = static_cast<SwValueFieldType*>(GetTyp())->ExpandValue(nValue, GetFormat(), GetLanguage()); @@ -410,18 +410,18 @@ bool SwDBField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId ) //invalidate text node if(GetTyp()) { - SwIterator<SwFmtFld,SwFieldType> aIter( *GetTyp() ); - SwFmtFld* pFmtFld = aIter.First(); - while(pFmtFld) + SwIterator<SwFormatField,SwFieldType> aIter( *GetTyp() ); + SwFormatField* pFormatField = aIter.First(); + while(pFormatField) { - SwTxtFld *pTxtFld = pFmtFld->GetTxtFld(); - if(pTxtFld && static_cast<SwDBField*>(pFmtFld->GetField()) == this ) + SwTextField *pTextField = pFormatField->GetTextField(); + if(pTextField && static_cast<SwDBField*>(pFormatField->GetField()) == this ) { //notify the change - pTxtFld->NotifyContentChange(*pFmtFld); + pTextField->NotifyContentChange(*pFormatField); break; } - pFmtFld = aIter.Next(); + pFormatField = aIter.Next(); } } } @@ -447,8 +447,8 @@ bool SwDBField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId ) // base class for all further database fields -SwDBNameInfField::SwDBNameInfField(SwFieldType* pTyp, const SwDBData& rDBData, sal_uLong nFmt) : - SwField(pTyp, nFmt), +SwDBNameInfField::SwDBNameInfField(SwFieldType* pTyp, const SwDBData& rDBData, sal_uLong nFormat) : + SwField(pTyp, nFormat), aDBData(rDBData), nSubType(0) { @@ -763,8 +763,8 @@ SwFieldType* SwDBNameFieldType::Copy() const // name of the connected database -SwDBNameField::SwDBNameField(SwDBNameFieldType* pTyp, const SwDBData& rDBData, sal_uLong nFmt) - : SwDBNameInfField(pTyp, rDBData, nFmt) +SwDBNameField::SwDBNameField(SwDBNameFieldType* pTyp, const SwDBData& rDBData, sal_uLong nFormat) + : SwDBNameInfField(pTyp, rDBData, nFormat) {} OUString SwDBNameField::Expand() const @@ -808,8 +808,8 @@ SwFieldType* SwDBSetNumberFieldType::Copy() const SwDBSetNumberField::SwDBSetNumberField(SwDBSetNumberFieldType* pTyp, const SwDBData& rDBData, - sal_uLong nFmt) - : SwDBNameInfField(pTyp, rDBData, nFmt), nNumber(0) + sal_uLong nFormat) + : SwDBNameInfField(pTyp, rDBData, nFormat), nNumber(0) {} OUString SwDBSetNumberField::Expand() const diff --git a/sw/source/core/fields/ddefld.cxx b/sw/source/core/fields/ddefld.cxx index 376f7ac2d7c4..de9d8274cb3f 100644 --- a/sw/source/core/fields/ddefld.cxx +++ b/sw/source/core/fields/ddefld.cxx @@ -41,11 +41,11 @@ using namespace ::com::sun::star; class SwIntrnlRefLink : public SwBaseLink { - SwDDEFieldType& rFldType; + SwDDEFieldType& rFieldType; public: - SwIntrnlRefLink( SwDDEFieldType& rType, SfxLinkUpdateMode nUpdateType, SotClipboardFormatId nFmt ) - : SwBaseLink( nUpdateType, nFmt ), - rFldType( rType ) + SwIntrnlRefLink( SwDDEFieldType& rType, SfxLinkUpdateMode nUpdateType, SotClipboardFormatId nFormat ) + : SwBaseLink( nUpdateType, nFormat ), + rFieldType( rType ) {} virtual void Closed() SAL_OVERRIDE; @@ -82,9 +82,9 @@ public: if( bDel ) sStr = sStr.copy( 0, n ); - rFldType.SetExpansion( sStr ); + rFieldType.SetExpansion( sStr ); // set Expansion first! (otherwise this flag will be deleted) - rFldType.SetCRLFDelFlag( bDel ); + rFieldType.SetCRLFDelFlag( bDel ); } break; @@ -93,25 +93,25 @@ public: return SUCCESS; } - OSL_ENSURE( rFldType.GetDoc(), "no pDoc" ); + OSL_ENSURE( rFieldType.GetDoc(), "no pDoc" ); // no dependencies left? - if( rFldType.HasWriterListeners() && !rFldType.IsModifyLocked() && !ChkNoDataFlag() ) + if( rFieldType.HasWriterListeners() && !rFieldType.IsModifyLocked() && !ChkNoDataFlag() ) { - SwViewShell* pSh = rFldType.GetDoc()->getIDocumentLayoutAccess().GetCurrentViewShell(); - SwEditShell* pESh = rFldType.GetDoc()->GetEditShell(); + SwViewShell* pSh = rFieldType.GetDoc()->getIDocumentLayoutAccess().GetCurrentViewShell(); + SwEditShell* pESh = rFieldType.GetDoc()->GetEditShell(); // Search for fields. If no valid found, disconnect. SwMsgPoolItem aUpdateDDE( RES_UPDATEDDETBL ); bool bCallModify = false; - rFldType.LockModify(); + rFieldType.LockModify(); - SwIterator<SwClient,SwFieldType> aIter(rFldType); + SwIterator<SwClient,SwFieldType> aIter(rFieldType); for(SwClient* pLast = aIter.First(); pLast; pLast = aIter.Next()) { // a DDE table or a DDE field attribute in the text - if( !pLast->IsA( TYPE( SwFmtFld ) ) || - static_cast<SwFmtFld*>(pLast)->GetTxtFld() ) + if( !pLast->IsA( TYPE( SwFormatField ) ) || + static_cast<SwFormatField*>(pLast)->GetTextField() ) { if( !bCallModify ) { @@ -125,7 +125,7 @@ public: } } - rFldType.UnlockModify(); + rFieldType.UnlockModify(); if( bCallModify ) { @@ -144,15 +144,15 @@ public: void SwIntrnlRefLink::Closed() { - if( rFldType.GetDoc() && !rFldType.GetDoc()->IsInDtor() ) + if( rFieldType.GetDoc() && !rFieldType.GetDoc()->IsInDtor() ) { // advise goes, convert all fields into text? - SwViewShell* pSh = rFldType.GetDoc()->getIDocumentLayoutAccess().GetCurrentViewShell(); - SwEditShell* pESh = rFldType.GetDoc()->GetEditShell(); + SwViewShell* pSh = rFieldType.GetDoc()->getIDocumentLayoutAccess().GetCurrentViewShell(); + SwEditShell* pESh = rFieldType.GetDoc()->GetEditShell(); if( pESh ) { pESh->StartAllAction(); - pESh->FieldToText( &rFldType ); + pESh->FieldToText( &rFieldType ); pESh->EndAllAction(); } else @@ -169,20 +169,20 @@ const SwNode* SwIntrnlRefLink::GetAnchor() const { // here, any anchor of the normal NodesArray should be sufficient const SwNode* pNd = 0; - SwIterator<SwClient,SwFieldType> aIter(rFldType); + SwIterator<SwClient,SwFieldType> aIter(rFieldType); for(SwClient* pLast = aIter.First(); pLast; pLast = aIter.Next()) { // a DDE table or a DDE field attribute in the text - if( !pLast->IsA( TYPE( SwFmtFld ) )) + if( !pLast->IsA( TYPE( SwFormatField ) )) { SwDepend* pDep = static_cast<SwDepend*>(pLast); - SwDDETable* pDDETbl = static_cast<SwDDETable*>(pDep->GetToTell()); - pNd = pDDETbl->GetTabSortBoxes()[0]->GetSttNd(); + SwDDETable* pDDETable = static_cast<SwDDETable*>(pDep->GetToTell()); + pNd = pDDETable->GetTabSortBoxes()[0]->GetSttNd(); } - else if( static_cast<SwFmtFld*>(pLast)->GetTxtFld() ) - pNd = static_cast<SwFmtFld*>(pLast)->GetTxtFld()->GetpTxtNode(); + else if( static_cast<SwFormatField*>(pLast)->GetTextField() ) + pNd = static_cast<SwFormatField*>(pLast)->GetTextField()->GetpTextNode(); - if( pNd && &rFldType.GetDoc()->GetNodes() == &pNd->GetNodes() ) + if( pNd && &rFieldType.GetDoc()->GetNodes() == &pNd->GetNodes() ) break; pNd = 0; } @@ -193,32 +193,32 @@ bool SwIntrnlRefLink::IsInRange( sal_uLong nSttNd, sal_uLong nEndNd, sal_Int32 nStt, sal_Int32 nEnd ) const { // here, any anchor of the normal NodesArray should be sufficient - SwNodes* pNds = &rFldType.GetDoc()->GetNodes(); - SwIterator<SwClient,SwFieldType> aIter(rFldType); + SwNodes* pNds = &rFieldType.GetDoc()->GetNodes(); + SwIterator<SwClient,SwFieldType> aIter(rFieldType); for(SwClient* pLast = aIter.First(); pLast; pLast = aIter.Next()) { // a DDE table or a DDE field attribute in the text - if( !pLast->IsA( TYPE( SwFmtFld ) )) + if( !pLast->IsA( TYPE( SwFormatField ) )) { SwDepend* pDep = static_cast<SwDepend*>(pLast); - SwDDETable* pDDETbl = static_cast<SwDDETable*>(pDep->GetToTell()); - const SwTableNode* pTblNd = pDDETbl->GetTabSortBoxes()[0]-> + SwDDETable* pDDETable = static_cast<SwDDETable*>(pDep->GetToTell()); + const SwTableNode* pTableNd = pDDETable->GetTabSortBoxes()[0]-> GetSttNd()->FindTableNode(); - if( pTblNd->GetNodes().IsDocNodes() && - nSttNd < pTblNd->EndOfSectionIndex() && - nEndNd > pTblNd->GetIndex() ) + if( pTableNd->GetNodes().IsDocNodes() && + nSttNd < pTableNd->EndOfSectionIndex() && + nEndNd > pTableNd->GetIndex() ) return true; } - else if( static_cast<SwFmtFld*>(pLast)->GetTxtFld() ) + else if( static_cast<SwFormatField*>(pLast)->GetTextField() ) { - const SwTxtFld* pTFld = static_cast<SwFmtFld*>(pLast)->GetTxtFld(); - const SwTxtNode* pNd = pTFld->GetpTxtNode(); + const SwTextField* pTField = static_cast<SwFormatField*>(pLast)->GetTextField(); + const SwTextNode* pNd = pTField->GetpTextNode(); if( pNd && pNds == &pNd->GetNodes() ) { sal_uLong nNdPos = pNd->GetIndex(); if( nSttNd <= nNdPos && nNdPos <= nEndNd && - ( nNdPos != nSttNd || pTFld->GetStart() >= nStt ) && - ( nNdPos != nEndNd || pTFld->GetStart() < nEnd )) + ( nNdPos != nSttNd || pTField->GetStart() >= nStt ) && + ( nNdPos != nEndNd || pTField->GetStart() < nEnd )) return true; } } diff --git a/sw/source/core/fields/ddetbl.cxx b/sw/source/core/fields/ddetbl.cxx index 268f248b1140..b4823e6a61e2 100644 --- a/sw/source/core/fields/ddetbl.cxx +++ b/sw/source/core/fields/ddetbl.cxx @@ -64,17 +64,17 @@ SwDDETable::SwDDETable( SwTable& rTable, SwDDEFieldType* pDDEType, bool bUpdate SwDDETable::~SwDDETable() { - SwDDEFieldType* pFldTyp = static_cast<SwDDEFieldType*>(aDepend.GetRegisteredIn()); - SwDoc* pDoc = GetFrmFmt()->GetDoc(); + SwDDEFieldType* pFieldTyp = static_cast<SwDDEFieldType*>(aDepend.GetRegisteredIn()); + SwDoc* pDoc = GetFrameFormat()->GetDoc(); if( !pDoc->IsInDtor() && !aLines.empty() && GetTabSortBoxes()[0]->GetSttNd()->GetNodes().IsDocNodes() ) - pFldTyp->DecRefCnt(); + pFieldTyp->DecRefCnt(); // If it is the last dependent of the "deleted field" than delete it finally - if( pFldTyp->IsDeleted() && pFldTyp->HasOnlyOneListener() ) + if( pFieldTyp->IsDeleted() && pFieldTyp->HasOnlyOneListener() ) { - pFldTyp->Remove( &aDepend ); - delete pFldTyp; + pFieldTyp->Remove( &aDepend ); + delete pFieldTyp; } } @@ -97,7 +97,7 @@ void SwDDETable::SwClientNotify( const SwModify& rModify, const SfxHint& rHint ) void SwDDETable::ChangeContent() { - OSL_ENSURE( GetFrmFmt(), "No FrameFormat" ); + OSL_ENSURE( GetFrameFormat(), "No FrameFormat" ); // Is this the correct NodesArray? (because of UNDO) if( aLines.empty() ) @@ -106,7 +106,7 @@ void SwDDETable::ChangeContent() if( !GetTabSortBoxes()[0]->GetSttNd()->GetNodes().IsDocNodes() ) return; - // access to DDEFldType + // access to DDEFieldType SwDDEFieldType* pDDEType = static_cast<SwDDEFieldType*>(aDepend.GetRegisteredIn()); OUString aExpand = comphelper::string::remove(pDDEType->GetExpansion(), '\r'); @@ -122,26 +122,26 @@ void SwDDETable::ChangeContent() SwTableBox* pBox = pLine->GetTabBoxes()[ i ]; OSL_ENSURE( pBox->GetSttIdx(), "no content box" ); SwNodeIndex aNdIdx( *pBox->GetSttNd(), 1 ); - SwTxtNode* pTxtNode = aNdIdx.GetNode().GetTxtNode(); - OSL_ENSURE( pTxtNode, "No Node" ); - SwIndex aCntIdx( pTxtNode, 0 ); - pTxtNode->EraseText( aCntIdx ); - pTxtNode->InsertText( aLine.getToken( 0, '\t', nLineTokenPos ), aCntIdx ); - - SwTableBoxFmt* pBoxFmt = static_cast<SwTableBoxFmt*>(pBox->GetFrmFmt()); - pBoxFmt->LockModify(); - pBoxFmt->ResetFmtAttr( RES_BOXATR_VALUE ); - pBoxFmt->UnlockModify(); + SwTextNode* pTextNode = aNdIdx.GetNode().GetTextNode(); + OSL_ENSURE( pTextNode, "No Node" ); + SwIndex aCntIdx( pTextNode, 0 ); + pTextNode->EraseText( aCntIdx ); + pTextNode->InsertText( aLine.getToken( 0, '\t', nLineTokenPos ), aCntIdx ); + + SwTableBoxFormat* pBoxFormat = static_cast<SwTableBoxFormat*>(pBox->GetFrameFormat()); + pBoxFormat->LockModify(); + pBoxFormat->ResetFormatAttr( RES_BOXATR_VALUE ); + pBoxFormat->UnlockModify(); } } - const IDocumentSettingAccess* pIDSA = GetFrmFmt()->getIDocumentSettingAccess(); - SwDoc* pDoc = GetFrmFmt()->GetDoc(); + const IDocumentSettingAccess* pIDSA = GetFrameFormat()->getIDocumentSettingAccess(); + SwDoc* pDoc = GetFrameFormat()->GetDoc(); if( AUTOUPD_FIELD_AND_CHARTS == pIDSA->getFieldUpdateFlags(true) ) pDoc->getIDocumentFieldsAccess().SetFieldsDirty( true, NULL, 0 ); } -SwDDEFieldType* SwDDETable::GetDDEFldType() +SwDDEFieldType* SwDDETable::GetDDEFieldType() { return static_cast<SwDDEFieldType*>(aDepend.GetRegisteredIn()); } @@ -149,8 +149,8 @@ SwDDEFieldType* SwDDETable::GetDDEFldType() bool SwDDETable::NoDDETable() { // search table node - OSL_ENSURE( GetFrmFmt(), "No FrameFormat" ); - SwDoc* pDoc = GetFrmFmt()->GetDoc(); + OSL_ENSURE( GetFrameFormat(), "No FrameFormat" ); + SwDoc* pDoc = GetFrameFormat()->GetDoc(); // Is this the correct NodesArray? (because of UNDO) if( aLines.empty() ) @@ -160,23 +160,23 @@ bool SwDDETable::NoDDETable() if( !pNd->GetNodes().IsDocNodes() ) return false; - SwTableNode* pTblNd = pNd->FindTableNode(); - OSL_ENSURE( pTblNd, "Where is the table?"); + SwTableNode* pTableNd = pNd->FindTableNode(); + OSL_ENSURE( pTableNd, "Where is the table?"); - SwTable* pNewTbl = new SwTable( *this ); + SwTable* pNewTable = new SwTable( *this ); // copy the table data - pNewTbl->GetTabSortBoxes().insert( GetTabSortBoxes() ); // move content boxes + pNewTable->GetTabSortBoxes().insert( GetTabSortBoxes() ); // move content boxes GetTabSortBoxes().clear(); - pNewTbl->GetTabLines().insert( pNewTbl->GetTabLines().begin(), + pNewTable->GetTabLines().insert( pNewTable->GetTabLines().begin(), GetTabLines().begin(), GetTabLines().end() ); // move lines GetTabLines().clear(); if( pDoc->getIDocumentLayoutAccess().GetCurrentViewShell() ) static_cast<SwDDEFieldType*>(aDepend.GetRegisteredIn())->DecRefCnt(); - pTblNd->SetNewTable( pNewTbl ); // replace table + pTableNd->SetNewTable( pNewTable ); // replace table return true; } diff --git a/sw/source/core/fields/docufld.cxx b/sw/source/core/fields/docufld.cxx index 75139a9753cc..6c7b4d5e3363 100644 --- a/sw/source/core/fields/docufld.cxx +++ b/sw/source/core/fields/docufld.cxx @@ -111,20 +111,20 @@ SwPageNumberFieldType::SwPageNumberFieldType() { } -OUString SwPageNumberFieldType::Expand( sal_uInt32 nFmt, short nOff, +OUString SwPageNumberFieldType::Expand( sal_uInt32 nFormat, short nOff, sal_uInt16 const nPageNumber, sal_uInt16 const nMaxPage, const OUString& rUserStr ) const { - sal_uInt32 nTmpFmt = (SVX_NUM_PAGEDESC == nFmt) ? (sal_uInt32)nNumberingType : nFmt; + sal_uInt32 nTmpFormat = (SVX_NUM_PAGEDESC == nFormat) ? (sal_uInt32)nNumberingType : nFormat; int const nTmp = nPageNumber + nOff; - if (0 > nTmp || SVX_NUM_NUMBER_NONE == nTmpFmt || (!bVirtuell && nTmp > nMaxPage)) + if (0 > nTmp || SVX_NUM_NUMBER_NONE == nTmpFormat || (!bVirtuell && nTmp > nMaxPage)) return OUString(); - if( SVX_NUM_CHAR_SPECIAL == nTmpFmt ) + if( SVX_NUM_CHAR_SPECIAL == nTmpFormat ) return rUserStr; - return FormatNumber( nTmp, nTmpFmt ); + return FormatNumber( nTmp, nTmpFormat ); } SwFieldType* SwPageNumberFieldType::Copy() const @@ -139,10 +139,10 @@ SwFieldType* SwPageNumberFieldType::Copy() const void SwPageNumberFieldType::ChangeExpansion( SwDoc* pDoc, bool bVirt, - const sal_Int16* pNumFmt ) + const sal_Int16* pNumFormat ) { - if( pNumFmt ) - nNumberingType = *pNumFmt; + if( pNumFormat ) + nNumberingType = *pNumFormat; bVirtuell = false; if (bVirt && pDoc) @@ -152,19 +152,19 @@ void SwPageNumberFieldType::ChangeExpansion( SwDoc* pDoc, sal_uInt32 nMaxItems = rPool.GetItemCount2( RES_PAGEDESC ); for( sal_uInt32 n = 0; n < nMaxItems; ++n ) { - const SwFmtPageDesc *pDesc; - if( 0 != (pDesc = static_cast<const SwFmtPageDesc*>(rPool.GetItem2( RES_PAGEDESC, n )) ) + const SwFormatPageDesc *pDesc; + if( 0 != (pDesc = static_cast<const SwFormatPageDesc*>(rPool.GetItem2( RES_PAGEDESC, n )) ) && pDesc->GetNumOffset() && pDesc->GetDefinedIn() ) { - const SwCntntNode* pNd = PTR_CAST( SwCntntNode, pDesc->GetDefinedIn() ); + const SwContentNode* pNd = PTR_CAST( SwContentNode, pDesc->GetDefinedIn() ); if( pNd ) { - if ( SwIterator<SwFrm,SwCntntNode>(*pNd).First() ) + if ( SwIterator<SwFrm,SwContentNode>(*pNd).First() ) bVirtuell = true; } - else if( pDesc->GetDefinedIn()->ISA( SwFmt )) + else if( pDesc->GetDefinedIn()->ISA( SwFormat )) { - SwAutoFmtGetDocNode aGetHt( &pDoc->GetNodes() ); + SwAutoFormatGetDocNode aGetHt( &pDoc->GetNodes() ); bVirtuell = !pDesc->GetDefinedIn()->GetInfo( aGetHt ); break; } @@ -174,9 +174,9 @@ void SwPageNumberFieldType::ChangeExpansion( SwDoc* pDoc, } SwPageNumberField::SwPageNumberField(SwPageNumberFieldType* pTyp, - sal_uInt16 nSub, sal_uInt32 nFmt, short nOff, + sal_uInt16 nSub, sal_uInt32 nFormat, short nOff, sal_uInt16 const nPageNumber, sal_uInt16 const nMaxPage) - : SwField(pTyp, nFmt), nSubType(nSub), nOffset(nOff) + : SwField(pTyp, nFormat), nSubType(nSub), nOffset(nOff) , m_nPageNumber(nPageNumber) , m_nMaxPage(nMaxPage) { @@ -192,26 +192,26 @@ void SwPageNumberField::ChangeExpansion(sal_uInt16 const nPageNumber, OUString SwPageNumberField::Expand() const { OUString sRet; - SwPageNumberFieldType* pFldType = static_cast<SwPageNumberFieldType*>(GetTyp()); + SwPageNumberFieldType* pFieldType = static_cast<SwPageNumberFieldType*>(GetTyp()); if( PG_NEXT == nSubType && 1 != nOffset ) { - sRet = pFldType->Expand(GetFormat(), 1, m_nPageNumber, m_nMaxPage, sUserStr); + sRet = pFieldType->Expand(GetFormat(), 1, m_nPageNumber, m_nMaxPage, sUserStr); if (!sRet.isEmpty()) { - sRet = pFldType->Expand(GetFormat(), nOffset, m_nPageNumber, m_nMaxPage, sUserStr); + sRet = pFieldType->Expand(GetFormat(), nOffset, m_nPageNumber, m_nMaxPage, sUserStr); } } else if( PG_PREV == nSubType && -1 != nOffset ) { - sRet = pFldType->Expand(GetFormat(), -1, m_nPageNumber, m_nMaxPage, sUserStr); + sRet = pFieldType->Expand(GetFormat(), -1, m_nPageNumber, m_nMaxPage, sUserStr); if (!sRet.isEmpty()) { - sRet = pFldType->Expand(GetFormat(), nOffset, m_nPageNumber, m_nMaxPage, sUserStr); + sRet = pFieldType->Expand(GetFormat(), nOffset, m_nPageNumber, m_nMaxPage, sUserStr); } } else - sRet = pFldType->Expand(GetFormat(), nOffset, m_nPageNumber, m_nMaxPage, sUserStr); + sRet = pFieldType->Expand(GetFormat(), nOffset, m_nPageNumber, m_nMaxPage, sUserStr); return sRet; } @@ -321,10 +321,10 @@ SwAuthorFieldType::SwAuthorFieldType() { } -OUString SwAuthorFieldType::Expand(sal_uLong nFmt) +OUString SwAuthorFieldType::Expand(sal_uLong nFormat) { SvtUserOptions& rOpt = SW_MOD()->GetUserOptions(); - if((nFmt & 0xff) == AF_NAME) + if((nFormat & 0xff) == AF_NAME) return rOpt.GetFullName(); return rOpt.GetID(); @@ -335,8 +335,8 @@ SwFieldType* SwAuthorFieldType::Copy() const return new SwAuthorFieldType; } -SwAuthorField::SwAuthorField(SwAuthorFieldType* pTyp, sal_uInt32 nFmt) - : SwField(pTyp, nFmt) +SwAuthorField::SwAuthorField(SwAuthorFieldType* pTyp, sal_uInt32 nFormat) + : SwField(pTyp, nFormat) { aContent = SwAuthorFieldType::Expand(GetFormat()); } @@ -411,14 +411,14 @@ SwFileNameFieldType::SwFileNameFieldType(SwDoc *pDocument) pDoc = pDocument; } -OUString SwFileNameFieldType::Expand(sal_uLong nFmt) const +OUString SwFileNameFieldType::Expand(sal_uLong nFormat) const { OUString aRet; const SwDocShell* pDShell = pDoc->GetDocShell(); if( pDShell && pDShell->HasName() ) { const INetURLObject& rURLObj = pDShell->GetMedium()->GetURLObject(); - switch( nFmt & ~FF_FIXED ) + switch( nFormat & ~FF_FIXED ) { case FF_PATH: { @@ -469,8 +469,8 @@ SwFieldType* SwFileNameFieldType::Copy() const return pTmp; } -SwFileNameField::SwFileNameField(SwFileNameFieldType* pTyp, sal_uInt32 nFmt) - : SwField(pTyp, nFmt) +SwFileNameField::SwFileNameField(SwFileNameFieldType* pTyp, sal_uInt32 nFormat) + : SwField(pTyp, nFormat) { aContent = static_cast<SwFileNameFieldType*>(GetTyp())->Expand(GetFormat()); } @@ -583,9 +583,9 @@ SwTemplNameFieldType::SwTemplNameFieldType(SwDoc *pDocument) pDoc = pDocument; } -OUString SwTemplNameFieldType::Expand(sal_uLong nFmt) const +OUString SwTemplNameFieldType::Expand(sal_uLong nFormat) const { - OSL_ENSURE( nFmt < FF_END, "Expand: no valid Fmt!" ); + OSL_ENSURE( nFormat < FF_END, "Expand: no valid Format!" ); OUString aRet; SwDocShell *pDocShell(pDoc->GetDocShell()); @@ -597,11 +597,11 @@ OUString SwTemplNameFieldType::Expand(sal_uLong nFmt) const xDPS->getDocumentProperties()); OSL_ENSURE(xDocProps.is(), "Doc has no DocumentProperties"); - if( FF_UI_NAME == nFmt ) + if( FF_UI_NAME == nFormat ) aRet = xDocProps->getTemplateName(); else if( !xDocProps->getTemplateURL().isEmpty() ) { - if( FF_UI_RANGE == nFmt ) + if( FF_UI_RANGE == nFormat ) { // for getting region names! SfxDocumentTemplates aFac; @@ -613,13 +613,13 @@ OUString SwTemplNameFieldType::Expand(sal_uLong nFmt) const else { INetURLObject aPathName( xDocProps->getTemplateURL() ); - if( FF_NAME == nFmt ) + if( FF_NAME == nFormat ) aRet = aPathName.GetName(URL_DECODE); - else if( FF_NAME_NOEXT == nFmt ) + else if( FF_NAME_NOEXT == nFormat ) aRet = aPathName.GetBase(); else { - if( FF_PATH == nFmt ) + if( FF_PATH == nFormat ) { aPathName.removeSegment(); aRet = aPathName.GetFull(); @@ -639,8 +639,8 @@ SwFieldType* SwTemplNameFieldType::Copy() const return pTmp; } -SwTemplNameField::SwTemplNameField(SwTemplNameFieldType* pTyp, sal_uInt32 nFmt) - : SwField(pTyp, nFmt) +SwTemplNameField::SwTemplNameField(SwTemplNameFieldType* pTyp, sal_uInt32 nFormat) + : SwField(pTyp, nFormat) {} OUString SwTemplNameField::Expand() const @@ -725,13 +725,13 @@ SwDocStatFieldType::SwDocStatFieldType(SwDoc* pDocument) pDoc = pDocument; } -OUString SwDocStatFieldType::Expand(sal_uInt16 nSubType, sal_uInt32 nFmt) const +OUString SwDocStatFieldType::Expand(sal_uInt16 nSubType, sal_uInt32 nFormat) const { sal_uInt32 nVal = 0; const SwDocStat& rDStat = pDoc->getIDocumentStatistics().GetDocStat(); switch( nSubType ) { - case DS_TBL: nVal = rDStat.nTbl; break; + case DS_TBL: nVal = rDStat.nTable; break; case DS_GRF: nVal = rDStat.nGrf; break; case DS_OLE: nVal = rDStat.nOLE; break; case DS_PARA: nVal = rDStat.nPara; break; @@ -741,15 +741,15 @@ OUString SwDocStatFieldType::Expand(sal_uInt16 nSubType, sal_uInt32 nFmt) const if( pDoc->getIDocumentLayoutAccess().GetCurrentLayout() ) ((SwDocStat &)rDStat).nPage = pDoc->getIDocumentLayoutAccess().GetCurrentLayout()->GetPageNum(); nVal = rDStat.nPage; - if( SVX_NUM_PAGEDESC == nFmt ) - nFmt = (sal_uInt32)nNumberingType; + if( SVX_NUM_PAGEDESC == nFormat ) + nFormat = (sal_uInt32)nNumberingType; break; default: OSL_FAIL( "SwDocStatFieldType::Expand: unknown SubType" ); } if( nVal <= SHRT_MAX ) - return FormatNumber( nVal, nFmt ); + return FormatNumber( nVal, nFormat ); return OUString::number( nVal ); } @@ -763,10 +763,10 @@ SwFieldType* SwDocStatFieldType::Copy() const /** * @param pTyp * @param nSub SubType - * @param nFmt + * @param nFormat */ -SwDocStatField::SwDocStatField(SwDocStatFieldType* pTyp, sal_uInt16 nSub, sal_uInt32 nFmt) - : SwField(pTyp, nFmt), +SwDocStatField::SwDocStatField(SwDocStatFieldType* pTyp, sal_uInt16 nSub, sal_uInt32 nFormat) + : SwField(pTyp, nFormat), nSubType(nSub) {} @@ -1004,15 +1004,15 @@ OUString SwDocInfoFieldType::Expand( sal_uInt16 nSub, sal_uInt32 nFormat, // document info field -SwDocInfoField::SwDocInfoField(SwDocInfoFieldType* pTyp, sal_uInt16 nSub, const OUString& rName, sal_uInt32 nFmt) : - SwValueField(pTyp, nFmt), nSubType(nSub) +SwDocInfoField::SwDocInfoField(SwDocInfoFieldType* pTyp, sal_uInt16 nSub, const OUString& rName, sal_uInt32 nFormat) : + SwValueField(pTyp, nFormat), nSubType(nSub) { aName = rName; - aContent = static_cast<SwDocInfoFieldType*>(GetTyp())->Expand(nSubType, nFmt, GetLanguage(), aName); + aContent = static_cast<SwDocInfoFieldType*>(GetTyp())->Expand(nSubType, nFormat, GetLanguage(), aName); } -SwDocInfoField::SwDocInfoField(SwDocInfoFieldType* pTyp, sal_uInt16 nSub, const OUString& rName, const OUString& rValue, sal_uInt32 nFmt) : - SwValueField(pTyp, nFmt), nSubType(nSub) +SwDocInfoField::SwDocInfoField(SwDocInfoFieldType* pTyp, sal_uInt16 nSub, const OUString& rName, const OUString& rValue, sal_uInt32 nFormat) : + SwValueField(pTyp, nFormat), nSubType(nSub) { aName = rName; aContent = rValue; @@ -1140,11 +1140,11 @@ OUString SwDocInfoField::GetFieldName() const SwField* SwDocInfoField::Copy() const { - SwDocInfoField* pFld = new SwDocInfoField(static_cast<SwDocInfoFieldType*>(GetTyp()), nSubType, aName, GetFormat()); - pFld->SetAutomaticLanguage(IsAutomaticLanguage()); - pFld->aContent = aContent; + SwDocInfoField* pField = new SwDocInfoField(static_cast<SwDocInfoFieldType*>(GetTyp()), nSubType, aName, GetFormat()); + pField->SetAutomaticLanguage(IsAutomaticLanguage()); + pField->aContent = aContent; - return pFld; + return pField; } sal_uInt16 SwDocInfoField::GetSubType() const @@ -1258,42 +1258,42 @@ bool SwDocInfoField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId ) return true; } -SwHiddenTxtFieldType::SwHiddenTxtFieldType( bool bSetHidden ) +SwHiddenTextFieldType::SwHiddenTextFieldType( bool bSetHidden ) : SwFieldType( RES_HIDDENTXTFLD ), bHidden( bSetHidden ) { } -SwFieldType* SwHiddenTxtFieldType::Copy() const +SwFieldType* SwHiddenTextFieldType::Copy() const { - return new SwHiddenTxtFieldType( bHidden ); + return new SwHiddenTextFieldType( bHidden ); } -void SwHiddenTxtFieldType::SetHiddenFlag( bool bSetHidden ) +void SwHiddenTextFieldType::SetHiddenFlag( bool bSetHidden ) { if( bHidden != bSetHidden ) { bHidden = bSetHidden; - UpdateFlds(); // notify all HiddenTexts + UpdateFields(); // notify all HiddenTexts } } -SwHiddenTxtField::SwHiddenTxtField( SwHiddenTxtFieldType* pFldType, +SwHiddenTextField::SwHiddenTextField( SwHiddenTextFieldType* pFieldType, bool bConditional, const OUString& rCond, const OUString& rStr, bool bHidden, sal_uInt16 nSub) : - SwField( pFldType ), aCond(rCond), nSubType(nSub), + SwField( pFieldType ), aCond(rCond), nSubType(nSub), bCanToggle(bConditional), bIsHidden(bHidden), bValid(false) { if(nSubType == TYP_CONDTXTFLD) { sal_Int32 nPos = 0; - aTRUETxt = rStr.getToken(0, '|', nPos); + aTRUEText = rStr.getToken(0, '|', nPos); if(nPos != -1) { - aFALSETxt = rStr.getToken(0, '|', nPos); + aFALSEText = rStr.getToken(0, '|', nPos); if(nPos != -1) { aContent = rStr.getToken(0, '|', nPos); @@ -1302,21 +1302,21 @@ SwHiddenTxtField::SwHiddenTxtField( SwHiddenTxtFieldType* pFldType, } } else - aTRUETxt = rStr; + aTRUEText = rStr; } -SwHiddenTxtField::SwHiddenTxtField( SwHiddenTxtFieldType* pFldType, +SwHiddenTextField::SwHiddenTextField( SwHiddenTextFieldType* pFieldType, const OUString& rCond, const OUString& rTrue, const OUString& rFalse, sal_uInt16 nSub) - : SwField( pFldType ), aTRUETxt(rTrue), aFALSETxt(rFalse), aCond(rCond), nSubType(nSub), + : SwField( pFieldType ), aTRUEText(rTrue), aFALSEText(rFalse), aCond(rCond), nSubType(nSub), bIsHidden(true), bValid(false) { bCanToggle = !aCond.isEmpty(); } -OUString SwHiddenTxtField::Expand() const +OUString SwHiddenTextField::Expand() const { // Type: !Hidden -> show always // Hide -> evaluate condition @@ -1327,17 +1327,17 @@ OUString SwHiddenTxtField::Expand() const return aContent; if( bCanToggle && !bIsHidden ) - return aTRUETxt; + return aTRUEText; } - else if( !static_cast<SwHiddenTxtFieldType*>(GetTyp())->GetHiddenFlag() || + else if( !static_cast<SwHiddenTextFieldType*>(GetTyp())->GetHiddenFlag() || ( bCanToggle && bIsHidden )) - return aTRUETxt; + return aTRUEText; - return aFALSETxt; + return aFALSEText; } /// get current field value and cache it -void SwHiddenTxtField::Evaluate(SwDoc* pDoc) +void SwHiddenTextField::Evaluate(SwDoc* pDoc) { OSL_ENSURE(pDoc, "got no document"); @@ -1349,7 +1349,7 @@ void SwHiddenTxtField::Evaluate(SwDoc* pDoc) SwDBManager* pMgr = pDoc->GetDBManager(); #endif bValid = false; - OUString sTmpName = (bCanToggle && !bIsHidden) ? aTRUETxt : aFALSETxt; + OUString sTmpName = (bCanToggle && !bIsHidden) ? aTRUEText : aFALSEText; // Database expressions need to be different from normal text. Therefore, normal text is set // in quotes. If the latter exist they will be removed. If not, check if potential DB name. @@ -1393,77 +1393,77 @@ void SwHiddenTxtField::Evaluate(SwDoc* pDoc) } } -OUString SwHiddenTxtField::GetFieldName() const +OUString SwHiddenTextField::GetFieldName() const { OUString aStr = SwFieldType::GetTypeStr(nSubType) + - " " + aCond + " " + aTRUETxt; + " " + aCond + " " + aTRUEText; if (nSubType == TYP_CONDTXTFLD) { - aStr += " : " + aFALSETxt; + aStr += " : " + aFALSEText; } return aStr; } -SwField* SwHiddenTxtField::Copy() const +SwField* SwHiddenTextField::Copy() const { - SwHiddenTxtField* pFld = - new SwHiddenTxtField(static_cast<SwHiddenTxtFieldType*>(GetTyp()), aCond, - aTRUETxt, aFALSETxt); - pFld->bIsHidden = bIsHidden; - pFld->bValid = bValid; - pFld->aContent = aContent; - pFld->SetFormat(GetFormat()); - pFld->nSubType = nSubType; - return pFld; + SwHiddenTextField* pField = + new SwHiddenTextField(static_cast<SwHiddenTextFieldType*>(GetTyp()), aCond, + aTRUEText, aFALSEText); + pField->bIsHidden = bIsHidden; + pField->bValid = bValid; + pField->aContent = aContent; + pField->SetFormat(GetFormat()); + pField->nSubType = nSubType; + return pField; } /// set condition -void SwHiddenTxtField::SetPar1(const OUString& rStr) +void SwHiddenTextField::SetPar1(const OUString& rStr) { aCond = rStr; bCanToggle = !aCond.isEmpty(); } -OUString SwHiddenTxtField::GetPar1() const +OUString SwHiddenTextField::GetPar1() const { return aCond; } /// set True/False text -void SwHiddenTxtField::SetPar2(const OUString& rStr) +void SwHiddenTextField::SetPar2(const OUString& rStr) { if (nSubType == TYP_CONDTXTFLD) { sal_Int32 nPos = rStr.indexOf('|'); if (nPos == -1) - aTRUETxt = rStr; + aTRUEText = rStr; else { - aTRUETxt = rStr.copy(0, nPos); - aFALSETxt = rStr.copy(nPos + 1); + aTRUEText = rStr.copy(0, nPos); + aFALSEText = rStr.copy(nPos + 1); } } else - aTRUETxt = rStr; + aTRUEText = rStr; } /// get True/False text -OUString SwHiddenTxtField::GetPar2() const +OUString SwHiddenTextField::GetPar2() const { if(nSubType != TYP_CONDTXTFLD) { - return aTRUETxt; + return aTRUEText; } - return aTRUETxt + "|" + aFALSETxt; + return aTRUEText + "|" + aFALSEText; } -sal_uInt16 SwHiddenTxtField::GetSubType() const +sal_uInt16 SwHiddenTextField::GetSubType() const { return nSubType; } -bool SwHiddenTxtField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const +bool SwHiddenTextField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const { switch( nWhichId ) { @@ -1471,10 +1471,10 @@ bool SwHiddenTxtField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const rAny <<= aCond; break; case FIELD_PROP_PAR2: - rAny <<= aTRUETxt; + rAny <<= aTRUEText; break; case FIELD_PROP_PAR3: - rAny <<= aFALSETxt; + rAny <<= aFALSEText; break; case FIELD_PROP_PAR4 : rAny <<= aContent; @@ -1488,7 +1488,7 @@ bool SwHiddenTxtField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const return true; } -bool SwHiddenTxtField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId ) +bool SwHiddenTextField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId ) { switch( nWhichId ) { @@ -1500,10 +1500,10 @@ bool SwHiddenTxtField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId ) } break; case FIELD_PROP_PAR2: - rAny >>= aTRUETxt; + rAny >>= aTRUEText; break; case FIELD_PROP_PAR3: - rAny >>= aFALSETxt; + rAny >>= aFALSEText; break; case FIELD_PROP_BOOL1: bIsHidden = *static_cast<sal_Bool const *>(rAny.getValue()); @@ -1518,7 +1518,7 @@ bool SwHiddenTxtField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId ) return true; } -OUString SwHiddenTxtField::GetColumnName(const OUString& rName) +OUString SwHiddenTextField::GetColumnName(const OUString& rName) { sal_Int32 nPos = rName.indexOf(DB_DELIM); if( nPos>=0 ) @@ -1531,7 +1531,7 @@ OUString SwHiddenTxtField::GetColumnName(const OUString& rName) return rName; } -OUString SwHiddenTxtField::GetDBName(const OUString& rName, SwDoc *pDoc) +OUString SwHiddenTextField::GetDBName(const OUString& rName, SwDoc *pDoc) { sal_Int32 nPos = rName.indexOf(DB_DELIM); if( nPos>=0 ) @@ -1574,10 +1574,10 @@ OUString SwHiddenParaField::Expand() const SwField* SwHiddenParaField::Copy() const { - SwHiddenParaField* pFld = new SwHiddenParaField(static_cast<SwHiddenParaFieldType*>(GetTyp()), aCond); - pFld->bIsHidden = bIsHidden; + SwHiddenParaField* pField = new SwHiddenParaField(static_cast<SwHiddenParaFieldType*>(GetTyp()), aCond); + pField->bIsHidden = bIsHidden; - return pFld; + return pField; } bool SwHiddenParaField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const @@ -1641,12 +1641,12 @@ SwFieldType* SwPostItFieldType::Copy() const SwPostItField::SwPostItField( SwPostItFieldType* pT, const OUString& rAuthor, - const OUString& rTxt, + const OUString& rText, const OUString& rInitials, const OUString& rName, const DateTime& rDateTime ) : SwField( pT ) - , sTxt( rTxt ) + , sText( rText ) , sAuthor( rAuthor ) , sInitials( rInitials ) , sName( rName ) @@ -1679,7 +1679,7 @@ OUString SwPostItField::GetDescription() const SwField* SwPostItField::Copy() const { - SwPostItField* pRet = new SwPostItField( static_cast<SwPostItFieldType*>(GetTyp()), sAuthor, sTxt, sInitials, sName, + SwPostItField* pRet = new SwPostItField( static_cast<SwPostItFieldType*>(GetTyp()), sAuthor, sText, sInitials, sName, aDateTime); if (mpText) pRet->SetTextObject( new OutlinerParaObject(*mpText) ); @@ -1704,13 +1704,13 @@ OUString SwPostItField::GetPar1() const /// set the PostIt's text void SwPostItField::SetPar2(const OUString& rStr) { - sTxt = rStr; + sText = rStr; } /// get the PostIt's text OUString SwPostItField::GetPar2() const { - return sTxt; + return sText; } @@ -1741,7 +1741,7 @@ bool SwPostItField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const break; case FIELD_PROP_PAR2: { - rAny <<= sTxt; + rAny <<= sText; break; } case FIELD_PROP_PAR3: @@ -1764,7 +1764,7 @@ bool SwPostItField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const if ( mpText ) m_pTextObject->SetText( *mpText ); else - m_pTextObject->SetString( sTxt ); + m_pTextObject->SetString( sText ); uno::Reference < text::XText > xText( m_pTextObject ); rAny <<= xText; @@ -1795,7 +1795,7 @@ bool SwPostItField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId ) rAny >>= sAuthor; break; case FIELD_PROP_PAR2: - rAny >>= sTxt; + rAny >>= sText; //#i100374# new string via api, delete complex text object so SwPostItNote picks up the new string if (mpText) { @@ -1881,8 +1881,8 @@ OUString SwExtUserFieldType::Expand(sal_uInt16 nSub, sal_uInt32 ) // extended user information field -SwExtUserField::SwExtUserField(SwExtUserFieldType* pTyp, sal_uInt16 nSubTyp, sal_uInt32 nFmt) : - SwField(pTyp, nFmt), nType(nSubTyp) +SwExtUserField::SwExtUserField(SwExtUserFieldType* pTyp, sal_uInt16 nSubTyp, sal_uInt32 nFormat) : + SwField(pTyp, nFormat), nType(nSubTyp) { aContent = SwExtUserFieldType::Expand(nType, GetFormat()); } @@ -1897,10 +1897,10 @@ OUString SwExtUserField::Expand() const SwField* SwExtUserField::Copy() const { - SwExtUserField* pFld = new SwExtUserField(static_cast<SwExtUserFieldType*>(GetTyp()), nType, GetFormat()); - pFld->SetExpansion(aContent); + SwExtUserField* pField = new SwExtUserField(static_cast<SwExtUserFieldType*>(GetTyp()), nType, GetFormat()); + pField->SetExpansion(aContent); - return pFld; + return pField; } sal_uInt16 SwExtUserField::GetSubType() const @@ -2060,14 +2060,14 @@ void SwRefPageGetFieldType::Modify( const SfxPoolItem* pOld, const SfxPoolItem* if( !pNew && !pOld && HasWriterListeners() ) { // first collect all SetPageRefFields - _SetGetExpFlds aTmpLst; + _SetGetExpFields aTmpLst; if( MakeSetList( aTmpLst ) ) { - SwIterator<SwFmtFld,SwFieldType> aIter( *this ); - for ( SwFmtFld* pFmtFld = aIter.First(); pFmtFld; pFmtFld = aIter.Next() ) + SwIterator<SwFormatField,SwFieldType> aIter( *this ); + for ( SwFormatField* pFormatField = aIter.First(); pFormatField; pFormatField = aIter.Next() ) // update only the GetRef fields - if( pFmtFld->GetTxtFld() ) - UpdateField( pFmtFld->GetTxtFld(), aTmpLst ); + if( pFormatField->GetTextField() ) + UpdateField( pFormatField->GetTextField(), aTmpLst ); } } @@ -2075,22 +2075,22 @@ void SwRefPageGetFieldType::Modify( const SfxPoolItem* pOld, const SfxPoolItem* NotifyClients( pOld, pNew ); } -bool SwRefPageGetFieldType::MakeSetList( _SetGetExpFlds& rTmpLst ) +bool SwRefPageGetFieldType::MakeSetList( _SetGetExpFields& rTmpLst ) { - SwIterator<SwFmtFld,SwFieldType> aIter(*pDoc->getIDocumentFieldsAccess().GetSysFldType( RES_REFPAGESETFLD)); - for ( SwFmtFld* pFmtFld = aIter.First(); pFmtFld; pFmtFld = aIter.Next() ) + SwIterator<SwFormatField,SwFieldType> aIter(*pDoc->getIDocumentFieldsAccess().GetSysFieldType( RES_REFPAGESETFLD)); + for ( SwFormatField* pFormatField = aIter.First(); pFormatField; pFormatField = aIter.Next() ) { // update only the GetRef fields - const SwTxtFld* pTFld = pFmtFld->GetTxtFld(); - if( pTFld ) + const SwTextField* pTField = pFormatField->GetTextField(); + if( pTField ) { - const SwTxtNode& rTxtNd = pTFld->GetTxtNode(); + const SwTextNode& rTextNd = pTField->GetTextNode(); // Always the first! (in Tab-Headline, header/footer ) Point aPt; - const SwCntntFrm* pFrm = rTxtNd.getLayoutFrm( rTxtNd.GetDoc()->getIDocumentLayoutAccess().GetCurrentLayout(), &aPt, 0, false ); + const SwContentFrm* pFrm = rTextNd.getLayoutFrm( rTextNd.GetDoc()->getIDocumentLayoutAccess().GetCurrentLayout(), &aPt, 0, false ); - _SetGetExpFld* pNew; + _SetGetExpField* pNew; if( !pFrm || pFrm->IsInDocBody() || @@ -2099,17 +2099,17 @@ bool SwRefPageGetFieldType::MakeSetList( _SetGetExpFlds& rTmpLst ) !pFrm->FindPageFrm() ) { // create index for determination of the TextNode - SwNodeIndex aIdx( rTxtNd ); - pNew = new _SetGetExpFld( aIdx, pTFld ); + SwNodeIndex aIdx( rTextNd ); + pNew = new _SetGetExpField( aIdx, pTField ); } else { // create index for determination of the TextNode SwPosition aPos( pDoc->GetNodes().GetEndOfPostIts() ); - bool const bResult = GetBodyTxtNode( *pDoc, aPos, *pFrm ); + bool const bResult = GetBodyTextNode( *pDoc, aPos, *pFrm ); OSL_ENSURE(bResult, "where is the Field?"); (void) bResult; // unused in non-debug - pNew = new _SetGetExpFld( aPos.nNode, pTFld, + pNew = new _SetGetExpField( aPos.nNode, pTField, &aPos.nContent ); } @@ -2121,129 +2121,129 @@ bool SwRefPageGetFieldType::MakeSetList( _SetGetExpFlds& rTmpLst ) return !rTmpLst.empty(); } -void SwRefPageGetFieldType::UpdateField( SwTxtFld* pTxtFld, - _SetGetExpFlds& rSetList ) +void SwRefPageGetFieldType::UpdateField( SwTextField* pTextField, + _SetGetExpFields& rSetList ) { - SwRefPageGetField* pGetFld = const_cast<SwRefPageGetField*>(static_cast<const SwRefPageGetField*>(pTxtFld->GetFmtFld().GetField())); - pGetFld->SetText( OUString() ); + SwRefPageGetField* pGetField = const_cast<SwRefPageGetField*>(static_cast<const SwRefPageGetField*>(pTextField->GetFormatField().GetField())); + pGetField->SetText( OUString() ); // then search the correct RefPageSet field - SwTxtNode* pTxtNode = &pTxtFld->GetTxtNode(); - if( pTxtNode->StartOfSectionIndex() > + SwTextNode* pTextNode = &pTextField->GetTextNode(); + if( pTextNode->StartOfSectionIndex() > pDoc->GetNodes().GetEndOfExtras().GetIndex() ) { - SwNodeIndex aIdx( *pTxtNode ); - _SetGetExpFld aEndFld( aIdx, pTxtFld ); + SwNodeIndex aIdx( *pTextNode ); + _SetGetExpField aEndField( aIdx, pTextField ); - _SetGetExpFlds::const_iterator itLast = rSetList.lower_bound( &aEndFld ); + _SetGetExpFields::const_iterator itLast = rSetList.lower_bound( &aEndField ); if( itLast != rSetList.begin() ) { --itLast; - const SwTxtFld* pRefTxtFld = (*itLast)->GetTxtFld(); - const SwRefPageSetField* pSetFld = - static_cast<const SwRefPageSetField*>(pRefTxtFld->GetFmtFld().GetField()); - if( pSetFld->IsOn() ) + const SwTextField* pRefTextField = (*itLast)->GetTextField(); + const SwRefPageSetField* pSetField = + static_cast<const SwRefPageSetField*>(pRefTextField->GetFormatField().GetField()); + if( pSetField->IsOn() ) { // determine the correct offset Point aPt; - const SwCntntFrm* pFrm = pTxtNode->getLayoutFrm( pTxtNode->GetDoc()->getIDocumentLayoutAccess().GetCurrentLayout(), &aPt, 0, false ); - const SwCntntFrm* pRefFrm = pRefTxtFld->GetTxtNode().getLayoutFrm( pRefTxtFld->GetTxtNode().GetDoc()->getIDocumentLayoutAccess().GetCurrentLayout(), &aPt, 0, false ); + const SwContentFrm* pFrm = pTextNode->getLayoutFrm( pTextNode->GetDoc()->getIDocumentLayoutAccess().GetCurrentLayout(), &aPt, 0, false ); + const SwContentFrm* pRefFrm = pRefTextField->GetTextNode().getLayoutFrm( pRefTextField->GetTextNode().GetDoc()->getIDocumentLayoutAccess().GetCurrentLayout(), &aPt, 0, false ); const SwPageFrm* pPgFrm = 0; const short nDiff = ( pFrm && pRefFrm ) ? (pPgFrm = pFrm->FindPageFrm())->GetPhyPageNum() - pRefFrm->FindPageFrm()->GetPhyPageNum() + 1 : 1; - sal_uInt32 nTmpFmt = SVX_NUM_PAGEDESC == pGetFld->GetFormat() + sal_uInt32 nTmpFormat = SVX_NUM_PAGEDESC == pGetField->GetFormat() ? ( !pPgFrm ? (sal_uInt32)SVX_NUM_ARABIC : pPgFrm->GetPageDesc()->GetNumType().GetNumberingType() ) - : pGetFld->GetFormat(); - const short nPageNum = std::max<short>(0, pSetFld->GetOffset() + nDiff); - pGetFld->SetText( FormatNumber( nPageNum, nTmpFmt ) ); + : pGetField->GetFormat(); + const short nPageNum = std::max<short>(0, pSetField->GetOffset() + nDiff); + pGetField->SetText( FormatNumber( nPageNum, nTmpFormat ) ); } } } // start formatting - const_cast<SwFmtFld&>(pTxtFld->GetFmtFld()).ModifyNotification( 0, 0 ); + const_cast<SwFormatField&>(pTextField->GetFormatField()).ModifyNotification( 0, 0 ); } // queries for relative page numbering SwRefPageGetField::SwRefPageGetField( SwRefPageGetFieldType* pTyp, - sal_uInt32 nFmt ) - : SwField( pTyp, nFmt ) + sal_uInt32 nFormat ) + : SwField( pTyp, nFormat ) { } OUString SwRefPageGetField::Expand() const { - return sTxt; + return sText; } SwField* SwRefPageGetField::Copy() const { SwRefPageGetField* pCpy = new SwRefPageGetField( static_cast<SwRefPageGetFieldType*>(GetTyp()), GetFormat() ); - pCpy->SetText( sTxt ); + pCpy->SetText( sText ); return pCpy; } void SwRefPageGetField::ChangeExpansion( const SwFrm* pFrm, - const SwTxtFld* pFld ) + const SwTextField* pField ) { // only fields in Footer, Header, FootNote, Flys SwRefPageGetFieldType* pGetType = static_cast<SwRefPageGetFieldType*>(GetTyp()); SwDoc* pDoc = pGetType->GetDoc(); - if( pFld->GetTxtNode().StartOfSectionIndex() > + if( pField->GetTextNode().StartOfSectionIndex() > pDoc->GetNodes().GetEndOfExtras().GetIndex() ) return; - sTxt.clear(); + sText.clear(); OSL_ENSURE( !pFrm->IsInDocBody(), "Flag incorrect, frame is in DocBody" ); // collect all SetPageRefFields - _SetGetExpFlds aTmpLst; + _SetGetExpFields aTmpLst; if( !pGetType->MakeSetList( aTmpLst ) ) return ; // create index for determination of the TextNode SwPosition aPos( SwNodeIndex( pDoc->GetNodes() ) ); - SwTxtNode* pTxtNode = const_cast<SwTxtNode*>(GetBodyTxtNode( *pDoc, aPos, *pFrm )); + SwTextNode* pTextNode = const_cast<SwTextNode*>(GetBodyTextNode( *pDoc, aPos, *pFrm )); // If no layout exists, ChangeExpansion is called for header and - // footer lines via layout formatting without existing TxtNode. - if(!pTxtNode) + // footer lines via layout formatting without existing TextNode. + if(!pTextNode) return; - _SetGetExpFld aEndFld( aPos.nNode, pFld, &aPos.nContent ); + _SetGetExpField aEndField( aPos.nNode, pField, &aPos.nContent ); - _SetGetExpFlds::const_iterator itLast = aTmpLst.lower_bound( &aEndFld ); + _SetGetExpFields::const_iterator itLast = aTmpLst.lower_bound( &aEndField ); if( itLast == aTmpLst.begin() ) return; // there is no corresponding set-field in front --itLast; - const SwTxtFld* pRefTxtFld = (*itLast)->GetTxtFld(); - const SwRefPageSetField* pSetFld = - static_cast<const SwRefPageSetField*>(pRefTxtFld->GetFmtFld().GetField()); + const SwTextField* pRefTextField = (*itLast)->GetTextField(); + const SwRefPageSetField* pSetField = + static_cast<const SwRefPageSetField*>(pRefTextField->GetFormatField().GetField()); Point aPt; - const SwCntntFrm* pRefFrm = pRefTxtFld->GetTxtNode().getLayoutFrm( pFrm->getRootFrm(), &aPt, 0, false ); - if( pSetFld->IsOn() && pRefFrm ) + const SwContentFrm* pRefFrm = pRefTextField->GetTextNode().getLayoutFrm( pFrm->getRootFrm(), &aPt, 0, false ); + if( pSetField->IsOn() && pRefFrm ) { // determine the correct offset const SwPageFrm* pPgFrm = pFrm->FindPageFrm(); const short nDiff = pPgFrm->GetPhyPageNum() - pRefFrm->FindPageFrm()->GetPhyPageNum() + 1; - SwRefPageGetField* pGetFld = const_cast<SwRefPageGetField*>(static_cast<const SwRefPageGetField*>(pFld->GetFmtFld().GetField())); - sal_uInt32 nTmpFmt = SVX_NUM_PAGEDESC == pGetFld->GetFormat() + SwRefPageGetField* pGetField = const_cast<SwRefPageGetField*>(static_cast<const SwRefPageGetField*>(pField->GetFormatField().GetField())); + sal_uInt32 nTmpFormat = SVX_NUM_PAGEDESC == pGetField->GetFormat() ? pPgFrm->GetPageDesc()->GetNumType().GetNumberingType() - : pGetFld->GetFormat(); - const short nPageNum = std::max<short>(0, pSetFld->GetOffset() + nDiff); - pGetFld->SetText( FormatNumber( nPageNum, nTmpFmt ) ); + : pGetField->GetFormat(); + const short nPageNum = std::max<short>(0, pSetField->GetOffset() + nDiff); + pGetField->SetText( FormatNumber( nPageNum, nTmpFormat ) ); } } @@ -2255,7 +2255,7 @@ bool SwRefPageGetField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const rAny <<= (sal_Int16)GetFormat(); break; case FIELD_PROP_PAR1: - rAny <<= sTxt; + rAny <<= sText; break; default: OSL_FAIL("illegal property"); @@ -2278,7 +2278,7 @@ bool SwRefPageGetField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId ) } break; case FIELD_PROP_PAR1: - rAny >>= sTxt; + rAny >>= sText; break; default: OSL_FAIL("illegal property"); @@ -2298,44 +2298,44 @@ SwFieldType* SwJumpEditFieldType::Copy() const return new SwJumpEditFieldType( pDoc ); } -SwCharFmt* SwJumpEditFieldType::GetCharFmt() +SwCharFormat* SwJumpEditFieldType::GetCharFormat() { - SwCharFmt* pFmt = pDoc->getIDocumentStylePoolAccess().GetCharFmtFromPool( RES_POOLCHR_JUMPEDIT ); + SwCharFormat* pFormat = pDoc->getIDocumentStylePoolAccess().GetCharFormatFromPool( RES_POOLCHR_JUMPEDIT ); // not registered yet? if( !aDep.GetRegisteredIn() ) - pFmt->Add( &aDep ); // register + pFormat->Add( &aDep ); // register - return pFmt; + return pFormat; } SwJumpEditField::SwJumpEditField( SwJumpEditFieldType* pTyp, sal_uInt32 nForm, - const OUString& rTxt, const OUString& rHelp ) - : SwField( pTyp, nForm ), sTxt( rTxt ), sHelp( rHelp ) + const OUString& rText, const OUString& rHelp ) + : SwField( pTyp, nForm ), sText( rText ), sHelp( rHelp ) { } OUString SwJumpEditField::Expand() const { - return "<" + sTxt + ">"; + return "<" + sText + ">"; } SwField* SwJumpEditField::Copy() const { return new SwJumpEditField( static_cast<SwJumpEditFieldType*>(GetTyp()), GetFormat(), - sTxt, sHelp ); + sText, sHelp ); } /// get place holder text OUString SwJumpEditField::GetPar1() const { - return sTxt; + return sText; } /// set place holder text void SwJumpEditField::SetPar1(const OUString& rStr) { - sTxt = rStr; + sText = rStr; } /// get hint text @@ -2373,7 +2373,7 @@ bool SwJumpEditField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const rAny <<= sHelp; break; case FIELD_PROP_PAR2 : - rAny <<= sTxt; + rAny <<= sText; break; default: OSL_FAIL("illegal property"); @@ -2406,7 +2406,7 @@ bool SwJumpEditField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId ) rAny >>= sHelp; break; case FIELD_PROP_PAR2 : - rAny >>= sTxt; + rAny >>= sText; break; default: OSL_FAIL("illegal property"); diff --git a/sw/source/core/fields/expfld.cxx b/sw/source/core/fields/expfld.cxx index 602b83015676..b9007ab4e86e 100644 --- a/sw/source/core/fields/expfld.cxx +++ b/sw/source/core/fields/expfld.cxx @@ -131,50 +131,50 @@ OUString ReplacePoint( const OUString& rTmpName, bool bWithCommandType ) return sRes; } -SwTxtNode* GetFirstTxtNode( const SwDoc& rDoc, SwPosition& rPos, - const SwCntntFrm *pCFrm, Point &rPt ) +SwTextNode* GetFirstTextNode( const SwDoc& rDoc, SwPosition& rPos, + const SwContentFrm *pCFrm, Point &rPt ) { - SwTxtNode* pTxtNode = 0; + SwTextNode* pTextNode = 0; if ( !pCFrm ) { const SwNodes& rNodes = rDoc.GetNodes(); rPos.nNode = *rNodes.GetEndOfContent().StartOfSectionNode(); - SwCntntNode* pCNd; + SwContentNode* pCNd; while( 0 != (pCNd = rNodes.GoNext( &rPos.nNode ) ) && - 0 == ( pTxtNode = pCNd->GetTxtNode() ) ) + 0 == ( pTextNode = pCNd->GetTextNode() ) ) ; - OSL_ENSURE( pTxtNode, "Where is the 1. TextNode?" ); - rPos.nContent.Assign( pTxtNode, 0 ); + OSL_ENSURE( pTextNode, "Where is the 1. TextNode?" ); + rPos.nContent.Assign( pTextNode, 0 ); } else if ( !pCFrm->IsValid() ) { - pTxtNode = const_cast<SwTxtNode*>(static_cast<const SwTxtNode*>(pCFrm->GetNode())); - rPos.nNode = *pTxtNode; - rPos.nContent.Assign( pTxtNode, 0 ); + pTextNode = const_cast<SwTextNode*>(static_cast<const SwTextNode*>(pCFrm->GetNode())); + rPos.nNode = *pTextNode; + rPos.nContent.Assign( pTextNode, 0 ); } else { pCFrm->GetCrsrOfst( &rPos, rPt ); - pTxtNode = rPos.nNode.GetNode().GetTxtNode(); + pTextNode = rPos.nNode.GetNode().GetTextNode(); } - return pTxtNode; + return pTextNode; } -const SwTxtNode* GetBodyTxtNode( const SwDoc& rDoc, SwPosition& rPos, +const SwTextNode* GetBodyTextNode( const SwDoc& rDoc, SwPosition& rPos, const SwFrm& rFrm ) { const SwLayoutFrm* pLayout = rFrm.GetUpper(); - const SwTxtNode* pTxtNode = 0; + const SwTextNode* pTextNode = 0; while( pLayout ) { if( pLayout->IsFlyFrm() ) { // get the FlyFormat - const SwFrmFmt* pFlyFmt = static_cast<const SwFlyFrm*>(pLayout)->GetFmt(); - OSL_ENSURE( pFlyFmt, "Could not find FlyFormat, where is the field?" ); + const SwFrameFormat* pFlyFormat = static_cast<const SwFlyFrm*>(pLayout)->GetFormat(); + OSL_ENSURE( pFlyFormat, "Could not find FlyFormat, where is the field?" ); - const SwFmtAnchor &rAnchor = pFlyFmt->GetAnchor(); + const SwFormatAnchor &rAnchor = pFlyFormat->GetAnchor(); if( FLY_AT_FLY == rAnchor.GetAnchorId() ) { @@ -186,12 +186,12 @@ const SwTxtNode* GetBodyTxtNode( const SwDoc& rDoc, SwPosition& rPos, (FLY_AT_CHAR == rAnchor.GetAnchorId()) || (FLY_AS_CHAR == rAnchor.GetAnchorId())) { - OSL_ENSURE( rAnchor.GetCntntAnchor(), "no valid position" ); - rPos = *rAnchor.GetCntntAnchor(); - pTxtNode = rPos.nNode.GetNode().GetTxtNode(); + OSL_ENSURE( rAnchor.GetContentAnchor(), "no valid position" ); + rPos = *rAnchor.GetContentAnchor(); + pTextNode = rPos.nNode.GetNode().GetTextNode(); if ( FLY_AT_PARA == rAnchor.GetAnchorId() ) { - const_cast<SwTxtNode*>(pTxtNode)->MakeStartIndex( + const_cast<SwTextNode*>(pTextNode)->MakeStartIndex( &rPos.nContent ); } @@ -202,51 +202,51 @@ const SwTxtNode* GetBodyTxtNode( const SwDoc& rDoc, SwPosition& rPos, } else { - pLayout->FindPageFrm()->GetCntntPosition( + pLayout->FindPageFrm()->GetContentPosition( pLayout->Frm().Pos(), rPos ); - pTxtNode = rPos.nNode.GetNode().GetTxtNode(); + pTextNode = rPos.nNode.GetNode().GetTextNode(); } } - else if( pLayout->IsFtnFrm() ) + else if( pLayout->IsFootnoteFrm() ) { // get the anchor's node - const SwTxtFtn* pFtn = static_cast<const SwFtnFrm*>(pLayout)->GetAttr(); - pTxtNode = &pFtn->GetTxtNode(); - rPos.nNode = *pTxtNode; - rPos.nContent = pFtn->GetStart(); + const SwTextFootnote* pFootnote = static_cast<const SwFootnoteFrm*>(pLayout)->GetAttr(); + pTextNode = &pFootnote->GetTextNode(); + rPos.nNode = *pTextNode; + rPos.nContent = pFootnote->GetStart(); } else if( pLayout->IsHeaderFrm() || pLayout->IsFooterFrm() ) { - const SwCntntFrm* pCntFrm; + const SwContentFrm* pCntFrm; const SwPageFrm* pPgFrm = pLayout->FindPageFrm(); if( pLayout->IsHeaderFrm() ) { const SwTabFrm *pTab; - if( 0 != ( pCntFrm = pPgFrm->FindFirstBodyCntnt()) && + if( 0 != ( pCntFrm = pPgFrm->FindFirstBodyContent()) && 0 != (pTab = pCntFrm->FindTabFrm()) && pTab->IsFollow() && pTab->GetTable()->GetRowsToRepeat() > 0 && pTab->IsInHeadline( *pCntFrm ) ) { // take the next line const SwLayoutFrm* pRow = pTab->GetFirstNonHeadlineRow(); - pCntFrm = pRow->ContainsCntnt(); + pCntFrm = pRow->ContainsContent(); } } else - pCntFrm = pPgFrm->FindLastBodyCntnt(); + pCntFrm = pPgFrm->FindLastBodyContent(); if( pCntFrm ) { - pTxtNode = pCntFrm->GetNode()->GetTxtNode(); - rPos.nNode = *pTxtNode; - const_cast<SwTxtNode*>(pTxtNode)->MakeEndIndex( &rPos.nContent ); + pTextNode = pCntFrm->GetNode()->GetTextNode(); + rPos.nNode = *pTextNode; + const_cast<SwTextNode*>(pTextNode)->MakeEndIndex( &rPos.nContent ); } else { Point aPt( pLayout->Frm().Pos() ); aPt.Y()++; // get out of the header - pCntFrm = pPgFrm->GetCntntPos( aPt, false, true, false ); - pTxtNode = GetFirstTxtNode( rDoc, rPos, pCntFrm, aPt ); + pCntFrm = pPgFrm->GetContentPos( aPt, false, true, false ); + pTextNode = GetFirstTextNode( rDoc, rPos, pCntFrm, aPt ); } } else @@ -256,7 +256,7 @@ const SwTxtNode* GetBodyTxtNode( const SwDoc& rDoc, SwPosition& rPos, } break; // found, so finish loop } - return pTxtNode; + return pTextNode; } SwGetExpFieldType::SwGetExpFieldType(SwDoc* pDc) @@ -277,9 +277,9 @@ void SwGetExpFieldType::Modify( const SfxPoolItem*, const SfxPoolItem* pNew ) } SwGetExpField::SwGetExpField(SwGetExpFieldType* pTyp, const OUString& rFormel, - sal_uInt16 nSub, sal_uLong nFmt) - : SwFormulaField( pTyp, nFmt, 0.0 ), - bIsInBodyTxt( true ), + sal_uInt16 nSub, sal_uLong nFormat) + : SwFormulaField( pTyp, nFormat, 0.0 ), + bIsInBodyText( true ), nSubType(nSub), bLateInitialization( false ) { @@ -311,7 +311,7 @@ SwField* SwGetExpField::Copy() const pTmp->SetLanguage(GetLanguage()); pTmp->SwValueField::SetValue(GetValue()); pTmp->sExpand = sExpand; - pTmp->bIsInBodyTxt = bIsInBodyTxt; + pTmp->bIsInBodyText = bIsInBodyText; pTmp->SetAutomaticLanguage(IsAutomaticLanguage()); if( bLateInitialization ) pTmp->SetLateInitialization(); @@ -319,52 +319,52 @@ SwField* SwGetExpField::Copy() const return pTmp; } -void SwGetExpField::ChangeExpansion( const SwFrm& rFrm, const SwTxtFld& rFld ) +void SwGetExpField::ChangeExpansion( const SwFrm& rFrm, const SwTextField& rField ) { - if( bIsInBodyTxt ) // only fields in Footer, Header, FootNote, Flys + if( bIsInBodyText ) // only fields in Footer, Header, FootNote, Flys return; OSL_ENSURE( !rFrm.IsInDocBody(), "Flag incorrect, frame is in DocBody" ); // determine document (or is there an easier way?) - const SwTxtNode* pTxtNode = &rFld.GetTxtNode(); - SwDoc& rDoc = *const_cast<SwDoc*>(pTxtNode->GetDoc()); + const SwTextNode* pTextNode = &rField.GetTextNode(); + SwDoc& rDoc = *const_cast<SwDoc*>(pTextNode->GetDoc()); // create index for determination of the TextNode SwPosition aPos( SwNodeIndex( rDoc.GetNodes() ) ); - pTxtNode = GetBodyTxtNode( rDoc, aPos, rFrm ); + pTextNode = GetBodyTextNode( rDoc, aPos, rFrm ); // If no layout exists, ChangeExpansion is called for header and - // footer lines via layout formatting without existing TxtNode. - if(!pTxtNode) + // footer lines via layout formatting without existing TextNode. + if(!pTextNode) return; // #i82544# if( bLateInitialization ) { - SwFieldType* pSetExpFld = rDoc.getIDocumentFieldsAccess().GetFldType(RES_SETEXPFLD, GetFormula(), false); - if( pSetExpFld ) + SwFieldType* pSetExpField = rDoc.getIDocumentFieldsAccess().GetFieldType(RES_SETEXPFLD, GetFormula(), false); + if( pSetExpField ) { bLateInitialization = false; if( !(GetSubType() & nsSwGetSetExpType::GSE_STRING) && - static_cast< SwSetExpFieldType* >(pSetExpFld)->GetType() == nsSwGetSetExpType::GSE_STRING ) + static_cast< SwSetExpFieldType* >(pSetExpField)->GetType() == nsSwGetSetExpType::GSE_STRING ) SetSubType( nsSwGetSetExpType::GSE_STRING ); } } - _SetGetExpFld aEndFld( aPos.nNode, &rFld, &aPos.nContent ); + _SetGetExpField aEndField( aPos.nNode, &rField, &aPos.nContent ); if(GetSubType() & nsSwGetSetExpType::GSE_STRING) { - SwHash** ppHashTbl; + SwHash** ppHashTable; sal_uInt16 nSize; - rDoc.getIDocumentFieldsAccess().FldsToExpand( ppHashTbl, nSize, aEndFld ); - sExpand = LookString( ppHashTbl, nSize, GetFormula() ); - ::DeleteHashTable( ppHashTbl, nSize ); + rDoc.getIDocumentFieldsAccess().FieldsToExpand( ppHashTable, nSize, aEndField ); + sExpand = LookString( ppHashTable, nSize, GetFormula() ); + ::DeleteHashTable( ppHashTable, nSize ); } else { // fill calculator with values SwCalc aCalc( rDoc ); - rDoc.getIDocumentFieldsAccess().FldsToCalc(aCalc, aEndFld); + rDoc.getIDocumentFieldsAccess().FieldsToCalc(aCalc, aEndField); // calculate value SetValue(aCalc.Calculate(GetFormula()).GetDouble()); @@ -516,11 +516,11 @@ void SwSetExpFieldType::Modify( const SfxPoolItem*, const SfxPoolItem* ) return; // do not expand further } -void SwSetExpFieldType::SetSeqFormat(sal_uLong nFmt) +void SwSetExpFieldType::SetSeqFormat(sal_uLong nFormat) { - SwIterator<SwFmtFld,SwFieldType> aIter(*this); - for( SwFmtFld* pFmtFld = aIter.First(); pFmtFld; pFmtFld = aIter.Next() ) - pFmtFld->GetField()->ChangeFormat( nFmt ); + SwIterator<SwFormatField,SwFieldType> aIter(*this); + for( SwFormatField* pFormatField = aIter.First(); pFormatField; pFormatField = aIter.Next() ) + pFormatField->GetField()->ChangeFormat( nFormat ); } sal_uLong SwSetExpFieldType::GetSeqFormat() @@ -528,11 +528,11 @@ sal_uLong SwSetExpFieldType::GetSeqFormat() if( !HasWriterListeners() ) return SVX_NUM_ARABIC; - const SwField *pFld = SwIterator<SwFmtFld,SwSetExpFieldType>(*this).First()->GetField(); - return pFld->GetFormat(); + const SwField *pField = SwIterator<SwFormatField,SwSetExpFieldType>(*this).First()->GetField(); + return pField->GetFormat(); } -sal_uInt16 SwSetExpFieldType::SetSeqRefNo( SwSetExpField& rFld ) +sal_uInt16 SwSetExpFieldType::SetSeqRefNo( SwSetExpField& rField ) { if( !HasWriterListeners() || !(nsSwGetSetExpType::GSE_SEQ & nType) ) return USHRT_MAX; @@ -540,12 +540,12 @@ sal_uInt16 SwSetExpFieldType::SetSeqRefNo( SwSetExpField& rFld ) std::vector<sal_uInt16> aArr; // check if number is already used and if a new one needs to be created - SwIterator<SwFmtFld,SwFieldType> aIter( *this ); - for( SwFmtFld* pF = aIter.First(); pF; pF = aIter.Next() ) + SwIterator<SwFormatField,SwFieldType> aIter( *this ); + for( SwFormatField* pF = aIter.First(); pF; pF = aIter.Next() ) { - const SwTxtNode* pNd; - if( pF->GetField() != &rFld && pF->GetTxtFld() && - 0 != ( pNd = pF->GetTxtFld()->GetpTxtNode() ) && + const SwTextNode* pNd; + if( pF->GetField() != &rField && pF->GetTextField() && + 0 != ( pNd = pF->GetTextField()->GetpTextNode() ) && pNd->GetNodes().IsDocNodes() ) { InsertSort( aArr, static_cast<SwSetExpField*>(pF->GetField())->GetSeqNumber() ); @@ -553,7 +553,7 @@ sal_uInt16 SwSetExpFieldType::SetSeqRefNo( SwSetExpField& rFld ) } // check first if number already exists - sal_uInt16 nNum = rFld.GetSeqNumber(); + sal_uInt16 nNum = rField.GetSeqNumber(); if( USHRT_MAX != nNum ) { std::vector<sal_uInt16>::size_type n {0}; @@ -577,24 +577,24 @@ sal_uInt16 SwSetExpFieldType::SetSeqRefNo( SwSetExpField& rFld ) break; } - rFld.SetSeqNumber( n ); + rField.SetSeqNumber( n ); return n; } -size_t SwSetExpFieldType::GetSeqFldList( SwSeqFldList& rList ) +size_t SwSetExpFieldType::GetSeqFieldList( SwSeqFieldList& rList ) { rList.Clear(); - SwIterator<SwFmtFld,SwFieldType> aIter( *this ); - for( SwFmtFld* pF = aIter.First(); pF; pF = aIter.Next() ) + SwIterator<SwFormatField,SwFieldType> aIter( *this ); + for( SwFormatField* pF = aIter.First(); pF; pF = aIter.Next() ) { - const SwTxtNode* pNd; - if( pF->GetTxtFld() && - 0 != ( pNd = pF->GetTxtFld()->GetpTxtNode() ) && + const SwTextNode* pNd; + if( pF->GetTextField() && + 0 != ( pNd = pF->GetTextField()->GetpTextNode() ) && pNd->GetNodes().IsDocNodes() ) { - _SeqFldLstElem* pNew = new _SeqFldLstElem( - pNd->GetExpandTxt( 0, -1 ), + _SeqFieldLstElem* pNew = new _SeqFieldLstElem( + pNd->GetExpandText( 0, -1 ), static_cast<SwSetExpField*>(pF->GetField())->GetSeqNumber() ); rList.InsertSort( pNew ); } @@ -603,25 +603,25 @@ size_t SwSetExpFieldType::GetSeqFldList( SwSeqFldList& rList ) return rList.Count(); } -void SwSetExpFieldType::SetChapter( SwSetExpField& rFld, const SwNode& rNd ) +void SwSetExpFieldType::SetChapter( SwSetExpField& rField, const SwNode& rNd ) { - const SwTxtNode* pTxtNd = rNd.FindOutlineNodeOfLevel( nLevel ); - if( pTxtNd ) + const SwTextNode* pTextNd = rNd.FindOutlineNodeOfLevel( nLevel ); + if( pTextNd ) { - SwNumRule * pRule = pTxtNd->GetNumRule(); + SwNumRule * pRule = pTextNd->GetNumRule(); if (pRule) { // --> OD 2005-11-02 #i51089 - TUNING# - if ( pTxtNd->GetNum() ) + if ( pTextNd->GetNum() ) { - const SwNodeNum & aNum = *(pTxtNd->GetNum()); + const SwNodeNum & aNum = *(pTextNd->GetNum()); // only get the number, without pre-/post-fixstrings OUString sNumber( pRule->MakeNumString(aNum, false )); if( !sNumber.isEmpty() ) - rFld.ChgExpStr( sNumber + sDelim + rFld.GetExpStr() ); + rField.ChgExpStr( sNumber + sDelim + rField.GetExpStr() ); } else { @@ -693,7 +693,7 @@ bool SwSetExpFieldType::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId ) return true; } -bool SwSeqFldList::InsertSort( _SeqFldLstElem* pNew ) +bool SwSeqFieldList::InsertSort( _SeqFieldLstElem* pNew ) { OUStringBuffer aBuf(pNew->sDlgEntry); const sal_Int32 nLen = aBuf.getLength(); @@ -713,7 +713,7 @@ bool SwSeqFldList::InsertSort( _SeqFldLstElem* pNew ) return bRet; } -bool SwSeqFldList::SeekEntry( const _SeqFldLstElem& rNew, size_t* pP ) const +bool SwSeqFieldList::SeekEntry( const _SeqFieldLstElem& rNew, size_t* pP ) const { size_t nO = maData.size(); size_t nU = 0; @@ -770,15 +770,15 @@ bool SwSeqFldList::SeekEntry( const _SeqFldLstElem& rNew, size_t* pP ) const } SwSetExpField::SwSetExpField(SwSetExpFieldType* pTyp, const OUString& rFormel, - sal_uLong nFmt) - : SwFormulaField( pTyp, nFmt, 0.0 ), nSeqNo( USHRT_MAX ), + sal_uLong nFormat) + : SwFormulaField( pTyp, nFormat, 0.0 ), nSeqNo( USHRT_MAX ), nSubType(0) - , mpFmtFld(0) + , mpFormatField(0) { SetFormula(rFormel); // ignore SubType bInput = false; - if( IsSequenceFld() ) + if( IsSequenceField() ) { SwValueField::SetValue(1.0); if( rFormel.isEmpty() ) @@ -788,9 +788,9 @@ SwSetExpField::SwSetExpField(SwSetExpFieldType* pTyp, const OUString& rFormel, } } -void SwSetExpField::SetFmtFld(SwFmtFld & rFmtFld) +void SwSetExpField::SetFormatField(SwFormatField & rFormatField) { - mpFmtFld = &rFmtFld; + mpFormatField = &rFormatField; } OUString SwSetExpField::Expand() const @@ -809,7 +809,7 @@ OUString SwSetExpField::Expand() const /// @return the field name OUString SwSetExpField::GetFieldName() const { - SwFldTypesEnum const nStrType( (IsSequenceFld()) + SwFieldTypesEnum const nStrType( (IsSequenceField()) ? TYP_SEQFLD : (bInput) ? TYP_SETINPFLD @@ -861,7 +861,7 @@ void SwSetExpField::SetValue( const double& rAny ) { SwValueField::SetValue(rAny); - if( IsSequenceFld() ) + if( IsSequenceField() ) sExpand = FormatNumber( GetValue(), GetFormat() ); else sExpand = static_cast<SwValueFieldType*>(GetTyp())->ExpandValue( rAny, @@ -877,19 +877,19 @@ void SwGetExpField::SetValue( const double& rAny ) /** Find the index of the reference text following the current field * - * @param rFmt + * @param rFormat * @param rDoc * @param nHint search starting position after the current field (or 0 if default) * @return */ -sal_Int32 SwGetExpField::GetReferenceTextPos( const SwFmtFld& rFmt, SwDoc& rDoc, sal_Int32 nHint) +sal_Int32 SwGetExpField::GetReferenceTextPos( const SwFormatField& rFormat, SwDoc& rDoc, sal_Int32 nHint) { - const SwTxtFld* pTxtFld = rFmt.GetTxtFld(); - const SwTxtNode& rTxtNode = pTxtFld->GetTxtNode(); + const SwTextField* pTextField = rFormat.GetTextField(); + const SwTextNode& rTextNode = pTextField->GetTextNode(); - sal_Int32 nRet = nHint ? nHint : pTxtFld->GetStart() + 1; - OUString sNodeText = rTxtNode.GetTxt(); + sal_Int32 nRet = nHint ? nHint : pTextField->GetStart() + 1; + OUString sNodeText = rTextNode.GetText(); if(nRet<sNodeText.getLength()) { @@ -909,7 +909,7 @@ sal_Int32 SwGetExpField::GetReferenceTextPos( const SwFmtFld& rFmt, SwDoc& rDoc, 0, 0 }; SwAttrSet aSet(rDoc.GetAttrPool(), nIds); - rTxtNode.GetAttr(aSet, nRet, nRet+1); + rTextNode.GetAttr(aSet, nRet, nRet+1); if( RTL_TEXTENCODING_SYMBOL != static_cast<const SvxFontItem&>(aSet.Get( GetWhichOfScript( RES_CHRATR_FONT, nSrcpt )) ).GetCharSet() ) @@ -1122,14 +1122,14 @@ SwInputField::SwInputField( SwInputFieldType* pFieldType, const OUString& rContent, const OUString& rPrompt, sal_uInt16 nSub, - sal_uLong nFmt, + sal_uLong nFormat, bool bIsFormField ) - : SwField( pFieldType, nFmt, LANGUAGE_SYSTEM, false ) + : SwField( pFieldType, nFormat, LANGUAGE_SYSTEM, false ) , aContent(rContent) , aPText(rPrompt) , nSubType(nSub) , mbIsFormField( bIsFormField ) - , mpFmtFld( NULL ) + , mpFormatField( NULL ) { } @@ -1137,33 +1137,33 @@ SwInputField::~SwInputField() { } -void SwInputField::SetFmtFld( SwFmtFld& rFmtFld ) +void SwInputField::SetFormatField( SwFormatField& rFormatField ) { - mpFmtFld = &rFmtFld; + mpFormatField = &rFormatField; } void SwInputField::LockNotifyContentChange() { - if ( GetFmtFld() != NULL ) + if ( GetFormatField() != NULL ) { - SwTxtInputFld* pTxtInputFld = dynamic_cast< SwTxtInputFld* >(GetFmtFld()->GetTxtFld()); - if ( pTxtInputFld != NULL ) + SwTextInputField* pTextInputField = dynamic_cast< SwTextInputField* >(GetFormatField()->GetTextField()); + if ( pTextInputField != NULL ) { - pTxtInputFld->LockNotifyContentChange(); + pTextInputField->LockNotifyContentChange(); } } } void SwInputField::UnlockNotifyContentChange() { - if ( GetFmtFld() != NULL ) + if ( GetFormatField() != NULL ) { - SwTxtInputFld* pTxtInputFld = dynamic_cast< SwTxtInputFld* >(GetFmtFld()->GetTxtFld()); - if ( pTxtInputFld != NULL ) + SwTextInputField* pTextInputField = dynamic_cast< SwTextInputField* >(GetFormatField()->GetTextField()); + if ( pTextInputField != NULL ) { - pTxtInputFld->UnlockNotifyContentChange(); + pTextInputField->UnlockNotifyContentChange(); } } } @@ -1177,7 +1177,7 @@ void SwInputField::applyFieldContent( const OUString& rNewFieldContent ) else if( (nSubType & 0x00ff) == INP_USR ) { SwUserFieldType* pUserTyp = static_cast<SwUserFieldType*>( - static_cast<SwInputFieldType*>(GetTyp())->GetDoc()->getIDocumentFieldsAccess().GetFldType( RES_USERFLD, getContent(), false ) ); + static_cast<SwInputFieldType*>(GetTyp())->GetDoc()->getIDocumentFieldsAccess().GetFieldType( RES_USERFLD, getContent(), false ) ); if( pUserTyp ) { pUserTyp->SetContent( rNewFieldContent ); @@ -1185,7 +1185,7 @@ void SwInputField::applyFieldContent( const OUString& rNewFieldContent ) // trigger update of the corresponding User Fields and other related Input Fields { LockNotifyContentChange(); - pUserTyp->UpdateFlds(); + pUserTyp->UpdateFields(); UnlockNotifyContentChange(); } } @@ -1204,7 +1204,7 @@ OUString SwInputField::GetFieldName() const SwField* SwInputField::Copy() const { - SwInputField* pFld = + SwInputField* pField = new SwInputField( static_cast<SwInputFieldType*>(GetTyp()), getContent(), @@ -1213,11 +1213,11 @@ SwField* SwInputField::Copy() const GetFormat(), mbIsFormField ); - pFld->SetHelp( aHelp ); - pFld->SetToolTip( aToolTip ); + pField->SetHelp( aHelp ); + pField->SetToolTip( aToolTip ); - pFld->SetAutomaticLanguage(IsAutomaticLanguage()); - return pFld; + pField->SetAutomaticLanguage(IsAutomaticLanguage()); + return pField; } OUString SwInputField::Expand() const @@ -1230,7 +1230,7 @@ OUString SwInputField::Expand() const if( (nSubType & 0x00ff) == INP_USR ) { SwUserFieldType* pUserTyp = static_cast<SwUserFieldType*>( - static_cast<SwInputFieldType*>(GetTyp())->GetDoc()->getIDocumentFieldsAccess().GetFldType( RES_USERFLD, getContent(), false ) ); + static_cast<SwInputFieldType*>(GetTyp())->GetDoc()->getIDocumentFieldsAccess().GetFieldType( RES_USERFLD, getContent(), false ) ); if( pUserTyp ) return pUserTyp->GetContent(); } diff --git a/sw/source/core/fields/fldbas.cxx b/sw/source/core/fields/fldbas.cxx index 3024f9c042f3..7f02e0a23bb8 100644 --- a/sw/source/core/fields/fldbas.cxx +++ b/sw/source/core/fields/fldbas.cxx @@ -51,13 +51,13 @@ using namespace ::com::sun::star; using namespace nsSwDocInfoSubType; -static sal_uInt16 lcl_GetLanguageOfFormat( sal_uInt16 nLng, sal_uLong nFmt, +static sal_uInt16 lcl_GetLanguageOfFormat( sal_uInt16 nLng, sal_uLong nFormat, const SvNumberFormatter& rFormatter ) { if( nLng == LANGUAGE_NONE ) // Bug #60010 nLng = LANGUAGE_SYSTEM; else if( nLng == ::GetAppLanguage() ) - switch( rFormatter.GetIndexTableOffset( nFmt )) + switch( rFormatter.GetIndexTableOffset( nFormat )) { case NF_NUMBER_SYSTEM: case NF_DATE_SYSTEM_SHORT: @@ -73,7 +73,7 @@ static sal_uInt16 lcl_GetLanguageOfFormat( sal_uInt16 nLng, sal_uLong nFmt, // Globals /// field names -std::vector<OUString>* SwFieldType::s_pFldNames = nullptr; +std::vector<OUString>* SwFieldType::s_pFieldNames = nullptr; namespace { @@ -125,11 +125,11 @@ namespace OUString SwFieldType::GetTypeStr(sal_uInt16 nTypeId) { - if (!s_pFldNames) - _GetFldName(); + if (!s_pFieldNames) + _GetFieldName(); - if (nTypeId < SwFieldType::s_pFldNames->size()) - return (*SwFieldType::s_pFldNames)[nTypeId]; + if (nTypeId < SwFieldType::s_pFieldNames->size()) + return (*SwFieldType::s_pFieldNames)[nTypeId]; return OUString(); } @@ -154,26 +154,26 @@ bool SwFieldType::PutValue( const uno::Any& , sal_uInt16 ) return false; } -void SwFldTypes::dumpAsXml(xmlTextWriterPtr pWriter) const +void SwFieldTypes::dumpAsXml(xmlTextWriterPtr pWriter) const { - xmlTextWriterStartElement(pWriter, BAD_CAST("swFldTypes")); + xmlTextWriterStartElement(pWriter, BAD_CAST("swFieldTypes")); sal_uInt16 nCount = size(); for (sal_uInt16 nType = 0; nType < nCount; ++nType) { const SwFieldType *pCurType = (*this)[nType]; - SwIterator<SwFmtFld, SwFieldType> aIter(*pCurType); - for (const SwFmtFld* pCurFldFmt = aIter.First(); pCurFldFmt; pCurFldFmt = aIter.Next()) + SwIterator<SwFormatField, SwFieldType> aIter(*pCurType); + for (const SwFormatField* pCurFieldFormat = aIter.First(); pCurFieldFormat; pCurFieldFormat = aIter.Next()) { - xmlTextWriterStartElement(pWriter, BAD_CAST("swFmtFld")); - xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("ptr"), "%p", pCurFldFmt); - xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("txtFld"), "%p", pCurFldFmt->GetTxtFld()); + xmlTextWriterStartElement(pWriter, BAD_CAST("swFormatField")); + xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("ptr"), "%p", pCurFieldFormat); + xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("txtField"), "%p", pCurFieldFormat->GetTextField()); xmlTextWriterStartElement(pWriter, BAD_CAST("swField")); - xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("symbol"), "%s", BAD_CAST(typeid(*pCurFldFmt->GetField()).name())); - xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("ptr"), "%p", pCurFldFmt->GetField()); - if (pCurFldFmt->GetField()->GetTyp()->Which() == RES_POSTITFLD) + xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("symbol"), "%s", BAD_CAST(typeid(*pCurFieldFormat->GetField()).name())); + xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("ptr"), "%p", pCurFieldFormat->GetField()); + if (pCurFieldFormat->GetField()->GetTyp()->Which() == RES_POSTITFLD) { - const SwPostItField* pField = static_cast<const SwPostItField*>(pCurFldFmt->GetField()); + const SwPostItField* pField = static_cast<const SwPostItField*>(pCurFieldFormat->GetField()); xmlTextWriterWriteAttribute(pWriter, BAD_CAST("name"), BAD_CAST(pField->GetName().toUtf8().getStr())); } xmlTextWriterEndElement(pWriter); @@ -481,7 +481,7 @@ SwValueFieldType::SwValueFieldType( const SwValueFieldType& rTyp ) /// return value formatted as string OUString SwValueFieldType::ExpandValue( const double& rVal, - sal_uInt32 nFmt, sal_uInt16 nLng) const + sal_uInt32 nFormat, sal_uInt16 nLng) const { if (rVal >= DBL_MAX) // error string for calculator return SwViewShell::GetShellRes()->aCalc_Error; @@ -491,51 +491,51 @@ OUString SwValueFieldType::ExpandValue( const double& rVal, Color* pCol = 0; // Bug #60010 - sal_uInt16 nFmtLng = ::lcl_GetLanguageOfFormat( nLng, nFmt, *pFormatter ); + sal_uInt16 nFormatLng = ::lcl_GetLanguageOfFormat( nLng, nFormat, *pFormatter ); - if( nFmt < SV_COUNTRY_LANGUAGE_OFFSET && LANGUAGE_SYSTEM != nFmtLng ) + if( nFormat < SV_COUNTRY_LANGUAGE_OFFSET && LANGUAGE_SYSTEM != nFormatLng ) { short nType = css::util::NumberFormat::DEFINED; sal_Int32 nDummy; - const SvNumberformat* pEntry = pFormatter->GetEntry(nFmt); + const SvNumberformat* pEntry = pFormatter->GetEntry(nFormat); if (pEntry && nLng != pEntry->GetLanguage()) { - sal_uInt32 nNewFormat = pFormatter->GetFormatForLanguageIfBuiltIn(nFmt, - (LanguageType)nFmtLng); + sal_uInt32 nNewFormat = pFormatter->GetFormatForLanguageIfBuiltIn(nFormat, + (LanguageType)nFormatLng); - if (nNewFormat == nFmt) + if (nNewFormat == nFormat) { // probably user-defined format - OUString sFmt(pEntry->GetFormatstring()); + OUString sFormat(pEntry->GetFormatstring()); - pFormatter->PutandConvertEntry(sFmt, nDummy, nType, nFmt, - pEntry->GetLanguage(), nFmtLng ); + pFormatter->PutandConvertEntry(sFormat, nDummy, nType, nFormat, + pEntry->GetLanguage(), nFormatLng ); } else - nFmt = nNewFormat; + nFormat = nNewFormat; } OSL_ENSURE(pEntry, "unknown number format!"); } - if( pFormatter->IsTextFormat( nFmt ) ) + if( pFormatter->IsTextFormat( nFormat ) ) { - pFormatter->GetOutputString(DoubleToString(rVal, nFmtLng), nFmt, + pFormatter->GetOutputString(DoubleToString(rVal, nFormatLng), nFormat, sExpand, &pCol); } else { - pFormatter->GetOutputString(rVal, nFmt, sExpand, &pCol); + pFormatter->GetOutputString(rVal, nFormat, sExpand, &pCol); } return sExpand; } OUString SwValueFieldType::DoubleToString(const double &rVal, - sal_uInt32 nFmt) const + sal_uInt32 nFormat) const { SvNumberFormatter* pFormatter = m_pDoc->GetNumberFormatter(); - const SvNumberformat* pEntry = pFormatter->GetEntry(nFmt); + const SvNumberformat* pEntry = pFormatter->GetEntry(nFormat); if (!pEntry) return OUString(); @@ -557,16 +557,16 @@ OUString SwValueFieldType::DoubleToString( const double &rVal, pFormatter->GetDecSep(), true ); } -SwValueField::SwValueField( SwValueFieldType* pFldType, sal_uInt32 nFmt, +SwValueField::SwValueField( SwValueFieldType* pFieldType, sal_uInt32 nFormat, sal_uInt16 nLng, const double fVal ) - : SwField(pFldType, nFmt, nLng) + : SwField(pFieldType, nFormat, nLng) , m_fValue(fVal) { } -SwValueField::SwValueField( const SwValueField& rFld ) - : SwField(rFld) - , m_fValue(rFld.GetValue()) +SwValueField::SwValueField( const SwValueField& rField ) + : SwField(rField) + , m_fValue(rField.GetValue()) { } @@ -590,43 +590,43 @@ SwFieldType* SwValueField::ChgTyp( SwFieldType* pNewType ) { SvNumberFormatter* pFormatter = pNewDoc->GetNumberFormatter(); - if( pFormatter && pFormatter->HasMergeFmtTbl() && + if( pFormatter && pFormatter->HasMergeFormatTable() && static_cast<SwValueFieldType *>(GetTyp())->UseFormat() ) - SetFormat(pFormatter->GetMergeFmtIndex( GetFormat() )); + SetFormat(pFormatter->GetMergeFormatIndex( GetFormat() )); } return SwField::ChgTyp(pNewType); } /// get format in office language -sal_uInt32 SwValueField::GetSystemFormat(SvNumberFormatter* pFormatter, sal_uInt32 nFmt) +sal_uInt32 SwValueField::GetSystemFormat(SvNumberFormatter* pFormatter, sal_uInt32 nFormat) { - const SvNumberformat* pEntry = pFormatter->GetEntry(nFmt); + const SvNumberformat* pEntry = pFormatter->GetEntry(nFormat); sal_uInt16 nLng = SvtSysLocale().GetLanguageTag().getLanguageType(); if (pEntry && nLng != pEntry->GetLanguage()) { - sal_uInt32 nNewFormat = pFormatter->GetFormatForLanguageIfBuiltIn(nFmt, + sal_uInt32 nNewFormat = pFormatter->GetFormatForLanguageIfBuiltIn(nFormat, (LanguageType)nLng); - if (nNewFormat == nFmt) + if (nNewFormat == nFormat) { // probably user-defined format short nType = css::util::NumberFormat::DEFINED; sal_Int32 nDummy; - OUString sFmt(pEntry->GetFormatstring()); + OUString sFormat(pEntry->GetFormatstring()); - sal_uInt32 nTempFormat = nFmt; - pFormatter->PutandConvertEntry(sFmt, nDummy, nType, + sal_uInt32 nTempFormat = nFormat; + pFormatter->PutandConvertEntry(sFormat, nDummy, nType, nTempFormat, pEntry->GetLanguage(), nLng); - nFmt = nTempFormat; + nFormat = nTempFormat; } else - nFmt = nNewFormat; + nFormat = nNewFormat; } - return nFmt; + return nFormat; } /// set language of the format @@ -638,30 +638,30 @@ void SwValueField::SetLanguage( sal_uInt16 nLng ) { // Bug #60010 SvNumberFormatter* pFormatter = GetDoc()->GetNumberFormatter(); - sal_uInt16 nFmtLng = ::lcl_GetLanguageOfFormat( nLng, GetFormat(), + sal_uInt16 nFormatLng = ::lcl_GetLanguageOfFormat( nLng, GetFormat(), *pFormatter ); if( (GetFormat() >= SV_COUNTRY_LANGUAGE_OFFSET || - LANGUAGE_SYSTEM != nFmtLng ) && + LANGUAGE_SYSTEM != nFormatLng ) && !(Which() == RES_USERFLD && (GetSubType()&nsSwExtendedSubType::SUB_CMD) ) ) { const SvNumberformat* pEntry = pFormatter->GetEntry(GetFormat()); - if( pEntry && nFmtLng != pEntry->GetLanguage() ) + if( pEntry && nFormatLng != pEntry->GetLanguage() ) { sal_uInt32 nNewFormat = pFormatter->GetFormatForLanguageIfBuiltIn( - GetFormat(), (LanguageType)nFmtLng ); + GetFormat(), (LanguageType)nFormatLng ); if( nNewFormat == GetFormat() ) { // probably user-defined format short nType = css::util::NumberFormat::DEFINED; sal_Int32 nDummy; - OUString sFmt( pEntry->GetFormatstring() ); - pFormatter->PutandConvertEntry( sFmt, nDummy, nType, + OUString sFormat( pEntry->GetFormatstring() ); + pFormatter->PutandConvertEntry( sFormat, nDummy, nType, nNewFormat, pEntry->GetLanguage(), - nFmtLng ); + nFormatLng ); } SetFormat( nNewFormat ); } @@ -682,14 +682,14 @@ void SwValueField::SetValue( const double& rVal ) m_fValue = rVal; } -SwFormulaField::SwFormulaField( SwValueFieldType* pFldType, sal_uInt32 nFmt, const double fVal) - : SwValueField(pFldType, nFmt, LANGUAGE_SYSTEM, fVal) +SwFormulaField::SwFormulaField( SwValueFieldType* pFieldType, sal_uInt32 nFormat, const double fVal) + : SwValueField(pFieldType, nFormat, LANGUAGE_SYSTEM, fVal) { } -SwFormulaField::SwFormulaField( const SwFormulaField& rFld ) - : SwValueField(static_cast<SwValueFieldType *>(rFld.GetTyp()), rFld.GetFormat(), - rFld.GetLanguage(), rFld.GetValue()) +SwFormulaField::SwFormulaField( const SwFormulaField& rField ) + : SwValueField(static_cast<SwValueFieldType *>(rField.GetTyp()), rField.GetFormat(), + rField.GetLanguage(), rField.GetValue()) { } @@ -702,9 +702,9 @@ void SwFormulaField::SetFormula(const OUString& rStr) { m_sFormula = rStr; - sal_uLong nFmt(GetFormat()); + sal_uLong nFormat(GetFormat()); - if( nFmt && SAL_MAX_UINT32 != nFmt ) + if( nFormat && SAL_MAX_UINT32 != nFormat ) { sal_Int32 nPos = 0; double fTmpValue; @@ -715,19 +715,19 @@ void SwFormulaField::SetFormula(const OUString& rStr) void SwFormulaField::SetExpandedFormula( const OUString& rStr ) { - sal_uInt32 nFmt(GetFormat()); + sal_uInt32 nFormat(GetFormat()); - if (nFmt && nFmt != SAL_MAX_UINT32 && static_cast<SwValueFieldType *>(GetTyp())->UseFormat()) + if (nFormat && nFormat != SAL_MAX_UINT32 && static_cast<SwValueFieldType *>(GetTyp())->UseFormat()) { double fTmpValue; SvNumberFormatter* pFormatter = GetDoc()->GetNumberFormatter(); - if (pFormatter->IsNumberFormat(rStr, nFmt, fTmpValue)) + if (pFormatter->IsNumberFormat(rStr, nFormat, fTmpValue)) { SwValueField::SetValue(fTmpValue); - m_sFormula = static_cast<SwValueFieldType *>(GetTyp())->DoubleToString(fTmpValue, nFmt); + m_sFormula = static_cast<SwValueFieldType *>(GetTyp())->DoubleToString(fTmpValue, nFormat); return; } } @@ -736,23 +736,23 @@ void SwFormulaField::SetExpandedFormula( const OUString& rStr ) OUString SwFormulaField::GetExpandedFormula() const { - sal_uInt32 nFmt(GetFormat()); + sal_uInt32 nFormat(GetFormat()); - if (nFmt && nFmt != SAL_MAX_UINT32 && static_cast<SwValueFieldType *>(GetTyp())->UseFormat()) + if (nFormat && nFormat != SAL_MAX_UINT32 && static_cast<SwValueFieldType *>(GetTyp())->UseFormat()) { OUString sFormattedValue; Color* pCol = 0; SvNumberFormatter* pFormatter = GetDoc()->GetNumberFormatter(); - if (pFormatter->IsTextFormat(nFmt)) + if (pFormatter->IsTextFormat(nFormat)) { - OUString sTempIn(static_cast<SwValueFieldType *>(GetTyp())->DoubleToString(GetValue(), nFmt)); - pFormatter->GetOutputString(sTempIn, nFmt, sFormattedValue, &pCol); + OUString sTempIn(static_cast<SwValueFieldType *>(GetTyp())->DoubleToString(GetValue(), nFormat)); + pFormatter->GetOutputString(sTempIn, nFormat, sFormattedValue, &pCol); } else { - pFormatter->GetOutputString(GetValue(), nFmt, sFormattedValue, &pCol); + pFormatter->GetOutputString(GetValue(), nFormat, sFormattedValue, &pCol); } return sFormattedValue; } diff --git a/sw/source/core/fields/flddat.cxx b/sw/source/core/fields/flddat.cxx index 0b23799b5b34..42d14a21e3d1 100644 --- a/sw/source/core/fields/flddat.cxx +++ b/sw/source/core/fields/flddat.cxx @@ -37,12 +37,12 @@ SwFieldType* SwDateTimeFieldType::Copy() const return pTmp; } -SwDateTimeField::SwDateTimeField(SwDateTimeFieldType* pInitType, sal_uInt16 nSub, sal_uLong nFmt, sal_uInt16 nLng) - : SwValueField(pInitType, nFmt, nLng, 0.0), +SwDateTimeField::SwDateTimeField(SwDateTimeFieldType* pInitType, sal_uInt16 nSub, sal_uLong nFormat, sal_uInt16 nLng) + : SwValueField(pInitType, nFormat, nLng, 0.0), nSubType(nSub), nOffset(0) { - if (!nFmt) + if (!nFormat) { SvNumberFormatter* pFormatter = GetDoc()->GetNumberFormatter(); if (nSubType & DATEFLD) diff --git a/sw/source/core/fields/fldlst.cxx b/sw/source/core/fields/fldlst.cxx index 03e3a8efa7ae..13339c5753a2 100644 --- a/sw/source/core/fields/fldlst.cxx +++ b/sw/source/core/fields/fldlst.cxx @@ -36,40 +36,40 @@ SwInputFieldList::SwInputFieldList( SwEditShell* pShell, bool bBuildTmpLst ) : pSh(pShell) { // create sorted list of all input fields - pSrtLst = new _SetGetExpFlds(); + pSrtLst = new _SetGetExpFields(); - const SwFldTypes& rFldTypes = *pSh->GetDoc()->getIDocumentFieldsAccess().GetFldTypes(); - const size_t nSize = rFldTypes.size(); + const SwFieldTypes& rFieldTypes = *pSh->GetDoc()->getIDocumentFieldsAccess().GetFieldTypes(); + const size_t nSize = rFieldTypes.size(); // iterate over all types for(size_t i=0; i < nSize; ++i) { - SwFieldType* pFldType = (SwFieldType*)rFldTypes[ i ]; - const sal_uInt16 nType = pFldType->Which(); + SwFieldType* pFieldType = (SwFieldType*)rFieldTypes[ i ]; + const sal_uInt16 nType = pFieldType->Which(); if( RES_SETEXPFLD == nType || RES_INPUTFLD == nType || RES_DROPDOWN == nType ) { - SwIterator<SwFmtFld,SwFieldType> aIter( *pFldType ); - for( SwFmtFld* pFmtFld = aIter.First(); pFmtFld; pFmtFld = aIter.Next() ) + SwIterator<SwFormatField,SwFieldType> aIter( *pFieldType ); + for( SwFormatField* pFormatField = aIter.First(); pFormatField; pFormatField = aIter.Next() ) { - const SwTxtFld* pTxtFld = pFmtFld->GetTxtFld(); + const SwTextField* pTextField = pFormatField->GetTextField(); - // only process InputFields, interactive SetExpFlds and DropDown fields - if( !pTxtFld || ( RES_SETEXPFLD == nType && - !static_cast<SwSetExpField*>(pFmtFld->GetField())->GetInputFlag())) + // only process InputFields, interactive SetExpFields and DropDown fields + if( !pTextField || ( RES_SETEXPFLD == nType && + !static_cast<SwSetExpField*>(pFormatField->GetField())->GetInputFlag())) continue; - const SwTxtNode& rTxtNode = pTxtFld->GetTxtNode(); - if( rTxtNode.GetNodes().IsDocNodes() ) + const SwTextNode& rTextNode = pTextField->GetTextNode(); + if( rTextNode.GetNodes().IsDocNodes() ) { if( bBuildTmpLst ) { - aTmpLst.insert( pTxtFld ); + aTmpLst.insert( pTextField ); } else { - SwNodeIndex aIdx( rTxtNode ); - _SetGetExpFld* pNew = new _SetGetExpFld(aIdx, pTxtFld ); + SwNodeIndex aIdx( rTextNode ); + _SetGetExpField* pNew = new _SetGetExpField(aIdx, pTextField ); pSrtLst->insert( pNew ); } } @@ -91,9 +91,9 @@ size_t SwInputFieldList::Count() const // get field from list in sorted order SwField* SwInputFieldList::GetField(size_t nId) { - const SwTxtFld* pTxtFld = (*pSrtLst)[ nId ]->GetTxtFld(); - OSL_ENSURE( pTxtFld, "no TextFld" ); - return const_cast<SwField*>(pTxtFld->GetFmtFld().GetField()); + const SwTextField* pTextField = (*pSrtLst)[ nId ]->GetTextField(); + OSL_ENSURE( pTextField, "no TextField" ); + return const_cast<SwField*>(pTextField->GetFormatField().GetField()); } /// save cursor @@ -126,36 +126,36 @@ void SwInputFieldList::GotoFieldPos(size_t nId) */ bool SwInputFieldList::BuildSortLst() { - const SwFldTypes& rFldTypes = *pSh->GetDoc()->getIDocumentFieldsAccess().GetFldTypes(); - const size_t nSize = rFldTypes.size(); + const SwFieldTypes& rFieldTypes = *pSh->GetDoc()->getIDocumentFieldsAccess().GetFieldTypes(); + const size_t nSize = rFieldTypes.size(); // iterate over all types for( size_t i = 0; i < nSize; ++i ) { - SwFieldType* pFldType = (SwFieldType*)rFldTypes[ i ]; - const sal_uInt16 nType = pFldType->Which(); + SwFieldType* pFieldType = (SwFieldType*)rFieldTypes[ i ]; + const sal_uInt16 nType = pFieldType->Which(); if( RES_SETEXPFLD == nType || RES_INPUTFLD == nType ) { - SwIterator<SwFmtFld,SwFieldType> aIter( *pFldType ); - for( SwFmtFld* pFmtFld = aIter.First(); pFmtFld; pFmtFld = aIter.Next() ) + SwIterator<SwFormatField,SwFieldType> aIter( *pFieldType ); + for( SwFormatField* pFormatField = aIter.First(); pFormatField; pFormatField = aIter.Next() ) { - const SwTxtFld* pTxtFld = pFmtFld->GetTxtFld(); + const SwTextField* pTextField = pFormatField->GetTextField(); - // process only InputFields and interactive SetExpFlds - if( !pTxtFld || ( RES_SETEXPFLD == nType && - !static_cast<SwSetExpField*>(pFmtFld->GetField())->GetInputFlag())) + // process only InputFields and interactive SetExpFields + if( !pTextField || ( RES_SETEXPFLD == nType && + !static_cast<SwSetExpField*>(pFormatField->GetField())->GetInputFlag())) continue; - const SwTxtNode& rTxtNode = pTxtFld->GetTxtNode(); - if( rTxtNode.GetNodes().IsDocNodes() ) + const SwTextNode& rTextNode = pTextField->GetTextNode(); + if( rTextNode.GetNodes().IsDocNodes() ) { // not in TempList, thus add to SortList - std::set<const SwTxtFld*>::iterator it = aTmpLst.find( pTxtFld ); + std::set<const SwTextField*>::iterator it = aTmpLst.find( pTextField ); if( aTmpLst.end() == it ) { - SwNodeIndex aIdx( rTxtNode ); - _SetGetExpFld* pNew = new _SetGetExpFld(aIdx, pTxtFld ); + SwNodeIndex aIdx( rTextNode ); + _SetGetExpField* pNew = new _SetGetExpField(aIdx, pTextField ); pSrtLst->insert( pNew ); } else diff --git a/sw/source/core/fields/macrofld.cxx b/sw/source/core/fields/macrofld.cxx index f03ad73e7dca..371ca8c5c30a 100644 --- a/sw/source/core/fields/macrofld.cxx +++ b/sw/source/core/fields/macrofld.cxx @@ -41,8 +41,8 @@ SwFieldType* SwMacroFieldType::Copy() const } SwMacroField::SwMacroField(SwMacroFieldType* pInitType, - const OUString& rLibAndName, const OUString& rTxt) : - SwField(pInitType), aMacro(rLibAndName), aText(rTxt), bIsScriptURL(false) + const OUString& rLibAndName, const OUString& rText) : + SwField(pInitType), aMacro(rLibAndName), aText(rText), bIsScriptURL(false) { bIsScriptURL = isScriptURL(aMacro); } diff --git a/sw/source/core/fields/postithelper.cxx b/sw/source/core/fields/postithelper.cxx index 6a8f53eea98e..618acb04509e 100644 --- a/sw/source/core/fields/postithelper.cxx +++ b/sw/source/core/fields/postithelper.cxx @@ -44,23 +44,23 @@ SwPostItHelper::SwLayoutStatus SwPostItHelper::getLayoutInfos( const SwPosition* pAnnotationStartPos ) { SwLayoutStatus aRet = INVISIBLE; - SwTxtNode* pTxtNode = rAnchorPos.nNode.GetNode().GetTxtNode(); - if ( pTxtNode == NULL ) + SwTextNode* pTextNode = rAnchorPos.nNode.GetNode().GetTextNode(); + if ( pTextNode == NULL ) return aRet; - SwIterator<SwTxtFrm,SwCntntNode> aIter( *pTxtNode ); - for( SwTxtFrm* pTxtFrm = aIter.First(); pTxtFrm != NULL; pTxtFrm = aIter.Next() ) + SwIterator<SwTextFrm,SwContentNode> aIter( *pTextNode ); + for( SwTextFrm* pTextFrm = aIter.First(); pTextFrm != NULL; pTextFrm = aIter.Next() ) { - if( !pTxtFrm->IsFollow() ) + if( !pTextFrm->IsFollow() ) { - pTxtFrm = pTxtFrm->GetFrmAtPos( rAnchorPos ); - SwPageFrm *pPage = pTxtFrm ? pTxtFrm->FindPageFrm() : 0; + pTextFrm = pTextFrm->GetFrmAtPos( rAnchorPos ); + SwPageFrm *pPage = pTextFrm ? pTextFrm->FindPageFrm() : 0; if ( pPage != NULL && !pPage->IsInvalid() && !pPage->IsInvalidFly() ) { aRet = VISIBLE; - o_rInfo.mpAnchorFrm = pTxtFrm; - pTxtFrm->GetCharRect( o_rInfo.mPosition, rAnchorPos, 0 ); + o_rInfo.mpAnchorFrm = pTextFrm; + pTextFrm->GetCharRect( o_rInfo.mPosition, rAnchorPos, 0 ); if ( pAnnotationStartPos != NULL ) { o_rInfo.mnStartNodeIdx = pAnnotationStartPos->nNode.GetIndex(); @@ -78,7 +78,7 @@ SwPostItHelper::SwLayoutStatus SwPostItHelper::getLayoutInfos( o_rInfo.meSidebarPosition = pPage->SidebarPosition(); o_rInfo.mRedlineAuthor = 0; - const IDocumentRedlineAccess* pIDRA = pTxtNode->getIDocumentRedlineAccess(); + const IDocumentRedlineAccess* pIDRA = pTextNode->getIDocumentRedlineAccess(); if( IDocumentRedlineAccess::IsShowChanges( pIDRA->GetRedlineMode() ) ) { const SwRangeRedline* pRedline = pIDRA->GetRedline( rAnchorPos, 0 ); @@ -95,7 +95,7 @@ SwPostItHelper::SwLayoutStatus SwPostItHelper::getLayoutInfos( } } - return ( (aRet==VISIBLE) && SwScriptInfo::IsInHiddenRange( *pTxtNode , rAnchorPos.nContent.GetIndex()) ) + return ( (aRet==VISIBLE) && SwScriptInfo::IsInHiddenRange( *pTextNode , rAnchorPos.nContent.GetIndex()) ) ? HIDDEN : aRet; } @@ -130,17 +130,17 @@ unsigned long SwPostItHelper::getPageInfo( SwRect& rPageFrm, const SwRootFrm* pR SwPosition SwAnnotationItem::GetAnchorPosition() const { - SwTxtFld* pTxtFld = mrFmtFld.GetTxtFld(); - SwTxtNode* pTxtNode = pTxtFld->GetpTxtNode(); + SwTextField* pTextField = mrFormatField.GetTextField(); + SwTextNode* pTextNode = pTextField->GetpTextNode(); - SwPosition aPos( *pTxtNode ); - aPos.nContent.Assign( pTxtNode, pTxtFld->GetStart() ); + SwPosition aPos( *pTextNode ); + aPos.nContent.Assign( pTextNode, pTextField->GetStart() ); return aPos; } bool SwAnnotationItem::UseElement() { - return mrFmtFld.IsFldInDoc(); + return mrFormatField.IsFieldInDoc(); } VclPtr<sw::sidebarwindows::SwSidebarWin> SwAnnotationItem::GetSidebarWindow( @@ -152,7 +152,7 @@ VclPtr<sw::sidebarwindows::SwSidebarWin> SwAnnotationItem::GetSidebarWindow( return VclPtr<sw::annotation::SwAnnotationWin>::Create( rEditWin, nBits, aMgr, aBits, *this, - &mrFmtFld ); + &mrFormatField ); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/fields/reffld.cxx b/sw/source/core/fields/reffld.cxx index f75eedfea755..c845ed0f2d5e 100644 --- a/sw/source/core/fields/reffld.cxx +++ b/sw/source/core/fields/reffld.cxx @@ -90,11 +90,11 @@ static void lcl_GetLayTree( const SwFrm* pFrm, std::vector<const SwFrm*>& rArr ) } } -bool IsFrameBehind( const SwTxtNode& rMyNd, sal_Int32 nMySttPos, - const SwTxtNode& rBehindNd, sal_Int32 nSttPos ) +bool IsFrameBehind( const SwTextNode& rMyNd, sal_Int32 nMySttPos, + const SwTextNode& rBehindNd, sal_Int32 nSttPos ) { - const SwTxtFrm *pMyFrm = static_cast<SwTxtFrm*>(rMyNd.getLayoutFrm( rMyNd.GetDoc()->getIDocumentLayoutAccess().GetCurrentLayout(), 0, 0, false) ), - *pFrm = static_cast<SwTxtFrm*>(rBehindNd.getLayoutFrm( rBehindNd.GetDoc()->getIDocumentLayoutAccess().GetCurrentLayout(), 0, 0, false) ); + const SwTextFrm *pMyFrm = static_cast<SwTextFrm*>(rMyNd.getLayoutFrm( rMyNd.GetDoc()->getIDocumentLayoutAccess().GetCurrentLayout(), 0, 0, false) ), + *pFrm = static_cast<SwTextFrm*>(rBehindNd.getLayoutFrm( rBehindNd.GetDoc()->getIDocumentLayoutAccess().GetCurrentLayout(), 0, 0, false) ); while( pFrm && !pFrm->IsInside( nSttPos ) ) pFrm = pFrm->GetFollow(); @@ -131,39 +131,39 @@ bool IsFrameBehind( const SwTxtNode& rMyNd, sal_Int32 nMySttPos, } const SwFrm* pRefFrm = aRefArr[ nRefCnt ]; - const SwFrm* pFldFrm = aArr[ nCnt ]; + const SwFrm* pFieldFrm = aArr[ nCnt ]; // different frames, check their Y-/X-position bool bRefIsLower = false; - if( ( FRM_COLUMN | FRM_CELL ) & pFldFrm->GetType() || + if( ( FRM_COLUMN | FRM_CELL ) & pFieldFrm->GetType() || ( FRM_COLUMN | FRM_CELL ) & pRefFrm->GetType() ) { - if( pFldFrm->GetType() == pRefFrm->GetType() ) + if( pFieldFrm->GetType() == pRefFrm->GetType() ) { // here, the X-pos is more important if( bVert ) { if( bR2L ) - bRefIsLower = pRefFrm->Frm().Top() < pFldFrm->Frm().Top() || - ( pRefFrm->Frm().Top() == pFldFrm->Frm().Top() && - pRefFrm->Frm().Left() < pFldFrm->Frm().Left() ); + bRefIsLower = pRefFrm->Frm().Top() < pFieldFrm->Frm().Top() || + ( pRefFrm->Frm().Top() == pFieldFrm->Frm().Top() && + pRefFrm->Frm().Left() < pFieldFrm->Frm().Left() ); else - bRefIsLower = pRefFrm->Frm().Top() < pFldFrm->Frm().Top() || - ( pRefFrm->Frm().Top() == pFldFrm->Frm().Top() && - pRefFrm->Frm().Left() > pFldFrm->Frm().Left() ); + bRefIsLower = pRefFrm->Frm().Top() < pFieldFrm->Frm().Top() || + ( pRefFrm->Frm().Top() == pFieldFrm->Frm().Top() && + pRefFrm->Frm().Left() > pFieldFrm->Frm().Left() ); } else if( bR2L ) - bRefIsLower = pRefFrm->Frm().Left() > pFldFrm->Frm().Left() || - ( pRefFrm->Frm().Left() == pFldFrm->Frm().Left() && - pRefFrm->Frm().Top() < pFldFrm->Frm().Top() ); + bRefIsLower = pRefFrm->Frm().Left() > pFieldFrm->Frm().Left() || + ( pRefFrm->Frm().Left() == pFieldFrm->Frm().Left() && + pRefFrm->Frm().Top() < pFieldFrm->Frm().Top() ); else - bRefIsLower = pRefFrm->Frm().Left() < pFldFrm->Frm().Left() || - ( pRefFrm->Frm().Left() == pFldFrm->Frm().Left() && - pRefFrm->Frm().Top() < pFldFrm->Frm().Top() ); + bRefIsLower = pRefFrm->Frm().Left() < pFieldFrm->Frm().Left() || + ( pRefFrm->Frm().Left() == pFieldFrm->Frm().Left() && + pRefFrm->Frm().Top() < pFieldFrm->Frm().Top() ); pRefFrm = 0; } - else if( ( FRM_COLUMN | FRM_CELL ) & pFldFrm->GetType() ) - pFldFrm = aArr[ nCnt - 1 ]; + else if( ( FRM_COLUMN | FRM_CELL ) & pFieldFrm->GetType() ) + pFieldFrm = aArr[ nCnt - 1 ]; else pRefFrm = aRefArr[ nRefCnt - 1 ]; } @@ -173,31 +173,31 @@ bool IsFrameBehind( const SwTxtNode& rMyNd, sal_Int32 nMySttPos, if( bVert ) { if( bR2L ) - bRefIsLower = pRefFrm->Frm().Left() < pFldFrm->Frm().Left() || - ( pRefFrm->Frm().Left() == pFldFrm->Frm().Left() && - pRefFrm->Frm().Top() < pFldFrm->Frm().Top() ); + bRefIsLower = pRefFrm->Frm().Left() < pFieldFrm->Frm().Left() || + ( pRefFrm->Frm().Left() == pFieldFrm->Frm().Left() && + pRefFrm->Frm().Top() < pFieldFrm->Frm().Top() ); else - bRefIsLower = pRefFrm->Frm().Left() > pFldFrm->Frm().Left() || - ( pRefFrm->Frm().Left() == pFldFrm->Frm().Left() && - pRefFrm->Frm().Top() < pFldFrm->Frm().Top() ); + bRefIsLower = pRefFrm->Frm().Left() > pFieldFrm->Frm().Left() || + ( pRefFrm->Frm().Left() == pFieldFrm->Frm().Left() && + pRefFrm->Frm().Top() < pFieldFrm->Frm().Top() ); } else if( bR2L ) - bRefIsLower = pRefFrm->Frm().Top() < pFldFrm->Frm().Top() || - ( pRefFrm->Frm().Top() == pFldFrm->Frm().Top() && - pRefFrm->Frm().Left() > pFldFrm->Frm().Left() ); + bRefIsLower = pRefFrm->Frm().Top() < pFieldFrm->Frm().Top() || + ( pRefFrm->Frm().Top() == pFieldFrm->Frm().Top() && + pRefFrm->Frm().Left() > pFieldFrm->Frm().Left() ); else - bRefIsLower = pRefFrm->Frm().Top() < pFldFrm->Frm().Top() || - ( pRefFrm->Frm().Top() == pFldFrm->Frm().Top() && - pRefFrm->Frm().Left() < pFldFrm->Frm().Left() ); + bRefIsLower = pRefFrm->Frm().Top() < pFieldFrm->Frm().Top() || + ( pRefFrm->Frm().Top() == pFieldFrm->Frm().Top() && + pRefFrm->Frm().Left() < pFieldFrm->Frm().Left() ); } return bRefIsLower; } /// get references -SwGetRefField::SwGetRefField( SwGetRefFieldType* pFldType, +SwGetRefField::SwGetRefField( SwGetRefFieldType* pFieldType, const OUString& rSetRef, sal_uInt16 nSubTyp, - sal_uInt16 nSeqenceNo, sal_uLong nFmt ) - : SwField( pFldType, nFmt ), + sal_uInt16 nSeqenceNo, sal_uLong nFormat ) + : SwField( pFieldType, nFormat ), sSetRefName( rSetRef ), nSubType( nSubTyp ), nSeqNo( nSeqenceNo ) @@ -236,7 +236,7 @@ bool SwGetRefField::IsRefToNumItemCrossRefBookmark() const ::sw::mark::CrossRefNumItemBookmark::IsLegalName(sSetRefName); } -const SwTxtNode* SwGetRefField::GetReferencedTxtNode() const +const SwTextNode* SwGetRefField::GetReferencedTextNode() const { SwGetRefFieldType *pTyp = dynamic_cast<SwGetRefFieldType*>(GetTyp()); if (!pTyp) @@ -246,17 +246,17 @@ const SwTxtNode* SwGetRefField::GetReferencedTxtNode() const } // #i85090# -OUString SwGetRefField::GetExpandedTxtOfReferencedTxtNode() const +OUString SwGetRefField::GetExpandedTextOfReferencedTextNode() const { - const SwTxtNode* pReferencedTxtNode( GetReferencedTxtNode() ); - return pReferencedTxtNode - ? OUString(pReferencedTxtNode->GetExpandTxt( 0, -1, true, true, false, false )) + const SwTextNode* pReferencedTextNode( GetReferencedTextNode() ); + return pReferencedTextNode + ? OUString(pReferencedTextNode->GetExpandText( 0, -1, true, true, false, false )) : OUString(); } OUString SwGetRefField::Expand() const { - return sTxt; + return sText; } OUString SwGetRefField::GetFieldName() const @@ -269,26 +269,26 @@ OUString SwGetRefField::GetFieldName() const return Expand(); } -// #i81002# - parameter <pFldTxtAttr> added -void SwGetRefField::UpdateField( const SwTxtFld* pFldTxtAttr ) +// #i81002# - parameter <pFieldTextAttr> added +void SwGetRefField::UpdateField( const SwTextField* pFieldTextAttr ) { - sTxt.clear(); + sText.clear(); SwDoc* pDoc = static_cast<SwGetRefFieldType*>(GetTyp())->GetDoc(); // finding the reference target (the number) sal_Int32 nNumStart = -1; sal_Int32 nNumEnd = -1; - SwTxtNode* pTxtNd = SwGetRefFieldType::FindAnchor( + SwTextNode* pTextNd = SwGetRefFieldType::FindAnchor( pDoc, sSetRefName, nSubType, nSeqNo, &nNumStart, &nNumEnd ); // not found? - if ( !pTxtNd ) + if ( !pTextNd ) { - sTxt = SwViewShell::GetShellRes()->aGetRefFld_RefItemNotFound; + sText = SwViewShell::GetShellRes()->aGetRefField_RefItemNotFound; return ; } // where is the category name (e.g. "Illustration")? - const OUString aText = pTxtNd->GetTxt(); + const OUString aText = pTextNd->GetText(); const sal_Int32 nCatStart = aText.indexOf(sSetRefName); const bool bHasCat = nCatStart>=0; const sal_Int32 nCatEnd = bHasCat ? nCatStart + sSetRefName.getLength() : -1; @@ -328,14 +328,14 @@ void SwGetRefField::UpdateField( const SwTxtFld* pFldTxtAttr ) // "Caption Text" case REF_ONLYCAPTION: { // next alphanumeric character after category+number - if (const SwTxtAttr* const pTxtAttr = - pTxtNd->GetTxtAttrForCharAt(nNumStart, RES_TXTATR_FIELD) + if (const SwTextAttr* const pTextAttr = + pTextNd->GetTextAttrForCharAt(nNumStart, RES_TXTATR_FIELD) ) { // start searching from nFrom const sal_Int32 nFrom = bHasCat ? std::max(nNumStart + 1, nCatEnd) : nNumStart + 1; - nStart = SwGetExpField::GetReferenceTextPos( pTxtAttr->GetFmtFld(), *pDoc, nFrom ); + nStart = SwGetExpField::GetReferenceTextPos( pTextAttr->GetFormatField(), *pDoc, nFrom ); } else { nStart = bHasCat ? std::max(nNumEnd, nCatEnd) : nNumEnd; } @@ -371,12 +371,12 @@ void SwGetRefField::UpdateField( const SwTxtFld* pFldTxtAttr ) case REF_FOOTNOTE: case REF_ENDNOTE: // get number or numString - for( unsigned i = 0; i < pDoc->GetFtnIdxs().size(); ++i ) + for( unsigned i = 0; i < pDoc->GetFootnoteIdxs().size(); ++i ) { - SwTxtFtn* const pFtnIdx = pDoc->GetFtnIdxs()[i]; - if( nSeqNo == pFtnIdx->GetSeqRefNo() ) + SwTextFootnote* const pFootnoteIdx = pDoc->GetFootnoteIdxs()[i]; + if( nSeqNo == pFootnoteIdx->GetSeqRefNo() ) { - sTxt = pFtnIdx->GetFtn().GetViewNumStr( *pDoc ); + sText = pFootnoteIdx->GetFootnote().GetViewNumStr( *pDoc ); break; } } @@ -390,13 +390,13 @@ void SwGetRefField::UpdateField( const SwTxtFld* pFldTxtAttr ) if( nStart != nEnd ) // a section? { - sTxt = pTxtNd->GetExpandTxt( nStart, nEnd - nStart ); + sText = pTextNd->GetExpandText( nStart, nEnd - nStart ); // remove all special characters (replace them with blanks) - if( !sTxt.isEmpty() ) + if( !sText.isEmpty() ) { - sTxt = comphelper::string::remove(sTxt, 0xad); - OUStringBuffer aBuf(sTxt); + sText = comphelper::string::remove(sText, 0xad); + OUStringBuffer aBuf(sText); const sal_Int32 l = aBuf.getLength(); for (sal_Int32 i=0; i<l; ++i) { @@ -409,7 +409,7 @@ void SwGetRefField::UpdateField( const SwTxtFld* pFldTxtAttr ) aBuf[i]='-'; } } - sTxt = aBuf.makeStringAndClear(); + sText = aBuf.makeStringAndClear(); } } } @@ -418,7 +418,7 @@ void SwGetRefField::UpdateField( const SwTxtFld* pFldTxtAttr ) case REF_PAGE: case REF_PAGE_PGDESC: { - const SwTxtFrm* pFrm = static_cast<SwTxtFrm*>(pTxtNd->getLayoutFrm( pDoc->getIDocumentLayoutAccess().GetCurrentLayout(), 0, 0, false)), + const SwTextFrm* pFrm = static_cast<SwTextFrm*>(pTextNd->getLayoutFrm( pDoc->getIDocumentLayoutAccess().GetCurrentLayout(), 0, 0, false)), *pSave = pFrm; while( pFrm && !pFrm->IsInside( nNumStart ) ) pFrm = pFrm->GetFollow(); @@ -430,9 +430,9 @@ void SwGetRefField::UpdateField( const SwTxtFld* pFldTxtAttr ) if( REF_PAGE_PGDESC == GetFormat() && 0 != ( pPage = pFrm->FindPageFrm() ) && pPage->GetPageDesc() ) - sTxt = pPage->GetPageDesc()->GetNumType().GetNumStr( nPageNo ); + sText = pPage->GetPageDesc()->GetNumType().GetNumStr( nPageNo ); else - sTxt = OUString::number(nPageNo); + sText = OUString::number(nPageNo); } } break; @@ -440,14 +440,14 @@ void SwGetRefField::UpdateField( const SwTxtFld* pFldTxtAttr ) case REF_CHAPTER: { // a bit tricky: search any frame - const SwFrm* pFrm = pTxtNd->getLayoutFrm( pDoc->getIDocumentLayoutAccess().GetCurrentLayout() ); + const SwFrm* pFrm = pTextNd->getLayoutFrm( pDoc->getIDocumentLayoutAccess().GetCurrentLayout() ); if( pFrm ) { - SwChapterFieldType aFldTyp; - SwChapterField aFld( &aFldTyp, 0 ); - aFld.SetLevel( MAXLEVEL - 1 ); - aFld.ChangeExpansion( pFrm, pTxtNd, true ); - sTxt = aFld.GetNumber(); + SwChapterFieldType aFieldTyp; + SwChapterField aField( &aFieldTyp, 0 ); + aField.SetLevel( MAXLEVEL - 1 ); + aField.ChangeExpansion( pFrm, pTextNd, true ); + sText = aField.GetNumber(); } } break; @@ -455,24 +455,24 @@ void SwGetRefField::UpdateField( const SwTxtFld* pFldTxtAttr ) case REF_UPDOWN: { // #i81002# - // simplified: use parameter <pFldTxtAttr> - if( !pFldTxtAttr || !pFldTxtAttr->GetpTxtNode() ) + // simplified: use parameter <pFieldTextAttr> + if( !pFieldTextAttr || !pFieldTextAttr->GetpTextNode() ) break; LanguageTag aLanguageTag( GetLanguage()); LocaleDataWrapper aLocaleData( aLanguageTag ); // first a "short" test - in case both are in the same node - if( pFldTxtAttr->GetpTxtNode() == pTxtNd ) + if( pFieldTextAttr->GetpTextNode() == pTextNd ) { - sTxt = nNumStart < pFldTxtAttr->GetStart() + sText = nNumStart < pFieldTextAttr->GetStart() ? aLocaleData.getAboveWord() : aLocaleData.getBelowWord(); break; } - sTxt = ::IsFrameBehind( *pFldTxtAttr->GetpTxtNode(), pFldTxtAttr->GetStart(), - *pTxtNd, nNumStart ) + sText = ::IsFrameBehind( *pFieldTextAttr->GetpTextNode(), pFieldTextAttr->GetStart(), + *pTextNd, nNumStart ) ? aLocaleData.getAboveWord() : aLocaleData.getBelowWord(); } @@ -482,9 +482,9 @@ void SwGetRefField::UpdateField( const SwTxtFld* pFldTxtAttr ) case REF_NUMBER_NO_CONTEXT: case REF_NUMBER_FULL_CONTEXT: { - if ( pFldTxtAttr && pFldTxtAttr->GetpTxtNode() ) + if ( pFieldTextAttr && pFieldTextAttr->GetpTextNode() ) { - sTxt = MakeRefNumStr( pFldTxtAttr->GetTxtNode(), *pTxtNd, GetFormat() ); + sText = MakeRefNumStr( pFieldTextAttr->GetTextNode(), *pTextNd, GetFormat() ); } } break; @@ -495,14 +495,14 @@ void SwGetRefField::UpdateField( const SwTxtFld* pFldTxtAttr ) } // #i81002# -OUString SwGetRefField::MakeRefNumStr( const SwTxtNode& rTxtNodeOfField, - const SwTxtNode& rTxtNodeOfReferencedItem, +OUString SwGetRefField::MakeRefNumStr( const SwTextNode& rTextNodeOfField, + const SwTextNode& rTextNodeOfReferencedItem, const sal_uInt32 nRefNumFormat ) { - if ( rTxtNodeOfReferencedItem.HasNumber() && - rTxtNodeOfReferencedItem.IsCountedInList() ) + if ( rTextNodeOfReferencedItem.HasNumber() && + rTextNodeOfReferencedItem.IsCountedInList() ) { - OSL_ENSURE( rTxtNodeOfReferencedItem.GetNum(), + OSL_ENSURE( rTextNodeOfReferencedItem.GetNum(), "<SwGetRefField::MakeRefNumStr(..)> - referenced paragraph has number, but no <SwNodeNum> instance --> please inform OD!" ); // Determine, up to which level the superior list labels have to be @@ -513,30 +513,30 @@ OUString SwGetRefField::MakeRefNumStr( const SwTxtNode& rTxtNodeOfField, // field and the text node of the referenced item are in the same // document context. if ( nRefNumFormat == REF_NUMBER && - rTxtNodeOfField.FindFlyStartNode() - == rTxtNodeOfReferencedItem.FindFlyStartNode() && - rTxtNodeOfField.FindFootnoteStartNode() - == rTxtNodeOfReferencedItem.FindFootnoteStartNode() && - rTxtNodeOfField.FindHeaderStartNode() - == rTxtNodeOfReferencedItem.FindHeaderStartNode() && - rTxtNodeOfField.FindFooterStartNode() - == rTxtNodeOfReferencedItem.FindFooterStartNode() ) + rTextNodeOfField.FindFlyStartNode() + == rTextNodeOfReferencedItem.FindFlyStartNode() && + rTextNodeOfField.FindFootnoteStartNode() + == rTextNodeOfReferencedItem.FindFootnoteStartNode() && + rTextNodeOfField.FindHeaderStartNode() + == rTextNodeOfReferencedItem.FindHeaderStartNode() && + rTextNodeOfField.FindFooterStartNode() + == rTextNodeOfReferencedItem.FindFooterStartNode() ) { - const SwNodeNum* pNodeNumForTxtNodeOfField( 0 ); - if ( rTxtNodeOfField.HasNumber() && - rTxtNodeOfField.GetNumRule() == rTxtNodeOfReferencedItem.GetNumRule() ) + const SwNodeNum* pNodeNumForTextNodeOfField( 0 ); + if ( rTextNodeOfField.HasNumber() && + rTextNodeOfField.GetNumRule() == rTextNodeOfReferencedItem.GetNumRule() ) { - pNodeNumForTxtNodeOfField = rTxtNodeOfField.GetNum(); + pNodeNumForTextNodeOfField = rTextNodeOfField.GetNum(); } else { - pNodeNumForTxtNodeOfField = - rTxtNodeOfReferencedItem.GetNum()->GetPrecedingNodeNumOf( rTxtNodeOfField ); + pNodeNumForTextNodeOfField = + rTextNodeOfReferencedItem.GetNum()->GetPrecedingNodeNumOf( rTextNodeOfField ); } - if ( pNodeNumForTxtNodeOfField ) + if ( pNodeNumForTextNodeOfField ) { - const SwNumberTree::tNumberVector rFieldNumVec = pNodeNumForTxtNodeOfField->GetNumberVector(); - const SwNumberTree::tNumberVector rRefItemNumVec = rTxtNodeOfReferencedItem.GetNum()->GetNumberVector(); + const SwNumberTree::tNumberVector rFieldNumVec = pNodeNumForTextNodeOfField->GetNumberVector(); + const SwNumberTree::tNumberVector rRefItemNumVec = rTextNodeOfReferencedItem.GetNum()->GetNumberVector(); sal_uInt8 nLevel( 0 ); while ( nLevel < rFieldNumVec.size() && nLevel < rRefItemNumVec.size() ) { @@ -555,13 +555,13 @@ OUString SwGetRefField::MakeRefNumStr( const SwTxtNode& rTxtNodeOfField, // Determine, if superior list labels have to be included const bool bInclSuperiorNumLabels( - ( nRestrictInclToThisLevel < rTxtNodeOfReferencedItem.GetActualListLevel() && + ( nRestrictInclToThisLevel < rTextNodeOfReferencedItem.GetActualListLevel() && ( nRefNumFormat == REF_NUMBER || nRefNumFormat == REF_NUMBER_FULL_CONTEXT ) ) ); - OSL_ENSURE( rTxtNodeOfReferencedItem.GetNumRule(), + OSL_ENSURE( rTextNodeOfReferencedItem.GetNumRule(), "<SwGetRefField::MakeRefNumStr(..)> - referenced numbered paragraph has no numbering rule set --> please inform OD!" ); - return rTxtNodeOfReferencedItem.GetNumRule()->MakeRefNumString( - *(rTxtNodeOfReferencedItem.GetNum()), + return rTextNodeOfReferencedItem.GetNumRule()->MakeRefNumString( + *(rTextNodeOfReferencedItem.GetNum()), bInclSuperiorNumLabels, nRestrictInclToThisLevel ); } @@ -571,11 +571,11 @@ OUString SwGetRefField::MakeRefNumStr( const SwTxtNode& rTxtNodeOfField, SwField* SwGetRefField::Copy() const { - SwGetRefField* pFld = new SwGetRefField( static_cast<SwGetRefFieldType*>(GetTyp()), + SwGetRefField* pField = new SwGetRefField( static_cast<SwGetRefFieldType*>(GetTyp()), sSetRefName, nSubType, nSeqNo, GetFormat() ); - pFld->sTxt = sTxt; - return pFld; + pField->sText = sText; + return pField; } /// get reference name @@ -750,7 +750,7 @@ void SwGetRefField::ConvertProgrammaticToUIName() SwDoc* pDoc = static_cast<SwGetRefFieldType*>(GetTyp())->GetDoc(); const OUString rPar1 = GetPar1(); // don't convert when the name points to an existing field type - if(!pDoc->getIDocumentFieldsAccess().GetFldType(RES_SETEXPFLD, rPar1, false)) + if(!pDoc->getIDocumentFieldsAccess().GetFieldType(RES_SETEXPFLD, rPar1, false)) { sal_uInt16 nPoolId = SwStyleNameMapper::GetPoolIdFromProgName( rPar1, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL ); sal_uInt16 nResId = USHRT_MAX; @@ -789,66 +789,66 @@ void SwGetRefFieldType::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew // update to all GetReference fields if( !pNew && !pOld ) { - SwIterator<SwFmtFld,SwFieldType> aIter( *this ); - for( SwFmtFld* pFmtFld = aIter.First(); pFmtFld; pFmtFld = aIter.Next() ) + SwIterator<SwFormatField,SwFieldType> aIter( *this ); + for( SwFormatField* pFormatField = aIter.First(); pFormatField; pFormatField = aIter.Next() ) { // update only the GetRef fields //JP 3.4.2001: Task 71231 - we need the correct language - SwGetRefField* pGRef = static_cast<SwGetRefField*>(pFmtFld->GetField()); - const SwTxtFld* pTFld; + SwGetRefField* pGRef = static_cast<SwGetRefField*>(pFormatField->GetField()); + const SwTextField* pTField; if( !pGRef->GetLanguage() && - 0 != ( pTFld = pFmtFld->GetTxtFld()) && - pTFld->GetpTxtNode() ) + 0 != ( pTField = pFormatField->GetTextField()) && + pTField->GetpTextNode() ) { - pGRef->SetLanguage( pTFld->GetpTxtNode()->GetLang( - pTFld->GetStart() ) ); + pGRef->SetLanguage( pTField->GetpTextNode()->GetLang( + pTField->GetStart() ) ); } // #i81002# - pGRef->UpdateField( pFmtFld->GetTxtFld() ); + pGRef->UpdateField( pFormatField->GetTextField() ); } } // forward to text fields, they "expand" the text NotifyClients( pOld, pNew ); } -SwTxtNode* SwGetRefFieldType::FindAnchor( SwDoc* pDoc, const OUString& rRefMark, +SwTextNode* SwGetRefFieldType::FindAnchor( SwDoc* pDoc, const OUString& rRefMark, sal_uInt16 nSubType, sal_uInt16 nSeqNo, sal_Int32* pStt, sal_Int32* pEnd ) { OSL_ENSURE( pStt, "Why did no one check the StartPos?" ); - SwTxtNode* pTxtNd = 0; + SwTextNode* pTextNd = 0; switch( nSubType ) { case REF_SETREFATTR: { - const SwFmtRefMark *pRef = pDoc->GetRefMark( rRefMark ); - if( pRef && pRef->GetTxtRefMark() ) + const SwFormatRefMark *pRef = pDoc->GetRefMark( rRefMark ); + if( pRef && pRef->GetTextRefMark() ) { - pTxtNd = const_cast<SwTxtNode*>(&pRef->GetTxtRefMark()->GetTxtNode()); - *pStt = pRef->GetTxtRefMark()->GetStart(); + pTextNd = const_cast<SwTextNode*>(&pRef->GetTextRefMark()->GetTextNode()); + *pStt = pRef->GetTextRefMark()->GetStart(); if( pEnd ) - *pEnd = *pRef->GetTxtRefMark()->GetAnyEnd(); + *pEnd = *pRef->GetTextRefMark()->GetAnyEnd(); } } break; case REF_SEQUENCEFLD: { - SwFieldType* pFldType = pDoc->getIDocumentFieldsAccess().GetFldType( RES_SETEXPFLD, rRefMark, false ); - if( pFldType && pFldType->HasWriterListeners() && - nsSwGetSetExpType::GSE_SEQ & static_cast<SwSetExpFieldType*>(pFldType)->GetType() ) + SwFieldType* pFieldType = pDoc->getIDocumentFieldsAccess().GetFieldType( RES_SETEXPFLD, rRefMark, false ); + if( pFieldType && pFieldType->HasWriterListeners() && + nsSwGetSetExpType::GSE_SEQ & static_cast<SwSetExpFieldType*>(pFieldType)->GetType() ) { - SwIterator<SwFmtFld,SwFieldType> aIter( *pFldType ); - for( SwFmtFld* pFmtFld = aIter.First(); pFmtFld; pFmtFld = aIter.Next() ) + SwIterator<SwFormatField,SwFieldType> aIter( *pFieldType ); + for( SwFormatField* pFormatField = aIter.First(); pFormatField; pFormatField = aIter.Next() ) { - if( pFmtFld->GetTxtFld() && nSeqNo == - static_cast<SwSetExpField*>(pFmtFld->GetField())->GetSeqNumber() ) + if( pFormatField->GetTextField() && nSeqNo == + static_cast<SwSetExpField*>(pFormatField->GetField())->GetSeqNumber() ) { - SwTxtFld* pTxtFld = pFmtFld->GetTxtFld(); - pTxtNd = pTxtFld->GetpTxtNode(); - *pStt = pTxtFld->GetStart(); + SwTextField* pTextField = pFormatField->GetTextField(); + pTextNd = pTextField->GetpTextNode(); + *pStt = pTextField->GetStart(); if( pEnd ) *pEnd = (*pStt) + 1; break; @@ -866,7 +866,7 @@ SwTxtNode* SwGetRefFieldType::FindAnchor( SwDoc* pDoc, const OUString& rRefMark, const ::sw::mark::IMark* pBkmk = ppMark->get(); const SwPosition* pPos = &pBkmk->GetMarkStart(); - pTxtNd = pPos->nNode.GetNode().GetTxtNode(); + pTextNd = pPos->nNode.GetNode().GetTextNode(); *pStt = pPos->nContent.GetIndex(); if(pEnd) { @@ -876,9 +876,9 @@ SwTxtNode* SwGetRefFieldType::FindAnchor( SwDoc* pDoc, const OUString& rRefMark, // #i81002# if(dynamic_cast< ::sw::mark::CrossRefBookmark const *>(pBkmk)) { - OSL_ENSURE( pTxtNd, + OSL_ENSURE( pTextNd, "<SwGetRefFieldType::FindAnchor(..)> - node marked by cross-reference bookmark isn't a text node --> crash" ); - *pEnd = pTxtNd->Len(); + *pEnd = pTextNd->Len(); } } else if(pBkmk->GetOtherMarkPos().nNode == pBkmk->GetMarkPos().nNode) @@ -896,15 +896,15 @@ SwTxtNode* SwGetRefFieldType::FindAnchor( SwDoc* pDoc, const OUString& rRefMark, case REF_FOOTNOTE: case REF_ENDNOTE: { - for( auto pFtnIdx : pDoc->GetFtnIdxs() ) - if( nSeqNo == pFtnIdx->GetSeqRefNo() ) + for( auto pFootnoteIdx : pDoc->GetFootnoteIdxs() ) + if( nSeqNo == pFootnoteIdx->GetSeqRefNo() ) { - SwNodeIndex* pIdx = pFtnIdx->GetStartNode(); + SwNodeIndex* pIdx = pFootnoteIdx->GetStartNode(); if( pIdx ) { SwNodeIndex aIdx( *pIdx, 1 ); - if( 0 == ( pTxtNd = aIdx.GetNode().GetTxtNode())) - pTxtNd = static_cast<SwTxtNode*>(pDoc->GetNodes().GoNext( &aIdx )); + if( 0 == ( pTextNd = aIdx.GetNode().GetTextNode())) + pTextNd = static_cast<SwTextNode*>(pDoc->GetNodes().GoNext( &aIdx )); } *pStt = 0; if( pEnd ) @@ -915,7 +915,7 @@ SwTxtNode* SwGetRefFieldType::FindAnchor( SwDoc* pDoc, const OUString& rRefMark, break; } - return pTxtNd; + return pTextNd; } struct _RefIdsMap @@ -936,7 +936,7 @@ private: public: _RefIdsMap( const OUString& rName ) : aName( rName ), bInit( false ) {} - void Check( SwDoc& rDoc, SwDoc& rDestDoc, SwGetRefField& rFld, bool bField ); + void Check( SwDoc& rDoc, SwDoc& rDestDoc, SwGetRefField& rField, bool bField ); OUString GetName() { return aName; } }; @@ -948,17 +948,17 @@ typedef boost::ptr_vector<_RefIdsMap> _RefIdsMaps; /// @param[in,out] rIds The list of IDs found in the document. void _RefIdsMap::GetFieldIdsFromDoc( SwDoc& rDoc, std::set<sal_uInt16> &rIds) { - SwFieldType *const pType = rDoc.getIDocumentFieldsAccess().GetFldType(RES_SETEXPFLD, aName, false); + SwFieldType *const pType = rDoc.getIDocumentFieldsAccess().GetFieldType(RES_SETEXPFLD, aName, false); if (!pType) return; - SwIterator<SwFmtFld,SwFieldType> aIter( *pType ); - for (SwFmtFld const* pF = aIter.First(); pF; pF = aIter.Next()) + SwIterator<SwFormatField,SwFieldType> aIter( *pType ); + for (SwFormatField const* pF = aIter.First(); pF; pF = aIter.Next()) { - if (pF->GetTxtFld()) + if (pF->GetTextField()) { - SwTxtNode const*const pNd = pF->GetTxtFld()->GetpTxtNode(); + SwTextNode const*const pNd = pF->GetTextField()->GetpTextNode(); if (pNd && pNd->GetNodes().IsDocNodes()) { rIds.insert(static_cast<SwSetExpField const*>(pF->GetField()) @@ -973,8 +973,8 @@ void _RefIdsMap::GetFieldIdsFromDoc( SwDoc& rDoc, std::set<sal_uInt16> &rIds) /// @param[in,out] rIds The list of IDs found in the document. void _RefIdsMap::GetNoteIdsFromDoc( SwDoc& rDoc, std::set<sal_uInt16> &rIds) { - for( auto n = rDoc.GetFtnIdxs().size(); n; ) - rIds.insert( rDoc.GetFtnIdxs()[ --n ]->GetSeqRefNo() ); + for( auto n = rDoc.GetFootnoteIdxs().size(); n; ) + rIds.insert( rDoc.GetFootnoteIdxs()[ --n ]->GetSeqRefNo() ); } /// Initialise the aIds and aDestIds collections from the source documents. @@ -996,12 +996,12 @@ void _RefIdsMap::Init( SwDoc& rDoc, SwDoc& rDestDoc, bool bField ) AddId( GetFirstUnusedId(aIds), *pIt ); // Change the Sequence number of all SetExp fields in the source document - SwFieldType* pType = rDoc.getIDocumentFieldsAccess().GetFldType( RES_SETEXPFLD, aName, false ); + SwFieldType* pType = rDoc.getIDocumentFieldsAccess().GetFieldType( RES_SETEXPFLD, aName, false ); if( pType ) { - SwIterator<SwFmtFld,SwFieldType> aIter( *pType ); - for( SwFmtFld* pF = aIter.First(); pF; pF = aIter.Next() ) - if( pF->GetTxtFld() ) + SwIterator<SwFormatField,SwFieldType> aIter( *pType ); + for( SwFormatField* pF = aIter.First(); pF; pF = aIter.Next() ) + if( pF->GetTextField() ) { SwSetExpField *const pSetExp( static_cast<SwSetExpField *>(pF->GetField())); @@ -1019,10 +1019,10 @@ void _RefIdsMap::Init( SwDoc& rDoc, SwDoc& rDestDoc, bool bField ) AddId( GetFirstUnusedId(aIds), *pIt ); // Change the footnotes/endnotes in the source doc to the new ID - for ( const auto pFtnIdx : rDoc.GetFtnIdxs() ) + for ( const auto pFootnoteIdx : rDoc.GetFootnoteIdxs() ) { - sal_uInt16 const n = pFtnIdx->GetSeqRefNo(); - pFtnIdx->SetSeqNo(sequencedIds[n]); + sal_uInt16 const n = pFootnoteIdx->GetSeqRefNo(); + pFootnoteIdx->SetSeqNo(sequencedIds[n]); } } bInit = true; @@ -1056,12 +1056,12 @@ void _RefIdsMap::AddId( sal_uInt16 id, sal_uInt16 seqNum ) sequencedIds[ seqNum ] = id; } -void _RefIdsMap::Check( SwDoc& rDoc, SwDoc& rDestDoc, SwGetRefField& rFld, +void _RefIdsMap::Check( SwDoc& rDoc, SwDoc& rDestDoc, SwGetRefField& rField, bool bField ) { Init( rDoc, rDestDoc, bField); - sal_uInt16 const nSeqNo = rFld.GetSeqNo(); + sal_uInt16 const nSeqNo = rField.GetSeqNo(); // check if it needs to be remapped // if sequencedIds doesn't contain the number, it means there is no @@ -1070,7 +1070,7 @@ void _RefIdsMap::Check( SwDoc& rDoc, SwDoc& rDestDoc, SwGetRefField& rFld, // (and if it is not the same document, there's no "correct" result anyway) if (sequencedIds.count(nSeqNo)) { - rFld.SetSeqNo( sequencedIds[nSeqNo] ); + rField.SetSeqNo( sequencedIds[nSeqNo] ); } } @@ -1089,45 +1089,45 @@ void SwGetRefFieldType::MergeWithOtherDoc( SwDoc& rDestDoc ) { // when copying _to_ clipboard, expectation is that no fields exist // so no re-mapping is required to avoid collisions - assert(!rDestDoc.getIDocumentFieldsAccess().GetSysFldType(RES_GETREFFLD)->HasWriterListeners()); + assert(!rDestDoc.getIDocumentFieldsAccess().GetSysFieldType(RES_GETREFFLD)->HasWriterListeners()); return; // don't modify the fields in the source doc } // then there are RefFields in the DescDox - so all RefFields in the SourceDoc // need to be converted to have unique IDs for both documents _RefIdsMap aFntMap( aEmptyOUStr ); - _RefIdsMaps aFldMap; + _RefIdsMaps aFieldMap; - SwIterator<SwFmtFld,SwFieldType> aIter( *this ); - for( SwFmtFld* pFld = aIter.First(); pFld; pFld = aIter.Next() ) + SwIterator<SwFormatField,SwFieldType> aIter( *this ); + for( SwFormatField* pField = aIter.First(); pField; pField = aIter.Next() ) { - SwGetRefField& rRefFld = *static_cast<SwGetRefField*>(pFld->GetField()); - switch( rRefFld.GetSubType() ) + SwGetRefField& rRefField = *static_cast<SwGetRefField*>(pField->GetField()); + switch( rRefField.GetSubType() ) { case REF_SEQUENCEFLD: { _RefIdsMap* pMap = 0; - for( auto n = aFldMap.size(); n; ) + for( auto n = aFieldMap.size(); n; ) { - if( aFldMap[ --n ].GetName()==rRefFld.GetSetRefName() ) + if( aFieldMap[ --n ].GetName()==rRefField.GetSetRefName() ) { - pMap = &aFldMap[ n ]; + pMap = &aFieldMap[ n ]; break; } } if( !pMap ) { - pMap = new _RefIdsMap( rRefFld.GetSetRefName() ); - aFldMap.push_back( pMap ); + pMap = new _RefIdsMap( rRefField.GetSetRefName() ); + aFieldMap.push_back( pMap ); } - pMap->Check( *pDoc, rDestDoc, rRefFld, true ); + pMap->Check( *pDoc, rDestDoc, rRefField, true ); } break; case REF_FOOTNOTE: case REF_ENDNOTE: - aFntMap.Check( *pDoc, rDestDoc, rRefFld, false ); + aFntMap.Check( *pDoc, rDestDoc, rRefField, false ); break; } } diff --git a/sw/source/core/fields/tblcalc.cxx b/sw/source/core/fields/tblcalc.cxx index b993fd84eabc..1aa3992539fd 100644 --- a/sw/source/core/fields/tblcalc.cxx +++ b/sw/source/core/fields/tblcalc.cxx @@ -30,38 +30,38 @@ using namespace ::com::sun::star; -SwTblFieldType::SwTblFieldType(SwDoc* pDocPtr) +SwTableFieldType::SwTableFieldType(SwDoc* pDocPtr) : SwValueFieldType( pDocPtr, RES_TABLEFLD ) {} -SwFieldType* SwTblFieldType::Copy() const +SwFieldType* SwTableFieldType::Copy() const { - return new SwTblFieldType(GetDoc()); + return new SwTableFieldType(GetDoc()); } -void SwTblField::CalcField( SwTblCalcPara& rCalcPara ) +void SwTableField::CalcField( SwTableCalcPara& rCalcPara ) { if( rCalcPara.rCalc.IsCalcError() ) // stop if there is already an error set return; // create pointers from box name - BoxNmToPtr( rCalcPara.pTbl ); - OUString sFml( MakeFormula( rCalcPara )); - SetValue( rCalcPara.rCalc.Calculate( sFml ).GetDouble() ); + BoxNmToPtr( rCalcPara.pTable ); + OUString sFormula( MakeFormula( rCalcPara )); + SetValue( rCalcPara.rCalc.Calculate( sFormula ).GetDouble() ); ChgValid( !rCalcPara.IsStackOverflow() ); // is the value again valid? } -SwTblField::SwTblField( SwTblFieldType* pInitType, const OUString& rFormel, - sal_uInt16 nType, sal_uLong nFmt ) - : SwValueField( pInitType, nFmt ), SwTableFormula( rFormel ), +SwTableField::SwTableField( SwTableFieldType* pInitType, const OUString& rFormel, + sal_uInt16 nType, sal_uLong nFormat ) + : SwValueField( pInitType, nFormat ), SwTableFormula( rFormel ), nSubType(nType) { sExpand = "0"; } -SwField* SwTblField::Copy() const +SwField* SwTableField::Copy() const { - SwTblField* pTmp = new SwTblField( static_cast<SwTblFieldType*>(GetTyp()), + SwTableField* pTmp = new SwTableField( static_cast<SwTableFieldType*>(GetTyp()), SwTableFormula::GetFormula(), nSubType, GetFormat() ); pTmp->sExpand = sExpand; pTmp->SwValueField::SetValue(GetValue()); @@ -70,33 +70,33 @@ SwField* SwTblField::Copy() const return pTmp; } -OUString SwTblField::GetFieldName() const +OUString SwTableField::GetFieldName() const { - return GetTyp()->GetName() + " " + const_cast<SwTblField *>(this)->GetCommand(); + return GetTyp()->GetName() + " " + const_cast<SwTableField *>(this)->GetCommand(); } /// search TextNode containing this field -const SwNode* SwTblField::GetNodeOfFormula() const +const SwNode* SwTableField::GetNodeOfFormula() const { if( !GetTyp()->HasWriterListeners() ) return 0; - SwIterator<SwFmtFld,SwFieldType> aIter( *GetTyp() ); - for( SwFmtFld* pFmtFld = aIter.First(); pFmtFld; pFmtFld = aIter.Next() ) - if( this == pFmtFld->GetField() ) - return &pFmtFld->GetTxtFld()->GetTxtNode(); + SwIterator<SwFormatField,SwFieldType> aIter( *GetTyp() ); + for( SwFormatField* pFormatField = aIter.First(); pFormatField; pFormatField = aIter.Next() ) + if( this == pFormatField->GetField() ) + return &pFormatField->GetTextField()->GetTextNode(); return 0; } -OUString SwTblField::GetCommand() +OUString SwTableField::GetCommand() { if (EXTRNL_NAME != GetNameType()) { SwNode const*const pNd = GetNodeOfFormula(); - SwTableNode const*const pTblNd = (pNd) ? pNd->FindTableNode() : 0; - if (pTblNd) + SwTableNode const*const pTableNd = (pNd) ? pNd->FindTableNode() : 0; + if (pTableNd) { - PtrToBoxNm( &pTblNd->GetTable() ); + PtrToBoxNm( &pTableNd->GetTable() ); } } return (EXTRNL_NAME == GetNameType()) @@ -104,11 +104,11 @@ OUString SwTblField::GetCommand() : OUString(); } -OUString SwTblField::Expand() const +OUString SwTableField::Expand() const { if (nSubType & nsSwExtendedSubType::SUB_CMD) { - return const_cast<SwTblField *>(this)->GetCommand(); + return const_cast<SwTableField *>(this)->GetCommand(); } if(nSubType & nsSwGetSetExpType::GSE_STRING) @@ -120,33 +120,33 @@ OUString SwTblField::Expand() const return sExpand; } -sal_uInt16 SwTblField::GetSubType() const +sal_uInt16 SwTableField::GetSubType() const { return nSubType; } -void SwTblField::SetSubType(sal_uInt16 nType) +void SwTableField::SetSubType(sal_uInt16 nType) { nSubType = nType; } -void SwTblField::SetValue( const double& rVal ) +void SwTableField::SetValue( const double& rVal ) { SwValueField::SetValue(rVal); sExpand = static_cast<SwValueFieldType*>(GetTyp())->ExpandValue(rVal, GetFormat(), GetLanguage()); } -OUString SwTblField::GetPar2() const +OUString SwTableField::GetPar2() const { return SwTableFormula::GetFormula(); } -void SwTblField::SetPar2(const OUString& rStr) +void SwTableField::SetPar2(const OUString& rStr) { SetFormula( rStr ); } -bool SwTblField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const +bool SwTableField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const { bool bRet = true; switch ( nWhichId ) @@ -154,7 +154,7 @@ bool SwTblField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const case FIELD_PROP_PAR2: { sal_uInt16 nOldSubType = nSubType; - SwTblField* pThis = const_cast<SwTblField*>(this); + SwTableField* pThis = const_cast<SwTableField*>(this); pThis->nSubType |= nsSwExtendedSubType::SUB_CMD; rAny <<= Expand(); pThis->nSubType = nOldSubType; @@ -175,7 +175,7 @@ bool SwTblField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const return bRet; } -bool SwTblField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId ) +bool SwTableField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId ) { bool bRet = true; switch ( nWhichId ) diff --git a/sw/source/core/fields/usrfld.cxx b/sw/source/core/fields/usrfld.cxx index b8aad8a1b1f0..467d0e90fe56 100644 --- a/sw/source/core/fields/usrfld.cxx +++ b/sw/source/core/fields/usrfld.cxx @@ -37,8 +37,8 @@ using namespace ::com::sun::star; // Userfields -SwUserField::SwUserField(SwUserFieldType* pTyp, sal_uInt16 nSub, sal_uInt32 nFmt) - : SwValueField(pTyp, nFmt), +SwUserField::SwUserField(SwUserFieldType* pTyp, sal_uInt16 nSub, sal_uInt32 nFormat) + : SwValueField(pTyp, nFormat), nSubType(nSub) { } @@ -163,12 +163,12 @@ SwUserFieldType::SwUserFieldType( SwDoc* pDocPtr, const OUString& aNam ) EnableFormat(false); // Do not use a Numberformatter } -OUString SwUserFieldType::Expand(sal_uInt32 nFmt, sal_uInt16 nSubType, sal_uInt16 nLng) +OUString SwUserFieldType::Expand(sal_uInt32 nFormat, sal_uInt16 nSubType, sal_uInt16 nLng) { if((nType & nsSwGetSetExpType::GSE_EXPR) && !(nSubType & nsSwExtendedSubType::SUB_CMD)) { EnableFormat(true); - return ExpandValue(nValue, nFmt, nLng); + return ExpandValue(nValue, nFormat, nLng); } EnableFormat(false); // Do not use a Numberformatter @@ -203,7 +203,7 @@ void SwUserFieldType::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) if ( !IsModifyLocked() ) { LockModify(); - GetDoc()->getIDocumentFieldsAccess().GetSysFldType( RES_INPUTFLD )->UpdateFlds(); + GetDoc()->getIDocumentFieldsAccess().GetSysFieldType( RES_INPUTFLD )->UpdateFields(); UnlockModify(); } } @@ -229,38 +229,38 @@ double SwUserFieldType::GetValue( SwCalc& rCalc ) return nValue; } -OUString SwUserFieldType::GetContent( sal_uInt32 nFmt ) +OUString SwUserFieldType::GetContent( sal_uInt32 nFormat ) { - if (nFmt && nFmt != SAL_MAX_UINT32) + if (nFormat && nFormat != SAL_MAX_UINT32) { OUString sFormattedValue; Color* pCol = 0; SvNumberFormatter* pFormatter = GetDoc()->GetNumberFormatter(); - pFormatter->GetOutputString(GetValue(), nFmt, sFormattedValue, &pCol); + pFormatter->GetOutputString(GetValue(), nFormat, sFormattedValue, &pCol); return sFormattedValue; } return aContent; } -void SwUserFieldType::SetContent( const OUString& rStr, sal_uInt32 nFmt ) +void SwUserFieldType::SetContent( const OUString& rStr, sal_uInt32 nFormat ) { if( aContent != rStr ) { aContent = rStr; - if (nFmt && nFmt != SAL_MAX_UINT32) + if (nFormat && nFormat != SAL_MAX_UINT32) { double fValue; SvNumberFormatter* pFormatter = GetDoc()->GetNumberFormatter(); - if (pFormatter->IsNumberFormat(rStr, nFmt, fValue)) + if (pFormatter->IsNumberFormat(rStr, nFormat, fValue)) { SetValue(fValue); - aContent = DoubleToString(fValue, nFmt); + aContent = DoubleToString(fValue, nFormat); } } |