Skip to content
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

FILEFORMAT_ASSERT() on text object export #2012

Closed
lpechacek opened this issue Dec 22, 2021 · 2 comments
Closed

FILEFORMAT_ASSERT() on text object export #2012

lpechacek opened this issue Dec 22, 2021 · 2 comments

Comments

@lpechacek
Copy link
Member

FILEFORMAT_ASSERT(text_format != end(text_format_mapping));

At this moment, we merely know that it triggers but don't understand the exact circumstances. The reporter explicitly mentioned that the map contains text objects with varying alignment. However, it is unclear why text_format_mapping does not have the symbol+alignment combination.

@lpechacek
Copy link
Member Author

Unsurprisingly, changing object's h_align attribute to an invalid value in an .omap file triggers the export assert. I don't know, however, if that is the root cause of the original report. I'm investigating further.

<?xml version="1.0" encoding="UTF-8"?>
<map xmlns="http://openorienteering.org/apps/mapper/xml/v2" version="9">
<notes></notes>
<georeferencing scale="4000"><projected_crs id="Local"/></georeferencing>
<colors count="0">
</colors>
<barrier version="6" required="0.6.0">
<symbols count="1">
<symbol type="8" id="0" code="1" name="x"><text_symbol icon_text="" rotatable="true"><font family="Arial" size="4000"/><text color="-900" line_spacing="1" paragraph_spacing="0" character_spacing="0"/></text_symbol></symbol>
</symbols>
<parts count="1" current="0">
<part name="default part"><objects count="1">
<object type="4" symbol="0" h_align="3" v_align="2"><coords count="1">-82334 -48780;</coords><text>I like texting</text></object>
</objects></part>
</parts>
<templates count="0" first_front_template="0">
<defaults use_meters_per_pixel="true" meters_per_pixel="0" dpi="0" scale="0"/>
</templates>
<view>
<grid color="#80646464" display="0" alignment="0" additional_rotation="0" unit="1" h_spacing="500" v_spacing="500" h_offset="0" v_offset="0" snapping_enabled="true"/>
<map_view zoom="3.74293" position_x="-62348" position_y="-44393"><map opacity="1" visible="true"/><templates count="0"/></map_view>
</view>
</barrier>
</map>

@lpechacek
Copy link
Member Author

lpechacek commented Dec 23, 2021

This is the murder weapon:

<object type="4" symbol="-4" h_align="0" v_align="0"><coords count="1">10720 -82640;</coords><text>b</text></object>

Symbol number -4 is the hardcoded number for undefined text symbol. The root cause of this issue is that the .ocd exporter routines do not handle objects with undefined symbols.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant