67 #include <section.hxx>
79 #include <com/sun/star/drawing/XShape.hpp>
80 #include <com/sun/star/i18n/BreakIterator.hpp>
81 #include <com/sun/star/i18n/ScriptType.hpp>
82 #include <com/sun/star/i18n/WordType.hpp>
83 #include <com/sun/star/text/RubyPosition.hpp>
117 return " FORMDROPDOWN ";
119 return " FORMCHECKBOX ";
121 return " ODFFORMDATE ";
125 return " HYPERLINK ";
154 const uno::Reference<beans::XPropertySetInfo>& rPropertySetInfo)
156 OUString sLinkChainName;
157 if (rPropertySetInfo->hasPropertyByName(
"LinkDisplayName"))
159 rPropertySet->getPropertyValue(
"LinkDisplayName") >>= sLinkChainName;
160 if (!sLinkChainName.isEmpty())
161 return sLinkChainName;
163 if (rPropertySetInfo->hasPropertyByName(
"ChainName"))
164 rPropertySet->getPropertyValue(
"ChainName") >>= sLinkChainName;
165 return sLinkChainName;
169 : pOld( rExport.m_pChpIter ), m_rExport( rExport )
204 pCurRedline(nullptr),
207 mrSwFormatDrop(rTextNd.GetSwAttrSet().GetDrop())
232 aFlyFrame.ForceTreatAsInline();
248 if ( pos1 >= 0 && pos2 >= 0 )
251 return std::min(pos1, pos2);
255 return std::max(pos1, pos2);
266 if (0 <= fieldEndPos && fieldEndPos < nStartPos)
273 if (0 <= formElementPos && formElementPos < nStartPos)
291 if ( i >= nStartPos && i < nMinPos )
317 if( i >= nStartPos && i < nMinPos )
326 if( i >= nStartPos && i < nMinPos )
344 for(
size_t i = 0;
i < pTextAttrs->Count(); ++
i )
348 if( nPos >= nStartPos && nPos <= nMinPos )
354 if( nPos >= nStartPos && nPos <= nMinPos )
361 if( nPos >= nStartPos && nPos <= nMinPos )
375 sal_Int32 nNextFlyPos = 0;
377 while (aTmpFlyIter !=
maFlyFrames.end() && nNextFlyPos < nStartPos)
379 const SwPosition &rAnchor = aTmpFlyIter->GetPosition();
384 if (nNextFlyPos >= nStartPos && nNextFlyPos < nMinPos)
385 nMinPos = nNextFlyPos;
409 const SvxFontItem &rParentFont = ItemGet<SvxFontItem>(
425 aExportSet.ClearItem(nFontId);
433 for(
size_t i = 0;
i < pTextAttrs->Count(); ++
i )
436 const sal_Int32* pEnd = pHt->
End();
438 if (pEnd ? ( nSwPos >= pHt->
GetStart() && nSwPos < *pEnd)
445 const std::shared_ptr<SfxItemSet>& pSet = rAutoFormat.
GetStyleHandle();
451 if( SfxItemState::SET == pSet->GetItemState( nWhichId,
false, &pItem ))
453 if (nWhichId == nFontId)
458 aRangeItems[nWhichId] = pItem;
464 aRangeItems[nWhich] = (&(pHt->
GetAttr()));
466 else if (nSwPos < pHt->GetStart())
478 if ( pCharFormatItem )
489 if (
const SfxGrabBagItem *pAutoFmtGrabBag = dynamic_cast<const SfxGrabBagItem*>(pGrabBag))
493 std::unique_ptr<SfxGrabBagItem> pNewCharFmtGrabBag(pCharFmtGrabBag->Clone());
494 assert(pNewCharFmtGrabBag);
495 auto & rNewFmtMap = pNewCharFmtGrabBag->GetGrabBag();
496 for (
auto const & item : pAutoFmtGrabBag->GetGrabBag())
498 if (item.second.hasValue())
499 rNewFmtMap.erase(item.first);
501 aExportSet.Put(std::move(pNewCharFmtGrabBag));
511 for (
const auto& aRangeItem : aRangeItems )
513 aExportItems[aRangeItem.first] = aRangeItem.second;
516 if ( !aExportItems.empty() )
523 const SvxFontItem * pFontToOutput = ( rParentFont != *pFont )? pFont :
nullptr;
535 OSL_ENSURE( pFont,
"must be *some* font associated with this txtnode" );
540 if ( rParentFont != aFont )
565 if (rExportSet.
HasItem(nWhich) || !pValue)
568 bool hasPropertyInCharStyle =
false;
569 bool hasPropertyInParaStyle =
false;
577 if (pCharFormat->GetAttrSet().HasItem(nWhich, &pItem))
579 hasPropertyInCharStyle = (*pItem == *pValue);
588 nStyle = ( nStyle != 0xfff ) ? nStyle : 0;
595 hasPropertyInParaStyle = (*pItem == *pValue);
601 if (hasPropertyInCharStyle && hasPropertyInParaStyle)
603 rExportSet.
Put(*pValue);
618 if (VMLExport::IsWaterMarkShape(pSdrObj->
GetName()))
635 return nNodePos ==
maFlyIter->GetPosition().nNode.GetIndex();
642 const SwPosition& rAnchor = rFly.GetPosition();
659 uno::Reference< drawing::XShape > xShape;
663 xShape.set(const_cast<SdrObject*>(pSdrObj)->getUnoShape(), uno::UNO_QUERY);
664 uno::Reference< beans::XPropertySet > xPropertySet(xShape, uno::UNO_QUERY);
665 uno::Reference< beans::XPropertySetInfo > xPropertySetInfo;
666 if( xPropertySet.is() )
667 xPropertySetInfo = xPropertySet->getPropertySetInfo();
668 if( xPropertySetInfo.is() )
674 if( xPropertySetInfo->hasPropertyByName(
"ChainNextName") )
675 xPropertySet->getPropertyValue(
"ChainNextName") >>= aLinkedTextboxInfo.
sNextChain;
676 if( xPropertySetInfo->hasPropertyByName(
"ChainPrevName") )
677 xPropertySet->getPropertyValue(
"ChainPrevName") >>= aLinkedTextboxInfo.
sPrevChain;
682 assert( !sLinkChainName.isEmpty() );
695 ++linkedTextboxesIter;
702 ++linkedTextboxesIter;
710 ++linkedTextboxesIter;
723 assert(nPos >= nSwPos &&
"a fly must get flagged as a nextAttr/CurrentPos");
724 if ( nPos != nSwPos )
731 if (VMLExport::IsWaterMarkShape(pSdrObj->
GetName()))
765 for (
size_t i = 0;
i < pTextAttrs->Count(); ++
i)
775 else if (nSwPos < pHt->GetStart())
789 for (
size_t i = 0;
i < pTextAttrs->Count(); ++
i)
791 const SwTextAttr* pHt = pTextAttrs->GetSortedByEnd(
i);
792 const sal_Int32 nStart = pHt->
GetStart();
793 const sal_Int32 nEnd = pHt->
End() ? *pHt->
End() : INT_MAX;
794 if (nSwPos >= nStart && nSwPos < nEnd)
817 if(nSwPos == nWordLen && nSwPos != 0)
822 if (nSwPos == nDropChars && nSwPos != 0)
845 for (
size_t i = 0;
i < pTextAttrs->
Count(); ++
i)
849 const sal_Int32 * pAtrEnd =
nullptr;
850 if(
nullptr != ( pAtrEnd = pHt->
End() ) &&
851 nTmpSwPos >= pHt->
GetStart() && nTmpSwPos < *pAtrEnd )
853 if ( nWhich == pItem->
Which() )
872 else if (nTmpSwPos < pHt->GetStart())
881 rItems.insert(rItems.end(),
pO->begin(),
pO->end());
887 return pRet ? *pRet :
rNd.SwContentNode::GetAttr(nWhich);
894 aStr += OUString::number(aWW8Ruby.
GetJC()) +
" \\* \"Font:";
896 aStr += OUString::number((aWW8Ruby.
GetRubyHeight() + 5) / 10) +
" \\o";
899 aStr += OUStringLiteral(
u"\\a") + OUStringChar(aWW8Ruby.
GetDirective());
901 aStr +=
"(\\s\\up " + OUString::number((aWW8Ruby.
GetBaseHeight() + 10) / 20 - 1) +
"(";
923 if ( rRet.getLength() > 40 )
924 rRet = rRet.copy( 0, 40 );
925 OSL_ENSURE( rRet.getLength() <= 40,
"Word cannot have bookmarks longer than 40 chars" );
931 OUString sURL = rUrl;
935 OUString sParentPath = sConvertedParent.isEmpty() ?
m_sBaseURL : sConvertedParent;
941 if ( anAbsoluteParent.
GetNewAbsURL( rUrl, &anAbsoluteNew ) )
946 OUString sToConvert = rUrl.replaceAll(
"\\",
"/" );
950 if ( !sRelative.isEmpty() )
959 bool bBookMarkOnly =
false;
964 if ( rUrl.getLength() > 1 && rUrl[0] ==
'#' )
970 const OUString sRefType(nPos>=0 && nPos+1<sMark.getLength() ?
971 sMark.copy(nPos+1).replaceAll(
" ",
"") :
975 if ( !sRefType.isEmpty() &&
976 (sRefType ==
"outline" || sRefType ==
"graphic" || sRefType ==
"frame" || sRefType ==
"ole" || sRefType ==
"region" || sRefType ==
"table") )
980 if ( rBookmarkPair.first == sMark )
982 sMark =
"_toc" + OUString::number( rBookmarkPair.second );
995 if ( aProtocol == INetProtocol::File || aProtocol == INetProtocol::NotValid )
1003 if ( !sMark.isEmpty() && sURL.isEmpty() )
1004 bBookMarkOnly =
true;
1008 return bBookMarkOnly;
1015 OUString sURL = *pLinkURL;
1017 if ( !sURL.isEmpty() )
1020 if ( bBookMarkOnly )
1025 if ( !pMark->isEmpty() )
1026 sURL +=
" \\l \"" + *pMark +
"\"";
1028 if ( !rTarget.isEmpty() )
1029 sURL +=
" \\n " + rTarget;
1033 return bBookMarkOnly;
1048 bool bBookMarkOnly =
AnalyzeURL( rUrl, rTarget, &sURL, &sMark );
1060 0x03, 0x6a, 0,0,0,0,
1078 OUString sRelativeURL;
1079 if ( !rUrl.isEmpty() )
1081 bool bAbsolute = sRelativeURL == rUrl;
1086 0,0,0,0,0,0,0,0,0,0,
1087 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1088 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1089 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1094 0xD0,0xC9,0xEA,0x79,0xF9,0xBA,0xCE,0x11,
1095 0x8C,0x82,0x00,0xAA,0x00,0x4B,0xA9,0x0B
1101 if ( !sMark.isEmpty() )
1108 sal_uInt32 nFlag = bBookMarkOnly ? 0 : 0x01;
1111 if ( !sMark.isEmpty() )
1116 if ( eProto == INetProtocol::File || eProto == INetProtocol::Smb )
1121 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1122 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46,
1127 0xFF, 0xFF, 0xAD, 0xDE, 0x00, 0x00, 0x00, 0x00,
1128 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1129 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
1134 if ( eProto == INetProtocol::File && sURL.startsWith(
"/" ) )
1139 if (sURL.getLength()>=3)
1142 if ( sURL[0]==
'/' && sURL[2]==
':' &&
1143 ( (aDrive>=
'A' && aDrive<=
'Z' ) || (aDrive>=
'a' && aDrive<=
'z') ) )
1145 sURL = sURL.copy(1).replaceAll(
"/",
"\\");
1150 const char pSmb[] =
"smb://";
1151 if ( eProto == INetProtocol::Smb && sURL.startsWith( pSmb ) )
1153 sURL = sURL.copy(
sizeof(pSmb)-3 ).replaceAll(
"/",
"\\" );
1159 RTL_TEXTENCODING_MS_1252 );
1167 else if ( eProto != INetProtocol::NotValid )
1174 0xE0,0xC9,0xEA,0x79,0xF9,0xBA,0xCE,0x11,
1175 0x8C,0x82,0x00,0xAA,0x00,0x4B,0xA9,0x0B
1183 if ( !sMark.isEmpty() )
1204 rBookmark.replace(
' ',
'_'),
1228 [nSplitEndPos](
const CharRunEntry& rCharRun) {
return rCharRun.mnEndPos >= nSplitEndPos; });
1229 if (aIter ==
maCharRuns.end() || aIter->mnEndPos == nSplitEndPos)
1247 aItems.push_back( 1 );
1249 sal_uInt16 nStt_sprmCFSpec = aItems.size();
1253 aItems.push_back( 1 );
1273 const sal_Int32* pTextEnd = rTextTOXMark.
End();
1277 *pTextEnd - rTextTOXMark.
GetStart() );
1295 sText =
" XE \"" + sText +
"\" ";
1299 sText +=
"\" \\f \"" + OUStringChar(static_cast<char>(
'A' +
GetExport( ).GetId( *rAttr.
GetTOXType() ) ));
1304 sText =
" TC \"" + sText;
1305 sal_uInt16 nLvl = rAttr.
GetLevel();
1309 sText +=
"\" \\l " + OUString::number(nLvl) +
" ";
1313 OSL_ENSURE(
false,
"Unhandled option for toc export" );
1317 if (!sText.isEmpty())
1327 const sal_Int32* pEnd;
1329 for (
size_t i = 0;
i < pTextAttrs->Count(); ++
i)
1331 const SwTextAttr* pHt = pTextAttrs->GetSortedByEnd(
i);
1333 switch ( pItem->
Which() )
1337 if (nPos == *pEnd && nPos != pHt->
GetStart())
1345 if (
nullptr != pEnd && nPos == *pEnd && nPos != pHt->
GetStart())
1353 if (nPos == *pEnd && nPos != pHt->
GetStart())
1360 if (nPos < pHt->GetAnyEnd())
1363 for (
size_t i = 0;
i < pTextAttrs->Count(); ++
i )
1367 switch ( pItem->
Which() )
1377 if (nPos == *pEnd && nPos == pHt->
GetStart())
1390 if (
nullptr != pEnd && nPos == *pEnd && nPos == pHt->
GetStart())
1407 if (nPos == *pEnd && nPos == pHt->
GetStart())
1414 if (nPos < pHt->GetStart())
1485 const SwPosition* pCheckedStt = pRedl->Start();
1492 if (pRedl->GetType() == RedlineType::ParagraphFormat)
1512 case RedlineType::Insert:
1513 case RedlineType::Delete:
1514 case RedlineType::Format:
1545 case RedlineType::Insert:
1546 case RedlineType::Delete:
1547 case RedlineType::Format:
1593 else if (
auto pNd = dynamic_cast< const SwContentNode *>(
m_pOutFormatNode ) )
1598 else if ( dynamic_cast< const SwTextFormatColl *>(
m_pOutFormatNode ) !=
nullptr )
1601 nDir = SvxFrameDirection::Horizontal_RL_TB;
1603 nDir = SvxFrameDirection::Horizontal_LR_TB;
1607 if ( nDir == SvxFrameDirection::Environment )
1611 nDir = SvxFrameDirection::Horizontal_RL_TB;
1613 nDir = SvxFrameDirection::Horizontal_LR_TB;
1623 while ( pFlyFormat )
1626 if ( SvxFrameDirection::Environment == pItem->GetValue() )
1630 if ((RndStdIds::FLY_AT_PAGE != pAnchor->
GetAnchorId()) &&
1636 pFlyFormat =
nullptr;
1639 pFlyFormat =
nullptr;
1644 nRet = pItem->GetValue();
1648 OSL_ENSURE( nRet != SvxFrameDirection::Environment,
"leaving with environment direction" );
1663 if (SfxItemState::SET != eState || !pRet || (!pRet->
GetGraphic() &&
1683 if (SfxItemState::SET != eState || !pRet || (!pRet->
GetGraphic() &&
1688 if ((RndStdIds::FLY_AT_PAGE != pAnchor->
GetAnchorId()) &&
1695 pFlyFormat =
nullptr;
1698 pFlyFormat =
nullptr;
1705 std::shared_ptr<SvxBrushItem> aRet(std::make_shared<SvxBrushItem>(aTmpColor,
RES_BACKGROUND));
1709 aRet.reset(pRet->
Clone());
1721 sal_Int32 nLen)
const
1726 OUString aSnippet(rStr.copy(nCurrentPos, nLen));
1730 aSnippet = aSnippet.replace(0x0A, 0x0B);
1737 if (SvxCaseMap::Capitalize == static_cast<const SvxCaseMapItem&>(rItem).
GetValue())
1743 switch (nScriptType)
1745 case i18n::ScriptType::ASIAN:
1748 case i18n::ScriptType::COMPLEX:
1751 case i18n::ScriptType::LATIN:
1758 aFontHelper.
SetCaseMap(SvxCaseMap::Capitalize);
1759 aFontHelper.SetLanguage(nLanguage);
1767 i18n::WordType::ANYWORD_IGNOREWHITESPACES ) )
1769 aSnippet = OUStringChar(rStr[nCurrentPos]) + aSnippet.subView(1);
1787 while( nPos < nMax )
1796 pEnd->
nNode == *pTextNode && pStt->
nNode != *pTextNode &&
1810 short nDropLines = rSwFormatDrop.
GetLines();
1812 int rFontHeight, rDropHeight, rDropDescent;
1815 ShortToSVBT16( nStyle, nSty );
1825 int nDCS = ( nDropLines << 3 ) | 0x01;
1831 if ( rNode.
GetDropSize( rFontHeight, rDropHeight, rDropDescent ) )
1840 if ( pTextNodeInfo )
1843 SAL_INFO(
"sw.ww8", pTextNodeInfo->toString());
1851 if ( rNode.
GetDropSize( rFontHeight, rDropHeight, rDropDescent ) )
1854 if ( pSwCharFormat )
1874 const sal_Int32 nNextPos = aAttrIter->
WhereNext();
1875 sal_Int32 nNextBookmark = nNextPos;
1876 sal_Int32 nNextAnnotationMark = nNextPos;
1878 if( nNextBookmark > nCurrentPos )
1885 return std::min( nNextPos, std::min( nNextBookmark, nNextAnnotationMark ) );
1896 if( nCurrentPos == aAttrIter->
WhereNext() && ( !bNextBookmark || nNextPos > aAttrIter->
WhereNext() ) )
1907 for ( sal_Int32
i = 0;
i < nMarks;
i++ )
1936 bool bIsStartOk = ( pMark->
GetMarkStart().
nNode == nNd ) && ( nBStart >= nStt ) && ( nBStart <= nEnd );
1937 bool bIsEndOk = ( pMark->
GetMarkEnd().
nNode == nNd ) && ( nBEnd >= nStt ) && ( nBEnd <= nEnd );
1939 if ( bIsStartOk || bIsEndOk )
1941 rArr.push_back( pMark );
1945 return ( !rArr.empty() );
1955 for ( sal_Int32
i = 0;
i < nMarks;
i++ )
1967 bool bIsStartOk = ( pMark->
GetMarkStart().
nNode == nNd ) && ( nBStart >= nStt ) && ( nBStart <= nEnd );
1968 bool bIsEndOk = ( pMark->
GetMarkEnd().
nNode == nNd ) && ( nBEnd >= nStt ) && ( nBEnd <= nEnd );
1981 bSingleChar =
false;
1985 if ( ( bIsStartOk || bIsEndOk ) && !bSingleChar )
1987 rArr.push_back( pMark );
1991 return ( !rArr.empty() );
1996 class CompareMarksEnd
1999 bool operator() (
const IMark * pOneB,
const IMark * pTwoB )
const
2004 return nOEnd < nTEnd;
2012 bool bHasBookmark =
false;
2018 if( !bNextPositionOnly || (nNext > nCurrentPos ))
2021 bHasBookmark =
true;
2029 if( !bNextPositionOnly || nNext > nCurrentPos )
2031 if ( !bHasBookmark )
2034 rNearest = std::min( rNearest, nNext );
2035 bHasBookmark =
true;
2039 return bHasBookmark;
2044 bool bHasAnnotationMark =
false;
2050 if( !bNextPositionOnly || (nNext > nCurrentPos ))
2053 bHasAnnotationMark =
true;
2061 if( !bNextPositionOnly || nNext > nCurrentPos )
2063 if ( !bHasAnnotationMark )
2066 rNearest = std::min( rNearest, nNext );
2078 for (
IMark* pMark : aMarksStart )
2081 const sal_Int32 nStart = pMark->GetMarkStart().nContent.GetIndex();
2082 const sal_Int32 nEnd = pMark->GetMarkEnd().nContent.GetIndex();
2085 if ( nStart > nCurrentPos && ( pMark->GetMarkStart().nNode == rNode.
GetIndex()) )
2086 aSortedStart.push_back( pMark );
2088 if ( nEnd > nCurrentPos && nEnd <= ( nCurrentPos + nLen ) && (pMark->GetMarkEnd().nNode == rNode.
GetIndex()) )
2089 aSortedEnd.push_back( pMark );
2093 std::sort( aSortedEnd.begin(), aSortedEnd.end(), CompareMarksEnd() );
2108 if (
GetBookmarks( rNode, nCurrentPos, nCurrentPos + nLen, aMarksStart ) )
2112 for (
IMark* pMark : aMarksStart )
2115 const sal_Int32 nStart = pMark->GetMarkStart().nContent.GetIndex();
2116 const sal_Int32 nEnd = pMark->GetMarkEnd().nContent.GetIndex();
2118 if ( nStart > nCurrentPos && ( pMark->GetMarkStart().nNode == rNode.
GetIndex()) )
2119 aSortedStart.push_back( pMark );
2121 if ( nEnd > nCurrentPos && nEnd <= ( nCurrentPos + nLen ) && (pMark->GetMarkEnd().nNode == rNode.
GetIndex()) )
2122 aSortedEnd.push_back( pMark );
2126 std::sort( aSortedEnd.begin(), aSortedEnd.end(), CompareMarksEnd() );
2164 for (
auto const& it : tmp)
2169 while (
auto const*
const pMark = rIDMA.getFieldmarkFor(
SwPosition(const_cast<SwTextNode&>(rNd), pos)))
2171 if (pMark->GetMarkEnd().nNode != rNd)
2176 pos = pMark->GetMarkEnd().nContent.GetIndex();
2188 SAL_INFO(
"sw.ww8",
"<OutWW8_SwTextNode>" );
2193 bool bLastCR =
false;
2194 bool bExported =
false;
2198 if (aNextIdx == aLastIdx)
2221 rtl_TextEncoding eChrSet = aAttrIter.
GetCharSet();
2248 pFormula->PtrToBoxNm( &pTableNode->
GetTable() );
2281 auto aBreakIt = softBreakList.
begin();
2285 sal_Int32 nCurrentPos = *aBreakIt;
2287 if( softBreakList.
size() > 1 )
2290 if ( pNextSplitParaPageDesc == pNextSplitParaPageDesc->
GetFollow() )
2291 aBreakIt = --softBreakList.
end();
2319 OUString sBkmkName =
"_toc" + OUString::number( rNode.
GetIndex() );
2329 sal_Int32
const nEnd = bNeedParaSplit ? *aBreakIt :
aStr.getLength();
2330 bool bIncludeEndOfParaCRInRedlineProperties =
false;
2331 sal_Int32 nOpenAttrWithRange = 0;
2334 if ( pTextNodeInfo )
2336 pTextNodeInfoInner = pTextNodeInfo->getFirstInner();
2343 bool bPostponeWritingText = false ;
2344 OUString aSavedSnippet ;
2346 sal_Int32 nNextAttr =
GetNextPos( &aAttrIter, rNode, nCurrentPos );
2351 nCurrentPos = nNextAttr;
2358 bool bSingleEmptyRun = nCurrentPos == 0 && nNextAttr == 0;
2361 if( nNextAttr > nEnd )
2385 bPostponeWritingText = true ;
2388 nStateOfFlyFrame = aAttrIter.
OutFlys( nCurrentPos );
2400 if (nCurrentPos == 0)
2403 bool bTextAtr = aAttrIter.
IsTextAttr( nCurrentPos );
2406 sal_Int32 nLen = nNextAttr - nCurrentPos;
2407 if ( !bTextAtr && nLen )
2451 it->second >>= sFieldId;
2452 eFieldId =
static_cast<ww::eField>(sFieldId.toInt32());
2458 it->second >>= sCode;
2490 if ( !sOleId.isEmpty() )
2519 it->second >>= sFieldId;
2520 eFieldId =
static_cast<ww::eField>(sFieldId.toInt32());
2541 if ( isDropdownOrCheckbox )
2546 if ( isDropdownOrCheckbox )
2551 if ( isDropdownOrCheckbox )
2557 assert(!bNeedParaSplit || nCurrentPos <= *aBreakIt);
2558 if( bNeedParaSplit && nCurrentPos + ofs + nLen > *aBreakIt)
2559 nLen = *aBreakIt - nCurrentPos - ofs;
2562 OUString aSnippet( aAttrIter.
GetSnippet(
aStr, nCurrentPos + ofs, nLen ) );
2566 sal_Int32 nFirstLineIndent=0;
2569 if ( pTextNode && pTextNode->GetAttr(aSet) )
2578 aSnippet =
"\x09" + aSnippet;
2582 if ( bPostponeWritingText && (
FLY_POSTPONED != nStateOfFlyFrame ) )
2584 bPostponeWritingText = true ;
2585 aSavedSnippet = aSnippet ;
2589 bPostponeWritingText = false ;
2598 if (0 != nEnd && !(bPostponeWritingText &&
FLY_PROCESSED == nStateOfFlyFrame))
2603 aAttrIter.
OutAttr( nCurrentPos,
false );
2609 if ( nNextAttr == nEnd )
2611 OSL_ENSURE( nOpenAttrWithRange >= 0,
"odd to see this happening, expected >= 0" );
2612 if ( !bTextAtr && nOpenAttrWithRange <= 0 )
2615 bIncludeEndOfParaCRInRedlineProperties =
true;
2619 nStateOfFlyFrame = aAttrIter.
OutFlys( nEnd );
2629 if (bLastCR && (!bExported))
2635 WriteCR( pTextNodeInfoInner );
2646 aAttrIter.
OutAttr( nCurrentPos,
false );
2651 if ( nNextAttr == nEnd )
2653 OSL_ENSURE(nOpenAttrWithRange >= 0,
2654 "odd to see this happening, expected >= 0");
2655 bool bAttrWithRange = (nOpenAttrWithRange > 0);
2656 if ( nCurrentPos != nEnd )
2659 OSL_ENSURE(nOpenAttrWithRange == 0,
2660 "odd to see this happening, expected 0");
2670 if (bTextAtr || bAttrWithRange || bIncludeEndOfParaCRInRedlineProperties)
2673 nStateOfFlyFrame = aAttrIter.
OutFlys( nEnd );
2677 WriteCR( pTextNodeInfoInner );
2679 if (bLastCR && (!bExported))
2691 if (bIncludeEndOfParaCRInRedlineProperties)
2705 if( bPostponeWritingText &&
FLY_PROCESSED == nStateOfFlyFrame )
2715 aAttrIter.
OutAttr( nCurrentPos,
false );
2721 else if( bPostponeWritingText && !aSavedSnippet.isEmpty() )
2730 nCurrentPos = nNextAttr;
2734 while ( nCurrentPos < nEnd );
2737 if( bNeedParaSplit && *aBreakIt != rNode.
GetText().getLength() )
2739 pNextSplitParaPageDesc = pNextSplitParaPageDesc->
GetFollow();
2740 assert(pNextSplitParaPageDesc);
2746 bool bCheckSectionBreak =
true;
2748 if ( bNeedParaSplit )
2755 if ( !bCheckSectionBreak )
2758 if ( rBreak.GetBreak() == SvxBreak::PageAfter )
2760 if ( pNextNode && pNextNode->
FindPageDesc() != pNextSplitParaPageDesc )
2761 bCheckSectionBreak =
true;
2768 if ( bCheckSectionBreak )
2779 if ( pTextNodeInfo )
2782 SAL_INFO(
"sw.ww8", pTextNodeInfo->toString());
2786 if (pTextNodeInfoInner->isFirstInTable())
2788 const SwTable * pTable = pTextNodeInfoInner->getTable();
2791 if (pTabFormat !=
nullptr)
2810 static_cast<const SvxULSpaceItem*>(pItem)->GetUpper()) ||
2815 SvxULSpaceItem aUL( *static_cast<const SvxULSpaceItem*>(pItem) );
2828 pTmpSet->
Put( aUL );
2832 const bool bParaRTL = aAttrIter.
IsParaRTL();
2834 int nNumberLevel = -1;
2837 if (nNumberLevel >= 0 && nNumberLevel <
MAXLEVEL)
2843 pFormat = &pRule->
Get( nLvl );
2853 aLR.SetTextLeft( aLR.GetTextLeft() + pFormat->
GetAbsLSpace() );
2873 if (SfxItemState::SET !=
2888 pTmpSet->
Put( aLR );
2906 pTmpSet->
Put(aItem);
2921 (!pItem || pItem->GetValue() == SvxFrameDirection::Environment) &&
2922 rTextColl.
GetFrameDir().GetValue() == SvxFrameDirection::Environment
2934 if ( pAdjust && (pAdjust->
GetAdjust() == SvxAdjust::Left || pAdjust->
GetAdjust() == SvxAdjust::Right ) )
2959 ( pPoolItem ==
nullptr )
2961 : *static_cast<const SvxLRSpaceItem*>( pPoolItem ) );
2973 const SwNumFormat& rNumFormat = pRule->
Get( static_cast< sal_uInt16 >(nLevel) );
2992 pTmpSet->
Put( aLRSpace );
3010 if (rBreakAtParaStyle.
GetBreak() == SvxBreak::PageAfter)
3016 pTmpSet->
Put(rBreakAtParaStyle);
3037 const bool bKeep = rKeep.GetValue();
3038 const bool bDontSplit = !(bKeep ||
3041 if ( bKeep || bDontSplit )
3057 bool bSetAtPara =
false;
3060 else if ( bDontSplit )
3073 pTmpSet->
Put( aKeepItem );
3091 OutputItemSet( *pNewSet,
true,
false, i18n::ScriptType::LATIN,
false);
3111 bool bCharFormatOnly =
true;
3114 if (std::shared_ptr<SfxItemSet>
const& pSet = rListAutoFormat.
GetStyleHandle())
3116 aParagraphMarkerProperties.Put(*pSet);
3117 bCharFormatOnly =
false;
3121 for(
size_t i = 0;
i < pTextAttrs->Count(); ++
i )
3124 const sal_Int32 startPos = pHt->
GetStart();
3125 const sal_Int32* endPos = pHt->
End();
3129 if( endPos && (startPos == *endPos ) && (*endPos == rNode.
GetText().getLength()) )
3131 SAL_INFO(
"sw.ww8", startPos <<
"startPos == endPos" << *endPos);
3133 SAL_INFO(
"sw.ww8",
"nWhich" << nWhich);
3137 aParagraphMarkerProperties.Put(pHt->
GetAttr());
3140 bCharFormatOnly =
false;
3154 }
while(*aBreakIt != rNode.
GetText().getLength() && bNeedParaSplit );
3156 SAL_INFO(
"sw.ww8",
"</OutWW8_SwTextNode>" );
3172 bool bNoPageBreak =
false;
3176 bNoPageBreak =
true;
3186 case SvxBreak::PageBefore:
3187 case SvxBreak::PageAfter:
3188 bNoPageBreak =
false;
3195 bRet = bNoPageBreak;
3227 if ( !pSet && !bInTOX )
3282 pSectNd = pSectNdNext;
3298 {
"ooxml:CT_SdtDocPart_docPartGallery", uno::makeAny(OUString(
"Table of Contents"))},
3299 {
"ooxml:CT_SdtDocPart_docPartUnique", uno::makeAny(OUString(
"true"))},
3304 {
"ooxml:CT_SdtPr_docPartObj", uno::makeAny(aDocPropertyValues)},
3308 aGrabBag.
GetGrabBag()[
"SdtPr"] <<= aSdtPrPropertyValues;
3323 const SwNode& rEndTocNextNode = aEndTocNext.GetNode();
3328 aGrabBag.
GetGrabBag()[
"ParaSdtEndBefore"] <<=
true;
3342 pSepx->AppendSep(
Fc2Cp(
Strm().Tell()), pPageDesc, pFormat, nLnNum);
3352 bool bUseEscher =
true;
3408 aOffset -= aPageRect.
Pos();
3417 (RndStdIds::FLY_AT_PAGE != rAnch.
GetAnchorId()) &&
3461 if ( pRedline->
Next() )
3464 static const sal_uInt16 insSprmIds[ 3 ] =
3469 static const sal_uInt16 delSprmIds[ 3 ] =
3475 const sal_uInt16* pSprmIds =
nullptr;
3478 case RedlineType::Insert:
3479 pSprmIds = insSprmIds;
3482 case RedlineType::Delete:
3483 pSprmIds = delSprmIds;
3486 case RedlineType::Format:
3494 OSL_ENSURE(
false,
"Unhandled redline type for export");
3539 case css::text::RubyAdjust_LEFT:
3543 case css::text::RubyAdjust_CENTER:
3546 case css::text::RubyAdjust_RIGHT:
3550 case css::text::RubyAdjust_BLOCK:
3554 case css::text::RubyAdjust_INDENT_BLOCK:
3559 OSL_ENSURE(
false,
"Unhandled Ruby justification code" );
3563 if ( rRuby.
GetPosition() == css::text::RubyPosition::INTER_CHARACTER )
3588 const auto& rHeight = ItemGet<SvxFontHeightItem>(
3604 const auto& rHeight = DefaultItemGet<SvxFontHeightItem>(
3609 const OUString &rText = rNode.
GetText();
3610 sal_uInt16 nScript = i18n::ScriptType::LATIN;
3612 if (!rText.isEmpty())
SwSectionNode * FindSectionNode()
Search section node, in which it is.
const SwEndNode * EndOfSectionNode() const
virtual void WriteCR(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner=ww8::WW8TableNodeInfoInner::Pointer_t())=0
OUString GetSnippet(const OUString &rStr, sal_Int32 nCurrentPos, sal_Int32 nLen) const
constexpr TypedWhichId< SvxFrameDirectionItem > RES_FRAMEDIR(120)
constexpr TypedWhichId< SwFormatPageDesc > RES_PAGEDESC(93)
virtual AttributeOutputBase & AttrOutput() const =0
Access to the attribute output class.
virtual void OutputOLENode(const SwOLENode &)=0
Output SwOLENode.
bool Insert(const SvxTabStop &rTab)
sal_uLong GetIndex() const
const OUString & GetBaseURL() const
const sw::BroadcastingModify * m_pOutFormatNode
virtual void AppendSmartTags(SwTextNode &)
virtual ::sw::mark::IFieldmark * getFieldmarkAt(const SwPosition &rPos) const =0
get Fieldmark for CH_TXT_ATR_FIELDSTART/CH_TXT_ATR_FIELDEND at rPos
virtual const OUString & GetName() const =0
std::unique_ptr< ww::bytes > pO
Buffer.
void GetCurrentItems(ww::bytes &rItems) const
bool m_bLinkedTextboxesHelperInitialized
Represents the style of a paragraph.
sal_uInt16 AddRedlineAuthor(std::size_t nId)
bool IsSaveRelFSys() const
virtual void FormatDrop(const SwTextNode &rNode, const SwFormatDrop &rSwFormatDrop, sal_uInt16 nStyle, ww8::WW8TableNodeInfo::Pointer_t pTextNodeInfo, ww8::WW8TableNodeInfoInner::Pointer_t pTextNodeInfoInner)=0
Marks a position in the document model.
void OutSwString(const OUString &, sal_Int32 nStt, sal_Int32 nLen)
constexpr TypedWhichId< SvxTabStopItem > RES_PARATR_TABSTOP(68)
bool IsSectionNode() const
std::unique_ptr< WW8Fib > pFib
File Information Block.
virtual void SectionBreaks(const SwNode &rNode)=0
Called in order to output section breaks.
ww8::Frames GetFramesInNode(const ww8::Frames &rFrames, const SwNode &rNode)
Get the Frames anchored to a given node.
const SfxPoolItem & GetItem(sal_uInt16 nWhich) const
static const SwPageDesc * GetPageDescOfNode(const SwNode &rNd)
Given a SwNode return the pagedesc in use at that location.
Pagedescriptor Client of SwPageDesc that is "described" by the attribute.
SvxAdjust GetAdjust() const
virtual void EndParagraphProperties(const SfxItemSet &rParagraphMarkerProperties, const SwRedlineData *pRedlineData, const SwRedlineData *pRedlineParagraphMarkerDeleted, const SwRedlineData *pRedlineParagraphMarkerInserted)=0
Called after we end outputting the attributes.
SwOLENode * GetOLENode()
Inline methods from Node.hxx.
void WriteStringAsPara(const OUString &rText)
SwTableBox * GetTableBox() const
If node is in a table return the respective table box.
constexpr TypedWhichId< SwFormatMeta > RES_TXTATR_METAFIELD(49)
RndStdIds m_eNewAnchorType
const OUString & GetText() const
OUString const & GetPrimaryKey() const
sal_uInt16 GetId(const SwTextFormatColl &rColl) const
Return the numeric id of the style.
const SwFormatDrop & mrSwFormatDrop
SwpHints * GetpSwpHints()
const SwRedlineData * Next() const
SwRect FindLayoutRect(const bool bPrtArea=false, const Point *pPoint=nullptr) const
std::multimap< sal_Int32, OUString > m_aBookmarksOfParagraphEnd
const SwNumFormat * GetNumFormat(sal_uInt16 i) const
constexpr TypedWhichId< SvxFormatKeepItem > RES_KEEP(110)
OUString GetURLPath(DecodeMechanism eMechanism=DecodeMechanism::ToIUri, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8) const
virtual bool AnalyzeURL(const OUString &rURL, const OUString &rTarget, OUString *pLinkURL, OUString *pMark) override
std::size_t GetAuthor() const
virtual void Redline(const SwRedlineData *pRedline) override
Output redlining.
const SwRedlineData * GetParagraphLevelRedline()
std::vector< sal_uInt8 > bytes
virtual sal_Int32 Len() const override
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_LANGUAGE(10)
constexpr::Color COL_TRANSPARENT(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
virtual void EndRuby(const SwTextNode &rNode, sal_Int32 nPos)=0
Output ruby end.
constexpr TypedWhichId< SwNumRuleItem > RES_PARATR_NUMRULE(72)
static SW_DLLPUBLIC MarkType GetType(const ::sw::mark::IMark &rMark)
Returns the MarkType used to create the mark.
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_FONTSIZE(8)
const SwPosition * GetMark() const
const SwAttrSet * m_pStyAttr
const SwPageDesc * FindPageDesc(size_t *pPgDescNdIdx=nullptr) const
Search PageDesc with which this node is formatted.
LanguageType GetLanguage(SfxItemSet const &aSet, sal_uInt16 nLangWhichId)
rtl_TextEncoding meChrSet
SwFrameFormat & GetFirstMaster()
bool MiserableFormFieldExportHack(const SwFrameFormat &rFrameFormat)
Provides access to the marks of a document.
bool m_bOutPageDescs
PageDescs (section properties) are being written.
virtual void StartRuby(const SwTextNode &rNode, sal_Int32 nPos, const SwFormatRuby &rRuby)=0
Output ruby start.
virtual void OutputLinkedOLE(const OUString &)=0
std::stack< sal_Int32 > m_aCurrentCharPropStarts
To remember the position in a run.
constexpr TypedWhichId< SvxFormatBreakItem > RES_BREAK(94)
bool NeedSectionBreak(const SwNode &rNd) const
bool HasDummyChar() const
SwTableLine is one table row in the document model.
static void WriteString8(SvStream &rStrm, std::u16string_view rStr, bool bAddZero, rtl_TextEncoding eCodeSet)
const OUString & GetName() const
bool GetNewAbsURL(OUString const &rTheRelURIRef, INetURLObject *pTheAbsURIRef) const
static OUString GetRelURL(OUString const &rTheBaseURIRef, OUString const &rTheAbsURIRef, EncodeMechanism eEncodeMechanism=EncodeMechanism::WasEncoded, DecodeMechanism eDecodeMechanism=DecodeMechanism::ToIUri, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8, FSysStyle eStyle=FSysStyle::Detect)
SwSectionFormat * GetFormat()
SvxFrameDirection GetTextDirection(const SwPosition &rPos, const Point *pPt=nullptr) const
sal_uInt16 m_nStyleBeforeFly
style number of the node
void Pos(const Point &rNew)
bool AreListLevelIndentsApplicable() const
Determines, if the list level indent attributes can be applied to the paragraph.
IDocumentMarkAccess * getIDocumentMarkAccess()
virtual void StartRunProperties()=0
Called before we start outputting the attributes.
WW8_CP Fc2Cp(sal_uLong nFc) const
const SwTOXType * GetTOXType() const
Of course Writer needs its own rectangles.
void Set_UInt32(sal_uInt8 *&p, sal_uInt32 n)
static constexpr sal_uInt16 val
virtual sal_Int32 getAnnotationMarksCount() const =0
void OutputItemSet(const SfxItemSet &rSet, bool bPapFormat, bool bChpFormat, sal_uInt16 nScript, bool bExportParentItemSet)
Use OutputItem() on an item set according to the parameters.
void AppendFlyInFlys(const ww8::Frame &rFrameFormat, const Point &rNdTopLeft)
virtual SvxBrushItem * Clone(SfxItemPool *pPool=nullptr) const override
constexpr TypedWhichId< SfxGrabBagItem > RES_CHRATR_GRABBAG(43)
SVL_DLLPUBLIC OUString simpleNormalizedMakeRelative(OUString const &baseUriReference, OUString const &uriReference)
virtual const SfxPoolItem * HasTextItem(sal_uInt16 nWhich) const override
#define CH_TXT_ATR_FORMELEMENT
OUString FieldString(ww::eField eIndex)
virtual ExportFormat GetExportFormat() const =0
int GetActualListLevel() const
Returns the actual list level of this text node, when it is a list item.
std::shared_ptr< SvxBrushItem > TrueFrameBgBrush(const SwFrameFormat &rFlyFormat) const
constexpr TypedWhichId< SvxFontItem > RES_CHRATR_FONT(7)
SwTableFormat * GetFrameFormat()
const SwRedlineData * GetParagraphMarkerRedline(const SwTextNode &rNode, RedlineType aRedlineType)
IMarkVector m_rSortedAnnotationMarksEnd
virtual void SectionBreak(sal_uInt8 nC, bool bBreakAfter, const WW8_SepInfo *pSectionInfo=nullptr)=0
Write a section break msword::ColumnBreak or msword::PageBreak bBreakAfter: the break must be schedul...
void GetPoolItems(const SfxItemSet &rSet, ww8::PoolItems &rItems, bool bExportParentItemSet)
Get the SfxPoolItems of a SfxItemSet.
virtual void SetAnchorIsLinkedToNode(bool)
If the node has an anchor linked.
OUString PathToFileName() const
OUString BookmarkToWord(const OUString &rBookmark)
const SwSection & GetSection() const
sal_Int32 WhereNext() const
sal_uInt16 GetScript() const
void GenerateBookmarksForSequenceField(const SwTextNode &rNode, SwWW8AttrIter &rAttrIter)
MSO uses bookmarks to reference sequence fields, so we need to generate these additional bookmarks du...
constexpr TypedWhichId< SvxCaseMapItem > RES_CHRATR_CASEMAP(RES_CHRATR_BEGIN)
#define CH_TXTATR_BREAKWORD
sal_uInt16 IsFormulaOrValueBox() const
void WriteText()
Iterate through the nodes and call the appropriate OutputNode() on them.
void SetTextLeft(const tools::Long nL, const sal_uInt16 nProp=100)
RedlineType GetType() const
virtual void PageBreakBefore(bool bBreak)=0
Page break As a paragraph property - the paragraph should be on the next page.
virtual void AppendBookmarks(const SwTextNode &rNd, sal_Int32 nCurrentPos, sal_Int32 nLen)=0
virtual void OutputField(const SwField *pField, ww::eField eFieldType, const OUString &rFieldCmd, FieldFlags nMode=FieldFlags::All) override
Write the field.
SwWW8AttrIter(const SwWW8AttrIter &)=delete
SwNodeType GetNodeType() const
MSWordExportBase & m_rExport
std::map< OUString, LinkedTextboxInfo > m_aLinkedTextboxesHelper
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_CTL_LANGUAGE(29)
A wrapper around SfxPoolItem to store the start position of (usually) a text portion, with an optional end.
virtual ::sw::mark::IFieldmark * getFieldmarkFor(const SwPosition &pos) const =0
void OutputFormat(const SwFormat &rFormat, bool bPapFormat, bool bChpFormat, bool bFlyFormat=false)
Output attributes.
virtual bool StartURL(const OUString &rUrl, const OUString &rTarget) override
Output URL start.
void StartTOX(const SwSection &rSect)
sal_uLong GetIndex() const
virtual void StartRun(const SwRedlineData *pRedlineData, sal_Int32 nPos, bool bSingleEmptyRun=false)=0
Start of the text run.
sal_Int32 GetStart() const
const SvxBrushItem * GetCurrentPageBgBrush() const
MSWordAttrIter * m_pChpIter
virtual void SetStateOfFlyFrame(FlyProcessingState)
Set the state of the Fly at current position.
virtual void StartParagraphProperties()=0
Called before we start outputting the attributes.
virtual bool IsFlyProcessingPostponed()
Is processing of fly postponed ?
constexpr TypedWhichId< SwFormatRuby > RES_TXTATR_CJK_RUBY(53)
const SwTable & GetTable() const
virtual void ResetFlyProcessingFlag()
Reset the flag for FlyProcessing.
constexpr TypedWhichId< SfxGrabBagItem > RES_PARATR_GRABBAG(81)
constexpr TypedWhichId< SwFormatCharFormat > RES_TXTATR_CHARFMT(52)
virtual parameter_map_t * GetParameters()=0
const Graphic * GetGraphic(OUString const &referer=OUString()) const
void WriteChar(sal_Unicode c) override
constexpr TypedWhichId< SwFormatAutoFormat > RES_TXTATR_AUTOFMT(50)
static void UpdateTocSectionNodeProperties(const SwSectionNode &rSectionNode)
void handleToggleProperty(SfxItemSet &rExportSet, const SwFormatCharFormat *pCharFormatItem, sal_uInt16 nWhich, const SfxPoolItem *pValue)
ww8::WW8TableInfo::Pointer_t m_pTableInfo
void OutputItem(const SfxPoolItem &rHt)
Call the right virtual function according to the type of the item.
css::uno::Sequence< css::beans::PropertyValue > InitPropertySequence(::std::initializer_list< ::std::pair< OUString, css::uno::Any > > vInit)
SwAttrPool * GetPool() const
rtl_TextEncoding GetCharSet() const
constexpr TypedWhichId< SwFormatINetFormat > RES_TXTATR_INETFMT(51)
const SwFrameFormat & GetFrameFormat() const
Get the writer SwFrameFormat that this object describes.
const SwRedlineData & GetRedlineData(sal_uInt16 nPos=0) const
constexpr TypedWhichId< SvxWeightItem > RES_CHRATR_WEIGHT(15)
SwFormatColl & GetAnyFormatColl() const
const T & item_cast(const SfxPoolItem &rItem)
Provide a dynamic_cast style cast for SfxPoolItems.
void GetSortedAnnotationMarks(const SwWW8AttrIter &rAttrs, sal_Int32 nCurrentPos, sal_Int32 nLen)
SwNode & GetEndOfContent() const
Regular ContentSection (i.e. the BodyText).
static void WriteString16(SvStream &rStrm, const OUString &rStr, bool bAddZero)
virtual const_iterator_t getAllMarksBegin() const =0
returns a STL-like random access iterator to the begin of the sequence of marks.
const Color & GetColor() const
virtual sal_uLong ReplaceCr(sal_uInt8 nChar)=0
const OUString & GetAlternativeText() const
bool IsContentNode() const
const SwAttrSet * GetpSwAttrSet() const
sal_uInt32 GetRubyHeight() const
virtual bool AnalyzeURL(const OUString &rUrl, const OUString &rTarget, OUString *pLinkURL, OUString *pMark)
std::unique_ptr< WW8_WrPlcPn > m_pPapPlc
WW8Export & m_rWW8Export
Reference to the export, where to get the data from.
void OutputSectionNode(const SwSectionNode &)
Output SwSectionNode.
sal_uInt16 ClearItem(sal_uInt16 nWhich=0)
virtual void RunText(const OUString &rText, rtl_TextEncoding eCharSet=RTL_TEXTENCODING_UTF8)=0
Output text (inside a run).
static bool isRightToLeft(LanguageType nLang)
sal_Int32 GetNextPos(SwWW8AttrIter const *pAttrIter, const SwTextNode &rNode, sal_Int32 nCurrentPos)
Get the next position in the text node to output.
const sal_uInt8 ND_HAS_PREV_LAYNODE
void SplitRun(sal_Int32 nSplitEndPos)
virtual ~MSWordAttrIter()
virtual void FormatDrop(const SwTextNode &rNode, const SwFormatDrop &rSwFormatDrop, sal_uInt16 nStyle, ww8::WW8TableNodeInfo::Pointer_t pTextNodeInfo, ww8::WW8TableNodeInfoInner::Pointer_t pTextNodeInfoInner) override
SwTextAttr * Get(size_t nPos) const
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
void SetCurItemSet(const SfxItemSet *pS)
Setter for pISet.
std::map< sal_uInt16, const SfxPoolItem *, sw::util::ItemSort > PoolItems
STL container of SfxPoolItems (Attributes)
std::vector< Frame >::iterator FrameIter
STL iterator for Frames.
std::unique_ptr< WW8_WrPlcSepx > pSepx
Sections/headers/footers.
const SwStartNode * StartOfSectionNode() const
WW8Ruby(const SwTextNode &rNode, const SwFormatRuby &rRuby, const MSWordExportBase &rExport)
void NearestAnnotationMark(sal_Int32 &rNearest, const sal_Int32 nCurrentPos, bool bNextPositionOnly)
Find the nearest annotation mark from the current position.
void UpdatePosition(SwWW8AttrIter *pAttrIter, sal_Int32 nCurrentPos)
Update the information for GetNextPos().
const SwPosition * GetPoint() const
OUString GetURLNoMark(DecodeMechanism eMechanism=DecodeMechanism::ToIUri, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8) const
FlyProcessingState OutFlys(sal_Int32 nSwPos)
const SwPageDesc & GetPageDesc(const size_t i) const
const SwTOXBase * GetTOXBase() const
virtual void OutputTextNode(SwTextNode &)
Output SwTextNode.
sw::util::CharRuns maCharRuns
void EndCommentOutput(std::u16string_view rName)
void OutputContentNode(SwContentNode &)
Call the right (virtual) function according to the type of the item.
virtual void ExportGrfBullet(const SwTextNode &rNd)=0
SwContentNode * GetContentNode()
sal_uInt8 HasPrevNextLayNode() const
vector_type::size_type size_type
sal_uInt16 GetLevel() const
static void WriteShort(SvStream &rStrm, sal_Int16 nVal)
tools::Long GetLeft() const
const ww8::Frame * m_pParentFrame
virtual WW8Export & GetExport() override
Return the right export class.
static sal_Int32 lcl_getMinPos(sal_Int32 pos1, sal_Int32 pos2)
void SetTextFirstLineOffset(const short nF, const sal_uInt16 nProp=100)
std::size_t WriteBytes(const void *pData, std::size_t nSize)
virtual void StartParagraph(ww8::WW8TableNodeInfo::Pointer_t pTextNodeInfo)=0
Start of the paragraph.
Marks a character position inside a document model node.
bool HasRefToAttr(const OUString &rName)
Find the reference.
#define CH_TXT_ATR_FIELDSTART
const SwRedlineData * GetRunLevelRedline(sal_Int32 nPos)
sal_uInt16 GetWhichOfScript(sal_uInt16 nWhich, sal_uInt16 nScript)
const DateTime & GetTimeStamp() const
SwNumRule * GetNumRule(bool bInParent=true) const
Returns numbering rule of this text node.
SvxFrameDirection GetDefaultFrameDirection() const
const std::map< OUString, css::uno::Any > & GetGrabBag() const
static OUString GetScheme(INetProtocol eTheScheme)
virtual void OutputField(const SwField *pField, ww::eField eFieldType, const OUString &rFieldCmd, FieldFlags nMode=FieldFlags::All)=0
Write the field.
SwFrameFormat * GetFrameFormat()
virtual const_iterator_t getAnnotationMarksBegin() const =0
bool KnowsPageDesc() const
short GetTextFirstLineOffset() const
void OutputFlyFrame(const ww8::Frame &rFormat)
Output frames.
virtual void EndRuby(const SwTextNode &rNode, sal_Int32 nPos) override
Output ruby end.
virtual void WriteCR(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner=ww8::WW8TableNodeInfoInner::Pointer_t()) override
Marks a node in the document model.
SwWW8Writer & GetWriter() const
SwFrameFormat * GetFrameFormat()
SwNodes & GetNodes()
Node is in which nodes-array/doc?
static void CorrectTabStopInSet(SfxItemSet &rSet, sal_Int32 nAbsLeft)
bool HasSwAttrSet() const
const_iterator end() const
void InsUInt16(sal_uInt16 n)
virtual void OutputGrfNode(const SwGrfNode &)=0
Output SwGrfNode.
virtual void TableInfoCell(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfo)=0
const sal_Unicode cMarkSeparator
const SwRangeRedline * pCurRedline
sal_uInt16 GetBoxPos(const SwTableBox *pBox) const
void InsUInt32(sal_uInt32 n)
void EndTOX(const SwSection &rSect, bool bCareEnd=true)
SwTableLines & GetTabLines()
IMarkVector m_rSortedAnnotationMarksStart
SwTable is one table in the document model, containing rows (which contain cells).
sal_uInt32 GetBaseHeight() const
sal_Int16 GetWordFirstLineOffset(const SwNumFormat &rFormat)
const SwPosition * Start() const
void GetSortedBookmarks(const SwTextNode &rNd, sal_Int32 nCurrentPos, sal_Int32 nLen)
const SwPageDesc * GetFollow() const
virtual void EndRunProperties(const SwRedlineData *pRedlineData)=0
Called after we end outputting the attributes.
const SwNodeIndex * GetContentIdx() const
const_iterator begin() const
virtual const SwRangeRedline * GetRedline(const SwPosition &rPos, SwRedlineTable::size_type *pFndPos) const =0
CharRuns GetPseudoCharRuns(const SwTextNode &rTextNd)
Collect the ranges of Text which share.
css::uno::Reference< css::i18n::XBreakIterator > const & GetBreakIter() const
OUString GetMainURL(DecodeMechanism eMechanism, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8) const
void fillSoftPageBreakList(SwSoftPageBreakList &rBreak) const
const SwNumFormat & Get(sal_uInt16 i) const
virtual void RTLAndCJKState(bool bIsRTL, sal_uInt16 nScript)=0
Export the state of RTL/CJK.
OUString const & GetFontFamily() const
const css::lang::Locale & GetLocale(const LanguageType aLang)
SwFrameFormat & GetMaster()
sal_uLong EndOfSectionIndex() const
void OutSwFormatRefMark(const SwFormatRefMark &rAttr)
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
SwTextNode is a paragraph in the document model.
sal_Int32 GetDropLen(sal_Int32 nWishLen) const
nWishLen = 0 indicates that we want a whole word
void SetCaseMap(const SvxCaseMap eNew)
virtual void WriteBookmarkInActParagraph(const OUString &rName, sal_Int32 nFirstRunPos, sal_Int32 nLastRunPos) override
Insert a bookmark inside the currently processed paragraph.
char GetDirective() const
IDocumentRedlineAccess const & getIDocumentRedlineAccess() const
constexpr TypedWhichId< SwTableBoxFormula > RES_BOXATR_FORMULA(149)
constexpr sal_uInt16 RES_TXTATR_END(RES_TXTATR_NOEND_END)
IMarkVector m_rSortedBookmarksEnd
const SwStartNode * GetSttNd() const
OUString BookmarkToWriter(const OUString &rBookmark)
const SwPageDesc * m_pCurrentPageDesc
An SwTextAttr container, stores all directly formatted text portions for a text node.
OUString GetExpandText(SwRootFrame const *pLayout, const sal_Int32 nIdx=0, const sal_Int32 nLen=-1, const bool bWithNum=false, const bool bAddSpaceAfterListLabelStr=false, const bool bWithSpacesForLevel=false, const ExpandMode eAdditionalMode=ExpandMode::ExpandFootnote) const
add 4th optional parameter indicating, when that a spa...
constexpr sal_uInt16 RES_CHRATR_BEGIN(HINT_BEGIN)
virtual void StartRuby(const SwTextNode &rNode, sal_Int32 nPos, const SwFormatRuby &rRuby) override
Output ruby start.
constexpr TypedWhichId< SvxBrushItem > RES_BACKGROUND(105)
static OUString lcl_getLinkChainName(const uno::Reference< beans::XPropertySet > &rPropertySet, const uno::Reference< beans::XPropertySetInfo > &rPropertySetInfo)
bool HasFlysAt(sal_Int32 nSwPos) const
virtual const SfxPoolItem & GetItem(sal_uInt16 nWhich) const override
static OUString & TruncateBookmark(OUString &rRet)
bool GetDropSize(int &rFontHeight, int &rDropHeight, int &rDropDescent) const
Passes back info needed on the dropcap dimensions.
virtual sal_Int32 getAllMarksCount() const =0
returns the number of marks.
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
OUString const & GetSecondaryKey() const
FlyProcessingState
enum to state the present state of the fly
Make exporting a Writer Frame easy.
bool IsDropCap(int nSwPos)
bool IsNumbered(SwRootFrame const *pLayout=nullptr) const
Returns is this text node is numbered.
const SwContentNode * GetContentNode() const
Get the node this frame is anchored into.
bool IncludeEndOfParaCRInRedlineProperties(sal_Int32 nPos) const
sal_uInt32 DateTime2DTTM(const DateTime &rDT)
Convert from DTTM to Writer's DateTime.
virtual void AppendAnnotationMarks(const SwWW8AttrIter &rAttrs, sal_Int32 nCurrentPos, sal_Int32 nLen)=0
const ::std::vector< Color > ImpSvNumberformatScan::StandardColor COL_WHITE
#define SAL_INFO(area, stream)
SvStream & WriteUChar(unsigned char nChar)
sal_Int32 GetIndex() const
SvStream * pDataStrm
Streams for WW97 Export.
bool IsCountedInList() const
INetProtocol GetProtocol() const
LanguageType GetAppLanguage()
IDocumentSettingAccess const & getIDocumentSettingAccess() const
const sal_uInt8 PageBreak
std::pair< OUString, sal_uLong > aBookmarkPair
sw::util::CharRuns::const_iterator maCharRunIter
const SwPosition * End() const
OUString CalcCaseMap(const OUString &rTxt) const
std::multimap< sal_Int32, OUString > m_aBookmarksOfParagraphStart
Bookmarks of the current paragraph.
virtual void SaveData(sal_uLong nStt, sal_uLong nEnd) override
Remember some of the members so that we can recurse in WriteText().
RedlineType GetType(sal_uInt16 nPos=0) const
bool HasItem(sal_uInt16 nWhich, const SfxPoolItem **ppItem=nullptr) const
const sal_Int32 * End() const
SwTableBox is one table cell in the document model.
bool NearestBookmark(sal_Int32 &rNearest, const sal_Int32 nCurrentPos, bool bNextPositionOnly)
Find the nearest bookmark from the current position.
virtual void FieldVanish(const OUString &rText, ww::eField eType)=0
virtual bool EndURL(bool isAtEndOfParagraph)=0
Output URL end.
std::shared_ptr< WW8TableNodeInfoInner > Pointer_t
constexpr TypedWhichId< SwTOXMark > RES_TXTATR_TOXMARK(47)
constexpr TypedWhichId< SvxLRSpaceItem > RES_LR_SPACE(91)
virtual void AppendSection(const SwPageDesc *pPageDesc, const SwSectionFormat *pFormat, sal_uLong nLnNum) override
bool IsPlausableSingleWordSection(const SwFrameFormat &rTitleFormat, const SwFrameFormat &rFollowFormat)
See if two page formats can be expressed as a single word section.
virtual void ParagraphStyle(sal_uInt16 nStyle)=0
Output style.
bool GetBookmarks(const SwTextNode &rNd, sal_Int32 nStt, sal_Int32 nEnd, IMarkVector &rArr)
virtual bool get(DocumentSettingId id) const =0
Return the specified document setting.
virtual const SwPosition & GetMarkEnd() const =0
static void InsUInt16(ww::bytes &rO, sal_uInt16 n)
virtual void TableInfoCell(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfo) override
#define CH_TXT_ATR_FIELDEND
bool GetAnnotationMarks(const SwWW8AttrIter &rAttrs, sal_Int32 nStt, sal_Int32 nEnd, IMarkVector &rArr)
const SwAttrSet & GetSwAttrSet() const
Does node has already its own auto-attributes? Access to SwAttrSet.
void StartCommentOutput(std::u16string_view rName)
SwTableNode * FindTableNode()
Search table node, in which it is.
virtual bool StartURL(const OUString &rUrl, const OUString &rTarget)=0
Output URL start.
virtual void PrepareNewPageDesc(const SfxItemSet *pSet, const SwNode &rNd, const SwFormatPageDesc *pNewPgDescFormat, const SwPageDesc *pNewPgDesc)=0
const SfxPoolItem & GetAttr() const
void ExportPoolItemsToCHP(ww8::PoolItems &rItems, sal_uInt16 nScript, const SvxFontItem *pFont, bool bWriteCombChars=false)
Export the pool items to attributes (through an attribute output class).
constexpr TypedWhichId< SwFormatAutoFormat > RES_PARATR_LIST_AUTOFMT(87)
virtual OUString GetFieldname() const =0
virtual void Redline(const SwRedlineData *pRedline)=0
Output redlining.
#define SAL_WARN(area, stream)
Base class for WW8Export and DocxExport.
OUString GetMark(DecodeMechanism eMechanism=DecodeMechanism::ToIUri, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8) const
static OUString lcl_getFieldCode(const IFieldmark *pFieldmark)
sal_Int32 SearchNext(sal_Int32 nStartPos)
SwRedlineTable::size_type nCurRedlinePos
constexpr TypedWhichId< SwFormatLineNumber > RES_LINENUMBER(116)
sal_uInt16 GetPos(const SwTableLine *pBox) const
bool IsExportableAttr(sal_Int32 nSwPos) const
SvxFrameDirection GetCurrentPageDirection() const
Right to left?
const SwFormatDrop & GetSwFormatDrop() const
virtual const SwPosition & GetMarkStart() const =0
static OUString GetBookmarkName(sal_uInt16 nTyp, const OUString *pName, sal_uInt16 nSeqNo)
Find the bookmark name.
virtual void EndParagraph(ww8::WW8TableNodeInfoInner::Pointer_t pTextNodeInfoInner)=0
End of the paragraph.
const SwTextTOXMark * GetTextTOXMark() const
const SwTextNode & GetNode() const
bool IsInline() const
Is this frame inline (as character)
WriterSource GetWriterType() const
Get the type of frame that this wraps.
constexpr TypedWhichId< SwFormatRefMark > RES_TXTATR_REFMARK(RES_TXTATR_WITHEND_BEGIN)
SectionType GetType() const
MSWordAttrIter(const MSWordAttrIter &)=delete
static SwTextFormatColl & lcl_getFormatCollection(MSWordExportBase &rExport, const SwTextNode *pTextNode)
Delivers the right paragraph style.
virtual void WriteHyperlinkData(const ::sw::mark::IFieldmark &rFieldmark)=0
static bool NoPageBreakSection(const SfxItemSet *pSet)
virtual const SwRedlineTable & GetRedlineTable() const =0
void TOXMark(const SwTextNode &rNode, const SwTOXMark &rAttr)
std::vector< ::sw::mark::IMark * > IMarkVector
Used to split the runs according to the bookmarks start and ends.
std::pair< const_iterator, bool > insert(Value &&x)
const SfxPoolItem & GetAttr(sal_uInt16 nWhich, bool bInParent=true) const
SS for PoolItems: hard attributation.
virtual void AppendBookmark(const OUString &rName)=0
void ClearOverridesFromSet(const SwFormatCharFormat &rFormat, SfxItemSet &rSet)
Remove properties from an SfxItemSet which a SwFormatCharFormat overrides.
void OutAttr(sal_Int32 nSwPos, bool bWriteCombinedChars)
virtual void RestoreData() override
Restore what was saved in SaveData().
const SfxPoolItem * GetItem(sal_uInt16 nWhich, bool bSearchInParent=true) const
bool IsTextAttr(sal_Int32 nSwPos) const
void OutputFlyFrame_Impl(const ww8::Frame &rFormat, const Point &rNdTopLeft) override
Output frames - the implementation.
virtual bool EndURL(bool) override
Output URL end.
#define CH_TXT_ATR_FIELDSEP
virtual void WriteFormData(const ::sw::mark::IFieldmark &rFieldmark)=0
Write the data of the form field.
int OutAttrWithRange(const SwTextNode &rNode, sal_Int32 nPos)
static ww::eField lcl_getFieldId(const IFieldmark *const pFieldmark)
The class MSWordAttrIter is a helper class to build the Fkp.chpx.
SvtSaveOptions m_aSaveOpt
std::shared_ptr< WW8TableNodeInfo > Pointer_t
static void WriteLong(SvStream &rStrm, sal_Int32 nVal)
const SwPosition & GetPosition() const
Get the position this frame is anchored at.
bool IsInTable() const
Return whether currently exported node is in table.
bool NeedTextNodeSplit(const SwTextNode &rNd, SwSoftPageBreakList &pList) const
SwFrameFormat * GetFlyFormat() const
If node is in a fly return the respective format.
SwCharFormat * GetCharFormat()
SwContentNode * GoNext(SwNodeIndex *) const
virtual void AppendSection(const SwPageDesc *pPageDesc, const SwSectionFormat *pFormat, sal_uLong nLnNum)=0
const sal_uInt8 ND_HAS_NEXT_LAYNODE
constexpr TypedWhichId< SvxULSpaceItem > RES_UL_SPACE(92)
virtual void EndRun(const SwTextNode *pNode, sal_Int32 nPos, bool bLastRun=false)=0
End of the text run.
SwRect FindPageFrameRect() const
virtual void EmptyParagraph() override
Empty paragraph.
std::unique_ptr< WW8_WrPlcPn > m_pChpPlc
constexpr TypedWhichId< SvxAdjustItem > RES_PARATR_ADJUST(64)
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_CJK_LANGUAGE(24)
SvxFrameDirection TrueFrameDirection(const SwFrameFormat &rFlyFormat) const
Right to left?
OUString ConvertURL(const OUString &rUrl, bool bAbsoluteOut)
IMarkVector m_rSortedBookmarksStart
virtual MSWordExportBase & GetExport()=0
Return the right export class.
static OUString encode(OUString const &rText, Part ePart, EncodeMechanism eMechanism, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8)
const SwAttrPool & GetAttrPool() const
std::vector< aBookmarkPair > m_aImplicitBookmarks
virtual void OutputFlyFrame_Impl(const ww8::Frame &rFormat, const Point &rNdTopLeft)=0
Output frames - the implementation.
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
bool IsAnchorLinkedToThisNode(sal_uLong nNodePos)
std::unique_ptr< MSWordStyles > m_pStyles
virtual void WritePostitFieldReference()
for docx w:commentReference
virtual void FieldVanish(const OUString &rText, ww::eField eType) override
virtual void OutputFKP(bool)
Output FKP (Formatted disK Page) - necessary for binary formats only.
bool RequiresImplicitBookmark()
Base class of the Writer document model elements.
static OUString decode(OUString const &rText, DecodeMechanism eMechanism, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8)