LibreOffice Module sw (master)  1
Classes | Functions
sw::hack Namespace Reference

Classes

class  DrawingOLEAdaptor
 Make inserting an OLE object into a Writer document easy. More...
 
class  Position
 

Functions

sal_uInt16 TransformWhichBetweenPools (const SfxItemPool &rDestPool, const SfxItemPool &rSrcPool, sal_uInt16 nWhich)
 Map an ID valid in one SfxItemPool to its equivalent in another. More...
 
sal_uInt16 GetSetWhichFromSwDocWhich (const SfxItemSet &rSet, const SwDoc &rDoc, sal_uInt16 nWhich)
 Map a SwDoc WhichId to the equivalent Id for a given SfxItemSet. More...
 

Function Documentation

sal_uInt16 sw::hack::GetSetWhichFromSwDocWhich ( const SfxItemSet rSet,
const SwDoc rDoc,
sal_uInt16  nWhich 
)

Map a SwDoc WhichId to the equivalent Id for a given SfxItemSet.

Given a WhichId (the id that identifies a property e.g. bold) which is correct for a Writer document, get the equivalent whichId which for a given SfxItemSet.

This arises because the drawing layer uses the same properties as writer e.g. SvxWeight, but for some reason uses different ids for the same properties as writer.

This is effectively the same as TransformWhichBetweenPools except at a slightly different layer.

Parameters
rSetThe SfxItemSet in whose terms the Id is returned
rDocThe SwDoc in whose terms the Id is passed in
nWhichThe Id to transform from writer to the SfxItemSet's domain
Returns
0 on failure, the correct SfxItemSet Id on success

Definition at line 278 of file writerhelper.cxx.

References SwDoc::GetAttrPool(), SfxItemSet::GetPool(), SfxItemSet::GetRanges(), RES_WHICHHINT_END, and TransformWhichBetweenPools().

Referenced by MSWordExportBase::GetItem(), MSWord_SdrAttrIter::GetItem(), and MSWordExportBase::HasItem().

sal_uInt16 sw::hack::TransformWhichBetweenPools ( const SfxItemPool rDestPool,
const SfxItemPool rSrcPool,
sal_uInt16  nWhich 
)

Map an ID valid in one SfxItemPool to its equivalent in another.

Given a WhichId (the id that identifies a property e.g. bold) which is correct in a given SfxItemPool, get the equivalent whichId in another SfxItemPool

This arises because the drawing layer uses the same properties as writer e.g. SvxWeight, but for some reason uses different ids for the same properties as writer.

Parameters
rDestPoolThe SfxItemPool in whose terms the Id is returned
rSrcPoolThe SfxItemPool in whose terms the Id is passed in
nWhichThe Id to transform from source to dest
Returns
0 on failure, the correct property Id on success

Definition at line 267 of file writerhelper.cxx.

References SfxItemPool::GetSlotId(), and SfxItemPool::GetWhich().

Referenced by GetSetWhichFromSwDocWhich(), MSWord_SdrAttrIter::HasTextItem(), and MSWord_SdrAttrIter::SetItemsThatDifferFromStandard().