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>
84#include <osl/diagnose.h>
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" ) )
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;
232 SwFltBookmark( EnsureTOCBookmarkName( sOrigName ), aVal, pB->
GetHandle(), IsTOCBookmarkName( sOrigName ) ));
240 if (pAtnBook->getIsEnd())
252 if (pFactoidBook->getIsEnd())
257 aMark.
SetHandle(pFactoidBook->getHandle());
271 OUString
aName = rOrg.replaceAll(
"\\\\",
"\\");
275 if (
aName.endsWith(
"\""))
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(
size_t nBuf = 0; nBuf+1 <
aStr.size(); nBuf++ )
311 if(
aStr[ nBuf ] ==
'"' )
315 &&
aStr[ nBuf ] ==
'\\'
316 && (
aStr[ nBuf + 1 ] == cToken
317 ||
aStr[ nBuf + 1 ] == cToken2 ) )
321 while( nBuf <
aStr.size()
322 &&
aStr[ nBuf ] ==
' ' )
325 return nBuf <
aStr.size() ? nBuf : -1;
342 ||
aStr[
n ] == 132 )
346 while(
n2 < sal_Int32(
aStr.size())
354 while(
n2 < sal_Int32(
aStr.size())
358 return OUString(
aStr.substr(
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' )
398 OSL_ENSURE(pLang,
"impossible");
401 if (
nLang != nDefault)
425 const sal_Int32
pos = sParams.indexOf(
"YYYY");
428 sParams = sParams.replaceFirst(
"YY",
"YYYY");
445 OSL_ENSURE(pLang,
"impossible");
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;
511 SwNode *
const pFinalNode(rNodes[nEndNode]);
524 OSL_ENSURE(pF,
"WW8PLCFx_FLD - Pointer not available");
551 aFieldPam.
Start() ) :
nullptr;
552 OSL_ENSURE(pFieldmark!=
nullptr,
"hmmm; why was the bookmark not created?");
553 if (pFieldmark!=
nullptr) {
557 const IFieldmark::parameter_map_t& rParametersToAdd =
m_aFieldStack.back().getParameters();
558 pFieldmark->GetParameters()->insert(rParametersToAdd.begin(), rParametersToAdd.end());
613 sal_Int32 nMaxValidIndex = pNd ? pNd->
Len() : 0;
616 SAL_WARN(
"sw.ww8",
"Attempt to restore to invalid content position");
626 OUString fieldDefinition =
m_aFieldStack.back().GetBookmarkCode();
628 OUString paramCondition;
635 sal_Int32 nLastIndex = fieldDefinition.lastIndexOf(
"\\*");
636 sal_Int32 nOtherIndex = fieldDefinition.lastIndexOf(
"\\#");
637 if (nOtherIndex > 0 && (nOtherIndex < nLastIndex || nLastIndex < 0))
638 nLastIndex = nOtherIndex;
639 nOtherIndex = fieldDefinition.lastIndexOf(
"\\@");
640 if (nOtherIndex > 0 && (nOtherIndex < nLastIndex || nLastIndex < 0))
641 nLastIndex = nOtherIndex;
642 nOtherIndex = fieldDefinition.lastIndexOf(
"\\!");
643 if (nOtherIndex > 0 && (nOtherIndex < nLastIndex || nLastIndex < 0))
644 nLastIndex = nOtherIndex;
646 fieldDefinition = fieldDefinition.copy(0, nLastIndex);
685 const IFieldmark::parameter_map_t& rParametersToAdd =
m_aFieldStack.back().getParameters();
686 pFieldmark->GetParameters()->insert(rParametersToAdd.begin(), rParametersToAdd.end());
687 OUString sFieldId = OUString::number(
m_aFieldStack.back().mnFieldId );
688 pFieldmark->GetParameters()->insert(
689 std::pair< OUString, uno::Any > (
692 pFieldmark->GetParameters()->insert(
693 std::pair< OUString, uno::Any > (
700 OUString sOleId =
"_" +
710 uno::Reference< embed::XStorage > xOleStg = xDocStg->openStorageElement(
711 "OLELinks", embed::ElementModes::WRITE );
716 xSrc1->CopyTo( xObjDst.
get() );
718 if ( !xObjDst->GetError() )
722 uno::Reference< embed::XTransactedObject > xTransact( xOleStg, uno::UNO_QUERY );
723 if ( xTransact.is() )
728 pFieldmark->GetParameters()->insert(
729 std::pair< OUString, uno::Any >(
764 : maStartPos(rPos), mnFieldId(nFieldId), mnObjLocFc(0)
769 : maStartPos(rOther.maStartPos), mnFieldId(rOther.mnFieldId), mnObjLocFc(rOther.mnObjLocFc)
775 std::swap(maStartPos, rOther.maStartPos);
776 std::swap(mnFieldId, rOther.mnFieldId);
809 enum Limits {eMax = 96};
810 static const FNReadField aWW8FieldTab[eMax+1] =
912 OSL_ENSURE(
SAL_N_ELEMENTS( aWW8FieldTab ) == eMax+1,
"FieldFunc table not right" );
915 OSL_ENSURE(pF,
"WW8PLCFx_FLD - Pointer not available");
920 bool bNested =
false;
924 [](
const WW8FieldEntry& aField) { return !AcceptableNestedField(aField.mnFieldId); });
930 OSL_ENSURE(bOk,
"WW8: Bad Field!");
933 if ( aF.
nId == 6 ) bCodeNest =
false;
934 if (aF.
nId == 70) bCodeNest =
false;
941 sal_uInt16
n = (aF.
nId <= eMax) ? aF.
nId : o3tl::narrowing<sal_uInt16>(eMax);
942 sal_uInt16 nI =
n / 32;
943 sal_uInt32 nMask = 1 << (
n % 32 );
954 if( !bOk || !aF.
nId )
957 if( aF.
nId > eMax - 1)
969 bool bHasHandler = aWW8FieldTab[aF.
nId] !=
nullptr;
981 if (nRet == -2 && !aReadParam.
GetResult().isEmpty())
983 bHasHandler = rtl::isAsciiDigit(aReadParam.
GetResult()[0]);
990 bHasHandler = nRet < 0 || nRet ==
'*';
995 if (!bHasHandler || bCodeNest)
1011 const sal_Int32 nDotPos =
aStr.indexOf(
'.');
1012 const sal_Int32 nSlashPos =
aStr.indexOf(
'/');
1013 sal_Int32 nSpacePos =
aStr.indexOf(
' ', 1 );
1015 nSpacePos =
aStr.getLength();
1017 if ( (
aStr.getLength() <= 1 ||
aStr[1] !=
'=') &&
1018 (( nDotPos>=0 && nDotPos < nSpacePos ) ||
1019 ( nSlashPos>=0 && nSlashPos < nSpacePos )))
1062 aStr =
aStr.replaceAll(
"\x01",
"");
1104 for( sal_Int32 nI = 0;
1105 nI < rStr.getLength() && rStr.getLength() < (
MAX_FIELDLEN - 4); ++nI )
1107 bool bSetAsHex =
false;
1114 rStr = rStr.replaceAt( nI, 1,
u"\"" );
1117 rStr = rStr.replaceAt( nI, 1,
u"{" );
1120 rStr = rStr.replaceAt( nI, 1,
u"|" );
1123 rStr = rStr.replaceAt( nI, 1,
u"}" );
1129 rStr = rStr.replaceAt( nI, 0,
u"\\" );
1136 rStr = rStr.replaceAt( nI, 1,
u"\n" );
1145 bSetAsHex = 0x20 > cChar;
1152 OUString sTmp(
"\\x" );
1155 sTmp += OUString::number( cChar, 16 );
1156 rStr = rStr.replaceAt( nI, 1 , sTmp );
1157 nI += sTmp.getLength() - 1;
1167 OUString
aName(
"WwFieldTag");
1236 if( aDef.isEmpty() )
1239 if ( pF->
nId != 0x01 )
1242 aDef, aQ,
INP_TXT, 0,
false );
1272 OUStringBuffer buf(sRes.getLength());
1273 for (sal_Int32
i = 0;
i < sRes.getLength(); ++
i)
1293 SAL_INFO(
"sw.ww8",
"GetFieldResult(): filtering control character");
1298 return buf.makeStringAndClear();
1341 OUString &rOrigName,
const OUString &rData)
1353 if (!
sName.isEmpty())
1361 sName =
"WWSetBkmk" + OUString::number(nNo);
1388 std::map<OUString, OUString, SwWW8::ltstr>::const_iterator
1411 std::map<OUString, OUString, SwWW8::ltstr>::const_iterator aResult =
1415 ?
sName : (*aResult).second;
1421 OUString sOrigName, aQ;
1432 if (sOrigName.isEmpty())
1434 else if (aQ.isEmpty())
1445 if (sOrigName.isEmpty())
1452 if (!aDef.isEmpty())
1491 OUString aSequenceName;
1493 bool bHidden =
false;
1494 bool bFormat =
false;
1495 bool bCountOn =
true;
1507 if( aSequenceName.isEmpty() )
1509 else if( aBook.isEmpty() )
1545 if (aSequenceName.isEmpty() && aBook.isEmpty())
1556 if (!sStart.isEmpty())
1557 aField.
SetFormula( aSequenceName +
"=" + sStart );
1573 OUString aResult = aReadParam.
GetResult();
1574 sal_Int32 nResult = aResult.toInt32();
1591 bool bDateTime =
false;
1596 OUString aDocProperty;
1606 if( aDocProperty.isEmpty() )
1616 aDocProperty = aDocProperty.replaceAll(
"\"",
"");
1626 static const char* aName10 =
"\x0F";
1627 static const char* aName11
1629 static const char* aName12
1631 static const char* aName13
1633 static const char* aName14
1635 static const char* aName20 =
"\x15";
1636 static const char* aName21
1638 static const char* aName22
1640 static const char* aName23
1642 static const char* aName24
1644 static const char* aName30 =
"\x16";
1645 static const char* aName31
1646 =
"ZULETZTGESPEICHERTZEIT";
1647 static const char* aName32
1648 =
"DERNIERENREGISTREMENT";
1649 static const char* aName33
1651 static const char* aName34
1653 static const char* aName40 =
"\x17";
1654 static const char* aName41
1655 =
"ZULETZTGEDRUCKT";
1656 static const char* aName42
1657 =
"DERNI\xC8" "REIMPRESSION";
1658 static const char* aName43
1660 static const char* aName44
1662 static const char* aName50 =
"\x18";
1663 static const char* aName51
1664 =
"\xDC" "BERARBEITUNGSNUMMER";
1665 static const char* aName52
1666 =
"NUM\xC9" "RODEREVISION";
1667 static const char* aName53
1669 static const char* aName54
1671 static const sal_uInt16 nFieldCnt = 5;
1675 static const sal_uInt16 nLangCnt = 4;
1676 static const char *aNameSet_26[nFieldCnt][nLangCnt+1] =
1678 {aName10, aName11, aName12, aName13, aName14},
1679 {aName20, aName21, aName22, aName23, aName24},
1680 {aName30, aName31, aName32, aName33, aName34},
1681 {aName40, aName41, aName42, aName43, aName44},
1682 {aName50, aName51, aName52, aName53, aName54}
1685 bool bFieldFound=
false;
1687 for(sal_uInt16 nLIdx=1; !bFieldFound && (nLangCnt > nLIdx); ++nLIdx)
1689 for(nFIdx = 0; !bFieldFound && (nFieldCnt > nFIdx); ++nFIdx)
1691 if( aDocProperty == OUString( aNameSet_26[nFIdx][nLIdx], strlen(aNameSet_26[nFIdx][nLIdx]),
1692 RTL_TEXTENCODING_MS_1252 ) )
1695 pF->
nId = aNameSet_26[nFIdx][0][0];
1715 OUString sVariable = aField.
ExpandField(
false,
nullptr);
1716 if (sDisplayed.getLength() != sVariable.getLength())
1718 sal_Int32 nLen = sVariable.indexOf(
'\x0');
1720 sVariable = sVariable.copy(0, nLen);
1722 if (sDisplayed == sVariable)
1788 sal_uInt32 nFormat = 0;
1796 case SvNumFormatType::DATE:
1799 case SvNumFormatType::TIME:
1802 case SvNumFormatType::DATETIME:
1813 if ( 64 == pF->
nId )
1824 if(
aData.isEmpty() )
1868 bool bHijri =
false;
1890 sal_uInt32 nFormat = 0;
1895 if( SvNumFormatType::UNDEFINED == nDT )
1899 nDT = SvNumFormatType::TIME;
1905 nDT = SvNumFormatType::DATE;
1911 if (nDT & SvNumFormatType::DATE || nDT == SvNumFormatType::TIME)
1916 if (pF->
nOpt & 0x10)
1920 SvNumInputOptions::LAX_TIME))
1924 aSetDateTime.
AddTime(fSerial);
1953 OSL_ENSURE(
false,
"unknown option in FileName field");
1968 case 27: nSub =
DS_WORD;
break;
1969 case 28: nSub =
DS_CHAR;
break;
1994 sal_Int32 nSize = 0;
2016 const OUString aSiz = aReadParam.
GetResult();
2017 if (!aSiz.isEmpty())
2019 bool bFail = o3tl::checked_multiply<sal_Int32>(aSiz.toInt32(), 20, nSize);
2033 if (!
aName.isEmpty())
2050 if (!
aName.isEmpty())
2102 if (sOrigName.isEmpty())
2104 else if (sVal.isEmpty())
2127 OUString sOrigBkmName;
2139 if( sOrigBkmName.isEmpty() )
2178 if ( IsTOCBookmarkName( sBkmName ) )
2180 sBkmName = EnsureTOCBookmarkName(sBkmName);
2182 m_xReffedStck->m_aReferencedTOCBookmarks.insert( sBkmName );
2211 bool bAboveBelow =
false;
2222 if( aBkmName.isEmpty() )
2267 else if ( nRet == -2 && sOrigName.isEmpty() )
2285 OUString sBookmarkName;
2286 if ( IsTOCBookmarkName(
sName ) )
2288 sBookmarkName = EnsureTOCBookmarkName(
sName);
2290 m_xReffedStck->m_aReferencedTOCBookmarks.insert( sBookmarkName );
2294 sBookmarkName =
sName;
2296 OUString sURL =
"#" + sBookmarkName;
2298 static constexpr OUStringLiteral sLinkStyle(
u"Index Link");
2299 const sal_uInt16 nPoolId =
2301 aURL.SetVisitedFormatAndId( sLinkStyle, nPoolId);
2302 aURL.SetINetFormatAndId( sLinkStyle, nPoolId );
2310 OUString sPageRefBookmarkName;
2311 if ( IsTOCBookmarkName(
sName ) )
2313 sPageRefBookmarkName = EnsureTOCBookmarkName(
sName);
2315 m_xReffedStck->m_aReferencedTOCBookmarks.insert( sPageRefBookmarkName );
2319 sPageRefBookmarkName =
sName;
2333 bool bConverted =
false;
2334 if( rReference ==
"(" )
2338 if (rName ==
u"CheckIt")
2340 else if (rName ==
u"UncheckIt")
2342 else if (rName ==
u"ShowExample")
2349 rReference = OUString(cSymbol);
2359 bool bNewVText =
true;
2360 bool bBracket =
false;
2371 if(
aName.isEmpty() )
2373 else if( aVText.isEmpty() || bBracket )
2380 bBracket = (aVText[0] ==
'[');
2383 else if( aVText.endsWith(
"]") )
2389 if(
aName.isEmpty() )
2396 aName =
"StarOffice.Standard.Modul1." +
aName;
2401 if( !bApplyWingdings )
2412 rtl_TextEncoding eSrcCharSet;
2414 && aFontName==
"Wingdings" )
2420 if ( i < m_xFonts->GetMax() )
2435 bool bUseRemote =
false;
2440 uno::Reference< task::XInteractionHandler > xIH(
2443 uno::Reference< ucb::XProgressHandler > xProgress;
2448 static_cast< ucb::XCommandEnvironment*
>(pCommandEnv.get()),
2455 bUseRemote = !aTitle.isEmpty();
2461 OUString aMediaType;
2463 bUseRemote = !aMediaType.isEmpty();
2478 bool bEmbedded =
true;
2489 if (aGrfName.isEmpty())
2520 aFlySet.Put(
SwFormatVertOrient( 0, text::VertOrientation::TOP, text::RelOrientation::FRAME ));
2554 if( aPara.isEmpty() )
2556 else if( aBook.isEmpty() )
2567 if (!aBook.isEmpty() && aBook[ 0 ] !=
'\\')
2570 ConvertUFName(aBook);
2590 OSL_ENSURE(pSection,
"no section inserted");
2594 OSL_ENSURE(pSectionNode,
"no section node!");
2610#if !HAVE_FEATURE_DBCONNECTIVITY || ENABLE_FUZZERS
2624 if(
aName.isEmpty() )
2639 aResult = aResult.replace(
'\xb',
'\n' );
2651#if HAVE_FEATURE_DBCONNECTIVITY && !ENABLE_FUZZERS
2664#if HAVE_FEATURE_DBCONNECTIVITY && !ENABLE_FUZZERS
2687 if (
'o' == cChar ||
'O' == cChar)
2691 if (aResult.
sType ==
"Input")
2697 else if (aResult.
sType ==
"CombinedCharacters")
2704 else if (
'*' == cChar)
2712 sal_uInt16 nJustificationCode=0;
2714 sal_uInt32 nFontSize=0;
2726 OUString sTemp = rReadParam.
GetResult();
2727 if( sTemp.startsWithIgnoreAsciiCase(
"jc" ) )
2729 sTemp = sTemp.copy(2);
2730 nJustificationCode = o3tl::narrowing<sal_uInt16>(sTemp.toInt32());
2732 else if( sTemp.startsWithIgnoreAsciiCase(
"hps" ) )
2734 sTemp = sTemp.copy(3);
2735 nFontSize=
static_cast<sal_uInt32
>(sTemp.toInt32());
2737 else if( sTemp.startsWithIgnoreAsciiCase(
"Font:" ) )
2739 sTemp = sTemp.copy(5);
2755 rReadParam.
GetResult().startsWithIgnoreAsciiCase(
"p"))
2759 OUString sPart = rReadParam.
GetResult();
2760 sal_Int32 nBegin = sPart.indexOf(
'(');
2763 sal_Int32 nEnd = sPart.indexOf(
')');
2765 if ((nBegin != -1) &&
2766 (nEnd != -1) && (nBegin < nEnd))
2768 sRuby = sPart.copy(nBegin+1,nEnd-nBegin-1);
2772 nBegin = sPart.indexOf(
',',nEnd);
2775 nBegin = sPart.indexOf(
';',nEnd);
2777 nEnd = sPart.lastIndexOf(
')');
2779 if ((nBegin != -1) && (nEnd != -1) && (nBegin < nEnd))
2781 sText = sPart.copy(nBegin+1,nEnd-nBegin-1);
2793 if (sRuby.isEmpty() || sText.isEmpty() || sFontName.isEmpty() || !nFontSize)
2796 css::text::RubyAdjust eRubyAdjust;
2797 switch (nJustificationCode)
2800 eRubyAdjust = css::text::RubyAdjust_CENTER;
2803 eRubyAdjust = css::text::RubyAdjust_BLOCK;
2806 eRubyAdjust = css::text::RubyAdjust_INDENT_BLOCK;
2810 eRubyAdjust = css::text::RubyAdjust_LEFT;
2813 eRubyAdjust = css::text::RubyAdjust_RIGHT;
2827 rpCharFormat->GetFormatAttr(
2831 const SvxFontItem &rF = rpCharFormat->GetFormatAttr(
2835 pCharFormat = rpCharFormat;
2857 pCharFormat = pFormat;
2884 OUString sSeqName( rParam.
GetResult() );
2900 for (sal_uInt16 nI =
MAXLEVEL; nI > 0; --nI)
2918 if( sParams.isEmpty() )
2925 OUString sTemplate( sParams.getToken(0,
';',
nIndex) );
2929 sTemplate = sParams.getToken(0,
',',
nIndex);
2935 sTemplate = pStyle->
GetName();
2939 else while( -1 !=
nIndex )
2941 sal_Int32 nOldIndex=
nIndex;
2942 sal_uInt16 nLevel = o3tl::narrowing<sal_uInt16>(
2947 nLevel = o3tl::narrowing<sal_uInt16>(
2951 if( (0 < nLevel) && (
MAXLEVEL >= nLevel) )
2959 sTemplate = pStyle->
GetName();
2962 if( !sStyles.isEmpty() )
2964 sStyles += sTemplate;
2969 sTemplate = sParams.getToken(0,
';',
nIndex);
2973 sTemplate = sParams.getToken(0,
',',
nIndex);
2980 sal_uInt16 nIndexCols = 1;
2982 nIndexCols =
maSegments.back().maSep.ccolM1 + 1;
3048 sal_uInt16 nIndexCols = 1;
3052 std::shared_ptr<SwTOXBase> pBase = std::make_shared<SwTOXBase>( pType, aOrigForm, nCreateOf, OUString() );
3074 const OUString sParams( aReadParam.
GetResult() );
3076 if( !sParams.isEmpty() )
3078 nIndexCols = o3tl::narrowing<sal_uInt16>(sParams.toInt32());
3086 OUString sDelimiter( aReadParam.
GetResult() );
3087 SwForm aForm( pBase->GetTOXForm() );
3093 for(sal_uInt16 nLevel = 1;
3106 SwFormTokens::iterator aIt = aPattern.begin();
3117 if(0x09 == sDelimiter[0])
3118 aIt->eTabAlign = SvxTabAdjust::End;
3122 aToken.
sText = sDelimiter;
3125 aForm.
SetPattern(nLevel, std::move(aPattern));
3136 pBase->SetTOXForm( aForm );
3147 pBase->SetOptions( eOptions );
3153 bool bIsHyperlink =
false;
3159 sal_Int32 nMaxLevel = 0;
3169 bIsHyperlink =
true;
3183 if( nMaxLevel < nVal )
3196 if( nMaxLevel < nVal )
3211 OUString sDelimiter( aReadParam.
GetResult() );
3212 SwForm aForm( pBase->GetTOXForm() );
3218 for(sal_uInt16 nLevel = 1;
3231 SwFormTokens::iterator aIt = aPattern.begin();
3243 aToken.
sText = sDelimiter;
3247 std::move(aPattern));
3256 pBase->SetTOXForm( aForm );
3263 sal_Int32 nStart(0);
3272 SwForm aForm( pBase->GetTOXForm() );
3275 for ( sal_Int32 nLevel = nStart; nLevel<=nEnd; ++nLevel )
3284 SwFormTokens::iterator aIt = aPattern.begin();
3291 aIt = aPattern.erase(aIt);
3298 aPattern.erase(aIt);
3299 aForm.
SetPattern(nLevel, std::move(aPattern));
3307 pBase->SetTOXForm( aForm );
3328 SwForm aForm(pBase->GetTOXForm());
3331 for(sal_uInt16 nLevel = 1; nLevel <= nEnd; ++nLevel)
3336 aPattern.insert(aPattern.begin(), aLinkStart);
3340 auto aItr = std::find_if(aPattern.begin(), aPattern.end(),
3341 [](
const SwFormToken& rToken) { return rToken.eTokenType == TOKEN_PAGE_NUMS; });
3342 if (aItr != aPattern.end())
3343 aPattern.insert(aItr, aLinkStart);
3345 aPattern.push_back(aLinkEnd);
3346 aForm.
SetPattern(nLevel, std::move(aPattern));
3348 pBase->SetTOXForm(aForm);
3352 pBase->SetLevel(nMaxLevel);
3368 std::unique_ptr<SwForm> pForm;
3371 if (rSI.IsOutlineNumbered())
3373 sal_uInt16 nStyleLevel = rSI.mnWW8OutlineLevel;
3374 const SwNumFormat& rFormat = rSI.GetOutlineNumrule()->Get( nStyleLevel );
3380 pForm.reset(
new SwForm( pBase->GetTOXForm() ));
3382 SwFormTokens aPattern = pForm->GetPattern(nStyleLevel);
3383 SwFormTokens::iterator aIt =
3384 find_if(aPattern.begin(), aPattern.end(),
3387 if ( aIt != aPattern.end() )
3390 aNumberEntrySeparator.
sText =
" ";
3391 aPattern.insert( ++aIt, aNumberEntrySeparator );
3392 pForm->SetPattern( nStyleLevel, std::move(aPattern) );
3399 pBase->SetTOXForm( *pForm );
3404 pBase->SetCreate(eCreateFrom);
3412 pBase->SetCreate( eCreateFrom );
3423 SwForm aOldForm( pBase->GetTOXForm() );
3425 sal_uInt16 nNewEnd = aNewForm.
GetFormMax()-1;
3428 for(sal_uInt16 nLevel = 1; nLevel <= nNewEnd; ++nLevel)
3431 SwFormTokens::iterator new_end =
3433 aPattern.erase(new_end, aPattern.end() );
3434 aForm.
SetPattern( nLevel, std::move(aPattern) );
3438 pBase->SetTOXForm( aNewForm );
3442 OSL_ENSURE(
false,
"Unhandled toc options!");
3450 OSL_ENSURE(
false,
"Unhandled toc options!");
3455 pBase->AdjustTabStops(
m_rDoc );
3475 const SfxItemSet* pSet = pNd->GetpSwAttrSet();
3504 pBase2->SetMSTOCExpression(rStr);
3506 if ( nIndexCols > 1 )
3511 aCol.
Init( nIndexCols, 708, USHRT_MAX );
3513 pBase2->SetAttrSet( aSet );
3545 OUString sURL, sTarget, sMark;
3550 bool bOptions =
false;
3560 if (sURL.isEmpty() && !bOptions)
3574 if( sMark.endsWith(
"\""))
3576 sMark = sMark.copy( 0, sMark.getLength() - 1 );
3579 if ( IsTOCBookmarkName( sMark ) )
3581 sMark = EnsureTOCBookmarkName(sMark);
3599 OSL_ENSURE(
false,
"Analysis still missing - unknown data" );
3608 OSL_ENSURE(!sURL.isEmpty() || !sMark.isEmpty(),
"WW8: Empty URL");
3610 if( !sMark.isEmpty() )
3611 sURL +=
"#" + sMark;
3617 OUString sLinkStyle(
"Index Link");
3618 sal_uInt16 nPoolId =
3620 aURL.SetVisitedFormatAndId( sLinkStyle, nPoolId );
3621 aURL.SetINetFormatAndId( sLinkStyle, nPoolId );
3636 sal_uInt16 nLevel = 1;
3638 OUString sFieldText;
3648 if( sFieldText.isEmpty() )
3658 const OUString sParams( aReadParam.
GetResult() );
3659 if( sParams[0]!=
'C' && sParams[0]!=
'c' )
3667 const OUString sParams( aReadParam.
GetResult() );
3669 if( !sParams.isEmpty() && sParams[0]>
'0' && sParams[0]<=
'9' )
3671 nLevel = o3tl::narrowing<sal_uInt16>(sParams.toInt32());
3678 OSL_ENSURE( rDoc.
GetTOXTypeCount( eTox ),
"Doc.GetTOXTypeCount() == 0 :-(" );
3692 if( -1 != nScndFnd )
3697 sFieldText = sFieldText.copy( nFnd+1 );
3701 if (!sFieldText.isEmpty())
3710 bool bIdx = (nFieldId != 9);
3720 const int nChunk = 64;
3723 const static char *
aFieldNames[] = {
"\x06""INHALT",
"\x02""XE",
3725 const static sal_uInt8 aFieldId[] = { 9, 4, 9 };
3743 OUString sFieldName;
3744 sal_Int32 nFieldLen =
m_xSBase->WW8ReadString( *
m_pStrm, sFieldName, nStartCp,
3746 nStartCp+=nFieldLen;
3751 if( !nFieldLen || sFieldName[nC]!=0x13 )
3754 if( nFieldLen && sFieldName[nC]==0x15 )
3765 nFnd = sFieldName.indexOf(0x15);
3773 nStartCp+=nFieldLen;
3785 sFieldName = sFieldName.copy(0, nFnd);
3788 while ( sFieldName[nC]==
' ' )
3791 for(
int i = 0;
i < 3;
i++ )
3794 const sal_Int32 nNameLen =
static_cast<sal_Int32
>(*
pName++);
3795 if( sFieldName.matchIgnoreAsciiCaseAsciiL(
pName, nNameLen, nC ) )
3797 ImportTox( aFieldId[
i], sFieldName.copy( nC + nNameLen ) );
const char *const aFieldNames[]
OUString uppercase(const OUString &rStr, sal_Int32 nPos, sal_Int32 nCount) const
void AddTime(double fTimeInDays)
Text operation/manipulation interface.
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.
virtual bool InsertPoolItem(const SwPaM &rRg, const SfxPoolItem &, const SetAttrMode nFlags=SetAttrMode::DEFAULT, SwRootFrame const *pLayout=nullptr, SwTextAttr **ppNewTextAttr=nullptr)=0
Insert an attribute.
virtual bool InsertString(const SwPaM &rRg, const OUString &, const SwInsertFlags nInsertMode=SwInsertFlags::EMPTYEXPAND)=0
Insert string into existing text node at position rRg.Point().
virtual SwFieldType * GetSysFieldType(const SwFieldIds eWhich) const =0
virtual SwFieldType * InsertFieldType(const SwFieldType &)=0
Provides access to the marks of a document.
virtual sw::mark::IFieldmark * makeFieldBookmark(const SwPaM &rPaM, const OUString &rName, const OUString &rType, SwPosition const *pSepPos=nullptr)=0
static SW_DLLPUBLIC OUString GetCrossRefHeadingBookmarkNamePrefix()
virtual void SetUpdateExpFieldStat(bool b)=0
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
static SotStorage * OpenOLEStorage(css::uno::Reference< css::embed::XStorage > const &xStorage, OUString const &rEleName, StreamMode=StreamMode::STD_READWRITE)
SotStorage * OpenSotStorage(const OUString &rEleName, StreamMode=StreamMode::STD_READWRITE, bool transacted=true)
sal_uInt64 Seek(sal_uInt64 nPos)
static SvtFilterOptions & Get()
bool IsUseEnhancedFields() const
sal_uInt32 GetHeight() const
const OUString & GetFamilyName() const
SvxNumType GetNumberingType() const
css::uno::Reference< css::i18n::XBreakIterator > const & GetBreakIter() const
virtual sal_Int32 Len() const
void SetFieldCode(const OUString &rStr)
access to the command string
void InitContent()
Evaluation for header and footer.
virtual sal_uInt16 GetSubType() const override
virtual void SetSubType(sal_uInt16 nSub) override
void SetDateTime(const DateTime &rDT)
SwTOXBaseSection * InsertTableOf(const SwPosition &rPos, const SwTOXBase &rTOX, const SfxItemSet *pSet=nullptr, bool bExpand=false, SwRootFrame const *pLayout=nullptr)
IDocumentState const & getIDocumentState() const
css::uno::Reference< css::embed::XStorage > GetDocStorage()
const SwCharFormat * GetDfltCharFormat() const
sal_uInt16 GetTOXTypeCount(TOXTypes eTyp) const
Manage table of content types.
SwSection * InsertSwSection(SwPaM const &rRange, SwSectionData &, std::tuple< SwTOXBase const *, sw::RedlineMode, sw::FieldmarkMode, sw::ParagraphBreakMode > const *pTOXBase, SfxItemSet const *const pAttr, bool const bUpdate=true)
IDocumentContentOperations const & getIDocumentContentOperations() const
IDocumentFieldsAccess const & getIDocumentFieldsAccess() const
static SwTOXBase * GetCurTOX(const SwPosition &rPos)
Get current table of contents.
IDocumentMarkAccess * getIDocumentMarkAccess()
OUString GetUniqueSectionName(const OUString *pChkStr=nullptr) const
void SetInitDBFields(bool b)
const SwAttrPool & GetAttrPool() const
SwCharFormat * MakeCharFormat(const OUString &rFormatName, SwCharFormat *pDerivedFrom, bool bBroadcast=false)
const SwTOXType * GetTOXType(TOXTypes eTyp, sal_uInt16 nId) const
SvNumberFormatter * GetNumberFormatter(bool bCreate=true)
Instances of SwFields and those derived from it occur 0 to n times.
Base class of all fields.
virtual void SetLanguage(LanguageType nLng)
virtual OUString GetPar1() const
OUString ExpandField(bool bCached, SwRootFrame const *pLayout) const
expand the field.
SwFieldIds Which() const
ResId.
void SetAutomaticLanguage(bool const bSet)
Stores RDF statements on a paragraph (key-value pairs where the subject is the paragraph).
void SetHandle(tools::Long nHandle)
std::unique_ptr< SfxPoolItem > m_pAttr
void SetHadBreakItem(bool bVal)
void SetHadPageDescItem(bool bVal)
const SwTOXBase & GetBase() const
static void ParseIfFieldDefinition(std::u16string_view aFieldDefinition, OUString &rCondition, OUString &rTrue, OUString &rFalse)
Base class of the Writer document model elements.
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
SwNodeOffset GetIndex() const
SwContentNode * GetContentNode()
PaM is Point and Mark: a selection of the document model.
SwNode & GetPointNode() const
const SwPosition * End() const
const SwPosition * GetPoint() const
const SwPosition * Start() const
SAL_DLLPRIVATE void SetProtectFlag(bool const bFlag)
void SetLinkFileName(OUString const &rNew)
A section node represents the start of a section on the UI, i.e.
SwSectionFormat * GetFormat()
virtual void SetValue(const double &rVal) override
virtual sal_uInt16 GetSubType() const override
void SetInputFlag(bool bInp)
virtual void SetSubType(sal_uInt16 nType) override
void SetPromptText(const OUString &rStr)
static SW_DLLPUBLIC sal_uInt16 GetPoolIdFromUIName(const OUString &rName, SwGetPoolIdFromName)
static void FillUIName(const OUString &rName, OUString &rFillName, SwGetPoolIdFromName)
void SetStyleNames(const OUString &rSet, sal_uInt16 nLevel)
SwTOXElement GetCreateType() const
void RegisterToTOXType(SwTOXType &rMark)
sal_uInt16 GetLevel() const
void SetCaptionDisplay(SwCaptionDisplay eSet)
OUString const & GetStyleNames(sal_uInt16 nLevel) const
void SetSequenceName(const OUString &rSet)
void SetLevel(sal_uInt16)
void SetAlternativeText(const OUString &rAlt)
void SetSecondaryKey(const OUString &rStr)
void SetPrimaryKey(const OUString &rStr)
void SetLevel(sal_uInt16 nLevel)
SwTextNode is a paragraph in the document model.
virtual sal_Int32 Len() const override
SwFltStackEntry * RefToVar(const SwField *pField, SwFltStackEntry &rEntry)
std::map< OUString, OUString, SwWW8::ltstr > m_aFieldVarNames
eF_ResT Read_F_Num(WW8FieldDesc *pF, OUString &)
eF_ResT Read_F_FormTextBox(WW8FieldDesc *pF, OUString &rStr)
SwFieldType * m_pNumFieldType
bool m_bCareFirstParaEndInToc
const WW8Fib & GetFib() const
std::vector< SwWW8StyInf > m_vColl
eF_ResT Read_F_DocInfo(WW8FieldDesc *pF, OUString &rStr)
SvNumFormatType GetTimeDatePara(std::u16string_view aStr, sal_uInt32 &rFormat, LanguageType &rLang, int nWhichDefault, bool bHijri=false)
eF_ResT Read_F_Author(WW8FieldDesc *, OUString &)
eF_ResT Read_F_PgRef(WW8FieldDesc *, OUString &rStr)
eF_ResT Read_F_OCX(WW8FieldDesc *, OUString &)
void ImportTox(int nFieldId, const OUString &aStr)
eF_ResT Read_F_FormCheckBox(WW8FieldDesc *pF, OUString &rStr)
eF_ResT Read_F_TemplName(WW8FieldDesc *, OUString &)
std::unique_ptr< SwWW8FltControlStack > m_xCtrlStck
eF_ResT Read_F_ANumber(WW8FieldDesc *, OUString &)
eF_ResT Read_F_HTMLControl(WW8FieldDesc *pF, OUString &rStr)
std::optional< SwPaM > m_oPosAfterTOC
eF_ResT Read_F_Shape(WW8FieldDesc *pF, OUString &rStr)
eF_ResT Read_F_FileName(WW8FieldDesc *, OUString &rStr)
tools::Long Read_Field(WW8PLCFManResult *pRes)
bool m_bCareLastParaEndInToc
rtl_TextEncoding m_eTextCharSet
eF_ResT Read_F_Equation(WW8FieldDesc *, OUString &)
eF_ResT Read_F_Input(WW8FieldDesc *, OUString &rStr)
sal_uInt32 m_nFieldTagBad[3]
eF_ResT Read_F_Seq(WW8FieldDesc *, OUString &rStr)
wwSectionManager m_aSectionManager
bool m_bLoadingTOXHyperlink
bool ForceFieldLanguage(SwField &rField, LanguageType nLang)
bool JoinNode(SwPaM &rPam, bool bStealAttr=false)
bool SetNewFontAttr(sal_uInt16 nFCode, bool bSetEnums, sal_uInt16 nWhich)
eF_ResT Read_F_IncludeText(WW8FieldDesc *, OUString &rStr)
OUString ConvertFFileName(const OUString &rRaw)
translate FieldParameter names into the system character set and at the same time,...
eF_ResT Read_F_DBNext(WW8FieldDesc *, OUString &)
eF_ResT Read_F_Macro(WW8FieldDesc *, OUString &rStr)
bool GetFontParams(sal_uInt16, FontFamily &, OUString &, FontPitch &, rtl_TextEncoding &)
eF_ResT Read_F_NoteReference(WW8FieldDesc *pF, OUString &rStr)
SwFlyFrameFormat * m_pFlyFormatOfJustInsertedGraphic
sal_uInt32 m_nFieldTagAlways[3]
std::shared_ptr< WW8PLCFMan > m_xPlcxMan
WW8_CP Read_F_Tag(WW8FieldDesc *pF)
tools::Long MapBookmarkVariables(const WW8FieldDesc *pF, OUString &rOrigName, const OUString &rData)
OUString GetMappedBookmark(std::u16string_view rOrigName)
eF_ResT Read_F_CurPage(WW8FieldDesc *, OUString &)
std::deque< WW8FieldEntry > m_aFieldStack
tools::Long Read_AtnBook(WW8PLCFManResult *)
eF_ResT Read_F_Tox(WW8FieldDesc *pF, OUString &rStr)
wwFrameNamer m_aGrfNameGenerator
eF_ResT Read_F_IncludePicture(WW8FieldDesc *, OUString &rStr)
void GetSmartTagInfo(SwFltRDFMark &rMark)
tools::Long Read_FactoidBook(WW8PLCFManResult *)
eF_ResT Read_F_DBField(WW8FieldDesc *, OUString &rStr)
const SwFormat * GetStyleWithOrgWWName(std::u16string_view rName) const
void Read_FieldVanish(sal_uInt16 nId, const sal_uInt8 *pData, short nLen)
void AppendTextNode(SwPosition &rPos)
void Read_SubF_Ruby(msfilter::util::WW8ReadFieldParams &rReadParam)
eF_ResT Read_F_Ref(WW8FieldDesc *pF, OUString &)
eF_ResT Read_F_Embedd(WW8FieldDesc *, OUString &rStr)
std::unique_ptr< SwWW8ReferencedFltEndStack > m_xReffedStck
std::unique_ptr< WW8Fonts > m_xFonts
eF_ResT Read_F_Hyperlink(WW8FieldDesc *, OUString &rStr)
rtl_TextEncoding m_eStructCharSet
std::unique_ptr< SwWW8FltRefStack > m_xReffingStck
std::unique_ptr< WW8ScannerBase > m_xSBase
void NewAttr(const SfxPoolItem &rAttr, const bool bFirstLineOfStSet=false, const bool bLeftIndentSet=false)
OUString GetFieldResult(WW8FieldDesc const *pF)
std::unique_ptr< sw::util::RedlineStack > m_xRedlineStack
void NotifyMacroEventRead()
eF_ResT Read_F_Set(WW8FieldDesc *, OUString &rStr)
std::vector< const SwCharFormat * > m_aRubyCharFormats
eF_ResT Read_F_Styleref(WW8FieldDesc *, OUString &rStr)
Reads a STYLEREF field.
eF_ResT Read_F_FormListBox(WW8FieldDesc *pF, OUString &rStr)
std::deque< bool > m_aApos
tools::Long Read_Book(WW8PLCFManResult *)
eF_ResT Read_F_Symbol(WW8FieldDesc *, OUString &rStr)
SwFormat * m_pCurrentColl
eF_ResT Read_F_InputVar(WW8FieldDesc *, OUString &rStr)
wwSectionNamer m_aSectionNameGenerator
eF_ResT Read_F_DateTime(WW8FieldDesc *, OUString &rStr)
void MakeTagString(OUString &rStr, const OUString &rOrg)
eF_ResT Read_F_DBNum(WW8FieldDesc *, OUString &)
void InsertTagField(const sal_uInt16 nId, const OUString &rTagText)
const SfxPoolItem * GetFormatAttr(sal_uInt16 nWhich)
void Swap(WW8FieldEntry &rOther) noexcept
void SetBookmarkType(const OUString &bookmarkType)
WW8FieldEntry(SwPosition const &rPos, sal_uInt16 nFieldId) noexcept
sw::hack::Position maStartPos
WW8FieldEntry & operator=(const WW8FieldEntry &rOther) noexcept
void SetBookmarkCode(const OUString &bookmarkCode)
void SetBookmarkName(const OUString &bookmarkName)
Handles the import of PlcfAtnBkf and PlcfAtnBkl: start / end position of annotation marks.
tools::Long GetHandle() const
eBookStatus GetStatus() const
WW8_CP GetStartPos() const
tools::Long GetLen() const
const OUString * GetName() const
bool GetPara(tools::Long nIdx, WW8FieldDesc &rF)
bool StartPosIsFieldStart()
bool EndPosIsFieldEnd(WW8_CP &)
Handles the import of PlcfBkfFactoid and PlcfBklFactoid: start / end position of factoids.
sal_Int32 FindNextStringPiece(sal_Int32 _nStart=-1)
OUString GetResult() const
sal_Int32 SkipToNextToken()
bool GetTokenSttFromTo(sal_Int32 *_pFrom, sal_Int32 *_pTo, sal_Int32 _nMax)
css::uno::Any getPropertyValue(const OUString &rPropertyName)
void SetUniqueGraphName(SwFrameFormat *pFrameFormat, std::u16string_view rFixedPart)
bool WillHavePageDescHere(const SwNode &) const
sal_uInt16 CurrentSectionColCount() const
std::deque< wwSection > maSegments
void PrependedInlineNode(const SwPosition &rPos, const SwNode &rNode)
bool CurrentSectionIsProtected() const
bool SwFltGetFlag(sal_uLong nFieldFlags, int no)
constexpr sal_uInt16 RES_FRMATR_BEGIN(RES_PARATR_LIST_END)
constexpr TypedWhichId< CntUInt16Item > RES_FLTR_ANNOTATIONMARK(195)
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_FONTSIZE(8)
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_LANGUAGE(10)
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_CTL_LANGUAGE(29)
constexpr sal_uInt16 RES_FRMATR_END(141)
constexpr TypedWhichId< SwFormatINetFormat > RES_TXTATR_INETFMT(51)
constexpr TypedWhichId< SwFormatPageDesc > RES_PAGEDESC(99)
constexpr TypedWhichId< SfxStringItem > RES_FLTR_BOOKMARK(RES_FLTRATTR_BEGIN)
constexpr TypedWhichId< SwFormatField > RES_TXTATR_FIELD(RES_TXTATR_NOEND_BEGIN)
constexpr TypedWhichId< SvxFormatBreakItem > RES_BREAK(100)
constexpr TypedWhichId< SvxFontItem > RES_CHRATR_FONT(7)
constexpr TypedWhichId< SwFltTOX > RES_FLTR_TOX(193)
constexpr TypedWhichId< SwFormatRuby > RES_TXTATR_CJK_RUBY(53)
constexpr TypedWhichId< SwFltRDFMark > RES_FLTR_RDFMARK(196)
sal_uInt16 GetWhichOfScript(sal_uInt16 nWhich, sal_uInt16 nScript)
CharClass & GetAppCharClass()
#define LANGUAGE_ENGLISH_US
#define SAL_WARN(area, stream)
#define SAL_INFO(area, stream)
#define SAL_N_ELEMENTS(arr)
constexpr OUStringLiteral aObjectPool
constexpr OUStringLiteral aData
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)
OString stripEnd(const OString &rIn, char c)
Reference< XComponentContext > getProcessComponentContext()
bool IsControlChar(sal_Unicode cChar)
EquationResult ParseCombinedChars(const OUString &rStr)
const SwDocInfoSubType DI_DOCNO
const SwDocInfoSubType DI_SUB_AUTHOR
const SwDocInfoSubType DI_CUSTOM
const SwDocInfoSubType DI_CHANGE
const SwDocInfoSubType DI_COMMENT
const SwDocInfoSubType DI_SUB_FIXED
const SwDocInfoSubType DI_PRINT
const SwDocInfoSubType DI_SUB_DATE
const SwDocInfoSubType DI_KEYS
const SwDocInfoSubType DI_SUBJECT
const SwDocInfoSubType DI_TITLE
const SwDocInfoSubType DI_SUB_TIME
const SwDocInfoSubType DI_CREATE
const SwExtendedSubType SUB_INVISIBLE
Invisible.
const SwGetSetExpType GSE_SEQ
Sequence.
const SwGetSetExpType GSE_STRING
String.
std::basic_string_view< charT, traits > trim(std::basic_string_view< charT, traits > str)
sal_Int32 toInt32(std::u16string_view str, sal_Int16 radix=10)
constexpr bool starts_with(std::basic_string_view< charT, traits > sv, std::basic_string_view< charT, traits > x) noexcept
std::basic_string_view< charT, traits > getToken(std::basic_string_view< charT, traits > sv, charT delimiter, std::size_t &position)
const sal_Unicode cTokenSeparator
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.
auto FilterControlChars(std::u16string_view aString) -> OUString
constexpr OUStringLiteral ODF_FORMTEXT
constexpr OUStringLiteral ODF_CODE_PARAM
constexpr OUStringLiteral ODF_OLE_PARAM
constexpr OUStringLiteral ODF_UNHANDLED
constexpr OUStringLiteral ODF_ID_PARAM
SwMoveFnCollection const & fnMoveBackward
@ RES_POOLCHR_RUBYTEXT
Rubytext.
@ REF_UPDOWN
"Above/Below"
@ REF_NUMBER
new reference format types for referencing bookmarks and set references
@ REF_ONLYNUMBER
"Category and Number"
@ REF_NUMBER_NO_CONTEXT
"Number (no context)"
@ REF_NUMBER_FULL_CONTEXT
"Number (full context)"
static LanguageType nLang
Marks a position in the document model.
void Assign(const SwNode &rNd, SwNodeOffset nDelta, sal_Int32 nContentOffset=0)
These all set both nNode and nContent.
void SetContent(sal_Int32 nContentIndex)
Set content index, only valid to call this if the position points to a SwContentNode subclass.
SwNodeOffset GetNodeIndex() const
const SwNodes & GetNodes() const
sal_Int32 GetContentIndex() const
sal_uInt16 nId
WW-id for fields.
WW8_CP nLen
total length (to skip over text)
sal_uInt8 nOpt
WW-Flags ( e.g.: changed by user )
WW8_CP nSCode
start of instructions code
bool bCodeNest
instruction used recursively
WW8_CP nLRes
length ( == 0, if no result )
WW8_CP nSRes
start of result
bool bResNest
instruction inserted into result
SVX_NUM_CHARS_LOWER_LETTER_N
SVX_NUM_CHARS_UPPER_LETTER_N
constexpr sal_uInt8 MAXLEVEL
#define TOX_STYLE_DELIMITER
std::vector< SwFormToken > SwFormTokens
Vector of tokens.
OUString BookmarkToWriter(std::u16string_view rBookmark)
static SvxNumType GetNumberPara(std::u16string_view aStr, bool bAllowPageDesc=false)
static OUString FindPara(std::u16string_view aStr, sal_Unicode cToken, sal_Unicode cToken2)
static bool ConvertMacroSymbol(std::u16string_view rName, OUString &rReference)
bool CanUseRemoteLink(const OUString &rGrfName)
static void lcl_ImportTox(SwDoc &rDoc, SwPaM const &rPaM, const OUString &rStr, bool bIdx)
static bool AcceptableNestedField(sal_uInt16 nFieldCode)
static void lcl_toxMatchTSwitch(SwWW8ImplReader const &rReader, SwTOXBase &rBase, WW8ReadFieldParams &rParam)
static OUString GetWordDefaultDateStringAsUS(SvNumberFormatter *pFormatter, LanguageType nLang)
static bool SanityCheck(const SwPaM &rFieldPam)
static void lcl_ConvertSequenceName(OUString &rSequenceName)
static sal_uInt16 lcl_GetMaxValidWordTOCLevel(const SwForm &rForm)
#define WW8_TOX_LEVEL_DELIM
static SvxNumType GetNumTypeFromName(const OUString &rStr, bool bAllowPageDesc=false)
static sal_Int32 FindParaStart(std::u16string_view aStr, sal_Unicode cToken, sal_Unicode cToken2)
static void lcl_toxMatchACSwitch(SwDoc const &rDoc, SwTOXBase &rBase, WW8ReadFieldParams &rParam, SwCaptionDisplay eCaptionType)
static void EnsureMaxLevelForTemplates(SwTOXBase &rBase)