Skip to content

Text Selection refactoring of Ralph - continuation of PR #238 - fixing final tests#240

Merged
svanteschubert merged 15 commits into
masterfrom
api-change
Jul 13, 2023
Merged

Text Selection refactoring of Ralph - continuation of PR #238 - fixing final tests#240
svanteschubert merged 15 commits into
masterfrom
api-change

Conversation

@svanteschubert

Copy link
Copy Markdown
Contributor

I have reviewed and continued Ralph's PR #238

The Fix in the Nutshell:
Realized that two navigators where working on the same DOC and one was changing the DOC, but the other had a cached selection, which was not updated as the prior STATIC SelectionManager should now be moved to the OdfDocument instance to be able to dirty flag

According to GitHub docu - and from my understanding of it - I can only contribute to a PR, by creating a new one:
https://docs.github.com/de/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

This is what I did today:

  1. update my PR branch
  2. Complete build of ODF Toolkit successfull on Windows 10 -> but a dozen files with Indent Normalization
  3. These files changed by "Indent Normalization" committed locally to remove noise
  4. The two ignored Tests activated in TextSelectionTest(@ignore deleted) & all test output files named differently in relation to their test method
  5. does hang/loop in this TextSelectionTest in complete build.. - pasteAtEndOf causes loop
  6. Enhance readablity in Tests - Making TextSelection and TextNavigation variables mnemonic, e.g. search4XY and selection4XY
  7. Enhance robustness in Tests -> Exchanging global TextSelection & TextNavigation variables with local ones!
  8. Fixed loop see above.

…hanging slower Hashtable with HashMap and Vector with ArrayList

@rsoika rsoika left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks all good to me

@rsoika rsoika left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks all good to me

@svanteschubert svanteschubert self-assigned this Jul 11, 2023

@rsoika rsoika left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes - works now perfect!

@rsoika rsoika left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok - I understand and yes this is a perfect solution to get away form the singleton.
But what do think about adding a method resetSelections
this can be necessary if user did first search and modify the doc and than - before he saves the document - what to modify the result again - now she should have the chance to reset the current selections ?

@svanteschubert

Copy link
Copy Markdown
Contributor Author

Sure, the SelectionManager could offer such a functionality. Let me update!

@svanteschubert

Copy link
Copy Markdown
Contributor Author

I called the method unregisterAll() as there was already a method called:
public void unregisterItem(Selection item)

@rsoika rsoika left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me

@svanteschubert svanteschubert merged commit a627b73 into master Jul 13, 2023
@svanteschubert svanteschubert deleted the api-change branch July 13, 2023 13:10
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.

2 participants