namespace oox::shape
{
WordprocessingCanvasContext::WordprocessingCanvasContext(FragmentHandler2 const& rParent, const css::awt::Size& rSize)
: FragmentHandler2(rParent)
, m_bFullWPGSupport(true)
{
mpShapePtr = std::make_shared<oox::drawingml::Shape>(u"com.sun.star.drawing.GroupShape"_ustr);
mpShapePtr->setSize(rSize);
mpShapePtr->setWordprocessingCanvas(true); // will be "WordprocessingCanvas" in InteropGrabBag
mpShapePtr->setWps(true);
oox::drawingml::ShapePtr pBackground
= std::make_shared<oox::drawingml::Shape>(u"com.sun.star.drawing.CustomShape"_ustr);
pBackground->getCustomShapeProperties()->setShapePresetType(XML_rect);
pBackground->setSize(rSize);
pBackground->setWordprocessingCanvas(true);
pBackground->setWPGChild(true);
pBackground->setWps(true); // Fill and Line properties will follow in wpc:bg and wpc:whole child elements of wpc element
mpShapePtr->addChild(pBackground);
mpShapePtr->setChildSize(rSize);
}
::oox::core::ContextHandlerRef
WordprocessingCanvasContext::onCreateContext(sal_Int32 nElementToken, const ::oox::AttributeList& /*rAttribs*/)
{ switch (getBaseToken(nElementToken))
{ case XML_wpc:
SAL_INFO("oox", "WordprocessingCanvasContext::createFastChildContext: wpc: "
<< getBaseToken(nElementToken)); break; case XML_bg: //CT_BackgroundFormatting returnnew oox::drawingml::ShapePropertiesContext(*this,
*(getShape()->getChildren().front())); case XML_whole: // CT_WholeE2oFormatting returnnew oox::drawingml::ShapePropertiesContext(*this,
*(getShape()->getChildren().front())); case XML_wsp: // CT_WordprocessingShape
{
oox::drawingml::ShapePtr pShape = std::make_shared<oox::drawingml::Shape>(
u"com.sun.star.drawing.CustomShape"_ustr, /*bDefaultHeight=*/false); returnnew oox::shape::WpsContext(*this, uno::Reference<drawing::XShape>(), mpShapePtr,
pShape);
} case XML_pic: // CT_Picture returnnew oox::drawingml::GraphicShapeContext(
*this, mpShapePtr,
std::make_shared<oox::drawingml::Shape>(
u"com.sun.star.drawing.GraphicObjectShape"_ustr)); break; case XML_graphicFrame: // CT_GraphicFrame
SAL_INFO("oox", "WordprocessingCanvasContext::createFastChildContext: ToDo: graphicFrame: "
<< getBaseToken(nElementToken)); break; case XML_wgp: // CT_WordprocessingGroup
{
rtl::Reference<WpgContext> pWPGContext = new oox::shape::WpgContext(*this, mpShapePtr);
pWPGContext->setFullWPGSupport(m_bFullWPGSupport); return pWPGContext;
} default: // includes case XML_contentPart // Word uses this for Ink, as <w14:contentPart r:id="rId4"> for example. Thereby rId4 is // a reference into the 'ink' folder in the docx package. Import of Ink is not // implemented yet. In general it refers to arbitrary XML source.
SAL_WARN("oox", "WordprocessingCanvasContext::createFastChildContext: unhandled element:"
<< getBaseToken(nElementToken)); break;
} return nullptr;
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.