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{}
84 for (sal_uInt16 & rn : maDirections)
100 if( !
close( rPos, eType ) )
106 OSL_ENSURE( bResult,
"close without open!");
114 "should not be possible, must be at least one segment");
122 "should not be possible, must be at least one segment");
130 "should not be possible, must be at least one segment");
139 "should not be possible, must be at least one segment");
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()->nContent.GetIndex();
199 sChar += OUStringChar(pText->
GetText()[--nPos]);
201 --m_pPaM->GetMark()->nContent;
202 std::shared_ptr<SwUnoCursor> xLastAnchorCursor(m_pLastAnchorPos ?
m_rDoc.
CreateUnoCursor(*m_pLastAnchorPos) :
nullptr);
203 m_pLastAnchorPos.reset();
205 m_pPaM->DeleteMark();
206 if (xLastAnchorCursor)
207 m_pLastAnchorPos.reset(
new SwPosition(*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;
236 SAL_WARN_IF(aDeleteListener.WasDeleted(),
"sw.ww8",
"Footnode deleted during its import");
237 if (!aDeleteListener.WasDeleted())
241 OSL_ENSURE(sChar.getLength()==1 && ((rDesc.
mbAutoNum == (sChar[0] == 2))),
242 "footnote autonumbering must be 0x02, and everything else must not be");
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;
272 m_pPaM->GetPoint()->nContent.Assign( pTNd, 0 );
275 if (nFirstLineIndent < 0 && rText.getLength() > 1 && rText[1] == 0x09)
276 ++m_pPaM->GetMark()->nContent;
277 ++m_pPaM->GetMark()->nContent;
278 m_xReffingStck->Delete(*m_pPaM);
280 m_pPaM->DeleteMark();
285 *m_pPaM->GetPoint() = aTmpPos;
287 m_xPlcxMan = xOldPlcxMan;
288 m_xPlcxMan->RestoreAllPLCFx( aSave );
292 m_aSectionManager.SetCurrentSectionHasFootnote();
294 m_aFootnoteStack.pop_back();
316 if (
const void*
pData = pEndNote ? pEndNote->
GetData() :
nullptr)
323 if (
const void*
pData = pFootNote ? pFootNote->
GetData() :
nullptr)
330 m_aFootnoteStack.push_back(aDesc);
341 std::set<std::pair<WW8_CP, WW8_CP>> aPrevRes;
351 aSprmRes = pPap->
HasSprm(0x6649);
355 if (nLevel + 1 == *pLevel)
360 OSL_ENSURE(!nLevel || pLevel,
"sublevel without level sprm");
377 if (!aPrevRes.insert(aBounds).second)
379 SAL_WARN(
"sw.ww8",
"SearchRowEnd, loop in paragraph property chain");
398 std::set<std::pair<WW8_CP, WW8_CP>> aPrevRes;
418 if (!aPrevRes.insert(aBounds).second)
420 SAL_WARN(
"sw.ww8",
"SearchTableEnd, loop in paragraph property chain");
431 const WW8_TablePos *pTopLevelTable = nCellLevel <= 1 ? pTabPos :
nullptr;
435 sal_uInt16
const nStyle(m_xPlcxMan->GetColl());
436 if (!m_bTxbxFlySection && nStyle < m_vColl.size())
437 aRet.
mpStyleApo = StyleExists(nStyle) ? m_vColl[nStyle].m_xWWFly.get() :
nullptr;
458 aRet.
m_bHasSprm37 = m_xPlcxMan->HasParaSprm(m_bVer67 ? 37 : 0x2423).pSprm !=
nullptr;
459 SprmResult aSrpm29 = m_xPlcxMan->HasParaSprm(m_bVer67 ? 29 : 0x261B);
465 bool bNowApo = aRet.
HasFrame() || pTopLevelTable;
468 if (!ConstructApo(aRet, pTabPos))
472 bool bTestAllowed = !m_bTxbxFlySection && !bTableRowEnd;
481 if (nCellLevel == m_nInTable)
490 OSL_ENSURE(m_xTableDesc,
"What!");
491 bTestAllowed =
false;
500 m_xTableDesc->GetCurrentCol() == 0 &&
501 ( !m_xTableDesc->IsValidCell( m_xTableDesc->GetCurrentCol() ) ||
502 m_xTableDesc->InFirstParaInCell() );
511 aRet.
mbStartApo = bNowApo && !InEqualOrHigherApo(1);
512 aRet.
mbStopApo = InEqualOrHigherApo(nCellLevel) && !bNowApo;
520 if (bNowApo && InEqualApo(nCellLevel))
523 if (!TestSameApo(aRet, pTabPos))
536 SVX_NUM_ARABIC, SVX_NUM_ARABIC };
538 static const SvxAdjust eAdjA[4] = { SvxAdjust::Left,
539 SvxAdjust::Right, SvxAdjust::Left, SvxAdjust::Left };
573 if ((rAV.
aBits1 & 0x4) >> 2)
581 sal_Int16 nIndent =
std::abs(static_cast<sal_Int16>(SVBT16ToUInt16( rAV.
dxaIndent )));
590 if( rAV.
nfc == 5 || rAV.
nfc == 7 )
598 const sal_uInt8* pText,
size_t nStart,
size_t nElements,
bool bOutline)
600 if (nStart > nElements)
606 bool bInsert =
false;
607 rtl_TextEncoding eCharSet = m_eStructCharSet;
609 const WW8_FFN* pF = m_xFonts->GetFont(SVBT16ToUInt16(rAV.
ftc));
610 bool bListSymbol = pF && ( pF->
aFFNBase.
chs == 2 );
613 OUStringBuffer sText(static_cast<sal_Int32>(nLen));
616 if (nLen > nElements)
618 SAL_WARN(
"sw.ww8",
"SetAnlvStrings: ignoring out of range "
619 << nLen <<
" vs " << nElements <<
" max");
622 sText = OUString(reinterpret_cast<char const *>(pText), nLen, eCharSet);
629 if (nLen > nElements / 2)
631 SAL_WARN(
"sw.ww8",
"SetAnlvStrings: ignoring out of range "
632 << nLen <<
" vs " << nElements / 2 <<
" max");
635 for(sal_uInt32
i = 0;
i < nLen; ++
i, pText += 2)
637 sText.append(static_cast<sal_Unicode>(SVBT16ToUInt16(*reinterpret_cast<SVBT16 const *>(pText))));
668 if( GetFontParams( SVBT16ToUInt16( rAV.
ftc ), eFamily, aName,
669 ePitch, eCharSet ) ){
684 OUString::unacquired(sText).iterateCodePoints(&
o3tl::temporary(sal_Int32(0))));
698 sPrefix = sText.copy( 0, rAV.
cbTextBefore ).makeStringAndClear();
727 pNumR->
Set(nSwLevel, aNF);
737 if( m_xStyles->mpStyRule )
738 return m_xStyles->mpStyRule;
740 const OUString aBaseName(
"WW8StyleNum");
748 m_xStyles->mpStyRule->SetAutoRule(
false);
750 return m_xStyles->mpStyRule;
756 m_nSwNumLevel = 0xff;
767 if (pColl !=
nullptr && pColl->
m_bColl && *pData)
773 m_nSwNumLevel = *pData - 1;
774 if (!m_bNoAttrImport)
775 static_cast<SwTextFormatColl*
>(m_pCurrentColl)->AssignToListLevelOfOutlineStyle( m_nSwNumLevel );
782 else if( *pData == 10 || *pData == 11 )
785 m_xStyles->mnWwNumLevel = *pData;
801 if( !m_pCurrentColl || nLen <= 0
802 || (pStyInf && !pStyInf->
m_bColl)
805 m_nSwNumLevel = 0xff;
811 SAL_WARN(
"sw.ww8",
"ANLevelDesc property is " << nLen <<
" long, needs to be at least " <<
sizeof(
WW8_ANLD));
812 m_nSwNumLevel = 0xff;
816 if (m_nSwNumLevel <= 9)
822 const OUString
aName(
"Outline");
828 SetAnld(&aNR, reinterpret_cast<WW8_ANLD const *>(pData), m_nSwNumLevel,
true);
833 else if( m_xStyles->mnWwNumLevel == 10 || m_xStyles->mnWwNumLevel == 11 ){
835 SetAnld(pNR, reinterpret_cast<WW8_ANLD const *>(pData), 0,
false);
838 pStyInf = GetStyle(m_nCurrentColl);
839 if (pStyInf !=
nullptr)
858 for (i = 0, pAV1 = pO->
rganlv; i < nSwLevel; ++i, ++pAV1)
864 pNumR->
Set(nSwLevel, aNF);
879 SAL_WARN(
"sw.ww8",
"WW8_OLST property is " << nLen <<
" long, needs to be at least " <<
sizeof(
WW8_OLST));
884 *m_xNumOlst = *
reinterpret_cast<WW8_OLST const *
>(pData);
890 if( nWwLevelNo == 12 )
892 else if( nWwLevelNo == 10 )
894 else if( nWwLevelNo == 11 )
896 else if( nWwLevelNo > 0 && nWwLevelNo <= 9 )
903 const OUString& rNumRule =
WW8_Numbering == nNumType ? msNumberingNumRule : msOutlineNumRule;
904 if (rNumRule.isEmpty())
912 msNumberingNumRule = rNumRule;
914 msOutlineNumRule = rNumRule;
921 m_bCurrentAND_fNumberAcross =
false;
936 sNumRule = m_xTableDesc->GetNumRuleName();
937 if (!sNumRule.isEmpty())
961 if (sNumRule.isEmpty())
975 m_xTableDesc->SetNumRuleName(pNumRule->
GetName());
981 sNumRule = pNumRule ? pNumRule->
GetName() : OUString();
983 m_xCtrlStck->NewAttr(*m_pPaM->GetPoint(),
986 m_aANLDRules.SetNumRule(sNumRule, m_nWwNumType);
1001 if (*pSprm13 == 10 || *pSprm13 == 11)
1004 if (pNumRule && !pNumRule->
GetNumFormat(m_nSwNumLevel))
1010 SetAnld(pNumRule, reinterpret_cast<WW8_ANLD const *>(aS12.
pSprm), m_nSwNumLevel,
false);
1013 else if( *pSprm13 > 0 && *pSprm13 <=
MAXLEVEL )
1015 m_nSwNumLevel = *pSprm13 - 1;
1017 if (pNumRule && !pNumRule->
GetNumFormat(m_nSwNumLevel))
1022 for (
sal_uInt8 nI = 0; nI < m_nSwNumLevel; ++nI)
1025 SetNumOlst(pNumRule, m_xNumOlst.get(), nI);
1028 SetNumOlst(pNumRule, m_xNumOlst.get(), m_nSwNumLevel);
1035 SetAnld(pNumRule, reinterpret_cast<WW8_ANLD const *>(aS12.
pSprm), m_nSwNumLevel,
false);
1040 m_nSwNumLevel = 0xff;
1059 StopAnlToRestart(
WW8_None, bGoBack);
1069 *m_pPaM->GetPoint() = aTmpPos;
1074 m_aANLDRules.msNumberingNumRule.clear();
1080 bool bNumberingNotStopOutline =
1083 if (!bNumberingNotStopOutline)
1084 m_aANLDRules.msOutlineNumRule.clear();
1086 m_nSwNumLevel = 0xff;
1103 memcpy( pSHDs, rBand.
pSHDs, nWwCols *
sizeof(
WW8_SHD ) );
1107 pNewSHDs =
new Color[nWwCols];
1110 memcpy(aDefBrcs, rBand.
aDefBrcs,
sizeof(aDefBrcs));
1124 nLen -= 2 * (nCols + 1);
1128 short nOldCols = nWwCols;
1132 for (
int i = 0;
i <= nCols;
i++, pT+=2)
1133 nCenter[
i] = static_cast<sal_Int16>(SVBT16ToUInt16( pT ));
1135 if( nCols != nOldCols )
1145 short nFileCols = nLen / ( bVer67 ? 10 : 20 );
1153 short nColsToRead = std::min<short>(nFileCols, nCols);
1155 if (nColsToRead <= 0)
1172 for (
int i = 0;
i < nColsToRead;
i++, ++pCurrentTC,++pTc)
1176 pCurrentTC->bFirstMerged =
sal_uInt8( ( aBits1 & 0x01 ) != 0 );
1177 pCurrentTC->bMerged =
sal_uInt8( ( aBits1 & 0x02 ) != 0 );
1186 if( ( pCurrentTC->bMerged )
1202 for (
int k = 0; k < nColsToRead; ++k, ++pCurrentTC, ++pTc )
1204 sal_uInt16 aBits1 = SVBT16ToUInt16( pTc->
aBits1Ver8 );
1205 pCurrentTC->bFirstMerged =
sal_uInt8( ( aBits1 & 0x0001 ) != 0 );
1206 pCurrentTC->bMerged =
sal_uInt8( ( aBits1 & 0x0002 ) != 0 );
1207 pCurrentTC->bVertical =
sal_uInt8( ( aBits1 & 0x0004 ) != 0 );
1208 pCurrentTC->bBackward =
sal_uInt8( ( aBits1 & 0x0008 ) != 0 );
1209 pCurrentTC->bRotateFont =
sal_uInt8( ( aBits1 & 0x0010 ) != 0 );
1210 pCurrentTC->bVertMerge =
sal_uInt8( ( aBits1 & 0x0020 ) != 0 );
1211 pCurrentTC->bVertRestart =
sal_uInt8( ( aBits1 & 0x0040 ) != 0 );
1212 pCurrentTC->nVertAlign = ( ( aBits1 & 0x0180 ) >> 7 );
1226 for (
int k = 0; k < nCols; ++k)
1228 if(maDirections[k] == 4)
1230 if(pTCs[k].bVertical)
1232 if(pTCs[k].bBackward)
1233 maDirections[k] = 3;
1235 maDirections[k] = 1;
1243 if( !pParamsTSetBRC || !pTCs )
1248 SAL_WARN(
"sw.ww8",
"table border property is too short");
1256 if (nitcFirst >= nWwCols)
1259 if (nitcLim > nWwCols)
1262 bool bChangeRight = (nFlag & 0x08) != 0;
1263 bool bChangeBottom = (nFlag & 0x04) != 0;
1264 bool bChangeLeft = (nFlag & 0x02) != 0;
1265 bool bChangeTop = (nFlag & 0x01) != 0;
1267 WW8_TCell* pCurrentTC = pTCs + nitcFirst;
1273 SAL_WARN(
"sw.ww8",
"table border property is too short");
1276 brcVer9 =
WW8_BRCVer9(
WW8_BRC(*reinterpret_cast<WW8_BRCVer6 const *>(pParamsTSetBRC+3)));
1278 else if( nBrcVer == 8 )
1280 static_assert(
sizeof (
WW8_BRC) == 4,
"this has to match the msword size");
1281 if (nParamsLen <
sizeof(
WW8_BRC) + 3)
1283 SAL_WARN(
"sw.ww8",
"table border property is too short");
1286 brcVer9 =
WW8_BRCVer9(*reinterpret_cast<WW8_BRC const *>(pParamsTSetBRC+3));
1292 SAL_WARN(
"sw.ww8",
"table border property is too short");
1295 brcVer9 = *
reinterpret_cast<WW8_BRCVer9 const *
>(pParamsTSetBRC+3);
1298 for(
int i = nitcFirst;
i < nitcLim; ++
i, ++pCurrentTC )
1318 SAL_WARN(
"sw.ww8",
"table border property is too short");
1322 for (
int i = 0;
i < 6; ++
i)
1325 else if ( nBrcVer == 8 )
1327 static_assert(
sizeof (
WW8_BRC) == 4,
"this has to match the msword size");
1328 if (nParamsLen <
sizeof(
WW8_BRC) * 6)
1330 SAL_WARN(
"sw.ww8",
"table border property is too short");
1333 for(
int i = 0;
i < 6; ++
i )
1334 aDefBrcs[
i] =
WW8_BRCVer9(reinterpret_cast<WW8_BRC const *>(pParams)[
i]);
1338 if (nParamsLen <
sizeof( aDefBrcs ))
1340 SAL_WARN(
"sw.ww8",
"table border property is too short");
1343 memcpy( aDefBrcs, pParams,
sizeof( aDefBrcs ) );
1352 if( !(nWwCols && pParamsTDxaCol) )
1357 short nDxaCol =
static_cast<sal_Int16
>(SVBT16ToUInt16( pParamsTDxaCol + 2 ));
1359 for(
int i = nitcFirst; (
i < nitcLim) && (
i < nWwCols);
i++ )
1361 const short nOrgWidth = nCenter[
i+1] - nCenter[
i];
1362 const short nDelta = nDxaCol - nOrgWidth;
1363 for(
int j =
i+1; j <= nWwCols; j++ )
1365 nCenter[j] = nCenter[j] + nDelta;
1372 if( !nWwCols || !pParamsTInsert )
1375 sal_uInt8 nitcInsert = pParamsTInsert[0];
1379 sal_uInt16 ndxaCol = SVBT16ToUInt16( pParamsTInsert+2 );
1382 if (nitcInsert > nWwCols)
1384 nNewWwCols = nitcInsert+nctc;
1390 nctc = ::sal::static_int_cast<
sal_uInt8>(nNewWwCols-nitcInsert);
1395 nNewWwCols = nWwCols+nctc;
1401 nctc = ::sal::static_int_cast<
sal_uInt8>(nNewWwCols-nWwCols);
1409 memcpy( pTC2s, pTCs, nWwCols *
sizeof(
WW8_TCell ) );
1415 if (nitcInsert <= nWwCols)
1418 nCenter[nWwCols + nctc] = nCenter[nWwCols]+nctc*ndxaCol;
1419 for(
int i = nWwCols-1;
i >= nitcInsert;
i--)
1422 nCenter[
i + nctc] = nCenter[
i]+nctc*ndxaCol;
1425 pTCs[
i + nctc] = pTCs[
i];
1430 for(
int i = nWwCols;
i > nitcInsert+nWwCols;
i--)
1431 nCenter[
i] =
i ? (nCenter[
i - 1]+ndxaCol) : 0;
1434 for(
int j = 0;j < nctc; j++)
1435 nCenter[j + nitcInsert] = (j + nitcInsert) ? (nCenter[j + nitcInsert -1]+ndxaCol) : 0;
1437 nWwCols = nNewWwCols;
1445 sal_uInt16
nCode = SVBT16ToUInt16(pParams);
1447 OSL_ENSURE(nStartCell < nEndCell,
"not as I thought");
1448 OSL_ENSURE(nEndCell <
MAX_COL + 1,
"not as I thought");
1454 for (;nStartCell < nEndCell; ++nStartCell)
1455 maDirections[nStartCell] = nCode;
1460 sal_uInt8 nLen = pParams ? *(pParams - 1) : 0;
1461 OSL_ENSURE(nLen == 6,
"Unexpected spacing len");
1465 #if OSL_DEBUG_LEVEL > 0
1467 OSL_ENSURE(nWhichCell == 0,
"Expected cell to be 0!");
1473 OSL_ENSURE(nSideBits < 0x10,
"Unexpected value for nSideBits");
1475 sal_uInt16
nValue = SVBT16ToUInt16( pParams );
1476 for (
int i = wwTOP;
i <= wwRIGHT;
i++)
1478 switch (nSideBits & (1 <<
i))
1481 mnDefaultTop = nValue;
1484 mnDefaultLeft = nValue;
1487 mnDefaultBottom = nValue;
1490 mnDefaultRight = nValue;
1495 OSL_ENSURE(
false,
"Impossible");
1503 sal_uInt8 nLen = pParams ? *(pParams - 1) : 0;
1504 OSL_ENSURE(nLen == 6,
"Unexpected spacing len");
1508 const sal_uInt8 nStartCell = *pParams++;
1510 OSL_ENSURE(nStartCell <
MAX_COL + 1,
"Cell out of range in spacings");
1511 if ( nStartCell >= nEndCell || nEndCell >
MAX_COL+1 )
1515 OSL_ENSURE(nSideBits < 0x10,
"Unexpected value for nSideBits");
1518 OSL_ENSURE(nSizeType == 0x3,
"Unexpected non-twip value for margin width");
1519 if ( nSizeType != 0x3 )
1522 sal_uInt16
nValue = SVBT16ToUInt16( pParams );
1524 for (
int nCell = nStartCell; nCell < nEndCell; ++nCell)
1526 nOverrideSpacing[ nCell ] |= nSideBits;
1527 OSL_ENSURE(nOverrideSpacing[ nCell ] < 0x10,
"Unexpected value for nSideBits");
1529 for (
int i=0;
i < 4;
i++)
1531 if (nSideBits & (1 <<
i))
1532 nOverrideValues[ nCell ][
i ] = nValue;
1539 if( !(nWwCols && pParamsTDelete) )
1543 if (nitcFirst >= nWwCols)
1546 if (nitcLim <= nitcFirst)
1553 int nShlCnt = nWwCols - nitcLim;
1557 WW8_TCell* pCurrentTC = pTCs + nitcFirst;
1559 while( i < nShlCnt )
1562 nCenter[nitcFirst + i] = nCenter[nitcLim + i];
1565 *pCurrentTC = pTCs[ nitcLim + i];
1571 nCenter[nitcFirst + i] = nCenter[nitcLim + i];
1574 short nCellsDeleted = nitcLim - nitcFirst;
1576 if (nCellsDeleted > nWwCols)
1577 nCellsDeleted = nWwCols;
1578 nWwCols -= nCellsDeleted;
1594 short nCount = nLen >> 1;
1595 if (nCount > nWwCols)
1600 for(i=0, pShd = reinterpret_cast<SVBT16 const *>(pS); i<nCount; i++, pShd++ )
1601 pSHDs[i].SetWWValue( *pShd );
1607 if (!nLen || nStart >= nWwCols)
1611 pNewSHDs =
new Color[nWwCols];
1613 short nCount = nLen / 10 + nStart;
1614 if (nCount > nWwCols)
1632 if (aRes.
pSprm ==
nullptr)
1648 sprmTDefTableNewShd, sprmTDefTableNewShd2nd, sprmTDefTableNewShd3rd,
1649 sprmTCellPadding, sprmTCellPaddingDefault
1662 return sprmTTableWidth;
1664 return sprmTTextFlow;
1692 return sprmTDefTableNewShd;
1694 return sprmTDefTableNewShd2nd;
1696 return sprmTDefTableNewShd3rd;
1698 return sprmTTableBorders90;
1702 return sprmTSetBrc90;
1704 return sprmTCellPadding;
1706 return sprmTCellPaddingDefault;
1771 m_pFirstBand(nullptr),
1772 m_pActBand(nullptr),
1773 m_pTableNd(nullptr),
1774 m_pTabLines(nullptr),
1775 m_pTabLine(nullptr),
1776 m_pTabBoxes(nullptr),
1778 m_pCurrentWWCell(nullptr),
1780 m_nDefaultSwCols(0),
1785 m_nPreferredWidth(0),
1788 m_bClaimLineFormat(
false),
1789 m_eOri(
text::HoriOrientation::
LEFT),
1792 m_nCurrentBandRow(0),
1796 m_pParentPos(nullptr),
1797 m_pFlyFormat(nullptr),
1802 static const sal_Int16 aOriArr[] =
1804 text::HoriOrientation::LEFT, text::HoriOrientation::CENTER, text::HoriOrientation::RIGHT, text::HoriOrientation::CENTER
1819 std::set<std::pair<WW8_CP, WW8_CP>> aPrevRes;
1824 short nTabeDxaNew = SHRT_MAX;
1825 bool bTabRowJustRead =
false;
1827 const sal_uInt8* pNewShadeSprm[3] = {
nullptr,
nullptr,
nullptr};
1828 const sal_uInt8* pTableBorders =
nullptr;
1829 sal_uInt16 nTableBordersLen = 0;
1830 const sal_uInt8* pTableBorders90 =
nullptr;
1831 sal_uInt16 nTableBorders90Len = 0;
1833 std::vector<std::pair<const sal_uInt8*, sal_uInt16>> aTSetBrcs, aTSetBrc90s;
1849 for (
int nLoop = 0; nLoop < 2; ++nLoop)
1855 sal_Int32 nFixedLen = aSprmParser.DistanceToData(nId);
1856 sal_Int32 nL = aSprmParser.GetSprmSize(nId, aSprmIter.
GetSprms(), aSprmIter.
GetRemLen());
1857 sal_Int32 nLen = nL - nFixedLen;
1861 case sprmTTableWidth:
1887 pTableBorders = pParams;
1888 nTableBordersLen = nLen;
1890 case sprmTTableBorders90:
1891 pTableBorders90 = pParams;
1892 nTableBorders90Len = nLen;
1902 m_eOri = aOriArr[*pParams & 0x3];
1905 m_bIsBiDi = SVBT16ToUInt16(pParams) != 0;
1908 pNewBand->
nGapHalf =
static_cast<sal_Int16
>(SVBT16ToUInt16( pParams ));
1911 pNewBand->
nLineHeight =
static_cast<sal_Int16
>(SVBT16ToUInt16( pParams ));
1915 pNewBand->
ReadDef(bOldVer, pParams, nLen);
1916 bTabRowJustRead =
true;
1919 pShadeSprm = pParams;
1921 case sprmTDefTableNewShd:
1922 pNewShadeSprm[0] = pParams;
1924 case sprmTDefTableNewShd2nd:
1925 pNewShadeSprm[1] = pParams;
1927 case sprmTDefTableNewShd3rd:
1928 pNewShadeSprm[2] = pParams;
1936 short nDxaNew =
static_cast<sal_Int16
>(SVBT16ToUInt16( pParams ));
1937 if( nDxaNew < nTabeDxaNew )
1938 nTabeDxaNew = nDxaNew;
1942 aTSetBrcs.emplace_back(pParams, nLen);
1945 aTSetBrc90s.emplace_back(pParams, nLen);
1956 case sprmTCellPaddingDefault:
1959 case sprmTCellPadding:
1980 if (bTabRowJustRead)
1985 pNewBand->
ReadShd(pShadeSprm);
1986 if (pNewShadeSprm[0])
1987 pNewBand->
ReadNewShd(pNewShadeSprm[0], bOldVer, 0);
1988 if (pNewShadeSprm[1])
1989 pNewBand->
ReadNewShd(pNewShadeSprm[1], bOldVer, 22);
1990 if (pNewShadeSprm[2])
1991 pNewBand->
ReadNewShd(pNewShadeSprm[2], bOldVer, 44);
1992 if (pTableBorders90)
1994 else if (pTableBorders)
1996 pTableBorders, nTableBordersLen);
1997 for (
const auto&
a : aTSetBrcs)
1999 for (
const auto&
a : aTSetBrc90s)
2003 if( nTabeDxaNew < SHRT_MAX )
2005 short* pCenter = pNewBand->
nCenter;
2006 short firstDxaCenter = *pCenter;
2007 for(
int i = 0;
i < pNewBand->
nWwCols;
i++, ++pCenter )
2012 (nTabeDxaNew - (firstDxaCenter + pNewBand->
nGapHalf));
2054 SprmResult aParamsRes = HasTabCellSprm(pPap, bOldVer);
2059 if (!pParams || aParamsRes.
nRemainingData < 1 || (1 != *pParams) ||
2060 (pLevel && aLevelRes.
nRemainingData >= 1 && (*pLevel <= m_pIo->m_nInTable)))
2066 WW8_CP nMyStartCp=nStartCp;
2107 if (!aPrevRes.insert(aBounds).second)
2109 SAL_WARN(
"sw.ww8",
"WW8TabDesc, loop in paragraph property chain");
2124 pNewBand->
nRows = 1;
2151 short nMinCols = SHRT_MAX;
2183 short nOrigWidth[
MAX_COL + 1];
2201 if (nCellWidth != nOrigWidth[
i])
2203 if (nOrigWidth[i] == 0)
2207 else if ((nCellWidth <= 0) && (nOrigWidth[i] > 0))
2225 if(
m_eOri == text::HoriOrientation::RIGHT)
2250 for (
int k = 0; k < pR->
nWwCols; ++k)
2253 for (
int i = 0;
i < 4; ++
i)
2275 j = (k == pR->
nWwCols - 1) ? 3 : 5;
2294 for (i = 0; i < pR->
nWwCols; ++i)
2309 OSL_ENSURE(i,
"no columns in row ?");
2316 if (i && !pR->
bExist[i-1])
2319 while (k && !pR->
bExist[k])
2321 for (sal_uInt16
n=k+1;
n<i;
n++)
2333 if ((m_nMinLeft && !
m_bIsBiDi && text::HoriOrientation::LEFT ==
m_eOri) ||
2334 (m_nMinLeft != -108 &&
m_bIsBiDi && text::HoriOrientation::RIGHT ==
m_eOri))
2335 m_eOri = text::HoriOrientation::LEFT_AND_WIDTH;
2350 OSL_ENSURE(pApply,
"No frame");
2366 "should not be possible, must be at least one segment");
2379 bool bSetMinHeight =
false;
2395 bSetMinHeight =
true;
2427 if ( bIsInsideMargin && bAdjustMargin )
2428 m_eOri = text::HoriOrientation::LEFT_AND_WIDTH;
2431 if (
m_eOri == text::HoriOrientation::LEFT_AND_WIDTH )
2457 OSL_ENSURE(pTableNode,
"no table node!");
2470 if (
const SfxItemSet* pSet = pNd->GetpSwAttrSet())
2472 std::unique_ptr<SfxPoolItem> pSetAttr;
2500 m_bIsBiDi ? SvxFrameDirection::Horizontal_RL_TB : SvxFrameDirection::Horizontal_LR_TB,
RES_FRAMEDIR );
2503 if (text::HoriOrientation::LEFT_AND_WIDTH ==
m_eOri)
2514 (eHori == text::HoriOrientation::LEFT_AND_WIDTH))
2557 GetSttNd()->FindTableNode());
2558 OSL_ENSURE(
m_pTableNd,
"Where is my table node" );
2597 "Too few lines, table ended early");
2606 OSL_ENSURE(nCol < m_pTabBoxes->
size(),
2607 "Too few columns, table ended early");
2614 bool bMerge =
false;
2656 aPam.GetPoint()->nNode++;
2700 m_MergeGroups.push_back(std::unique_ptr<WW8SelBoxInfo>(pActMGroup));
2724 pTabBox2 = rBoxes.empty() ?
nullptr : rBoxes.front();
2728 if (!pTabBox2 || !pTabBox2->
GetSttNd())
2752 OSL_ENSURE(
m_xTmpPos &&
m_pIo,
"I've forgotten where the table is anchored");
2770 if (xLastAnchorCursor)
2787 throw std::runtime_error(
"table unexpectedly destroyed by applying redlines");
2798 if((1 < groupIt->size()) && groupIt->row(0)[0])
2800 SwFrameFormat* pNewFormat = groupIt->row(0)[0]->ClaimFrameFormat();
2802 const sal_uInt16 nRowSpan = groupIt->rowsCount();
2803 for (sal_uInt16
n = 0;
n < nRowSpan; ++
n)
2805 auto& rRow = groupIt->row(
n);
2806 for (
size_t i = 0;
i<rRow.size(); ++
i)
2808 const sal_Int32 nRowSpanSet = (
n == 0) && (
i == 0) ?
2810 (-1 * (nRowSpan -
n));
2815 pCurrentBox->
ChgFrameFormat(static_cast<SwTableBoxFormat*>(pNewFormat));
2826 m_MergeGroups.clear();
2841 const short nTolerance = 4;
2843 short nX2 = nX1 + nWidth;
2862 if( ( nX1 > nGrX1 ) && ( nX2 < nGrX2 ) )
2872 if( ( ( nX1 > nGrX1 )
2873 && ( nX1 < nGrX2 - 2*nTolerance ) )
2874 || ( ( nX2 > nGrX1 + 2*nTolerance )
2875 && ( nX2 < nGrX2 ) )
2877 || ( ( nX1 <=nGrX1 )
2878 && ( nX2 >=nGrX2 ) ) )
2901 OSL_FAIL(
"Problem with table");
2921 OSL_ENSURE(
false,
"Actual row bigger than expected." );
3003 if(!rSnapToGrid.GetValue())
3007 aGridItem.SetValue(
false);
3047 SvxBoxItemLine::TOP);
3055 SvxBoxItemLine::BOTTOM);
3069 SvxBoxItemLine::LEFT);
3072 aFormatBox.
SetDistance(nLeftDist, SvxBoxItemLine::LEFT);
3077 SvxBoxItemLine::RIGHT);
3080 aFormatBox.
SetDistance(nRightDist,SvxBoxItemLine::RIGHT);
3120 OSL_ENSURE(eDir == SvxFrameDirection::Environment,
"unknown direction code, maybe it's a bitfield");
3123 eDir = SvxFrameDirection::Vertical_LR_BT;
3126 eDir = SvxFrameDirection::Vertical_RL_TB;
3129 eDir = SvxFrameDirection::Vertical_RL_TB;
3132 eDir = bIsBiDi ? SvxFrameDirection::Horizontal_RL_TB : SvxFrameDirection::Horizontal_LR_TB;
3151 sal_Int16 eVertOri=text::VertOrientation::TOP;
3160 eVertOri = text::VertOrientation::TOP;
3163 eVertOri = text::VertOrientation::CENTER;
3166 eVertOri = text::VertOrientation::BOTTOM;
3181 "Wrong column count in table" );
3231 if( j < m_pActBand->nWwCols )
3340 pTheMergeGroup = pActGroup;
3347 if( pTheMergeGroup )
3356 sal_uInt16 nCol = 0;
3380 for (sal_uInt16 nSize = static_cast< sal_uInt16 >(
m_aNumRuleNames.size()); nSize <= nCol; ++nSize)
3398 std::unique_ptr<WW8FlyPara> pTableWFlyPara;
3403 RndStdIds eAnchor( RndStdIds::FLY_AS_CHAR );
3411 WW8_CP nMyStartCp = nStartCp;
3415 pNestedTabPos = &aNestedTabPos;
3418 if ( pNestedTabPos )
3422 if ( pTableWFlyPara )
3432 eAnchor = RndStdIds::FLY_AT_CHAR;
3440 if( pStyleFormat && pStyleFormat->
GetBreak().
GetBreak() == SvxBreak::PageBefore )
3450 if ((eAnchor == RndStdIds::FLY_AT_CHAR)
3459 aItemSet.Put( aAnchor );
3462 OSL_ENSURE(
m_xTableDesc->m_pFlyFormat->GetAnchor().GetAnchorId() == eAnchor,
3463 "Not the anchor type requested!" );
3472 if ( pTableWFlyPara && pTableSFlyPara )
3474 WW8FlySet aFlySet( *
this, pTableWFlyPara.get(), pTableSFlyPara,
false );
3477 aFlySet.Put( aAnchor );
3483 m_xTableDesc->m_pTable->GetFrameFormat()->GetHoriOrient();
3499 delete pTableSFlyPara;
3515 if( ( nLen > 0 ) && ( *pData == 1 ) )
3521 if( ( nLen > 0 ) && ( *pData == 1 ) )
3542 OSL_ENSURE(
m_xTableDesc,
"Panic, stop table with no table!");
3577 sal_uInt16 nRes = USHRT_MAX;
3580 for(sal_uInt16 nI = 0; nI <
m_xStyles->GetCount(); nI++ )
3582 && (nLFOIndex ==
m_vColl[ nI ].m_nLFOIndex) )
3593 for(sal_uInt16 nI = 0; nI <
m_xStyles->GetCount(); nI++ )
3595 && (rName ==
m_vColl[ nI ].GetOrgWWName()) )
3597 pRet =
m_vColl[ nI ].m_pFormat;
3627 #ifdef DEBUGSPRMREADER
3628 fprintf(stderr,
"id is %x\n", aIter.GetCurrentId());
3645 std::unique_ptr<sal_uInt8[]> pSprms(
new sal_uInt8[nLen] );
3653 if ( pSt->
Tell() & 0x1 )
3663 if (!(pSt->
Tell() & 0x1))
3688 if( (1 < cbUPX) || ( (0 < cbUPX) && !bPAP ) )
3708 nLen = nLen - cbUPX;
3730 :
WW8Style(*pI->m_pTableStream, _rFib)
3731 , maSprmParser(_rFib)
3733 , mpStStrm(pI->m_pTableStream)
3734 , mpStyRule(nullptr)
3735 , mpParaSprms(nullptr)
3738 , mbTextColChanged(
false)
3739 , mbFontChanged(
false)
3740 , mbCJKFontChanged(
false)
3741 , mbCTLFontChanged(
false)
3742 , mbFSizeChanged(
false)
3743 , mbFCTLSizeChanged(
false)
3744 , mbWidowsChanged(
false)
3745 , mbBidiChanged(
false)
3812 pColl = aResult.first;
3813 bStyExist = aResult.second;
3820 pColl = aResult.first;
3821 bStyExist = aResult.second;
3827 if (bImport && bStyExist && rSI.
GetOrgWWName().startsWith(
"WW8Num"))
3849 if (j != nThisStyle && j <
m_cstd )
3930 std::unique_ptr<WW8_STD> xStd(
Read1Style(nSkip, &sName));
3937 if ( !xStd || sName.isEmpty() || ((1 != xStd->sgc) && (2 != xStd->sgc)) )
3944 bool bOldNoImp =
PrepareStyle(rSI, static_cast<ww::sti>(xStd->sti), nNr, xStd->istdNext);
3993 for (i=0; i <
m_cstd; ++i)
4007 for (i=0; i <
m_cstd; ++i)
4024 std::unique_ptr<WW8_STD> xStd(
Read1Style(nSkip,
nullptr));
4042 std::vector<sal_uInt8> aRet
4048 static_cast< sal_uInt8 >(128 + rChpx.
fItalic),
4054 static_cast< sal_uInt8 >(128 + rChpx.
fOutline),
4060 static_cast< sal_uInt8 >(128 + rChpx.
fCaps),
4069 ShortToSVBT16(rChpx.
ftc, a);
4070 aRet.push_back(a[1]);
4071 aRet.push_back(a[0]);
4077 aRet.push_back(rChpx.
kul);
4084 ShortToSVBT16(rChpx.
lid, a);
4085 aRet.push_back(a[1]);
4086 aRet.push_back(a[0]);
4092 aRet.push_back(rChpx.
ico);
4100 ShortToSVBT16(rChpx.
hps, a);
4101 aRet.push_back(a[0]);
4107 aRet.push_back(rChpx.
hpsPos);
4111 aRet.push_back( static_cast< sal_uInt8 >(128 + rChpx.
fBoldBi) );
4114 aRet.push_back( static_cast< sal_uInt8 >(128 + rChpx.
fItalicBi) );
4120 ShortToSVBT16(rChpx.
fsFtcBi, a);
4121 aRet.push_back(a[1]);
4122 aRet.push_back(a[0]);
4129 ShortToSVBT16(rChpx.
lidBi, a);
4130 aRet.push_back(a[1]);
4131 aRet.push_back(a[0]);
4137 aRet.push_back(rChpx.
icoBi);
4144 ShortToSVBT16(rChpx.
hpsBi, a);
4145 aRet.push_back(a[1]);
4146 aRet.push_back(a[0]);
4163 if (nSize > nMaxByteCount)
4165 SAL_WARN(
"sw.ww8",
"ReadWord2Chpx: truncating out of range "
4166 << nSize <<
" to " << nMaxByteCount);
4167 nSize = nMaxByteCount;
4181 aChpx.
fBold = nFlags8 & 0x01;
4182 aChpx.
fItalic = (nFlags8 & 0x02) >> 1;
4183 aChpx.
fRMarkDel = (nFlags8 & 0x04) >> 2;
4184 aChpx.
fOutline = (nFlags8 & 0x08) >> 3;
4187 aChpx.
fCaps = (nFlags8 & 0x40) >> 6;
4188 aChpx.
fVanish = (nFlags8 & 0x80) >> 7;
4190 if (nCount >= nSize)
break;
4197 aChpx.
fRMark = nFlags8 & 0x01;
4198 aChpx.
fSpec = (nFlags8 & 0x02) >> 1;
4199 aChpx.
fStrike = (nFlags8 & 0x04) >> 2;
4200 aChpx.
fObj = (nFlags8 & 0x08) >> 3;
4201 aChpx.
fBoldBi = (nFlags8 & 0x10) >> 4;
4202 aChpx.
fItalicBi = (nFlags8 & 0x20) >> 5;
4203 aChpx.
fBiDi = (nFlags8 & 0x40) >> 6;
4206 if (nCount >= nSize)
break;
4213 aChpx.
fsIco = nFlags8 & 0x01;
4214 aChpx.
fsFtc = (nFlags8 & 0x02) >> 1;
4215 aChpx.
fsHps = (nFlags8 & 0x04) >> 2;
4216 aChpx.
fsKul = (nFlags8 & 0x08) >> 3;
4217 aChpx.
fsPos = (nFlags8 & 0x10) >> 4;
4218 aChpx.
fsSpace = (nFlags8 & 0x20) >> 5;
4219 aChpx.
fsLid = (nFlags8 & 0x40) >> 6;
4220 aChpx.
fsIcoBi = (nFlags8 & 0x80) >> 7;
4222 if (nCount >= nSize)
break;
4229 aChpx.
fsFtcBi = nFlags8 & 0x01;
4230 aChpx.
fsHpsBi = (nFlags8 & 0x02) >> 1;
4231 aChpx.
fsLidBi = (nFlags8 & 0x04) >> 2;
4233 if (nCount >= nSize)
break;
4237 if (nCount >= nSize)
break;
4241 if (nCount >= nSize)
break;
4250 aChpx.
fNumRun = (nFlags8 & 0x80) >> 7;
4252 if (nCount >= nSize)
break;
4259 aChpx.
ico = nFlags8 & 0x1F;
4260 aChpx.
kul = (nFlags8 & 0xE0) >> 5;
4262 if (nCount >= nSize)
break;
4266 if (nCount >= nSize)
break;
4270 if (nCount >= nSize)
break;
4274 if (nCount >= nSize)
break;
4278 if (nCount >= nSize)
break;
4282 if (nCount >= nSize)
break;
4286 if (nCount >= nSize)
break;
4314 sal_uInt16 cstcStd(0);
4318 sal_uInt16 cbName(0);
4320 if (cbName > nMaxByteCount)
4322 SAL_WARN(
"sw.ww8",
"WW8RStyle::ImportOldFormatStyles: truncating out of range "
4323 << cbName <<
" to " << nMaxByteCount);
4324 cbName = nMaxByteCount;
4326 sal_uInt16 nByteCount = 2;
4328 while (nByteCount < cbName)
4346 nByteCount += aTmp.getLength();
4347 sName = OStringToOUString(aTmp, eStructChrSet);
4352 if (sName.isEmpty())
4356 sName = OUString(pStr, strlen(pStr), RTL_TEXTENCODING_ASCII_US);
4359 if (sName.isEmpty())
4360 sName =
"Unknown Style: " + OUString::number(stc);
4366 sal_uInt16 nStyles=stcp;
4368 std::vector<pxoffset> aCHPXOffsets(stcp);
4370 sal_uInt16 cbChpx(0);
4372 if (cbChpx > nMaxByteCount)
4374 SAL_WARN(
"sw.ww8",
"WW8RStyle::ImportOldFormatStyles: truncating out of range "
4375 << cbChpx <<
" to " << nMaxByteCount);
4376 cbChpx = nMaxByteCount;
4380 std::vector< std::vector<sal_uInt8> > aConvertedChpx;
4381 while (nByteCount < cbChpx)
4383 if (stcp == aCHPXOffsets.size())
4394 aCHPXOffsets[stcp].mnSize = 0;
4401 aCHPXOffsets[stcp].mnSize = nRemainder;
4404 aCHPXOffsets[stcp].
mnSize);
4407 nByteCount += nRemainder;
4410 aConvertedChpx.emplace_back( );
4415 std::vector<pxoffset> aPAPXOffsets(stcp);
4417 sal_uInt16 cbPapx(0);
4419 if (cbPapx > nMaxByteCount)
4421 SAL_WARN(
"sw.ww8",
"WW8RStyle::ImportOldFormatStyles: truncating out of range "
4422 << cbPapx <<
" to " << nMaxByteCount);
4423 cbPapx = nMaxByteCount;
4427 while (nByteCount < cbPapx)
4429 if (stcp == aPAPXOffsets.size())
4439 aPAPXOffsets[stcp].mnSize = 0;
4450 aPAPXOffsets[stcp].mnSize = nRemainder;
4453 nByteCount += nRemainder;
4462 if (iMac > nStyles) iMac = nStyles;
4464 for (stcp = 0; stcp < iMac; ++stcp)
4487 if (stcp >= aPAPXOffsets.size())
4495 bool bOldNoImp =
PrepareStyle(rSI, eSti, stc, stcNext);
4500 if (!aConvertedChpx[stcp].empty())
4502 static_cast< short >(aConvertedChpx[stcp].
size()),
4546 *static_cast<SwTextFormatColl*>(pj->
m_pFormat) );
void SetFamily(FontFamily)
sal_uInt32 GetTextAreaWidth() const
SvxNumType GetNumberingType() const
simple Iterator for SPRMs
SvStream & ReadInt16(sal_Int16 &rInt16)
sal_uInt8 & GetMaxHyphens()
constexpr TypedWhichId< SvxFrameDirectionItem > RES_FRAMEDIR(120)
std::shared_ptr< SwUnoCursor > CreateUnoCursor(const SwPosition &rPos, bool bTableCursor=false)
std::unique_ptr< SwWW8FltControlStack > m_xCtrlStck
SVX_NUM_CHARS_UPPER_LETTER_N
void SetCurrentSectionVerticalAdjustment(const css::drawing::TextVerticalAdjust nVA)
rtl_TextEncoding m_eLTRFontSrcCharSet
SwNode & GetNode(bool bPoint=true) const
bool GoInContent(SwPaM &rPam, SwMoveFnCollection const &fnMove)
sw::util::CharStyleMapper m_aCharStyleMapper
sal_uInt8 brcType() const
sal_uInt32 GetPageLeft() const
SwNodeOffset EndOfSectionIndex() const
void SetRowsToRepeat(sal_uInt16 nNumOfRows)
Represents the style of a paragraph.
Marks a position in the document model.
void SetSprms(const sal_uInt8 *pSprms_, sal_Int32 nLen_)
constexpr TypedWhichId< SvxParaGridItem > RES_PARATR_SNAPTOGRID(77)
constexpr TypedWhichId< SvxFontItem > RES_CHRATR_CTL_FONT(27)
std::unique_ptr< WW8RStyle > m_xStyles
iterator for footnotes/endnotes and comments
static Color ExtractColour(const sal_uInt8 *&rpData, bool bVer67)
void SetHeight(tools::Long n)
void StartAnl(const sal_uInt8 *pSprm13)
void ReadDef(bool bVer67, const sal_uInt8 *pS, short nLen)
void SetTabBorders(SwTableBox *pBox, short nIdx)
sal_uInt32 GetWWPageTopMargin() const
const OUString & GetText() const
SvStream & ReadUInt16(sal_uInt16 &rUInt16)
bool StandardStiIsCharStyle(sti eSti) noexcept
Determine if the WinWord sti is standard Character Style.
bool SearchRowEnd(WW8PLCFx_Cp_FKP *pPap, WW8_CP &rStartCp, int nLevel) const
SVX_NUM_FULL_WIDTH_ARABIC
const sal_uInt16 sprmTDelete
const sal_uInt16 sprmTDefTable
const SwNumFormat * GetNumFormat(sal_uInt16 i) const
static bool SetBorder(SvxBoxItem &rBox, const WW8_BRCVer9 *pbrc, short *pSizeArray=nullptr, sal_uInt8 nSetBorders=0xFF)
static wwTableSprm GetTableSprm(sal_uInt16 nId, ww::WordVersion eVer)
sw::util::RedlineStack * getOldRedlineStack()
std::unique_ptr< sal_Int32[]> pData
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.
Word2CHPX ReadWord2Chpx(SvStream &rSt, std::size_t nOffset, sal_uInt8 nSize)
rtl_TextEncoding m_eCJKFontSrcCharSet
rtl_TextEncoding GetCharSet() const
bool close(const SwPosition &rPos, RedlineType eType)
void SetNCurrentColl(sal_uInt16 nColl)
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_FONTSIZE(8)
SwNumRule * GetNumRule(const SwDoc &rDoc, sal_uInt8 nNumType)
sal_uInt16 GetCurrentId() const
constexpr::Color COL_AUTO(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
const sal_uInt16 sprmTDyaRowHeight
const sal_uInt16 sprmTDxaGapHalf
std::unique_ptr< FrameDeleteWatch > m_xFormatOfJustInsertedApo
constexpr sal_uInt16 RES_FRMATR_END(133)
SwFrameFormat * ClaimFrameFormat()
std::unique_ptr< sw::util::RedlineStack > mxOldRedlineStack
const sal_Unicode cBulletChar
Character for lists.
constexpr sal_uInt8 MAXLEVEL
std::shared_ptr< WW8Fib > m_xWwFib
bool StyleExists(unsigned int nColl) const
sal_uInt64 Seek(sal_uInt64 nPos)
WW8LvlType GetNumType(sal_uInt8 nWwLevelNo)
constexpr TypedWhichId< SvxFormatBreakItem > RES_BREAK(94)
virtual void DeleteRange(SwPaM &)=0
Delete a range SwFlyFrameFormat.
void SetTabShades(SwTableBox *pBox, short nWwIdx)
SwTableLine is one table row in the document model.
sal_uInt8 mnWW8OutlineLevel
std::unique_ptr< WW8TabDesc > m_xTableDesc
const OUString & GetName() const
constexpr TypedWhichId< SfxStringItem > RES_FLTR_NUMRULE(192)
OUString GetUniqueNumRuleName(const OUString *pChkStr=nullptr, bool bAutoNum=true) const
rtl_TextEncoding GetCJKCharSet() const
void Read_OLST(sal_uInt16, const sal_uInt8 *pData, short nLen)
void SetCharSet(rtl_TextEncoding)
void StopAnlToRestart(sal_uInt8 nType, bool bGoBack=true)
sal_uInt16 m_n81BiDiFlags
void ProcessSprmTDelete(const sal_uInt8 *pParamsTDelete)
void MoveInsideFly(const SwFrameFormat *pFlyFormat)
static constexpr sal_uInt16 val
SwNodeOffset abs(const SwNodeOffset &a)
void SetTabDirection(SwTableBox *pBox, short nWwIdx)
IDocumentContentOperations const & getIDocumentContentOperations() const
const WW8Fib & GetFib() const
WW8TabBandDesc * m_pActBand
void SetCurrentSectionHasFootnote()
bool PrepareStyle(SwWW8StyInf &rSI, ww::sti eSti, sal_uInt16 nThisStyle, sal_uInt16 nNextStyle)
constexpr TypedWhichId< SvxFontItem > RES_CHRATR_FONT(7)
SwTableFormat * GetFrameFormat()
bool StartTable(WW8_CP nStartCp)
Value in Var-direction gives minimum (can be exceeded but not be less).
sal_uInt64 SeekRel(sal_Int64 nPos)
void ReadShd(const sal_uInt8 *pS)
SwNodeOffset GetSttIdx() const
void ImportOldFormatStyles()
void Read_ANLevelDesc(sal_uInt16, const sal_uInt8 *pData, short nLen)
rtl_TextEncoding m_eRTLFontSrcCharSet
SwTwips MoveOutsideFly(SwFrameFormat *pFlyFormat, const SwPosition &rPos, bool bTableJoin=true)
WW8TabBandDesc * m_pFirstBand
SwContentNode * GetContentNode(bool bPoint=true) const
std::unique_ptr< sw::util::RedlineStack > m_xRedlineStack
bool IsSevenMinus(WordVersion eVer)
const SwTableLines * m_pTabLines
short GetCurrentCol() const
WW8TabDesc(WW8TabDesc const &)=delete
SwFlyFrameFormat * MakeFlySection(RndStdIds eAnchorType, const SwPosition *pAnchorPos, const SfxItemSet *pSet=nullptr, SwFrameFormat *pParent=nullptr, bool bCalledFromShell=false)
void SetPamInCell(short nWwCol, bool bPam)
std::vector< sal_uInt8 > ChpxToSprms(const Word2CHPX &rChpx)
StyleResult GetStyle(const OUString &rName, ww::sti eSti)
Get the writer style which the word style should map to.
SwNodeType GetNodeType() const
std::shared_ptr< WW8FlyPara > m_xWWFly
std::vector< SwWW8StyInf > m_vColl
bool SetTextFormatColl(const SwPaM &rRg, SwTextFormatColl *pFormat, const bool bReset=true, const bool bResetListAttrs=false, SwRootFrame const *pLayout=nullptr)
Add 4th optional parameter .
IDocumentStylePoolAccess const & getIDocumentStylePoolAccess() const
SwFormat * m_pStandardFormatColl
const SwTextFormatColl * GetDfltTextFormatColl() const
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.
std::unique_ptr< SwPosition > m_pLastAnchorPos
SwTableBoxes * m_pTabBoxes
const SwTextFormatColl * m_pDfltTextFormatColl
const sal_uInt16 sprmTTableBorders
sw::util::ParaStyleMapper m_aParaStyleMapper
void InsertTable(SwTableNode &rTableNode, SwPaM &rPaM)
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
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 ...
const SwTable & GetTable() const
bool IsWW8BuiltInHeadingStyle() const
virtual WW8_CP Where() override
SVX_NUM_IROHA_FULLWIDTH_JA
SwNodeOffset GetIndex() const
void SetCountedInList(bool bCounted)
This is what we use in the Parser (and Dumper)
std::unique_ptr< WW8_STD > Read1Style(sal_uInt16 &rSkip, OUString *pString)
const sal_uInt16 sprmTTableHeader
void ProcessSpecificSpacing(const sal_uInt8 *pParamsTInsert)
sal_uInt64 remainingSize()
bool IsValidCell(short nCol) const
const char * GetEnglishNameFromSti(sti eSti) noexcept
Find the WinWord english name from a sti index.
void ImportGrupx(short nLen, bool bPara, bool bOdd)