Translated German comments to English.

This commit is contained in:
Philipp Weissenbacher
2011-11-19 12:05:18 +01:00
committed by Petr Mladek
parent 6151ec073e
commit ed870efe80
3 changed files with 97 additions and 110 deletions

View File

@@ -1510,7 +1510,7 @@ void SwCompareData::SetRedlinesToDoc( sal_Bool bUseDocInfo )
} }
else else
{ {
// liegen hintereinander also zusammen fassen // are consecutive, so combine
rSttEnd = *((SwPaM*)pTmp->GetNext())->End(); rSttEnd = *((SwPaM*)pTmp->GetNext())->End();
delete pTmp->GetNext(); delete pTmp->GetNext();
} }

View File

@@ -42,11 +42,11 @@
#include <unotools/charclass.hxx> #include <unotools/charclass.hxx>
#include <fmtcntnt.hxx> #include <fmtcntnt.hxx>
#include <doc.hxx> #include <doc.hxx>
#include <swserv.hxx> // fuer Server-Funktionalitaet #include <swserv.hxx> // for server functionality
#include <IMark.hxx> #include <IMark.hxx>
#include <bookmrk.hxx> #include <bookmrk.hxx>
#include <section.hxx> // fuer SwSectionFmt #include <section.hxx> // for SwSectionFmt
#include <swtable.hxx> // fuer SwTable #include <swtable.hxx> // for SwTable
#include <node.hxx> #include <node.hxx>
#include <ndtxt.hxx> #include <ndtxt.hxx>
#include <pam.hxx> #include <pam.hxx>
@@ -106,20 +106,20 @@ sal_Bool lcl_FindSection( const SwSectionFmtPtr& rpSectFmt, void* pArgs, bool bC
: GetAppCharClass().lower( pItem->m_Item ) ); : GetAppCharClass().lower( pItem->m_Item ) );
if( sNm == sCompare ) if( sNm == sCompare )
{ {
// gefunden, als erfrage die Daten // found, so get the data
const SwNodeIndex* pIdx; const SwNodeIndex* pIdx;
if( 0 != (pIdx = rpSectFmt->GetCntnt().GetCntntIdx() ) && if( 0 != (pIdx = rpSectFmt->GetCntnt().GetCntntIdx() ) &&
&rpSectFmt->GetDoc()->GetNodes() == &pIdx->GetNodes() ) &rpSectFmt->GetDoc()->GetNodes() == &pIdx->GetNodes() )
{ {
// eine Tabelle im normalen NodesArr // a table in the normal NodesArr
pItem->pSectNd = pIdx->GetNode().GetSectionNode(); pItem->pSectNd = pIdx->GetNode().GetSectionNode();
return sal_False; return sal_False;
} }
//nein!! // sollte der Namen schon passen, der Rest aber nicht, dann haben wir // If the name is already correct, but not the rest then we don't have them.
// sie nicht. Die Namen sind immer eindeutig. // The names are always unique.
} }
} }
return sal_True; // dann weiter return sal_True;
} }
sal_Bool lcl_FindSectionCaseSensitive( const SwSectionFmtPtr& rpSectFmt, void* pArgs ) sal_Bool lcl_FindSectionCaseSensitive( const SwSectionFmtPtr& rpSectFmt, void* pArgs )
{ {
@@ -145,15 +145,15 @@ sal_Bool lcl_FindTable( const SwFrmFmtPtr& rpTableFmt, void* pArgs )
pFBox->GetSttNd() && pFBox->GetSttNd() &&
&rpTableFmt->GetDoc()->GetNodes() == &pFBox->GetSttNd()->GetNodes() ) &rpTableFmt->GetDoc()->GetNodes() == &pFBox->GetSttNd()->GetNodes() )
{ {
// eine Tabelle im normalen NodesArr // a table in the normal NodesArr
pItem->pTblNd = (SwTableNode*) pItem->pTblNd = (SwTableNode*)
pFBox->GetSttNd()->FindTableNode(); pFBox->GetSttNd()->FindTableNode();
return sal_False; return sal_False;
} }
//nein! // sollte der Namen schon passen, der Rest aber nicht, dann haben wir // If the name is already correct, but not the rest then we don't have them.
// sie nicht. Die Namen sind immer eindeutig. // The names are always unique.
} }
return sal_True; // dann weiter return sal_True;
} }
@@ -161,7 +161,7 @@ sal_Bool lcl_FindTable( const SwFrmFmtPtr& rpTableFmt, void* pArgs )
bool SwDoc::GetData( const String& rItem, const String& rMimeType, bool SwDoc::GetData( const String& rItem, const String& rMimeType,
uno::Any & rValue ) const uno::Any & rValue ) const
{ {
//search for bookmarks and sections case senstive at first. If nothing is found then try again case insensitive // search for bookmarks and sections case senstive at first. If nothing is found then try again case insensitive
bool bCaseSensitive = true; bool bCaseSensitive = true;
while( true ) while( true )
{ {
@@ -169,14 +169,14 @@ bool SwDoc::GetData( const String& rItem, const String& rMimeType,
if(pBkmk) if(pBkmk)
return SwServerObject(*pBkmk).GetData(rValue, rMimeType); return SwServerObject(*pBkmk).GetData(rValue, rMimeType);
// haben wir ueberhaupt das Item vorraetig? // Do we already have the Item?
String sItem( bCaseSensitive ? rItem : GetAppCharClass().lower(rItem)); String sItem( bCaseSensitive ? rItem : GetAppCharClass().lower(rItem));
_FindItem aPara( sItem ); _FindItem aPara( sItem );
((SwSectionFmts&)*pSectionFmtTbl).ForEach( 0, pSectionFmtTbl->Count(), ((SwSectionFmts&)*pSectionFmtTbl).ForEach( 0, pSectionFmtTbl->Count(),
bCaseSensitive ? lcl_FindSectionCaseSensitive : lcl_FindSectionCaseInsensitive, &aPara ); bCaseSensitive ? lcl_FindSectionCaseSensitive : lcl_FindSectionCaseInsensitive, &aPara );
if( aPara.pSectNd ) if( aPara.pSectNd )
{ {
// gefunden, als erfrage die Daten // found, so get the data
return SwServerObject( *aPara.pSectNd ).GetData( rValue, rMimeType ); return SwServerObject( *aPara.pSectNd ).GetData( rValue, rMimeType );
} }
if( !bCaseSensitive ) if( !bCaseSensitive )
@@ -200,7 +200,7 @@ bool SwDoc::GetData( const String& rItem, const String& rMimeType,
bool SwDoc::SetData( const String& rItem, const String& rMimeType, bool SwDoc::SetData( const String& rItem, const String& rMimeType,
const uno::Any & rValue ) const uno::Any & rValue )
{ {
//search for bookmarks and sections case senstive at first. If nothing is found then try again case insensitive // search for bookmarks and sections case senstive at first. If nothing is found then try again case insensitive
bool bCaseSensitive = true; bool bCaseSensitive = true;
while( true ) while( true )
{ {
@@ -208,13 +208,13 @@ bool SwDoc::SetData( const String& rItem, const String& rMimeType,
if(pBkmk) if(pBkmk)
return SwServerObject(*pBkmk).SetData(rMimeType, rValue); return SwServerObject(*pBkmk).SetData(rMimeType, rValue);
// haben wir ueberhaupt das Item vorraetig? // Do we already have the Item?
String sItem( bCaseSensitive ? rItem : GetAppCharClass().lower(rItem)); String sItem( bCaseSensitive ? rItem : GetAppCharClass().lower(rItem));
_FindItem aPara( sItem ); _FindItem aPara( sItem );
pSectionFmtTbl->ForEach( 0, pSectionFmtTbl->Count(), bCaseSensitive ? lcl_FindSectionCaseSensitive : lcl_FindSectionCaseInsensitive, &aPara ); pSectionFmtTbl->ForEach( 0, pSectionFmtTbl->Count(), bCaseSensitive ? lcl_FindSectionCaseSensitive : lcl_FindSectionCaseInsensitive, &aPara );
if( aPara.pSectNd ) if( aPara.pSectNd )
{ {
// gefunden, als erfrage die Daten // found, so get the data
return SwServerObject( *aPara.pSectNd ).SetData( rMimeType, rValue ); return SwServerObject( *aPara.pSectNd ).SetData( rMimeType, rValue );
} }
if( !bCaseSensitive ) if( !bCaseSensitive )
@@ -239,7 +239,7 @@ bool SwDoc::SetData( const String& rItem, const String& rMimeType,
{ {
SwServerObject* pObj = NULL; SwServerObject* pObj = NULL;
//search for bookmarks and sections case senstive at first. If nothing is found then try again case insensitive // search for bookmarks and sections case senstive at first. If nothing is found then try again case insensitive
bool bCaseSensitive = true; bool bCaseSensitive = true;
while( true ) while( true )
{ {
@@ -291,7 +291,7 @@ bool SwDoc::SetData( const String& rItem, const String& rMimeType,
sal_Bool SwDoc::SelectServerObj( const String& rStr, SwPaM*& rpPam, sal_Bool SwDoc::SelectServerObj( const String& rStr, SwPaM*& rpPam,
SwNodeRange*& rpRange ) const SwNodeRange*& rpRange ) const
{ {
// haben wir ueberhaupt das Item vorraetig? // Do we actually have the Item?
rpPam = 0; rpPam = 0;
rpRange = 0; rpRange = 0;
@@ -303,8 +303,8 @@ sal_Bool SwDoc::SelectServerObj( const String& rStr, SwPaM*& rpPam,
const CharClass& rCC = GetAppCharClass(); const CharClass& rCC = GetAppCharClass();
// Erweiterung fuer die Bereiche, nicht nur Bookmarks/Bereiche linken, // Extension for areas: not only link bookmarks/areas
// sondern auch Rahmen(Text!), Tabellen, Gliederungen: // but also frames (text!), tables, outlines:
if( STRING_NOTFOUND != nPos ) if( STRING_NOTFOUND != nPos )
{ {
sal_Bool bWeiter = sal_False; sal_Bool bWeiter = sal_False;
@@ -341,7 +341,7 @@ sal_Bool SwDoc::SelectServerObj( const String& rStr, SwPaM*& rpPam,
} }
else if( sCmp.EqualsAscii( pMarkToRegion ) ) else if( sCmp.EqualsAscii( pMarkToRegion ) )
{ {
sItem = sName; // wird unten behandelt ! sItem = sName; // Is being dealt with further down!
bWeiter = sal_True; bWeiter = sal_True;
} }
else if( sCmp.EqualsAscii( pMarkToOutline ) ) else if( sCmp.EqualsAscii( pMarkToOutline ) )
@@ -358,14 +358,14 @@ sal_Bool SwDoc::SelectServerObj( const String& rStr, SwPaM*& rpPam,
rOutlNds.Seek_Entry( pNd, &nTmpPos ); rOutlNds.Seek_Entry( pNd, &nTmpPos );
rpRange = new SwNodeRange( aPos.nNode, 0, aPos.nNode ); rpRange = new SwNodeRange( aPos.nNode, 0, aPos.nNode );
// dann suche jetzt noch das Ende vom Bereich // look for the area's end, now
for( ++nTmpPos; for( ++nTmpPos;
nTmpPos < rOutlNds.Count() && nTmpPos < rOutlNds.Count() &&
nLvl < rOutlNds[ nTmpPos ]->GetTxtNode()-> nLvl < rOutlNds[ nTmpPos ]->GetTxtNode()->
//GetTxtColl()->GetOutlineLevel();//#outline level,zhaojianwei //GetTxtColl()->GetOutlineLevel();//#outline level,zhaojianwei
GetAttrOutlineLevel()-1;//<-end,zhaojianwei GetAttrOutlineLevel()-1;//<-end,zhaojianwei
++nTmpPos ) ++nTmpPos )
; // es gibt keinen Block ; // there is no block
if( nTmpPos < rOutlNds.Count() ) if( nTmpPos < rOutlNds.Count() )
rpRange->aEnd = *rOutlNds[ nTmpPos ]; rpRange->aEnd = *rOutlNds[ nTmpPos ];
@@ -379,7 +379,7 @@ sal_Bool SwDoc::SelectServerObj( const String& rStr, SwPaM*& rpPam,
return sal_False; return sal_False;
} }
//search for bookmarks and sections case senstive at first. If nothing is found then try again case insensitive // search for bookmarks and sections case senstive at first. If nothing is found then try again case insensitive
bool bCaseSensitive = true; bool bCaseSensitive = true;
while( true ) while( true )
{ {

View File

@@ -52,8 +52,8 @@
#include <doc.hxx> #include <doc.hxx>
#include <IDocumentUndoRedo.hxx> #include <IDocumentUndoRedo.hxx>
#include <docary.hxx> #include <docary.hxx>
#include <pagefrm.hxx> //Fuer DelPageDesc #include <pagefrm.hxx> //For DelPageDesc
#include <rootfrm.hxx> //Fuer DelPageDesc #include <rootfrm.hxx> //For DelPageDesc
#include <ndtxt.hxx> #include <ndtxt.hxx>
#include <frmtool.hxx> #include <frmtool.hxx>
#include <pagedesc.hxx> #include <pagedesc.hxx>
@@ -92,10 +92,9 @@ static void lcl_DefaultPageFmt( sal_uInt16 nPoolFmtId,
const Size aPhysSize = SvxPaperInfo::GetDefaultPaperSize(); const Size aPhysSize = SvxPaperInfo::GetDefaultPaperSize();
aFrmSize.SetSize( aPhysSize ); aFrmSize.SetSize( aPhysSize );
//Auf Default-Raender vorbereiten. // Prepare for default borders.
//Raender haben eine defaultmaessige Mindestgroesse. // Borders have a default minimum size.
//wenn der Drucker einen groesseren Rand vorgibt, so // If the printer forces a larger border, that's ok too.
//ist mir dass auch recht.
// The HTML page desc had A4 as page size always. // The HTML page desc had A4 as page size always.
// This has been changed to take the page size from the printer. // This has been changed to take the page size from the printer.
// Unfortunately, the margins of the HTML page desc are smaller than // Unfortunately, the margins of the HTML page desc are smaller than
@@ -110,15 +109,15 @@ static void lcl_DefaultPageFmt( sal_uInt16 nPoolFmtId,
} }
else if( MEASURE_METRIC == SvtSysLocale().GetLocaleData().getMeasurementSystemEnum() ) else if( MEASURE_METRIC == SvtSysLocale().GetLocaleData().getMeasurementSystemEnum() )
{ {
nMinTop = nMinBottom = nMinLeft = nMinRight = 1134; //2 Zentimeter nMinTop = nMinBottom = nMinLeft = nMinRight = 1134; // 2 centimetres
} }
else else
{ {
nMinTop = nMinBottom = 1440; //al la WW: 1Inch nMinTop = nMinBottom = 1440; //al la WW: 1 Inch
nMinLeft = nMinRight = 1800; // 1,25 Inch nMinLeft = nMinRight = 1800; // 1,25 Inch
} }
//Raender einstellen. // Set borders.
SvxLRSpaceItem aLR( RES_LR_SPACE ); SvxLRSpaceItem aLR( RES_LR_SPACE );
SvxULSpaceItem aUL( RES_UL_SPACE ); SvxULSpaceItem aUL( RES_UL_SPACE );
@@ -145,11 +144,10 @@ static void lcl_DefaultPageFmt( sal_uInt16 nPoolFmtId,
void lcl_DescSetAttr( const SwFrmFmt &rSource, SwFrmFmt &rDest, void lcl_DescSetAttr( const SwFrmFmt &rSource, SwFrmFmt &rDest,
const sal_Bool bPage = sal_True ) const sal_Bool bPage = sal_True )
{ {
/////////////// !!!!!!!!!!!!!!!! // We should actually use ItemSet's Intersect here, but that doesn't work
// eigentlich sollte hier das Intersect von ItemSet benutzt werden, aber das // correctly if we have different WhichRanges.
// funktioniert nicht richtig, wenn man unterschiedliche WhichRanges hat.
/////////////// !!!!!!!!!!!!!!!! // Take over the attributes which are of interest.
//Die interressanten Attribute uebernehmen.
sal_uInt16 const aIdArr[] = { RES_FRM_SIZE, RES_UL_SPACE, sal_uInt16 const aIdArr[] = { RES_FRM_SIZE, RES_UL_SPACE,
RES_BACKGROUND, RES_SHADOW, RES_BACKGROUND, RES_SHADOW,
RES_COL, RES_COL, RES_COL, RES_COL,
@@ -183,7 +181,7 @@ void lcl_DescSetAttr( const SwFrmFmt &rSource, SwFrmFmt &rDest,
} }
} }
// auch Pool-, Hilfe-Id's uebertragen // Transmit pool and help IDs too
rDest.SetPoolFmtId( rSource.GetPoolFmtId() ); rDest.SetPoolFmtId( rSource.GetPoolFmtId() );
rDest.SetPoolHelpId( rSource.GetPoolHelpId() ); rDest.SetPoolHelpId( rSource.GetPoolHelpId() );
rDest.SetPoolHlpFileId( rSource.GetPoolHlpFileId() ); rDest.SetPoolHlpFileId( rSource.GetPoolHlpFileId() );
@@ -192,7 +190,7 @@ void lcl_DescSetAttr( const SwFrmFmt &rSource, SwFrmFmt &rDest,
void SwDoc::ChgPageDesc( sal_uInt16 i, const SwPageDesc &rChged ) void SwDoc::ChgPageDesc( sal_uInt16 i, const SwPageDesc &rChged )
{ {
OSL_ENSURE( i < aPageDescs.Count(), "PageDescs ueberindiziert." ); OSL_ENSURE( i < aPageDescs.Count(), "PageDescs is out of range." );
SwPageDesc *pDesc = aPageDescs[i]; SwPageDesc *pDesc = aPageDescs[i];
SwRootFrm* pTmpRoot = GetCurrentLayout(); SwRootFrm* pTmpRoot = GetCurrentLayout();
@@ -204,26 +202,24 @@ void SwDoc::ChgPageDesc( sal_uInt16 i, const SwPageDesc &rChged )
} }
::sw::UndoGuard const undoGuard(GetIDocumentUndoRedo()); ::sw::UndoGuard const undoGuard(GetIDocumentUndoRedo());
//Als erstes wird ggf. gespiegelt. // Mirror at first if needed.
if ( rChged.GetUseOn() == nsUseOnPage::PD_MIRROR ) if ( rChged.GetUseOn() == nsUseOnPage::PD_MIRROR )
((SwPageDesc&)rChged).Mirror(); ((SwPageDesc&)rChged).Mirror();
else else
//sonst Werte aus Master nach Left uebertragen. // Or else transfer values from Master to Left.
::lcl_DescSetAttr( ((SwPageDesc&)rChged).GetMaster(), ::lcl_DescSetAttr( ((SwPageDesc&)rChged).GetMaster(),
((SwPageDesc&)rChged).GetLeft() ); ((SwPageDesc&)rChged).GetLeft() );
//NumType uebernehmen. // Take over NumType.
if( rChged.GetNumType().GetNumberingType() != pDesc->GetNumType().GetNumberingType() ) if( rChged.GetNumType().GetNumberingType() != pDesc->GetNumType().GetNumberingType() )
{ {
pDesc->SetNumType( rChged.GetNumType() ); pDesc->SetNumType( rChged.GetNumType() );
// den Seitennummernfeldern bescheid sagen, // Notify page number fields, that NumFormat has changed
// das sich das Num-Format geaendert hat
GetSysFldType( RES_PAGENUMBERFLD )->UpdateFlds(); GetSysFldType( RES_PAGENUMBERFLD )->UpdateFlds();
GetSysFldType( RES_REFPAGEGETFLD )->UpdateFlds(); GetSysFldType( RES_REFPAGEGETFLD )->UpdateFlds();
// Wenn sich die Numerierungsart geaendert hat, koennte es QuoVadis/ // If the numbering scheme has changed we could have QuoVadis/ErgoSum texts
// ErgoSum-Texte geben, die sich auf eine geaenderte Seite beziehen, // that refer to a changed page, so we invalidate foot notes.
// deshalb werden die Fussnoten invalidiert
SwFtnIdxs& rFtnIdxs = GetFtnIdxs(); SwFtnIdxs& rFtnIdxs = GetFtnIdxs();
for( sal_uInt16 nPos = 0; nPos < rFtnIdxs.Count(); ++nPos ) for( sal_uInt16 nPos = 0; nPos < rFtnIdxs.Count(); ++nPos )
{ {
@@ -233,18 +229,18 @@ void SwDoc::ChgPageDesc( sal_uInt16 i, const SwPageDesc &rChged )
} }
} }
//Orientierung uebernehmen // Take over orientation
pDesc->SetLandscape( rChged.GetLandscape() ); pDesc->SetLandscape( rChged.GetLandscape() );
// #i46909# no undo if header or footer changed // #i46909# no undo if header or footer changed
bool bHeaderFooterChanged = false; bool bHeaderFooterChanged = false;
//Header abgleichen. // Synch header.
const SwFmtHeader &rHead = rChged.GetMaster().GetHeader(); const SwFmtHeader &rHead = rChged.GetMaster().GetHeader();
if (undoGuard.UndoWasEnabled()) if (undoGuard.UndoWasEnabled())
{ {
// #i46909# no undo if header or footer changed // #i46909# no undo if header or footer changed
// hat sich an den Nodes etwas veraendert ? // Did something change in the nodes?
const SwFmtHeader &rOldHead = pDesc->GetMaster().GetHeader(); const SwFmtHeader &rOldHead = pDesc->GetMaster().GetHeader();
bHeaderFooterChanged |= bHeaderFooterChanged |=
( rHead.IsActive() != rOldHead.IsActive() || ( rHead.IsActive() != rOldHead.IsActive() ||
@@ -253,21 +249,20 @@ void SwDoc::ChgPageDesc( sal_uInt16 i, const SwPageDesc &rChged )
pDesc->GetMaster().SetFmtAttr( rHead ); pDesc->GetMaster().SetFmtAttr( rHead );
if ( rChged.IsHeaderShared() || !rHead.IsActive() ) if ( rChged.IsHeaderShared() || !rHead.IsActive() )
{ {
//Left teilt sich den Header mit dem Master. // Left shares the header with the Master.
pDesc->GetLeft().SetFmtAttr( pDesc->GetMaster().GetHeader() ); pDesc->GetLeft().SetFmtAttr( pDesc->GetMaster().GetHeader() );
} }
else if ( rHead.IsActive() ) else if ( rHead.IsActive() )
{ //Left bekommt einen eigenen Header verpasst wenn das Format nicht { // Left gets it's own header if the Format doesn't alrady have one.
//bereits einen hat. // If it already has one and it points to the same Section as the
//Wenn er bereits einen hat und dieser auf die gleiche Section // Right one, it needs to get an own Header.
//wie der Rechte zeigt, so muss er einen eigenen bekommen. Der // The content is evidently copied.
//Inhalt wird sinnigerweise kopiert.
const SwFmtHeader &rLeftHead = pDesc->GetLeft().GetHeader(); const SwFmtHeader &rLeftHead = pDesc->GetLeft().GetHeader();
if ( !rLeftHead.IsActive() ) if ( !rLeftHead.IsActive() )
{ {
SwFmtHeader aHead( MakeLayoutFmt( RND_STD_HEADERL, 0 ) ); SwFmtHeader aHead( MakeLayoutFmt( RND_STD_HEADERL, 0 ) );
pDesc->GetLeft().SetFmtAttr( aHead ); pDesc->GetLeft().SetFmtAttr( aHead );
//Weitere Attribute (Raender, Umrandung...) uebernehmen. // Take over additional attributes (borders, border strips ...).
::lcl_DescSetAttr( *rHead.GetHeaderFmt(), *aHead.GetHeaderFmt(), sal_False); ::lcl_DescSetAttr( *rHead.GetHeaderFmt(), *aHead.GetHeaderFmt(), sal_False);
} }
else else
@@ -282,9 +277,8 @@ void SwDoc::ChgPageDesc( sal_uInt16 i, const SwPageDesc &rChged )
SwFrmFmt *pFmt = new SwFrmFmt( GetAttrPool(), "Header", SwFrmFmt *pFmt = new SwFrmFmt( GetAttrPool(), "Header",
GetDfltFrmFmt() ); GetDfltFrmFmt() );
::lcl_DescSetAttr( *pRight, *pFmt, sal_False ); ::lcl_DescSetAttr( *pRight, *pFmt, sal_False );
//Der Bereich auf den das rechte Kopfattribut zeigt wird // The area which the right header attribute is pointing to is copied,
//kopiert und der Index auf den StartNode in das linke // and the Index to the StartNode is set to the left header attribute.
//Kopfattribut gehaengt.
SwNodeIndex aTmp( GetNodes().GetEndOfAutotext() ); SwNodeIndex aTmp( GetNodes().GetEndOfAutotext() );
SwStartNode* pSttNd = GetNodes().MakeEmptySection( aTmp, SwHeaderStartNode ); SwStartNode* pSttNd = GetNodes().MakeEmptySection( aTmp, SwHeaderStartNode );
SwNodeRange aRange( aRCnt.GetCntntIdx()->GetNode(), 0, SwNodeRange aRange( aRCnt.GetCntntIdx()->GetNode(), 0,
@@ -303,12 +297,12 @@ void SwDoc::ChgPageDesc( sal_uInt16 i, const SwPageDesc &rChged )
} }
pDesc->ChgHeaderShare( rChged.IsHeaderShared() ); pDesc->ChgHeaderShare( rChged.IsHeaderShared() );
//Footer abgleichen. // Synch Footer.
const SwFmtFooter &rFoot = rChged.GetMaster().GetFooter(); const SwFmtFooter &rFoot = rChged.GetMaster().GetFooter();
if (undoGuard.UndoWasEnabled()) if (undoGuard.UndoWasEnabled())
{ {
// #i46909# no undo if header or footer changed // #i46909# no undo if header or footer changed
// hat sich an den Nodes etwas veraendert ? // Did something change in the Nodes?
const SwFmtFooter &rOldFoot = pDesc->GetMaster().GetFooter(); const SwFmtFooter &rOldFoot = pDesc->GetMaster().GetFooter();
bHeaderFooterChanged |= bHeaderFooterChanged |=
( rFoot.IsActive() != rOldFoot.IsActive() || ( rFoot.IsActive() != rOldFoot.IsActive() ||
@@ -316,20 +310,19 @@ void SwDoc::ChgPageDesc( sal_uInt16 i, const SwPageDesc &rChged )
} }
pDesc->GetMaster().SetFmtAttr( rFoot ); pDesc->GetMaster().SetFmtAttr( rFoot );
if ( rChged.IsFooterShared() || !rFoot.IsActive() ) if ( rChged.IsFooterShared() || !rFoot.IsActive() )
//Left teilt sich den Header mit dem Master. // Left shares the Header with the Master.
pDesc->GetLeft().SetFmtAttr( pDesc->GetMaster().GetFooter() ); pDesc->GetLeft().SetFmtAttr( pDesc->GetMaster().GetFooter() );
else if ( rFoot.IsActive() ) else if ( rFoot.IsActive() )
{ //Left bekommt einen eigenen Footer verpasst wenn das Format nicht { // Left gets it's own Footer if the Format does not already have one.
//bereits einen hat. // If the Format already has a Footer and it points to the same section as the Right one,
//Wenn er bereits einen hat und dieser auf die gleiche Section // it needs to get an own one.
//wie der Rechte zeigt, so muss er einen eigenen bekommen. Der // The content is evidently copied.
//Inhalt wird sinnigerweise kopiert.
const SwFmtFooter &rLeftFoot = pDesc->GetLeft().GetFooter(); const SwFmtFooter &rLeftFoot = pDesc->GetLeft().GetFooter();
if ( !rLeftFoot.IsActive() ) if ( !rLeftFoot.IsActive() )
{ {
SwFmtFooter aFoot( MakeLayoutFmt( RND_STD_FOOTER, 0 ) ); SwFmtFooter aFoot( MakeLayoutFmt( RND_STD_FOOTER, 0 ) );
pDesc->GetLeft().SetFmtAttr( aFoot ); pDesc->GetLeft().SetFmtAttr( aFoot );
//Weitere Attribute (Raender, Umrandung...) uebernehmen. // Take over additional attributes (borders, border strips ...).
::lcl_DescSetAttr( *rFoot.GetFooterFmt(), *aFoot.GetFooterFmt(), sal_False); ::lcl_DescSetAttr( *rFoot.GetFooterFmt(), *aFoot.GetFooterFmt(), sal_False);
} }
else else
@@ -344,9 +337,8 @@ void SwDoc::ChgPageDesc( sal_uInt16 i, const SwPageDesc &rChged )
SwFrmFmt *pFmt = new SwFrmFmt( GetAttrPool(), "Footer", SwFrmFmt *pFmt = new SwFrmFmt( GetAttrPool(), "Footer",
GetDfltFrmFmt() ); GetDfltFrmFmt() );
::lcl_DescSetAttr( *pRight, *pFmt, sal_False ); ::lcl_DescSetAttr( *pRight, *pFmt, sal_False );
//Der Bereich auf den das rechte Kopfattribut zeigt wird // The Area to which the right header attribute is pointing to is being copied
//kopiert und der Index auf den StartNode in das linke // and the Index to the StartNode is set to the left header attribute.
//Kopfattribut gehaengt.
SwNodeIndex aTmp( GetNodes().GetEndOfAutotext() ); SwNodeIndex aTmp( GetNodes().GetEndOfAutotext() );
SwStartNode* pSttNd = GetNodes().MakeEmptySection( aTmp, SwFooterStartNode ); SwStartNode* pSttNd = GetNodes().MakeEmptySection( aTmp, SwFooterStartNode );
SwNodeRange aRange( aRCnt.GetCntntIdx()->GetNode(), 0, SwNodeRange aRange( aRCnt.GetCntntIdx()->GetNode(), 0,
@@ -367,11 +359,10 @@ void SwDoc::ChgPageDesc( sal_uInt16 i, const SwPageDesc &rChged )
if ( pDesc->GetName() != rChged.GetName() ) if ( pDesc->GetName() != rChged.GetName() )
pDesc->SetName( rChged.GetName() ); pDesc->SetName( rChged.GetName() );
// Dadurch wird ein RegisterChange ausgeloest, wenn notwendig // A RegisterChange is triggered, if necessary
pDesc->SetRegisterFmtColl( rChged.GetRegisterFmtColl() ); pDesc->SetRegisterFmtColl( rChged.GetRegisterFmtColl() );
//Wenn sich das UseOn oder der Follow aendern muessen die // If UseOn or the Follow change, the paragraphs need to know about it.
//Absaetze das erfahren.
sal_Bool bUseOn = sal_False; sal_Bool bUseOn = sal_False;
sal_Bool bFollow = sal_False; sal_Bool bFollow = sal_False;
if ( pDesc->GetUseOn() != rChged.GetUseOn() ) if ( pDesc->GetUseOn() != rChged.GetUseOn() )
@@ -392,18 +383,17 @@ void SwDoc::ChgPageDesc( sal_uInt16 i, const SwPageDesc &rChged )
} }
if ( (bUseOn || bFollow) && pTmpRoot) if ( (bUseOn || bFollow) && pTmpRoot)
//Layot benachrichtigen! // Inform layout!
{ {
std::set<SwRootFrm*> aAllLayouts = GetAllLayouts(); std::set<SwRootFrm*> aAllLayouts = GetAllLayouts();
std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::mem_fun(&SwRootFrm::AllCheckPageDescs)); std::for_each( aAllLayouts.begin(), aAllLayouts.end(),std::mem_fun(&SwRootFrm::AllCheckPageDescs));
} }
//Jetzt noch die Seiten-Attribute uebernehmen. // Take over the page attributes.
::lcl_DescSetAttr( rChged.GetMaster(), pDesc->GetMaster() ); ::lcl_DescSetAttr( rChged.GetMaster(), pDesc->GetMaster() );
::lcl_DescSetAttr( rChged.GetLeft(), pDesc->GetLeft() ); ::lcl_DescSetAttr( rChged.GetLeft(), pDesc->GetLeft() );
//Wenn sich FussnotenInfo veraendert, so werden die Seiten // If the FootnoteInfo changes, the pages are triggered.
//angetriggert.
if( !(pDesc->GetFtnInfo() == rChged.GetFtnInfo()) ) if( !(pDesc->GetFtnInfo() == rChged.GetFtnInfo()) )
{ {
pDesc->SetFtnInfo( rChged.GetFtnInfo() ); pDesc->SetFtnInfo( rChged.GetFtnInfo() );
@@ -428,8 +418,8 @@ void SwDoc::ChgPageDesc( sal_uInt16 i, const SwPageDesc &rChged )
|* |*
|* SwDoc::DelPageDesc() |* SwDoc::DelPageDesc()
|* |*
|* Beschreibung Alle Descriptoren, deren Follow auf den zu loeschenden |* Description: All descriptors who's Follow point to the to-be-deleted
|* zeigen muessen angepasst werden. |* have to be adapted.
|* |*
|*************************************************************************/ |*************************************************************************/
@@ -497,8 +487,8 @@ void SwDoc::BroadcastStyleOperation(String rName, SfxStyleFamily eFamily,
void SwDoc::DelPageDesc( sal_uInt16 i, sal_Bool bBroadcast ) void SwDoc::DelPageDesc( sal_uInt16 i, sal_Bool bBroadcast )
{ {
OSL_ENSURE( i < aPageDescs.Count(), "PageDescs ueberindiziert." ); OSL_ENSURE( i < aPageDescs.Count(), "PageDescs is out of range." );
OSL_ENSURE( i != 0, "Default Pagedesc loeschen is nicht." ); OSL_ENSURE( i != 0, "You cannot delete the default Pagedesc.");
if ( i == 0 ) if ( i == 0 )
return; return;
@@ -547,7 +537,7 @@ sal_uInt16 SwDoc::MakePageDesc( const String &rName, const SwPageDesc *pCpy,
else else
{ {
pNew = new SwPageDesc( rName, GetDfltFrmFmt(), this ); pNew = new SwPageDesc( rName, GetDfltFrmFmt(), this );
//Default-Seitenformat einstellen. // Set the default page format.
lcl_DefaultPageFmt( USHRT_MAX, pNew->GetMaster(), pNew->GetLeft() ); lcl_DefaultPageFmt( USHRT_MAX, pNew->GetMaster(), pNew->GetLeft() );
SvxFrameDirection aFrameDirection = bRegardLanguage ? SvxFrameDirection aFrameDirection = bRegardLanguage ?
@@ -589,17 +579,17 @@ SwPageDesc* SwDoc::FindPageDescByName( const String& rName, sal_uInt16* pPos ) c
} }
/****************************************************************************** /******************************************************************************
* Methode : void SwDoc::PrtDataChanged() * Method : void SwDoc::PrtDataChanged()
* Beschreibung: * Description :
******************************************************************************/ ******************************************************************************/
void SwDoc::PrtDataChanged() void SwDoc::PrtDataChanged()
{ {
//!!!!!!!! Bei Aenderungen hier bitte ggf. InJobSetup im Sw3io mitpflegen // If you change this, also modify InJobSetup in Sw3io if appropriate.
// #i41075# // #i41075#
OSL_ENSURE( get(IDocumentSettingAccess::USE_VIRTUAL_DEVICE) || OSL_ENSURE( get(IDocumentSettingAccess::USE_VIRTUAL_DEVICE) ||
0 != getPrinter( sal_False ), "PrtDataChanged will be called recursive!" ); 0 != getPrinter( sal_False ), "PrtDataChanged will be called recursively!" );
SwRootFrm* pTmpRoot = GetCurrentLayout(); SwRootFrm* pTmpRoot = GetCurrentLayout();
SwWait *pWait = 0; SwWait *pWait = 0;
sal_Bool bEndAction = sal_False; sal_Bool bEndAction = sal_False;
@@ -659,11 +649,10 @@ void SwDoc::PrtDataChanged()
delete pWait; delete pWait;
} }
//Zur Laufzeit sammeln wir die GlobalNames der Server, die keine // We collect the GlobalNames of the servers at runtime, who don't want to be notified
//Benachrichtigung zu Druckerwechseln wuenschen. Dadurch sparen wir // about printer changes. Thereby saving loading a lot of objects (luckily all foreign
//das Laden vieler Objekte (gluecklicherweise werden obendrein alle // objects are mapped to one ID).
//Fremdobjekte unter einer ID abgebuildet). Init und DeInit vom Array // Initialisation and deinitialisation can be found in init.cxx
//ist in init.cxx zu finden.
extern SvPtrarr *pGlobalOLEExcludeList; extern SvPtrarr *pGlobalOLEExcludeList;
void SwDoc::PrtOLENotify( sal_Bool bAll ) void SwDoc::PrtOLENotify( sal_Bool bAll )
@@ -683,11 +672,10 @@ void SwDoc::PrtOLENotify( sal_Bool bAll )
} }
if ( !pShell ) if ( !pShell )
{ {
//Das hat ohne Shell und damit ohne Client keinen Sinn, weil nur darueber // This doesn't make sense without a Shell and thus without a client, because
//die Kommunikation bezueglich der Groessenaenderung implementiert ist. // the communication about size changes is implemented by these components.
//Da wir keine Shell haben, merken wir uns diesen unguenstigen // Because we don't have a Shell we remember this unfortunate situtaion in the document,
//Zustand am Dokument, dies wird dann beim Erzeugen der ersten Shell // which is made up for later on when creating the first Shell.
//nachgeholt.
mbOLEPrtNotifyPending = sal_True; mbOLEPrtNotifyPending = sal_True;
if ( bAll ) if ( bAll )
mbAllOLENotify = sal_True; mbAllOLENotify = sal_True;
@@ -713,14 +701,13 @@ void SwDoc::PrtOLENotify( sal_Bool bAll )
SwOLENode* pOLENd = (*pNodes)[i]; SwOLENode* pOLENd = (*pNodes)[i];
pOLENd->SetOLESizeInvalid( sal_False ); pOLENd->SetOLESizeInvalid( sal_False );
//Ersteinmal die Infos laden und festellen ob das Teil nicht // At first load the Infos and see if it's not already in the exclude list.
//schon in der Exclude-Liste steht
SvGlobalName aName; SvGlobalName aName;
svt::EmbeddedObjectRef& xObj = pOLENd->GetOLEObj().GetObject(); svt::EmbeddedObjectRef& xObj = pOLENd->GetOLEObj().GetObject();
if ( xObj.is() ) if ( xObj.is() )
aName = SvGlobalName( xObj->getClassID() ); aName = SvGlobalName( xObj->getClassID() );
else //Noch nicht geladen else // Not yet loaded
{ {
// TODO/LATER: retrieve ClassID of an unloaded object // TODO/LATER: retrieve ClassID of an unloaded object
// aName = ???? // aName = ????
@@ -737,8 +724,8 @@ void SwDoc::PrtOLENotify( sal_Bool bAll )
if ( bFound ) if ( bFound )
continue; continue;
//Kennen wir nicht, also muss das Objekt geladen werden. // We don't know it, so the object has to be loaded.
//Wenn es keine Benachrichtigung wuenscht // If it doesn't want to be informed
if ( xObj.is() ) if ( xObj.is() )
{ {
pGlobalOLEExcludeList->Insert( pGlobalOLEExcludeList->Insert(
@@ -775,9 +762,9 @@ IMPL_LINK( SwDoc, DoUpdateModifiedOLE, Timer *, )
SwOLENode* pOLENd = (*pNodes)[i]; SwOLENode* pOLENd = (*pNodes)[i];
pOLENd->SetOLESizeInvalid( sal_False ); pOLENd->SetOLESizeInvalid( sal_False );
//Kennen wir nicht, also muss das Objekt geladen werden. // We don't know it, so the object has to be loaded.
//Wenn es keine Benachrichtigung wuenscht // If it doesn't want to be informed
if( pOLENd->GetOLEObj().GetOleRef().is() ) //Kaputt? if( pOLENd->GetOLEObj().GetOleRef().is() ) // Broken?
{ {
pOLENd->ModifyNotification( &aMsgHint, &aMsgHint ); pOLENd->ModifyNotification( &aMsgHint, &aMsgHint );
} }