20#ifndef INCLUDED_FILTER_MSFILTER_MSDFFIMP_HXX
21#define INCLUDED_FILTER_MSFILTER_MSDFFIMP_HXX
30#include <unordered_map>
32#include <com/sun/star/uno/Any.hxx>
33#include <com/sun/star/uno/Reference.hxx>
39#include <rtl/ustring.hxx>
71 namespace embed {
class XEmbeddedObject; }
72 namespace embed {
class XStorage; }
87 void ApplyCustomShapeTextAttributes(
SfxItemSet& rSet )
const;
89 void ApplyCustomShapeGeometryAttributes(
SvStream& rIn,
105 static Degree100 Fix16ToAngle( sal_Int32 nAngle );
107#ifdef DBG_CUSTOMSHAPE
113 void SetDefaultPropSet(
SvStream& rIn, sal_uInt32 nOffDgg )
const;
116 void ImportGradientColor(
SfxItemSet& aSet, sal_uInt32 eMSO_FillType,
double dTrans,
double dBackTrans )
const;
119#define COL_DEFAULT ::Color( 0xFA, 0xFB, 0xFC )
130 bool operator()(std::shared_ptr<SvxMSDffShapeInfo>
const& lhs,
131 std::shared_ptr<SvxMSDffShapeInfo>
const& rhs)
const;
135 bool operator()(std::shared_ptr<SvxMSDffShapeInfo>
const& lhs,
136 std::shared_ptr<SvxMSDffShapeInfo>
const& rhs)
const;
140typedef ::std::set< std::shared_ptr<SvxMSDffShapeInfo>,
142typedef ::std::multiset< std::shared_ptr<SvxMSDffShapeInfo>,
145#define SVXMSDFF_SETTINGS_CROP_BITMAPS 1
146#define SVXMSDFF_SETTINGS_IMPORT_PPT 2
147#define SVXMSDFF_SETTINGS_IMPORT_EXCEL 4
151#define OLE_MATHTYPE_2_STARMATH 0x0001
152#define OLE_WINWORD_2_STARWRITER 0x0002
153#define OLE_EXCEL_2_STARCALC 0x0004
154#define OLE_POWERPOINT_2_STARIMPRESS 0x0008
188 ::std::vector< std::unique_ptr<SvxMSDffConnectorRule> >
aCList;
217 static const int RELTO_DEFAULT = 2;
220 std::optional<tools::Polygon>
222 std::unique_ptr<char[]>
225 std::unique_ptr<char[]>
266 {
return nShapeId < rEntry.
nShapeId; }
278 typedef std::set<std::unique_ptr<SvxMSDffImportRec>,
290 bool empty()
const {
return m_Records.empty(); }
291 void insert(std::unique_ptr<SvxMSDffImportRec> pImpRec);
292 size_t size()
const {
return m_Records.size(); }
294 MSDffImportRecords::const_iterator
begin()
const {
return m_Records.begin(); }
295 MSDffImportRecords::const_iterator
end()
const {
return m_Records.end(); }
296 virtual void NotifyFreeObj(
SdrObject* pObj)
override;
356#define DFF_RECORD_MANAGER_BUF_SIZE 64
363 std::unique_ptr<DffRecordList>
386 sal_uInt32 nStOfs = 0 );
424 void CheckTxBxStoryChain();
425 void GetFidclData(sal_uInt32 nOffsDgg);
467 void GetCtrlData(sal_uInt32 nOffsDgg);
468 void GetDrawingGroupContainerData(
SvStream& rSt,
469 sal_uInt32 nLenDgg );
474 void GetDrawingContainerData(
SvStream& rSt,
476 sal_uInt16 nDrawingContainerId );
477 bool GetShapeGroupContainerData(
SvStream& rSt,
478 sal_uInt32 nLenShapeGroupCont,
480 sal_uInt16 nDrawingContainerId );
481 bool GetShapeContainerData(
SvStream& rSt,
482 sal_uInt32 nLenShapeCont,
483 sal_uInt64 nPosGroup,
484 sal_uInt16 nDrawingContainerId );
494 const int _nCalledByGroup )
const;
495 static css::uno::Reference < css::embed::XEmbeddedObject > CheckForConvertToSOObj(
496 sal_uInt32 nConvertFlags,
SotStorage& rSrcStg,
497 const css::uno::Reference < css::embed::XStorage >& xDestStg,
500 OUString
const& rBaseURL);
503 static void ProcessClientAnchor(
SvStream& rStData,
505 std::unique_ptr<
char[]>& rpBuff,
506 sal_uInt32& rBuffLen );
507 virtual void ProcessClientAnchor2(
SvStream& rStData,
510 static void ProcessClientData(
SvStream& rStData,
512 std::unique_ptr<
char[]>& rpBuff,
513 sal_uInt32& rBuffLen );
529 virtual bool GetColorFromPalette(sal_uInt16 nNum,
Color& rColor)
const;
533 static void ReadObjText(
const OUString& rText,
SdrObject* pObj );
536 virtual bool GetOLEStorageName( sal_uInt32 nOLEId,
537 OUString& rStorageName,
539 css::uno::Reference < css::embed::XStorage >& xDestStg
558 Color MSO_TEXT_CLR_ToColor( sal_uInt32 nColorCode )
const;
559 Color MSO_CLR_ToColor( sal_uInt32 nColorCode,
560 sal_uInt16 nContextProperty = DFF_Prop_lineColor )
const;
561 virtual bool SeekToShape(
SvStream& rSt,
563 sal_uInt32 nId )
const;
564 static bool SeekToRec(
SvStream& rSt,
569 bool SeekToRec2( sal_uInt16 nRecId1,
573 static OUString MSDFFReadZString(
SvStream& rIn,
577 [[nodiscard]]
static bool ReadCommonRecordHeader(
SvStream& rSt,
581 sal_uInt32& rLength);
611 Color mnDefaultColor_,
613 bool bSkipImages =
false );
618 void InitSvxMSDffManager( sal_uInt32 nOffsDgg_,
620 sal_uInt32 nSvxMSDffOLEConvFlags);
621 void SetDgContainer(
SvStream& rSt );
630 static bool ConvertToOle2(
SvStream& rStm,
637 void Scale(sal_Int32& rVal)
const;
640 void ScaleEmu(sal_Int32& rVal)
const;
641 sal_uInt32 ScalePt( sal_uInt32 nPt )
const;
642 sal_Int32 ScalePoint( sal_Int32 nVal )
const;
675 sal_Int32* pShapeId);
682 sal_Int32* pShapeId );
689 sal_Int32* pShapeId);
702 {
return m_xShapeInfosById.get(); }
705 {
return &m_aShapeOrders; }
712 void ExchangeInShapeOrder(
SdrObject const * pOldObject,
716 void RemoveFromShapeOrder(
SdrObject const * pObject )
const;
720 const OUString& rStorageName,
722 const css::uno::Reference < css::embed::XStorage >& xDestStg,
728 sal_uInt32 nConvertFlags,
730 OUString
const& rBaseURL);
740 static bool SetPropValue(
741 const css::uno::Any& rAny,
742 const css::uno::Reference< css::beans::XPropertySet > & rXPropSet,
743 const OUString& rPropertyName
747 static OUString GetFilterNameFromClassID(
const SvGlobalName& aGlobName);
751 void insertShapeId( sal_Int32 nShapeId,
SdrObject* pShape );
752 void removeShapeId(
SdrObject const * pShape );
753 SdrObject* getShapeForId( sal_Int32 nShapeId );
766 sal_uInt16 nSeqId=0, sal_uInt16 nBoxId=0):
std::unique_ptr< DffPropSet > pDefaultPropSet
const SvxMSDffManager & rManager
DffPropertyReader & operator=(DffPropertyReader const &)=delete
bool mbRotateGranientFillWithAngle
DffPropertyReader(DffPropertyReader const &)=delete
virtual ~SvxMSDffClientData()
virtual void NotifyFreeObj(SdrObject *pObj)=0
block of parameters for import/export for a single call of ImportObjAtCurrentStreamPos()
SvxMSDffImportData & operator=(SvxMSDffImportData const &)=delete
MSDffImportRecords::const_iterator end() const
MSDffImportRecords m_Records
Shape pointer, Shape ids and private data.
tools::Rectangle aParentRect
Rectangle of the surrounding groups, which might have been provided externally.
std::map< const SdrObject *, SvxMSDffImportRec * > m_ObjToRecMap
MSDffImportRecords::const_iterator begin() const
std::set< std::unique_ptr< SvxMSDffImportRec >, comphelper::UniquePtrValueLess< SvxMSDffImportRec > > MSDffImportRecords
list of all SvxMSDffImportRec instances of/for a group
SvxMSDffImportData(SvxMSDffImportData const &)=delete
abstract base class for Escher imports
DffRecordManager maShapeRecords
sal_uInt32 nSvxMSDffOLEConvFlags
const SvxMSDffShapeOrders * GetShapeOrders() const
sal_uInt32 nSvxMSDffSettings
std::unique_ptr< SvxMSDffBLIPInfos > m_pBLIPInfos
void SetSvxMSDffSettings(sal_uInt32 nSettings)
const SvxMSDffShapeInfos_ById * GetShapeInfos() const
std::unique_ptr< SvxMSDffShapeInfos_ById > m_xShapeInfosById
std::vector< FIDCL > maFidcls
std::map< sal_uInt32, sal_uInt64 > OffsetMap
sal_uInt32 GetSvxMSDffSettings() const
SvxMSDffShapeIdContainer maShapeIdContainer
stores a reference to an imported SdrObject with its shape id if it has one
SdrModel * GetModel() const
SvxMSDffShapeOrders m_aShapeOrders
std::unique_ptr< DffPropertyReader > pSecPropSet
ShapeFlag nGroupShapeFlags
OffsetMap maDgOffsetTable
array of fileoffsets
std::unique_ptr< SvxMSDffShapeInfos_ByTxBxComp > m_xShapeInfosByTxBxComp
std::unordered_map< sal_uInt32, Graphic > aEscherBlipCache
std::vector< std::pair< DffObjData, std::shared_ptr< DffRecordHeader > > > maPendingGroupData
When importing Excel files, cell anchor computations for non-page-anchored groups must be done after ...
SvStream & ReadSvxMSDffSolverContainer(SvStream &rIn, SvxMSDffSolverContainer &rContainer)
constexpr OUStringLiteral SVEXT_PERSIST_STREAM
@ SEEK_FROM_CURRENT_AND_RESTART
::std::multiset< std::shared_ptr< SvxMSDffShapeInfo >, CompareSvxMSDffShapeInfoByTxBxComp > SvxMSDffShapeInfos_ByTxBxComp
#define DFF_RECORD_MANAGER_BUF_SIZE
::std::map< sal_Int32, SdrObject * > SvxMSDffShapeIdContainer
std::vector< std::unique_ptr< SvxMSDffShapeOrder > > SvxMSDffShapeOrders
the following will be sorted by the order of their appearance:
::std::set< std::shared_ptr< SvxMSDffShapeInfo >, CompareSvxMSDffShapeInfoById > SvxMSDffShapeInfos_ById
#define MSFILTER_DLLPUBLIC
void Clear(EHistoryType eHistory)
class SAL_NO_VTABLE XPropertySet
Shape IDs per cluster in DGG atom.
OSQLColumns::const_iterator find(const OSQLColumns::const_iterator &first, const OSQLColumns::const_iterator &last, std::u16string_view _rVal, const ::comphelper::UStringMixEqual &_rCase)
bool operator()(std::shared_ptr< SvxMSDffShapeInfo > const &lhs, std::shared_ptr< SvxMSDffShapeInfo > const &rhs) const
bool operator()(SvxMSDffShapeOrder *const &lhs, SvxMSDffShapeOrder *const &rhs) const
const DffRecordHeader & rSpHd
tools::Rectangle aChildAnchor
DffObjData(const DffRecordHeader &rObjHd, const tools::Rectangle &rBoundRect, int nClByGroup)
tools::Rectangle aBoundRect
bool bRotateTextWithShape
DffObjData(const std::shared_ptr< DffRecordHeader > &rObjHd, const DffObjData &o)
std::unique_ptr< DffRecordList > pNext
DffRecordHeader mHd[DFF_RECORD_MANAGER_BUF_SIZE]
DffRecordList(DffRecordList *pList)
sal_uInt32 dgid
DG owning the SPIDs in this cluster.
provided by SvxMSDffManager for each shape in a group
MSDffTxId(const MSDffTxId &rCopy)
the following will be sorted by the order of their appearance:
SdrObject * pAObj
pPtr of object (corresponding to shape A)
ShapeFlag nSpFlagsA
SpFlags of shape A (the original mirror flags must be known when solving the Solver Container)
sal_uInt32 nShapeC
SPID of connector shape.
SdrObject * pBObj
pPtr of object (corresponding to shape B)
ShapeFlag nSpFlagsB
SpFlags of shape B.
sal_uInt32 ncptiB
Connection site Index of shape B.
sal_uInt32 nShapeA
SPID of shape A.
sal_uInt32 ncptiA
Connection site Index of shape A.
SdrObject * pCObj
pPtr of connector object
sal_uInt32 nShapeB
SPID of shape B.
sal_uInt32 nGroupShapeBooleanProperties
std::optional< sal_uInt32 > nXRelTo
sal_Int32 nDxWrapDistLeft
bool operator<(const SvxMSDffImportRec &rEntry) const
sal_Int32 nCropFromBottom
std::optional< tools::Polygon > pWrapPolygon
sal_Int32 nDxTextLeft
distance of text box from surrounding shape
sal_uInt32 nClientAnchorLen
int relativeHorizontalWidth
in 0.1% or -1 for none
SvxMSDffImportRec & operator=(const SvxMSDffImportRec &)=delete
sal_uInt32 nClientDataLen
std::unique_ptr< char[]> pClientDataBuffer
sal_uLong nNextShapeId
for linked text boxes
rtl::Reference< SdrObject > pObj
std::unique_ptr< char[]> pClientAnchorBuffer
std::optional< sal_uInt32 > nYRelTo
MSO_LineDashing eLineDashing
sal_Int32 nDxWrapDistRight
sal_Int32 nDyWrapDistBottom
MSO_LineStyle eLineStyle
border types
MSDffTxId aTextId
identifier for text boxes
SvxMSDffShapeInfo(const SvxMSDffShapeInfo &rInfo)
bool bReplaceByFly
shape can be replaced by a frame in Writer
sal_uInt64 nFilePos
offset of the shape in control stream for
sal_uInt32 nShapeId
shape id, used in PLCF SPA and in mso_fbtSp (FSP)
SvxMSDffShapeInfo(sal_uInt64 nFPos, sal_uInt32 nId=0, sal_uInt16 nSeqId=0, sal_uInt16 nBoxId=0)
SvxMSDffShapeOrder(sal_uLong nId)
SdrObject * pObj
pointer to the draw object (or NULL if not used)
sal_uLong nTxBxComp
chain or box number in the Text-Box-Story (or NULL)
sal_uLong nShapeId
shape id used in PLCF SPA and in mso_fbtSp (FSP)
bool operator<(const SvxMSDffShapeOrder &rEntry) const
SwFlyFrameFormat * pFly
format of frame that was inserted as a replacement
SvxMSDffSolverContainer & operator=(SvxMSDffSolverContainer const &)=delete
::std::vector< std::unique_ptr< SvxMSDffConnectorRule > > aCList
SvxMSDffSolverContainer(SvxMSDffSolverContainer const &)=delete