Kaydet (Commit) c5d47afc authored tarafından Philipp Weissenbacher's avatar Philipp Weissenbacher Kaydeden (comit) Noel Grandin

Translate German comments, fix some ws

Change-Id: Ida67ce193ad032e2a1855e4380626f805514c2f2
Reviewed-on: https://gerrit.libreoffice.org/11103Reviewed-by: 's avatarNoel Grandin <noelgrandin@gmail.com>
Tested-by: 's avatarNoel Grandin <noelgrandin@gmail.com>
üst 32ce5ae1
...@@ -128,11 +128,11 @@ long ScGlobal::nLastColWidthExtra = STD_EXTRA_WIDTH; ...@@ -128,11 +128,11 @@ long ScGlobal::nLastColWidthExtra = STD_EXTRA_WIDTH;
static sal_uInt16 nPPTZoom = 0; // ScreenZoom used to determine nScreenPPTX/Y static sal_uInt16 nPPTZoom = 0; // ScreenZoom used to determine nScreenPPTX/Y
class SfxViewShell; class SfxViewShell;
SfxViewShell* pScActiveViewShell = NULL; //! als Member !!!!! SfxViewShell* pScActiveViewShell = NULL; //FIXME: Make this a member
sal_uInt16 nScClickMouseModifier = 0; //! dito sal_uInt16 nScClickMouseModifier = 0; //FIXME: This too
sal_uInt16 nScFillModeMouseModifier = 0; //! dito sal_uInt16 nScFillModeMouseModifier = 0; //FIXME: And this
// statische Funktionen // Static functions
bool ScGlobal::HasAttrChanged( const SfxItemSet& rNewAttrs, bool ScGlobal::HasAttrChanged( const SfxItemSet& rNewAttrs,
const SfxItemSet& rOldAttrs, const SfxItemSet& rOldAttrs,
...@@ -144,16 +144,15 @@ bool ScGlobal::HasAttrChanged( const SfxItemSet& rNewAttrs, ...@@ -144,16 +144,15 @@ bool ScGlobal::HasAttrChanged( const SfxItemSet& rNewAttrs,
if ( eNewState == eOldState ) if ( eNewState == eOldState )
{ {
// beide Items gesetzt // Both Items set
// PoolItems, d.h. Pointer-Vergleich zulaessig // PoolItems, meaning comparing pointers is valid
if ( SFX_ITEM_SET == eOldState ) if ( SFX_ITEM_SET == eOldState )
bInvalidate = (&rNewAttrs.Get( nWhich ) != &rOldAttrs.Get( nWhich )); bInvalidate = (&rNewAttrs.Get( nWhich ) != &rOldAttrs.Get( nWhich ));
} }
else else
{ {
// ein Default-Item dabei // Contains a Default Item
// PoolItems, d.h. Item-Vergleich noetig // PoolItems, meaning Item comparison necessary
const SfxPoolItem& rOldItem = ( SFX_ITEM_SET == eOldState ) const SfxPoolItem& rOldItem = ( SFX_ITEM_SET == eOldState )
? rOldAttrs.Get( nWhich ) ? rOldAttrs.Get( nWhich )
: rOldAttrs.GetPool()->GetDefaultItem( nWhich ); : rOldAttrs.GetPool()->GetDefaultItem( nWhich );
...@@ -197,9 +196,8 @@ bool ScGlobal::CheckWidthInvalidate( bool& bNumFormatChanged, ...@@ -197,9 +196,8 @@ bool ScGlobal::CheckWidthInvalidate( bool& bNumFormatChanged,
const SfxItemSet& rNewAttrs, const SfxItemSet& rNewAttrs,
const SfxItemSet& rOldAttrs ) const SfxItemSet& rOldAttrs )
{ {
// Ueberpruefen, ob Attributaenderungen in rNewAttrs gegnueber // Check whether attribute changes in rNewAttrs compared to rOldAttrs render
// rOldAttrs die Textbreite an einer Zelle ungueltig machen // the text width at a cell invalid
bNumFormatChanged = bNumFormatChanged =
HasAttrChanged( rNewAttrs, rOldAttrs, ATTR_VALUE_FORMAT ); HasAttrChanged( rNewAttrs, rOldAttrs, ATTR_VALUE_FORMAT );
return ( bNumFormatChanged return ( bNumFormatChanged
...@@ -241,7 +239,7 @@ const SvxSearchItem& ScGlobal::GetSearchItem() ...@@ -241,7 +239,7 @@ const SvxSearchItem& ScGlobal::GetSearchItem()
void ScGlobal::SetSearchItem( const SvxSearchItem& rNew ) void ScGlobal::SetSearchItem( const SvxSearchItem& rNew )
{ {
// Hier waere ein Zuweisungsoperator ganz nett: // FIXME: An assignement operator would be nice here
delete pSearchItem; delete pSearchItem;
pSearchItem = (SvxSearchItem*)rNew.Clone(); pSearchItem = (SvxSearchItem*)rNew.Clone();
...@@ -290,8 +288,7 @@ ScUnoAddInCollection* ScGlobal::GetAddInCollection() ...@@ -290,8 +288,7 @@ ScUnoAddInCollection* ScGlobal::GetAddInCollection()
ScUserList* ScGlobal::GetUserList() ScUserList* ScGlobal::GetUserList()
{ {
// Hack: Cfg-Item an der App ggF. laden // Hack: Load Cfg item at the App
global_InitAppOptions(); global_InitAppOptions();
if (!pUserList) if (!pUserList)
...@@ -499,13 +496,13 @@ void ScGlobal::Init() ...@@ -499,13 +496,13 @@ void ScGlobal::Init()
{ {
pEmptyOUString = new OUString; pEmptyOUString = new OUString;
// Die Default-Sprache fuer Zahlenformate (ScGlobal::eLnge) // The default language for number formats (ScGlobal::eLnge) must
// muss immer LANGUAGE_SYSTEM sein // always be LANGUAGE_SYSTEM
//! Dann kann auch die Variable raus // FIXME: So remove this variable?
eLnge = LANGUAGE_SYSTEM; eLnge = LANGUAGE_SYSTEM;
//! Wenn Sortierung etc. von der Sprache der installierten Offfice-Version // FIXME: If the sort-order etc. should depend the installed Office version
//! abhaengen sollen, hier "Application::GetSettings().GetUILanguage()" // use Application::GetSettings().GetUILanguage() here
pSysLocale = new SvtSysLocale; pSysLocale = new SvtSysLocale;
pCharClass = pSysLocale->GetCharClassPtr(); pCharClass = pSysLocale->GetCharClassPtr();
pLocaleData = pSysLocale->GetLocaleDataPtr(); pLocaleData = pSysLocale->GetLocaleDataPtr();
...@@ -524,7 +521,7 @@ void ScGlobal::Init() ...@@ -524,7 +521,7 @@ void ScGlobal::Init()
// arguments are to be merged in, which in turn need strings of function // arguments are to be merged in, which in turn need strings of function
// names from the compiler. // names from the compiler.
ScParameterClassification::Init(); ScParameterClassification::Init();
srand( (unsigned) time( NULL ) ); // Random Seed Init fuer Interpreter srand( (unsigned) time( NULL ) ); // Random Seed Init for Interpreter
::comphelper::rng::seed( time( NULL ) ); // seed for libc rand() replacement ::comphelper::rng::seed( time( NULL ) ); // seed for libc rand() replacement
InitAddIns(); InitAddIns();
...@@ -532,7 +529,7 @@ void ScGlobal::Init() ...@@ -532,7 +529,7 @@ void ScGlobal::Init()
pStrClipDocName = new OUString( ScResId( SCSTR_NONAME ) ); pStrClipDocName = new OUString( ScResId( SCSTR_NONAME ) );
*pStrClipDocName += "1"; *pStrClipDocName += "1";
// ScDocumentPool::InitVersionMaps() ist schon vorher gerufen worden // ScDocumentPool::InitVersionMaps() has been called earlier already
} }
void ScGlobal::UpdatePPT( OutputDevice* pDev ) void ScGlobal::UpdatePPT( OutputDevice* pDev )
...@@ -583,7 +580,7 @@ void ScGlobal::InitTextHeight(SfxItemPool* pPool) ...@@ -583,7 +580,7 @@ void ScGlobal::InitTextHeight(SfxItemPool* pPool)
VirtualDevice aVirtWindow( *pDefaultDev ); VirtualDevice aVirtWindow( *pDefaultDev );
aVirtWindow.SetMapMode(MAP_PIXEL); aVirtWindow.SetMapMode(MAP_PIXEL);
Font aDefFont; Font aDefFont;
pPattern->GetFont(aDefFont, SC_AUTOCOL_BLACK, &aVirtWindow); // font color doesn't matter here pPattern->GetFont(aDefFont, SC_AUTOCOL_BLACK, &aVirtWindow); // Font color doesn't matter here
aVirtWindow.SetFont(aDefFont); aVirtWindow.SetFont(aDefFont);
sal_uInt16 nTest = static_cast<sal_uInt16>( sal_uInt16 nTest = static_cast<sal_uInt16>(
aVirtWindow.PixelToLogic(Size(0, aVirtWindow.GetTextHeight()), MAP_TWIP).Height()); aVirtWindow.PixelToLogic(Size(0, aVirtWindow.GetTextHeight()), MAP_TWIP).Height());
...@@ -602,7 +599,7 @@ void ScGlobal::InitTextHeight(SfxItemPool* pPool) ...@@ -602,7 +599,7 @@ void ScGlobal::InitTextHeight(SfxItemPool* pPool)
void ScGlobal::Clear() void ScGlobal::Clear()
{ {
// asyncs _vor_ ExitExternalFunc zerstoeren! // Destroy asyncs _before_ ExitExternalFunc!
for( ScAddInAsyncs::iterator it = theAddInAsyncTbl.begin(); it != theAddInAsyncTbl.end(); ++it ) for( ScAddInAsyncs::iterator it = theAddInAsyncTbl.begin(); it != theAddInAsyncTbl.end(); ++it )
{ {
delete *it; delete *it;
...@@ -620,11 +617,11 @@ void ScGlobal::Clear() ...@@ -620,11 +617,11 @@ void ScGlobal::Clear()
delete[] ppRscString; delete[] ppRscString;
ppRscString = NULL; ppRscString = NULL;
DELETEZ(pStarCalcFunctionList); // vor ResMgr zerstoeren! DELETEZ(pStarCalcFunctionList); // Destroy before ResMgr!
DELETEZ(pStarCalcFunctionMgr); DELETEZ(pStarCalcFunctionMgr);
ScParameterClassification::Exit(); ScParameterClassification::Exit();
ScCompiler::DeInit(); ScCompiler::DeInit();
ScInterpreter::GlobalExit(); // statischen Stack loeschen ScInterpreter::GlobalExit(); // Delete static Stack
DELETEZ(pEmptyBrushItem); DELETEZ(pEmptyBrushItem);
DELETEZ(pButtonBrushItem); DELETEZ(pButtonBrushItem);
...@@ -724,7 +721,6 @@ ScFunctionMgr* ScGlobal::GetStarCalcFunctionMgr() ...@@ -724,7 +721,6 @@ ScFunctionMgr* ScGlobal::GetStarCalcFunctionMgr()
void ScGlobal::ResetFunctionList() void ScGlobal::ResetFunctionList()
{ {
// FunctionMgr has pointers into FunctionList, must also be updated // FunctionMgr has pointers into FunctionList, must also be updated
DELETEZ( pStarCalcFunctionMgr ); DELETEZ( pStarCalcFunctionMgr );
DELETEZ( pStarCalcFunctionList ); DELETEZ( pStarCalcFunctionList );
} }
...@@ -845,12 +841,12 @@ const sal_Unicode* ScGlobal::FindUnquoted( const sal_Unicode* pString, sal_Unico ...@@ -845,12 +841,12 @@ const sal_Unicode* ScGlobal::FindUnquoted( const sal_Unicode* pString, sal_Unico
bool ScGlobal::EETextObjEqual( const EditTextObject* pObj1, bool ScGlobal::EETextObjEqual( const EditTextObject* pObj1,
const EditTextObject* pObj2 ) const EditTextObject* pObj2 )
{ {
if ( pObj1 == pObj2 ) // both empty or the same object if ( pObj1 == pObj2 ) // Both empty or the same object
return true; return true;
if ( pObj1 && pObj2 ) if ( pObj1 && pObj2 )
{ {
// first test for equal text content // First test for equal text content
sal_Int32 nParCount = pObj1->GetParagraphCount(); sal_Int32 nParCount = pObj1->GetParagraphCount();
if ( nParCount != pObj2->GetParagraphCount() ) if ( nParCount != pObj2->GetParagraphCount() )
return false; return false;
...@@ -873,22 +869,22 @@ bool ScGlobal::EETextObjEqual( const EditTextObject* pObj1, ...@@ -873,22 +869,22 @@ bool ScGlobal::EETextObjEqual( const EditTextObject* pObj1,
void ScGlobal::OpenURL( const OUString& rURL, const OUString& rTarget ) void ScGlobal::OpenURL( const OUString& rURL, const OUString& rTarget )
{ {
// OpenURL wird immer ueber irgendwelche Umwege durch Mausklicks im GridWindow // OpenURL is always called in the GridWindow by mouse clicks in some way or another.
// aufgerufen, darum stimmen pScActiveViewShell und nScClickMouseModifier. // That's why pScActiveViewShell and nScClickMouseModifier are correct.
//SvtSecurityOptions to access Libreoffice global security parameters // SvtSecurityOptions to access Libreoffice global security parameters
SvtSecurityOptions aSecOpt; SvtSecurityOptions aSecOpt;
bool bCtrlClickHappened = (nScClickMouseModifier & KEY_MOD1); bool bCtrlClickHappened = (nScClickMouseModifier & KEY_MOD1);
bool bCtrlClickSecOption = aSecOpt.IsOptionSet( SvtSecurityOptions::E_CTRLCLICK_HYPERLINK ); bool bCtrlClickSecOption = aSecOpt.IsOptionSet( SvtSecurityOptions::E_CTRLCLICK_HYPERLINK );
if( bCtrlClickHappened && !( bCtrlClickSecOption ) ) if( bCtrlClickHappened && !( bCtrlClickSecOption ) )
{ {
//return since ctrl+click happened when the // return since ctrl+click happened when the
//ctrl+click security option was disabled, link should not open // ctrl+click security option was disabled, link should not open
return; return;
} }
else if( !( bCtrlClickHappened ) && bCtrlClickSecOption ) else if( !( bCtrlClickHappened ) && bCtrlClickSecOption )
{ {
//ctrl+click did not happen; only click happened maybe with some // ctrl+click did not happen; only click happened maybe with some
//other key combo. and security option is set, so return // other key combo. and security option is set, so return
return; return;
} }
SfxStringItem aUrl( SID_FILE_NAME, rURL ); SfxStringItem aUrl( SID_FILE_NAME, rURL );
...@@ -910,8 +906,7 @@ void ScGlobal::OpenURL( const OUString& rURL, const OUString& rTarget ) ...@@ -910,8 +906,7 @@ void ScGlobal::OpenURL( const OUString& rURL, const OUString& rTarget )
SfxBoolItem aNewView( SID_OPEN_NEW_VIEW, false ); SfxBoolItem aNewView( SID_OPEN_NEW_VIEW, false );
SfxBoolItem aBrowsing( SID_BROWSE, true ); SfxBoolItem aBrowsing( SID_BROWSE, true );
// kein SID_SILENT mehr // No SID_SILENT anymore
SfxViewFrame* pViewFrm = SfxViewFrame::Current(); SfxViewFrame* pViewFrm = SfxViewFrame::Current();
if (pViewFrm) if (pViewFrm)
pViewFrm->GetDispatcher()->Execute( SID_OPENDOC, pViewFrm->GetDispatcher()->Execute( SID_OPENDOC,
...@@ -933,14 +928,12 @@ sal_uInt8 ScGlobal::GetDefaultScriptType() ...@@ -933,14 +928,12 @@ sal_uInt8 ScGlobal::GetDefaultScriptType()
// Script type of office language is used then (same as GetEditDefaultLanguage, // Script type of office language is used then (same as GetEditDefaultLanguage,
// to get consistent behavior of text in simple cells and EditEngine, // to get consistent behavior of text in simple cells and EditEngine,
// also same as GetAppLanguage() in Writer) // also same as GetAppLanguage() in Writer)
return (sal_uInt8) SvtLanguageOptions::GetScriptTypeOfLanguage( Application::GetSettings().GetLanguageTag().getLanguageType() ); return (sal_uInt8) SvtLanguageOptions::GetScriptTypeOfLanguage( Application::GetSettings().GetLanguageTag().getLanguageType() );
} }
LanguageType ScGlobal::GetEditDefaultLanguage() LanguageType ScGlobal::GetEditDefaultLanguage()
{ {
// used for EditEngine::SetDefaultLanguage // Used for EditEngine::SetDefaultLanguage
return Application::GetSettings().GetLanguageTag().getLanguageType(); return Application::GetSettings().GetLanguageTag().getLanguageType();
} }
...@@ -1043,7 +1036,7 @@ void ScGlobal::AddLanguage( SfxItemSet& rSet, SvNumberFormatter& rFormatter ) ...@@ -1043,7 +1036,7 @@ void ScGlobal::AddLanguage( SfxItemSet& rSet, SvNumberFormatter& rFormatter )
const SvNumberformat* pHardFormat = rFormatter.GetEntry( const SvNumberformat* pHardFormat = rFormatter.GetEntry(
((const SfxUInt32Item*)pHardItem)->GetValue() ); ((const SfxUInt32Item*)pHardItem)->GetValue() );
sal_uLong nParentFmt = 0; // pool default sal_uLong nParentFmt = 0; // Pool default
const SfxItemSet* pParent = rSet.GetParent(); const SfxItemSet* pParent = rSet.GetParent();
if ( pParent ) if ( pParent )
nParentFmt = ((const SfxUInt32Item&)pParent->Get( ATTR_VALUE_FORMAT )).GetValue(); nParentFmt = ((const SfxUInt32Item&)pParent->Get( ATTR_VALUE_FORMAT )).GetValue();
......
...@@ -163,7 +163,7 @@ void ScOutlineArray::FindEntry( ...@@ -163,7 +163,7 @@ void ScOutlineArray::FindEntry(
if (nMaxLevel > nDepth) if (nMaxLevel > nDepth)
nMaxLevel = nDepth; nMaxLevel = nDepth;
for (size_t nLevel = 0; nLevel < nMaxLevel; ++nLevel) //! rueckwaerts suchen ? for (size_t nLevel = 0; nLevel < nMaxLevel; ++nLevel) //TODO: Search backwards?
{ {
ScOutlineCollection* pCollect = &aCollections[nLevel]; ScOutlineCollection* pCollect = &aCollections[nLevel];
ScOutlineCollection::iterator it = pCollect->begin(), itEnd = pCollect->end(); ScOutlineCollection::iterator it = pCollect->begin(), itEnd = pCollect->end();
...@@ -172,7 +172,7 @@ void ScOutlineArray::FindEntry( ...@@ -172,7 +172,7 @@ void ScOutlineArray::FindEntry(
ScOutlineEntry* pEntry = it->second; ScOutlineEntry* pEntry = it->second;
if (pEntry->GetStart() <= nSearchPos && pEntry->GetEnd() >= nSearchPos) if (pEntry->GetStart() <= nSearchPos && pEntry->GetEnd() >= nSearchPos)
{ {
rFindLevel = nLevel + 1; // naechster Level (zum Einfuegen) rFindLevel = nLevel + 1; // Next Level (for insertion)
rFindIndex = std::distance(pCollect->begin(), it); rFindIndex = std::distance(pCollect->begin(), it);
} }
} }
...@@ -189,7 +189,7 @@ bool ScOutlineArray::Insert( ...@@ -189,7 +189,7 @@ bool ScOutlineArray::Insert(
bool bCont; bool bCont;
sal_uInt16 nFindMax; sal_uInt16 nFindMax;
FindEntry( nStartCol, nStartLevel, nStartIndex ); // nLevel = neuer Level (alter+1) !!! FindEntry( nStartCol, nStartLevel, nStartIndex ); // nLevel = new Level (old+1)
FindEntry( nEndCol, nEndLevel, nEndIndex ); FindEntry( nEndCol, nEndLevel, nEndIndex );
nFindMax = std::max(nStartLevel,nEndLevel); nFindMax = std::max(nStartLevel,nEndLevel);
do do
...@@ -230,8 +230,7 @@ bool ScOutlineArray::Insert( ...@@ -230,8 +230,7 @@ bool ScOutlineArray::Insert(
size_t nLevel = nStartLevel; size_t nLevel = nStartLevel;
// untere verschieben // Move the ones underneath
bool bNeedSize = false; bool bNeedSize = false;
if (nDepth > 0) if (nDepth > 0)
{ {
...@@ -247,7 +246,7 @@ bool ScOutlineArray::Insert( ...@@ -247,7 +246,7 @@ bool ScOutlineArray::Insert(
{ {
if (nMoveLevel >= SC_OL_MAXDEPTH - 1) if (nMoveLevel >= SC_OL_MAXDEPTH - 1)
{ {
rSizeChanged = false; // kein Platz rSizeChanged = false; // No more room
return false; return false;
} }
aCollections[nMoveLevel+1].insert(new ScOutlineEntry(*pEntry)); aCollections[nMoveLevel+1].insert(new ScOutlineEntry(*pEntry));
...@@ -305,7 +304,7 @@ bool ScOutlineArray::FindTouchedLevel( ...@@ -305,7 +304,7 @@ bool ScOutlineArray::FindTouchedLevel(
if ( ( nBlockStart>=nStart && nBlockStart<=nEnd ) || if ( ( nBlockStart>=nStart && nBlockStart<=nEnd ) ||
( nBlockEnd >=nStart && nBlockEnd <=nEnd ) ) ( nBlockEnd >=nStart && nBlockEnd <=nEnd ) )
{ {
rFindLevel = nLevel; // wirklicher Level rFindLevel = nLevel; // Actual Level
bFound = true; bFound = true;
} }
} }
...@@ -329,10 +328,10 @@ void ScOutlineArray::RemoveSub(SCCOLROW nStartPos, SCCOLROW nEndPos, size_t nLev ...@@ -329,10 +328,10 @@ void ScOutlineArray::RemoveSub(SCCOLROW nStartPos, SCCOLROW nEndPos, size_t nLev
SCCOLROW nEnd = pEntry->GetEnd(); SCCOLROW nEnd = pEntry->GetEnd();
if (nStart >= nStartPos && nEnd <= nEndPos) if (nStart >= nStartPos && nEnd <= nEndPos)
{ {
// Overlaps. // Overlaps
RemoveSub( nStart, nEnd, nLevel+1 ); RemoveSub( nStart, nEnd, nLevel+1 );
// Re-calc iterator positions after the tree gets invalidated. // Re-calc iterator positions after the tree gets invalidated
size_t nPos = std::distance(rColl.begin(), it); size_t nPos = std::distance(rColl.begin(), it);
rColl.erase(it); rColl.erase(it);
it = rColl.begin(); it = rColl.begin();
...@@ -356,7 +355,7 @@ void ScOutlineArray::RemoveSub(SCCOLROW nStartPos, SCCOLROW nEndPos, size_t nLev ...@@ -356,7 +355,7 @@ void ScOutlineArray::RemoveSub(SCCOLROW nStartPos, SCCOLROW nEndPos, size_t nLev
{ {
RemoveSub( nStart, nEnd, nLevel+1 ); RemoveSub( nStart, nEnd, nLevel+1 );
// Re-calc iterator positions after the tree gets invalidated. // Re-calc iterator positions after the tree gets invalidated
size_t nPos = std::distance(rColl.begin(), it); size_t nPos = std::distance(rColl.begin(), it);
rColl.erase(it); rColl.erase(it);
it = rColl.begin(); it = rColl.begin();
...@@ -372,7 +371,7 @@ void ScOutlineArray::PromoteSub(SCCOLROW nStartPos, SCCOLROW nEndPos, size_t nSt ...@@ -372,7 +371,7 @@ void ScOutlineArray::PromoteSub(SCCOLROW nStartPos, SCCOLROW nEndPos, size_t nSt
{ {
if (nStartLevel==0) if (nStartLevel==0)
{ {
OSL_FAIL("PromoteSub mit Level 0"); OSL_FAIL("PromoteSub with Level 0");
return; return;
} }
...@@ -389,7 +388,7 @@ void ScOutlineArray::PromoteSub(SCCOLROW nStartPos, SCCOLROW nEndPos, size_t nSt ...@@ -389,7 +388,7 @@ void ScOutlineArray::PromoteSub(SCCOLROW nStartPos, SCCOLROW nEndPos, size_t nSt
{ {
aCollections[nLevel-1].insert(new ScOutlineEntry(*pEntry)); aCollections[nLevel-1].insert(new ScOutlineEntry(*pEntry));
// Re-calc iterator positions after the tree gets invalidated. // Re-calc iterator positions after the tree gets invalidated
size_t nPos = std::distance(rColl.begin(), it); size_t nPos = std::distance(rColl.begin(), it);
rColl.erase(it); rColl.erase(it);
it = rColl.begin(); it = rColl.begin();
...@@ -412,7 +411,7 @@ void ScOutlineArray::PromoteSub(SCCOLROW nStartPos, SCCOLROW nEndPos, size_t nSt ...@@ -412,7 +411,7 @@ void ScOutlineArray::PromoteSub(SCCOLROW nStartPos, SCCOLROW nEndPos, size_t nSt
{ {
aCollections[nLevel-1].insert(new ScOutlineEntry(*pEntry)); aCollections[nLevel-1].insert(new ScOutlineEntry(*pEntry));
// Re-calc iterator positions after the tree gets invalidated. // Re-calc iterator positions after the tree gets invalidated
size_t nPos = std::distance(rColl.begin(), it); size_t nPos = std::distance(rColl.begin(), it);
rColl.erase(it); rColl.erase(it);
it = rColl.begin(); it = rColl.begin();
...@@ -425,7 +424,10 @@ void ScOutlineArray::PromoteSub(SCCOLROW nStartPos, SCCOLROW nEndPos, size_t nSt ...@@ -425,7 +424,10 @@ void ScOutlineArray::PromoteSub(SCCOLROW nStartPos, SCCOLROW nEndPos, size_t nSt
} }
} }
bool ScOutlineArray::DecDepth() // nDepth auf leere Levels anpassen /**
* Adapt nDepth for empty Levels
*/
bool ScOutlineArray::DecDepth()
{ {
bool bChanged = false; bool bChanged = false;
bool bCont; bool bCont;
...@@ -462,7 +464,7 @@ bool ScOutlineArray::Remove( SCCOLROW nBlockStart, SCCOLROW nBlockEnd, bool& rSi ...@@ -462,7 +464,7 @@ bool ScOutlineArray::Remove( SCCOLROW nBlockStart, SCCOLROW nBlockEnd, bool& rSi
SCCOLROW nEnd = pEntry->GetEnd(); SCCOLROW nEnd = pEntry->GetEnd();
if (nBlockStart <= nEnd && nBlockEnd >= nStart) if (nBlockStart <= nEnd && nBlockEnd >= nStart)
{ {
// Overlaps. // Overlaps
pCollect->erase(it); pCollect->erase(it);
PromoteSub( nStart, nEnd, nLevel+1 ); PromoteSub( nStart, nEnd, nLevel+1 );
itEnd = pCollect->end(); itEnd = pCollect->end();
...@@ -473,7 +475,7 @@ bool ScOutlineArray::Remove( SCCOLROW nBlockStart, SCCOLROW nBlockEnd, bool& rSi ...@@ -473,7 +475,7 @@ bool ScOutlineArray::Remove( SCCOLROW nBlockStart, SCCOLROW nBlockEnd, bool& rSi
++it; ++it;
} }
if (bAny) // Depth anpassen if (bAny) // Adapt Depth
if (DecDepth()) if (DecDepth())
rSizeChanged = true; rSizeChanged = true;
...@@ -538,7 +540,7 @@ bool ScOutlineArray::GetEntryIndex(size_t nLevel, SCCOLROW nPos, size_t& rnIndex ...@@ -538,7 +540,7 @@ bool ScOutlineArray::GetEntryIndex(size_t nLevel, SCCOLROW nPos, size_t& rnIndex
if (nLevel >= nDepth) if (nLevel >= nDepth)
return false; return false;
// found entry contains passed position // Found entry contains passed position
const ScOutlineCollection& rColl = aCollections[nLevel]; const ScOutlineCollection& rColl = aCollections[nLevel];
ScOutlineCollection::const_iterator it = rColl.begin(), itEnd = rColl.end(); ScOutlineCollection::const_iterator it = rColl.begin(), itEnd = rColl.end();
for (; it != itEnd; ++it) for (; it != itEnd; ++it)
...@@ -559,7 +561,7 @@ bool ScOutlineArray::GetEntryIndexInRange( ...@@ -559,7 +561,7 @@ bool ScOutlineArray::GetEntryIndexInRange(
if (nLevel >= nDepth) if (nLevel >= nDepth)
return false; return false;
// found entry will be completely inside of passed range // Found entry will be completely inside of passed range
const ScOutlineCollection& rColl = aCollections[nLevel]; const ScOutlineCollection& rColl = aCollections[nLevel];
ScOutlineCollection::const_iterator it = rColl.begin(), itEnd = rColl.end(); ScOutlineCollection::const_iterator it = rColl.begin(), itEnd = rColl.end();
for (; it != itEnd; ++it) for (; it != itEnd; ++it)
...@@ -603,7 +605,7 @@ void ScOutlineArray::SetVisibleBelow( ...@@ -603,7 +605,7 @@ void ScOutlineArray::SetVisibleBelow(
} }
if (bSkipHidden) if (bSkipHidden)
nSubLevel = nDepth; // Abbruch nSubLevel = nDepth; // Bail out
} }
} }
...@@ -667,8 +669,8 @@ void ScOutlineArray::InsertSpace(SCCOLROW nStartPos, SCSIZE nSize) ...@@ -667,8 +669,8 @@ void ScOutlineArray::InsertSpace(SCCOLROW nStartPos, SCSIZE nSize)
else else
{ {
SCCOLROW nEnd = pEntry->GetEnd(); SCCOLROW nEnd = pEntry->GetEnd();
// immer erweitern, wenn innerhalb der Gruppe eingefuegt // Always expand if inserted within the group
// beim Einfuegen am Ende nur, wenn die Gruppe nicht ausgeblendet ist // When inserting at the end, only if the group is not hidden
if ( nEnd >= nStartPos || ( nEnd+1 >= nStartPos && !pEntry->IsHidden() ) ) if ( nEnd >= nStartPos || ( nEnd+1 >= nStartPos && !pEntry->IsHidden() ) )
{ {
SCSIZE nEntrySize = pEntry->GetSize(); SCSIZE nEntrySize = pEntry->GetSize();
...@@ -682,8 +684,8 @@ void ScOutlineArray::InsertSpace(SCCOLROW nStartPos, SCSIZE nSize) ...@@ -682,8 +684,8 @@ void ScOutlineArray::InsertSpace(SCCOLROW nStartPos, SCSIZE nSize)
bool ScOutlineArray::DeleteSpace(SCCOLROW nStartPos, SCSIZE nSize) bool ScOutlineArray::DeleteSpace(SCCOLROW nStartPos, SCSIZE nSize)
{ {
SCCOLROW nEndPos = nStartPos + nSize - 1; SCCOLROW nEndPos = nStartPos + nSize - 1;
bool bNeedSave = false; // Original fuer Undo benoetigt? bool bNeedSave = false; // Do we need the original one for Undo?
bool bChanged = false; // fuer Test auf Level bool bChanged = false; // For Level test
ScSubOutlineIterator aIter( this ); ScSubOutlineIterator aIter( this );
ScOutlineEntry* pEntry; ScOutlineEntry* pEntry;
...@@ -695,21 +697,21 @@ bool ScOutlineArray::DeleteSpace(SCCOLROW nStartPos, SCSIZE nSize) ...@@ -695,21 +697,21 @@ bool ScOutlineArray::DeleteSpace(SCCOLROW nStartPos, SCSIZE nSize)
if ( nEntryEnd >= nStartPos ) if ( nEntryEnd >= nStartPos )
{ {
if ( nEntryStart > nEndPos ) // rechts if ( nEntryStart > nEndPos ) // Right
pEntry->Move(-(static_cast<SCsCOLROW>(nSize))); pEntry->Move(-(static_cast<SCsCOLROW>(nSize)));
else if ( nEntryStart < nStartPos && nEntryEnd >= nEndPos ) // aussen else if ( nEntryStart < nStartPos && nEntryEnd >= nEndPos ) // Outside
pEntry->SetSize( nEntrySize-nSize ); pEntry->SetSize( nEntrySize-nSize );
else else
{ {
bNeedSave = true; bNeedSave = true;
if ( nEntryStart >= nStartPos && nEntryEnd <= nEndPos ) // innen if ( nEntryStart >= nStartPos && nEntryEnd <= nEndPos ) // Inside
{ {
aIter.DeleteLast(); aIter.DeleteLast();
bChanged = true; bChanged = true;
} }
else if ( nEntryStart >= nStartPos ) // rechts ueber else if ( nEntryStart >= nStartPos ) // Top right
pEntry->SetPosSize( nStartPos, static_cast<SCSIZE>(nEntryEnd-nEndPos) ); pEntry->SetPosSize( nStartPos, static_cast<SCSIZE>(nEntryEnd-nEndPos) );
else // links ueber else // Top left
pEntry->SetSize( static_cast<SCSIZE>(nStartPos-nEntryStart) ); pEntry->SetSize( static_cast<SCSIZE>(nStartPos-nEntryStart) );
} }
} }
...@@ -806,7 +808,7 @@ bool ScOutlineTable::DeleteRow( SCROW nStartRow, SCSIZE nSize ) ...@@ -806,7 +808,7 @@ bool ScOutlineTable::DeleteRow( SCROW nStartRow, SCSIZE nSize )
ScSubOutlineIterator::ScSubOutlineIterator( ScOutlineArray* pOutlineArray ) : ScSubOutlineIterator::ScSubOutlineIterator( ScOutlineArray* pOutlineArray ) :
pArray( pOutlineArray ), pArray( pOutlineArray ),
nStart( 0 ), nStart( 0 ),
nEnd( SCCOLROW_MAX ), // alle durchgehen nEnd( SCCOLROW_MAX ), // Iterate over all of them
nSubLevel( 0 ), nSubLevel( 0 ),
nSubEntry( 0 ) nSubEntry( 0 )
{ {
...@@ -851,13 +853,13 @@ ScOutlineEntry* ScSubOutlineIterator::GetNext() ...@@ -851,13 +853,13 @@ ScOutlineEntry* ScSubOutlineIterator::GetNext()
} }
else else
{ {
// Go to the next sub-level. // Go to the next sub-level
nSubEntry = 0; nSubEntry = 0;
++nSubLevel; ++nSubLevel;
} }
} }
while (!bFound); while (!bFound);
return pEntry; // nSubLevel gueltig, wenn pEntry != 0 return pEntry; // nSubLevel valid, if pEntry != 0
} }
size_t ScSubOutlineIterator::LastEntry() const size_t ScSubOutlineIterator::LastEntry() const
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment