diff options
23 files changed, 74 insertions, 84 deletions
diff --git a/sw/source/core/doc/acmplwrd.cxx b/sw/source/core/doc/acmplwrd.cxx index 85485455b00f..80c657d06d4f 100644 --- a/sw/source/core/doc/acmplwrd.cxx +++ b/sw/source/core/doc/acmplwrd.cxx @@ -146,7 +146,7 @@ void SwAutoCompleteClient::Modify( const SfxPoolItem* pOld, const SfxPoolItem *) case RES_OBJECTDYING: if( (void*)GetRegisteredIn() == ((SwPtrMsgPoolItem *)pOld)->pObject ) ((SwModify*)GetRegisteredIn())->Remove(this); - pAutoCompleteWord->DocumentDying(*pDoc); + pAutoCompleteWord->DocumentDying(*pDoc); break; } diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx index 76e9cfcee2d8..4f43b7dddc0f 100644 --- a/sw/source/core/doc/docbm.cxx +++ b/sw/source/core/doc/docbm.cxx @@ -1392,12 +1392,12 @@ void _SaveCntntIdx(SwDoc* pDoc, FOREACHSHELL_START( pShell ) SwPaM *_pStkCrsr = PCURSH->GetStkCrsr(); if( _pStkCrsr ) - do { - lcl_ChkPaM( rSaveArr, nNode, nCntnt, *_pStkCrsr, - aSave, false ); - aSave.IncCount(); - } while ( (_pStkCrsr != 0 ) && - ((_pStkCrsr=(SwPaM *)_pStkCrsr->GetNext()) != PCURSH->GetStkCrsr()) ); + do { + lcl_ChkPaM( rSaveArr, nNode, nCntnt, *_pStkCrsr, + aSave, false ); + aSave.IncCount(); + } while ( (_pStkCrsr != 0 ) && + ((_pStkCrsr=(SwPaM *)_pStkCrsr->GetNext()) != PCURSH->GetStkCrsr()) ); FOREACHPAM_START( PCURSH->_GetCrsr() ) lcl_ChkPaM( rSaveArr, nNode, nCntnt, *PCURCRSR, @@ -1517,16 +1517,16 @@ void _RestoreCntntIdx(SwDoc* pDoc, FOREACHSHELL_START( pShell ) SwPaM *_pStkCrsr = PCURSH->GetStkCrsr(); if( _pStkCrsr ) - do { - if( aSave.GetCount() == nCnt ) - { - pPos = &_pStkCrsr->GetBound( 0x0800 == - aSave.GetType() ); - break; - } - ++nCnt; - } while ( (_pStkCrsr != 0 ) && - ((_pStkCrsr=(SwPaM *)_pStkCrsr->GetNext()) != PCURSH->GetStkCrsr()) ); + do { + if( aSave.GetCount() == nCnt ) + { + pPos = &_pStkCrsr->GetBound( 0x0800 == + aSave.GetType() ); + break; + } + ++nCnt; + } while ( (_pStkCrsr != 0 ) && + ((_pStkCrsr=(SwPaM *)_pStkCrsr->GetNext()) != PCURSH->GetStkCrsr()) ); if( pPos ) break; @@ -1678,16 +1678,16 @@ void _RestoreCntntIdx(std::vector<sal_uLong> &rSaveArr, FOREACHSHELL_START( pShell ) SwPaM *_pStkCrsr = PCURSH->GetStkCrsr(); if( _pStkCrsr ) - do { - if( aSave.GetCount() == nCnt ) - { - pPos = &_pStkCrsr->GetBound( 0x0800 == - aSave.GetType() ); - break; - } - ++nCnt; - } while ( (_pStkCrsr != 0 ) && - ((_pStkCrsr=(SwPaM *)_pStkCrsr->GetNext()) != PCURSH->GetStkCrsr()) ); + do { + if( aSave.GetCount() == nCnt ) + { + pPos = &_pStkCrsr->GetBound( 0x0800 == + aSave.GetType() ); + break; + } + ++nCnt; + } while ( (_pStkCrsr != 0 ) && + ((_pStkCrsr=(SwPaM *)_pStkCrsr->GetNext()) != PCURSH->GetStkCrsr()) ); if( pPos ) break; diff --git a/sw/source/core/doc/doccorr.cxx b/sw/source/core/doc/doccorr.cxx index 9e7e6adbe61e..2379c71d3810 100644 --- a/sw/source/core/doc/doccorr.cxx +++ b/sw/source/core/doc/doccorr.cxx @@ -127,10 +127,10 @@ void PaMCorrAbs( const SwPaM& rRange, FOREACHSHELL_START( pShell ) SwPaM *_pStkCrsr = PCURSH->GetStkCrsr(); if( _pStkCrsr ) - do { - lcl_PaMCorrAbs( *_pStkCrsr, aStart, aEnd, aNewPos ); - } while ( (_pStkCrsr != 0 ) && - ((_pStkCrsr=(SwPaM *)_pStkCrsr->GetNext()) != PCURSH->GetStkCrsr()) ); + do { + lcl_PaMCorrAbs( *_pStkCrsr, aStart, aEnd, aNewPos ); + } while ( (_pStkCrsr != 0 ) && + ((_pStkCrsr=(SwPaM *)_pStkCrsr->GetNext()) != PCURSH->GetStkCrsr()) ); FOREACHPAM_START( PCURSH->_GetCrsr() ) lcl_PaMCorrAbs( *PCURCRSR, aStart, aEnd, aNewPos ); @@ -273,10 +273,10 @@ void PaMCorrRel( const SwNodeIndex &rOldNode, FOREACHSHELL_START( pShell ) SwPaM *_pStkCrsr = PCURSH->GetStkCrsr(); if( _pStkCrsr ) - do { - lcl_PaMCorrRel1( _pStkCrsr, pOldNode, aNewPos, nCntIdx ); - } while ( (_pStkCrsr != 0 ) && - ((_pStkCrsr=(SwPaM *)_pStkCrsr->GetNext()) != PCURSH->GetStkCrsr()) ); + do { + lcl_PaMCorrRel1( _pStkCrsr, pOldNode, aNewPos, nCntIdx ); + } while ( (_pStkCrsr != 0 ) && + ((_pStkCrsr=(SwPaM *)_pStkCrsr->GetNext()) != PCURSH->GetStkCrsr()) ); FOREACHPAM_START( PCURSH->_GetCrsr() ) lcl_PaMCorrRel1( PCURCRSR, pOldNode, aNewPos, nCntIdx); diff --git a/sw/source/core/doc/poolfmt.cxx b/sw/source/core/doc/poolfmt.cxx index a78cb31681cf..fc8f1b4f07b7 100644 --- a/sw/source/core/doc/poolfmt.cxx +++ b/sw/source/core/doc/poolfmt.cxx @@ -361,7 +361,7 @@ SwTxtFmtColl* SwDoc::GetTxtCollFromPool( sal_uInt16 nId, bool bRegardLanguage ) : GetTxtCollFromPool( nParent )); else //FEATURE::CONDCOLL - pNewColl = new SwTxtFmtColl( GetAttrPool(), aNm, !nParent + pNewColl = new SwTxtFmtColl( GetAttrPool(), aNm, !nParent ? pDfltTxtFmtColl : GetTxtCollFromPool( nParent )); pNewColl->SetPoolFmtId( nId ); diff --git a/sw/source/core/docnode/nodes.cxx b/sw/source/core/docnode/nodes.cxx index 49ea80ad0660..500f56d855ab 100644 --- a/sw/source/core/docnode/nodes.cxx +++ b/sw/source/core/docnode/nodes.cxx @@ -291,8 +291,7 @@ void SwNodes::ChgNode( SwNodeIndex& rDelPos, sal_uLong nSz, { rNds.GetDoc()->GetDocShell()->Broadcast( SwFmtFldHint( &pTxtFld->GetFld(), pTxtFld->GetFld().IsFldInDoc() ? SWFMTFLD_INSERTED : SWFMTFLD_REMOVED ) ); } - else - if( RES_DDEFLD == pTyp->Which() ) + else if( RES_DDEFLD == pTyp->Which() ) { if( bToUndo ) ((SwDDEFieldType*)pTyp)->DecRefCnt(); diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index 28e512726d39..19d688928c69 100644 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -3112,7 +3112,7 @@ SwRootFrm::Paint(SwRect const& rRect, SwPrintData const*const pPrintData) const } if ( pSh->GetDoc()->get( IDocumentSettingAccess::BACKGROUND_PARA_OVER_DRAWINGS ) ) - pPage->PaintBaBo( aPaintRect, pPage, sal_True, /*bOnlyTxtBackground=*/true ); + pPage->PaintBaBo( aPaintRect, pPage, sal_True, /*bOnlyTxtBackground=*/true ); if( pSh->GetWin() ) { diff --git a/sw/source/core/text/frmform.cxx b/sw/source/core/text/frmform.cxx index 698cf952a249..2419fc934012 100644 --- a/sw/source/core/text/frmform.cxx +++ b/sw/source/core/text/frmform.cxx @@ -385,7 +385,7 @@ void SwTxtFrm::AdjustFrm( const SwTwips nChgHght, sal_Bool bHasToFit ) if( bVert ) Prt().SSize().Width() += nChgHght; else - Prt().SSize().Height() += nChgHght; + Prt().SSize().Height() += nChgHght; UNDO_SWAP( this ) return; } diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx index cbdcc57aadc9..2283eedd0785 100644 --- a/sw/source/core/text/itrform2.cxx +++ b/sw/source/core/text/itrform2.cxx @@ -2548,12 +2548,14 @@ SwFlyCntPortion *SwTxtFormatter::NewFlyCntPortion( SwTxtFormatInfo &rInf, aBase.Y() = Y() + pRet->GetAscent(); nMode |= AS_CHAR_ULSPACE; if( !rInf.IsTest() ) + { aTmpBase = aBase; if ( GetInfo().GetTxtFrm()->IsVertical() ) GetInfo().GetTxtFrm()->SwitchHorizontalToVertical( aTmpBase ); pRet->SetBase( *rInf.GetTxtFrm(), aTmpBase, nTmpAscent, nTmpDescent, nFlyAsc, nFlyDesc, nMode ); + } } } else diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx index 14f7485c161f..c6c6745c3511 100644 --- a/sw/source/core/txtnode/fntcache.cxx +++ b/sw/source/core/txtnode/fntcache.cxx @@ -1358,7 +1358,7 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf ) { nKernSum += nSpaceAdd; if( j < i ) - rInf.GetOut().DrawText( aTmpPos, rInf.GetText(), + rInf.GetOut().DrawText( aTmpPos, rInf.GetText(), rInf.GetIdx() + j, i - j ); j = i + 1; SwTwips nAdd = pKernArray[ i ] + nKernSum; diff --git a/sw/source/core/txtnode/thints.cxx b/sw/source/core/txtnode/thints.cxx index caf76ec91122..c69574d50a14 100644 --- a/sw/source/core/txtnode/thints.cxx +++ b/sw/source/core/txtnode/thints.cxx @@ -2797,8 +2797,7 @@ bool SwpHints::TryInsertHint( SwTxtAttr* const pHint, SwTxtNode &rNode, // Also attributes without length may be inserted directly. // SETATTR_NOHINTADJUST is set e.g., during undo. // Portion building in not necessary during XML import. - else - if ( !bNoHintAdjustMode && + else if ( !bNoHintAdjustMode && !pHint->IsOverlapAllowedAttr() && !rNode.GetDoc()->IsInXMLImport() && ( RES_TXTATR_AUTOFMT == nWhich || diff --git a/sw/source/filter/html/htmlplug.cxx b/sw/source/filter/html/htmlplug.cxx index 58c83b25a414..39cca4bc70d0 100644 --- a/sw/source/filter/html/htmlplug.cxx +++ b/sw/source/filter/html/htmlplug.cxx @@ -1202,8 +1202,7 @@ Writer& OutHTML_FrmFmtOLENode( Writer& rWrt, const SwFrmFmt& rFrmFmt, rHTMLWrt.OutNewLine(); HTMLOutFuncs::Out_AsciiTag( rWrt.Strm(), OOO_STRING_SVTOOLS_HTML_applet, sal_False ); } - else - if( aGlobName == SvGlobalName( SO3_PLUGIN_CLASSID ) ) + else if( aGlobName == SvGlobalName( SO3_PLUGIN_CLASSID ) ) { // fuer Plugins die Paramater als Optionen schreiben diff --git a/sw/source/filter/xml/xmltexte.cxx b/sw/source/filter/xml/xmltexte.cxx index 07e2011153c8..059a4e120f8b 100644 --- a/sw/source/filter/xml/xmltexte.cxx +++ b/sw/source/filter/xml/xmltexte.cxx @@ -227,7 +227,7 @@ static void lcl_addURL ( SvXMLExport &rExport, const String &rURL, String sRelURL; if( bToRel && (rURL.Len() > 0) ) - sRelURL = URIHelper::simpleNormalizedMakeRelative(rExport.GetOrigFileName(), + sRelURL = URIHelper::simpleNormalizedMakeRelative(rExport.GetOrigFileName(), rURL); else sRelURL = rURL; diff --git a/sw/source/ui/app/docstyle.cxx b/sw/source/ui/app/docstyle.cxx index 4a8458a4d2cb..0ee955e332c3 100644 --- a/sw/source/ui/app/docstyle.cxx +++ b/sw/source/ui/app/docstyle.cxx @@ -2543,7 +2543,9 @@ SfxStyleSheetBase* SwStyleSheetIterator::First() ? !(nId & USER_FMT) // searched for used and found none : bIsSearchUsed ) - continue; + { + continue; + } if( rDoc.get(IDocumentSettingAccess::HTML_MODE) && !(nId & USER_FMT) && !( RES_POOLCHR_HTML_BEGIN <= nId && diff --git a/sw/source/ui/app/swmodul1.cxx b/sw/source/ui/app/swmodul1.cxx index 7815061c89f4..3c1388fba18e 100644 --- a/sw/source/ui/app/swmodul1.cxx +++ b/sw/source/ui/app/swmodul1.cxx @@ -293,13 +293,13 @@ void SwModule::ApplyUserCharUnit(sal_Bool bApplyChar, sal_Bool bWeb) if(bWeb) { if(!pWebUsrPref) - GetUsrPref(sal_True); + GetUsrPref(sal_True); pPref = pWebUsrPref; } else { if(!pUsrPref) - GetUsrPref(sal_False); + GetUsrPref(sal_False); pPref = pUsrPref; } sal_Bool bOldApplyCharUnit = pPref->IsApplyCharUnit(); diff --git a/sw/source/ui/docvw/PostItMgr.cxx b/sw/source/ui/docvw/PostItMgr.cxx index 83b1cc9b278d..90c369cb0830 100644 --- a/sw/source/ui/docvw/PostItMgr.cxx +++ b/sw/source/ui/docvw/PostItMgr.cxx @@ -523,8 +523,7 @@ void SwPostItMgr::PreparePageContainer() for (int i=0; i<lPageSize - lContainerSize;i++) mPages.push_back( new SwPostItPageItem()); } - else - if (lContainerSize > lPageSize) + else if (lContainerSize > lPageSize) { for (int i=mPages.size()-1; i >= lPageSize;--i) { @@ -1470,8 +1469,7 @@ bool SwPostItMgr::ScrollbarHit(const unsigned long aPage,const Point &aPoint) Scroll( -1*GetScrollSize(), aPage); return true; } - else - if (aRectTop.IsInside(aPoint)) + else if (aRectTop.IsInside(aPoint)) { if (aPoint.X() < long((aPointTop.X() + GetSidebarWidth()/3*2))) Scroll(GetScrollSize(), aPage); diff --git a/sw/source/ui/envelp/envlop1.cxx b/sw/source/ui/envelp/envlop1.cxx index e1b7cae3d1dd..c4fc2ee52047 100644 --- a/sw/source/ui/envelp/envlop1.cxx +++ b/sw/source/ui/envelp/envlop1.cxx @@ -243,8 +243,8 @@ IMPL_LINK( SwEnvPage, DatabaseHdl, ListBox *, pListBox ) } else sActDBName.SetToken(1, DB_DELIM, aTableLB.GetSelectEntry()); - pSh->GetNewDBMgr()->GetColumnNames(&aDBFieldLB, aDatabaseLB.GetSelectEntry(), - aTableLB.GetSelectEntry()); + pSh->GetNewDBMgr()->GetColumnNames(&aDBFieldLB, aDatabaseLB.GetSelectEntry(), + aTableLB.GetSelectEntry()); return 0; } diff --git a/sw/source/ui/fldui/flddinf.cxx b/sw/source/ui/fldui/flddinf.cxx index 6a6f35b1ebcb..34adbd421621 100644 --- a/sw/source/ui/fldui/flddinf.cxx +++ b/sw/source/ui/fldui/flddinf.cxx @@ -215,9 +215,7 @@ IMPL_LINK_NOARG(SwFldDokInfPage, TypeHdl) pSelEntry = aTypeTLB.GetEntry(0); aTypeTLB.Select(pSelEntry); } - else - - if (pOldEntry != pSelEntry) + else if (pOldEntry != pSelEntry) FillSelectionLB((sal_uInt16)(sal_uLong)pSelEntry->GetUserData()); SubTypeHdl(); diff --git a/sw/source/ui/shells/annotsh.cxx b/sw/source/ui/shells/annotsh.cxx index 117a0d20b267..3ce6672b08b5 100644 --- a/sw/source/ui/shells/annotsh.cxx +++ b/sw/source/ui/shells/annotsh.cxx @@ -636,14 +636,11 @@ void SwAnnotationShell::GetState(SfxItemSet& rSet) if (nWhich==SID_ATTR_PARA_ADJUST_LEFT) eAdjust = SVX_ADJUST_LEFT; - else - if (nWhich==SID_ATTR_PARA_ADJUST_RIGHT) + else if (nWhich==SID_ATTR_PARA_ADJUST_RIGHT) eAdjust = SVX_ADJUST_RIGHT; - else - if (nWhich==SID_ATTR_PARA_ADJUST_CENTER) + else if (nWhich==SID_ATTR_PARA_ADJUST_CENTER) eAdjust = SVX_ADJUST_CENTER; - else - if (nWhich==SID_ATTR_PARA_ADJUST_BLOCK) + else if (nWhich==SID_ATTR_PARA_ADJUST_BLOCK) eAdjust = SVX_ADJUST_BLOCK; if( !pAdjust ) @@ -669,11 +666,9 @@ void SwAnnotationShell::GetState(SfxItemSet& rSet) if (nWhich==SID_ATTR_PARA_LINESPACE_10) nLSpace = 100; - else - if (nWhich==SID_ATTR_PARA_LINESPACE_15) + else if (nWhich==SID_ATTR_PARA_LINESPACE_15) nLSpace = 150; - else - if (nWhich==SID_ATTR_PARA_LINESPACE_20) + else if (nWhich==SID_ATTR_PARA_LINESPACE_20) nLSpace = 200; if( !pLSpace ) @@ -884,7 +879,7 @@ void SwAnnotationShell::StateClpbrd(SfxItemSet &rSet) SvxClipboardFmtItem aFormats( SID_CLIPBOARD_FORMAT_ITEMS ); if ( aDataHelper.HasFormat( SOT_FORMAT_RTF ) ) aFormats.AddClipbrdFormat( SOT_FORMAT_RTF ); - aFormats.AddClipbrdFormat( SOT_FORMAT_STRING ); + aFormats.AddClipbrdFormat( SOT_FORMAT_STRING ); rSet.Put( aFormats ); } else diff --git a/sw/source/ui/shells/txtattr.cxx b/sw/source/ui/shells/txtattr.cxx index 6802fe54f3ed..d40c091d2c78 100644 --- a/sw/source/ui/shells/txtattr.cxx +++ b/sw/source/ui/shells/txtattr.cxx @@ -250,13 +250,13 @@ void SwTextShell::ExecCharAttrArgs(SfxRequest &rReq) aSize.SetHeight( lSize ); aAttrSet.Put( aSize ); } - if( aAttrSet.Count() ) - { - if( pColl ) - pColl->SetFmtAttr( aAttrSet ); - else - rWrtSh.SetAttr( aAttrSet ); - } + if( aAttrSet.Count() ) + { + if( pColl ) + pColl->SetFmtAttr( aAttrSet ); + else + rWrtSh.SetAttr( aAttrSet ); + } rReq.Done(); } break; diff --git a/sw/source/ui/uiview/view2.cxx b/sw/source/ui/uiview/view2.cxx index 4f568a847eb0..56ef147872f4 100644 --- a/sw/source/ui/uiview/view2.cxx +++ b/sw/source/ui/uiview/view2.cxx @@ -2060,7 +2060,7 @@ long SwView::InsertMedium( sal_uInt16 nSlotId, SfxMedium* pMedium, sal_Int16 nVe SfxRequest aRequest(GetViewFrame(), SID_INSERTDOC); aRequest.AppendItem(SfxStringItem(SID_INSERTDOC, pMedium->GetOrigURL())); if(pMedium->GetFilter()) - aRequest.AppendItem(SfxStringItem(FN_PARAM_1, pMedium->GetFilter()->GetName())); + aRequest.AppendItem(SfxStringItem(FN_PARAM_1, pMedium->GetFilter()->GetName())); aRequest.Done(); } diff --git a/sw/source/ui/uno/unotxdoc.cxx b/sw/source/ui/uno/unotxdoc.cxx index be2a5d6ea17d..729145ce88d9 100644 --- a/sw/source/ui/uno/unotxdoc.cxx +++ b/sw/source/ui/uno/unotxdoc.cxx @@ -1794,11 +1794,9 @@ Sequence< OUString > SwXTextDocument::getSupportedServiceNames(void) throw( Runt if (bTextDoc) pArray[2] = OUString ( RTL_CONSTASCII_USTRINGPARAM ( ( "com.sun.star.text.TextDocument" ) ) ); - else - if (bWebDoc) + else if (bWebDoc) pArray[2] = OUString ( RTL_CONSTASCII_USTRINGPARAM ( ( "com.sun.star.text.WebDocument" ) ) ); - else - if (bGlobalDoc) + else if (bGlobalDoc) pArray[2] = OUString ( RTL_CONSTASCII_USTRINGPARAM ( ( "com.sun.star.text.GlobalDocument" ) ) ); return aRet; diff --git a/sw/source/ui/vba/vbadocumentproperties.cxx b/sw/source/ui/vba/vbadocumentproperties.cxx index 97b6fd4bbfc8..7ecd02ecfe87 100644 --- a/sw/source/ui/vba/vbadocumentproperties.cxx +++ b/sw/source/ui/vba/vbadocumentproperties.cxx @@ -702,7 +702,7 @@ protected: virtual uno::Any SAL_CALL getByName( const ::rtl::OUString& aName ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException) { if ( !hasByName( aName ) ) - throw container::NoSuchElementException(); + throw container::NoSuchElementException(); DocPropsByName::iterator it = mNamedDocProps.find( aName ); return uno::Any( it->second ); diff --git a/sw/source/ui/vba/vbapalette.cxx b/sw/source/ui/vba/vbapalette.cxx index c60861b7b2e1..380a2f20523f 100644 --- a/sw/source/ui/vba/vbapalette.cxx +++ b/sw/source/ui/vba/vbapalette.cxx @@ -64,8 +64,8 @@ public: virtual uno::Any SAL_CALL getByIndex( ::sal_Int32 Index ) throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException) { - if ( Index < 0 || Index >= getCount() ) - throw lang::IndexOutOfBoundsException(); + if ( Index < 0 || Index >= getCount() ) + throw lang::IndexOutOfBoundsException(); return uno::makeAny( sal_Int32( ColorTable[ Index ] ) ); } |