Hi,

I am using this code for letting postits know about a new language of the document:


void SwDoc::SetDefault( const SfxItemSet& rSet )
{
.......
//mod: #i6193# notify postits about new language
pItem = aIter.FirstItem();
while (pItem)
{
    if (pItem->IsA(SvxLanguageItem::StaticType()))
    {
        // translate from doc- which to editengine- which
        USHORT nLangWhichId = 0;
        switch ( pItem->Which())
        {
case RES_CHRATR_LANGUAGE : nLangWhichId = EE_CHAR_LANGUAGE ; break; case RES_CHRATR_CJK_LANGUAGE : nLangWhichId = EE_CHAR_LANGUAGE_CJK; break; case RES_CHRATR_CTL_LANGUAGE : nLangWhichId = EE_CHAR_LANGUAGE_CTL; break;
        }
const SvxLanguageItem aItem( (static_cast<const SvxLanguageItem&>(*pItem)).GetLanguage(), nLangWhichId);
        if (GetDocShell() && GetDocShell()->GetView())
            GetDocShell()->GetView()->GetPostItMgr()->SetLanguage(aItem);
        break;
    }
    pItem = aIter.NextItem();

    SetModified();
}

This code works, but I am not sure if this is the correct way and right location for it, could someone have a look?

Best regards
Max


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to