LibreOffice Module editeng (master) 1
Public Member Functions | Static Public Member Functions | List of all members
SvxEditSourceHelper Class Reference

Helper class for common functionality in edit sources. More...

#include <unoedhlp.hxx>

Public Member Functions

static ::std::unique_ptr< SfxHintEENotification2Hint (EENotify const *aNotify)
 Translates EditEngine notifications into broadcastable hints. More...
 

Static Public Member Functions

static void GetAttributeRun (sal_Int32 &nStartIndex, sal_Int32 &nEndIndex, const EditEngine &rEE, sal_Int32 nPara, sal_Int32 nIndex, bool bInCell=false)
 Calculate attribute run for EditEngines. More...
 
static Point EEToUserSpace (const Point &rPoint, const Size &rEESize, bool bIsVertical)
 Convert point from edit engine to user coordinate space. More...
 
static Point UserSpaceToEE (const Point &rPoint, const Size &rEESize, bool bIsVertical)
 Convert point from user to edit engine coordinate space. More...
 
static tools::Rectangle EEToUserSpace (const tools::Rectangle &rRect, const Size &rEESize, bool bIsVertical)
 Convert rect from edit engine to user coordinate space. More...
 

Detailed Description

Helper class for common functionality in edit sources.

Definition at line 58 of file unoedhlp.hxx.

Member Function Documentation

◆ EENotification2Hint()

std::unique_ptr< SfxHint > SvxEditSourceHelper::EENotification2Hint ( EENotify const *  aNotify)

◆ EEToUserSpace() [1/2]

Point SvxEditSourceHelper::EEToUserSpace ( const Point rPoint,
const Size rEESize,
bool  bIsVertical 
)
static

Convert point from edit engine to user coordinate space.

As the edit engine internally keeps vertical text unrotated, all internal edit engine methods return their stuff unrotated, too. This method rotates and shifts given point appropriately, if vertical writing is on.

Parameters
rPointPoint to transform
rEESizePaper size of the edit engine
bIsVerticalWhether output text is vertical or not
Returns
the possibly transformed point

Definition at line 234 of file unoedhlp.cxx.

References Size::Height(), Point::X(), and Point::Y().

Referenced by EEToUserSpace(), SvxEditEngineForwarder::GetCharBounds(), and SvxOutlinerForwarder::GetCharBounds().

◆ EEToUserSpace() [2/2]

tools::Rectangle SvxEditSourceHelper::EEToUserSpace ( const tools::Rectangle rRect,
const Size rEESize,
bool  bIsVertical 
)
static

Convert rect from edit engine to user coordinate space.

As the edit engine internally keeps vertical text unrotated, all internal edit engine methods return their stuff unrotated, too. This method rotates and shifts given rect appropriately, if vertical writing is on.

Parameters
rRectRectangle to transform
rEESizePaper size of the edit engine
bIsVerticalWhether output text is vertical or not
Returns
the possibly transformed rect

Definition at line 244 of file unoedhlp.cxx.

References tools::Rectangle::BottomLeft(), EEToUserSpace(), and tools::Rectangle::TopRight().

◆ GetAttributeRun()

void SvxEditSourceHelper::GetAttributeRun ( sal_Int32 &  nStartIndex,
sal_Int32 &  nEndIndex,
const EditEngine rEE,
sal_Int32  nPara,
sal_Int32  nIndex,
bool  bInCell = false 
)
static

Calculate attribute run for EditEngines.

Please note that the range returned is half-open: [nStartIndex,nEndIndex)

Parameters
nStartIndexHerein, the start index of the range of similar attributes is returned
nEndIndexHerein, the end index (exclusive) of the range of similar attributes is returned
rEEThe EditEngine to query for attributes
nParaThe paragraph the following index value is to be interpreted in
nIndexThe character index from which the range of similar attributed characters is requested

Definition at line 85 of file unoedhlp.cxx.

References CHARATTRIBS, EditEngine::GetAttribs(), GetAttributeRun(), EditEngine::GetCharAttribs(), EditEngine::GetParagraphCount(), EditEngine::GetTextLen(), i, nIndex, EPosition::nIndex, and EPosition::nPara.

Referenced by GetAttributeRun(), SvxEditEngineForwarder::GetAttributeRun(), and SvxOutlinerForwarder::GetAttributeRun().

◆ UserSpaceToEE()

Point SvxEditSourceHelper::UserSpaceToEE ( const Point rPoint,
const Size rEESize,
bool  bIsVertical 
)
static

Convert point from user to edit engine coordinate space.

As the edit engine internally keeps vertical text unrotated, all internal edit engine methods return their stuff unrotated, too. This method rotates and shifts given point appropriately, if vertical writing is on.

Parameters
rPointPoint to transform
rEESizePaper size of the edit engine
bIsVerticalWhether output text is vertical or not
Returns
the possibly transformed point

Definition at line 239 of file unoedhlp.cxx.

References Size::Height(), Point::X(), and Point::Y().

Referenced by SvxEditEngineForwarder::GetIndexAtPoint(), and SvxOutlinerForwarder::GetIndexAtPoint().


The documentation for this class was generated from the following files: