diff options
author | Ivan Timofeev <timofeev.i.s@gmail.com> | 2012-09-02 16:05:21 +0400 |
---|---|---|
committer | Ivan Timofeev <timofeev.i.s@gmail.com> | 2012-09-02 16:42:18 +0400 |
commit | 35e13d1f5403076c752879ecbe17b2f451b188d9 (patch) | |
tree | 4ac06aa67fbc564747b26d86aae68bbf87abc880 | |
parent | 3e317451e319734d7e45cc431bd4b68ffe1a08f6 (diff) |
expand ACT_KONTEXT and MV_KONTEXT macros, rename kontext to context
Change-Id: I7783e60cc048dfbd99976881afca317ad1326d66
-rw-r--r-- | sw/inc/editsh.hxx | 17 | ||||
-rw-r--r-- | sw/source/core/edit/edws.cxx | 14 | ||||
-rw-r--r-- | sw/source/ui/docvw/edtwin.cxx | 10 | ||||
-rw-r--r-- | sw/source/ui/shells/basesh.cxx | 2 | ||||
-rw-r--r-- | sw/source/ui/uiview/viewmdi.cxx | 4 | ||||
-rw-r--r-- | sw/source/ui/wrtsh/delete.cxx | 18 | ||||
-rw-r--r-- | sw/source/ui/wrtsh/move.cxx | 2 | ||||
-rw-r--r-- | sw/source/ui/wrtsh/select.cxx | 26 | ||||
-rw-r--r-- | sw/source/ui/wrtsh/wrtsh1.cxx | 8 |
9 files changed, 46 insertions, 55 deletions
diff --git a/sw/inc/editsh.hxx b/sw/inc/editsh.hxx index 012290069612..58d8befd6231 100644 --- a/sw/inc/editsh.hxx +++ b/sw/inc/editsh.hxx @@ -968,26 +968,21 @@ inline const sfx2::LinkManager& SwEditShell::GetLinkManager() const { return ((SwEditShell*)this)->GetLinkManager(); } /// Class for automated call of Start- and EndAction(). -class SwActKontext { +class SwActContext { SwEditShell *pSh; public: - SwActKontext(SwEditShell *pShell); - ~SwActKontext(); + SwActContext(SwEditShell *pShell); + ~SwActContext(); }; -#define ACT_KONTEXT(x) SwActKontext _aActKontext_(x) - /// Class for automated call of Start- and EndCrsrMove(). -class SwMvKontext { +class SwMvContext { SwEditShell *pSh; public: - SwMvKontext(SwEditShell *pShell ); - ~SwMvKontext(); + SwMvContext(SwEditShell *pShell); + ~SwMvContext(); }; -#define MV_KONTEXT(x) SwMvKontext _aMvKontext_(x) - - #endif diff --git a/sw/source/core/edit/edws.cxx b/sw/source/core/edit/edws.cxx index 4f267fe087dc..018e275006ba 100644 --- a/sw/source/core/edit/edws.cxx +++ b/sw/source/core/edit/edws.cxx @@ -206,31 +206,27 @@ sal_Bool SwEditShell::HasOtherCnt() const ******************************************************************************/ -SwActKontext::SwActKontext(SwEditShell *pShell) +SwActContext::SwActContext(SwEditShell *pShell) : pSh(pShell) { pSh->StartAction(); } -SwActKontext::~SwActKontext() +SwActContext::~SwActContext() { pSh->EndAction(); } -/****************************************************************************** - * Klasse fuer den automatisierten Aufruf von Start- und - * EndCrsrMove(); - ******************************************************************************/ - -SwMvKontext::SwMvKontext(SwEditShell *pShell ) : pSh(pShell) +SwMvContext::SwMvContext(SwEditShell *pShell) + : pSh(pShell) { pSh->SttCrsrMove(); } -SwMvKontext::~SwMvKontext() +SwMvContext::~SwMvContext() { pSh->EndCrsrMove(); } diff --git a/sw/source/ui/docvw/edtwin.cxx b/sw/source/ui/docvw/edtwin.cxx index 777f072d3f0d..812d7bd8af28 100644 --- a/sw/source/ui/docvw/edtwin.cxx +++ b/sw/source/ui/docvw/edtwin.cxx @@ -3435,7 +3435,7 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) { // only temporary generate Move-Kontext because otherwise // the query to the content form doesn't work!!! - MV_KONTEXT( &rSh ); + SwMvContext aMvContext( &rSh ); nTmpSetCrsr = rSh.SetCursor(&aDocPos, bOnlyText); bValidCrsrPos = !(CRSR_POSCHG & nTmpSetCrsr); bCallBase = sal_False; @@ -3459,7 +3459,7 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) nSelType & nsSelectionType::SEL_GRF || rSh.IsObjSelectable( aDocPos ) ) { - MV_KONTEXT( &rSh ); + SwMvContext aMvContext( &rSh ); if( !rSh.IsFrmSelected() ) rSh.GotoNextFly(); rSh.EnterSelFrmMode(); @@ -4210,7 +4210,7 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt) bNoInterrupt = sal_False; { // create only temporary move context because otherwise // the query to the content form doesn't work!!! - MV_KONTEXT( &rSh ); + SwMvContext aMvContext( &rSh ); const Point aDocPos( PixelToLogic( aStartPos ) ); bValidCrsrPos = !(CRSR_POSCHG & rSh.SetCursor(&aDocPos, false)); } @@ -5402,7 +5402,7 @@ sal_Bool SwEditWin::SelectMenuPosition(SwWrtShell& rSh, const Point& rMousePos ) { { // create only temporary move context because otherwise // the query against the content form doesn't work!!! - MV_KONTEXT( &rSh ); + SwMvContext aMvContext( &rSh ); rSh.SetCursor(&aDocPos, false); bRet = sal_True; } @@ -5413,7 +5413,7 @@ sal_Bool SwEditWin::SelectMenuPosition(SwWrtShell& rSh, const Point& rMousePos ) if( nSelType == nsSelectionType::SEL_OLE || nSelType == nsSelectionType::SEL_GRF ) { - MV_KONTEXT( &rSh ); + SwMvContext aMvContext( &rSh ); if( !rSh.IsFrmSelected() ) rSh.GotoNextFly(); rSh.EnterSelFrmMode(); diff --git a/sw/source/ui/shells/basesh.cxx b/sw/source/ui/shells/basesh.cxx index 099e96fd86bb..af0cc9751c11 100644 --- a/sw/source/ui/shells/basesh.cxx +++ b/sw/source/ui/shells/basesh.cxx @@ -665,7 +665,7 @@ void SwBaseShell::Execute(SfxRequest &rReq) if (rSh.HasMark()) { - MV_KONTEXT(&rSh); + SwMvContext aMvContext(&rSh); if (rSh.IsCrsrPtAtEnd()) rSh.SwapPam(); rSh.ClearMark(); diff --git a/sw/source/ui/uiview/viewmdi.cxx b/sw/source/ui/uiview/viewmdi.cxx index 27949cff51e9..01522518664c 100644 --- a/sw/source/ui/uiview/viewmdi.cxx +++ b/sw/source/ui/uiview/viewmdi.cxx @@ -84,7 +84,7 @@ void SwView::_SetZoom( const Size &rEditSize, SvxZoomType eZoomType, pWrtShell->LockPaint(); { - ACT_KONTEXT(pWrtShell); + SwActContext aActContext(pWrtShell); long nFac = nFactor; @@ -222,7 +222,7 @@ void SwView::SetViewLayout( sal_uInt16 nColumns, bool bBookMode, sal_Bool bViewO { - ACT_KONTEXT(pWrtShell); + SwActContext aActContext(pWrtShell); if ( !GetViewFrame()->GetFrame().IsInPlace() && !bViewOnly ) { diff --git a/sw/source/ui/wrtsh/delete.cxx b/sw/source/ui/wrtsh/delete.cxx index 08604a4455b1..a220189984ba 100644 --- a/sw/source/ui/wrtsh/delete.cxx +++ b/sw/source/ui/wrtsh/delete.cxx @@ -99,7 +99,7 @@ sal_Bool SwWrtShell::TryRemoveIndent() long SwWrtShell::DelLine() { - ACT_KONTEXT(this); + SwActContext aActContext(this); ResetCursorStack(); // alten Cursor merken Push(); @@ -170,10 +170,10 @@ long SwWrtShell::DelLeft() { if( !IsBlockMode() || HasSelection() ) { - //OS: wieder einmal Basic: ACT_KONTEXT muss vor + //OS: wieder einmal Basic: SwActContext muss vor //EnterStdMode verlassen werden! { - ACT_KONTEXT(this); + SwActContext aActContext(this); ResetCursorStack(); Delete(); UpdateAttr(); @@ -265,10 +265,10 @@ long SwWrtShell::DelRight() { if( !IsBlockMode() || HasSelection() ) { - //OS: wieder einmal Basic: ACT_KONTEXT muss vor + //OS: wieder einmal Basic: SwActContext muss vor //EnterStdMode verlassen werden! { - ACT_KONTEXT(this); + SwActContext aActContext(this); ResetCursorStack(); Delete(); UpdateAttr(); @@ -418,7 +418,7 @@ long SwWrtShell::DelRight() long SwWrtShell::DelToEndOfPara() { - ACT_KONTEXT(this); + SwActContext aActContext(this); ResetCursorStack(); Push(); SetMark(); @@ -438,7 +438,7 @@ long SwWrtShell::DelToEndOfPara() long SwWrtShell::DelToStartOfPara() { - ACT_KONTEXT(this); + SwActContext aActContext(this); ResetCursorStack(); Push(); SetMark(); @@ -489,7 +489,7 @@ long SwWrtShell::DelNxtWord() { if(IsEndOfDoc()) return 0; - ACT_KONTEXT(this); + SwActContext aActContext(this); ResetCursorStack(); EnterStdMode(); SetMark(); @@ -515,7 +515,7 @@ long SwWrtShell::DelPrvWord() { if(IsStartOfDoc()) return 0; - ACT_KONTEXT(this); + SwActContext aActContext(this); ResetCursorStack(); EnterStdMode(); SetMark(); diff --git a/sw/source/ui/wrtsh/move.cxx b/sw/source/ui/wrtsh/move.cxx index 89d10bd61e8b..9ee0f41b22a4 100644 --- a/sw/source/ui/wrtsh/move.cxx +++ b/sw/source/ui/wrtsh/move.cxx @@ -763,7 +763,7 @@ sal_Bool SwWrtShell::SelectTxtAttr( sal_uInt16 nWhich, const SwTxtAttr* pAttr ) { sal_Bool bRet; { - MV_KONTEXT(this); + SwMvContext aMvContext(this); SttSelect(); bRet = SwCrsrShell::SelectTxtAttr( nWhich, sal_False, pAttr ); } diff --git a/sw/source/ui/wrtsh/select.cxx b/sw/source/ui/wrtsh/select.cxx index c89fe0ab1433..c228aa1d5acd 100644 --- a/sw/source/ui/wrtsh/select.cxx +++ b/sw/source/ui/wrtsh/select.cxx @@ -71,7 +71,7 @@ void SwWrtShell::Invalidate() sal_Bool SwWrtShell::SelNearestWrd() { - MV_KONTEXT(this); + SwMvContext aMvContext(this); if( !IsInWrd() && !IsEndWrd() && !IsSttWrd() ) PrvWrd(); if( IsEndWrd() ) @@ -85,7 +85,7 @@ sal_Bool SwWrtShell::SelWrd(const Point *pPt, sal_Bool ) { sal_Bool bRet; { - MV_KONTEXT(this); + SwMvContext aMvContext(this); SttSelect(); bRet = SwCrsrShell::SelectWord( pPt ); } @@ -102,7 +102,7 @@ sal_Bool SwWrtShell::SelWrd(const Point *pPt, sal_Bool ) void SwWrtShell::SelSentence(const Point *pPt, sal_Bool ) { { - MV_KONTEXT(this); + SwMvContext aMvContext(this); ClearMark(); SwCrsrShell::GoStartSentence(); SttSelect(); @@ -118,7 +118,7 @@ void SwWrtShell::SelSentence(const Point *pPt, sal_Bool ) void SwWrtShell::SelPara(const Point *pPt, sal_Bool ) { { - MV_KONTEXT(this); + SwMvContext aMvContext(this); ClearMark(); SwCrsrShell::MovePara( fnParaCurr, fnParaStart ); SttSelect(); @@ -139,7 +139,7 @@ long SwWrtShell::SelAll() { if(bBlockMode) LeaveBlockMode(); - MV_KONTEXT(this); + SwMvContext aMvContext(this); sal_Bool bMoveTable = sal_False; SwPosition *pStartPos = 0; SwPosition *pEndPos = 0; @@ -320,7 +320,7 @@ long SwWrtShell::SetCrsr(const Point *pPt, sal_Bool bTextOnly) long SwWrtShell::SetCrsrKillSel(const Point *pPt, sal_Bool bTextOnly ) { - ACT_KONTEXT(this); + SwActContext aActContext(this); ResetSelect(pPt,sal_False); return SwCrsrShell::SetCrsr(*pPt, bTextOnly); } @@ -350,14 +350,14 @@ long SwWrtShell::ResetSelect(const Point *,sal_Bool) } else { - /* ACT_KONTEXT() macht eine Action auf - + /* SwActContext macht eine Action auf - um im Basicablauf keine Probleme mit der Shellumschaltung zu bekommen, darf GetChgLnk().Call() erst nach EndAction() gerufen werden. */ { - ACT_KONTEXT(this); + SwActContext aActContext(this); bSelWrd = bSelLn = sal_False; KillPams(); ClearMark(); @@ -447,7 +447,7 @@ inline sal_Bool operator<(const Point &rP1,const Point &rP2) long SwWrtShell::ExtSelWrd(const Point *pPt, sal_Bool ) { - MV_KONTEXT(this); + SwMvContext aMvContext(this); if( IsTableMode() ) return 1; @@ -509,7 +509,7 @@ long SwWrtShell::ExtSelWrd(const Point *pPt, sal_Bool ) long SwWrtShell::ExtSelLn(const Point *pPt, sal_Bool ) { - MV_KONTEXT(this); + SwMvContext aMvContext(this); SwCrsrShell::SetCrsr(*pPt); if( IsTableMode() ) return 1; @@ -569,12 +569,12 @@ void SwWrtShell::EnterStdMode() } else { - /* ACT_KONTEXT() opens and action which has to be + /* SwActContext opens and action which has to be closed prior to the call of GetChgLnk().Call() */ { - ACT_KONTEXT(this); + SwActContext aActContext(this); bSelWrd = bSelLn = sal_False; if( !IsRetainSelection() ) KillPams(); @@ -888,7 +888,7 @@ long SwWrtShell::EndDrag(const Point * /*pPt*/, sal_Bool ) // #i32329# Enhanced table selection sal_Bool SwWrtShell::SelectTableRowCol( const Point& rPt, const Point* pEnd, bool bRowDrag ) { - MV_KONTEXT(this); + SwMvContext aMvContext(this); SttSelect(); if(SelTblRowCol( rPt, pEnd, bRowDrag )) { diff --git a/sw/source/ui/wrtsh/wrtsh1.cxx b/sw/source/ui/wrtsh/wrtsh1.cxx index 723cb4c062ce..813a9f566801 100644 --- a/sw/source/ui/wrtsh/wrtsh1.cxx +++ b/sw/source/ui/wrtsh/wrtsh1.cxx @@ -176,7 +176,7 @@ void SwWrtShell::Edit() sal_Bool SwWrtShell::IsEndWrd() { - MV_KONTEXT(this); + SwMvContext aMvContext(this); if(IsEndPara() && !IsSttPara()) return sal_True; @@ -896,7 +896,7 @@ void SwWrtShell::InsertPageBreak(const String *pPageDesc, sal_uInt16 nPgNum ) ResetCursorStack(); if( CanInsert() ) { - ACT_KONTEXT(this); + SwActContext aActContext(this); StartUndo(UNDO_UI_INSERT_PAGE_BREAK); if ( !IsCrsrInTbl() ) @@ -951,7 +951,7 @@ void SwWrtShell::InsertLineBreak() void SwWrtShell::InsertColumnBreak() { - ACT_KONTEXT(this); + SwActContext aActContext(this); ResetCursorStack(); if( CanInsert() ) { @@ -1015,7 +1015,7 @@ void SwWrtShell::SplitNode( sal_Bool bAutoFmt, sal_Bool bCheckTableStart ) ResetCursorStack(); if( CanInsert() ) { - ACT_KONTEXT(this); + SwActContext aActContext(this); rView.GetEditWin().FlushInBuffer(); sal_Bool bHasSel = HasSelection(); |