suspicious member 'mnDiagramRotation' in class Shape in oox

Regina Henschel rb.henschel at
Fri Jul 15 15:27:13 UTC 2022

Hi all,

The class Shape has a member 'mnDiagramRotation' (#376), which can be 
set by setDiagramRotation() (#164)

It has a comment
    // rotates shape prior to sizing, does not affect text rotation

It is set in

And evaluated in CreateAndInsert() in
886      // Special for SmartArt import. Rotate diagram's shape around 
object's center before sizing.
887      if (bUseRotationTransform && mnDiagramRotation != 0)
888      {
889          aTransformation.translate(-0.5, -0.5);
891          aTransformation.translate(0.5, 0.5);
892      }

and in
1693                  nTextRotateAngle -= mnDiagramRotation;

(1) The comment makes no sense to me. A shape rotation prior to sizing 
is unlikely, because it would introduce shearing of the shape.
(2) Isn't the rotation of the shapes on opening a diagram taken from 
drawing.xml not from layout.xml ?
(3) In all my tests the value of mnDiagramRotation was always zero in 
CreateAndInsert(). In which scenario is
pShape->setDiagramRotation(rAttribs.getInteger(XML_rot, 0) * PER_DEGREE);
in layoutnodecontext.cxx triggert?
(4) Do you have an example file, where mnDiagramRotation has a value 
different from zero?

Kind regards,

More information about the LibreOffice mailing list