speedata / publisher

speedata Publisher - a professional database Publishing system
https://www.speedata.de/
GNU Affero General Public License v3.0
296 stars 36 forks source link

<NoBreak reduce="fontsize"> does not work with <Value select="…"/> #598

Closed iclukas closed 1 month ago

iclukas commented 1 month ago
<Layout xmlns="urn:speedata.de:2009/publisher/en">
    <Pageformat width="100mm" height="297mm"/>

    <Record element="data">
        <PlaceObject>
            <Textblock>
                <Paragraph>
                    <NoBreak reduce="fontsize">
                        <Value select="'Lorem ipsum dummytext a pretty long line that will have to be scaled down'"/>
                    </NoBreak>
                </Paragraph>
            </Textblock>
        </PlaceObject>
    </Record>
</Layout>

Changing to <Value>Lorem ipsum dummytext a pretty long line that will have to be scaled down</Value> makes it work. But then it’s impossible to use data XML or variables.

pgundlach commented 1 month ago

Will be fixed in 4.19.18, available in a few minutes

iclukas commented 1 month ago

There’s still one minor issue. sp crashes if the value happens to be an empty string.

iclukas commented 1 month ago

More issues:

If sp runs into the 10 loops limit, it crashes. I think it should just issue an error instead.

This also crashes (doesn’t matter if <B> or <NoBreak> is the outer element):

<Layout xmlns="urn:speedata.de:2009/publisher/en">
    <Pageformat width="100mm" height="297mm"/>

    <Record element="data">
        <PlaceObject>
            <Textblock>
                <Paragraph>
                    <NoBreak reduce="fontsize">
                        <B><Value select="'Lorem ipsum dummytext a pretty long line that will have to be scaled down'"/></B>
                    </NoBreak>
                </Paragraph>
            </Textblock>
        </PlaceObject>
    </Record>
</Layout>

These examples worked fine in older versions.