|
LibreOffice Module sw (master) 1
|
The default implementation of ToxTabStopTokenHandler. More...
#include <ToxTabStopTokenHandler.hxx>
Public Types | |
| enum | TabStopReferencePolicy { TABSTOPS_RELATIVE_TO_INDENT , TABSTOPS_RELATIVE_TO_PAGE } |
Public Member Functions | |
| DefaultToxTabStopTokenHandler (SwNodeOffset indexOfSectionNode, const SwPageDesc &defaultPageDescription, bool tabPositionIsRelativeToParagraphIndent, TabStopReferencePolicy referencePolicy) | |
| ToxTabStopTokenHandler::HandledTabStopToken | HandleTabStopToken (const SwFormToken &aToken, const SwTextNode &targetNode, const SwRootFrame *currentLayout) const override |
| Handle a tab stop token. More... | |
Public Member Functions inherited from sw::ToxTabStopTokenHandler | |
| virtual | ~ToxTabStopTokenHandler () |
| virtual HandledTabStopToken | HandleTabStopToken (const SwFormToken &aToken, const SwTextNode &targetNode, const SwRootFrame *currentLayout) const =0 |
| Handle a tab stop token. More... | |
Private Member Functions | |
| tools::Long | CalculatePageMarginFromPageDescription (const SwTextNode &targetNode) const |
| Calculate the page margin from the page description. More... | |
Static Private Member Functions | |
| static bool | CanUseLayoutRectangle (const SwTextNode &targetNode, const SwRootFrame *currentLayout) |
| Test whether the page layout can be obtained by a layout rectangle. More... | |
Private Attributes | |
| SwNodeOffset | mIndexOfSectionNode |
| const SwPageDesc & | mDefaultPageDescription |
| bool | mTabPositionIsRelativeToParagraphIndent |
| TabStopReferencePolicy | mTabStopReferencePolicy |
The default implementation of ToxTabStopTokenHandler.
Definition at line 53 of file ToxTabStopTokenHandler.hxx.
| Enumerator | |
|---|---|
| TABSTOPS_RELATIVE_TO_INDENT | |
| TABSTOPS_RELATIVE_TO_PAGE | |
Definition at line 57 of file ToxTabStopTokenHandler.hxx.
| sw::DefaultToxTabStopTokenHandler::DefaultToxTabStopTokenHandler | ( | SwNodeOffset | indexOfSectionNode, |
| const SwPageDesc & | defaultPageDescription, | ||
| bool | tabPositionIsRelativeToParagraphIndent, | ||
| TabStopReferencePolicy | referencePolicy | ||
| ) |
| indexOfSectionNode | The index of the section node. It is needed to determine whether a page description was given by a node before the tox section. |
| defaultPageDescription | Which page description shall be used if we do not find one or the found page description was provided by a node before the tox section |
| tabPositionIsRelativeToParagraphIndent | Whether the tab position is relative to the paragraph indent. (toxForm.IsRelTabPos() is true or false.) |
| tabstopReferencePolicy | How tab stops are positioned. (#i21237) The default behavior is to place tab stops relative to the page. |
Definition at line 29 of file ToxTabStopTokenHandler.cxx.
|
private |
Calculate the page margin from the page description.
This is the fallback method to determine the position of a tab stop.
Definition at line 90 of file ToxTabStopTokenHandler.cxx.
References SvxBoxItem::CalcLineSpace(), SwNode::FindPageDesc(), SwFormat::GetBox(), SwFormat::GetFrameSize(), SwNode::GetIndex(), SvxLRSpaceItem::GetLeft(), SwFormat::GetLRSpace(), SwPageDesc::GetMaster(), SvxLRSpaceItem::GetRight(), SvxSizeItem::GetWidth(), mDefaultPageDescription, mIndexOfSectionNode, and result.
Referenced by HandleTabStopToken().
|
staticprivate |
Test whether the page layout can be obtained by a layout rectangle.
Is used to determine how to find tab stop position.
Definition at line 110 of file ToxTabStopTokenHandler.cxx.
References SwFrame::FindPageFrame(), SwContentNode::getLayoutFrame(), SwPageFrame::GetPageDesc(), and RES_PAGEDESC().
Referenced by HandleTabStopToken().
|
overridevirtual |
Handle a tab stop token.
If the token contains tab alignment information, that is used to create the SvxTabStop. Else, the information about the tab stop is taken from a page description. Depending on the TabStopReferencePolicy provided in the constructor, the method behaves differently when deriving the tab stop position.
Implements sw::ToxTabStopTokenHandler.
Definition at line 42 of file ToxTabStopTokenHandler.cxx.
References SwFormToken::bWithTab, CalculatePageMarginFromPageDescription(), CanUseLayoutRectangle(), cDfltDecimalChar, SwFormToken::cTabFillChar, SwFormToken::eTabAlign, SwContentNode::FindLayoutRect(), SwFormat::GetFirstLineIndent(), SvxTextLeftMarginItem::GetLeft(), SwTextNode::GetTextColl(), SvxFirstLineIndentItem::GetTextFirstLineOffset(), SvxTextLeftMarginItem::GetTextLeft(), SwFormat::GetTextLeftMargin(), SwRect::IsEmpty(), mTabPositionIsRelativeToParagraphIndent, mTabStopReferencePolicy, nRightMargin, SwFormToken::nTabStopPosition, RES_MARGIN_TEXTLEFT(), result, TABSTOPS_RELATIVE_TO_INDENT, and SwRect::Width().
|
private |
Definition at line 105 of file ToxTabStopTokenHandler.hxx.
Referenced by CalculatePageMarginFromPageDescription().
|
private |
Definition at line 104 of file ToxTabStopTokenHandler.hxx.
Referenced by CalculatePageMarginFromPageDescription().
|
private |
Definition at line 106 of file ToxTabStopTokenHandler.hxx.
Referenced by HandleTabStopToken().
|
private |
Definition at line 107 of file ToxTabStopTokenHandler.hxx.
Referenced by HandleTabStopToken().