diff options
Diffstat (limited to 'sw/source/core/edit')
-rwxr-xr-x | sw/source/core/edit/acorrect.cxx | 11 | ||||
-rw-r--r-- | sw/source/core/edit/autofmt.cxx | 152 | ||||
-rw-r--r-- | sw/source/core/edit/edatmisc.cxx | 20 | ||||
-rw-r--r-- | sw/source/core/edit/edattr.cxx | 32 | ||||
-rw-r--r-- | sw/source/core/edit/eddel.cxx | 6 | ||||
-rw-r--r-- | sw/source/core/edit/edfcol.cxx | 11 | ||||
-rw-r--r-- | sw/source/core/edit/edfld.cxx | 25 | ||||
-rw-r--r-- | sw/source/core/edit/edfldexp.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/edit/edfmt.cxx | 11 | ||||
-rw-r--r-- | sw/source/core/edit/edglbldc.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/edit/edglss.cxx | 6 | ||||
-rw-r--r-- | sw/source/core/edit/editsh.cxx | 81 | ||||
-rw-r--r-- | sw/source/core/edit/edlingu.cxx | 135 | ||||
-rw-r--r-- | sw/source/core/edit/ednumber.cxx | 60 | ||||
-rw-r--r-- | sw/source/core/edit/edredln.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/edit/edsect.cxx | 10 | ||||
-rw-r--r-- | sw/source/core/edit/edtab.cxx | 10 | ||||
-rw-r--r-- | sw/source/core/edit/edtox.cxx | 38 | ||||
-rw-r--r-- | sw/source/core/edit/edundo.cxx | 16 | ||||
-rw-r--r-- | sw/source/core/edit/edws.cxx | 6 |
20 files changed, 217 insertions, 423 deletions
diff --git a/sw/source/core/edit/acorrect.cxx b/sw/source/core/edit/acorrect.cxx index d018b0731e43..a9ab99f2ee4b 100755 --- a/sw/source/core/edit/acorrect.cxx +++ b/sw/source/core/edit/acorrect.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -192,10 +193,6 @@ sal_Bool SwAutoCorrDoc::ReplaceRange( xub_StrLen nPos, xub_StrLen nSourceLength, { SwDoc* pDoc = rEditSh.GetDoc(); -// if( !pDoc->IsAutoFmtRedline() && -// pPam != &rCrsr ) // nur an akt. Position das Redline sichern -// pDoc->SetRedlineMode_intern( eOld | REDLINE_IGNORE ); - if( pDoc->IsAutoFmtRedline() ) { if( nPos == pNd->GetTxt().Len() ) // am Ende erfolgt ein Insert @@ -310,7 +307,6 @@ const String* SwAutoCorrDoc::GetPrevPara( sal_Bool bAtNormalPos ) (*pIdx)--; pTNd = pIdx->GetNode().GetTxtNode(); } - //if( pTNd && NO_NUMBERING == pTNd->GetTxtColl()->GetOutlineLevel() ) if( pTNd && 0 == pTNd->GetAttrOutlineLevel() )//#outline level,zhaojianwei pStr = &pTNd->GetTxt(); @@ -330,7 +326,7 @@ sal_Bool SwAutoCorrDoc::ChgAutoCorrWord( xub_StrLen & rSttPos, xub_StrLen nEndPo // Absatz-Anfang oder ein Blank gefunden, suche nach dem Wort // Kuerzel im Auto SwTxtNode* pTxtNd = rCrsr.GetNode()->GetTxtNode(); - ASSERT( pTxtNd, "wo ist denn der TextNode?" ); + OSL_ENSURE( pTxtNd, "wo ist denn der TextNode?" ); sal_Bool bRet = sal_False; if( nEndPos == rSttPos ) @@ -374,7 +370,7 @@ sal_Bool SwAutoCorrDoc::ChgAutoCorrWord( xub_StrLen & rSttPos, xub_StrLen nEndPo if( ppPara ) { - ASSERT( !pIdx, "wer hat seinen Index nicht geloescht?" ); + OSL_ENSURE( !pIdx, "wer hat seinen Index nicht geloescht?" ); pIdx = new SwNodeIndex( rCrsr.GetPoint()->nNode, -1 ); } @@ -546,3 +542,4 @@ void SwDontExpandItem::RestoreDontExpandItems( const SwPosition& rPos ) } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/edit/autofmt.cxx b/sw/source/core/edit/autofmt.cxx index 3ae88ec4b45d..4400b66b1704 100644 --- a/sw/source/core/edit/autofmt.cxx +++ b/sw/source/core/edit/autofmt.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -28,8 +29,6 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" - -#define _SVSTDARR_LONGS #define _SVSTDARR_USHORTS #include <ctype.h> @@ -63,7 +62,7 @@ #include <pam.hxx> #include <edimp.hxx> #include <fesh.hxx> -#include <swundo.hxx> // fuer die UndoIds +#include <swundo.hxx> // for the UndoId's #include <poolfmt.hxx> #include <ndtxt.hxx> #include <txtfrm.hxx> @@ -99,23 +98,23 @@ const sal_Unicode cStarSymbolEmDash = 0x2014; SvxSwAutoFmtFlags* SwEditShell::pAutoFmtFlags = 0; -// Anzahl von Num-/Bullet-Absatzvorlagen. MAXLEVEL wird demnaechst auf -// x erhoeht, die Anzahl Vorlagen aber nicht (Ueberbleibsel aus <= 4.0) +// Number of num-/bullet-paragraph templates. MAXLEVEL will soon be raised +// to x, but not the number of templates. (Artifact from <= 4.0) const sal_uInt16 cnNumBullColls = 4; class SwAutoFormat { SvxSwAutoFmtFlags aFlags; - SwPaM aDelPam; // ein Pam der benutzt werden kann - SwNodeIndex aNdIdx; // der Index auf den akt. TextNode - SwNodeIndex aEndNdIdx; // Index auf das Ende vom Bereich + SwPaM aDelPam; // a Pam that can be used + SwNodeIndex aNdIdx; // the index on the current TextNode + SwNodeIndex aEndNdIdx; // index on the end of the area SwEditShell* pEditShell; SwDoc* pDoc; - SwTxtNode* pAktTxtNd; // der akt. TextNode - SwTxtFrm* pAktTxtFrm; // Frame vom akt. TextNode + SwTxtNode* pAktTxtNd; // the current TextNode + SwTxtFrm* pAktTxtFrm; // frame of the current TextNode CharClass* pCharClass; // Character classification - sal_uLong nEndNdIdx; // fuer die Prozent-Anzeige + sal_uLong nEndNdIdx; // for the percentage-display LanguageType eCharClassLang; sal_uInt16 nLastHeadLvl, nLastCalcHeadLvl; @@ -178,7 +177,7 @@ class SwAutoFormat String GoNextPara(); sal_Bool HasObjects( const SwNode& rNd ); - // TxtNode Methoden + // TxtNode methods const SwTxtNode* GetNextNode() const; sal_Bool IsEmptyLine( const SwTxtNode& rNd ) const { return 0 == rNd.GetTxt().Len() || @@ -201,7 +200,7 @@ class SwAutoFormat sal_uInt16 GetDigitLevel( const SwTxtNode& rTxtNd, xub_StrLen& rPos, String* pPreFix = 0, String* pPostFix = 0, String* pNumTypes = 0 ) const; - // hole den FORMATIERTEN TextFrame + // get the FORMATED TextFrame SwTxtFrm* GetFrm( const SwTxtNode& rTxtNd ) const; void BuildIndent(); @@ -215,15 +214,15 @@ class SwAutoFormat sal_Bool HasBreakAttr( const SwTxtNode& ) const; void DeleteSel( SwPaM& rPam ); sal_Bool DeleteAktNxtPara( const String& rNxtPara ); - // loesche im Node Anfang oder/und Ende + // delete in the node start and/or end void DeleteAktPara( sal_Bool bStart = sal_True, sal_Bool nEnd = sal_True ); void DelEmptyLine( sal_Bool bTstNextPara = sal_True ); - // loesche bei mehrzeiligen Absaetzen die "linken" und/oder - // "rechten" Raender + // when using multiline paragraphs delete the "left" and/or + // "right" margins void DelMoreLinesBlanks( sal_Bool bWithLineBreaks = sal_False ); - // loesche den vorherigen Absatz + // delete the previous paragraph void DelPrevPara(); - // dann lasse doch mal das AutoCorrect auf den akt. TextNode los + // execute AutoCorrect on current TextNode void AutoCorrect( xub_StrLen nSttPos = 0 ); sal_Bool CanJoin( const SwTxtNode* pTxtNd ) const @@ -237,7 +236,7 @@ class SwAutoFormat !HasBreakAttr( *pTxtNd ); } - // ist ein Punkt am Ende ?? + // is a dot at the end ?? sal_Bool IsSentenceAtEnd( const SwTxtNode& rTxtNd ) const; sal_Bool DoUnderline(); @@ -269,9 +268,9 @@ const sal_Unicode* StrChr( const sal_Unicode* pSrc, sal_Unicode c ) SwTxtFrm* SwAutoFormat::GetFrm( const SwTxtNode& rTxtNd ) const { - // besorge mal den Frame + // get the Frame const SwCntntFrm *pFrm = rTxtNd.getLayoutFrm( pEditShell->GetLayout() ); - ASSERT( pFrm, "zum Autoformat muss das Layout vorhanden sein" ); + OSL_ENSURE( pFrm, "zum Autoformat muss das Layout vorhanden sein" ); if( aFlags.bAFmtByInput && !pFrm->IsValid() ) { SwRect aTmpFrm( pFrm->Frm() ); @@ -347,10 +346,10 @@ String SwAutoFormat::GoNextPara() else pNewNd = &aNdIdx.GetNode(); - // kein TextNode -> - // TableNode : Tabelle ueberspringen - // NoTxtNode : Nodes ueberspringen - // EndNode : Ende erreicht, beenden + // not a TextNode -> + // TableNode : skip table + // NoTxtNode : skip nodes + // EndNode : at the end, terminate if( pNewNd->IsEndNode() ) { bEnde = sal_True; @@ -377,8 +376,8 @@ String SwAutoFormat::GoNextPara() sal_Bool SwAutoFormat::HasObjects( const SwNode& rNd ) { - // haengt irgend etwas absatzgebundenes am Absatz? - // z.B. Rahmen, DrawObjecte, .. + // Is there something bound to the paragraph in the paragraph + // like borders, DrawObjects, ... sal_Bool bRet = sal_False; const SwSpzFrmFmts& rFmts = *pDoc->GetSpzFrmFmts(); for( sal_uInt16 n = 0; n < rFmts.Count(); ++n ) @@ -431,12 +430,12 @@ sal_Bool SwAutoFormat::IsEnumericChar( const SwTxtNode& rNd ) const if( !nLen ) return sal_False; - // -, +, * getrennt durch Blank ?? + // -, +, * separated by blank ?? if( 2 < nLen && IsSpace( rTxt.GetChar( nBlnks + 1 ) ) ) { if( StrChr( pBulletChar, rTxt.GetChar( nBlnks ) ) ) return sal_True; - // sollte an der Position ein Symbolfont existieren ? + // Should there be a symbol font at the position? SwTxtFrmInfo aFInfo( GetFrm( rNd ) ); if( aFInfo.IsBullet( nBlnks )) return sal_True; @@ -449,7 +448,7 @@ sal_Bool SwAutoFormat::IsEnumericChar( const SwTxtNode& rNd ) const sal_Bool SwAutoFormat::IsBlanksInString( const SwTxtNode& rNd ) const { - // suche im String mehr als 5 Blanks/Tabs + // Search more that 5 blanks/tabs in the string. String sTmp( rNd.GetTxt() ); DelTrailingBlanks( DelLeadingBlanks( sTmp )); const sal_Unicode* pTmp = sTmp.GetBuffer(); @@ -457,7 +456,7 @@ sal_Bool SwAutoFormat::IsBlanksInString( const SwTxtNode& rNd ) const { if( IsSpace( *pTmp ) ) { - if( IsSpace( *++pTmp )) // 2 Space nach einander + if( IsSpace( *++pTmp )) // 2 spaces after each other { const sal_Unicode* pStt = pTmp; while( *pTmp && IsSpace( *++pTmp )) @@ -506,7 +505,7 @@ sal_uInt16 SwAutoFormat::CalcLevel( const SwTxtNode& rNd, sal_uInt16 *pDigitLvl break; default: if( pDigitLvl ) - // Teste auf 1.) / 1. / 1.1.1 / (1). / (1) / .... + // test 1.) / 1. / 1.1.1 / (1). / (1) / .... *pDigitLvl = GetDigitLevel( rNd, n ); return nLvl; } @@ -568,12 +567,9 @@ sal_Bool SwAutoFormat::DoUnderline() xub_StrLen nCnt = 0; while( *pStr ) { -//JP 29.03.96: Spaces unterbrechen die Umrandung! -// if( !IsSpace( *pStr ) ) + int eTmp = 0; + switch( *pStr ) { - int eTmp = 0; - switch( *pStr ) - { case '-': eTmp = 1; break; case '_': eTmp = 2; break; case '=': eTmp = 3; break; @@ -582,13 +578,13 @@ sal_Bool SwAutoFormat::DoUnderline() case '#': eTmp = 6; break; default: return sal_False; - } - if( 0 == eState ) - eState = eTmp; - else if( eState != eTmp ) - return sal_False; - ++nCnt; } + if( 0 == eState ) + eState = eTmp; + else if( eState != eTmp ) + return sal_False; + ++nCnt; + ++pStr; } @@ -598,37 +594,33 @@ sal_Bool SwAutoFormat::DoUnderline() DelEmptyLine( sal_False ); aDelPam.SetMark(); aDelPam.GetMark()->nContent = 0; -//JP 19.03.96: kein Underline sondern eine Umrandung setzen! -// pDoc->Insert( aDelPam, SvxUnderlineItem( eState ) ); SvxBorderLine aLine; switch( eState ) { case 1: // einfach, 0,05 pt - aLine.SetOutWidth( DEF_LINE_WIDTH_0 ); + aLine.SetStyle( SOLID ); + aLine.SetWidth( DEF_LINE_WIDTH_0 ); break; case 2: // einfach, 1,0 pt - aLine.SetOutWidth( DEF_LINE_WIDTH_1 ); + aLine.SetStyle( SOLID ); + aLine.SetWidth( DEF_LINE_WIDTH_1 ); break; case 3: // doppelt, 1,1 pt - aLine.SetOutWidth( DEF_DOUBLE_LINE0_OUT ); - aLine.SetInWidth( DEF_DOUBLE_LINE0_IN ); - aLine.SetDistance( DEF_DOUBLE_LINE0_DIST ); + aLine.SetStyle( DOUBLE ); + aLine.SetWidth( DEF_LINE_WIDTH_0 ); break; case 4: // doppelt, 4,5 pt - aLine.SetOutWidth( DEF_DOUBLE_LINE4_OUT ); - aLine.SetInWidth( DEF_DOUBLE_LINE4_IN ); - aLine.SetDistance( DEF_DOUBLE_LINE4_DIST ); + aLine.SetStyle( THICKTHIN_SMALLGAP ); + aLine.SetWidth( DEF_LINE_WIDTH_1 ); break; case 5: // doppelt, 6,0 pt - aLine.SetOutWidth( DEF_DOUBLE_LINE5_OUT ); - aLine.SetInWidth( DEF_DOUBLE_LINE5_IN ); - aLine.SetDistance( DEF_DOUBLE_LINE5_DIST ); + aLine.SetStyle( THINTHICK_SMALLGAP ); + aLine.SetWidth( DEF_LINE_WIDTH_2 ); break; case 6: // doppelt, 9,0 pt - aLine.SetOutWidth( DEF_DOUBLE_LINE6_OUT ); - aLine.SetInWidth( DEF_DOUBLE_LINE6_IN ); - aLine.SetDistance( DEF_DOUBLE_LINE6_DIST ); + aLine.SetStyle( DOUBLE ); + aLine.SetWidth( DEF_LINE_WIDTH_2 ); break; } SfxItemSet aSet(pDoc->GetAttrPool(), @@ -860,7 +852,6 @@ sal_uInt16 SwAutoFormat::GetDigitLevel( const SwTxtNode& rNd, xub_StrLen& rPos, // roemische Zeichen sind "mdclxvi". Da man aber eher mal eine // Numerierung mit c oder d anfangen will, werden diese erstmal // zu chars und spaeter ggfs. zu romischen Zeichen! -// if( strchr( "mdclxvi", cLow )) #ifdef WITH_ALPHANUM_AS_NUMFMT //detection of 'c' and 'd' a ROMAN numbering should not be done here if( 256 > cLow &&( (eScan & (LOWER_ROMAN|UPPER_ROMAN)) @@ -1087,8 +1078,6 @@ sal_Bool SwAutoFormat::HasSelBlanks( SwPaM& rPam ) const SwTxtNode* pTxtNd = pPos->nNode.GetNode().GetTxtNode(); if( nBlnkPos && nBlnkPos-- < pTxtNd->GetTxt().Len() && ( ' ' == pTxtNd->GetTxt().GetChar( nBlnkPos ) )) -// JP 23.08.95: keine Tabs stehen lassen, diese in Blanks wandeln -// ( ' ' == ( cCh = pTxtNd->GetTxt()[ nBlnkPos ] ) || '\t' == cCh )) pPos->nContent--; else { @@ -1097,8 +1086,6 @@ sal_Bool SwAutoFormat::HasSelBlanks( SwPaM& rPam ) const pTxtNd = pPos->nNode.GetNode().GetTxtNode(); if( nBlnkPos < pTxtNd->GetTxt().Len() && ( ' ' == pTxtNd->GetTxt().GetChar( nBlnkPos ))) -// JP 23.08.95: keine Tabs stehen lassen, diese in Blanks wandeln -// ( ' ' == ( cCh = pTxtNd->GetTxt()[ nBlnkPos ] ) || '\t' == cCh )) pPos->nContent++; else return sal_False; @@ -1473,19 +1460,17 @@ void SwAutoFormat::BuildEnum( sal_uInt16 nLvl, sal_uInt16 nDigitLevel ) IsBlanksInString( *pAktTxtNd ) || IsSentenceAtEnd( *pAktTxtNd ); sal_Bool bRTL = pEditShell->IsInRightToLeftText(); -// SetColl( RES_POOLCOLL_NUM_LEVEL1 + ( nLvl * 4 ) ); DeleteAktPara( sal_True, sal_True ); sal_Bool bChgBullet = sal_False, bChgEnum = sal_False; xub_StrLen nAutoCorrPos = 0; // falls die Numerierung gesetzt werden, die akt. besorgen - // --> OD 2008-02-11 #newlistlevelattrs# SwNumRule aRule( pDoc->GetUniqueNumRuleName(), // --> OD 2008-06-06 #i89178# numfunc::GetDefaultPositionAndSpaceMode() ); // <-- - // <-- + const SwNumRule* pCur = 0; if( aFlags.bSetNumRule && 0 != (pCur = pAktTxtNd->GetNumRule()) ) aRule = *pCur; @@ -1494,7 +1479,6 @@ void SwAutoFormat::BuildEnum( sal_uInt16 nLvl, sal_uInt16 nDigitLevel ) const String& rStr = pAktTxtNd->GetTxt(); xub_StrLen nTxtStt = 0, nOrigTxtStt = 0; const sal_Unicode* pFndBulletChr; -// if( aFlags.bAFmtByInput ? aFlags.bSetNumRule : aFlags.bChgEnumNum && if( aFlags.bChgEnumNum && 2 < rStr.Len() && 0 != ( pFndBulletChr = StrChr( pBulletChar, rStr.GetChar( nTxtStt ) )) @@ -1684,10 +1668,8 @@ void SwAutoFormat::BuildEnum( sal_uInt16 nLvl, sal_uInt16 nDigitLevel ) pAktTxtNd->SetAttrListLevel(nLvl); pAktTxtNd->SetNumLSpace( sal_True ); - // --> OD 2008-03-17 #refactorlists# // start new list pDoc->SetNumRule( aDelPam, aRule, true ); - // <-- aDelPam.DeleteMark(); aDelPam.GetPoint()->nContent.Assign( pAktTxtNd, 0 ); @@ -2092,12 +2074,7 @@ void SwAutoFormat::AutoCorrect( xub_StrLen nPos ) case '?': if( aFlags.bCptlSttSntnc ) bFirstSent = sal_True; -//alle Wortrenner loesen die Autokorrektur aus! -// break; default: -//alle Wortrenner loesen die Autokorrektur aus! -// case ' ': -// case '\t': if( !( rAppCC.isLetterNumeric( *pTxt, nPos ) || '/' == cChar )) // '/' should not be a word seperator (e.g. '1/2' needs to be handled as one word for replacement) { @@ -2205,7 +2182,7 @@ SwAutoFormat::SwAutoFormat( SwEditShell* pEdShell, SvxSwAutoFmtFlags& rFlags, pCharClass( 0 ), nRedlAutoFmtSeqId( 0 ) { - ASSERT( (pSttNd && pEndNd) || (!pSttNd && !pEndNd), + OSL_ENSURE( (pSttNd && pEndNd) || (!pSttNd && !pEndNd), "Kein Bereich angegeben" ); if( aFlags.bSetNumRule && !aFlags.bAFmtByInput ) @@ -2420,10 +2397,6 @@ SwAutoFormat::SwAutoFormat( SwEditShell* pEdShell, SvxSwAutoFmtFlags& rFlags, if( !bNxtEmpty && HasBreakAttr( *pNxtNd ) ) bNxtEmpty = sal_True; - // fuer z.B. selbst definierte Einzuege oder - // rechts/zentierte Ausrichtung -// if( !nLevel && 0 != aFInfo.GetLineStart() ) -// nLevel = 1; } else { @@ -2462,13 +2435,6 @@ SwAutoFormat::SwAutoFormat( SwEditShell* pEdShell, SvxSwAutoFmtFlags& rFlags, // nicht, dann teste auf Ueberschrift if( ':' == sEndClrStr.GetChar( nLen - 1 ) ) { -//--------------------------------------------------------------------------- -// Wie ist denn nun die Bedingung fuer die Ueberschrift auf Ebene 3 ?? -// Zur Zeit: generell wenn am Ende ein ':' ist. -// -// if( bNxtEmpty || bNxtAlpha ) -// !IsEnumericChar( *pNxtNd ) ) -//--------------------------------------------------------------------------- { BuildHeadLine( 2 ); eStat = READ_NEXT_PARA; @@ -2481,16 +2447,8 @@ SwAutoFormat::SwAutoFormat( SwEditShell* pEdShell, SvxSwAutoFmtFlags& rFlags, if( bNxtEmpty || bNxtAlpha || ( pNxtNd && IsEnumericChar( *pNxtNd )) -//--------------------------------------------------------------------------- -// ist zum Verwechseln mit neg. Einzug !! - /*|| nLevel < nNxtLevel*/ -//--------------------------------------------------------------------------- - ) { - // wurde Level vom Text vorgegeben ? -// if( USHRT_MAX != nDigitLvl ) -// nLevel = nDigitLvl; // eine Ebene runter ? if( nLevel >= MAXLEVEL ) @@ -2532,9 +2490,6 @@ SwAutoFormat::SwAutoFormat( SwEditShell* pEdShell, SvxSwAutoFmtFlags& rFlags, BuildEnum( nLevel, nDigitLvl ); eStat = READ_NEXT_PARA; } -//JP 25.03.96: Vorlagen fuer Einzug zulassen -// else if( aFlags.bAFmtByInput ) -// eStat = READ_NEXT_PARA; else if( bReplaceStyles ) eStat = nLevel ? TST_IDENT : TST_NEG_IDENT; else @@ -2796,3 +2751,4 @@ void SwEditShell::SetAutoFmtFlags(SvxSwAutoFmtFlags * pFlags) pEditFlags->aByInputBulletFont = pFlags->aByInputBulletFont; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/edit/edatmisc.cxx b/sw/source/core/edit/edatmisc.cxx index 386814eda008..bb5d650484b2 100644 --- a/sw/source/core/edit/edatmisc.cxx +++ b/sw/source/core/edit/edatmisc.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -54,7 +55,7 @@ void SwEditShell::ResetAttr( const SvUShortsSort* pAttrs ) } FOREACHPAM_START(this) - // if ( PCURCRSR->HasMark() ) + GetDoc()->ResetAttrs(*PCURCRSR, sal_True, pAttrs); FOREACHPAM_END() @@ -70,10 +71,6 @@ void SwEditShell::ResetAttr( const SvUShortsSort* pAttrs ) void SwEditShell::GCAttr() { -//JP 04.02.97: wozu eine Action-Klammerung - ein Formatierung sollte nicht -// ausgeloest werden, so dass es hier ueberfluessig ist. -// Sonst Probleme im MouseBut.DownHdl - Bug 35562 -// StartAllAction(); FOREACHPAM_START(this) if ( !PCURCRSR->HasMark() ) { @@ -97,7 +94,6 @@ void SwEditShell::GCAttr() aIdx <= rEnd ); } FOREACHPAM_END() -// EndAllAction(); } // Setze das Attribut als neues default Attribut im Dokument. @@ -111,17 +107,6 @@ void SwEditShell::SetDefault( const SfxPoolItem& rFmtHint ) EndAllAction(); } -/* - -void SwEditShell::SetDefault( const SfxItemSet& rSet ) -{ - // 7502: Action-Klammerung - StartAllAction(); - GetDoc()->SetDefault( rSet ); - EndAllAction(); -} -*/ - // Erfrage das Default Attribut in diesem Dokument. const SfxPoolItem& SwEditShell::GetDefault( sal_uInt16 nFmtHint ) const @@ -193,3 +178,4 @@ void SwEditShell::SetAttr( const SfxItemSet& rSet, sal_uInt16 nFlags ) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/edit/edattr.cxx b/sw/source/core/edit/edattr.cxx index 8a5891093315..a67663445a85 100644 --- a/sw/source/core/edit/edattr.cxx +++ b/sw/source/core/edit/edattr.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -70,10 +71,8 @@ const sal_uInt16& getMaxLookup() return nMaxLookup; } -// --> OD 2008-01-16 #newlistlevelattrs# sal_Bool SwEditShell::GetCurAttr( SfxItemSet& rSet, const bool bMergeIndentValuesOfNumRule ) const -// <-- { if( GetCrsrCnt() > getMaxLookup() ) { @@ -142,11 +141,10 @@ sal_Bool SwEditShell::GetCurAttr( SfxItemSet& rSet, xub_StrLen nStt = n == nSttNd ? nSttCnt : 0, nEnd = n == nEndNd ? nEndCnt : ((SwTxtNode*)pNd)->GetTxt().Len(); - // --> OD 2008-01-16 #newlistlevelattrs# + ((SwTxtNode*)pNd)->GetAttr( *pSet, nStt, nEnd, sal_False, sal_True, bMergeIndentValuesOfNumRule ); - // <-- } break; case ND_GRFNODE: @@ -257,21 +255,6 @@ bool SwEditShell::SetCurFtn( const SwFmtFtn& rFillFtn ) } - -/*sal_uInt16 SwEditShell::GetFtnCnt( sal_Bool bEndNotes = sal_False ) const -{ - const SwFtnIdxs &rIdxs = pDoc->GetFtnIdxs(); - sal_uInt16 nCnt = 0; - for ( sal_uInt16 i = 0; i < rIdxs.Count(); ++i ) - { - const SwFmtFtn &rFtn = rIdxs[i]->GetFtn(); - if ( bEndNotes == rFtn.IsEndNote() ) - nCnt++; - } - return nCnt; -} */ - - bool SwEditShell::HasFtns( bool bEndNotes ) const { const SwFtnIdxs &rIdxs = pDoc->GetFtnIdxs(); @@ -427,10 +410,9 @@ sal_Bool lcl_IsNoEndTxtAttrAtPos( const SwTxtNode& rTNd, xub_StrLen nPos, { bRet = sal_False; - // --> OD 2008-03-19 #refactorlists# if ( rTNd.IsInList() ) { - ASSERT( rTNd.GetNumRule(), + OSL_ENSURE( rTNd.GetNumRule(), "<lcl_IsNoEndTxtAttrAtPos(..)> - no list style found at text node. Serious defect -> please inform OD." ); const SwNumRule* pNumRule = rTNd.GetNumRule(); const SwNumFmt &rNumFmt = pNumRule->Get( static_cast<sal_uInt16>(rTNd.GetActualListLevel()) ); @@ -490,7 +472,7 @@ sal_Bool lcl_IsNoEndTxtAttrAtPos( const SwTxtNode& rTNd, xub_StrLen nPos, sal_uInt16 SwEditShell::GetScriptType() const { sal_uInt16 nRet = 0; - //if( pBreakIt->GetBreakIter().is() ) + { FOREACHPAM_START(this) @@ -551,7 +533,7 @@ sal_uInt16 SwEditShell::GetScriptType() const ? pEnd->nContent.GetIndex() : rTxt.Len(); - ASSERT( nEndPos <= rTxt.Len(), "Index outside the range - endless loop!" ); + OSL_ENSURE( nEndPos <= rTxt.Len(), "Index outside the range - endless loop!" ); if( nEndPos > rTxt.Len() ) nEndPos = rTxt.Len(); @@ -625,7 +607,7 @@ sal_uInt16 SwEditShell::GetScalingOfSelectedText() const const SwPaM* pCrsr = GetCrsr(); const SwPosition* pStt = pCrsr->Start(); const SwTxtNode* pTNd = pStt->nNode.GetNode().GetTxtNode(); - ASSERT( pTNd, "no textnode available" ); + OSL_ENSURE( pTNd, "no textnode available" ); sal_uInt16 nScaleWidth; if( pTNd ) @@ -644,3 +626,5 @@ sal_uInt16 SwEditShell::GetScalingOfSelectedText() const nScaleWidth = 100; // default are no scaling -> 100% return nScaleWidth; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/edit/eddel.cxx b/sw/source/core/edit/eddel.cxx index 3289c07f1928..494f780898df 100644 --- a/sw/source/core/edit/eddel.cxx +++ b/sw/source/core/edit/eddel.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -280,9 +281,9 @@ long SwEditShell::Copy( SwEditShell* pDestShell ) { SwPaM* pCmp = (SwPaM*)pDestShell->GetCrsr(); // sicher den Pointer auf Cursor do { - ASSERT( pCmp->GetPoint()->nContent.GetIdxReg() + OSL_ENSURE( pCmp->GetPoint()->nContent.GetIdxReg() == pCmp->GetCntntNode(), "Point im falschen Node" ); - ASSERT( pCmp->GetMark()->nContent.GetIdxReg() + OSL_ENSURE( pCmp->GetMark()->nContent.GetIdxReg() == pCmp->GetCntntNode(sal_False), "Mark im falschen Node" ); sal_Bool bTst = *pCmp->GetPoint() == *pCmp->GetMark(); (void) bTst; @@ -354,3 +355,4 @@ sal_Bool SwEditShell::DelFullPara() +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/edit/edfcol.cxx b/sw/source/core/edit/edfcol.cxx index 838abeb659bd..5f1b07d5315d 100644 --- a/sw/source/core/edit/edfcol.cxx +++ b/sw/source/core/edit/edfcol.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -38,9 +39,7 @@ #include <ndtxt.hxx> #include <paratr.hxx> #include <fmtpdsc.hxx> -// --> FME 2004-06-29 #114856# Formular view -#include <viewopt.hxx> -// <-- +#include <viewopt.hxx> // Formular view #include <SwRewriter.hxx> #include <numrule.hxx> #include <swundo.hxx> @@ -82,9 +81,8 @@ void SwEditShell::SetTxtFmtColl( SwTxtFmtColl *pFmt, FOREACHPAM_START(this) if( !PCURCRSR->HasReadonlySel( - // --> FME 2004-06-29 #114856# Formular view + // Formular view GetViewOptions()->IsFormView() ) ) - // <-- GetDoc()->SetTxtFmtColl( *PCURCRSR, pLocal, true, bResetListAttrs ); FOREACHPAM_END() @@ -102,7 +100,7 @@ SwTxtFmtColl* SwEditShell::MakeTxtFmtColl(const String& rFmtCollName, pParent = &GetTxtFmtColl(0); if ( (pColl=GetDoc()->MakeTxtFmtColl(rFmtCollName, pParent)) == 0 ) { - ASSERT( sal_False, "MakeTxtFmtColl failed" ) + OSL_FAIL( "MakeTxtFmtColl failed" ); } return pColl; @@ -160,3 +158,4 @@ void SwEditShell::FillByEx(SwTxtFmtColl* pColl, sal_Bool bReset) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/edit/edfld.cxx b/sw/source/core/edit/edfld.cxx index 3ed48bdf387f..58005a97832b 100644 --- a/sw/source/core/edit/edfld.cxx +++ b/sw/source/core/edit/edfld.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -234,7 +235,7 @@ void SwEditShell::Insert2(SwField& rFld, const bool bForceExpandHints) FOREACHPAM_START(this) // fuer jeden PaM bool bSuccess(GetDoc()->InsertPoolItem(*PCURCRSR, aFld, nInsertFlags)); - ASSERT( bSuccess, "Doc->Insert(Field) failed"); + OSL_ENSURE( bSuccess, "Doc->Insert(Field) failed"); (void) bSuccess; FOREACHPAM_END() // fuer jeden PaM @@ -268,7 +269,7 @@ SwField* SwEditShell::GetCurFld() const SwTxtFld *pTxtFld = GetDocTxtFld( pCrsr->Start() ); SwField *pCurFld = NULL; - /* #108536# Field was only recognized if no selection was + /* Field was only recognized if no selection was present. Now it is recognized if either the cursor is in the field or the selection spans exactly over the field. */ if( pTxtFld && @@ -287,7 +288,7 @@ SwField* SwEditShell::GetCurFld() const } - /* #108536# removed handling of multi-selections */ + /* removed handling of multi-selections */ return pCurFld; } @@ -298,7 +299,6 @@ SwField* SwEditShell::GetCurFld() const |* SwEditShell::UpdateFlds() |* |* Beschreibung Stehen die PaMs auf Feldern ? -|* BP 12.05.92 |* *************************************************************************/ SwTxtFld* lcl_FindInputFld( SwDoc* pDoc, SwField& rFld ) @@ -343,11 +343,6 @@ void SwEditShell::UpdateFlds( SwField &rFld ) SwTxtFld *pTxtFld; SwFmtFld *pFmtFld; -// if( pCrsr->GetNext() == pCrsr && !pCrsr->HasMark() && -// ( 0 != ( pTxtFld = GetDocTxtFld( pCrsr->Start() ) ) || -// 0 != ( pTxtFld = lcl_FindInputFld( GetDoc(), rFld ) ) ) && -// ( pFmtFld = (SwFmtFld*)&pTxtFld->GetFld())->GetFld() -// ->GetTyp()->Which() == rFld.GetTyp()->Which() ) if ( pCrsr->GetNext() == pCrsr && !pCrsr->HasMark()) { pTxtFld = GetDocTxtFld(pCrsr->Start()); @@ -356,7 +351,7 @@ void SwEditShell::UpdateFlds( SwField &rFld ) pTxtFld = lcl_FindInputFld( GetDoc(), rFld); if (pTxtFld != 0) - GetDoc()->UpdateFld(pTxtFld, rFld, pMsgHnt, sal_True); // #111840# + GetDoc()->UpdateFld(pTxtFld, rFld, pMsgHnt, sal_True); } // bOkay (statt return wg. EndAllAction) wird sal_False, @@ -403,7 +398,7 @@ void SwEditShell::UpdateFlds( SwField &rFld ) bOkay = sal_False; bTblSelBreak = GetDoc()->UpdateFld(pTxtFld, rFld, - pMsgHnt, sal_False); // #111840# + pMsgHnt, sal_False); } // Der Suchbereich wird um den gefundenen Bereich // verkuerzt. @@ -420,7 +415,7 @@ void SwEditShell::UpdateFlds( SwField &rFld ) EndAllAction(); } -/*-----------------13.05.92 10:54------------------- +/*-------------------------------------------------- Liefert den logischen fuer die Datenbank zurueck --------------------------------------------------*/ @@ -520,16 +515,12 @@ sal_Bool SwEditShell::IsLabelDoc() const { return getIDocumentSettingAccess()->get(IDocumentSettingAccess::LABEL_DOCUMENT); } -/* -----------------------------21.12.99 12:53-------------------------------- - ---------------------------------------------------------------------------*/ void SwEditShell::ChangeAuthorityData(const SwAuthEntry* pNewData) { GetDoc()->ChangeAuthorityData(pNewData); } -/* -----------------------------03.08.2001 12:04------------------------------ - ---------------------------------------------------------------------------*/ sal_Bool SwEditShell::IsAnyDatabaseFieldInDoc()const { const SwFldTypes * pFldTypes = GetDoc()->GetFldTypes(); @@ -562,3 +553,5 @@ sal_Bool SwEditShell::IsAnyDatabaseFieldInDoc()const } return sal_False; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/edit/edfldexp.cxx b/sw/source/core/edit/edfldexp.cxx index ae3aed3f1ea6..0bc650313adc 100644 --- a/sw/source/core/edit/edfldexp.cxx +++ b/sw/source/core/edit/edfldexp.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -52,7 +53,7 @@ sal_Bool SwEditShell::IsFieldDataSourceAvailable(String& rUsedDataSource) const uno::Reference< lang::XMultiServiceFactory > xMgr( ::comphelper::getProcessServiceFactory() ); if( !xMgr.is() ) return sal_False; - uno::Reference<uno::XInterface> xInstance = xMgr->createInstance( OUString::createFromAscii( "com.sun.star.sdb.DatabaseContext" )); + uno::Reference<uno::XInterface> xInstance = xMgr->createInstance(OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdb.DatabaseContext"))); uno::Reference<container::XNameAccess> xDBContext(xInstance, uno::UNO_QUERY) ; if(!xDBContext.is()) return sal_False; @@ -95,3 +96,4 @@ sal_Bool SwEditShell::IsFieldDataSourceAvailable(String& rUsedDataSource) const } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/edit/edfmt.cxx b/sw/source/core/edit/edfmt.cxx index 225a1df48c74..e597cac10d02 100644 --- a/sw/source/core/edit/edfmt.cxx +++ b/sw/source/core/edit/edfmt.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -38,7 +39,7 @@ #include <fchrfmt.hxx> #include <frmfmt.hxx> #include <charfmt.hxx> -#include "ndtxt.hxx" // Fuer GetXXXFmt +#include "ndtxt.hxx" // for GetXXXFmt #include "hints.hxx" /************************************* @@ -92,7 +93,7 @@ void SwEditShell::FillByEx(SwCharFmt* pCharFmt, sal_Bool bReset) { const SwPosition* pPtPos = pPam->GetPoint(); const SwPosition* pMkPos = pPam->GetMark(); - if( pPtPos->nNode == pMkPos->nNode ) // im selben Node ? + if( pPtPos->nNode == pMkPos->nNode ) // in the same node? { nStt = pPtPos->nContent.GetIndex(); if( nStt < pMkPos->nContent.GetIndex() ) @@ -154,7 +155,7 @@ SwCharFmt* SwEditShell::MakeCharFmt( const String& rName, } //---------------------------------- -// inlines im Product +// inlines in product SwTxtFmtColl* SwEditShell::GetTxtCollFromPool( sal_uInt16 nId ) @@ -163,7 +164,7 @@ SwTxtFmtColl* SwEditShell::GetTxtCollFromPool( sal_uInt16 nId ) } - // return das geforderte automatische Format - Basis-Klasse ! + // return the demanded automatic format - base-class ! SwFmt* SwEditShell::GetFmtFromPool( sal_uInt16 nId ) { return GetDoc()->GetFmtFromPool( nId ); @@ -195,3 +196,5 @@ SwTxtFmtColl* SwEditShell::FindTxtFmtCollByName( const String& rName ) const { return pDoc->FindTxtFmtCollByName( rName ); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/edit/edglbldc.cxx b/sw/source/core/edit/edglbldc.cxx index d07b5b7a1e6c..94cc61bc0499 100644 --- a/sw/source/core/edit/edglbldc.cxx +++ b/sw/source/core/edit/edglbldc.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -86,7 +87,7 @@ sal_uInt16 SwEditShell::GetGlobalDocContent( SwGlblDocContents& rArr ) const { case TOX_HEADER_SECTION: break; // ignore case TOX_CONTENT_SECTION: - ASSERT( pSect->ISA( SwTOXBaseSection ), "keine TOXBaseSection!" ); + OSL_ENSURE( pSect->ISA( SwTOXBaseSection ), "keine TOXBaseSection!" ); pNew = new SwGlblDocContent( (SwTOXBaseSection*)pSect ); break; @@ -408,3 +409,4 @@ SwGlblDocContent::SwGlblDocContent( const SwSection* pSect ) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/edit/edglss.cxx b/sw/source/core/edit/edglss.cxx index 56996558b306..a559edc840a0 100644 --- a/sw/source/core/edit/edglss.cxx +++ b/sw/source/core/edit/edglss.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -181,7 +182,7 @@ sal_uInt16 SwEditShell::SaveGlossaryDoc( SwTextBlocks& rBlock, sal_Bool SwEditShell::_CopySelToDoc( SwDoc* pInsDoc, SwNodeIndex* pSttNd ) { - ASSERT( pInsDoc, "kein Ins.Dokument" ); + OSL_ENSURE( pInsDoc, "kein Ins.Dokument" ); SwNodes& rNds = pInsDoc->GetNodes(); @@ -282,7 +283,6 @@ sal_Bool SwEditShell::_CopySelToDoc( SwDoc* pInsDoc, SwNodeIndex* pSttNd ) sal_Bool SwEditShell::GetSelectedText( String &rBuf, int nHndlParaBrk ) { - sal_Bool bRet = sal_False; GetCrsr(); // ggfs. alle Cursor erzeugen lassen if( IsSelOnePara() ) { @@ -304,7 +304,6 @@ sal_Bool SwEditShell::GetSelectedText( String &rBuf, int nHndlParaBrk ) RTL_CONSTASCII_STRINGPARAM( "\015\012" )); #endif } - bRet = sal_True; } else if( IsSelection() ) { @@ -371,3 +370,4 @@ sal_Bool SwEditShell::GetSelectedText( String &rBuf, int nHndlParaBrk ) +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/edit/editsh.cxx b/sw/source/core/edit/editsh.cxx index 6465e703482f..5f428d85c4f9 100644 --- a/sw/source/core/edit/editsh.cxx +++ b/sw/source/core/edit/editsh.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -29,7 +30,6 @@ #include "precompiled_sw.hxx" #include <hintids.hxx> -#include <tools/list.hxx> #include <tools/urlobj.hxx> #include <vcl/cmdevt.hxx> #include <unotools/charclass.hxx> @@ -86,7 +86,7 @@ void SwEditShell::Insert( sal_Unicode c, sal_Bool bOnlyCurrCrsr ) FOREACHPAM_START(this) const bool bSuccess = GetDoc()->InsertString(*PCURCRSR, c); - ASSERT( bSuccess, "Doc->Insert() failed." ); + OSL_ENSURE( bSuccess, "Doc->Insert() failed." ); (void) bSuccess; SaveTblBoxCntnt( PCURCRSR->GetPoint() ); @@ -120,7 +120,7 @@ void SwEditShell::Insert2(const String &rStr, const bool bForceExpandHints ) //OPT: GetSystemCharSet const bool bSuccess = GetDoc()->InsertString(*_pStartCrsr, rStr, nInsertFlags); - ASSERT( bSuccess, "Doc->Insert() failed." ); + OSL_ENSURE( bSuccess, "Doc->Insert() failed." ); (void) bSuccess; SaveTblBoxCntnt( _pStartCrsr->GetPoint() ); @@ -188,7 +188,7 @@ void SwEditShell::Overwrite(const String &rStr) FOREACHPAM_START(this) if( !GetDoc()->Overwrite(*PCURCRSR, rStr ) ) { - ASSERT( sal_False, "Doc->Overwrite(Str) failed." ) + OSL_FAIL( "Doc->Overwrite(Str) failed." ); } SaveTblBoxCntnt( PCURCRSR->GetPoint() ); FOREACHPAM_END() @@ -222,9 +222,6 @@ long SwEditShell::SplitNode( sal_Bool bAutoFormat, sal_Bool bCheckTableStart ) return(1L); } -/*-- 11.05.2004 09:41:20--------------------------------------------------- - - -----------------------------------------------------------------------*/ sal_Bool SwEditShell::AppendTxtNode() { sal_Bool bRet = sal_False; @@ -266,24 +263,22 @@ SwGrfNode * SwEditShell::_GetGrfNode() const * oder auf die gleiche Graphic zeigt) ******************************************************************************/ -// --> OD 2005-02-09 #119353# - robust const Graphic* SwEditShell::GetGraphic( sal_Bool bWait ) const { SwGrfNode* pGrfNode = _GetGrfNode(); - // --> OD 2005-02-09 #119353# - robust const Graphic* pGrf( 0L ); if ( pGrfNode ) { pGrf = &(pGrfNode->GetGrf()); - // --> OD 2007-03-01 #i73788# + // --> #i73788# // no load of linked graphic, if its not needed now (bWait = sal_False). if ( bWait ) { if( pGrf->IsSwapOut() || ( pGrfNode->IsLinkedFile() && GRAPHIC_DEFAULT == pGrf->GetType() ) ) { -#ifdef DBG_UTIL - ASSERT( pGrfNode->SwapIn( bWait ) || !bWait, "Grafik konnte nicht geladen werden" ); +#if OSL_DEBUG_LEVEL > 1 + OSL_ENSURE( pGrfNode->SwapIn( bWait ) || !bWait, "Grafik konnte nicht geladen werden" ); #else pGrfNode->SwapIn( bWait ); #endif @@ -293,8 +288,8 @@ const Graphic* SwEditShell::GetGraphic( sal_Bool bWait ) const { if ( pGrf->IsSwapOut() && !pGrfNode->IsLinkedFile() ) { -#ifdef DBG_UTIL - ASSERT( pGrfNode->SwapIn( bWait ) || !bWait, "Grafik konnte nicht geladen werden" ); +#if OSL_DEBUG_LEVEL > 1 + OSL_ENSURE( pGrfNode->SwapIn( bWait ) || !bWait, "Grafik konnte nicht geladen werden" ); #else pGrfNode->SwapIn( bWait ); #endif @@ -316,13 +311,10 @@ sal_Bool SwEditShell::IsGrfSwapOut( sal_Bool bOnlyLinked ) const : pGrfNode->GetGrfObj().IsSwappedOut()); } -// --> OD 2005-02-09 #119353# - robust const GraphicObject* SwEditShell::GetGraphicObj() const { SwGrfNode* pGrfNode = _GetGrfNode(); - // --> OD 2005-02-09 #119353# - robust return pGrfNode ? &(pGrfNode->GetGrfObj()) : 0L; - // <-- } sal_uInt16 SwEditShell::GetGraphicType() const @@ -375,7 +367,7 @@ void SwEditShell::ReRead( const String& rGrfName, const String& rFltName, void SwEditShell::GetGrfNms( String* pGrfName, String* pFltName, const SwFlyFrmFmt* pFmt ) const { - ASSERT( pGrfName || pFltName, "was wird denn nun erfragt?" ); + OSL_ENSURE( pGrfName || pFltName, "was wird denn nun erfragt?" ); if( pFmt ) GetDoc()->GetGrfNms( *pFmt, pGrfName, pFltName ); else @@ -387,30 +379,6 @@ void SwEditShell::GetGrfNms( String* pGrfName, String* pFltName, } -// alternativen Text abfragen/setzen -//const String& SwEditShell::GetAlternateText() const -//{ -// SwPaM* pCrsr = GetCrsr(); -// const SwNoTxtNode* pNd; -// if( !pCrsr->HasMark() && 0 != ( pNd = pCrsr->GetNode()->GetNoTxtNode()) ) -// return pNd->GetAlternateText(); - -// return aEmptyStr; -//} - - -//void SwEditShell::SetAlternateText( const String& rTxt ) -//{ -// SwPaM* pCrsr = GetCrsr(); -// SwNoTxtNode* pNd; -// if( !pCrsr->HasMark() && 0 != ( pNd = pCrsr->GetNode()->GetNoTxtNode()) ) -// { -// pNd->SetAlternateText( rTxt, sal_True ); -// GetDoc()->SetModified(); -// } -//} - - const PolyPolygon *SwEditShell::GetGraphicPolygon() const { SwNoTxtNode *pNd = GetCrsr()->GetNode()->GetNoTxtNode(); @@ -433,7 +401,7 @@ void SwEditShell::SetGraphicPolygon( const PolyPolygon *pPoly ) void SwEditShell::ClearAutomaticContour() { SwNoTxtNode *pNd = GetCrsr()->GetNode()->GetNoTxtNode(); - ASSERT( pNd, "is no NoTxtNode!" ); + OSL_ENSURE( pNd, "is no NoTxtNode!" ); if( pNd->HasAutomaticContour() ) { StartAllAction(); @@ -456,14 +424,14 @@ void SwEditShell::ClearAutomaticContour() svt::EmbeddedObjectRef& SwEditShell::GetOLEObject() const { - ASSERT( CNT_OLE == GetCntType(), "GetOLEObj: kein OLENode." ); - ASSERT( !GetCrsr()->HasMark() || + OSL_ENSURE( CNT_OLE == GetCntType(), "GetOLEObj: kein OLENode." ); + OSL_ENSURE( !GetCrsr()->HasMark() || (GetCrsr()->HasMark() && GetCrsr()->GetPoint()->nNode == GetCrsr()->GetMark()->nNode), "GetOLEObj: kein OLENode." ); SwOLENode *pOLENode = GetCrsr()->GetNode()->GetOLENode(); - ASSERT( pOLENode, "GetOLEObj: kein OLENode." ); + OSL_ENSURE( pOLENode, "GetOLEObj: kein OLENode." ); SwOLEObj& rOObj = pOLENode->GetOLEObj(); return rOObj.GetObject(); } @@ -491,7 +459,7 @@ sal_Bool SwEditShell::HasOLEObj( const String &rName ) const void SwEditShell::SetChartName( const String &rName ) { SwOLENode *pONd = GetCrsr()->GetNode()->GetOLENode(); - ASSERT( pONd, "ChartNode not found" ); + OSL_ENSURE( pONd, "ChartNode not found" ); pONd->SetChartTblName( rName ); } @@ -612,19 +580,13 @@ void SwEditShell::ReplaceDropTxt( const String &rStr ) SwPaM aPam( rNd, rStr.Len(), rNd, 0 ); if( !GetDoc()->Overwrite( aPam, rStr ) ) { - ASSERT( sal_False, "Doc->Overwrite(Str) failed." ); + OSL_FAIL( "Doc->Overwrite(Str) failed." ); } EndAllAction(); } } -/****************************************************************************** - * Methode : - * Beschreibung: - * Erstellt : OK 25.04.94 13:45 - * Aenderung : - ******************************************************************************/ String SwEditShell::Calculate() { @@ -723,8 +685,8 @@ Graphic SwEditShell::GetIMapGraphic() const if( rGrf.IsSwapOut() || ( ((SwGrfNode*)pNd)->IsLinkedFile() && GRAPHIC_DEFAULT == rGrf.GetType() ) ) { -#ifdef DBG_UTIL - ASSERT( ((SwGrfNode*)pNd)->SwapIn( sal_True ) || !sal_True, "Grafik konnte nicht geladen werden" ); +#if OSL_DEBUG_LEVEL > 1 + OSL_ENSURE( ((SwGrfNode*)pNd)->SwapIn( sal_True ), "Grafik konnte nicht geladen werden" ); #else ((SwGrfNode*)pNd)->SwapIn( sal_True ); #endif @@ -985,16 +947,16 @@ sal_uInt16 SwEditShell::GetLineCount( sal_Bool bActPos ) SwFrm* pFrm = pCntFrm; while( pFrm && !(pFrm->GetType() & nTyp) ) pFrm = pFrm->GetUpper(); - ASSERT( pFrm, "Wo bin ich?" ); + OSL_ENSURE( pFrm, "Wo bin ich?" ); if( pFrm && ( pFrm->GetType() & FRM_FOOTER ) ) pTmp = pCNd->FindFooterStartNode(); else pTmp = pCNd->FindHeaderStartNode(); } - ASSERT( pTmp, "Missing StartNode" ); + OSL_ENSURE( pTmp, "Missing StartNode" ); aStart = *pTmp; } - ASSERT( pCNd && pCntFrm, "Missing Layout-Information" ); + OSL_ENSURE( pCNd && pCntFrm, "Missing Layout-Information" ); } while( 0 != ( pCNd = GetDoc()->GetNodes().GoNextSection( @@ -1202,3 +1164,4 @@ void SwEditShell::ApplyViewOptions( const SwViewOption &rOpt ) } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/edit/edlingu.cxx b/sw/source/core/edit/edlingu.cxx index 10dcba3c1a3c..f90ebe45748f 100644 --- a/sw/source/core/edit/edlingu.cxx +++ b/sw/source/core/edit/edlingu.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -72,8 +73,6 @@ using namespace ::com::sun::star::uno; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::linguistic2; -#define C2U(cChar) rtl::OUString::createFromAscii(cChar) - /************************************************************************* * class SwLinguIter *************************************************************************/ @@ -151,8 +150,8 @@ public: bool SpellSentence(::svx::SpellPortions& rPortions, bool bIsGrammarCheck); void ToSentenceStart(); - const ::svx::SpellPortions GetLastPortions(){ return aLastPortions;} - SpellContentPositions GetLastPositions() {return aLastPositions;} + const ::svx::SpellPortions GetLastPortions() const { return aLastPortions;} + SpellContentPositions GetLastPositions() const {return aLastPositions;} void ContinueAfterThisSentence() { bMoveToEndOfSentence = true; } }; @@ -214,7 +213,7 @@ const SwTxtNode *pLinguNode; SwLinguIter::SwLinguIter() : pSh( 0 ), pStart( 0 ), pEnd( 0 ), pCurr( 0 ), pCurrX( 0 ) { - // @@@ es fehlt: Sicherstellen der Reentrance, ASSERTs etc. + // @@@ es fehlt: Sicherstellen der Reentrance, OSL_ENSURE( etc. } /************************************************************************* @@ -236,12 +235,10 @@ void SwLinguIter::_Start( SwEditShell *pShell, SwDocPositions eStart, SET_CURR_SHELL( pSh ); - ASSERT( !pEnd, "LinguStart ohne End?"); + OSL_ENSURE( !pEnd, "LinguStart ohne End?"); SwPaM *pCrsr = pSh->GetCrsr(); - // pStk->SetCurCrsr(); -// if( pCrsr->HasMark() || pCrsr != pCrsr->GetNext() ) if( pShell->HasSelection() || pCrsr != pCrsr->GetNext() ) { bSetCurr = 0 != GetCurr(); @@ -297,7 +294,7 @@ void SwLinguIter::_End(bool bRestoreSelection) if( !pSh ) return; - ASSERT( pEnd, "SwEditShell::SpellEnd() ohne Start?"); + OSL_ENSURE( pEnd, "SwEditShell::SpellEnd() ohne Start?"); if(bRestoreSelection) { while( nCrsrCnt-- ) @@ -312,10 +309,6 @@ void SwLinguIter::_End(bool bRestoreSelection) DELETEZ(pCurrX); pSh = 0; - -#ifdef LINGU_STATISTIK - aSwLinguStat.Flush(); -#endif } /************************************************************************* @@ -356,9 +349,7 @@ uno::Any SwSpellIter::Continue( sal_uInt16* pPageCnt, sal_uInt16* pPageSt ) if( !pMySh ) return aSpellRet; -// const SwPosition *pEnd = GetEnd(); - - ASSERT( GetEnd(), "SwEditShell::SpellContinue() ohne Start?"); + OSL_ENSURE( GetEnd(), "SwEditShell::SpellContinue() ohne Start?"); uno::Reference< uno::XInterface > xSpellRet; sal_Bool bGoOn = sal_True; @@ -432,9 +423,7 @@ uno::Any SwConvIter::Continue( sal_uInt16* pPageCnt, sal_uInt16* pPageSt ) if( !pMySh ) return aConvRet; -// const SwPosition *pEnd = GetEnd(); - - ASSERT( GetEnd(), "SwConvIter::Continue() ohne Start?"); + OSL_ENSURE( GetEnd(), "SwConvIter::Continue() ohne Start?"); rtl::OUString aConvText; sal_Bool bGoOn = sal_True; @@ -492,7 +481,7 @@ sal_Bool SwHyphIter::IsAuto() { uno::Reference< beans::XPropertySet > xProp( ::GetLinguPropertySet() ); return xProp.is() ? *(sal_Bool*)xProp->getPropertyValue( - C2U(UPN_IS_HYPH_AUTO) ).getValue() + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(UPN_IS_HYPH_AUTO)) ).getValue() : sal_False; } @@ -521,7 +510,7 @@ void SwHyphIter::Start( SwEditShell *pShell, SwDocPositions eStart, SwDocPositio // robust if( GetSh() || GetEnd() ) { - ASSERT( !GetSh(), "+SwEditShell::HyphStart: missing HyphEnd()" ); + OSL_ENSURE( !GetSh(), "+SwEditShell::HyphStart: missing HyphEnd()" ); return; } @@ -560,12 +549,11 @@ uno::Any SwHyphIter::Continue( sal_uInt16* pPageCnt, sal_uInt16* pPageSt ) const sal_Bool bAuto = IsAuto(); uno::Reference< XHyphenatedWord > xHyphWord; - sal_uInt16 nRet; sal_Bool bGoOn = sal_False; do { SwPaM *pCrsr; do { - ASSERT( GetEnd(), "SwEditShell::SpellContinue() ohne Start?" ); + OSL_ENSURE( GetEnd(), "SwEditShell::SpellContinue() ohne Start?" ); pCrsr = pMySh->GetCrsr(); if ( !pCrsr->HasMark() ) pCrsr->SetMark(); @@ -575,10 +563,7 @@ uno::Any SwHyphIter::Continue( sal_uInt16* pPageCnt, sal_uInt16* pPageSt ) pCrsr->SetMark(); } - // geraten BUG: - if ( *pCrsr->End() > *GetEnd() ) - nRet = 0; - else + if ( *pCrsr->End() <= *GetEnd() ) { *pCrsr->GetMark() = *GetEnd(); @@ -651,7 +636,7 @@ void SwHyphIter::DelSoftHyph( SwPaM &rPam ) void SwHyphIter::InsertSoftHyph( const xub_StrLen nHyphPos ) { SwEditShell *pMySh = GetSh(); - ASSERT( pMySh, "+SwEditShell::InsertSoftHyph: missing HyphStart()"); + OSL_ENSURE( pMySh, "+SwEditShell::InsertSoftHyph: missing HyphStart()"); if( !pMySh ) return; @@ -664,9 +649,9 @@ void SwHyphIter::InsertSoftHyph( const xub_StrLen nHyphPos ) if( pSttPos->nNode != pEndPos->nNode || !nLastHyphLen ) { - ASSERT( pSttPos->nNode == pEndPos->nNode, + OSL_ENSURE( pSttPos->nNode == pEndPos->nNode, "+SwEditShell::InsertSoftHyph: node warp during hyphenation" ); - ASSERT(nLastHyphLen, "+SwEditShell::InsertSoftHyph: missing HyphContinue()"); + OSL_ENSURE(nLastHyphLen, "+SwEditShell::InsertSoftHyph: missing HyphContinue()"); *pSttPos = *pEndPos; return; } @@ -751,14 +736,14 @@ void SwEditShell::SpellStart( // do not spell if interactive spelling is active elsewhere if (!pConvArgs && !pSpellIter) { - ASSERT( !pSpellIter, "wer ist da schon am spellen?" ); + OSL_ENSURE( !pSpellIter, "wer ist da schon am spellen?" ); pSpellIter = new SwSpellIter; pLinguIter = pSpellIter; } // do not do text conversion if it is active elsewhere if (pConvArgs && !pConvIter) { - ASSERT( !pConvIter, "text conversion already active!" ); + OSL_ENSURE( !pConvIter, "text conversion already active!" ); pConvIter = new SwConvIter( *pConvArgs ); pLinguIter = pConvIter; } @@ -789,13 +774,13 @@ void SwEditShell::SpellEnd( SwConversionArgs *pConvArgs, bool bRestoreSelection { if (!pConvArgs && pSpellIter && pSpellIter->GetSh() == this) { - ASSERT( pSpellIter, "wo ist mein Iterator?" ); + OSL_ENSURE( pSpellIter, "wo ist mein Iterator?" ); pSpellIter->_End(bRestoreSelection); delete pSpellIter, pSpellIter = 0; } if (pConvArgs && pConvIter && pConvIter->GetSh() == this) { - ASSERT( pConvIter, "wo ist mein Iterator?" ); + OSL_ENSURE( pConvIter, "wo ist mein Iterator?" ); pConvIter->_End(); delete pConvIter, pConvIter = 0; } @@ -826,8 +811,8 @@ uno::Any SwEditShell::SpellContinue( ::StartProgress( STR_STATSTR_SPELL, 0, nEndPage, GetDoc()->GetDocShell() ); } - ASSERT( pConvArgs || pSpellIter, "SpellIter missing" ); - ASSERT( !pConvArgs || pConvIter, "ConvIter missing" ); + OSL_ENSURE( pConvArgs || pSpellIter, "SpellIter missing" ); + OSL_ENSURE( !pConvArgs || pConvIter, "ConvIter missing" ); //JP 18.07.95: verhinder bei Fehlermeldungen die Anzeige der Selektionen // KEIN StartAction, da damit auch die Paints abgeschaltet // werden !!!!! @@ -892,7 +877,7 @@ void SwEditShell::HyphStart( SwDocPositions eStart, SwDocPositions eEnd ) // do not hyphenate if interactive hyphenationg is active elsewhere if (!pHyphIter) { - ASSERT( !pHyphIter, "wer ist da schon am hyphinieren?" ); + OSL_ENSURE( !pHyphIter, "wer ist da schon am hyphinieren?" ); pHyphIter = new SwHyphIter; pHyphIter->Start( this, eStart, eEnd ); } @@ -910,7 +895,7 @@ void SwEditShell::HyphEnd() { if (pHyphIter->GetSh() == this) { - ASSERT( pHyphIter, "wo ist mein Iterator?" ); + OSL_ENSURE( pHyphIter, "wo ist mein Iterator?" ); pHyphIter->End(); delete pHyphIter, pHyphIter = 0; } @@ -944,7 +929,7 @@ uno::Reference< uno::XInterface > *pPageSt = 1; // das StatLineStartPercent } - ASSERT( pHyphIter, "wo ist mein Iterator?" ); + OSL_ENSURE( pHyphIter, "wo ist mein Iterator?" ); //JP 18.07.95: verhinder bei Fehlermeldungen die Anzeige der Selektionen // KEIN StartAction, da damit auch die Paints abgeschaltet // werden !!!!! @@ -970,7 +955,7 @@ uno::Reference< uno::XInterface > void SwEditShell::InsertSoftHyph( const xub_StrLen nHyphPos ) { - ASSERT( pHyphIter, "wo ist mein Iterator?" ); + OSL_ENSURE( pHyphIter, "wo ist mein Iterator?" ); pHyphIter->InsertSoftHyph( nHyphPos ); } @@ -983,7 +968,7 @@ void SwEditShell::InsertSoftHyph( const xub_StrLen nHyphPos ) void SwEditShell::HyphIgnore() { - ASSERT( pHyphIter, "wo ist mein Iterator?" ); + OSL_ENSURE( pHyphIter, "wo ist mein Iterator?" ); //JP 18.07.95: verhinder bei Fehlermeldungen die Anzeige der Selektionen // KEIN StartAction, da damit auch die Paints abgeschaltet // werden !!!!! @@ -1047,7 +1032,7 @@ uno::Reference< XSpellAlternatives > // implementation here by providing an additional parameter. Sequence< PropertyValue > aPropVals(1); PropertyValue &rVal = aPropVals.getArray()[0]; - rVal.Name = C2U( UPN_MAX_NUMBER_OF_SUGGESTIONS ); + rVal.Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( UPN_MAX_NUMBER_OF_SUGGESTIONS )); rVal.Value <<= (sal_Int16) 7; xSpellAlt = xSpell->spell( aWord, eActLang, aPropVals ); @@ -1086,7 +1071,7 @@ uno::Reference< XSpellAlternatives > //no determine the rectangle in the current line xub_StrLen nWordStart = (nBegin + nLeft) < nLineStart ? nLineStart : nBegin + nLeft; //take one less than the line end - otherwise the next line would be calculated - xub_StrLen nWordEnd = (nBegin + nLen - nLeft - nRight) > nLineEnd ? nLineEnd - 1: (nBegin + nLen - nLeft - nRight); + xub_StrLen nWordEnd = (nBegin + nLen - nLeft - nRight) > nLineEnd ? nLineEnd: (nBegin + nLen - nLeft - nRight); Push(); pCrsr->DeleteMark(); SwIndex& rContent = GetCrsr()->GetPoint()->nContent; @@ -1098,7 +1083,7 @@ uno::Reference< XSpellAlternatives > SwCntntFrm *pCntntFrame = pCntntNode->getLayoutFrm( GetLayout(), pPt, pCrsr->GetPoint(), sal_False); pCntntFrame->GetCharRect( aStartRect, *pCrsr->GetPoint(), &aState ); - rContent = nWordEnd; + rContent = nWordEnd - 1; SwRect aEndRect; pCntntFrame->GetCharRect( aEndRect, *pCrsr->GetPoint(),&aState ); rSelectRect = aStartRect.Union( aEndRect ); @@ -1109,9 +1094,7 @@ uno::Reference< XSpellAlternatives > return xSpellAlt; } -/*------------------------------------------------------------------------- - -----------------------------------------------------------------------*/ bool SwEditShell::GetGrammarCorrection( linguistic2::ProofreadingResult /*out*/ &rResult, // the complete result @@ -1164,12 +1147,6 @@ bool SwEditShell::GetGrammarCorrection( sal_Int32 nEndOfSentence = ModelToViewHelper::ConvertToViewPosition( pConversionMap, pWrong->getSentenceEnd( nBegin ) ); if( nEndOfSentence == STRING_LEN ) { -/* if( nStartOfSentence == 0 ) - { - nStartOfSentence = -1; - nEndOfSentence = -1; - } - else */ nEndOfSentence = aExpandText.getLength(); } @@ -1204,10 +1181,6 @@ bool SwEditShell::GetGrammarCorrection( xub_StrLen nLineEnd = GetCrsr()->GetPoint()->nContent.GetIndex(); Pop(sal_False); -#if OSL_DEBUG_LEVEL > 1 -// pNode->GetGrammarCheck()->Invalidate( 0, STRING_LEN ); -// pNode->SetGrammarCheckDirty( true ); -#endif // make sure the selection build later from the // data below does not include footnotes and other // "in word" character to the left and right in order @@ -1230,7 +1203,7 @@ bool SwEditShell::GetGrammarCorrection( //no determine the rectangle in the current line xub_StrLen nWordStart = (nBegin + nLeft) < nLineStart ? nLineStart : nBegin + nLeft; //take one less than the line end - otherwise the next line would be calculated - xub_StrLen nWordEnd = (nBegin + nLen - nLeft - nRight) > nLineEnd ? nLineEnd - 1: (nBegin + nLen - nLeft - nRight); + xub_StrLen nWordEnd = (nBegin + nLen - nLeft - nRight) > nLineEnd ? nLineEnd: (nBegin + nLen - nLeft - nRight); Push(); pCrsr->DeleteMark(); SwIndex& rContent = GetCrsr()->GetPoint()->nContent; @@ -1242,7 +1215,7 @@ bool SwEditShell::GetGrammarCorrection( SwCntntFrm *pCntntFrame = pCntntNode->getLayoutFrm( GetLayout(), pPt, pCrsr->GetPoint(), sal_False); pCntntFrame->GetCharRect( aStartRect, *pCrsr->GetPoint(), &aState ); - rContent = nWordEnd; + rContent = nWordEnd - 1; SwRect aEndRect; pCntntFrame->GetCharRect( aEndRect, *pCrsr->GetPoint(),&aState ); rSelectRect = aStartRect.Union( aEndRect ); @@ -1254,12 +1227,9 @@ bool SwEditShell::GetGrammarCorrection( return bRes; } -/*-- 18.09.2003 15:08:18--------------------------------------------------- - - -----------------------------------------------------------------------*/ bool SwEditShell::SpellSentence(::svx::SpellPortions& rPortions, bool bIsGrammarCheck) { - ASSERT( pSpellIter, "SpellIter missing" ); + OSL_ENSURE( pSpellIter, "SpellIter missing" ); if(!pSpellIter) return false; bool bRet = pSpellIter->SpellSentence(rPortions, bIsGrammarCheck); @@ -1270,19 +1240,17 @@ bool SwEditShell::SpellSentence(::svx::SpellPortions& rPortions, bool bIsGrammar EndAction(); return bRet; } -/*-- 08.09.2008 09:35:19--------------------------------------------------- +/*------------------------------------------------------------------------- make SpellIter start with the current sentence when called next time -----------------------------------------------------------------------*/ void SwEditShell::PutSpellingToSentenceStart() { - ASSERT( pSpellIter, "SpellIter missing" ); + OSL_ENSURE( pSpellIter, "SpellIter missing" ); if(!pSpellIter) return; pSpellIter->ToSentenceStart(); } -/*-- 02.02.2005 14:34:41--------------------------------------------------- - -----------------------------------------------------------------------*/ sal_uInt32 lcl_CountRedlines( const ::svx::SpellPortions& rLastPortions) { @@ -1295,9 +1263,6 @@ sal_uInt32 lcl_CountRedlines( } return nRet; } -/*-- 18.09.2003 15:08:20--------------------------------------------------- - - -----------------------------------------------------------------------*/ void SwEditShell::MoveContinuationPosToEndOfCheckedSentence() { @@ -1316,15 +1281,15 @@ void SwEditShell::ApplyChangedSentence(const ::svx::SpellPortions& rNewPortions, // Note: rNewPortions.size() == 0 is valid and happens when the whole // sentence got removed in the dialog - ASSERT( pSpellIter, "SpellIter missing" ); + OSL_ENSURE( pSpellIter, "SpellIter missing" ); if(pSpellIter && pSpellIter->GetLastPortions().size() > 0) // no portions -> no text to be changed { const SpellPortions& rLastPortions = pSpellIter->GetLastPortions(); const SpellContentPositions rLastPositions = pSpellIter->GetLastPositions(); - ASSERT(rLastPortions.size() > 0 && + OSL_ENSURE(rLastPortions.size() > 0 && rLastPortions.size() == rLastPositions.size(), - "last vectors of spelling results are not set or not equal") + "last vectors of spelling results are not set or not equal"); // iterate over the new portions, beginning at the end to take advantage of the previously // saved content positions @@ -1398,7 +1363,7 @@ void SwEditShell::ApplyChangedSentence(const ::svx::SpellPortions& rNewPortions, { //add the 'ignore' markup to the TextNode's grammar ignore markup list IgnoreGrammarErrorAt( *pCrsr ); - DBG_ERROR("TODO: add ignore mark to text node"); + OSL_FAIL("TODO: add ignore mark to text node"); } if(aCurrentNewPortion == rNewPortions.begin()) break; @@ -1462,7 +1427,7 @@ void SwEditShell::ApplyChangedSentence(const ::svx::SpellPortions& rNewPortions, EndAction(); } } -/*-- 02.02.2005 10:46:45--------------------------------------------------- +/*------------------------------------------------------------------------- collect all deleted redlines of the current text node beginning at the start of the cursor position -----------------------------------------------------------------------*/ @@ -1502,7 +1467,7 @@ SpellContentPositions lcl_CollectDeletedRedlines(SwEditShell* pSh) } return aRedlines; } -/*-- 02.02.2005 11:06:12--------------------------------------------------- +/*------------------------------------------------------------------------- remove the redline positions after the current selection -----------------------------------------------------------------------*/ void lcl_CutRedlines( SpellContentPositions& aDeletedRedlines, SwEditShell* pSh ) @@ -1519,9 +1484,7 @@ void lcl_CutRedlines( SpellContentPositions& aDeletedRedlines, SwEditShell* pSh } } } -/*-- 02.02.2005 11:43:00--------------------------------------------------- - -----------------------------------------------------------------------*/ SpellContentPosition lcl_FindNextDeletedRedline( const SpellContentPositions& rDeletedRedlines, xub_StrLen nSearchFrom ) @@ -1541,9 +1504,7 @@ SpellContentPosition lcl_FindNextDeletedRedline( } return aRet; } -/*-- 18.09.2003 15:08:20--------------------------------------------------- - -----------------------------------------------------------------------*/ bool SwSpellIter::SpellSentence(::svx::SpellPortions& rPortions, bool bIsGrammarCheck) { bool bRet = false; @@ -1554,7 +1515,7 @@ bool SwSpellIter::SpellSentence(::svx::SpellPortions& rPortions, bool bIsGrammar if( !pMySh ) return false; - ASSERT( GetEnd(), "SwEditShell::SpellSentence() ohne Start?"); + OSL_ENSURE( GetEnd(), "SwEditShell::SpellSentence() ohne Start?"); uno::Reference< XSpellAlternatives > xSpellRet; linguistic2::ProofreadingResult aGrammarResult; @@ -1746,16 +1707,11 @@ bool SwSpellIter::SpellSentence(::svx::SpellPortions& rPortions, bool bIsGrammar return bRet; } -/*-- 08.09.2008 09:37:15--------------------------------------------------- - - -----------------------------------------------------------------------*/ void SwSpellIter::ToSentenceStart() { bBackToStartOfSentence = true; } -/*-- 08.10.2003 08:49:56--------------------------------------------------- - -----------------------------------------------------------------------*/ LanguageType lcl_GetLanguage(SwEditShell& rSh) { sal_uInt16 nScriptType = rSh.GetScriptType(); @@ -1771,7 +1727,7 @@ LanguageType lcl_GetLanguage(SwEditShell& rSh) const SvxLanguageItem& rLang = static_cast<const SvxLanguageItem& >(aSet.Get(nLangWhichId)); return rLang.GetLanguage(); } -/*-- 08.10.2003 08:53:27--------------------------------------------------- +/*------------------------------------------------------------------------- create a text portion at the given position -----------------------------------------------------------------------*/ void SwSpellIter::CreatePortion(uno::Reference< XSpellAlternatives > xAlt, @@ -1798,7 +1754,7 @@ void SwSpellIter::CreatePortion(uno::Reference< XSpellAlternatives > xAlt, const beans::PropertyValue* pProperties = pGrammarResult->aProperties.getConstArray(); for( sal_Int32 nProp = 0; nProp < pGrammarResult->aProperties.getLength(); ++nProp ) { - if( pProperties->Name.equalsAscii("DialogTitle") ) + if( pProperties->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("DialogTitle") ) ) { pProperties->Value >>= aPortion.sDialogTitle; break; @@ -1820,9 +1776,7 @@ void SwSpellIter::CreatePortion(uno::Reference< XSpellAlternatives > xAlt, aLastPositions.push_back(aPosition); } } -/*-- 19.09.2003 13:05:43--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwSpellIter::AddPortion(uno::Reference< XSpellAlternatives > xAlt, linguistic2::ProofreadingResult* pGrammarResult, const SpellContentPositions& rDeletedRedlines) @@ -1941,9 +1895,7 @@ void SwSpellIter::AddPortion(uno::Reference< XSpellAlternatives > xAlt, } } } -/*-- 07.08.2008 15:01:25--------------------------------------------------- - -----------------------------------------------------------------------*/ void SwEditShell::IgnoreGrammarErrorAt( SwPaM& rErrorPosition ) { SwTxtNode *pNode; @@ -1972,3 +1924,4 @@ void SwEditShell::IgnoreGrammarErrorAt( SwPaM& rErrorPosition ) } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/edit/ednumber.cxx b/sw/source/core/edit/ednumber.cxx index d740090d4694..f4b54f774903 100644 --- a/sw/source/core/edit/ednumber.cxx +++ b/sw/source/core/edit/ednumber.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -113,7 +114,7 @@ void SwPamRanges::Insert( const SwNodeIndex& rIdx1, const SwNodeIndex& rIdx2 ) SwPaM& SwPamRanges::SetPam( sal_uInt16 nArrPos, SwPaM& rPam ) { - ASSERT_ID( nArrPos < Count(), ERR_VAR_IDX ); + OSL_ASSERT( nArrPos < Count() ); const SwPamRange& rTmp = *(GetData() + nArrPos ); rPam.GetPoint()->nNode = rTmp.nStart; rPam.GetPoint()->nContent.Assign( rPam.GetCntntNode(), 0 ); @@ -181,7 +182,6 @@ sal_Bool SwEditShell::HasNumber() const { bResult = pTxtNd->HasNumber(); - // --> OD 2005-10-26 #b6340308# // special case: outline numbered, not counted paragraph if ( bResult && pTxtNd->GetNumRule() == GetDoc()->GetOutlineNumRule() && @@ -189,7 +189,6 @@ sal_Bool SwEditShell::HasNumber() const { bResult = sal_False; } - // <-- } return bResult; @@ -234,10 +233,9 @@ void SwEditShell::DelNumRules() // ueberfluessig sein, aber VB hatte darueber eine Bugrep. CallChgLnk(); - // --> OD 2005-10-24 #126346# - cursor can not be anymore in - // front of a label, because numbering/bullet is deleted. + // cursor can not be anymore in front of a label, + // because numbering/bullet is deleted. SetInFrontOfLabel( sal_False ); - // <-- GetDoc()->SetModified(); EndAllAction(); @@ -317,10 +315,8 @@ void SwEditShell::ChangeIndentOfAllListLevels( short nDiff ) aRule.ChangeIndent( nDiff ); // <-- - // --> OD 2008-03-17 #refactorlists# // no start of new list SetCurNumRule( aRule, false ); - // <-- } EndAllAction(); @@ -341,13 +337,9 @@ void SwEditShell::SetIndent(short nIndent, const SwPosition & rPos) SwTxtNode * pTxtNode = aPaM.GetNode()->GetTxtNode(); // --> OD 2008-06-09 #i90078# -// int nLevel = -1; -// int nReferenceLevel = pTxtNode->GetActualListLevel(); -// if (! IsFirstOfNumRule(aPaM)) -// nLevel = nReferenceLevel; SwNumRule aRule(*pCurNumRule); -// aRule.ChangeIndent(nIndent, nLevel, nReferenceLevel, sal_False); + if ( IsFirstOfNumRule() ) { aRule.SetIndentOfFirstListLevelAndChangeOthers( nIndent ); @@ -361,7 +353,6 @@ void SwEditShell::SetIndent(short nIndent, const SwPosition & rPos) // --> OD 2005-02-18 #i42921# - 3rd parameter = false in order to // suppress setting of num rule at <aPaM>. - // --> OD 2008-03-17 #refactorlists# // do not apply any list GetDoc()->SetNumRule( aPaM, aRule, false, String(), sal_False ); // <-- @@ -559,15 +550,11 @@ sal_Bool SwEditShell::IsProtectedOutlinePara() const { SwNodePtr pTmpNd = rOutlNd[ nPos ]; - // --> OD 2008-04-02 #refactorlists# -// sal_uInt8 nTmpLvl = GetRealLevel( pTmpNd->GetTxtNode()-> -// GetTxtColl()->GetOutlineLevel() ); - // int nTmpLvl = pTmpNd->GetTxtNode()->GetOutlineLevel();//#outline level,zhaojianwei int nTmpLvl = pTmpNd->GetTxtNode()->GetAttrOutlineLevel(); - // ASSERT( nTmpLvl >= 0 && nTmpLvl < MAXLEVEL, - ASSERT( nTmpLvl >= 0 && nTmpLvl <= MAXLEVEL, //<-end,zhaojianwei + + OSL_ENSURE( nTmpLvl >= 0 && nTmpLvl <= MAXLEVEL, "<SwEditShell::IsProtectedOutlinePara()>" ); - // <-- + if( bFirst ) { nLvl = nTmpLvl; @@ -583,10 +570,10 @@ sal_Bool SwEditShell::IsProtectedOutlinePara() const } } } -#ifdef DBG_UTIL +#if OSL_DEBUG_LEVEL > 1 else { - ASSERT(!this, "Cursor not on an outline node" ); + OSL_ENSURE(!this, "Cursor not on an outline node" ); } #endif return bRet; @@ -619,7 +606,7 @@ sal_Bool SwEditShell::IsOutlineCopyable( sal_uInt16 nIdx ) const } -sal_Bool SwEditShell::NumOrNoNum( sal_Bool bNumOn, sal_Bool bChkStart ) // #115901# +sal_Bool SwEditShell::NumOrNoNum( sal_Bool bNumOn, sal_Bool bChkStart ) { sal_Bool bRet = sal_False; SwPaM* pCrsr = GetCrsr(); @@ -627,7 +614,6 @@ sal_Bool SwEditShell::NumOrNoNum( sal_Bool bNumOn, sal_Bool bChkStart ) // #1159 ( !bChkStart || !pCrsr->GetPoint()->nContent.GetIndex()) ) { StartAllAction(); // Klammern fuers Updaten !! - // #115901# bRet = GetDoc()->NumOrNoNum( pCrsr->GetPoint()->nNode, !bNumOn ); // #i29560# EndAllAction(); } @@ -654,32 +640,26 @@ sal_Bool SwEditShell::IsNoNum( sal_Bool bChkStart ) const return bResult; } -// --> OD 2008-02-29 #refactorlists# - removed <pHasChilds> sal_uInt8 SwEditShell::GetNumLevel() const { // gebe die akt. Ebene zurueck, auf der sich der Point vom Cursor befindet - //sal_uInt8 nLevel = NO_NUMBERING; //#outline level,zhaojianwei sal_uInt8 nLevel = MAXLEVEL; //end,zhaojianwei SwPaM* pCrsr = GetCrsr(); const SwTxtNode* pTxtNd = pCrsr->GetNode()->GetTxtNode(); - // --> FME 2005-09-12 #124972# Made code robust: - ASSERT( pTxtNd, "GetNumLevel() without text node" ) + OSL_ENSURE( pTxtNd, "GetNumLevel() without text node" ); if ( !pTxtNd ) return nLevel; - // <-- const SwNumRule* pRule = pTxtNd->GetNumRule(); if(pRule) { - // --> OD 2008-05-09 #refactorlists# const int nListLevelOfTxtNode( pTxtNd->GetActualListLevel() ); if ( nListLevelOfTxtNode >= 0 ) { nLevel = static_cast<sal_uInt8>( nListLevelOfTxtNode ); } - // <-- } return nLevel; @@ -690,8 +670,6 @@ const SwNumRule* SwEditShell::GetCurNumRule() const return GetDoc()->GetCurrNumRule( *GetCrsr()->GetPoint() ); } -// OD 2008-02-08 #newlistlevelattrs# - add handling of parameter <bResetIndentAttrs> -// --> OD 2008-03-17 #refactorlists# void SwEditShell::SetCurNumRule( const SwNumRule& rRule, const bool bCreateNewList, const String sContinuedListId, @@ -709,19 +687,14 @@ void SwEditShell::SetCurNumRule( const SwNumRule& rRule, for( sal_uInt16 n = 0; n < aRangeArr.Count(); ++n ) { aRangeArr.SetPam( n, aPam ); - // --> OD 2008-02-08 #newlistlevelattrs# - // --> OD 2008-03-17 #refactorlists# GetDoc()->SetNumRule( aPam, rRule, bCreateNewList, sContinuedListId, sal_True, bResetIndentAttrs ); - // <-- GetDoc()->SetCounted( aPam, true ); } } else { - // --> OD 2008-02-08 #newlistlevelattrs# - // --> OD 2008-03-17 #refactorlists# GetDoc()->SetNumRule( *pCrsr, rRule, bCreateNewList, sContinuedListId, sal_True, bResetIndentAttrs ); @@ -804,7 +777,6 @@ void SwEditShell::SetNodeNumStart( sal_uInt16 nStt ) sal_uInt16 SwEditShell::GetNodeNumStart() const { const SwTxtNode* pTxtNd = GetCrsr()->GetNode()->GetTxtNode(); - // --> OD 2008-02-28 #refactorlists# // correction: check, if list restart value is set at text node and // use new method <SwTxtNode::GetAttrListRestartValue()>. // return USHRT_MAX, if no list restart value is found. @@ -813,13 +785,8 @@ sal_uInt16 SwEditShell::GetNodeNumStart() const return static_cast<sal_uInt16>(pTxtNd->GetAttrListRestartValue()); } return USHRT_MAX; - // <-- } -/*-- 26.08.2005 14:47:17--------------------------------------------------- - - -----------------------------------------------------------------------*/ -// --> OD 2008-03-18 #refactorlists# const SwNumRule * SwEditShell::SearchNumRule( const bool bForward, const bool bNum, const bool bOutline, @@ -830,4 +797,5 @@ const SwNumRule * SwEditShell::SearchNumRule( const bool bForward, bForward, bNum, bOutline, nNonEmptyAllowed, sListId ); } -// <-- + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/edit/edredln.cxx b/sw/source/core/edit/edredln.cxx index 0dd6b9b3ec79..44116e4ebf5c 100644 --- a/sw/source/core/edit/edredln.cxx +++ b/sw/source/core/edit/edredln.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -148,3 +149,4 @@ sal_uInt16 SwEditShell::FindRedlineOfData( const SwRedlineData& rData ) const +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/edit/edsect.cxx b/sw/source/core/edit/edsect.cxx index a31122b631f4..25e4dcb434af 100644 --- a/sw/source/core/edit/edsect.cxx +++ b/sw/source/core/edit/edsect.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -88,7 +89,7 @@ const SwSection* SwEditShell::GetCurrSection() const return GetDoc()->GetCurrSection( *GetCrsr()->GetPoint() ); } -/*-----------------17.03.99 11:53------------------- +/*-------------------------------------------------- * SwEditShell::GetAnySection liefert den fuer Spalten * zustaendigen Bereich, bei Fussnoten kann es nicht der * Bereich innerhalb der Fussnote sein. @@ -113,11 +114,11 @@ const SwSection* SwEditShell::GetAnySection( sal_Bool bOutOfTab, const Point* pP if( pFrm && pFrm->IsInSct() ) { SwSectionFrm* pSect = pFrm->FindSctFrm(); - ASSERT( pSect, "GetAnySection: Where's my Sect?" ); + OSL_ENSURE( pSect, "GetAnySection: Where's my Sect?" ); if( pSect->IsInFtn() && pSect->GetUpper()->IsInSct() ) { pSect = pSect->GetUpper()->FindSctFrm(); - ASSERT( pSect, "GetAnySection: Where's my SectFrm?" ); + OSL_ENSURE( pSect, "GetAnySection: Where's my SectFrm?" ); } return pSect->GetSection(); } @@ -399,9 +400,7 @@ const SwNode* lcl_SpecialInsertNode(const SwPosition* pCurrentPos) pReturn = pInnermostNode->EndOfSectionNode(); else if ( bStart ) pReturn = pInnermostNode; - // else pReturn = NULL; } - // else: pReturn = NULL DBG_ASSERT( ( pReturn == NULL ) || pReturn->IsStartNode() || @@ -453,3 +452,4 @@ bool SwEditShell::DoSpecialInsert() return bRet; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/edit/edtab.cxx b/sw/source/core/edit/edtab.cxx index f67442d1be4b..edf9b2a9d150 100644 --- a/sw/source/core/edit/edtab.cxx +++ b/sw/source/core/edit/edtab.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -80,7 +81,7 @@ const SwTable& SwEditShell::InsertTable( const SwInsertTableOptions& rInsTblOpts GetDoc()->SplitNode( *pPos, false ); } - /* #109161# 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. */ const SwTable *pTable = GetDoc()->InsertTable( rInsTblOpts, *pPos, @@ -451,9 +452,8 @@ sal_Bool SwEditShell::CanMergeTable( sal_Bool bWithPrev, sal_Bool* pChkNxtPrv ) const SwTableNode* pChkNd = rNds[ pTblNd->GetIndex() - 1 ]->FindTableNode(); if( pChkNd && !pChkNd->GetTable().ISA( SwDDETable ) && bNew == pChkNd->GetTable().IsNewModel() && - // --> FME 2004-09-17 #117418# Consider table in table case + // Consider table in table case pChkNd->EndOfSectionIndex() == pTblNd->GetIndex() - 1 ) - // <-- *pChkNxtPrv = sal_True, bRet = sal_True; // mit Prev ist moeglich else { @@ -470,10 +470,9 @@ sal_Bool SwEditShell::CanMergeTable( sal_Bool bWithPrev, sal_Bool* pChkNxtPrv ) if( bWithPrev ) { pTmpTblNd = rNds[ pTblNd->GetIndex() - 1 ]->FindTableNode(); - // --> FME 2004-09-17 #117418# Consider table in table case + // Consider table in table case if ( pTmpTblNd && pTmpTblNd->EndOfSectionIndex() != pTblNd->GetIndex() - 1 ) pTmpTblNd = 0; - // <-- } else pTmpTblNd = rNds[ pTblNd->EndOfSectionIndex() + 1 ]->GetTableNode(); @@ -491,3 +490,4 @@ void SwEditShell::AppendUndoForInsertFromDB( sal_Bool bIsTable ) GetDoc()->AppendUndoForInsertFromDB( *GetCrsr(), bIsTable ); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/edit/edtox.cxx b/sw/source/core/edit/edtox.cxx index b09b57d50b9a..1bbf0b3b9e9a 100644 --- a/sw/source/core/edit/edtox.cxx +++ b/sw/source/core/edit/edtox.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -51,7 +52,6 @@ #include <pam.hxx> #include <viewopt.hxx> #include <ndtxt.hxx> -#include <errhdl.hxx> #include <swundo.hxx> #include <txttxmrk.hxx> #include <edimp.hxx> @@ -118,40 +118,30 @@ sal_uInt16 SwEditShell::GetCurTOXMarks(SwTOXMarks& rMarks) const return GetDoc()->GetCurTOXMark( *GetCrsr()->Start(), rMarks ); } -/* -----------------01.09.99 16:05------------------- - - --------------------------------------------------*/ sal_Bool SwEditShell::IsTOXBaseReadonly(const SwTOXBase& rTOXBase) const { - ASSERT( rTOXBase.ISA( SwTOXBaseSection ), "no TOXBaseSection!" ); + OSL_ENSURE( rTOXBase.ISA( SwTOXBaseSection ), "no TOXBaseSection!" ); const SwTOXBaseSection& rTOXSect = (const SwTOXBaseSection&)rTOXBase; return rTOXSect.IsProtect(); } -/* -----------------18.10.99 15:53------------------- - --------------------------------------------------*/ void SwEditShell::SetTOXBaseReadonly(const SwTOXBase& rTOXBase, sal_Bool bReadonly) { - ASSERT( rTOXBase.ISA( SwTOXBaseSection ), "no TOXBaseSection!" ); + OSL_ENSURE( rTOXBase.ISA( SwTOXBaseSection ), "no TOXBaseSection!" ); const SwTOXBaseSection& rTOXSect = (const SwTOXBaseSection&)rTOXBase; ((SwTOXBase&)rTOXBase).SetProtected(bReadonly); - ASSERT( rTOXSect.SwSection::GetType() == TOX_CONTENT_SECTION, "not a TOXContentSection" ); + OSL_ENSURE( rTOXSect.SwSection::GetType() == TOX_CONTENT_SECTION, "not a TOXContentSection" ); SwSectionData aSectionData(rTOXSect); aSectionData.SetProtectFlag(bReadonly); UpdateSection( GetSectionFmtPos( *rTOXSect.GetFmt() ), aSectionData, 0 ); } -/* -----------------02.09.99 07:47------------------- - - --------------------------------------------------*/ const SwTOXBase* SwEditShell::GetDefaultTOXBase( TOXTypes eTyp, sal_Bool bCreate ) { return GetDoc()->GetDefaultTOXBase( eTyp, bCreate ); } -/* -----------------02.09.99 08:05------------------- - --------------------------------------------------*/ void SwEditShell::SetDefaultTOXBase(const SwTOXBase& rBase) { GetDoc()->SetDefaultTOXBase(rBase); @@ -173,7 +163,7 @@ void SwEditShell::InsertTableOf( const SwTOXBase& rTOX, const SfxItemSet* pSet ) // Einfuegen des Verzeichnisses const SwTOXBaseSection* pTOX = pDoc->InsertTableOf( *GetCrsr()->GetPoint(), rTOX, pSet, sal_True ); - ASSERT(pTOX, "Kein aktuelles Verzeichnis"); + OSL_ENSURE(pTOX, "Kein aktuelles Verzeichnis"); // Formatierung anstossen CalcLayout(); @@ -197,9 +187,9 @@ sal_Bool SwEditShell::UpdateTableOf( const SwTOXBase& rTOX, const SfxItemSet* pS { sal_Bool bRet = sal_False; - ASSERT( rTOX.ISA( SwTOXBaseSection ), "keine TOXBaseSection!" ); + OSL_ENSURE( rTOX.ISA( SwTOXBaseSection ), "keine TOXBaseSection!" ); SwTOXBaseSection* pTOX = (SwTOXBaseSection*)&rTOX; - ASSERT(pTOX, "Keine aktuelles Verzeichnis"); + OSL_ENSURE(pTOX, "Keine aktuelles Verzeichnis"); const SwSectionNode* pSectNd; if( pTOX && 0 != ( pSectNd = pTOX->GetFmt()->GetSectionNode() ) ) { @@ -295,7 +285,7 @@ const SwTOXBase* SwEditShell::GetTOX( sal_uInt16 nPos ) const pSect->GetFmt()->GetSectionNode() && nCnt++ == nPos ) { - ASSERT( pSect->ISA( SwTOXBaseSection ), "keine TOXBaseSection!" ); + OSL_ENSURE( pSect->ISA( SwTOXBaseSection ), "keine TOXBaseSection!" ); return (SwTOXBaseSection*)pSect; } } @@ -315,23 +305,16 @@ sal_Bool SwEditShell::IsUpdateTOX() const return GetDoc()->IsUpdateTOX(); } -/* -----------------26.08.99 13:49------------------- - - --------------------------------------------------*/ const String& SwEditShell::GetTOIAutoMarkURL() const { return GetDoc()->GetTOIAutoMarkURL(); } -/* -----------------26.08.99 13:49------------------- - --------------------------------------------------*/ void SwEditShell::SetTOIAutoMarkURL(const String& rSet) { GetDoc()->SetTOIAutoMarkURL(rSet); } -/* -----------------26.08.99 09:29------------------- - --------------------------------------------------*/ void SwEditShell::ApplyAutoMark() { StartAllAction(); @@ -369,8 +352,6 @@ void SwEditShell::ApplyAutoMark() // // SearchOptions to be used in loop below // - //SearchAlgorithms eSrchType = SearchAlgorithms_ABSOLUTE; - //OUString aSrchStr = rText; sal_Bool bCaseSensitive = sal_True; sal_Bool bWordOnly = sal_False; sal_Bool bSrchInSel = sal_False; @@ -431,13 +412,11 @@ void SwEditShell::ApplyAutoMark() // if (!bCaseSensitive) { - //nSrchFlags |= SearchFlags::ALL_IGNORE_CASE; aSearchOpt.transliterateFlags |= TransliterationModules_IGNORE_CASE; } else { - //aSearchOpt.searchFlag &= ~SearchFlags::ALL_IGNORE_CASE; aSearchOpt.transliterateFlags &= ~TransliterationModules_IGNORE_CASE; } @@ -485,3 +464,4 @@ void SwEditShell::ApplyAutoMark() +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/edit/edundo.cxx b/sw/source/core/edit/edundo.cxx index 9ae0d641a3c2..0ee3879c48c5 100644 --- a/sw/source/core/edit/edundo.cxx +++ b/sw/source/core/edit/edundo.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -103,7 +104,7 @@ bool SwEditShell::Undo(sal_uInt16 const nCount) { SET_CURR_SHELL( this ); - // #105332# current undo state was not saved + // current undo state was not saved ::sw::UndoGuard const undoGuard(GetDoc()->GetIDocumentUndoRedo()); sal_Bool bRet = sal_False; @@ -148,7 +149,7 @@ bool SwEditShell::Undo(sal_uInt16 const nCount) GetDoc()->SetRedlineMode( eOld ); GetDoc()->CompressRedlines(); - //JP 18.09.97: autom. Erkennung fuer die neue "Box" + // autom. Erkennung fuer die neue "Box" SaveTblBoxCntnt(); } EndAllAction(); @@ -162,7 +163,7 @@ bool SwEditShell::Redo(sal_uInt16 const nCount) sal_Bool bRet = sal_False; - // #105332# undo state was not saved + // undo state was not saved ::sw::UndoGuard const undoGuard(GetDoc()->GetIDocumentUndoRedo()); StartAllAction(); @@ -197,7 +198,7 @@ bool SwEditShell::Redo(sal_uInt16 const nCount) GetDoc()->SetRedlineMode( eOld ); GetDoc()->CompressRedlines(); - //JP 18.09.97: autom. Erkennung fuer die neue "Box" + // autom. Erkennung fuer die neue "Box" SaveTblBoxCntnt(); } @@ -232,8 +233,8 @@ bool SwEditShell::Repeat(sal_uInt16 const nCount) void lcl_SelectSdrMarkList( SwEditShell* pShell, const SdrMarkList* pSdrMarkList ) { - ASSERT( pShell != NULL, "need shell!" ); - ASSERT( pSdrMarkList != NULL, "need mark list" ); + OSL_ENSURE( pShell != NULL, "need shell!" ); + OSL_ENSURE( pSdrMarkList != NULL, "need mark list" ); if( pShell->ISA( SwFEShell ) ) { @@ -252,7 +253,8 @@ void lcl_SelectSdrMarkList( SwEditShell* pShell, // the old implementation would always unselect // objects, even if no new ones were selected. If this // is a problem, we need to re-work this a little. - ASSERT( pSdrMarkList->GetMarkCount() != 0, "empty mark list" ); + OSL_ENSURE( pSdrMarkList->GetMarkCount() != 0, "empty mark list" ); } } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/edit/edws.cxx b/sw/source/core/edit/edws.cxx index 1a681ad2cf29..bb34343dc65e 100644 --- a/sw/source/core/edit/edws.cxx +++ b/sw/source/core/edit/edws.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -175,7 +176,7 @@ sal_uInt16 SwEditShell::GetCntType() const case ND_OLENODE: nRet = CNT_OLE; break; } - ASSERT( nRet, ERR_OUTOFSCOPE ); + OSL_ASSERT( nRet ); return nRet; } @@ -324,7 +325,7 @@ void SwEditShell::AutoCorrect( SvxAutoCorrect& rACorr, sal_Bool bInsert, SwAutoCorrDoc aSwAutoCorrDoc( *this, *pCrsr, cChar ); rACorr.AutoCorrect( aSwAutoCorrDoc, pTNd->GetTxt(), pCrsr->GetPoint()->nContent.GetIndex(), - cChar, bInsert ); + cChar, bInsert, GetWin() ); if( cChar ) SaveTblBoxCntnt( pCrsr->GetPoint() ); EndAllAction(); @@ -363,3 +364,4 @@ SwAutoCompleteWord& SwEditShell::GetAutoCompleteWords() +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |