[api] Paragraph::control_text_positions 추가 (옵션 A, #390)#405
Closed
DanMeon wants to merge 3 commits into
Closed
Conversation
…elpers wrapper 전환 - src/model/paragraph.rs: impl Paragraph 의 char_shape_id_at 다음에 pub fn control_text_positions(&self) -> Vec<usize> 신설. 알고리즘 본체 이식 (char_offsets 갭 분석). - src/document_core/helpers.rs: find_control_text_positions 본체 → para.control_text_positions() thin wrapper. pub(crate) 가시성 유지로 26 caller 호환. - 의존성 방향 model ← parser ← document_core 보존을 위해 알고리즘 본체를 model::Paragraph 로 이동. mydocs/plans/task_m100_390.md, _impl.md 동봉. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- test_control_text_positions_empty: controls.is_empty() 분기 - test_control_text_positions_no_offsets_inline_sequential: fallback 인라인 컨트롤 (Table) 순차 배치 - test_control_text_positions_no_offsets_non_inline_skipped: fallback else 분기 (비인라인 Bookmark 는 pos 미증가) - test_control_text_positions_gap_between_chars: 일반 분기 'AB' 사이 갭 분석 - test_control_text_positions_gap_before: 첫 문자 이전 갭 - test_control_text_positions_surrogate_pair_char_width: surrogate pair (U+1F389) UTF-16 width=2 분기 boundary cargo test --lib 1022 passed (baseline upstream/devel @ 4828937 = 1016, +6 신규). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
cargo test 1072 / cargo clippy -- -D warnings / samples/2010-01-06.hwp SVG 내보내기 6페이지 검증 통과. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
edwardkim
added a commit
that referenced
this pull request
Apr 28, 2026
edwardkim
added a commit
that referenced
this pull request
Apr 28, 2026
Owner
|
완료. `devel` 에 cherry-pick (작성자 attribution 보존) 으로 머지됨 (commit `35c5c1d`). 이슈 #390 자동 close 됩니다 (PR 본문에 `closes #390` 명시). 머지 commit작성자 attribution 보존:
검증
평가옵션 A (Paragraph 인스턴스 메서드 캡슐화) 선택이 long-term API 안정성 측면에서 적절했습니다 — helpers 모듈은 내부 구현으로 자유롭게 진화 가능하면서도 외부 binding (PyO3 / napi / JNI 등) 이 안정적인 surface 를 통해 호출 가능하게 됐습니다. `rhwp-python` 작업에 본 변경이 도움이 되길 바랍니다. 외부 binding 사용 중 추가로 누락된 surface 가 있으면 이슈로 알려주세요. 좋은 기여 감사합니다. |
Contributor
Author
|
빠른 피드백 감사합니다! |
edwardkim
added a commit
that referenced
this pull request
Apr 30, 2026
본 사이클 15번째 PR. PR #405 (DanMeon, v0.7.8) 와 같은 결의 외부 노출 작업. 이슈 #484 옵션 A — Paragraph::utf16_pos_to_char_idx 인스턴스 메서드 캡슐화. cherry-pick 3 commits (DanMeon author 보존): - a068645 Stage 1: 메서드 신설 - 36631fd Stage 2: 단위 테스트 6 추가 - efa0054 최종 보고서 검증: - cargo test --lib: 1086 passed (1080 + 6) - svg_snapshot: 6/6, issue_418: 1/1, clippy: 0건 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced May 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
변경 요약
이슈 #390 옵션 A 채택.
document_core::find_control_text_positions의 알고리즘 본체를Paragraph::control_text_positions(&self) -> Vec<usize>인스턴스 메서드로 캡슐화하여 외부 crate (third-party PyO3 / napi / JNI 등 binding) 에서 호출 가능하게 합니다.src/document_core/helpers.rs의find_control_text_positions는pub(crate)thin wrapper 로 유지되어 기존 26 caller (cursor / nav / 렌더러 / 책갈피 / 명령 / WASM) 동작 변경 없습니다. 의존성 방향 (model ← parser ← document_core) 보존을 위해 본체를model::Paragraph로 이동했습니다.관련 이슈
closes #390
테스트
cargo test통과cargo clippy -- -D warnings통과스크린샷
해당 없음 (API 노출, 시각적 변경 없음).