本文整理汇总了C++中KoShapeSavingContext::removeShapeOffset方法的典型用法代码示例。如果您正苦于以下问题:C++ KoShapeSavingContext::removeShapeOffset方法的具体用法?C++ KoShapeSavingContext::removeShapeOffset怎么用?C++ KoShapeSavingContext::removeShapeOffset使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KoShapeSavingContext
的用法示例。
在下文中一共展示了KoShapeSavingContext::removeShapeOffset方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: saveOdf
//.........这里部分代码省略.........
// horizontal-pos
switch (d->horizontalPos) {
case HCenter:
shape()->setAdditionalStyleAttribute("style:horizontal-pos", "center");
break;
case HFromInside:
shape()->setAdditionalStyleAttribute("style:horizontal-pos", "from-inside");
break;
case HFromLeft:
shape()->setAdditionalStyleAttribute("style:horizontal-pos", "from-left");
break;
case HInside:
shape()->setAdditionalStyleAttribute("style:horizontal-posl", "inside");
break;
case HLeft:
shape()->setAdditionalStyleAttribute("style:horizontal-pos", "left");
break;
case HOutside:
shape()->setAdditionalStyleAttribute("style:horizontal-pos", "outside");
break;
case HRight:
shape()->setAdditionalStyleAttribute("style:horizontal-pos", "right");
break;
default:
break;
}
// horizontal-rel
switch (d->horizontalRel) {
case HChar:
shape()->setAdditionalStyleAttribute("style:horizontal-rel", "char");
break;
case HPage:
shape()->setAdditionalStyleAttribute("style:horizontal-rel", "page");
break;
case HPageContent:
shape()->setAdditionalStyleAttribute("style:horizontal-rel", "page-content");
break;
case HPageStartMargin:
shape()->setAdditionalStyleAttribute("style:horizontal-rel", "page-start-margin");
break;
case HPageEndMargin:
shape()->setAdditionalStyleAttribute("style:horizontal-rel", "page-end-margin");
break;
case HFrame:
shape()->setAdditionalStyleAttribute("style:horizontal-rel", "frame");
break;
case HFrameContent:
shape()->setAdditionalStyleAttribute("style:horizontal-rel", "frame-content");
break;
case HFrameEndMargin:
shape()->setAdditionalStyleAttribute("style:horizontal-rel", "frame-end-margin");
break;
case HFrameStartMargin:
shape()->setAdditionalStyleAttribute("style:horizontal-rel", "frame-start-margin");
break;
case HParagraph:
shape()->setAdditionalStyleAttribute("style:horizontal-rel", "paragraph");
break;
case HParagraphContent:
shape()->setAdditionalStyleAttribute("style:horizontal-rel", "paragraph-content");
break;
case HParagraphEndMargin:
shape()->setAdditionalStyleAttribute("style:horizontal-rel", "paragraph-end-margin");
break;
case HParagraphStartMargin:
shape()->setAdditionalStyleAttribute("style:horizontal-rel", "paragraph-start-margin");
break;
default:
break;
}
if (!d->wrapInfluenceOnPosition.isEmpty()) {
shape()->setAdditionalStyleAttribute("draw:wrap-influence-on-position", d->wrapInfluenceOnPosition);
}
if (d->flowWithText) {
shape()->setAdditionalStyleAttribute("style:flow-with-text", "true");
} else {
shape()->setAdditionalStyleAttribute("style:flow-with-text", "false");
}
if (shape()->parent()) {// an anchor may not yet have been layout-ed
QTransform parentMatrix = shape()->parent()->absoluteTransformation(0).inverted();
QTransform shapeMatrix = shape()->absoluteTransformation(0);;
qreal dx = d->offset.x() - shapeMatrix.dx()*parentMatrix.m11()
- shapeMatrix.dy()*parentMatrix.m21();
qreal dy = d->offset.y() - shapeMatrix.dx()*parentMatrix.m12()
- shapeMatrix.dy()*parentMatrix.m22();
context.addShapeOffset(shape(), QTransform(parentMatrix.m11(),parentMatrix.m12(),
parentMatrix.m21(),parentMatrix.m22(),
dx,dy));
}
shape()->saveOdf(context);
context.removeShapeOffset(shape());
}