LibreOffice Module sw (master) 1
|
Handles DOCX export of drawings. More...
#include <docxsdrexport.hxx>
Classes | |
struct | Impl |
Holds data used by DocxSdrExport only. More... | |
Public Member Functions | |
DocxSdrExport (DocxExport &rExport, const sax_fastparser::FSHelperPtr &pSerializer, oox::drawingml::DrawingML *pDrawingML) | |
~DocxSdrExport () | |
void | setSerializer (const sax_fastparser::FSHelperPtr &pSerializer) |
const Size * | getFlyFrameSize () const |
When exporting fly frames, this holds the real size of the frame. More... | |
bool | getTextFrameSyntax () const |
bool | getDMLTextFrameSyntax () const |
rtl::Reference< sax_fastparser::FastAttributeList > & | getFlyAttrList () |
rtl::Reference< sax_fastparser::FastAttributeList > & | getTextboxAttrList () |
Attributes of the next v:textbox element. More... | |
OStringBuffer & | getTextFrameStyle () |
void | setParagraphSdtOpen (bool bParagraphSdtOpen) |
Set if paragraph sdt open in the current drawing. More... | |
bool | IsDrawingOpen () const |
bool | IsDMLAndVMLDrawingOpen () const |
bool | IsParagraphHasDrawing () const |
void | setParagraphHasDrawing (bool bParagraphHasDrawing) |
rtl::Reference< sax_fastparser::FastAttributeList > & | getFlyFillAttrList () |
void | setFlyWrapAttrList (rtl::Reference< sax_fastparser::FastAttributeList > const &pAttrList) |
sax_fastparser::FastAttributeList * | getBodyPrAttrList () |
Attributes of <wps:bodyPr>, used during DML export of text frames. More... | |
rtl::Reference< sax_fastparser::FastAttributeList > & | getDashLineStyle () |
void | startDMLAnchorInline (const SwFrameFormat *pFrameFormat, const Size &rSize) |
void | endDMLAnchorInline (const SwFrameFormat *pFrameFormat) |
void | writeVMLDrawing (const SdrObject *sdrObj, const SwFrameFormat &rFrameFormat) |
Writes a drawing as VML data. More... | |
void | writeDMLDrawing (const SdrObject *pSdrObject, const SwFrameFormat *pFrameFormat, int nAnchorId) |
Writes a drawing as DML. More... | |
void | writeDMLAndVMLDrawing (const SdrObject *sdrObj, const SwFrameFormat &rFrameFormat, int nAnchorId) |
Writes shape in both DML and VML format. More... | |
void | writeDMLEffectLst (const SwFrameFormat &rFrameFormat) |
Write <a:effectLst>, the effect list. More... | |
void | writeDiagram (const SdrObject *sdrObject, const SwFrameFormat &rFrameFormat, int nDiagramId) |
Writes a diagram (smartart). More... | |
void | writeDMLTextFrame (ww8::Frame const *pParentFrame, int nAnchorId, bool bTextBoxOnly=false) |
Writes text frame in DML format. More... | |
void | writeVMLTextFrame (ww8::Frame const *pParentFrame, bool bTextBoxOnly=false) |
Writes text frame in VML format. More... | |
void | writeOnlyTextOfFrame (ww8::Frame const *pParentFrame) |
Writes text from Textbox for <w:framePr> More... | |
void | writeBoxItemLine (const SvxBoxItem &rBox) |
Writes the drawingML <a:ln> markup of a box item. More... | |
Static Public Member Functions | |
static bool | isTextBox (const SwFrameFormat &rFrameFormat) |
Is this a standalone TextFrame, or used as a TextBox of a shape? More... | |
Private Attributes | |
std::unique_ptr< Impl > | m_pImpl |
Handles DOCX export of drawings.
Definition at line 49 of file docxsdrexport.hxx.
DocxSdrExport::DocxSdrExport | ( | DocxExport & | rExport, |
const sax_fastparser::FSHelperPtr & | pSerializer, | ||
oox::drawingml::DrawingML * | pDrawingML | ||
) |
Definition at line 602 of file docxsdrexport.cxx.
References m_pImpl.
|
default |
void DocxSdrExport::endDMLAnchorInline | ( | const SwFrameFormat * | pFrameFormat | ) |
Definition at line 1339 of file docxsdrexport.cxx.
References SwFormat::GetAnchor(), SwFormatAnchor::GetAnchorId(), and m_pImpl.
Referenced by DocxAttributeOutput::FlyFrameGraphic(), writeDiagram(), writeDMLDrawing(), writeDMLTextFrame(), and DocxAttributeOutput::WritePostponedChart().
sax_fastparser::FastAttributeList * DocxSdrExport::getBodyPrAttrList | ( | ) |
Attributes of <wps:bodyPr>, used during DML export of text frames.
Definition at line 654 of file docxsdrexport.cxx.
References m_pImpl.
Referenced by DocxAttributeOutput::FormatBox().
rtl::Reference< sax_fastparser::FastAttributeList > & DocxSdrExport::getDashLineStyle | ( | ) |
Definition at line 659 of file docxsdrexport.cxx.
References m_pImpl.
Referenced by DocxAttributeOutput::FormatBox().
bool DocxSdrExport::getDMLTextFrameSyntax | ( | ) | const |
Definition at line 619 of file docxsdrexport.cxx.
References m_pImpl.
Referenced by DocxAttributeOutput::FormatBackground(), DocxAttributeOutput::FormatBox(), DocxAttributeOutput::FormatFillGradient(), DocxAttributeOutput::FormatFrameSize(), DocxAttributeOutput::FormatHorizOrientation(), DocxAttributeOutput::FormatLRSpace(), DocxAttributeOutput::FormatSurround(), DocxAttributeOutput::FormatULSpace(), DocxAttributeOutput::FormatVertOrientation(), and DocxAttributeOutput::MaybeOutputBrushItem().
rtl::Reference< sax_fastparser::FastAttributeList > & DocxSdrExport::getFlyAttrList | ( | ) |
Definition at line 621 of file docxsdrexport.cxx.
References m_pImpl.
Referenced by DocxAttributeOutput::FormatBackground(), DocxAttributeOutput::FormatBox(), DocxAttributeOutput::FormatFillGradient(), DocxAttributeOutput::FormatFrameSize(), DocxAttributeOutput::FormatHorizOrientation(), DocxAttributeOutput::FormatLRSpace(), DocxAttributeOutput::FormatSurround(), DocxAttributeOutput::FormatULSpace(), DocxAttributeOutput::FormatVertOrientation(), DocxAttributeOutput::Redline(), and DocxAttributeOutput::WriteCollectedParagraphProperties().
rtl::Reference< sax_fastparser::FastAttributeList > & DocxSdrExport::getFlyFillAttrList | ( | ) |
Definition at line 649 of file docxsdrexport.cxx.
References m_pImpl.
Referenced by DocxAttributeOutput::FormatBackground(), and DocxAttributeOutput::FormatFillGradient().
const Size * DocxSdrExport::getFlyFrameSize | ( | ) | const |
When exporting fly frames, this holds the real size of the frame.
Definition at line 615 of file docxsdrexport.cxx.
References m_pImpl.
Referenced by DocxAttributeOutput::FormatFrameSize().
rtl::Reference< sax_fastparser::FastAttributeList > & DocxSdrExport::getTextboxAttrList | ( | ) |
Attributes of the next v:textbox element.
Definition at line 626 of file docxsdrexport.cxx.
References m_pImpl.
Referenced by DocxAttributeOutput::FormatBox().
OStringBuffer & DocxSdrExport::getTextFrameStyle | ( | ) |
Definition at line 631 of file docxsdrexport.cxx.
References m_pImpl.
Referenced by DocxAttributeOutput::FormatFrameSize(), DocxAttributeOutput::FormatHorizOrientation(), DocxAttributeOutput::FormatLRSpace(), DocxAttributeOutput::FormatULSpace(), and DocxAttributeOutput::FormatVertOrientation().
bool DocxSdrExport::getTextFrameSyntax | ( | ) | const |
Definition at line 617 of file docxsdrexport.cxx.
References m_pImpl.
Referenced by DocxAttributeOutput::FormatBackground(), DocxAttributeOutput::FormatBox(), DocxAttributeOutput::FormatFrameSize(), DocxAttributeOutput::FormatHorizOrientation(), DocxAttributeOutput::FormatLRSpace(), DocxAttributeOutput::FormatSurround(), DocxAttributeOutput::FormatULSpace(), and DocxAttributeOutput::FormatVertOrientation().
bool DocxSdrExport::IsDMLAndVMLDrawingOpen | ( | ) | const |
Definition at line 640 of file docxsdrexport.cxx.
References m_pImpl.
Referenced by DocxAttributeOutput::EndParagraph(), DocxAttributeOutput::EndParagraphProperties(), and DocxAttributeOutput::StartParagraph().
bool DocxSdrExport::IsDrawingOpen | ( | ) | const |
Definition at line 633 of file docxsdrexport.cxx.
References m_pImpl.
Referenced by DocxAttributeOutput::WriteFlyFrame(), and DocxAttributeOutput::WritePostponedDMLDrawing().
bool DocxSdrExport::IsParagraphHasDrawing | ( | ) | const |
Definition at line 642 of file docxsdrexport.cxx.
References m_pImpl.
Referenced by DocxAttributeOutput::EndParagraph(), and DocxAttributeOutput::EndRun().
|
static |
Is this a standalone TextFrame, or used as a TextBox of a shape?
Definition at line 2193 of file docxsdrexport.cxx.
References SwTextBoxHelper::isTextBox(), and RES_FLYFRMFMT().
Referenced by DocxAttributeOutput::WriteFlyFrame().
void DocxSdrExport::setFlyWrapAttrList | ( | rtl::Reference< sax_fastparser::FastAttributeList > const & | pAttrList | ) |
Definition at line 664 of file docxsdrexport.cxx.
References m_pImpl.
Referenced by DocxAttributeOutput::FormatSurround().
void DocxSdrExport::setParagraphHasDrawing | ( | bool | bParagraphHasDrawing | ) |
Definition at line 644 of file docxsdrexport.cxx.
References m_pImpl.
Referenced by DocxAttributeOutput::EndParagraph().
void DocxSdrExport::setParagraphSdtOpen | ( | bool | bParagraphSdtOpen | ) |
Set if paragraph sdt open in the current drawing.
Definition at line 635 of file docxsdrexport.cxx.
References m_pImpl.
Referenced by DocxAttributeOutput::EndParagraph().
void DocxSdrExport::setSerializer | ( | const sax_fastparser::FSHelperPtr & | pSerializer | ) |
Definition at line 610 of file docxsdrexport.cxx.
References m_pImpl.
void DocxSdrExport::startDMLAnchorInline | ( | const SwFrameFormat * | pFrameFormat, |
const Size & | rSize | ||
) |
Sizes of integral types climits header defines constants with the limits of integral types for the specific system and compiler implementation used. Use of this might cause platform dependent problem like posOffset exceed the limit.
Extent width is of type long ( i.e cx & cy ) as
per ECMA-376, Second Edition, Part 1 - Fundamentals And Markup Language Reference [ 20.4.2.7 extent (Drawing Object Size)]
cy is of type a:ST_PositiveCoordinate. Minimum inclusive: 0 Maximum inclusive: 27273042316900
reference : http://www.schemacentral.com/sc/ooxml/e-wp_extent-1.html
Though ECMA mentions the max value as aforementioned. It appears that MSO does not handle for the same, in fact it actually can handle a max value of int32 i.e 2147483647( MAX_INTEGER_VALUE ). Therefore changing the following accordingly so that LO sync's up with MSO.
Definition at line 670 of file docxsdrexport.cxx.
References abs(), sw::util::CorrectWordWrapPolygonForExport(), tools::PolyPolygon::Count(), sax_fastparser::FastSerializerHelper::createAttrList(), comphelper::SequenceAsHashMap::end(), comphelper::SequenceAsHashMap::find(), SwFrameFormat::FindLayoutRect(), SwFrameFormat::FindRealSdrObject(), SwFormatWrapInfluenceOnObjPos::GetAllowOverlap(), SwFormat::GetAnchor(), SwFormatAnchor::GetAnchorId(), SwFormat::GetDoc(), SdrObject::GetGrabBagItem(), IDocumentDrawModelAccess::GetHellId(), SwFormatHoriOrient::GetHoriOrient(), SwFormat::GetHoriOrient(), SwDoc::getIDocumentDrawModelAccess(), IDocumentDrawModelAccess::GetInvisibleHellId(), SdrObject::GetLayer(), SvxLRSpaceItem::GetLeft(), SvxShadowItem::GetLocation(), SvxULSpaceItem::GetLower(), SwFormat::GetLRSpace(), sw::util::GetNoTextNodeFromSwFrameFormat(), SdrObject::GetObjIdentifier(), SwFormat::GetOpaque(), SdrObject::GetOrdNum(), tools::Polygon::GetPoint(), SwFormatVertOrient::GetPos(), SwFormatHoriOrient::GetPos(), SwFormatVertOrient::GetRelationOrient(), SwFormatHoriOrient::GetRelationOrient(), SvxLRSpaceItem::GetRight(), SdrObject::GetRotateAngle(), SwFormat::GetShadow(), tools::Polygon::GetSize(), SwFormatSurround::GetSurround(), SwFormat::GetSurround(), SwFormat::GetULSpace(), SvxULSpaceItem::GetUpper(), SfxEnumItem< typename EnumT >::GetValue(), SwFormatVertOrient::GetVertOrient(), SwFormat::GetVertOrient(), SvxShadowItem::GetWidth(), SwFormat::GetWrapInfluenceOnObjPos(), Point::getX(), Point::getY(), Size::Height(), SwRect::Height(), i, SwFormatSurround::IsContour(), SwFormatSurround::IsOutside(), m_pImpl, min(), round, SAL_MAX_INT32, SAL_MIN_INT32, Size::Width(), SwRect::Width(), X, and Y.
Referenced by DocxAttributeOutput::FlyFrameGraphic(), writeDiagram(), writeDMLDrawing(), writeDMLTextFrame(), and DocxAttributeOutput::WritePostponedChart().
void DocxSdrExport::writeBoxItemLine | ( | const SvxBoxItem & | rBox | ) |
Writes the drawingML <a:ln> markup of a box item.
Definition at line 1735 of file docxsdrexport.cxx.
References editeng::ConvertBorderWidthToWord(), msfilter::util::ConvertColor(), editeng::SvxBorderLine::GetBorderLineStyle(), SvxBoxItem::GetBottom(), editeng::SvxBorderLine::GetColor(), SvxBoxItem::GetLeft(), SvxBoxItem::GetRight(), SvxBoxItem::GetTop(), editeng::SvxBorderLine::GetWidth(), SvxBorderLineWidth::Hairline, m_pImpl, and sColor.
Referenced by DocxAttributeOutput::FlyFrameGraphic(), and DocxAttributeOutput::FormatBox().
void DocxSdrExport::writeDiagram | ( | const SdrObject * | sdrObject, |
const SwFrameFormat & | rFrameFormat, | ||
int | nDiagramId | ||
) |
Writes a diagram (smartart).
Definition at line 1702 of file docxsdrexport.cxx.
References endDMLAnchorInline(), tools::Rectangle::getOpenHeight(), tools::Rectangle::getOpenWidth(), SdrObject::GetSnapRect(), m_pImpl, and startDMLAnchorInline().
Referenced by DocxAttributeOutput::WriteFlyFrame(), and DocxAttributeOutput::WritePostponedDiagram().
void DocxSdrExport::writeDMLAndVMLDrawing | ( | const SdrObject * | sdrObj, |
const SwFrameFormat & | rFrameFormat, | ||
int | nAnchorId | ||
) |
Writes shape in both DML and VML format.
Definition at line 1601 of file docxsdrexport.cxx.
References EscherPropertyContainer::GetCustomShapeType(), msfilter::util::HasTextBoxContent(), DocxSdrExport::Impl::isSupportedDMLShape(), lcl_isLockedCanvas(), m_pImpl, writeDMLDrawing(), and writeVMLDrawing().
Referenced by DocxAttributeOutput::WriteFlyFrame(), DocxAttributeOutput::WritePostponedCustomShape(), and DocxAttributeOutput::WritePostponedDMLDrawing().
void DocxSdrExport::writeDMLDrawing | ( | const SdrObject * | pSdrObject, |
const SwFrameFormat * | pFrameFormat, | ||
int | nAnchorId | ||
) |
Writes a drawing as DML.
Definition at line 1406 of file docxsdrexport.cxx.
References AddExtLst(), sax_fastparser::FastSerializerHelper::createAttrList(), endDMLAnchorInline(), FSNS(), SwFormat::GetAnchor(), SwFormatAnchor::GetAnchorId(), SdrObject::GetDescription(), SwFormat::GetDoc(), SdrObject::getHyperlink(), SdrObject::GetLogicRect(), SdrObject::GetName(), tools::Rectangle::getOpenHeight(), tools::Rectangle::getOpenWidth(), SwDoc::GetPageDesc(), oox::getRelationship(), SdrObject::GetRelativeHeight(), SdrObject::GetRelativeHeightRelation(), SdrObject::GetRelativeWidth(), SdrObject::GetRelativeWidthRelation(), SdrObject::GetTitle(), oox::drawingml::URLTransformer::getTransformedString(), SwPageDesc::GetUseOn(), oox::drawingml::URLTransformer::isExternalURL(), DocxSdrExport::Impl::isSupportedDMLShape(), SdrObject::IsVisible(), lcl_isLockedCanvas(), m_pImpl, Mirror, oox::drawingml::PER_PERCENT, and startDMLAnchorInline().
Referenced by writeDMLAndVMLDrawing(), DocxAttributeOutput::WriteFlyFrame(), DocxAttributeOutput::WritePostponedCustomShape(), and DocxAttributeOutput::WritePostponedDMLDrawing().
void DocxSdrExport::writeDMLEffectLst | ( | const SwFrameFormat & | rFrameFormat | ) |
Write <a:effectLst>, the effect list.
Definition at line 1652 of file docxsdrexport.cxx.
References msfilter::util::ConvertColor(), SvxShadowItem::GetColor(), SvxShadowItem::GetLocation(), SwFormat::GetShadow(), SvxShadowItem::GetWidth(), lcl_TransparencyToDrawingMlAlpha(), and m_pImpl.
Referenced by DocxAttributeOutput::FlyFrameGraphic(), and writeDMLTextFrame().
void DocxSdrExport::writeDMLTextFrame | ( | ww8::Frame const * | pParentFrame, |
int | nAnchorId, | ||
bool | bTextBoxOnly = false |
||
) |
Writes text frame in DML format.
Definition at line 1783 of file docxsdrexport.cxx.
References sax_fastparser::FastSerializerHelper::createAttrList(), endDMLAnchorInline(), SwNode::EndOfSectionIndex(), oox::drawingml::ExportRotateClockwisify(), SwFrameFormat::FindRealSdrObject(), FSNS(), sw::proofreadingiterator::get(), SwFormat::GetContent(), SwFormatContent::GetContentIdx(), SwFormat::GetFrameDir(), ww8::Frame::GetFrameFormat(), SwFormat::GetFrameSize(), SwFormatFrameSize::GetHeightPercent(), SwFormatFrameSize::GetHeightPercentRelation(), SwFormatFrameSize::GetHeightSizeType(), SwNodeIndex::GetIndex(), SwFormat::GetName(), SwNodeIndex::GetNode(), oox::getRelationship(), ww8::Frame::GetSize(), oox::drawingml::GetTextVerticalAdjust(), oox::drawingml::URLTransformer::getTransformedString(), SwFormatFrameSize::GetWidthPercent(), SwFormatFrameSize::GetWidthPercentRelation(), Size::Height(), oox::drawingml::URLTransformer::isExternalURL(), m_pImpl, oox::drawingml::PER_PERCENT, startDMLAnchorInline(), SwFormatFrameSize::SYNCED, TXT_TXTBOX, uno::Any::Value, Variable, Size::Width(), and writeDMLEffectLst().
Referenced by DocxAttributeOutput::EndParagraph(), and DocxAttributeOutput::WriteTextBox().
void DocxSdrExport::writeOnlyTextOfFrame | ( | ww8::Frame const * | pParentFrame | ) |
Writes text from Textbox for <w:framePr>
Definition at line 1718 of file docxsdrexport.cxx.
References sax_fastparser::FastSerializerHelper::createAttrList(), SwNode::EndOfSectionIndex(), sw::proofreadingiterator::get(), SwFormat::GetContent(), SwFormatContent::GetContentIdx(), ww8::Frame::GetFrameFormat(), SwNodeIndex::GetIndex(), SwNodeIndex::GetNode(), m_pImpl, and TXT_TXTBOX.
Referenced by DocxAttributeOutput::EndParagraph().
void DocxSdrExport::writeVMLDrawing | ( | const SdrObject * | sdrObj, |
const SwFrameFormat & | rFrameFormat | ||
) |
Writes a drawing as VML data.
Definition at line 1356 of file docxsdrexport.cxx.
References SwFormat::GetFollowTextFlow(), SwFormatHoriOrient::GetHoriOrient(), SwFormat::GetHoriOrient(), SwFormatVertOrient::GetRelationOrient(), SwFormatHoriOrient::GetRelationOrient(), SwFormat::GetSurround(), SfxBoolItem::GetValue(), SwFormatVertOrient::GetVertOrient(), SwFormat::GetVertOrient(), m_pImpl, and docx::SurroundToVMLWrap().
Referenced by writeDMLAndVMLDrawing().
void DocxSdrExport::writeVMLTextFrame | ( | ww8::Frame const * | pParentFrame, |
bool | bTextBoxOnly = false |
||
) |
Writes text frame in VML format.
Definition at line 2087 of file docxsdrexport.cxx.
References sax_fastparser::FastSerializerHelper::createAttrList(), SwNode::EndOfSectionIndex(), SwFrameFormat::FindRealSdrObject(), SwFormat::GetContent(), SwFormatContent::GetContentIdx(), ww8::Frame::GetFrameFormat(), SwNodeIndex::GetIndex(), SwNodeIndex::GetNode(), ww8::Frame::GetSize(), m_pImpl, pObject, toDegrees(), and TXT_TXTBOX.
Referenced by DocxAttributeOutput::EndParagraph(), and DocxAttributeOutput::WriteVMLTextBox().
|
private |
Definition at line 52 of file docxsdrexport.hxx.
Referenced by endDMLAnchorInline(), getBodyPrAttrList(), getDashLineStyle(), getDMLTextFrameSyntax(), getFlyAttrList(), getFlyFillAttrList(), getFlyFrameSize(), getTextboxAttrList(), getTextFrameStyle(), getTextFrameSyntax(), IsDMLAndVMLDrawingOpen(), IsDrawingOpen(), IsParagraphHasDrawing(), setFlyWrapAttrList(), setParagraphHasDrawing(), setParagraphSdtOpen(), setSerializer(), startDMLAnchorInline(), writeBoxItemLine(), writeDiagram(), writeDMLAndVMLDrawing(), writeDMLDrawing(), writeDMLEffectLst(), writeDMLTextFrame(), writeOnlyTextOfFrame(), writeVMLDrawing(), and writeVMLTextFrame().