51 : maSetLayer(rSetLayer), mnInlines(0), mpDrawPg(pDrawPg),
52 mpShapeOrders(pShapeOrders)
55 OSL_ENSURE(
mpDrawPg,
"Missing draw page impossible!");
71 const bool bInHellLayer,
72 const bool _bInHeaderFooter )
81 [nIdx](
const EscherShape& rShape) { return rShape.mnEscherShapeOrder == nIdx; });
89 for (sal_uInt16 nShapePos=0; nShapePos < nShapeCount; nShapePos++)
103 const bool bInHellLayer,
104 const bool _bInHeaderFooter )
121 if ( !_bInHeaderFooter )
123 while ( aIter != aEnd )
125 if ( !aIter->mbInHeaderFooter )
129 nRet += aIter->mnNoInlines + 1;
135 while (aIter != aEnd)
137 if (!aIter->mbInHellLayer || (_bInHeaderFooter && !aIter->mbInHeaderFooter))
139 nRet += aIter->mnNoInlines + 1;
143 while (aIter != aEnd)
147 if ( _bInHeaderFooter && !aIter->mbInHeaderFooter )
151 if ( bInHellLayer && !aIter->mbInHellLayer )
154 if ( aIter->mnEscherShapeOrder > nFound )
156 nRet += aIter->mnNoInlines+1;
168 if (nWwHeight & 0x2000)
194 OSL_ENSURE(aEnd !=
maEscherLayer.end(),
"Something very wrong here");
198 nInsertPos += aEnd->mnNoInlines;
215 auto aIter = std::find_if(
217 [nWwHeight](
short aHeight){ return (aHeight & 0x1fff) > (nWwHeight & 0x1fff); });
252 if (!rFileName.isEmpty())
257 return !rFileName.isEmpty();
275 roGraphic.emplace(aWMF);
304 : nCL(rPic.dxaCropLeft),
305 nCR(rPic.dxaCropRight),
306 nCT(rPic.dyaCropTop),
307 nCB(rPic.dyaCropBottom)
320 nWidth = nCurrentWidth * rPic.
mx / 1000;
321 nHeight = nCurrentHeight * rPic.
my / 1000;
330 SdrObjList* pObjectList = pGroupObject->GetSubList();
341 OSL_ENSURE(
false,
"Impossible!");
351 sal_uInt32 nWidth = rPD.
nWidth;
352 sal_uInt32 nHeight = rPD.
nHeight;
355 sal_Int32 nNetHeight = nHeight + rPD.
nCT + rPD.
nCB;
364 aFlySet.
Put(aAnchor);
370 *
m_pPaM, rFileName, OUString(), pGraph,
371 &aFlySet, &rGrfSet,
nullptr);
392 pFlyFormat =
ImportOle(pGraph, &aFlySet, &rGrfSet);
398 *
m_pPaM, rFileName, OUString(), pGraph, &aFlySet,
418 std::optional<Graphic> oGraph;
419 bool bOk =
ReadGrafFile(aFileName, oGraph, rPic, pSt, nFilePos, &bInDoc);
432 aGrfSet.
Put( aCrop );
438 pRet =
MakeGrafInContent(rPic, aPD, oGraph ? &*oGraph :
nullptr, aFileName, aGrfSet);
447 pDataStream->
ReadBytes( &aPicS,
sizeof( aPicS ) );
453 bool bOk = pDataStream->
good();
468 return aRg.aStart.GetNode().GetNodeType();
500 if (bValid && aPic.
lcb >= 58)
514 if (RndStdIds::FLY_AS_CHAR ==
524 else if((0x64 == aPic.
MFP.
mm) || (0x66 == aPic.
MFP.
mm))
543 if (0x66 == aPic.
MFP.
mm)
560 ?
aData.begin()->get() :
nullptr;
571 if( relativeWidth == -1 )
573 if( relativeWidth != 0 )
576 aPic.
mx = msword_cast<sal_uInt16>(
597 aFlySet.
Put(aAnchor);
599 aAttrSet.Put(aFlySet);
606 aAttrSet.Put(aFlySet);
646 bool bTextObjWasGrouped =
false;
648 bTextObjWasGrouped =
true;
650 if (bTextObjWasGrouped)
654 if (SdrObjKind::OLE2 ==
pObject->GetObjIdentifier())
664 const Graphic& rGraph = pGraphObject->GetGraphic();
667 pRet =
ImportOle(&rGraph, &aAttrSet, &aGrSet,
pObject->GetBLIPSizeRectangle());
672 *
m_pPaM, OUString(), OUString(),
673 &rGraph, &aAttrSet, &aGrSet,
nullptr );
687 OUString aObjectName(
pObject->GetName());
697 if (pOurNewObject !=
pObject.get())
703 if (
pObject->getSdrPageFromSdrObject())
720 else if (aPic.
lcb >= 58)
736 pPic->
lcb = SVBT32ToUInt32( pPicS->
lcb );
738 pPic->
MFP.
mm = SVBT16ToUInt16( pPicS->
MFP.
mm );
742 for( sal_uInt16
i = 0;
i < 14 ;
i++ )
746 pPic->
mx = SVBT16ToUInt16( pPicS->
mx );
747 pPic->
my = SVBT16ToUInt16( pPicS->
my );
768 sal_uInt16 nBits = SVBT16ToUInt16(rFSPAS.
aBits1);
770 rFSPA.
bHdr = sal_uInt16(0 != (nBits & 0x0001));
771 rFSPA.
nbx = (nBits & 0x0006) >> 1;
772 rFSPA.
nby = (nBits & 0x0018) >> 3;
773 rFSPA.
nwr = (nBits & 0x01E0) >> 5;
774 rFSPA.
nwrk = (nBits & 0x1E00) >> 9;
775 rFSPA.
bRcaSimple = sal_uInt16(0 != (nBits & 0x2000));
776 rFSPA.
bBelowText = sal_uInt16(0 != (nBits & 0x4000));
777 rFSPA.
bAnchorLock = sal_uInt16(0 != (nBits & 0x8000));
static GraphicFilter & GetGraphicFilter()
ErrCode ImportGraphic(Graphic &rGraphic, const INetURLObject &rPath, sal_uInt16 nFormat=GRFILTER_FORMAT_DONTKNOW, sal_uInt16 *pDeterminedFormat=nullptr, GraphicFilterImportFlags nImportFlags=GraphicFilterImportFlags::NONE)
virtual SwDrawFrameFormat * InsertDrawObj(const SwPaM &rRg, SdrObject &rDrawObj, const SfxItemSet &rFlyAttrSet)=0
Insert a DrawObject.
virtual SwFlyFrameFormat * InsertGraphic(const SwPaM &rRg, const OUString &rGrfName, const OUString &rFltName, const Graphic *pGraphic, const SfxItemSet *pFlyAttrSet, const SfxItemSet *pGrfAttrSet, SwFrameFormat *)=0
Insert graphic or formula.
virtual const SwViewShell * GetCurrentViewShell() const =0
Returns the layout set at the document.
virtual rtl::Reference< SdrObject > ReplaceObject(SdrObject *pNewObj, size_t nObjNum)
virtual void InsertObject(SdrObject *pObj, size_t nPos=SAL_MAX_SIZE)
size_t GetObjCount() const
virtual rtl::Reference< SdrObject > RemoveObject(size_t nObjNum)
sal_uInt32 GetOrdNum() const
virtual const tools::Rectangle & GetCurrentBoundRect() const
virtual void SetLogicRect(const tools::Rectangle &rRect)
SdrPage * getSdrPageFromSdrObject() const
SdrObject * getParentSdrObjectFromSdrObject() const
virtual SdrLayerID GetLayer() const
virtual void SetLayer(SdrLayerID nLayer)
sal_uInt16 ClearItem(sal_uInt16 nWhich=0)
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
SvStream & ReadInt16(sal_Int16 &rInt16)
sal_uInt64 Seek(sal_uInt64 nPos)
std::size_t ReadBytes(void *pData, std::size_t nSize)
sal_uInt64 SeekRel(sal_Int64 nPos)
SvStream & ReadUChar(unsigned char &rChar)
IDocumentContentOperations const & getIDocumentContentOperations() const
const SwFlyFrameFormat * FindFlyByName(const OUString &rName, SwNodeType nNdTyp=SwNodeType::NONE) const
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
const SwAttrPool & GetAttrPool() const
const SwNodeIndex * GetContentIdx() const
Marks a node in the document model.
Base class of the Writer document model elements.
const SwEndNode * EndOfSectionNode() const
const SwPosition * GetPoint() const
bool ReadGrafFile(OUString &rFileName, std::optional< Graphic > &rpGraphic, const WW8_PIC &rPic, SvStream *pSt, sal_uLong nFilePos, bool *pDelIt)
SwFrameFormat * ImportGraf1(WW8_PIC const &rPic, SvStream *pSt, sal_uLong nFilePos)
SwFrameFormat * ImportOle(const Graphic *=nullptr, const SfxItemSet *pFlySet=nullptr, const SfxItemSet *pGrfSet=nullptr, const tools::Rectangle &aVisArea=tools::Rectangle())
static void ReplaceObj(const SdrObject &rReplaceTextObj, SdrObject &rSubObj)
void SetAttributesAtGrfNode(const SvxMSDffImportRec &rRecord, const SwFrameFormat &rFlyFormat, WW8_FSPA const *pF)
std::unique_ptr< WW8SwFlyPara > m_xSFlyPara
std::unique_ptr< WW8FlyPara > m_xWFlyPara
SwFlyFrameFormat * InsertOle(SdrOle2Obj &rObject, const SfxItemSet &rFlySet, const SfxItemSet *rGrfSet)
std::shared_ptr< WW8Fib > m_xWwFib
wwSectionManager m_aSectionManager
SwFrameFormat * ImportGraf(SdrTextObj const *pTextObj=nullptr, SwFrameFormat const *pFlyFormat=nullptr)
SwFlyFrameFormat * MakeGrafNotInContent(const WW8PicDesc &rPD, const Graphic *pGraph, const OUString &rFileName, const SfxItemSet &rGrfSet)
SwFlyFrameFormat * m_pFlyFormatOfJustInsertedGraphic
std::unique_ptr< SwMSDffManager > m_xMSDffManager
wwFrameNamer m_aGrfNameGenerator
std::unique_ptr< wwZOrderer > m_xWWZOrder
std::set< sal_uLong > m_aGrafPosSet
SdrObject * CreateContactObject(SwFrameFormat *pFlyFormat)
rtl_TextEncoding m_eStructCharSet
friend class SwMSDffManager
SwFrameFormat * AddAutoAnchor(SwFrameFormat *pFormat)
static bool GetPictGrafFromStream(Graphic &rGraphic, SvStream &rSrc)
SwFrameFormat * MakeGrafInContent(const WW8_PIC &rPic, const WW8PicDesc &rPD, const Graphic *pGraph, const OUString &rFileName, const SfxItemSet &rGrfSet)
static SAL_WARN_UNUSED_RESULT bool PicRead(SvStream *pDataStream, WW8_PIC *pPic, bool bVer67)
void MatchSdrItemsIntoFlySet(SdrObject const *pSdrObj, SfxItemSet &aFlySet, MSO_LineStyle eLineStyle, MSO_LineDashing eDashing, MSO_SPT eShapeType, tools::Rectangle &rInnerDist)
Make setting a drawing object's layer in a Writer document easy.
void SendObjectToHeaven(SdrObject &rObject) const
Make Object lives in the top layer.
void SendObjectToHell(SdrObject &rObject) const
Make Object live in the bottom drawing layer.
void SetUniqueGraphName(SwFrameFormat *pFrameFormat, std::u16string_view rFixedPart)
sal_uInt32 GetPageWidth() const
sal_uInt32 GetPageRight() const
sal_uInt32 GetPageLeft() const
void InsertTextLayerObject(SdrObject *pObject)
const SvxMSDffShapeOrders * mpShapeOrders
sal_uLong GetEscherObjectPos(sal_uLong nSpId, const bool bInHellLayer, const bool _bInHeaderFooter)
sal_uLong GetDrawingObjectPos(short nWwHeight)
void InsideEscher(sal_uLong nIndex)
void InsertObject(SdrObject *pObject, sal_uLong nPos)
sw::util::SetLayer maSetLayer
myeiter MapEscherIdxToIter(sal_uLong nIdx)
void InsertDrawingObject(SdrObject *pObj, short nWwHeight)
std::vector< EscherShape >::iterator myeiter
std::vector< short > maDrawHeight
sal_uInt16 GetEscherObjectIdx(sal_uLong nSpId)
std::stack< sal_uInt16 > maIndexes
wwZOrderer(const sw::util::SetLayer &rSetLayer, SdrPage *pDrawPg, const SvxMSDffShapeOrders *pShapeOrders)
sal_uLong mnNoInitialObjects
std::vector< EscherShape > maEscherLayer
void InsertEscherObject(SdrObject *pObject, sal_uLong nSpId, const bool bInHellLayer, const bool _bInHeaderFooter)
EmbeddedObjectRef * pObject
@ Fixed
Frame cannot be moved in Var-direction.
constexpr sal_uInt16 RES_FRMATR_BEGIN(RES_PARATR_LIST_END)
constexpr sal_uInt16 RES_GRFATR_BEGIN(RES_FRMATR_END)
constexpr sal_uInt16 RES_FRMATR_END(141)
constexpr TypedWhichId< SwFormatAnchor > RES_ANCHOR(110)
constexpr sal_uInt16 RES_GRFATR_END(156)
void SetProgressState(tools::Long nPosition, SwDocShell const *pDocShell)
std::vector< std::unique_ptr< SvxMSDffShapeOrder > > SvxMSDffShapeOrders
constexpr OUStringLiteral aData
SVL_DLLPUBLIC Link< OUString *, bool > const & GetMaybeFileHdl()
SVL_DLLPUBLIC OUString SmartRel2Abs(INetURLObject const &rTheBaseURIRef, OUString const &rTheRelURIRef, Link< OUString *, bool > const &rMaybeFileHdl=Link< OUString *, bool >(), bool bCheckFileExists=true, bool bIgnoreFragment=false, INetURLObject::EncodeMechanism eEncodeMechanism=INetURLObject::EncodeMechanism::WasEncoded, INetURLObject::DecodeMechanism eDecodeMechanism=INetURLObject::DecodeMechanism::ToIUri, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8, FSysStyle eStyle=FSysStyle::Detect)
o3tl::strong_int< sal_Int32, struct Tag_SwNodeOffset > SwNodeOffset
TOOLS_DLLPUBLIC bool checkSeek(SvStream &rSt, sal_uInt64 nOffset)
int relativeHorizontalWidth
MSO_LineDashing eLineDashing
WW8PicDesc(const WW8_PIC &rPic)
static constexpr RndStdIds eAnchor
struct WW8_PIC_SHADOW::@14 MFP
VCL_DLLPUBLIC bool ReadWindowMetafile(SvStream &rStream, GDIMetaFile &rMTF)
static void WW8PicShadowToReal(WW8_PIC_SHADOW const *pPicS, WW8_PIC *pPic)
void WW8FSPAShadowToReal(const WW8_FSPA_SHADOW &rFSPAS, WW8_FSPA &rFSPA)
void MatchEscherMirrorIntoFlySet(const SvxMSDffImportRec &rRecord, SfxItemSet &rFlySet)
OUString read_uInt8_PascalString(SvStream &rStrm, rtl_TextEncoding eEnc)