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>
84 #define MAX_FIELDLEN 64000
86 #define WW8_TOX_LEVEL_DELIM ':'
99 bool IsTOCBookmarkName(
const OUString& rName)
104 OUString EnsureTOCBookmarkName(
const OUString& rName)
106 OUString sTmp = rName;
107 if ( IsTOCBookmarkName ( rName ) )
122 OSL_ENSURE( pB,
"WW8PLCFx_Book - Pointer does not exist" );
142 pName->startsWithIgnoreAsciiCase(
"_Hlt" ) )
158 m_xSBase->WW8ReadString( *m_pStrm, aVal, pB->
GetStartPos(), nLen,
160 m_pStrm->Seek( nOldPos );
171 for( sal_Int32 nI = 0;
172 nI < aVal.getLength() && aVal.getLength() < (
MAX_FIELDLEN - 4);
183 aVal = aVal.replaceAt( nI, 1,
"\n" );
196 bSetAsHex = 0x20 > cChar;
203 OUString sTmp(
"\\x" );
206 sTmp += OUString::number( cChar, 16 );
207 aVal = aVal.replaceAt( nI, 1 , sTmp );
208 nI += sTmp.getLength() - 1;
220 if (!m_aFieldStack.empty())
227 m_xReffedStck->NewAttr( aStart,
228 SwFltBookmark( EnsureTOCBookmarkName( sOrigName ), aVal, pB->
GetHandle(), IsTOCBookmarkName( sOrigName ) ));
236 if (pAtnBook->getIsEnd())
248 if (pFactoidBook->getIsEnd())
249 m_xReffedStck->SetAttr(*m_pPaM->GetPoint(),
RES_FLTR_RDFMARK,
true, pFactoidBook->getHandle());
253 aMark.
SetHandle(pFactoidBook->getHandle());
254 GetSmartTagInfo(aMark);
255 m_xReffedStck->NewAttr(*m_pPaM->GetPoint(), aMark);
267 OUString
aName = rOrg.replaceAll(
"\\\\",
"\\");
268 aName = aName.replaceAll(
"%20",
" ");
271 if (aName.endsWith(
"\""))
272 aName = aName.copy(0, aName.getLength()-1);
275 if (!aName.isEmpty())
286 void ConvertUFName( OUString& rName )
294 ConvertUFName(rSequenceName);
295 if (
'0' <= rSequenceName[0] &&
'9' >= rSequenceName[0])
296 rSequenceName =
"_" + rSequenceName;
305 for( sal_Int32 nBuf = 0; nBuf+1 < rStr.getLength(); nBuf++ )
307 if( rStr[ nBuf ] ==
'"' )
311 && rStr[ nBuf ] ==
'\\'
312 && ( rStr[ nBuf + 1 ] == cToken
313 || rStr[ nBuf + 1 ] == cToken2 ) )
317 while( nBuf < rStr.getLength()
318 && rStr[ nBuf ] ==
' ' )
321 return nBuf < rStr.getLength() ? nBuf : -1;
338 || rStr[ n ] == 132 )
342 while( n2 < rStr.getLength()
344 && rStr[ n2 ] !=
'"' )
350 while( n2 < rStr.getLength()
351 && rStr[ n2 ] !=
' ' )
354 return rStr.copy( n, n2-n );
358 bool bAllowPageDesc =
false)
361 if( rStr.startsWithIgnoreAsciiCase(
"Arabi" ) )
363 else if( rStr.startsWith(
"misch" ) )
365 else if( rStr.startsWith(
"MISCH" ) )
367 else if( rStr.startsWithIgnoreAsciiCase(
"alphabeti" ) )
368 eTyp = ( rStr[0] ==
'A' )
371 else if( rStr.startsWithIgnoreAsciiCase(
"roman" ) )
372 eTyp = ( rStr[0] ==
'R' )
380 OUString s(
FindPara( rStr,
'*',
'*' ) );
391 OSL_ENSURE(pLang,
"impossible");
394 if (nLang != nDefault)
418 const sal_Int32
pos = sParams.indexOf(
"YYYY");
421 sParams = sParams.replaceFirst(
"YY",
"YYYY");
430 if (m_xPlcxMan && !m_bVer67)
432 SprmResult aResult = m_xPlcxMan->HasCharSprm(0x85A);
438 OSL_ENSURE(pLang,
"impossible");
442 OUString sParams(
FindPara( rStr,
'@',
'@' ) );
443 if (sParams.isEmpty())
445 bool bHasTime =
false;
446 switch (nWhichDefault)
451 sParams +=
" HH:MM:SS AM/PM";
455 sParams +=
"DD/MM/YYYY HH:MM:SS";
465 sParams =
"[~hijri]" + sParams;
467 sal_Int32 nCheckPos = 0;
471 OUString sTemp(sParams);
476 return bHasTime ? SvNumFormatType::DATETIME : SvNumFormatType::DATE;
484 nNumFormatType = pFormatter->
GetType(nFormatIdx);
485 rFormat = nFormatIdx;
487 return nNumFormatType;
503 OSL_ENSURE(pF,
"WW8PLCFx_FLD - Pointer not available");
511 OSL_ENSURE(!m_aFieldStack.empty(),
"Empty field stack");
512 if (!m_aFieldStack.empty())
519 nRet = m_aFieldStack.back().mnFieldId;
523 if (bUseEnhFields && m_pPaM!=
nullptr && m_pPaM->GetPoint()!=
nullptr) {
525 SwPaM aFieldPam( m_aFieldStack.back().GetPtNode(), m_aFieldStack.back().GetPtContent(), aEndPos.
nNode, aEndPos.
nContent.
GetIndex());
527 IFieldmark *pFieldmark = pMarksAccess->makeFieldBookmark(
528 aFieldPam, m_aFieldStack.back().GetBookmarkName(),
ODF_FORMTEXT,
530 OSL_ENSURE(pFieldmark!=
nullptr,
"hmmm; why was the bookmark not created?");
531 if (pFieldmark!=
nullptr) {
534 m_xRedlineStack->MoveAttrsFieldmarkInserted(*aFieldPam.Start());
536 pFieldmark->
GetParameters()->insert(rParametersToAdd.begin(), rParametersToAdd.end());
543 if (m_bLoadingTOXCache)
545 if (m_nEmbeddedTOXLevel > 0)
548 --m_nEmbeddedTOXLevel;
552 m_aTOXEndCps.insert(nCP);
553 m_bLoadingTOXCache =
false;
554 if ( m_pPaM->End() &&
555 m_pPaM->End()->nNode.GetNode().GetTextNode() &&
556 m_pPaM->End()->nNode.GetNode().GetTextNode()->Len() == 0 )
562 m_bCareLastParaEndInToc =
true;
567 *m_pPaM = *m_pPosAfterTOC;
568 m_pPosAfterTOC.reset();
574 if (m_bLoadingTOXCache && !m_bLoadingTOXHyperlink)
580 if (m_bLoadingTOXHyperlink)
581 m_bLoadingTOXHyperlink =
false;
587 *m_pPaM->GetPoint() = m_aFieldStack.back().maStartPos;
592 const OUString& fieldDefinition = m_aFieldStack.back().GetBookmarkCode();
594 OUString paramCondition;
603 static_cast<SwHiddenTextFieldType*>(pFieldType),
614 OUString aCode = m_aFieldStack.back().GetBookmarkCode();
615 if (!aCode.isEmpty() && !aCode.trim().startsWith(
"SHAPE"))
620 m_aFieldStack.back().GetPtNode(), m_aFieldStack.back().GetPtContent(),
625 IFieldmark* pFieldmark = pMarksAccess->makeFieldBookmark(
627 m_aFieldStack.back().GetBookmarkName(),
634 m_xRedlineStack->MoveAttrsFieldmarkInserted(*aFieldPam.Start());
636 pFieldmark->
GetParameters()->insert(rParametersToAdd.begin(), rParametersToAdd.end());
637 OUString sFieldId = OUString::number( m_aFieldStack.back().mnFieldId );
639 std::pair< OUString, uno::Any > (
641 uno::makeAny( sFieldId ) ) );
643 std::pair< OUString, uno::Any > (
645 uno::makeAny( aCode ) ) );
647 if ( m_aFieldStack.back().mnObjLocFc > 0 )
650 OUString sOleId =
"_" +
651 OUString::number( m_aFieldStack.back().mnObjLocFc );
657 uno::Reference< embed::XStorage > xDocStg = GetDoc().GetDocStorage();
660 uno::Reference< embed::XStorage > xOleStg = xDocStg->openStorageElement(
661 "OLELinks", embed::ElementModes::WRITE );
672 uno::Reference< embed::XTransactedObject > xTransact( xOleStg, uno::UNO_QUERY );
673 if ( xTransact.is() )
679 std::pair< OUString, uno::Any >(
687 m_aFieldStack.pop_back();
714 : maStartPos(rPos), mnFieldId(nFieldId), mnObjLocFc(0)
719 : maStartPos(rOther.maStartPos), mnFieldId(rOther.mnFieldId), mnObjLocFc(rOther.mnObjLocFc)
725 std::swap(maStartPos, rOther.maStartPos);
726 std::swap(mnFieldId, rOther.mnFieldId);
739 msBookmarkName=bookmarkName;
744 msMarkType=bookmarkType;
749 msMarkCode = bookmarkCode;
759 enum Limits {eMax = 96};
760 static const FNReadField aWW8FieldTab[eMax+1] =
862 OSL_ENSURE(
SAL_N_ELEMENTS( aWW8FieldTab ) == eMax+1,
"FieldFunc table not right" );
865 OSL_ENSURE(pF,
"WW8PLCFx_FLD - Pointer not available");
870 bool bNested =
false;
871 if (!m_aFieldStack.empty())
873 bNested = std::any_of(m_aFieldStack.cbegin(), m_aFieldStack.cend(),
880 OSL_ENSURE(bOk,
"WW8: Bad Field!");
883 if ( aF.
nId == 6 ) bCodeNest =
false;
884 if (aF.
nId == 70) bCodeNest =
false;
886 m_aFieldStack.emplace_back(*m_pPaM->GetPoint(), aF.
nId);
891 sal_uInt16
n = (aF.
nId <= eMax) ? aF.
nId : static_cast<sal_uInt16>(eMax);
892 sal_uInt16 nI = n / 32;
893 sal_uInt32 nMask = 1 << ( n % 32 );
901 if( m_nFieldTagAlways[nI] & nMask )
902 return Read_F_Tag( &aF );
904 if( !bOk || !aF.
nId )
907 if( aF.
nId > eMax - 1)
909 if( m_nFieldTagBad[nI] & nMask )
910 return Read_F_Tag( &aF );
916 if (aF.
nId != 88 && m_xPlcxMan->GetDoingDrawTextBox())
919 bool bHasHandler = aWW8FieldTab[aF.
nId] !=
nullptr;
924 sal_uInt64 nOldPos = m_pStrm->Tell();
926 aF.
nLCode = m_xSBase->WW8ReadString(*m_pStrm, aStr, m_xPlcxMan->GetCpOfs() + aF.
nSCode, aF.
nLCode, m_eTextCharSet);
927 m_pStrm->Seek(nOldPos);
931 if (nRet == -2 && !aReadParam.
GetResult().isEmpty())
933 bHasHandler = rtl::isAsciiDigit(aReadParam.
GetResult()[0]);
940 bHasHandler = nRet < 0 || nRet ==
'*';
945 if (!bHasHandler || bCodeNest)
947 if( m_nFieldTagBad[nI] & nMask )
948 return Read_F_Tag( &aF );
955 aF.
nLCode = m_xSBase->WW8ReadString( *m_pStrm, aStr, m_xPlcxMan->GetCpOfs()+
957 m_pStrm->Seek( nOldPos );
961 const sal_Int32 nDotPos = aStr.indexOf(
'.');
962 const sal_Int32 nSlashPos = aStr.indexOf(
'/');
963 sal_Int32 nSpacePos = aStr.indexOf(
' ', 1 );
965 nSpacePos = aStr.getLength();
967 if ( ( aStr.getLength() <= 1 || aStr[1] !=
'=') &&
968 (( nDotPos>=0 && nDotPos < nSpacePos ) ||
969 ( nSlashPos>=0 && nSlashPos < nSpacePos )))
978 m_aFieldStack.back().SetBookmarkCode( aStr );
984 auto nOldPos = m_pStrm->Tell();
986 if ( aF.nId == 6 && aF.bCodeNest )
989 aF.nLCode = m_xSBase->WW8ReadString( *m_pStrm, aStr, m_xPlcxMan->GetCpOfs() +
990 aF.nSCode, aF.nSRes - aF.nSCode - 1, m_eTextCharSet );
994 aF.nLCode = m_xSBase->WW8ReadString( *m_pStrm, aStr, m_xPlcxMan->GetCpOfs()+
995 aF.nSCode, aF.nLCode, m_eTextCharSet );
1002 aStr = aStr.replaceAll(
"\x01",
"");
1005 eF_ResT eRes = (this->*aWW8FieldTab[aF.nId])( &aF, aStr );
1006 m_pStrm->Seek(nOldPos);
1017 return aF.nLen - aF.nLRes - 2;
1021 if ( m_nFieldTagBad[nI] & nMask )
1022 return Read_F_Tag( &aF );
1025 return aF.nLen - aF.nLRes - 2;
1044 for( sal_Int32 nI = 0;
1045 nI < rStr.getLength() && rStr.getLength() < (
MAX_FIELDLEN - 4); ++nI )
1047 bool bSetAsHex =
false;
1054 rStr = rStr.replaceAt( nI, 1,
"\"" );
1057 rStr = rStr.replaceAt( nI, 1,
"{" );
1060 rStr = rStr.replaceAt( nI, 1,
"|" );
1063 rStr = rStr.replaceAt( nI, 1,
"}" );
1069 rStr = rStr.replaceAt( nI, 0,
"\\" );
1076 rStr = rStr.replaceAt( nI, 1,
"\n" );
1085 bSetAsHex = 0x20 > cChar;
1092 OUString sTmp(
"\\x" );
1095 sTmp += OUString::number( cChar, 16 );
1096 rStr = rStr.replaceAt( nI, 1 , sTmp );
1097 nI += sTmp.getLength() - 1;
1107 OUString
aName(
"WwFieldTag");
1109 aName += OUString::number( nId );
1122 SwSetExpField aField( static_cast<SwSetExpFieldType*>(pFT), rTagText );
1140 m_xSBase->WW8ReadString( *m_pStrm, sFText,
1141 m_xPlcxMan->GetCpOfs() + nStart, nL, m_eStructCharSet);
1144 MakeTagString( aTagText, sFText );
1145 InsertTagField( pF->
nId, aTagText );
1147 m_pStrm->Seek( nOldPos );
1176 if( aDef.isEmpty() )
1177 aDef = GetFieldResult( pF );
1179 if ( pF->
nId != 0x01 )
1182 aDef, aQ,
INP_TXT, 0,
false );
1204 m_xSBase->WW8ReadString( *m_pStrm, sRes, m_xPlcxMan->GetCpOfs() + nStart,
1205 nL, m_eStructCharSet );
1207 m_pStrm->Seek( nOldPos );
1212 OUStringBuffer buf(sRes.getLength());
1213 for (sal_Int32
i = 0;
i < sRes.getLength(); ++
i)
1233 SAL_INFO(
"sw.ww8",
"GetFieldResult(): filtering control character");
1238 return buf.makeStringAndClear();
1281 OUString &rOrigName,
const OUString &rData)
1283 OSL_ENSURE(m_xPlcxMan,
"No pPlcxMan");
1290 m_xPlcxMan->GetBook()->MapName(rOrigName);
1291 OUString
sName = m_xPlcxMan->GetBook()->GetBookmark(
1293 if (!sName.isEmpty())
1295 m_xPlcxMan->GetBook()->SetStatus(nIndex,
BOOK_IGNORE);
1300 nNo = m_xReffingStck->aFieldVarNames.size()+1;
1301 sName =
"WWSetBkmk" + OUString::number(nNo);
1302 nNo += m_xPlcxMan->GetBook()->GetIMax();
1304 m_xReffedStck->NewAttr(*m_pPaM->GetPoint(),
1306 m_xReffingStck->aFieldVarNames[rOrigName] = sName;
1328 std::map<OUString, OUString, SwWW8::ltstr>::const_iterator
1329 aResult = aFieldVarNames.find(sName);
1331 if (aResult != aFieldVarNames.end())
1346 OSL_ENSURE(m_xPlcxMan,
"no pPlcxMan");
1347 m_xPlcxMan->GetBook()->MapName(sName);
1351 std::map<OUString, OUString, SwWW8::ltstr>::const_iterator aResult =
1352 m_xReffingStck->aFieldVarNames.find(sName);
1354 return (aResult == m_xReffingStck->aFieldVarNames.end())
1355 ? sName : (*aResult).second;
1361 OUString sOrigName, aQ;
1372 if (sOrigName.isEmpty())
1374 else if (aQ.isEmpty())
1385 if (sOrigName.isEmpty())
1388 const OUString aResult(GetFieldResult(pF));
1392 if (!aDef.isEmpty())
1399 const tools::Long nNo = MapBookmarkVariables(pF, sOrigName, aResult);
1417 if( !m_pNumFieldType ){
1421 SwSetExpField aField( static_cast<SwSetExpFieldType*>(m_pNumFieldType), OUString(),
1423 aField.
SetValue( ++m_nFieldNum,
nullptr );
1431 OUString aSequenceName;
1433 bool bHidden =
false;
1434 bool bFormat =
false;
1435 bool bCountOn =
true;
1447 if( aSequenceName.isEmpty() )
1449 else if( aBook.isEmpty() )
1485 if (aSequenceName.isEmpty() && aBook.isEmpty())
1496 if (!sStart.isEmpty())
1497 aField.
SetFormula( aSequenceName +
"=" + sStart );
1513 OUString aResult = aReadParam.
GetResult();
1514 sal_Int32 nResult = aResult.toInt32();
1531 bool bDateTime =
false;
1535 OUString aDocProperty;
1545 if( aDocProperty.isEmpty() )
1555 aDocProperty = aDocProperty.replaceAll(
"\"",
"");
1565 static const char* aName10 =
"\x0F";
1566 static const char* aName11
1568 static const char* aName12
1570 static const char* aName13
1572 static const char* aName14
1574 static const char* aName20 =
"\x15";
1575 static const char* aName21
1577 static const char* aName22
1579 static const char* aName23
1581 static const char* aName24
1583 static const char* aName30 =
"\x16";
1584 static const char* aName31
1585 =
"ZULETZTGESPEICHERTZEIT";
1586 static const char* aName32
1587 =
"DERNIERENREGISTREMENT";
1588 static const char* aName33
1590 static const char* aName34
1592 static const char* aName40 =
"\x17";
1593 static const char* aName41
1594 =
"ZULETZTGEDRUCKT";
1595 static const char* aName42
1596 =
"DERNI\xC8" "REIMPRESSION";
1597 static const char* aName43
1599 static const char* aName44
1601 static const char* aName50 =
"\x18";
1602 static const char* aName51
1603 =
"\xDC" "BERARBEITUNGSNUMMER";
1604 static const char* aName52
1605 =
"NUM\xC9" "RODEREVISION";
1606 static const char* aName53
1608 static const char* aName54
1610 static const sal_uInt16 nFieldCnt = 5;
1614 static const sal_uInt16 nLangCnt = 4;
1615 static const char *aNameSet_26[nFieldCnt][nLangCnt+1] =
1617 {aName10, aName11, aName12, aName13, aName14},
1618 {aName20, aName21, aName22, aName23, aName24},
1619 {aName30, aName31, aName32, aName33, aName34},
1620 {aName40, aName41, aName42, aName43, aName44},
1621 {aName50, aName51, aName52, aName53, aName54}
1624 bool bFieldFound=
false;
1626 for(sal_uInt16 nLIdx=1; !bFieldFound && (nLangCnt > nLIdx); ++nLIdx)
1628 for(nFIdx = 0; !bFieldFound && (nFieldCnt > nFIdx); ++nFIdx)
1630 if( aDocProperty == OUString( aNameSet_26[nFIdx][nLIdx], strlen(aNameSet_26[nFIdx][nLIdx]),
1631 RTL_TEXTENCODING_MS_1252 ) )
1634 pF->
nId = aNameSet_26[nFIdx][0][0];
1699 sal_uInt32 nFormat = 0;
1707 case SvNumFormatType::DATE:
1710 case SvNumFormatType::TIME:
1713 case SvNumFormatType::DATETIME:
1724 if ( 64 == pF->
nId )
1735 if( aData.isEmpty() )
1745 aData = aData.replaceAll(
"\"",
"");
1751 ForceFieldLanguage(aField, nLang);
1778 bool bHijri =
false;
1800 sal_uInt32 nFormat = 0;
1805 if( SvNumFormatType::UNDEFINED == nDT )
1809 nDT = SvNumFormatType::TIME;
1815 nDT = SvNumFormatType::DATE;
1821 if (nDT & SvNumFormatType::DATE)
1825 ForceFieldLanguage(aField, nLang);
1828 else if (nDT == SvNumFormatType::TIME)
1832 ForceFieldLanguage(aField, nLang);
1858 OSL_ENSURE(
false,
"unknown option in FileName field");
1873 case 27: nSub =
DS_WORD;
break;
1874 case 28: nSub =
DS_CHAR;
break;
1899 sal_Int32 nSize = 0;
1921 const OUString aSiz = aReadParam.
GetResult();
1922 if (!aSiz.isEmpty())
1924 bool bFail = o3tl::checked_multiply<sal_Int32>(aSiz.toInt32(), 20, nSize);
1938 if (!aName.isEmpty())
1955 if (!aName.isEmpty())
1987 if( m_bObj && m_nPicLocFc )
1988 m_nObjLocFc = m_nPicLocFc;
1989 m_bEmbeddObj =
true;
2007 if (sOrigName.isEmpty())
2009 else if (sVal.isEmpty())
2015 const tools::Long nNo = MapBookmarkVariables(pF, sOrigName, sVal);
2019 SwSetExpField aField( static_cast<SwSetExpFieldType*>(pFT), sVal, ULONG_MAX );
2032 OUString sOrigBkmName;
2044 if( sOrigBkmName.isEmpty() )
2079 OUString sBkmName(GetMappedBookmark(sOrigBkmName));
2083 if ( IsTOCBookmarkName( sBkmName ) )
2085 sBkmName = EnsureTOCBookmarkName(sBkmName);
2087 m_xReffedStck->aReferencedTOCBookmarks.insert( sBkmName );
2102 m_xReffingStck->NewAttr( *m_pPaM->GetPoint(),
SwFormatField(aField) );
2116 bool bAboveBelow =
false;
2127 if( aBkmName.isEmpty() )
2149 m_xReffingStck->NewAttr(*m_pPaM->GetPoint(),
SwFormatField(aField));
2156 m_xReffingStck->NewAttr(*m_pPaM->GetPoint(),
SwFormatField(aField2));
2172 else if ( nRet == -2 && sOrigName.isEmpty() )
2178 const OUString
sName(GetMappedBookmark(sOrigName));
2181 if (m_bLoadingTOXCache)
2186 if (!m_bLoadingTOXHyperlink && !sName.isEmpty())
2190 OUString sBookmarkName;
2191 if ( IsTOCBookmarkName( sName ) )
2193 sBookmarkName = EnsureTOCBookmarkName(sName);
2195 m_xReffedStck->aReferencedTOCBookmarks.insert( sBookmarkName );
2199 sBookmarkName = sName;
2201 OUString sURL =
"#" + sBookmarkName;
2203 const OUString sLinkStyle(
"Index Link");
2204 const sal_uInt16 nPoolId =
2208 m_xCtrlStck->NewAttr( *m_pPaM->GetPoint(), aURL );
2215 OUString sPageRefBookmarkName;
2216 if ( IsTOCBookmarkName( sName ) )
2218 sPageRefBookmarkName = EnsureTOCBookmarkName(sName);
2220 m_xReffedStck->aReferencedTOCBookmarks.insert( sPageRefBookmarkName );
2224 sPageRefBookmarkName = sName;
2238 bool bConverted =
false;
2239 if( rReference ==
"(" )
2243 if (rName ==
u"CheckIt")
2245 else if (rName ==
u"UncheckIt")
2247 else if (rName ==
u"ShowExample")
2254 rReference = OUString(cSymbol);
2264 bool bNewVText =
true;
2265 bool bBracket =
false;
2268 sal_Int32 nOffset = 0;
2278 if( aName.isEmpty() )
2280 else if( aVText.isEmpty() || bBracket )
2289 bBracket = (aVText[0] ==
'[');
2292 else if( aVText.endsWith(
"]") )
2298 if( aName.isEmpty() )
2301 NotifyMacroEventRead();
2305 aName =
"StarOffice.Standard.Modul1." + aName;
2310 if( !bApplyWingdings )
2314 WW8_CP nOldCp = m_xPlcxMan->Where();
2315 WW8_CP nCp = nOldCp + nOffset;
2317 SwPaM aPaM(*m_pPaM, m_pPaM);
2328 for ( ; i < m_xFonts->GetMax(); i++ )
2333 rtl_TextEncoding eSrcCharSet;
2334 if( GetFontParams( i, eFamily, aFontName, ePitch, eSrcCharSet )
2335 && aFontName==
"Wingdings" )
2341 if ( i < m_xFonts->GetMax() )
2357 , mnCpStart(nCpStart)
2359 , mPaM(*rPaM.GetMark(), *rPaM.GetPoint())
2366 bool bUseRemote =
false;
2371 uno::Reference< task::XInteractionHandler > xIH(
2374 uno::Reference< ucb::XProgressHandler > xProgress;
2379 static_cast< ucb::XCommandEnvironment* >(pCommandEnv),
2386 bUseRemote = !aTitle.isEmpty();
2392 OUString aMediaType;
2394 bUseRemote = !aMediaType.isEmpty();
2409 bool bEmbedded =
true;
2420 if (aGrfName.isEmpty())
2452 aFlySet.Put(
SwFormatVertOrient( 0, text::VertOrientation::TOP, text::RelOrientation::FRAME ));
2486 if( aPara.isEmpty() )
2488 else if( aBook.isEmpty() )
2499 if (!aBook.isEmpty() && aBook[ 0 ] !=
'\\')
2502 ConvertUFName(aBook);
2518 aSection.SetProtectFlag(
true);
2522 OSL_ENSURE(pSection,
"no section inserted");
2526 OSL_ENSURE(pSectionNode,
"no section node!");
2543 #if !HAVE_FEATURE_DBCONNECTIVITY
2557 if( aName.isEmpty() )
2565 SwDBField aField( static_cast<SwDBFieldType*>(pFT) );
2572 aResult = aResult.replace(
'\xb',
'\n' );
2584 #if HAVE_FEATURE_DBCONNECTIVITY
2587 SwDBNextSetField aField( static_cast<SwDBNextSetFieldType*>(pFT), OUString(),
2597 #if HAVE_FEATURE_DBCONNECTIVITY
2620 if (
'o' == cChar ||
'O' == cChar)
2624 if (aResult.
sType ==
"Input")
2630 else if (aResult.
sType ==
"CombinedCharacters")
2637 else if (
'*' == cChar)
2645 sal_uInt16 nJustificationCode=0;
2647 sal_uInt32 nFontSize=0;
2659 OUString sTemp = rReadParam.
GetResult();
2660 if( sTemp.startsWithIgnoreAsciiCase(
"jc" ) )
2662 sTemp = sTemp.copy(2);
2663 nJustificationCode =
static_cast<sal_uInt16
>(sTemp.toInt32());
2665 else if( sTemp.startsWithIgnoreAsciiCase(
"hps" ) )
2667 sTemp = sTemp.copy(3);
2668 nFontSize=
static_cast<sal_uInt32
>(sTemp.toInt32());
2670 else if( sTemp.startsWithIgnoreAsciiCase(
"Font:" ) )
2672 sTemp = sTemp.copy(5);
2688 rReadParam.
GetResult().startsWithIgnoreAsciiCase(
"p"))
2692 OUString sPart = rReadParam.
GetResult();
2693 sal_Int32 nBegin = sPart.indexOf(
'(');
2696 sal_Int32 nEnd = sPart.indexOf(
')');
2698 if ((nBegin != -1) &&
2699 (nEnd != -1) && (nBegin < nEnd))
2701 sRuby = sPart.copy(nBegin+1,nEnd-nBegin-1);
2705 nBegin = sPart.indexOf(
',',nEnd);
2708 nBegin = sPart.indexOf(
';',nEnd);
2710 nEnd = sPart.lastIndexOf(
')');
2712 if ((nBegin != -1) && (nEnd != -1) && (nBegin < nEnd))
2714 sText = sPart.copy(nBegin+1,nEnd-nBegin-1);
2726 if (sRuby.isEmpty() || sText.isEmpty() || sFontName.isEmpty() || !nFontSize)
2729 css::text::RubyAdjust eRubyAdjust;
2730 switch (nJustificationCode)
2733 eRubyAdjust = css::text::RubyAdjust_CENTER;
2736 eRubyAdjust = css::text::RubyAdjust_BLOCK;
2739 eRubyAdjust = css::text::RubyAdjust_INDENT_BLOCK;
2743 eRubyAdjust = css::text::RubyAdjust_LEFT;
2746 eRubyAdjust = css::text::RubyAdjust_RIGHT;
2760 ItemGet<SvxFontHeightItem>(*rpCharFormat,
2764 const SvxFontItem &rF = ItemGet<SvxFontItem>(*rpCharFormat,
2768 pCharFormat = rpCharFormat;
2780 aNm+=OUString::number(m_aRubyCharFormats.size()+1);
2787 pFormat->SetFormatAttr(aHeightItem);
2788 pFormat->SetFormatAttr(aFontItem);
2789 m_aRubyCharFormats.push_back(pFormat);
2790 pCharFormat = pFormat;
2817 OUString sSeqName( rParam.
GetResult() );
2833 for (sal_uInt16 nI =
MAXLEVEL; nI > 0; --nI)
2851 if( sParams.isEmpty() )
2858 OUString sTemplate( sParams.getToken(0,
';', nIndex) );
2862 sTemplate = sParams.getToken(0,
',', nIndex);
2868 sTemplate = pStyle->
GetName();
2872 else while( -1 != nIndex )
2874 sal_Int32 nOldIndex=nIndex;
2875 sal_uInt16 nLevel =
static_cast<sal_uInt16
>(
2876 sParams.getToken(0,
';', nIndex).toInt32());
2880 nLevel =
static_cast<sal_uInt16
>(
2881 sParams.getToken(0,
',', nIndex).toInt32());
2884 if( (0 < nLevel) && (
MAXLEVEL >= nLevel) )
2892 sTemplate = pStyle->
GetName();
2895 if( !sStyles.isEmpty() )
2897 sStyles += sTemplate;
2902 sTemplate = sParams.getToken(0,
';', nIndex);
2906 sTemplate = sParams.getToken(0,
',', nIndex);
2913 sal_uInt16 nIndexCols = 1;
2915 nIndexCols =
maSegments.back().maSep.ccolM1 + 1;
2981 sal_uInt16 nIndexCols = 1;
2985 std::shared_ptr<SwTOXBase> pBase = std::make_shared<SwTOXBase>( pType, aOrigForm, nCreateOf, OUString() );
3007 const OUString sParams( aReadParam.
GetResult() );
3009 if( !sParams.isEmpty() )
3011 nIndexCols =
static_cast<sal_uInt16
>(sParams.toInt32());
3019 OUString sDelimiter( aReadParam.
GetResult() );
3020 SwForm aForm( pBase->GetTOXForm() );
3026 for(sal_uInt16 nLevel = 1;
3038 aForm.GetPattern(nLevel);
3039 SwFormTokens::iterator aIt = aPattern.begin();
3042 eType = ++aIt == aPattern.end() ?
TOKEN_END : aIt->eTokenType;
3050 if(0x09 == sDelimiter[0])
3051 aIt->eTabAlign = SvxTabAdjust::End;
3055 aToken.
sText = sDelimiter;
3058 aForm.SetPattern(nLevel, aPattern);
3069 pBase->SetTOXForm( aForm );
3080 pBase->SetOptions( eOptions );
3086 bool bIsHyperlink =
false;
3092 sal_Int32 nMaxLevel = 0;
3102 bIsHyperlink =
true;
3116 if( nMaxLevel < nVal )
3129 if( nMaxLevel < nVal )
3144 OUString sDelimiter( aReadParam.
GetResult() );
3145 SwForm aForm( pBase->GetTOXForm() );
3151 for(sal_uInt16 nLevel = 1;
3164 SwFormTokens::iterator aIt = aPattern.begin();
3167 eType = ++aIt == aPattern.end() ?
TOKEN_END : aIt->eTokenType;
3176 aToken.
sText = sDelimiter;
3179 aForm.SetPattern(nLevel,
3189 pBase->SetTOXForm( aForm );
3196 sal_Int32 nStart(0);
3202 nEnd = aOrigForm.GetFormMax()-1;
3205 SwForm aForm( pBase->GetTOXForm() );
3206 if (aForm.GetFormMax() <= nEnd)
3208 for ( sal_Int32 nLevel = nStart; nLevel<=nEnd; ++nLevel )
3217 SwFormTokens::iterator aIt = aPattern.begin();
3220 eType = ++aIt == aPattern.end() ?
TOKEN_END : aIt->eTokenType;
3224 aIt = aPattern.erase(aIt);
3231 aPattern.erase(aIt);
3232 aForm.SetPattern(nLevel, aPattern);
3240 pBase->SetTOXForm( aForm );
3261 SwForm aForm(pBase->GetTOXForm());
3264 for(sal_uInt16 nLevel = 1; nLevel <= nEnd; ++nLevel)
3269 aPattern.insert(aPattern.begin(), aLinkStart);
3273 auto aItr = std::find_if(aPattern.begin(), aPattern.end(),
3275 if (aItr != aPattern.end())
3276 aPattern.insert(aItr, aLinkStart);
3278 aPattern.push_back(aLinkEnd);
3279 aForm.SetPattern(nLevel, aPattern);
3281 pBase->SetTOXForm(aForm);
3285 pBase->SetLevel(nMaxLevel);
3301 std::unique_ptr<SwForm> pForm;
3304 if (rSI.IsOutlineNumbered())
3306 sal_uInt16 nStyleLevel = rSI.mnWW8OutlineLevel;
3307 const SwNumFormat& rFormat = rSI.GetOutlineNumrule()->Get( nStyleLevel );
3313 pForm.reset(
new SwForm( pBase->GetTOXForm() ));
3315 SwFormTokens aPattern = pForm->GetPattern(nStyleLevel);
3316 SwFormTokens::iterator aIt =
3317 find_if(aPattern.begin(), aPattern.end(),
3320 if ( aIt != aPattern.end() )
3323 aNumberEntrySeparator.
sText =
" ";
3324 aPattern.insert( ++aIt, aNumberEntrySeparator );
3325 pForm->SetPattern( nStyleLevel, aPattern );
3332 pBase->SetTOXForm( *pForm );
3337 pBase->SetCreate(eCreateFrom);
3345 pBase->SetCreate( eCreateFrom );
3356 SwForm aOldForm( pBase->GetTOXForm() );
3357 SwForm aNewForm( eType );
3358 sal_uInt16 nNewEnd = aNewForm.GetFormMax()-1;
3361 for(sal_uInt16 nLevel = 1; nLevel <= nNewEnd; ++nLevel)
3364 SwFormTokens::iterator new_end =
3366 aPattern.erase(new_end, aPattern.end() );
3367 aForm.SetPattern( nLevel, aPattern );
3368 aForm.SetTemplate( nLevel, aOldForm.GetTemplate(nLevel) );
3371 pBase->SetTOXForm( aNewForm );
3375 OSL_ENSURE(
false,
"Unhandled toc options!");
3383 OSL_ENSURE(
false,
"Unhandled toc options!");
3388 pBase->AdjustTabStops(
m_rDoc );
3408 const SfxItemSet* pSet = pNd->GetpSwAttrSet();
3437 pBase2->SetMSTOCExpression(rStr);
3439 if ( nIndexCols > 1 )
3446 pBase2->SetAttrSet( aSet );
3478 OUString sURL, sTarget, sMark;
3483 bool bOptions =
false;
3493 if (sURL.isEmpty() && !bOptions)
3507 if( sMark.endsWith(
"\""))
3509 sMark = sMark.copy( 0, sMark.getLength() - 1 );
3512 if ( IsTOCBookmarkName( sMark ) )
3514 sMark = EnsureTOCBookmarkName(sMark);
3532 OSL_ENSURE(
false,
"Analysis still missing - unknown data" );
3541 OSL_ENSURE(!sURL.isEmpty() || !sMark.isEmpty(),
"WW8: Empty URL");
3543 if( !sMark.isEmpty() )
3544 sURL +=
"#" + sMark;
3550 OUString sLinkStyle(
"Index Link");
3551 sal_uInt16 nPoolId =
3569 sal_uInt16 nLevel = 1;
3571 OUString sFieldText;
3581 if( sFieldText.isEmpty() )
3591 const OUString sParams( aReadParam.
GetResult() );
3592 if( sParams[0]!=
'C' && sParams[0]!=
'c' )
3600 const OUString sParams( aReadParam.
GetResult() );
3602 if( !sParams.isEmpty() && sParams[0]>
'0' && sParams[0]<=
'9' )
3604 nLevel =
static_cast<sal_uInt16
>(sParams.toInt32());
3611 OSL_ENSURE( rDoc.
GetTOXTypeCount( eTox ),
"Doc.GetTOXTypeCount() == 0 :-(" );
3625 if( -1 != nScndFnd )
3630 sFieldText = sFieldText.copy( nFnd+1 );
3634 if (!sFieldText.isEmpty())
3643 bool bIdx = (nFieldId != 9);
3653 const int nChunk = 64;
3656 const static char *
aFieldNames[] = {
"\x06""INHALT",
"\x02""XE",
3658 const static sal_uInt8 aFieldId[] = { 9, 4, 9 };
3676 OUString sFieldName;
3677 sal_Int32 nFieldLen =
m_xSBase->WW8ReadString( *
m_pStrm, sFieldName, nStartCp,
3679 nStartCp+=nFieldLen;
3684 if( !nFieldLen || sFieldName[nC]!=0x13 )
3687 if( nFieldLen && sFieldName[nC]==0x15 )
3698 nFnd = sFieldName.indexOf(0x15);
3706 nStartCp+=nFieldLen;
3718 sFieldName = sFieldName.copy(0, nFnd);
3721 while ( sFieldName[nC]==
' ' )
3724 for(
int i = 0;
i < 3;
i++ )
3726 const char*
pName = aFieldNames[
i];
3727 const sal_Int32 nNameLen =
static_cast<sal_Int32
>(*pName++);
3728 if( sFieldName.matchIgnoreAsciiCaseAsciiL( pName, nNameLen, nC ) )
3730 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
constexpr TypedWhichId< SwFltRDFMark > RES_FLTR_RDFMARK(194)
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< CntUInt16Item > RES_FLTR_ANNOTATIONMARK(193)
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.
OUString GetUniqueSectionName(const OUString *pChkStr=nullptr) const
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)
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)
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)
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
constexpr sal_uInt16 RES_FRMATR_END(131)
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)
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)
constexpr TypedWhichId< SwFltTOX > RES_FLTR_TOX(191)
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)