Kaydet (Commit) 7cb8b8c8 authored tarafından Philipp Riemer's avatar Philipp Riemer

work on existing comments in sw/source/core/edit

Change-Id: I32b249971ac6ac540d816c38e00321befb181901
üst ce6cb1db
...@@ -271,13 +271,14 @@ sal_Bool SwAutoCorrDoc::SetINetAttr( xub_StrLen nStt, xub_StrLen nEnd, const Str ...@@ -271,13 +271,14 @@ sal_Bool SwAutoCorrDoc::SetINetAttr( xub_StrLen nStt, xub_StrLen nEnd, const Str
return sal_True; return sal_True;
} }
// Return the text of a previous paragraph /** Return the text of a previous paragraph
// This must not be empty! *
// Does this not exists or there are only blankness, then return 0 * This must not be empty!
// The Flag specifies: *
// sal_True: that, before the normal insert position * @param bAtNormalPos If <true> before the normal insert position; if <false> in which the
//sal_False: that, in which the corrected word was inserted. * corrected word was inserted. (Doesn't need to be the same paragraph!)
// (Doesn't need to be the same paragraph!!!!) * @return text or 0, if previous paragraph does not exists or there are only blankness
*/
const String* SwAutoCorrDoc::GetPrevPara( sal_Bool bAtNormalPos ) const String* SwAutoCorrDoc::GetPrevPara( sal_Bool bAtNormalPos )
{ {
const String* pStr = 0; const String* pStr = 0;
......
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
#include <pam.hxx> #include <pam.hxx>
#include <edimp.hxx> #include <edimp.hxx>
#include <fesh.hxx> #include <fesh.hxx>
#include <swundo.hxx> // for the UndoId's #include <swundo.hxx> // for the UndoIds
#include <poolfmt.hxx> #include <poolfmt.hxx>
#include <ndtxt.hxx> #include <ndtxt.hxx>
#include <txtfrm.hxx> #include <txtfrm.hxx>
...@@ -99,7 +99,7 @@ class SwAutoFormat ...@@ -99,7 +99,7 @@ class SwAutoFormat
SwTxtNode* pAktTxtNd; // the current TextNode SwTxtNode* pAktTxtNd; // the current TextNode
SwTxtFrm* pAktTxtFrm; // frame of the current TextNode SwTxtFrm* pAktTxtFrm; // frame of the current TextNode
CharClass* pCharClass; // Character classification CharClass* pCharClass; // Character classification
sal_uLong nEndNdIdx; // for the percentage-display sal_uLong nEndNdIdx; // for the percentage-display
LanguageType eCharClassLang; LanguageType eCharClassLang;
sal_uInt16 nLastHeadLvl, nLastCalcHeadLvl; sal_uInt16 nLastHeadLvl, nLastCalcHeadLvl;
...@@ -182,7 +182,7 @@ class SwAutoFormat ...@@ -182,7 +182,7 @@ class SwAutoFormat
sal_uInt16 GetDigitLevel( const SwTxtNode& rTxtNd, xub_StrLen& rPos, sal_uInt16 GetDigitLevel( const SwTxtNode& rTxtNd, xub_StrLen& rPos,
String* pPreFix = 0, String* pPostFix = 0, String* pPreFix = 0, String* pPostFix = 0,
String* pNumTypes = 0 ) const; String* pNumTypes = 0 ) const;
// get the FORMATED TextFrame /// get the FORMATED TextFrame
SwTxtFrm* GetFrm( const SwTxtNode& rTxtNd ) const; SwTxtFrm* GetFrm( const SwTxtNode& rTxtNd ) const;
void BuildIndent(); void BuildIndent();
...@@ -196,15 +196,15 @@ class SwAutoFormat ...@@ -196,15 +196,15 @@ class SwAutoFormat
bool HasBreakAttr( const SwTxtNode& ) const; bool HasBreakAttr( const SwTxtNode& ) const;
void DeleteSel( SwPaM& rPam ); void DeleteSel( SwPaM& rPam );
bool DeleteAktNxtPara( const String& rNxtPara ); bool DeleteAktNxtPara( const String& rNxtPara );
// delete in the node start and/or end /// delete in the node start and/or end
void DeleteAktPara( bool bStart = true, bool nEnd = true ); void DeleteAktPara( bool bStart = true, bool nEnd = true );
void DelEmptyLine( bool bTstNextPara = true ); void DelEmptyLine( bool bTstNextPara = true );
// when using multiline paragraphs delete the "left" and/or /// when using multiline paragraphs delete the "left" and/or
// "right" margins /// "right" margins
void DelMoreLinesBlanks( bool bWithLineBreaks = false ); void DelMoreLinesBlanks( bool bWithLineBreaks = false );
// delete the previous paragraph /// delete the previous paragraph
void DelPrevPara(); void DelPrevPara();
// execute AutoCorrect on current TextNode /// execute AutoCorrect on current TextNode
void AutoCorrect( xub_StrLen nSttPos = 0 ); void AutoCorrect( xub_StrLen nSttPos = 0 );
bool CanJoin( const SwTxtNode* pTxtNd ) const bool CanJoin( const SwTxtNode* pTxtNd ) const
...@@ -218,7 +218,7 @@ class SwAutoFormat ...@@ -218,7 +218,7 @@ class SwAutoFormat
!HasBreakAttr( *pTxtNd ); !HasBreakAttr( *pTxtNd );
} }
// is a dot at the end ?? /// is a dot at the end ??
bool IsSentenceAtEnd( const SwTxtNode& rTxtNd ) const; bool IsSentenceAtEnd( const SwTxtNode& rTxtNd ) const;
bool DoUnderline(); bool DoUnderline();
...@@ -281,7 +281,7 @@ void SwAutoFormat::_SetRedlineTxt( sal_uInt16 nActionId ) ...@@ -281,7 +281,7 @@ void SwAutoFormat::_SetRedlineTxt( sal_uInt16 nActionId )
case STR_AUTOFMTREDL_SET_NUMBULET: case STR_AUTOFMTREDL_SET_NUMBULET:
case STR_AUTOFMTREDL_DEL_MORELINES: case STR_AUTOFMTREDL_DEL_MORELINES:
// AutoCorrect-Actions // AutoCorrect actions
case STR_AUTOFMTREDL_USE_REPLACE: case STR_AUTOFMTREDL_USE_REPLACE:
case STR_AUTOFMTREDL_CPTL_STT_WORD: case STR_AUTOFMTREDL_CPTL_STT_WORD:
case STR_AUTOFMTREDL_CPTL_STT_SENT: case STR_AUTOFMTREDL_CPTL_STT_SENT:
...@@ -308,7 +308,7 @@ String SwAutoFormat::GoNextPara() ...@@ -308,7 +308,7 @@ String SwAutoFormat::GoNextPara()
{ {
SwNode* pNewNd = 0; SwNode* pNewNd = 0;
do { do {
//has to be checed twice before and after incrementation // has to be checked twice before and after incrementation
if( aNdIdx.GetIndex() >= aEndNdIdx.GetIndex() ) if( aNdIdx.GetIndex() >= aEndNdIdx.GetIndex() )
{ {
bEnde = true; bEnde = true;
...@@ -772,7 +772,7 @@ sal_uInt16 SwAutoFormat::GetDigitLevel( const SwTxtNode& rNd, xub_StrLen& rPos, ...@@ -772,7 +772,7 @@ sal_uInt16 SwAutoFormat::GetDigitLevel( const SwTxtNode& rNd, xub_StrLen& rPos,
sal_uInt16 nStart = 0; sal_uInt16 nStart = 0;
sal_uInt8 nDigitLvl = 0, nDigitCnt = 0; sal_uInt8 nDigitLvl = 0, nDigitCnt = 0;
//count number of parenthesis to assure a sensible order is found // count number of parenthesis to assure a sensible order is found
sal_uInt16 nOpeningParentheses = 0; sal_uInt16 nOpeningParentheses = 0;
sal_uInt16 nClosingParentheses = 0; sal_uInt16 nClosingParentheses = 0;
...@@ -823,7 +823,7 @@ sal_uInt16 SwAutoFormat::GetDigitLevel( const SwTxtNode& rNd, xub_StrLen& rPos, ...@@ -823,7 +823,7 @@ sal_uInt16 SwAutoFormat::GetDigitLevel( const SwTxtNode& rNd, xub_StrLen& rPos,
// Roman numbers are "mdclxvi". Since we want to start numbering with c or d more often, // Roman numbers are "mdclxvi". Since we want to start numbering with c or d more often,
// convert first to characters and later to roman numbers if needed. // convert first to characters and later to roman numbers if needed.
#ifdef WITH_ALPHANUM_AS_NUMFMT #ifdef WITH_ALPHANUM_AS_NUMFMT
//detection of 'c' and 'd' a ROMAN numbering should not be done here // detection of 'c' and 'd' a ROMAN numbering should not be done here
if( 256 > cLow &&( (eScan & (LOWER_ROMAN|UPPER_ROMAN)) if( 256 > cLow &&( (eScan & (LOWER_ROMAN|UPPER_ROMAN))
? strchr( "mdclxvi", cLow ) ? strchr( "mdclxvi", cLow )
: strchr( "mlxvi", cLow ) )) : strchr( "mlxvi", cLow ) ))
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
/** /*
* hard formatting (Attribute) * hard formatting (Attribute)
*/ */
...@@ -87,9 +87,7 @@ void SwEditShell::GCAttr() ...@@ -87,9 +87,7 @@ void SwEditShell::GCAttr()
FOREACHPAM_END() FOREACHPAM_END()
} }
// Set the attribute as new default attribute in the document. /// Set the attribute as new default attribute in the document.
void SwEditShell::SetDefault( const SfxPoolItem& rFmtHint ) void SwEditShell::SetDefault( const SfxPoolItem& rFmtHint )
{ {
// 7502: Action-Parenthesis // 7502: Action-Parenthesis
...@@ -98,8 +96,7 @@ void SwEditShell::SetDefault( const SfxPoolItem& rFmtHint ) ...@@ -98,8 +96,7 @@ void SwEditShell::SetDefault( const SfxPoolItem& rFmtHint )
EndAllAction(); EndAllAction();
} }
// Inquire the Default Attribut in this document. /// request the default attribute in this document.
const SfxPoolItem& SwEditShell::GetDefault( sal_uInt16 nFmtHint ) const const SfxPoolItem& SwEditShell::GetDefault( sal_uInt16 nFmtHint ) const
{ {
return GetDoc()->GetDefault( nFmtHint ); return GetDoc()->GetDefault( nFmtHint );
......
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
#include <algorithm> #include <algorithm>
/** /*
* hard Formatting (Attributes) * hard Formatting (Attributes)
*/ */
...@@ -327,7 +327,7 @@ bool SwEditShell::HasFtns( bool bEndNotes ) const ...@@ -327,7 +327,7 @@ bool SwEditShell::HasFtns( bool bEndNotes ) const
} }
// Give a List of all footnotes and their beginning texts /// Give a List of all footnotes and their beginning texts
sal_uInt16 SwEditShell::GetSeqFtnList( SwSeqFldList& rList, bool bEndNotes ) sal_uInt16 SwEditShell::GetSeqFtnList( SwSeqFldList& rList, bool bEndNotes )
{ {
rList.Clear(); rList.Clear();
...@@ -368,7 +368,7 @@ sal_uInt16 SwEditShell::GetSeqFtnList( SwSeqFldList& rList, bool bEndNotes ) ...@@ -368,7 +368,7 @@ sal_uInt16 SwEditShell::GetSeqFtnList( SwSeqFldList& rList, bool bEndNotes )
} }
// Adjust left margin via object bar (similar to adjustment of numerations). /// Adjust left margin via object bar (similar to adjustment of numerations).
bool SwEditShell::IsMoveLeftMargin( bool bRight, bool bModulus ) const bool SwEditShell::IsMoveLeftMargin( bool bRight, bool bModulus ) const
{ {
bool bRet = true; bool bRet = true;
...@@ -525,7 +525,7 @@ static bool lcl_IsNoEndTxtAttrAtPos( const SwTxtNode& rTNd, xub_StrLen nPos, ...@@ -525,7 +525,7 @@ static bool lcl_IsNoEndTxtAttrAtPos( const SwTxtNode& rTNd, xub_StrLen nPos,
} }
// returns the scripttpye of the selection /// returns the script type of the selection
sal_uInt16 SwEditShell::GetScriptType() const sal_uInt16 SwEditShell::GetScriptType() const
{ {
sal_uInt16 nRet = 0; sal_uInt16 nRet = 0;
......
...@@ -150,7 +150,7 @@ SwTxtFmtColl* SwEditShell::GetTxtCollFromPool( sal_uInt16 nId ) ...@@ -150,7 +150,7 @@ SwTxtFmtColl* SwEditShell::GetTxtCollFromPool( sal_uInt16 nId )
} }
// return the demanded automatic format - base-class ! /// return the requested automatic format - base-class !
SwFmt* SwEditShell::GetFmtFromPool( sal_uInt16 nId ) SwFmt* SwEditShell::GetFmtFromPool( sal_uInt16 nId )
{ {
return GetDoc()->GetFmtFromPool( nId ); return GetDoc()->GetFmtFromPool( nId );
......
...@@ -491,7 +491,7 @@ sal_uInt16 SwEditShell::GetRefMarks( std::vector<OUString>* pStrings ) const ...@@ -491,7 +491,7 @@ sal_uInt16 SwEditShell::GetRefMarks( std::vector<OUString>* pStrings ) const
String SwEditShell::GetDropTxt( const sal_uInt16 nChars ) const String SwEditShell::GetDropTxt( const sal_uInt16 nChars ) const
{ {
/** /*
* pb: made changes for #i74939# * pb: made changes for #i74939#
* *
* always return a string even though there is a selection * always return a string even though there is a selection
...@@ -806,14 +806,14 @@ void SwEditShell::SetNumberingRestart() ...@@ -806,14 +806,14 @@ void SwEditShell::SetNumberingRestart()
{ {
StartAllAction(); StartAllAction();
Push(); Push();
//iterate over all text contents - body, frames, header, footer, footnote text // iterate over all text contents - body, frames, header, footer, footnote text
SwPaM* pCrsr = GetCrsr(); SwPaM* pCrsr = GetCrsr();
for(sal_uInt16 i = 0; i < 2; i++) for(sal_uInt16 i = 0; i < 2; i++)
{ {
if(!i) if(!i)
MakeFindRange(DOCPOS_START, DOCPOS_END, pCrsr); //body content MakeFindRange(DOCPOS_START, DOCPOS_END, pCrsr); // body content
else else
MakeFindRange(DOCPOS_OTHERSTART, DOCPOS_OTHEREND, pCrsr); //extra content MakeFindRange(DOCPOS_OTHERSTART, DOCPOS_OTHEREND, pCrsr); // extra content
SwPosition* pSttPos = pCrsr->Start(), *pEndPos = pCrsr->End(); SwPosition* pSttPos = pCrsr->Start(), *pEndPos = pCrsr->End();
sal_uLong nCurrNd = pSttPos->nNode.GetIndex(); sal_uLong nCurrNd = pSttPos->nNode.GetIndex();
sal_uLong nEndNd = pEndPos->nNode.GetIndex(); sal_uLong nEndNd = pEndPos->nNode.GetIndex();
...@@ -821,7 +821,7 @@ void SwEditShell::SetNumberingRestart() ...@@ -821,7 +821,7 @@ void SwEditShell::SetNumberingRestart()
{ {
SwCntntFrm* pCntFrm; SwCntntFrm* pCntFrm;
bool bGoOn = true; bool bGoOn = true;
//iterate over all paragraphs // iterate over all paragraphs
while( bGoOn ) while( bGoOn )
{ {
SwNode* pNd = GetDoc()->GetNodes()[ nCurrNd ]; SwNode* pNd = GetDoc()->GetNodes()[ nCurrNd ];
...@@ -830,13 +830,13 @@ void SwEditShell::SetNumberingRestart() ...@@ -830,13 +830,13 @@ void SwEditShell::SetNumberingRestart()
case ND_TEXTNODE: case ND_TEXTNODE:
if( 0 != ( pCntFrm = ((SwTxtNode*)pNd)->getLayoutFrm( GetLayout() )) ) if( 0 != ( pCntFrm = ((SwTxtNode*)pNd)->getLayoutFrm( GetLayout() )) )
{ {
//jump over hidden frames - ignore protection! // skip hidden frames - ignore protection!
if( !((SwTxtFrm*)pCntFrm)->IsHiddenNow() ) if( !((SwTxtFrm*)pCntFrm)->IsHiddenNow() )
{ {
//if the node is numbered and the starting value of the numbering equals the // if the node is numbered and the starting value of the numbering equals the
//start value of the numbering rule then set this value as hard starting value // start value of the numbering rule then set this value as hard starting value
//get the node num // get the node num
// OD 2005-11-09 // OD 2005-11-09
SwTxtNode* pTxtNd( static_cast<SwTxtNode*>(pNd) ); SwTxtNode* pTxtNd( static_cast<SwTxtNode*>(pNd) );
SwNumRule* pNumRule( pTxtNd->GetNumRule() ); SwNumRule* pNumRule( pTxtNd->GetNumRule() );
...@@ -848,7 +848,7 @@ void SwEditShell::SetNumberingRestart() ...@@ -848,7 +848,7 @@ void SwEditShell::SetNumberingRestart()
pTxtNd->GetNum()->GetNumber() == pTxtNd->GetNum()->GetNumber() ==
pNumRule->Get( static_cast<sal_uInt16>(pTxtNd->GetActualListLevel()) ).GetStart() ) pNumRule->Get( static_cast<sal_uInt16>(pTxtNd->GetActualListLevel()) ).GetStart() )
{ {
//now set a the start value as attribute // now set a the start value as attribute
SwPosition aCurrentNode(*pNd); SwPosition aCurrentNode(*pNd);
GetDoc()->SetNumRuleStart( aCurrentNode, sal_True ); GetDoc()->SetNumRuleStart( aCurrentNode, sal_True );
} }
...@@ -856,7 +856,7 @@ void SwEditShell::SetNumberingRestart() ...@@ -856,7 +856,7 @@ void SwEditShell::SetNumberingRestart()
} }
break; break;
case ND_SECTIONNODE: case ND_SECTIONNODE:
// jump over hidden sections - ignore protection! // skip hidden sections - ignore protection!
if(((SwSectionNode*)pNd)->GetSection().IsHidden() ) if(((SwSectionNode*)pNd)->GetSection().IsHidden() )
nCurrNd = pNd->EndOfSectionIndex(); nCurrNd = pNd->EndOfSectionIndex();
break; break;
......
This diff is collapsed.
...@@ -178,8 +178,7 @@ sal_Bool SwEditShell::SelectionHasNumber() const ...@@ -178,8 +178,7 @@ sal_Bool SwEditShell::SelectionHasNumber() const
{ {
bResult = pTxtNd->HasNumber(); bResult = pTxtNd->HasNumber();
// --> OD 2005-10-26 #b6340308# // #b6340308# special case: outline numbered, not counted paragraph
// special case: outline numbered, not counted paragraph
if ( bResult && if ( bResult &&
pTxtNd->GetNumRule() == GetDoc()->GetOutlineNumRule() && pTxtNd->GetNumRule() == GetDoc()->GetOutlineNumRule() &&
!pTxtNd->IsCountedInList() ) !pTxtNd->IsCountedInList() )
...@@ -189,7 +188,6 @@ sal_Bool SwEditShell::SelectionHasNumber() const ...@@ -189,7 +188,6 @@ sal_Bool SwEditShell::SelectionHasNumber() const
if (bResult==sal_False) { if (bResult==sal_False) {
break; break;
} }
// <--
} }
} }
} }
...@@ -199,7 +197,8 @@ sal_Bool SwEditShell::SelectionHasNumber() const ...@@ -199,7 +197,8 @@ sal_Bool SwEditShell::SelectionHasNumber() const
return bResult; return bResult;
} }
//Sym3_879 add a new function to determine number on/off status
// add a new function to determine number on/off status
sal_Bool SwEditShell::SelectionHasBullet() const sal_Bool SwEditShell::SelectionHasBullet() const
{ {
sal_Bool bResult = HasBullet(); sal_Bool bResult = HasBullet();
......
...@@ -122,8 +122,10 @@ void SwEditShell::UpdateRedlineAttr() ...@@ -122,8 +122,10 @@ void SwEditShell::UpdateRedlineAttr()
} }
} }
// Search the Redline of this data and return the Pos of the Array /** Search the Redline of the data given
// return USHRT_MAX if not present *
* @return Returns the Pos of the Array, or USHRT_MAX if not present
*/
sal_uInt16 SwEditShell::FindRedlineOfData( const SwRedlineData& rData ) const sal_uInt16 SwEditShell::FindRedlineOfData( const SwRedlineData& rData ) const
{ {
const SwRedlineTbl& rTbl = GetDoc()->GetRedlineTbl(); const SwRedlineTbl& rTbl = GetDoc()->GetRedlineTbl();
......
...@@ -78,10 +78,9 @@ const SwSection* SwEditShell::GetCurrSection() const ...@@ -78,10 +78,9 @@ const SwSection* SwEditShell::GetCurrSection() const
return GetDoc()->GetCurrSection( *GetCrsr()->GetPoint() ); return GetDoc()->GetCurrSection( *GetCrsr()->GetPoint() );
} }
/** /** Deliver the responsible area of the columns.
* SwEditShell::GetAnySection delivers the responsible area *
* of the columns, in footnotes it may not be the * In footnotes it may not be the area within the footnote.
* area within the footnote.
*/ */
const SwSection* SwEditShell::GetAnySection( sal_Bool bOutOfTab, const Point* pPt ) const const SwSection* SwEditShell::GetAnySection( sal_Bool bOutOfTab, const Point* pPt ) const
...@@ -254,9 +253,10 @@ void SwEditShell::_SetSectionAttr( SwSectionFmt& rSectFmt, ...@@ -254,9 +253,10 @@ void SwEditShell::_SetSectionAttr( SwSectionFmt& rSectFmt,
EndAllAction(); EndAllAction();
} }
// search inside the cursor selection for full selected sections. /** Search inside the cursor selection for full selected sections.
// if any part of section in the selection return 0. *
// if more than one in the selection return the count * @return If any part of section in the selection return 0, if more than one return the count.
*/
sal_uInt16 SwEditShell::GetFullSelectedSectionCount() const sal_uInt16 SwEditShell::GetFullSelectedSectionCount() const
{ {
sal_uInt16 nRet = 0; sal_uInt16 nRet = 0;
...@@ -298,8 +298,8 @@ sal_uInt16 SwEditShell::GetFullSelectedSectionCount() const ...@@ -298,8 +298,8 @@ sal_uInt16 SwEditShell::GetFullSelectedSectionCount() const
} }
/** /** Find the suitable node for a special insert (alt-enter).
* Find the suitable node for a special insert (alt-enter). *
* This should enable inserting text before/after sections and tables. * This should enable inserting text before/after sections and tables.
* *
* A node is found if: * A node is found if:
...@@ -407,8 +407,7 @@ bool SwEditShell::CanSpecialInsert() const ...@@ -407,8 +407,7 @@ bool SwEditShell::CanSpecialInsert() const
return NULL != lcl_SpecialInsertNode( GetCrsr()->GetPoint() ); return NULL != lcl_SpecialInsertNode( GetCrsr()->GetPoint() );
} }
/** check whether a node can be special-inserted (alt-Enter), and do so. Return
/** check whether a node cen be special-inserted (alt-Enter), and do so. Return
whether insertion was possible. whether insertion was possible.
*/ */
bool SwEditShell::DoSpecialInsert() bool SwEditShell::DoSpecialInsert()
......
...@@ -103,9 +103,8 @@ const SwTable& SwEditShell::InsertTable( const SwInsertTableOptions& rInsTblOpts ...@@ -103,9 +103,8 @@ const SwTable& SwEditShell::InsertTable( const SwInsertTableOptions& rInsTblOpts
GetDoc()->SplitNode( *pPos, false ); GetDoc()->SplitNode( *pPos, false );
} }
/* If called from a shell the adjust item is propagated // If called from a shell the adjust item is propagated
from pPos to the new content nodes in the table. // from pPos to the new content nodes in the table.
*/
const SwTable *pTable = GetDoc()->InsertTable( rInsTblOpts, *pPos, const SwTable *pTable = GetDoc()->InsertTable( rInsTblOpts, *pPos,
nRows, nCols, nRows, nCols,
eAdj, pTAFmt, eAdj, pTAFmt,
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment