diff options
author | Alex Ivan <alexnivan@yahoo.com> | 2013-09-07 19:29:59 +0300 |
---|---|---|
committer | Alex Ivan <alexnivan@yahoo.com> | 2013-09-07 19:29:59 +0300 |
commit | d1b17ec6e6a994f7e835bb25117f335bed90783d (patch) | |
tree | 3dbb97df9deffdf30d716a9fab494c689cd95b6c | |
parent | 452435c85c5fbe1e62ec81bc39deccb646a78bf6 (diff) |
Fix SwAttrHandler::Init to take parent attribute set into account
The new implementation might not be as efficient as the previous, but
the functionality is preserved. The change allows the correct text
properties from the table style to be taken into consideration.
Change-Id: Icf1460a40baa0c10c6234b05113b1c75848cb4da
-rw-r--r-- | sw/source/core/text/atrstck.cxx | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/sw/source/core/text/atrstck.cxx b/sw/source/core/text/atrstck.cxx index 2747f26077fa..a7dac25a531d 100644 --- a/sw/source/core/text/atrstck.cxx +++ b/sw/source/core/text/atrstck.cxx @@ -419,26 +419,16 @@ void SwAttrHandler::Init( const SfxPoolItem** pPoolItem, const SwAttrSet* pAS, // do we have to apply additional paragraph attributes? bVertLayout = bVL; - if ( pAS && pAS->Count() ) - { - SfxItemIter aIter( *pAS ); - sal_uInt16 nWhich; - const SfxPoolItem* pItem = aIter.GetCurItem(); - while( true ) + if( pAS ) + for ( sal_uInt16 i = RES_CHRATR_BEGIN; i < RES_CHRATR_END; i++ ) { - nWhich = pItem->Which(); - if (isCHRATR(nWhich)) + const SfxPoolItem* pItem = 0; + if( SFX_ITEM_SET == pAS->GetItemState( i, sal_True, &pItem ) ) { - pDefaultArray[ StackPos[ nWhich ] ] = pItem; + pDefaultArray[ StackPos[ i ] ] = pItem; FontChg( *pItem, rFnt, sal_True ); } - - if( aIter.IsAtEnd() ) - break; - - pItem = aIter.NextItem(); } - } // It is possible, that Init is called more than once, e.g., in a // SwTxtFrm::FormatOnceMore situation. |