diff options
Diffstat (limited to 'sw/source/core/txtnode/thints.cxx')
-rw-r--r-- | sw/source/core/txtnode/thints.cxx | 824 |
1 files changed, 412 insertions, 412 deletions
diff --git a/sw/source/core/txtnode/thints.cxx b/sw/source/core/txtnode/thints.cxx index 428256799a0c..452ae53001e9 100644 --- a/sw/source/core/txtnode/thints.cxx +++ b/sw/source/core/txtnode/thints.cxx @@ -96,26 +96,26 @@ SwpHints::SwpHints() { } -struct TxtAttrDeleter +struct TextAttrDeleter { SwAttrPool & m_rPool; - TxtAttrDeleter( SwDoc & rDoc ) : m_rPool( rDoc.GetAttrPool() ) { } - void operator() (SwTxtAttr * const pAttr) + TextAttrDeleter( SwDoc & rDoc ) : m_rPool( rDoc.GetAttrPool() ) { } + void operator() (SwTextAttr * const pAttr) { if (RES_TXTATR_META == pAttr->Which() || RES_TXTATR_METAFIELD == pAttr->Which()) { - static_txtattr_cast<SwTxtMeta *>(pAttr)->ChgTxtNode(0); // prevents ASSERT + static_txtattr_cast<SwTextMeta *>(pAttr)->ChgTextNode(0); // prevents ASSERT } - SwTxtAttr::Destroy( pAttr, m_rPool ); + SwTextAttr::Destroy( pAttr, m_rPool ); } }; -struct TxtAttrContains +struct TextAttrContains { sal_Int32 m_nPos; - TxtAttrContains( const sal_Int32 nPos ) : m_nPos( nPos ) { } - bool operator() (SwTxtAttrEnd * const pAttr) + TextAttrContains( const sal_Int32 nPos ) : m_nPos( nPos ) { } + bool operator() (SwTextAttrEnd * const pAttr) { return (pAttr->GetStart() < m_nPos) && (m_nPos < *pAttr->End()); } @@ -208,54 +208,54 @@ splitPolicy(const sal_uInt16 nWhichNew, const sal_uInt16 nWhichOther) } } -void SwTxtINetFmt::InitINetFmt(SwTxtNode & rNode) +void SwTextINetFormat::InitINetFormat(SwTextNode & rNode) { - ChgTxtNode(&rNode); - SwCharFmt * const pFmt( - rNode.GetDoc()->getIDocumentStylePoolAccess().GetCharFmtFromPool(RES_POOLCHR_INET_NORMAL) ); - pFmt->Add( this ); + ChgTextNode(&rNode); + SwCharFormat * const pFormat( + rNode.GetDoc()->getIDocumentStylePoolAccess().GetCharFormatFromPool(RES_POOLCHR_INET_NORMAL) ); + pFormat->Add( this ); } -void SwTxtRuby::InitRuby(SwTxtNode & rNode) +void SwTextRuby::InitRuby(SwTextNode & rNode) { - ChgTxtNode(&rNode); - SwCharFmt * const pFmt( - rNode.GetDoc()->getIDocumentStylePoolAccess().GetCharFmtFromPool(RES_POOLCHR_RUBYTEXT) ); - pFmt->Add( this ); + ChgTextNode(&rNode); + SwCharFormat * const pFormat( + rNode.GetDoc()->getIDocumentStylePoolAccess().GetCharFormatFromPool(RES_POOLCHR_RUBYTEXT) ); + pFormat->Add( this ); } /** Create a new nesting text hint. */ -static SwTxtAttrNesting * -MakeTxtAttrNesting(SwTxtNode & rNode, SwTxtAttrNesting & rNesting, +static SwTextAttrNesting * +MakeTextAttrNesting(SwTextNode & rNode, SwTextAttrNesting & rNesting, const sal_Int32 nStart, const sal_Int32 nEnd) { - SwTxtAttr * const pNew( MakeTxtAttr( + SwTextAttr * const pNew( MakeTextAttr( *rNode.GetDoc(), rNesting.GetAttr(), nStart, nEnd ) ); switch (pNew->Which()) { case RES_TXTATR_INETFMT: { - static_txtattr_cast<SwTxtINetFmt*>(pNew)->InitINetFmt(rNode); + static_txtattr_cast<SwTextINetFormat*>(pNew)->InitINetFormat(rNode); break; } case RES_TXTATR_CJK_RUBY: { - static_txtattr_cast<SwTxtRuby*>(pNew)->InitRuby(rNode); + static_txtattr_cast<SwTextRuby*>(pNew)->InitRuby(rNode); break; } default: - assert(!"MakeTxtAttrNesting: what the hell is that?"); + assert(!"MakeTextAttrNesting: what the hell is that?"); break; } - return static_txtattr_cast<SwTxtAttrNesting*>(pNew); + return static_txtattr_cast<SwTextAttrNesting*>(pNew); } -typedef ::std::vector<SwTxtAttrNesting *> NestList_t; +typedef ::std::vector<SwTextAttrNesting *> NestList_t; static void -lcl_DoSplitNew(NestList_t & rSplits, SwTxtNode & rNode, +lcl_DoSplitNew(NestList_t & rSplits, SwTextNode & rNode, const sal_Int32 nNewStart, const sal_Int32 nOtherStart, const sal_Int32 nOtherEnd, bool bOtherDummy) { @@ -264,12 +264,12 @@ lcl_DoSplitNew(NestList_t & rSplits, SwTxtNode & rNode, // first find the portion that is split (not necessarily the last one!) NestList_t::iterator const iter( ::std::find_if( rSplits.begin(), rSplits.end(), - TxtAttrContains(nSplitPos) ) ); + TextAttrContains(nSplitPos) ) ); if (iter != rSplits.end()) // already split here? { const sal_Int32 nStartPos( // skip other's dummy character! (bSplitAtStart && bOtherDummy) ? nSplitPos + 1 : nSplitPos ); - SwTxtAttrNesting * const pNew( MakeTxtAttrNesting( + SwTextAttrNesting * const pNew( MakeTextAttrNesting( rNode, **iter, nStartPos, *(*iter)->GetEnd() ) ); *(*iter)->GetEnd() = nSplitPos; rSplits.insert(iter + 1, pNew); @@ -280,7 +280,7 @@ lcl_DoSplitNew(NestList_t & rSplits, SwTxtNode & rNode, Insert nesting hint into the hints array. Also calls NoteInHistory. @param rNewHint the hint to be inserted (must not overlap existing!) */ -void SwpHints::InsertNesting(SwTxtAttrNesting & rNewHint) +void SwpHints::InsertNesting(SwTextAttrNesting & rNewHint) { SwpHintsArray::Insert(& rNewHint); NoteInHistory( & rNewHint, true ); @@ -354,7 +354,7 @@ splitting of exising hints that is necessary for backward compatibility. @returns true iff hint was successfully inserted */ bool -SwpHints::TryInsertNesting( SwTxtNode & rNode, SwTxtAttrNesting & rNewHint ) +SwpHints::TryInsertNesting( SwTextNode & rNode, SwTextAttrNesting & rNewHint ) { // INVARIANT: the nestable hints in the array are properly nested const sal_uInt16 nNewWhich( rNewHint.Which() ); @@ -377,7 +377,7 @@ SwpHints::TryInsertNesting( SwTxtNode & rNode, SwTxtAttrNesting & rNewHint ) // pass 1: split the inserted hint into fragments if necessary for ( size_t i = 0; i < GetEndCount(); ++i ) { - SwTxtAttr * const pOther = GetEnd(i); + SwTextAttr * const pOther = GetEnd(i); if (pOther->IsNesting()) { @@ -391,7 +391,7 @@ SwpHints::TryInsertNesting( SwTxtNode & rNode, SwTxtAttrNesting & rNewHint ) case FAIL: SAL_INFO("sw.core", "cannot insert hint: overlap"); ::std::for_each(SplitNew.begin(), SplitNew.end(), - TxtAttrDeleter(*rNode.GetDoc())); + TextAttrDeleter(*rNode.GetDoc())); return false; case SPLIT_NEW: lcl_DoSplitNew(SplitNew, rNode, nNewStart, @@ -399,7 +399,7 @@ SwpHints::TryInsertNesting( SwTxtNode & rNode, SwTxtAttrNesting & rNewHint ) break; case SPLIT_OTHER: OverlappingExisting.push_back( - static_txtattr_cast<SwTxtAttrNesting*>(pOther)); + static_txtattr_cast<SwTextAttrNesting*>(pOther)); break; default: assert(!"bad code monkey"); @@ -412,7 +412,7 @@ SwpHints::TryInsertNesting( SwTxtNode & rNode, SwTxtAttrNesting & rNewHint ) { // ruby and hyperlink: if there is nesting, _overwrite_ OverwrittenExisting.push_back( - static_txtattr_cast<SwTxtAttrNesting*>(pOther)); + static_txtattr_cast<SwTextAttrNesting*>(pOther)); } else if ((nNewStart == nOtherStart) && pOther->HasDummyChar()) { @@ -488,8 +488,8 @@ SwpHints::TryInsertNesting( SwTxtNode & rNode, SwTxtAttrNesting & rNewHint ) SAL_INFO("sw.core", "hints array full :-("); return false; } - SwTxtAttrNesting * const pOtherLeft( - MakeTxtAttrNesting( rNode, **itOther, + SwTextAttrNesting * const pOtherLeft( + MakeTextAttrNesting( rNode, **itOther, nOtherStart, nSplitNewEnd ) ); InsertNesting( *pOtherLeft ); } @@ -507,8 +507,8 @@ SwpHints::TryInsertNesting( SwTxtNode & rNode, SwTxtAttrNesting & rNewHint ) SAL_INFO("sw.core", "hints array full :-("); return false; } - SwTxtAttrNesting * const pOtherRight( - MakeTxtAttrNesting( rNode, **itOther, + SwTextAttrNesting * const pOtherRight( + MakeTextAttrNesting( rNode, **itOther, nSplitNewStart, nOtherEnd ) ); InsertNesting( *pOtherRight ); } @@ -558,8 +558,8 @@ SwpHints::TryInsertNesting( SwTxtNode & rNode, SwTxtAttrNesting & rNewHint ) Delete( *itOther ); // this also does NoteInHistory! if (nNewEnd < nOtherEnd) { - SwTxtAttrNesting * const pOtherRight( - MakeTxtAttrNesting( + SwTextAttrNesting * const pOtherRight( + MakeTextAttrNesting( rNode, **itOther, nNewEnd, nOtherEnd ) ); bool const bSuccess( TryInsertNesting(rNode, *pOtherRight) ); SAL_WARN_IF(!bSuccess, "sw.core", "recursive call 1 failed?"); @@ -588,7 +588,7 @@ SwpHints::TryInsertNesting( SwTxtNode & rNode, SwTxtAttrNesting & rNewHint ) // RES_TXTATR_CHARFMT. The new attribute itself will // split any existing RES_TXTATR_AUTOFMT or RES_TXTATR_CHARFMT. -void SwpHints::BuildPortions( SwTxtNode& rNode, SwTxtAttr& rNewHint, +void SwpHints::BuildPortions( SwTextNode& rNode, SwTextAttr& rNewHint, const SetAttrMode nMode ) { const sal_uInt16 nWhich = rNewHint.Which(); @@ -597,8 +597,8 @@ void SwpHints::BuildPortions( SwTxtNode& rNode, SwTxtAttr& rNewHint, const sal_Int32 nThisEnd = *rNewHint.GetEnd(); const bool bNoLengthAttribute = nThisStart == nThisEnd; - std::vector<SwTxtAttr*> aInsDelHints; - std::vector<SwTxtAttr*>::iterator aIter; + std::vector<SwTextAttr*> aInsDelHints; + std::vector<SwTextAttr*>::iterator aIter; assert( RES_TXTATR_CHARFMT == rNewHint.Which() || RES_TXTATR_AUTOFMT == rNewHint.Which() ); @@ -610,7 +610,7 @@ void SwpHints::BuildPortions( SwTxtNode& rNode, SwTxtAttr& rNewHint, { for ( size_t i = 0; i < Count(); ++i ) { - SwTxtAttr* pOther = GetTextHint(i); + SwTextAttr* pOther = GetTextHint(i); if ( RES_TXTATR_CHARFMT != pOther->Which() && RES_TXTATR_AUTOFMT != pOther->Which() ) @@ -623,12 +623,12 @@ void SwpHints::BuildPortions( SwTxtNode& rNode, SwTxtAttr& rNewHint, // Split pOther if necessary: if ( nOtherStart < nThisStart && nThisStart < nOtherEnd ) { - SwTxtAttr* pNewAttr = MakeTxtAttr( *rNode.GetDoc(), + SwTextAttr* pNewAttr = MakeTextAttr( *rNode.GetDoc(), pOther->GetAttr(), nOtherStart, nThisStart ); if ( RES_TXTATR_CHARFMT == pOther->Which() ) { - static_txtattr_cast<SwTxtCharFmt*>(pNewAttr)->SetSortNumber( - static_txtattr_cast<SwTxtCharFmt*>(pOther)->GetSortNumber() ); + static_txtattr_cast<SwTextCharFormat*>(pNewAttr)->SetSortNumber( + static_txtattr_cast<SwTextCharFormat*>(pOther)->GetSortNumber() ); } aInsDelHints.push_back( pNewAttr ); @@ -643,12 +643,12 @@ void SwpHints::BuildPortions( SwTxtNode& rNode, SwTxtAttr& rNewHint, // Split pOther if necessary: if ( nOtherStart < nThisEnd && nThisEnd < nOtherEnd ) { - SwTxtAttr* pNewAttr = MakeTxtAttr( *rNode.GetDoc(), + SwTextAttr* pNewAttr = MakeTextAttr( *rNode.GetDoc(), pOther->GetAttr(), nOtherStart, nThisEnd ); if ( RES_TXTATR_CHARFMT == pOther->Which() ) { - static_txtattr_cast<SwTxtCharFmt*>(pNewAttr)->SetSortNumber( - static_txtattr_cast<SwTxtCharFmt*>(pOther)->GetSortNumber()); + static_txtattr_cast<SwTextCharFormat*>(pNewAttr)->SetSortNumber( + static_txtattr_cast<SwTextCharFormat*>(pOther)->GetSortNumber()); } aInsDelHints.push_back( pNewAttr ); @@ -681,7 +681,7 @@ void SwpHints::BuildPortions( SwTxtNode& rNode, SwTxtAttr& rNewHint, { for ( size_t i = 0; i < Count(); ++i ) { - const SwTxtAttr* pOther = GetTextHint(i); + const SwTextAttr* pOther = GetTextHint(i); if ( RES_TXTATR_CHARFMT != pOther->Which() && RES_TXTATR_AUTOFMT != pOther->Which() ) @@ -713,7 +713,7 @@ void SwpHints::BuildPortions( SwTxtNode& rNode, SwTxtAttr& rNewHint, // Get all hints that are in [nPorStart, nPorEnd[: for ( size_t i = 0; i < Count(); ++i ) { - SwTxtAttr *pOther = GetTextHint(i); + SwTextAttr *pOther = GetTextHint(i); if ( RES_TXTATR_CHARFMT != pOther->Which() && RES_TXTATR_AUTOFMT != pOther->Which() ) @@ -731,7 +731,7 @@ void SwpHints::BuildPortions( SwTxtNode& rNode, SwTxtAttr& rNewHint, } } - SwTxtAttr* pNewAttr = 0; + SwTextAttr* pNewAttr = 0; if ( RES_TXTATR_CHARFMT == nWhich ) { // pNewHint can be inserted after calculating the sort value. @@ -744,16 +744,16 @@ void SwpHints::BuildPortions( SwTxtNode& rNode, SwTxtAttr& rNewHint, if ( RES_TXTATR_CHARFMT == (*aIter)->Which() ) { // #i74589# - const SwFmtCharFmt& rOtherCharFmt = (*aIter)->GetCharFmt(); - const SwFmtCharFmt& rThisCharFmt = rNewHint.GetCharFmt(); - const bool bSameCharFmt = rOtherCharFmt.GetCharFmt() == rThisCharFmt.GetCharFmt(); + const SwFormatCharFormat& rOtherCharFormat = (*aIter)->GetCharFormat(); + const SwFormatCharFormat& rThisCharFormat = rNewHint.GetCharFormat(); + const bool bSameCharFormat = rOtherCharFormat.GetCharFormat() == rThisCharFormat.GetCharFormat(); // #i90311# // Do not remove existing character format hint during XML import if ( !rNode.GetDoc()->IsInXMLImport() && ( !( SetAttrMode::DONTREPLACE & nMode ) || bNoLengthAttribute || - bSameCharFmt ) ) + bSameCharFormat ) ) { // Remove old hint Delete( *aIter ); @@ -767,18 +767,18 @@ void SwpHints::BuildPortions( SwTxtNode& rNode, SwTxtAttr& rNewHint, // remove all attributes from auto styles, which are explicitly set in // the new character format: OSL_ENSURE( RES_TXTATR_AUTOFMT == (*aIter)->Which(), "AUTOSTYLES - Misc trouble" ); - SwTxtAttr* pOther = *aIter; - std::shared_ptr<SfxItemSet> pOldStyle = static_cast<const SwFmtAutoFmt&>(pOther->GetAttr()).GetStyleHandle(); + SwTextAttr* pOther = *aIter; + std::shared_ptr<SfxItemSet> pOldStyle = static_cast<const SwFormatAutoFormat&>(pOther->GetAttr()).GetStyleHandle(); // For each attribute in the automatic style check if it // is also set the new character style: SfxItemSet aNewSet( *pOldStyle->GetPool(), - aCharAutoFmtSetRange); + aCharAutoFormatSetRange); SfxItemIter aItemIter( *pOldStyle ); const SfxPoolItem* pItem = aItemIter.GetCurItem(); while( true ) { - if ( !CharFmt::IsItemIncluded( pItem->Which(), &rNewHint ) ) + if ( !CharFormat::IsItemIncluded( pItem->Which(), &rNewHint ) ) { aNewSet.Put( *pItem ); } @@ -796,7 +796,7 @@ void SwpHints::BuildPortions( SwTxtNode& rNode, SwTxtAttr& rNewHint, // Create new AutoStyle if ( aNewSet.Count() ) { - pNewAttr = MakeTxtAttr( *rNode.GetDoc(), + pNewAttr = MakeTextAttr( *rNode.GetDoc(), aNewSet, nPorStart, nPorEnd ); SwpHintsArray::Insert( pNewAttr ); NoteInHistory( pNewAttr, true ); @@ -816,30 +816,30 @@ void SwpHints::BuildPortions( SwTxtNode& rNode, SwTxtAttr& rNewHint, } else { - pNewAttr = MakeTxtAttr( *rNode.GetDoc(), rNewHint.GetAttr(), + pNewAttr = MakeTextAttr( *rNode.GetDoc(), rNewHint.GetAttr(), nPorStart, nPorEnd ); - static_txtattr_cast<SwTxtCharFmt*>(pNewAttr)->SetSortNumber(nCharStyleCount); + static_txtattr_cast<SwTextCharFormat*>(pNewAttr)->SetSortNumber(nCharStyleCount); } } else { // Find the current autostyle. Mix attributes if necessary. - SwTxtAttr* pCurrentAutoStyle = 0; - SwTxtAttr* pCurrentCharFmt = 0; + SwTextAttr* pCurrentAutoStyle = 0; + SwTextAttr* pCurrentCharFormat = 0; aIter = aInsDelHints.begin(); while ( aIter != aInsDelHints.end() ) { if ( RES_TXTATR_AUTOFMT == (*aIter)->Which() ) pCurrentAutoStyle = *aIter; else if ( RES_TXTATR_CHARFMT == (*aIter)->Which() ) - pCurrentCharFmt = *aIter; + pCurrentCharFormat = *aIter; ++aIter; } - std::shared_ptr<SfxItemSet> pNewStyle = static_cast<const SwFmtAutoFmt&>(rNewHint.GetAttr()).GetStyleHandle(); + std::shared_ptr<SfxItemSet> pNewStyle = static_cast<const SwFormatAutoFormat&>(rNewHint.GetAttr()).GetStyleHandle(); if ( pCurrentAutoStyle ) { - std::shared_ptr<SfxItemSet> pCurrentStyle = static_cast<const SwFmtAutoFmt&>(pCurrentAutoStyle->GetAttr()).GetStyleHandle(); + std::shared_ptr<SfxItemSet> pCurrentStyle = static_cast<const SwFormatAutoFormat&>(pCurrentAutoStyle->GetAttr()).GetStyleHandle(); // Merge attributes SfxItemSet aNewSet( *pCurrentStyle ); @@ -860,7 +860,7 @@ void SwpHints::BuildPortions( SwTxtNode& rNode, SwTxtAttr& rNewHint, pTmpItem == pItem ) { // Do not clear item if the attribute is set in a character format: - if ( !pCurrentCharFmt || 0 == CharFmt::GetItem( *pCurrentCharFmt, pItem->Which() ) ) + if ( !pCurrentCharFormat || 0 == CharFormat::GetItem( *pCurrentCharFormat, pItem->Which() ) ) aNewSet.ClearItem( pItem->Which() ); } } @@ -873,7 +873,7 @@ void SwpHints::BuildPortions( SwTxtNode& rNode, SwTxtAttr& rNewHint, // Create new AutoStyle if ( aNewSet.Count() ) - pNewAttr = MakeTxtAttr( *rNode.GetDoc(), aNewSet, + pNewAttr = MakeTextAttr( *rNode.GetDoc(), aNewSet, nPorStart, nPorEnd ); } else @@ -898,7 +898,7 @@ void SwpHints::BuildPortions( SwTxtNode& rNode, SwTxtAttr& rNewHint, pTmpItem == pItem ) { // Do not clear item if the attribute is set in a character format: - if ( !pCurrentCharFmt || 0 == CharFmt::GetItem( *pCurrentCharFmt, pItem->Which() ) ) + if ( !pCurrentCharFormat || 0 == CharFormat::GetItem( *pCurrentCharFormat, pItem->Which() ) ) { if ( !pNewSet ) pNewSet = pNewStyle->Clone( true ); @@ -932,7 +932,7 @@ void SwpHints::BuildPortions( SwTxtNode& rNode, SwTxtAttr& rNewHint, } else if ( pNewStyle.get() ) { - pNewAttr = MakeTxtAttr( *rNode.GetDoc(), *pNewStyle, + pNewAttr = MakeTextAttr( *rNode.GetDoc(), *pNewStyle, nPorStart, nPorEnd ); } } @@ -958,7 +958,7 @@ void SwpHints::BuildPortions( SwTxtNode& rNode, SwTxtAttr& rNewHint, rNode.DestroyAttr( &rNewHint ); } -SwTxtAttr* MakeRedlineTxtAttr( SwDoc & rDoc, SfxPoolItem & rAttr ) +SwTextAttr* MakeRedlineTextAttr( SwDoc & rDoc, SfxPoolItem & rAttr ) { // this is intended _only_ for special-purpose redline attributes! switch (rAttr.Which()) @@ -984,38 +984,38 @@ SwTxtAttr* MakeRedlineTxtAttr( SwDoc & rDoc, SfxPoolItem & rAttr ) // FIXME: this const_cast is evil! SfxPoolItem& rNew = const_cast<SfxPoolItem&>( rDoc.GetAttrPool().Put( rAttr ) ); - return new SwTxtAttrEnd( rNew, 0, 0 ); + return new SwTextAttrEnd( rNew, 0, 0 ); } // create new text attribute -SwTxtAttr* MakeTxtAttr( +SwTextAttr* MakeTextAttr( SwDoc & rDoc, SfxPoolItem& rAttr, sal_Int32 const nStt, sal_Int32 const nEnd, CopyOrNew_t const bIsCopy, - SwTxtNode *const pTxtNode ) + SwTextNode *const pTextNode ) { if ( isCHRATR(rAttr.Which()) ) { - // Somebody wants to build a SwTxtAttr for a character attribute. + // Somebody wants to build a SwTextAttr for a character attribute. // Sorry, this is not allowed any longer. // You'll get a brand new autostyle attribute: SfxItemSet aItemSet( rDoc.GetAttrPool(), RES_CHRATR_BEGIN, RES_CHRATR_END ); aItemSet.Put( rAttr ); - return MakeTxtAttr( rDoc, aItemSet, nStt, nEnd ); + return MakeTextAttr( rDoc, aItemSet, nStt, nEnd ); } else if ( RES_TXTATR_AUTOFMT == rAttr.Which() && - static_cast<const SwFmtAutoFmt&>(rAttr).GetStyleHandle()-> + static_cast<const SwFormatAutoFormat&>(rAttr).GetStyleHandle()-> GetPool() != &rDoc.GetAttrPool() ) { // If the attribute is an auto-style which refers to a pool that is // different from rDoc's pool, we have to correct this: - const StylePool::SfxItemSet_Pointer_t pAutoStyle = static_cast<const SwFmtAutoFmt&>(rAttr).GetStyleHandle(); + const StylePool::SfxItemSet_Pointer_t pAutoStyle = static_cast<const SwFormatAutoFormat&>(rAttr).GetStyleHandle(); std::unique_ptr<const SfxItemSet> pNewSet( pAutoStyle->SfxItemSet::Clone( true, &rDoc.GetAttrPool() )); - SwTxtAttr* pNew = MakeTxtAttr( rDoc, *pNewSet, nStt, nEnd ); + SwTextAttr* pNew = MakeTextAttr( rDoc, *pNewSet, nStt, nEnd ); return pNew; } @@ -1024,104 +1024,104 @@ SwTxtAttr* MakeTxtAttr( SfxPoolItem& rNew = const_cast<SfxPoolItem&>( rDoc.GetAttrPool().Put( rAttr ) ); - SwTxtAttr* pNew = 0; + SwTextAttr* pNew = 0; switch( rNew.Which() ) { case RES_TXTATR_CHARFMT: { - SwFmtCharFmt &rFmtCharFmt = static_cast<SwFmtCharFmt&>(rNew); - if( !rFmtCharFmt.GetCharFmt() ) + SwFormatCharFormat &rFormatCharFormat = static_cast<SwFormatCharFormat&>(rNew); + if( !rFormatCharFormat.GetCharFormat() ) { - rFmtCharFmt.SetCharFmt( rDoc.GetDfltCharFmt() ); + rFormatCharFormat.SetCharFormat( rDoc.GetDfltCharFormat() ); } - pNew = new SwTxtCharFmt( rFmtCharFmt, nStt, nEnd ); + pNew = new SwTextCharFormat( rFormatCharFormat, nStt, nEnd ); } break; case RES_TXTATR_INETFMT: - pNew = new SwTxtINetFmt( static_cast<SwFmtINetFmt&>(rNew), nStt, nEnd ); + pNew = new SwTextINetFormat( static_cast<SwFormatINetFormat&>(rNew), nStt, nEnd ); break; case RES_TXTATR_FIELD: - pNew = new SwTxtFld( static_cast<SwFmtFld &>(rNew), nStt, + pNew = new SwTextField( static_cast<SwFormatField &>(rNew), nStt, rDoc.IsClipBoard() ); break; case RES_TXTATR_ANNOTATION: { - pNew = new SwTxtAnnotationFld( static_cast<SwFmtFld &>(rNew), nStt, rDoc.IsClipBoard() ); + pNew = new SwTextAnnotationField( static_cast<SwFormatField &>(rNew), nStt, rDoc.IsClipBoard() ); if (bIsCopy == COPY) { // On copy of the annotation field do not keep the annotated text range by removing // the relation to its annotation mark (relation established via annotation field's name). // If the annotation mark is also copied, the relation and thus the annotated text range will be reestablished, // when the annotation mark is created and inserted into the document. - const_cast<SwPostItField&>(dynamic_cast<const SwPostItField&>(*(pNew->GetFmtFld().GetField()))).SetName(OUString()); + const_cast<SwPostItField&>(dynamic_cast<const SwPostItField&>(*(pNew->GetFormatField().GetField()))).SetName(OUString()); } } break; case RES_TXTATR_INPUTFIELD: - pNew = new SwTxtInputFld( static_cast<SwFmtFld &>(rNew), nStt, nEnd, + pNew = new SwTextInputField( static_cast<SwFormatField &>(rNew), nStt, nEnd, rDoc.IsClipBoard() ); break; case RES_TXTATR_FLYCNT: { // erst hier wird das Frame-Format kopiert (mit Inhalt) !! - pNew = new SwTxtFlyCnt( static_cast<SwFmtFlyCnt&>(rNew), nStt ); + pNew = new SwTextFlyCnt( static_cast<SwFormatFlyCnt&>(rNew), nStt ); // Kopie von einem Text-Attribut - if ( static_cast<const SwFmtFlyCnt &>(rAttr).GetTxtFlyCnt() ) + if ( static_cast<const SwFormatFlyCnt &>(rAttr).GetTextFlyCnt() ) { // then the format must be copied - static_cast<SwTxtFlyCnt *>(pNew)->CopyFlyFmt( &rDoc ); + static_cast<SwTextFlyCnt *>(pNew)->CopyFlyFormat( &rDoc ); } } break; case RES_TXTATR_FTN: - pNew = new SwTxtFtn( static_cast<SwFmtFtn&>(rNew), nStt ); + pNew = new SwTextFootnote( static_cast<SwFormatFootnote&>(rNew), nStt ); // ggfs. SeqNo kopieren - if( static_cast<SwFmtFtn&>(rAttr).GetTxtFtn() ) - static_cast<SwTxtFtn*>(pNew)->SetSeqNo( static_cast<SwFmtFtn&>(rAttr).GetTxtFtn()->GetSeqRefNo() ); + if( static_cast<SwFormatFootnote&>(rAttr).GetTextFootnote() ) + static_cast<SwTextFootnote*>(pNew)->SetSeqNo( static_cast<SwFormatFootnote&>(rAttr).GetTextFootnote()->GetSeqRefNo() ); break; case RES_TXTATR_REFMARK: pNew = nStt == nEnd - ? new SwTxtRefMark( static_cast<SwFmtRefMark&>(rNew), nStt ) - : new SwTxtRefMark( static_cast<SwFmtRefMark&>(rNew), nStt, &nEnd ); + ? new SwTextRefMark( static_cast<SwFormatRefMark&>(rNew), nStt ) + : new SwTextRefMark( static_cast<SwFormatRefMark&>(rNew), nStt, &nEnd ); break; case RES_TXTATR_TOXMARK: - pNew = new SwTxtTOXMark( static_cast<SwTOXMark&>(rNew), nStt, &nEnd ); + pNew = new SwTextTOXMark( static_cast<SwTOXMark&>(rNew), nStt, &nEnd ); break; case RES_TXTATR_CJK_RUBY: - pNew = new SwTxtRuby( static_cast<SwFmtRuby&>(rNew), nStt, nEnd ); + pNew = new SwTextRuby( static_cast<SwFormatRuby&>(rNew), nStt, nEnd ); break; case RES_TXTATR_META: case RES_TXTATR_METAFIELD: - pNew = SwTxtMeta::CreateTxtMeta( rDoc.GetMetaFieldManager(), pTxtNode, - static_cast<SwFmtMeta&>(rNew), nStt, nEnd, bIsCopy == COPY ); + pNew = SwTextMeta::CreateTextMeta( rDoc.GetMetaFieldManager(), pTextNode, + static_cast<SwFormatMeta&>(rNew), nStt, nEnd, bIsCopy == COPY ); break; default: assert(RES_TXTATR_AUTOFMT == rNew.Which()); - pNew = new SwTxtAttrEnd( rNew, nStt, nEnd ); + pNew = new SwTextAttrEnd( rNew, nStt, nEnd ); break; } return pNew; } -SwTxtAttr* MakeTxtAttr( SwDoc & rDoc, const SfxItemSet& rSet, +SwTextAttr* MakeTextAttr( SwDoc & rDoc, const SfxItemSet& rSet, sal_Int32 nStt, sal_Int32 nEnd ) { IStyleAccess& rStyleAccess = rDoc.GetIStyleAccess(); const StylePool::SfxItemSet_Pointer_t pAutoStyle = rStyleAccess.getAutomaticStyle( rSet, IStyleAccess::AUTO_STYLE_CHAR ); - SwFmtAutoFmt aNewAutoFmt; - aNewAutoFmt.SetStyleHandle( pAutoStyle ); - SwTxtAttr* pNew = MakeTxtAttr( rDoc, aNewAutoFmt, nStt, nEnd ); + SwFormatAutoFormat aNewAutoFormat; + aNewAutoFormat.SetStyleHandle( pAutoStyle ); + SwTextAttr* pNew = MakeTextAttr( rDoc, aNewAutoFormat, nStt, nEnd ); return pNew; } // loesche das Text-Attribut (muss beim Pool abgemeldet werden!) -void SwTxtNode::DestroyAttr( SwTxtAttr* pAttr ) +void SwTextNode::DestroyAttr( SwTextAttr* pAttr ) { if( pAttr ) { @@ -1132,10 +1132,10 @@ void SwTxtNode::DestroyAttr( SwTxtAttr* pAttr ) case RES_TXTATR_FLYCNT: { // siehe auch die Anmerkung "Loeschen von Formaten - // zeichengebundener Frames" in fesh.cxx, SwFEShell::DelFmt() - SwFrmFmt* pFmt = pAttr->GetFlyCnt().GetFrmFmt(); - if( pFmt ) // vom Undo auf 0 gesetzt ?? - pDoc->getIDocumentLayoutAccess().DelLayoutFmt( pFmt ); + // zeichengebundener Frames" in fesh.cxx, SwFEShell::DelFormat() + SwFrameFormat* pFormat = pAttr->GetFlyCnt().GetFrameFormat(); + if( pFormat ) // vom Undo auf 0 gesetzt ?? + pDoc->getIDocumentLayoutAccess().DelLayoutFormat( pFormat ); } break; @@ -1144,8 +1144,8 @@ void SwTxtNode::DestroyAttr( SwTxtAttr* pAttr ) break; case RES_TXTATR_FTN: - static_cast<SwTxtFtn*>(pAttr)->SetStartNode( 0 ); - static_cast<SwFmtFtn&>(pAttr->GetAttr()).InvalidateFootnote(); + static_cast<SwTextFootnote*>(pAttr)->SetStartNode( 0 ); + static_cast<SwFormatFootnote&>(pAttr->GetAttr()).InvalidateFootnote(); break; case RES_TXTATR_FIELD: @@ -1153,18 +1153,18 @@ void SwTxtNode::DestroyAttr( SwTxtAttr* pAttr ) case RES_TXTATR_INPUTFIELD: if( !pDoc->IsInDtor() ) { - SwTxtFld *const pTxtFld(static_txtattr_cast<SwTxtFld*>(pAttr)); + SwTextField *const pTextField(static_txtattr_cast<SwTextField*>(pAttr)); // Wenn wir ein HiddenParaField sind, dann muessen wir // ggf. fuer eine Neuberechnung des Visible-Flags sorgen. - const SwField* pFld = pAttr->GetFmtFld().GetField(); + const SwField* pField = pAttr->GetFormatField().GetField(); //JP 06-08-95: DDE-Felder bilden eine Ausnahme - OSL_ENSURE( RES_DDEFLD == pFld->GetTyp()->Which() || - this == pTxtFld->GetpTxtNode(), + OSL_ENSURE( RES_DDEFLD == pField->GetTyp()->Which() || + this == pTextField->GetpTextNode(), "Wo steht denn dieses Feld?" ); // bestimmte Felder mussen am Doc das Calculations-Flag updaten - switch( pFld->GetTyp()->Which() ) + switch( pField->GetTyp()->Which() ) { case RES_HIDDENPARAFLD: SetCalcHiddenParaField(); @@ -1176,22 +1176,22 @@ void SwTxtNode::DestroyAttr( SwTxtAttr* pAttr ) case RES_HIDDENTXTFLD: case RES_DBNUMSETFLD: case RES_DBNEXTSETFLD: - if( !pDoc->getIDocumentFieldsAccess().IsNewFldLst() && GetNodes().IsDocNodes() ) - pDoc->getIDocumentFieldsAccess().InsDelFldInFldLst(false, *pTxtFld); + if( !pDoc->getIDocumentFieldsAccess().IsNewFieldLst() && GetNodes().IsDocNodes() ) + pDoc->getIDocumentFieldsAccess().InsDelFieldInFieldLst(false, *pTextField); break; case RES_DDEFLD: - if (GetNodes().IsDocNodes() && pTxtFld->GetpTxtNode()) - static_cast<SwDDEFieldType*>(pFld->GetTyp())->DecRefCnt(); + if (GetNodes().IsDocNodes() && pTextField->GetpTextNode()) + static_cast<SwDDEFieldType*>(pField->GetTyp())->DecRefCnt(); break; case RES_POSTITFLD: { - const_cast<SwFmtFld&>(pAttr->GetFmtFld()).Broadcast( - SwFmtFldHint(&pTxtFld->GetFmtFld(), SwFmtFldHintWhich::REMOVED)); + const_cast<SwFormatField&>(pAttr->GetFormatField()).Broadcast( + SwFormatFieldHint(&pTextField->GetFormatField(), SwFormatFieldHintWhich::REMOVED)); break; } } } - static_cast<SwFmtFld&>(pAttr->GetAttr()).InvalidateField(); + static_cast<SwFormatField&>(pAttr->GetAttr()).InvalidateField(); break; case RES_TXTATR_TOXMARK: @@ -1199,23 +1199,23 @@ void SwTxtNode::DestroyAttr( SwTxtAttr* pAttr ) break; case RES_TXTATR_REFMARK: - static_cast<SwFmtRefMark&>(pAttr->GetAttr()).InvalidateRefMark(); + static_cast<SwFormatRefMark&>(pAttr->GetAttr()).InvalidateRefMark(); break; case RES_TXTATR_META: case RES_TXTATR_METAFIELD: - static_txtattr_cast<SwTxtMeta*>(pAttr)->ChgTxtNode(0); + static_txtattr_cast<SwTextMeta*>(pAttr)->ChgTextNode(0); break; default: break; } - SwTxtAttr::Destroy( pAttr, pDoc->GetAttrPool() ); + SwTextAttr::Destroy( pAttr, pDoc->GetAttrPool() ); } } -SwTxtAttr* SwTxtNode::InsertItem( +SwTextAttr* SwTextNode::InsertItem( SfxPoolItem& rAttr, const sal_Int32 nStart, const sal_Int32 nEnd, @@ -1223,10 +1223,10 @@ SwTxtAttr* SwTxtNode::InsertItem( { // character attributes will be inserted as automatic styles: OSL_ENSURE( !isCHRATR(rAttr.Which()), "AUTOSTYLES - " - "SwTxtNode::InsertItem should not be called with character attributes"); + "SwTextNode::InsertItem should not be called with character attributes"); - SwTxtAttr *const pNew = - MakeTxtAttr( + SwTextAttr *const pNew = + MakeTextAttr( *GetDoc(), rAttr, nStart, @@ -1250,7 +1250,7 @@ SwTxtAttr* SwTxtNode::InsertItem( } // take ownership of pAttr; if insertion fails, delete pAttr -bool SwTxtNode::InsertHint( SwTxtAttr * const pAttr, const SetAttrMode nMode ) +bool SwTextNode::InsertHint( SwTextAttr * const pAttr, const SetAttrMode nMode ) { bool bHiddenPara = false; @@ -1274,8 +1274,8 @@ bool SwTxtNode::InsertHint( SwTxtAttr * const pAttr, const SetAttrMode nMode ) { case RES_TXTATR_FLYCNT: { - SwTxtFlyCnt *pFly = static_cast<SwTxtFlyCnt *>(pAttr); - SwFrmFmt* pFmt = pAttr->GetFlyCnt().GetFrmFmt(); + SwTextFlyCnt *pFly = static_cast<SwTextFlyCnt *>(pAttr); + SwFrameFormat* pFormat = pAttr->GetFlyCnt().GetFrameFormat(); if( !(SetAttrMode::NOTXTATRCHR & nInsMode) ) { // Wir muessen zuerst einfuegen, da in SetAnchor() @@ -1284,18 +1284,18 @@ bool SwTxtNode::InsertHint( SwTxtAttr * const pAttr, const SetAttrMode nMode ) // gesetzt ist, dann korrigiere dieses nach dem Einfuegen // des Zeichens. Sonst muesste das immer ausserhalb // erfolgen (Fehleranfaellig !) - const SwFmtAnchor* pAnchor = 0; - pFmt->GetItemState( RES_ANCHOR, false, + const SwFormatAnchor* pAnchor = 0; + pFormat->GetItemState( RES_ANCHOR, false, reinterpret_cast<const SfxPoolItem**>(&pAnchor) ); SwIndex aIdx( this, pAttr->GetStart() ); - const OUString c(GetCharOfTxtAttr(*pAttr)); + const OUString c(GetCharOfTextAttr(*pAttr)); OUString const ins( InsertText(c, aIdx, nInsertFlags) ); if (ins.isEmpty()) { // do not record deletion of Format! ::sw::UndoGuard const ug( - pFmt->GetDoc()->GetIDocumentUndoRedo()); + pFormat->GetDoc()->GetIDocumentUndoRedo()); DestroyAttr(pAttr); return false; // text node full :( } @@ -1303,34 +1303,34 @@ bool SwTxtNode::InsertHint( SwTxtAttr * const pAttr, const SetAttrMode nMode ) if (pAnchor && (FLY_AS_CHAR == pAnchor->GetAnchorId()) && - pAnchor->GetCntntAnchor() && - pAnchor->GetCntntAnchor()->nNode == *this && - pAnchor->GetCntntAnchor()->nContent == aIdx ) + pAnchor->GetContentAnchor() && + pAnchor->GetContentAnchor()->nNode == *this && + pAnchor->GetContentAnchor()->nContent == aIdx ) { --const_cast<SwIndex&>( - pAnchor->GetCntntAnchor()->nContent); + pAnchor->GetContentAnchor()->nContent); } } pFly->SetAnchor( this ); // Format-Pointer kann sich im SetAnchor geaendert haben! // (Kopieren in andere Docs!) - pFmt = pAttr->GetFlyCnt().GetFrmFmt(); - SwDoc *pDoc = pFmt->GetDoc(); + pFormat = pAttr->GetFlyCnt().GetFrameFormat(); + SwDoc *pDoc = pFormat->GetDoc(); // OD 26.06.2003 #108784# - allow drawing objects in header/footer. // But don't allow control objects in header/footer - if( RES_DRAWFRMFMT == pFmt->Which() && - pDoc->IsInHeaderFooter( pFmt->GetAnchor().GetCntntAnchor()->nNode ) ) + if( RES_DRAWFRMFMT == pFormat->Which() && + pDoc->IsInHeaderFooter( pFormat->GetAnchor().GetContentAnchor()->nNode ) ) { SwDrawContact* pDrawContact = - static_cast<SwDrawContact*>(pFmt->FindContactObj()); + static_cast<SwDrawContact*>(pFormat->FindContactObj()); if ( pDrawContact && pDrawContact->GetMaster() && ::CheckControlLayer( pDrawContact->GetMaster() ) ) { // das soll nicht meoglich sein; hier verhindern - // Der Dtor des TxtHints loescht nicht das Zeichen. + // Der Dtor des TextHints loescht nicht das Zeichen. // Wenn ein CH_TXTATR_.. vorliegt, dann muss man // dieses explizit loeschen if( SetAttrMode::NOTXTATRCHR & nInsMode ) @@ -1358,7 +1358,7 @@ bool SwTxtNode::InsertHint( SwTxtAttr * const pAttr, const SetAttrMode nMode ) case RES_TXTATR_FTN : { // Fussnoten, man kommt an alles irgendwie heran. - // CntntNode erzeugen und in die Inserts-Section stellen + // ContentNode erzeugen und in die Inserts-Section stellen SwDoc *pDoc = GetDoc(); SwNodes &rNodes = pDoc->GetNodes(); @@ -1366,7 +1366,7 @@ bool SwTxtNode::InsertHint( SwTxtAttr * const pAttr, const SetAttrMode nMode ) if( StartOfSectionIndex() < rNodes.GetEndOfAutotext().GetIndex() ) { // das soll nicht meoglich sein; hier verhindern - // Der Dtor des TxtHints loescht nicht das Zeichen. + // Der Dtor des TextHints loescht nicht das Zeichen. // Wenn ein CH_TXTATR_.. vorliegt, dann muss man // dieses explizit loeschen if( SetAttrMode::NOTXTATRCHR & nInsMode ) @@ -1387,10 +1387,10 @@ bool SwTxtNode::InsertHint( SwTxtAttr * const pAttr, const SetAttrMode nMode ) } // wird eine neue Fussnote eingefuegt ?? - bool bNewFtn = 0 == static_cast<SwTxtFtn*>(pAttr)->GetStartNode(); - if( bNewFtn ) + bool bNewFootnote = 0 == static_cast<SwTextFootnote*>(pAttr)->GetStartNode(); + if( bNewFootnote ) { - static_cast<SwTxtFtn*>(pAttr)->MakeNewTextSection( GetNodes() ); + static_cast<SwTextFootnote*>(pAttr)->MakeNewTextSection( GetNodes() ); SwRegHistory* pHist = GetpSwpHints() ? GetpSwpHints()->GetHistory() : 0; if( pHist ) @@ -1400,11 +1400,11 @@ bool SwTxtNode::InsertHint( SwTxtAttr * const pAttr, const SetAttrMode nMode ) { // loesche alle Frames der Section, auf die der StartNode zeigt sal_uLong nSttIdx = - static_cast<SwTxtFtn*>(pAttr)->GetStartNode()->GetIndex(); + static_cast<SwTextFootnote*>(pAttr)->GetStartNode()->GetIndex(); sal_uLong nEndIdx = rNodes[ nSttIdx++ ]->EndOfSectionIndex(); for( ; nSttIdx < nEndIdx; ++nSttIdx ) { - SwCntntNode* pCNd = rNodes[ nSttIdx ]->GetCntntNode(); + SwContentNode* pCNd = rNodes[ nSttIdx ]->GetContentNode(); if( 0 != pCNd ) pCNd->DelFrms(); } @@ -1416,7 +1416,7 @@ bool SwTxtNode::InsertHint( SwTxtAttr * const pAttr, const SetAttrMode nMode ) // entstehen koennen und das Attribut im _SortArr_ am // Dokument nicht eingetrage wird. SwIndex aNdIdx( this, pAttr->GetStart() ); - const OUString c(GetCharOfTxtAttr(*pAttr)); + const OUString c(GetCharOfTextAttr(*pAttr)); OUString const ins( InsertText(c, aNdIdx, nInsertFlags) ); if (ins.isEmpty()) { @@ -1426,40 +1426,40 @@ bool SwTxtNode::InsertHint( SwTxtAttr * const pAttr, const SetAttrMode nMode ) nInsMode |= SetAttrMode::NOTXTATRCHR; } - // Wir tragen uns am FtnIdx-Array des Docs ein ... - SwTxtFtn* pTxtFtn = 0; - if( !bNewFtn ) + // Wir tragen uns am FootnoteIdx-Array des Docs ein ... + SwTextFootnote* pTextFootnote = 0; + if( !bNewFootnote ) { - // eine alte Ftn wird umgehaengt (z.B. SplitNode) - for( size_t n = 0; n < pDoc->GetFtnIdxs().size(); ++n ) - if( pAttr == pDoc->GetFtnIdxs()[n] ) + // eine alte Footnote wird umgehaengt (z.B. SplitNode) + for( size_t n = 0; n < pDoc->GetFootnoteIdxs().size(); ++n ) + if( pAttr == pDoc->GetFootnoteIdxs()[n] ) { // neuen Index zuweisen, dafuer aus dem SortArray // loeschen und neu eintragen - pTxtFtn = pDoc->GetFtnIdxs()[n]; - pDoc->GetFtnIdxs().erase( pDoc->GetFtnIdxs().begin() + n ); + pTextFootnote = pDoc->GetFootnoteIdxs()[n]; + pDoc->GetFootnoteIdxs().erase( pDoc->GetFootnoteIdxs().begin() + n ); break; } // wenn ueber Undo der StartNode gesetzt wurde, kann // der Index noch gar nicht in der Verwaltung stehen !! } - if( !pTxtFtn ) - pTxtFtn = static_cast<SwTxtFtn*>(pAttr); + if( !pTextFootnote ) + pTextFootnote = static_cast<SwTextFootnote*>(pAttr); // fuers Update der Nummern und zum Sortieren // muss der Node gesetzt sein. - static_cast<SwTxtFtn*>(pAttr)->ChgTxtNode( this ); + static_cast<SwTextFootnote*>(pAttr)->ChgTextNode( this ); - // FussNote im Redline-Bereich NICHT ins FtnArray einfuegen! + // FussNote im Redline-Bereich NICHT ins FootnoteArray einfuegen! if( StartOfSectionIndex() > rNodes.GetEndOfRedlines().GetIndex() ) { - const bool bSuccess = pDoc->GetFtnIdxs().insert(pTxtFtn).second; - OSL_ENSURE( bSuccess, "FtnIdx not inserted." ); + const bool bSuccess = pDoc->GetFootnoteIdxs().insert(pTextFootnote).second; + OSL_ENSURE( bSuccess, "FootnoteIdx not inserted." ); (void) bSuccess; // unused in non-debug } SwNodeIndex aTmpIndex( *this ); - pDoc->GetFtnIdxs().UpdateFtn( aTmpIndex); - static_cast<SwTxtFtn*>(pAttr)->SetSeqRefNo(); + pDoc->GetFootnoteIdxs().UpdateFootnote( aTmpIndex); + static_cast<SwTextFootnote*>(pAttr)->SetSeqRefNo(); } break; @@ -1467,7 +1467,7 @@ bool SwTxtNode::InsertHint( SwTxtAttr * const pAttr, const SetAttrMode nMode ) { // fuer HiddenParaFields Benachrichtigungsmechanismus // anwerfen - if( RES_HIDDENPARAFLD == pAttr->GetFmtFld().GetField()->GetTyp()->Which() ) + if( RES_HIDDENPARAFLD == pAttr->GetFormatField().GetField()->GetTyp()->Which() ) { bHiddenPara = true; } @@ -1475,14 +1475,14 @@ bool SwTxtNode::InsertHint( SwTxtAttr * const pAttr, const SetAttrMode nMode ) break; } - // Fuer SwTxtHints ohne Endindex werden CH_TXTATR_.. + // Fuer SwTextHints ohne Endindex werden CH_TXTATR_.. // eingefuegt, aStart muss danach um einen zurueckgesetzt werden. - // Wenn wir im SwTxtNode::Copy stehen, so wurde das Zeichen bereits + // Wenn wir im SwTextNode::Copy stehen, so wurde das Zeichen bereits // mitkopiert. In solchem Fall ist SETATTR_NOTXTATRCHR angegeben worden. if( !(SetAttrMode::NOTXTATRCHR & nInsMode) ) { SwIndex aIdx( this, pAttr->GetStart() ); - OUString const ins( InsertText(OUString(GetCharOfTxtAttr(*pAttr)), + OUString const ins( InsertText(OUString(GetCharOfTextAttr(*pAttr)), aIdx, nInsertFlags) ); if (ins.isEmpty()) { @@ -1510,19 +1510,19 @@ bool SwTxtNode::InsertHint( SwTxtAttr * const pAttr, const SetAttrMode nMode ) { case RES_TXTATR_INPUTFIELD: { - SwTxtInputFld* pTxtInputFld = dynamic_cast<SwTxtInputFld*>(pAttr); - if ( pTxtInputFld ) + SwTextInputField* pTextInputField = dynamic_cast<SwTextInputField*>(pAttr); + if ( pTextInputField ) { if( !(SetAttrMode::NOTXTATRCHR & nMode) ) { SwIndex aIdx( this, pAttr->GetStart() ); InsertText( OUString(CH_TXT_ATR_INPUTFIELDSTART), aIdx, nInsertFlags ); - const OUString aContent = pTxtInputFld->GetFieldContent(); + const OUString aContent = pTextInputField->GetFieldContent(); InsertText( aContent, aIdx, nInsertFlags ); InsertText( OUString(CH_TXT_ATR_INPUTFIELDEND), aIdx, nInsertFlags ); sal_Int32* const pEnd(pAttr->GetEnd()); - OSL_ENSURE( pEnd != NULL, "<SwTxtNode::InsertHint(..)> - missing end of RES_TXTATR_INPUTFIELD!" ); + OSL_ENSURE( pEnd != NULL, "<SwTextNode::InsertHint(..)> - missing end of RES_TXTATR_INPUTFIELD!" ); if ( pEnd != NULL ) { *pEnd = *pEnd + 2 + aContent.getLength(); @@ -1538,7 +1538,7 @@ bool SwTxtNode::InsertHint( SwTxtAttr * const pAttr, const SetAttrMode nMode ) InsertText( OUString(CH_TXT_ATR_INPUTFIELDSTART), aIdx, nInsertFlags ); bInputFieldStartCharInserted = true; sal_Int32* const pEnd(pAttr->GetEnd()); - OSL_ENSURE( pEnd != NULL, "<SwTxtNode::InsertHint(..)> - missing end of RES_TXTATR_INPUTFIELD!" ); + OSL_ENSURE( pEnd != NULL, "<SwTextNode::InsertHint(..)> - missing end of RES_TXTATR_INPUTFIELD!" ); if ( pEnd != NULL ) { *pEnd = *pEnd + 1; @@ -1547,7 +1547,7 @@ bool SwTxtNode::InsertHint( SwTxtAttr * const pAttr, const SetAttrMode nMode ) } sal_Int32* const pEnd(pAttr->GetEnd()); - OSL_ENSURE( pEnd != NULL, "<SwTxtNode::InsertHint(..)> - missing end of RES_TXTATR_INPUTFIELD!" ); + OSL_ENSURE( pEnd != NULL, "<SwTextNode::InsertHint(..)> - missing end of RES_TXTATR_INPUTFIELD!" ); if ( pEnd != NULL && m_Text[ *(pEnd) - 1 ] != CH_TXT_ATR_INPUTFIELDEND ) { @@ -1571,8 +1571,8 @@ bool SwTxtNode::InsertHint( SwTxtAttr * const pAttr, const SetAttrMode nMode ) // handle overlap with an existing InputField bool bInsertHint = true; { - const SwTxtInputFld* pTxtInputFld = GetOverlappingInputFld( *pAttr ); - if ( pTxtInputFld != NULL ) + const SwTextInputField* pTextInputField = GetOverlappingInputField( *pAttr ); + if ( pTextInputField != NULL ) { if ( pAttr->End() == NULL ) { @@ -1580,13 +1580,13 @@ bool SwTxtNode::InsertHint( SwTxtAttr * const pAttr, const SetAttrMode nMode ) } else { - if ( pAttr->GetStart() > pTxtInputFld->GetStart() ) + if ( pAttr->GetStart() > pTextInputField->GetStart() ) { - pAttr->GetStart() = pTxtInputFld->GetStart(); + pAttr->GetStart() = pTextInputField->GetStart(); } - if ( *(pAttr->End()) < *(pTxtInputFld->End()) ) + if ( *(pAttr->End()) < *(pTextInputField->End()) ) { - *(pAttr->GetEnd()) = *(pTxtInputFld->End()); + *(pAttr->GetEnd()) = *(pTextInputField->End()); } } } @@ -1646,7 +1646,7 @@ bool SwTxtNode::InsertHint( SwTxtAttr * const pAttr, const SetAttrMode nMode ) return bRet; } -void SwTxtNode::DeleteAttribute( SwTxtAttr * const pAttr ) +void SwTextNode::DeleteAttribute( SwTextAttr * const pAttr ) { if ( !HasHints() ) { @@ -1664,7 +1664,7 @@ void SwTxtNode::DeleteAttribute( SwTxtAttr * const pAttr ) else if ( pAttr->HasContent() ) { const SwIndex aIdx( this, pAttr->GetStart() ); - OSL_ENSURE( pAttr->End() != NULL, "<SwTxtNode::DeleteAttribute(..)> - missing End() at <SwTxtAttr> instance which has content" ); + OSL_ENSURE( pAttr->End() != NULL, "<SwTextNode::DeleteAttribute(..)> - missing End() at <SwTextAttr> instance which has content" ); EraseText( aIdx, *pAttr->End() - pAttr->GetStart() ); } else @@ -1676,7 +1676,7 @@ void SwTxtNode::DeleteAttribute( SwTxtAttr * const pAttr ) pAttr->Which()); m_pSwpHints->Delete( pAttr ); - SwTxtAttr::Destroy( pAttr, GetDoc()->GetAttrPool() ); + SwTextAttr::Destroy( pAttr, GetDoc()->GetAttrPool() ); NotifyClients( 0, &aHint ); TryDeleteSwpHints(); @@ -1684,7 +1684,7 @@ void SwTxtNode::DeleteAttribute( SwTxtAttr * const pAttr ) } //FIXME: this does NOT respect SORT NUMBER (for CHARFMT)! -void SwTxtNode::DeleteAttributes( +void SwTextNode::DeleteAttributes( const sal_uInt16 nWhich, const sal_Int32 nStart, const sal_Int32 nEnd ) @@ -1694,13 +1694,13 @@ void SwTxtNode::DeleteAttributes( for ( size_t nPos = 0; m_pSwpHints && nPos < m_pSwpHints->Count(); ++nPos ) { - SwTxtAttr * const pTxtHt = m_pSwpHints->GetTextHint( nPos ); - const sal_Int32 nHintStart = pTxtHt->GetStart(); + SwTextAttr * const pTextHt = m_pSwpHints->GetTextHint( nPos ); + const sal_Int32 nHintStart = pTextHt->GetStart(); if (nStart < nHintStart) { break; // sorted by start } - else if ( (nStart == nHintStart) && (nWhich == pTxtHt->Which()) ) + else if ( (nStart == nHintStart) && (nWhich == pTextHt->Which()) ) { if ( nWhich == RES_CHRATR_HIDDEN ) { @@ -1710,36 +1710,36 @@ void SwTxtNode::DeleteAttributes( else if ( nWhich == RES_TXTATR_CHARFMT ) { // Check if character format contains hidden attribute: - const SwCharFmt* pFmt = pTxtHt->GetCharFmt().GetCharFmt(); + const SwCharFormat* pFormat = pTextHt->GetCharFormat().GetCharFormat(); const SfxPoolItem* pItem; - if ( SfxItemState::SET == pFmt->GetItemState( RES_CHRATR_HIDDEN, true, &pItem ) ) + if ( SfxItemState::SET == pFormat->GetItemState( RES_CHRATR_HIDDEN, true, &pItem ) ) SetCalcHiddenCharFlags(); } // #i75430# Recalc hidden flags if necessary else if ( nWhich == RES_TXTATR_AUTOFMT ) { // Check if auto style contains hidden attribute: - const SfxPoolItem* pHiddenItem = CharFmt::GetItem( *pTxtHt, RES_CHRATR_HIDDEN ); + const SfxPoolItem* pHiddenItem = CharFormat::GetItem( *pTextHt, RES_CHRATR_HIDDEN ); if ( pHiddenItem ) SetCalcHiddenCharFlags(); // for auto styles DeleteAttributes is only called from Undo // so it shouldn't need to care about ignore start/end flags } - sal_Int32 const * const pEndIdx = pTxtHt->GetEnd(); + sal_Int32 const * const pEndIdx = pTextHt->GetEnd(); - if ( pTxtHt->HasDummyChar() ) + if ( pTextHt->HasDummyChar() ) { // Unbedingt Copy-konstruieren! const SwIndex aIdx( this, nStart ); - // erase the CH_TXTATR, which will also delete pTxtHt + // erase the CH_TXTATR, which will also delete pTextHt EraseText( aIdx, 1 ); } - else if ( pTxtHt->HasContent() ) + else if ( pTextHt->HasContent() ) { const SwIndex aIdx( this, nStart ); - OSL_ENSURE( pTxtHt->End() != NULL, "<SwTxtNode::DeleteAttributes(..)> - missing End() at <SwTxtAttr> instance which has content" ); - EraseText( aIdx, *pTxtHt->End() - nStart ); + OSL_ENSURE( pTextHt->End() != NULL, "<SwTextNode::DeleteAttributes(..)> - missing End() at <SwTextAttr> instance which has content" ); + EraseText( aIdx, *pTextHt->End() - nStart ); } else if( *pEndIdx == nEnd ) { @@ -1753,7 +1753,7 @@ void SwTxtNode::DeleteAttributes( nWhich); m_pSwpHints->DeleteAtPos( nPos ); // gefunden, loeschen, - SwTxtAttr::Destroy( pTxtHt, GetDoc()->GetAttrPool() ); + SwTextAttr::Destroy( pTextHt, GetDoc()->GetAttrPool() ); NotifyClients( 0, &aHint ); } } @@ -1761,7 +1761,7 @@ void SwTxtNode::DeleteAttributes( TryDeleteSwpHints(); } -void SwTxtNode::DelSoftHyph( const sal_Int32 nStt, const sal_Int32 nEnd ) +void SwTextNode::DelSoftHyph( const sal_Int32 nStt, const sal_Int32 nEnd ) { sal_Int32 nFndPos = nStt; sal_Int32 nEndPos = nEnd; @@ -1778,7 +1778,7 @@ void SwTxtNode::DelSoftHyph( const sal_Int32 nStt, const sal_Int32 nEnd ) } } -bool SwTxtNode::IsIgnoredCharFmtForNumbering(const sal_uInt16 nWhich) +bool SwTextNode::IsIgnoredCharFormatForNumbering(const sal_uInt16 nWhich) { return (nWhich == RES_CHRATR_UNDERLINE || nWhich == RES_CHRATR_COLOR || nWhich == RES_CHRATR_BACKGROUND || nWhich == RES_CHRATR_ESCAPEMENT); } @@ -1787,7 +1787,7 @@ bool SwTxtNode::IsIgnoredCharFmtForNumbering(const sal_uInt16 nWhich) //Font underline; //Font Italic of Western, CJK and CTL; //Font Bold of Wertern, CJK and CTL; -bool lcl_IsIgnoredCharFmtForBullets(const sal_uInt16 nWhich) +bool lcl_IsIgnoredCharFormatForBullets(const sal_uInt16 nWhich) { return (nWhich == RES_CHRATR_UNDERLINE || nWhich == RES_CHRATR_POSTURE || nWhich == RES_CHRATR_WEIGHT || nWhich == RES_CHRATR_CJK_POSTURE || nWhich == RES_CHRATR_CJK_WEIGHT @@ -1795,12 +1795,12 @@ bool lcl_IsIgnoredCharFmtForBullets(const sal_uInt16 nWhich) } //Condition for expanding char set to character style of specified number rule level: -//The item inside the set should not conflict to any exist and non-default item inside paragraph properties set (SwCntntNode::SwPAttrSet); +//The item inside the set should not conflict to any exist and non-default item inside paragraph properties set (SwContentNode::SwPAttrSet); //The node should have applied a number rule; //The node should be counted in a list, if not, make it to be; //The item should not conflict to any exist and non-default item inside the character of specified number rule level; //The item should not be ignored depend on the exact number rule type; -bool SwTxtNode::TryCharSetExpandToNum(const SfxItemSet& aCharSet) +bool SwTextNode::TryCharSetExpandToNum(const SfxItemSet& aCharSet) { bool bRet = false; SfxItemIter aIter( aCharSet ); @@ -1823,21 +1823,21 @@ bool SwTxtNode::TryCharSetExpandToNum(const SfxItemSet& aCharSet) if (nLevel != -1 && pCurrNum) { - const SwNumFmt* pCurrNumFmt = pCurrNum->GetNumFmt(static_cast<sal_uInt16>(nLevel)); - if (pCurrNumFmt) + const SwNumFormat* pCurrNumFormat = pCurrNum->GetNumFormat(static_cast<sal_uInt16>(nLevel)); + if (pCurrNumFormat) { - if (pCurrNumFmt->IsItemize() && lcl_IsIgnoredCharFmtForBullets(nWhich)) + if (pCurrNumFormat->IsItemize() && lcl_IsIgnoredCharFormatForBullets(nWhich)) return bRet; - if (pCurrNumFmt->IsEnumeration() && SwTxtNode::IsIgnoredCharFmtForNumbering(nWhich)) + if (pCurrNumFormat->IsEnumeration() && SwTextNode::IsIgnoredCharFormatForNumbering(nWhich)) return bRet; - SwCharFmt* pCurrCharFmt =pCurrNumFmt->GetCharFmt(); + SwCharFormat* pCurrCharFormat =pCurrNumFormat->GetCharFormat(); - if (pCurrCharFmt && pCurrCharFmt->GetItemState(nWhich,false) != SfxItemState::SET) + if (pCurrCharFormat && pCurrCharFormat->GetItemState(nWhich,false) != SfxItemState::SET) { - pCurrCharFmt->SetFmtAttr(*pItem); - SwNumFmt aNewNumFmt(*pCurrNumFmt); - aNewNumFmt.SetCharFmt(pCurrCharFmt); - pCurrNum->Set(nLevel,aNewNumFmt); + pCurrCharFormat->SetFormatAttr(*pItem); + SwNumFormat aNewNumFormat(*pCurrNumFormat); + aNewNumFormat.SetCharFormat(pCurrCharFormat); + pCurrNum->Set(nLevel,aNewNumFormat); bRet = true; } } @@ -1847,8 +1847,8 @@ bool SwTxtNode::TryCharSetExpandToNum(const SfxItemSet& aCharSet) } // setze diese Attribute am TextNode. Wird der gesamte Bereich umspannt, -// dann setze sie nur im AutoAttrSet (SwCntntNode:: SetAttr) -bool SwTxtNode::SetAttr( +// dann setze sie nur im AutoAttrSet (SwContentNode:: SetAttr) +bool SwTextNode::SetAttr( const SfxItemSet& rSet, const sal_Int32 nStt, const sal_Int32 nEnd, @@ -1859,7 +1859,7 @@ bool SwTxtNode::SetAttr( // teil die Sets auf (fuer Selektion in Nodes) const SfxItemSet* pSet = &rSet; - SfxItemSet aTxtSet( *rSet.GetPool(), RES_TXTATR_BEGIN, RES_TXTATR_END-1 ); + SfxItemSet aTextSet( *rSet.GetPool(), RES_TXTATR_BEGIN, RES_TXTATR_END-1 ); // gesamter Bereich if ( !nStt && (nEnd == m_Text.getLength()) && @@ -1867,50 +1867,50 @@ bool SwTxtNode::SetAttr( { // sind am Node schon Zeichenvorlagen gesetzt, muss man diese Attribute // (rSet) immer als TextAttribute setzen, damit sie angezeigt werden. - bool bHasCharFmts = false; + bool bHasCharFormats = false; if ( HasHints() ) { for ( size_t n = 0; n < m_pSwpHints->Count(); ++n ) { - if ( (*m_pSwpHints)[ n ]->IsCharFmtAttr() ) + if ( (*m_pSwpHints)[ n ]->IsCharFormatAttr() ) { - bHasCharFmts = true; + bHasCharFormats = true; break; } } } - if( !bHasCharFmts ) + if( !bHasCharFormats ) { - aTxtSet.Put( rSet ); + aTextSet.Put( rSet ); // If there are any character attributes in rSet, // we want to set them at the paragraph: - if( aTxtSet.Count() != rSet.Count() ) + if( aTextSet.Count() != rSet.Count() ) { const bool bRet = SetAttr( rSet ); - if( !aTxtSet.Count() ) + if( !aTextSet.Count() ) return bRet; } // check for auto style: const SfxPoolItem* pItem; - const bool bAutoStyle = SfxItemState::SET == aTxtSet.GetItemState( RES_TXTATR_AUTOFMT, false, &pItem ); + const bool bAutoStyle = SfxItemState::SET == aTextSet.GetItemState( RES_TXTATR_AUTOFMT, false, &pItem ); if ( bAutoStyle ) { - std::shared_ptr<SfxItemSet> pAutoStyleSet = static_cast<const SwFmtAutoFmt*>(pItem)->GetStyleHandle(); + std::shared_ptr<SfxItemSet> pAutoStyleSet = static_cast<const SwFormatAutoFormat*>(pItem)->GetStyleHandle(); const bool bRet = SetAttr( *pAutoStyleSet ); - if( 1 == aTxtSet.Count() ) + if( 1 == aTextSet.Count() ) return bRet; } // Continue with the text attributes: - pSet = &aTxtSet; + pSet = &aTextSet; } } GetOrCreateSwpHints(); - SfxItemSet aCharSet( *rSet.GetPool(), aCharAutoFmtSetRange ); + SfxItemSet aCharSet( *rSet.GetPool(), aCharAutoFormatSetRange ); size_t nCount = 0; SfxItemIter aIter( *pSet ); @@ -1922,16 +1922,16 @@ bool SwTxtNode::SetAttr( { const sal_uInt16 nWhich = pItem->Which(); OSL_ENSURE( isCHRATR(nWhich) || isTXTATR(nWhich), - "SwTxtNode::SetAttr(): unknown attribute" ); + "SwTextNode::SetAttr(): unknown attribute" ); if ( isCHRATR(nWhich) || isTXTATR(nWhich) ) { if ((RES_TXTATR_CHARFMT == nWhich) && - (GetDoc()->GetDfltCharFmt() == - static_cast<const SwFmtCharFmt*>(pItem)->GetCharFmt())) + (GetDoc()->GetDfltCharFormat() == + static_cast<const SwFormatCharFormat*>(pItem)->GetCharFormat())) { SwIndex aIndex( this, nStt ); - RstTxtAttr( aIndex, nEnd - nStt, RES_TXTATR_CHARFMT, 0 ); - DontExpandFmt( aIndex ); + RstTextAttr( aIndex, nEnd - nStt, RES_TXTATR_CHARFMT, 0 ); + DontExpandFormat( aIndex ); } else { @@ -1943,7 +1943,7 @@ bool SwTxtNode::SetAttr( else { - SwTxtAttr *const pNew = MakeTxtAttr( *GetDoc(), + SwTextAttr *const pNew = MakeTextAttr( *GetDoc(), const_cast<SfxPoolItem&>(*pItem), nStt, nEnd ); if ( pNew ) { @@ -1968,7 +1968,7 @@ bool SwTxtNode::SetAttr( if ( aCharSet.Count() ) { - SwTxtAttr* pTmpNew = MakeTxtAttr( *GetDoc(), aCharSet, nStt, nEnd ); + SwTextAttr* pTmpNew = MakeTextAttr( *GetDoc(), aCharSet, nStt, nEnd ); if ( InsertHint( pTmpNew, nMode ) ) { ++nCount; @@ -1984,7 +1984,7 @@ static void lcl_MergeAttr( SfxItemSet& rSet, const SfxPoolItem& rAttr ) { if ( RES_TXTATR_AUTOFMT == rAttr.Which() ) { - const SfxItemSet* pCFSet = CharFmt::GetItemSet( rAttr ); + const SfxItemSet* pCFSet = CharFormat::GetItemSet( rAttr ); if ( !pCFSet ) return; SfxWhichIter aIter( *pCFSet ); @@ -2002,13 +2002,13 @@ static void lcl_MergeAttr( SfxItemSet& rSet, const SfxPoolItem& rAttr ) rSet.Put( rAttr ); } -static void lcl_MergeAttr_ExpandChrFmt( SfxItemSet& rSet, const SfxPoolItem& rAttr ) +static void lcl_MergeAttr_ExpandChrFormat( SfxItemSet& rSet, const SfxPoolItem& rAttr ) { if( RES_TXTATR_CHARFMT == rAttr.Which() || RES_TXTATR_INETFMT == rAttr.Which() || RES_TXTATR_AUTOFMT == rAttr.Which() ) { - const SfxItemSet* pCFSet = CharFmt::GetItemSet( rAttr ); + const SfxItemSet* pCFSet = CharFormat::GetItemSet( rAttr ); if ( pCFSet ) { @@ -2047,20 +2047,20 @@ public: SwPoolItemEndPair() : mpItem( 0 ), mnEndPos( 0 ) {}; }; -static void lcl_MergeListLevelIndentAsLRSpaceItem( const SwTxtNode& rTxtNode, +static void lcl_MergeListLevelIndentAsLRSpaceItem( const SwTextNode& rTextNode, SfxItemSet& rSet ) { - if ( rTxtNode.AreListLevelIndentsApplicable() ) + if ( rTextNode.AreListLevelIndentsApplicable() ) { - const SwNumRule* pRule = rTxtNode.GetNumRule(); - if ( pRule && rTxtNode.GetActualListLevel() >= 0 ) + const SwNumRule* pRule = rTextNode.GetNumRule(); + if ( pRule && rTextNode.GetActualListLevel() >= 0 ) { - const SwNumFmt& rFmt = pRule->Get(static_cast<sal_uInt16>(rTxtNode.GetActualListLevel())); - if ( rFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_ALIGNMENT ) + const SwNumFormat& rFormat = pRule->Get(static_cast<sal_uInt16>(rTextNode.GetActualListLevel())); + if ( rFormat.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_ALIGNMENT ) { SvxLRSpaceItem aLR( RES_LR_SPACE ); - aLR.SetTxtLeft( rFmt.GetIndentAt() ); - aLR.SetTxtFirstLineOfst( static_cast<short>(rFmt.GetFirstLineIndent()) ); + aLR.SetTextLeft( rFormat.GetIndentAt() ); + aLR.SetTextFirstLineOfst( static_cast<short>(rFormat.GetFirstLineIndent()) ); rSet.Put( aLR ); } } @@ -2068,8 +2068,8 @@ static void lcl_MergeListLevelIndentAsLRSpaceItem( const SwTxtNode& rTxtNode, } // erfrage die Attribute vom TextNode ueber den Bereich -bool SwTxtNode::GetAttr( SfxItemSet& rSet, sal_Int32 nStt, sal_Int32 nEnd, - const bool bOnlyTxtAttr, const bool bGetFromChrFmt, +bool SwTextNode::GetAttr( SfxItemSet& rSet, sal_Int32 nStt, sal_Int32 nEnd, + const bool bOnlyTextAttr, const bool bGetFromChrFormat, const bool bMergeIndentValuesOfNumRule ) const { if( HasHints() ) @@ -2087,17 +2087,17 @@ bool SwTxtNode::GetAttr( SfxItemSet& rSet, sal_Int32 nStt, sal_Int32 nEnd, */ void (*fnMergeAttr)( SfxItemSet&, const SfxPoolItem& ) - = bGetFromChrFmt ? &lcl_MergeAttr_ExpandChrFmt + = bGetFromChrFormat ? &lcl_MergeAttr_ExpandChrFormat : &lcl_MergeAttr; - // dann besorge mal die Auto-(Fmt)Attribute - SfxItemSet aFmtSet( *rSet.GetPool(), rSet.GetRanges() ); - if( !bOnlyTxtAttr ) + // dann besorge mal die Auto-(Format)Attribute + SfxItemSet aFormatSet( *rSet.GetPool(), rSet.GetRanges() ); + if( !bOnlyTextAttr ) { - SwCntntNode::GetAttr( aFmtSet ); + SwContentNode::GetAttr( aFormatSet ); if ( bMergeIndentValuesOfNumRule ) { - lcl_MergeListLevelIndentAsLRSpaceItem( *this, aFmtSet ); + lcl_MergeListLevelIndentAsLRSpaceItem( *this, aFormatSet ); } } @@ -2107,7 +2107,7 @@ bool SwTxtNode::GetAttr( SfxItemSet& rSet, sal_Int32 nStt, sal_Int32 nEnd, { for (size_t n = 0; n < nSize; ++n) { - const SwTxtAttr* pHt = (*m_pSwpHints)[n]; + const SwTextAttr* pHt = (*m_pSwpHints)[n]; const sal_Int32 nAttrStart = pHt->GetStart(); if( nAttrStart > nEnd ) // ueber den Bereich hinaus break; @@ -2133,7 +2133,7 @@ bool SwTxtNode::GetAttr( SfxItemSet& rSet, sal_Int32 nStt, sal_Int32 nEnd, for (size_t n = 0; n < nSize; ++n) { - const SwTxtAttr* pHt = (*m_pSwpHints)[n]; + const SwTextAttr* pHt = (*m_pSwpHints)[n]; const sal_Int32 nAttrStart = pHt->GetStart(); if( nAttrStart > nEnd ) // ueber den Bereich hinaus break; @@ -2149,14 +2149,14 @@ bool SwTxtNode::GetAttr( SfxItemSet& rSet, sal_Int32 nStt, sal_Int32 nEnd, continue; if( nEnd <= *pAttrEnd ) // hinter oder genau Ende - (*fnMergeAttr)( aFmtSet, pHt->GetAttr() ); + (*fnMergeAttr)( aFormatSet, pHt->GetAttr() ); else -// else if( pHt->GetAttr() != aFmtSet.Get( pHt->Which() ) ) +// else if( pHt->GetAttr() != aFormatSet.Get( pHt->Which() ) ) // uneindeutig bChkInvalid = true; } else if( nAttrStart < nEnd // reicht in den Bereich -)// && pHt->GetAttr() != aFmtSet.Get( pHt->Which() ) ) +)// && pHt->GetAttr() != aFormatSet.Get( pHt->Which() ) ) bChkInvalid = true; if( bChkInvalid ) @@ -2167,7 +2167,7 @@ bool SwTxtNode::GetAttr( SfxItemSet& rSet, sal_Int32 nStt, sal_Int32 nEnd, if ( RES_TXTATR_AUTOFMT == pHt->Which() ) { - const SfxItemSet* pAutoSet = CharFmt::GetItemSet( pHt->GetAttr() ); + const SfxItemSet* pAutoSet = CharFormat::GetItemSet( pHt->GetAttr() ); if ( pAutoSet ) { pItemIter.reset( new SfxItemIter( *pAutoSet ) ); @@ -2183,7 +2183,7 @@ bool SwTxtNode::GetAttr( SfxItemSet& rSet, sal_Int32 nStt, sal_Int32 nEnd, { const sal_uInt16 nHintWhich = pItem->Which(); OSL_ENSURE(!isUNKNOWNATR(nHintWhich), - "SwTxtNode::GetAttr(): unknown attribute?"); + "SwTextNode::GetAttr(): unknown attribute?"); if ( !pAttrArr.get() ) { @@ -2206,7 +2206,7 @@ bool SwTxtNode::GetAttr( SfxItemSet& rSet, sal_Int32 nStt, sal_Int32 nEnd, { if( !pPrev->mpItem ) { - if ( bOnlyTxtAttr || *pItem != aFmtSet.Get( nHintWhich ) ) + if ( bOnlyTextAttr || *pItem != aFormatSet.Get( nHintWhich ) ) { if( nAttrStart > nStt ) { @@ -2254,7 +2254,7 @@ bool SwTxtNode::GetAttr( SfxItemSet& rSet, sal_Int32 nStt, sal_Int32 nEnd, if( nEnd <= rItemPair.mnEndPos ) // hinter oder genau Ende { - if( *rItemPair.mpItem != aFmtSet.Get( nWh ) ) + if( *rItemPair.mpItem != aFormatSet.Get( nWh ) ) (*fnMergeAttr)( rSet, *rItemPair.mpItem ); } else @@ -2264,18 +2264,18 @@ bool SwTxtNode::GetAttr( SfxItemSet& rSet, sal_Int32 nStt, sal_Int32 nEnd, } } } - if( aFmtSet.Count() ) + if( aFormatSet.Count() ) { // aus dem Format-Set alle entfernen, die im TextSet auch gesetzt sind - aFmtSet.Differentiate( rSet ); + aFormatSet.Differentiate( rSet ); // jetzt alle zusammen "mergen" - rSet.Put( aFmtSet ); + rSet.Put( aFormatSet ); } } - else if( !bOnlyTxtAttr ) + else if( !bOnlyTextAttr ) { - // dann besorge mal die Auto-(Fmt)Attribute - SwCntntNode::GetAttr( rSet ); + // dann besorge mal die Auto-(Format)Attribute + SwContentNode::GetAttr( rSet ); if ( bMergeIndentValuesOfNumRule ) { lcl_MergeListLevelIndentAsLRSpaceItem( *this, rSet ); @@ -2289,7 +2289,7 @@ namespace { typedef std::pair<sal_Int32, sal_Int32> AttrSpan_t; -typedef std::multimap<AttrSpan_t, const SwTxtAttr*> AttrSpanMap_t; +typedef std::multimap<AttrSpan_t, const SwTextAttr*> AttrSpanMap_t; struct IsAutoStyle { @@ -2320,13 +2320,13 @@ struct RemovePresentAttrs return; } - const SwTxtAttr* const pAutoStyle(i_rAttrSpan.second); + const SwTextAttr* const pAutoStyle(i_rAttrSpan.second); SfxItemIter aIter(m_rAttrSet); const SfxPoolItem* pItem(aIter.GetCurItem()); while (pItem) { const sal_uInt16 nWhich(pItem->Which()); - if (CharFmt::IsItemIncluded(nWhich, pAutoStyle)) + if (CharFormat::IsItemIncluded(nWhich, pAutoStyle)) { m_rAttrSet.ClearItem(nWhich); } @@ -2357,7 +2357,7 @@ lcl_CollectHintSpans(const SwpHints& i_rHints, const sal_Int32 nLength, for (size_t i = 0; i < i_rHints.Count(); ++i) { - const SwTxtAttr* const pHint(i_rHints[i]); + const SwTextAttr* const pHint(i_rHints[i]); const sal_uInt16 nWhich(pHint->Which()); if (nWhich == RES_TXTATR_CHARFMT || nWhich == RES_TXTATR_AUTOFMT) { @@ -2369,7 +2369,7 @@ lcl_CollectHintSpans(const SwpHints& i_rHints, const sal_Int32 nLength, { // insert dummy span covering the gap o_rSpanMap.insert(AttrSpanMap_t::value_type( - AttrSpan_t(nLastEnd, aSpan.first), (const SwTxtAttr *)0)); + AttrSpan_t(nLastEnd, aSpan.first), (const SwTextAttr *)0)); } nLastEnd = aSpan.second; @@ -2380,7 +2380,7 @@ lcl_CollectHintSpans(const SwpHints& i_rHints, const sal_Int32 nLength, if (nLastEnd != nLength && nLength != 0) { o_rSpanMap.insert( - AttrSpanMap_t::value_type(AttrSpan_t(nLastEnd, nLength), (const SwTxtAttr *)0)); + AttrSpanMap_t::value_type(AttrSpan_t(nLastEnd, nLength), (const SwTextAttr *)0)); } } @@ -2411,11 +2411,11 @@ struct SfxItemSetClearer } -/** Does the hard work of SwTxtNode::FmtToTxtAttr: the real conversion +/** Does the hard work of SwTextNode::FormatToTextAttr: the real conversion of items to automatic styles. */ void -SwTxtNode::impl_FmtToTxtAttr(const SfxItemSet& i_rAttrSet) +SwTextNode::impl_FormatToTextAttr(const SfxItemSet& i_rAttrSet) { typedef AttrSpanMap_t::iterator AttrSpanMap_iterator_t; AttrSpanMap_t aAttrSpanMap; @@ -2454,9 +2454,9 @@ SwTxtNode::impl_FmtToTxtAttr(const SfxItemSet& i_rAttrSet) { // there already is an automatic style on that span: // create new one and remove the original one - SwTxtAttr* const pAutoStyle(const_cast<SwTxtAttr*>(aAutoStyleIt->second)); + SwTextAttr* const pAutoStyle(const_cast<SwTextAttr*>(aAutoStyleIt->second)); const std::shared_ptr<SfxItemSet> pOldStyle( - static_cast<const SwFmtAutoFmt&>( + static_cast<const SwFormatAutoFormat&>( pAutoStyle->GetAttr()).GetStyleHandle()); aCurSet.Put(*pOldStyle); @@ -2465,7 +2465,7 @@ SwTxtNode::impl_FmtToTxtAttr(const SfxItemSet& i_rAttrSet) DestroyAttr(pAutoStyle); } m_pSwpHints->Insert( - MakeTxtAttr(*GetDoc(), aCurSet, + MakeTextAttr(*GetDoc(), aCurSet, aCurRange->first.first, aCurRange->first.second)); } @@ -2481,9 +2481,9 @@ SwTxtNode::impl_FmtToTxtAttr(const SfxItemSet& i_rAttrSet) ClearItemsFromAttrSet(aClearedIds); } -void SwTxtNode::FmtToTxtAttr( SwTxtNode* pNd ) +void SwTextNode::FormatToTextAttr( SwTextNode* pNd ) { - SfxItemSet aThisSet( GetDoc()->GetAttrPool(), aCharFmtSetRange ); + SfxItemSet aThisSet( GetDoc()->GetAttrPool(), aCharFormatSetRange ); if( HasSwAttrSet() && GetpSwAttrSet()->Count() ) aThisSet.Put( *GetpSwAttrSet() ); @@ -2491,7 +2491,7 @@ void SwTxtNode::FmtToTxtAttr( SwTxtNode* pNd ) if( pNd == this ) { - impl_FmtToTxtAttr(aThisSet); + impl_FormatToTextAttr(aThisSet); } else { @@ -2506,7 +2506,7 @@ void SwTxtNode::FmtToTxtAttr( SwTxtNode* pNd ) // 4 a a clear item in this // 5 a b convert item to attr of this - SfxItemSet aNdSet( pNd->GetDoc()->GetAttrPool(), aCharFmtSetRange ); + SfxItemSet aNdSet( pNd->GetDoc()->GetAttrPool(), aCharFormatSetRange ); if( pNd->HasSwAttrSet() && pNd->GetpSwAttrSet()->Count() ) aNdSet.Put( *pNd->GetpSwAttrSet() ); @@ -2518,7 +2518,7 @@ void SwTxtNode::FmtToTxtAttr( SwTxtNode* pNd ) { SfxItemIter aIter( aThisSet ); const SfxPoolItem* pItem = aIter.GetCurItem(), *pNdItem = 0; - SfxItemSet aConvertSet( GetDoc()->GetAttrPool(), aCharFmtSetRange ); + SfxItemSet aConvertSet( GetDoc()->GetAttrPool(), aCharFormatSetRange ); std::vector<sal_uInt16> aClearWhichIds; while( true ) @@ -2549,7 +2549,7 @@ void SwTxtNode::FmtToTxtAttr( SwTxtNode* pNd ) ClearItemsFromAttrSet( aClearWhichIds ); // 2, 5/ convert all other items to attrs - impl_FmtToTxtAttr(aConvertSet); + impl_FormatToTextAttr(aConvertSet); } { @@ -2557,11 +2557,11 @@ void SwTxtNode::FmtToTxtAttr( SwTxtNode* pNd ) SfxItemSetClearer(aNdSet)); // 3/ convert items to attrs - pNd->impl_FmtToTxtAttr(aNdSet); + pNd->impl_FormatToTextAttr(aNdSet); if( aNdSet.Count() ) { - SwFmtChg aTmp1( pNd->GetFmtColl() ); + SwFormatChg aTmp1( pNd->GetFormatColl() ); pNd->NotifyClients( &aTmp1, &aTmp1 ); } } @@ -2578,7 +2578,7 @@ void SwpHints::CalcFlags() const size_t nSize = Count(); for( size_t nPos = 0; nPos < nSize; ++nPos ) { - const SwTxtAttr* pAttr = (*this)[ nPos ]; + const SwTextAttr* pAttr = (*this)[ nPos ]; switch( pAttr->Which() ) { case RES_TXTATR_FTN: @@ -2588,8 +2588,8 @@ void SwpHints::CalcFlags() break; case RES_TXTATR_FIELD: { - const SwField* pFld = pAttr->GetFmtFld().GetField(); - if( RES_DDEFLD == pFld->GetTyp()->Which() ) + const SwField* pField = pAttr->GetFormatField().GetField(); + if( RES_DDEFLD == pField->GetTyp()->Which() ) { m_bDDEFields = true; if ( m_bFootnote ) @@ -2607,19 +2607,19 @@ bool SwpHints::CalcHiddenParaField() bool bOldHasHiddenParaField = m_bHasHiddenParaField; bool bNewHasHiddenParaField = false; const size_t nSize = Count(); - const SwTxtAttr *pTxtHt; + const SwTextAttr *pTextHt; for( size_t nPos = 0; nPos < nSize; ++nPos ) { - pTxtHt = (*this)[ nPos ]; - const sal_uInt16 nWhich = pTxtHt->Which(); + pTextHt = (*this)[ nPos ]; + const sal_uInt16 nWhich = pTextHt->Which(); if( RES_TXTATR_FIELD == nWhich ) { - const SwFmtFld& rFld = pTxtHt->GetFmtFld(); - if( RES_HIDDENPARAFLD == rFld.GetField()->GetTyp()->Which() ) + const SwFormatField& rField = pTextHt->GetFormatField(); + if( RES_HIDDENPARAFLD == rField.GetField()->GetTyp()->Which() ) { - if( !static_cast<const SwHiddenParaField*>(rFld.GetField())->IsHidden() ) + if( !static_cast<const SwHiddenParaField*>(rField.GetField())->IsHidden() ) { SetHiddenParaField(false); return bOldHasHiddenParaField != bNewHasHiddenParaField; @@ -2635,12 +2635,12 @@ bool SwpHints::CalcHiddenParaField() return bOldHasHiddenParaField != bNewHasHiddenParaField; } -void SwpHints::NoteInHistory( SwTxtAttr *pAttr, const bool bNew ) +void SwpHints::NoteInHistory( SwTextAttr *pAttr, const bool bNew ) { if ( m_pHistory ) { m_pHistory->AddHint( pAttr, bNew ); } } -bool SwpHints::MergePortions( SwTxtNode& rNode ) +bool SwpHints::MergePortions( SwTextNode& rNode ) { if ( !Count() ) return false; @@ -2649,28 +2649,28 @@ bool SwpHints::MergePortions( SwTxtNode& rNode ) SwpHintsArray::Resort(); bool bRet = false; - typedef std::multimap< int, std::pair<SwTxtAttr*, bool> > PortionMap; + typedef std::multimap< int, std::pair<SwTextAttr*, bool> > PortionMap; PortionMap aPortionMap; - std::map<int, bool> RsidOnlyAutoFmtFlagMap; + std::map<int, bool> RsidOnlyAutoFormatFlagMap; sal_Int32 nLastPorStart = COMPLETE_STRING; int nKey = 0; // get portions by start position: for ( size_t i = 0; i < Count(); ++i ) { - SwTxtAttr *pHt = GetTextHint( i ); + SwTextAttr *pHt = GetTextHint( i ); if ( RES_TXTATR_CHARFMT != pHt->Which() && RES_TXTATR_AUTOFMT != pHt->Which() ) //&& //RES_TXTATR_INETFMT != pHt->Which() ) continue; - bool isRsidOnlyAutoFmt(false); + bool isRsidOnlyAutoFormat(false); // check for RSID-only AUTOFMT if (RES_TXTATR_AUTOFMT == pHt->Which()) { std::shared_ptr<SfxItemSet> const pSet( - pHt->GetAutoFmt().GetStyleHandle()); + pHt->GetAutoFormat().GetStyleHandle()); if ((pSet->Count() == 1) && pSet->GetItem(RES_CHRATR_RSID, false)) { // fdo#70201: eliminate no-extent RSID-only AUTOFMT @@ -2678,7 +2678,7 @@ bool SwpHints::MergePortions( SwTxtNode& rNode ) if (pHt->GetStart() == *pHt->GetEnd()) { SwpHintsArray::DeleteAtPos(i); // kill it without History! - SwTxtAttr::Destroy(pHt, rNode.GetDoc()->GetAttrPool()); + SwTextAttr::Destroy(pHt, rNode.GetDoc()->GetAttrPool()); --i; continue; } @@ -2690,7 +2690,7 @@ bool SwpHints::MergePortions( SwTxtNode& rNode ) pHt->SetFormatIgnoreEnd (true); NoteInHistory(pHt, true); } - isRsidOnlyAutoFmt = true; + isRsidOnlyAutoFormat = true; } } @@ -2706,8 +2706,8 @@ bool SwpHints::MergePortions( SwTxtNode& rNode ) ++nKey; nLastPorStart = nPorStart; aPortionMap.insert(std::make_pair(nKey, - std::make_pair(pHt, isRsidOnlyAutoFmt))); - RsidOnlyAutoFmtFlagMap[nKey] = isRsidOnlyAutoFmt; + std::make_pair(pHt, isRsidOnlyAutoFormat))); + RsidOnlyAutoFormatFlagMap[nKey] = isRsidOnlyAutoFormat; } // check if portion i can be merged with portion i+1: @@ -2725,17 +2725,17 @@ bool SwpHints::MergePortions( SwTxtNode& rNode ) enum { MATCH, DIFFER_ONLY_RSID, DIFFER } eMerge(MATCH); size_t const nAttributesInPor1 = std::distance(aRange1.first, aRange1.second); size_t const nAttributesInPor2 = std::distance(aRange2.first, aRange2.second); - bool const isRsidOnlyAutoFmt1(RsidOnlyAutoFmtFlagMap[i]); - bool const isRsidOnlyAutoFmt2(RsidOnlyAutoFmtFlagMap[j]); + bool const isRsidOnlyAutoFormat1(RsidOnlyAutoFormatFlagMap[i]); + bool const isRsidOnlyAutoFormat2(RsidOnlyAutoFormatFlagMap[j]); // if both have one they could be equal, but not if only one has it - bool const bSkipRsidOnlyAutoFmt(nAttributesInPor1 != nAttributesInPor2); + bool const bSkipRsidOnlyAutoFormat(nAttributesInPor1 != nAttributesInPor2); // this loop needs to handle the case where one has a CHARFMT and the // other CHARFMT + RSID-only AUTOFMT, so... // want to skip over RSID-only AUTOFMT here, hence the -1 - if ((nAttributesInPor1 - ((isRsidOnlyAutoFmt1) ? 1 : 0)) == - (nAttributesInPor2 - ((isRsidOnlyAutoFmt2) ? 1 : 0)) + if ((nAttributesInPor1 - ((isRsidOnlyAutoFormat1) ? 1 : 0)) == + (nAttributesInPor2 - ((isRsidOnlyAutoFormat2) ? 1 : 0)) && (nAttributesInPor1 != 0 || nAttributesInPor2 != 0)) { // _if_ there is one element more either in aRange1 or aRange2 @@ -2750,8 +2750,8 @@ bool SwpHints::MergePortions( SwTxtNode& rNode ) eMerge = DIFFER; break; } - // skip it - cannot be equal if bSkipRsidOnlyAutoFmt is set - if (bSkipRsidOnlyAutoFmt + // skip it - cannot be equal if bSkipRsidOnlyAutoFormat is set + if (bSkipRsidOnlyAutoFormat && aIter1 != aRange1.second && aIter1->second.second) { assert(DIFFER != eMerge); @@ -2759,7 +2759,7 @@ bool SwpHints::MergePortions( SwTxtNode& rNode ) ++aIter1; continue; } - if (bSkipRsidOnlyAutoFmt + if (bSkipRsidOnlyAutoFormat && aIter2 != aRange2.second && aIter2->second.second) { assert(DIFFER != eMerge); @@ -2768,8 +2768,8 @@ bool SwpHints::MergePortions( SwTxtNode& rNode ) continue; } assert(aIter1 != aRange1.second && aIter2 != aRange2.second); - SwTxtAttr const*const p1 = aIter1->second.first; - SwTxtAttr const*const p2 = aIter2->second.first; + SwTextAttr const*const p1 = aIter1->second.first; + SwTextAttr const*const p2 = aIter2->second.first; if (p1->Which() != p2->Which()) { eMerge = DIFFER; @@ -2781,8 +2781,8 @@ bool SwpHints::MergePortions( SwTxtNode& rNode ) // in the RSID, which should have no effect on text layout if (RES_TXTATR_AUTOFMT == p1->Which()) { - SfxItemSet set1(*p1->GetAutoFmt().GetStyleHandle()); - SfxItemSet set2(*p2->GetAutoFmt().GetStyleHandle()); + SfxItemSet set1(*p1->GetAutoFormat().GetStyleHandle()); + SfxItemSet set2(*p2->GetAutoFormat().GetStyleHandle()); set1.ClearItem(RES_CHRATR_RSID); set2.ClearItem(RES_CHRATR_RSID); @@ -2843,7 +2843,7 @@ bool SwpHints::MergePortions( SwTxtNode& rNode ) sal_Int32 nNewPortionEnd = 0; for ( aIter2 = aRange2.first; aIter2 != aRange2.second; ++aIter2 ) { - SwTxtAttr *const p2 = aIter2->second.first; + SwTextAttr *const p2 = aIter2->second.first; nNewPortionEnd = *p2->GetEnd(); const size_t nCountBeforeDelete = Count(); @@ -2860,7 +2860,7 @@ bool SwpHints::MergePortions( SwTxtNode& rNode ) aRange1 = aPortionMap.equal_range( i ); for ( aIter1 = aRange1.first; aIter1 != aRange1.second; ++aIter1 ) { - SwTxtAttr *const p1 = aIter1->second.first; + SwTextAttr *const p1 = aIter1->second.first; NoteInHistory( p1 ); *p1->GetEnd() = nNewPortionEnd; NoteInHistory( p1, true ); @@ -2881,7 +2881,7 @@ bool SwpHints::MergePortions( SwTxtNode& rNode ) { if (!aIter1->second.second) // already set above, don't change { - SwTxtAttr *const pCurrent(aIter1->second.first); + SwTextAttr *const pCurrent(aIter1->second.first); if (pCurrent->IsFormatIgnoreEnd() != bSetIgnoreFlag) { NoteInHistory(pCurrent); @@ -2894,7 +2894,7 @@ bool SwpHints::MergePortions( SwTxtNode& rNode ) { if (!aIter2->second.second) // already set above, don't change { - SwTxtAttr *const pCurrent(aIter2->second.first); + SwTextAttr *const pCurrent(aIter2->second.first); if (pCurrent->IsFormatIgnoreStart() != bSetIgnoreFlag) { NoteInHistory(pCurrent); @@ -2912,15 +2912,15 @@ bool SwpHints::MergePortions( SwTxtNode& rNode ) } // check if there is already a character format and adjust the sort numbers -static void lcl_CheckSortNumber( const SwpHints& rHints, SwTxtCharFmt& rNewCharFmt ) +static void lcl_CheckSortNumber( const SwpHints& rHints, SwTextCharFormat& rNewCharFormat ) { - const sal_Int32 nHtStart = rNewCharFmt.GetStart(); - const sal_Int32 nHtEnd = *rNewCharFmt.GetEnd(); + const sal_Int32 nHtStart = rNewCharFormat.GetStart(); + const sal_Int32 nHtEnd = *rNewCharFormat.GetEnd(); sal_uInt16 nSortNumber = 0; for ( size_t i = 0; i < rHints.Count(); ++i ) { - const SwTxtAttr* pOtherHt = rHints[i]; + const SwTextAttr* pOtherHt = rHints[i]; const sal_Int32 nOtherStart = pOtherHt->GetStart(); @@ -2933,13 +2933,13 @@ static void lcl_CheckSortNumber( const SwpHints& rHints, SwTxtCharFmt& rNewCharF if ( nOtherStart == nHtStart && nOtherEnd == nHtEnd ) { - nSortNumber = static_txtattr_cast<const SwTxtCharFmt*>(pOtherHt)->GetSortNumber() + 1; + nSortNumber = static_txtattr_cast<const SwTextCharFormat*>(pOtherHt)->GetSortNumber() + 1; } } } if ( nSortNumber > 0 ) - rNewCharFmt.SetSortNumber( nSortNumber ); + rNewCharFormat.SetSortNumber( nSortNumber ); } /* @@ -2950,8 +2950,8 @@ static void lcl_CheckSortNumber( const SwpHints& rHints, SwTxtCharFmt& rNewCharF * The return value indicates successful insertion. */ bool SwpHints::TryInsertHint( - SwTxtAttr* const pHint, - SwTxtNode &rNode, + SwTextAttr* const pHint, + SwTextNode &rNode, const SetAttrMode nMode ) { if ( MAX_HINTS <= Count() ) // we're sorry, this flight is overbooked... @@ -2975,18 +2975,18 @@ bool SwpHints::TryInsertHint( case RES_TXTATR_CHARFMT: { // Check if character format contains hidden attribute: - const SwCharFmt* pFmt = pHint->GetCharFmt().GetCharFmt(); + const SwCharFormat* pFormat = pHint->GetCharFormat().GetCharFormat(); const SfxPoolItem* pItem; - if ( SfxItemState::SET == pFmt->GetItemState( RES_CHRATR_HIDDEN, true, &pItem ) ) + if ( SfxItemState::SET == pFormat->GetItemState( RES_CHRATR_HIDDEN, true, &pItem ) ) rNode.SetCalcHiddenCharFlags(); - static_txtattr_cast<SwTxtCharFmt*>(pHint)->ChgTxtNode( &rNode ); + static_txtattr_cast<SwTextCharFormat*>(pHint)->ChgTextNode( &rNode ); break; } // #i75430# Recalc hidden flags if necessary case RES_TXTATR_AUTOFMT: { - std::shared_ptr<SfxItemSet> const pSet( pHint->GetAutoFmt().GetStyleHandle() ); + std::shared_ptr<SfxItemSet> const pSet( pHint->GetAutoFormat().GetStyleHandle() ); if (pHint->GetStart() == *pHint->GetEnd()) { if (pSet->Count() == 1 && pSet->GetItem(RES_CHRATR_RSID, false)) @@ -2996,11 +2996,11 @@ bool SwpHints::TryInsertHint( } } // Check if auto style contains hidden attribute: - const SfxPoolItem* pHiddenItem = CharFmt::GetItem( *pHint, RES_CHRATR_HIDDEN ); + const SfxPoolItem* pHiddenItem = CharFormat::GetItem( *pHint, RES_CHRATR_HIDDEN ); if ( pHiddenItem ) rNode.SetCalcHiddenCharFlags(); - // fdo#71556: populate aWhichFmtAttr member of SwMsgPoolItem + // fdo#71556: populate aWhichFormatAttr member of SwMsgPoolItem const sal_uInt16 *pRanges = pSet->GetRanges(); while( (*pRanges) != 0 ) { @@ -3015,24 +3015,24 @@ bool SwpHints::TryInsertHint( break; } case RES_TXTATR_INETFMT: - static_txtattr_cast<SwTxtINetFmt*>(pHint)->InitINetFmt(rNode); + static_txtattr_cast<SwTextINetFormat*>(pHint)->InitINetFormat(rNode); break; case RES_TXTATR_FIELD: case RES_TXTATR_ANNOTATION: case RES_TXTATR_INPUTFIELD: { - SwTxtFld *const pTxtFld(static_txtattr_cast<SwTxtFld*>(pHint)); - bool bDelFirst = 0 != pTxtFld->GetpTxtNode(); - pTxtFld->ChgTxtNode( &rNode ); + SwTextField *const pTextField(static_txtattr_cast<SwTextField*>(pHint)); + bool bDelFirst = 0 != pTextField->GetpTextNode(); + pTextField->ChgTextNode( &rNode ); SwDoc* pDoc = rNode.GetDoc(); - const SwField* pFld = pTxtFld->GetFmtFld().GetField(); + const SwField* pField = pTextField->GetFormatField().GetField(); - if( !pDoc->getIDocumentFieldsAccess().IsNewFldLst() ) + if( !pDoc->getIDocumentFieldsAccess().IsNewFieldLst() ) { // was fuer ein Feld ist es denn ?? // bestimmte Felder mussen am Doc das Calculations-Flag updaten - switch( pFld->GetTyp()->Which() ) + switch( pField->GetTyp()->Which() ) { case RES_DBFLD: case RES_SETEXPFLD: @@ -3042,14 +3042,14 @@ bool SwpHints::TryInsertHint( case RES_DBNEXTSETFLD: { if( bDelFirst ) - pDoc->getIDocumentFieldsAccess().InsDelFldInFldLst(false, *pTxtFld); + pDoc->getIDocumentFieldsAccess().InsDelFieldInFieldLst(false, *pTextField); if( rNode.GetNodes().IsDocNodes() ) - pDoc->getIDocumentFieldsAccess().InsDelFldInFldLst(true, *pTxtFld); + pDoc->getIDocumentFieldsAccess().InsDelFieldInFieldLst(true, *pTextField); } break; case RES_DDEFLD: if( rNode.GetNodes().IsDocNodes() ) - static_cast<SwDDEFieldType*>(pFld->GetTyp())->IncRefCnt(); + static_cast<SwDDEFieldType*>(pField->GetTyp())->IncRefCnt(); break; } } @@ -3057,58 +3057,58 @@ bool SwpHints::TryInsertHint( // gehts ins normale Nodes-Array? if( rNode.GetNodes().IsDocNodes() ) { - bool bInsFldType = false; - switch( pFld->GetTyp()->Which() ) + bool bInsFieldType = false; + switch( pField->GetTyp()->Which() ) { case RES_SETEXPFLD: - bInsFldType = static_cast<SwSetExpFieldType*>(pFld->GetTyp())->IsDeleted(); - if( nsSwGetSetExpType::GSE_SEQ & static_cast<SwSetExpFieldType*>(pFld->GetTyp())->GetType() ) + bInsFieldType = static_cast<SwSetExpFieldType*>(pField->GetTyp())->IsDeleted(); + if( nsSwGetSetExpType::GSE_SEQ & static_cast<SwSetExpFieldType*>(pField->GetTyp())->GetType() ) { // bevor die ReferenzNummer gesetzt wird, sollte // das Feld am richtigen FeldTypen haengen! - SwSetExpFieldType* pFldType = static_cast<SwSetExpFieldType*>( - pDoc->getIDocumentFieldsAccess().InsertFldType( *pFld->GetTyp() ) ); - if( pFldType != pFld->GetTyp() ) + SwSetExpFieldType* pFieldType = static_cast<SwSetExpFieldType*>( + pDoc->getIDocumentFieldsAccess().InsertFieldType( *pField->GetTyp() ) ); + if( pFieldType != pField->GetTyp() ) { - SwFmtFld* pFmtFld = const_cast<SwFmtFld*>(&pTxtFld->GetFmtFld()); - pFmtFld->RegisterToFieldType( *pFldType ); - pFmtFld->GetField()->ChgTyp( pFldType ); + SwFormatField* pFormatField = const_cast<SwFormatField*>(&pTextField->GetFormatField()); + pFormatField->RegisterToFieldType( *pFieldType ); + pFormatField->GetField()->ChgTyp( pFieldType ); } - pFldType->SetSeqRefNo( *const_cast<SwSetExpField*>(static_cast<const SwSetExpField*>(pFld)) ); + pFieldType->SetSeqRefNo( *const_cast<SwSetExpField*>(static_cast<const SwSetExpField*>(pField)) ); } break; case RES_USERFLD: - bInsFldType = static_cast<SwUserFieldType*>(pFld->GetTyp())->IsDeleted(); + bInsFieldType = static_cast<SwUserFieldType*>(pField->GetTyp())->IsDeleted(); break; case RES_DDEFLD: - if( pDoc->getIDocumentFieldsAccess().IsNewFldLst() ) - static_cast<SwDDEFieldType*>(pFld->GetTyp())->IncRefCnt(); - bInsFldType = static_cast<SwDDEFieldType*>(pFld->GetTyp())->IsDeleted(); + if( pDoc->getIDocumentFieldsAccess().IsNewFieldLst() ) + static_cast<SwDDEFieldType*>(pField->GetTyp())->IncRefCnt(); + bInsFieldType = static_cast<SwDDEFieldType*>(pField->GetTyp())->IsDeleted(); break; case RES_POSTITFLD: if ( pDoc->GetDocShell() ) { - pDoc->GetDocShell()->Broadcast( SwFmtFldHint( - &pTxtFld->GetFmtFld(), SwFmtFldHintWhich::INSERTED)); + pDoc->GetDocShell()->Broadcast( SwFormatFieldHint( + &pTextField->GetFormatField(), SwFormatFieldHintWhich::INSERTED)); } break; } - if( bInsFldType ) - pDoc->getIDocumentFieldsAccess().InsDeletedFldType( *pFld->GetTyp() ); + if( bInsFieldType ) + pDoc->getIDocumentFieldsAccess().InsDeletedFieldType( *pField->GetTyp() ); } } break; case RES_TXTATR_FTN : - static_cast<SwTxtFtn*>(pHint)->ChgTxtNode( &rNode ); + static_cast<SwTextFootnote*>(pHint)->ChgTextNode( &rNode ); break; case RES_TXTATR_REFMARK: - static_txtattr_cast<SwTxtRefMark*>(pHint)->ChgTxtNode( &rNode ); + static_txtattr_cast<SwTextRefMark*>(pHint)->ChgTextNode( &rNode ); if( rNode.GetNodes().IsDocNodes() ) { // search for a reference with the same name - SwTxtAttr* pTmpHt; + SwTextAttr* pTmpHt; sal_Int32 *pTmpHtEnd; sal_Int32 *pTmpHintEnd; for( size_t n = 0, nEnd = Count(); n < nEnd; ++n ) @@ -3152,16 +3152,16 @@ bool SwpHints::TryInsertHint( } break; case RES_TXTATR_TOXMARK: - static_txtattr_cast<SwTxtTOXMark*>(pHint)->ChgTxtNode( &rNode ); + static_txtattr_cast<SwTextTOXMark*>(pHint)->ChgTextNode( &rNode ); break; case RES_TXTATR_CJK_RUBY: - static_txtattr_cast<SwTxtRuby*>(pHint)->InitRuby(rNode); + static_txtattr_cast<SwTextRuby*>(pHint)->InitRuby(rNode); break; case RES_TXTATR_META: case RES_TXTATR_METAFIELD: - static_txtattr_cast<SwTxtMeta *>(pHint)->ChgTxtNode( &rNode ); + static_txtattr_cast<SwTextMeta *>(pHint)->ChgTextNode( &rNode ); break; case RES_CHRATR_HIDDEN: @@ -3172,10 +3172,10 @@ bool SwpHints::TryInsertHint( if( SetAttrMode::DONTEXPAND & nMode ) pHint->SetDontExpand( true ); - // SwTxtAttrs ohne Ende werden sonderbehandelt: + // SwTextAttrs ohne Ende werden sonderbehandelt: // Sie werden natuerlich in das Array insertet, aber sie werden nicht // in die pPrev/Next/On/Off-Verkettung aufgenommen. - // Der Formatierer erkennt diese TxtHints an dem CH_TXTATR_.. im Text ! + // Der Formatierer erkennt diese TextHints an dem CH_TXTATR_.. im Text ! sal_Int32 nHtStart = pHint->GetStart(); if( !pHtEnd ) { @@ -3220,7 +3220,7 @@ bool SwpHints::TryInsertHint( if (pHint->IsNesting()) { const bool bRet( - TryInsertNesting(rNode, *static_txtattr_cast<SwTxtAttrNesting*>(pHint))); + TryInsertNesting(rNode, *static_txtattr_cast<SwTextAttrNesting*>(pHint))); if (!bRet) return false; } // Currently REFMARK and TOXMARK have OverlapAllowed set to true. @@ -3235,7 +3235,7 @@ bool SwpHints::TryInsertHint( RES_TXTATR_CHARFMT == nWhich ) ) { OSL_ENSURE( nWhich != RES_TXTATR_AUTOFMT || - static_cast<const SwFmtAutoFmt&>(pHint->GetAttr()).GetStyleHandle()->GetPool() == + static_cast<const SwFormatAutoFormat&>(pHint->GetAttr()).GetStyleHandle()->GetPool() == &rNode.GetDoc()->GetAttrPool(), "AUTOSTYLES - Pool mismatch" ); @@ -3262,7 +3262,7 @@ bool SwpHints::TryInsertHint( { // #i82989# Check sort numbers in NoHintAdjustMode if ( RES_TXTATR_CHARFMT == nWhich ) - lcl_CheckSortNumber(*this, *static_txtattr_cast<SwTxtCharFmt*>(pHint)); + lcl_CheckSortNumber(*this, *static_txtattr_cast<SwTextCharFormat*>(pHint)); SwpHintsArray::Insert( pHint ); NoteInHistory( pHint, true ); @@ -3290,33 +3290,33 @@ bool SwpHints::TryInsertHint( void SwpHints::DeleteAtPos( const size_t nPos ) { - SwTxtAttr *pHint = GetTextHint(nPos); + SwTextAttr *pHint = GetTextHint(nPos); // ChainDelete( pHint ); NoteInHistory( pHint ); SwpHintsArray::DeleteAtPos( nPos ); if( pHint->Which() == RES_TXTATR_FIELD ) { - SwTxtFld *const pTxtFld(static_txtattr_cast<SwTxtFld*>(pHint)); - const SwFieldType* pFldTyp = pTxtFld->GetFmtFld().GetField()->GetTyp(); - if( RES_DDEFLD == pFldTyp->Which() ) + SwTextField *const pTextField(static_txtattr_cast<SwTextField*>(pHint)); + const SwFieldType* pFieldTyp = pTextField->GetFormatField().GetField()->GetTyp(); + if( RES_DDEFLD == pFieldTyp->Which() ) { - const SwTxtNode* pNd = pTxtFld->GetpTxtNode(); + const SwTextNode* pNd = pTextField->GetpTextNode(); if( pNd && pNd->GetNodes().IsDocNodes() ) - const_cast<SwDDEFieldType*>(static_cast<const SwDDEFieldType*>(pFldTyp))->DecRefCnt(); - pTxtFld->ChgTxtNode(0); + const_cast<SwDDEFieldType*>(static_cast<const SwDDEFieldType*>(pFieldTyp))->DecRefCnt(); + pTextField->ChgTextNode(0); } else if ( m_bHasHiddenParaField && - RES_HIDDENPARAFLD == pFldTyp->Which() ) + RES_HIDDENPARAFLD == pFieldTyp->Which() ) { m_bCalcHiddenParaField = true; } } else if ( pHint->Which() == RES_TXTATR_ANNOTATION ) { - SwTxtFld *const pTxtFld(static_txtattr_cast<SwTxtFld*>(pHint)); - const_cast<SwFmtFld&>(pTxtFld->GetFmtFld()).Broadcast( - SwFmtFldHint(&pTxtFld->GetFmtFld(), SwFmtFldHintWhich::REMOVED)); + SwTextField *const pTextField(static_txtattr_cast<SwTextField*>(pHint)); + const_cast<SwFormatField&>(pTextField->GetFormatField()).Broadcast( + SwFormatFieldHint(&pTextField->GetFormatField(), SwFormatFieldHintWhich::REMOVED)); } CalcFlags(); @@ -3326,23 +3326,23 @@ void SwpHints::DeleteAtPos( const size_t nPos ) // Ist der Hint schon bekannt, dann suche die Position und loesche ihn. // Ist er nicht im Array, so gibt es ein OSL_ENSURE(!! -void SwpHints::Delete( SwTxtAttr* pTxtHt ) +void SwpHints::Delete( SwTextAttr* pTextHt ) { - // Attr 2.0: SwpHintsArr::Delete( pTxtHt ); - const size_t nPos = GetStartOf( pTxtHt ); + // Attr 2.0: SwpHintsArr::Delete( pTextHt ); + const size_t nPos = GetStartOf( pTextHt ); OSL_ENSURE( SAL_MAX_SIZE != nPos, "Attribut nicht im Attribut-Array!" ); if( SAL_MAX_SIZE != nPos ) DeleteAtPos( nPos ); } -void SwTxtNode::ClearSwpHintsArr( bool bDelFields ) +void SwTextNode::ClearSwpHintsArr( bool bDelFields ) { if ( HasHints() ) { size_t nPos = 0; while ( nPos < m_pSwpHints->Count() ) { - SwTxtAttr* pDel = m_pSwpHints->GetTextHint( nPos ); + SwTextAttr* pDel = m_pSwpHints->GetTextHint( nPos ); bool bDel = false; switch( pDel->Which() ) @@ -3372,7 +3372,7 @@ void SwTxtNode::ClearSwpHintsArr( bool bDelFields ) } } -sal_uInt16 SwTxtNode::GetLang( const sal_Int32 nBegin, const sal_Int32 nLen, +sal_uInt16 SwTextNode::GetLang( const sal_Int32 nBegin, const sal_Int32 nLen, sal_uInt16 nScript ) const { sal_uInt16 nRet = LANGUAGE_DONTKNOW; @@ -3392,7 +3392,7 @@ sal_uInt16 SwTxtNode::GetLang( const sal_Int32 nBegin, const sal_Int32 nLen, for ( size_t i = 0; i < nSize; ++i ) { // ist der Attribut-Anfang schon groesser als der Idx ? - const SwTxtAttr *pHt = m_pSwpHints->operator[](i); + const SwTextAttr *pHt = m_pSwpHints->operator[](i); const sal_Int32 nAttrStart = pHt->GetStart(); if( nEnd < nAttrStart ) break; @@ -3400,7 +3400,7 @@ sal_uInt16 SwTxtNode::GetLang( const sal_Int32 nBegin, const sal_Int32 nLen, const sal_uInt16 nWhich = pHt->Which(); if( nWhichId == nWhich || - ( ( pHt->IsCharFmtAttr() || RES_TXTATR_AUTOFMT == nWhich ) && CharFmt::IsItemIncluded( nWhichId, pHt ) ) ) + ( ( pHt->IsCharFormatAttr() || RES_TXTATR_AUTOFMT == nWhich ) && CharFormat::IsItemIncluded( nWhichId, pHt ) ) ) { const sal_Int32 *pEndIdx = pHt->End(); // Ueberlappt das Attribut den Bereich? @@ -3419,7 +3419,7 @@ sal_uInt16 SwTxtNode::GetLang( const sal_Int32 nBegin, const sal_Int32 nLen, if( pHt->DontExpand() ? nBegin >= *pEndIdx : nBegin > *pEndIdx) continue; } - const SfxPoolItem* pItem = CharFmt::GetItem( *pHt, nWhichId ); + const SfxPoolItem* pItem = CharFormat::GetItem( *pHt, nWhichId ); const sal_uInt16 nLng = static_cast<const SvxLanguageItem*>(pItem)->GetLanguage(); // Umfasst das Attribut den Bereich komplett? @@ -3439,7 +3439,7 @@ sal_uInt16 SwTxtNode::GetLang( const sal_Int32 nBegin, const sal_Int32 nLen, return nRet; } -sal_Unicode GetCharOfTxtAttr( const SwTxtAttr& rAttr ) +sal_Unicode GetCharOfTextAttr( const SwTextAttr& rAttr ) { sal_Unicode cRet = CH_TXTATR_BREAKWORD; switch ( rAttr.Which() ) @@ -3461,7 +3461,7 @@ sal_Unicode GetCharOfTxtAttr( const SwTxtAttr& rAttr ) break; default: - OSL_FAIL("GetCharOfTxtAttr: unknown attr"); + OSL_FAIL("GetCharOfTextAttr: unknown attr"); break; } return cRet; |