diff options
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/dialog/srchdlg.cxx | 2 | ||||
-rw-r--r-- | svx/source/engine3d/e3dundo.cxx | 22 | ||||
-rw-r--r-- | svx/source/fmcomp/gridcell.cxx | 2 | ||||
-rw-r--r-- | svx/source/items/numfmtsh.cxx | 58 | ||||
-rw-r--r-- | svx/source/svdraw/sdrundomanager.cxx | 16 | ||||
-rw-r--r-- | svx/source/svdraw/svdundo.cxx | 366 | ||||
-rw-r--r-- | svx/source/table/tableundo.cxx | 66 | ||||
-rw-r--r-- | svx/source/table/tableundo.hxx | 6 |
8 files changed, 275 insertions, 263 deletions
diff --git a/svx/source/dialog/srchdlg.cxx b/svx/source/dialog/srchdlg.cxx index 22d913abd922..11d235e57870 100644 --- a/svx/source/dialog/srchdlg.cxx +++ b/svx/source/dialog/srchdlg.cxx @@ -929,7 +929,7 @@ void SvxSearchDialog::Init_Impl( int bSearchPattern ) bool bSetSearch = ( ( nModifyFlag & MODIFY_SEARCH ) == 0 ); bool bSetReplace = ( ( nModifyFlag & MODIFY_REPLACE ) == 0 ); - if ( pSearchItem->GetSearchString().Len() && bSetSearch ) + if ( !(pSearchItem->GetSearchString().isEmpty()) && bSetSearch ) m_pSearchLB->SetText( pSearchItem->GetSearchString() ); else if (!aSearchStrings.empty()) { diff --git a/svx/source/engine3d/e3dundo.cxx b/svx/source/engine3d/e3dundo.cxx index 14934f734e3f..38c287fde338 100644 --- a/svx/source/engine3d/e3dundo.cxx +++ b/svx/source/engine3d/e3dundo.cxx @@ -34,9 +34,9 @@ E3dUndoAction::~E3dUndoAction () // Repeat does not exist -sal_Bool E3dUndoAction::CanRepeat(SfxRepeatTarget&) const +bool E3dUndoAction::CanRepeat(SfxRepeatTarget&) const { - return sal_False; + return false; } /************************************************************************/ @@ -74,13 +74,13 @@ void E3dRotateUndoAction::Redo () TYPEINIT1(E3dAttributesUndoAction, SdrUndoAction); E3dAttributesUndoAction::E3dAttributesUndoAction( SdrModel &rModel, - E3dObject* pInObject, - const SfxItemSet& rNewSet, - const SfxItemSet& rOldSet) -: SdrUndoAction( rModel ), - pObject ( pInObject ), - aNewSet ( rNewSet ), - aOldSet ( rOldSet ) + E3dObject* pInObject, + const SfxItemSet& rNewSet, + const SfxItemSet& rOldSet) + : SdrUndoAction( rModel ) + , pObject ( pInObject ) + , aNewSet ( rNewSet ) + , aOldSet ( rOldSet ) { } @@ -105,9 +105,9 @@ void E3dAttributesUndoAction::Redo() // Multiple Undo is not possible -sal_Bool E3dAttributesUndoAction::CanRepeat(SfxRepeatTarget& /*rView*/) const +bool E3dAttributesUndoAction::CanRepeat(SfxRepeatTarget& /*rView*/) const { - return sal_False; + return false; } // Multiple Undo is not possible diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx index 86a9b256ebf0..91aebe7d1031 100644 --- a/svx/source/fmcomp/gridcell.cxx +++ b/svx/source/fmcomp/gridcell.cxx @@ -1442,7 +1442,7 @@ void DbFormattedField::Init( Window& rParent, const Reference< XRowSet >& xCurso } else { - String sConverted; + OUString sConverted; Color* pDummy; pFormatterUsed->GetOutputString(::comphelper::getDouble(aDefault), 0, sConverted, &pDummy); ((FormattedField*)m_pWindow)->SetDefaultText(sConverted); diff --git a/svx/source/items/numfmtsh.cxx b/svx/source/items/numfmtsh.cxx index ae6fbe7358d6..7a824d2f8f4b 100644 --- a/svx/source/items/numfmtsh.cxx +++ b/svx/source/items/numfmtsh.cxx @@ -456,8 +456,10 @@ void SvxNumberFormatShell::MakePreviewString( const String& rFormatStr, } else { + OUString sTemp(rPreviewStr); pFormatter->GetOutputString( nValNum, nExistingFormat, - rPreviewStr, &rpFontColor, bUseStarFormat ); + sTemp, &rpFontColor, bUseStarFormat ); + rPreviewStr = sTemp; } } } @@ -768,14 +770,14 @@ short SvxNumberFormatShell::FillEListWithCurrency_Impl( std::vector<String*>& rL const NfCurrencyEntry* pTmpCurrencyEntry; bool bTmpBanking; - XubString rSymbol; + OUString rSymbol; bool bFlag=pFormatter->GetNewCurrencySymbolString(nCurFormatKey,rSymbol, - &pTmpCurrencyEntry,&bTmpBanking); + &pTmpCurrencyEntry,&bTmpBanking); - if((!bFlag && pCurCurrencyEntry==NULL) || - (bFlag && pTmpCurrencyEntry==NULL && !rSymbol.Len()) || - nCurCategory==NUMBERFORMAT_ALL) + if( (!bFlag && pCurCurrencyEntry==NULL) || + (bFlag && pTmpCurrencyEntry==NULL && rSymbol.isEmpty()) || + (nCurCategory==NUMBERFORMAT_ALL)) { if ( nCurCategory == NUMBERFORMAT_ALL ) FillEListWithUserCurrencys(rList,nSelPos); @@ -855,10 +857,11 @@ short SvxNumberFormatShell::FillEListWithSysCurrencys( std::vector<String*>& rLi { const NfCurrencyEntry* pTmpCurrencyEntry; bool bTmpBanking; - XubString rSymbol; + OUString rSymbol; pFormatter->GetNewCurrencySymbolString(nKey,rSymbol, - &pTmpCurrencyEntry,&bTmpBanking); + &pTmpCurrencyEntry, + &bTmpBanking); bUserNewCurrency=(pTmpCurrencyEntry!=NULL); } @@ -896,19 +899,20 @@ short SvxNumberFormatShell::FillEListWithUserCurrencys( std::vector<String*>& rL DBG_ASSERT( pCurFmtTable != NULL, "Unbekanntes Zahlenformat!" ); String aStrComment; - String aNewFormNInfo; + OUString aNewFormNInfo; short nMyCat = SELPOS_NONE; const NfCurrencyEntry* pTmpCurrencyEntry; bool bTmpBanking, bAdaptSelPos; - XubString rSymbol; - XubString rBankSymbol; + OUString rSymbol; + OUString rBankSymbol; std::vector<String*> aList; std::vector<sal_uInt32> aKeyList; pFormatter->GetNewCurrencySymbolString(nCurFormatKey,rSymbol, - &pTmpCurrencyEntry,&bTmpBanking); + &pTmpCurrencyEntry, + &bTmpBanking); XubString rShortSymbol; @@ -919,9 +923,9 @@ short SvxNumberFormatShell::FillEListWithUserCurrencys( std::vector<String*>& rL // format (nCurFormatKey) that was set in FormatChanged() after // matching the format string entered in the dialog. bAdaptSelPos = true; - pCurCurrencyEntry=(NfCurrencyEntry*)pTmpCurrencyEntry; - bBankingSymbol=bTmpBanking; - nCurCurrencyEntryPos=FindCurrencyFormat(pTmpCurrencyEntry,bTmpBanking); + pCurCurrencyEntry = (NfCurrencyEntry*)pTmpCurrencyEntry; + bBankingSymbol = bTmpBanking; + nCurCurrencyEntryPos = FindCurrencyFormat(pTmpCurrencyEntry,bTmpBanking); } else { @@ -951,33 +955,35 @@ short SvxNumberFormatShell::FillEListWithUserCurrencys( std::vector<String*>& rL if ( !IsRemoved_Impl( nKey ) ) { if( pNumEntry->GetType() & NUMBERFORMAT_DEFINED || - pNumEntry->IsAdditionalStandardDefined() ) + pNumEntry->IsAdditionalStandardDefined() ) { nMyCat=pNumEntry->GetType() & ~NUMBERFORMAT_DEFINED; - aStrComment=pNumEntry->GetComment(); + aStrComment = pNumEntry->GetComment(); CategoryToPos_Impl(nMyCat,nMyType); - aNewFormNInfo= pNumEntry->GetFormatstring(); + aNewFormNInfo = pNumEntry->GetFormatstring(); bool bInsFlag = false; if ( pNumEntry->HasNewCurrency() ) { bInsFlag = true; // merge locale formats into currency selection } - else if( (!bTmpBanking && aNewFormNInfo.Search(rSymbol)!=STRING_NOTFOUND) || - (bTmpBanking && aNewFormNInfo.Search(rBankSymbol)!=STRING_NOTFOUND) ) + else if( (!bTmpBanking && aNewFormNInfo.indexOf(rSymbol) >= 0) || + (bTmpBanking && aNewFormNInfo.indexOf(rBankSymbol) >= 0) ) { bInsFlag = true; } - else if(aNewFormNInfo.Search(rShortSymbol)!=STRING_NOTFOUND) + else if(aNewFormNInfo.indexOf(rShortSymbol) >= 0) { - XubString rTstSymbol; + OUString rTstSymbol; const NfCurrencyEntry* pTstCurrencyEntry; bool bTstBanking; pFormatter->GetNewCurrencySymbolString(nKey,rTstSymbol, - &pTstCurrencyEntry,&bTstBanking); + &pTstCurrencyEntry, + &bTstBanking); - if(pTmpCurrencyEntry==pTstCurrencyEntry && bTstBanking==bTmpBanking) + if(pTmpCurrencyEntry == pTstCurrencyEntry && + bTstBanking == bTmpBanking) { bInsFlag = true; } @@ -1154,7 +1160,9 @@ void SvxNumberFormatShell::GetPreviewString_Impl( String& rString, Color*& rpCol } else { - pFormatter->GetOutputString( nValNum, nCurFormatKey, rString, &rpColor, bUseStarFormat ); + OUString sTemp(rString); + pFormatter->GetOutputString( nValNum, nCurFormatKey, sTemp, &rpColor, bUseStarFormat ); + rString = sTemp; } } diff --git a/svx/source/svdraw/sdrundomanager.cxx b/svx/source/svdraw/sdrundomanager.cxx index c28654cb924d..4f97225383bd 100644 --- a/svx/source/svdraw/sdrundomanager.cxx +++ b/svx/source/svdraw/sdrundomanager.cxx @@ -21,10 +21,10 @@ ////////////////////////////////////////////////////////////////////////////// SdrUndoManager::SdrUndoManager(sal_uInt16 nMaxUndoActionCount) -: EditUndoManager(nMaxUndoActionCount), - maEndTextEditHdl(), - mpLastUndoActionBeforeTextEdit(0), - mbEndTextEditTriggeredFromUndo(false) + : EditUndoManager(nMaxUndoActionCount) + , maEndTextEditHdl() + , mpLastUndoActionBeforeTextEdit(0) + , mbEndTextEditTriggeredFromUndo(false) { } @@ -32,11 +32,11 @@ SdrUndoManager::~SdrUndoManager() { } -sal_Bool SdrUndoManager::Undo() +bool SdrUndoManager::Undo() { if(isTextEditActive()) { - sal_Bool bRetval(sal_False); + bool bRetval(false); // we are in text edit mode if(GetUndoActionCount() && mpLastUndoActionBeforeTextEdit != GetUndoAction(0)) @@ -61,9 +61,9 @@ sal_Bool SdrUndoManager::Undo() } } -sal_Bool SdrUndoManager::Redo() +bool SdrUndoManager::Redo() { - sal_Bool bRetval(sal_False); + bool bRetval(false); if(isTextEditActive()) { diff --git a/svx/source/svdraw/svdundo.cxx b/svx/source/svdraw/svdundo.cxx index 4ff6730d8561..8cae9f4cbeb7 100644 --- a/svx/source/svdraw/svdundo.cxx +++ b/svx/source/svdraw/svdundo.cxx @@ -59,11 +59,11 @@ TYPEINIT1(SdrUndoAction,SfxUndoAction); SdrUndoAction::~SdrUndoAction() {} -sal_Bool SdrUndoAction::CanRepeat(SfxRepeatTarget& rView) const +bool SdrUndoAction::CanRepeat(SfxRepeatTarget& rView) const { SdrView* pV=PTR_CAST(SdrView,&rView); if (pV!=NULL) return CanSdrRepeat(*pV); - return sal_False; + return false; } void SdrUndoAction::Repeat(SfxRepeatTarget& rView) @@ -145,48 +145,50 @@ OUString SdrUndoGroup::GetComment() const bool SdrUndoGroup::CanSdrRepeat(SdrView& rView) const { - switch (eFunction) { - case SDRREPFUNC_OBJ_NONE : return sal_False; - case SDRREPFUNC_OBJ_DELETE : return rView.AreObjectsMarked(); - case SDRREPFUNC_OBJ_COMBINE_POLYPOLY: return rView.IsCombinePossible(sal_False); - case SDRREPFUNC_OBJ_COMBINE_ONEPOLY : return rView.IsCombinePossible(sal_True); - case SDRREPFUNC_OBJ_DISMANTLE_POLYS : return rView.IsDismantlePossible(sal_False); - case SDRREPFUNC_OBJ_DISMANTLE_LINES : return rView.IsDismantlePossible(sal_True); - case SDRREPFUNC_OBJ_CONVERTTOPOLY : return rView.IsConvertToPolyObjPossible(sal_False); - case SDRREPFUNC_OBJ_CONVERTTOPATH : return rView.IsConvertToPathObjPossible(sal_False); - case SDRREPFUNC_OBJ_GROUP : return rView.IsGroupPossible(); - case SDRREPFUNC_OBJ_UNGROUP : return rView.IsUnGroupPossible(); - case SDRREPFUNC_OBJ_PUTTOTOP : return rView.IsToTopPossible(); - case SDRREPFUNC_OBJ_PUTTOBTM : return rView.IsToBtmPossible(); - case SDRREPFUNC_OBJ_MOVTOTOP : return rView.IsToTopPossible(); - case SDRREPFUNC_OBJ_MOVTOBTM : return rView.IsToBtmPossible(); - case SDRREPFUNC_OBJ_REVORDER : return rView.IsReverseOrderPossible(); - case SDRREPFUNC_OBJ_IMPORTMTF : return rView.IsImportMtfPossible(); - default: break; + switch (eFunction) + { + case SDRREPFUNC_OBJ_NONE : return false; + case SDRREPFUNC_OBJ_DELETE : return rView.AreObjectsMarked(); + case SDRREPFUNC_OBJ_COMBINE_POLYPOLY: return rView.IsCombinePossible(sal_False); + case SDRREPFUNC_OBJ_COMBINE_ONEPOLY : return rView.IsCombinePossible(sal_True); + case SDRREPFUNC_OBJ_DISMANTLE_POLYS : return rView.IsDismantlePossible(sal_False); + case SDRREPFUNC_OBJ_DISMANTLE_LINES : return rView.IsDismantlePossible(sal_True); + case SDRREPFUNC_OBJ_CONVERTTOPOLY : return rView.IsConvertToPolyObjPossible(sal_False); + case SDRREPFUNC_OBJ_CONVERTTOPATH : return rView.IsConvertToPathObjPossible(sal_False); + case SDRREPFUNC_OBJ_GROUP : return rView.IsGroupPossible(); + case SDRREPFUNC_OBJ_UNGROUP : return rView.IsUnGroupPossible(); + case SDRREPFUNC_OBJ_PUTTOTOP : return rView.IsToTopPossible(); + case SDRREPFUNC_OBJ_PUTTOBTM : return rView.IsToBtmPossible(); + case SDRREPFUNC_OBJ_MOVTOTOP : return rView.IsToTopPossible(); + case SDRREPFUNC_OBJ_MOVTOBTM : return rView.IsToBtmPossible(); + case SDRREPFUNC_OBJ_REVORDER : return rView.IsReverseOrderPossible(); + case SDRREPFUNC_OBJ_IMPORTMTF : return rView.IsImportMtfPossible(); + default: break; } // switch - return sal_False; + return false; } void SdrUndoGroup::SdrRepeat(SdrView& rView) { - switch (eFunction) { - case SDRREPFUNC_OBJ_NONE : break; - case SDRREPFUNC_OBJ_DELETE : rView.DeleteMarked(); break; - case SDRREPFUNC_OBJ_COMBINE_POLYPOLY: rView.CombineMarkedObjects(sal_False); break; - case SDRREPFUNC_OBJ_COMBINE_ONEPOLY : rView.CombineMarkedObjects(sal_True); break; - case SDRREPFUNC_OBJ_DISMANTLE_POLYS : rView.DismantleMarkedObjects(sal_False); break; - case SDRREPFUNC_OBJ_DISMANTLE_LINES : rView.DismantleMarkedObjects(sal_True); break; - case SDRREPFUNC_OBJ_CONVERTTOPOLY : rView.ConvertMarkedToPolyObj(sal_False); break; - case SDRREPFUNC_OBJ_CONVERTTOPATH : rView.ConvertMarkedToPathObj(sal_False); break; - case SDRREPFUNC_OBJ_GROUP : rView.GroupMarked(); break; - case SDRREPFUNC_OBJ_UNGROUP : rView.UnGroupMarked(); break; - case SDRREPFUNC_OBJ_PUTTOTOP : rView.PutMarkedToTop(); break; - case SDRREPFUNC_OBJ_PUTTOBTM : rView.PutMarkedToBtm(); break; - case SDRREPFUNC_OBJ_MOVTOTOP : rView.MovMarkedToTop(); break; - case SDRREPFUNC_OBJ_MOVTOBTM : rView.MovMarkedToBtm(); break; - case SDRREPFUNC_OBJ_REVORDER : rView.ReverseOrderOfMarked(); break; - case SDRREPFUNC_OBJ_IMPORTMTF : rView.DoImportMarkedMtf(); break; - default: break; + switch (eFunction) + { + case SDRREPFUNC_OBJ_NONE : break; + case SDRREPFUNC_OBJ_DELETE : rView.DeleteMarked(); break; + case SDRREPFUNC_OBJ_COMBINE_POLYPOLY: rView.CombineMarkedObjects(sal_False); break; + case SDRREPFUNC_OBJ_COMBINE_ONEPOLY : rView.CombineMarkedObjects(sal_True); break; + case SDRREPFUNC_OBJ_DISMANTLE_POLYS : rView.DismantleMarkedObjects(sal_False); break; + case SDRREPFUNC_OBJ_DISMANTLE_LINES : rView.DismantleMarkedObjects(sal_True); break; + case SDRREPFUNC_OBJ_CONVERTTOPOLY : rView.ConvertMarkedToPolyObj(sal_False); break; + case SDRREPFUNC_OBJ_CONVERTTOPATH : rView.ConvertMarkedToPathObj(sal_False); break; + case SDRREPFUNC_OBJ_GROUP : rView.GroupMarked(); break; + case SDRREPFUNC_OBJ_UNGROUP : rView.UnGroupMarked(); break; + case SDRREPFUNC_OBJ_PUTTOTOP : rView.PutMarkedToTop(); break; + case SDRREPFUNC_OBJ_PUTTOBTM : rView.PutMarkedToBtm(); break; + case SDRREPFUNC_OBJ_MOVTOTOP : rView.MovMarkedToTop(); break; + case SDRREPFUNC_OBJ_MOVTOBTM : rView.MovMarkedToBtm(); break; + case SDRREPFUNC_OBJ_REVORDER : rView.ReverseOrderOfMarked(); break; + case SDRREPFUNC_OBJ_IMPORTMTF : rView.DoImportMarkedMtf(); break; + default: break; } // switch } @@ -195,9 +197,9 @@ OUString SdrUndoGroup::GetSdrRepeatComment(SdrView& /*rView*/) const return aComment.replaceAll("%1", ImpGetResStr(STR_ObjNameSingulPlural)); } -SdrUndoObj::SdrUndoObj(SdrObject& rNewObj): - SdrUndoAction(*rNewObj.GetModel()), - pObj(&rNewObj) +SdrUndoObj::SdrUndoObj(SdrObject& rNewObj) + : SdrUndoAction(*rNewObj.GetModel()) + , pObj(&rNewObj) { } @@ -263,19 +265,16 @@ void SdrUndoAttrObj::ensureStyleSheetInStyleSheetPool(SfxStyleSheetBasePool& rSt } SdrUndoAttrObj::SdrUndoAttrObj(SdrObject& rNewObj, bool bStyleSheet1, bool bSaveText) -: SdrUndoObj(rNewObj), - pUndoSet(NULL), - pRedoSet(NULL), - pRepeatSet(NULL), - mxUndoStyleSheet(), - mxRedoStyleSheet(), - bHaveToTakeRedoSet(sal_True), - pTextUndo(NULL), - - // #i8508# - pTextRedo(NULL), - - pUndoGroup(NULL) + : SdrUndoObj(rNewObj) + , pUndoSet(NULL) + , pRedoSet(NULL) + , pRepeatSet(NULL) + , mxUndoStyleSheet() + , mxRedoStyleSheet() + , bHaveToTakeRedoSet(sal_True) + , pTextUndo(NULL) + , pTextRedo(NULL) + , pUndoGroup(NULL) { bStyleSheet = bStyleSheet1; @@ -319,8 +318,6 @@ SdrUndoAttrObj::~SdrUndoAttrObj() delete pRepeatSet; delete pUndoGroup; delete pTextUndo; - - // #i8508# delete pTextRedo; } @@ -603,11 +600,11 @@ OUString SdrUndoMoveObj::GetSdrRepeatComment(SdrView& /*rView*/) const //////////////////////////////////////////////////////////////////////////////////////////////////// -SdrUndoGeoObj::SdrUndoGeoObj(SdrObject& rNewObj): - SdrUndoObj(rNewObj), - pUndoGeo(NULL), - pRedoGeo(NULL), - pUndoGroup(NULL) +SdrUndoGeoObj::SdrUndoGeoObj(SdrObject& rNewObj) + : SdrUndoObj(rNewObj) + , pUndoGeo(NULL) + , pRedoGeo(NULL) + , pUndoGroup(NULL) { SdrObjList* pOL=rNewObj.GetSubList(); if (pOL!=NULL && pOL->GetObjCount() && !rNewObj.ISA(E3dScene)) @@ -620,7 +617,9 @@ SdrUndoGeoObj::SdrUndoGeoObj(SdrObject& rNewObj): for (sal_uIntPtr nObjNum=0; nObjNum<nObjAnz; nObjNum++) { pUndoGroup->AddAction(new SdrUndoGeoObj(*pOL->GetObj(nObjNum))); } - } else { + } + else + { pUndoGeo=pObj->GetGeoData(); } } @@ -719,40 +718,43 @@ void SdrUndoObjList::ObjListListener::Notify(SfxBroadcaster&, const SfxHint& rHi { switch (pSdrHint->GetKind()) { - case HINT_OBJCHG : - if (IsListening(*m_pBroadcaster)) - { - const sal_uInt32 nNewOrdNum(m_rObject.GetOrdNum()); - if (nNewOrdNum != m_rThat.GetOrdNum()) - m_rThat.SetOrdNum(nNewOrdNum); - } - break; - case HINT_OBJREMOVED : - SAL_WARN_IF(!IsListening(*m_pBroadcaster), "svx.sdr", "Object is not in any list"); - EndListening(*m_pBroadcaster); - break; - case HINT_OBJINSERTED : - SAL_WARN_IF(IsListening(*m_pBroadcaster), "svx.sdr", "Object is already in a list"); - StartListening(*m_pBroadcaster); - break; - default : - break; + case HINT_OBJCHG : + if (IsListening(*m_pBroadcaster)) + { + const sal_uInt32 nNewOrdNum(m_rObject.GetOrdNum()); + if (nNewOrdNum != m_rThat.GetOrdNum()) + m_rThat.SetOrdNum(nNewOrdNum); + } + break; + case HINT_OBJREMOVED : + SAL_WARN_IF(!IsListening(*m_pBroadcaster), "svx.sdr", "Object is not in any list"); + EndListening(*m_pBroadcaster); + break; + case HINT_OBJINSERTED : + SAL_WARN_IF(IsListening(*m_pBroadcaster), "svx.sdr", "Object is already in a list"); + StartListening(*m_pBroadcaster); + break; + default : + break; } } } } SdrUndoObjList::SdrUndoObjList(SdrObject& rNewObj, bool bOrdNumDirect) -: SdrUndoObj(rNewObj), - bOwner(sal_False), - pView(NULL), - pPageView(NULL), - m_pListener(NULL) + : SdrUndoObj(rNewObj) + , bOwner(sal_False) + , pView(NULL) + , pPageView(NULL) + , m_pListener(NULL) { pObjList=pObj->GetObjList(); - if (bOrdNumDirect) { + if (bOrdNumDirect) + { nOrdNum=pObj->GetOrdNumDirect(); - } else { + } + else + { nOrdNum=pObj->GetOrdNum(); } @@ -803,9 +805,9 @@ void SdrUndoRemoveObj::Undo() // position of the target object. Point aOwnerAnchorPos(0, 0); - if(pObjList - && pObjList->GetOwnerObj() - && pObjList->GetOwnerObj()->ISA(SdrObjGroup)) + if(pObjList && + pObjList->GetOwnerObj() && + pObjList->GetOwnerObj()->ISA(SdrObjGroup)) { aOwnerAnchorPos = pObjList->GetOwnerObj()->GetAnchorPos(); } @@ -957,17 +959,20 @@ OUString SdrUndoNewObj::GetComment() const } SdrUndoReplaceObj::SdrUndoReplaceObj(SdrObject& rOldObj1, SdrObject& rNewObj1, bool bOrdNumDirect) -: SdrUndoObj(rOldObj1), - bOldOwner(sal_False), - bNewOwner(sal_False), - pNewObj(&rNewObj1) + : SdrUndoObj(rOldObj1) + , bOldOwner(sal_False) + , bNewOwner(sal_False) + , pNewObj(&rNewObj1) { SetOldOwner(sal_True); pObjList=pObj->GetObjList(); - if (bOrdNumDirect) { + if (bOrdNumDirect) + { nOrdNum=pObj->GetOrdNumDirect(); - } else { + } + else + { nOrdNum=pObj->GetOrdNum(); } } @@ -1058,9 +1063,9 @@ OUString SdrUndoCopyObj::GetComment() const // #i11702# SdrUndoObjectLayerChange::SdrUndoObjectLayerChange(SdrObject& rObj, SdrLayerID aOldLayer, SdrLayerID aNewLayer) -: SdrUndoObj(rObj), - maOldLayer(aOldLayer), - maNewLayer(aNewLayer) + : SdrUndoObj(rObj) + , maOldLayer(aOldLayer) + , maNewLayer(aNewLayer) { } @@ -1078,10 +1083,10 @@ void SdrUndoObjectLayerChange::Redo() //////////////////////////////////////////////////////////////////////////////////////////////////// -SdrUndoObjOrdNum::SdrUndoObjOrdNum(SdrObject& rNewObj, sal_uInt32 nOldOrdNum1, sal_uInt32 nNewOrdNum1): - SdrUndoObj(rNewObj), - nOldOrdNum(nOldOrdNum1), - nNewOrdNum(nNewOrdNum1) +SdrUndoObjOrdNum::SdrUndoObjOrdNum(SdrObject& rNewObj, sal_uInt32 nOldOrdNum1, sal_uInt32 nNewOrdNum1) + : SdrUndoObj(rNewObj) + , nOldOrdNum(nOldOrdNum1) + , nNewOrdNum(nNewOrdNum1) { } @@ -1091,7 +1096,8 @@ void SdrUndoObjOrdNum::Undo() ImpShowPageOfThisObject(); SdrObjList* pOL=pObj->GetObjList(); - if (pOL==NULL) { + if (pOL==NULL) + { OSL_FAIL("UndoObjOrdNum: pObj does not have an ObjList."); return; } @@ -1101,7 +1107,8 @@ void SdrUndoObjOrdNum::Undo() void SdrUndoObjOrdNum::Redo() { SdrObjList* pOL=pObj->GetObjList(); - if (pOL==NULL) { + if (pOL==NULL) + { OSL_FAIL("RedoObjOrdNum: pObj does not have an ObjList."); return; } @@ -1121,12 +1128,12 @@ OUString SdrUndoObjOrdNum::GetComment() const //////////////////////////////////////////////////////////////////////////////////////////////////// SdrUndoObjSetText::SdrUndoObjSetText(SdrObject& rNewObj, sal_Int32 nText) -: SdrUndoObj(rNewObj) -, pOldText(NULL) -, pNewText(NULL) -, bNewTextAvailable(sal_False) -, bEmptyPresObj(sal_False) -, mnText(nText) + : SdrUndoObj(rNewObj) + , pOldText(NULL) + , pNewText(NULL) + , bNewTextAvailable(sal_False) + , bEmptyPresObj(sal_False) + , mnText(nText) { SdrText* pText = static_cast< SdrTextObj*>( &rNewObj )->getText(mnText); if( pText && pText->GetOutlinerParaObject() ) @@ -1263,10 +1270,10 @@ SdrUndoObjStrAttr::SdrUndoObjStrAttr( SdrObject& rNewObj, const ObjStrAttrType eObjStrAttr, const String& sOldStr, const String& sNewStr) - : SdrUndoObj( rNewObj ), - meObjStrAttr( eObjStrAttr ), - msOldStr( sOldStr ), - msNewStr( sNewStr ) + : SdrUndoObj( rNewObj ) + , meObjStrAttr( eObjStrAttr ) + , msOldStr( sOldStr ) + , msNewStr( sNewStr ) { } @@ -1276,20 +1283,14 @@ void SdrUndoObjStrAttr::Undo() switch ( meObjStrAttr ) { - case OBJ_NAME: - { - pObj->SetName( msOldStr ); - } + case OBJ_NAME: + pObj->SetName( msOldStr ); break; - case OBJ_TITLE: - { - pObj->SetTitle( msOldStr ); - } + case OBJ_TITLE: + pObj->SetTitle( msOldStr ); break; - case OBJ_DESCRIPTION: - { - pObj->SetDescription( msOldStr ); - } + case OBJ_DESCRIPTION: + pObj->SetDescription( msOldStr ); break; } } @@ -1298,20 +1299,14 @@ void SdrUndoObjStrAttr::Redo() { switch ( meObjStrAttr ) { - case OBJ_NAME: - { - pObj->SetName( msNewStr ); - } + case OBJ_NAME: + pObj->SetName( msNewStr ); break; - case OBJ_TITLE: - { - pObj->SetTitle( msNewStr ); - } + case OBJ_TITLE: + pObj->SetTitle( msNewStr ); break; - case OBJ_DESCRIPTION: - { - pObj->SetDescription( msNewStr ); - } + case OBJ_DESCRIPTION: + pObj->SetDescription( msNewStr ); break; } @@ -1323,24 +1318,18 @@ OUString SdrUndoObjStrAttr::GetComment() const String aStr; switch ( meObjStrAttr ) { - case OBJ_NAME: - { - ImpTakeDescriptionStr( STR_UndoObjName, aStr ); - aStr += sal_Unicode(' '); - aStr += sal_Unicode('\''); - aStr += msNewStr; - aStr += sal_Unicode('\''); - } + case OBJ_NAME: + ImpTakeDescriptionStr( STR_UndoObjName, aStr ); + aStr += sal_Unicode(' '); + aStr += sal_Unicode('\''); + aStr += msNewStr; + aStr += sal_Unicode('\''); break; - case OBJ_TITLE: - { - ImpTakeDescriptionStr( STR_UndoObjTitle, aStr ); - } + case OBJ_TITLE: + ImpTakeDescriptionStr( STR_UndoObjTitle, aStr ); break; - case OBJ_DESCRIPTION: - { - ImpTakeDescriptionStr( STR_UndoObjDescription, aStr ); - } + case OBJ_DESCRIPTION: + ImpTakeDescriptionStr( STR_UndoObjDescription, aStr ); break; } @@ -1348,18 +1337,19 @@ OUString SdrUndoObjStrAttr::GetComment() const } -SdrUndoLayer::SdrUndoLayer(sal_uInt16 nLayerNum, SdrLayerAdmin& rNewLayerAdmin, SdrModel& rNewModel): - SdrUndoAction(rNewModel), - pLayer(rNewLayerAdmin.GetLayer(nLayerNum)), - pLayerAdmin(&rNewLayerAdmin), - nNum(nLayerNum), - bItsMine(sal_False) +SdrUndoLayer::SdrUndoLayer(sal_uInt16 nLayerNum, SdrLayerAdmin& rNewLayerAdmin, SdrModel& rNewModel) + : SdrUndoAction(rNewModel) + , pLayer(rNewLayerAdmin.GetLayer(nLayerNum)) + , pLayerAdmin(&rNewLayerAdmin) + , nNum(nLayerNum) + , bItsMine(sal_False) { } SdrUndoLayer::~SdrUndoLayer() { - if (bItsMine) { + if (bItsMine) + { delete pLayer; } } @@ -1443,18 +1433,22 @@ OUString SdrUndoMoveLayer::GetComment() const SdrUndoPage::SdrUndoPage(SdrPage& rNewPg) -: SdrUndoAction(*rNewPg.GetModel()), - mrPage(rNewPg) + : SdrUndoAction(*rNewPg.GetModel()) + , mrPage(rNewPg) { } void SdrUndoPage::ImpInsertPage(sal_uInt16 nNum) { DBG_ASSERT(!mrPage.IsInserted(),"SdrUndoPage::ImpInsertPage(): mrPage is already inserted."); - if (!mrPage.IsInserted()) { - if (mrPage.IsMasterPage()) { + if (!mrPage.IsInserted()) + { + if (mrPage.IsMasterPage()) + { rMod.InsertMasterPage(&mrPage,nNum); - } else { + } + else + { rMod.InsertPage(&mrPage,nNum); } } @@ -1463,11 +1457,15 @@ void SdrUndoPage::ImpInsertPage(sal_uInt16 nNum) void SdrUndoPage::ImpRemovePage(sal_uInt16 nNum) { DBG_ASSERT(mrPage.IsInserted(),"SdrUndoPage::ImpRemovePage(): mrPage is not inserted."); - if (mrPage.IsInserted()) { + if (mrPage.IsInserted()) + { SdrPage* pChkPg=NULL; - if (mrPage.IsMasterPage()) { + if (mrPage.IsMasterPage()) + { pChkPg=rMod.RemoveMasterPage(nNum); - } else { + } + else + { pChkPg=rMod.RemovePage(nNum); } DBG_ASSERT(pChkPg==&mrPage,"SdrUndoPage::ImpRemovePage(): RemovePage!=&mrPage"); @@ -1478,10 +1476,14 @@ void SdrUndoPage::ImpRemovePage(sal_uInt16 nNum) void SdrUndoPage::ImpMovePage(sal_uInt16 nOldNum, sal_uInt16 nNewNum) { DBG_ASSERT(mrPage.IsInserted(),"SdrUndoPage::ImpMovePage(): mrPage is not inserted."); - if (mrPage.IsInserted()) { - if (mrPage.IsMasterPage()) { + if (mrPage.IsInserted()) + { + if (mrPage.IsMasterPage()) + { rMod.MoveMasterPage(nOldNum,nNewNum); - } else { + } + else + { rMod.MovePage(nOldNum,nNewNum); } } @@ -1494,9 +1496,9 @@ void SdrUndoPage::ImpTakeDescriptionStr(sal_uInt16 nStrCacheID, XubString& rStr, //////////////////////////////////////////////////////////////////////////////////////////////////// -SdrUndoPageList::SdrUndoPageList(SdrPage& rNewPg): - SdrUndoPage(rNewPg), - bItsMine(sal_False) +SdrUndoPageList::SdrUndoPageList(SdrPage& rNewPg) + : SdrUndoPage(rNewPg) + , bItsMine(sal_False) { nPageNum=rNewPg.GetPageNum(); } @@ -1511,9 +1513,9 @@ SdrUndoPageList::~SdrUndoPageList() //////////////////////////////////////////////////////////////////////////////////////////////////// -SdrUndoDelPage::SdrUndoDelPage(SdrPage& rNewPg): - SdrUndoPageList(rNewPg), - pUndoGroup(NULL) +SdrUndoDelPage::SdrUndoDelPage(SdrPage& rNewPg) + : SdrUndoPageList(rNewPg) + , pUndoGroup(NULL) { bItsMine = sal_True; @@ -1552,7 +1554,9 @@ SdrUndoDelPage::~SdrUndoDelPage() void SdrUndoDelPage::Undo() { ImpInsertPage(nPageNum); - if (pUndoGroup!=NULL) { // recover master page relationships + if (pUndoGroup!=NULL) + { + // recover master page relationships pUndoGroup->Undo(); } DBG_ASSERT(bItsMine,"UndoDeletePage: mrPage does not belong to UndoAction."); diff --git a/svx/source/table/tableundo.cxx b/svx/source/table/tableundo.cxx index e889427ef354..aee0012abef3 100644 --- a/svx/source/table/tableundo.cxx +++ b/svx/source/table/tableundo.cxx @@ -38,10 +38,10 @@ using namespace ::com::sun::star::table; namespace sdr { namespace table { CellUndo::CellUndo( const SdrObjectWeakRef& xObjRef, const CellRef& xCell ) -: SdrUndoAction( *xCell->GetModel() ) -, mxObjRef( xObjRef ) -, mxCell( xCell ) -, mbUndo( true ) + : SdrUndoAction( *xCell->GetModel() ) + , mxObjRef( xObjRef ) + , mxCell( xCell ) + , mbUndo( true ) { if( mxCell.is() && mxObjRef.is() ) { @@ -96,16 +96,16 @@ void CellUndo::Redo() } } -sal_Bool CellUndo::Merge( SfxUndoAction *pNextAction ) +bool CellUndo::Merge( SfxUndoAction *pNextAction ) { CellUndo* pNext = dynamic_cast< CellUndo* >( pNextAction ); if( pNext && pNext->mxCell.get() == mxCell.get() ) { - return sal_True; + return true; } else { - return sal_False; + return false; } } @@ -170,10 +170,10 @@ static void Dispose( RowVector& rRows ) // ----------------------------------------------------------------------------- InsertRowUndo::InsertRowUndo( const TableModelRef& xTable, sal_Int32 nIndex, RowVector& aNewRows ) -: SdrUndoAction( *xTable->getSdrTableObj()->GetModel() ) -, mxTable( xTable ) -, mnIndex( nIndex ) -, mbUndo( true ) + : SdrUndoAction( *xTable->getSdrTableObj()->GetModel() ) + , mxTable( xTable ) + , mnIndex( nIndex ) + , mbUndo( true ) { maRows.swap( aNewRows ); } @@ -213,10 +213,10 @@ void InsertRowUndo::Redo() // ----------------------------------------------------------------------------- RemoveRowUndo::RemoveRowUndo( const TableModelRef& xTable, sal_Int32 nIndex, RowVector& aRemovedRows ) -: SdrUndoAction( *xTable->getSdrTableObj()->GetModel() ) -, mxTable( xTable ) -, mnIndex( nIndex ) -, mbUndo( true ) + : SdrUndoAction( *xTable->getSdrTableObj()->GetModel() ) + , mxTable( xTable ) + , mnIndex( nIndex ) + , mbUndo( true ) { maRows.swap( aRemovedRows ); } @@ -274,10 +274,10 @@ static void Dispose( CellVector& rCells ) // ----------------------------------------------------------------------------- InsertColUndo::InsertColUndo( const TableModelRef& xTable, sal_Int32 nIndex, ColumnVector& aNewCols, CellVector& aCells ) -: SdrUndoAction( *xTable->getSdrTableObj()->GetModel() ) -, mxTable( xTable ) -, mnIndex( nIndex ) -, mbUndo( true ) + : SdrUndoAction( *xTable->getSdrTableObj()->GetModel() ) + , mxTable( xTable ) + , mnIndex( nIndex ) + , mbUndo( true ) { maColumns.swap( aNewCols ); maCells.swap( aCells ); @@ -321,10 +321,10 @@ void InsertColUndo::Redo() // ----------------------------------------------------------------------------- RemoveColUndo::RemoveColUndo( const TableModelRef& xTable, sal_Int32 nIndex, ColumnVector& aNewCols, CellVector& aCells ) -: SdrUndoAction( *xTable->getSdrTableObj()->GetModel() ) -, mxTable( xTable ) -, mnIndex( nIndex ) -, mbUndo( true ) + : SdrUndoAction( *xTable->getSdrTableObj()->GetModel() ) + , mxTable( xTable ) + , mnIndex( nIndex ) + , mbUndo( true ) { maColumns.swap( aNewCols ); maCells.swap( aCells ); @@ -368,9 +368,9 @@ void RemoveColUndo::Redo() // ----------------------------------------------------------------------------- TableColumnUndo::TableColumnUndo( const TableColumnRef& xCol ) -: SdrUndoAction( *xCol->mxTableModel->getSdrTableObj()->GetModel() ) -, mxCol( xCol ) -, mbHasRedoData( false ) + : SdrUndoAction( *xCol->mxTableModel->getSdrTableObj()->GetModel() ) + , mxCol( xCol ) + , mbHasRedoData( false ) { getData( maUndoData ); } @@ -402,7 +402,7 @@ void TableColumnUndo::Redo() // ----------------------------------------------------------------------------- -sal_Bool TableColumnUndo::Merge( SfxUndoAction *pNextAction ) +bool TableColumnUndo::Merge( SfxUndoAction *pNextAction ) { TableColumnUndo* pNext = dynamic_cast< TableColumnUndo* >( pNextAction ); return pNext && pNext->mxCol == mxCol; @@ -437,9 +437,9 @@ void TableColumnUndo::getData( Data& rData ) // ----------------------------------------------------------------------------- TableRowUndo::TableRowUndo( const TableRowRef& xRow ) -: SdrUndoAction( *xRow->mxTableModel->getSdrTableObj()->GetModel() ) -, mxRow( xRow ) -, mbHasRedoData( false ) + : SdrUndoAction( *xRow->mxTableModel->getSdrTableObj()->GetModel() ) + , mxRow( xRow ) + , mbHasRedoData( false ) { getData( maUndoData ); } @@ -471,7 +471,7 @@ void TableRowUndo::Redo() // ----------------------------------------------------------------------------- -sal_Bool TableRowUndo::Merge( SfxUndoAction *pNextAction ) +bool TableRowUndo::Merge( SfxUndoAction *pNextAction ) { TableRowUndo* pNext = dynamic_cast< TableRowUndo* >( pNextAction ); return pNext && pNext->mxRow == mxRow; @@ -504,8 +504,8 @@ void TableRowUndo::getData( Data& rData ) // ----------------------------------------------------------------------------- TableStyleUndo::TableStyleUndo( const SdrTableObj& rTableObj ) -: SdrUndoAction( *rTableObj.GetModel() ) -, mxObjRef( const_cast< sdr::table::SdrTableObj*>( &rTableObj ) ) + : SdrUndoAction( *rTableObj.GetModel() ) + , mxObjRef( const_cast< sdr::table::SdrTableObj*>( &rTableObj ) ) { getData( maUndoData ); } diff --git a/svx/source/table/tableundo.hxx b/svx/source/table/tableundo.hxx index 4f816a477650..2e32abab1f98 100644 --- a/svx/source/table/tableundo.hxx +++ b/svx/source/table/tableundo.hxx @@ -47,7 +47,7 @@ public: virtual void Undo(); virtual void Redo(); - virtual sal_Bool Merge( SfxUndoAction *pNextAction ); + virtual bool Merge( SfxUndoAction *pNextAction ); void dispose(); virtual void ObjectInDestruction(const SdrObject& rObject); @@ -164,7 +164,7 @@ public: virtual void Undo(); virtual void Redo(); - virtual sal_Bool Merge( SfxUndoAction *pNextAction ); + virtual bool Merge( SfxUndoAction *pNextAction ); private: struct Data @@ -196,7 +196,7 @@ public: virtual void Undo(); virtual void Redo(); - virtual sal_Bool Merge( SfxUndoAction *pNextAction ); + virtual bool Merge( SfxUndoAction *pNextAction ); private: struct Data |