Corrected PresObj Styles

When SdrPresObj's get constructed, e.g. when loading/
opening an Impress, the Styles for the PresObj's
(PresentationObjects) need to be constructed carefully
the same way as in former versions. This is a combination
of creating the SdrObject, adding a Style and setting default
Attributes, combined with in.-between corrections. All these
combinations make these fragile, plus the im/export using
ODF XML format and UNO API. With last SOSaw080 changes
not all places were correctly converted (mainly due to
new timing when and how a SdrObject belongs to a SdrPage).
Corrected this now, checked im/export/echange with
libreoffice-6-0 versions.

Stuff is more complicated that initially thought, see comment
added at AttributeProperties::GetObjectItemSet() for more info.
Adaption of the two UnitTest-Files is explained there, too.

Change-Id: Ia90a37492f3a92030790fbd27b7c532883bce923
Reviewed-on: https://gerrit.libreoffice.org/55029
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Armin Le Grand <Armin.Le.Grand@cib.de>
This commit is contained in:
Armin Le Grand
2018-05-29 20:04:34 +02:00
parent f15c4b0f3c
commit 6ebe8b9068
6 changed files with 59 additions and 58 deletions

View File

@@ -1,6 +1,6 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<XShapes> <XShapes>
<XShape positionX="2823" positionY="-75" sizeX="19753" sizeY="19045" type="com.sun.star.drawing.GraphicObjectShape" name="Picture 5" fontHeight="18.000000" fontColor="ffffffff" textAutoGrowHeight="false" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="BLOCK" textVerticalAdjust="TOP" textLeftDistance="250" textRightDistance="250" textUpperDistance="125" textLowerDistance="125" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" shadow="false" shadowColor="808080" shadowTransparence="0" shadowXDistance="200" shadowYDistance="200" zOrder="0" layerID="0" layerName="layout" visible="true" printable="true" moveProtect="false" sizeProtect="false"> <XShape positionX="2823" positionY="-75" sizeX="19753" sizeY="19045" type="com.sun.star.drawing.GraphicObjectShape" name="Picture 5" fontHeight="18.000000" fontColor="ffffffff" textAutoGrowHeight="false" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="TOP" textLeftDistance="250" textRightDistance="250" textUpperDistance="125" textLowerDistance="125" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" shadow="false" shadowColor="808080" shadowTransparence="0" shadowXDistance="200" shadowYDistance="200" zOrder="0" layerID="0" layerName="layout" visible="true" printable="true" moveProtect="false" sizeProtect="false">
<Transformation> <Transformation>
<Line1 column1="19754.000000" column2="0.000000" column3="2823.000000"/> <Line1 column1="19754.000000" column2="0.000000" column3="2823.000000"/>
<Line2 column1="0.000000" column2="19046.000000" column3="-75.000000"/> <Line2 column1="0.000000" column2="19046.000000" column3="-75.000000"/>

View File

@@ -1,6 +1,6 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<XShapes> <XShapes>
<XShape positionX="3680" positionY="2451" sizeX="6" sizeY="2990" type="com.sun.star.drawing.LineShape" name="Straight Connector 3" fontHeight="18.000000" fontColor="ffffffff" textAutoGrowHeight="false" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="BLOCK" textVerticalAdjust="TOP" textLeftDistance="250" textRightDistance="250" textUpperDistance="125" textLowerDistance="125" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID"> <XShape positionX="3680" positionY="2451" sizeX="6" sizeY="2990" type="com.sun.star.drawing.LineShape" name="Straight Connector 3" fontHeight="18.000000" fontColor="ffffffff" textAutoGrowHeight="false" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="TOP" textLeftDistance="250" textRightDistance="250" textUpperDistance="125" textLowerDistance="125" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID">
<LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/> <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
<LineStart> <LineStart>
<pointSequence> <pointSequence>
@@ -35,7 +35,7 @@
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/> <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation> </Transformation>
</XShape> </XShape>
<XShape positionX="4324" positionY="2449" sizeX="5" sizeY="2990" type="com.sun.star.drawing.LineShape" name="Straight Connector 4" fontHeight="18.000000" fontColor="ffffffff" textAutoGrowHeight="false" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="BLOCK" textVerticalAdjust="TOP" textLeftDistance="250" textRightDistance="250" textUpperDistance="125" textLowerDistance="125" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID"> <XShape positionX="4324" positionY="2449" sizeX="5" sizeY="2990" type="com.sun.star.drawing.LineShape" name="Straight Connector 4" fontHeight="18.000000" fontColor="ffffffff" textAutoGrowHeight="false" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="TOP" textLeftDistance="250" textRightDistance="250" textUpperDistance="125" textLowerDistance="125" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID">
<LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/> <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
<LineStart> <LineStart>
<pointSequence> <pointSequence>
@@ -70,7 +70,7 @@
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/> <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation> </Transformation>
</XShape> </XShape>
<XShape positionX="4947" positionY="2449" sizeX="5" sizeY="2990" type="com.sun.star.drawing.LineShape" name="Straight Connector 5" fontHeight="18.000000" fontColor="ffffffff" textAutoGrowHeight="false" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="BLOCK" textVerticalAdjust="TOP" textLeftDistance="250" textRightDistance="250" textUpperDistance="125" textLowerDistance="125" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID"> <XShape positionX="4947" positionY="2449" sizeX="5" sizeY="2990" type="com.sun.star.drawing.LineShape" name="Straight Connector 5" fontHeight="18.000000" fontColor="ffffffff" textAutoGrowHeight="false" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="TOP" textLeftDistance="250" textRightDistance="250" textUpperDistance="125" textLowerDistance="125" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID">
<LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/> <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
<LineStart> <LineStart>
<pointSequence> <pointSequence>
@@ -105,7 +105,7 @@
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/> <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation> </Transformation>
</XShape> </XShape>
<XShape positionX="9401" positionY="2435" sizeX="5" sizeY="2988" type="com.sun.star.drawing.LineShape" name="Straight Connector 6" fontHeight="18.000000" fontColor="ffffffff" textAutoGrowHeight="false" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="BLOCK" textVerticalAdjust="TOP" textLeftDistance="250" textRightDistance="250" textUpperDistance="125" textLowerDistance="125" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID"> <XShape positionX="9401" positionY="2435" sizeX="5" sizeY="2988" type="com.sun.star.drawing.LineShape" name="Straight Connector 6" fontHeight="18.000000" fontColor="ffffffff" textAutoGrowHeight="false" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="TOP" textLeftDistance="250" textRightDistance="250" textUpperDistance="125" textLowerDistance="125" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID">
<LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/> <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
<LineStart> <LineStart>
<pointSequence> <pointSequence>
@@ -140,7 +140,7 @@
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/> <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation> </Transformation>
</XShape> </XShape>
<XShape positionX="10043" positionY="2433" sizeX="5" sizeY="2988" type="com.sun.star.drawing.LineShape" name="Straight Connector 7" fontHeight="18.000000" fontColor="ffffffff" textAutoGrowHeight="false" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="BLOCK" textVerticalAdjust="TOP" textLeftDistance="250" textRightDistance="250" textUpperDistance="125" textLowerDistance="125" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID"> <XShape positionX="10043" positionY="2433" sizeX="5" sizeY="2988" type="com.sun.star.drawing.LineShape" name="Straight Connector 7" fontHeight="18.000000" fontColor="ffffffff" textAutoGrowHeight="false" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="TOP" textLeftDistance="250" textRightDistance="250" textUpperDistance="125" textLowerDistance="125" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID">
<LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/> <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
<LineStart> <LineStart>
<pointSequence> <pointSequence>
@@ -175,7 +175,7 @@
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/> <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation> </Transformation>
</XShape> </XShape>
<XShape positionX="10669" positionY="2435" sizeX="5" sizeY="2990" type="com.sun.star.drawing.LineShape" name="Straight Connector 8" fontHeight="18.000000" fontColor="ffffffff" textAutoGrowHeight="false" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="BLOCK" textVerticalAdjust="TOP" textLeftDistance="250" textRightDistance="250" textUpperDistance="125" textLowerDistance="125" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID"> <XShape positionX="10669" positionY="2435" sizeX="5" sizeY="2990" type="com.sun.star.drawing.LineShape" name="Straight Connector 8" fontHeight="18.000000" fontColor="ffffffff" textAutoGrowHeight="false" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="TOP" textLeftDistance="250" textRightDistance="250" textUpperDistance="125" textLowerDistance="125" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID">
<LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/> <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
<LineStart> <LineStart>
<pointSequence> <pointSequence>
@@ -210,7 +210,7 @@
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/> <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation> </Transformation>
</XShape> </XShape>
<XShape positionX="12466" positionY="2433" sizeX="6" sizeY="2988" type="com.sun.star.drawing.LineShape" name="Straight Connector 9" fontHeight="18.000000" fontColor="ffffffff" textAutoGrowHeight="false" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="BLOCK" textVerticalAdjust="TOP" textLeftDistance="250" textRightDistance="250" textUpperDistance="125" textLowerDistance="125" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID"> <XShape positionX="12466" positionY="2433" sizeX="6" sizeY="2988" type="com.sun.star.drawing.LineShape" name="Straight Connector 9" fontHeight="18.000000" fontColor="ffffffff" textAutoGrowHeight="false" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="TOP" textLeftDistance="250" textRightDistance="250" textUpperDistance="125" textLowerDistance="125" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID">
<LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/> <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
<LineStart> <LineStart>
<pointSequence> <pointSequence>
@@ -245,7 +245,7 @@
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/> <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation> </Transformation>
</XShape> </XShape>
<XShape positionX="13107" positionY="2431" sizeX="5" sizeY="2988" type="com.sun.star.drawing.LineShape" name="Straight Connector 10" fontHeight="18.000000" fontColor="ffffffff" textAutoGrowHeight="false" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="BLOCK" textVerticalAdjust="TOP" textLeftDistance="250" textRightDistance="250" textUpperDistance="125" textLowerDistance="125" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID"> <XShape positionX="13107" positionY="2431" sizeX="5" sizeY="2988" type="com.sun.star.drawing.LineShape" name="Straight Connector 10" fontHeight="18.000000" fontColor="ffffffff" textAutoGrowHeight="false" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="TOP" textLeftDistance="250" textRightDistance="250" textUpperDistance="125" textLowerDistance="125" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID">
<LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/> <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
<LineStart> <LineStart>
<pointSequence> <pointSequence>
@@ -280,7 +280,7 @@
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/> <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation> </Transformation>
</XShape> </XShape>
<XShape positionX="13731" positionY="2431" sizeX="5" sizeY="2988" type="com.sun.star.drawing.LineShape" name="Straight Connector 11" fontHeight="18.000000" fontColor="ffffffff" textAutoGrowHeight="false" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="BLOCK" textVerticalAdjust="TOP" textLeftDistance="250" textRightDistance="250" textUpperDistance="125" textLowerDistance="125" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID"> <XShape positionX="13731" positionY="2431" sizeX="5" sizeY="2988" type="com.sun.star.drawing.LineShape" name="Straight Connector 11" fontHeight="18.000000" fontColor="ffffffff" textAutoGrowHeight="false" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="TOP" textLeftDistance="250" textRightDistance="250" textUpperDistance="125" textLowerDistance="125" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID">
<LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/> <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
<LineStart> <LineStart>
<pointSequence> <pointSequence>
@@ -315,7 +315,7 @@
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/> <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation> </Transformation>
</XShape> </XShape>
<XShape positionX="15872" positionY="2431" sizeX="6" sizeY="2988" type="com.sun.star.drawing.LineShape" name="Straight Connector 12" fontHeight="18.000000" fontColor="ffffffff" textAutoGrowHeight="false" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="BLOCK" textVerticalAdjust="TOP" textLeftDistance="250" textRightDistance="250" textUpperDistance="125" textLowerDistance="125" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID"> <XShape positionX="15872" positionY="2431" sizeX="6" sizeY="2988" type="com.sun.star.drawing.LineShape" name="Straight Connector 12" fontHeight="18.000000" fontColor="ffffffff" textAutoGrowHeight="false" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="TOP" textLeftDistance="250" textRightDistance="250" textUpperDistance="125" textLowerDistance="125" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID">
<LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/> <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
<LineStart> <LineStart>
<pointSequence> <pointSequence>
@@ -350,7 +350,7 @@
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/> <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation> </Transformation>
</XShape> </XShape>
<XShape positionX="16513" positionY="2430" sizeX="5" sizeY="2988" type="com.sun.star.drawing.LineShape" name="Straight Connector 13" fontHeight="18.000000" fontColor="ffffffff" textAutoGrowHeight="false" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="BLOCK" textVerticalAdjust="TOP" textLeftDistance="250" textRightDistance="250" textUpperDistance="125" textLowerDistance="125" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID"> <XShape positionX="16513" positionY="2430" sizeX="5" sizeY="2988" type="com.sun.star.drawing.LineShape" name="Straight Connector 13" fontHeight="18.000000" fontColor="ffffffff" textAutoGrowHeight="false" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="TOP" textLeftDistance="250" textRightDistance="250" textUpperDistance="125" textLowerDistance="125" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID">
<LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/> <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
<LineStart> <LineStart>
<pointSequence> <pointSequence>
@@ -385,7 +385,7 @@
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/> <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation> </Transformation>
</XShape> </XShape>
<XShape positionX="17137" positionY="2430" sizeX="5" sizeY="2988" type="com.sun.star.drawing.LineShape" name="Straight Connector 14" fontHeight="18.000000" fontColor="ffffffff" textAutoGrowHeight="false" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="BLOCK" textVerticalAdjust="TOP" textLeftDistance="250" textRightDistance="250" textUpperDistance="125" textLowerDistance="125" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID"> <XShape positionX="17137" positionY="2430" sizeX="5" sizeY="2988" type="com.sun.star.drawing.LineShape" name="Straight Connector 14" fontHeight="18.000000" fontColor="ffffffff" textAutoGrowHeight="false" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="TOP" textLeftDistance="250" textRightDistance="250" textUpperDistance="125" textLowerDistance="125" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID">
<LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/> <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
<LineStart> <LineStart>
<pointSequence> <pointSequence>
@@ -420,7 +420,7 @@
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/> <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation> </Transformation>
</XShape> </XShape>
<XShape positionX="17772" positionY="2430" sizeX="5" sizeY="2988" type="com.sun.star.drawing.LineShape" name="Straight Connector 15" fontHeight="18.000000" fontColor="ffffffff" textAutoGrowHeight="false" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="BLOCK" textVerticalAdjust="TOP" textLeftDistance="250" textRightDistance="250" textUpperDistance="125" textLowerDistance="125" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID"> <XShape positionX="17772" positionY="2430" sizeX="5" sizeY="2988" type="com.sun.star.drawing.LineShape" name="Straight Connector 15" fontHeight="18.000000" fontColor="ffffffff" textAutoGrowHeight="false" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="TOP" textLeftDistance="250" textRightDistance="250" textUpperDistance="125" textLowerDistance="125" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID">
<LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/> <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
<LineStart> <LineStart>
<pointSequence> <pointSequence>
@@ -455,7 +455,7 @@
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/> <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation> </Transformation>
</XShape> </XShape>
<XShape positionX="6549" positionY="2438" sizeX="6" sizeY="2990" type="com.sun.star.drawing.LineShape" name="Straight Connector 16" fontHeight="18.000000" fontColor="ffffffff" textAutoGrowHeight="false" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="BLOCK" textVerticalAdjust="TOP" textLeftDistance="250" textRightDistance="250" textUpperDistance="125" textLowerDistance="125" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID"> <XShape positionX="6549" positionY="2438" sizeX="6" sizeY="2990" type="com.sun.star.drawing.LineShape" name="Straight Connector 16" fontHeight="18.000000" fontColor="ffffffff" textAutoGrowHeight="false" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="TOP" textLeftDistance="250" textRightDistance="250" textUpperDistance="125" textLowerDistance="125" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID">
<LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/> <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
<LineStart> <LineStart>
<pointSequence> <pointSequence>
@@ -490,7 +490,7 @@
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/> <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation> </Transformation>
</XShape> </XShape>
<XShape positionX="7193" positionY="2435" sizeX="5" sizeY="2990" type="com.sun.star.drawing.LineShape" name="Straight Connector 17" fontHeight="18.000000" fontColor="ffffffff" textAutoGrowHeight="false" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="BLOCK" textVerticalAdjust="TOP" textLeftDistance="250" textRightDistance="250" textUpperDistance="125" textLowerDistance="125" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID"> <XShape positionX="7193" positionY="2435" sizeX="5" sizeY="2990" type="com.sun.star.drawing.LineShape" name="Straight Connector 17" fontHeight="18.000000" fontColor="ffffffff" textAutoGrowHeight="false" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="TOP" textLeftDistance="250" textRightDistance="250" textUpperDistance="125" textLowerDistance="125" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID">
<LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/> <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
<LineStart> <LineStart>
<pointSequence> <pointSequence>
@@ -525,7 +525,7 @@
<Line3 column1="0.000000" column2="0.000000" column3="1.000000"/> <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/>
</Transformation> </Transformation>
</XShape> </XShape>
<XShape positionX="7816" positionY="2435" sizeX="5" sizeY="2990" type="com.sun.star.drawing.LineShape" name="Straight Connector 18" fontHeight="18.000000" fontColor="ffffffff" textAutoGrowHeight="false" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="BLOCK" textVerticalAdjust="TOP" textLeftDistance="250" textRightDistance="250" textUpperDistance="125" textLowerDistance="125" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID"> <XShape positionX="7816" positionY="2435" sizeX="5" sizeY="2990" type="com.sun.star.drawing.LineShape" name="Straight Connector 18" fontHeight="18.000000" fontColor="ffffffff" textAutoGrowHeight="false" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="CENTER" textVerticalAdjust="TOP" textLeftDistance="250" textRightDistance="250" textUpperDistance="125" textLowerDistance="125" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="0" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" lineStyle="SOLID">
<LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/> <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/>
<LineStart> <LineStart>
<pointSequence> <pointSequence>

View File

@@ -233,35 +233,42 @@ namespace sdr
// remember if we had a SfxItemSet already // remember if we had a SfxItemSet already
const bool bHadSfxItemSet(HasSfxItemSet()); const bool bHadSfxItemSet(HasSfxItemSet());
// call parent - this will then guarantee // call parent - this will guarantee SfxItemSet existence
// SfxItemSet existence
DefaultProperties::GetObjectItemSet(); DefaultProperties::GetObjectItemSet();
if(!bHadSfxItemSet) if(!bHadSfxItemSet)
{ {
// SfxItemSet was created and ForceDefaultAttributes() is done. // need to take care for SfxStyleSheet for newly
// We now need to set a default SfxStyleSheet at the SdrObject. This // created SfxItemSet
// is possible now since we always have the SdrModel in SdrObject, if(nullptr == mpStyleSheet)
// so use applyDefaultStyleSheetFromSdrModel() which will do the {
// right thing in each derivation of BaseProperties. // Set missing defaults without removal of hard attributes.
// We also need to 'rescue' mpStyleSheet if it is already set, // This is more complicated historically than I first thought:
// which means a SfxStyleSheet was already set/ocopied but not // Originally for GetDefaultStyleSheetForSdrGrafObjAndSdrOle2Obj
// yet set at the SdrObject. See copy-constructor and how it remembers // SetStyleSheet(..., false) was used, while for GetDefaultStyleSheet
// the SfxStyleSheet there. This time, do not reset the // SetStyleSheet(..., true) was used. Thus, for SdrGrafObj and SdrOle2Obj
// attributes already set - this is done above. // bDontRemoveHardAttr == false -> *do* delete hard attributes was used.
SfxStyleSheet* pImplicitelyAlreadySet(mpStyleSheet); // This was probably not done by purpose, adding the method
// GetDefaultStyleSheetForSdrGrafObjAndSdrOle2Obj additionally to
// Set missing defaults and do RemoveHardAttributes. This is // GetDefaultStyleSheet was an enhancement to allow for SdrGrafObj/SdrOle2Obj
// important, it deletes again the attributes set in // with full AttributeSet (adding e.g. FillAttributes). To stay as compatible
// ForceDefaultAttributes() which are set in the default // as possible these SdrObjects got a new default-StyleSheet.
// SfxStyleSheet. // There is no reason to delete the HardAttributes and it anyways has only
const_cast< AttributeProperties* >(this)->applyDefaultStyleSheetFromSdrModel(); // AFAIK effects on a single Item - the SdrTextHorzAdjustItem. To get things
// unified I will stay with not deleting the HardAttributes and adapt the
if(pImplicitelyAlreadySet) // UnitTests in CppunitTest_sd_import_tests accordingly.
const_cast< AttributeProperties* >(this)->applyDefaultStyleSheetFromSdrModel();
}
else
{ {
// Late-Init of setting parent to SfxStyleSheet after // Late-Init of setting parent to SfxStyleSheet after
// it's creation. // it's creation. Can only happen from copy-constructor
const_cast< AttributeProperties* >(this)->SetStyleSheet(pImplicitelyAlreadySet, true); // (where creation of SfxItemSet is avoided due to the
// problem with constructors and virtual functions in C++),
// thus DontRemoveHardAttr is not needed.
const_cast< AttributeProperties* >(this)->SetStyleSheet(
mpStyleSheet,
true);
} }
} }
@@ -326,11 +333,8 @@ namespace sdr
} }
} }
// set item // guarantee SfxItemSet existence
if(!HasSfxItemSet()) GetObjectItemSet();
{
GetObjectItemSet();
}
if(pResultItem) if(pResultItem)
{ {
@@ -357,11 +361,8 @@ namespace sdr
void AttributeProperties::SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr) void AttributeProperties::SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr)
{ {
// guarantee SfxItemSet existence here // guarantee SfxItemSet existence
if(!HasSfxItemSet()) GetObjectItemSet();
{
GetObjectItemSet();
}
ImpRemoveStyleSheet(); ImpRemoveStyleSheet();
ImpAddStyleSheet(pNewStyleSheet, bDontRemoveHardAttr); ImpAddStyleSheet(pNewStyleSheet, bDontRemoveHardAttr);
@@ -381,11 +382,8 @@ namespace sdr
if(!GetStyleSheet() || dynamic_cast<const SfxStyleSheet *>(mpStyleSheet) == nullptr) if(!GetStyleSheet() || dynamic_cast<const SfxStyleSheet *>(mpStyleSheet) == nullptr)
return; return;
// force SfxItemSet existence // guarantee SfxItemSet existence
if(!HasSfxItemSet()) GetObjectItemSet();
{
GetObjectItemSet();
}
// prepare copied, new itemset, but WITHOUT parent // prepare copied, new itemset, but WITHOUT parent
SfxItemSet* pDestItemSet = new SfxItemSet(*mpItemSet); SfxItemSet* pDestItemSet = new SfxItemSet(*mpItemSet);

View File

@@ -39,7 +39,8 @@ namespace sdr
if(pStyleSheet) if(pStyleSheet)
{ {
SetStyleSheet(pStyleSheet, false); // do not delete hard attributes when setting dsefault Style
SetStyleSheet(pStyleSheet, true);
} }
else else
{ {

View File

@@ -34,7 +34,8 @@ namespace sdr
if(pStyleSheet) if(pStyleSheet)
{ {
SetStyleSheet(pStyleSheet, false); // do not delete hard attributes when setting dsefault Style
SetStyleSheet(pStyleSheet, true);
} }
else else
{ {

View File

@@ -43,7 +43,8 @@ namespace sdr
void BaseProperties::applyDefaultStyleSheetFromSdrModel() void BaseProperties::applyDefaultStyleSheetFromSdrModel()
{ {
SetStyleSheet(GetSdrObject().getSdrModelFromSdrObject().GetDefaultStyleSheet(), false); // do not delete hard attributes when setting dsefault Style
SetStyleSheet(GetSdrObject().getSdrModelFromSdrObject().GetDefaultStyleSheet(), true);
} }
const SdrObject& BaseProperties::GetSdrObject() const const SdrObject& BaseProperties::GetSdrObject() const