diff options
author | Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de> | 2021-12-20 09:48:27 +0100 |
---|---|---|
committer | Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de> | 2021-12-21 13:05:15 +0100 |
commit | 01de8e10bfa6a99dbbfd771a626657790be8129c (patch) | |
tree | 20c5158b63459c51952d3b46388a28ed2cfd15d2 /sc | |
parent | 4f140ebac1f971d72f5bb59ee23a3fe248c4d16e (diff) |
Fix formatting (wrong indentation)
Apply clang-format to this method
Change-Id: I67fbdc4ca8b9c602ed85a57dbbde8ed47bdd45c4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127215
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/tool/dbdata.cxx | 65 |
1 files changed, 32 insertions, 33 deletions
diff --git a/sc/source/core/tool/dbdata.cxx b/sc/source/core/tool/dbdata.cxx index f5328139f3e4..8ea877502087 100644 --- a/sc/source/core/tool/dbdata.cxx +++ b/sc/source/core/tool/dbdata.cxx @@ -546,44 +546,43 @@ bool ScDBData::HasSubTotalParam() const void ScDBData::UpdateMoveTab(SCTAB nOldPos, SCTAB nNewPos) { - ScRange aRange; - GetArea( aRange ); - SCTAB nTab = aRange.aStart.Tab(); // a database range is only on one sheet + ScRange aRange; + GetArea(aRange); + SCTAB nTab = aRange.aStart.Tab(); // a database range is only on one sheet - // customize as the current table as ScTablesHint (tabvwsh5.cxx) + // customize as the current table as ScTablesHint (tabvwsh5.cxx) - if ( nTab == nOldPos ) // moved sheet - nTab = nNewPos; - else if ( nOldPos < nNewPos ) // moved to the back - { - if ( nTab > nOldPos && nTab <= nNewPos ) // move this sheet - --nTab; - } - else // moved to the front - { - if ( nTab >= nNewPos && nTab < nOldPos ) // move this sheet - ++nTab; - } - - bool bChanged = ( nTab != aRange.aStart.Tab() ); - if (bChanged) - { - // SetArea() invalidates column names, but it is the same column range - // just on a different sheet; remember and set new. - ::std::vector<OUString> aNames( maTableColumnNames); - bool bTableColumnNamesDirty = mbTableColumnNamesDirty; - // Same column range. - SetArea( nTab, aRange.aStart.Col(), aRange.aStart.Row(), - aRange.aEnd.Col(),aRange.aEnd.Row() ); - // Do not use SetTableColumnNames() because that resets mbTableColumnNamesDirty. - maTableColumnNames = aNames; - mbTableColumnNamesDirty = bTableColumnNamesDirty; - } + if (nTab == nOldPos) // moved sheet + nTab = nNewPos; + else if (nOldPos < nNewPos) // moved to the back + { + if (nTab > nOldPos && nTab <= nNewPos) // move this sheet + --nTab; + } + else // moved to the front + { + if (nTab >= nNewPos && nTab < nOldPos) // move this sheet + ++nTab; + } - // MoveTo() is not necessary if only the sheet changed. + bool bChanged = (nTab != aRange.aStart.Tab()); + if (bChanged) + { + // SetArea() invalidates column names, but it is the same column range + // just on a different sheet; remember and set new. + ::std::vector<OUString> aNames(maTableColumnNames); + bool bTableColumnNamesDirty = mbTableColumnNamesDirty; + // Same column range. + SetArea(nTab, aRange.aStart.Col(), aRange.aStart.Row(), aRange.aEnd.Col(), + aRange.aEnd.Row()); + // Do not use SetTableColumnNames() because that resets mbTableColumnNamesDirty. + maTableColumnNames = aNames; + mbTableColumnNamesDirty = bTableColumnNamesDirty; + } - SetModified(bChanged); + // MoveTo() is not necessary if only the sheet changed. + SetModified(bChanged); } bool ScDBData::UpdateReference(const ScDocument* pDoc, UpdateRefMode eUpdateRefMode, |