LibreOffice Module writerfilter (master) 1
Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
writerfilter::rtftok::RTFSdrImport Class Referencefinal

Handles the import of drawings using RTF markup. More...

#include <rtfsdrimport.hxx>

Inheritance diagram for writerfilter::rtftok::RTFSdrImport:
[legend]
Collaboration diagram for writerfilter::rtftok::RTFSdrImport:
[legend]

Public Types

enum  ShapeOrPict {
  SHAPE ,
  PICT
}
 

Public Member Functions

 RTFSdrImport (RTFDocumentImpl &rDocument, css::uno::Reference< css::lang::XComponent > const &xDstDoc)
 
 ~RTFSdrImport () override
 
void resolve (RTFShape &rShape, bool bClose, ShapeOrPict shapeOrPict)
 
void close ()
 
void append (std::u16string_view aKey, std::u16string_view aValue)
 
void appendGroupProperty (std::u16string_view aKey, std::u16string_view aValue)
 Append property on the current parent. More...
 
void resolveDhgt (css::uno::Reference< css::beans::XPropertySet > const &xPropertySet, sal_Int32 nZOrder, bool bOldStyle)
 
void pushParent (css::uno::Reference< css::drawing::XShapes > const &xParent)
 Push a new group shape to the parent stack. More...
 
void popParent ()
 Pop the current group shape from the parent stack. More...
 
css::uno::Reference< css::drawing::XShape > const & getCurrentShape () const
 
bool isFakePict () const
 
- Public Member Functions inherited from SvRefBase
 SvRefBase ()
 
 SvRefBase (const SvRefBase &)
 
SvRefBaseoperator= (const SvRefBase &)
 
void RestoreNoDelete ()
 
void AddNextRef ()
 
void AddFirstRef ()
 
void ReleaseRef ()
 
unsigned int GetRefCount () const
 

Static Public Member Functions

static void resolveLineColorAndWidth (bool bTextFrame, const css::uno::Reference< css::beans::XPropertySet > &xPropertySet, css::uno::Any const &rLineColor, css::uno::Any const &rLineWidth)
 Set line color and line width on the shape, using the relevant API depending on if the shape is a text frame or not. More...
 
static void resolveFLine (css::uno::Reference< css::beans::XPropertySet > const &xPropertySet, sal_Int32 nFLine)
 
static std::vector< css::beans::PropertyValue > getTextFrameDefaults (bool bNew)
 These are the default in Word, but not in Writer. More...
 

Private Member Functions

void createShape (const OUString &rService, css::uno::Reference< css::drawing::XShape > &xShape, css::uno::Reference< css::beans::XPropertySet > &xPropertySet)
 
void applyProperty (css::uno::Reference< css::drawing::XShape > const &xShape, std::u16string_view aKey, std::u16string_view aValue) const
 
int initShape (css::uno::Reference< css::drawing::XShape > &o_xShape, css::uno::Reference< css::beans::XPropertySet > &o_xPropSet, bool &o_rIsCustomShape, RTFShape const &rShape, bool bClose, ShapeOrPict shapeOrPict)
 

Private Attributes

RTFDocumentImplm_rImport
 
std::stack< css::uno::Reference< css::drawing::XShapes > > m_aParents
 
css::uno::Reference< css::drawing::XShape > m_xShape
 
bool m_bTextFrame
 If m_xShape is imported as a Writer text frame (instead of a drawinglayer rectangle). More...
 
bool m_bTextGraphicObject
 If m_xShape is imported as a Writer text graphic object (instead of a drawinglayer shape). More...
 
bool m_bFakePict
 if inside \pict, but actually it's a shape (not a picture) More...
 
std::stack< writerfilter::dmapper::GraphicZOrderHelperm_aGraphicZOrderHelpers
 

Additional Inherited Members

- Protected Member Functions inherited from SvRefBase
virtual ~SvRefBase () COVERITY_NOEXCEPT_FALSE
 

Detailed Description

Handles the import of drawings using RTF markup.

Definition at line 42 of file rtfsdrimport.hxx.

Member Enumeration Documentation

◆ ShapeOrPict

Enumerator
SHAPE 
PICT 

Definition at line 49 of file rtfsdrimport.hxx.

Constructor & Destructor Documentation

◆ RTFSdrImport()

writerfilter::rtftok::RTFSdrImport::RTFSdrImport ( RTFDocumentImpl rDocument,
css::uno::Reference< css::lang::XComponent > const &  xDstDoc 
)

Definition at line 59 of file rtfsdrimport.cxx.

References m_aGraphicZOrderHelpers, m_aParents, and m_rImport.

◆ ~RTFSdrImport()

writerfilter::rtftok::RTFSdrImport::~RTFSdrImport ( )
override

Definition at line 72 of file rtfsdrimport.cxx.

References m_aGraphicZOrderHelpers, and m_aParents.

Member Function Documentation

◆ append()

void writerfilter::rtftok::RTFSdrImport::append ( std::u16string_view  aKey,
std::u16string_view  aValue 
)

Definition at line 1166 of file rtfsdrimport.cxx.

References applyProperty(), and m_xShape.

◆ appendGroupProperty()

void writerfilter::rtftok::RTFSdrImport::appendGroupProperty ( std::u16string_view  aKey,
std::u16string_view  aValue 
)

Append property on the current parent.

Definition at line 1171 of file rtfsdrimport.cxx.

References applyProperty(), and m_aParents.

◆ applyProperty()

void writerfilter::rtftok::RTFSdrImport::applyProperty ( css::uno::Reference< css::drawing::XShape > const &  xShape,
std::u16string_view  aKey,
std::u16string_view  aValue 
) const
private

Definition at line 191 of file rtfsdrimport.cxx.

References get(), m_bTextFrame, NormAngle36000(), RTF_MULTIPLIER, o3tl::toInt32(), and u.

Referenced by append(), appendGroupProperty(), and resolve().

◆ close()

void writerfilter::rtftok::RTFSdrImport::close ( )

◆ createShape()

void writerfilter::rtftok::RTFSdrImport::createShape ( const OUString &  rService,
css::uno::Reference< css::drawing::XShape > &  xShape,
css::uno::Reference< css::beans::XPropertySet > &  xPropertySet 
)
private

Definition at line 80 of file rtfsdrimport.cxx.

References writerfilter::rtftok::RTFDocumentImpl::getModelFactory(), and m_rImport.

Referenced by initShape().

◆ getCurrentShape()

css::uno::Reference< css::drawing::XShape > const & writerfilter::rtftok::RTFSdrImport::getCurrentShape ( ) const
inline

Definition at line 78 of file rtfsdrimport.hxx.

References m_xShape.

◆ getTextFrameDefaults()

std::vector< beans::PropertyValue > writerfilter::rtftok::RTFSdrImport::getTextFrameDefaults ( bool  bNew)
static

These are the default in Word, but not in Writer.

Parameters
bNewif the frame is new-style or old-style.

Definition at line 88 of file rtfsdrimport.cxx.

References writerfilter::dmapper::FRAME, and writerfilter::dmapper::NONE.

Referenced by writerfilter::rtftok::RTFDocumentImpl::dispatchFlag(), and initShape().

◆ initShape()

int writerfilter::rtftok::RTFSdrImport::initShape ( css::uno::Reference< css::drawing::XShape > &  o_xShape,
css::uno::Reference< css::beans::XPropertySet > &  o_xPropSet,
bool &  o_rIsCustomShape,
RTFShape const &  rShape,
bool  bClose,
ShapeOrPict  shapeOrPict 
)
private

◆ isFakePict()

bool writerfilter::rtftok::RTFSdrImport::isFakePict ( ) const
inline

Definition at line 79 of file rtfsdrimport.hxx.

References m_bFakePict.

◆ popParent()

void writerfilter::rtftok::RTFSdrImport::popParent ( )

Pop the current group shape from the parent stack.

Definition at line 136 of file rtfsdrimport.cxx.

References m_aGraphicZOrderHelpers, and m_aParents.

◆ pushParent()

void writerfilter::rtftok::RTFSdrImport::pushParent ( css::uno::Reference< css::drawing::XShapes > const &  xParent)

Push a new group shape to the parent stack.

Definition at line 130 of file rtfsdrimport.cxx.

References m_aGraphicZOrderHelpers, and m_aParents.

◆ resolve()

void writerfilter::rtftok::RTFSdrImport::resolve ( RTFShape rShape,
bool  bClose,
ShapeOrPict  shapeOrPict 
)

Definition at line 354 of file rtfsdrimport.cxx.

References Point::AdjustX(), Point::AdjustY(), basegfx::B2DPolygon::append(), applyProperty(), aSegments, msfilter::util::BGRToRGB(), COL_BLACK(), ColorTransparency, comphelper::containerToSequence(), msfilter::util::ConvertColorOU(), convertTwipToMm100(), writerfilter::Stream::endShape(), ESCHER_ShpInst_Line, ESCHER_ShpInst_PictureFrame, writerfilter::dmapper::FRAME, writerfilter::rtftok::RTFShape::getAnchorAttributes(), comphelper::SequenceAsHashMap::getAsConstPropertyValueList(), basegfx::B2DPolygon::getB2DPoint(), writerfilter::rtftok::RTFShape::getBottom(), writerfilter::rtftok::RTFDocumentImpl::getGraphicHelper(), writerfilter::rtftok::RTFShape::getHoriOrientRelation(), writerfilter::rtftok::RTFShape::getLeft(), writerfilter::rtftok::RTFDocumentImpl::getModelFactory(), writerfilter::rtftok::RTFShape::getProperties(), writerfilter::rtftok::RTFShape::getRight(), SdrObject::getSdrObjectFromXShape(), o3tl::getToken(), writerfilter::rtftok::RTFShape::getTop(), writerfilter::rtftok::RTFShape::getVertOrientRelation(), writerfilter::rtftok::RTFShape::getWrap(), writerfilter::rtftok::RTFShape::getWrapPolygonSprms(), basegfx::Tuple2D< typename TYPE >::getX(), basegfx::Tuple2D< typename TYPE >::getY(), writerfilter::rtftok::RTFShape::getZ(), writerfilter::rtftok::RTFShape::hasZ(), i, comphelper::InitPropertySequence(), initShape(), writerfilter::rtftok::RTFDocumentImpl::isInBackground(), m_aParents, m_bTextFrame, m_bTextGraphicObject, m_rImport, m_xShape, writerfilter::rtftok::RTFDocumentImpl::Mapper(), oox::vml::ShadowModel::mbHasShadow, oox::vml::FillModel::moColor, oox::vml::ShadowModel::moColor, oox::vml::FillModel::moColor2, oox::vml::FillModel::moFocus, oox::vml::ShadowModel::moOffset, oox::vml::FillModel::moType, nCount, writerfilter::rtftok::NO_APPEND, writerfilter::dmapper::NONE, nType, pObject, writerfilter::Stream::props(), oox::vml::FillModel::pushToPropMap(), oox::vml::ShadowModel::pushToPropMap(), resolveDhgt(), resolveFLine(), resolveLineColorAndWidth(), writerfilter::rtftok::RTFDocumentImpl::resolvePict(), RTF_MULTIPLIER, SAL_INFO, SAL_WARN, basegfx::B2DHomMatrix::scale(), writerfilter::rtftok::RTFSprms::set(), writerfilter::rtftok::RTFShape::setBottom(), writerfilter::rtftok::RTFDocumentImpl::setDestinationText(), writerfilter::rtftok::RTFShape::setHoriOrientRelation(), oox::PropertySet::setProperties(), writerfilter::rtftok::RTFShape::setRight(), writerfilter::rtftok::RTFShape::setVertOrientRelation(), writerfilter::Stream::startShape(), o3tl::toInt32(), and basegfx::B2DPolygon::transform().

◆ resolveDhgt()

void writerfilter::rtftok::RTFSdrImport::resolveDhgt ( css::uno::Reference< css::beans::XPropertySet > const &  xPropertySet,
sal_Int32  nZOrder,
bool  bOldStyle 
)

◆ resolveFLine()

void writerfilter::rtftok::RTFSdrImport::resolveFLine ( css::uno::Reference< css::beans::XPropertySet > const &  xPropertySet,
sal_Int32  nFLine 
)
static

◆ resolveLineColorAndWidth()

void writerfilter::rtftok::RTFSdrImport::resolveLineColorAndWidth ( bool  bTextFrame,
const css::uno::Reference< css::beans::XPropertySet > &  xPropertySet,
css::uno::Any const &  rLineColor,
css::uno::Any const &  rLineWidth 
)
static

Set line color and line width on the shape, using the relevant API depending on if the shape is a text frame or not.

Definition at line 155 of file rtfsdrimport.cxx.

References uno::Any::hasValue().

Referenced by writerfilter::rtftok::RTFDocumentImpl::beforePopState(), and resolve().

Member Data Documentation

◆ m_aGraphicZOrderHelpers

std::stack<writerfilter::dmapper::GraphicZOrderHelper> writerfilter::rtftok::RTFSdrImport::m_aGraphicZOrderHelpers
private

Definition at line 99 of file rtfsdrimport.hxx.

Referenced by popParent(), pushParent(), resolveDhgt(), RTFSdrImport(), and ~RTFSdrImport().

◆ m_aParents

std::stack<css::uno::Reference<css::drawing::XShapes> > writerfilter::rtftok::RTFSdrImport::m_aParents
private

◆ m_bFakePict

bool writerfilter::rtftok::RTFSdrImport::m_bFakePict
private

if inside \pict, but actually it's a shape (not a picture)

Definition at line 98 of file rtfsdrimport.hxx.

Referenced by initShape(), and isFakePict().

◆ m_bTextFrame

bool writerfilter::rtftok::RTFSdrImport::m_bTextFrame
private

If m_xShape is imported as a Writer text frame (instead of a drawinglayer rectangle).

Definition at line 94 of file rtfsdrimport.hxx.

Referenced by applyProperty(), initShape(), and resolve().

◆ m_bTextGraphicObject

bool writerfilter::rtftok::RTFSdrImport::m_bTextGraphicObject
private

If m_xShape is imported as a Writer text graphic object (instead of a drawinglayer shape).

Definition at line 96 of file rtfsdrimport.hxx.

Referenced by initShape(), and resolve().

◆ m_rImport

RTFDocumentImpl& writerfilter::rtftok::RTFSdrImport::m_rImport
private

Definition at line 90 of file rtfsdrimport.hxx.

Referenced by close(), createShape(), and resolve().

◆ m_xShape

css::uno::Reference<css::drawing::XShape> writerfilter::rtftok::RTFSdrImport::m_xShape
private

Definition at line 92 of file rtfsdrimport.hxx.

Referenced by append(), getCurrentShape(), and resolve().


The documentation for this class was generated from the following files: