Hi Max,
On 09/17/08 12:29, Maximilian Odendahl wrote:
The problem here is that this needs to go into svx, and different kinds
of EditEngines are involved, so this easy mapping based on writer core
or EditEngine is not possible, therefore the possible solution with the
typeinfo.
I had a look at the code in svx/source/editeng/edtspell.cxx and was
somewhat astonished to find this:
sal_Bool EdtAutoCorrDoc::SetAttr( sal_uInt16 nStt, sal_uInt16 nEnd,
sal_uInt16 nSlotId, SfxPoolItem& rItem )
{
SfxItemPool* pPool = &pImpEE->GetEditDoc().GetItemPool();
while ( pPool->GetSecondaryPool() &&
pPool->GetName().EqualsAscii( "EditEngineItemPool" ) )
{
pPool = pPool->GetSecondaryPool();
}
sal_uInt16 nWhich = pPool->GetWhich( nSlotId );
...
So this means we skip all item pools at the beginning of the item pool
chain, as long as we found one with a name different from
"EditEngineItemPool" or we reach the end of the item pool chain.
The while loop only makes sense, if there are more than one
"EditEngineItemPools" in the pool chain. Strange. And why should be skip
the "EditEngineItemPools", although we are currently "inside" the
EditEngine?
So I suspect the code just misses a "!" and should read:
while ( pPool->GetSecondaryPool() &&
!pPool->GetName().EqualsAscii( "EditEngineItemPool" ) )
{
pPool = pPool->GetSecondaryPool();
}
which translates to: Skip any item pool with a name different from
"EditEngineItemPool" but stop at the last one in the item pool chain.
Does this make sense? OS agreed with me. But since the code is there for
at least 8 years, this of course requires some thorough testing.
Hope this helps,
Frank
--
Frank Meies (fme) - Co-lead OpenOffice.org Writer
OpenOffice.org Engineering at Sun: http://blogs.sun.com/GullFOSS
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]