Hi,
I have submitted a patch for review:
https://gerrit.libreoffice.org/2461
To pull it, you can do:
git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/61/2461/1
fdo#39468: Translate German comments in sd/source/core/
Change-Id: I91af80438dff2aead6bf32cecd3caa97e05c9a65
---
M sd/source/core/CustomAnimationEffect.cxx
M sd/source/core/drawdoc.cxx
M sd/source/core/drawdoc2.cxx
M sd/source/core/drawdoc3.cxx
M sd/source/core/drawdoc4.cxx
5 files changed, 441 insertions(+), 805 deletions(-)
diff --git a/sd/source/core/CustomAnimationEffect.cxx b/sd/source/core/CustomAnimationEffect.cxx
index 90eb27c..94a5002 100644
--- a/sd/source/core/CustomAnimationEffect.cxx
+++ b/sd/source/core/CustomAnimationEffect.cxx
@@ -370,7 +370,7 @@
catch( Exception& )
{
nSubItems = 0;
- OSL_FAIL( "sd::CustomAnimationEffect::getNumberOfSubitems(), exception cought!" );
+ OSL_FAIL( "sd::CustomAnimationEffect::getNumberOfSubitems(), exception caught!" );
}
return nSubItems;
@@ -698,7 +698,7 @@
}
catch( Exception& )
{
- OSL_FAIL( "sd::CustomAnimationEffect::setTarget(), exception cought!" );
+ OSL_FAIL( "sd::CustomAnimationEffect::setTarget(), exception caught!" );
}
}
@@ -735,7 +735,7 @@
}
catch( Exception& )
{
- OSL_FAIL( "sd::CustomAnimationEffect::setTargetSubItem(), exception cought!" );
+ OSL_FAIL( "sd::CustomAnimationEffect::setTargetSubItem(), exception caught!" );
}
}
@@ -787,7 +787,7 @@
}
catch( Exception& )
{
- OSL_FAIL( "sd::CustomAnimationEffect::setDuration(), exception cought!" );
+ OSL_FAIL( "sd::CustomAnimationEffect::setDuration(), exception caught!" );
}
}
@@ -802,7 +802,7 @@
}
catch( Exception& )
{
- OSL_FAIL( "sd::CustomAnimationEffect::setBegin(), exception cought!" );
+ OSL_FAIL( "sd::CustomAnimationEffect::setBegin(), exception caught!" );
}
}
@@ -817,7 +817,7 @@
}
catch( Exception& )
{
- OSL_FAIL( "sd::CustomAnimationEffect::setAcceleration(), exception cought!" );
+ OSL_FAIL( "sd::CustomAnimationEffect::setAcceleration(), exception caught!" );
}
}
// --------------------------------------------------------------------
@@ -831,7 +831,7 @@
}
catch( Exception& )
{
- OSL_FAIL( "sd::CustomAnimationEffect::setDecelerate(), exception cought!" );
+ OSL_FAIL( "sd::CustomAnimationEffect::setDecelerate(), exception caught!" );
}
}
@@ -846,7 +846,7 @@
}
catch( Exception& )
{
- OSL_FAIL( "sd::CustomAnimationEffect::setAutoReverse(), exception cought!" );
+ OSL_FAIL( "sd::CustomAnimationEffect::setAutoReverse(), exception caught!" );
}
}
@@ -1112,7 +1112,7 @@
}
catch( Exception& )
{
- OSL_FAIL( "sd::CustomAnimationEffect::setIterateType(), Exception cought!" );
+ OSL_FAIL( "sd::CustomAnimationEffect::setIterateType(), Exception caught!" );
}
}
@@ -1157,7 +1157,7 @@
}
catch( Exception& )
{
- OSL_FAIL("sd::CustomAnimationEffect::getPath(), exception cought!" );
+ OSL_FAIL("sd::CustomAnimationEffect::getPath(), exception caught!" );
}
return aPath;
@@ -1185,7 +1185,7 @@
}
catch( Exception& )
{
- OSL_FAIL("sd::CustomAnimationEffect::setPath(), exception cought!" );
+ OSL_FAIL("sd::CustomAnimationEffect::setPath(), exception caught!" );
}
}
@@ -1234,7 +1234,7 @@
}
catch( Exception& )
{
- OSL_FAIL("sd::CustomAnimationEffect::getProperty(), exception cought!" );
+ OSL_FAIL("sd::CustomAnimationEffect::getProperty(), exception caught!" );
}
return aProperty;
@@ -1311,7 +1311,7 @@
}
catch( Exception& )
{
- OSL_FAIL("sd::CustomAnimationEffect::setProperty(), exception cought!" );
+ OSL_FAIL("sd::CustomAnimationEffect::setProperty(), exception caught!" );
}
return bChanged;
@@ -1367,7 +1367,7 @@
}
catch( Exception& )
{
- OSL_FAIL("sd::CustomAnimationEffect::getColor(), exception cought!" );
+ OSL_FAIL("sd::CustomAnimationEffect::getColor(), exception caught!" );
}
return aColor;
@@ -1422,7 +1422,7 @@
}
catch( Exception& )
{
- OSL_FAIL("sd::CustomAnimationEffect::setColor(), exception cought!" );
+ OSL_FAIL("sd::CustomAnimationEffect::setColor(), exception caught!" );
}
}
@@ -1468,7 +1468,7 @@
}
catch( Exception& )
{
- OSL_FAIL("sd::CustomAnimationEffect::getTransformationProperty(), exception cought!" );
+ OSL_FAIL("sd::CustomAnimationEffect::getTransformationProperty(), exception caught!" );
}
return aProperty;
@@ -1541,7 +1541,7 @@
}
catch( Exception& )
{
- OSL_FAIL("sd::CustomAnimationEffect::setTransformationProperty(), exception cought!" );
+ OSL_FAIL("sd::CustomAnimationEffect::setTransformationProperty(), exception caught!" );
}
return bChanged;
@@ -1563,7 +1563,7 @@
}
catch( Exception& )
{
- OSL_FAIL("sd::CustomAnimationEffect::createAudio(), exception cought!" );
+ OSL_FAIL("sd::CustomAnimationEffect::createAudio(), exception caught!" );
}
}
@@ -1918,7 +1918,7 @@
}
catch( Exception& )
{
- OSL_FAIL( "sd::EffectSequenceHelper::append(), exception cought!" );
+ OSL_FAIL( "sd::EffectSequenceHelper::append(), exception caught!" );
}
return pEffect;
@@ -1942,7 +1942,7 @@
}
catch( Exception& )
{
- OSL_FAIL( "sd::EffectSequenceHelper::replace(), exception cought!" );
+ OSL_FAIL( "sd::EffectSequenceHelper::replace(), exception caught!" );
}
}
@@ -2098,7 +2098,7 @@
}
catch( Exception& )
{
- OSL_FAIL( "sd::EffectSequenceHelper::rebuild(), exception cought!" );
+ OSL_FAIL( "sd::EffectSequenceHelper::rebuild(), exception caught!" );
}
}
@@ -2265,7 +2265,7 @@
}
catch( Exception& )
{
- OSL_FAIL( "ppt::stl_process_after_effect_node_func::operator(), exception cought!" );
+ OSL_FAIL( "ppt::stl_process_after_effect_node_func::operator(), exception caught!" );
}
}
@@ -2718,7 +2718,7 @@
}
catch( Exception& )
{
- OSL_FAIL("sd::EffectSequenceHelper::createTextGroup(), exception cought!" );
+ OSL_FAIL("sd::EffectSequenceHelper::createTextGroup(), exception caught!" );
}
}
@@ -3048,7 +3048,7 @@
}
catch( Exception& )
{
- OSL_FAIL( "sd::EffectSequenceHelper::create(), exception cought!" );
+ OSL_FAIL( "sd::EffectSequenceHelper::create(), exception caught!" );
}
}
@@ -3071,7 +3071,7 @@
}
catch( Exception& )
{
- OSL_FAIL( "sd::EffectSequenceHelper::createEffectsequence(), exception cought!" );
+ OSL_FAIL( "sd::EffectSequenceHelper::createEffectsequence(), exception caught!" );
}
}
@@ -3117,7 +3117,7 @@
}
catch( Exception& )
{
- OSL_FAIL( "sd::EffectSequenceHelper::createEffects(), exception cought!" );
+ OSL_FAIL( "sd::EffectSequenceHelper::createEffects(), exception caught!" );
}
}
@@ -3178,7 +3178,7 @@
}
catch( Exception& )
{
- OSL_FAIL( "sd::EffectSequenceHelper::processAfterEffect(), exception cought!" );
+ OSL_FAIL( "sd::EffectSequenceHelper::processAfterEffect(), exception caught!" );
}
}
@@ -3271,7 +3271,7 @@
Reference< ::com::sun::star::animations::XAnimationNode > MainSequence::getRootNode()
{
- DBG_ASSERT( mnRebuildLockGuard == 0, "MainSequence::getRootNode(), rebuild is locked, ist this
really what you want?" );
+ DBG_ASSERT( mnRebuildLockGuard == 0, "MainSequence::getRootNode(), rebuild is locked, is this
really what you want?" );
if( maTimer.IsActive() && mbTimerMode )
{
@@ -3338,7 +3338,7 @@
}
catch( Exception& )
{
- OSL_FAIL( "sd::MainSequence::create(), exception cought!" );
+ OSL_FAIL( "sd::MainSequence::create(), exception caught!" );
return;
}
@@ -3745,7 +3745,7 @@
}
catch( Exception& )
{
- OSL_FAIL( "sd::InteractiveSequence::InteractiveSequence(), exception cought!" );
+ OSL_FAIL( "sd::InteractiveSequence::InteractiveSequence(), exception caught!" );
return;
}
}
diff --git a/sd/source/core/drawdoc.cxx b/sd/source/core/drawdoc.cxx
index 5b7d3e4..3f36d86 100644
--- a/sd/source/core/drawdoc.cxx
+++ b/sd/source/core/drawdoc.cxx
@@ -170,14 +170,14 @@
mpMasterPageListWatcher = ::std::auto_ptr<ImpMasterPageListWatcher>(
new ImpMasterPageListWatcher(*this));
- SetObjectShell(pDrDocSh); // fuer das VCDrawModel
+ SetObjectShell(pDrDocSh); // for VCDrawModel
if (mpDocSh)
{
SetSwapGraphics(sal_True);
}
- // Masseinheit (von App) und Massstab (von SdMod) setzen
+ // Set measuring unit (of the application) and scale (of SdMod)
sal_Int32 nX, nY;
SdOptions* pOptions = SD_MOD()->GetSdOptions(meDocType);
pOptions->GetScale( nX, nY );
@@ -196,13 +196,12 @@
pItemPool->FreezeIdRanges();
SetTextDefaults();
- // die DrawingEngine muss auch wissen, wo er ist
+ // DrawingEngine has to know where it is...
FmFormModel::SetStyleSheetPool( new SdStyleSheetPool( GetPool(), this ) );
- // Dem DrawOutliner den StyleSheetPool setzen, damit Textobjekte richtig
- // eingelesen werden koennen. Der Link zum StyleRequest-Handler des
- // Dokuments wird erst in NewOrLoadCompleted gesetzt, da erst dann alle
- // Vorlagen existieren.
+ // Set StyleSheetPool for DrawOutliner, so text objects can be read correctly.
+ // The link to the StyleRequest handler of the document is set later, in
+ // NewOrLoadCompleted, because only then do all the templates exist.
SdrOutliner& rOutliner = GetDrawOutliner();
rOutliner.SetStyleSheetPool((SfxStyleSheetPool*)GetStyleSheetPool());
SetCalcFieldValueHdl( &rOutliner );
@@ -242,8 +241,7 @@
GetPool().GetSecondaryPool()->SetPoolDefaultItem( SvxScriptSpaceItem( sal_False,
EE_PARA_ASIANCJKSPACING ) );
}
- // DefTab und SpellOptions setzen
- // Jetzt am Modul (SD)
+ // Set DefTab and SpellOptions for the SD module
sal_uInt16 nDefTab = pOptions->GetDefTab();
SetDefaultTabulator( nDefTab );
@@ -291,13 +289,12 @@
}
rOutliner.SetControlWord(nCntrl);
- // Initialize the printer independent layout mode.
+ // Initialize the printer independent layout mode
SetPrinterIndependentLayout (pOptions->GetPrinterIndependentLayout());
- // Dem HitTestOutliner den StyleSheetPool setzen.
- // Der Link zum StyleRequest-Handler des
- // Dokuments wird erst in NewOrLoadCompleted gesetzt, da erst dann alle
- // Vorlagen existieren.
+ // Set the StyleSheetPool for HitTestOutliner.
+ // The link to the StyleRequest handler of the document is set later, in
+ // NewOrLoadCompleted, because only then do all the templates exist.
SfxItemSet aSet2( pHitTestOutliner->GetEmptyItemSet() );
pHitTestOutliner->SetStyleSheetPool( (SfxStyleSheetPool*)GetStyleSheetPool() );
@@ -331,22 +328,21 @@
pHitTestOutliner->SetControlWord( nCntrl2 );
- /**************************************************************************
- * Layer anlegen
- *
- * Es werden auf Pages und MasterPages folgende Default-Layer angelegt:
- *
- * Layer STR_LAYOUT : Standardlayer f�r alle Zeichenobjekte
- *
- * Layer STR_BCKGRND : Hintergrund der MasterPage
- * (auf normalen Pages z.Z. keine Verwendung)
- *
- * Layer STR_BCKGRNDOBJ: Objekte auf dem Hintergrund der MasterPage
- * (auf normalen Pages z.Z. keine Verwendung)
- *
- * Layer STR_CONTROLS : Standardlayer f�r Controls
- *
- **************************************************************************/
+ /** Create layers
+ *
+ * We create the following default layers on all pages and master pages:
+ *
+ * STR_LAYOUT : default layer for drawing objects
+ *
+ * STR_BCKGRND : background of the master page
+ * (currently unused within normal pages)
+ *
+ * STR_BCKGRNDOBJ: objects on the background of master pages
+ * (currently unused within normal pages)
+ *
+ * STR_CONTROLS : default layer for controls
+ */
+
{
String aControlLayerName( SdResId(STR_LAYER_CONTROLS) );
@@ -363,11 +359,8 @@
}
-/*************************************************************************
-|*
-|* Destruktor
-|*
-\************************************************************************/
+
+// Destructor
SdDrawDocument::~SdDrawDocument()
{
@@ -393,7 +386,7 @@
if (pLinkManager)
{
- // BaseLinks freigeben
+ // Release BaseLinks
if ( !pLinkManager->GetLinks().empty() )
{
pLinkManager->Remove( 0, pLinkManager->GetLinks().size() );
@@ -411,7 +404,7 @@
{
for (sal_uLong j = 0; j < mpCustomShowList->size(); j++)
{
- // Ggf. CustomShows loeschen
+ // If necessary, delete CustomShows
SdCustomShow* pCustomShow = (*mpCustomShowList)[j];
delete pCustomShow;
}
@@ -433,13 +426,10 @@
mpCharClass = NULL;
}
-/*************************************************************************
-|*
-|* Diese Methode erzeugt ein neues Dokument (SdDrawDocument) und gibt einen
-|* Zeiger darauf zurueck. Die Drawing Engine benutzt diese Methode um das
-|* Dokument oder Teile davon ins Clipboard/DragServer stellen zu koennen.
-|*
-\************************************************************************/
+
+// This method creates a new document (SdDrawDocument) and returns a pointer to
+// said document. The drawing engine uses this method to put the document (or
+// parts of it) into the clipboard/DragServer.
SdrModel* SdDrawDocument::AllocModel() const
{
@@ -447,7 +437,8 @@
if( mpCreatingTransferable )
{
- // Dokument wird fuer Drag&Drop/Clipboard erzeugt, dafuer muss dem Dokument eine DocShell
(SvPersist) bekannt sein
+ // Document is created for drag & drop/clipboard. To be able to
+ // do this, the document has to know a DocShell (SvPersist).
SfxObjectShell* pObj = NULL;
::sd::DrawDocShell* pNewDocSh = NULL;
@@ -462,8 +453,8 @@
pNewDocSh->DoInitNew( NULL );
pNewModel = pNewDocSh->GetDoc();
- // Nur fuer Clipboard notwendig,
- // fuer Drag&Drop erfolgt dieses im DragServer
+ // Only necessary for clipboard –
+ // for drag & drop this is handled by DragServer
SdStyleSheetPool* pOldStylePool = (SdStyleSheetPool*) GetStyleSheetPool();
SdStyleSheetPool* pNewStylePool = (SdStyleSheetPool*) pNewModel->GetStyleSheetPool();
@@ -474,7 +465,7 @@
for (sal_uInt16 i = 0; i < GetMasterSdPageCount(PK_STANDARD); i++)
{
- // Alle Layouts der MasterPage mitnehmen
+ // Move with all of the master page's layouts
String aOldLayoutName(((SdDrawDocument*) this)->GetMasterSdPage(i,
PK_STANDARD)->GetLayoutName());
aOldLayoutName.Erase( aOldLayoutName.SearchAscii( SD_LT_SEPARATOR ) );
SdStyleSheetVector aCreatedSheets;
@@ -485,7 +476,7 @@
}
else if( mbAllocDocSh )
{
- // Es wird eine DocShell erzeugt, welche mit GetAllocedDocSh() zurueckgegeben wird
+ // Create a DocShell which is then returned with GetAllocedDocSh()
SdDrawDocument* pDoc = (SdDrawDocument*) this;
pDoc->SetAllocDocSh(sal_False);
pDoc->mxAllocedDocShRef = new ::sd::DrawDocShell(
@@ -501,74 +492,53 @@
return pNewModel;
}
-/*************************************************************************
-|*
-|* Diese Methode erzeugt eine neue Seite (SdPage) und gibt einen Zeiger
-|* darauf zurueck. Die Drawing Engine benutzt diese Methode beim Laden
-|* zur Erzeugung von Seiten (deren Typ sie ja nicht kennt, da es ABLEITUNGEN
-|* der SdrPage sind).
-|*
-\************************************************************************/
+// This method creates a new page (SdPage) and returns a pointer to said page.
+// The drawing engine uses this method to create pages (whose types it does
+// not know, as they are _derivatives_ of SdrPage) when loading.
SdrPage* SdDrawDocument::AllocPage(bool bMasterPage)
{
return new SdPage(*this, NULL, bMasterPage);
}
-/*************************************************************************
-|*
-|* SetChanged(), das Model wurde geaendert
-|*
-\************************************************************************/
-
+// When the model has changed
void SdDrawDocument::SetChanged(sal_Bool bFlag)
{
if (mpDocSh)
{
if (mbNewOrLoadCompleted && mpDocSh->IsEnableSetModified())
{
- // weitergeben an Basisklasse
+ // Pass on to base class
FmFormModel::SetChanged(bFlag);
- // an ObjectShell weiterleiten
+ // Forward to ObjectShell
mpDocSh->SetModified(bFlag);
}
}
else
{
- // weitergeben an Basisklasse
+ // Pass on to base class
FmFormModel::SetChanged(bFlag);
}
}
-/*************************************************************************
-|*
-|* NbcSetChanged(), the model changed, don't call anybody else
-|*
-\************************************************************************/
-
+// The model changed, don't call anything else
void SdDrawDocument::NbcSetChanged(sal_Bool bFlag)
{
// forward to baseclass
FmFormModel::SetChanged(bFlag);
}
-/*************************************************************************
-|*
-|* NewOrLoadCompleted
-|*
-|* Wird gerufen, wenn das Dokument geladen wurde bzw. feststeht, dass es
-|* nicht mehr geladen wird.
-|*
-\************************************************************************/
+// NewOrLoadCompleted is called when the document is loaded, or when it is clear
+// it won't load any more.
void SdDrawDocument::NewOrLoadCompleted(DocCreationMode eMode)
{
if (eMode == NEW_DOC)
{
- // Neues Dokument:
- // Praesentations- und Standardvorlagen erzeugen,
- // Pool fuer virtuelle Controls erzeugen
+ // New document:
+ // create slideshow and default templates,
+ // create pool for virtual controls
CreateLayoutTemplates();
CreateDefaultCellStyles();
@@ -576,7 +546,7 @@
}
else if (eMode == DOC_LOADED)
{
- // Dokument wurde geladen:
+ // Document has finished loading
CheckMasterPages();
@@ -611,23 +581,23 @@
pPage->SetName( aName );
}
- // Sprachabhaengige Namen der StandardLayer erzeugen
+ // Create names of the default layers in the user's language
RestoreLayerNames();
- // Sprachabhaengige Namen der Vorlagen setzen
+ // Create names of the styles in the user's language
static_cast<SdStyleSheetPool*>(mxStyleSheetPool.get())->UpdateStdNames();
- // Ggf. fehlende Vorlagen erzeugen (es gab z.B. frueher keinen Subtitle)
+ // Create any missing styles – e. g. formerly, there was no Subtitle style
static_cast<SdStyleSheetPool*>(mxStyleSheetPool.get())->CreatePseudosIfNecessary();
}
- // Standardvorlage an der Drawing Engine setzen
+ // Set default style of Drawing Engine
String aName( SdResId(STR_STANDARD_STYLESHEET_NAME));
SetDefaultStyleSheet(static_cast<SfxStyleSheet*>(mxStyleSheetPool->Find(aName,
SD_STYLE_FAMILY_GRAPHICS)));
- // Draw-Outliner und Dokument Outliner initialisieren,
- // aber nicht den globalen Outliner, den der ist ja nicht
- // dokumentspezifisch wie StyleSheetPool und StyleRequestHandler
+ // Initialize DrawOutliner and DocumentOutliner, but don't initialize the
+ // global outliner, as it is not document specific like StyleSheetPool and
+ // StyleRequestHandler are.
::Outliner& rDrawOutliner = GetDrawOutliner();
rDrawOutliner.SetStyleSheetPool((SfxStyleSheetPool*)GetStyleSheetPool());
sal_uLong nCntrl = rDrawOutliner.GetControlWord();
@@ -637,9 +607,9 @@
nCntrl &= ~EE_CNTRL_ONLINESPELLING;
rDrawOutliner.SetControlWord(nCntrl);
- // HitTest-Outliner und Dokument Outliner initialisieren,
- // aber nicht den globalen Outliner, den der ist ja nicht
- // dokumentspezifisch wie StyleSheetPool und StyleRequestHandler
+ // Initialize HitTestOutliner and DocumentOutliner, but don't initialize the
+ // global outliner, as it is not document specific like StyleSheetPool and
+ // StyleRequestHandler are.
pHitTestOutliner->SetStyleSheetPool((SfxStyleSheetPool*)GetStyleSheetPool());
if(mpOutliner)
@@ -653,8 +623,7 @@
if ( eMode == DOC_LOADED )
{
- // Praesentationsobjekte muessen wieder Listener der entsprechenden
- // Vorlagen werden
+ // Make presentation objects listeners of the appropriate styles
SdStyleSheetPool* pSPool = (SdStyleSheetPool*) GetStyleSheetPool();
sal_uInt16 nPage, nPageCount;
@@ -667,14 +636,14 @@
pSPool->CreateLayoutStyleSheets( pPage->GetName(), sal_True );
}
- // Standard- und Notizseiten:
+ // Default and notes pages:
for (nPage = 0; nPage < GetPageCount(); nPage++)
{
SdPage* pPage = (SdPage*)GetPage(nPage);
NewOrLoadCompleted( pPage, pSPool );
}
- // Masterpages:
+ // Master pages:
for (nPage = 0; nPage < GetMasterPageCount(); nPage++)
{
SdPage* pPage = (SdPage*)GetMasterPage(nPage);
@@ -685,9 +654,7 @@
mbNewOrLoadCompleted = sal_True;
- /**************************************************************************
- * Alle gelinkten Pages aktualisieren
- **************************************************************************/
+ // Update all linked pages
SdPage* pPage = NULL;
sal_uInt16 nMaxSdPages = GetSdPageCount(PK_STANDARD);
@@ -728,7 +695,7 @@
const sd::ShapeList& rPresentationShapes( pPage->GetPresentationShapeList() );
if(!rPresentationShapes.isEmpty())
{
- // Listen mit Titel- und Gliederungsvorlagen erstellen
+ // Create lists of title and outline styles
String aName = pPage->GetLayoutName();
aName.Erase( aName.SearchAscii( SD_LT_SEPARATOR ));
@@ -739,8 +706,8 @@
SdrObject* pObj = rPresentationShapes.getNextShape(0);
- // jetzt nach Titel- und Gliederungstextobjekten suchen und
- // Objekte zu Listenern machen
+ // Now look for title and outline text objects, then make those objects
+ // listeners.
while(pObj)
{
if (pObj->GetObjInventor() == SdrInventor)
@@ -753,7 +720,7 @@
if( pOPO && pOPO->GetOutlinerMode() == OUTLINERMODE_DONTKNOW )
pOPO->SetOutlinerMode( OUTLINERMODE_TITLEOBJECT );
- // sal_True: harte Attribute dabei nicht loeschen
+ // sal_True: don't delete "hard" attributes when doing this.
if (pTitleSheet)
pObj->SetStyleSheet(pTitleSheet, sal_True);
}
@@ -772,7 +739,7 @@
pObj->StartListening(*pSheet);
if( iter == aOutlineList.begin())
- // Textrahmen hoert auf StyleSheet der Ebene1
+ // text frame listens to stylesheet of layer 1
pObj->NbcSetStyleSheet(pSheet, sal_True);
}
}
@@ -798,13 +765,8 @@
}
}
-/*************************************************************************
-|*
-|* Lokaler Outliner, welcher fuer den Gliederungsmodus verwendet wird
-|* In diesen Outliner werden ggf. OutlinerViews inserted!
-|*
-\************************************************************************/
-
+// Local outliner that is used for outline mode. In this outliner, OutlinerViews
+// may be inserted.
::sd::Outliner* SdDrawDocument::GetOutliner(sal_Bool bCreateOutliner)
{
if (!mpOutliner && bCreateOutliner)
@@ -822,23 +784,17 @@
}
-/*************************************************************************
-|*
-|* Interner Outliner, welcher fuer die Erzeugung von Textobjekten
-|* verwendet wird.
-|* In diesen Outliner werden keine OutlinerViews inserted!
-|*
-\************************************************************************/
-
+// Internal outliner that is used to create text objects. We don't insert any
+// OutlinerViews into this outliner!
::sd::Outliner* SdDrawDocument::GetInternalOutliner(sal_Bool bCreateOutliner)
{
if ( !mpInternalOutliner && bCreateOutliner )
{
mpInternalOutliner = new ::sd::Outliner( this, OUTLINERMODE_TEXTOBJECT );
- // MT:
- // Dieser Outliner wird nur fuer das Erzeugen spezieller Textobjekte
- // verwendet. Da in diesen Textobjekten keine Portion-Informationen
- // gespeichert werden muessen, kann/soll der Update-Mode immer sal_False bleiben.
+
+ // This outliner is only used to create special text objects. As no
+ // information about portions is saved in this outliner, the update mode
+ // can/should always remain sal_False.
mpInternalOutliner->SetUpdateMode( sal_False );
mpInternalOutliner->EnableUndo( sal_False );
@@ -852,21 +808,16 @@
DBG_ASSERT( !mpInternalOutliner || ( mpInternalOutliner->GetUpdateMode() == sal_False ) ,
"InternalOutliner: UpdateMode = sal_True !" );
DBG_ASSERT( !mpInternalOutliner || ( mpInternalOutliner->IsUndoEnabled() == sal_False ),
"InternalOutliner: Undo = sal_True !" );
- // MT: Wer ihn vollmuellt, macht ihn auch gleich wieder leer:
- // Vorteile:
- // a) Keine unnoetigen Clear-Aufrufe
- // b) Kein Muell im Speicher.
- DBG_ASSERT( !mpInternalOutliner || ( ( mpInternalOutliner->GetParagraphCount() == 1 ) && (
mpInternalOutliner->GetText( mpInternalOutliner->GetParagraph( 0 ) ).Len() == 0 ) ),
"InternalOutliner: Nicht leer!" );
+ // If you add stuff here, always clear it out.
+ // Advantages:
+ // a) no unnecessary Clear calls
+ // b) no wasted memory
+ DBG_ASSERT( !mpInternalOutliner || ( ( mpInternalOutliner->GetParagraphCount() == 1 ) && (
mpInternalOutliner->GetText( mpInternalOutliner->GetParagraph( 0 ) ).Len() == 0 ) ),
"InternalOutliner: not empty!" );
return mpInternalOutliner;
}
-/*************************************************************************
-|*
-|* OnlineSpelling ein/aus
-|*
-\************************************************************************/
-
+// OnlineSpelling on/off
void SdDrawDocument::SetOnlineSpell(sal_Bool bIn)
{
mbOnlineSpell = bIn;
@@ -918,12 +869,7 @@
}
-/*************************************************************************
-|*
-|* OnlineSpelling: Markierung ein/aus
-|*
-\************************************************************************/
-
+// OnlineSpelling: highlighting on/off
uno::Reference< uno::XInterface > SdDrawDocument::createUnoModel()
{
uno::Reference< uno::XInterface > xModel;
@@ -954,12 +900,12 @@
{
case ::com::sun::star::document::PrinterIndependentLayout::DISABLED:
case ::com::sun::star::document::PrinterIndependentLayout::ENABLED:
- // Just store supported modes and inform the doc shell.
+ // Just store supported modes and inform the doc shell
mnPrinterIndependentLayout = nMode;
// Since it is possible that a SdDrawDocument is constructed without a
// SdDrawDocShell the pointer member mpDocSh needs to be tested
- // before the call is executed. This is e.-g. used for copy/paste.
+ // before the call is executed. This is e. g. used for copy/paste.
if(mpDocSh)
{
mpDocSh->UpdateRefDevice ();
@@ -968,7 +914,7 @@
break;
default:
- // Ignore unknown values.
+ // Ignore unknown values
break;
}
}
diff --git a/sd/source/core/drawdoc2.cxx b/sd/source/core/drawdoc2.cxx
index e612831..fd36dd4 100644
--- a/sd/source/core/drawdoc2.cxx
+++ b/sd/source/core/drawdoc2.cxx
@@ -69,25 +69,18 @@
using namespace ::sd;
-const long PRINT_OFFSET = 30; // siehe \svx\source\dialog\page.cxx (PB)
+const long PRINT_OFFSET = 30; // see /svx/source/dialog/page.cxx
using namespace com::sun::star;
-/*************************************************************************
-|*
-|* Sucht ein Objekt per Name
-|*
-\************************************************************************/
-
+// Looks up an object by name
SdrObject* SdDrawDocument::GetObj(const String& rObjName) const
{
SdrObject* pObj = NULL;
SdrObject* pObjFound = NULL;
SdPage* pPage = NULL;
- /**************************************************************************
- * Zuerst alle Pages durchsuchen
- **************************************************************************/
+ // First search in all pages
sal_uInt16 nPage = 0;
const sal_uInt16 nMaxPages = GetPageCount();
@@ -112,9 +105,7 @@
nPage++;
}
- /**************************************************************************
- * Wenn nicht gefunden, dann alle MasterPages durchsuchen
- **************************************************************************/
+ // If it couldn't be found, look through all master pages
nPage = 0;
const sal_uInt16 nMaxMasterPages = GetMasterPageCount();
@@ -143,12 +134,7 @@
}
-/*************************************************************************
-|*
-|* Sucht die SdPage per Name
-|*
-\************************************************************************/
-
+// Find SdPage by name
sal_uInt16 SdDrawDocument::GetPageByName(const String& rPgName, sal_Bool& rbIsMasterPage) const
{
SdPage* pPage = NULL;
@@ -159,7 +145,7 @@
rbIsMasterPage = sal_False;
// Search all regular pages and all notes pages (handout pages are
- // ignored.)
+ // ignored)
while (nPage < nMaxPages && nPageNum == SDRPAGE_NOTFOUND)
{
pPage = const_cast<SdPage*>(static_cast<const SdPage*>(
@@ -175,7 +161,7 @@
nPage++;
}
- // Search all master pages when not found among non-master pages.
+ // Search all master pages when not found among non-master pages
const sal_uInt16 nMaxMasterPages = GetMasterPageCount();
nPage = 0;
@@ -216,13 +202,8 @@
return (sal_uInt16)mpMasterPageListWatcher->GetSdPageCount(ePgKind);
}
-/*************************************************************************
-|*
-|* die in den Seitenobjekten der Notizseiten eingetragenen
-|* Seitennummern anpassen
-|*
-\************************************************************************/
-
+// Adapt the page numbers that are registered in the page objects of the notes
+// pages
void SdDrawDocument::UpdatePageObjectsInNotes(sal_uInt16 nStartPos)
{
sal_uInt16 nPageCount = GetPageCount();
@@ -232,8 +213,8 @@
{
pPage = (SdPage*)GetPage(nPage);
- // wenn es eine Notizseite ist, Seitenobjekt suchen
- // und Nummer korrigieren
+ // If this is a notes page, find its page object and correct the page
+ // number
if (pPage && pPage->GetPageKind() == PK_NOTES)
{
sal_uLong nObjCount = pPage->GetObjCount();
@@ -244,11 +225,10 @@
if (pObj->GetObjIdentifier() == OBJ_PAGE &&
pObj->GetObjInventor() == SdrInventor)
{
- // das Seitenobjekt stellt die vorhergende Seite (also
- // die Zeichenseite) dar
- DBG_ASSERTWARNING(nStartPos, "Notizseitenpos. darf nicht 0 sein");
+ // The page object is the preceding page (drawing page)
+ DBG_ASSERTWARNING(nStartPos, "Position of notes page must not be 0.");
- DBG_ASSERTWARNING(nPage > 1, "Seitenobjekt darf nicht Handzettel darstellen");
+ DBG_ASSERTWARNING(nPage > 1, "Page object must not be a handout.");
if (nStartPos > 0 && nPage > 1)
((SdrPageObj*)pObj)->SetReferencedPage(GetPage(nPage - 1));
@@ -366,15 +346,9 @@
}
}
-/*************************************************************************
-|*
-|* Seite verschieben
-|*
-\************************************************************************/
-
+// Move page
void SdDrawDocument::MovePage(sal_uInt16 nPgNum, sal_uInt16 nNewPos)
{
- // Seite verschieben
FmFormModel::MovePage(nPgNum, nNewPos);
sal_uInt16 nMin = Min(nPgNum, nNewPos);
@@ -382,12 +356,7 @@
UpdatePageObjectsInNotes(nMin);
}
-/*************************************************************************
-|*
-|* Seite einfuegen
-|*
-\************************************************************************/
-
+// Insert page
void SdDrawDocument::InsertPage(SdrPage* pPage, sal_uInt16 nPos)
{
bool bLast = (nPos == GetPageCount());
@@ -403,12 +372,7 @@
}
-/*************************************************************************
-|*
-|* Seite loeschen
-|*
-\************************************************************************/
-
+// Delete page
void SdDrawDocument::DeletePage(sal_uInt16 nPgNum)
{
FmFormModel::DeletePage(nPgNum);
@@ -416,12 +380,7 @@
UpdatePageObjectsInNotes(nPgNum);
}
-/*************************************************************************
-|*
-|* Seite entfernen
-|*
-\************************************************************************/
-
+// Remove page
SdrPage* SdDrawDocument::RemovePage(sal_uInt16 nPgNum)
{
SdrPage* pPage = FmFormModel::RemovePage(nPgNum);
@@ -466,12 +425,7 @@
return FmFormModel::RemoveMasterPage(nPgNum);
}
-/*************************************************************************
-|*
-|* Seiten selektieren
-|*
-\************************************************************************/
-
+//Select pages
void SdDrawDocument::SetSelected(SdPage* pPage, sal_Bool bSelect)
{
PageKind ePageKind = pPage->GetPageKind();
@@ -503,18 +457,10 @@
}
}
-/*************************************************************************
-|*
-|* Sofern noch keine Seiten vorhanden sind, werden nun Seiten erzeugt
-|*
-\************************************************************************/
-
+// If no pages exist yet, create them now
void SdDrawDocument::CreateFirstPages( SdDrawDocument* pRefDocument /* = 0 */ )
{
- /**************************************************************************
- * Wenn noch keine Seite im Model vorhanden ist (Datei-Neu), wird
- * eine neue Seite eingefuegt
- **************************************************************************/
+ // If no page exists yet in the model, (File -> New), insert a page
sal_uInt16 nPageCount = GetPageCount();
if (nPageCount <= 1)
@@ -522,9 +468,7 @@
// #i57181# Paper size depends on Language, like in Writer
Size aDefSize = SvxPaperInfo::GetDefaultPaperSize( MAP_100TH_MM );
- /**********************************************************************
- * Handzettel-Seite einfuegen
- **********************************************************************/
+ // Insert handout page
SdPage* pHandoutPage = dynamic_cast< SdPage* >( AllocPage(sal_False) );
SdPage* pRefPage = NULL;
@@ -547,9 +491,7 @@
pHandoutPage->SetName( String (SdResId(STR_HANDOUT) ) );
InsertPage(pHandoutPage, 0);
- /**********************************************************************
- * MasterPage einfuegen und an der Handzettel-Seite vermerken
- **********************************************************************/
+ // Insert master page and register this with the handout page
SdPage* pHandoutMPage = (SdPage*) AllocPage(sal_True);
pHandoutMPage->SetSize( pHandoutPage->GetSize() );
pHandoutMPage->SetPageKind(PK_HANDOUT);
@@ -560,11 +502,9 @@
InsertMasterPage(pHandoutMPage, 0);
pHandoutPage->TRG_SetMasterPage( *pHandoutMPage );
- /**********************************************************************
- * Seite einfuegen
- * Sofern nPageCount==1 ist, wurde das Model fuers Clipboad erzeugt.
- * Eine Standard-Seite ist daher schon vorhanden.
- **********************************************************************/
+ // Insert page
+ // If nPageCount==1 is, the model for the clipboard was created, thus a
+ // default page must already exist
SdPage* pPage;
sal_Bool bClipboard = sal_False;
@@ -582,7 +522,7 @@
}
else if (meDocType == DOCUMENT_TYPE_DRAW)
{
- // Draw: stets Default-Groesse mit Raendern
+ // Draw: always use default size with margins
pPage->SetSize(aDefSize);
SfxPrinter* pPrinter = mpDocSh->GetPrinter(sal_False);
@@ -612,7 +552,7 @@
}
else
{
- // Impress: stets Bildschirmformat, quer
+ // Impress: always use screen format, landscape.
Size aSz( SvxPaperInfo::GetPaperSize(PAPER_SCREEN_4_3, MAP_100TH_MM) );
pPage->SetSize( Size( aSz.Height(), aSz.Width() ) );
pPage->SetBorder(0, 0, 0, 0);
@@ -626,9 +566,7 @@
pPage = (SdPage*) GetPage(1);
}
- /**********************************************************************
- * MasterPage einfuegen und an der Seite vermerken
- **********************************************************************/
+ // Insert master page, then register this with the page
SdPage* pMPage = (SdPage*) AllocPage(sal_True);
pMPage->SetSize( pPage->GetSize() );
pMPage->SetBorder( pPage->GetLftBorder(),
@@ -640,9 +578,7 @@
if( bClipboard )
pMPage->SetLayoutName( pPage->GetLayoutName() );
- /**********************************************************************
- * Notizen-Seite einfuegen
- **********************************************************************/
+ // Insert notes page
SdPage* pNotesPage = (SdPage*) AllocPage(sal_False);
if( pRefDocument )
@@ -655,7 +591,7 @@
}
else
{
- // Stets Hochformat
+ // Always use portrait format
if (aDefSize.Height() >= aDefSize.Width())
{
pNotesPage->SetSize(aDefSize);
@@ -672,9 +608,7 @@
if( bClipboard )
pNotesPage->SetLayoutName( pPage->GetLayoutName() );
- /**********************************************************************
- * MasterPage einfuegen und an der Notizen-Seite vermerken
- **********************************************************************/
+ // Insert master page, then register this with the notes page
SdPage* pNotesMPage = (SdPage*) AllocPage(sal_True);
pNotesMPage->SetSize( pNotesPage->GetSize() );
pNotesMPage->SetPageKind(PK_NOTES);
@@ -700,13 +634,8 @@
}
}
-/*************************************************************************
-|*
-|* Erzeugt fehlende Notiz und Handzettelseiten (nach PowerPoint-Import)
-|* Es wird davon ausgegangen, dass mindestens eine Standard-Seite und
-|* eine Standard-MasterPage vorhanden sind.
-|*
-\************************************************************************/
+// Creates missing notes and handout pages (after PowerPoint import).
+// We assume that at least one default page and one default master page exist.
sal_Bool SdDrawDocument::CreateMissingNotesAndHandoutPages()
{
@@ -715,9 +644,7 @@
if (nPageCount != 0)
{
- /**********************************************************************
- * PageKind setzen
- **********************************************************************/
+ // Set PageKind
SdPage* pHandoutMPage = (SdPage*) GetMasterPage(0);
pHandoutMPage->SetPageKind(PK_HANDOUT);
@@ -731,15 +658,15 @@
if(!pPage->TRG_HasMasterPage())
{
- // Keine MasterPage gesetzt -> erste Standard-MasterPage nehmen
- // (Wenn bei PPT keine Standard-Seite vorhanden war)
+ // No master page set -> use first default master page
+ // (If there was no default page in the PPT)
pPage->TRG_SetMasterPage(*GetMasterPage(1));
}
SdPage* pNotesPage = (SdPage*) GetPage(i+1);
pNotesPage->SetPageKind(PK_NOTES);
- // Notiz-MasterPages setzen
+ // Set notes master page
sal_uInt16 nMasterPageAfterPagesMasterPage = (pPage->TRG_GetMasterPage()).GetPageNum()
+ 1;
pNotesPage->TRG_SetMasterPage(*GetMasterPage(nMasterPageAfterPagesMasterPage));
}
@@ -752,14 +679,9 @@
return(bOK);
}
-/*************************************************************************
-|*
-|* - selektierte Seiten hinter genannte Seite schieben
-|* (nTargetPage = (sal_uInt16)-1 --> vor erste Seite schieben)
-|* - ergibt sal_True, wenn Seiten verschoben wurden
-|*
-\************************************************************************/
-
+// + Move selected pages after said page
+// (nTargetPage = (sal_uInt16)-1 --> move before first page)
+// + Returns sal_True when the page has been moved
sal_Bool SdDrawDocument::MovePages(sal_uInt16 nTargetPage)
{
SdPage* pPage = NULL;
@@ -772,7 +694,7 @@
if( bUndo )
BegUndo(String(SdResId(STR_UNDO_MOVEPAGES)));
- // Liste mit selektierten Seiten
+ // List of selected pages
std::vector<SdPage*> aPageList;
for (nPage = 0; nPage < nNoOfPages; nPage++)
{
@@ -782,7 +704,7 @@
aPageList.push_back(pPage);
}
- // falls noetig, nach vorne hangeln, bis nicht selektierte Seite gefunden
+ // If necessary, look backwards, until we find a page that wasn't selected
nPage = nTargetPage;
if (nPage != (sal_uInt16)-1)
{
@@ -799,7 +721,7 @@
}
}
- // vor der ersten Seite einfuegen
+ // Insert before the first page
if (nPage == (sal_uInt16)-1)
{
std::vector<SdPage*>::reverse_iterator iter;
@@ -820,11 +742,11 @@
}
}
}
- // hinter <nPage> einfuegen
+ // Insert after <nPage>
else
{
nTargetPage = nPage;
- nTargetPage = 2 * nTargetPage + 1; // PK_STANDARD --> absolut
+ nTargetPage = 2 * nTargetPage + 1; // PK_STANDARD --> absolute
std::vector<SdPage*>::iterator iter;
for (iter = aPageList.begin(); iter != aPageList.end(); ++iter)
@@ -833,7 +755,7 @@
nPage = pPage->GetPageNum();
if (nPage > nTargetPage)
{
- nTargetPage += 2; // hinter (!) der Seite einfuegen
+ nTargetPage += 2; // Insert _after_ the page
if (nPage != nTargetPage)
{
@@ -874,23 +796,13 @@
}
-/*************************************************************************
-|*
-|* Anzahl der Links im sfx2::LinkManager zurueckgeben
-|*
-\************************************************************************/
-
+// Return number of links in sfx2::LinkManager
sal_uLong SdDrawDocument::GetLinkCount()
{
return pLinkManager->GetLinks().size();
}
-/*************************************************************************
-|*
-|* Language setzen
-|*
-\************************************************************************/
-
+// Set Language
void SdDrawDocument::SetLanguage( const LanguageType eLang, const sal_uInt16 nId )
{
sal_Bool bChanged = sal_False;
@@ -921,12 +833,7 @@
}
-/*************************************************************************
-|*
-|* Return language
-|*
-\************************************************************************/
-
+// Return language
LanguageType SdDrawDocument::GetLanguage( const sal_uInt16 nId ) const
{
LanguageType eLangType = meLanguage;
@@ -940,25 +847,20 @@
}
-/*************************************************************************
-|*
-|* WorkStartup einleiten
-|*
-\************************************************************************/
-
+// Initiate WorkStartup
IMPL_LINK_NOARG(SdDrawDocument, WorkStartupHdl)
{
if( mpDocSh )
mpDocSh->SetWaitCursor( sal_True );
- sal_Bool bChanged = IsChanged(); // merken
+ sal_Bool bChanged = IsChanged(); // remember this
- // Autolayouts initialisieren
+ // Initialize Autolayouts
SdPage* pHandoutMPage = GetMasterSdPage(0, PK_HANDOUT);
if (pHandoutMPage->GetAutoLayout() == AUTOLAYOUT_NONE)
{
- // AutoLayout wurde noch nicht umgesetzt -> Initialisieren
+ // No AutoLayout yet -> initialize
pHandoutMPage->SetAutoLayout(AUTOLAYOUT_HANDOUT6, sal_True, sal_True);
}
@@ -966,7 +868,7 @@
if (pPage->GetAutoLayout() == AUTOLAYOUT_NONE)
{
- // AutoLayout wurde noch nicht umgesetzt -> Initialisieren
+ // No AutoLayout yet -> initialize
pPage->SetAutoLayout(AUTOLAYOUT_NONE, sal_True, sal_True);
}
@@ -974,7 +876,7 @@
if (pNotesPage->GetAutoLayout() == AUTOLAYOUT_NONE)
{
- // AutoLayout wurde noch nicht umgesetzt -> Initialisieren
+ // No AutoLayout yet -> initialize
pNotesPage->SetAutoLayout(AUTOLAYOUT_NOTES, sal_True, sal_True);
}
@@ -986,21 +888,16 @@
}
-/*************************************************************************
-|*
-|* Wenn der WorkStartupTimer erzeugt worden ist (das erfolgt ausschliesslich
-|* in SdDrawViewShell::Consruct() ), so wird der Timer ggf. gestoppt und
-|* das WorkStartup eingeleitet
-|*
-\************************************************************************/
-
+// When the WorkStartupTimer has been created (this only happens in
+// SdDrawViewShell::Construct() ), the timer may be stopped and the WorkStartup
+// may be initiated.
void SdDrawDocument::StopWorkStartupDelay()
{
if (mpWorkStartupTimer)
{
if ( mpWorkStartupTimer->IsActive() )
{
- // Timer war noch nicht abgelaufen -> WorkStartup wird eingeleitet
+ // Timer not yet expired -> initiate WorkStartup
mpWorkStartupTimer->Stop();
WorkStartupHdl(NULL);
}
@@ -1010,14 +907,9 @@
}
}
-/*************************************************************************
-|*
-|* Wenn der WorkStartupTimer erzeugt worden ist (das erfolgt ausschliesslich
-|* in SdDrawViewShell::Consruct() ), so wird der Timer ggf. gestoppt und
-|* das WorkStartup eingeleitet
-|*
-\************************************************************************/
-
+// When the WorkStartupTimer has been created (this only happens in
+// SdDrawViewShell::Construct() ), the timer may be stopped and the WorkStartup
+// may be initiated.
SdAnimationInfo* SdDrawDocument::GetAnimationInfo(SdrObject* pObject) const
{
DBG_ASSERT(pObject, "sd::SdDrawDocument::GetAnimationInfo(), invalid argument!");
@@ -1034,7 +926,7 @@
SdrObjUserData* pUD = 0;
SdAnimationInfo* pRet = 0;
- // gibt es in den User-Daten eine Animationsinformation?
+ // Can we find animation information within the user data?
for (nUD = 0; nUD < nUDCount; nUD++)
{
pUD = rObject.GetUserData(nUD);
@@ -1056,13 +948,13 @@
SdIMapInfo* SdDrawDocument::GetIMapInfo( SdrObject* pObject ) const
{
- DBG_ASSERT(pObject, "ohne Objekt keine IMapInfo");
+ DBG_ASSERT(pObject, "Without an object there is no IMapInfo");
SdrObjUserData* pUserData = NULL;
SdIMapInfo* pIMapInfo = NULL;
sal_uInt16 nCount = pObject->GetUserDataCount();
- // gibt es in den User-Daten eine IMap-Information?
+ // Can we find IMap information within the user data?
for ( sal_uInt16 i = 0; i < nCount; i++ )
{
pUserData = pObject->GetUserData( i );
@@ -1090,22 +982,22 @@
const Rectangle& rRect = pObj->GetLogicRect();
sal_Bool bObjSupported = sal_False;
- // HitTest ausfuehren
- if ( pObj->ISA( SdrGrafObj ) ) // einfaches Grafik-Objekt
+ // execute HitTest
+ if ( pObj->ISA( SdrGrafObj ) ) // simple graphics object
{
const SdrGrafObj* pGrafObj = (const SdrGrafObj*) pObj;
const GeoStat& rGeo = pGrafObj->GetGeoStat();
SdrGrafObjGeoData* pGeoData = (SdrGrafObjGeoData*) pGrafObj->GetGeoData();
- // Drehung rueckgaengig
+ // Undo rotation
if ( rGeo.nDrehWink )
RotatePoint( aRelPoint, rRect.TopLeft(), -rGeo.nSin, rGeo.nCos );
- // Spiegelung rueckgaengig
+ // Undo mirroring
if ( pGeoData->bMirrored )
aRelPoint.X() = rRect.Right() + rRect.Left() - aRelPoint.X();
- // ggf. Unshear:
+ // Undo shearing
if ( rGeo.nShearWink )
ShearPoint( aRelPoint, rRect.TopLeft(), -rGeo.nTan );
@@ -1118,20 +1010,20 @@
delete pGeoData;
bObjSupported = sal_True;
}
- else if ( pObj->ISA( SdrOle2Obj ) ) // OLE-Objekt
+ else if ( pObj->ISA( SdrOle2Obj ) ) // OLE object
{
aGraphSize = ( (SdrOle2Obj*) pObj )->GetOrigObjSize();
bObjSupported = sal_True;
}
- // hat alles geklappt, dann HitTest ausfuehren
+ // Everything worked out well, thus execute HitTest
if ( bObjSupported )
{
- // relativen Mauspunkt berechnen
+ // Calculate relative position of mouse cursor
aRelPoint -= rRect.TopLeft();
pIMapObj = rImageMap.GetHitIMapObject( aGraphSize, rRect.GetSize(), aRelPoint );
- // Deaktivierte Objekte wollen wir nicht
+ // We don't care about deactivated objects
if ( pIMapObj && !pIMapObj->IsActive() )
pIMapObj = NULL;
}
@@ -1317,7 +1209,7 @@
eNotesLayout = pPreviousNotesPage->GetAutoLayout();
}
- // Create new standard page and set it up.
+ // Create new standard page and set it up
pStandardPage = (SdPage*) AllocPage(sal_False);
// Set the size here since else the presobj autolayout
@@ -1331,7 +1223,7 @@
// Use master page of current page.
pStandardPage->TRG_SetMasterPage(pPreviousStandardPage->TRG_GetMasterPage());
- // User layout of current standard page.
+ // User layout of current standard page
pStandardPage->SetLayoutName( pPreviousStandardPage->GetLayoutName() );
pStandardPage->SetAutoLayout(eStandardLayout, sal_True);
pStandardPage->setHeaderFooterSettings( pPreviousStandardPage->getHeaderFooterSettings() );
@@ -1347,14 +1239,14 @@
pStandardPage->SetPresChange( pPreviousStandardPage->GetPresChange() );
pStandardPage->SetTime( pPreviousStandardPage->GetTime() );
- // Create new notes page and set it up.
+ // Create new notes page and set it up
pNotesPage = (SdPage*) AllocPage(sal_False);
pNotesPage->SetPageKind(PK_NOTES);
- // Use master page of current page.
+ // Use master page of current page
pNotesPage->TRG_SetMasterPage(pPreviousNotesPage->TRG_GetMasterPage());
- // Use layout of current notes page.
+ // Use layout of current notes page
pNotesPage->SetLayoutName( pPreviousNotesPage->GetLayoutName() );
pNotesPage->SetAutoLayout(eNotesLayout, sal_True);
pNotesPage->setHeaderFooterSettings( pPreviousNotesPage->getHeaderFooterSettings() );
@@ -1378,10 +1270,10 @@
{
PageKind ePageKind = PK_STANDARD;
- // Get current page.
+ // Get current page
SdPage* pActualPage = GetSdPage(nPageNum, ePageKind);
- // Get background flags.
+ // Get background flags
SdrLayerAdmin& rLayerAdmin = GetLayerAdmin();
sal_uInt8 aBckgrnd = rLayerAdmin.GetLayerID(String(SdResId(STR_LAYER_BCKGRND)), sal_False);
sal_uInt8 aBckgrndObj = rLayerAdmin.GetLayerID(String(SdResId(STR_LAYER_BCKGRNDOBJ)),
sal_False);
@@ -1389,7 +1281,7 @@
return DuplicatePage (
pActualPage, ePageKind,
- // No names for the new slides.
+ // No names for the new slides
String(), String(),
aVisibleLayers.IsSet(aBckgrnd),
aVisibleLayers.IsSet(aBckgrndObj));
@@ -1427,7 +1319,7 @@
pPreviousNotesPage = (SdPage*) GetPage(nStandardPageNum - 1);
}
- // Create duplicates of a standard page and the associated notes page.
+ // Create duplicates of a standard page and the associated notes page
pStandardPage = (SdPage*) pPreviousStandardPage->Clone();
pNotesPage = (SdPage*) pPreviousNotesPage->Clone();
@@ -1465,7 +1357,7 @@
String aNotesPageName = sNotesPageName;
// Gather some information about the standard page and the notes page
- // that are to be inserted. This makes sure that there is always one
+ // that are to be inserted. This makes sure that there is always one
// standard page followed by one notes page.
if (ePageKind == PK_NOTES)
{
@@ -1487,7 +1379,7 @@
if (nInsertPosition < 0)
nInsertPosition = nStandardPageNum;
- // Set up and insert the standard page.
+ // Set up and insert the standard page
SetupNewPage (
pPreviousStandardPage,
pStandardPage,
@@ -1496,7 +1388,7 @@
bIsPageBack,
bIsPageObj);
- // Set up and insert the notes page.
+ // Set up and insert the notes page
pNotesPage->SetPageKind(PK_NOTES);
SetupNewPage (
pPreviousNotesPage,
@@ -1507,7 +1399,7 @@
bIsPageObj);
// Return an index that allows the caller to access the newly inserted
- // pages by using GetSdPage().
+ // pages by using GetSdPage()
return pStandardPage->GetPageNum() / 2;
}
diff --git a/sd/source/core/drawdoc3.cxx b/sd/source/core/drawdoc3.cxx
index 0c2e5e1..ef6a28b 100644
--- a/sd/source/core/drawdoc3.cxx
+++ b/sd/source/core/drawdoc3.cxx
@@ -95,9 +95,7 @@
const sal_uInt16 nMPageCount = rDoc.GetMasterPageCount();
for (sal_uInt16 nMPage = 0; nMPage < nMPageCount && !bFound; nMPage++)
{
- /**************************************************************
- * Gibt es die Layouts schon im Dokument?
- **************************************************************/
+ // Do the layouts already exist within the document?
SdPage* pTestPage = (SdPage*) rDoc.GetMasterPage(nMPage);
String aFullTest(pTestPage->GetLayoutName());
aFullTest.Erase( aFullTest.SearchAscii( SD_LT_SEPARATOR ));
@@ -112,12 +110,7 @@
mrLayoutsToTransfer.push_back(aLayout);
}
-/*************************************************************************
-|*
-|* Fuegt ein Bookmark als Seite ein
-|*
-\************************************************************************/
-
+// Inserts a bookmark as a page
static void lcl_IterateBookmarkPages( SdDrawDocument &rDoc, SdDrawDocument* pBookmarkDoc,
const std::vector<rtl::OUString> &rBookmarkList, sal_uInt16
nBMSdPageCount,
InsertBookmarkAsPage_FindDuplicateLayouts& rPageIterator )
@@ -185,12 +178,7 @@
}
}
-/*************************************************************************
-|*
-|* Oeffnet ein Bookmark-Dokument
-|*
-\************************************************************************/
-
+// Opens a bookmark document
SdDrawDocument* SdDrawDocument::OpenBookmarkDoc(SfxMedium& rMedium)
{
sal_Bool bOK = sal_True;
@@ -215,10 +203,9 @@
{
CloseBookmarkDoc();
- // Es wird eine DocShell erzeugt, da in dem Dokument OLE-Objekte
- // enthalten sein koennten (Persist)
- // Wenn dem nicht so waere, so koennte man auch das Model
- // direkt laden
+ // Create a DocShell, as OLE objects might be contained in the
+ // document. (Persist)
+ // If that wasn't the case, we could load the model directly.
if ( bCreateGraphicShell )
// Draw
mxBookmarkDocShRef = new ::sd::GraphicDocShell(SFX_CREATE_MODE_STANDARD, sal_True);
@@ -253,12 +240,7 @@
return(pBookmarkDoc);
}
-/*************************************************************************
-|*
-|* Oeffnet ein Bookmark-Dokument
-|*
-\************************************************************************/
-
+// Opens a bookmark document
SdDrawDocument* SdDrawDocument::OpenBookmarkDoc(const String& rBookmarkFile)
{
SdDrawDocument* pBookmarkDoc = NULL;
@@ -276,31 +258,24 @@
return(pBookmarkDoc);
}
-/*************************************************************************
-|*
-|* Fuegt ein Bookmark (Seite oder Objekt) ein
-|*
-\************************************************************************/
-
+// Inserts a bookmark (page or object)
sal_Bool SdDrawDocument::InsertBookmark(
- const std::vector<rtl::OUString> &rBookmarkList, // Liste der Namen der einzufuegenden
Bookmarks
- std::vector<rtl::OUString> &rExchangeList, // Liste der zu verwendenen Namen
- sal_Bool bLink, // Bookmarks sollen als Verknuepfung
eingefuegt werden
- sal_Bool bReplace, // Aktuellen Seiten (Standard&Notiz)
werden ersetzt
- sal_uInt16 nInsertPos, // Einfuegeposition fuer Seiten
- sal_Bool bNoDialogs, // Keine Dialoge anzeigen
- ::sd::DrawDocShell* pBookmarkDocSh, // Wenn gesetzt, so ist dieses das
Source-Dokument
- sal_Bool bCopy, // Seiten werden kopiert
- Point* pObjPos) // Einfuegeposition fuer Objekte
+ const std::vector<rtl::OUString> &rBookmarkList, // List of names of the bookmarks to be
inserted
+ std::vector<rtl::OUString> &rExchangeList, // List of the names to be used
+ sal_Bool bLink, // Insert bookmarks as links?
+ sal_Bool bReplace, // Replace current default and notes pages?
+ sal_uInt16 nInsertPos, // Insertion position of pages
+ sal_Bool bNoDialogs, // Don't show dialogs
+ ::sd::DrawDocShell* pBookmarkDocSh, // If set, this is the source document
+ sal_Bool bCopy, // Copy the pages?
+ Point* pObjPos) // Insertion position of objects
{
sal_Bool bOK = sal_True;
sal_Bool bInsertPages = sal_False;
if (rBookmarkList.empty())
{
- /**********************************************************************
- * Alle Seiten werden eingefuegt
- **********************************************************************/
+ // Insert all pages
bInsertPages = sal_True;
}
else
@@ -324,15 +299,13 @@
std::vector<rtl::OUString>::const_iterator pIter;
for ( pIter = rBookmarkList.begin(); bOK && pIter != rBookmarkList.end() && !bInsertPages;
++pIter )
{
- /******************************************************************
- * Gibt es in der Bookmark-Liste einen Seitennamen?
- ******************************************************************/
+ // Is there a page name in the bookmark list?
String aBMPgName(*pIter);
sal_Bool bIsMasterPage;
if( pBookmarkDoc->GetPageByName( aBMPgName, bIsMasterPage ) != SDRPAGE_NOTFOUND )
{
- // Seite gefunden
+ // Found the page
bInsertPages = sal_True;
}
}
@@ -342,14 +315,14 @@
if ( bOK && bInsertPages )
{
- // Zuerst werden alle Seiten-Bookmarks eingefuegt
+ // Insert all page bookmarks
bOK = InsertBookmarkAsPage(rBookmarkList, &rExchangeList, bLink, bReplace,
nInsertPos, bNoDialogs, pBookmarkDocSh, bCopy, sal_True,
sal_False);
}
if ( bOK && !rBookmarkList.empty() )
{
- // Es werden alle Objekt-Bookmarks eingefuegt
+ // Insert all object bookmarks
bOK = InsertBookmarkAsObject(rBookmarkList, rExchangeList, bLink,
pBookmarkDocSh, pObjPos, bCalcObjCount);
}
@@ -379,7 +352,7 @@
sal_Bool SdDrawDocument::InsertBookmarkAsPage(
const std::vector<rtl::OUString> &rBookmarkList,
- std::vector<rtl::OUString> *pExchangeList, // Liste der zu verwendenen Namen
+ std::vector<rtl::OUString> *pExchangeList, // List of names to be used
sal_Bool bLink,
sal_Bool bReplace,
sal_uInt16 nInsertPos,
@@ -446,8 +419,7 @@
sal_Int32 nNLower = pNPage->GetLwrBorder();
Orientation eNOrient = pRefPage->GetOrientation();
- // Seitengroesse und -raender an die Werte der letzten
- // Seiten anpassen?
+ // Adapt page size and margins to those of the later pages?
pRefPage = GetSdPage(nSdPageCount - 1, PK_STANDARD);
if( bNoDialogs )
@@ -481,11 +453,8 @@
}
- /**************************************************************************
- |* Die benoetigten Praesentations-StyleSheets ermitteln und vor
- |* den Seiten transferieren, sonst verlieren die Textobjekte
- |* beim Transfer den Bezug zur Vorlage
- \*************************************************************************/
+ // Get the necessary presentation stylesheets and transfer them before
+ // the pages, else, the text objects won't reference their styles anymore.
::svl::IUndoManager* pUndoMgr = NULL;
if( mpDocSh )
{
@@ -501,14 +470,11 @@
lcl_IterateBookmarkPages( *this, pBookmarkDoc, rBookmarkList, nBMSdPageCount, aSearchFunctor );
- /**************************************************************************
- * Die tatsaechlich benoetigten Vorlagen kopieren
- **************************************************************************/
+ // Copy the style that we actually need.
SdStyleSheetPool* pBookmarkStyleSheetPool =
dynamic_cast<SdStyleSheetPool*>(pBookmarkDoc->GetStyleSheetPool());
SdStyleSheetPool* pStyleSheetPool = dynamic_cast<SdStyleSheetPool*>(GetStyleSheetPool());
- // Wenn Vorlagen kopiert werden muessen, dann muessen auch die
- // MasterPages kopiert werden!
+ // When copying styles, also copy the master pages!
if( !aLayoutsToTransfer.empty() )
bMergeMasterPages = sal_True;
@@ -542,9 +508,7 @@
// TODO handle undo of table styles too
pStyleSheetPool->CopyTableStyles(*pBookmarkStyleSheetPool);
- /**************************************************************************
- * Dokument einfuegen
- **************************************************************************/
+ // Insert document
const bool bUndo = IsUndoEnabled();
@@ -555,7 +519,7 @@
{
if (nInsertPos >= GetPageCount())
{
- // Seiten werden hinten angefuegt
+ // Add pages to the end
nInsertPos = GetPageCount();
}
@@ -573,7 +537,7 @@
if (bLink)
{
- // Es werden sich die Namen aller Seiten gemerkt
+ // Remember the names of all pages
aNameMap.insert(std::make_pair(nBMSdPage,sName));
}
@@ -588,13 +552,13 @@
}
Merge(*pBookmarkDoc,
- 1, // Nicht die Handzettelseite
- 0xFFFF, // Aber alle anderen
- nActualInsertPos, // An Position einfuegen
- bMergeMasterPages, // MasterPages mitnehmen
- sal_False, // Aber nur die benoetigten MasterPages
- sal_True, // Undo-Aktion erzeugen
- bCopy); // Seiten kopieren (oder mergen)
+ 1, // Not the handout page
+ 0xFFFF, // But all others
+ nActualInsertPos, // Insert at position ...
+ bMergeMasterPages, // Move master pages?
+ sal_False, // But only the master pages used
+ sal_True, // Create an undo action
+ bCopy); // Copy (or merge) pages?
for (nBMSdPage=0; nBMSdPage < nBMSdPageCount; nBMSdPage++)
{
@@ -604,8 +568,8 @@
// delay renaming *after* pages are copied (might destroy source otherwise)
if( aRenameSet.find(nBMSdPage) != aRenameSet.end() )
{
- // Seitenname schon vorhanden -> Defaultname
- // fuer Standard & Notizseite
+ // Page name already in use -> Use default name for default and
+ // notes page
pPage->SetName(String());
pNotesPage->SetName(String());
}
@@ -614,7 +578,7 @@
{
String aName(aNameMap[nBMSdPage]);
- // Nun werden die Link-Namen zusammengestellt
+ // Assemble all link names
pPage->SetFileName(aBookmarkName);
pPage->SetBookmarkName(aName);
pPage->SetModel(this);
@@ -625,21 +589,19 @@
}
else
{
- /**********************************************************************
- * Ausgewaehlte Seiten einfuegen
- **********************************************************************/
+ // Insert selected pages
SdPage* pBMPage;
if (nInsertPos >= GetPageCount())
{
- // Seiten werden hinten angefuegt
+ // Add pages to the end
bReplace = sal_False;
nInsertPos = GetPageCount();
}
sal_uInt16 nActualInsertPos = nInsertPos;
- // Collect the bookmarked pages.
+ // Collect the bookmarked pages
::std::vector<SdPage*> aBookmarkedPages (rBookmarkList.size(), NULL);
for ( size_t nPos = 0, n = rBookmarkList.size(); nPos < n; ++nPos)
{
@@ -660,9 +622,7 @@
if (pBMPage && pBMPage->GetPageKind()==PK_STANDARD && !pBMPage->IsMasterPage())
{
- /**************************************************************
- * Es muss eine StandardSeite sein
- **************************************************************/
+ // It has to be a default page
sal_Bool bMustRename = sal_False;
// delay renaming *after* pages are copied (might destroy source otherwise)
@@ -686,13 +646,13 @@
}
Merge(*pBookmarkDoc,
- nBMPage, // Von Seite (Standard)
- nBMPage+1, // Bis Seite (Notizen)
- nActualInsertPos, // An Position einfuegen
- bMergeMasterPages, // MasterPages mitnehmen
- sal_False, // Aber nur die benoetigten MasterPages
- sal_True, // Undo-Aktion erzeugen
- bCopy); // Seiten kopieren (oder mergen)
+ nBMPage, // From page (default page)
+ nBMPage+1, // To page (notes page)
+ nActualInsertPos, // Insert at position
+ bMergeMasterPages, // Move master pages?
+ sal_False, // But only the master pages used
+ sal_True, // Create undo action
+ bCopy); // Copy (or merge) pages?
if( bReplace )
{
@@ -705,8 +665,8 @@
if( bMustRename )
{
- // Seitenname schon vorhanden -> Defaultname
- // fuer Standard & Notizseite
+ // Page name already in use -> use default name for default and
+ // notes page
SdPage* pPage = (SdPage*) GetPage(nActualInsertPos);
pPage->SetName(String());
SdPage* pNotesPage = (SdPage*) GetPage(nActualInsertPos+1);
@@ -723,7 +683,7 @@
if (bReplace)
{
- // Seite & Notizseite ausfuegen
+ // Remove page and notes page.
const sal_uInt16 nDestPageNum(nActualInsertPos + 2);
SdPage* pStandardPage = 0L;
@@ -785,21 +745,18 @@
}
- /**************************************************************************
- |* Dabei sind evtl. zu viele Masterpages ruebergekommen, da die
- |* DrawingEngine gleiche Praesentationslayouts nicht erkennen kann.
- |* Ueberzaehlige MasterPages entfernen.
- \*************************************************************************/
+ // We might have duplicate master pages now, as the drawing engine does not
+ // recognize duplicates. Remove these now.
sal_uInt16 nNewMPageCount = GetMasterPageCount();
- // rueckwaerts, damit Nummern nicht durcheinander geraten
+ // Go backwards, so the numbers don't become messed up
for (sal_uInt16 nPage = nNewMPageCount - 1; nPage >= nMPageCount; nPage--)
{
pRefPage = (SdPage*) GetMasterPage(nPage);
String aMPLayout(pRefPage->GetLayoutName());
PageKind eKind = pRefPage->GetPageKind();
- // gibt's den schon?
+ // Does this already exist?
for (sal_uInt16 nTest = 0; nTest < nMPageCount; nTest++)
{
SdPage* pTest = (SdPage*) GetMasterPage(nTest);
@@ -849,7 +806,7 @@
if (pExchangeList && pExchangeIter != pExchangeList->end())
{
- // Zuverwendener Name aus Exchange-Liste holen
+ // Get the name to use from Exchange list
String aExchangeName (*pExchangeIter);
pRefPage->SetName(aExchangeName);
SdrHint aHint(HINT_PAGEORDERCHG);
@@ -922,7 +879,7 @@
pRefPage->SetBorder(nLeft, nUpper, nRight, nLower);
pRefPage->SetOrientation( eOrient );
}
- else // kann nur noch NOTES sein
+ else // Can only be notes
{
if (bScaleObjects)
{
@@ -960,15 +917,10 @@
return bContinue;
}
-/*************************************************************************
-|*
-|* Fuegt ein Bookmark als Objekt ein
-|*
-\************************************************************************/
-
+// Inserts a bookmark as an object
sal_Bool SdDrawDocument::InsertBookmarkAsObject(
const std::vector<rtl::OUString> &rBookmarkList,
- const std::vector<rtl::OUString> &rExchangeList, // Liste der zu verwendenen Namen
+ const std::vector<rtl::OUString> &rExchangeList, // List of names to use
sal_Bool /* bLink */,
::sd::DrawDocShell* pBookmarkDocSh,
Point* pObjPos, bool bCalcObjCount)
@@ -1013,17 +965,14 @@
std::vector<rtl::OUString>::const_iterator pIter;
for ( pIter = rBookmarkList.begin(); pIter != rBookmarkList.end(); ++pIter )
{
- /******************************************************************
- * Namen der Bookmarks aus Liste holen
- ******************************************************************/
+ // Get names of bookmarks from the list
String aBMName (*pIter);
SdrObject* pObj = pBookmarkDoc->GetObj(aBMName);
if (pObj)
{
- // Objekt gefunden
-
+ // Found an object
if (pObj->GetObjInventor() == SdrInventor &&
pObj->GetObjIdentifier() == OBJ_OLE2)
{
@@ -1032,7 +981,7 @@
if (!pBMView)
{
- // View erstmalig erzeugen
+ // Create View for the first time
pBMView = new ::sd::View(*pBookmarkDoc, (OutputDevice*) NULL);
pBMView->EndListening(*pBookmarkDoc);
}
@@ -1057,13 +1006,11 @@
if (pBMView)
{
- /**********************************************************************
- * Selektierte Objekte einfuegen
- **********************************************************************/
+ // Insert selected objects
::sd::View* pView = new ::sd::View(*this, (OutputDevice*) NULL);
pView->EndListening(*this);
- // Seite bestimmen, auf der die Objekte eingefuegt werden sollen
+ // Look for the page into which the objects are supposed to be inserted
SdrPage* pPage = GetSdPage(0, PK_STANDARD);
if (mpDocSh)
@@ -1072,7 +1019,7 @@
if (pViewSh)
{
- // Welche Seite wird denn aktuell angezeigt?
+ // Which page is currently in view?
SdrPageView* pPV = pViewSh->GetView()->GetSdrPageView();
if (pPV)
@@ -1101,7 +1048,7 @@
if (!rExchangeList.empty() || bCalcObjCount)
{
- // OrdNums sortieren und Anzahl Objekte vor dem Einfuegen bestimmen
+ // Sort OrdNums and get the number of objects before inserting
pPage->RecalcObjOrdNums();
nCountBefore = pPage->GetObjCount();
}
@@ -1116,19 +1063,19 @@
pBMView->GetDoc().SetAllocDocSh(sal_False);
if (!bOLEObjFound)
- delete pTmpDoc; // Wird ansonsten von der DocShell zerstoert
+ delete pTmpDoc; // Would otherwise be destroyed by DocShell
delete pView;
if (!rExchangeList.empty())
{
- // Anzahl Objekte nach dem Einfuegen bestimmen
+ // Get number of objects after inserting.
sal_uLong nCount = pPage->GetObjCount();
std::vector<rtl::OUString>::const_iterator pIter = rExchangeList.begin();
for (sal_uLong nObj = nCountBefore; nObj < nCount; nObj++)
{
- // Zuverwendener Name aus Exchange-Liste holen
+ // Get the name to use from the Exchange list
if (pIter != rExchangeList.end())
{
String aExchangeName (*pIter);
@@ -1149,12 +1096,7 @@
return bOK;
}
-/*************************************************************************
-|*
-|* Beendet das Einfuegen von Bookmarks
-|*
-\************************************************************************/
-
+// Stops the bookmark insertion
void SdDrawDocument::CloseBookmarkDoc()
{
if (mxBookmarkDocShRef.Is())
@@ -1166,47 +1108,27 @@
maBookmarkFile = String();
}
-/*************************************************************************
-|*
-|* Dokument laden (fuer gelinkte Objekte)
-|*
-\************************************************************************/
-
+// Load document (for linked objects)
const SdrModel* SdDrawDocument::LoadModel(const String& rFileName)
{
return ( OpenBookmarkDoc(rFileName) );
}
-/*************************************************************************
-|*
-|* Dokument schliessen (fuer gelinkte Objekte)
-|*
-\************************************************************************/
-
+// Close document (for linked objects)
void SdDrawDocument::DisposeLoadedModels()
{
CloseBookmarkDoc();
}
-/*************************************************************************
-|*
-|* Ist das Dokument read-only?
-|*
-\************************************************************************/
-
+// Is this document read-only?
bool SdDrawDocument::IsReadOnly() const
{
return sal_False;
}
-/*************************************************************************
-|*
-|* In anschliessendem AllocModel() wird eine DocShell erzeugt
-|* (xAllocedDocShRef). Eine bereits bestehende DocShell wird ggf. geloescht
-|*
-\************************************************************************/
-
+// In the subsequent AllocModel() a DocShell (xAllocedDocShRef) is created.
+// Any pre-existing DocShell is deleted
void SdDrawDocument::SetAllocDocSh(sal_Bool bAlloc)
{
mbAllocDocSh = bAlloc;
@@ -1219,29 +1141,18 @@
mxAllocedDocShRef.Clear();
}
-/*************************************************************************
-|*
-|* Liste der CustomShows zurueckgeben (ggf. zuerst erzeugen)
-|*
-\************************************************************************/
-
+// Return list of CustomShows (create it, too, if necessary)
SdCustomShowList* SdDrawDocument::GetCustomShowList(sal_Bool bCreate)
{
if (!mpCustomShowList && bCreate)
{
- // Liste erzeugen
mpCustomShowList = new SdCustomShowList;
}
return mpCustomShowList;
}
-/*************************************************************************
-|*
-|* Nicht benutzte MasterPages und Layouts entfernen
-|*
-\************************************************************************/
-
+// Remove unused master pages and layouts
void SdDrawDocument::RemoveUnnecessaryMasterPages(SdPage* pMasterPage, sal_Bool
bOnlyDuplicatePages, sal_Bool bUndo)
{
::sd::View* pView = NULL;
@@ -1258,9 +1169,7 @@
pView = mpDocSh->GetViewShell()->GetView();
}
- /***********************************************************
- * Alle MasterPages pruefen
- ***********************************************************/
+ // Check all master pages
sal_uInt16 nSdMasterPageCount = GetMasterSdPageCount( PK_STANDARD );
for (sal_Int32 nMPage = nSdMasterPageCount - 1; nMPage >= 0; nMPage--)
{
@@ -1290,7 +1199,7 @@
GetMasterPageUserCount( pMaster ) == 0 &&
pNotesMaster )
{
- // Do not delete master pages that have their precious flag set.
+ // Do not delete master pages that have their precious flag set
sal_Bool bDeleteMaster = !pMaster->IsPrecious();
OUString aLayoutName = pMaster->GetLayoutName();
@@ -1347,9 +1256,9 @@
delete pMaster;
if( bUndo )
- EndUndo(); // schon hier, damit sich Joes Actions ZWISCHEN unsere eigenen
schieben
+ EndUndo(); // do this here already, so Joe's actions happen _between_ our own
- // alte Layoutvorlagen loeschen, wenn sie nicht mehr benoetigt werden
+ // Delete old, unused layout stylesheets
sal_Bool bDeleteOldStyleSheets = sal_True;
for ( sal_uInt16 nMPg = 0;
nMPg < GetMasterPageCount() && bDeleteOldStyleSheets;
@@ -1369,7 +1278,7 @@
if( bUndo )
{
- // die Liste gehoert der UndoAction
+ // This list belongs to UndoAction
SdMoveStyleSheetsUndoAction* pMovStyles = new SdMoveStyleSheetsUndoAction(
this, aRemove, false );
if (pUndoMgr)
@@ -1383,28 +1292,25 @@
}
if (pMasterPage)
- break; // Nur diese eine MasterPage!
+ break; // Just this one master page!
}
}
-/*************************************************************************
-|*
-|* MasterPage austauschen
-|*
-|* Entweder erhaelt nSdPageNum eine neue, eigene MasterPage, oder die MasterPage
-|* wird komplett ausgetauscht (gilt dann fuer alle Seiten).
-|*
-|* nSdPageNum : Nummer der Seite, welche die neue MasterPage erhalten soll
-|* rLayoutName : LayoutName der neuen MasterPage
-|* pSourceDoc : Dokument (Vorlage) aus dem die MasterPage geholt wird
-|* bMaster : Die MasterPage von nSdPageNum soll ausgetauscht werden
-|* bCheckMasters: Nicht benutzte MasterPages sollen entfernt werden
-|*
-|* Ist pSourceDoc == NULL, so wird eine leere MasterPage zugewiesen.
-|* Ist rLayoutName leer, so wird die erste MasterPage genommen
-\************************************************************************/
-
+/** Exchange master page
+ *
+ * Either the nSdPageNum gets a new, own master page or the master page is
+ * exchanged completely (which then applies to all pages).
+ *
+ * nSdPageNum : page number that the new master page should get.
+ * rLayoutName : LayoutName of the new master page
+ * pSourceDoc : document (template) to get the master page from
+ * bMaster : exchange the master page of nSdPageNum
+ * bCheckMasters: remove unused master pages
+ *
+ * If pSourceDoc == NULL, an empty master page is applied.
+ * If rLayoutName is empty, the first master page is used.
+ */
void SdDrawDocument::SetMasterPage(sal_uInt16 nSdPageNum,
const String& rLayoutName,
SdDrawDocument* pSourceDoc,
@@ -1438,12 +1344,10 @@
if (pSourceDoc)
{
- std::vector<StyleReplaceData> aReplList; // Liste fuer ersetzte StyleSheets
+ std::vector<StyleReplaceData> aReplList; // List of replaced stylesheets
sal_Bool bLayoutReloaded = sal_False; // Wurde ex. Layout wieder geladen?
- /*********************************************************************
- |* LayoutName, Page and Notespage
- \*********************************************************************/
+ // LayoutName, Page and Notes page
if (rLayoutName.Len() == 0)
{
// No LayoutName: take first MasterPage
@@ -1484,7 +1388,7 @@
}
}
- // we should never reach this, but one never knows....
+ // we should never reach this, but one never knows...
if( (pMaster == NULL) || (pNotesMaster == NULL) )
{
pUndoMgr->LeaveListAction();
@@ -1510,16 +1414,14 @@
}
}
- /*****************************************************************
- |* Praesentationsvorlagen korrigieren bzw. neu anlegen
- \****************************************************************/
- // nur die Praesentationsvorlagen beachten
+ // Correct or create presentation templates --
+ // only worry about presentation templates
String aName;
SdStyleSheetPool* pSourceStyleSheetPool = (SdStyleSheetPool*)
pSourceDoc->GetStyleSheetPool();
pSourceStyleSheetPool->SetSearchMask(SD_STYLE_FAMILY_MASTERPAGE);
static_cast<SdStyleSheetPool*>(
mxStyleSheetPool.get())->SetSearchMask(SD_STYLE_FAMILY_MASTERPAGE);
- SdStyleSheetVector aCreatedStyles; // Liste fuer erzeugte StyleSheets
+ SdStyleSheetVector aCreatedStyles; // List of created stylesheets
SfxStyleSheetBase* pHisSheet = pSourceStyleSheetPool->First();
while (pHisSheet)
@@ -1532,13 +1434,13 @@
if (pMySheet)
{
- // Es ist eine gleichnamige Vorlage vorhanden ist: Inhalte ersetzen
+ // A stylesheet of the same name already exists -> overwrite contents
#ifdef DBG_UTIL
sal_Bool bTest =
#endif
pMySheet->SetName(pHisSheet->GetName());
- DBG_ASSERT(bTest, "StyleSheet-Umbenennung fehlgeschlagen");
- pMySheet->GetItemSet().ClearItem(0); // alle loeschen
+ DBG_ASSERT(bTest, "Renaming StyleSheet failed.");
+ pMySheet->GetItemSet().ClearItem(0); // Delete all
StyleSheetUndoAction* pUndoChStyle = new StyleSheetUndoAction(this,
pMySheet,
&pHisSheet->GetItemSet());
@@ -1552,7 +1454,7 @@
String aHelpFile;
pMySheet = static_cast<SfxStyleSheet*>( &mxStyleSheetPool->Make(aName,
SD_STYLE_FAMILY_MASTERPAGE, pHisSheet->GetMask()) );
pMySheet->SetHelpId( aHelpFile, pHisSheet->GetHelpId(aHelpFile) );
- pMySheet->GetItemSet().ClearItem(0); // alle loeschen
+ pMySheet->GetItemSet().ClearItem(0); // Delete all
pMySheet->GetItemSet().Put(pHisSheet->GetItemSet());
aCreatedStyles.push_back( SdStyleSheetRef( static_cast< SdStyleSheet* >(
pMySheet ) ) );
@@ -1574,9 +1476,8 @@
pHisSheet = (SfxStyleSheet*) pSourceStyleSheetPool->Next();
}
- // wenn neue Vorlagen erzeugt wurden:
- // eventuell bestehende Parent-Verkettung der Itemsets in den
- // Vorlagen wieder aufbauen
+ // If new styles were created: re-create parent chaining of the item
+ // sets in the styles.
if(!aCreatedStyles.empty())
{
std::vector<StyleReplaceData>::iterator pRDataIter;
@@ -1606,43 +1507,43 @@
}
}
- // ab jetzt beim Suchen alle beachten
+ // Now look for all of them when searching
pSourceStyleSheetPool->SetSearchMask(SFX_STYLE_FAMILY_ALL);
mxStyleSheetPool->SetSearchMask(SFX_STYLE_FAMILY_ALL);
}
if( !aCreatedStyles.empty() )
{
- // UndoAction fuer das Erzeugen und Einfuegen vorn StyleSheets
- // auf den UndoManager legen
+ // Add UndoAction for creating and inserting the stylesheets to
+ // the top of the UndoManager
SdMoveStyleSheetsUndoAction* pMovStyles = new SdMoveStyleSheetsUndoAction( this,
aCreatedStyles, sal_True);
pUndoMgr->AddUndoAction(pMovStyles);
}
}
- // Layoutnamen auf Basis des Seitenlayoutnamens der Masterpage bilden
+ // Create layout name based upon the name of the page layout of the
+ // master page
String aPageLayoutName(pMaster->GetLayoutName());
String aLayoutName = aPageLayoutName;
aLayoutName.Erase( aLayoutName.SearchAscii( SD_LT_SEPARATOR ));
if (pSourceDoc != this)
{
- // Aus dem Source-Dokument austragen
+ // Remove from the source document
pSourceDoc->RemoveMasterPage(pNotesMaster->GetPageNum());
pSourceDoc->RemoveMasterPage(pMaster->GetPageNum());
}
- /*********************************************************************
- |* Neue MasterPages ins Dokument eintragen und den Standard- und
- |* Notizseiten das Praesentationslayout ueberbraten
- \********************************************************************/
+ // Register the new master pages with the document and then use the
+ // the new presentation layout for the default and notes pages
if (pSourceDoc != this)
{
- // Die Masterpages einfuegen:
- // Masterpages von neuen Layouts hinten anhaengen; wird ein Layout
- // dagegen ersetzt, so muss vor der Position der alten Masterpage
- // eingefuegt werden, damit ab jetzt beim Suchen (z. B. SdPage::
- // SetPresentationLayout) die neue Masterpage zuerst gefunden wird
+ // Insert the master pages:
+ // Insert master pages from new layouts at the end.
+ // If a layout is being replaced, however, insert them before the
+ // position of the old master page, so from now on the new master
+ // page will be found when searching (e.g.
+ // SdPage::SetPresentationLayout).
sal_uInt16 nInsertPos = rOldMaster.GetPageNum();
BegUndo();
@@ -1660,11 +1561,11 @@
{
AddUndo(GetSdrUndoFactory().CreateUndoNewPage(*pNotesMaster));
- EndUndo(); // schon hier, damit sich Joes Actions ZWISCHEN unsere eigenen schieben
+ EndUndo(); // do this here already, so Joe's actions happen _between_ our own.
}
}
- // Liste mit Seiten fuellen
+ // Fill list with pages
std::vector<SdPage*> aPageList;
// #98456, this has to be removed according to CL (KA 07/08/2002)
@@ -1709,12 +1610,9 @@
(*pIter)->SetAutoLayout(eAutoLayout);
}
- /*********************************************************************
- |* Neue Masterpages angleichen
- \********************************************************************/
+ // Adapt new master pages
if (pSourceDoc != this)
{
- // die Masterpages angleichen
Size aSize(rOldMaster.GetSize());
Rectangle aBorderRect(rOldMaster.GetLftBorder(),
rOldMaster.GetUppBorder(),
@@ -1753,9 +1651,7 @@
}
else
{
- /*********************************************************************
- |* Einen neuen Layoutnamen ausdenken
- \********************************************************************/
+ // Find a new name for the layout
String aName = String(SdResId(STR_LAYOUT_DEFAULT_NAME));
String aTest;
sal_Bool bNotANewName = sal_True;
@@ -1764,12 +1660,12 @@
for (nCount = 0; bNotANewName; nCount++)
{
- // Testnamen bilden
- aTest = aName; // Standard, Standard1, Standard2, ...
+ // Create a test name
+ aTest = aName; // Default, Default1, Default2, ...
if (nCount > 0)
aTest += OUString::number( nCount );
- // gibt's schon eine, die so heisst?
+ // Is there any page that's already named the same?
bNotANewName = sal_False;
for (sal_uInt16 nMPg = 1; nMPg < nMPgCount; nMPg++)
{
@@ -1786,9 +1682,7 @@
aPageLayoutName.AppendAscii( RTL_CONSTASCII_STRINGPARAM( SD_LT_SEPARATOR ));
aPageLayoutName += String(SdResId(STR_LAYOUT_OUTLINE));
- /*********************************************************************
- |* Neue StyleSheets erzeugen
- \********************************************************************/
+ // Generate new stylesheets
static_cast<SdStyleSheetPool*>( mxStyleSheetPool.get())->CreateLayoutStyleSheets(aName);
SdStyleSheetVector aCreatedStyles;
static_cast<SdStyleSheetPool*>( mxStyleSheetPool.get())->CreateLayoutSheetList(aName,
aCreatedStyles);
@@ -1799,10 +1693,7 @@
pUndoMgr->AddUndoAction(pMovStyles);
}
- /*********************************************************************
- |* Neue MasterPages erzeugen und ins Dokument eintragen
- \********************************************************************/
-
+ // Generate new master pages and register them with the document
if( bUndo )
BegUndo();
@@ -1840,9 +1731,7 @@
if( bUndo )
EndUndo();
- /*********************************************************************
- |* Liste der betroffenen Standard- und Notizseiten erstellen
- \********************************************************************/
+ // Create a list of affected default and notes pages
std::vector<SdPage*> aPageList;
if (bMaster)
{
@@ -1862,9 +1751,7 @@
aPageList.push_back(pNotes);
}
- /*********************************************************************
- |* An den betroffenen Seiten Praesentations- und Autolayout setzen
- \********************************************************************/
+ // Set presentation layout and AutoLayout for the affected pages
for ( std::vector<SdPage*>::iterator pIter = aPageList.begin(); pIter != aPageList.end();
++pIter )
{
AutoLayout eOldAutoLayout = (*pIter)->GetAutoLayout();
@@ -1886,19 +1773,16 @@
}
}
- /*********************************************************************
- |* falls die alten Masterpages nicht mehr benoetigt werden,
- |* muessen sie und die entsprechenden Praesentationsvorlagen
- |* entfernt werden
- \********************************************************************/
+ // If the old master pages aren't used anymore, they and their styles have
+ // to be removed.
if (bCheckMasters)
{
- // Alle pruefen
+ // Check all
RemoveUnnecessaryMasterPages();
}
else
{
- // Nur die ausgetauschte MasterPage pruefen
+ // Check only the master page that was replaced
RemoveUnnecessaryMasterPages(&rOldMaster);
}
diff --git a/sd/source/core/drawdoc4.cxx b/sd/source/core/drawdoc4.cxx
index 25a0c8d..35b0de6 100644
--- a/sd/source/core/drawdoc4.cxx
+++ b/sd/source/core/drawdoc4.cxx
@@ -115,17 +115,11 @@
using namespace ::com::sun::star::linguistic2;
using namespace ::sd;
-/*************************************************************************
-|*
-|* CreateLayoutTemplates, Layoutvorlagen erzeugen
-|*
-|* Z.Zt. (31.03.95) speichert der StyleSheetPool nur diejenigen Sheets, die
-|* ein ItemSet haben. Damit alle Sheets gespeichert werden, wird die ItemSet-
-|* Erzeugung mit einem GetItemSet-Aufruf erzwungen.
-|* Dies kann entfallen, sobald der Pool auch Sheets ohne ItemSet speichert.
-|*
-\************************************************************************/
-
+// CreateLayoutTemplates
+// At the moment (31.03.1995), the StyleSheetPool only saves styleheets that
+// have an ItemSet. To save all stylesheets, we force the creation of an ItemSet
+// with a GetItemSet call.
+// We can remove this behavior once the pool saves styleheets even without an ItemSet
void SdDrawDocument::CreateLayoutTemplates()
{
SdStyleSheetPool* pSSPool = (SdStyleSheetPool*)GetStyleSheetPool();
@@ -133,12 +127,8 @@
String aHelpFile;
String aStdName = String(SdResId(STR_STANDARD_STYLESHEET_NAME));
- // ---- Standardvorlage -----------------------------------------------
+ // Default style
- // nicht benutzt, nicht benutzerdefiniert
- // SB hatte wahrscheinlich Probleme mit SFXSTYLEBIT_AUTO, da dann gar nichts
- // mehr im Gestalter angezeigt wird. Dieses Problem ist zu 364 j behoben worden
- // sal_uInt16 nMask = SFXSTYLEBIT_ALL & ~(SFXSTYLEBIT_USED | SFXSTYLEBIT_USERDEF);
sal_uInt16 nMask = SFXSTYLEBIT_AUTO;
String aName(aStdName);
@@ -156,7 +146,7 @@
aNullGrad.SetEndIntens( 100 );
XHatch aNullHatch(aNullCol);
- // Linienattribute (Extended OutputDevice)
+ // Line attributes (Extended OutputDevice)
rISet.Put(XLineStyleItem(XLINE_SOLID));
rISet.Put(XLineColorItem(String(), RGB_Color(COL_DEFAULT_SHAPE_STROKE)));
rISet.Put(XLineWidthItem(0));
@@ -169,7 +159,7 @@
rISet.Put(XLineEndCenterItem());
rISet.Put(SdrTextHorzAdjustItem(SDRTEXTHORZADJUST_BLOCK));
- // Fuellattribute (Extended OutputDevice)
+ // Fill attributes (Extended OutputDevice)
rISet.Put(XFillStyleItem(XFILL_SOLID));
rISet.Put(XFillColorItem(String(), RGB_Color(COL_DEFAULT_SHAPE_FILLING)));
@@ -181,10 +171,10 @@
aNullBmp.Erase( aNullColor );
rISet.Put(XFillBitmapItem(pPool,aNullBmp));
- // Schattenattribute (Drawing Engine)
+ // Shadow attributes (Drawing Engine)
rISet.Put(SdrShadowItem(sal_False));
rISet.Put(SdrShadowColorItem(RGB_Color(COL_GRAY)));
- rISet.Put(SdrShadowXDistItem(200)); // 3 mm Schattendistanz
+ rISet.Put(SdrShadowXDistItem(200)); // 3 mm Shadow distance
rISet.Put(SdrShadowYDistItem(200));
Font aLatinFont, aCJKFont, aCTLFont;
@@ -225,7 +215,7 @@
rISet.Put(SvxCharReliefItem(RELIEF_NONE, EE_CHAR_RELIEF));
rISet.Put(SvxColorItem(Color(COL_AUTO), EE_CHAR_COLOR ));
- // Absatzattribute (Edit Engine)
+ // Paragraph attributes (Edit Engine)
rISet.Put(SvxLRSpaceItem(EE_PARA_LRSPACE));
rISet.Put(SvxULSpaceItem(EE_PARA_ULSPACE));
@@ -240,28 +230,27 @@
rISet.Put( SvxAutoKernItem( sal_True, EE_CHAR_PAIRKERNING ) );
// Bullet
- // BulletItem und BulletFont fuer Titel und Gliederung
+ // BulletItem and BulletFont for title and outline
SvxBulletItem aBulletItem(EE_PARA_BULLET);
- // die sind in allen Ebenen identisch
+ // Identical in all layers
aBulletItem.SetStyle(BS_BULLET);
aBulletItem.SetStart(1);
- aBulletItem.SetScale(45); // in Prozent
+ aBulletItem.SetScale(45); // In percent
Font aBulletFont( pSSPool->GetBulletFont() );
aBulletFont.SetSize(Size(0,635)); // sj: (i33745) changed default from 24 to 18 pt
aBulletItem.SetFont(aBulletFont);
- aBulletItem.SetSymbol( 0x25CF ); // Punkt
+ aBulletItem.SetSymbol( 0x25CF ); // In points
rISet.Put(aBulletItem);
- // Neues BulletItem
+ // New BulletItem
pSSPool->PutNumBulletItem( pSheet, aBulletFont );
SfxItemSet* pISet = NULL;
- // ---- Objekt mit Pfeilspitze ----------------------------------------
-
+ // Object with arrowhead
aName = String(SdResId(STR_POOLSHEET_OBJWITHARROW));
pSheet = &(pSSPool->Make(aName, SD_STYLE_FAMILY_GRAPHICS, nMask));
pSheet->SetParent(aStdName);
@@ -283,8 +272,7 @@
pISet->Put(XLineEndWidthItem(300));
pISet->Put(XLineStartCenterItem(sal_True));
- // ---- Objekt mit Schatten -------------------------------------------
-
+ // Object with Shadow
aName = String(SdResId(STR_POOLSHEET_OBJWITHSHADOW));
pSheet = &(pSSPool->Make(aName, SD_STYLE_FAMILY_GRAPHICS, nMask));
pSheet->SetParent(aStdName);
@@ -293,11 +281,10 @@
pISet->Put(SdrShadowItem(sal_True));
pISet->Put(SdrShadowColorItem(RGB_Color(COL_GRAY)));
- pISet->Put(SdrShadowXDistItem(200)); // 3 mm Schattendistanz
+ pISet->Put(SdrShadowXDistItem(200)); // 3 mm shadow distance
pISet->Put(SdrShadowYDistItem(200));
- // ---- Objekt ohne F�llung -------------------------------------------
-
+ // Object without fillung
aName = String(SdResId(STR_POOLSHEET_OBJWITHOUTFILL));
pSheet = &(pSSPool->Make(aName, SD_STYLE_FAMILY_GRAPHICS, nMask));
pSheet->SetParent(aStdName);
@@ -307,8 +294,7 @@
pISet->Put(XFillStyleItem(XFILL_NONE));
pISet->Put(XLineColorItem(String(), RGB_Color(COL_BLACK)));
- // ---- Text ----------------------------------------------------------
-
+ // Text
aName = String(SdResId(STR_POOLSHEET_TEXT));
pSheet = &(pSSPool->Make(aName, SD_STYLE_FAMILY_GRAPHICS, nMask));
pSheet->SetParent(aStdName);
@@ -318,8 +304,7 @@
pISet->Put(XLineStyleItem(XLINE_NONE));
pISet->Put(XFillStyleItem(XFILL_NONE));
- // ---- Textk�rper ----------------------------------------------------
-
+ // Text body
aName = String(SdResId(STR_POOLSHEET_TEXTBODY));
pSheet = &(pSSPool->Make(aName, SD_STYLE_FAMILY_GRAPHICS, nMask));
pSheet->SetParent(aStdName);
@@ -331,8 +316,7 @@
pISet->Put(SvxFontHeightItem(564, 100, EE_CHAR_FONTHEIGHT)); // 16 pt
- // ---- Textk�rper mit Blocksatz --------------------------------------
-
+ // Text body, justified
aName = String(SdResId(STR_POOLSHEET_TEXTBODY_JUSTIFY));
pSheet = &(pSSPool->Make(aName, SD_STYLE_FAMILY_GRAPHICS, nMask));
pSheet->SetParent(aStdName);
@@ -344,8 +328,7 @@
pISet->Put(SvxAdjustItem(SVX_ADJUST_BLOCK, EE_PARA_JUST ));
- // ---- Textkoerper mit Einzug -----------------------------------------
-
+ // Text body, indented
aName = String(SdResId(STR_POOLSHEET_TEXTBODY_INDENT));
pSheet = &(pSSPool->Make(aName, SD_STYLE_FAMILY_GRAPHICS, nMask));
pSheet->SetParent(aStdName);
@@ -356,10 +339,10 @@
pISet->Put(XFillStyleItem(XFILL_NONE));
SvxLRSpaceItem aLRSpaceItem( EE_PARA_LRSPACE );
- aLRSpaceItem.SetTxtFirstLineOfst(600); // Erstzeileneinzug 6mm, rechts 0
+ aLRSpaceItem.SetTxtFirstLineOfst(600); // Indentation of first line: 6mm; right: 0
pISet->Put(aLRSpaceItem);
- // ---- Titel ---------------------------------------------------------
+ // Title
aName = String(SdResId(STR_POOLSHEET_TITLE));
pSheet = &(pSSPool->Make(aName, SD_STYLE_FAMILY_GRAPHICS, nMask));
@@ -372,8 +355,7 @@
pISet->Put(SvxFontHeightItem(1551, 100, EE_CHAR_FONTHEIGHT )); // 44 pt
- // ---- Titel1 --------------------------------------------------------
-
+ // Title1
aName = String(SdResId(STR_POOLSHEET_TITLE1));
pSheet = &(pSSPool->Make(aName, SD_STYLE_FAMILY_GRAPHICS, nMask));
pSheet->SetParent(aStdName);
@@ -386,14 +368,14 @@
pISet->Put(SdrShadowItem(sal_True));
pISet->Put(SdrShadowColorItem(RGB_Color(COL_GRAY)));
- pISet->Put(SdrShadowXDistItem(200)); // 2 mm Schattendistanz
+ pISet->Put(SdrShadowXDistItem(200)); // 2 mm shadow distance
pISet->Put(SdrShadowYDistItem(200));
pISet->Put(SvxFontHeightItem(846, 100, EE_CHAR_FONTHEIGHT )); // 24 pt
pISet->Put(SvxAdjustItem(SVX_ADJUST_CENTER, EE_PARA_JUST ));
- // ---- Titel2 --------------------------------------------------------
+ // Title2
aName = String(SdResId(STR_POOLSHEET_TITLE2));
pSheet = &(pSSPool->Make(aName, SD_STYLE_FAMILY_GRAPHICS, nMask));
@@ -403,26 +385,26 @@
pISet->Put(XLineWidthItem(50));
- // Farbe nicht aus der Farbtabelle holen, denn da kann diese Farbe
- // geloescht oder veraendert sein
+ // Don't get color from the color table, because the color might have been
+ // deleted or changed there
Color aOrange4(255, 204, 153);
pISet->Put(XFillColorItem(String(), aOrange4));
pISet->Put(SdrShadowItem(sal_True));
pISet->Put(SdrShadowColorItem(RGB_Color(COL_GRAY)));
- pISet->Put(SdrShadowXDistItem(200)); // 2 mm Schattendistanz
+ pISet->Put(SdrShadowXDistItem(200)); // 2 mm shadow distance
pISet->Put(SdrShadowYDistItem(200));
pISet->Put(SvxFontHeightItem(1270, 100, EE_CHAR_FONTHEIGHT )); // 36 pt
SvxLRSpaceItem aLRSpItem( 200, 200, 0, 0, EE_PARA_LRSPACE);
- pISet->Put( aLRSpItem ); // Erstzeileneinzug 0 mm, links und rechts 2 mm
+ pISet->Put( aLRSpItem ); // Indentation of first line: 0 mm; left and right: 2 mm
- pISet->Put(SvxULSpaceItem(100, 100, EE_PARA_ULSPACE )); // Absatzrand oben/unten 1 mm
+ pISet->Put(SvxULSpaceItem(100, 100, EE_PARA_ULSPACE )); // Paragraph margin above/below:
1 mm
pISet->Put(SvxAdjustItem(SVX_ADJUST_CENTER, EE_PARA_JUST ));
- // ---- Ueberschrift ---------------------------------------------------
+ // Headline
aName = String(SdResId(STR_POOLSHEET_HEADLINE));
pSheet = &(pSSPool->Make(aName, SD_STYLE_FAMILY_GRAPHICS, nMask));
@@ -435,11 +417,10 @@
pISet->Put(SvxFontHeightItem(846, 100, EE_CHAR_FONTHEIGHT )); // 24 pt
- pISet->Put(SvxULSpaceItem(420, 210, EE_PARA_ULSPACE )); // Absatzrand oben 4,2 mm,
- // unten 2,1 mm
+ pISet->Put(SvxULSpaceItem(420, 210, EE_PARA_ULSPACE )); // Paragraph margin above: 4,2 mm,
+ // Paragraph margin below: 2,1 mm
- // ---- Ueberschrift1 --------------------------------------------------
-
+ // Headline1
aName = String(SdResId(STR_POOLSHEET_HEADLINE1));
pSheet = &(pSSPool->Make(aName, SD_STYLE_FAMILY_GRAPHICS, nMask));
pSheet->SetParent(aStdName);
@@ -453,11 +434,10 @@
pISet->Put(SvxFontHeightItem(635, 100, EE_CHAR_FONTHEIGHT )); // 18 pt
- pISet->Put(SvxULSpaceItem(420, 210, EE_PARA_ULSPACE )); // Absatzrand oben 4,2 mm,
- // unten 2,1 mm
+ pISet->Put(SvxULSpaceItem(420, 210, EE_PARA_ULSPACE )); // Paragraph margin above: 4,2 mm,
+ // Paragraph margin below: 2,1 mm
- // ---- Ueberschrift2 --------------------------------------------------
-
+ // Headline2
aName = String(SdResId(STR_POOLSHEET_HEADLINE2));
pSheet = &(pSSPool->Make(aName, SD_STYLE_FAMILY_GRAPHICS, nMask));
pSheet->SetParent(aStdName);
@@ -472,11 +452,10 @@
pISet->Put(SvxFontHeightItem(494, 100, EE_CHAR_FONTHEIGHT )); // 14 pt
- pISet->Put(SvxULSpaceItem(420, 210, EE_PARA_ULSPACE )); // Absatzrand oben 4,2 mm,
- // unten 2,1 mm
+ pISet->Put(SvxULSpaceItem(420, 210, EE_PARA_ULSPACE )); // Paragraph margin above: 4,2 mm,
+ // Paragraph margin below: 2,1 mm
- // ---- Bemassung --------------------------------------------------
-
+ // Measurements
aName = String(SdResId(STR_POOLSHEET_MEASURE));
pSheet = &(pSSPool->Make(aName, SD_STYLE_FAMILY_GRAPHICS, nMask));
pSheet->SetParent(aStdName);
@@ -495,7 +474,7 @@
pISet->Put(XLineStyleItem(XLINE_SOLID));
pISet->Put(SdrMeasureShowUnitItem(true));
- // Praesentationsvorlagen fuer das Standardlayout erzeugen
+ // Generate presentation templates for default layout.
String aPrefix = String(SdResId(STR_LAYOUT_DEFAULT_NAME));
pSSPool->CreateLayoutStyleSheets(aPrefix);
}
@@ -588,7 +567,7 @@
rISet.Put(SvxColorItem(Color(COL_AUTO), EE_CHAR_COLOR ));
- // Absatzattribute (Edit Engine)
+ // Paragraph attributes (Edit Engine)
rISet.Put(SvxLRSpaceItem(EE_PARA_LRSPACE));
rISet.Put(SvxULSpaceItem(EE_PARA_ULSPACE));
@@ -640,7 +619,7 @@
implCreateTableTemplate( xTableFamily, "orange" , aOrange1, aOrange3, aOrange2 );
- // ---- Turquise --------------------------------------------------
+ // ---- Turquoise --------------------------------------------------
Any aTurquise1( implMakeSolidCellStyle( pSSPool, "turquise1" , aDefaultCellStyleName,
RGB_COLORDATA(71,184,184)));
Any aTurquise2( implMakeSolidCellStyle( pSSPool, "turquise2" , aDefaultCellStyleName,
RGB_COLORDATA(51,163,163)));
@@ -680,7 +659,7 @@
implCreateTableTemplate( xTableFamily, "green" , aGreen1, aGreen3, aGreen2 );
- // ---- Seetang ----------------------------------------------
+ // ---- Seaweed ----------------------------------------------
Any aSeetang1( implMakeSolidCellStyle( pSSPool, "seetang1" , aDefaultCellStyleName,
RGB_COLORDATA(204,255,255)));
Any aSeetang2( implMakeSolidCellStyle( pSSPool, "seetang2" , aDefaultCellStyleName,
RGB_COLORDATA(71,184,184)));
@@ -705,12 +684,7 @@
implCreateTableTemplate( xTableFamily, "yellow" , aYellow1, aYellow3, aYellow2 );
}
-/*************************************************************************
-|*
-|* Anzahl der Seiten, die eine masterPage referenzieren
-|*
-\************************************************************************/
-
+// Number of pages that reference a master page
sal_uInt16 SdDrawDocument::GetMasterPageUserCount(SdrPage* pMaster) const
{
sal_uInt16 nResult = 0;
@@ -733,11 +707,7 @@
}
-/*************************************************************************
-|*
-|* OnlineSpelling im Hintergrund beenden
-|*
-\************************************************************************/
+// Finish OnlineSpelling in the background
void SdDrawDocument::StopOnlineSpelling()
{
@@ -753,12 +723,7 @@
mpOnlineSpellingList = NULL;
}
-/*************************************************************************
-|*
-|* OnlineSpelling im Hintergrund starten
-|*
-\************************************************************************/
-
+// Start OnlineSpelling in the background
void SdDrawDocument::StartOnlineSpelling(sal_Bool bForceSpelling)
{
if (mbOnlineSpell && (bForceSpelling || mbInitialOnlineSpellingEnabled) &&
@@ -783,13 +748,13 @@
for ( nPage = 0; nPage < GetPageCount(); nPage++ )
{
- // Alle Pages durchsuchen
+ // Search in all pages
FillOnlineSpellingList((SdPage*) GetPage(nPage));
}
for (nPage = 0; nPage < GetMasterPageCount(); nPage++)
{
- // Alle MasterPages durchsuchen
+ // Search all master pages
FillOnlineSpellingList((SdPage*) GetMasterPage(nPage));
}
@@ -801,12 +766,7 @@
}
}
-/*************************************************************************
-|*
-|* OnlineSpelling-Liste fuellen
-|*
-\************************************************************************/
-
+// Fill OnlineSpelling list
void SdDrawDocument::FillOnlineSpellingList(SdPage* pPage)
{
SdrObject* pObj = NULL;
@@ -821,12 +781,12 @@
if (pObj->GetOutlinerParaObject())
{
- // Textobjekt gefunden
+ // Found a text object
mpOnlineSpellingList->addShape(*pObj);
}
else if (pObj->GetObjIdentifier() == OBJ_GRUP)
{
- // Gruppenobjekt gefunden
+ // Found a group object
SdrObjListIter aGroupIter(*((SdrObjGroup*)pObj)->GetSubList(),
IM_DEEPNOGROUPS);
@@ -836,7 +796,7 @@
{
if (aGroupIter.Next()->GetOutlinerParaObject())
{
- // Textobjekt im Gruppenobjekt gefunden
+ // Found a text object in a group object
bSubTextObjFound = sal_True;
}
}
@@ -849,32 +809,25 @@
}
}
-/*************************************************************************
-|*
-|* OnlineSpelling im Hintergrund
-|*
-\************************************************************************/
-
+// OnlineSpelling in the background
IMPL_LINK_NOARG(SdDrawDocument, OnlineSpellingHdl)
{
if (mpOnlineSpellingList!=NULL
&& ( !mbOnlineSpell || mpOnlineSpellingList->hasMore()))
{
- /**********************************************************************
- * Naechstes Objekt spellen
- **********************************************************************/
+ // Spell next object
SdrObject* pObj = mpOnlineSpellingList->getNextShape();
if (pObj)
{
if (pObj->GetOutlinerParaObject() && pObj->ISA(SdrTextObj))
{
- // Textobjekt spellen
+ // Spell text object
SpellObject((SdrTextObj*) pObj);
}
else if (pObj->GetObjIdentifier() == OBJ_GRUP)
{
- // Gruppenobjekt gefunden
+ // Found a group object
SdrObjListIter aGroupIter(*((SdrObjGroup*)pObj)->GetSubList(),
IM_DEEPNOGROUPS);
@@ -886,22 +839,22 @@
if (pSubObj->GetOutlinerParaObject() && pSubObj->ISA(SdrTextObj))
{
- // Textobjekt im Gruppenobjekt gefunden
+ // Found a text object in a group object
SpellObject((SdrTextObj*) pSubObj);
}
}
}
}
- // Weitersuchen
+ // Continue search
mpOnlineSpellingTimer->Start();
}
else
{
- // Spelling wurde initial durchgefuehrt
+ // Initial spelling has finished
mbInitialOnlineSpellingEnabled = sal_False;
- // Suche beenden
+ // Stop search
StopOnlineSpelling();
delete mpOnlineSearchItem;
@@ -911,12 +864,7 @@
return(0);
}
-/*************************************************************************
-|*
-|* Objekt spellen (fuer OnlineSpelling)
-|*
-\************************************************************************/
-
+// Spell object (for OnlineSpelling)
void SdDrawDocument::SpellObject(SdrTextObj* pObj)
{
if (pObj && pObj->GetOutlinerParaObject() /* && pObj != pView->GetTextEditObject() */)
@@ -936,7 +884,7 @@
}
pOutl->Init( nOutlMode );
- // Text in den Outliner setzen
+ // Put text into the outliner
pOutl->SetText(*((SdrTextObj*) pObj)->GetOutlinerParaObject());
if (!mpOnlineSearchItem || pOutl->HasText(*mpOnlineSearchItem))
@@ -970,45 +918,33 @@
}
}
-/*************************************************************************
-|*
-|* Objekt wurde ins Model eingefuegt
-|*
-\************************************************************************/
+// Object was inserted into model
void SdDrawDocument::InsertObject(SdrObject* pObj, SdPage* /*pPage*/)
{
if(mpOnlineSpellingList && pObj)
{
if (pObj->GetOutlinerParaObject() || (pObj->GetObjIdentifier() == OBJ_GRUP))
{
- // Objekt in OnlineSpelling-Liste aufnehmen
+ // Add object to OnlineSpelling list
mpOnlineSpellingList->addShape(*pObj);
}
}
}
-/*************************************************************************
-|*
-|* Objekt wurde aus dem Model entfernt
-|*
-\************************************************************************/
+// Object removed from model
void SdDrawDocument::RemoveObject(SdrObject* pObj, SdPage* /*pPage*/)
{
if(mpOnlineSpellingList && pObj)
{
if (pObj->GetOutlinerParaObject() || (pObj->GetObjIdentifier() == OBJ_GRUP))
{
- // Objekt in OnlineSpelling-Liste durch NULL-Pointer ersetzt
+ // Replace object in OnlineSpelling list by 0 pointer
mpOnlineSpellingList->removeShape(*pObj);
}
}
}
-/*************************************************************************
-|*
-|* Callback fuer ExecuteSpellPopup()
-|*
-\************************************************************************/
+// Callback for ExecuteSpellPopup()
IMPL_LINK(SdDrawDocument, OnlineSpellEventHdl, EditStatus*, pEditStat)
{
sal_uLong nStat = pEditStat->GetStatusWord();
@@ -1017,11 +953,7 @@
return(0);
}
-/*************************************************************************
-|*
-|* Callback fuer ExecuteSpellPopup()
-|*
-\************************************************************************/
+// Callback for ExecuteSpellPopup()
// removed link and replaced with Imp method
void SdDrawDocument::ImpOnlineSpellCallback(SpellCallbackInfo* pInfo, SdrObject* pObj,
SdrOutliner* pOutl)
@@ -1054,11 +986,8 @@
}
}
-/*************************************************************************
-|*
-|* Eindeutige Namen der StandardLayer durch sprachabhaengige Namen ersetzen
-|*
-\************************************************************************/
+// Replace the unambiguous names of the default layers by their names in the
+// native language
void SdDrawDocument::RestoreLayerNames()
{
SdrLayerAdmin& rLayerAdmin = GetLayerAdmin();
@@ -1096,12 +1025,7 @@
}
}
-/*************************************************************************
-|*
-|* Formatierte Seitennummer zurueckgeben (1, I, i, a, usw.)
-|*
-\************************************************************************/
-
+// Return formatted page number (1, I, i, a, etc.)
String SdDrawDocument::CreatePageNumValue(sal_uInt16 nNum) const
{
String aPageNumValue;
@@ -1133,14 +1057,9 @@
-/*************************************************************************
-|*
-|* Layout-Template umbenennen
-|* Zu beachten ist, das rOldLayoutName im Gegensatz zu rNewName den
-|* kompletten Layout(!)-Namen enthaelt (inkl. ~LT~)!
-|*
-\************************************************************************/
-
+// Rename layout template
+// Keep in mind that rOldLayoutName contains the _complete_ name of the layout
+// (including ~LT~). This is unlike rNewName.
void SdDrawDocument::RenameLayoutTemplate(const String& rOldLayoutName, const String& rNewName)
{
String aOldName(rOldLayoutName);
@@ -1177,14 +1096,14 @@
pSheet = aIter.Next();
}
- // jetzt noch den Layoutnamen der Zeichen- und der Notizseite
- // sowie ihrer Masterpages setzen
+ // Now set the layout name of the drawing and the notes page, as well as
+ // their master pages.
String aPageLayoutName(rNewName);
aPageLayoutName.AppendAscii( RTL_CONSTASCII_STRINGPARAM( SD_LT_SEPARATOR ));
aPageLayoutName += String(SdResId(STR_LAYOUT_OUTLINE));
- // an allen Seiten, die das jetzt umbeannte Layout benutzen, die
- // Textobjekte von der Aenderung unterrichten und Layoutnamen setzen
+ // Inform all text objects on pages that use the renamed layout and set the
+ // new name.
sal_uInt16 nPage;
for (nPage = 0; nPage < GetPageCount(); nPage++)
{
@@ -1226,9 +1145,8 @@
}
}
- // und nochmal fuer die Masterpages
- // die betroffenen Masterpages erhalten als Seitennamen den Namen
- // des Layouts
+ // Now do this again for all master pages.
+ // The affected master pages get the name of the layout as their page name.
for (nPage = 0; nPage < GetMasterPageCount(); nPage++)
{
SdPage* pPage = (SdPage*) GetMasterPage(nPage);
@@ -1271,25 +1189,21 @@
}
}
-/*************************************************************************
-|*
-|* Outliner-Defaults setzen (Pool-Defaults)
-|*
-\************************************************************************/
+// Set outliner defaults (pool defaults)
void SdDrawDocument::SetTextDefaults() const
{
- // BulletItem und BulletFont fuer Titel und Gliederung
+ // BulletItem and BulletFont for Titel and Outline
SvxBulletItem aBulletItem(EE_PARA_BULLET);
Font aBulletFont( static_cast<SdStyleSheetPool*>( mxStyleSheetPool.get())->GetBulletFont() );
aBulletFont.SetSize(Size(0,846)); // 24 pt
aBulletItem.SetFont(aBulletFont);
aBulletItem.SetStyle(BS_BULLET);
aBulletItem.SetStart(1);
- aBulletItem.SetScale(45); // in Prozent
- aBulletItem.SetSymbol( 0x25CF ); // Punkt
+ aBulletItem.SetScale(45); // In percent
+ aBulletItem.SetSymbol( 0x25CF ); // In points
pItemPool->SetPoolDefaultItem( aBulletItem );
- // Neues BulletItem
+ // New BulletItem
SvxNumberFormat aNumberFormat(SVX_NUM_CHAR_SPECIAL);
aNumberFormat.SetBulletFont(&aBulletFont);
aNumberFormat.SetBulletChar( 0x25CF ); // StarBats: 0xF000 + 34
--
To view, visit https://gerrit.libreoffice.org/2461
To unsubscribe, visit https://gerrit.libreoffice.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I91af80438dff2aead6bf32cecd3caa97e05c9a65
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Stefan Knorr <heinzlesspam@gmail.com>
Context
- [PATCH] fdo#39468: Translate German comments in sd/source/core/ · Stefan Knorr (via Code Review)
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.