Need help: SVG import
Christina Roßmanith
ChrRossmanith at gmx.de
Fri Apr 27 14:07:09 PDT 2012
That hint helped :-) Now text without any attributes is rendered as well.
Christina
Am 25.04.2012 13:23, schrieb Marco Cecchetti:
>
> After giving a better look, I could have found where the problem is:
> look at the begin of visitElements routine (line 101):
>
> if( xElem->hasAttributes() )
> rFunc(xElem,xElem->getAttributes());
> else
> rFunc(xElem);
>
> The function called in case the element has at least one
> attribute or no atribute at all are different.
>
> In the first case ShapeWritingVisitor method:
> void operator()( const uno::Reference<xml::dom::XElement>& xElem,
> const uno::Reference<xml::dom::XNamedNodeMap>&
> xAttributes );
> is called
>
> in the second case the method invoked is:
>
> void operator()( const uno::Reference<xml::dom::XElement>& )
>
> that has an empty body (line 1204), so when your example is processed
> nothing happens.
>
> The rationale should be that an element without any attribute does
> not bring any info to parse. But for a <text> or <tspan> element is
> different because of the characters included between the start and
> the end tag.
>
> -- Marco
>
>
> On Wed, 25 Apr 2012 13:03:08 +0200, Marco Cecchetti
> <mrcekets at gmail.com> wrote:
>
>>
>>
>> That's odd, saxbuilder should be completely agnostic
>> from a element name point of view.
>> Did you try to print element names xElem->getNodeName() (line 1227)
>> for the broken example ?
>>
>> -- Marco
>>
>>
>> On Wed, 25 Apr 2012 11:48:10 +0200, Noel Grandin
>> <noelgrandin at gmail.com> wrote:
>>
>>> Looks like the code in
>>> unoxml/source/dom/saxbuilder.cxx
>>> converts the SAX event stream into a DOM tree.
>>>
>>> On 2012-04-25 08:34, Christina Rossmanith wrote:
>>>> for the example without "x" and "y" attribute the "case XML_TEXT"
>>>> block is never reached. That's why I'd like to understand where and
>>>> how the tree is built.
>>>>
>>>>
>>> _______________________________________________
>>> LibreOffice mailing list
>>> LibreOffice at lists.freedesktop.org
>>> http://lists.freedesktop.org/mailman/listinfo/libreoffice
>>
>>
>
>
More information about the LibreOffice
mailing list