understanding ImpForceLineAngle, aGeo and friends

Dr. David Alan Gilbert dave at treblig.org
Sat Jan 2 03:35:03 UTC 2021


Hi,
  I'd appreciate some pointers on shape creation and in
particular why ImpForceLineAngle exists.

  I'm chasing a bug where a line in a docx document ends up 90deg
rotated; it's the docx in https://bugs.documentfoundation.org/show_bug.cgi?id=139297
and 'Shape5' - the vertical line at the left that turns out
to be horizontal.
  (That bug has *lots* of other problems, but mostly related to groups,
which that shape isn't in, and most of the other issues are location/stretching
not transform).

I've convinced myself that the polypoly that Shape::createAndInsert creates
is correct; a nice simple line with the X's the same, and the Y different;

But I'm a bit confused by the call to ImpForceLineAngle - it sets
aGeo.nRotationAngle based on the points in the line and ends
up with it at -9000; if I force that to 0 then my line stays
where I expect it, vertical;  (The fact that this is still
called when I load a similar pptx and it works, confuses me).

  a) What is ImpForceLineAngle for, why calculate an angle
from the line you've just created?
  b) Is that angle supposed to be applied to that line - or
is it intended just for something else ?

Any pointers appreciated!

The ImpForceLineAngle is triggered by createAndInsert's
  PropertySet( xSet ).setProperties( aShapeProps );
call, I think because of the PolyPolygon property.

The trace looks like:
#0  0x00007fa77bd8b530 in SdrPathObj::ImpForceLineAngle() () at /discs/fast/core/instdir/program/libsvxcorelo.so
#1  0x00007fa77bd8c180 in SdrPathObj::ImpForceKind() () at /discs/fast/core/instdir/program/libsvxcorelo.so
#2  0x00007fa77bd8ceab in SdrPathObj::NbcSetPathPoly(basegfx::B2DPolyPolygon const&) () at /discs/fast/core/instdir/program/libsvxcorelo.so
#3  0x00007fa77bd8cf3c in SdrPathObj::SetPathPoly(basegfx::B2DPolyPolygon const&) () at /discs/fast/core/instdir/program/libsvxcorelo.so
#4  0x00007fa77bee71cc in SvxShapePolyPolygon::SetPolygon(basegfx::B2DPolyPolygon const&) () at /discs/fast/core/instdir/program/libsvxcorelo.so
#5  0x00007fa77beeaefb in SvxShapePolyPolygon::setPropertyValueImpl(rtl::OUString const&, SfxItemPropertySimpleEntry const*, com::sun::star::uno::Any const&) ()
    at /discs/fast/core/instdir/program/libsvxcorelo.so
#6  0x00007fa77bf098ab in SvxShape::_setPropertyValue(rtl::OUString const&, com::sun::star::uno::Any const&) () at /discs/fast/core/instdir/program/libsvxcorelo.so
#7  0x00007fa760acb2bf in SwXShape::setPropertyValue(rtl::OUString const&, com::sun::star::uno::Any const&) () at /discs/fast/core/instdir/program/../program/libswlo.so
#8  0x00007fa77bf07e11 in SvxShape::setPropertyValues(com::sun::star::uno::Sequence<rtl::OUString> const&, com::sun::star::uno::Sequence<com::sun::star::uno::Any> const&) ()
    at /discs/fast/core/instdir/program/libsvxcorelo.so
#9  0x00007fa7618fd152 in oox::PropertySet::setProperties(com::sun::star::uno::Sequence<rtl::OUString> const&, com::sun::star::uno::Sequence<com::sun::star::uno::Any> const&) ()
    at /discs/fast/core/instdir/program/../program/libooxlo.so
#10 0x00007fa7618fd274 in oox::PropertySet::setProperties(oox::PropertyMap const&) () at /discs/fast/core/instdir/program/../program/libooxlo.so
#11 0x00007fa7618149d6 in oox::drawingml::Shape::createAndInsert(oox::core::XmlFilterBase&, rtl::OUString const&, oox::drawingml::Theme const*, com::sun::star::uno::Reference<com::sun::star::drawing::XShapes> const&, bool, bool, basegfx::B2DHomMatrix&, oox::drawingml::FillProperties&, bool) () at /discs/fast/core/instdir/program/../program/libooxlo.so
#12 0x00007fa7618226bf in oox::drawingml::Shape::addShape(oox::core::XmlFilterBase&, oox::drawingml::Theme const*, com::sun::star::uno::Reference<com::sun::star::drawing::XShapes> const&, basegfx::B2DHomMatrix const&, oox::drawingml::FillProperties&, std::map<rtl::OUString, std::shared_ptr<oox::drawingml::Shape>, std::less<rtl::OUString>, std::allocator<std::pair<rtl::OUString const, std::shared_ptr<oox::drawingml::Shape> > > >*, bool) () at /discs/fast/core/instdir/program/../program/libooxlo.so
#13 0x00007fa76198891c in oox::shape::ShapeContextHandler::getShape() () at /discs/fast/core/instdir/program/../program/libooxlo.so
#14 0x00007fa75e882417 in writerfilter::ooxml::OOXMLFastContextHandlerShape::sendShape(int) () at /discs/fast/core/instdir/program/../program/libwriterfilterlo.so
#15 0x00007fa75e886391 in writerfilter::ooxml::OOXMLFastContextHandlerShape::lcl_endFastElement(int) () at /discs/fast/core/instdir/program/../program/libwriterfilterlo.so

Thanks for any pointers,

Dave

-- 
 -----Open up your eyes, open up your mind, open up your code -------   
/ Dr. David Alan Gilbert    |       Running GNU/Linux       | Happy  \ 
\        dave @ treblig.org |                               | In Hex /
 \ _________________________|_____ http://www.treblig.org   |_______/


More information about the LibreOffice mailing list