Skip to content

New FontData Constructor to create a deep copy #2128

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ShahzaibIbrahim
Copy link
Contributor

This change will give us a chance to use proper channel to create a deep copy of FontData object instead of using FontData(fd.toString)

Copy link
Contributor

github-actions bot commented May 8, 2025

Test Results

104 files   -    441  104 suites   - 441   6s ⏱️ - 27m 37s
 66 tests  -  4 333   66 ✅  -  4 315  0 💤  -  18  0 ❌ ±0 
213 runs   - 16 510  213 ✅  - 16 370  0 💤  - 140  0 ❌ ±0 

Results for commit 3a3deb9. ± Comparison against base commit d2cb26d.

This pull request removes 4333 tests.
AllGTKTests org.eclipse.swt.tests.gtk.Test_GtkConverter ‑ test_HeuristicASCII_dollarSign
AllGTKTests org.eclipse.swt.tests.gtk.Test_GtkConverter ‑ test_HeuristicASCII_emptyString
AllGTKTests org.eclipse.swt.tests.gtk.Test_GtkConverter ‑ test_HeuristicASCII_letterA
AllGTKTests org.eclipse.swt.tests.gtk.Test_GtkConverter ‑ test_HeuristicASCII_letters
AllGTKTests org.eclipse.swt.tests.gtk.Test_GtkConverter ‑ test_HeuristicUTF16LE_null
AllGTKTests org.eclipse.swt.tests.gtk.Test_GtkConverter ‑ test_HeuristicUTF16_AsciiLetters
AllGTKTests org.eclipse.swt.tests.gtk.Test_GtkConverter ‑ test_HeuristicUTF16_Asciiletter
AllGTKTests org.eclipse.swt.tests.gtk.Test_GtkConverter ‑ test_HeuristicUTF16_LotsOfLetters
AllGTKTests org.eclipse.swt.tests.gtk.Test_GtkConverter ‑ test_HeuristicUTF16_letter
AllGTKTests org.eclipse.swt.tests.gtk.Test_GtkConverter ‑ test_HeuristicUTF16_letters
…

♻️ This comment has been updated with latest results.

@ShahzaibIbrahim ShahzaibIbrahim marked this pull request as ready for review May 8, 2025 11:56
@ShahzaibIbrahim ShahzaibIbrahim force-pushed the master-296 branch 2 times, most recently from c7a5291 to 46cfcee Compare May 13, 2025 10:16
Copy link
Contributor

@HeikoKlare HeikoKlare left a comment

Choose a reason for hiding this comment

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

Having a proper copy constructor for FontData sounds reasonable to me.
However, the implementations are no proper copy constructors. They seem to be copies of the String-based constructors which is only able to copy the data present in the string, while a proper copy constructor can simply deep-copy all the data from the existing FontData object.

@ShahzaibIbrahim ShahzaibIbrahim marked this pull request as draft June 3, 2025 11:56
@ShahzaibIbrahim ShahzaibIbrahim marked this pull request as ready for review June 3, 2025 12:10
Copy link
Contributor

@HeikoKlare HeikoKlare left a comment

Choose a reason for hiding this comment

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

In general, this now looks fine to me. I only have some minor comments regarding code style.

@ShahzaibIbrahim ShahzaibIbrahim force-pushed the master-296 branch 2 times, most recently from 2d5c93f to aee6314 Compare June 5, 2025 09:28
Copy link
Contributor

@HeikoKlare HeikoKlare left a comment

Choose a reason for hiding this comment

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

This looks good now. Before merging we will just need to ensure that the @since tags are updated to 3.131 (you could already do that now) and that the necessary version bump to 3.131 is applied (if not yet done by then).

[win32] Introducing new FontData Constructor to create a deep copy

This change will give us a chance to use proper channel to create a deep
copy of FontData object instead of using FontData(fd.toString)
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.

Improve FontData Copying: Replace String Constructor with Safer Approach
2 participants