20 #include <config_features.h>
21 #include <config_fuzzers.h>
28 #include <com/sun/star/embed/XStorage.hpp>
29 #include <com/sun/star/embed/ElementModes.hpp>
30 #include <com/sun/star/embed/XTransactedObject.hpp>
31 #include <com/sun/star/task/InteractionHandler.hpp>
33 #include <com/sun/star/ucb/XCommandEnvironment.hpp>
41 #include <rtl/character.hxx>
47 #include <com/sun/star/i18n/XBreakIterator.hpp>
66 #include <section.hxx>
84 #include <osl/diagnose.h>
87 #include <string_view>
89 #define MAX_FIELDLEN 64000
91 #define WW8_TOX_LEVEL_DELIM ':'
103 bool IsTOCBookmarkName(std::u16string_view rName)
108 OUString EnsureTOCBookmarkName(
const OUString& rName)
110 OUString sTmp = rName;
111 if ( IsTOCBookmarkName ( rName ) )
126 OSL_ENSURE( pB,
"WW8PLCFx_Book - Pointer does not exist" );
146 pName->startsWithIgnoreAsciiCase(
"_Hlt" ) )
161 sal_uInt64 nOldPos = m_pStrm->Tell();
162 m_xSBase->WW8ReadString( *m_pStrm, aVal, pB->
GetStartPos(), nLen,
164 m_pStrm->Seek( nOldPos );
175 for( sal_Int32 nI = 0;
176 nI < aVal.getLength() && aVal.getLength() < (
MAX_FIELDLEN - 4);
187 aVal = aVal.replaceAt( nI, 1,
u"\n" );
200 bSetAsHex = 0x20 > cChar;
207 OUString sTmp(
"\\x" );
210 sTmp += OUString::number( cChar, 16 );
211 aVal = aVal.replaceAt( nI, 1 , sTmp );
212 nI += sTmp.getLength() - 1;
224 if (!m_aFieldStack.empty())
231 m_xReffedStck->NewAttr( aStart,
232 SwFltBookmark( EnsureTOCBookmarkName( sOrigName ), aVal, pB->
GetHandle(), IsTOCBookmarkName( sOrigName ) ));
240 if (pAtnBook->getIsEnd())
252 if (pFactoidBook->getIsEnd())
253 m_xReffedStck->SetAttr(*m_pPaM->GetPoint(),
RES_FLTR_RDFMARK,
true, pFactoidBook->getHandle());
257 aMark.
SetHandle(pFactoidBook->getHandle());
258 GetSmartTagInfo(aMark);
259 m_xReffedStck->NewAttr(*m_pPaM->GetPoint(), aMark);
271 OUString
aName = rOrg.replaceAll(
"\\\\",
"\\");
272 aName = aName.replaceAll(
"%20",
" ");
275 if (aName.endsWith(
"\""))
276 aName = aName.copy(0, aName.getLength()-1);
279 if (!aName.isEmpty())
290 void ConvertUFName( OUString& rName )
298 ConvertUFName(rSequenceName);
299 if (
'0' <= rSequenceName[0] &&
'9' >= rSequenceName[0])
300 rSequenceName =
"_" + rSequenceName;
309 for( sal_Int32 nBuf = 0; nBuf+1 < rStr.getLength(); nBuf++ )
311 if( rStr[ nBuf ] ==
'"' )
315 && rStr[ nBuf ] ==
'\\'
316 && ( rStr[ nBuf + 1 ] == cToken
317 || rStr[ nBuf + 1 ] == cToken2 ) )
321 while( nBuf < rStr.getLength()
322 && rStr[ nBuf ] ==
' ' )
325 return nBuf < rStr.getLength() ? nBuf : -1;
342 || rStr[ n ] == 132 )
346 while( n2 < rStr.getLength()
348 && rStr[ n2 ] !=
'"' )
354 while( n2 < rStr.getLength()
355 && rStr[ n2 ] !=
' ' )
358 return rStr.copy( n, n2-n );
362 bool bAllowPageDesc =
false)
368 if( rStr.startsWithIgnoreAsciiCase(
"Arabi" ) )
370 else if( rStr.startsWith(
"misch" ) )
372 else if( rStr.startsWith(
"MISCH" ) )
374 else if( rStr.startsWithIgnoreAsciiCase(
"alphabeti" ) )
375 eTyp = ( rStr[0] ==
'A' )
378 else if( rStr.startsWithIgnoreAsciiCase(
"roman" ) )
379 eTyp = ( rStr[0] ==
'R' )
387 OUString s(
FindPara( rStr,
'*',
'*' ) );
398 OSL_ENSURE(pLang,
"impossible");
401 if (nLang != nDefault)
425 const sal_Int32
pos = sParams.indexOf(
"YYYY");
428 sParams = sParams.replaceFirst(
"YY",
"YYYY");
437 if (m_xPlcxMan && !m_bVer67)
439 SprmResult aResult = m_xPlcxMan->HasCharSprm(0x85A);
445 OSL_ENSURE(pLang,
"impossible");
449 OUString sParams(
FindPara( rStr,
'@',
'@' ) );
450 if (sParams.isEmpty())
452 bool bHasTime =
false;
453 switch (nWhichDefault)
458 sParams +=
" HH:MM:SS AM/PM";
462 sParams +=
"DD/MM/YYYY HH:MM:SS";
472 sParams =
"[~hijri]" + sParams;
474 sal_Int32 nCheckPos = 0;
478 OUString sTemp(sParams);
483 return bHasTime ? SvNumFormatType::DATETIME : SvNumFormatType::DATE;
491 nNumFormatType = pFormatter->
GetType(nFormatIdx);
492 rFormat = nFormatIdx;
494 return nNumFormatType;
510 OSL_ENSURE(pF,
"WW8PLCFx_FLD - Pointer not available");
518 OSL_ENSURE(!m_aFieldStack.empty(),
"Empty field stack");
519 if (!m_aFieldStack.empty())
526 nRet = m_aFieldStack.back().mnFieldId;
530 if (bUseEnhFields && m_pPaM!=
nullptr && m_pPaM->GetPoint()!=
nullptr) {
532 SwPaM aFieldPam( m_aFieldStack.back().GetPtNode(), m_aFieldStack.back().GetPtContent(), aEndPos.
nNode, aEndPos.
nContent.
GetIndex());
534 IFieldmark *pFieldmark = pMarksAccess->makeFieldBookmark(
535 aFieldPam, m_aFieldStack.back().GetBookmarkName(),
ODF_FORMTEXT,
537 OSL_ENSURE(pFieldmark!=
nullptr,
"hmmm; why was the bookmark not created?");
538 if (pFieldmark!=
nullptr) {
541 m_xRedlineStack->MoveAttrsFieldmarkInserted(*aFieldPam.Start());
543 pFieldmark->
GetParameters()->insert(rParametersToAdd.begin(), rParametersToAdd.end());
550 if (m_bLoadingTOXCache)
552 if (m_nEmbeddedTOXLevel > 0)
555 --m_nEmbeddedTOXLevel;
559 m_aTOXEndCps.insert(nCP);
560 m_bLoadingTOXCache =
false;
561 if ( m_pPaM->End() &&
562 m_pPaM->End()->nNode.GetNode().GetTextNode() &&
563 m_pPaM->End()->nNode.GetNode().GetTextNode()->Len() == 0 )
569 m_bCareLastParaEndInToc =
true;
574 *m_pPaM = *m_pPosAfterTOC;
575 m_pPosAfterTOC.reset();
581 if (m_bLoadingTOXCache && !m_bLoadingTOXHyperlink)
587 if (m_bLoadingTOXHyperlink)
588 m_bLoadingTOXHyperlink =
false;
595 SwPosition aRestorePos(m_aFieldStack.back().maStartPos);
598 sal_Int32 nMaxValidIndex = pNd ? pNd->
Len() : 0;
599 if (aRestorePos.nContent.GetIndex() > nMaxValidIndex)
601 SAL_WARN(
"sw.ww8",
"Attempt to restore to invalid content position");
602 aRestorePos.nContent.Assign(pNd, nMaxValidIndex);
605 *m_pPaM->GetPoint() = aRestorePos;
611 const OUString& fieldDefinition = m_aFieldStack.back().GetBookmarkCode();
613 OUString paramCondition;
622 static_cast<SwHiddenTextFieldType*>(pFieldType),
633 OUString aCode = m_aFieldStack.back().GetBookmarkCode();
639 m_aFieldStack.back().GetPtNode(), m_aFieldStack.back().GetPtContent(),
644 IFieldmark* pFieldmark = pMarksAccess->makeFieldBookmark(
646 m_aFieldStack.back().GetBookmarkName(),
653 m_xRedlineStack->MoveAttrsFieldmarkInserted(*aFieldPam.Start());
655 pFieldmark->
GetParameters()->insert(rParametersToAdd.begin(), rParametersToAdd.end());
656 OUString sFieldId = OUString::number( m_aFieldStack.back().mnFieldId );
658 std::pair< OUString, uno::Any > (
662 std::pair< OUString, uno::Any > (
666 if ( m_aFieldStack.back().mnObjLocFc > 0 )
669 OUString sOleId =
"_" +
670 OUString::number( m_aFieldStack.back().mnObjLocFc );
676 uno::Reference< embed::XStorage > xDocStg = GetDoc().GetDocStorage();
679 uno::Reference< embed::XStorage > xOleStg = xDocStg->openStorageElement(
680 "OLELinks", embed::ElementModes::WRITE );
691 uno::Reference< embed::XTransactedObject > xTransact( xOleStg, uno::UNO_QUERY );
692 if ( xTransact.is() )
698 std::pair< OUString, uno::Any >(
706 m_aFieldStack.pop_back();
733 : maStartPos(rPos), mnFieldId(nFieldId), mnObjLocFc(0)
738 : maStartPos(rOther.maStartPos), mnFieldId(rOther.mnFieldId), mnObjLocFc(rOther.mnObjLocFc)
744 std::swap(maStartPos, rOther.maStartPos);
745 std::swap(mnFieldId, rOther.mnFieldId);
758 msBookmarkName=bookmarkName;
763 msMarkType=bookmarkType;
768 msMarkCode = bookmarkCode;
778 enum Limits {eMax = 96};
779 static const FNReadField aWW8FieldTab[eMax+1] =
881 OSL_ENSURE(
SAL_N_ELEMENTS( aWW8FieldTab ) == eMax+1,
"FieldFunc table not right" );
884 OSL_ENSURE(pF,
"WW8PLCFx_FLD - Pointer not available");
889 bool bNested =
false;
890 if (!m_aFieldStack.empty())
892 bNested = std::any_of(m_aFieldStack.cbegin(), m_aFieldStack.cend(),
899 OSL_ENSURE(bOk,
"WW8: Bad Field!");
902 if ( aF.
nId == 6 ) bCodeNest =
false;
903 if (aF.
nId == 70) bCodeNest =
false;
905 m_aFieldStack.emplace_back(*m_pPaM->GetPoint(), aF.
nId);
910 sal_uInt16
n = (aF.
nId <= eMax) ? aF.
nId : o3tl::narrowing<sal_uInt16>(eMax);
911 sal_uInt16 nI = n / 32;
912 sal_uInt32 nMask = 1 << ( n % 32 );
920 if( m_nFieldTagAlways[nI] & nMask )
921 return Read_F_Tag( &aF );
923 if( !bOk || !aF.
nId )
926 if( aF.
nId > eMax - 1)
928 if( m_nFieldTagBad[nI] & nMask )
929 return Read_F_Tag( &aF );
935 if (aF.
nId != 88 && m_xPlcxMan->GetDoingDrawTextBox())
938 bool bHasHandler = aWW8FieldTab[aF.
nId] !=
nullptr;
943 sal_uInt64 nOldPos = m_pStrm->Tell();
945 aF.
nLCode = m_xSBase->WW8ReadString(*m_pStrm, aStr, m_xPlcxMan->GetCpOfs() + aF.
nSCode, aF.
nLCode, m_eTextCharSet);
946 m_pStrm->Seek(nOldPos);
950 if (nRet == -2 && !aReadParam.
GetResult().isEmpty())
952 bHasHandler = rtl::isAsciiDigit(aReadParam.
GetResult()[0]);
959 bHasHandler = nRet < 0 || nRet ==
'*';
964 if (!bHasHandler || bCodeNest)
966 if( m_nFieldTagBad[nI] & nMask )
967 return Read_F_Tag( &aF );
972 sal_uInt64 nOldPos = m_pStrm->Tell();
974 aF.
nLCode = m_xSBase->WW8ReadString( *m_pStrm, aStr, m_xPlcxMan->GetCpOfs()+
976 m_pStrm->Seek( nOldPos );
980 const sal_Int32 nDotPos = aStr.indexOf(
'.');
981 const sal_Int32 nSlashPos = aStr.indexOf(
'/');
982 sal_Int32 nSpacePos = aStr.indexOf(
' ', 1 );
984 nSpacePos = aStr.getLength();
986 if ( ( aStr.getLength() <= 1 || aStr[1] !=
'=') &&
987 (( nDotPos>=0 && nDotPos < nSpacePos ) ||
988 ( nSlashPos>=0 && nSlashPos < nSpacePos )))
997 m_aFieldStack.back().SetBookmarkCode( aStr );
1003 auto nOldPos = m_pStrm->Tell();
1005 if ( aF.nId == 6 && aF.bCodeNest )
1008 aF.nLCode = m_xSBase->WW8ReadString( *m_pStrm, aStr, m_xPlcxMan->GetCpOfs() +
1009 aF.nSCode, aF.nSRes - aF.nSCode - 1, m_eTextCharSet );
1013 aF.nLCode = m_xSBase->WW8ReadString( *m_pStrm, aStr, m_xPlcxMan->GetCpOfs()+
1014 aF.nSCode, aF.nLCode, m_eTextCharSet );
1021 aStr = aStr.replaceAll(
"\x01",
"");
1024 eF_ResT eRes = (this->*aWW8FieldTab[aF.nId])( &aF, aStr );
1025 m_pStrm->Seek(nOldPos);
1036 return aF.nLen - aF.nLRes - 2;
1040 if ( m_nFieldTagBad[nI] & nMask )
1041 return Read_F_Tag( &aF );
1044 return aF.nLen - aF.nLRes - 2;
1063 for( sal_Int32 nI = 0;
1064 nI < rStr.getLength() && rStr.getLength() < (
MAX_FIELDLEN - 4); ++nI )
1066 bool bSetAsHex =
false;
1073 rStr = rStr.replaceAt( nI, 1,
u"\"" );
1076 rStr = rStr.replaceAt( nI, 1,
u"{" );
1079 rStr = rStr.replaceAt( nI, 1,
u"|" );
1082 rStr = rStr.replaceAt( nI, 1,
u"}" );
1088 rStr = rStr.replaceAt( nI, 0,
u"\\" );
1095 rStr = rStr.replaceAt( nI, 1,
u"\n" );
1104 bSetAsHex = 0x20 > cChar;
1111 OUString sTmp(
"\\x" );
1114 sTmp += OUString::number( cChar, 16 );
1115 rStr = rStr.replaceAt( nI, 1 , sTmp );
1116 nI += sTmp.getLength() - 1;
1126 OUString
aName(
"WwFieldTag");
1128 aName += OUString::number( nId );
1141 SwSetExpField aField( static_cast<SwSetExpFieldType*>(pFT), rTagText );
1151 sal_uInt64 nOldPos = m_pStrm->Tell();
1159 m_xSBase->WW8ReadString( *m_pStrm, sFText,
1160 m_xPlcxMan->GetCpOfs() + nStart, nL, m_eStructCharSet);
1163 MakeTagString( aTagText, sFText );
1164 InsertTagField( pF->
nId, aTagText );
1166 m_pStrm->Seek( nOldPos );
1195 if( aDef.isEmpty() )
1196 aDef = GetFieldResult( pF );
1198 if ( pF->
nId != 0x01 )
1201 aDef, aQ,
INP_TXT, 0,
false );
1211 sal_uInt64 nOldPos = m_pStrm->Tell();
1223 m_xSBase->WW8ReadString( *m_pStrm, sRes, m_xPlcxMan->GetCpOfs() + nStart,
1224 nL, m_eStructCharSet );
1226 m_pStrm->Seek( nOldPos );
1231 OUStringBuffer buf(sRes.getLength());
1232 for (sal_Int32
i = 0;
i < sRes.getLength(); ++
i)
1252 SAL_INFO(
"sw.ww8",
"GetFieldResult(): filtering control character");
1257 return buf.makeStringAndClear();
1300 OUString &rOrigName,
const OUString &rData)
1302 OSL_ENSURE(m_xPlcxMan,
"No pPlcxMan");
1309 m_xPlcxMan->GetBook()->MapName(rOrigName);
1310 OUString
sName = m_xPlcxMan->GetBook()->GetBookmark(
1312 if (!sName.isEmpty())
1314 m_xPlcxMan->GetBook()->SetStatus(nIndex,
BOOK_IGNORE);
1319 nNo = m_xReffingStck->m_aFieldVarNames.size()+1;
1320 sName =
"WWSetBkmk" + OUString::number(nNo);
1321 nNo += m_xPlcxMan->GetBook()->GetIMax();
1323 m_xReffedStck->NewAttr(*m_pPaM->GetPoint(),
1325 m_xReffingStck->m_aFieldVarNames[rOrigName] = sName;
1347 std::map<OUString, OUString, SwWW8::ltstr>::const_iterator
1348 aResult = m_aFieldVarNames.find(sName);
1350 if (aResult != m_aFieldVarNames.end())
1365 OSL_ENSURE(m_xPlcxMan,
"no pPlcxMan");
1366 m_xPlcxMan->GetBook()->MapName(sName);
1370 std::map<OUString, OUString, SwWW8::ltstr>::const_iterator aResult =
1371 m_xReffingStck->m_aFieldVarNames.find(sName);
1373 return (aResult == m_xReffingStck->m_aFieldVarNames.end())
1374 ? sName : (*aResult).second;
1380 OUString sOrigName, aQ;
1391 if (sOrigName.isEmpty())
1393 else if (aQ.isEmpty())
1404 if (sOrigName.isEmpty())
1407 const OUString aResult(GetFieldResult(pF));
1411 if (!aDef.isEmpty())
1418 const tools::Long nNo = MapBookmarkVariables(pF, sOrigName, aResult);
1436 if( !m_pNumFieldType ){
1440 SwSetExpField aField( static_cast<SwSetExpFieldType*>(m_pNumFieldType), OUString(),
1442 aField.
SetValue( ++m_nFieldNum,
nullptr );
1450 OUString aSequenceName;
1452 bool bHidden =
false;
1453 bool bFormat =
false;
1454 bool bCountOn =
true;
1466 if( aSequenceName.isEmpty() )
1468 else if( aBook.isEmpty() )
1504 if (aSequenceName.isEmpty() && aBook.isEmpty())
1515 if (!sStart.isEmpty())
1516 aField.
SetFormula( aSequenceName +
"=" + sStart );
1532 OUString aResult = aReadParam.
GetResult();
1533 sal_Int32 nResult = aResult.toInt32();
1550 bool bDateTime =
false;
1555 OUString aDocProperty;
1565 if( aDocProperty.isEmpty() )
1575 aDocProperty = aDocProperty.replaceAll(
"\"",
"");
1585 static const char* aName10 =
"\x0F";
1586 static const char* aName11
1588 static const char* aName12
1590 static const char* aName13
1592 static const char* aName14
1594 static const char* aName20 =
"\x15";
1595 static const char* aName21
1597 static const char* aName22
1599 static const char* aName23
1601 static const char* aName24
1603 static const char* aName30 =
"\x16";
1604 static const char* aName31
1605 =
"ZULETZTGESPEICHERTZEIT";
1606 static const char* aName32
1607 =
"DERNIERENREGISTREMENT";
1608 static const char* aName33
1610 static const char* aName34
1612 static const char* aName40 =
"\x17";
1613 static const char* aName41
1614 =
"ZULETZTGEDRUCKT";
1615 static const char* aName42
1616 =
"DERNI\xC8" "REIMPRESSION";
1617 static const char* aName43
1619 static const char* aName44
1621 static const char* aName50 =
"\x18";
1622 static const char* aName51
1623 =
"\xDC" "BERARBEITUNGSNUMMER";
1624 static const char* aName52
1625 =
"NUM\xC9" "RODEREVISION";
1626 static const char* aName53
1628 static const char* aName54
1630 static const sal_uInt16 nFieldCnt = 5;
1634 static const sal_uInt16 nLangCnt = 4;
1635 static const char *aNameSet_26[nFieldCnt][nLangCnt+1] =
1637 {aName10, aName11, aName12, aName13, aName14},
1638 {aName20, aName21, aName22, aName23, aName24},
1639 {aName30, aName31, aName32, aName33, aName34},
1640 {aName40, aName41, aName42, aName43, aName44},
1641 {aName50, aName51, aName52, aName53, aName54}
1644 bool bFieldFound=
false;
1646 for(sal_uInt16 nLIdx=1; !bFieldFound && (nLangCnt > nLIdx); ++nLIdx)
1648 for(nFIdx = 0; !bFieldFound && (nFieldCnt > nFIdx); ++nFIdx)
1650 if( aDocProperty == OUString( aNameSet_26[nFIdx][nLIdx], strlen(aNameSet_26[nFIdx][nLIdx]),
1651 RTL_TEXTENCODING_MS_1252 ) )
1654 pF->
nId = aNameSet_26[nFIdx][0][0];
1668 const auto pType(static_cast<SwDocInfoFieldType*>(
1670 const OUString sDisplayed = GetFieldResult(pF);
1674 OUString sVariable = aField.
ExpandField(
false,
nullptr);
1675 if (sDisplayed.getLength() != sVariable.getLength())
1677 sal_Int32 nLen = sVariable.indexOf(
'\x0');
1679 sVariable = sVariable.copy(0, nLen);
1681 if (sDisplayed == sVariable)
1747 sal_uInt32 nFormat = 0;
1755 case SvNumFormatType::DATE:
1758 case SvNumFormatType::TIME:
1761 case SvNumFormatType::DATETIME:
1772 if ( 64 == pF->
nId )
1783 if( aData.isEmpty() )
1793 aData = aData.replaceAll(
"\"",
"");
1796 const auto pType(static_cast<SwDocInfoFieldType*>(
1798 SwDocInfoField aField(pType, nSub|nReg, aData, GetFieldResult(pF), nFormat);
1800 ForceFieldLanguage(aField, nLang);
1827 bool bHijri =
false;
1849 sal_uInt32 nFormat = 0;
1854 if( SvNumFormatType::UNDEFINED == nDT )
1858 nDT = SvNumFormatType::TIME;
1864 nDT = SvNumFormatType::DATE;
1870 if (nDT & SvNumFormatType::DATE || nDT == SvNumFormatType::TIME)
1875 if (pF->
nOpt & 0x10)
1879 SvNumInputOptions::LAX_TIME))
1883 aSetDateTime.
AddTime(fSerial);
1886 ForceFieldLanguage(aField, nLang);
1912 OSL_ENSURE(
false,
"unknown option in FileName field");
1927 case 27: nSub =
DS_WORD;
break;
1928 case 28: nSub =
DS_CHAR;
break;
1953 sal_Int32 nSize = 0;
1975 const OUString aSiz = aReadParam.
GetResult();
1976 if (!aSiz.isEmpty())
1978 bool bFail = o3tl::checked_multiply<sal_Int32>(aSiz.toInt32(), 20, nSize);
1992 if (!aName.isEmpty())
2009 if (!aName.isEmpty())
2041 if( m_bObj && m_nPicLocFc )
2042 m_nObjLocFc = m_nPicLocFc;
2043 m_bEmbeddObj =
true;
2061 if (sOrigName.isEmpty())
2063 else if (sVal.isEmpty())
2069 const tools::Long nNo = MapBookmarkVariables(pF, sOrigName, sVal);
2073 SwSetExpField aField( static_cast<SwSetExpFieldType*>(pFT), sVal, ULONG_MAX );
2086 OUString sOrigBkmName;
2098 if( sOrigBkmName.isEmpty() )
2133 OUString sBkmName(GetMappedBookmark(sOrigBkmName));
2137 if ( IsTOCBookmarkName( sBkmName ) )
2139 sBkmName = EnsureTOCBookmarkName(sBkmName);
2141 m_xReffedStck->m_aReferencedTOCBookmarks.insert( sBkmName );
2156 m_xReffingStck->NewAttr( *m_pPaM->GetPoint(),
SwFormatField(aField) );
2170 bool bAboveBelow =
false;
2181 if( aBkmName.isEmpty() )
2203 m_xReffingStck->NewAttr(*m_pPaM->GetPoint(),
SwFormatField(aField));
2210 m_xReffingStck->NewAttr(*m_pPaM->GetPoint(),
SwFormatField(aField2));
2226 else if ( nRet == -2 && sOrigName.isEmpty() )
2232 const OUString
sName(GetMappedBookmark(sOrigName));
2235 if (m_bLoadingTOXCache)
2240 if (!m_bLoadingTOXHyperlink && !sName.isEmpty())
2244 OUString sBookmarkName;
2245 if ( IsTOCBookmarkName( sName ) )
2247 sBookmarkName = EnsureTOCBookmarkName(sName);
2249 m_xReffedStck->m_aReferencedTOCBookmarks.insert( sBookmarkName );
2253 sBookmarkName = sName;
2255 OUString sURL =
"#" + sBookmarkName;
2257 static const OUStringLiteral sLinkStyle(
u"Index Link");
2258 const sal_uInt16 nPoolId =
2262 m_xCtrlStck->NewAttr( *m_pPaM->GetPoint(), aURL );
2269 OUString sPageRefBookmarkName;
2270 if ( IsTOCBookmarkName( sName ) )
2272 sPageRefBookmarkName = EnsureTOCBookmarkName(sName);
2274 m_xReffedStck->m_aReferencedTOCBookmarks.insert( sPageRefBookmarkName );
2278 sPageRefBookmarkName = sName;
2292 bool bConverted =
false;
2293 if( rReference ==
"(" )
2297 if (rName ==
u"CheckIt")
2299 else if (rName ==
u"UncheckIt")
2301 else if (rName ==
u"ShowExample")
2308 rReference = OUString(cSymbol);
2318 bool bNewVText =
true;
2319 bool bBracket =
false;
2322 sal_Int32 nOffset = 0;
2332 if( aName.isEmpty() )
2334 else if( aVText.isEmpty() || bBracket )
2343 bBracket = (aVText[0] ==
'[');
2346 else if( aVText.endsWith(
"]") )
2352 if( aName.isEmpty() )
2355 NotifyMacroEventRead();
2359 aName =
"StarOffice.Standard.Modul1." + aName;
2364 if( !bApplyWingdings )
2368 WW8_CP nOldCp = m_xPlcxMan->Where();
2369 WW8_CP nCp = nOldCp + nOffset;
2371 SwPaM aPaM(*m_pPaM, m_pPaM);
2382 for ( ; i < m_xFonts->GetMax(); i++ )
2387 rtl_TextEncoding eSrcCharSet;
2388 if( GetFontParams( i, eFamily, aFontName, ePitch, eSrcCharSet )
2389 && aFontName==
"Wingdings" )
2395 if ( i < m_xFonts->GetMax() )
2411 , mnCpStart(nCpStart)
2413 , mPaM(*rPaM.GetMark(), *rPaM.GetPoint())
2420 bool bUseRemote =
false;
2425 uno::Reference< task::XInteractionHandler > xIH(
2428 uno::Reference< ucb::XProgressHandler > xProgress;
2433 static_cast< ucb::XCommandEnvironment* >(pCommandEnv.get()),
2440 bUseRemote = !aTitle.isEmpty();
2446 OUString aMediaType;
2447 aCnt.getPropertyValue(
"MediaType") >>= aMediaType;
2448 bUseRemote = !aMediaType.isEmpty();
2463 bool bEmbedded =
true;
2474 if (aGrfName.isEmpty())
2505 aFlySet.Put(
SwFormatVertOrient( 0, text::VertOrientation::TOP, text::RelOrientation::FRAME ));
2539 if( aPara.isEmpty() )
2541 else if( aBook.isEmpty() )
2552 if (!aBook.isEmpty() && aBook[ 0 ] !=
'\\')
2555 ConvertUFName(aBook);
2571 aSection.SetProtectFlag(
true);
2575 OSL_ENSURE(pSection,
"no section inserted");
2579 OSL_ENSURE(pSectionNode,
"no section node!");
2596 #if !HAVE_FEATURE_DBCONNECTIVITY || ENABLE_FUZZERS
2610 if( aName.isEmpty() )
2618 SwDBField aField( static_cast<SwDBFieldType*>(pFT) );
2625 aResult = aResult.replace(
'\xb',
'\n' );
2637 #if HAVE_FEATURE_DBCONNECTIVITY && !ENABLE_FUZZERS
2640 SwDBNextSetField aField( static_cast<SwDBNextSetFieldType*>(pFT), OUString(),
2650 #if HAVE_FEATURE_DBCONNECTIVITY && !ENABLE_FUZZERS
2673 if (
'o' == cChar ||
'O' == cChar)
2677 if (aResult.
sType ==
"Input")
2683 else if (aResult.
sType ==
"CombinedCharacters")
2690 else if (
'*' == cChar)
2698 sal_uInt16 nJustificationCode=0;
2700 sal_uInt32 nFontSize=0;
2712 OUString sTemp = rReadParam.
GetResult();
2713 if( sTemp.startsWithIgnoreAsciiCase(
"jc" ) )
2715 sTemp = sTemp.copy(2);
2716 nJustificationCode = o3tl::narrowing<sal_uInt16>(sTemp.toInt32());
2718 else if( sTemp.startsWithIgnoreAsciiCase(
"hps" ) )
2720 sTemp = sTemp.copy(3);
2721 nFontSize=
static_cast<sal_uInt32
>(sTemp.toInt32());
2723 else if( sTemp.startsWithIgnoreAsciiCase(
"Font:" ) )
2725 sTemp = sTemp.copy(5);
2741 rReadParam.
GetResult().startsWithIgnoreAsciiCase(
"p"))
2745 OUString sPart = rReadParam.
GetResult();
2746 sal_Int32 nBegin = sPart.indexOf(
'(');
2749 sal_Int32 nEnd = sPart.indexOf(
')');
2751 if ((nBegin != -1) &&
2752 (nEnd != -1) && (nBegin < nEnd))
2754 sRuby = sPart.copy(nBegin+1,nEnd-nBegin-1);
2758 nBegin = sPart.indexOf(
',',nEnd);
2761 nBegin = sPart.indexOf(
';',nEnd);
2763 nEnd = sPart.lastIndexOf(
')');
2765 if ((nBegin != -1) && (nEnd != -1) && (nBegin < nEnd))
2767 sText = sPart.copy(nBegin+1,nEnd-nBegin-1);
2779 if (sRuby.isEmpty() || sText.isEmpty() || sFontName.isEmpty() || !nFontSize)
2782 css::text::RubyAdjust eRubyAdjust;
2783 switch (nJustificationCode)
2786 eRubyAdjust = css::text::RubyAdjust_CENTER;
2789 eRubyAdjust = css::text::RubyAdjust_BLOCK;
2792 eRubyAdjust = css::text::RubyAdjust_INDENT_BLOCK;
2796 eRubyAdjust = css::text::RubyAdjust_LEFT;
2799 eRubyAdjust = css::text::RubyAdjust_RIGHT;
2813 rpCharFormat->GetFormatAttr(
2817 const SvxFontItem &rF = rpCharFormat->GetFormatAttr(
2821 pCharFormat = rpCharFormat;
2833 aNm+=OUString::number(m_aRubyCharFormats.size()+1);
2840 pFormat->SetFormatAttr(aHeightItem);
2841 pFormat->SetFormatAttr(aFontItem);
2842 m_aRubyCharFormats.push_back(pFormat);
2843 pCharFormat = pFormat;
2870 OUString sSeqName( rParam.
GetResult() );
2886 for (sal_uInt16 nI =
MAXLEVEL; nI > 0; --nI)
2904 if( sParams.isEmpty() )
2911 OUString sTemplate( sParams.getToken(0,
';', nIndex) );
2915 sTemplate = sParams.getToken(0,
',', nIndex);
2921 sTemplate = pStyle->
GetName();
2925 else while( -1 != nIndex )
2927 sal_Int32 nOldIndex=nIndex;
2928 sal_uInt16 nLevel = o3tl::narrowing<sal_uInt16>(
2933 nLevel = o3tl::narrowing<sal_uInt16>(
2937 if( (0 < nLevel) && (
MAXLEVEL >= nLevel) )
2945 sTemplate = pStyle->
GetName();
2948 if( !sStyles.isEmpty() )
2950 sStyles += sTemplate;
2955 sTemplate = sParams.getToken(0,
';', nIndex);
2959 sTemplate = sParams.getToken(0,
',', nIndex);
2966 sal_uInt16 nIndexCols = 1;
2968 nIndexCols =
maSegments.back().maSep.ccolM1 + 1;
3034 sal_uInt16 nIndexCols = 1;
3038 std::shared_ptr<SwTOXBase> pBase = std::make_shared<SwTOXBase>( pType, aOrigForm, nCreateOf, OUString() );
3060 const OUString sParams( aReadParam.
GetResult() );
3062 if( !sParams.isEmpty() )
3064 nIndexCols = o3tl::narrowing<sal_uInt16>(sParams.toInt32());
3072 OUString sDelimiter( aReadParam.
GetResult() );
3073 SwForm aForm( pBase->GetTOXForm() );
3079 for(sal_uInt16 nLevel = 1;
3091 aForm.GetPattern(nLevel);
3092 SwFormTokens::iterator aIt = aPattern.begin();
3095 eType = ++aIt == aPattern.end() ?
TOKEN_END : aIt->eTokenType;
3103 if(0x09 == sDelimiter[0])
3104 aIt->eTabAlign = SvxTabAdjust::End;
3108 aToken.
sText = sDelimiter;
3111 aForm.SetPattern(nLevel, std::move(aPattern));
3122 pBase->SetTOXForm( aForm );
3133 pBase->SetOptions( eOptions );
3139 bool bIsHyperlink =
false;
3145 sal_Int32 nMaxLevel = 0;
3155 bIsHyperlink =
true;
3169 if( nMaxLevel < nVal )
3182 if( nMaxLevel < nVal )
3197 OUString sDelimiter( aReadParam.
GetResult() );
3198 SwForm aForm( pBase->GetTOXForm() );
3204 for(sal_uInt16 nLevel = 1;
3217 SwFormTokens::iterator aIt = aPattern.begin();
3220 eType = ++aIt == aPattern.end() ?
TOKEN_END : aIt->eTokenType;
3229 aToken.
sText = sDelimiter;
3232 aForm.SetPattern(nLevel,
3233 std::move(aPattern));
3242 pBase->SetTOXForm( aForm );
3249 sal_Int32 nStart(0);
3255 nEnd = aOrigForm.GetFormMax()-1;
3258 SwForm aForm( pBase->GetTOXForm() );
3259 if (aForm.GetFormMax() <= nEnd)
3261 for ( sal_Int32 nLevel = nStart; nLevel<=nEnd; ++nLevel )
3270 SwFormTokens::iterator aIt = aPattern.begin();
3273 eType = ++aIt == aPattern.end() ?
TOKEN_END : aIt->eTokenType;
3277 aIt = aPattern.erase(aIt);
3284 aPattern.erase(aIt);
3285 aForm.SetPattern(nLevel, std::move(aPattern));
3293 pBase->SetTOXForm( aForm );
3314 SwForm aForm(pBase->GetTOXForm());
3317 for(sal_uInt16 nLevel = 1; nLevel <= nEnd; ++nLevel)
3322 aPattern.insert(aPattern.begin(), aLinkStart);
3326 auto aItr = std::find_if(aPattern.begin(), aPattern.end(),
3328 if (aItr != aPattern.end())
3329 aPattern.insert(aItr, aLinkStart);
3331 aPattern.push_back(aLinkEnd);
3332 aForm.SetPattern(nLevel, std::move(aPattern));
3334 pBase->SetTOXForm(aForm);
3338 pBase->SetLevel(nMaxLevel);
3354 std::unique_ptr<SwForm> pForm;
3357 if (rSI.IsOutlineNumbered())
3359 sal_uInt16 nStyleLevel = rSI.mnWW8OutlineLevel;
3360 const SwNumFormat& rFormat = rSI.GetOutlineNumrule()->Get( nStyleLevel );
3366 pForm.reset(
new SwForm( pBase->GetTOXForm() ));
3368 SwFormTokens aPattern = pForm->GetPattern(nStyleLevel);
3369 SwFormTokens::iterator aIt =
3370 find_if(aPattern.begin(), aPattern.end(),
3373 if ( aIt != aPattern.end() )
3376 aNumberEntrySeparator.
sText =
" ";
3377 aPattern.insert( ++aIt, aNumberEntrySeparator );
3378 pForm->SetPattern( nStyleLevel, std::move(aPattern) );
3385 pBase->SetTOXForm( *pForm );
3390 pBase->SetCreate(eCreateFrom);
3398 pBase->SetCreate( eCreateFrom );
3409 SwForm aOldForm( pBase->GetTOXForm() );
3410 SwForm aNewForm( eType );
3411 sal_uInt16 nNewEnd = aNewForm.GetFormMax()-1;
3414 for(sal_uInt16 nLevel = 1; nLevel <= nNewEnd; ++nLevel)
3417 SwFormTokens::iterator new_end =
3419 aPattern.erase(new_end, aPattern.end() );
3420 aForm.SetPattern( nLevel, std::move(aPattern) );
3421 aForm.SetTemplate( nLevel, aOldForm.GetTemplate(nLevel) );
3424 pBase->SetTOXForm( aNewForm );
3428 OSL_ENSURE(
false,
"Unhandled toc options!");
3436 OSL_ENSURE(
false,
"Unhandled toc options!");
3441 pBase->AdjustTabStops(
m_rDoc );
3461 const SfxItemSet* pSet = pNd->GetpSwAttrSet();
3490 pBase2->SetMSTOCExpression(rStr);
3492 if ( nIndexCols > 1 )
3497 aCol.Init( nIndexCols, 708, USHRT_MAX );
3499 pBase2->SetAttrSet( aSet );
3531 OUString sURL, sTarget, sMark;
3536 bool bOptions =
false;
3546 if (sURL.isEmpty() && !bOptions)
3560 if( sMark.endsWith(
"\""))
3562 sMark = sMark.copy( 0, sMark.getLength() - 1 );
3565 if ( IsTOCBookmarkName( sMark ) )
3567 sMark = EnsureTOCBookmarkName(sMark);
3585 OSL_ENSURE(
false,
"Analysis still missing - unknown data" );
3594 OSL_ENSURE(!sURL.isEmpty() || !sMark.isEmpty(),
"WW8: Empty URL");
3596 if( !sMark.isEmpty() )
3597 sURL +=
"#" + sMark;
3603 OUString sLinkStyle(
"Index Link");
3604 sal_uInt16 nPoolId =
3622 sal_uInt16 nLevel = 1;
3624 OUString sFieldText;
3634 if( sFieldText.isEmpty() )
3644 const OUString sParams( aReadParam.
GetResult() );
3645 if( sParams[0]!=
'C' && sParams[0]!=
'c' )
3653 const OUString sParams( aReadParam.
GetResult() );
3655 if( !sParams.isEmpty() && sParams[0]>
'0' && sParams[0]<=
'9' )
3657 nLevel = o3tl::narrowing<sal_uInt16>(sParams.toInt32());
3664 OSL_ENSURE( rDoc.
GetTOXTypeCount( eTox ),
"Doc.GetTOXTypeCount() == 0 :-(" );
3678 if( -1 != nScndFnd )
3683 sFieldText = sFieldText.copy( nFnd+1 );
3687 if (!sFieldText.isEmpty())
3696 bool bIdx = (nFieldId != 9);
3706 const int nChunk = 64;
3709 const static char *
aFieldNames[] = {
"\x06""INHALT",
"\x02""XE",
3711 const static sal_uInt8 aFieldId[] = { 9, 4, 9 };
3729 OUString sFieldName;
3730 sal_Int32 nFieldLen =
m_xSBase->WW8ReadString( *
m_pStrm, sFieldName, nStartCp,
3732 nStartCp+=nFieldLen;
3737 if( !nFieldLen || sFieldName[nC]!=0x13 )
3740 if( nFieldLen && sFieldName[nC]==0x15 )
3751 nFnd = sFieldName.indexOf(0x15);
3759 nStartCp+=nFieldLen;
3771 sFieldName = sFieldName.copy(0, nFnd);
3774 while ( sFieldName[nC]==
' ' )
3777 for(
int i = 0;
i < 3;
i++ )
3779 const char*
pName = aFieldNames[
i];
3780 const sal_Int32 nNameLen =
static_cast<sal_Int32
>(*pName++);
3781 if( sFieldName.matchIgnoreAsciiCaseAsciiL( pName, nNameLen, nC ) )
3783 ImportTox( aFieldId[
i], sFieldName.copy( nC + nNameLen ) );
OString stripEnd(const OString &rIn, char c)
eF_ResT Read_F_Set(WW8FieldDesc *, OUString &rStr)
virtual void SetSubType(sal_uInt16 nType) override
SvxNumType GetNumberingType() const
Instances of SwFields and those derived from it occur 0 to n times.
void InsertTagField(const sal_uInt16 nId, const OUString &rTagText)
const SwDocInfoSubType DI_SUB_TIME
std::vector< SwFormToken > SwFormTokens
Vector of tokens.
virtual sal_Int32 Len() const
constexpr TypedWhichId< SwFormatPageDesc > RES_PAGEDESC(93)
std::unique_ptr< SwWW8FltControlStack > m_xCtrlStck
SVX_NUM_CHARS_UPPER_LETTER_N
bool bCodeNest
instruction used recursively
virtual void SetSubType(sal_uInt16 nSub) override
SwNode & GetNode(bool bPoint=true) const
Handles the import of PlcfAtnBkf and PlcfAtnBkl: start / end position of annotation marks...
std::map< OUString, css::uno::Any > parameter_map_t
Marks a position in the document model.
rtl_TextEncoding m_eStructCharSet
void Read_FieldVanish(sal_uInt16 nId, const sal_uInt8 *pData, short nLen)
WW8FieldEntry(SwPosition const &rPos, sal_uInt16 nFieldId) noexcept
SwTOXElement GetCreateType() const
eF_ResT Read_F_DateTime(WW8FieldDesc *, OUString &rStr)
static bool AcceptableNestedField(sal_uInt16 nFieldCode)
SwFlyFrameFormat * m_pFlyFormatOfJustInsertedGraphic
const SwTOXBase & GetBase() const
eF_ResT Read_F_Num(WW8FieldDesc *pF, OUString &)
void SetLinkFileName(OUString const &rNew)
#define LANGUAGE_ENGLISH_US
SwCharFormat * MakeCharFormat(const OUString &rFormatName, SwCharFormat *pDerivedFrom, bool bBroadcast=false)
WW8_CP nSCode
start of instructions code
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.
SvNumberFormatter * GetNumberFormatter(bool bCreate=true)
const SwExtendedSubType SUB_INVISIBLE
Invisible.
sal_uLong MSDateTimeFormatToSwFormat(OUString &rParams, SvNumberFormatter *pFormatter, LanguageType &rLang, bool bHijri, LanguageType nDocLang)
Convert from Word Date/Time field str to Writer's Date Time str.
void SetBookmarkType(const OUString &bookmarkType)
static void FillUIName(const OUString &rName, OUString &rFillName, SwGetPoolIdFromName)
void SetLevel(sal_uInt16 nLevel)
static SwTOXBase * GetCurTOX(const SwPosition &rPos)
Get current table of contents.
bool EndPosIsFieldEnd(WW8_CP &)
void SetPromptText(const OUString &rStr)
eF_ResT Read_F_InputVar(WW8FieldDesc *, OUString &rStr)
eF_ResT Read_F_Author(WW8FieldDesc *, OUString &)
#define WW8_TOX_LEVEL_DELIM
virtual sal_Int32 Len() const override
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_LANGUAGE(10)
virtual sal_uInt16 GetSubType() const override
css::uno::Any getPropertyValue(const OUString &rPropertyName)
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_FONTSIZE(8)
wwFrameNamer m_aGrfNameGenerator
const sal_Unicode cTokenSeparator
Base class of all fields.
void MakeTagString(OUString &rStr, const OUString &rOrg)
void SetHandle(tools::Long nHandle)
#define TOX_STYLE_DELIMITER
Provides access to the marks of a document.
constexpr sal_uInt16 RES_FRMATR_END(133)
OUString GetUniqueSectionName(const OUString *pChkStr=nullptr) const
constexpr sal_uInt8 MAXLEVEL
constexpr TypedWhichId< SwFltRDFMark > RES_FLTR_RDFMARK(196)
static SotStorage * OpenOLEStorage(css::uno::Reference< css::embed::XStorage > const &xStorage, OUString const &rEleName, StreamMode=StreamMode::STD_READWRITE)
sal_uInt64 Seek(sal_uInt64 nPos)
std::basic_string_view< charT, traits > getToken(std::basic_string_view< charT, traits > sv, charT delimiter, std::size_t &position)
constexpr TypedWhichId< SvxFormatBreakItem > RES_BREAK(94)
const SwDocInfoSubType DI_COMMENT
std::unique_ptr< SwPaM > m_pPosAfterTOC
WW8_CP nLen
total length (to skip over text)
static void EnsureMaxLevelForTemplates(SwTOXBase &rBase)
bool isAnyKnownWebDAVScheme() const
static OUString FindPara(const OUString &rStr, sal_Unicode cToken, sal_Unicode cToken2)
SwSectionFormat * GetFormat()
IDocumentMarkAccess * getIDocumentMarkAccess()
virtual bool InsertPoolItem(const SwPaM &rRg, const SfxPoolItem &, const SetAttrMode nFlags=SetAttrMode::DEFAULT, SwRootFrame const *pLayout=nullptr, SwTextAttr **ppNewTextAttr=nullptr)=0
Insert an attribute.
bool StartPosIsFieldStart()
virtual sal_uInt16 GetSubType() const override
eF_ResT Read_F_Macro(WW8FieldDesc *, OUString &rStr)
IDocumentContentOperations const & getIDocumentContentOperations() const
constexpr TypedWhichId< SvxFontItem > RES_CHRATR_FONT(7)
void SetDateTime(const DateTime &rDT)
eF_ResT Read_F_Shape(WW8FieldDesc *pF, OUString &rStr)
static void ParseIfFieldDefinition(const OUString &aFieldDefinition, OUString &rCondition, OUString &rTrue, OUString &rFalse)
eF_ResT Read_F_Seq(WW8FieldDesc *, OUString &rStr)
OUString GetMappedBookmark(std::u16string_view rOrigName)
tools::Long GetLen() const
static LanguageType nLang
constexpr bool starts_with(std::basic_string_view< charT, traits > sv, std::basic_string_view< charT, traits > x) noexcept
SwContentNode * GetContentNode(bool bPoint=true) const
constexpr OUStringLiteral ODF_CODE_PARAM
virtual OUString GetPar1() const
IDocumentFieldsAccess const & getIDocumentFieldsAccess() const
sal_Int32 GetTokenSttPtr() const
Stores RDF statements on a paragraph (key-value pairs where the subject is the paragraph).
static SW_DLLPUBLIC OUString GetCrossRefHeadingBookmarkNamePrefix()
const SwCharFormat * GetDfltCharFormat() const
SwTOXBaseSection * InsertTableOf(const SwPosition &rPos, const SwTOXBase &rTOX, const SfxItemSet *pSet=nullptr, bool bExpand=false, SwRootFrame const *pLayout=nullptr)
SotStorage * OpenSotStorage(const OUString &rEleName, StreamMode=StreamMode::STD_READWRITE, bool transacted=true)
void RegisterToTOXType(SwTOXType &rMark)
Handles the import of PlcfBkfFactoid and PlcfBklFactoid: start / end position of factoids.
std::unique_ptr< SwWW8ReferencedFltEndStack > m_xReffedStck
std::vector< SwWW8StyInf > m_vColl
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_CTL_LANGUAGE(29)
tools::Long GetHandle() const
void SetFieldCode(const OUString &rStr)
access to the command string
eF_ResT Read_F_DBNum(WW8FieldDesc *, OUString &)
const SwDocInfoSubType DI_SUBJECT
void SetInitDBFields(bool b)
static SW_DLLPUBLIC sal_uInt16 GetPoolIdFromUIName(const OUString &rName, SwGetPoolIdFromName)
bool CopyTo(SotStorage *pDestStg)
virtual void SetValue(const double &rVal) override
constexpr TypedWhichId< SwFormatRuby > RES_TXTATR_CJK_RUBY(53)
sal_uInt16 GetTOXTypeCount(TOXTypes eTyp) const
Manage table of content types.
virtual parameter_map_t * GetParameters()=0
void SetAutomaticLanguage(bool const bSet)
void SetBookmarkCode(const OUString &bookmarkCode)
eF_ResT Read_F_IncludeText(WW8FieldDesc *, OUString &rStr)
constexpr TypedWhichId< SfxStringItem > RES_FLTR_BOOKMARK(RES_FLTRATTR_BEGIN)
void SetAlternativeText(const OUString &rAlt)
bool m_bLoadingTOXHyperlink
void SetHadPageDescItem(bool bVal)
SwFltStackEntry * RefToVar(const SwField *pField, SwFltStackEntry &rEntry)
eF_ResT Read_F_PgRef(WW8FieldDesc *, OUString &rStr)
constexpr TypedWhichId< SwFormatINetFormat > RES_TXTATR_INETFMT(51)
constexpr OUStringLiteral aData
#define SAL_N_ELEMENTS(arr)
const SwDocInfoSubType DI_CUSTOM
void SetHadBreakItem(bool bVal)
tools::Long MapBookmarkVariables(const WW8FieldDesc *pF, OUString &rOrigName, const OUString &rData)
WW8_CP Read_F_Tag(WW8FieldDesc *pF)
void Read_SubF_Ruby(msfilter::util::WW8ReadFieldParams &rReadParam)
constexpr OUStringLiteral ODF_ID_PARAM
eF_ResT Read_F_FormCheckBox(WW8FieldDesc *pF, OUString &rStr)
eF_ResT Read_F_DBField(WW8FieldDesc *, OUString &rStr)
PaM is Point and Mark: a selection of the document model.
void PrependedInlineNode(const SwPosition &rPos, const SwNode &rNode)
bool Move(SwMoveFnCollection const &fnMove=fnMoveForward, SwGoInDoc fnGo=GoInContent)
Movement of cursor.
const SwDocInfoSubType DI_PRINT
eF_ResT Read_F_TemplName(WW8FieldDesc *, OUString &)
bool CurrentSectionIsProtected() const
virtual bool InsertString(const SwPaM &rRg, const OUString &, const SwInsertFlags nInsertMode=SwInsertFlags::EMPTYEXPAND)=0
Insert string into existing text node at position rRg.Point().
bool bResNest
instruction inserted into result
bool GetPara(tools::Long nIdx, WW8FieldDesc &rF)
constexpr TypedWhichId< SwFormatField > RES_TXTATR_FIELD(RES_TXTATR_NOEND_BEGIN)
eF_ResT Read_F_Symbol(WW8FieldDesc *, OUString &rStr)
constexpr TypedWhichId< CntUInt16Item > RES_FLTR_ANNOTATIONMARK(195)
static SvtFilterOptions & Get()
void Swap(WW8FieldEntry &rOther) noexcept
void SetUniqueGraphName(SwFrameFormat *pFrameFormat, std::u16string_view rFixedPart)
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
wwSectionManager m_aSectionManager
void SetPrimaryKey(const OUString &rStr)
const SwPosition * GetPoint() const
std::unique_ptr< WW8ScannerBase > m_xSBase
EquationResult ParseCombinedChars(const OUString &rStr)
SwIndex & Assign(SwIndexReg *, sal_Int32)
eF_ResT Read_F_FileName(WW8FieldDesc *, OUString &rStr)
const SwDocInfoSubType DI_KEYS
constexpr OUStringLiteral ODF_OLE_PARAM
bool SwFltGetFlag(sal_uLong nFieldFlags, int no)
constexpr OUStringLiteral ODF_FORMTEXT
SwContentNode * GetContentNode()
SwNodeOffset GetIndex() const
const SwDocInfoSubType DI_CREATE
void SetSequenceName(const OUString &rSet)
rtl_TextEncoding m_eTextCharSet
void SetCaptionDisplay(SwCaptionDisplay eSet)
void NewAttr(const SfxPoolItem &rAttr, const bool bFirstLineOfStSet=false, const bool bLeftIndentSet=false)
void AppendTextNode(SwPosition &rPos)
OUString uppercase(const OUString &rStr, sal_Int32 nPos, sal_Int32 nCount) const
bool ForceFieldLanguage(SwField &rField, LanguageType nLang)
constexpr TypedWhichId< SwFltTOX > RES_FLTR_TOX(193)
WW8_CP GetStartPos() const
sal_uInt16 GetWhichOfScript(sal_uInt16 nWhich, sal_uInt16 nScript)
new reference format types for referencing bookmarks and set references
eF_ResT Read_F_Embedd(WW8FieldDesc *, OUString &rStr)
eF_ResT Read_F_Ref(WW8FieldDesc *pF, OUString &)
static sal_Int32 FindParaStart(const OUString &rStr, sal_Unicode cToken, sal_Unicode cToken2)
IDocumentState const & getIDocumentState() const
eF_ResT Read_F_FormTextBox(WW8FieldDesc *pF, OUString &rStr)
void ImportTox(int nFieldId, const OUString &aStr)
eF_ResT Read_F_Tox(WW8FieldDesc *pF, OUString &rStr)
const SwDocInfoSubType DI_SUB_DATE
Marks a node in the document model.
sal_Int32 toInt32(std::u16string_view str, sal_Int16 radix=10)
Text operation/manipulation interface.
void SetBookmarkName(const OUString &bookmarkName)
sal_uInt16 GetLevel() const
eF_ResT Read_F_FormListBox(WW8FieldDesc *pF, OUString &rStr)
void InitContent()
Evaluation for header and footer.
SVX_NUM_CHARS_LOWER_LETTER_N
tools::Long Read_FactoidBook(WW8PLCFManResult *)
std::unique_ptr< SfxPoolItem > m_pAttr
std::deque< bool > m_aApos
const OUString * GetName() const
tools::Long Read_AtnBook(WW8PLCFManResult *)
WW8PostProcessAttrsInfo(WW8_CP nCpStart, WW8_CP nCpEnd, SwPaM &rPaM)
eBookStatus GetStatus() const
OUString GetResult() const
WW8_CP nLRes
length ( == 0, if no result )
bool IsControlChar(sal_Unicode cChar)
const SwDocInfoSubType DI_SUB_AUTHOR
css::uno::Reference< css::i18n::XBreakIterator > const & GetBreakIter() const
std::vector< const SwCharFormat * > m_aRubyCharFormats
bool m_bCareFirstParaEndInToc
OUString ConvertFFileName(const OUString &rRaw)
translate FieldParameter names into the system character set and at the same time, double backslashes are converted into single ones
tools::Long Read_Field(WW8PLCFManResult *pRes)
const OUString & GetFamilyName() const
OUString GetFieldResult(WW8FieldDesc const *pF)
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
OUString ExpandField(bool bCached, SwRootFrame const *pLayout) const
expand the field.
const SwGetSetExpType GSE_SEQ
Sequence.
sal_uInt32 GetHeight() const
static OUString GetWordDefaultDateStringAsUS(SvNumberFormatter *pFormatter, LanguageType nLang)
SwFieldIds Which() const
ResId.
WW8FieldEntry & operator=(const WW8FieldEntry &rOther) noexcept
SvNumFormatType GetTimeDatePara(OUString const &rStr, sal_uInt32 &rFormat, LanguageType &rLang, int nWhichDefault, bool bHijri=false)
sal_Int32 SkipToNextToken()
sal_Int32 FindNextStringPiece(sal_Int32 _nStart=-1)
sal_uInt8 nOpt
WW-Flags ( e.g.: changed by user )
constexpr sal_uInt16 RES_CHRATR_BEGIN(HINT_BEGIN)
virtual void SetLanguage(LanguageType nLng)
static bool ConvertMacroSymbol(std::u16string_view rName, OUString &rReference)
eF_ResT Read_F_DBNext(WW8FieldDesc *, OUString &)
sal_uInt16 nId
WW-id for fields.
const SwDocInfoSubType DI_DOCNO
virtual SwFieldType * InsertFieldType(const SwFieldType &)=0
OUString const & GetStyleNames(sal_uInt16 nLevel) const
static SvxNumType GetNumberPara(const OUString &rStr, bool bAllowPageDesc=false)
sal_uInt16 CurrentSectionColCount() const
bool CanUseRemoteLink(const OUString &rGrfName)
#define SAL_INFO(area, stream)
static void lcl_toxMatchACSwitch(SwDoc const &rDoc, SwTOXBase &rBase, WW8ReadFieldParams &rParam, SwCaptionDisplay eCaptionType)
sal_Int32 GetIndex() const
void SetStyleNames(const OUString &rSet, sal_uInt16 nLevel)
eF_ResT Read_F_OCX(WW8FieldDesc *, OUString &)
if(aStr!=aBuf) UpdateName_Impl(m_xFollowLb.get()
eF_ResT Read_F_Input(WW8FieldDesc *, OUString &rStr)
eF_ResT Read_F_ANumber(WW8FieldDesc *, OUString &)
void AddTime(double fTimeInDays)
std::u16string_view trim(std::u16string_view str)
OUString BookmarkToWriter(std::u16string_view rBookmark)
void SetInputFlag(bool bInp)
const SwPosition * End() const
constexpr OUStringLiteral ODF_UNHANDLED
constexpr sal_uInt16 RES_PARATR_END(82)
WW8_CP nSRes
start of result
Reference< XComponentContext > getProcessComponentContext()
eF_ResT Read_F_DocInfo(WW8FieldDesc *pF, OUString &rStr)
static void lcl_ImportTox(SwDoc &rDoc, SwPaM const &rPaM, const OUString &rStr, bool bIdx)
auto FilterControlChars(OUString const &rString) -> OUString
eF_ResT Read_F_Styleref(WW8FieldDesc *, OUString &rStr)
Reads a STYLEREF field.
void SetSecondaryKey(const OUString &rStr)
SwMoveFnCollection const & fnMoveBackward
eF_ResT Read_F_Hyperlink(WW8FieldDesc *, OUString &rStr)
static sal_uInt16 lcl_GetMaxValidWordTOCLevel(const SwForm &rForm)
std::shared_ptr< WW8PLCFMan > m_xPlcxMan
static void lcl_ConvertSequenceName(OUString &rSequenceName)
bool WillHavePageDescHere(const SwNodeIndex &rIdx) const
#define SAL_WARN(area, stream)
virtual void SetUpdateExpFieldStat(bool b)=0
const SwGetSetExpType GSE_STRING
String.
wwSectionNamer m_aSectionNameGenerator
virtual SwFieldType * GetSysFieldType(const SwFieldIds eWhich) const =0
const SwDocInfoSubType DI_SUB_FIXED
static void lcl_toxMatchTSwitch(SwWW8ImplReader const &rReader, SwTOXBase &rBase, WW8ReadFieldParams &rParam)
const SwFormat * GetStyleWithOrgWWName(std::u16string_view rName) const
const SwDocInfoSubType DI_CHANGE
virtual void SetMark()
Unless this is called, the getter method of Mark will return Point.
const SwTOXType * GetTOXType(TOXTypes eTyp, sal_uInt16 nId) const
sw::hack::Position maStartPos
void SetLevel(sal_uInt16)
const char *const aFieldNames[]
SwFormat * m_pCurrentColl
const SwDocInfoSubType DI_TITLE
SwSection * InsertSwSection(SwPaM const &rRange, SwSectionData &, std::tuple< SwTOXBase const *, sw::RedlineMode, sw::FieldmarkMode > const *pTOXBase, SfxItemSet const *const pAttr, bool const bUpdate=true)
bool IsUseEnhancedFields() const
static SvxNumType GetNumTypeFromName(const OUString &rStr, bool bAllowPageDesc=false)
eF_ResT Read_F_CurPage(WW8FieldDesc *, OUString &)
eF_ResT Read_F_IncludePicture(WW8FieldDesc *, OUString &rStr)
CharClass & GetAppCharClass()
std::deque< wwSection > maSegments
eF_ResT Read_F_NoteReference(WW8FieldDesc *pF, OUString &rStr)
constexpr sal_uInt16 RES_FRMATR_BEGIN(RES_PARATR_LIST_END)
tools::Long Read_Book(WW8PLCFManResult *)
const SwAttrPool & GetAttrPool() const
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
bool GetTokenSttFromTo(sal_Int32 *_pFrom, sal_Int32 *_pTo, sal_Int32 _nMax)
eF_ResT Read_F_Equation(WW8FieldDesc *, OUString &)
constexpr OUStringLiteral aObjectPool
bool m_bDetectedRangeSegmentation false
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)
eF_ResT Read_F_HTMLControl(WW8FieldDesc *pF, OUString &rStr)