20 #include <config_features.h>
27 #include <com/sun/star/embed/XStorage.hpp>
28 #include <com/sun/star/embed/ElementModes.hpp>
29 #include <com/sun/star/embed/XTransactedObject.hpp>
30 #include <com/sun/star/task/InteractionHandler.hpp>
32 #include <com/sun/star/ucb/XCommandEnvironment.hpp>
39 #include <rtl/character.hxx>
45 #include <com/sun/star/i18n/XBreakIterator.hpp>
64 #include <section.hxx>
81 #include <osl/diagnose.h>
85 #define MAX_FIELDLEN 64000
87 #define WW8_TOX_LEVEL_DELIM ':'
100 bool IsTOCBookmarkName(
const OUString& rName)
105 OUString EnsureTOCBookmarkName(
const OUString& rName)
107 OUString sTmp = rName;
108 if ( IsTOCBookmarkName ( rName ) )
123 OSL_ENSURE( pB,
"WW8PLCFx_Book - Pointer does not exist" );
143 pName->startsWithIgnoreAsciiCase(
"_Hlt" ) )
159 m_xSBase->WW8ReadString( *m_pStrm, aVal, pB->
GetStartPos(), nLen,
161 m_pStrm->Seek( nOldPos );
172 for( sal_Int32 nI = 0;
173 nI < aVal.getLength() && aVal.getLength() < (
MAX_FIELDLEN - 4);
184 aVal = aVal.replaceAt( nI, 1,
"\n" );
197 bSetAsHex = 0x20 > cChar;
204 OUString sTmp(
"\\x" );
207 sTmp += OUString::number( cChar, 16 );
208 aVal = aVal.replaceAt( nI, 1 , sTmp );
209 nI += sTmp.getLength() - 1;
221 if (!m_aFieldStack.empty())
228 m_xReffedStck->NewAttr( aStart,
229 SwFltBookmark( EnsureTOCBookmarkName( sOrigName ), aVal, pB->
GetHandle(), IsTOCBookmarkName( sOrigName ) ));
237 if (pAtnBook->getIsEnd())
249 if (pFactoidBook->getIsEnd())
250 m_xReffedStck->SetAttr(*m_pPaM->GetPoint(),
RES_FLTR_RDFMARK,
true, pFactoidBook->getHandle());
254 aMark.
SetHandle(pFactoidBook->getHandle());
255 GetSmartTagInfo(aMark);
256 m_xReffedStck->NewAttr(*m_pPaM->GetPoint(), aMark);
268 OUString
aName = rOrg.replaceAll(
"\\\\",
"\\");
269 aName = aName.replaceAll(
"%20",
" ");
272 if (aName.endsWith(
"\""))
273 aName = aName.copy(0, aName.getLength()-1);
276 if (!aName.isEmpty())
287 void ConvertUFName( OUString& rName )
295 ConvertUFName(rSequenceName);
296 if (
'0' <= rSequenceName[0] &&
'9' >= rSequenceName[0])
297 rSequenceName =
"_" + rSequenceName;
306 for( sal_Int32 nBuf = 0; nBuf+1 < rStr.getLength(); nBuf++ )
308 if( rStr[ nBuf ] ==
'"' )
312 && rStr[ nBuf ] ==
'\\'
313 && ( rStr[ nBuf + 1 ] == cToken
314 || rStr[ nBuf + 1 ] == cToken2 ) )
318 while( nBuf < rStr.getLength()
319 && rStr[ nBuf ] ==
' ' )
322 return nBuf < rStr.getLength() ? nBuf : -1;
339 || rStr[ n ] == 132 )
343 while( n2 < rStr.getLength()
345 && rStr[ n2 ] !=
'"' )
351 while( n2 < rStr.getLength()
352 && rStr[ n2 ] !=
' ' )
355 return rStr.copy( n, n2-n );
359 bool bAllowPageDesc =
false)
362 if( rStr.startsWithIgnoreAsciiCase(
"Arabi" ) )
364 else if( rStr.startsWith(
"misch" ) )
366 else if( rStr.startsWith(
"MISCH" ) )
368 else if( rStr.startsWithIgnoreAsciiCase(
"alphabeti" ) )
369 eTyp = ( rStr[0] ==
'A' )
372 else if( rStr.startsWithIgnoreAsciiCase(
"roman" ) )
373 eTyp = ( rStr[0] ==
'R' )
381 OUString s(
FindPara( rStr,
'*',
'*' ) );
392 OSL_ENSURE(pLang,
"impossible");
395 if (nLang != nDefault)
419 const sal_Int32
pos = sParams.indexOf(
"YYYY");
422 sParams = sParams.replaceFirst(
"YY",
"YYYY");
431 if (m_xPlcxMan && !m_bVer67)
433 SprmResult aResult = m_xPlcxMan->HasCharSprm(0x85A);
439 OSL_ENSURE(pLang,
"impossible");
443 OUString sParams(
FindPara( rStr,
'@',
'@' ) );
444 if (sParams.isEmpty())
446 bool bHasTime =
false;
447 switch (nWhichDefault)
452 sParams +=
" HH:MM:SS AM/PM";
456 sParams +=
"DD/MM/YYYY HH:MM:SS";
466 sParams =
"[~hijri]" + sParams;
468 sal_Int32 nCheckPos = 0;
472 OUString sTemp(sParams);
477 return bHasTime ? SvNumFormatType::DATETIME : SvNumFormatType::DATE;
485 nNumFormatType = pFormatter->
GetType(nFormatIdx);
486 rFormat = nFormatIdx;
488 return nNumFormatType;
504 OSL_ENSURE(pF,
"WW8PLCFx_FLD - Pointer not available");
512 OSL_ENSURE(!m_aFieldStack.empty(),
"Empty field stack");
513 if (!m_aFieldStack.empty())
520 nRet = m_aFieldStack.back().mnFieldId;
524 if (bUseEnhFields && m_pPaM!=
nullptr && m_pPaM->GetPoint()!=
nullptr) {
526 SwPaM aFieldPam( m_aFieldStack.back().GetPtNode(), m_aFieldStack.back().GetPtContent(), aEndPos.
nNode, aEndPos.
nContent.
GetIndex());
528 IFieldmark *pFieldmark = pMarksAccess->makeFieldBookmark(
529 aFieldPam, m_aFieldStack.back().GetBookmarkName(),
ODF_FORMTEXT,
531 OSL_ENSURE(pFieldmark!=
nullptr,
"hmmm; why was the bookmark not created?");
532 if (pFieldmark!=
nullptr) {
535 m_xRedlineStack->MoveAttrsFieldmarkInserted(*aFieldPam.Start());
537 pFieldmark->
GetParameters()->insert(rParametersToAdd.begin(), rParametersToAdd.end());
544 if (m_bLoadingTOXCache)
546 if (m_nEmbeddedTOXLevel > 0)
549 --m_nEmbeddedTOXLevel;
553 m_aTOXEndCps.insert(nCP);
554 m_bLoadingTOXCache =
false;
555 if ( m_pPaM->End() &&
556 m_pPaM->End()->nNode.GetNode().GetTextNode() &&
557 m_pPaM->End()->nNode.GetNode().GetTextNode()->Len() == 0 )
563 m_bCareLastParaEndInToc =
true;
568 *m_pPaM = *m_pPosAfterTOC;
569 m_pPosAfterTOC.reset();
575 if (m_bLoadingTOXCache && !m_bLoadingTOXHyperlink)
581 if (m_bLoadingTOXHyperlink)
582 m_bLoadingTOXHyperlink =
false;
588 *m_pPaM->GetPoint() = m_aFieldStack.back().maStartPos;
593 const OUString& fieldDefinition = m_aFieldStack.back().GetBookmarkCode();
595 OUString paramCondition;
604 static_cast<SwHiddenTextFieldType*>(pFieldType),
615 OUString aCode = m_aFieldStack.back().GetBookmarkCode();
616 if (!aCode.isEmpty() && !aCode.trim().startsWith(
"SHAPE"))
621 m_aFieldStack.back().GetPtNode(), m_aFieldStack.back().GetPtContent(),
626 IFieldmark* pFieldmark = pMarksAccess->makeFieldBookmark(
628 m_aFieldStack.back().GetBookmarkName(),
635 m_xRedlineStack->MoveAttrsFieldmarkInserted(*aFieldPam.Start());
637 pFieldmark->
GetParameters()->insert(rParametersToAdd.begin(), rParametersToAdd.end());
638 OUString sFieldId = OUString::number( m_aFieldStack.back().mnFieldId );
640 std::pair< OUString, uno::Any > (
642 uno::makeAny( sFieldId ) ) );
644 std::pair< OUString, uno::Any > (
646 uno::makeAny( aCode ) ) );
648 if ( m_aFieldStack.back().mnObjLocFc > 0 )
651 OUString sOleId =
"_" +
652 OUString::number( m_aFieldStack.back().mnObjLocFc );
658 uno::Reference< embed::XStorage > xDocStg = GetDoc().GetDocStorage();
661 uno::Reference< embed::XStorage > xOleStg = xDocStg->openStorageElement(
662 "OLELinks", embed::ElementModes::WRITE );
673 uno::Reference< embed::XTransactedObject > xTransact( xOleStg, uno::UNO_QUERY );
674 if ( xTransact.is() )
680 std::pair< OUString, uno::Any >(
688 m_aFieldStack.pop_back();
715 : maStartPos(rPos), mnFieldId(nFieldId), mnObjLocFc(0)
720 : maStartPos(rOther.maStartPos), mnFieldId(rOther.mnFieldId), mnObjLocFc(rOther.mnObjLocFc)
726 std::swap(maStartPos, rOther.maStartPos);
727 std::swap(mnFieldId, rOther.mnFieldId);
740 msBookmarkName=bookmarkName;
745 msMarkType=bookmarkType;
750 msMarkCode = bookmarkCode;
760 enum Limits {eMax = 96};
761 static const FNReadField aWW8FieldTab[eMax+1] =
863 OSL_ENSURE(
SAL_N_ELEMENTS( aWW8FieldTab ) == eMax+1,
"FieldFunc table not right" );
866 OSL_ENSURE(pF,
"WW8PLCFx_FLD - Pointer not available");
871 bool bNested =
false;
872 if (!m_aFieldStack.empty())
874 bNested = std::any_of(m_aFieldStack.cbegin(), m_aFieldStack.cend(),
881 OSL_ENSURE(bOk,
"WW8: Bad Field!");
884 if ( aF.
nId == 6 ) bCodeNest =
false;
885 if (aF.
nId == 70) bCodeNest =
false;
887 m_aFieldStack.emplace_back(*m_pPaM->GetPoint(), aF.
nId);
892 sal_uInt16
n = (aF.
nId <= eMax) ? aF.
nId : static_cast<sal_uInt16>(eMax);
893 sal_uInt16 nI = n / 32;
894 sal_uInt32 nMask = 1 << ( n % 32 );
902 if( m_nFieldTagAlways[nI] & nMask )
903 return Read_F_Tag( &aF );
905 if( !bOk || !aF.
nId )
908 if( aF.
nId > eMax - 1)
910 if( m_nFieldTagBad[nI] & nMask )
911 return Read_F_Tag( &aF );
917 if (aF.
nId != 88 && m_xPlcxMan->GetDoingDrawTextBox())
920 bool bHasHandler = aWW8FieldTab[aF.
nId] !=
nullptr;
925 sal_uInt64 nOldPos = m_pStrm->Tell();
927 aF.
nLCode = m_xSBase->WW8ReadString(*m_pStrm, aStr, m_xPlcxMan->GetCpOfs() + aF.
nSCode, aF.
nLCode, m_eTextCharSet);
928 m_pStrm->Seek(nOldPos);
932 if (nRet == -2 && !aReadParam.
GetResult().isEmpty())
934 bHasHandler = rtl::isAsciiDigit(aReadParam.
GetResult()[0]);
941 bHasHandler = nRet < 0 || nRet ==
'*';
946 if (!bHasHandler || bCodeNest)
948 if( m_nFieldTagBad[nI] & nMask )
949 return Read_F_Tag( &aF );
956 aF.
nLCode = m_xSBase->WW8ReadString( *m_pStrm, aStr, m_xPlcxMan->GetCpOfs()+
958 m_pStrm->Seek( nOldPos );
962 const sal_Int32 nDotPos = aStr.indexOf(
'.');
963 const sal_Int32 nSlashPos = aStr.indexOf(
'/');
964 sal_Int32 nSpacePos = aStr.indexOf(
' ', 1 );
966 nSpacePos = aStr.getLength();
968 if ( ( aStr.getLength() <= 1 || aStr[1] !=
'=') &&
969 (( nDotPos>=0 && nDotPos < nSpacePos ) ||
970 ( nSlashPos>=0 && nSlashPos < nSpacePos )))
979 m_aFieldStack.back().SetBookmarkCode( aStr );
985 auto nOldPos = m_pStrm->Tell();
987 if ( aF.nId == 6 && aF.bCodeNest )
990 aF.nLCode = m_xSBase->WW8ReadString( *m_pStrm, aStr, m_xPlcxMan->GetCpOfs() +
991 aF.nSCode, aF.nSRes - aF.nSCode - 1, m_eTextCharSet );
995 aF.nLCode = m_xSBase->WW8ReadString( *m_pStrm, aStr, m_xPlcxMan->GetCpOfs()+
996 aF.nSCode, aF.nLCode, m_eTextCharSet );
1003 aStr = aStr.replaceAll(
"\x01",
"");
1006 eF_ResT eRes = (this->*aWW8FieldTab[aF.nId])( &aF, aStr );
1007 m_pStrm->Seek(nOldPos);
1018 return aF.nLen - aF.nLRes - 2;
1022 if ( m_nFieldTagBad[nI] & nMask )
1023 return Read_F_Tag( &aF );
1026 return aF.nLen - aF.nLRes - 2;
1045 for( sal_Int32 nI = 0;
1046 nI < rStr.getLength() && rStr.getLength() < (
MAX_FIELDLEN - 4); ++nI )
1048 bool bSetAsHex =
false;
1055 rStr = rStr.replaceAt( nI, 1,
"\"" );
1058 rStr = rStr.replaceAt( nI, 1,
"{" );
1061 rStr = rStr.replaceAt( nI, 1,
"|" );
1064 rStr = rStr.replaceAt( nI, 1,
"}" );
1070 rStr = rStr.replaceAt( nI, 0,
"\\" );
1077 rStr = rStr.replaceAt( nI, 1,
"\n" );
1086 bSetAsHex = 0x20 > cChar;
1093 OUString sTmp(
"\\x" );
1096 sTmp += OUString::number( cChar, 16 );
1097 rStr = rStr.replaceAt( nI, 1 , sTmp );
1098 nI += sTmp.getLength() - 1;
1108 OUString
aName(
"WwFieldTag");
1110 aName += OUString::number( nId );
1123 SwSetExpField aField( static_cast<SwSetExpFieldType*>(pFT), rTagText );
1141 m_xSBase->WW8ReadString( *m_pStrm, sFText,
1142 m_xPlcxMan->GetCpOfs() + nStart, nL, m_eStructCharSet);
1145 MakeTagString( aTagText, sFText );
1146 InsertTagField( pF->
nId, aTagText );
1148 m_pStrm->Seek( nOldPos );
1177 if( aDef.isEmpty() )
1178 aDef = GetFieldResult( pF );
1180 if ( pF->
nId != 0x01 )
1183 aDef, aQ,
INP_TXT, 0,
false );
1205 m_xSBase->WW8ReadString( *m_pStrm, sRes, m_xPlcxMan->GetCpOfs() + nStart,
1206 nL, m_eStructCharSet );
1208 m_pStrm->Seek( nOldPos );
1213 OUStringBuffer buf(sRes.getLength());
1214 for (sal_Int32
i = 0;
i < sRes.getLength(); ++
i)
1234 SAL_INFO(
"sw.ww8",
"GetFieldResult(): filtering control character");
1239 return buf.makeStringAndClear();
1282 OUString &rOrigName,
const OUString &rData)
1284 OSL_ENSURE(m_xPlcxMan,
"No pPlcxMan");
1291 m_xPlcxMan->GetBook()->MapName(rOrigName);
1292 OUString
sName = m_xPlcxMan->GetBook()->GetBookmark(
1294 if (!sName.isEmpty())
1296 m_xPlcxMan->GetBook()->SetStatus(nIndex,
BOOK_IGNORE);
1301 nNo = m_xReffingStck->aFieldVarNames.size()+1;
1302 sName =
"WWSetBkmk" + OUString::number(nNo);
1303 nNo += m_xPlcxMan->GetBook()->GetIMax();
1305 m_xReffedStck->NewAttr(*m_pPaM->GetPoint(),
1307 m_xReffingStck->aFieldVarNames[rOrigName] = sName;
1329 std::map<OUString, OUString, SwWW8::ltstr>::const_iterator
1330 aResult = aFieldVarNames.find(sName);
1332 if (aResult != aFieldVarNames.end())
1347 OSL_ENSURE(m_xPlcxMan,
"no pPlcxMan");
1348 m_xPlcxMan->GetBook()->MapName(sName);
1352 std::map<OUString, OUString, SwWW8::ltstr>::const_iterator aResult =
1353 m_xReffingStck->aFieldVarNames.find(sName);
1355 return (aResult == m_xReffingStck->aFieldVarNames.end())
1356 ? sName : (*aResult).second;
1362 OUString sOrigName, aQ;
1373 if (sOrigName.isEmpty())
1375 else if (aQ.isEmpty())
1386 if (sOrigName.isEmpty())
1389 const OUString aResult(GetFieldResult(pF));
1393 if (!aDef.isEmpty())
1400 const tools::Long nNo = MapBookmarkVariables(pF, sOrigName, aResult);
1418 if( !m_pNumFieldType ){
1422 SwSetExpField aField( static_cast<SwSetExpFieldType*>(m_pNumFieldType), OUString(),
1424 aField.
SetValue( ++m_nFieldNum,
nullptr );
1432 OUString aSequenceName;
1434 bool bHidden =
false;
1435 bool bFormat =
false;
1436 bool bCountOn =
true;
1448 if( aSequenceName.isEmpty() )
1450 else if( aBook.isEmpty() )
1486 if (aSequenceName.isEmpty() && aBook.isEmpty())
1497 if (!sStart.isEmpty())
1498 aField.
SetFormula( aSequenceName +
"=" + sStart );
1514 OUString aResult = aReadParam.
GetResult();
1515 sal_Int32 nResult = aResult.toInt32();
1532 bool bDateTime =
false;
1536 OUString aDocProperty;
1546 if( aDocProperty.isEmpty() )
1556 aDocProperty = aDocProperty.replaceAll(
"\"",
"");
1566 static const char* aName10 =
"\x0F";
1567 static const char* aName11
1569 static const char* aName12
1571 static const char* aName13
1573 static const char* aName14
1575 static const char* aName20 =
"\x15";
1576 static const char* aName21
1578 static const char* aName22
1580 static const char* aName23
1582 static const char* aName24
1584 static const char* aName30 =
"\x16";
1585 static const char* aName31
1586 =
"ZULETZTGESPEICHERTZEIT";
1587 static const char* aName32
1588 =
"DERNIERENREGISTREMENT";
1589 static const char* aName33
1591 static const char* aName34
1593 static const char* aName40 =
"\x17";
1594 static const char* aName41
1595 =
"ZULETZTGEDRUCKT";
1596 static const char* aName42
1597 =
"DERNI\xC8" "REIMPRESSION";
1598 static const char* aName43
1600 static const char* aName44
1602 static const char* aName50 =
"\x18";
1603 static const char* aName51
1604 =
"\xDC" "BERARBEITUNGSNUMMER";
1605 static const char* aName52
1606 =
"NUM\xC9" "RODEREVISION";
1607 static const char* aName53
1609 static const char* aName54
1611 static const sal_uInt16 nFieldCnt = 5;
1615 static const sal_uInt16 nLangCnt = 4;
1616 static const char *aNameSet_26[nFieldCnt][nLangCnt+1] =
1618 {aName10, aName11, aName12, aName13, aName14},
1619 {aName20, aName21, aName22, aName23, aName24},
1620 {aName30, aName31, aName32, aName33, aName34},
1621 {aName40, aName41, aName42, aName43, aName44},
1622 {aName50, aName51, aName52, aName53, aName54}
1625 bool bFieldFound=
false;
1627 for(sal_uInt16 nLIdx=1; !bFieldFound && (nLangCnt > nLIdx); ++nLIdx)
1629 for(nFIdx = 0; !bFieldFound && (nFieldCnt > nFIdx); ++nFIdx)
1631 if( aDocProperty == OUString( aNameSet_26[nFIdx][nLIdx], strlen(aNameSet_26[nFIdx][nLIdx]),
1632 RTL_TEXTENCODING_MS_1252 ) )
1635 pF->
nId = aNameSet_26[nFIdx][0][0];
1700 sal_uInt32 nFormat = 0;
1708 case SvNumFormatType::DATE:
1711 case SvNumFormatType::TIME:
1714 case SvNumFormatType::DATETIME:
1725 if ( 64 == pF->
nId )
1736 if( aData.isEmpty() )
1746 aData = aData.replaceAll(
"\"",
"");
1752 ForceFieldLanguage(aField, nLang);
1779 bool bHijri =
false;
1801 sal_uInt32 nFormat = 0;
1806 if( SvNumFormatType::UNDEFINED == nDT )
1810 nDT = SvNumFormatType::TIME;
1816 nDT = SvNumFormatType::DATE;
1822 sal_uInt16 nDoNotRecalculate = (pF->
nOpt & 0x10) ?
FIXEDFLD : 0;
1823 if (nDoNotRecalculate)
1832 if (nDT & SvNumFormatType::DATE)
1836 (
DATEFLD | nDoNotRecalculate),
1838 ForceFieldLanguage(aField, nLang);
1841 else if (nDT == SvNumFormatType::TIME)
1845 (
TIMEFLD | nDoNotRecalculate),
1847 ForceFieldLanguage(aField, nLang);
1873 OSL_ENSURE(
false,
"unknown option in FileName field");
1888 case 27: nSub =
DS_WORD;
break;
1889 case 28: nSub =
DS_CHAR;
break;
1914 sal_Int32 nSize = 0;
1936 const OUString aSiz = aReadParam.
GetResult();
1937 if (!aSiz.isEmpty())
1939 bool bFail = o3tl::checked_multiply<sal_Int32>(aSiz.toInt32(), 20, nSize);
1953 if (!aName.isEmpty())
1970 if (!aName.isEmpty())
2002 if( m_bObj && m_nPicLocFc )
2003 m_nObjLocFc = m_nPicLocFc;
2004 m_bEmbeddObj =
true;
2022 if (sOrigName.isEmpty())
2024 else if (sVal.isEmpty())
2030 const tools::Long nNo = MapBookmarkVariables(pF, sOrigName, sVal);
2034 SwSetExpField aField( static_cast<SwSetExpFieldType*>(pFT), sVal, ULONG_MAX );
2047 OUString sOrigBkmName;
2059 if( sOrigBkmName.isEmpty() )
2094 OUString sBkmName(GetMappedBookmark(sOrigBkmName));
2098 if ( IsTOCBookmarkName( sBkmName ) )
2100 sBkmName = EnsureTOCBookmarkName(sBkmName);
2102 m_xReffedStck->aReferencedTOCBookmarks.insert( sBkmName );
2117 m_xReffingStck->NewAttr( *m_pPaM->GetPoint(),
SwFormatField(aField) );
2131 bool bAboveBelow =
false;
2142 if( aBkmName.isEmpty() )
2164 m_xReffingStck->NewAttr(*m_pPaM->GetPoint(),
SwFormatField(aField));
2171 m_xReffingStck->NewAttr(*m_pPaM->GetPoint(),
SwFormatField(aField2));
2187 else if ( nRet == -2 && sOrigName.isEmpty() )
2193 const OUString
sName(GetMappedBookmark(sOrigName));
2196 if (m_bLoadingTOXCache)
2201 if (!m_bLoadingTOXHyperlink && !sName.isEmpty())
2205 OUString sBookmarkName;
2206 if ( IsTOCBookmarkName( sName ) )
2208 sBookmarkName = EnsureTOCBookmarkName(sName);
2210 m_xReffedStck->aReferencedTOCBookmarks.insert( sBookmarkName );
2214 sBookmarkName = sName;
2216 OUString sURL =
"#" + sBookmarkName;
2218 static const OUStringLiteral sLinkStyle(
u"Index Link");
2219 const sal_uInt16 nPoolId =
2223 m_xCtrlStck->NewAttr( *m_pPaM->GetPoint(), aURL );
2230 OUString sPageRefBookmarkName;
2231 if ( IsTOCBookmarkName( sName ) )
2233 sPageRefBookmarkName = EnsureTOCBookmarkName(sName);
2235 m_xReffedStck->aReferencedTOCBookmarks.insert( sPageRefBookmarkName );
2239 sPageRefBookmarkName = sName;
2253 bool bConverted =
false;
2254 if( rReference ==
"(" )
2258 if (rName ==
u"CheckIt")
2260 else if (rName ==
u"UncheckIt")
2262 else if (rName ==
u"ShowExample")
2269 rReference = OUString(cSymbol);
2279 bool bNewVText =
true;
2280 bool bBracket =
false;
2283 sal_Int32 nOffset = 0;
2293 if( aName.isEmpty() )
2295 else if( aVText.isEmpty() || bBracket )
2304 bBracket = (aVText[0] ==
'[');
2307 else if( aVText.endsWith(
"]") )
2313 if( aName.isEmpty() )
2316 NotifyMacroEventRead();
2320 aName =
"StarOffice.Standard.Modul1." + aName;
2325 if( !bApplyWingdings )
2329 WW8_CP nOldCp = m_xPlcxMan->Where();
2330 WW8_CP nCp = nOldCp + nOffset;
2332 SwPaM aPaM(*m_pPaM, m_pPaM);
2343 for ( ; i < m_xFonts->GetMax(); i++ )
2348 rtl_TextEncoding eSrcCharSet;
2349 if( GetFontParams( i, eFamily, aFontName, ePitch, eSrcCharSet )
2350 && aFontName==
"Wingdings" )
2356 if ( i < m_xFonts->GetMax() )
2372 , mnCpStart(nCpStart)
2374 , mPaM(*rPaM.GetMark(), *rPaM.GetPoint())
2381 bool bUseRemote =
false;
2386 uno::Reference< task::XInteractionHandler > xIH(
2389 uno::Reference< ucb::XProgressHandler > xProgress;
2394 static_cast< ucb::XCommandEnvironment* >(pCommandEnv.get()),
2401 bUseRemote = !aTitle.isEmpty();
2407 OUString aMediaType;
2408 aCnt.getPropertyValue(
"MediaType") >>= aMediaType;
2409 bUseRemote = !aMediaType.isEmpty();
2424 bool bEmbedded =
true;
2435 if (aGrfName.isEmpty())
2467 aFlySet.Put(
SwFormatVertOrient( 0, text::VertOrientation::TOP, text::RelOrientation::FRAME ));
2501 if( aPara.isEmpty() )
2503 else if( aBook.isEmpty() )
2514 if (!aBook.isEmpty() && aBook[ 0 ] !=
'\\')
2517 ConvertUFName(aBook);
2533 aSection.SetProtectFlag(
true);
2537 OSL_ENSURE(pSection,
"no section inserted");
2541 OSL_ENSURE(pSectionNode,
"no section node!");
2558 #if !HAVE_FEATURE_DBCONNECTIVITY
2572 if( aName.isEmpty() )
2580 SwDBField aField( static_cast<SwDBFieldType*>(pFT) );
2587 aResult = aResult.replace(
'\xb',
'\n' );
2599 #if HAVE_FEATURE_DBCONNECTIVITY
2602 SwDBNextSetField aField( static_cast<SwDBNextSetFieldType*>(pFT), OUString(),
2612 #if HAVE_FEATURE_DBCONNECTIVITY
2635 if (
'o' == cChar ||
'O' == cChar)
2639 if (aResult.
sType ==
"Input")
2645 else if (aResult.
sType ==
"CombinedCharacters")
2652 else if (
'*' == cChar)
2660 sal_uInt16 nJustificationCode=0;
2662 sal_uInt32 nFontSize=0;
2674 OUString sTemp = rReadParam.
GetResult();
2675 if( sTemp.startsWithIgnoreAsciiCase(
"jc" ) )
2677 sTemp = sTemp.copy(2);
2678 nJustificationCode =
static_cast<sal_uInt16
>(sTemp.toInt32());
2680 else if( sTemp.startsWithIgnoreAsciiCase(
"hps" ) )
2682 sTemp = sTemp.copy(3);
2683 nFontSize=
static_cast<sal_uInt32
>(sTemp.toInt32());
2685 else if( sTemp.startsWithIgnoreAsciiCase(
"Font:" ) )
2687 sTemp = sTemp.copy(5);
2703 rReadParam.
GetResult().startsWithIgnoreAsciiCase(
"p"))
2707 OUString sPart = rReadParam.
GetResult();
2708 sal_Int32 nBegin = sPart.indexOf(
'(');
2711 sal_Int32 nEnd = sPart.indexOf(
')');
2713 if ((nBegin != -1) &&
2714 (nEnd != -1) && (nBegin < nEnd))
2716 sRuby = sPart.copy(nBegin+1,nEnd-nBegin-1);
2720 nBegin = sPart.indexOf(
',',nEnd);
2723 nBegin = sPart.indexOf(
';',nEnd);
2725 nEnd = sPart.lastIndexOf(
')');
2727 if ((nBegin != -1) && (nEnd != -1) && (nBegin < nEnd))
2729 sText = sPart.copy(nBegin+1,nEnd-nBegin-1);
2741 if (sRuby.isEmpty() || sText.isEmpty() || sFontName.isEmpty() || !nFontSize)
2744 css::text::RubyAdjust eRubyAdjust;
2745 switch (nJustificationCode)
2748 eRubyAdjust = css::text::RubyAdjust_CENTER;
2751 eRubyAdjust = css::text::RubyAdjust_BLOCK;
2754 eRubyAdjust = css::text::RubyAdjust_INDENT_BLOCK;
2758 eRubyAdjust = css::text::RubyAdjust_LEFT;
2761 eRubyAdjust = css::text::RubyAdjust_RIGHT;
2775 ItemGet<SvxFontHeightItem>(*rpCharFormat,
2779 const SvxFontItem &rF = ItemGet<SvxFontItem>(*rpCharFormat,
2783 pCharFormat = rpCharFormat;
2795 aNm+=OUString::number(m_aRubyCharFormats.size()+1);
2802 pFormat->SetFormatAttr(aHeightItem);
2803 pFormat->SetFormatAttr(aFontItem);
2804 m_aRubyCharFormats.push_back(pFormat);
2805 pCharFormat = pFormat;
2832 OUString sSeqName( rParam.
GetResult() );
2848 for (sal_uInt16 nI =
MAXLEVEL; nI > 0; --nI)
2866 if( sParams.isEmpty() )
2873 OUString sTemplate( sParams.getToken(0,
';', nIndex) );
2877 sTemplate = sParams.getToken(0,
',', nIndex);
2883 sTemplate = pStyle->
GetName();
2887 else while( -1 != nIndex )
2889 sal_Int32 nOldIndex=nIndex;
2890 sal_uInt16 nLevel =
static_cast<sal_uInt16
>(
2891 sParams.getToken(0,
';', nIndex).toInt32());
2895 nLevel =
static_cast<sal_uInt16
>(
2896 sParams.getToken(0,
',', nIndex).toInt32());
2899 if( (0 < nLevel) && (
MAXLEVEL >= nLevel) )
2907 sTemplate = pStyle->
GetName();
2910 if( !sStyles.isEmpty() )
2912 sStyles += sTemplate;
2917 sTemplate = sParams.getToken(0,
';', nIndex);
2921 sTemplate = sParams.getToken(0,
',', nIndex);
2928 sal_uInt16 nIndexCols = 1;
2930 nIndexCols =
maSegments.back().maSep.ccolM1 + 1;
2996 sal_uInt16 nIndexCols = 1;
3000 std::shared_ptr<SwTOXBase> pBase = std::make_shared<SwTOXBase>( pType, aOrigForm, nCreateOf, OUString() );
3022 const OUString sParams( aReadParam.
GetResult() );
3024 if( !sParams.isEmpty() )
3026 nIndexCols =
static_cast<sal_uInt16
>(sParams.toInt32());
3034 OUString sDelimiter( aReadParam.
GetResult() );
3035 SwForm aForm( pBase->GetTOXForm() );
3041 for(sal_uInt16 nLevel = 1;
3053 aForm.GetPattern(nLevel);
3054 SwFormTokens::iterator aIt = aPattern.begin();
3057 eType = ++aIt == aPattern.end() ?
TOKEN_END : aIt->eTokenType;
3065 if(0x09 == sDelimiter[0])
3066 aIt->eTabAlign = SvxTabAdjust::End;
3070 aToken.
sText = sDelimiter;
3073 aForm.SetPattern(nLevel, aPattern);
3084 pBase->SetTOXForm( aForm );
3095 pBase->SetOptions( eOptions );
3101 bool bIsHyperlink =
false;
3107 sal_Int32 nMaxLevel = 0;
3117 bIsHyperlink =
true;
3131 if( nMaxLevel < nVal )
3144 if( nMaxLevel < nVal )
3159 OUString sDelimiter( aReadParam.
GetResult() );
3160 SwForm aForm( pBase->GetTOXForm() );
3166 for(sal_uInt16 nLevel = 1;
3179 SwFormTokens::iterator aIt = aPattern.begin();
3182 eType = ++aIt == aPattern.end() ?
TOKEN_END : aIt->eTokenType;
3191 aToken.
sText = sDelimiter;
3194 aForm.SetPattern(nLevel,
3204 pBase->SetTOXForm( aForm );
3211 sal_Int32 nStart(0);
3217 nEnd = aOrigForm.GetFormMax()-1;
3220 SwForm aForm( pBase->GetTOXForm() );
3221 if (aForm.GetFormMax() <= nEnd)
3223 for ( sal_Int32 nLevel = nStart; nLevel<=nEnd; ++nLevel )
3232 SwFormTokens::iterator aIt = aPattern.begin();
3235 eType = ++aIt == aPattern.end() ?
TOKEN_END : aIt->eTokenType;
3239 aIt = aPattern.erase(aIt);
3246 aPattern.erase(aIt);
3247 aForm.SetPattern(nLevel, aPattern);
3255 pBase->SetTOXForm( aForm );
3276 SwForm aForm(pBase->GetTOXForm());
3279 for(sal_uInt16 nLevel = 1; nLevel <= nEnd; ++nLevel)
3284 aPattern.insert(aPattern.begin(), aLinkStart);
3288 auto aItr = std::find_if(aPattern.begin(), aPattern.end(),
3290 if (aItr != aPattern.end())
3291 aPattern.insert(aItr, aLinkStart);
3293 aPattern.push_back(aLinkEnd);
3294 aForm.SetPattern(nLevel, aPattern);
3296 pBase->SetTOXForm(aForm);
3300 pBase->SetLevel(nMaxLevel);
3316 std::unique_ptr<SwForm> pForm;
3319 if (rSI.IsOutlineNumbered())
3321 sal_uInt16 nStyleLevel = rSI.mnWW8OutlineLevel;
3322 const SwNumFormat& rFormat = rSI.GetOutlineNumrule()->Get( nStyleLevel );
3328 pForm.reset(
new SwForm( pBase->GetTOXForm() ));
3330 SwFormTokens aPattern = pForm->GetPattern(nStyleLevel);
3331 SwFormTokens::iterator aIt =
3332 find_if(aPattern.begin(), aPattern.end(),
3335 if ( aIt != aPattern.end() )
3338 aNumberEntrySeparator.
sText =
" ";
3339 aPattern.insert( ++aIt, aNumberEntrySeparator );
3340 pForm->SetPattern( nStyleLevel, aPattern );
3347 pBase->SetTOXForm( *pForm );
3352 pBase->SetCreate(eCreateFrom);
3360 pBase->SetCreate( eCreateFrom );
3371 SwForm aOldForm( pBase->GetTOXForm() );
3372 SwForm aNewForm( eType );
3373 sal_uInt16 nNewEnd = aNewForm.GetFormMax()-1;
3376 for(sal_uInt16 nLevel = 1; nLevel <= nNewEnd; ++nLevel)
3379 SwFormTokens::iterator new_end =
3381 aPattern.erase(new_end, aPattern.end() );
3382 aForm.SetPattern( nLevel, aPattern );
3383 aForm.SetTemplate( nLevel, aOldForm.GetTemplate(nLevel) );
3386 pBase->SetTOXForm( aNewForm );
3390 OSL_ENSURE(
false,
"Unhandled toc options!");
3398 OSL_ENSURE(
false,
"Unhandled toc options!");
3403 pBase->AdjustTabStops(
m_rDoc );
3423 const SfxItemSet* pSet = pNd->GetpSwAttrSet();
3452 pBase2->SetMSTOCExpression(rStr);
3454 if ( nIndexCols > 1 )
3461 pBase2->SetAttrSet( aSet );
3493 OUString sURL, sTarget, sMark;
3498 bool bOptions =
false;
3508 if (sURL.isEmpty() && !bOptions)
3522 if( sMark.endsWith(
"\""))
3524 sMark = sMark.copy( 0, sMark.getLength() - 1 );
3527 if ( IsTOCBookmarkName( sMark ) )
3529 sMark = EnsureTOCBookmarkName(sMark);
3547 OSL_ENSURE(
false,
"Analysis still missing - unknown data" );
3556 OSL_ENSURE(!sURL.isEmpty() || !sMark.isEmpty(),
"WW8: Empty URL");
3558 if( !sMark.isEmpty() )
3559 sURL +=
"#" + sMark;
3565 OUString sLinkStyle(
"Index Link");
3566 sal_uInt16 nPoolId =
3584 sal_uInt16 nLevel = 1;
3586 OUString sFieldText;
3596 if( sFieldText.isEmpty() )
3606 const OUString sParams( aReadParam.
GetResult() );
3607 if( sParams[0]!=
'C' && sParams[0]!=
'c' )
3615 const OUString sParams( aReadParam.
GetResult() );
3617 if( !sParams.isEmpty() && sParams[0]>
'0' && sParams[0]<=
'9' )
3619 nLevel =
static_cast<sal_uInt16
>(sParams.toInt32());
3626 OSL_ENSURE( rDoc.
GetTOXTypeCount( eTox ),
"Doc.GetTOXTypeCount() == 0 :-(" );
3640 if( -1 != nScndFnd )
3645 sFieldText = sFieldText.copy( nFnd+1 );
3649 if (!sFieldText.isEmpty())
3658 bool bIdx = (nFieldId != 9);
3668 const int nChunk = 64;
3671 const static char *
aFieldNames[] = {
"\x06""INHALT",
"\x02""XE",
3673 const static sal_uInt8 aFieldId[] = { 9, 4, 9 };
3691 OUString sFieldName;
3692 sal_Int32 nFieldLen =
m_xSBase->WW8ReadString( *
m_pStrm, sFieldName, nStartCp,
3694 nStartCp+=nFieldLen;
3699 if( !nFieldLen || sFieldName[nC]!=0x13 )
3702 if( nFieldLen && sFieldName[nC]==0x15 )
3713 nFnd = sFieldName.indexOf(0x15);
3721 nStartCp+=nFieldLen;
3733 sFieldName = sFieldName.copy(0, nFnd);
3736 while ( sFieldName[nC]==
' ' )
3739 for(
int i = 0;
i < 3;
i++ )
3741 const char*
pName = aFieldNames[
i];
3742 const sal_Int32 nNameLen =
static_cast<sal_Int32
>(*pName++);
3743 if( sFieldName.matchIgnoreAsciiCaseAsciiL( pName, nNameLen, nC ) )
3745 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.
constexpr TypedWhichId< SwFormatPageDesc > RES_PAGEDESC(93)
std::unique_ptr< SwWW8FltControlStack > m_xCtrlStck
SVX_NUM_CHARS_UPPER_LETTER_N
bool bCodeNest
instruction used recursively
sal_uLong GetIndex() const
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)
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)
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 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)
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()
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)
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)
tools::Long GetLen() const
static LanguageType nLang
SwContentNode * GetContentNode(bool bPoint=true) const
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
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
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)
void Swap(WW8FieldEntry &rOther)
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)
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 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
bool SwFltGetFlag(sal_uLong nFieldFlags, int no)
SwContentNode * GetContentNode()
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.
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::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
std::unique_ptr< SfxPoolItem > pAttr
OUString GetFieldResult(WW8FieldDesc const *pF)
const SwGetSetExpType GSE_SEQ
Sequence.
sal_uInt32 GetHeight() const
static OUString GetWordDefaultDateStringAsUS(SvNumberFormatter *pFormatter, LanguageType nLang)
OUString BookmarkToWriter(const OUString &rBookmark)
SwFieldIds Which() const
ResId.
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
const o3tl::enumarray< SvxAdjust, unsigned short > aSvxToUnoAdjust USHRT_MAX
virtual bool InsertPoolItem(const SwPaM &rRg, const SfxPoolItem &, const SetAttrMode nFlags=SetAttrMode::DEFAULT, SwRootFrame const *pLayout=nullptr, bool bExpandCharToPara=false, SwTextAttr **ppNewTextAttr=nullptr)=0
Insert an attribute.
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 &)
eF_ResT Read_F_Input(WW8FieldDesc *, OUString &rStr)
eF_ResT Read_F_ANumber(WW8FieldDesc *, OUString &)
void SetInputFlag(bool bInp)
const SwPosition * End() const
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)
WW8FieldEntry(SwPosition const &rPos, sal_uInt16 nFieldId)
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
virtual void SetUpdateExpFieldStat(bool b)=0
OUString GetMappedBookmark(const OUString &rOrigName)
const SwGetSetExpType GSE_STRING
String.
wwSectionNamer m_aSectionNameGenerator
virtual SwFieldType * GetSysFieldType(const SwFieldIds eWhich) const =0
if(!pCandidateA->getEnd().equal(pCandidateB->getStart()))
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
WW8FieldEntry & operator=(const WW8FieldEntry &rOther)
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)