Repository navigation
Persist current table style (CTABLESTYLE) in DXF header #2117
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,7 +2,9 @@ | |
| //! multileader styles, layout page setups, named views, UCSs and groups. | ||
|
|
||
| use cadcraft_doc::geom::{Vec2, Vec3}; | ||
| use cadcraft_doc::{Common, DashElement, Drawing, EntityKind, Group, Line, Linetype, MLeaderStyle, NamedView, Space, TextStyle, Ucs, library}; | ||
| use cadcraft_doc::{ | ||
| Common, DashElement, Drawing, EntityKind, Group, Line, Linetype, MLeaderStyle, NamedView, Space, TableStyle, TextStyle, Ucs, library, | ||
| }; | ||
| use cadcraft_io::{read_dxf, write_dxf}; | ||
|
|
||
| fn round_trip(d: &Drawing) -> Drawing { | ||
|
|
@@ -82,6 +84,15 @@ fn multileader_styles_and_current_style_round_trip() { | |
| assert_eq!(r.header.str("CMLEADERSTYLE", ""), "Callout"); | ||
| } | ||
|
|
||
| #[test] | ||
| fn current_table_style_round_trips() { | ||
| let mut d = Drawing::new_imperial(); | ||
| d.table_styles.push(TableStyle { name: "TS".into(), ..TableStyle::default() }); | ||
| d.header.set_str("CTABLESTYLE", "TS"); | ||
| let r = round_trip(&d); | ||
| assert_eq!(r.header.str("CTABLESTYLE", ""), "TS"); | ||
| } | ||
|
Comment on lines
+87
to
+94
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Check the serialized group code.
|
||
|
|
||
| #[test] | ||
| fn layout_page_setup_and_paper_view_round_trip() { | ||
| let mut d = Drawing::new_imperial(); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Script executed:
Repository: storytold/cadcraft
Length of output: 7042
Script executed:
Repository: storytold/cadcraft
Length of output: 41935
Script executed:
Repository: storytold/cadcraft
Length of output: 41874
Script executed:
Repository: storytold/cadcraft
Length of output: 19611
Add DXF variable-dictionary handling without removing the header variable.
("CTABLESTYLE", 7)follows the repository's header convention and should remain. The remaining gap is that aDICTIONARYVARvalue is preserved as raw data but is not applied tod.header, while new DXF output does not createAcDbVariableDictionary. A DXF that stores the current style only asCTABLESTYLEwith group code1can therefore reopen in CADCraft asStandard.Add the DXF variable-dictionary write and read mapping for
CTABLESTYLE, while retaining$CTABLESTYLEfor compatibility. Do not add a new DWG path: the DWG bridge already writesCTABLESTYLEas aDictionaryVariablefor AC1018. Add an AutoCAD-authored DXF fixture that exercises the dictionary value and its precedence over the header value.