24#include <osl/diagnose.h>
28#include <vcl/font.hxx>
78 pNextBand(nullptr), nGapHalf(0), mnDefaultLeft(0), mnDefaultTop(0), mnDefaultRight(0),
79 mnDefaultBottom(0), mbHasSpacing(false), nLineHeight(0), nRows(0), nCenter{}, nWidth{},
80 nWwCols(0), nSwCols(0), bLEmptyCol(false), bREmptyCol(false), bCantSplit(false),
81 bCantSplit90(false), pTCs(nullptr), nOverrideSpacing{}, nOverrideValues{}, pSHDs(nullptr),
82 pNewSHDs(nullptr), bExist{}, nTransCell{}
106 OSL_ENSURE( bResult,
"close without open!");
113 OSL_ENSURE(!maSegments.empty(),
114 "should not be possible, must be at least one segment");
115 if (!maSegments.empty())
116 maSegments.back().mbHasFootnote =
true;
121 OSL_ENSURE(!maSegments.empty(),
122 "should not be possible, must be at least one segment");
123 if ( !maSegments.empty() )
124 maSegments.back().mnVerticalAdjustment = nVA;
129 OSL_ENSURE(!maSegments.empty(),
130 "should not be possible, must be at least one segment");
131 if (!maSegments.empty())
132 return maSegments.back().IsVertical();
138 OSL_ENSURE(!maSegments.empty(),
139 "should not be possible, must be at least one segment");
140 if (!maSegments.empty())
141 return SectionIsProtected(maSegments.back());
147 return !maSegments.empty() ? maSegments.back().m_nPgLeft : 0;
152 return !maSegments.empty() ? maSegments.back().m_nPgRight : 0;
157 return !maSegments.empty() ? maSegments.back().GetPageWidth() : 0;
162 return !maSegments.empty() ? maSegments.back().GetTextAreaWidth() : 0;
167 return !maSegments.empty() ? maSegments.back().maSep.dyaTop : 0;
182 OSL_ENSURE(!m_aFootnoteStack.empty(),
"footnote end without start");
183 if (m_aFootnoteStack.empty())
186 bool bFtEdOk =
false;
192 sal_Int32
nPos = m_pPaM->GetPoint()->GetContentIndex();
201 m_pPaM->GetMark()->AdjustContent(-1);
202 std::shared_ptr<SwUnoCursor> xLastAnchorCursor(m_oLastAnchorPos ?
m_rDoc.
CreateUnoCursor(*m_oLastAnchorPos) :
nullptr);
203 m_oLastAnchorPos.reset();
205 m_pPaM->DeleteMark();
206 if (xLastAnchorCursor)
207 m_oLastAnchorPos.emplace(*xLastAnchorCursor->GetPoint());
211 OSL_ENSURE(pFN,
"Problems creating the footnote text");
216 m_xPlcxMan->SaveAllPLCFx( aSave );
217 std::shared_ptr<WW8PLCFMan> xOldPlcxMan = m_xPlcxMan;
220 assert(pSttIdx &&
"Problems creating footnote text");
224 bool bOld = m_bFootnoteEdn;
225 m_bFootnoteEdn =
true;
234 m_bFootnoteEdn = bOld;
241 OSL_ENSURE(sChar.getLength()==1 && ((rDesc.
mbAutoNum == (sChar[0] == 2))),
242 "footnote autonumbering must be 0x02, and everything else must not be");
254 SwPosition& rPaMPointPos = *m_pPaM->GetPoint();
257 if (pTNd && !pTNd->
GetText().isEmpty() && !sChar.isEmpty())
259 const OUString &rText = pTNd->
GetText();
260 if (rText[0] == sChar[0])
263 sal_Int32 nFirstLineIndent=0;
277 if (nFirstLineIndent < 0 && rText.getLength() > 1 && rText[1] == 0x09)
278 m_pPaM->GetMark()->AdjustContent(1);
279 m_pPaM->GetMark()->AdjustContent(1);
280 m_xReffingStck->Delete(*m_pPaM);
282 m_pPaM->DeleteMark();
287 *m_pPaM->GetPoint() = aTmpPos;
289 m_xPlcxMan = xOldPlcxMan;
290 m_xPlcxMan->RestoreAllPLCFx( aSave );
294 m_aSectionManager.SetCurrentSectionHasFootnote();
296 m_aFootnoteStack.pop_back();
318 if (
const void*
pData = pEndNote ? pEndNote->
GetData() :
nullptr)
325 if (
const void*
pData = pFootNote ? pFootNote->
GetData() :
nullptr)
332 m_aFootnoteStack.push_back(aDesc);
343 std::set<std::pair<WW8_CP, WW8_CP>> aPrevRes;
353 aSprmRes = pPap->
HasSprm(0x6649);
357 if (nLevel + 1 == *pLevel)
362 OSL_ENSURE(!nLevel || pLevel,
"sublevel without level sprm");
379 if (!aPrevRes.insert(aBounds).second)
381 SAL_WARN(
"sw.ww8",
"SearchRowEnd, loop in paragraph property chain");
394 const WW8_TablePos *pTopLevelTable = nCellLevel <= 1 ? pTabPos :
nullptr;
398 sal_uInt16
const nStyle(m_xPlcxMan->GetColl());
399 if (!m_bTxbxFlySection && nStyle < m_vColl.size())
400 aRet.
mpStyleApo = StyleExists(nStyle) ? m_vColl[nStyle].m_xWWFly.get() :
nullptr;
421 aRet.
m_bHasSprm37 = m_xPlcxMan->HasParaSprm(m_bVer67 ? 37 : 0x2423).pSprm !=
nullptr;
422 SprmResult aSrpm29 = m_xPlcxMan->HasParaSprm(m_bVer67 ? 29 : 0x261B);
429 bool bNowApo = aRet.
HasFrame() || pTopLevelTable;
432 if (!ConstructApo(aRet, pTabPos))
436 bool bTestAllowed = !m_bTxbxFlySection && !bTableRowEnd;
445 if (nCellLevel == m_nInTable)
454 OSL_ENSURE(m_xTableDesc,
"What!");
455 bTestAllowed =
false;
464 m_xTableDesc->GetCurrentCol() == 0 &&
465 ( !m_xTableDesc->IsValidCell( m_xTableDesc->GetCurrentCol() ) ||
466 m_xTableDesc->InFirstParaInCell() );
475 aRet.
mbStartApo = bNowApo && !InEqualOrHigherApo(1);
476 aRet.
mbStopApo = InEqualOrHigherApo(nCellLevel) && !bNowApo;
484 if (bNowApo && InEqualApo(nCellLevel))
487 if (!TestSameApo(aRet, pTabPos))
502 static const SvxAdjust eAdjA[4] = { SvxAdjust::Left,
503 SvxAdjust::Right, SvxAdjust::Left, SvxAdjust::Left };
537 if ((rAV.
aBits1 & 0x4) >> 2)
545 sal_Int16 nIndent =
std::abs(
static_cast<sal_Int16
>(SVBT16ToUInt16( rAV.
dxaIndent )));
554 if( rAV.
nfc == 5 || rAV.
nfc == 7 )
564 const sal_uInt8* pText,
size_t nStart,
size_t nElements,
bool bOutline)
572 bool bInsert =
false;
573 rtl_TextEncoding eCharSet = m_eStructCharSet;
575 const WW8_FFN* pF = m_xFonts->GetFont(SVBT16ToUInt16(rAV.
ftc));
576 bool bListSymbol = pF && ( pF->
aFFNBase.
chs == 2 );
579 OUStringBuffer sText(
static_cast<sal_Int32
>(nLen));
584 SAL_WARN(
"sw.ww8",
"SetAnlvStrings: ignoring out of range "
585 << nLen <<
" vs " <<
nElements <<
" max");
588 sText = OUString(
reinterpret_cast<char const *
>(pText), nLen, eCharSet);
597 SAL_WARN(
"sw.ww8",
"SetAnlvStrings: ignoring out of range "
598 << nLen <<
" vs " <<
nElements / 2 <<
" max");
601 for(sal_uInt32
i = 0;
i < nLen; ++
i, pText += 2)
603 sText.append(
static_cast<sal_Unicode>(SVBT16ToUInt16(*
reinterpret_cast<SVBT16 const *
>(pText))));
634 if( GetFontParams( SVBT16ToUInt16( rAV.
ftc ), eFamily,
aName,
635 ePitch, eCharSet ) ){
693 pNumR->
Set(nSwLevel, aNF);
703 if( m_xStyles->mpStyRule )
704 return m_xStyles->mpStyRule;
706 const OUString aBaseName(
"WW8StyleNum");
714 m_xStyles->mpStyRule->SetAutoRule(
false);
716 return m_xStyles->mpStyRule;
722 m_nSwNumLevel = 0xff;
739 m_nSwNumLevel = *
pData - 1;
740 if (!m_bNoAttrImport)
741 static_cast<SwTextFormatColl*
>(m_pCurrentColl)->AssignToListLevelOfOutlineStyle( m_nSwNumLevel );
751 m_xStyles->mnWwNumLevel = *
pData;
767 if( !m_pCurrentColl || nLen <= 0
768 || (pStyInf && !pStyInf->
m_bColl)
771 m_nSwNumLevel = 0xff;
777 SAL_WARN(
"sw.ww8",
"ANLevelDesc property is " << nLen <<
" long, needs to be at least " <<
sizeof(
WW8_ANLD));
778 m_nSwNumLevel = 0xff;
782 if (m_nSwNumLevel <= 9)
788 const OUString
aName(
"Outline");
794 SetAnld(&aNR,
reinterpret_cast<WW8_ANLD const *
>(
pData), m_nSwNumLevel,
true);
799 else if( m_xStyles->mnWwNumLevel == 10 || m_xStyles->mnWwNumLevel == 11 ){
801 SetAnld(pNR,
reinterpret_cast<WW8_ANLD const *
>(
pData), 0,
false);
804 pStyInf = GetStyle(m_nCurrentColl);
805 if (pStyInf !=
nullptr)
824 for (
i = 0, pAV1 = pO->
rganlv;
i < nSwLevel; ++
i, ++pAV1)
830 pNumR->
Set(nSwLevel, aNF);
845 SAL_WARN(
"sw.ww8",
"WW8_OLST property is " << nLen <<
" long, needs to be at least " <<
sizeof(
WW8_OLST));
856 if( nWwLevelNo == 12 )
858 else if( nWwLevelNo == 10 )
860 else if( nWwLevelNo == 11 )
862 else if( nWwLevelNo > 0 && nWwLevelNo <= 9 )
870 if (rNumRule.isEmpty())
878 msNumberingNumRule = rNumRule;
880 msOutlineNumRule = rNumRule;
887 m_bCurrentAND_fNumberAcross =
false;
902 sNumRule = m_xTableDesc->GetNumRuleName();
903 if (!sNumRule.isEmpty())
927 if (sNumRule.isEmpty())
941 m_xTableDesc->SetNumRuleName(pNumRule->
GetName());
947 sNumRule = pNumRule ? pNumRule->
GetName() : OUString();
949 m_xCtrlStck->NewAttr(*m_pPaM->GetPoint(),
952 m_aANLDRules.SetNumRule(sNumRule, m_nWwNumType);
967 if (*pSprm13 == 10 || *pSprm13 == 11)
976 SetAnld(pNumRule,
reinterpret_cast<WW8_ANLD const *
>(aS12.
pSprm), m_nSwNumLevel,
false);
979 else if( *pSprm13 > 0 && *pSprm13 <=
MAXLEVEL )
981 m_nSwNumLevel = *pSprm13 - 1;
988 for (
sal_uInt8 nI = 0; nI < m_nSwNumLevel; ++nI)
991 SetNumOlst(pNumRule, m_xNumOlst.get(), nI);
994 SetNumOlst(pNumRule, m_xNumOlst.get(), m_nSwNumLevel);
1001 SetAnld(pNumRule,
reinterpret_cast<WW8_ANLD const *
>(aS12.
pSprm), m_nSwNumLevel,
false);
1006 m_nSwNumLevel = 0xff;
1025 StopAnlToRestart(
WW8_None, bGoBack);
1035 *m_pPaM->GetPoint() = aTmpPos;
1040 m_aANLDRules.msNumberingNumRule.clear();
1046 bool bNumberingNotStopOutline =
1049 if (!bNumberingNotStopOutline)
1050 m_aANLDRules.msOutlineNumRule.clear();
1052 m_nSwNumLevel = 0xff;
1069 memcpy( pSHDs, rBand.
pSHDs, nWwCols *
sizeof(
WW8_SHD ) );
1073 pNewSHDs =
new Color[nWwCols];
1076 memcpy(aDefBrcs, rBand.
aDefBrcs,
sizeof(aDefBrcs));
1090 nLen -= 2 * (nCols + 1);
1094 short nOldCols = nWwCols;
1098 for (
int i = 0;
i <= nCols;
i++, pT+=2)
1099 nCenter[
i] =
static_cast<sal_Int16
>(SVBT16ToUInt16( pT ));
1101 if( nCols != nOldCols )
1111 short nFileCols = nLen / ( bVer67 ? 10 : 20 );
1119 short nColsToRead = std::min<short>(nFileCols, nCols);
1121 if (nColsToRead <= 0)
1138 for (
int i = 0;
i < nColsToRead;
i++, ++pCurrentTC,++pTc)
1142 pCurrentTC->bFirstMerged =
sal_uInt8( ( aBits1 & 0x01 ) != 0 );
1143 pCurrentTC->bMerged =
sal_uInt8( ( aBits1 & 0x02 ) != 0 );
1152 if( ( pCurrentTC->bMerged )
1168 for (
int k = 0; k < nColsToRead; ++k, ++pCurrentTC, ++pTc )
1170 sal_uInt16 aBits1 = SVBT16ToUInt16( pTc->
aBits1Ver8 );
1171 pCurrentTC->bFirstMerged =
sal_uInt8( ( aBits1 & 0x0001 ) != 0 );
1172 pCurrentTC->bMerged =
sal_uInt8( ( aBits1 & 0x0002 ) != 0 );
1173 pCurrentTC->bVertical =
sal_uInt8( ( aBits1 & 0x0004 ) != 0 );
1174 pCurrentTC->bBackward =
sal_uInt8( ( aBits1 & 0x0008 ) != 0 );
1175 pCurrentTC->bRotateFont =
sal_uInt8( ( aBits1 & 0x0010 ) != 0 );
1176 pCurrentTC->bVertMerge =
sal_uInt8( ( aBits1 & 0x0020 ) != 0 );
1177 pCurrentTC->bVertRestart =
sal_uInt8( ( aBits1 & 0x0040 ) != 0 );
1178 pCurrentTC->nVertAlign = ( ( aBits1 & 0x0180 ) >> 7 );
1192 for (
int k = 0; k < nCols; ++k)
1194 if(maDirections[k] == 4)
1196 if(pTCs[k].bVertical)
1198 if(pTCs[k].bBackward)
1199 maDirections[k] = 3;
1201 maDirections[k] = 1;
1209 if( !pParamsTSetBRC || !pTCs )
1214 SAL_WARN(
"sw.ww8",
"table border property is too short");
1222 if (nitcFirst >= nWwCols)
1225 if (nitcLim > nWwCols)
1228 bool bChangeRight = (nFlag & 0x08) != 0;
1229 bool bChangeBottom = (nFlag & 0x04) != 0;
1230 bool bChangeLeft = (nFlag & 0x02) != 0;
1231 bool bChangeTop = (nFlag & 0x01) != 0;
1233 WW8_TCell* pCurrentTC = pTCs + nitcFirst;
1239 SAL_WARN(
"sw.ww8",
"table border property is too short");
1244 else if( nBrcVer == 8 )
1246 static_assert(
sizeof (
WW8_BRC) == 4,
"this has to match the msword size");
1247 if (nParamsLen <
sizeof(
WW8_BRC) + 3)
1249 SAL_WARN(
"sw.ww8",
"table border property is too short");
1258 SAL_WARN(
"sw.ww8",
"table border property is too short");
1261 brcVer9 = *
reinterpret_cast<WW8_BRCVer9 const *
>(pParamsTSetBRC+3);
1264 for(
int i = nitcFirst;
i < nitcLim; ++
i, ++pCurrentTC )
1284 SAL_WARN(
"sw.ww8",
"table border property is too short");
1288 for (
int i = 0;
i < 6; ++
i)
1291 else if ( nBrcVer == 8 )
1293 static_assert(
sizeof (
WW8_BRC) == 4,
"this has to match the msword size");
1294 if (nParamsLen <
sizeof(
WW8_BRC) * 6)
1296 SAL_WARN(
"sw.ww8",
"table border property is too short");
1299 for(
int i = 0;
i < 6; ++
i )
1304 if (nParamsLen <
sizeof( aDefBrcs ))
1306 SAL_WARN(
"sw.ww8",
"table border property is too short");
1309 memcpy( aDefBrcs, pParams,
sizeof( aDefBrcs ) );
1318 if( !(nWwCols && pParamsTDxaCol) )
1323 short nDxaCol =
static_cast<sal_Int16
>(SVBT16ToUInt16( pParamsTDxaCol + 2 ));
1325 for(
int i = nitcFirst; (
i < nitcLim) && (
i < nWwCols);
i++ )
1327 const short nOrgWidth = nCenter[
i+1] - nCenter[
i];
1328 const short nDelta = nDxaCol - nOrgWidth;
1329 for(
int j =
i+1; j <= nWwCols; j++ )
1331 nCenter[j] = nCenter[j] + nDelta;
1338 if( !nWwCols || !pParamsTInsert )
1341 sal_uInt8 nitcInsert = pParamsTInsert[0];
1345 sal_uInt16 ndxaCol = SVBT16ToUInt16( pParamsTInsert+2 );
1348 if (nitcInsert > nWwCols)
1350 nNewWwCols = nitcInsert+nctc;
1356 nctc = ::sal::static_int_cast<sal_uInt8>(nNewWwCols-nitcInsert);
1361 nNewWwCols = nWwCols+nctc;
1367 nctc = ::sal::static_int_cast<sal_uInt8>(nNewWwCols-nWwCols);
1375 memcpy( pTC2s, pTCs, nWwCols *
sizeof(
WW8_TCell ) );
1381 if (nitcInsert <= nWwCols)
1384 nCenter[nWwCols + nctc] = nCenter[nWwCols]+nctc*ndxaCol;
1385 for(
int i = nWwCols-1;
i >= nitcInsert;
i--)
1388 nCenter[
i + nctc] = nCenter[
i]+nctc*ndxaCol;
1391 pTCs[
i + nctc] = pTCs[
i];
1396 for(
int i = nWwCols;
i > nitcInsert+nWwCols;
i--)
1397 nCenter[
i] =
i ? (nCenter[
i - 1]+ndxaCol) : 0;
1400 for(
int j = 0;j < nctc; j++)
1401 nCenter[j + nitcInsert] = (j + nitcInsert) ? (nCenter[j + nitcInsert -1]+ndxaCol) : 0;
1403 nWwCols = nNewWwCols;
1411 sal_uInt16 nCode = SVBT16ToUInt16(pParams);
1413 OSL_ENSURE(nStartCell < nEndCell,
"not as I thought");
1414 OSL_ENSURE(nEndCell <
MAX_COL + 1,
"not as I thought");
1420 for (;nStartCell < nEndCell; ++nStartCell)
1421 maDirections[nStartCell] = nCode;
1426 sal_uInt8 nLen = pParams ? *(pParams - 1) : 0;
1427 OSL_ENSURE(nLen == 6,
"Unexpected spacing len");
1431#if OSL_DEBUG_LEVEL > 0
1433 OSL_ENSURE(nWhichCell == 0,
"Expected cell to be 0!");
1439 OSL_ENSURE(nSideBits < 0x10,
"Unexpected value for nSideBits");
1441 sal_uInt16
nValue = SVBT16ToUInt16( pParams );
1442 for (
int i = wwTOP;
i <= wwRIGHT;
i++)
1444 switch (nSideBits & (1 <<
i))
1453 mnDefaultBottom =
nValue;
1461 OSL_ENSURE(
false,
"Impossible");
1469 sal_uInt8 nLen = pParams ? *(pParams - 1) : 0;
1470 OSL_ENSURE(nLen == 6,
"Unexpected spacing len");
1474 const sal_uInt8 nStartCell = *pParams++;
1476 OSL_ENSURE(nStartCell <
MAX_COL + 1,
"Cell out of range in spacings");
1477 if ( nStartCell >= nEndCell || nEndCell >
MAX_COL+1 )
1481 OSL_ENSURE(nSideBits < 0x10,
"Unexpected value for nSideBits");
1484 OSL_ENSURE(nSizeType == 0x3,
"Unexpected non-twip value for margin width");
1485 if ( nSizeType != 0x3 )
1488 sal_uInt16
nValue = SVBT16ToUInt16( pParams );
1490 for (
int nCell = nStartCell; nCell < nEndCell; ++nCell)
1492 nOverrideSpacing[ nCell ] |= nSideBits;
1493 OSL_ENSURE(nOverrideSpacing[ nCell ] < 0x10,
"Unexpected value for nSideBits");
1495 for (
int i=0;
i < 4;
i++)
1497 if (nSideBits & (1 <<
i))
1498 nOverrideValues[ nCell ][
i ] =
nValue;
1505 if( !(nWwCols && pParamsTDelete) )
1509 if (nitcFirst >= nWwCols)
1512 if (nitcLim <= nitcFirst)
1519 int nShlCnt = nWwCols - nitcLim;
1523 WW8_TCell* pCurrentTC = pTCs + nitcFirst;
1525 while(
i < nShlCnt )
1528 nCenter[nitcFirst +
i] = nCenter[nitcLim +
i];
1531 *pCurrentTC = pTCs[ nitcLim +
i];
1537 nCenter[nitcFirst +
i] = nCenter[nitcLim +
i];
1540 short nCellsDeleted = nitcLim - nitcFirst;
1542 if (nCellsDeleted > nWwCols)
1543 nCellsDeleted = nWwCols;
1544 nWwCols -= nCellsDeleted;
1560 short nCount = nLen >> 1;
1567 pSHDs[
i].SetWWValue( *pShd );
1573 if (!nLen || nStart >= nWwCols)
1577 pNewSHDs =
new Color[nWwCols];
1579 short nCount = nLen / 10 + nStart;
1598 if (aRes.
pSprm ==
nullptr)
1614 sprmTDefTableNewShd, sprmTDefTableNewShd2nd, sprmTDefTableNewShd3rd,
1615 sprmTCellPadding, sprmTCellPaddingDefault
1628 return sprmTTableWidth;
1630 return sprmTTextFlow;
1658 return sprmTDefTableNewShd;
1660 return sprmTDefTableNewShd2nd;
1662 return sprmTDefTableNewShd3rd;
1664 return sprmTTableBorders90;
1668 return sprmTSetBrc90;
1670 return sprmTCellPadding;
1672 return sprmTCellPaddingDefault;
1737 m_pFirstBand(nullptr),
1738 m_pActBand(nullptr),
1739 m_pTableNd(nullptr),
1740 m_pTabLines(nullptr),
1741 m_pTabLine(nullptr),
1742 m_pTabBoxes(nullptr),
1744 m_pCurrentWWCell(nullptr),
1746 m_nDefaultSwCols(0),
1751 m_nPreferredWidth(0),
1754 m_bClaimLineFormat(false),
1755 m_eOri(
text::HoriOrientation::
LEFT),
1758 m_nCurrentBandRow(0),
1762 m_pParentPos(nullptr),
1763 m_pFlyFormat(nullptr),
1768 static const sal_Int16 aOriArr[] =
1770 text::HoriOrientation::LEFT, text::HoriOrientation::CENTER, text::HoriOrientation::RIGHT, text::HoriOrientation::CENTER
1785 std::set<std::pair<WW8_CP, WW8_CP>> aPrevRes;
1790 short nTabeDxaNew = SHRT_MAX;
1791 bool bTabRowJustRead =
false;
1793 const sal_uInt8* pNewShadeSprm[3] = {
nullptr,
nullptr,
nullptr};
1794 const sal_uInt8* pTableBorders =
nullptr;
1795 sal_uInt16 nTableBordersLen = 0;
1796 const sal_uInt8* pTableBorders90 =
nullptr;
1797 sal_uInt16 nTableBorders90Len = 0;
1799 std::vector<std::pair<const sal_uInt8*, sal_uInt16>> aTSetBrcs, aTSetBrc90s;
1815 for (
int nLoop = 0; nLoop < 2; ++nLoop)
1823 sal_Int32 nLen = nL - nFixedLen;
1827 case sprmTTableWidth:
1853 pTableBorders = pParams;
1854 nTableBordersLen = nLen;
1856 case sprmTTableBorders90:
1857 pTableBorders90 = pParams;
1858 nTableBorders90Len = nLen;
1868 m_eOri = aOriArr[*pParams & 0x3];
1871 m_bIsBiDi = SVBT16ToUInt16(pParams) != 0;
1874 pNewBand->
nGapHalf =
static_cast<sal_Int16
>(SVBT16ToUInt16( pParams ));
1877 pNewBand->
nLineHeight =
static_cast<sal_Int16
>(SVBT16ToUInt16( pParams ));
1881 pNewBand->
ReadDef(bOldVer, pParams, nLen);
1882 bTabRowJustRead =
true;
1885 pShadeSprm = pParams;
1887 case sprmTDefTableNewShd:
1888 pNewShadeSprm[0] = pParams;
1890 case sprmTDefTableNewShd2nd:
1891 pNewShadeSprm[1] = pParams;
1893 case sprmTDefTableNewShd3rd:
1894 pNewShadeSprm[2] = pParams;
1902 short nDxaNew =
static_cast<sal_Int16
>(SVBT16ToUInt16( pParams ));
1903 if( nDxaNew < nTabeDxaNew )
1904 nTabeDxaNew = nDxaNew;
1908 aTSetBrcs.emplace_back(pParams, nLen);
1911 aTSetBrc90s.emplace_back(pParams, nLen);
1922 case sprmTCellPaddingDefault:
1925 case sprmTCellPadding:
1946 if (bTabRowJustRead)
1951 pNewBand->
ReadShd(pShadeSprm);
1952 if (pNewShadeSprm[0])
1953 pNewBand->
ReadNewShd(pNewShadeSprm[0], bOldVer, 0);
1954 if (pNewShadeSprm[1])
1955 pNewBand->
ReadNewShd(pNewShadeSprm[1], bOldVer, 22);
1956 if (pNewShadeSprm[2])
1957 pNewBand->
ReadNewShd(pNewShadeSprm[2], bOldVer, 44);
1958 if (pTableBorders90)
1960 else if (pTableBorders)
1962 pTableBorders, nTableBordersLen);
1963 for (
const auto&
a : aTSetBrcs)
1965 for (
const auto&
a : aTSetBrc90s)
1969 if( nTabeDxaNew < SHRT_MAX )
1971 short* pCenter = pNewBand->
nCenter;
1972 short firstDxaCenter = *pCenter;
1973 for(
int i = 0;
i < pNewBand->
nWwCols;
i++, ++pCenter )
1978 (nTabeDxaNew - (firstDxaCenter + pNewBand->
nGapHalf));
2020 SprmResult aParamsRes = HasTabCellSprm(pPap, bOldVer);
2025 if (!pParams || aParamsRes.
nRemainingData < 1 || (1 != *pParams) ||
2026 (pLevel && aLevelRes.
nRemainingData >= 1 && (*pLevel <= m_pIo->m_nInTable)))
2032 WW8_CP nMyStartCp=nStartCp;
2073 if (!aPrevRes.insert(aBounds).second)
2075 SAL_WARN(
"sw.ww8",
"WW8TabDesc, loop in paragraph property chain");
2090 pNewBand->
nRows = 1;
2117 short nMinCols = SHRT_MAX;
2149 short nOrigWidth[
MAX_COL + 1];
2169 if (nOrigWidth[
i] == 0)
2173 else if ((
nCellWidth <= 0) && (nOrigWidth[
i] > 0))
2191 if(
m_eOri == text::HoriOrientation::RIGHT)
2216 for (
int k = 0; k < pR->
nWwCols; ++k)
2219 for (
int i = 0;
i < 4; ++
i)
2241 j = (k == pR->
nWwCols - 1) ? 3 : 5;
2275 OSL_ENSURE(
i,
"no columns in row ?");
2285 while (k && !pR->
bExist[k])
2287 for (sal_uInt16
n=k+1;
n<
i;
n++)
2301 m_eOri = text::HoriOrientation::LEFT_AND_WIDTH;
2316 OSL_ENSURE(pApply,
"No frame");
2332 "should not be possible, must be at least one segment");
2345 bool bSetMinHeight =
false;
2356 const SwNode* pAnchorNode =
2358 if (pAnchorNode && *pAnchorNode == pPoint->
GetNode())
2361 bSetMinHeight =
true;
2393 if ( bIsInsideMargin && bAdjustMargin )
2394 m_eOri = text::HoriOrientation::LEFT_AND_WIDTH;
2397 if (
m_eOri == text::HoriOrientation::LEFT_AND_WIDTH )
2423 OSL_ENSURE(pTableNode,
"no table node!");
2436 if (
const SfxItemSet* pSet = pNd->GetpSwAttrSet())
2438 std::unique_ptr<SfxPoolItem> pSetAttr;
2466 m_bIsBiDi ? SvxFrameDirection::Horizontal_RL_TB : SvxFrameDirection::Horizontal_LR_TB,
RES_FRAMEDIR );
2469 if (text::HoriOrientation::LEFT_AND_WIDTH ==
m_eOri)
2480 (eHori == text::HoriOrientation::LEFT_AND_WIDTH))
2523 GetSttNd()->FindTableNode());
2524 OSL_ENSURE(
m_pTableNd,
"Where is my table node" );
2563 "Too few lines, table ended early");
2572 OSL_ENSURE(nCol < m_pTabBoxes->
size(),
2573 "Too few columns, table ended early");
2580 bool bMerge =
false;
2662 p->m_bGroupLocked =
true;
2666 m_MergeGroups.push_back(std::unique_ptr<WW8SelBoxInfo>(pActMGroup));
2690 pTabBox2 = rBoxes.empty() ? nullptr : rBoxes.front();
2694 if (!pTabBox2 || !pTabBox2->
GetSttNd())
2718 OSL_ENSURE(
m_xTmpPos &&
m_pIo,
"I've forgotten where the table is anchored");
2736 if (xLastAnchorCursor)
2753 throw std::runtime_error(
"table unexpectedly destroyed by applying redlines");
2764 if((1 < groupIt->size()) && groupIt->row(0)[0])
2766 SwFrameFormat* pNewFormat = groupIt->row(0)[0]->ClaimFrameFormat();
2768 const sal_uInt16 nRowSpan = groupIt->rowsCount();
2769 for (sal_uInt16
n = 0;
n < nRowSpan; ++
n)
2771 auto& rRow = groupIt->row(
n);
2772 for (
size_t i = 0;
i<rRow.size(); ++
i)
2774 const sal_Int32 nRowSpanSet = (
n == 0) && (
i == 0) ?
2776 (-1 * (nRowSpan -
n));
2807 const short nTolerance = 4;
2809 short nX2 = nX1 + nWidth;
2828 if( ( nX1 > nGrX1 ) && ( nX2 < nGrX2 ) )
2838 if( ( ( nX1 > nGrX1 )
2839 && ( nX1 < nGrX2 - 2*nTolerance ) )
2840 || ( ( nX2 > nGrX1 + 2*nTolerance )
2841 && ( nX2 < nGrX2 ) )
2843 || ( ( nX1 <=nGrX1 )
2844 && ( nX2 >=nGrX2 ) ) )
2867 OSL_FAIL(
"Problem with table");
2887 OSL_ENSURE(
false,
"Actual row bigger than expected." );
2970 if(!rSnapToGrid.GetValue())
2974 aGridItem.SetValue(
false);
3012 SvxBoxItemLine::TOP);
3020 SvxBoxItemLine::BOTTOM);
3034 SvxBoxItemLine::LEFT);
3037 aFormatBox.
SetDistance(nLeftDist, SvxBoxItemLine::LEFT);
3042 SvxBoxItemLine::RIGHT);
3045 aFormatBox.
SetDistance(nRightDist,SvxBoxItemLine::RIGHT);
3085 OSL_ENSURE(eDir == SvxFrameDirection::Environment,
"unknown direction code, maybe it's a bitfield");
3088 eDir = SvxFrameDirection::Vertical_LR_BT;
3091 eDir = SvxFrameDirection::Vertical_RL_TB;
3094 eDir = SvxFrameDirection::Vertical_RL_TB;
3097 eDir = bIsBiDi ? SvxFrameDirection::Horizontal_RL_TB : SvxFrameDirection::Horizontal_LR_TB;
3116 sal_Int16 eVertOri=text::VertOrientation::TOP;
3125 eVertOri = text::VertOrientation::TOP;
3128 eVertOri = text::VertOrientation::CENTER;
3131 eVertOri = text::VertOrientation::BOTTOM;
3146 "Wrong column count in table" );
3196 if( j < m_pActBand->nWwCols )
3305 pTheMergeGroup = pActGroup;
3312 if( pTheMergeGroup )
3321 sal_uInt16 nCol = 0;
3345 for (sal_uInt16 nSize =
static_cast< sal_uInt16
>(
m_aNumRuleNames.size()); nSize <= nCol; ++nSize)
3363 std::unique_ptr<WW8FlyPara> pTableWFlyPara;
3368 RndStdIds eAnchor( RndStdIds::FLY_AS_CHAR );
3376 WW8_CP nMyStartCp = nStartCp;
3380 pNestedTabPos = &aNestedTabPos;
3383 if ( pNestedTabPos )
3387 if ( pTableWFlyPara )
3397 eAnchor = RndStdIds::FLY_AT_CHAR;
3405 if( pStyleFormat && pStyleFormat->
GetBreak().
GetBreak() == SvxBreak::PageBefore )
3415 if ((eAnchor == RndStdIds::FLY_AT_CHAR)
3424 aItemSet.Put( aAnchor );
3427 OSL_ENSURE(
m_xTableDesc->m_pFlyFormat->GetAnchor().GetAnchorId() == eAnchor,
3428 "Not the anchor type requested!" );
3437 if ( pTableWFlyPara && pTableSFlyPara )
3439 WW8FlySet aFlySet( *
this, pTableWFlyPara.get(), pTableSFlyPara,
false );
3442 aFlySet.
Put( aAnchor );
3448 m_xTableDesc->m_pTable->GetFrameFormat()->GetHoriOrient();
3464 delete pTableSFlyPara;
3480 if( ( nLen > 0 ) && ( *
pData == 1 ) )
3486 if( ( nLen > 0 ) && ( *
pData == 1 ) )
3507 OSL_ENSURE(
m_xTableDesc,
"Panic, stop table with no table!");
3542 sal_uInt16 nRes = USHRT_MAX;
3545 for(sal_uInt16 nI = 0; nI <
m_xStyles->GetCount(); nI++ )
3547 && (nLFOIndex ==
m_vColl[ nI ].m_nLFOIndex) )
3558 for(sal_uInt16 nI = 0; nI <
m_xStyles->GetCount(); nI++ )
3560 && (rName ==
m_vColl[ nI ].GetOrgWWName()) )
3562 pRet =
m_vColl[ nI ].m_pFormat;
3592#ifdef DEBUGSPRMREADER
3593 fprintf(stderr,
"id is %x\n", aIter.GetCurrentId());
3610 std::unique_ptr<sal_uInt8[]> pSprms(
new sal_uInt8[nLen] );
3618 if ( pSt->
Tell() & 0x1 )
3628 if (!(pSt->
Tell() & 0x1))
3653 if( (1 < cbUPX) || ( (0 < cbUPX) && !bPAP ) )
3673 nLen = nLen - cbUPX;
3695 :
WW8Style(*pI->m_pTableStream, _rFib)
3696 , maSprmParser(_rFib)
3698 , mpStStrm(pI->m_pTableStream)
3699 , mpStyRule(nullptr)
3700 , mpParaSprms(nullptr)
3703 , mbTextColChanged(false)
3704 , mbFontChanged(false)
3705 , mbCJKFontChanged(false)
3706 , mbCTLFontChanged(false)
3707 , mbFSizeChanged(false)
3708 , mbFCTLSizeChanged(false)
3709 , mbWidowsChanged(false)
3710 , mbBidiChanged(false)
3768 sal_uInt16 nNextStyle,
3769 std::map<OUString, sal_Int32>& rParaCollisions,
3770 std::map<OUString, sal_Int32>& rCharCollisions)
3780 pColl = aResult.first;
3781 bStyExist = aResult.second;
3788 pColl = aResult.first;
3789 bStyExist = aResult.second;
3795 if (bImport && bStyExist && rSI.
GetOrgWWName().startsWith(
"WW8Num"))
3817 if (j != nThisStyle && j <
m_cstd )
3877 std::map<OUString, sal_Int32>& rParaCollisions,
3878 std::map<OUString, sal_Int32>& rCharCollisions)
3907 if ( !xStd ||
sName.isEmpty() || ((1 != xStd->sgc) && (2 != xStd->sgc)) )
3915 nNr, xStd->istdNext,
3916 rParaCollisions, rCharCollisions);
3996 std::unique_ptr<WW8_STD> xStd(
Read1Style(nSkip,
nullptr));
4014 std::vector<sal_uInt8> aRet
4041 ShortToSVBT16(rChpx.
ftc,
a);
4042 aRet.push_back(
a[1]);
4043 aRet.push_back(
a[0]);
4049 aRet.push_back(rChpx.
kul);
4056 ShortToSVBT16(rChpx.
lid,
a);
4057 aRet.push_back(
a[1]);
4058 aRet.push_back(
a[0]);
4064 aRet.push_back(rChpx.
ico);
4072 ShortToSVBT16(rChpx.
hps,
a);
4073 aRet.push_back(
a[0]);
4079 aRet.push_back(rChpx.
hpsPos);
4093 aRet.push_back(
a[1]);
4094 aRet.push_back(
a[0]);
4101 ShortToSVBT16(rChpx.
lidBi,
a);
4102 aRet.push_back(
a[1]);
4103 aRet.push_back(
a[0]);
4109 aRet.push_back(rChpx.
icoBi);
4116 ShortToSVBT16(rChpx.
hpsBi,
a);
4117 aRet.push_back(
a[1]);
4118 aRet.push_back(
a[0]);
4135 if (nSize > nMaxByteCount)
4137 SAL_WARN(
"sw.ww8",
"ReadWord2Chpx: truncating out of range "
4138 << nSize <<
" to " << nMaxByteCount);
4139 nSize = nMaxByteCount;
4153 aChpx.
fBold = nFlags8 & 0x01;
4154 aChpx.
fItalic = (nFlags8 & 0x02) >> 1;
4155 aChpx.
fRMarkDel = (nFlags8 & 0x04) >> 2;
4156 aChpx.
fOutline = (nFlags8 & 0x08) >> 3;
4159 aChpx.
fCaps = (nFlags8 & 0x40) >> 6;
4160 aChpx.
fVanish = (nFlags8 & 0x80) >> 7;
4162 if (
nCount >= nSize)
break;
4169 aChpx.
fRMark = nFlags8 & 0x01;
4170 aChpx.
fSpec = (nFlags8 & 0x02) >> 1;
4171 aChpx.
fStrike = (nFlags8 & 0x04) >> 2;
4172 aChpx.
fObj = (nFlags8 & 0x08) >> 3;
4173 aChpx.
fBoldBi = (nFlags8 & 0x10) >> 4;
4174 aChpx.
fItalicBi = (nFlags8 & 0x20) >> 5;
4175 aChpx.
fBiDi = (nFlags8 & 0x40) >> 6;
4178 if (
nCount >= nSize)
break;
4185 aChpx.
fsIco = nFlags8 & 0x01;
4186 aChpx.
fsFtc = (nFlags8 & 0x02) >> 1;
4187 aChpx.
fsHps = (nFlags8 & 0x04) >> 2;
4188 aChpx.
fsKul = (nFlags8 & 0x08) >> 3;
4189 aChpx.
fsPos = (nFlags8 & 0x10) >> 4;
4190 aChpx.
fsSpace = (nFlags8 & 0x20) >> 5;
4191 aChpx.
fsLid = (nFlags8 & 0x40) >> 6;
4192 aChpx.
fsIcoBi = (nFlags8 & 0x80) >> 7;
4194 if (
nCount >= nSize)
break;
4201 aChpx.
fsFtcBi = nFlags8 & 0x01;
4202 aChpx.
fsHpsBi = (nFlags8 & 0x02) >> 1;
4203 aChpx.
fsLidBi = (nFlags8 & 0x04) >> 2;
4205 if (
nCount >= nSize)
break;
4209 if (
nCount >= nSize)
break;
4213 if (
nCount >= nSize)
break;
4222 aChpx.
fNumRun = (nFlags8 & 0x80) >> 7;
4224 if (
nCount >= nSize)
break;
4231 aChpx.
ico = nFlags8 & 0x1F;
4232 aChpx.
kul = (nFlags8 & 0xE0) >> 5;
4234 if (
nCount >= nSize)
break;
4238 if (
nCount >= nSize)
break;
4242 if (
nCount >= nSize)
break;
4246 if (
nCount >= nSize)
break;
4250 if (
nCount >= nSize)
break;
4254 if (
nCount >= nSize)
break;
4258 if (
nCount >= nSize)
break;
4286 sal_uInt16 cstcStd(0);
4290 sal_uInt16 cbName(0);
4292 if (cbName > nMaxByteCount)
4294 SAL_WARN(
"sw.ww8",
"WW8RStyle::ImportOldFormatStyles: truncating out of range "
4295 << cbName <<
" to " << nMaxByteCount);
4296 cbName = nMaxByteCount;
4298 sal_uInt16 nByteCount = 2;
4300 while (nByteCount < cbName)
4318 nByteCount += aTmp.getLength();
4319 sName = OStringToOUString(aTmp, eStructChrSet);
4324 if (
sName.isEmpty())
4328 sName = OUString(pStr, strlen(pStr), RTL_TEXTENCODING_ASCII_US);
4331 if (
sName.isEmpty())
4332 sName =
"Unknown Style: " + OUString::number(stc);
4338 sal_uInt16 nStyles=stcp;
4340 std::vector<pxoffset> aCHPXOffsets(stcp);
4342 sal_uInt16 cbChpx(0);
4344 if (cbChpx > nMaxByteCount)
4346 SAL_WARN(
"sw.ww8",
"WW8RStyle::ImportOldFormatStyles: truncating out of range "
4347 << cbChpx <<
" to " << nMaxByteCount);
4348 cbChpx = nMaxByteCount;
4352 std::vector< std::vector<sal_uInt8> > aConvertedChpx;
4353 while (nByteCount < cbChpx)
4355 if (stcp == aCHPXOffsets.size())
4366 aCHPXOffsets[stcp].mnSize = 0;
4373 aCHPXOffsets[stcp].mnSize = nRemainder;
4376 aCHPXOffsets[stcp].
mnSize);
4379 nByteCount += nRemainder;
4382 aConvertedChpx.emplace_back( );
4387 std::vector<pxoffset> aPAPXOffsets(stcp);
4389 sal_uInt16 cbPapx(0);
4391 if (cbPapx > nMaxByteCount)
4393 SAL_WARN(
"sw.ww8",
"WW8RStyle::ImportOldFormatStyles: truncating out of range "
4394 << cbPapx <<
" to " << nMaxByteCount);
4395 cbPapx = nMaxByteCount;
4399 while (nByteCount < cbPapx)
4401 if (stcp == aPAPXOffsets.size())
4411 aPAPXOffsets[stcp].mnSize = 0;
4422 aPAPXOffsets[stcp].mnSize = nRemainder;
4425 nByteCount += nRemainder;
4434 if (iMac > nStyles) iMac = nStyles;
4436 std::map<OUString, sal_Int32> aParaCollisions;
4437 std::map<OUString, sal_Int32> aCharCollisions;
4439 for (stcp = 0; stcp < iMac; ++stcp)
4462 if (stcp >= aPAPXOffsets.size())
4477 if (!aConvertedChpx[stcp].empty())
4479 static_cast< short >(aConvertedChpx[stcp].
size()),
4490 std::map<OUString, sal_Int32> aParaCollisions;
4491 std::map<OUString, sal_Int32> aCharCollisions;
const OUString & GetValue() const
virtual void DeleteRange(SwPaM &)=0
Delete a range SwFlyFrameFormat.
virtual SwTextFormatColl * GetTextCollFromPool(sal_uInt16 nId, bool bRegardLanguage=true)=0
Return "Auto-Collection with ID.
const SfxPoolItem * GetItem(sal_uInt16 nWhich, bool bSearchInParent=true) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
SvStream & ReadInt16(sal_Int16 &rInt16)
SvStream & ReadUInt32(sal_uInt32 &rUInt32)
sal_uInt64 Seek(sal_uInt64 nPos)
std::size_t ReadBytes(void *pData, std::size_t nSize)
sal_uInt64 SeekRel(sal_Int64 nPos)
SvStream & ReadUInt16(sal_uInt16 &rUInt16)
sal_uInt64 remainingSize()
SvStream & ReadUChar(unsigned char &rChar)
void SetDistance(sal_Int16 nNew, SvxBoxItemLine nLine)
short GetTextFirstLineOffset() const
sal_uInt8 & GetMaxHyphens()
sal_uInt8 & GetMinTrail()
void SetLeft(const tools::Long nL, const sal_uInt16 nProp=100)
void SetNumberingType(SvxNumType nSet)
SvxNumType GetNumberingType() const
void SetHeight(tools::Long n)
void SetWidth(tools::Long n)
SwFlyFrameFormat * MakeFlySection(RndStdIds eAnchorType, const SwPosition *pAnchorPos, const SfxItemSet *pSet=nullptr, SwFrameFormat *pParent=nullptr, bool bCalledFromShell=false)
OUString GetUniqueNumRuleName(const OUString *pChkStr=nullptr, bool bAutoNum=true) const
SwNumRule * FindNumRulePtr(const OUString &rName) const
const SwNumRuleTable & GetNumRuleTable() const
SwNumRule * GetOutlineNumRule() const
IDocumentContentOperations const & getIDocumentContentOperations() const
SwFootnoteIdxs & GetFootnoteIdxs()
void InsertRow(const SwCursor &rCursor, sal_uInt16 nCnt=1, bool bBehind=true)
IDocumentStylePoolAccess const & getIDocumentStylePoolAccess() const
const SwTextFormatColl * GetDfltTextFormatColl() const
std::shared_ptr< SwUnoCursor > CreateUnoCursor(const SwPosition &rPos, bool bTableCursor=false)
const SwAttrPool & GetAttrPool() const
const SwTable * InsertTable(const SwInsertTableOptions &rInsTableOpts, const SwPosition &rPos, sal_uInt16 nRows, sal_uInt16 nCols, sal_Int16 eAdjust, const SwTableAutoFormat *pTAFormat=nullptr, const std::vector< sal_uInt16 > *pColArr=nullptr, bool bCalledFromShell=false, bool bNewModel=true, const OUString &rTableName={})
Insert new table at position.
bool SetTextFormatColl(const SwPaM &rRg, SwTextFormatColl *pFormat, const bool bReset=true, const bool bResetListAttrs=false, SwRootFrame const *pLayout=nullptr)
Add 4th optional parameter <bResetListAttrs>.
sal_uInt16 MakeNumRule(const OUString &rName, const SwNumRule *pCpy=nullptr, bool bBroadcast=false, const SvxNumberFormat::SvxNumPositionAndSpaceMode eDefaultNumberFormatPositionAndSpaceMode=SvxNumberFormat::LABEL_WIDTH_AND_POSITION)
void SetOutlineNumRule(const SwNumRule &rRule)
Marks a node in the document model.
SwNodeOffset GetIndex() const
Base class of the Writer document model elements.
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
SwNodeOffset EndOfSectionIndex() const
SwNodeType GetNodeType() const
SwNode & GetEndOfExtras() const
This is the last EndNode of a special section.
bool InsBoxen(SwTableNode *, SwTableLine *, SwTableBoxFormat *, SwTextFormatColl *, const SfxItemSet *pAutoAttr, sal_uInt16 nInsPos, sal_uInt16 nCnt=1)
Insert a new box in the line before InsPos.
const SwNumFormat * GetNumFormat(sal_uInt16 i) const
void Set(sal_uInt16 i, const SwNumFormat *)
const OUString & GetName() const
PaM is Point and Mark: a selection of the document model.
SwNode & GetPointNode() const
const SwPosition * GetPoint() const
SwTableBox is one table cell in the document model.
SwNodeOffset GetSttIdx() const
void setRowSpan(sal_Int32 nNewRowSpan)
SwFrameFormat * GetFrameFormat()
const SwStartNode * GetSttNd() const
void ChgFrameFormat(SwTableBoxFormat *pNewFormat, bool bNeedToReregister=true)
SwFrameFormat * ClaimFrameFormat()
SwTableLine is one table row in the document model.
SwFrameFormat * GetFrameFormat()
SwFrameFormat * ClaimFrameFormat()
SwTableBoxes & GetTabBoxes()
const SwTable & GetTable() const
SwTableNode * GetTableNode() const
void SetRowsToRepeat(sal_uInt16 nNumOfRows)
SwTableLines & GetTabLines()
SwTableFormat * GetFrameFormat()
static SwSelBoxes & SelLineFromBox(const SwTableBox *pBox, SwSelBoxes &rBoxes, bool bToTop=true)
const SfxPoolItem & GetAttr() const
Represents the style of a paragraph.
SwTextNode is a paragraph in the document model.
void SetAttrListLevel(int nLevel)
Sets the list level of this text node.
SwTextAttr * InsertItem(SfxPoolItem &rAttr, const sal_Int32 nStart, const sal_Int32 nEnd, const SetAttrMode nMode=SetAttrMode::DEFAULT)
create new text attribute from rAttr and insert it
const SfxPoolItem & GetAttr(sal_uInt16 nWhich, bool bInParent=true) const
End: Data collected during idle time.
void SetCountedInList(bool bCounted)
const OUString & GetText() const
std::optional< SwPosition > m_oLastAnchorPos
sal_uInt16 m_nLFOPosition
sal_uInt16 End_Footnote()
const WW8Fib & GetFib() const
friend struct WW8SwFlyPara
std::vector< SwWW8StyInf > m_vColl
bool m_bCurrentAND_fNumberAcross
const SwTextFormatColl * m_pDfltTextFormatColl
void Read_TabRowEnd(sal_uInt16, const sal_uInt8 *pData, short nLen)
void Read_ANLevelNo(sal_uInt16, const sal_uInt8 *pData, short nLen)
static Color ExtractColour(const sal_uInt8 *&rpData, bool bVer67)
bool SetUpperSpacing(SwPaM &pMyPam, int nSpace)
std::unique_ptr< SwWW8FltControlStack > m_xCtrlStck
std::unique_ptr< WW8SwFlyPara > m_xSFlyPara
void Read_TabCellEnd(sal_uInt16, const sal_uInt8 *pData, short nLen)
static bool ParseTabPos(WW8_TablePos *aTabPos, WW8PLCFx_Cp_FKP *pPap)
SwTwips MoveOutsideFly(SwFrameFormat *pFlyFormat, const SwPosition &rPos, bool bTableJoin=true)
std::shared_ptr< WW8Fib > m_xWwFib
wwSectionManager m_aSectionManager
void StopAnlToRestart(sal_uInt8 nType, bool bGoBack=true)
bool SetNewFontAttr(sal_uInt16 nFCode, bool bSetEnums, sal_uInt16 nWhich)
sal_uInt16 m_nCurrentColl
sw::util::InsertedTablesManager m_aInsertedTables
void SetNCurrentColl(sal_uInt16 nColl)
sw::util::CharStyleMapper m_aCharStyleMapper
std::unique_ptr< WW8Dop > m_xWDop
std::unique_ptr< WW8FlyPara > ConstructApo(const ApoTestResults &rApo, const WW8_TablePos *pTabPos)
bool StartTable(WW8_CP nStartCp)
std::unique_ptr< FrameDeleteWatch > m_xFormatOfJustInsertedApo
void SetAnld(SwNumRule *pNumR, WW8_ANLD const *pAD, sal_uInt8 nSwLevel, bool bOutLine)
sal_uInt16 StyleUsingLFO(sal_uInt16 nLFOIndex) const
std::shared_ptr< WW8PLCFMan > m_xPlcxMan
std::stack< std::unique_ptr< WW8TabDesc > > m_aTableStack
bool SetLowerSpacing(SwPaM &rMyPam, int nSpace)
bool StyleExists(unsigned int nColl) const
static bool IsBorder(const WW8_BRCVer9 *pbrc, bool bChkBtwn=false)
void NextAnlLine(const sal_uInt8 *pSprm13)
tools::Long Read_Footnote(WW8PLCFManResult *pRes)
void MoveInsideFly(const SwFrameFormat *pFlyFormat)
bool SearchRowEnd(WW8PLCFx_Cp_FKP *pPap, WW8_CP &rStartCp, int nLevel) const
std::unique_ptr< WW8TabDesc > m_xTableDesc
bool InEqualApo(int nLvl) const
const SwFormat * GetStyleWithOrgWWName(std::u16string_view rName) const
bool IsInvalidOrToBeMergedTabCell() const
void AppendTextNode(SwPosition &rPos)
void SetAnlvStrings(SwNumFormat &rNum, int nLevel, WW8_ANLV const &rAV, const sal_uInt8 *pText, size_t nStart, size_t nElements, bool bOutline)
void StopAllAnl(bool bGoBack=true)
void Read_OLST(sal_uInt16, const sal_uInt8 *pData, short nLen)
void NewAttr(const SfxPoolItem &rAttr, const bool bFirstLineOfStSet=false, const bool bLeftIndentSet=false)
void Read_ANLevelDesc(sal_uInt16, const sal_uInt8 *pData, short nLen)
std::unique_ptr< sw::util::RedlineStack > m_xRedlineStack
void SetNumOlst(SwNumRule *pNumR, WW8_OLST *pO, sal_uInt8 nSwLevel)
ApoTestResults TestApo(int nCellLevel, bool bTableRowEnd, const WW8_TablePos *pTabPos)
void StartAnl(const sal_uInt8 *pSprm13)
SwFormat * m_pCurrentColl
std::unique_ptr< WW8RStyle > m_xStyles
sw::util::ParaStyleMapper m_aParaStyleMapper
void RegisterNumFormatOnStyle(sal_uInt16 nStyle)
static bool SetBorder(SvxBoxItem &rBox, const WW8_BRCVer9 *pbrc, short *pSizeArray=nullptr, sal_uInt8 nSetBorders=0xFF)
short ImportSprm(const sal_uInt8 *pPos, sal_Int32 nMemLen, sal_uInt16 nId=0)
SwFormat * m_pStandardFormatColl
rtl_TextEncoding GetCJKCharSet() const
std::shared_ptr< WW8FlyPara > m_xWWFly
sal_uInt8 mnWW8OutlineLevel
rtl_TextEncoding m_eRTLFontSrcCharSet
void SetOrgWWIdent(const OUString &rName, const sal_uInt16 nId)
rtl_TextEncoding GetCharSet() const
bool IsWW8BuiltInHeadingStyle() const
sal_uInt16 m_n81BiDiFlags
const OUString & GetOrgWWName() const
rtl_TextEncoding m_eLTRFontSrcCharSet
rtl_TextEncoding m_eCJKFontSrcCharSet
void Insert(const SwPosition &rPos)
FIB - the File Information Block.
ww::WordVersion GetFIBVersion() const
static rtl_TextEncoding GetFIBCharset(sal_uInt16 chs, LanguageType nLidLocale)
iterator for Piece Table Exceptions of Fkps works on CPs (high-level)
virtual WW8_CP Where() override
virtual bool SeekPos(WW8_CP nCpPos) override
virtual void GetSprms(WW8PLCFxDesc *p) override
SprmResult HasSprm(sal_uInt16 nId, bool bFindFirst=true)
void GetPCDSprms(WW8PLCFxDesc &rDesc)
iterator for footnotes/endnotes and comments
const void * GetData() const
void ImportSprms(std::size_t nPosFc, short nLen, bool bPap)
WW8RStyle(const WW8RStyle &)=delete
wwSprmParser maSprmParser
void ImportGrupx(short nLen, bool bPara, bool bOdd)
bool PrepareStyle(SwWW8StyInf &rSI, ww::sti eSti, sal_uInt16 nThisStyle, sal_uInt16 nNextStyle, std::map< OUString, sal_Int32 > &rParaCollisions, std::map< OUString, sal_Int32 > &rCharCollisions)
void ImportNewFormatStyles()
void PostStyle(SwWW8StyInf const &rSI, bool bOldNoImp)
void RecursiveReg(sal_uInt16 nNr)
SprmResult HasParaSprm(sal_uInt16 nId) const
short ImportUPX(short nLen, bool bPAP, bool bOdd)
void ImportOldFormatStyles()
void Import1Style(sal_uInt16 nNr, std::map< OUString, sal_Int32 > &rParaCollisions, std::map< OUString, sal_Int32 > &rCharCollisions)
void push_back(SwTableBox *pBox)
simple Iterator for SPRMs
const sal_uInt8 * GetSprms() const
sal_Int32 GetRemLen() const
const sal_uInt8 * GetCurrentParams() const
void SetSprms(const sal_uInt8 *pSprms_, sal_Int32 nLen_)
sal_uInt16 GetCurrentId() const
std::unique_ptr< WW8_STD > Read1Style(sal_uInt16 &rSkip, OUString *pString)
bool IsValidCell(short nCol) const
void SetTabDirection(SwTableBox *pBox, short nWwIdx)
void SetPamInCell(short nWwCol, bool bPam)
const SwTableLines * m_pTabLines
OUString GetNumRuleName() const
std::vector< OUString > m_aNumRuleNames
SwPosition * m_pParentPos
void SetTabShades(SwTableBox *pBox, short nWwIdx)
void SetTabVertAlign(SwTableBox *pBox, short nWwIdx)
void SetSizePosition(SwFrameFormat *pFrameFormat)
sal_uInt16 GetLogicalWWCol() const
sal_uInt16 m_nRowsToRepeat
std::shared_ptr< SwUnoCursor > m_xTmpPos
WW8TabBandDesc * m_pFirstBand
bool InFirstParaInCell() const
WW8TabDesc(WW8TabDesc const &)=delete
WW8_TCell * m_pCurrentWWCell
void UpdateTableMergeGroup(WW8_TCell const &rCell, WW8SelBoxInfo *pActGroup, SwTableBox *pActBox, sal_uInt16 nCol)
void SetTabBorders(SwTableBox *pBox, short nIdx)
void InsertCells(short nIns)
short GetCurrentCol() const
WW8TabBandDesc * m_pActBand
std::vector< std::unique_ptr< WW8SelBoxInfo > > m_MergeGroups
void SetNumRuleName(const OUString &rName)
WW8SelBoxInfo * FindMergeGroup(short nX1, short nWidth, bool bExact)
SwTableBoxes * m_pTabBoxes
sw::util::RedlineStack * getOldRedlineStack()
std::unique_ptr< sw::util::RedlineStack > mxOldRedlineStack
StyleResult GetStyle(const OUString &rName, ww::sti eSti, std::map< OUString, sal_Int32 > &rCollisions)
Get the writer style which the word style should map to.
std::pair< SwCharFormat *, bool > StyleResult
StyleResult StyleResult is a std::pair of a pointer to a style and a flag which is true if the style ...
void InsertTable(SwTableNode &rTableNode, SwPaM &rPaM)
std::pair< SwTextFormatColl *, bool > StyleResult
StyleResult StyleResult is a std::pair of a pointer to a style and a flag which is true if the style ...
StyleResult GetStyle(const OUString &rName, ww::sti eSti, std::map< OUString, sal_Int32 > &rCollisions)
Get the writer style which the word style should map to.
bool close(const SwPosition &rPos, RedlineType eType)
void SetFamily(FontFamily)
void SetCharSet(rtl_TextEncoding)
void SetFamilyName(const OUString &rFamilyName)
void SetCurrentSectionVerticalAdjustment(const css::drawing::TextVerticalAdjust nVA)
sal_uInt32 GetTextAreaWidth() const
bool CurrentSectionIsVertical() const
sal_uInt32 GetPageWidth() const
sal_uInt32 GetPageRight() const
std::deque< wwSection > maSegments
void PrependedInlineNode(const SwPosition &rPos, const SwNode &rNode)
sal_uInt32 GetWWPageTopMargin() const
void SetCurrentSectionHasFootnote()
sal_uInt32 GetPageLeft() const
bool CurrentSectionIsProtected() const
wwSprmParser knows how to take a sequence of bytes and split it up into sprms and their arguments
sal_Int32 DistanceToData(sal_uInt16 nId) const
Get known len of a sprms head, the bytes of the sprm id + any bytes reserved to hold a variable lengt...
SprmResult findSprmData(sal_uInt16 nId, sal_uInt8 *pSprms, sal_Int32 nLen) const
Returns the offset to data of the first sprm of id nId, 0.
sal_Int32 GetSprmSize(sal_uInt16 nId, const sal_uInt8 *pSprm, sal_Int32 nRemLen) const
constexpr ::Color COL_AUTO(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
@ Fixed
Frame cannot be moved in Var-direction.
@ Variable
Frame is variable in Var-direction.
@ Minimum
Value in Var-direction gives minimum (can be exceeded but not be less).
constexpr TypedWhichId< SvxFrameDirectionItem > RES_FRAMEDIR(126)
constexpr sal_uInt16 RES_FRMATR_BEGIN(RES_PARATR_LIST_END)
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_CTL_FONTSIZE(28)
constexpr TypedWhichId< SvxFontItem > RES_CHRATR_CJK_FONT(22)
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_FONTSIZE(8)
constexpr TypedWhichId< SvxFirstLineIndentItem > RES_MARGIN_FIRSTLINE(91)
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_CJK_FONTSIZE(23)
constexpr TypedWhichId< SvxFontItem > RES_CHRATR_CTL_FONT(27)
constexpr sal_uInt16 RES_FRMATR_END(141)
constexpr TypedWhichId< SvxBrushItem > RES_BACKGROUND(111)
constexpr TypedWhichId< SvxHyphenZoneItem > RES_PARATR_HYPHENZONE(69)
constexpr TypedWhichId< SvxOrphansItem > RES_PARATR_ORPHANS(66)
constexpr TypedWhichId< SvxWidowsItem > RES_PARATR_WIDOWS(67)
constexpr TypedWhichId< SvxParaGridItem > RES_PARATR_SNAPTOGRID(77)
constexpr TypedWhichId< SvxBoxItem > RES_BOX(112)
constexpr TypedWhichId< SvxFormatBreakItem > RES_BREAK(100)
constexpr TypedWhichId< SvxFontItem > RES_CHRATR_FONT(7)
constexpr TypedWhichId< SvxColorItem > RES_CHRATR_COLOR(3)
constexpr TypedWhichId< SvxLRSpaceItem > RES_LR_SPACE(97)
constexpr TypedWhichId< SfxStringItem > RES_FLTR_NUMRULE(192)
#define SAL_WARN_IF(condition, area, stream)
#define SAL_WARN(area, stream)
#define SAL_N_ELEMENTS(arr)
void SetProgressState(tools::Long nPosition, SwDocShell const *pDocShell)
std::unique_ptr< sal_Int32[]> pData
const sal_uInt16 sprmTSetBrc
const sal_uInt16 sprmTDxaCol
const sal_uInt16 sprmTDxaLeft
const sal_uInt16 sprmTDyaRowHeight
const sal_uInt16 sprmTTableHeader
const sal_uInt16 sprmTTableBorders
const sal_uInt16 sprmTDelete
const sal_uInt16 sprmTFCantSplit
const sal_uInt16 sprmTDxaGapHalf
const sal_uInt16 sprmTInsert
const sal_uInt16 sprmTDefTable
const sal_uInt16 sprmTDefTableShd
const sal_uInt16 LN_PAnld
OStringBuffer & padToLength(OStringBuffer &rBuffer, sal_Int32 nLength, char cFill='\0')
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
sal_uInt32 iterateCodePoints(std::u16string_view string, sal_Int32 *indexUtf16, sal_Int32 incrementCodePoints=1)
constexpr T & temporary(T &&x)
const sal_Int32 nCellWidth
const char * GetEnglishNameFromSti(sti eSti) noexcept
Find the WinWord english name from a sti index.
bool StandardStiIsCharStyle(sti eSti) noexcept
Determine if the WinWord sti is standard Character Style.
sti GetCanonicalStiFromStc(sal_uInt8 stc) noexcept
Find the WinWord sti index of an old <= Word2 stc (style code)
bool IsSevenMinus(WordVersion eVer)
o3tl::strong_int< sal_Int32, struct Tag_SwNodeOffset > SwNodeOffset
SwNodeOffset abs(const SwNodeOffset &a)
const sal_Unicode cBulletChar
Character for lists.
bool GoInContent(SwPaM &rPam, SwMoveFnCollection const &fnMove)
SwMoveFnCollection const & fnMoveBackward
@ RES_POOLCOLL_STANDARD
Standard.
TOOLS_DLLPUBLIC OString read_uInt8s_ToOString(SvStream &rStrm, std::size_t nUnits)
TOOLS_DLLPUBLIC bool checkSeek(SvStream &rSt, sal_uInt64 nOffset)
SwNumRule * GetNumRule(const SwDoc &rDoc, sal_uInt8 nNumType)
void SetNumRule(const OUString &rNumRule, sal_uInt8 nNumType)
static constexpr sal_uInt16 val
Marks a position in the document model.
void Adjust(SwNodeOffset nDelta)
Adjust node position, and resets content position to zero.
void Assign(const SwNode &rNd, SwNodeOffset nDelta, sal_Int32 nContentOffset=0)
These all set both nNode and nContent.
void SetContent(sal_Int32 nContentIndex)
Set content index, only valid to call this if the position points to a SwContentNode subclass.
SwNodeOffset GetNodeIndex() const
sal_Int32 GetContentIndex() const
const sal_uInt8 * pMemPos
void ProcessSprmTSetBRC(int nBrcVer, const sal_uInt8 *pParamsTSetBRC, sal_uInt16 nParamsLen)
sal_uInt8 transCell(sal_uInt8 nWwCol) const
sal_uInt8 nOverrideSpacing[MAX_COL+1]
sal_uInt8 nTransCell[MAX_COL+2]
sal_uInt16 maDirections[MAX_COL+1]
short nOverrideValues[MAX_COL+1][4]
void ReadNewShd(const sal_uInt8 *pS, bool bVer67, sal_uInt8 nStart)
void ReadShd(const sal_uInt8 *pS)
void ProcessSprmTTableBorders(int nBrcVer, const sal_uInt8 *pParams, sal_uInt16 nParamsLen)
WW8TabBandDesc * pNextBand
void ProcessSprmTInsert(const sal_uInt8 *pParamsTInsert)
void ProcessSpecificSpacing(const sal_uInt8 *pParamsTInsert)
void ProcessSprmTDelete(const sal_uInt8 *pParamsTDelete)
void ReadDef(bool bVer67, const sal_uInt8 *pS, short nLen)
void ProcessDirection(const sal_uInt8 *pParams)
void ProcessSprmTDxaCol(const sal_uInt8 *pParamsTDxaCol)
void ProcessSpacing(const sal_uInt8 *pParamsTInsert)
sal_uInt8 brcType() const
This is what we use in the Parser (and Dumper)
sal_uInt16 GetValue() const
SVX_NUM_IROHA_FULLWIDTH_JA
SVX_NUM_FULL_WIDTH_ARABIC
SVX_NUM_CHARS_LOWER_LETTER_N
SVX_NUM_NUMBER_TRADITIONAL_JA
SVX_NUM_NUMBER_UPPER_ZH_TW
SVX_NUM_HANGUL_SYLLABLE_KO
SVX_NUM_IROHA_HALFWIDTH_JA
SVX_NUM_CHARS_UPPER_LETTER_N
std::vector< SwTableBox * > SwTableBoxes
constexpr sal_uInt8 MAXLEVEL
css::drawing::Direction3D aDirection
static SvxFrameDirection MakeDirection(sal_uInt16 nCode, bool bIsBiDi)
static void SetBaseAnlv(SwNumFormat &rNum, WW8_ANLV const &rAV, sal_uInt8 nSwLevel)
Word2CHPX ReadWord2Chpx(SvStream &rSt, std::size_t nOffset, sal_uInt8 nSize)
std::vector< sal_uInt8 > ChpxToSprms(const Word2CHPX &rChpx)
static short WW8SkipEven(SvStream *pSt)
static short WW8SkipOdd(SvStream *pSt)
static wwTableSprm GetTableSprm(sal_uInt16 nId, ww::WordVersion eVer)
WW8LvlType GetNumType(sal_uInt8 nWwLevelNo)