Kaydet (Commit) ce6cb1db authored tarafından Philipp Riemer's avatar Philipp Riemer

fdo#39468: Translate German comments in sw/source/core/edit

Change-Id: I48682db4a27be298b8c0392603879d2e12f24cd7
Reviewed-on: https://gerrit.libreoffice.org/4203Reviewed-by: 's avatarPhilipp Riemer <ruderphilipp@gmail.com>
Tested-by: 's avatarPhilipp Riemer <ruderphilipp@gmail.com>
üst eaeaafbf
This diff is collapsed.
......@@ -33,27 +33,21 @@
#include <comcore.hrc>
#include <list>
/************************************************************
* Loeschen
************************************************************/
void SwEditShell::DeleteSel( SwPaM& rPam, sal_Bool* pUndo )
{
// nur bei Selektion
// only for selections
if( !rPam.HasMark() || *rPam.GetPoint() == *rPam.GetMark())
return;
// besteht eine Selection in einer Tabelle ?
// dann nur den Inhalt der selektierten Boxen loeschen
// jetzt gibt es 2 Faelle die beachtet werden muessen:
// 1. Point und Mark stehen in einer Box, Selection normal loeschen
// 2. Point und Mark stehen in unterschiedlichen Boxen, alle
// selektierten Boxen suchen in den Inhalt loeschen
// Is the selection in a table? Then delete only the content of the selected boxes.
// Here, there are two cases:
// 1. Point and Mark are in one box, delete selection as usual
// 2. Point and Mare are in different boxes, search all selected boxes and delete content
if( rPam.GetNode()->FindTableNode() &&
rPam.GetNode()->StartOfSectionNode() !=
rPam.GetNode(sal_False)->StartOfSectionNode() )
{
// in Tabellen das Undo gruppieren
// group the Undo in the table
if( pUndo && !*pUndo )
{
GetDoc()->GetIDocumentUndoRedo().StartUndo( UNDO_START, NULL );
......@@ -68,37 +62,37 @@ void SwEditShell::DeleteSel( SwPaM& rPam, sal_Bool* pUndo )
if( pEndSelPos->nNode.GetIndex() <= rEndNd.GetIndex() )
{
*aDelPam.GetPoint() = *pEndSelPos;
pEndSelPos = 0; // Pointer als Flag missbrauchen
pEndSelPos = 0; // misuse a pointer as a flag
}
else
{
// dann ans Ende der Section
// then go to the end of the selection
aDelPam.GetPoint()->nNode = rEndNd;
aDelPam.Move( fnMoveBackward, fnGoCntnt );
}
// geschuetze Boxen ueberspringen !
// skip protected boxes
if( !pNd->IsCntntNode() ||
!pNd->IsInProtectSect() )
{
// alles loeschen
// delete everything
GetDoc()->DeleteAndJoin( aDelPam );
SaveTblBoxCntnt( aDelPam.GetPoint() );
}
if( !pEndSelPos ) // am Ende der Selection
if( !pEndSelPos ) // at the end of a selection
break;
aDelPam.DeleteMark();
aDelPam.Move( fnMoveForward, fnGoCntnt ); // naechste Box
aDelPam.Move( fnMoveForward, fnGoCntnt ); // next box
} while( pEndSelPos );
}
else
{
// alles loeschen
// delete everything
GetDoc()->DeleteAndJoin( rPam );
SaveTblBoxCntnt( rPam.GetPoint() );
}
// Selection wird nicht mehr benoetigt.
// Selection is not needed anymore
rPam.DeleteMark();
}
......@@ -112,7 +106,7 @@ long SwEditShell::Delete()
StartAllAction();
sal_Bool bUndo = GetCrsr()->GetNext() != GetCrsr();
if( bUndo ) // mehr als eine Selection ?
if( bUndo ) // more than one selection?
{
SwRewriter aRewriter;
aRewriter.AddRule(UndoArg1, SW_RESSTR(STR_MULTISEL));
......@@ -124,7 +118,7 @@ long SwEditShell::Delete()
DeleteSel( *PCURCRSR, &bUndo );
FOREACHPAM_END()
// falls eine Undo-Klammerung, dann hier beenden
// If undo container then close here
if( bUndo )
{
GetDoc()->GetIDocumentUndoRedo().EndUndo(UNDO_END, 0);
......@@ -223,14 +217,13 @@ long SwEditShell::Copy( SwEditShell* pDestShell )
GetDoc()->SplitNode( *pPos, false );
}
// nur bei Selektion (nicht Textnodes haben Selection,
// aber Point/GetMark sind gleich
// Only for a selection (non-text nodes have selection but Point/GetMark are equal)
if( !PCURCRSR->HasMark() || *PCURCRSR->GetPoint() == *PCURCRSR->GetMark() )
continue;
if( bFirstMove )
{
// Anfangs-Position vom neuen Bereich merken
// Store start position of the new area
aSttNdIdx = pPos->nNode.GetIndex()-1;
nSttCntIdx = pPos->nContent.GetIndex();
bFirstMove = false;
......@@ -258,27 +251,26 @@ long SwEditShell::Copy( SwEditShell* pDestShell )
}
else
{
// falls beim Move der Cursor "gewandert" ist, so setze hier auch
// seinen GetMark um, damit dieser nie in den Wald zeigt.
// If the cursor moved during move process, move also its GetMark
pDestShell->GetCrsr()->SetMark();
pDestShell->GetCrsr()->DeleteMark();
}
#if OSL_DEBUG_LEVEL > 0
// pruefe ob die Indizies auch in den richtigen Nodes angemeldet sind
// check if the indices are registered in the correct nodes
{
SwPaM* pCmp = (SwPaM*)pDestShell->GetCrsr(); // sicher den Pointer auf Cursor
SwPaM* pCmp = (SwPaM*)pDestShell->GetCrsr(); // store pointer to cursor
do {
OSL_ENSURE( pCmp->GetPoint()->nContent.GetIdxReg()
== pCmp->GetCntntNode(), "Point im falschen Node" );
== pCmp->GetCntntNode(), "Point in wrong Node" );
OSL_ENSURE( pCmp->GetMark()->nContent.GetIdxReg()
== pCmp->GetCntntNode(sal_False), "Mark im falschen Node" );
== pCmp->GetCntntNode(sal_False), "Mark in wrong Node" );
bool bTst = *pCmp->GetPoint() == *pCmp->GetMark();
(void) bTst;
} while( pDestShell->GetCrsr() != ( pCmp = (SwPaM*)pCmp->GetNext() ) );
}
#endif
// Undo-Klammerung hier beenden
// close Undo container here
pDestShell->GetDoc()->GetIDocumentUndoRedo().EndUndo( UNDO_END, NULL );
pDestShell->EndAllAction();
......@@ -287,13 +279,13 @@ long SwEditShell::Copy( SwEditShell* pDestShell )
return (long)bRet;
}
// Ersetz einen selektierten Bereich in einem TextNode mit dem
// String. Ist fuers Suchen&Ersetzen gedacht.
// bRegExpRplc - ersetze Tabs (\\t) und setze den gefundenen String
// ein ( nicht \& )
// z.B.: Fnd: "zzz", Repl: "xx\t\\t..&..\&"
// --> "xx\t<Tab>..zzz..&"
/** Replace a selected area in a text node with a given string.
*
* Intended for "search & replace".
*
* @param bRegExpRplc if <true> replace tabs (\\t) and replace with found string (not \&).
* E.g. [Fnd: "zzz", Repl: "xx\t\\t..&..\&"] --> "xx\t<Tab>..zzz..&"
*/
sal_Bool SwEditShell::Replace( const String& rNewStr, sal_Bool bRegExpRplc )
{
SET_CURR_SHELL( this );
......@@ -313,22 +305,21 @@ sal_Bool SwEditShell::Replace( const String& rNewStr, sal_Bool bRegExpRplc )
}
FOREACHPAM_END()
// Undo-Klammerung hier beenden
// close Undo container here
GetDoc()->GetIDocumentUndoRedo().EndUndo(UNDO_EMPTY, NULL);
EndAllAction();
}
return bRet;
}
// Special-Methode fuer JOE's- Wizzards
/// special method for JOE's wizards
sal_Bool SwEditShell::DelFullPara()
{
sal_Bool bRet = sal_False;
if( !IsTableMode() )
{
SwPaM* pCrsr = GetCrsr();
// keine Mehrfach-Selection
// no multi selection
if( pCrsr->GetNext() == pCrsr && !HasReadonlySel() )
{
SET_CURR_SHELL( this );
......
......@@ -107,12 +107,11 @@ void SwEditShell::FillByEx(SwTxtFmtColl* pColl, sal_Bool bReset)
const SfxItemSet* pSet = pCnt->GetpSwAttrSet();
if( pSet )
{
// JP 05.10.98: falls eines der Attribute Break/PageDesc/NumRule(auto)
// im ItemSet steht, so entferne die VORM setzen an der Collection.
// Ansonst wird zu viel gemacht oder falsche gemacht (NumRules!)
// JP 05.10.98: Special treatment if one of the attribues Break/PageDesc/NumRule(auto) is
// in the ItemSet. Otherwise there will be too much or wrong processing (NumRules!)
// Bug 57568
// AutoNumRules NICHT in die Vorlagen uebernehmen
// Do NOT copy AutoNumRules into the template
const SfxPoolItem* pItem;
const SwNumRule* pRule = 0;
if( SFX_ITEM_SET == pSet->GetItemState( RES_BREAK, sal_False ) ||
......
This diff is collapsed.
......@@ -25,7 +25,7 @@
#include <ndtxt.hxx>
#include <docary.hxx>
#include <swwait.hxx>
#include <swundo.hxx> // fuer die UndoIds
#include <swundo.hxx> // for UndoIds
#include <section.hxx>
#include <doctxm.hxx>
#include <edglbldc.hxx>
......@@ -58,7 +58,7 @@ sal_uInt16 SwEditShell::GetGlobalDocContent( SwGlblDocContents& rArr ) const
if( !getIDocumentSettingAccess()->get(IDocumentSettingAccess::GLOBAL_DOCUMENT) )
return 0;
// dann alle gelinkten Bereiche auf der obersten Ebene
// then all linked areas on the topmost level
SwDoc* pMyDoc = GetDoc();
const SwSectionFmts& rSectFmts = pMyDoc->GetSections();
sal_uInt16 n;
......@@ -73,7 +73,7 @@ sal_uInt16 SwEditShell::GetGlobalDocContent( SwGlblDocContents& rArr ) const
{
case TOX_HEADER_SECTION: break; // ignore
case TOX_CONTENT_SECTION:
OSL_ENSURE( pSect->ISA( SwTOXBaseSection ), "keine TOXBaseSection!" );
OSL_ENSURE( pSect->ISA( SwTOXBaseSection ), "no TOXBaseSection!" );
pNew = new SwGlblDocContent( (SwTOXBaseSection*)pSect );
break;
......@@ -86,14 +86,14 @@ sal_uInt16 SwEditShell::GetGlobalDocContent( SwGlblDocContents& rArr ) const
}
}
// und als letztes die Dummies (sonstiger Text) einfuegen
// and finally add the dummies (other text)
SwNode* pNd;
sal_uLong nSttIdx = pMyDoc->GetNodes().GetEndOfExtras().GetIndex() + 2;
for( n = 0; n < rArr.size(); ++n )
{
const SwGlblDocContent& rNew = *rArr[ n ];
// suche von StartPos bis rNew.DocPos nach einem Content Node.
// Existiert dieser, so muss ein DummyEintrag eingefuegt werden.
// Search from StartPos until rNew.DocPos for a content node.
// If one exists then a dummy entry is needed.
for( ; nSttIdx < rNew.GetDocPos(); ++nSttIdx )
if( ( pNd = pMyDoc->GetNodes()[ nSttIdx ])->IsCntntNode()
|| pNd->IsSectionNode() || pNd->IsTableNode() )
......@@ -102,16 +102,16 @@ sal_uInt16 SwEditShell::GetGlobalDocContent( SwGlblDocContents& rArr ) const
if( !rArr.insert( pNew ).second )
delete pNew;
else
++n; // auf die naechste Position
++n; // to the next position
break;
}
// StartPosition aufs Ende setzen
// set StartPosition to the end
nSttIdx = pMyDoc->GetNodes()[ rNew.GetDocPos() ]->EndOfSectionIndex();
++nSttIdx;
}
// sollte man das Ende auch noch setzen??
// Should the end also be set?
if( !rArr.empty() )
{
sal_uLong nNdEnd = pMyDoc->GetNodes().GetEndOfContent().GetIndex();
......@@ -259,7 +259,7 @@ sal_Bool SwEditShell::DeleteGlobalDocContent( const SwGlblDocContents& rArr ,
sal_uLong nDelIdx = rDelPos.GetDocPos();
if( 1 == rArr.size() )
{
// ein Node muss aber da bleiben!
// we need at least one node!
rPos.nNode = nDelIdx - 1;
rPos.nContent.Assign( 0, 0 );
......
......@@ -28,17 +28,13 @@
#include <editsh.hxx>
#include <edimp.hxx>
#include <frmfmt.hxx>
#include <swundo.hxx> // fuer die UndoIds
#include <swundo.hxx> // for UndoIds
#include <ndtxt.hxx>
#include <swtable.hxx> // fuers kopieren von Tabellen
#include <swtable.hxx> // for table copying
#include <shellio.hxx> // SwTextBlocks
#include <acorrect.hxx>
#include <swerror.h> // SwTextBlocks
/******************************************************************************
* jetzt mit einem verkappten Reader/Writer/Dokument
******************************************************************************/
void SwEditShell::InsertGlossary( SwTextBlocks& rGlossary, const String& rStr )
{
StartAllAction();
......@@ -46,13 +42,7 @@ void SwEditShell::InsertGlossary( SwTextBlocks& rGlossary, const String& rStr )
EndAllAction();
}
/******************************************************************************
* aktuelle Selektion zum Textbaustein machen und ins
* Textbausteindokument einfuegen, einschliesslich Vorlagen
******************************************************************************/
/// convert current selection into text block and add to the text block document, incl. templates
sal_uInt16 SwEditShell::MakeGlossary( SwTextBlocks& rBlks, const String& rName, const String& rShortName,
sal_Bool bSaveRelFile, const String* pOnlyTxt )
{
......@@ -124,7 +114,7 @@ sal_uInt16 SwEditShell::SaveGlossaryDoc( SwTextBlocks& rBlock,
pCrsr->GetPoint()->nContent.Assign( pCntntNd, 0 );
pCrsr->SetMark();
// dann bis zum Ende vom Nodes Array
// then until the end of the Node array
pCrsr->GetPoint()->nNode = pMyDoc->GetNodes().GetEndOfContent().GetIndex()-1;
pCntntNd = pCrsr->GetCntntNode();
if( pCntntNd )
......@@ -163,14 +153,10 @@ sal_uInt16 SwEditShell::SaveGlossaryDoc( SwTextBlocks& rBlock,
return nRet;
}
/******************************************************************************
* kopiere alle Selectionen und das Doc
******************************************************************************/
/// copy all selections and the doc
sal_Bool SwEditShell::_CopySelToDoc( SwDoc* pInsDoc, SwNodeIndex* pSttNd )
{
OSL_ENSURE( pInsDoc, "kein Ins.Dokument" );
OSL_ENSURE( pInsDoc, "no Ins.Document" );
SwNodes& rNds = pInsDoc->GetNodes();
......@@ -178,7 +164,7 @@ sal_Bool SwEditShell::_CopySelToDoc( SwDoc* pInsDoc, SwNodeIndex* pSttNd )
SwCntntNode * pNd = aIdx.GetNode().GetCntntNode();
SwPosition aPos( aIdx, SwIndex( pNd, pNd->Len() ));
// soll der Index auf Anfang returnt werden ?
// Should the index be reset to start?
if( pSttNd )
{
*pSttNd = aPos.nNode;
......@@ -192,18 +178,17 @@ sal_Bool SwEditShell::_CopySelToDoc( SwDoc* pInsDoc, SwNodeIndex* pSttNd )
if( IsTableMode() )
{
// kopiere Teile aus einer Tabelle: lege eine Tabelle mit der Breite
// von der Originalen an und kopiere die selectierten Boxen.
// Die Groessen werden prozentual korrigiert.
// Copy parts of a table: create a table with the width of the original one and copy the
// selected boxes. The sizes are corrected on a percentage basis.
// lasse ueber das Layout die Boxen suchen
// search boxes using the layout
SwTableNode* pTblNd;
SwSelBoxes aBoxes;
GetTblSel( *this, aBoxes );
if( !aBoxes.empty() && 0 != (pTblNd = (SwTableNode*)aBoxes[0]
->GetSttNd()->FindTableNode() ))
{
// teste ob der TabellenName kopiert werden kann
// check if the table name can be copied
sal_Bool bCpyTblNm = aBoxes.size() == pTblNd->GetTable().GetTabSortBoxes().size();
if( bCpyTblNm )
{
......@@ -255,23 +240,20 @@ sal_Bool SwEditShell::_CopySelToDoc( SwDoc* pInsDoc, SwNodeIndex* pSttNd )
if( !pInsDoc->IsExpFldsLocked() )
pInsDoc->UpdateExpFlds(NULL, true);
// die gemerkte Node-Position wieder auf den richtigen Node
// set the saved Node position back to the correct Node
if( bRet && pSttNd )
++(*pSttNd);
return bRet;
}
/*------------------------------------------------------------------------
Beschreibung: Text innerhalb der Selektion erfragen
Returnwert: liefert sal_False, wenn der selektierte Bereich
zu gross ist, um in den Stringpuffer kopiert zu werden.
------------------------------------------------------------------------*/
/** Get text in a Selection
*
* @return sal_False if the selected area is too big for being copied into the string buffer
*/
sal_Bool SwEditShell::GetSelectedText( String &rBuf, int nHndlParaBrk )
{
GetCrsr(); // ggfs. alle Cursor erzeugen lassen
GetCrsr(); // creates all cursors if needed
if( IsSelOnePara() )
{
rBuf = GetSelTxt();
......@@ -304,7 +286,7 @@ sal_Bool SwEditShell::GetSelectedText( String &rBuf, int nHndlParaBrk )
SwReaderWriter::GetWriter( OUString(FILTER_TEXT), String(), xWrt );
if( xWrt.Is() )
{
// Selektierte Bereiche in ein ASCII Dokument schreiben
// write selected areas into a ASCII document
SwWriter aWriter( aStream, *this);
xWrt->SetShowProgress( sal_False );
......
This diff is collapsed.
This diff is collapsed.
......@@ -112,14 +112,11 @@ SwPaM& SwPamRanges::SetPam( sal_uInt16 nArrPos, SwPaM& rPam )
return rPam;
}
// Numerierung Outline Regelwerk
// Rule book for outline numbering
void SwEditShell::SetOutlineNumRule(const SwNumRule& rRule)
{
StartAllAction(); // Klammern fuers Updaten !!
StartAllAction(); // bracketing for updating!
GetDoc()->SetOutlineNumRule(rRule);
EndAllAction();
}
......@@ -130,18 +127,17 @@ const SwNumRule* SwEditShell::GetOutlineNumRule() const
return GetDoc()->GetOutlineNumRule();
}
// setzt, wenn noch keine Numerierung, sonst wird geaendert
// arbeitet mit alten und neuen Regeln, nur Differenzen aktualisieren
// Absaetze ohne Numerierung, aber mit Einzuegen
// Set if there is no numbering yet, else update.
// Works with old and new rules. Update only differences.
// paragraphs without numbering, with indentations
bool SwEditShell::NoNum()
{
bool bRet = true;
StartAllAction();
SwPaM* pCrsr = GetCrsr();
if( pCrsr->GetNext() != pCrsr ) // Mehrfachselektion ?
if( pCrsr->GetNext() != pCrsr ) // Multiple selection?
{
GetDoc()->GetIDocumentUndoRedo().StartUndo( UNDO_START, NULL );
SwPamRanges aRangeArr( *pCrsr );
......@@ -156,7 +152,7 @@ bool SwEditShell::NoNum()
EndAllAction();
return bRet;
}
// Loeschen, Splitten der Aufzaehlungsliste
sal_Bool SwEditShell::SelectionHasNumber() const
{
sal_Bool bResult = HasNumber();
......@@ -281,12 +277,13 @@ sal_Bool SwEditShell::HasBullet() const
}
// <- #i29560#
/// delete, split list
void SwEditShell::DelNumRules()
{
StartAllAction();
SwPaM* pCrsr = GetCrsr();
if( pCrsr->GetNext() != pCrsr ) // Mehrfachselektion ?
if( pCrsr->GetNext() != pCrsr ) // multi-selection?
{
GetDoc()->GetIDocumentUndoRedo().StartUndo( UNDO_START, NULL );
SwPamRanges aRangeArr( *pCrsr );
......@@ -300,28 +297,24 @@ void SwEditShell::DelNumRules()
else
GetDoc()->DelNumRules( *pCrsr );
// rufe das AttrChangeNotify auf der UI-Seite. Sollte eigentlich
// ueberfluessig sein, aber VB hatte darueber eine Bugrep.
// Call AttrChangeNotify on the UI-side. Should actually be redundant but there was a bug once.
CallChgLnk();
// cursor can not be anymore in front of a label,
// because numbering/bullet is deleted.
// Cursor cannot be in front of a label anymore, because numbering/bullet is deleted.
SetInFrontOfLabel( false );
GetDoc()->SetModified();
EndAllAction();
}
// Hoch-/Runterstufen
// up- & downgrading
bool SwEditShell::NumUpDown( bool bDown )
{
StartAllAction();
bool bRet = true;
SwPaM* pCrsr = GetCrsr();
if( pCrsr->GetNext() == pCrsr ) // keine Mehrfachselektion ?
if( pCrsr->GetNext() == pCrsr ) // no multiple selection ?
bRet = GetDoc()->NumUpDown( *pCrsr, bDown );
else
{
......@@ -431,7 +424,7 @@ bool SwEditShell::MoveParagraph( long nOffset )
SwPaM *pCrsr = GetCrsr();
if( !pCrsr->HasMark() )
{
// sorge dafuer, das Bound1 und Bound2 im gleichen Node stehen
// Ensures that Bound1 and Bound2 are in the same Node
pCrsr->SetMark();
pCrsr->DeleteMark();
}
......@@ -471,7 +464,7 @@ bool SwEditShell::MoveNumParas( bool bUpperLower, bool bUpperLeft )
{
StartAllAction();
// auf alle Selektionen ??
// On all selections?
SwPaM* pCrsr = GetCrsr();
SwPaM aCrsr( *pCrsr->Start() );
aCrsr.SetMark();
......@@ -486,11 +479,11 @@ bool SwEditShell::MoveNumParas( bool bUpperLower, bool bUpperLeft )
{
if( bUpperLower )
{
// ueber die naechste Nummerierung
// on top of the next numbering
long nOffset = 0;
const SwNode* pNd;
if( bUpperLeft ) // verschiebe nach oben
if( bUpperLeft ) // move up
{
SwPosition aPos( *aCrsr.GetMark() );
if( GetDoc()->GotoPrevNum( aPos, false ) )
......@@ -507,7 +500,7 @@ bool SwEditShell::MoveNumParas( bool bUpperLower, bool bUpperLeft )
nOffset = nIdx - nStt;
}
}
else // verschiebe nach unten
else // move down
{
const SwNumRule* pOrig = aCrsr.GetNode(sal_False)->GetTxtNode()->GetNumRule();
if( aCrsr.GetNode()->IsTxtNode() &&
......@@ -566,7 +559,7 @@ bool SwEditShell::OutlineUpDown( short nOffset )
bool bRet = true;
SwPaM* pCrsr = GetCrsr();
if( pCrsr->GetNext() == pCrsr ) // keine Mehrfachselektion ?
if( pCrsr->GetNext() == pCrsr ) // no multi selection?
bRet = GetDoc()->OutlineUpDown( *pCrsr, nOffset );
else
{
......@@ -683,7 +676,7 @@ bool SwEditShell::NumOrNoNum( sal_Bool bNumOn, bool bChkStart )
sal_Bool SwEditShell::IsNoNum( sal_Bool bChkStart ) const
{
// ein Backspace im Absatz ohne Nummer wird zum Delete
// a Backspace in the paragraph without number becomes a Delete
sal_Bool bResult = sal_False;
SwPaM* pCrsr = GetCrsr();
......@@ -703,7 +696,7 @@ sal_Bool SwEditShell::IsNoNum( sal_Bool bChkStart ) const
sal_uInt8 SwEditShell::GetNumLevel() const
{
// gebe die akt. Ebene zurueck, auf der sich der Point vom Cursor befindet
// return current level where the point of the cursor is
sal_uInt8 nLevel = MAXLEVEL; //end,zhaojianwei
SwPaM* pCrsr = GetCrsr();
......@@ -741,7 +734,7 @@ void SwEditShell::SetCurNumRule( const SwNumRule& rRule,
GetDoc()->GetIDocumentUndoRedo().StartUndo( UNDO_START, NULL );
SwPaM* pCrsr = GetCrsr();
if( pCrsr->GetNext() != pCrsr ) // Mehrfachselektion ?
if( pCrsr->GetNext() != pCrsr ) // multiple selection ?
{
SwPamRanges aRangeArr( *pCrsr );
SwPaM aPam( *pCrsr->GetPoint() );
......@@ -790,7 +783,7 @@ void SwEditShell::SetNumRuleStart( sal_Bool bFlag, SwPaM* pPaM )
{
StartAllAction();
SwPaM* pCrsr = pPaM ? pPaM : GetCrsr();
if( pCrsr->GetNext() != pCrsr ) // Mehrfachselektion ?
if( pCrsr->GetNext() != pCrsr ) // multiple selection ?
{
GetDoc()->GetIDocumentUndoRedo().StartUndo( UNDO_START, NULL );
SwPamRanges aRangeArr( *pCrsr );
......@@ -820,7 +813,7 @@ void SwEditShell::SetNodeNumStart( sal_uInt16 nStt, SwPaM* pPaM )
StartAllAction();
SwPaM* pCrsr = pPaM ? pPaM : GetCrsr();
if( pCrsr->GetNext() != pCrsr ) // Mehrfachselektion ?
if( pCrsr->GetNext() != pCrsr ) // multiple selection ?
{
GetDoc()->GetIDocumentUndoRedo().StartUndo( UNDO_START, NULL );
SwPamRanges aRangeArr( *pCrsr );
......
......@@ -155,13 +155,12 @@ sal_Bool SwEditShell::TableToText( sal_Unicode cCh )
StartAllAction();
// verschiebe den akt. Cursor aus dem Tabellen Bereich
// angemeldet ist
// move current Cursor out of the listing area
SwNodeIndex aTabIdx( *pTblNd );
pCrsr->DeleteMark();
pCrsr->GetPoint()->nNode = *pTblNd->EndOfSectionNode();
pCrsr->GetPoint()->nContent.Assign( 0, 0 );
// SPoint und Mark aus dem Bereich verschieben !!!
// move sPoint and Mark out of the area!
pCrsr->SetMark();
pCrsr->DeleteMark();
......@@ -190,7 +189,7 @@ sal_Bool SwEditShell::IsTextToTableAvailable() const
{
bOnlyText = sal_True;
// pruefe ob in der Selection eine Tabelle liegt
// check if selection is in listing
sal_uLong nStt = PCURCRSR->GetMark()->nNode.GetIndex(),
nEnd = PCURCRSR->GetPoint()->nNode.GetIndex();
if( nStt > nEnd ) { sal_uLong n = nStt; nStt = nEnd; nEnd = n; }
......@@ -242,9 +241,7 @@ void SwEditShell::InsertDDETable( const SwInsertTableOptions& rInsTblOpts,
EndAllAction();
}
/*--------------------------------------------------------------------
Beschreibung: Tabellenfelder einer Tabelle updaten
--------------------------------------------------------------------*/
/** update fields of a listing */
void SwEditShell::UpdateTable()
{
const SwTableNode* pTblNd = IsCrsrInTbl();
......@@ -264,7 +261,8 @@ void SwEditShell::UpdateTable()
}
}
// Change Modus erfragen/setzen
// get/set Change Mode
TblChgMode SwEditShell::GetTblChgMode() const
{
TblChgMode eMode;
......@@ -280,7 +278,6 @@ void SwEditShell::SetTblChgMode( TblChgMode eMode )
{
const SwTableNode* pTblNd = IsCrsrInTbl();
// Keine Arme keine Kekse
if( pTblNd )
{
((SwTable&)pTblNd->GetTable()).SetTblChgMode( eMode );
......@@ -318,7 +315,7 @@ sal_Bool SwEditShell::GetTblBoxFormulaAttrs( SfxItemSet& rSet ) const
const SwTableBoxFmt* pTblFmt = (SwTableBoxFmt*)pSelBox->GetFrmFmt();
if( !n )
{
// Formeln in die externe Darstellung bringen!
// Convert formulae into external presentation
const SwTable& rTbl = pSelBox->GetSttNd()->FindTableNode()->GetTable();
SwTableFmlUpdate aTblUpdate( (SwTable*)&rTbl );
......@@ -354,7 +351,7 @@ void SwEditShell::SetTblBoxFormulaAttrs( const SfxItemSet& rSet )
} while( false );
}
// beim setzen einer Formel keine Ueberpruefung mehr vornehmen!
// When setting a formula, do not check further!
if( SFX_ITEM_SET == rSet.GetItemState( RES_BOXATR_FORMULA ))
ClearTblBoxCntnt();
......@@ -482,13 +479,13 @@ sal_Bool SwEditShell::CanMergeTable( sal_Bool bWithPrev, sal_Bool* pChkNxtPrv )
bNew == pChkNd->GetTable().IsNewModel() &&
// Consider table in table case
pChkNd->EndOfSectionIndex() == pTblNd->GetIndex() - 1 )
*pChkNxtPrv = sal_True, bRet = sal_True; // mit Prev ist moeglich
*pChkNxtPrv = sal_True, bRet = sal_True; // using Prev is possible
else
{
pChkNd = rNds[ pTblNd->EndOfSectionIndex() + 1 ]->GetTableNode();
if( pChkNd && !pChkNd->GetTable().ISA( SwDDETable ) &&
bNew == pChkNd->GetTable().IsNewModel() )
*pChkNxtPrv = sal_False, bRet = sal_True; // mit Next ist moeglich
*pChkNxtPrv = sal_False, bRet = sal_True; // using Next is possible
}
}
else
......@@ -512,7 +509,7 @@ sal_Bool SwEditShell::CanMergeTable( sal_Bool bWithPrev, sal_Bool* pChkNxtPrv )
return bRet;
}
// setze das InsertDB als Tabelle Undo auf:
/** create InsertDB as table Undo */
void SwEditShell::AppendUndoForInsertFromDB( sal_Bool bIsTable )
{
GetDoc()->AppendUndoForInsertFromDB( *GetCrsr(), bIsTable );
......
......@@ -54,10 +54,7 @@ using namespace ::com::sun::star::i18n;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::util;
/*--------------------------------------------------------------------
Beschreibung: Verzeichnismarkierung ins Dokument einfuegen/loeschen
--------------------------------------------------------------------*/
// Add/delete listing markers to a document
void SwEditShell::Insert(const SwTOXMark& rMark)
{
......@@ -94,11 +91,7 @@ void SwEditShell::DeleteTOXMark( SwTOXMark* pMark )
EndAllAction();
}
/*--------------------------------------------------------------------
Beschreibung: Alle Verzeichnismarkierungen am SPoint zusammensuchen
--------------------------------------------------------------------*/
/// Collect all listing markers
sal_uInt16 SwEditShell::GetCurTOXMarks(SwTOXMarks& rMarks) const
{
return GetDoc()->GetCurTOXMark( *GetCrsr()->Start(), rMarks );
......@@ -133,10 +126,7 @@ void SwEditShell::SetDefaultTOXBase(const SwTOXBase& rBase)
GetDoc()->SetDefaultTOXBase(rBase);
}
/*--------------------------------------------------------------------
Beschreibung: Verzeichnis einfuegen, und Inhalt erzeugen
--------------------------------------------------------------------*/
/// Insert listing and create content
void SwEditShell::InsertTableOf( const SwTOXBase& rTOX, const SfxItemSet* pSet )
{
SET_CURR_SHELL( this );
......@@ -146,36 +136,33 @@ void SwEditShell::InsertTableOf( const SwTOXBase& rTOX, const SfxItemSet* pSet )
::StartProgress( STR_STATSTR_TOX_INSERT, 0, 0, pDocSh );
::SetProgressText( STR_STATSTR_TOX_INSERT, pDocSh );
// Einfuegen des Verzeichnisses
// Insert listing
const SwTOXBaseSection* pTOX = mpDoc->InsertTableOf(
*GetCrsr()->GetPoint(), rTOX, pSet, true );
OSL_ENSURE(pTOX, "Kein aktuelles Verzeichnis");
OSL_ENSURE(pTOX, "No current TOx");
// Formatierung anstossen
// start formatting
CalcLayout();
// Seitennummern eintragen
// insert page numbering
((SwTOXBaseSection*)pTOX)->UpdatePageNum();
pTOX->SetPosAtStartEnd( *GetCrsr()->GetPoint() );
// Fix fuer leere Verzeichnisse
// Fix for empty listing
InvalidateWindows( maVisArea );
::EndProgress( pDocSh );
EndAllAction();
}
/*--------------------------------------------------------------------
Beschreibung: Verzeichnisinhalt erneuern
--------------------------------------------------------------------*/
/// update tables of content
sal_Bool SwEditShell::UpdateTableOf( const SwTOXBase& rTOX, const SfxItemSet* pSet )
{
sal_Bool bRet = sal_False;
OSL_ENSURE( rTOX.ISA( SwTOXBaseSection ), "keine TOXBaseSection!" );
OSL_ENSURE( rTOX.ISA( SwTOXBaseSection ), "no TOXBaseSection!" );
SwTOXBaseSection* pTOX = (SwTOXBaseSection*)&rTOX;
OSL_ENSURE(pTOX, "Keine aktuelles Verzeichnis");
OSL_ENSURE(pTOX, "no current listing");
const SwSectionNode* pSectNd;
if( pTOX && 0 != ( pSectNd = pTOX->GetFmt()->GetSectionNode() ) )
{
......@@ -191,17 +178,17 @@ sal_Bool SwEditShell::UpdateTableOf( const SwTOXBase& rTOX, const SfxItemSet* pS
pMyDoc->GetIDocumentUndoRedo().StartUndo(UNDO_TOXCHANGE, NULL);
// Verzeichnisrumpf erzeugen
// create listing stub
pTOX->Update(pSet);
// Cursor korrigieren
// correct Cursor
if( bInIndex )
pTOX->SetPosAtStartEnd( *GetCrsr()->GetPoint() );
// Formatierung anstossen
// start formatting
CalcLayout();
// Seitennummern eintragen
// insert page numbering
pTOX->UpdatePageNum();
pMyDoc->GetIDocumentUndoRedo().EndUndo(UNDO_TOXCHANGE, NULL);
......@@ -212,11 +199,7 @@ sal_Bool SwEditShell::UpdateTableOf( const SwTOXBase& rTOX, const SfxItemSet* pS
return bRet;
}
/*--------------------------------------------------------------------
Beschreibung: Aktuelles Verzeichnis vor oder in dem der Cursor
steht
--------------------------------------------------------------------*/
/// Get current listing before or at the Cursor
const SwTOXBase* SwEditShell::GetCurTOX() const
{
return GetDoc()->GetCurTOX( *GetCrsr()->GetPoint() );
......@@ -227,18 +210,14 @@ bool SwEditShell::DeleteTOX( const SwTOXBase& rTOXBase, bool bDelNodes )
return GetDoc()->DeleteTOX( (SwTOXBase&)rTOXBase, bDelNodes );
}
/*--------------------------------------------------------------------
Beschreibung: Typen der Verzeichnisse verwalten
--------------------------------------------------------------------*/
// manage types of listings
const SwTOXType* SwEditShell::GetTOXType(TOXTypes eTyp, sal_uInt16 nId) const
{
return mpDoc->GetTOXType(eTyp, nId);
}
/*--------------------------------------------------------------------
Beschreibung: Schluessel fuer Stichwortverzeichnisse verwalten
--------------------------------------------------------------------*/
// manage keys for the alphabetical index
sal_uInt16 SwEditShell::GetTOIKeys( SwTOIKeyType eTyp, std::vector<String>& rArr ) const
{
......@@ -271,15 +250,14 @@ const SwTOXBase* SwEditShell::GetTOX( sal_uInt16 nPos ) const
pSect->GetFmt()->GetSectionNode() &&
nCnt++ == nPos )
{
OSL_ENSURE( pSect->ISA( SwTOXBaseSection ), "keine TOXBaseSection!" );
OSL_ENSURE( pSect->ISA( SwTOXBaseSection ), "no TOXBaseSection!" );
return (SwTOXBaseSection*)pSect;
}
}
return 0;
}
// nach einlesen einer Datei alle Verzeichnisse updaten
/** Update of all listings after reading-in a file */
void SwEditShell::SetUpdateTOX( sal_Bool bFlag )
{
GetDoc()->SetUpdateTOX( bFlag );
......
......@@ -106,24 +106,21 @@ bool SwEditShell::Undo(sal_uInt16 const nCount)
StartAllAction();
{
// eigentlich muesste ja nur der aktuelle Cursor berarbeitet
// werden, d.H. falls ein Ring besteht, diesen temporaer aufheben,
// damit nicht bei Einfuge-Operationen innerhalb von Undo
// an allen Bereichen eingefuegt wird.
// Actually it should be enough to just work on the current Cursor, i.e. if there is a cycle
// cancel the latter temporarily, so that an insert during Undo is not done in all areas.
KillPams();
SetMark(); // Bound1 und Bound2 in den gleichen Node
SetMark(); // Bound1 and Bound2 in the same Node
ClearMark();
// JP 02.04.98: Cursor merken - beim Auto-Format/-Korrektur
// soll dieser wieder an die Position
// Keep Cursor - so that we're able to set it at
// the same position for autoformat or autocorrection
SwUndoId nLastUndoId(UNDO_EMPTY);
GetDoc()->GetIDocumentUndoRedo().GetLastUndoInfo(0, & nLastUndoId);
bool bRestoreCrsr = 1 == nCount && (UNDO_AUTOFORMAT == nLastUndoId ||
UNDO_AUTOCORRECT == nLastUndoId );
Push();
//JP 18.09.97: gesicherten TabellenBoxPtr zerstoeren, eine autom.
// Erkennung darf nur noch fuer die neue "Box" erfolgen!
// Destroy stored TableBoxPtr. A dection is only permitted for the new "Box"!
ClearTblBoxCntnt();
RedlineMode_t eOld = GetDoc()->GetRedlineMode();
......@@ -149,7 +146,7 @@ bool SwEditShell::Undo(sal_uInt16 const nCount)
GetDoc()->SetRedlineMode( eOld );
GetDoc()->CompressRedlines();
// autom. Erkennung fuer die neue "Box"
// automatic detection of the new "Box"
SaveTblBoxCntnt();
}
EndAllAction();
......@@ -169,16 +166,13 @@ bool SwEditShell::Redo(sal_uInt16 const nCount)
StartAllAction();
{
// eigentlich muesste ja nur der aktuelle Cursor berarbeitet
// werden, d.H. falls ein Ring besteht, diesen temporaer aufheben,
// damit nicht bei Einfuge-Operationen innerhalb von Undo
// an allen Bereichen eingefuegt wird.
// Actually it should be enough to just work on the current Cursor, i.e. if there is a cycle
// cancel the latter temporarily, so that an insert during Undo is not done in all areas.
KillPams();
SetMark(); // Bound1 und Bound2 in den gleichen Node
SetMark(); // Bound1 and Bound2 in the same Node
ClearMark();
//JP 18.09.97: gesicherten TabellenBoxPtr zerstoeren, eine autom.
// Erkennung darf nur noch fuer die neue "Box" erfolgen!
// Destroy stored TableBoxPtr. A dection is only permitted for the new "Box"!
ClearTblBoxCntnt();
RedlineMode_t eOld = GetDoc()->GetRedlineMode();
......@@ -198,7 +192,7 @@ bool SwEditShell::Redo(sal_uInt16 const nCount)
GetDoc()->SetRedlineMode( eOld );
GetDoc()->CompressRedlines();
// autom. Erkennung fuer die neue "Box"
// automatic detection of the new "Box"
SaveTblBoxCntnt();
}
......
......@@ -31,12 +31,7 @@
#include <swundo.hxx>
#include <SwRewriter.hxx>
/********************************************************
* Ctor/Dtor
********************************************************/
// verkleideter Copy-Constructor
// masqueraded copy constructor
SwEditShell::SwEditShell( SwEditShell& rEdSH, Window *pWindow )
: SwCrsrShell( rEdSH, pWindow )
{
......@@ -145,15 +140,12 @@ void SwEditShell::CalcLayout()
EndAllAction();
}
/******************************************************************************
* Inhaltsform bestimmen, holen
******************************************************************************/
// OPT: wird fuer jedes Attribut gerufen?
/** Get the content type of a shell
*
* @todo Is this called for every attribute?
*/
sal_uInt16 SwEditShell::GetCntType() const
{
// nur noch am SPoint ist der Inhalt interessant
sal_uInt16 nRet = 0;
if( IsTableMode() )
nRet = CNT_TXT;
......@@ -192,10 +184,7 @@ sal_Bool SwEditShell::HasOtherCnt() const
return sal_False;
}
/******************************************************************************
* Zugriffsfunktionen fuer Filename-Behandlung
******************************************************************************/
// access controll functions for file name handling
SwActContext::SwActContext(SwEditShell *pShell)
: pSh(pShell)
......@@ -222,16 +211,13 @@ SwMvContext::~SwMvContext()
pSh->EndCrsrMove();
}
SwFrmFmt *SwEditShell::GetTableFmt() // OPT: schnellster Test auf Tabelle?
SwFrmFmt *SwEditShell::GetTableFmt() // fastest test on a table
{
const SwTableNode* pTblNd = IsCrsrInTbl();
return pTblNd ? (SwFrmFmt*)pTblNd->GetTable().GetFrmFmt() : 0;
}
// OPT: wieso 3x beim neuen Dokument
// TODO: Why is this called 3x for a new document?
sal_uInt16 SwEditShell::GetTOXTypeCount(TOXTypes eTyp) const
{
return mpDoc->GetTOXTypeCount(eTyp);
......@@ -266,19 +252,23 @@ void SwEditShell::DelAllUndoObj()
GetDoc()->GetIDocumentUndoRedo().DelAllUndoObj();
}
// Zusammenfassen von Kontinuierlichen Insert/Delete/Overwrite von
// Charaktern. Default ist sdbcx::Group-Undo.
// setzt Undoklammerung auf, liefert nUndoId der Klammerung
// Combine continuous calls of Insert/Delete/Overwrite on characters. Default: sdbcx::Group-Undo.
/** open undo container
*
* @return nUndoId ID of the container
*/
SwUndoId SwEditShell::StartUndo( SwUndoId eUndoId,
const SwRewriter *pRewriter )
{ return GetDoc()->GetIDocumentUndoRedo().StartUndo( eUndoId, pRewriter ); }
// schliesst Klammerung der nUndoId, nicht vom UI benutzt
/** close undo container
*
* not used by UI
*
* @param eUndoId ID of the undo container
* @param pRewriter ?
*/
SwUndoId SwEditShell::EndUndo(SwUndoId eUndoId,
const SwRewriter *pRewriter)
{ return GetDoc()->GetIDocumentUndoRedo().EndUndo(eUndoId, pRewriter); }
......@@ -294,9 +284,7 @@ bool SwEditShell::GetFirstRedoInfo(OUString *const o_pStr) const
SwUndoId SwEditShell::GetRepeatInfo(OUString *const o_pStr) const
{ return GetDoc()->GetIDocumentUndoRedo().GetRepeatInfo(o_pStr); }
// AutoKorrektur - JP 27.01.94
/** Auto correction */
void SwEditShell::AutoCorrect( SvxAutoCorrect& rACorr, sal_Bool bInsert,
sal_Unicode cChar )
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment