LibreOffice Module sw (master)  1
Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
SwAutoFormat Class Reference
Collaboration diagram for SwAutoFormat:
[legend]

Public Member Functions

 SwAutoFormat (SwEditShell *pEdShell, SvxSwAutoFormatFlags const &rFlags, SwNodeIndex const *pSttNd=nullptr, SwNodeIndex const *pEndNd=nullptr)
 

Private Types

enum  {
  NONE = 0,
  DELIM = 1,
  DIGIT = 2,
  CHG = 4,
  LOWER_ALPHA = 8,
  UPPER_ALPHA = 16,
  LOWER_ROMAN = 32,
  UPPER_ROMAN = 64,
  NO_DELIM = (DIGIT|LOWER_ALPHA|UPPER_ALPHA|LOWER_ROMAN|UPPER_ROMAN)
}
 

Private Member Functions

CharClassGetCharClass (LanguageType eLang) const
 
void SetColl (sal_uInt16 nId, bool bHdLineOrText=false)
 
void GoNextPara ()
 
const SwTextFrameGetNextNode (bool isCheckEnd=true) const
 
bool IsOneLine (const SwTextFrame &) const
 
bool IsFastFullLine (const SwTextFrame &) const
 
bool IsNoAlphaLine (const SwTextFrame &) const
 
bool IsEnumericChar (const SwTextFrame &) const
 
sal_uInt16 CalcLevel (const SwTextFrame &, sal_uInt16 *pDigitLvl=nullptr) const
 
sal_Int32 GetBigIndent (TextFrameIndex &rCurrentSpacePos) const
 
bool IsFirstCharCapital (const SwTextFrame &rNd) const
 
sal_uInt16 GetDigitLevel (const SwTextFrame &rFrame, TextFrameIndex &rPos, OUString *pPrefix=nullptr, OUString *pPostfix=nullptr, OUString *pNumTypes=nullptr) const
 
SwTextFrameGetFrame (const SwTextNode &rTextNd) const
 get the FORMATTED TextFrame More...
 
SwTextFrameEnsureFormatted (SwTextFrame const &) const
 
void BuildIndent ()
 
void BuildText ()
 
void BuildTextIndent ()
 
void BuildEnum (sal_uInt16 nLvl, sal_uInt16 nDigitLevel)
 
void BuildNegIndent (SwTwips nSpaces)
 
void BuildHeadLine (sal_uInt16 nLvl)
 
void DeleteSel (SwPaM &rPam)
 
void DeleteSelImpl (SwPaM &rDelPam, SwPaM &rPamToCorrect)
 
bool DeleteJoinCurNextPara (SwTextFrame const *pNextFrame, bool bIgnoreLeadingBlanks=false)
 
void DeleteLeadingTrailingBlanks (bool bStart=true, bool bEnd=true)
 delete in the node start and/or end More...
 
void DelEmptyLine (bool bTstNextPara=true)
 
void DelMoreLinesBlanks (bool bWithLineBreaks=false)
 when using multiline paragraphs delete the "left" and/or "right" margins More...
 
void JoinPrevPara ()
 join with the previous paragraph More...
 
void AutoCorrect (TextFrameIndex nSttPos=TextFrameIndex(0))
 execute AutoCorrect on current TextNode More...
 
bool CanJoin (const SwTextFrame *pNextFrame) const
 
bool DoUnderline ()
 
bool DoTable ()
 
void SetRedlineText_ (sal_uInt16 nId)
 
bool SetRedlineText (sal_uInt16 nId)
 
void ClearRedlineText ()
 

Static Private Member Functions

static bool IsSpace (const sal_Unicode c)
 
static bool HasObjects (const SwTextFrame &)
 
static bool IsEmptyLine (const SwTextFrame &rFrame)
 
static bool IsBlanksInString (const SwTextFrame &)
 
static OUString DelLeadingBlanks (const OUString &rStr)
 
static OUString DelTrailingBlanks (const OUString &rStr)
 
static sal_Int32 GetLeadingBlanks (const OUString &rStr)
 
static sal_Int32 GetTrailingBlanks (const OUString &rStr)
 
static bool HasBreakAttr (const SwTextFrame &)
 
static bool IsSentenceAtEnd (const SwTextFrame &rTextFrame)
 is a dot at the end ?? More...
 

Private Attributes

SvxSwAutoFormatFlags m_aFlags
 
SwPaM m_aDelPam
 
SwNodeIndex m_aNdIdx
 
SwNodeIndex m_aEndNdIdx
 
SwEditShellm_pEditShell
 
SwDocm_pDoc
 
SwTextNodem_pCurTextNd
 
SwTextFramem_pCurTextFrame
 
sal_uLong m_nEndNdIdx
 
std::unique_ptr< CharClassm_pCharClass
 
LanguageType m_eCharClassLang
 
sal_uInt16 m_nRedlAutoFormatSeqId
 
bool m_bEnd: 1
 
bool m_bMoreLines: 1
 

Detailed Description

Definition at line 85 of file autofmt.cxx.

Member Enumeration Documentation

anonymous enum
private
Enumerator
NONE 
DELIM 
DIGIT 
CHG 
LOWER_ALPHA 
UPPER_ALPHA 
LOWER_ROMAN 
UPPER_ROMAN 
NO_DELIM 

Definition at line 102 of file autofmt.cxx.

Constructor & Destructor Documentation

SwAutoFormat::SwAutoFormat ( SwEditShell pEdShell,
SvxSwAutoFormatFlags const &  rFlags,
SwNodeIndex const *  pSttNd = nullptr,
SwNodeIndex const *  pEndNd = nullptr 
)

Definition at line 2209 of file autofmt.cxx.

References SvxSwAutoFormatFlags::bAFormatByInput, SvxSwAutoFormatFlags::bChgUserColl, SvxSwAutoFormatFlags::bCreateTable, SvxSwAutoFormatFlags::bDelEmptyNode, SvxSwAutoFormatFlags::bReplaceStyles, SvxSwAutoFormatFlags::bSetNumRule, BuildEnum(), BuildHeadLine(), BuildIndent(), BuildNegIndent(), BuildText(), BuildTextIndent(), SvxSwAutoFormatFlags::bWithRedlining, CalcLevel(), SwNodes::Count(), DelEmptyLine(), SwCursorShell::DeleteCurrent, DelLeadingBlanks(), DelMoreLinesBlanks(), DelTrailingBlanks(), IDocumentUndoRedo::DoesUndo(), DoTable(), DoUnderline(), IDocumentUndoRedo::DoUndo(), EndProgress(), SwCursorShell::GetCursor(), SwDoc::GetDocShell(), SwTextFrameInfo::GetFirstIndent(), SwDoc::getIDocumentRedlineAccess(), SwDoc::GetIDocumentUndoRedo(), SwNodeIndex::GetIndex(), SwViewShell::GetLayout(), SwContentNode::getLayoutFrame(), SwTextFrameInfo::GetLineStart(), GetNextNode(), SwNodeIndex::GetNode(), SwDoc::GetNodes(), SwTextNode::GetNumRule(), SwFormat::GetPoolFormatId(), IDocumentRedlineAccess::GetRedlineFlags(), SwContentNode::GetSwAttrSet(), SwTextFrame::GetText(), SwTextNode::GetTextColl(), SvxLRSpaceItem::GetTextFirstLineOfst(), SvxLRSpaceItem::GetTextLeft(), SwNode::GetTextNode(), SwTextFrame::GetTextNodeForParaProps(), GoNextPara(), sw::GotoNextLayoutTextFrame(), sw::GotoPrevLayoutTextFrame(), HasBreakAttr(), HasObjects(), SwContentNode::HasSwAttrSet(), Ignore, IsBlanksInString(), IsEmptyLine(), IsEnumericChar(), IsFirstCharCapital(), IsNoAlphaLine(), IsOneLine(), IsPoolUserFormat(), m_aDelPam, m_bEnd, m_bMoreLines, m_nEndNdIdx, MAXLEVEL, On, SwCursorShell::Pop(), SwCursorShell::Push(), RES_LR_SPACE, RES_POOLCOLL_STANDARD, RES_POOLCOLL_TEXT, RES_POOLCOLL_TEXT_MOVE, SwDoc::SetAutoFormatRedline(), SetColl(), SwTextFrameInfo::SetFrame(), IDocumentRedlineAccess::SetRedlineFlags(), ShowMask, StartProgress(), and USHRT_MAX.

Member Function Documentation

void SwAutoFormat::AutoCorrect ( TextFrameIndex  nSttPos = TextFrameIndex(0))
private

execute AutoCorrect on current TextNode

Start autocorrection for the current TextNode.

Definition at line 1905 of file autofmt.cxx.

References SvxSwAutoFormatFlags::bAddNonBrkSpace, SvxSwAutoFormatFlags::bAFormatByInput, SvxSwAutoFormatFlags::bAutoCorrect, SvxSwAutoFormatFlags::bCapitalStartSentence, SvxSwAutoFormatFlags::bCapitalStartWord, SvxSwAutoFormatFlags::bChgOrdinalNumber, SvxSwAutoFormatFlags::bChgToEnEmDash, SvxSwAutoFormatFlags::bChgWeightUnderl, SvxSwAutoFormatFlags::bSetINetAttr, SvxSwAutoFormatFlags::bWithRedlining, CHAR_HARDBLANK, SwAutoCorrDoc::ChgAutoCorrWord(), ClearRedlineText(), SwPaM::DeleteMark(), SvxAutoCorrect::FnAddNonBrkSpace(), SvxAutoCorrect::FnCapitalStartSentence(), SvxAutoCorrect::FnCapitalStartWord(), SvxAutoCorrect::FnChgOrdinalNumber(), SvxAutoCorrect::FnChgToEnEmDash(), SvxAutoCorrect::FnChgWeightUnderl(), SvxAutoCorrect::FnSetINetAttr(), SvxAutoCorrCfg::Get(), GetAppCharClass(), SvxAutoCorrCfg::GetAutoCorrect(), SvxAutoCorrect::GetFlags(), SwTextFrameInfo::GetFrame(), GetFrame(), SwDoc::getIDocumentContentOperations(), SwDoc::getIDocumentRedlineAccess(), SwIndex::GetIndex(), SwTextFrame::GetLangOfChar(), SwPaM::GetMark(), SwNodeIndex::GetNode(), SwPaM::GetPoint(), SvxAutoCorrect::GetQuote(), IDocumentRedlineAccess::GetRedlineFlags(), SwTextFrame::GetText(), SwNode::GetTextNode(), IDocumentContentOperations::InsertString(), SwTextFrameInfo::IsBullet(), CharClass::isLetterNumeric(), IsSpace(), LANGUAGE_SYSTEM, SwTextFrame::MapModelToViewPos(), SwTextFrame::MapViewToModelPos(), SwPosition::nContent, SwPosition::nNode, IDocumentContentOperations::ReplaceRange(), SwTextFrameInfo::SetFrame(), SwPaM::SetMark(), SetRedlineText(), ShowDelete, STR_AUTOFMTREDL_BOLD, STR_AUTOFMTREDL_CPTL_STT_SENT, STR_AUTOFMTREDL_CPTL_STT_WORD, STR_AUTOFMTREDL_DASH, STR_AUTOFMTREDL_DETECT_URL, STR_AUTOFMTREDL_NON_BREAK_SPACE, STR_AUTOFMTREDL_ORDINAL, STR_AUTOFMTREDL_TYPO, STR_AUTOFMTREDL_UNDER, and STR_AUTOFMTREDL_USE_REPLACE.

Referenced by BuildEnum(), BuildHeadLine(), BuildIndent(), BuildNegIndent(), BuildText(), and BuildTextIndent().

void SwAutoFormat::BuildEnum ( sal_uInt16  nLvl,
sal_uInt16  nDigitLevel 
)
private

Definition at line 1461 of file autofmt.cxx.

References SvxSwAutoFormatFlags::aBulletFont, aTextNodeSetRange, AutoCorrect(), SvxSwAutoFormatFlags::bAFormatByInput, SvxSwAutoFormatFlags::bChgEnumNum, SvxSwAutoFormatFlags::bSetNumRule, CalcLevel(), CanJoin(), SvxSwAutoFormatFlags::cBullet, cnNumBullColls, cnPosEmDash, cnPosEnDash, cStarSymbolEmDash, cStarSymbolEnDash, DeleteJoinCurNextPara(), DeleteLeadingTrailingBlanks(), SwPaM::DeleteMark(), DeleteSel(), DelMoreLinesBlanks(), SwDoc::GetAttrPool(), IDocumentStylePoolAccess::GetCharFormatFromPool(), SwTextFrameInfo::GetCharPos(), vcl::Font::GetCharSet(), numfunc::GetDefaultPositionAndSpaceMode(), numfunc::GetDefBulletFont(), GetDigitLevel(), vcl::Font::GetFamilyName(), vcl::Font::GetFamilyType(), SwFrameAreaDefinition::getFramePrintArea(), SwDoc::getIDocumentContentOperations(), SwDoc::getIDocumentStylePoolAccess(), SwViewShell::GetLayout(), SvxLRSpaceItem::GetLeft(), SwAttrSet::GetLRSpace(), SwPaM::GetMark(), GetNextNode(), SwNodeIndex::GetNode(), SwPaM::GetNode(), SwNumRule::GetNumIndent(), SwTextNode::GetNumRule(), vcl::Font::GetPitch(), SwPaM::GetPoint(), vcl::Font::GetStyleName(), SwContentNode::GetSwAttrSet(), SwTextFrame::GetText(), SwNode::GetTextNode(), SwTextFrame::GetTextNodeForParaProps(), SwDoc::GetUniqueNumRuleName(), SvxTabStopItem::Insert(), IDocumentContentOperations::InsertString(), IsBlanksInString(), numfunc::IsDefBulletFontUserDefined(), IsFastFullLine(), SwCursorShell::IsInRightToLeftText(), IsSentenceAtEnd(), IsSpace(), lBullFirstLineOffset, lBullIndent, lNumIndent, m_bMoreLines, SwTextFrame::MapViewToModelPos(), MAXLEVEL, SwPosition::nNode, nPos, pBulletChar, RES_CHRATR_FONT, RES_PARATR_TABSTOP, RES_POOLCHR_BUL_LEVEL, RES_POOLCHR_NUM_LEVEL, RES_POOLCOLL_BUL_LEVEL1, RES_POOLCOLL_NUM_LEVEL1, SetAllScriptItem(), SwTextNode::SetAttrListLevel(), SvxNumberFormat::SetBulletFont(), SetColl(), SwDoc::SetFormatItemByAutoFormat(), SvxNumberFormat::SetIncludeUpperLevels(), SwPaM::SetMark(), SwDoc::SetNumRule(), SvxNumberFormat::SetPrefix(), SetRedlineText(), STR_AUTOFMTREDL_DEL_MORELINES, STR_AUTOFMTREDL_SET_NUMBULLET, StrChr(), SVX_NUM_CHAR_SPECIAL, u, USHRT_MAX, and SwRect::Width().

Referenced by SwAutoFormat().

void SwAutoFormat::BuildHeadLine ( sal_uInt16  nLvl)
private
void SwAutoFormat::BuildIndent ( )
private
void SwAutoFormat::BuildNegIndent ( SwTwips  nSpaces)
private
void SwAutoFormat::BuildText ( )
private
void SwAutoFormat::BuildTextIndent ( )
private
sal_uInt16 SwAutoFormat::CalcLevel ( const SwTextFrame rFrame,
sal_uInt16 *  pDigitLvl = nullptr 
) const
private
bool SwAutoFormat::CanJoin ( const SwTextFrame pNextFrame) const
inlineprivate
void SwAutoFormat::ClearRedlineText ( )
inlineprivate
void SwAutoFormat::DelEmptyLine ( bool  bTstNextPara = true)
private
bool SwAutoFormat::DeleteJoinCurNextPara ( SwTextFrame const *  pNextFrame,
bool  bIgnoreLeadingBlanks = false 
)
private
void SwAutoFormat::DeleteLeadingTrailingBlanks ( bool  bStart = true,
bool  bEnd = true 
)
private
void SwAutoFormat::DeleteSel ( SwPaM rPam)
private
void SwAutoFormat::DeleteSelImpl ( SwPaM rDelPam,
SwPaM rPamToCorrect 
)
private
OUString SwAutoFormat::DelLeadingBlanks ( const OUString &  rStr)
staticprivate

Definition at line 686 of file autofmt.cxx.

References IsSpace().

Referenced by IsBlanksInString(), and SwAutoFormat().

void SwAutoFormat::DelMoreLinesBlanks ( bool  bWithLineBreaks = false)
private
OUString SwAutoFormat::DelTrailingBlanks ( const OUString &  rStr)
staticprivate

Definition at line 696 of file autofmt.cxx.

References IsSpace().

Referenced by SwAutoFormat().

bool SwAutoFormat::DoTable ( )
private
bool SwAutoFormat::DoUnderline ( )
private
SwTextFrame * SwAutoFormat::EnsureFormatted ( SwTextFrame const &  rFrame) const
private
sal_Int32 SwAutoFormat::GetBigIndent ( TextFrameIndex rCurrentSpacePos) const
private
CharClass& SwAutoFormat::GetCharClass ( LanguageType  eLang) const
inlineprivate

Definition at line 118 of file autofmt.cxx.

References m_pCharClass.

Referenced by GetDigitLevel(), IsFirstCharCapital(), and IsNoAlphaLine().

sal_uInt16 SwAutoFormat::GetDigitLevel ( const SwTextFrame rFrame,
TextFrameIndex rPos,
OUString *  pPrefix = nullptr,
OUString *  pPostfix = nullptr,
OUString *  pNumTypes = nullptr 
) const
private
SwTextFrame * SwAutoFormat::GetFrame ( const SwTextNode rTextNd) const
private

get the FORMATTED TextFrame

Definition at line 229 of file autofmt.cxx.

References EnsureFormatted(), SwViewShell::GetLayout(), and SwContentNode::getLayoutFrame().

Referenced by AutoCorrect(), DelEmptyLine(), DeleteSelImpl(), and GoNextPara().

sal_Int32 SwAutoFormat::GetLeadingBlanks ( const OUString &  rStr)
staticprivate
const SwTextFrame * SwAutoFormat::GetNextNode ( bool  isCheckEnd = true) const
private
sal_Int32 SwAutoFormat::GetTrailingBlanks ( const OUString &  rStr)
staticprivate

Definition at line 719 of file autofmt.cxx.

References IsSpace().

Referenced by DeleteJoinCurNextPara(), DeleteLeadingTrailingBlanks(), and DoTable().

void SwAutoFormat::GoNextPara ( )
private
bool SwAutoFormat::HasBreakAttr ( const SwTextFrame rTextFrame)
staticprivate
bool SwAutoFormat::HasObjects ( const SwTextFrame rFrame)
staticprivate

Definition at line 339 of file autofmt.cxx.

References sw::FrameContainsNode(), and SwTextFrame::GetTextNodeFirst().

Referenced by SwAutoFormat().

bool SwAutoFormat::IsBlanksInString ( const SwTextFrame rFrame)
staticprivate
static bool SwAutoFormat::IsEmptyLine ( const SwTextFrame rFrame)
inlinestaticprivate

Definition at line 137 of file autofmt.cxx.

References GetLeadingBlanks(), and SwTextFrame::GetText().

Referenced by CanJoin(), and SwAutoFormat().

bool SwAutoFormat::IsEnumericChar ( const SwTextFrame rFrame) const
private
bool SwAutoFormat::IsFastFullLine ( const SwTextFrame rFrame) const
private
bool SwAutoFormat::IsFirstCharCapital ( const SwTextFrame rNd) const
private
bool SwAutoFormat::IsNoAlphaLine ( const SwTextFrame rFrame) const
private
bool SwAutoFormat::IsOneLine ( const SwTextFrame rFrame) const
private

Definition at line 368 of file autofmt.cxx.

References EnsureFormatted(), and SwTextFrameInfo::IsOneLine().

Referenced by GetBigIndent(), and SwAutoFormat().

bool SwAutoFormat::IsSentenceAtEnd ( const SwTextFrame rTextFrame)
staticprivate

is a dot at the end ??

Is there a dot at the end?

Definition at line 1071 of file autofmt.cxx.

References SwTextFrame::GetText(), and IsSpace().

Referenced by BuildEnum(), BuildIndent(), BuildNegIndent(), BuildText(), and BuildTextIndent().

static bool SwAutoFormat::IsSpace ( const sal_Unicode  c)
inlinestaticprivate
void SwAutoFormat::JoinPrevPara ( )
private
void SwAutoFormat::SetColl ( sal_uInt16  nId,
bool  bHdLineOrText = false 
)
private
bool SwAutoFormat::SetRedlineText ( sal_uInt16  nId)
inlineprivate
void SwAutoFormat::SetRedlineText_ ( sal_uInt16  nId)
private

Member Data Documentation

SwPaM SwAutoFormat::m_aDelPam
private

Definition at line 88 of file autofmt.cxx.

Referenced by SwAutoFormat().

SwNodeIndex SwAutoFormat::m_aEndNdIdx
private

Definition at line 90 of file autofmt.cxx.

SvxSwAutoFormatFlags SwAutoFormat::m_aFlags
private

Definition at line 87 of file autofmt.cxx.

SwNodeIndex SwAutoFormat::m_aNdIdx
private

Definition at line 89 of file autofmt.cxx.

bool SwAutoFormat::m_bEnd
private

Definition at line 115 of file autofmt.cxx.

Referenced by BuildIndent(), CanJoin(), GoNextPara(), and SwAutoFormat().

bool SwAutoFormat::m_bMoreLines
private
LanguageType SwAutoFormat::m_eCharClassLang
mutableprivate

Definition at line 98 of file autofmt.cxx.

sal_uLong SwAutoFormat::m_nEndNdIdx
private

Definition at line 96 of file autofmt.cxx.

Referenced by SwAutoFormat().

sal_uInt16 SwAutoFormat::m_nRedlAutoFormatSeqId
private

Definition at line 100 of file autofmt.cxx.

Referenced by SetRedlineText_().

std::unique_ptr<CharClass> SwAutoFormat::m_pCharClass
mutableprivate

Definition at line 97 of file autofmt.cxx.

Referenced by GetCharClass().

SwTextFrame* SwAutoFormat::m_pCurTextFrame
private

Definition at line 95 of file autofmt.cxx.

SwTextNode* SwAutoFormat::m_pCurTextNd
private

Definition at line 94 of file autofmt.cxx.

Referenced by CanJoin(), and DelEmptyLine().

SwDoc* SwAutoFormat::m_pDoc
private

Definition at line 93 of file autofmt.cxx.

SwEditShell* SwAutoFormat::m_pEditShell
private

Definition at line 92 of file autofmt.cxx.


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