Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix moving cells/rows/columns #479

Merged
merged 10 commits into from
Jul 24, 2020
Merged

Conversation

voodoo11
Copy link
Collaborator

Context

Fixes several bugs caused by inconsistent behavior of moveCells operation.

  • Moving cells with part of a range caused inconsistent state and runtime exception
  • Moving rows/columns were also affected as this operations consist of three others (addRows, moveCells, removeRows)
  • Undoing moveCells/moveRows sometimes caused wrong engine state

Circular dependencies that may occur after moving cells are now handled without loosing original formula.

const engine = HyperFormula.buildFromArray([
      ['=B1', '1'],
])
engine.moveCells(adr('A1'), 1, 1, adr('B1'))

const formula = engine.getCellFormula(adr('B1')) // '=B1',     before: '=#REF!'
const value = engine.getCellValue(adr('B1'))     // '#CYCLE!', before: '#REF!'

How has this been tested?

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature or improvement (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Additional language file or change to the existing one (translations)

Related issue(s):

Checklist:

  • My code follows the code style of this project,
  • My change requires a change to the documentation,
  • I described the modification in the CHANGELOG.md file.

izulin
izulin previously approved these changes Jul 24, 2020
src/DependencyGraph/DependencyGraph.ts Outdated Show resolved Hide resolved
src/DependencyGraph/FormulaCellVertex.ts Outdated Show resolved Hide resolved
Co-authored-by: Przemysław Uznański <40573492+izulin@users.noreply.github.com>
CHANGELOG.md Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
Co-authored-by: Wojciech Czerniak <wojciech.czerniak@gmail.com>
voodoo11 and others added 2 commits July 24, 2020 10:54
Co-authored-by: Wojciech Czerniak <wojciech.czerniak@gmail.com>
@voodoo11 voodoo11 requested a review from izulin July 24, 2020 08:59
@voodoo11 voodoo11 merged commit ec71cf1 into develop Jul 24, 2020
@wojciechczerniak wojciechczerniak deleted the jk/move-cells-transformer-fix branch September 15, 2021 11:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants