Hi,

I have two questions regarding the correct use of the Outliner/EditEngine class.

1) When I copy text from my EditView into writer editwindow, the font size is extremly small, all other font attributes are correct. I guess this is an issue with converting between points and twips, but I can't find the correct combination, this is the relevant part of my code:

...
mpOutliner->SetRefMapMode( MAP_TWIP );
OutputDevice* pDev = aShell->GetDoc()->getReferenceDevice(TRUE);
if ( pDev )
{
   mpOutliner->SetRefDevice( pDev );
}

SfxItemSet* pItems = new SfxItemSet(aShell->GetPool());
SvxFontHeightItem Item(12, 100,EE_CHAR_FONTHEIGHT );
Item.SetHeight(12,100,SFX_MAPUNIT_POINT);
pItems->Put(Item);
mpOutliner->SetParaAttribs(0, *pItems);
.....

I found this code in the WriteRTF() method while creating the transferable object which I guess explains the small size


case EE_CHAR_FONTHEIGHT:
case EE_CHAR_FONTHEIGHT_CJK:
case EE_CHAR_FONTHEIGHT_CTL:
{
   rOutput << sRTF_FS;
   long nHeight = ((const SvxFontHeightItem&)rItem).GetHeight();
   nHeight = LogicToTwips( nHeight );
   Twips => HalfPoints
   nHeight /= 10;
   rOutput.WriteNumber( nHeight );
}


2) Is there an automated way to set the toolbar buttons such as bold, italic etc based on the current cursor position of my EditEngine, instead of doing it manually for all the attributes after each cursor movement?


As the writer frame does both of my questions perfectly, any hint to this class and relevant source code would be also helpful.


Thanks for any help
Best regards
Max


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

Reply via email to