23#include <osl/endian.h>
53#include <editeng/editeng.hxx>
107using ::editeng::SvxBorderLine;
121 static const Color eColA[] = {
138 if( !( nWC[3] & 0x1 ) &&
139 ( ( nWC[0] == 0 || nWC[0]== 0x80 || nWC[0] == 0xff )
140 && ( nWC[1] == 0 || nWC[1]== 0x80 || nWC[1] == 0xff )
141 && ( nWC[2] == 0 || nWC[2]== 0x80 || nWC[2] == 0xff ) ) ){
143 for (
int i = 2;
i >= 0;
i--)
147 nIdx += ((nWC[
i] == 0xff) ? 2 : 1);
162 return Color(nWC[0], nWC[1], nWC[2]);
177 if (SVBT16ToUInt16(pHd->
cb) <
sizeof(
WW8_DPHEAD) + nDataSiz)
179 OSL_ENSURE(
false,
"+graphic element: too short?" );
185 OSL_ENSURE(bCouldRead,
"Short Graphic header");
203 if( SVBT16ToUInt16( rL.
lnps ) == 5 ){
210 if( SVBT16ToUInt16( rL.
lnps ) >= 1
211 && SVBT16ToUInt16(rL.
lnps ) <= 4 ){
213 sal_Int16 nLen = SVBT16ToUInt16( rL.
lnpw );
214 XDash aD( css::drawing::DashStyle_RECT, 1, 2 * nLen, 1, 5 * nLen, 5 * nLen );
215 switch( SVBT16ToUInt16( rL.
lnps ) ){
222 case 4: aD.
SetDots( 2 );
break;
229 if( SVBT16ToUInt16( rSh.
shdwpi ) ){
245 0, 0, 5, 10, 20, 25, 30, 40, 50, 60, 70, 75, 80,
246 90, 50, 50, 50, 50, 50, 50, 33, 33, 33, 33, 33, 33
248 sal_uInt16 nPat = SVBT16ToUInt16(rFill.
flpp);
265 +
static_cast<sal_uLong>(aB.
GetRed()) * ( 100 - nPatA[nPat] ) ) / 100 ) );
278 sal_uInt16 aSB = SVBT16ToUInt16( rLe.
aStartBits );
287 sal_uInt16 nSiz = SVBT16ToUInt16( rLt.
lnpw )
288 * ( ( aSB >> 2 & 0x3 ) + ( aSB >> 4 & 0x3 ) );
289 if( nSiz < 220 ) nSiz = 220;
294 sal_uInt16 aEB = SVBT16ToUInt16( rLe.
aEndBits );
295 if( !(aEB & 0x3) )
return;
303 sal_uInt16 nSiz = SVBT16ToUInt16( rLt.
lnpw )
304 * ( ( aEB >> 2 & 0x3 ) + ( aEB >> 4 & 0x3 ) );
305 if( nSiz < 220 ) nSiz = 220;
326 rP0.
AdjustX(
static_cast<sal_Int16
>(SVBT16ToUInt16( aLine.
xaStart )) );
327 rP0.
AdjustY(
static_cast<sal_Int16
>(SVBT16ToUInt16( aLine.
yaStart )) );
328 rP1.
AdjustX(
static_cast<sal_Int16
>(SVBT16ToUInt16( aLine.
xaEnd )) );
329 rP1.
AdjustY(
static_cast<sal_Int16
>(SVBT16ToUInt16( aLine.
yaEnd )) );
354 static_cast<sal_Int16
>(SVBT16ToUInt16( pHd->
ya )) +
m_nDrawYOfs2 );
356 aP1.
AdjustX(
static_cast<sal_Int16
>(SVBT16ToUInt16( pHd->
dxa )) );
357 aP1.
AdjustY(
static_cast<sal_Int16
>(SVBT16ToUInt16( pHd->
dya )) );
373 if( !
ReadGrafStart(
static_cast<void*
>(&aEllipse),
sizeof( aEllipse ), pHd,
rSet ) )
377 static_cast<sal_Int16
>(SVBT16ToUInt16( pHd->
ya )) +
m_nDrawYOfs2 );
379 aP1.
AdjustX(
static_cast<sal_Int16
>(SVBT16ToUInt16( pHd->
dxa )) );
380 aP1.
AdjustY(
static_cast<sal_Int16
>(SVBT16ToUInt16( pHd->
dya )) );
401 static_cast<sal_Int16
>(SVBT16ToUInt16( pHd->
ya )) +
m_nDrawYOfs2 );
403 aP1.
AdjustX(
static_cast<sal_Int16
>(SVBT16ToUInt16( pHd->
dxa )) * 2 );
404 aP1.
AdjustY(
static_cast<sal_Int16
>(SVBT16ToUInt16( pHd->
dya )) * 2 );
406 short nA[] = { 2, 3, 1, 0 };
407 short nW = nA[ ( ( aArc.
fLeft & 1 ) << 1 ) + ( aArc.
fUp & 1 ) ];
409 aP0.
AdjustY( -
static_cast<sal_Int16
>(SVBT16ToUInt16( pHd->
dya )) );
410 aP1.
AdjustY( -
static_cast<sal_Int16
>(SVBT16ToUInt16( pHd->
dya )) );
413 aP0.
AdjustX( -
static_cast<sal_Int16
>(SVBT16ToUInt16( pHd->
dxa )) );
414 aP1.
AdjustX( -
static_cast<sal_Int16
>(SVBT16ToUInt16( pHd->
dxa )) );
419 SdrCircKind::Section,
437 sal_uInt16
nCount = SVBT16ToUInt16( aPoly.
aBits1 ) >> 1 & 0x7fff;
441 OSL_ENSURE(bCouldRead,
"Short PolyLine header");
450 +
static_cast<sal_Int16
>(SVBT16ToUInt16( pHd->
xa )) );
452 +
static_cast<sal_Int16
>(SVBT16ToUInt16( pHd->
ya )) );
459 (SVBT16ToUInt16(aPoly.
aBits1) & 0x1) ? SdrObjKind::Polygon : SdrObjKind::PolyLine,
474 && (nCpStart >= rDrawEditEngine.
GetTextLen( nSP ) + 1) )
476 nCpStart -= rDrawEditEngine.
GetTextLen( nSP ) + 1;
482 && (nCpEnd > rDrawEditEngine.
GetTextLen( nEP ) + 1) )
484 nCpEnd -= rDrawEditEngine.
GetTextLen( nEP ) + 1;
487 return ESelection( nSP, nCpStart, nEP, nCpEnd );
512 sal_uInt16 nWhich =
i;
515 nSlotId && nWhich != nSlotId &&
516 0 != (nWhich = pEditPool->
GetWhich(nSlotId)) &&
530 sal_Int32 nStartPos = 0;
533 nStartPos = rString.indexOf(0x13, nStartPos);
541 rNewStartCp += rString.getLength()-nStartPos;
542 rString = rString.copy(0, nStartPos);
546 const bool was0x14 = rString[nStopPos]==0x14;
547 rString = rString.replaceAt(nStartPos, nStopPos+1-nStartPos,
u"");
548 rNewStartCp += nStopPos-nStartPos;
553 nStartPos = rString.indexOf(0x15, nStartPos);
556 rString = rString.replaceAt(nStartPos, 1,
u"");
571 : msURL(
std::move(
aURL)), mnStartPos(nStart), mnEndPos(0) {}
573 void SetEndPos(
tools::Long nEnd) { mnEndPos = nEnd; }
574 tools::Long GetStartPos()
const {
return mnStartPos;}
576 const OUString &
GetURL()
const {
return msURL;}
577 void Adjust(sal_Int32 nAdjust)
596 ManTypes eType,
bool bONLYnPicLocFc)
609 WW8_CP nNext, nStartReplace=0;
611 bool bDoingSymbol =
false;
617 std::deque<Chunk> aChunks;
621 while (nStart < nEndCp)
625 WW8_CP nTextStart = nStart;
626 if (nTextStart < nStartCp)
627 nTextStart = nStartCp;
655 nStartReplace = nTextStart;
664 bDoingSymbol =
false;
667 nTextStart - nStartCp));
670 bool bBadSelection = aReplaceSel.
nStartPara >= nParaCount || aReplaceSel.
nEndPara >= nParaCount;
672 SAL_WARN_IF(bBadSelection,
"sw.ww8",
"editengine has different amount of text than expected");
676 sal_Int32
nCount = nTextStart - nStartReplace;
677 OUStringBuffer sTemp(
nCount);
694 const SfxPoolItem *pItem = ((*m_xCtrlStck)[nI-1]).m_pAttr.get();
695 sal_uInt16 nWhich = pItem->
Which();
704 aChunks.emplace_back(nStart, sURL);
710 aChunks.back().SetEndPos(nStart+1);
718 const WW8_CP nEnd = ( nNext < nEndCp ) ? nNext : nEndCp;
719 if (!bONLYnPicLocFc && nNext != nStart && nEnd >= nStartCp)
730 const SfxPoolItem *pItem = ((*m_xCtrlStck)[
i]).m_pAttr.get();
731 sal_uInt16 nWhich = pItem->
Which();
742 nSlotId && nWhich != nSlotId &&
743 0 != (nWhich = pEditPool->
GetWhich(nSlotId)) &&
768 for (
size_t nI =
m_xCtrlStck->size(); nI > nCurrentCount; --nI)
771 auto aEnd = aChunks.end();
772 for (
auto aIter = aChunks.begin(); aIter != aEnd; ++aIter)
775 aIter->GetEndPos()-nStartCp));
779 const sal_Int32 nOrigLen = aString.getLength();
784 if (!aIter->GetURL().isEmpty())
788 nChanged = nOrigLen - 1;
793 nChanged = nOrigLen - aString.getLength();
795 for (
auto aIter2 = aIter+1; aIter2 != aEnd; ++aIter2)
796 aIter2->Adjust(nChanged);
807 sal_uInt16 nTxBxS, sal_uInt16 nSequence)
813 OSL_ENSURE(
false,
"+where's the text graphic (1)?" );
818 bool bCheckTextBoxStory = ( nTxBxS && pT->
GetIMax() >= nTxBxS );
819 if( bCheckTextBoxStory )
824 if (!pT->
Get(rStartCp, pT0) || rStartCp < 0)
826 OSL_ENSURE(
false,
"+where's the text graphic (2)?" );
830 if( bCheckTextBoxStory )
832 bool bReusable = (0 != SVBT16ToUInt16(
static_cast<WW8_TXBXS*
>(pT0)->fReusable ));
836 if( !pT->
Get( rStartCp, pT0 ) )
838 OSL_ENSURE(
false,
"+where's the text graphic (2a)?" );
841 bReusable = (0 != SVBT16ToUInt16(
static_cast<WW8_TXBXS*
>(pT0)->fReusable ));
845 if (!pT->
Get(rEndCp, pT0) || rEndCp < 0)
847 OSL_ENSURE(
false,
"+where's the text graphic (3)?" );
852 if( bCheckTextBoxStory )
855 if( USHRT_MAX > nSequence )
867 OSL_ENSURE(
false,
"+where's the text graphic (4)" );
871 for (sal_uInt16 iSequence = 0; iSequence < nSequence; ++iSequence)
874 if( (!pT->
Get( rStartCp, pT0 ))
875 || ( nMinStartCp > rStartCp ) )
877 OSL_ENSURE(
false,
"+where's the text graphic (5)?" );
880 if( rStartCp >= nMaxEndCp )
885 if ( (!pT->
Get(rEndCp, pT0)) || (nMaxEndCp < rEndCp-1) )
887 OSL_ENSURE(
false,
"+where's the text graphic (6)?" );
908 OSL_ENSURE(nStartCp <= nEndCp,
"+where's the graphic text (7)?");
909 if (nStartCp == nEndCp)
911 else if (nStartCp < nEndCp)
916 OSL_ENSURE(nLen,
"+where's the text graphic (8)?");
919 if( rString[nLen-1]==0x0d )
920 rString = rString.copy(0, nLen-1);
922 rString = rString.replace( 0xb, 0xa );
937 OUStringBuffer aNewData(rIn);
938 std::vector<sal_Int32> aDosLineEndDummies;
940 sal_Int32 nStrLen = rIn.getLength();
944 if (rIn[
i] ==
'\r' || rIn[
i] ==
'\n')
947 if ( (
i+1) < nStrLen && ((rIn[
i+1] ==
'\r') || (rIn[
i+1] ==
'\n')) &&
948 (rIn[
i] != rIn[
i+1]) )
951 aDosLineEndDummies.push_back(
i);
957 rIn = aNewData.makeStringAndClear();
958 return aDosLineEndDummies;
963 for (
auto aIter = rDosLineEndDummies.rbegin(); aIter != rDosLineEndDummies.rend(); ++aIter)
965 sal_Int32 nCharPos(*aIter);
979 SAL_WARN(
"sw.ww8",
"Truncating long EditEngine strings when fuzzing for performance");
980 rString = rString.copy(0, 1024);
991 OUString sEEString(rString);
1007 std::unique_ptr<EditTextObject> pTemporaryText =
m_pDrawEditEngine->CreateTextObject();
1008 pRet.
emplace( std::move(pTemporaryText) );
1018 rString = rString.replaceAll(
"\x01",
"");
1019 rString = rString.replaceAll(
"\x05",
"");
1020 rString = rString.replaceAll(
"\x08",
"");
1021 rString = rString.replaceAll(
"\007\007",
"\007\012");
1022 rString = rString.replace(0x7,
' ');
1030 Size const * pObjSiz, sal_uInt16 nTxBxS, sal_uInt16 nSequence,
tools::Long nPosCp,
1031 SwFrameFormat const * pOldFlyFormat,
bool bMakeSdrGrafObj,
bool& rbEraseTextObj,
1040 rbEraseTextObj =
false;
1044 bool bContainsGraphics =
false;
1055 if (
m_bFuzzing && aString.getLength() > 1024)
1057 SAL_WARN(
"sw.ww8",
"Truncating long EditEngine strings when fuzzing for performance");
1058 aString = aString.copy(0, 1024);
1061 const OUString aOrigString(aString);
1064 WW8_CP nNewStartCp = nStartCp;
1067 if (aString.getLength()!=1)
1069 bContainsGraphics = aString.indexOf(0x1)<0 || aString.indexOf(0x8)<0;
1074 switch( aString[0] )
1077 if (!pbTestTxbxContainsText)
1091 for(
int nLoop = 0; nLoop < 2; ++nLoop )
1096 if (
nullptr == pParams)
1099 switch( nCurrentId )
1129 if( bMakeSdrGrafObj && pTextObj &&
1141 static_cast<SdrGrafObj*
>(pNew.get())->SetGraphic(aGraph);
1147 pNew->SetLayer( pTextObj->
GetLayer() );
1150 ReplaceObject(pNew.get(), pTextObj->
GetOrdNum());
1160 pFlyFormat =
ImportGraf(bMakeSdrGrafObj ? pTextObj :
nullptr,
1166 if ( (!pbTestTxbxContainsText) && (!
m_bObj) )
1176 if( pFlyFormat && pRecord )
1197 rbEraseTextObj = (
nullptr != pFlyFormat);
1203 *pnStartCp = nStartCp;
1207 if( pbTestTxbxContainsText )
1208 *pbTestTxbxContainsText = bTextWasRead && ! rbEraseTextObj;
1209 else if( !rbEraseTextObj )
1235 if (pbContainsGraphics)
1236 *pbContainsGraphics = bContainsGraphics;
1242 bool bErase, bContainsText;
1243 InsertTxbxText(
nullptr,
nullptr,nTxBxS,USHRT_MAX,0,
nullptr,
false, bErase, &bContainsText,
1244 &rStartCp, &rEndCp );
1245 return bContainsText;
1254 if( !
ReadGrafStart(
static_cast<void*
>(&aTextB),
sizeof( aTextB ), pHd,
rSet ) )
1258 static_cast<sal_Int16
>(SVBT16ToUInt16( pHd->
ya )) +
m_nDrawYOfs2 );
1260 aP1.
AdjustX(
static_cast<sal_Int16
>(SVBT16ToUInt16( pHd->
dxa )) );
1261 aP1.
AdjustY(
static_cast<sal_Int16
>(SVBT16ToUInt16( pHd->
dya )) );
1269 Size aSize(
static_cast<sal_Int16
>(SVBT16ToUInt16( pHd->
dxa )) ,
1270 static_cast<sal_Int16
>(SVBT16ToUInt16( pHd->
dya )) );
1273 bool bContainsGraphics;
1275 bDummy,
nullptr,&nStartCpFly,&nEndCpFly,&bContainsGraphics);
1293 static const SdrCaptionType aCaptA[] = { SdrCaptionType::Type1, SdrCaptionType::Type2,
1294 SdrCaptionType::Type3, SdrCaptionType::Type4 };
1298 if( !
ReadGrafStart(
static_cast<void*
>(&aCallB),
sizeof( aCallB ), pHd,
rSet ) )
1304 SAL_WARN(
"sw.ww8",
"Short CaptionBox header");
1313 SAL_WARN(
"sw.ww8",
"Short CaptionBox header");
1318 if( nTyp == 1 && SVBT16ToUInt16( xP[0] ) == SVBT16ToUInt16( xP[2] ) )
1321 Point aP0(
static_cast<sal_Int16
>(SVBT16ToUInt16( pHd->
xa )) +
1323 static_cast<sal_Int16
>(SVBT16ToUInt16( pHd->
ya ))
1328 Point aP2(
static_cast<sal_Int16
>(SVBT16ToUInt16( pHd->
xa ))
1330 +
m_nDrawXOfs2 +
static_cast<sal_Int16
>(SVBT16ToUInt16( xP[0] )),
1331 static_cast<sal_Int16
>(SVBT16ToUInt16( pHd->
ya ))
1333 +
m_nDrawYOfs2 +
static_cast<sal_Int16
>(SVBT16ToUInt16( xP[1] )) );
1343 static_cast<sal_Int16
>(SVBT16ToUInt16( aCallB.
dpheadTxbx.
dya )) );
1344 bool bEraseThisObject;
1346 InsertTxbxText(pObj.get(), &aSize, 0, 0, 0,
nullptr,
false, bEraseThisObject );
1362 if( !
ReadGrafStart(
static_cast<void*
>(&nGrouped),
sizeof( nGrouped ), pHd,
rSet ) )
1366 nGrouped = (sal_Int16)OSL_SWAPWORD( nGrouped );
1374 short nLeft =
static_cast<sal_Int16
>(SVBT16ToUInt16( pHd->
cb )) -
sizeof(
WW8_DPHEAD );
1375 for (
int i = 0; i < nGrouped && nLeft >=
static_cast<short>(
sizeof(
WW8_DPHEAD)); ++
i)
1382 OSL_ENSURE(pSubGroup,
"Why no sublist available?");
1385 pObject->SetMergedItemSetAndBroadcast(aSet);
1403 OSL_ENSURE(bCouldRead,
"Graphic Primitive header short read" );
1410 if( rLeft >= SVBT16ToUInt16(aHd.
cb) )
1413 switch (SVBT16ToUInt16(aHd.
dpk) & 0xff )
1446 OSL_ENSURE(
false,
"+Grafik-Overlap" );
1448 rLeft = rLeft - SVBT16ToUInt16( aHd.
cb );
1457 if (!rPF.
Get(nStartFc, pF0))
1459 OSL_ENSURE(
false,
"+Where is the graphic (2) ?" );
1463 if( !SVBT32ToUInt32( pF->
fc ) )
1465 OSL_ENSURE(
false,
"+Where is the graphic (3) ?" );
1469 sal_uInt32 nPosFc = SVBT32ToUInt32(pF->
fc);
1479 OSL_ENSURE(bCouldSeek,
"Invalid graphic offset");
1486 OSL_ENSURE(bCouldRead,
"Short graphic header");
1490 short nLeft = SVBT16ToUInt16( aDo.
cb ) -
sizeof(
WW8_DO );
1491 while (nLeft >
static_cast<short>(
sizeof(
WW8_DPHEAD)))
1500 const sal_uInt32 nCntRelTo = 3;
1503 static const sal_Int16 aHoriRelOriTab[nCntRelTo] =
1505 text::RelOrientation::PAGE_PRINT_AREA,
1506 text::RelOrientation::PAGE_FRAME,
1507 text::RelOrientation::FRAME,
1511 static const sal_Int16 aVertRelOriTab[nCntRelTo] =
1513 text::RelOrientation::PAGE_PRINT_AREA,
1514 text::RelOrientation::PAGE_FRAME,
1515 text::RelOrientation::FRAME,
1518 const int nXAlign = aDo.
bx < nCntRelTo ? aDo.
bx : 0;
1519 const int nYAlign = aDo.
by < nCntRelTo ? aDo.
by : 0;
1522 aHoriRelOriTab[ nXAlign ]));
1524 aVertRelOriTab[ nYAlign ]));
1527 pObject->SetMergedItemSet(aSet);
1531 pDrawFrame->PosAttrSet();
1540 MSO_SPT eShapeType, sal_Int32 &rThick)
1542 sal_Int32 nOutsideThick = 0;
1557 nOutsideThick = eShapeType !=
mso_sptTextBox ? rThick : rThick/2;
1562 nOutsideThick = rThick/6;
1563 rThick = rThick*2/3;
1566 nOutsideThick = rThick*2/3;
1571 nOutsideThick = rThick*3/10;
1572 rThick = rThick*4/5;
1575 nOutsideThick = rThick*4/5;
1581 nOutsideThick = rThick/10;
1582 rThick = rThick*3/5;
1585 nOutsideThick = rThick*3/5;
1591 return nOutsideThick;
1601 sal_Int32 nOutsideThick = 0;
1603 return nOutsideThick;
1607 sal_Int32 nLineThick=rLineThick;
1609 eShapeType, rLineThick);
1621 switch( +eLineStyle )
1625 nIdx = SvxBorderLineStyle::SOLID;
1629 nIdx = SvxBorderLineStyle::DOUBLE;
1632 nIdx = SvxBorderLineStyle::THICKTHIN_SMALLGAP;
1635 nIdx = SvxBorderLineStyle::THINTHICK_SMALLGAP;
1639 nIdx = SvxBorderLineStyle::DOUBLE;
1646 OSL_ENSURE(
false,
"eLineStyle is not (yet) implemented!");
1653 nIdx = SvxBorderLineStyle::DASHED;
1656 nIdx = SvxBorderLineStyle::DOTTED;
1662 if (SvxBorderLineStyle::NONE != nIdx)
1664 SvxBorderLine aLine;
1665 aLine.SetColor( rLineColor );
1667 aLine.SetWidth( nLineThick );
1668 aLine.SetBorderLineStyle(nIdx);
1677 return nOutsideThick;
1680#define WW8ITEMVALUE(ItemSet,Id,Cast) ItemSet.GetItem<Cast>(Id)->GetValue()
1708 static sal_uInt16
const aDirectMatch[]
1714 for(sal_uInt16
i : aDirectMatch)
1715 if( SfxItemState::SET == rOldSet.
GetItemState(
i,
false, &pPoolItem) )
1717 rFlySet.
Put( *pPoolItem );
1721 bool bSkipResBackground =
false;
1729 while ( pAttrPool && !pAttrPool->
IsInRange(
i) )
1734 if ( SfxItemState::SET == rOldSet.
GetItemState(
i,
false, &pPoolItem) )
1736 rFlySet.
Put( *pPoolItem );
1742 if ( eFill != drawing::FillStyle_NONE )
1743 bSkipResBackground =
true;
1754 sal_Int32 nLineThick = 15, nOutside=0;
1759 if( eState == SfxItemState::SET )
1770 eDashing, eShapeType, nLineThick, aBox);
1784 if( 0 < rInnerDist.
Left() )
1785 aBox.
SetDistance( o3tl::narrowing<sal_uInt16>(rInnerDist.
Left()), SvxBoxItemLine::LEFT );
1786 if( 0 < rInnerDist.
Top() )
1787 aBox.
SetDistance( o3tl::narrowing<sal_uInt16>(rInnerDist.
Top()), SvxBoxItemLine::TOP );
1788 if( 0 < rInnerDist.
Right() )
1789 aBox.
SetDistance( o3tl::narrowing<sal_uInt16>(rInnerDist.
Right()), SvxBoxItemLine::RIGHT );
1790 if( 0 < rInnerDist.
Bottom() )
1791 aBox.
SetDistance( o3tl::narrowing<sal_uInt16>(rInnerDist.
Bottom()), SvxBoxItemLine::BOTTOM );
1814 rFlySet.
Put( aNewSize );
1831 rFlySet.
Put( aBox );
1850 if( 0 <= nShdDistX )
1852 if( 0 <= nShdDistY )
1853 eShdPosi = SvxShadowLocation::BottomRight;
1855 eShdPosi = SvxShadowLocation::TopRight;
1859 if( 0 <= nShdDistY )
1860 eShdPosi = SvxShadowLocation::BottomLeft;
1862 eShdPosi = SvxShadowLocation::TopLeft;
1866 rFlySet.
Put( aShadow );
1869 bool bBrushItemOk =
false;
1874 if (!bSkipResBackground && eState == SfxItemState::SET)
1878 nTrans =
sal_uInt8((nRes * 0xFE) / 100);
1880 bBrushItemOk =
true;
1885 if (!bSkipResBackground && pFillStyleItem)
1887 const drawing::FillStyle eFill = pFillStyleItem->GetValue();
1892 case drawing::FillStyle_NONE:
1897 bBrushItemOk =
true;
1900 case drawing::FillStyle_SOLID:
1901 case drawing::FillStyle_GRADIENT:
1903 const Color aColor =
1910 bBrushItemOk =
true;
1913 case drawing::FillStyle_HATCH:
1915 case drawing::FillStyle_BITMAP:
1930 bBrushItemOk =
true;
1937 rFlySet.
Put(aBrushItem);
1953 if ((nXRelTo == 0) || (nXRelTo == 2))
1961 if ((nXRelTo == 0) || (nXRelTo == 2))
1966 if ((rRecord.
nXAlign == 4) && (nXRelTo == 0))
1972 if ((rRecord.
nXAlign == 5) && (nXRelTo == 0))
1991 if ((nYRelTo == 0) || (nYRelTo == 1))
1999 if ((nYRelTo == 0) || (nYRelTo == 1))
2004 if ((rRecord.
nYAlign == 4) && (nYRelTo == 0))
2078 const Size &rSize = pNd->GetTwipSize();
2088 aPoly.
Move(nMove, 0);
2092 aPoly.
Scale(
double(aHackX),
double(aHackY));
2095 const Size &rOrigSize = pNd->GetGraphic().GetPrefSize();
2098 aPoly.
Scale(
double(aMapPolyX),
double(aMapPolyY));
2102 pNd->SetContour(&aPoly);
2111 case SdrObjKind::Text:
2113 case SdrObjKind::SwFlyDrawObjIdentifier:
2129 sal_Int32
const nIntegral(
static_cast<sal_Int32
>(nCrop) >> 16);
2131 if (
abs(nIntegral) >= 50)
2133 SAL_INFO(
"sw.ww8",
"ignoring suspiciously large crop: " << nIntegral);
2136 return (nIntegral * nSize) + (((nCrop & 0xffff) * nSize) >> 16);
2151 sal_uInt64 nHeight = aSz.
Height();
2152 sal_uInt64 nWidth = aSz.
Width();
2155 else if (!nHeight && pF)
2183 bool bFlipH(rRecord.
nFlags & ShapeFlag::FlipH);
2184 bool bFlipV(rRecord.
nFlags & ShapeFlag::FlipV);
2185 if ( bFlipH || bFlipV )
2221 pGrfNd->
SetAttr( aLuminance );
2233 if ( nGrafMode != GraphicDrawMode::Standard)
2251 pNewObject = pContactObject->
GetMaster();
2260 sal_Int16 eHoriOri, sal_Int16 eHoriRel)
2290 const sal_uInt32 nCntXAlign = 6;
2291 const sal_uInt32 nCntYAlign = 6;
2293 const sal_uInt32 nCntRelTo = 4;
2295 sal_uInt32 nXAlign = nCntXAlign > rRecord.
nXAlign ? rRecord.
nXAlign : 1;
2296 sal_uInt32 nYAlign = nCntYAlign > rRecord.
nYAlign ? rRecord.
nYAlign : 1;
2302 const bool bXYRelHaveDefaultValues = *rRecord.
nXRelTo == 2 && *rRecord.
nYRelTo == 2;
2303 if (bXYRelHaveDefaultValues &&
m_nInTable > 0 && !bCurSectionVertical)
2305 if (sal_uInt32(rFSPA.
nby) != rRecord.
nYRelTo)
2316 rFlySet.
Put( aAnchor );
2323 static const sal_Int16 aHoriOriTab[ nCntXAlign ] =
2326 text::HoriOrientation::LEFT,
2327 text::HoriOrientation::CENTER,
2328 text::HoriOrientation::RIGHT,
2331 text::HoriOrientation::LEFT,
2332 text::HoriOrientation::RIGHT
2336 static const sal_Int16 aVertOriTab[ nCntYAlign ] =
2339 text::VertOrientation::TOP,
2340 text::VertOrientation::CENTER,
2341 text::VertOrientation::BOTTOM,
2342 text::VertOrientation::LINE_TOP,
2343 text::VertOrientation::LINE_BOTTOM
2347 static const sal_Int16 aToLineVertOriTab[ nCntYAlign ] =
2350 text::VertOrientation::LINE_BOTTOM,
2351 text::VertOrientation::LINE_CENTER,
2352 text::VertOrientation::LINE_TOP,
2353 text::VertOrientation::LINE_BOTTOM,
2354 text::VertOrientation::LINE_TOP
2358 static const sal_Int16 aHoriRelOriTab[nCntRelTo] =
2360 text::RelOrientation::PAGE_PRINT_AREA,
2361 text::RelOrientation::PAGE_FRAME,
2362 text::RelOrientation::FRAME,
2363 text::RelOrientation::CHAR
2368 static const sal_Int16 aVertRelOriTab[nCntRelTo] =
2370 text::RelOrientation::PAGE_PRINT_AREA,
2371 text::RelOrientation::PAGE_FRAME,
2372 text::RelOrientation::FRAME,
2373 text::RelOrientation::TEXT_LINE
2384 if (eHoriOri == text::HoriOrientation::LEFT && eHoriRel == text::RelOrientation::PAGE_FRAME)
2388 eHoriRel = text::RelOrientation::PAGE_PRINT_AREA;
2393 else if (eHoriOri == text::HoriOrientation::RIGHT && eHoriRel == text::RelOrientation::PAGE_FRAME)
2397 eHoriRel = text::RelOrientation::PAGE_RIGHT;
2423 (eHoriRel == text::RelOrientation::FRAME || eHoriRel == text::RelOrientation::CHAR) &&
2427 eHoriRel = text::RelOrientation::PAGE_PRINT_AREA;
2432 if (eHoriOri == text::HoriOrientation::LEFT)
2434 else if (eHoriOri == text::HoriOrientation::RIGHT)
2439 eVertRel = aVertRelOriTab[ nYRelTo ];
2440 if (bCurSectionVertical && nYRelTo == 2)
2441 eVertRel = text::RelOrientation::PAGE_PRINT_AREA;
2444 if (eVertRel == text::RelOrientation::TEXT_LINE)
2446 eVertOri = aToLineVertOriTab[ nYAlign ];
2450 eVertOri = aVertOriTab[ nYAlign ];
2461 bCurSectionVertical ? eVertOri : eHoriOri,
2462 bCurSectionVertical ? eVertRel : eHoriRel);
2465 rFlySet.
Put(aHoriOri);
2468 !bCurSectionVertical ? eVertOri : eHoriOri,
2469 !bCurSectionVertical ? eVertRel : eHoriRel));
2477 bool bIsObjectLayoutInTableCell =
false;
2481 sal_uInt16 nWWVersion =
m_xWwFib->m_nProduct & 0xE000;
2482 if (nWWVersion == 0)
2488 nWWVersion = 0x2000;
2492 switch ( nWWVersion )
2496 bIsObjectLayoutInTableCell =
false;
2497 OSL_ENSURE(nGroupShapeBooleanProperties == 0,
2498 "no explicit object attribute layout in table cell expected." );
2509 bool fUsefLayoutInCell = (nGroupShapeBooleanProperties & 0x80000000) >> 31;
2510 bool fLayoutInCell = (nGroupShapeBooleanProperties & 0x8000) >> 15;
2512 bIsObjectLayoutInTableCell = !fUsefLayoutInCell || fLayoutInCell;
2517 OSL_FAIL(
"unknown version." );
2522 return bIsObjectLayoutInTableCell;
2540 OSL_ENSURE(
false,
"Where is the graphic (1) ?" );
2556 pPF->
SeekPos( nGrafAnchorCp );
2560 if (!pPF->
Get(nStartFc, pF0))
2562 OSL_ENSURE(
false,
"+Where is the graphic (2) ?" );
2571 OSL_ENSURE(
false,
"+Where is the graphic (3) ?" );
2586 OSL_ENSURE(
false,
"Where is the Shape ?" );
2592 if (
pObject->GetRotateAngle())
2603 bool bReplaceable =
false;
2605 switch (
pObject->GetObjIdentifier())
2607 case SdrObjKind::Graphic:
2608 bReplaceable =
true;
2611 case SdrObjKind::OLE2:
2612 bReplaceable =
true;
2624 css::text::WrapTextMode eSurround = css::text::WrapTextMode_PARALLEL;
2625 bool bContour =
false;
2630 eSurround = css::text::WrapTextMode_PARALLEL;
2633 eSurround = css::text::WrapTextMode_NONE;
2640 eSurround = css::text::WrapTextMode_THROUGH;
2644 eSurround = css::text::WrapTextMode_PARALLEL;
2650 if ((2 == aFSFA.
nwr) || (4 == aFSFA.
nwr))
2656 eSurround = css::text::WrapTextMode_PARALLEL;
2660 eSurround = css::text::WrapTextMode_LEFT;
2664 eSurround = css::text::WrapTextMode_RIGHT;
2668 eSurround = css::text::WrapTextMode_DYNAMIC;
2676 aFlySet.Put( aSur );
2680 OSL_ENSURE(!((
aData.size() != 1) && bReplaceable),
2681 "Replaceable drawing with > 1 entries ?");
2683 if (
aData.size() != 1)
2684 bReplaceable =
false;
2691 OSL_ENSURE(pRecord,
"how did that happen?");
2698 const bool bLayoutInTableCell =
2703 if (bLayoutInTableCell)
2706 aFlySet.Put( aFollowTextFlow );
2721 OUString lnName, aObjName, aTarFrame;
2722 for (sal_uInt16
i = 0;
i <
nCount;
i++ )
2725 if(
pData &&
pData->GetInventor() == SdrInventor::ScOrSwDraw
2738 std::unique_ptr<SwFormatURL> pFormatURL(
new SwFormatURL());
2739 pFormatURL->SetURL( lnName,
false );
2740 if (!aObjName.isEmpty())
2741 pFormatURL->SetName(aObjName);
2742 if (!aTarFrame.isEmpty())
2743 pFormatURL->SetTargetFrameName(aTarFrame);
2744 pFormatURL->SetMap(
nullptr);
2745 aFlySet.Put(std::move(pFormatURL));
2754 const bool bMoveToBackground = pRecord->
bDrawHell ||
2756 if ( bMoveToBackground )
2759 OUString aObjName =
pObject->GetName();
2761 bool bDrawObj =
false;
2762 bool bFrame =
false;
2788 if (pRetFrameFormat)
2799 if ( bMoveToBackground )
2819 eAnchor,
"Not the anchor type requested!");
2824 for (
const auto& it :
aData)
2830 *pRecord, nGrafAnchorCp, pRetFrameFormat);
2838 if (pDrawFrameFormat)
2844 if (pRetFrameFormat )
2846 if (!aObjName.isEmpty())
2848 if (pRetFrameFormat->
GetName().isEmpty())
2889 pThisGroup->GetCurrentBoundRect());
2897 pSdrTextObj->SetMergedItemSet(aSet);
2898 pSdrTextObj->NbcSetLayer( pThisGroup->GetLayer() );
2899 pThisGroup->GetSubList()->NbcInsertObject(pSdrTextObj.get());
2906 Size aObjSize(pSdrTextObj->GetSnapRect().GetWidth(),
2907 pSdrTextObj->GetSnapRect().GetHeight());
2910 SdrObject* pGroupObject = pSdrTextObj->getParentSdrObjectFromSdrObject();
2912 const size_t nOrdNum = pSdrTextObj->GetOrdNum();
2913 bool bEraseThisObject;
2915 nGrafAnchorCp, pRetFrameFormat,
2916 (pSdrTextObj.get() != pTrueObject.get()) || (
nullptr != pGroupObject), bEraseThisObject,
2917 nullptr,
nullptr,
nullptr,
nullptr, &rRecord);
2920 if (bEraseThisObject)
2922 if( pGroupObject || (pSdrTextObj.get() != pTrueObject.get()) )
2929 if (pSdrTextObj.get() != pNewObj)
2934 rRecord.
pObj = pNewObj;
2942 if( pSdrTextObj->getSdrPageFromSdrObject() )
2947 pRetFrameFormat =
nullptr;
2949 rRecord.
pObj =
nullptr;
2961 pSdrTextObj->SetMergedItemSetAndBroadcast(aItemSet);
2964 return pRetFrameFormat;
2993 rFlySet.
Put(aFrameSize);
3004 "Not the anchor type requested!");
3038 if (!rpOurNewObject->IsInserted())
3058 bool bJoined =
ReadText(nStartCp, (nEndCp-nStartCp),
3072 return pRetFrameFormat;
3119 OUString aObjectName(rpObject->GetName());
3120 if (SdrObjKind::OLE2 == rpObject->GetObjIdentifier())
3139 *
m_pPaM, aGrfName, OUString(),
nullptr,
3140 &rFlySet, &aGrSet,
nullptr);
3148 *
m_pPaM, OUString(), OUString(), &rGraph,
3149 &rFlySet, &aGrSet,
nullptr);
3153 if (pRetFrameFormat)
3155 if (SdrObjKind::OLE2 != rpObject->GetObjIdentifier())
3167 if( rpObject->getSdrPageFromSdrObject() )
3185 if (!rpOurNewObject->IsInserted())
3192 return pRetFrameFormat;
3226 "Don't use fltanchors with inline frames, slap!");
3232 size_t nCnt =
size();
3233 for (
size_t i=0;
i < nCnt; ++
i)
sal_uInt8 GetBlue() const
void SetGreen(sal_uInt8 nGreen)
void SetRed(sal_uInt8 nRed)
sal_uInt8 GetGreen() const
void SetAlpha(sal_uInt8 nAlpha)
void SetBlue(sal_uInt8 nBlue)
sal_Int32 GetParagraphCount() const
void QuickDelete(const ESelection &rSel)
sal_Int32 GetTextLen() const
void SetAlpha(sal_uInt8 cAlpha)
const GraphicAttr & GetAttr() const
void SetAttr(const GraphicAttr &rAttr)
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 SwDrawModel * GetOrCreateDrawModel()=0
virtual const SwDrawModel * GetDrawModel() const =0
Draw Model and id accessors.
void SetOutlinerMode(OutlinerMode nNew)
void SetVertical(bool bNew)
void setX(tools::Long nX)
void setY(tools::Long nY)
tools::Long AdjustY(tools::Long nVertMove)
tools::Long AdjustX(tools::Long nHorzMove)
static void ResetFrameFormatAttrs(SfxItemSet &rFrameSet)
bool IsLinkedGraphic() const
const OUString & GetFileName() const
const Graphic & GetGraphic() const
GraphicType GetGraphicType() const
const SfxItemPool & GetItemPool() const
const SdrPage * GetPage(sal_uInt16 nPgNum) const
virtual void InsertObject(SdrObject *pObj, size_t nPos=SAL_MAX_SIZE)
SdrObject * GetObj(size_t nNum) const
virtual rtl::Reference< SdrObject > RemoveObject(size_t nObjNum)
sal_uInt32 GetOrdNum() const
virtual SdrObjList * GetSubList() const
virtual const tools::Rectangle & GetCurrentBoundRect() const
virtual const tools::Rectangle & GetSnapRect() const
virtual SdrObjKind GetObjIdentifier() const
const SfxItemSet & GetMergedItemSet() const
SdrObject * getParentSdrObjectFromSdrObject() const
virtual SdrLayerID GetLayer() const
virtual void SetVerticalWriting(bool bVertical)
virtual void NbcSetOutlinerParaObject(std::optional< OutlinerParaObject > pTextObject) override
virtual bool IsVerticalWriting() const
void SetValue(EnumT nTheValue)
sal_uInt16 GetWhich(sal_uInt16 nSlot, bool bDeep=true) const
SfxItemPool * GetSecondaryPool() const
sal_uInt16 GetSlotId(sal_uInt16 nWhich) const
bool IsInRange(sal_uInt16 nWhich) const
SfxItemPool * GetMasterPool() const
SfxItemPool * GetPool() const
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SfxPoolItem * GetItem(sal_uInt16 nWhich, bool bSearchInParent=true) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
std::unique_ptr< SfxPoolItem > CloneSetWhich(sal_uInt16 nNewWhich) const
constexpr tools::Long Height() const
constexpr tools::Long Width() const
sal_uInt64 Seek(sal_uInt64 nPos)
sal_uInt64 SeekRel(sal_Int64 nPos)
void SetLine(const editeng::SvxBorderLine *pNew, SvxBoxItemLine nLine)
sal_uInt16 CalcLineWidth(SvxBoxItemLine nLine) const
void SetDistance(sal_Int16 nNew, SvxBoxItemLine nLine)
void SetGraphicPos(SvxGraphicPosition eNew)
const Color & GetColor() const
void SetColor(const Color &rCol)
void SetGraphicObject(const GraphicObject &rNewObj)
void SetTop(sal_Int32 nVal)
void SetLeft(sal_Int32 nVal)
void SetBottom(sal_Int32 nVal)
void SetRight(sal_Int32 nVal)
void SetRight(const tools::Long nR, const sal_uInt16 nProp=100)
void SetLeft(const tools::Long nL, const sal_uInt16 nProp=100)
void SetLocation(SvxShadowLocation eNew)
void SetWidth(sal_uInt16 nNew)
void SetColor(const Color &rNew)
tools::Long GetHeight() const
tools::Long GetWidth() const
void SetLower(const sal_uInt16 nL, const sal_uInt16 nProp=100)
void SetUpper(const sal_uInt16 nU, const sal_uInt16 nProp=100)
const SwMirrorGrf & GetMirrorGrf(bool=true) const
const SwAttrSet & GetSwAttrSet() const
Does node has already its own auto-attributes? Access to SwAttrSet.
virtual bool SetAttr(const SfxPoolItem &)
made virtual
SwFlyFrameFormat * MakeFlySection(RndStdIds eAnchorType, const SwPosition *pAnchorPos, const SfxItemSet *pSet=nullptr, SwFrameFormat *pParent=nullptr, bool bCalledFromShell=false)
IDocumentContentOperations const & getIDocumentContentOperations() const
OUString GetUniqueDrawObjectName() const
void DelFrameFormat(SwFrameFormat *pFormat, bool bBroadcast=false)
const SwAttrPool & GetAttrPool() const
OUString GetUniqueFrameName() const
IDocumentDrawModelAccess const & getIDocumentDrawModelAccess() const
void DeleteAndDestroy(Entries::size_type nCnt)
void NewAttr(const SwPosition &rPos, const SfxPoolItem &rAttr)
Entries::size_type size() const
virtual void SetAttrInDoc(const SwPosition &rTmpPos, SwFltStackEntry &rEntry)
const SwNodeIndex * GetContentIdx() const
virtual Size GetTwipSize() const override
static sal_Int32 GetEscherLineMatch(MSO_LineStyle eStyle, MSO_SPT eShapeType, sal_Int32 &rThick)
const OUString & GetHlink() const
const OUString & GetTarFrame() const
const OUString & GetName() const
const sal_Int32 & GetShapeId() const
Layout frame for SwNoTextNode, i.e. graphics and OLE nodes (including charts).
Marks a node in the document model.
SwNodeOffset GetIndex() const
const SwPosition * GetPoint() const
void AddAnchor(const SwPosition &rPos, SwFrameFormat *pFormat)
bool ReadText(WW8_CP nStartCp, WW8_CP nTextLen, ManTypes nType)
RndStdIds ProcessEscherAlign(SvxMSDffImportRec &rRecord, WW8_FSPA &rFSPA, SfxItemSet &rFlySet)
rtl::Reference< SdrObject > ReadGroup(WW8_DPHEAD const *pHd, SfxAllItemSet &rSet)
rtl::Reference< SdrObject > ReadPolyLine(WW8_DPHEAD const *pHd, SfxAllItemSet &rSet)
static void StripNegativeAfterIndent(SwFrameFormat const *pFlyFormat)
bool IsObjectLayoutInTableCell(const sal_uInt32 nGroupShapeBooleanProperties) const
std::unique_ptr< SwMSConvertControls > m_xFormImpl
static void AdjustULWrapForWordMargins(const SvxMSDffImportRec &rRecord, SvxULSpaceItem &rUL)
SwFrameFormat * ImportOle(const Graphic *=nullptr, const SfxItemSet *pFlySet=nullptr, const SfxItemSet *pGrfSet=nullptr, const tools::Rectangle &aVisArea=tools::Rectangle())
sal_Int32 GetRangeAsDrawingString(OUString &rString, tools::Long StartCp, tools::Long nEndCp, ManTypes eType)
SwFlyFrameFormat * ImportReplaceableDrawables(rtl::Reference< SdrObject > &rpObject, rtl::Reference< SdrObject > &rpOurNewObject, SvxMSDffImportRec &rRecord, WW8_FSPA &rF, SfxItemSet &rFlySet)
void InsertAttrsAsDrawingAttrs(WW8_CP nStartCp, WW8_CP nEndCp, ManTypes eType, bool bONLYnPicLocFc=false)
void SetAttributesAtGrfNode(const SvxMSDffImportRec &rRecord, const SwFrameFormat &rFlyFormat, WW8_FSPA const *pF)
std::unique_ptr< SwWW8FltControlStack > m_xCtrlStck
SwFlyFrameFormat * ConvertDrawTextToFly(rtl::Reference< SdrObject > &rpObject, rtl::Reference< SdrObject > &rpOurNewObject, const SvxMSDffImportRec &rRecord, RndStdIds eAnchor, const WW8_FSPA &rF, SfxItemSet &rFlySet)
bool ReadGrafStart(void *pData, short nDataSiz, WW8_DPHEAD const *pHd, SfxAllItemSet &rSet)
tools::Long Read_Field(WW8PLCFManResult *pRes)
static void MapWrapIntoFlyFormat(const SvxMSDffImportRec &rRecord, SwFrameFormat &rFlyFormat)
SwFlyFrameFormat * InsertOle(SdrOle2Obj &rObject, const SfxItemSet &rFlySet, const SfxItemSet *rGrfSet)
SwTwips MoveOutsideFly(SwFrameFormat *pFlyFormat, const SwPosition &rPos, bool bTableJoin=true)
std::shared_ptr< WW8Fib > m_xWwFib
rtl::Reference< SdrObject > ReadRect(WW8_DPHEAD const *pHd, SfxAllItemSet &rSet)
wwSectionManager m_aSectionManager
SwFrameFormat * ImportGraf(SdrTextObj const *pTextObj=nullptr, SwFrameFormat const *pFlyFormat=nullptr)
void ReadGrafLayer1(WW8PLCFspecial &rPF, tools::Long nGrafAnchorCp)
std::optional< OutlinerParaObject > ImportAsOutliner(OUString &rString, WW8_CP nStartCp, WW8_CP nEndCp, ManTypes eType)
sal_uInt16 m_nCurrentColl
rtl::Reference< SdrObject > ReadEllipse(WW8_DPHEAD const *pHd, SfxAllItemSet &rSet)
std::unique_ptr< EditEngine > m_pDrawEditEngine
static sal_Int32 MatchSdrBoxIntoFlyBoxItem(const Color &rLineColor, MSO_LineStyle eLineStyle, MSO_LineDashing eDashing, MSO_SPT eShapeType, sal_Int32 &rLineWidth, SvxBoxItem &rBox)
bool GetTxbxTextSttEndCp(WW8_CP &rStartCp, WW8_CP &rEndCp, sal_uInt16 nTxBxS, sal_uInt16 nSequence)
rtl_TextEncoding GetCurrentCharSet()
rtl::Reference< SdrObject > ReadGrafPrimitive(short &rLeft, SfxAllItemSet &rSet)
rtl::Reference< SdrObject > ImportOleBase(Graphic &rGraph, const Graphic *pGrf=nullptr, const SfxItemSet *pFlySet=nullptr, const tools::Rectangle &aVisArea=tools::Rectangle())
std::shared_ptr< WW8PLCFMan > m_xPlcxMan
rtl::Reference< SdrObject > ReadTextBox(WW8_DPHEAD const *pHd, SfxAllItemSet &rSet)
void EndSprm(sal_uInt16 nId)
std::unique_ptr< SwMSDffManager > m_xMSDffManager
bool IsInlineEscherHack() const
std::deque< WW8FieldEntry > m_aFieldStack
SwFrameFormat * MungeTextIntoDrawBox(SvxMSDffImportRec &rRecord, tools::Long nGrafAnchorCp, SwFrameFormat *pRetFrameFormat)
void MoveInsideFly(const SwFrameFormat *pFlyFormat)
void Read_Obj(sal_uInt16, const sal_uInt8 *, short nLen)
wwFrameNamer m_aGrfNameGenerator
std::unique_ptr< wwZOrderer > m_xWWZOrder
void Read_PicLoc(sal_uInt16, const sal_uInt8 *pData, short nLen)
rtl::Reference< SdrObject > ReadArc(WW8_DPHEAD const *pHd, SfxAllItemSet &rSet)
std::set< sal_uLong > m_aGrafPosSet
SdrObject * CreateContactObject(SwFrameFormat *pFlyFormat)
void InsertTxbxStyAttrs(SfxItemSet &rS, sal_uInt16 nColl)
std::unique_ptr< WW8ScannerBase > m_xSBase
friend class SwMSDffManager
std::unique_ptr< SwWW8FltAnchorStack > m_xAnchorStck
SwFrameFormat * AddAutoAnchor(SwFrameFormat *pFormat)
static void AdjustLRWrapForWordMargins(const SvxMSDffImportRec &rRecord, SvxLRSpaceItem &rLR)
rtl::Reference< SdrObject > ReadLine(WW8_DPHEAD const *pHd, SfxAllItemSet &rSet)
bool MiserableRTLGraphicsHack(SwTwips &rLeft, SwTwips nWidth, sal_Int16 eHoriOri, sal_Int16 eHoriRel)
SwWW8StyInf * GetStyle(sal_uInt16 nColl) const
std::optional< wwSprmParser > m_oSprmParser
void MatchSdrItemsIntoFlySet(SdrObject const *pSdrObj, SfxItemSet &aFlySet, MSO_LineStyle eLineStyle, MSO_LineDashing eDashing, MSO_SPT eShapeType, tools::Rectangle &rInnerDist)
rtl::Reference< SdrObject > ReadCaptionBox(WW8_DPHEAD const *pHd, SfxAllItemSet &rSet)
SwFrameFormat * Read_GrafLayer(tools::Long nGrafAnchorCp)
short ImportSprm(const sal_uInt8 *pPos, sal_Int32 nMemLen, sal_uInt16 nId=0)
void InsertTxbxText(SdrTextObj *pTextObj, Size const *pObjSiz, sal_uInt16 nTxBxS, sal_uInt16 nSequence, tools::Long nPosCp, SwFrameFormat const *pFlyFormat, bool bMakeSdrGrafObj, bool &rbEraseTextObj, bool *pbTestTxbxContainsText=nullptr, tools::Long *pnStartCp=nullptr, tools::Long *pnEndCp=nullptr, bool *pbContainsGraphics=nullptr, SvxMSDffImportRec const *pRecord=nullptr)
bool TxbxChainContainsRealText(sal_uInt16 nTxBxS, tools::Long &rStartCp, tools::Long &rEndCp)
among others for fields, that is, the same number of attr as positions, if Ctor-Param bNoEnd = false
bool Get(WW8_CP &rStart, void *&rpValue) const
bool SeekPos(tools::Long nPos)
void SetIdx(tools::Long nI)
tools::Long GetIMax() const
iterator for Piece Table Exceptions of Fkps works on CPs (high-level)
virtual void GetSprms(WW8PLCFxDesc *p) override
void GetPCDSprms(WW8PLCFxDesc &rDesc)
void Restore(SwWW8ImplReader *pRdr)
const SwPosition & GetStartPos() const
simple Iterator for SPRMs
const sal_uInt8 * GetSprms() const
const sal_uInt8 * GetCurrentParams() const
void SetSprms(const sal_uInt8 *pSprms_, sal_Int32 nLen_)
sal_uInt16 GetCurrentId() const
void SetDashLen(double nNewDashLen)
void SetDots(sal_uInt16 nNewDots)
void SetDistance(double nNewDistance)
void SetDashes(sal_uInt16 nNewDashes)
void append(const basegfx::B2DPoint &rPoint, sal_uInt32 nCount)
void setClosed(bool bNew)
void emplace(Args &&... args)
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_Int32 mnImportedGraphicsCount
bool CurrentSectionIsVertical() const
sal_uInt32 GetPageWidth() const
sal_uInt32 GetPageRight() const
sal_uInt32 GetPageLeft() const
constexpr ::Color COL_LIGHTRED(0xFF, 0x00, 0x00)
constexpr ::Color COL_GREEN(0x00, 0x80, 0x00)
constexpr ::Color COL_WHITE(0xFF, 0xFF, 0xFF)
constexpr ::Color COL_LIGHTCYAN(0x00, 0xFF, 0xFF)
constexpr ::Color COL_MAGENTA(0x80, 0x00, 0x80)
constexpr ::Color COL_LIGHTMAGENTA(0xFF, 0x00, 0xFF)
constexpr ::Color COL_BROWN(0x80, 0x80, 0x00)
constexpr ::Color COL_YELLOW(0xFF, 0xFF, 0x00)
constexpr ::Color COL_RED(0x80, 0x00, 0x00)
constexpr ::Color COL_LIGHTGRAY(0xC0, 0xC0, 0xC0)
constexpr ::Color COL_LIGHTBLUE(0x00, 0x00, 0xFF)
constexpr ::Color COL_CYAN(0x00, 0x80, 0x80)
constexpr ::Color COL_LIGHTGREEN(0x00, 0xFF, 0x00)
constexpr ::Color COL_BLUE(0x00, 0x00, 0x80)
constexpr ::Color COL_BLACK(0x00, 0x00, 0x00)
virtual OUString GetURL() const override
constexpr TypedWhichId< SvxFieldItem > EE_FEATURE_FIELD(EE_FEATURE_NOTCONV+1)
constexpr TypedWhichId< SvxColorItem > EE_CHAR_BKGCOLOR(EE_CHAR_START+32)
EmbeddedObjectRef * pObject
@ Fixed
Frame cannot be moved in Var-direction.
@ Variable
Frame is variable in Var-direction.
constexpr TypedWhichId< SvxFrameDirectionItem > RES_FRAMEDIR(126)
constexpr sal_uInt16 RES_FRMATR_BEGIN(RES_PARATR_LIST_END)
constexpr sal_uInt16 POOLATTR_BEGIN(HINT_BEGIN)
constexpr sal_uInt16 RES_FLTRATTR_END(197)
constexpr TypedWhichId< SwFormatFrameSize > RES_FRM_SIZE(89)
constexpr sal_uInt16 RES_GRFATR_BEGIN(RES_FRMATR_END)
constexpr TypedWhichId< SwFormatHoriOrient > RES_HORI_ORIENT(109)
constexpr TypedWhichId< SvxShadowItem > RES_SHADOW(113)
constexpr TypedWhichId< SwFormatVertOrient > RES_VERT_ORIENT(108)
constexpr sal_uInt16 RES_FRMATR_END(141)
constexpr TypedWhichId< SwFormatINetFormat > RES_TXTATR_INETFMT(51)
constexpr TypedWhichId< SvxBrushItem > RES_CHRATR_HIGHLIGHT(42)
constexpr TypedWhichId< SvxBrushItem > RES_BACKGROUND(111)
constexpr TypedWhichId< SvxBrushItem > RES_CHRATR_BACKGROUND(21)
constexpr TypedWhichId< SvxOpaqueItem > RES_OPAQUE(105)
constexpr TypedWhichId< SvxBoxItem > RES_BOX(112)
constexpr sal_uInt16 RES_FLTRATTR_BEGIN(RES_FORMAT_MSG_END)
constexpr sal_uInt16 RES_GRFATR_END(156)
constexpr TypedWhichId< SvxLRSpaceItem > RES_LR_SPACE(97)
constexpr TypedWhichId< SvxULSpaceItem > RES_UL_SPACE(98)
constexpr sal_uInt16 POOLATTR_END(RES_UNKNOWNATR_END)
#define SAL_WARN_IF(condition, area, stream)
#define SAL_WARN(area, stream)
#define SAL_INFO(area, stream)
#define SAL_N_ELEMENTS(arr)
void SetProgressState(tools::Long nPosition, SwDocShell const *pDocShell)
std::unique_ptr< sal_Int32[]> pData
const sal_uInt16 LN_CObjLocation
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)
sal_Int32 indexOfAny(std::u16string_view rIn, sal_Unicode const *const pChars, sal_Int32 const nPos)
OStringBuffer & padToLength(OStringBuffer &rBuffer, sal_Int32 nLength, char cFill='\0')
constexpr T saturating_sub(T a, T b)
SwNoTextNode * GetNoTextNodeFromSwFrameFormat(const SwFrameFormat &rFormat)
Get the SwNoTextNode associated with a SwFrameFormat if here is one.
SwTwips MakeSafePositioningValue(SwTwips nIn)
Clips a value to MAX/MIN 16bit value to make it safe for use as a position value to give to writer.
const int nWrap100Percent
For custom wrapping.
SwNodeOffset abs(const SwNodeOffset &a)
SdrOnOffItem makeSdrShadowItem(bool bShadow)
SdrMetricItem makeSdrShadowXDistItem(tools::Long nDist)
SdrMetricItem makeSdrShadowYDistItem(tools::Long nDist)
SdrOnOffItem makeSdrTextAutoGrowHeightItem(bool bAuto)
SdrOnOffItem makeSdrTextAutoGrowWidthItem(bool bAuto)
SdrMetricItem makeSdrTextUpperDistItem(tools::Long mnHeight)
SdrMetricItem makeSdrTextRightDistItem(tools::Long mnHeight)
SdrMetricItem makeSdrTextLowerDistItem(tools::Long mnHeight)
SdrMetricItem makeSdrTextLeftDistItem(tools::Long mnHeight)
TOOLS_DLLPUBLIC bool checkSeek(SvStream &rSt, sal_uInt64 nOffset)
sal_uInt32 nGroupShapeBooleanProperties
std::optional< sal_uInt32 > nXRelTo
sal_Int32 nDxWrapDistLeft
sal_Int32 nCropFromBottom
std::optional< tools::Polygon > pWrapPolygon
static const int RELTO_DEFAULT
rtl::Reference< SdrObject > pObj
std::optional< sal_uInt32 > nYRelTo
MSO_LineDashing eLineDashing
sal_Int32 nDxWrapDistRight
sal_Int32 nDyWrapDistBottom
Marks a position in the document model.
const sal_uInt8 * pMemPos
const sal_uInt8 * pMemPos
WW8_DP_POLYLINE dpPolyLine
WW8_DPHEAD dpheadPolyLine
constexpr TypedWhichId< SdrOnOffItem > SDRATTR_SHADOW(SDRATTR_SHADOW_FIRST+0)
constexpr TypedWhichId< SdrGrafLuminanceItem > SDRATTR_GRAFLUMINANCE(SDRATTR_GRAF_FIRST+3)
constexpr TypedWhichId< SdrGrafModeItem > SDRATTR_GRAFMODE(SDRATTR_GRAF_FIRST+8)
constexpr TypedWhichId< SdrMetricItem > SDRATTR_SHADOWYDIST(SDRATTR_SHADOW_FIRST+3)
constexpr TypedWhichId< SdrGrafContrastItem > SDRATTR_GRAFCONTRAST(SDRATTR_GRAF_FIRST+4)
constexpr TypedWhichId< SdrOnOffItem > SDRATTR_TEXT_AUTOGROWHEIGHT(SDRATTR_MISC_FIRST+2)
constexpr TypedWhichId< SdrGrafGamma100Item > SDRATTR_GRAFGAMMA(SDRATTR_GRAF_FIRST+5)
constexpr TypedWhichId< XColorItem > SDRATTR_SHADOWCOLOR(SDRATTR_SHADOW_FIRST+1)
constexpr TypedWhichId< SdrMetricItem > SDRATTR_SHADOWXDIST(SDRATTR_SHADOW_FIRST+2)
SVXCORE_DLLPUBLIC SdrTextObj * DynCastSdrTextObj(SdrObject *)
constexpr SwTwips MIN_BORDER_DIST
bool RTLGraphicsHack(SwTwips &rLeft, SwTwips nWidth, sal_Int16 eHoriOri, sal_Int16 eHoriRel, SwTwips nPageLeft, SwTwips nPageRight, SwTwips nPageSize)
static ESelection GetESelection(EditEngine const &rDrawEditEngine, tools::Long nCpStart, tools::Long nCpEnd)
static void SetStdAttr(SfxItemSet &rSet, WW8_DP_LINETYPE &rL, WW8_DP_SHADOW const &rSh)
static void SetLineEndAttr(SfxItemSet &rSet, WW8_DP_LINEEND const &rLe, WW8_DP_LINETYPE const &rLt)
static sal_Int32 lcl_ConvertCrop(sal_uInt32 const nCrop, sal_Int32 const nSize)
void MatchEscherMirrorIntoFlySet(const SvxMSDffImportRec &rRecord, SfxItemSet &rFlySet)
static void SetFill(SfxItemSet &rSet, WW8_DP_FILL &rFill)
#define WW8ITEMVALUE(ItemSet, Id, Cast)
static std::vector< sal_Int32 > replaceDosLineEndsButPreserveLength(OUString &rIn)
static void lcl_StripFields(OUString &rString, WW8_CP &rNewStartCp)
static Color WW8TransCol(SVBT32 nWC)
static void removePositions(EditEngine &rDrawEditEngine, const std::vector< sal_Int32 > &rDosLineEndDummies)
void WW8FSPAShadowToReal(const WW8_FSPA_SHADOW &rFSPAS, WW8_FSPA &rPic)
#define WW8FL_NO_GRAFLAYER
bool CanUseRemoteLink(const OUString &rGrfName)
#define WW8FL_NO_FLY_FOR_TXBX
bool checkRead(SvStream &rSt, void *pDest, sal_uInt32 nLength)
constexpr TypedWhichId< XFillColorItem > XATTR_FILLCOLOR(XATTR_FILL_FIRST+1)
constexpr sal_uInt16 XATTR_START
constexpr TypedWhichId< XFillTransparenceItem > XATTR_FILLTRANSPARENCE(XATTR_FILL_FIRST+5)
constexpr sal_uInt16 XATTR_END
constexpr TypedWhichId< XLineColorItem > XATTR_LINECOLOR(XATTR_LINE_FIRST+3)
constexpr TypedWhichId< XLineWidthItem > XATTR_LINEWIDTH(XATTR_LINE_FIRST+2)
constexpr TypedWhichId< XFillBmpTileItem > XATTR_FILLBMP_TILE(XATTR_FILL_FIRST+7)
constexpr TypedWhichId< XFillBitmapItem > XATTR_FILLBITMAP(XATTR_FILL_FIRST+4)
constexpr TypedWhichId< XLineStyleItem > XATTR_LINESTYLE(XATTR_LINE_FIRST)
constexpr TypedWhichId< XFillStyleItem > XATTR_FILLSTYLE(XATTR_FILL_FIRST)