summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Freund <matti_lx@yahoo.de>2013-03-17 23:16:05 +0100
committerFridrich Strba <fridrich@documentfoundation.org>2013-03-18 13:17:34 +0000
commitaebfd023c116047ab467f7abebd84e4c9acd5bbf (patch)
treeaf37e35d3d8b4cbf46365b3c664c4b5429f8ee7d
parent60c17b2873506ed8b068b34840aecda0c1d9bd65 (diff)
Comment translation ger - eng in sw/source/ui/wrtsh/
Change-Id: I41317f0f6859e7d5c3c62703a21f5fe8983aac9c Reviewed-on: https://gerrit.libreoffice.org/2812 Reviewed-by: Fridrich Strba <fridrich@documentfoundation.org> Tested-by: Fridrich Strba <fridrich@documentfoundation.org>
-rw-r--r--sw/source/ui/wrtsh/delete.cxx47
-rw-r--r--sw/source/ui/wrtsh/move.cxx195
-rw-r--r--sw/source/ui/wrtsh/navmgr.cxx153
-rw-r--r--sw/source/ui/wrtsh/select.cxx247
4 files changed, 226 insertions, 416 deletions
diff --git a/sw/source/ui/wrtsh/delete.cxx b/sw/source/ui/wrtsh/delete.cxx
index f4d4d3b41b8f..f95e8ddb4033 100644
--- a/sw/source/ui/wrtsh/delete.cxx
+++ b/sw/source/ui/wrtsh/delete.cxx
@@ -82,11 +82,7 @@ bool SwWrtShell::TryRemoveIndent()
return bResult;
}
-/*------------------------------------------------------------------------
- Description: Erase the line
-------------------------------------------------------------------------*/
-
-
+/** Description: Erase the line. */
long SwWrtShell::DelLine()
{
@@ -135,12 +131,12 @@ long SwWrtShell::DelLeft()
const int nCmp = nsSelectionType::SEL_FRM | nsSelectionType::SEL_GRF | nsSelectionType::SEL_OLE | nsSelectionType::SEL_DRW;
if( nCmp & nSelType )
{
- /* #108205# Remember object's position. */
+ // #108205# Remember object's position.
Point aTmpPt = GetObjRect().TopLeft();
DelSelectedObj();
- /* #108205# Set cursor to remembered position. */
+ // #108205# Set cursor to remembered position.
SetCrsr(&aTmpPt);
LeaveSelFrmMode();
@@ -195,13 +191,13 @@ long SwWrtShell::DelLeft()
GetSwCrsr()->GetNode()->FindTableBoxStartNode() :
0;
- /* If the cursor is at the beginning of a paragraph, try to step
- backwards. On failure we are done. */
+ // If the cursor is at the beginning of a paragraph, try to step
+ // backwards. On failure we are done.
if( !SwCrsrShell::Left(1,CRSR_SKIP_CHARS) )
return 0;
- /* If the cursor entered or left a table (or both) we are done. No step
- back. */
+ // If the cursor entered or left a table (or both) we are done. No step
+ // back.
const SwTableNode* pIsInTblNd = SwCrsrShell::IsCrsrInTbl();
if( pIsInTblNd != pWasInTblNd )
return 0;
@@ -306,7 +302,7 @@ long SwWrtShell::DelRight()
}
{
- /* #108049# Save the startnode of the current cell */
+ // #108049# Save the startnode of the current cell
const SwStartNode * pSNdOld;
pSNdOld = GetSwCrsr()->GetNode()->
FindTableBoxStartNode();
@@ -324,13 +320,13 @@ long SwWrtShell::DelRight()
{
if (IsCrsrInTbl() || (pWasInTblNd != IsCrsrInTbl()))
{
- /* #108049# Save the startnode of the current
+ /** #108049# Save the startnode of the current
cell. May be different to pSNdOld as we have
moved. */
const SwStartNode * pSNdNew = GetSwCrsr()
->GetNode()->FindTableBoxStartNode();
- /* #108049# Only move instead of deleting if we
+ /** #108049# Only move instead of deleting if we
have moved to a different cell */
if (pSNdOld != pSNdNew)
{
@@ -358,12 +354,12 @@ long SwWrtShell::DelRight()
case nsSelectionType::SEL_DRW_TXT:
case nsSelectionType::SEL_DRW_FORM:
{
- /* #108205# Remember object's position. */
+ // #108205# Remember object's position.
Point aTmpPt = GetObjRect().TopLeft();
DelSelectedObj();
- /* #108205# Set cursor to remembered position. */
+ // #108205# Set cursor to remembered position.
SetCrsr(&aTmpPt);
LeaveSelFrmMode();
@@ -405,8 +401,6 @@ long SwWrtShell::DelRight()
return nRet;
}
-
-
long SwWrtShell::DelToEndOfPara()
{
SwActContext aActContext(this);
@@ -425,8 +419,6 @@ long SwWrtShell::DelToEndOfPara()
return nRet;
}
-
-
long SwWrtShell::DelToStartOfPara()
{
SwActContext aActContext(this);
@@ -444,13 +436,10 @@ long SwWrtShell::DelToStartOfPara()
UpdateAttr();
return nRet;
}
-/*
- * All erase operations should work with Find instead with
- * Nxt-/PrvDelim, because the latter works with Wrap Around
- * -- that's probably not wished.
- */
-
+// All erase operations should work with Find instead with
+// Nxt-/PrvDelim, because the latter works with Wrap Around
+// -- that's probably not wished.
long SwWrtShell::DelToStartOfSentence()
{
@@ -462,8 +451,6 @@ long SwWrtShell::DelToStartOfSentence()
return nRet;
}
-
-
long SwWrtShell::DelToEndOfSentence()
{
if(IsEndOfDoc())
@@ -474,8 +461,6 @@ long SwWrtShell::DelToEndOfSentence()
return nRet;
}
-
-
long SwWrtShell::DelNxtWord()
{
if(IsEndOfDoc())
@@ -500,8 +485,6 @@ long SwWrtShell::DelNxtWord()
return nRet;
}
-
-
long SwWrtShell::DelPrvWord()
{
if(IsStartOfDoc())
diff --git a/sw/source/ui/wrtsh/move.cxx b/sw/source/ui/wrtsh/move.cxx
index e717dbd38d6b..4f3813abc68f 100644
--- a/sw/source/ui/wrtsh/move.cxx
+++ b/sw/source/ui/wrtsh/move.cxx
@@ -23,15 +23,16 @@
#include <viewopt.hxx>
#include <crsskip.hxx>
-/* Immer:
- - Zuruecksetzen des Cursorstacks
- - Timer nachtriggern
- - gfs. GCAttr
+/**
+ Always:
+ - Reset of the cursor stack
+ - retrigger timer
+ - if applicable: GCAttr
- bei Selektion
+ on selection
- SttSelect()
- sonst
+ else
- EndSelect()
*/
@@ -52,8 +53,8 @@ public:
{
if( bAct )
{
- //Die Action wird fuer das Scrollen in "einabsaetzigen" Rahmen mit
- //fester Hoehe gebraucht.
+ // The action is used for scrolling in "single paragraph"
+ // frames with fixed height.
pSh->StartAllAction();
pSh->EndAllAction();
}
@@ -92,7 +93,6 @@ sal_Bool SwWrtShell::SimpleMove( FNSimpleMove FnSimpleMove, sal_Bool bSelect )
return nRet;
}
-
sal_Bool SwWrtShell::Left( sal_uInt16 nMode, sal_Bool bSelect,
sal_uInt16 nCount, sal_Bool bBasicCall, sal_Bool bVisual )
{
@@ -110,8 +110,6 @@ sal_Bool SwWrtShell::Left( sal_uInt16 nMode, sal_Bool bSelect,
}
}
-
-
sal_Bool SwWrtShell::Right( sal_uInt16 nMode, sal_Bool bSelect,
sal_uInt16 nCount, sal_Bool bBasicCall, sal_Bool bVisual )
{
@@ -130,8 +128,6 @@ sal_Bool SwWrtShell::Right( sal_uInt16 nMode, sal_Bool bSelect,
}
}
-
-
sal_Bool SwWrtShell::Up( sal_Bool bSelect, sal_uInt16 nCount, sal_Bool bBasicCall )
{
if ( !bSelect && !bBasicCall && IsCrsrReadonly() && !GetViewOptions()->IsSelectionInReadonly())
@@ -148,8 +144,6 @@ sal_Bool SwWrtShell::Up( sal_Bool bSelect, sal_uInt16 nCount, sal_Bool bBasicCal
}
}
-
-
sal_Bool SwWrtShell::Down( sal_Bool bSelect, sal_uInt16 nCount, sal_Bool bBasicCall )
{
if ( !bSelect && !bBasicCall && IsCrsrReadonly() && !GetViewOptions()->IsSelectionInReadonly())
@@ -167,8 +161,6 @@ sal_Bool SwWrtShell::Down( sal_Bool bSelect, sal_uInt16 nCount, sal_Bool bBasicC
}
}
-
-
sal_Bool SwWrtShell::LeftMargin( sal_Bool bSelect, sal_Bool bBasicCall )
{
if ( !bSelect && !bBasicCall && IsCrsrReadonly() )
@@ -185,8 +177,6 @@ sal_Bool SwWrtShell::LeftMargin( sal_Bool bSelect, sal_Bool bBasicCall )
}
}
-
-
sal_Bool SwWrtShell::RightMargin( sal_Bool bSelect, sal_Bool bBasicCall )
{
if ( !bSelect && !bBasicCall && IsCrsrReadonly() )
@@ -205,8 +195,6 @@ sal_Bool SwWrtShell::RightMargin( sal_Bool bSelect, sal_Bool bBasicCall )
}
}
-
-
sal_Bool SwWrtShell::GoStart( sal_Bool bKeepArea, sal_Bool *pMoveTable,
sal_Bool bSelect, sal_Bool bDontMoveRegion )
{
@@ -220,7 +208,7 @@ sal_Bool SwWrtShell::GoStart( sal_Bool bKeepArea, sal_Bool *pMoveTable,
else
SttSelect();
}
- // Tabellenzelle?
+ // Table cell ?
if ( !bBoxSelection && (MoveSection( fnSectionCurr, fnSectionStart)
|| bDontMoveRegion))
{
@@ -236,11 +224,11 @@ sal_Bool SwWrtShell::GoStart( sal_Bool bKeepArea, sal_Bool *pMoveTable,
}
else if( bBoxSelection && pMoveTable )
{
- // JP 09.01.96: wir haben eine Boxselektion (oder leere Zelle)
- // und wollen selektieren (pMoveTable wird im
- // SelAll gesetzt). Dann darf die Tabelle nicht
- // verlassen werden; sonst ist keine Selektion der
- // gesamten Tabelle moeglich!
+ // JP 09.01.96: We have a box selection (or a empty cell)
+ // and we want select (pMoveTable will be
+ // set in SelAll). Then the table must not
+ // be left, otherwise there is no selection
+ // of the entire table possible!
*pMoveTable = sal_True;
return sal_True;
}
@@ -268,13 +256,11 @@ sal_Bool SwWrtShell::GoStart( sal_Bool bKeepArea, sal_Bool *pMoveTable,
else if ( bKeepArea )
return sal_True;
}
- // Bereiche ???
+ // Regions ???
return SwCrsrShell::MoveRegion( fnRegionCurrAndSkip, fnRegionStart ) ||
SwCrsrShell::SttEndDoc(sal_True);
}
-
-
sal_Bool SwWrtShell::GoEnd(sal_Bool bKeepArea, sal_Bool *pMoveTable)
{
if ( pMoveTable && *pMoveTable )
@@ -304,98 +290,74 @@ sal_Bool SwWrtShell::GoEnd(sal_Bool bKeepArea, sal_Bool *pMoveTable)
return sal_True;
}
}
- // Bereiche ???
+ // Regions ???
return SwCrsrShell::MoveRegion( fnRegionCurrAndSkip, fnRegionEnd ) ||
SwCrsrShell::SttEndDoc(sal_False);
}
-
-
sal_Bool SwWrtShell::SttDoc( sal_Bool bSelect )
{
ShellMoveCrsr aTmp( this, bSelect );
return GoStart(sal_False, 0, bSelect );
}
-
-
sal_Bool SwWrtShell::EndDoc( sal_Bool bSelect)
{
ShellMoveCrsr aTmp( this, bSelect );
return GoEnd();
}
-
sal_Bool SwWrtShell::SttNxtPg( sal_Bool bSelect )
{
ShellMoveCrsr aTmp( this, bSelect );
return MovePage( fnPageNext, fnPageStart );
}
-
-
sal_Bool SwWrtShell::SttPrvPg( sal_Bool bSelect )
{
ShellMoveCrsr aTmp( this, bSelect );
return MovePage( fnPagePrev, fnPageStart );
}
-
-
sal_Bool SwWrtShell::EndNxtPg( sal_Bool bSelect )
{
ShellMoveCrsr aTmp( this, bSelect );
return MovePage( fnPageNext, fnPageEnd );
}
-
-
sal_Bool SwWrtShell::EndPrvPg( sal_Bool bSelect )
{
ShellMoveCrsr aTmp( this, bSelect );
return MovePage( fnPagePrev, fnPageEnd );
}
-
-
sal_Bool SwWrtShell::SttPg( sal_Bool bSelect )
{
ShellMoveCrsr aTmp( this, bSelect );
return MovePage( fnPageCurr, fnPageStart );
}
-
-
sal_Bool SwWrtShell::EndPg( sal_Bool bSelect )
{
ShellMoveCrsr aTmp( this, bSelect );
return MovePage( fnPageCurr, fnPageEnd );
}
-
-
sal_Bool SwWrtShell::SttPara( sal_Bool bSelect )
{
ShellMoveCrsr aTmp( this, bSelect );
return MovePara( fnParaCurr, fnParaStart );
}
-
-
sal_Bool SwWrtShell::EndPara( sal_Bool bSelect )
{
ShellMoveCrsr aTmp( this, bSelect );
return MovePara(fnParaCurr,fnParaEnd);
}
-
-/*------------------------------------------------------------------------
- Beschreibung: Spaltenweises Springen
- Parameter: mit oder ohne SSelection
- Return: Erfolg oder Misserfolg
-------------------------------------------------------------------------*/
-
-
+// Column-by-jumping.
+// SSelection with or without
+// returns success or failure
sal_Bool SwWrtShell::StartOfColumn( sal_Bool bSelect )
{
@@ -403,55 +365,43 @@ sal_Bool SwWrtShell::StartOfColumn( sal_Bool bSelect )
return MoveColumn(fnColumnCurr, fnColumnStart);
}
-
-
sal_Bool SwWrtShell::EndOfColumn( sal_Bool bSelect )
{
ShellMoveCrsr aTmp( this, bSelect);
return MoveColumn(fnColumnCurr, fnColumnEnd);
}
-
-
sal_Bool SwWrtShell::StartOfNextColumn( sal_Bool bSelect )
{
ShellMoveCrsr aTmp( this, bSelect);
return MoveColumn( fnColumnNext, fnColumnStart);
}
-
-
sal_Bool SwWrtShell::EndOfNextColumn( sal_Bool bSelect )
{
ShellMoveCrsr aTmp( this, bSelect);
return MoveColumn(fnColumnNext, fnColumnEnd);
}
-
-
sal_Bool SwWrtShell::StartOfPrevColumn( sal_Bool bSelect )
{
ShellMoveCrsr aTmp( this, bSelect);
return MoveColumn(fnColumnPrev, fnColumnStart);
}
-
-
sal_Bool SwWrtShell::EndOfPrevColumn( sal_Bool bSelect )
{
ShellMoveCrsr aTmp( this, bSelect);
return MoveColumn(fnColumnPrev, fnColumnEnd);
}
-
-
sal_Bool SwWrtShell::PushCrsr(SwTwips lOffset, sal_Bool bSelect)
{
sal_Bool bDiff = sal_False;
SwRect aOldRect( GetCharRect() ), aTmpArea( VisArea() );
- //bDestOnStack besagt, ob ich den Cursor nicht an die aktuelle Position
- //setzen konnte, da in diesem Bereich kein Inhalt vorhanden ist.
+ // bDestOnStack indicates if I could not set the coursor at the current
+ // position, because in this region is no content.
if( !bDestOnStack )
{
Point aPt( aOldRect.Center() );
@@ -467,17 +417,16 @@ sal_Bool SwWrtShell::PushCrsr(SwTwips lOffset, sal_Bool bSelect)
bDestOnStack = true;
}
- //falls wir eine Rahmenselektion hatten, muss diese nach dem
- //fnSetCrsr entfernt werden und damit wir da wieder hinkommen
- //auf dem Stack gemerkt werden.
+ // If we had a frame selection, it must be removed after the fnSetCrsr
+ // and we have to remember the position on the stack to return to it later.
sal_Bool bIsFrmSel = sal_False;
bool bIsObjSel = false;
- //Zielposition liegt jetzt innerhalb des sichtbaren Bereiches -->
- //Cursor an die Zielposition setzen; merken, dass keine Ziel-
- //position mehr auf dem Stack steht.
- //Der neue sichtbare Bereich wird zuvor ermittelt.
+ //Target position is now within the viewable region -->
+ //Place the cursor at the target position; remember that no target
+ //position is longer on the stack.
+ //The new visible region is to be determined beforehand.
aTmpArea.Pos().Y() += lOffset;
if( aTmpArea.IsInside(aDest) )
{
@@ -489,7 +438,7 @@ sal_Bool SwWrtShell::PushCrsr(SwTwips lOffset, sal_Bool bSelect)
bIsFrmSel = IsFrmSelected();
bIsObjSel = 0 != IsObjSelected();
- // Rahmenselektion aufheben
+ // unselect frame
if( bIsFrmSel || bIsObjSel )
{
UnSelectFrm();
@@ -509,17 +458,17 @@ sal_Bool SwWrtShell::PushCrsr(SwTwips lOffset, sal_Bool bSelect)
if( bIsFrmSel )
{
- // bei Frames immer nur die obere Ecke nehmen, damit dieser
- // wieder selektiert werden kann
+ // In frames take only the upper corner
+ // so that it can be re-selected.
aOldRect.SSize( 5, 5 );
}
- // Zuruecksetzen des Dest. SPoint Flags
+ // reset Dest. SPoint Flags
bDestOnStack = false;
}
- // Position auf den Stack; bDiff besagt, ob ein Unterschied zwischen
- // der alten und der neuen Cursorposition besteht.
+ // Position into the stack; bDiff indicates if there is a
+ // difference between the old and the new cursor position.
pCrsrStack = new CrsrStack( bDiff, bIsFrmSel, aOldRect.Center(),
lOffset, pCrsrStack );
return !bDestOnStack && bDiff;
@@ -535,8 +484,8 @@ sal_Bool SwWrtShell::PopCrsr(sal_Bool bUpdate, sal_Bool bSelect)
const sal_Bool bValidPos = pCrsrStack->bValidCurPos;
if( bUpdate && bValidPos )
{
- // falls ein Vorgaenger auf dem Stack steht, dessen Flag fuer eine
- // gueltige Position verwenden.
+ // If a predecessor is on the stack,
+ // use the flag for a valid position.
SwRect aTmpArea(VisArea());
aTmpArea.Pos().Y() -= pCrsrStack->lOffset;
if( aTmpArea.IsInside( pCrsrStack->aDocPos ) )
@@ -554,9 +503,9 @@ sal_Bool SwWrtShell::PopCrsr(sal_Bool bUpdate, sal_Bool bSelect)
EnterSelFrmMode( &pCrsrStack->aDocPos );
}
}
- // Falls eine Verschiebung zwischen dem sichtbaren Bereich
- // und der gemerkten Cursorpositionen auftritt, werden
- // alle gemerkten Positionen weggeschmissen
+ // If a discrepancy between the visible range and the
+ // remembered cursor position occurs, all of the remembered
+ // positions are thrown away.
else
{
_ResetCursorStack();
@@ -574,12 +523,8 @@ sal_Bool SwWrtShell::PopCrsr(sal_Bool bUpdate, sal_Bool bSelect)
return bValidPos;
}
-/*
- * Zuruecksetzen aller gepushten Cursorpositionen; dieser werden nicht
- * zur Anzeige gebracht ( --> Kein Start-/EndAction!!)
- */
-
-
+// Reset of all pushed cursor positions; these will
+// not be displayed ( --> No Start-/EndAction!!)
void SwWrtShell::_ResetCursorStack()
{
@@ -593,38 +538,38 @@ void SwWrtShell::_ResetCursorStack()
ePageMove = MV_NO;
bDestOnStack = false;
}
-/**************
-
- falls kein Stack existiert --> Selektionen aufheben
- falls Stack && Richtungswechsel
- --> Cursor poppen und return
- sonst
- --> Cursor pushen
- Cursor umsetzen
-
-***************/
+/**
+ if no stack exists --> cancel selection
+ if stack && change of direction
+ --> pop cursor and return
+ else
+ --> push cursor
+ transpose cursor
+*/
sal_Bool SwWrtShell::PageCrsr(SwTwips lOffset, sal_Bool bSelect)
{
- // nichts tun, wenn ein Offset von 0 angegeben wurde
+ // Do nothing if an offset of 0 was indicated
if(!lOffset) return sal_False;
- // Diente mal dazu, eine Neuformatierung fuer das Layout
- // zu erzwingen.
- // Hat so nicht funktioniert, da der Cursor nicht gesetzt
- // wurde, da dies innerhalb einer Start- / EndActionklammerung
- // nicht geschieht.
- // Da am Ende nur ViewShell::EndAction() gerufen wird,
- // findet auch hier keine Aktualisierung der Anzeige
- // der Cursorposition statt.
- // Die CrsrShell- Actionklammerung kann nicht verwendet werden,
- // da sie immer zu einer Anzeige des Cursors fuehrt, also auch,
- // wenn nach dem Blaettern in einen Bereich ohne gueltige Position
- // geblaettert wurde.
- // ViewShell::StartAction();
+ // Was once used to force a reformat of the layout.
+ // This has not work that way, because the cursor was not set
+ // because this does not happen within a
+ // Start-/EndActionParentheses.
+ // Because only ViewShell::EndAction() is called at the end,
+ // no updating of the display of the cursor position takes place.
+ // The CrsrShell-Actionparentheses cannot be used, because it
+ // always leads to displaying the cursor, thus also,
+da sie immer zu einer Anzeige des Cursors fuehrt, also auch,
+ // if after the scroll scrolled in a region without a
+wenn nach dem Blaettern in einen Bereich ohne gueltige Position
+ // valid postition.
+geblaettert wurde.
+ // ViewShell::StartAction();
PageMove eDir = lOffset > 0? MV_PAGE_DOWN: MV_PAGE_UP;
- // Richtungswechsel und Stack vorhanden
+ // Change of direction and stack present
+Richtungswechsel und Stack vorhanden
if( eDir != ePageMove && ePageMove != MV_NO && PopCrsr( sal_True, bSelect ))
return sal_True;
@@ -633,8 +578,6 @@ sal_Bool SwWrtShell::PageCrsr(SwTwips lOffset, sal_Bool bSelect)
return bRet;
}
-
-
sal_Bool SwWrtShell::GotoPage(sal_uInt16 nPage, sal_Bool bRecord)
{
ShellMoveCrsr aTmp( this, sal_False);
@@ -650,8 +593,6 @@ sal_Bool SwWrtShell::GotoPage(sal_uInt16 nPage, sal_Bool bRecord)
return sal_False;
}
-
-
sal_Bool SwWrtShell::GotoMark( const ::sw::mark::IMark* const pMark, sal_Bool bSelect, sal_Bool bStart )
{
ShellMoveCrsr aTmp( this, bSelect );
@@ -748,8 +689,6 @@ const SwRedline* SwWrtShell::GotoRedline( sal_uInt16 nArrPos, sal_Bool bSelect )
return pRedline;
}
-
-
sal_Bool SwWrtShell::SelectTxtAttr( sal_uInt16 nWhich, const SwTxtAttr* pAttr )
{
sal_Bool bRet;
@@ -762,6 +701,4 @@ sal_Bool SwWrtShell::SelectTxtAttr( sal_uInt16 nWhich, const SwTxtAttr* pAttr )
return bRet;
}
-
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/wrtsh/navmgr.cxx b/sw/source/ui/wrtsh/navmgr.cxx
index fc07b7561d32..8cc63ad0c1d1 100644
--- a/sw/source/ui/wrtsh/navmgr.cxx
+++ b/sw/source/ui/wrtsh/navmgr.cxx
@@ -39,23 +39,22 @@
#include <com/sun/star/frame/XLayoutManager.hpp>
/**
- * If SMART is defined, the navigation history has recency with temporal ordering enhancement,
- * as described on http://zing.ncsl.nist.gov/hfweb/proceedings/greenberg/
+ * If SMART is defined, the navigation history has recency with temporal ordering enhancement,
+ * as described on http://zing.ncsl.nist.gov/hfweb/proceedings/greenberg/
*/
+
#define SMART 1
-/*
- * This method positions the cursor to the position rPos
- */
+// This method positions the cursor to the position rPos.
+
void SwNavigationMgr::GotoSwPosition(const SwPosition &rPos) {
- /* EnterStdMode() prevents the cursor to 'block' the current shell when it should move from the image back to the normal shell */
+ // EnterStdMode() prevents the cursor to 'block' the current
+ // shell when it should move from the image back to the normal shell
m_rMyShell.EnterStdMode();
m_rMyShell.StartAllAction();
- /*
- * cursor consists of two SwPositions: Point and Mark.
- * Such a pair is called a PaM. SwPaM is derived from SwRing.
- * The Ring contains the single regions of a multi-selection.
- */
+ // cursor consists of two SwPositions: Point and Mark.
+ // Such a pair is called a PaM. SwPaM is derived from SwRing.
+ // The Ring contains the single regions of a multi-selection.
SwPaM* pPaM = m_rMyShell.GetCrsr();
if(pPaM->HasMark())
@@ -64,129 +63,125 @@ void SwNavigationMgr::GotoSwPosition(const SwPosition &rPos) {
m_rMyShell.EndAllAction();
}
-/*
- * Ctor for the SwNavigationMgr class
- * Sets the shell to the current shell
- * and the index of the current position to 0
- */
+
+// Ctor for the SwNavigationMgr class
+// Sets the shell to the current shell
+// and the index of the current position to 0
+
SwNavigationMgr::SwNavigationMgr(SwWrtShell & rShell)
: m_nCurrent(0), m_rMyShell(rShell)
{
}
-/*
- * This method is used by the navigation shell - defined in sw/source/ui/inc/navsh.hxx
- * and implemented in sw/source/ui/shells/navsh.cxx
- * It is called when we want to check if the back button should be enabled or not.
- * The back button should be enabled only if there are some entries in the navigation history
- */
+// This method is used by the navigation shell - defined in sw/source/ui/inc/navsh.hxx
+// and implemented in sw/source/ui/shells/navsh.cxx
+// It is called when we want to check if the back button should be enabled or not.
+// The back button should be enabled only if there are some entries in the navigation history
+
bool SwNavigationMgr::backEnabled() {
return (m_nCurrent > 0);
}
-/*
- * Similar to backEnabled() method.
- * The forward button should be enabled if we ever clicked back
- * Due to the implementation of the navigation class, this is when the
- * current position within the navigation history entries in not the last one
- * i.e. when the m_nCurrent index is not at the end of the m_entries vector
- */
+
+// Similar to backEnabled() method.
+// The forward button should be enabled if we ever clicked back
+// Due to the implementation of the navigation class, this is when the
+// current position within the navigation history entries in not the last one
+// i.e. when the m_nCurrent index is not at the end of the m_entries vector
+
bool SwNavigationMgr::forwardEnabled() {
return m_nCurrent+1 < m_entries.size();
}
+// The goBack() method positions the cursor to the previous entry in the navigation history
+// If there was no history to go forward to, it adds the current position of the cursor
+// to the history so we could go forward to where we came from
-/*
- * The goBack() method positions the cursor to the previous entry in the navigation history
- * If there was no history to go forward to, it adds the current position of the cursor
- * to the history so we could go forward to where we came from
- */
void SwNavigationMgr::goBack() {
- /*
- * Although the button should be disabled whenever the backEnabled() returns false,
- * the UI is sometimes not as responsive as we would like it to be :)
- * this check prevents segmentation faults and in this way the class is not relying on the UI
- */
+
+ // Although the button should be disabled whenever the backEnabled() returns false,
+ // the UI is sometimes not as responsive as we would like it to be :)
+ // this check prevents segmentation faults and in this way the class is not relying on the UI
+
if (backEnabled()) {
/* Trying to get the current cursor */
SwPaM* pPaM = m_rMyShell.GetCrsr();
if (!pPaM) {
return;
}
+ // This flag will be used to manually refresh the buttons
- /* This flag will be used to manually refresh the buttons */
bool bForwardWasDisabled = !forwardEnabled();
- /*
- * If we're going backwards in our history, but the current location is not
- * in the history then we need to add *here* to it so that we can "go
- * forward" to here again.
- */
+
+ // If we're going backwards in our history, but the current location is not
+ // in the history then we need to add *here* to it so that we can "go
+ // forward" to here again.
if (bForwardWasDisabled) {
- /*
- * the cursor consists of two SwPositions: Point and Mark.
- * We are adding the current Point to the navigation history
- * so we could later navigate forward to it
- */
- /* The addEntry() method returns true iff we should decrement the index before navigating back */
+
+ // the cursor consists of two SwPositions: Point and Mark.
+ // We are adding the current Point to the navigation history
+ // so we could later navigate forward to it
+
+ // The addEntry() method returns true iff we should decrement
+ // the index before navigating back
+
if (addEntry(*pPaM->GetPoint()) ) {
m_nCurrent--;
}
}
m_nCurrent--;
- /* Position cursor to appropriate navigation history entry */
+ // Position cursor to appropriate navigation history entry
GotoSwPosition(*m_entries[m_nCurrent]->GetPoint());
- /* Refresh the buttons */
+ // Refresh the buttons
if (bForwardWasDisabled)
m_rMyShell.GetView().GetViewFrame()->GetBindings().Invalidate(FN_NAVIGATION_FORWARD);
if (!backEnabled())
m_rMyShell.GetView().GetViewFrame()->GetBindings().Invalidate(FN_NAVIGATION_BACK);
}
}
-/*
- * The goForward() method positions the cursor to the next entry in the navigation history
- */
+
+// The goForward() method positions the cursor to the next entry in the navigation history
void SwNavigationMgr::goForward() {
- /*
- * Although the button should be disabled whenever the backForward() returns false,
- * the UI is sometimes not as responsive as we would like it to be :)
- * this check prevents segmentation faults and in this way the class is not relying on the UI
- */
+
+ // Although the button should be disabled whenever the backForward() returns false,
+ // the UI is sometimes not as responsive as we would like it to be :)
+ // this check prevents segmentation faults and in this way the class is not relying on the UI
if (forwardEnabled()) {
- /* This flag will be used to manually refresh the buttons */
+ // This flag will be used to manually refresh the buttons
bool bBackWasDisabled = !backEnabled();
- /*
- * The current index is positioned at the current entry in the navigation history
- * We have to increment it to go to the next entry
- */
+ // The current index is positioned at the current entry in the navigation history
+ // We have to increment it to go to the next entry
m_nCurrent++;
GotoSwPosition(*m_entries[m_nCurrent]->GetPoint());
- /* Refresh the buttons */
+ // Refresh the buttons
if (bBackWasDisabled)
m_rMyShell.GetView().GetViewFrame()->GetBindings().Invalidate(FN_NAVIGATION_BACK);
if (!forwardEnabled())
m_rMyShell.GetView().GetViewFrame()->GetBindings().Invalidate(FN_NAVIGATION_FORWARD);
}
}
-/*
- * This method adds the SwPosition rPos to the navigation history
- * rPos is usually the current position of the cursor in the document
- */
+
+// This method adds the SwPosition rPos to the navigation history
+// rPos is usually the current position of the cursor in the document
+
bool SwNavigationMgr::addEntry(const SwPosition& rPos) {
- /* Flags that will be used for refreshing the buttons */
+ // Flags that will be used for refreshing the buttons
bool bBackWasDisabled = !backEnabled();
bool bForwardWasEnabled = forwardEnabled();
bool bRet = false; // return value of the function.
- // Indicates whether the index should be decremented before jumping back or not
+ // Indicates whether the index should be decremented before
+ // jumping back or not
#if SMART
- /* If any forward history exists, twist the tail of the list from the current position to the end */
+ // If any forward history exists, twist the tail of the
+ // list from the current position to the end
if (bForwardWasEnabled) {
- size_t number_ofm_entries = m_entries.size(); /* To avoid calling m_entries.size() multiple times */
- int curr = m_nCurrent; /* Index from which we'll twist the tail. */
- int n = (number_ofm_entries - curr) / 2; /* Number of entries that will swap places */
+ size_t number_ofm_entries = m_entries.size(); // To avoid calling m_entries.size() multiple times
+ int curr = m_nCurrent; // Index from which we'll twist the tail.
+ int n = (number_ofm_entries - curr) / 2; // Number of entries that will swap places
for (int i = 0; i < n; i++) {
::std::swap(m_entries[curr + i], m_entries[number_ofm_entries -1 - i]);
}
@@ -217,13 +212,13 @@ bool SwNavigationMgr::addEntry(const SwPosition& rPos) {
#endif
m_nCurrent = m_entries.size();
- /* Refresh buttons */
+ // Refresh buttons
if (bBackWasDisabled)
m_rMyShell.GetView().GetViewFrame()->GetBindings().Invalidate(FN_NAVIGATION_BACK);
if (bForwardWasEnabled)
m_rMyShell.GetView().GetViewFrame()->GetBindings().Invalidate(FN_NAVIGATION_FORWARD);
- /* show the Navigation toolbar */
+ // show the Navigation toolbar
css::uno::Reference< css::frame::XFrame > xFrame =
m_rMyShell.GetView().GetViewFrame()->GetFrame().GetFrameInterface();
if (xFrame.is())
diff --git a/sw/source/ui/wrtsh/select.cxx b/sw/source/ui/wrtsh/select.cxx
index dfa8f06dbbec..661c93eda73c 100644
--- a/sw/source/ui/wrtsh/select.cxx
+++ b/sw/source/ui/wrtsh/select.cxx
@@ -33,7 +33,7 @@
#include <mdiexp.hxx>
#include <fmtcol.hxx>
#include <frmfmt.hxx>
-#include <swundo.hxx> // fuer Undo-Ids
+#include <swundo.hxx> // for Undo-Ids
#include <swevent.hxx>
#include <swdtflvr.hxx>
#include <crsskip.hxx>
@@ -103,7 +103,7 @@ void SwWrtShell::SelSentence(const Point *pPt, sal_Bool )
if(pPt)
aStart = *pPt;
bSelLn = sal_True;
- bSelWrd = sal_False; // SelWord abschalten, sonst geht kein SelLine weiter
+ bSelWrd = sal_False; // disable SelWord, otherwise no SelLine goes on
}
void SwWrtShell::SelPara(const Point *pPt, sal_Bool )
@@ -119,7 +119,7 @@ void SwWrtShell::SelPara(const Point *pPt, sal_Bool )
if(pPt)
aStart = *pPt;
bSelLn = sal_False;
- bSelWrd = sal_False; // SelWord abschalten, sonst geht kein SelLine weiter
+ bSelWrd = sal_False; // disable SelWord, otherwise no SelLine goes on
}
@@ -183,16 +183,13 @@ long SwWrtShell::SelAll()
return 1;
}
-/*------------------------------------------------------------------------
- Beschreibung: Textsuche
-------------------------------------------------------------------------*/
-
+// Desciption: Text search
sal_uLong SwWrtShell::SearchPattern( const SearchOptions& rSearchOpt, sal_Bool bSearchInNotes,
SwDocPositions eStt, SwDocPositions eEnd,
FindRanges eFlags, int bReplace )
{
- // keine Erweiterung bestehender Selektionen
+ // no enhancement of existing selections
if(!(eFlags & FND_IN_SEL))
ClearMark();
sal_Bool bCancel = sal_False;
@@ -204,17 +201,14 @@ sal_uLong SwWrtShell::SearchPattern( const SearchOptions& rSearchOpt, sal_Bool b
}
return nRet;
}
-/*------------------------------------------------------------------------
- Beschreibung: Suche nach Vorlagen
-------------------------------------------------------------------------*/
-
+// Description: search for templates
sal_uLong SwWrtShell::SearchTempl( const String &rTempl,
SwDocPositions eStt, SwDocPositions eEnd,
FindRanges eFlags, const String* pReplTempl )
{
- // keine Erweiterung bestehender Selektionen
+ // no enhancement of existing selections
if(!(eFlags & FND_IN_SEL))
ClearMark();
SwTxtFmtColl *pColl = GetParaStyle(rTempl, SwWrtShell::GETSTYLE_CREATESOME);
@@ -233,20 +227,18 @@ sal_uLong SwWrtShell::SearchTempl( const String &rTempl,
return nRet;
}
-// Suche nach Attributen ----------------------------------------------------
-
-
+// search for attributes
sal_uLong SwWrtShell::SearchAttr( const SfxItemSet& rFindSet, sal_Bool bNoColls,
SwDocPositions eStart, SwDocPositions eEnde,
FindRanges eFlags, const SearchOptions* pSearchOpt,
const SfxItemSet* pReplaceSet )
{
- // Keine Erweiterung bestehender Selektionen
+ // no enhancement of existing selections
if (!(eFlags & FND_IN_SEL))
ClearMark();
- // Suchen
+ // Searching
sal_Bool bCancel = sal_False;
sal_uLong nRet = Find( rFindSet, bNoColls, eStart, eEnde, bCancel, eFlags, pSearchOpt, pReplaceSet);
@@ -258,17 +250,13 @@ sal_uLong SwWrtShell::SearchAttr( const SfxItemSet& rFindSet, sal_Bool bNoColls,
return nRet;
}
-// ---------- Selektionsmodi ----------
-
-
+// Selection modes
void SwWrtShell::PushMode()
{
pModeStack = new ModeStack( pModeStack, bIns, bExtMode, bAddMode, bBlockMode );
}
-
-
void SwWrtShell::PopMode()
{
if ( 0 == pModeStack )
@@ -287,20 +275,15 @@ void SwWrtShell::PopMode()
pModeStack = pTmp;
}
-/*
- * Zwei Methoden fuer das Cursorsetzen; die erste mappt auf die
- * gleichnamige Methoden an der CursorShell, die zweite hebt
- * zuerst alle Selektionen auf.
- */
-
-
+// Two methodes for setting cursors: the first maps at the
+// eponymous methodes in the CursorShell, the second removes
+// all selections at first.
long SwWrtShell::SetCrsr(const Point *pPt, sal_Bool bTextOnly)
{
- /*
- * eine gfs. bestehende Selektion an der Position des
- * Mausklicks aufheben
- */
+ // Remove a possibly present selection at the position
+ // of the mouseclick
+
if(!IsInSelect() && ChgCurrPam(*pPt)) {
ClearMark();
}
@@ -308,7 +291,6 @@ long SwWrtShell::SetCrsr(const Point *pPt, sal_Bool bTextOnly)
return SwCrsrShell::SetCrsr(*pPt, bTextOnly);
}
-
long SwWrtShell::SetCrsrKillSel(const Point *pPt, sal_Bool bTextOnly )
{
SwActContext aActContext(this);
@@ -316,21 +298,15 @@ long SwWrtShell::SetCrsrKillSel(const Point *pPt, sal_Bool bTextOnly )
return SwCrsrShell::SetCrsr(*pPt, bTextOnly);
}
-
-
void SwWrtShell::UnSelectFrm()
{
- // Rahmenselektion aufheben mit garantiert ungueltiger Position
+ // Remove Frame selection with guaranteed invalid position
Point aPt(LONG_MIN, LONG_MIN);
SelectObj(aPt, 0);
SwTransferable::ClearSelection( *this );
}
-/*
- * Aufheben aller Selektionen
- */
-
-
+// Remove of all selections
long SwWrtShell::ResetSelect(const Point *,sal_Bool)
{
@@ -341,12 +317,10 @@ long SwWrtShell::ResetSelect(const Point *,sal_Bool)
}
else
{
- /* SwActContext macht eine Action auf -
- um im Basicablauf keine Probleme mit der
- Shellumschaltung zu bekommen, darf
- GetChgLnk().Call() erst nach
- EndAction() gerufen werden.
- */
+ // SwActContext opens an Action -
+ // to avoid problems in the basic process with the
+ // shell switching, GetChgLnk().Call() may be called
+ // after EndAction().
{
SwActContext aActContext(this);
bSelWrd = bSelLn = sal_False;
@@ -355,10 +329,9 @@ long SwWrtShell::ResetSelect(const Point *,sal_Bool)
fnKillSel = &SwWrtShell::Ignore;
fnSetCrsr = &SwWrtShell::SetCrsr;
}
- /*
- * nach dem Aufheben aller Selektionen koennte ein Update der
- * Attr-Controls notwendig sein.
- */
+
+ // After canceling of all selections an update of Attr-Controls
+ // could be necessary.
GetChgLnk().Call(this);
}
Invalidate();
@@ -366,20 +339,13 @@ long SwWrtShell::ResetSelect(const Point *,sal_Bool)
return 1;
}
+// Do nothing
-
-/*
- * tue nichts
- */
long SwWrtShell::Ignore(const Point *, sal_Bool ) {
return 1;
}
-/*
- * Start eines Selektionsvorganges.
- */
-
-
+// Begin of a selection process.
void SwWrtShell::SttSelect()
{
@@ -399,11 +365,8 @@ void SwWrtShell::SttSelect()
Invalidate();
SwTransferable::CreateSelection( *this );
}
-/*
- * Ende eines Selektionsvorganges.
- */
-
+// End of a selection process.
void SwWrtShell::EndSelect()
{
@@ -425,17 +388,14 @@ void SwWrtShell::EndSelect()
if (pWrdCnt)
pWrdCnt->UpdateCounts();
}
-/* Methode, um eine bestehende wortweise oder zeilenweise Selektion
- * zu erweitern.
- */
+
+// Methode to enhance a selecton word by word or line by line.
inline bool operator<(const Point &rP1,const Point &rP2)
{
return rP1.Y() < rP2.Y() || (rP1.Y() == rP2.Y() && rP1.X() < rP2.X());
}
-
-
long SwWrtShell::ExtSelWrd(const Point *pPt, sal_Bool )
{
SwMvContext aMvContext(this);
@@ -518,11 +478,11 @@ long SwWrtShell::ExtSelLn(const Point *pPt, sal_Bool )
}
}
- // ggfs. den Mark der Selektion anpassen
+ // if applicable fit the selection to the "Mark"
sal_Bool bToTop = !IsCrsrPtAtEnd();
SwapPam();
- // der "Mark" muss am Zeilenende/-anfang stehen
+ // The "Mark" has to be at the end or the beginning of the line.
if( bToTop ? !IsEndSentence() : !IsStartSentence() )
{
if( bToTop )
@@ -539,10 +499,7 @@ long SwWrtShell::ExtSelLn(const Point *pPt, sal_Bool )
return bToTop ? SwCrsrShell::GoStartSentence() : SwCrsrShell::GoEndSentence();
}
-
-/*
- * zurueck in den Standard Mode: kein Mode, keine Selektionen.
- */
+// Back into the standard mode: no mode, no selections.
void SwWrtShell::EnterStdMode()
{
@@ -560,10 +517,9 @@ void SwWrtShell::EnterStdMode()
}
else
{
- /* SwActContext opens and action which has to be
- closed prior to the call of
- GetChgLnk().Call()
- */
+ // SwActContext opens and action which has to be
+ // closed prior to the call of
+ // GetChgLnk().Call()
{
SwActContext aActContext(this);
bSelWrd = bSelLn = sal_False;
@@ -578,11 +534,7 @@ void SwWrtShell::EnterStdMode()
SwTransferable::ClearSelection( *this );
}
-/*
- * Extended Mode
- */
-
-
+// Extended Mode
void SwWrtShell::EnterExtMode()
{
@@ -598,19 +550,14 @@ void SwWrtShell::EnterExtMode()
SttSelect();
}
-
-
void SwWrtShell::LeaveExtMode()
{
bExtMode = sal_False;
EndSelect();
}
-/*
- * Ende einer Selektion; falls die Selektion leer ist,
- * ClearMark().
- */
-
+// End of a selection; if the selection is empty,
+// ClearMark().
long SwWrtShell::SttLeaveSelect(const Point *, sal_Bool )
{
@@ -620,11 +567,8 @@ long SwWrtShell::SttLeaveSelect(const Point *, sal_Bool )
ClearMark();
return 1;
}
-/*
- * Verlassen des Selektionsmodus in Additional Mode
- */
-
+// Leaving of the selection mode in additional mode
long SwWrtShell::AddLeaveSelect(const Point *, sal_Bool )
{
@@ -633,11 +577,8 @@ long SwWrtShell::AddLeaveSelect(const Point *, sal_Bool )
CreateCrsr();
return 1;
}
-/*
- * Additional Mode
- */
-
+// Additional Mode
void SwWrtShell::EnterAddMode()
{
@@ -654,8 +595,6 @@ void SwWrtShell::EnterAddMode()
Invalidate();
}
-
-
void SwWrtShell::LeaveAddMode()
{
fnKillSel = &SwWrtShell::ResetSelect;
@@ -664,9 +603,7 @@ void SwWrtShell::LeaveAddMode()
Invalidate();
}
-/*
- * Block Mode
- */
+// Block Mode
void SwWrtShell::EnterBlockMode()
{
@@ -677,8 +614,6 @@ void SwWrtShell::EnterBlockMode()
Invalidate();
}
-
-
void SwWrtShell::LeaveBlockMode()
{
bBlockMode = sal_False;
@@ -687,9 +622,7 @@ void SwWrtShell::LeaveBlockMode()
Invalidate();
}
-// Einfuegemodus
-
-
+// Insert mode
void SwWrtShell::SetInsMode( sal_Bool bOn )
{
@@ -709,10 +642,7 @@ void SwWrtShell::SetRedlineModeAndCheckInsMode( sal_uInt16 eMode )
SetInsMode( true );
}
-/*
- * Rahmen bearbeiten
- */
-
+// Edit frame
long SwWrtShell::BeginFrmDrag(const Point *pPt, sal_Bool)
{
@@ -727,8 +657,6 @@ long SwWrtShell::BeginFrmDrag(const Point *pPt, sal_Bool)
return 1;
}
-
-
void SwWrtShell::EnterSelFrmMode(const Point *pPos)
{
if(pPos)
@@ -740,15 +668,13 @@ void SwWrtShell::EnterSelFrmMode(const Point *pPos)
bLayoutMode = sal_True;
HideCrsr();
- // gleicher Aufruf von BeginDrag an der SwFEShell
+ // equal call of BeginDrag in the SwFEShell
fnDrag = &SwWrtShell::BeginFrmDrag;
fnEndDrag = &SwWrtShell::UpdateLayoutFrm;
SwBaseShell::SetFrmMode( FLY_DRAG_START, this );
Invalidate();
}
-
-
void SwWrtShell::LeaveSelFrmMode()
{
fnDrag = &SwWrtShell::BeginDrag;
@@ -759,11 +685,8 @@ void SwWrtShell::LeaveSelFrmMode()
SwBaseShell::SetFrmMode( FLY_DRAG_END, this );
Invalidate();
}
-/*------------------------------------------------------------------------
- Beschreibung: Rahmengebundenes Macro ausfuehren
-------------------------------------------------------------------------*/
-
+// Description: execute framebound macro
IMPL_LINK( SwWrtShell, ExecFlyMac, void *, pFlyFmt )
{
@@ -782,21 +705,15 @@ IMPL_LINK( SwWrtShell, ExecFlyMac, void *, pFlyFmt )
return 0;
}
-
-
long SwWrtShell::UpdateLayoutFrm(const Point *pPt, sal_Bool )
{
- // voerst Dummy
+ // still a dummy
SwFEShell::EndDrag( pPt, sal_False );
fnDrag = &SwWrtShell::BeginFrmDrag;
return 1;
}
-/*
- * Handler fuer das Togglen der Modi. Liefern alten Mode zurueck.
- */
-
-
+// Handler for toggling the modes. Returns back the old mode.
long SwWrtShell::ToggleAddMode()
{
@@ -805,7 +722,6 @@ long SwWrtShell::ToggleAddMode()
return !bAddMode;
}
-
long SwWrtShell::ToggleBlockMode()
{
bBlockMode ? LeaveBlockMode(): EnterBlockMode();
@@ -813,18 +729,14 @@ long SwWrtShell::ToggleBlockMode()
return !bBlockMode;
}
-
long SwWrtShell::ToggleExtMode()
{
bExtMode ? LeaveExtMode() : EnterExtMode();
Invalidate();
return !bExtMode;
}
-/*
- * Draggen im Standard Modus (Selektieren von Inhalt)
- */
-
+// Dragging in standard mode (Selecting of content)
long SwWrtShell::BeginDrag(const Point * /*pPt*/, sal_Bool )
{
@@ -852,8 +764,6 @@ long SwWrtShell::BeginDrag(const Point * /*pPt*/, sal_Bool )
return 1;
}
-
-
long SwWrtShell::Drag(const Point *, sal_Bool )
{
if( IsSelTblCells() )
@@ -862,8 +772,6 @@ long SwWrtShell::Drag(const Point *, sal_Bool )
return 1;
}
-
-
long SwWrtShell::EndDrag(const Point * /*pPt*/, sal_Bool )
{
fnDrag = &SwWrtShell::BeginDrag;
@@ -890,9 +798,7 @@ sal_Bool SwWrtShell::SelectTableRowCol( const Point& rPt, const Point* pEnd, boo
return sal_False;
}
-/*------------------------------------------------------------------------
- Beschreibung: Selektion einer Tabellenzeile / Spalte
-------------------------------------------------------------------------*/
+// Description: Selection of a table line or column
sal_Bool SwWrtShell::SelectTableRow()
{
@@ -905,8 +811,6 @@ sal_Bool SwWrtShell::SelectTableRow()
return sal_False;
}
-
-
sal_Bool SwWrtShell::SelectTableCol()
{
if ( SelTblCol() )
@@ -928,28 +832,26 @@ sal_Bool SwWrtShell::SelectTableCell()
}
return sal_False;
}
-/*------------------------------------------------------------------------
- Beschreibung: Prueft, ob eine Wortselektion vorliegt.
- Gemaess den Regeln fuer intelligentes Cut / Paste
- werden umgebende Spaces rausgeschnitten.
- Return: Liefert Art der Wortselektion zurueck.
-------------------------------------------------------------------------*/
-
+// Description: Check if a word selection is present.
+// According to the rules for intelligent cut / paste
+// surrounding spaces are cut out.
+// Return: Delivers the type of the word selection.
int SwWrtShell::IntelligentCut(int nSelection, sal_Bool bCut)
{
- // kein intelligentes Drag and Drop bei Mehrfachselektion
- // es existieren mehrere Cursor, da ein zweiter bereits
- // an die Zielposition gesetzt wurde
+ // On multiple selection no intelligent drag and drop
+ // there are multiple cursors, since a second was placed
+ // already at the target postion.
+an die Zielposition gesetzt wurde
if( IsAddMode() || !(nSelection & nsSelectionType::SEL_TXT) )
return sal_False;
String sTxt;
CharClass& rCC = GetAppCharClass();
- // wenn das erste und das letzte Zeichen kein Wortzeichen ist,
- // ist kein Wort selektiert.
+ // If the first character is no word character,
+ // no word selected.
sal_Unicode cPrev = GetChar(sal_False);
sal_Unicode cNext = GetChar(sal_True, -1);
if( !cPrev || !cNext ||
@@ -961,7 +863,7 @@ int SwWrtShell::IntelligentCut(int nSelection, sal_Bool bCut)
cNext = GetChar(sal_True);
int cWord = NO_WORD;
- // ist ein Wort selektiert?
+ // is a word seleced?
if(!cWord && cPrev && cNext &&
CH_TXTATR_BREAKWORD != cPrev && CH_TXTATR_INWORD != cPrev &&
CH_TXTATR_BREAKWORD != cNext && CH_TXTATR_INWORD != cNext &&
@@ -972,7 +874,7 @@ int SwWrtShell::IntelligentCut(int nSelection, sal_Bool bCut)
if(cWord == WORD_NO_SPACE && ' ' == cPrev )
{
cWord = WORD_SPACE_BEFORE;
- // Space davor loeschen
+ // delete the space before
if(bCut)
{
Push();
@@ -988,7 +890,7 @@ int SwWrtShell::IntelligentCut(int nSelection, sal_Bool bCut)
else if(cWord == WORD_NO_SPACE && cNext == ' ')
{
cWord = WORD_SPACE_AFTER;
- // Space dahinter loeschen
+ // delete the space behind
if(bCut) {
Push();
if(!IsCrsrPtAtEnd()) SwapPam();
@@ -1002,8 +904,6 @@ int SwWrtShell::IntelligentCut(int nSelection, sal_Bool bCut)
return cWord;
}
-
-
// jump to the next / previous hyperlink - inside text and also
// on graphics
bool SwWrtShell::SelectNextPrevHyperlink( bool bNext )
@@ -1029,8 +929,8 @@ bool SwWrtShell::SelectNextPrevHyperlink( bool bNext )
if ( bFrmSelected )
UnSelectFrm();
- // Funktionspointer fuer das Aufheben der Selektion setzen
- // bei Cursor setzen
+ // Set the function pointer for the canceling of the selection
+ // set at cursor
fnKillSel = &SwWrtShell::ResetSelect;
fnSetCrsr = &SwWrtShell::SetCrsrKillSel;
bCreateXSelection = true;
@@ -1053,15 +953,10 @@ bool SwWrtShell::SelectNextPrevHyperlink( bool bNext )
return bRet;
}
-
-/* fuer den Erhalt der Selektion wird nach SetMark() der Cursor
- * nach links bewegt, damit er durch das Einfuegen von Text nicht
- * verschoben wird. Da auf der CORE-Seite am aktuellen Cursor
- * eine bestehende Selektion aufgehoben wird, wird der Cursor auf
- * den Stack gepushed. Nach dem Verschieben werden sie wieder
- * zusammengefasst. */
-
-
-
+// For the preservation of the selection the cursor will be moved left
+// after SetMark(), so that the cursor is not moved by inserting text.
+// Because a present selection at the CORE page is cleared at the
+// current cursor position, the cursor will be pushed on the stack.
+// After moving, they will again resummarized.
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */