Repository navigation
Conversation
add_picture wrote any align it was given into hp:pos@horzAlign ("BOGUS",
" RIGHT ", "TOP"), which Hancom reads as LEFT; a non-string failed only after
the image and its paragraph were added. The alignment is now checked first,
in any case, against the schema's horizontal alignments, and anything else is
refused with shape-position-frame before anything is stored.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A negative width or height of a rectangle, ellipse, arc, picture or equation box, or a negative rectangle corner ratio, was written as given; Hancom reads it as 0. Such values, and sizes of 2**31 or more, are now refused with typed errors before any paragraph, run or image is added (shape-size-value, shape-rect-ratio-value). An equation's base_unit outside 1..2**31-1 raises shape-equation-base-unit-value (a ValueError, as before) before its paragraph is added. HwpxOxmlShape.resize refuses a negative size too, and HwpxOxmlParagraph.add_picture builds the picture before adding its run. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Hancom reads a caption's gap and the gap between columns of the same width as signed 16-bit numbers and a new number as an unsigned one, wrapping anything else (a column gap of 32768 makes the columns overlap; a negative one written as text is read as 0). set_caption's gap outside -32768..32767, a same_gap (or page setup column_gap_mm) outside 0..32767 and a restart number outside 0..65535 are now refused before anything changes (shape-caption-gap-value, page-column-gap-value, page-new-num-value). The caption side check moves to shape_position unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 6, 2026
add_equation's base unit check now raises a typed error, so oxml/paragraph.py raises one untyped error fewer. The census lock records 202 untyped raises (paragraph.py 18), as the ratchet's self-test expects the lock to match the tree. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
바뀐 점
캡션 간격, 같은 폭 단의 간격, 새 번호에서 한/글이 그대로 두지 않는 값을 무엇도 바꾸기 전에 거부한다. 전에는 그대로 썼다.
한/글의 동작
hp:caption@gap)은 부호 있는 16비트 수로 읽는다.hp:colPr@sameGap)도 부호 있는 16비트 수로 읽는다."-1") 0으로 읽는다.hp:newNum@num)는 부호 없는 16비트 수로 읽는다. −1은 65535로, 65536은 0으로 감싼다.코드
oxml/shape_position.pyvalidate_caption_gap: −32768 이상 32767 이하의 int만 받는다. 오류 코드는shape-caption-gap-value.side) 검사(validate_caption_side)와 그 어휘(CAPTION_SIDES)를oxml/objects.py에서 옮긴다. 동작은 같다.objects.py가 줄 수 상한(1600)에 닿아 있어 간격 검사를 넣을 자리를 만든다.oxml/objects.py: 표·그림·도형이 함께 쓰는 캡션 쓰기(_write_caption)가 캡션을 만들기 전에 면과 간격을 검사한다.oxml/section_format.pyvalidate_column_gap: 0 이상 32767 이하의 int만 받는다. 오류 코드는page-column-gap-value.validate_new_number: 받은 값을 전처럼int()로 바꾼 뒤 0 이상 65535 이하만 받는다. 오류 코드는page-new-num-value.set_columns), 문단의 새 단(add_column_definition), 퍼사드(doc.page.set_columns)가 무엇도 바꾸기 전에 검사한다.doc.page.setup(columns=..., column_gap_mm=...)는 쪽 크기와 여백을 바꾸기 전에 단 간격을 검사한다.HwpxOxmlParagraph.add_new_num은 런을 더하기 전에 새 번호를 검사한다.errors.py와docs/error-codes.md에 코드 셋을 등록하고, 변경 로그 항목을 더한다.테스트
tests/test_gap_and_new_number_values.py를 더하고, 한/글 저장본 열을 함께 넣는다."-1"page.setup은 쪽도 바뀌지 않는다.이 PR은 #415와 #416 위에 쌓았다. 앞 PR이 병합되면 그 커밋들은 이 PR의 diff에서 빠진다.
🤖 Generated with Claude Code