23#include <com/sun/star/embed/ElementModes.hpp>
24#include <com/sun/star/embed/XStorage.hpp>
25#include <com/sun/star/frame/XModel.hpp>
26#include <com/sun/star/packages/XPackageEncryption.hpp>
27#include <com/sun/star/uno/XComponentContext.hpp>
35#include <osl/endian.h>
59#include <../../core/inc/rootfrm.hxx>
99#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
100#include <com/sun/star/document/XDocumentProperties.hpp>
108#include <rtl/random.h>
184typedef std::pair<bool,OUString>
BKMK;
185typedef std::pair<tools::Long,BKMK>
BKMKCP;
186typedef std::multimap<tools::Long,BKMKCP*>
BKMKCPs;
219 delete rEntry.second;
220 rEntry.second =
nullptr;
227 std::pair<BKMKNames::iterator, bool> aResult =
maSwBkmkNms.insert(std::pair<OUString,tools::Long>(rNm,0L));
232 maSttCps.insert(std::pair<tools::Long,BKMKCP*>(nStartCp,pBKCP));
233 aResult.first->second =
static_cast<tools::Long>(nStartCp);
237 std::pair<CPItr,CPItr> aRange =
maSttCps.equal_range(aResult.first->second);
238 for (
CPItr aItr = aRange.first;aItr != aRange.second;++aItr)
240 if (aItr->second && aItr->second->second.second == rNm)
242 if (aItr->second->second.first)
244 aItr->second->first =
static_cast<tools::Long>(nStartCp);
256 std::vector<OUString> aNames;
265 aEndCps.insert(std::pair<tools::Long,BKMKCP*>(rEntry.second->first, rEntry.second));
266 aNames.push_back(rEntry.second->second.second);
273 for (
const auto& rEntry : aEndCps)
277 rEntry.second->first =
n;
305 std::pair<CPItr,CPItr> aRange =
maSttCps.equal_range(nFrom);
306 CPItr aItr = aRange.first;
307 while (aItr != aRange.second)
311 if (aItr->second->first ==
static_cast<tools::Long>(nFrom))
313 aItr->second->second.first =
true;
314 aItr->second->first = nTo;
316 maSttCps.insert(std::pair<tools::Long,BKMKCP*>(nTo,aItr->second));
317 aItr->second =
nullptr;
318 aRange =
maSttCps.equal_range(nFrom);
338 void Append(
WW8_CP nStartCp,
WW8_CP nEndCp,
const std::map<OUString, OUString>& rStatements);
359 rExport.
m_pDop->fEmbedFactoids =
true;
363 rExport.
m_pFib->m_fcSttbfBkmkFactoid = rStream.
Tell();
378 rExport.
m_pFib->m_lcbSttbfBkmkFactoid = rStream.
Tell() - rExport.
m_pFib->m_fcSttbfBkmkFactoid;
380 rExport.
m_pFib->m_fcPlcfBkfFactoid = rStream.
Tell();
393 rExport.
m_pFib->m_lcbPlcfBkfFactoid = rStream.
Tell() - rExport.
m_pFib->m_fcPlcfBkfFactoid;
395 rExport.
m_pFib->m_fcPlcfBklFactoid = rStream.
Tell();
406 rExport.
m_pFib->m_lcbPlcfBklFactoid = rStream.
Tell() - rExport.
m_pFib->m_fcPlcfBklFactoid;
408 rExport.
m_pFib->m_fcFactoidData = rStream.
Tell();
411 aFactoidType.
m_nId = 1;
412 aFactoidType.
m_aUri =
"http://www.w3.org/1999/02/22-rdf-syntax-ns#";
413 aFactoidType.
m_aTag =
"RDF";
417 std::set<OUString> aSet;
418 for (
const std::map<OUString, OUString>& rStatements :
m_aStatements)
421 for (
const auto& rPair : rStatements)
423 aSet.insert(rPair.first);
424 aSet.insert(rPair.second);
428 for (
const std::map<OUString, OUString>& rStatements :
m_aStatements)
431 aPropertyBag.
m_nId = 1;
432 for (
const auto& rPair : rStatements)
435 aProperty.
m_nKey = std::distance(aSet.begin(), aSet.find(rPair.first));
436 aProperty.
m_nValue = std::distance(aSet.begin(), aSet.find(rPair.second));
442 aSmartTagData.
Write(rExport);
443 rExport.
m_pFib->m_lcbFactoidData = rStream.
Tell() - rExport.
m_pFib->m_fcFactoidData;
446#define DEFAULT_STYLES_COUNT 16
466 rDop.
dxaTab = o3tl::narrowing<sal_uInt16>(rTabStop[0].GetTabPos());
474 case SvxZoomType::WHOLEPAGE: rDop.
zkSaved = 1;
break;
475 case SvxZoomType::PAGEWIDTH: rDop.
zkSaved = 2;
break;
476 case SvxZoomType::OPTIMAL: rDop.
zkSaved = 3;
break;
490 rDop.
cPg =
static_cast< sal_Int16
>(rDStat.
nPage);
495 OSL_ENSURE(pDocShell,
"no SwDocShell");
496 uno::Reference<document::XDocumentProperties> xDocProps;
497 uno::Reference<beans::XPropertySet> xProps;
500 uno::Reference<lang::XComponent> xModelComp = pDocShell->
GetModel();
501 xProps.set(xModelComp, uno::UNO_QUERY);
502 uno::Reference<document::XDocumentPropertiesSupplier> xDPS(xModelComp, uno::UNO_QUERY_THROW);
503 xDocProps = xDPS->getDocumentProperties();
504 OSL_ENSURE(xDocProps.is(),
"DocumentProperties is null");
538 ::util::DateTime uDT = xDocProps->getCreationDate();
540 uDT = xDocProps->getModificationDate();
542 uDT = xDocProps->getPrintDate();
570 if( nMSStrByteLen > rSWStr.getLength() )
571 nMSStrByteLen = rSWStr.getLength()+1;
574 return memcmp( rSWStr.getStr(), pMSStr, nMSStrByteLen );
588 0x0021, 0x0025, 0x0029, 0x002c, 0x002e, 0x003a, 0x003b, 0x003f,
589 0x005d, 0x007d, 0x00a2, 0x00b0, 0x2019, 0x201d, 0x2030, 0x2032,
590 0x2033, 0x2103, 0x3001, 0x3002, 0x3005, 0x3009, 0x300b, 0x300d,
591 0x300f, 0x3011, 0x3015, 0x3041, 0x3043, 0x3045, 0x3047, 0x3049,
592 0x3063, 0x3083, 0x3085, 0x3087, 0x308e, 0x309b, 0x309c, 0x309d,
593 0x309e, 0x30a1, 0x30a3, 0x30a5, 0x30a7, 0x30a9, 0x30c3, 0x30e3,
594 0x30e5, 0x30e7, 0x30ee, 0x30f5, 0x30f6, 0x30fb, 0x30fc, 0x30fd,
595 0x30fe, 0xff01, 0xff05, 0xff09, 0xff0c, 0xff0e, 0xff1a, 0xff1b,
596 0xff1f, 0xff3d, 0xff5d, 0xff61, 0xff63, 0xff64, 0xff65, 0xff67,
597 0xff68, 0xff69, 0xff6a, 0xff6b, 0xff6c, 0xff6d, 0xff6e, 0xff6f,
598 0xff70, 0xff9e, 0xff9f, 0xffe0
602 0x0021, 0x0029, 0x002c, 0x002e, 0x003a, 0x003b, 0x003f, 0x005d,
603 0x007d, 0x00a8, 0x00b7, 0x02c7, 0x02c9, 0x2015, 0x2016, 0x2019,
604 0x201d, 0x2026, 0x2236, 0x3001, 0x3002, 0x3003, 0x3005, 0x3009,
605 0x300b, 0x300d, 0x300f, 0x3011, 0x3015, 0x3017, 0xff01, 0xff02,
606 0xff07, 0xff09, 0xff0c, 0xff0e, 0xff1a, 0xff1b, 0xff1f, 0xff3d,
607 0xff40, 0xff5c, 0xff5d, 0xff5e, 0xffe0
611 0x0021, 0x0025, 0x0029, 0x002c, 0x002e, 0x003a, 0x003b, 0x003f,
612 0x005d, 0x007d, 0x00a2, 0x00b0, 0x2019, 0x201d, 0x2032, 0x2033,
613 0x2103, 0x3009, 0x300b, 0x300d, 0x300f, 0x3011, 0x3015, 0xff01,
614 0xff05, 0xff09, 0xff0c, 0xff0e, 0xff1a, 0xff1b, 0xff1f, 0xff3d,
619 0x0021, 0x0029, 0x002c, 0x002e, 0x003a, 0x003b, 0x003f, 0x005d,
620 0x007d, 0x00a2, 0x00b7, 0x2013, 0x2014, 0x2019, 0x201d, 0x2022,
621 0x2025, 0x2026, 0x2027, 0x2032, 0x2574, 0x3001, 0x3002, 0x3009,
622 0x300b, 0x300d, 0x300f, 0x3011, 0x3015, 0x301e, 0xfe30, 0xfe31,
623 0xfe33, 0xfe34, 0xfe36, 0xfe38, 0xfe3a, 0xfe3c, 0xfe3e, 0xfe40,
624 0xfe42, 0xfe44, 0xfe4f, 0xfe50, 0xfe51, 0xfe52, 0xfe54, 0xfe55,
625 0xfe56, 0xfe57, 0xfe5a, 0xfe5c, 0xfe5e, 0xff01, 0xff09, 0xff0c,
626 0xff0e, 0xff1a, 0xff1b, 0xff1f, 0xff5c, 0xff5d, 0xff64
634 0x0024, 0x0028, 0x005b, 0x005c, 0x007b, 0x00a3, 0x00a5, 0x2018,
635 0x201c, 0x3008, 0x300a, 0x300c, 0x300e, 0x3010, 0x3014, 0xff04,
636 0xff08, 0xff3b, 0xff5b, 0xff62, 0xffe1, 0xffe5
640 0x0028, 0x005b, 0x007b, 0x00b7, 0x2018, 0x201c, 0x3008, 0x300a,
641 0x300c, 0x300e, 0x3010, 0x3014, 0x3016, 0xff08, 0xff0e, 0xff3b,
642 0xff5b, 0xffe1, 0xffe5
646 0x0028, 0x005b, 0x005c, 0x007b, 0x00a3, 0x00a5, 0x2018, 0x201c,
647 0x3008, 0x300a, 0x300c, 0x300e, 0x3010, 0x3014, 0xff04, 0xff08,
648 0xff3b, 0xff5b, 0xffe6
652 0x0028, 0x005b, 0x007b, 0x00a3, 0x00a5, 0x2018, 0x201c, 0x2035,
653 0x3008, 0x300a, 0x300c, 0x300e, 0x3010, 0x3014, 0x301d, 0xfe35,
654 0xfe37, 0xfe39, 0xfe3b, 0xfe3d, 0xfe3f, 0xfe41, 0xfe43, 0xfe59,
655 0xfe5b, 0xfe5d, 0xff08, 0xff5b
659 const i18n::ForbiddenCharacters *pForbidden =
nullptr;
660 const i18n::ForbiddenCharacters *pUseMe =
nullptr;
689 if (
nullptr != pForbidden)
693 aLangNotEnd[ nIdx ],
sizeof(aLangNotEnd[ nIdx ]) ) ||
695 aLangNotBegin[ nIdx ],
sizeof(aLangNotBegin[ nIdx ]) ) )
711 pForbidden->beginLine,
733 OSL_ENSURE( nNoNeeded<=1,
"Example of unexportable forbidden chars" );
738 (pUseMe->beginLine.getLength());
743 (pUseMe->endLine.getLength());
778 OSL_ENSURE(
false,
"Where is my ItemSet / pChpIter ?" );
793 OSL_ENSURE(nWhich != 0,
"All broken, Impossible");
801 m_nDataLen(16 * nStructSz),
802 m_nStructSiz( nStructSz )
813 OSL_ENSURE(b,
"Prev called on empty list");
814 return b ?
m_aPos.back() : 0;
835 m_aPos.push_back( nLastCp );
863 pfc = &rWrt.
m_pFib->m_fcPlcffldMom;
864 plc = &rWrt.
m_pFib->m_lcbPlcffldMom;
867 pfc = &rWrt.
m_pFib->m_fcPlcffldHdr;
868 plc = &rWrt.
m_pFib->m_lcbPlcffldHdr;
872 pfc = &rWrt.
m_pFib->m_fcPlcffldFootnote;
873 plc = &rWrt.
m_pFib->m_lcbPlcffldFootnote;
877 pfc = &rWrt.
m_pFib->m_fcPlcffldEdn;
878 plc = &rWrt.
m_pFib->m_lcbPlcffldEdn;
882 pfc = &rWrt.
m_pFib->m_fcPlcffldAtn;
883 plc = &rWrt.
m_pFib->m_lcbPlcffldAtn;
887 pfc = &rWrt.
m_pFib->m_fcPlcffldTxbx;
888 plc = &rWrt.
m_pFib->m_lcbPlcffldTxbx;
892 pfc = &rWrt.
m_pFib->m_fcPlcffldHdrTxbx;
893 plc = &rWrt.
m_pFib->m_lcbPlcffldHdrTxbx;
916 rWrt.
m_pFib->m_fcPlcfTch = nFcStart;
930 UInt32ToSVBT32(nData,nLittle);
937 static const sal_uInt32 aNulls[16] =
939 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
954 nEndPos = (nCurPos + 0x1ff) & ~0x1ffUL;
956 if( nEndPos > nCurPos )
958#if OSL_DEBUG_LEVEL > 0
960 OSL_ENSURE( nEndPos == nCurPos,
"Wrong FillUntil()" );
970 m_Fkps.push_back(std::make_unique<WW8_WrFkp>(
m_ePlc, nStartFc));
1003 nVarLen =
static_cast< short >(
p - aHugePapx);
1004 pSprms = pNewSprms = aHugePapx;
1008 else if( nVarLen && pF->
IsEqualPos( nEndFc ))
1018 bool bOk = pF->
Append(nEndFc, nVarLen, pNewSprms);
1024 m_Fkps.push_back(std::unique_ptr<WW8_WrFkp>(pF));
1025 if( !pF->
Append( nEndFc, nVarLen, pNewSprms ) )
1027 OSL_ENSURE(
false,
"Unable to insert Sprm" );
1030 if( pNewSprms != pSprms )
1038 for(
const std::unique_ptr<WW8_WrFkp> & rp :
m_Fkps)
1058 decltype(
m_Fkps)::size_type
i;
1067 m_Fkps[
i - 1 ]->GetEndFc() );
1088 : m_ePlc(ePl), m_nStartGrp(511), m_nOldStartGrp(511),
1089 m_nItemSize( (
CHP == ePl ) ? 1 : 13 ),
1090 m_nIMax(0), m_nOldVarLen(0), m_bCombined(false)
1094 memset(
m_pFkp, 0, 4 * 128 );
1095 memset(
m_pOfs, 0, 4 * 128 );
1096 reinterpret_cast<sal_Int32*
>(
m_pFkp)[0] = nStartFc;
1101 delete[]
reinterpret_cast<sal_Int32 *
>(
m_pFkp);
1102 delete[]
reinterpret_cast<sal_Int32 *
>(
m_pOfs);
1123 const sal_uInt8*
p =
m_pFkp + ( o3tl::narrowing<sal_uInt16>(nStart) << 1 );
1126 : ((o3tl::narrowing<sal_uInt16>(*
p++) << 1 ) == (( nVarLen+1) & 0xfffe)) )
1127 && !memcmp(
p, pSprms, nVarLen ) )
1137 sal_uInt8 *pStart=
nullptr,*pRet=
nullptr;
1146 const sal_uInt8*
p =
m_pFkp + ( o3tl::narrowing<sal_uInt16>(nStart) << 1 );
1157 memcpy(pRet,
p,rLen);
1164 assert((!nVarLen || pSprms) &&
"Item pointer missing");
1166 OSL_ENSURE( nVarLen < ( (
m_ePlc ==
PAP ) ? 497U : 502U ),
"Sprms too long !" );
1170 OSL_ENSURE(
false,
"Fkp::Append: Fkp is already combined" );
1176 OSL_ENSURE( nEndFc >=
n,
"+Fkp: FC backwards" );
1177 OSL_ENSURE( !nVarLen || !pSprms || nEndFc !=
n,
1178 "+Fkp: used same FC multiple times" );
1187 if (nVarLen && !nOldP)
1192 : (
m_nStartGrp - (((nVarLen + 1) & 0xFFFE)+1)) & 0xFFFE )
1207 if( nVarLen && !nOldP )
1215 ? ( nVarLen < 256 ) ? static_cast<sal_uInt8>(nVarLen) : 255
1216 : ( ( nVarLen + 1 ) >> 1 ));
1218 m_pFkp[ nOffset ] = nCnt;
1219 memcpy(
m_pFkp + nOffset + 1, pSprms, nVarLen );
1242#if defined OSL_BIGENDIAN
1247 *
p = OSL_SWAPDWORD( *
p );
1257 for(
p =
m_pFkp + 511 - 4;
p >= pEnd;
p-- )
1268 memcpy(
p,
nPos, 4 );
1322 return SVBT32ToUInt32(
m_pFkp );
1323 return reinterpret_cast<sal_Int32*
>(
m_pFkp)[0];
1348 if ( !nStartCp && !
m_Pcts.empty())
1350 OSL_ENSURE(1 ==
m_Pcts.size(),
"empty Piece!");
1360 nStartCp +=
m_Pcts.back()->GetStartCp();
1363 m_Pcts.push_back(std::make_unique<WW8_WrPc>(nStartFc, nStartCp));
1368 sal_uInt64 nPctStart;
1373 nOldPos = nPctStart + 1;
1376 for (
auto const& it :
m_Pcts)
1384 nStartCp +=
m_Pcts.back()->GetStartCp();
1388 for (
auto const& it :
m_Pcts)
1396 rWrt.
m_pFib->m_fcClx = nPctStart;
1398 rWrt.
m_pFib->m_lcbClx = nEndPos - nPctStart;
1402 nEndPos - nPctStart-5 );
1408 OSL_ENSURE( !
m_Pcts.empty(),
"SetParaBreak : m_Pcts.empty()" );
1409 m_Pcts.back()->SetStatus();
1415 OSL_ENSURE( !
m_Pcts.empty(),
"Fc2Cp no piece available" );
1419 return nFc +
m_Pcts.back()->GetStartCp();
1424 std::vector< const ::sw::mark::IMark* >
aArr;
1426 const sal_Int32 nCurrentEnd = nCurrentPos + nLen;
1432 for(const ::sw::mark::IMark*
p :
aArr)
1434 const ::sw::mark::IMark& rBkmk = *
p;
1435 if(
dynamic_cast< const ::sw::mark::IFieldmark *
>(&rBkmk))
1438 const SwPosition* pPos = &rBkmk.GetMarkPos();
1440 if(rBkmk.IsExpanded())
1441 pOPos = &rBkmk.GetOtherMarkPos();
1446 pOPos = &rBkmk.GetMarkPos();
1451 nContent < nCurrentEnd ) )
1458 nContent < nCurrentEnd )
1473 const sal_Int32 nStart = pMark->GetMarkStart().GetContentIndex();
1474 if (nStart == nCurrentPos)
1486 if (!aStatements.empty())
1495 m_pBkmks->MoveFieldMarks(nFrom, nTo);
1500 sal_uInt64 nSttCP =
Fc2Cp(
Strm().Tell() );
1506 sal_uInt64 nEndCP =
Fc2Cp(
Strm().Tell() );
1507 m_pBkmks->Append( nEndCP - 1, rName );
1513 std::unique_ptr<SvxBrushItem> aBrush = std::make_unique<SvxBrushItem>(
RES_BACKGROUND);
1516 if (SfxItemState::SET == eState)
1519 if (aBrush->GetColor() !=
COL_AUTO)
1531 for (
size_t n = 0;
n < nCountRule; ++
n)
1535 for (sal_uInt16 nLvl = 0; nLvl < nLevels; ++nLvl)
1571 const MapMode aMapMode(MapUnit::MapTwip);
1591 OUString aPicBullets(
"_PictureBullets");
1658 rWW8Wrt.
m_pFib->m_lcbSttbfRMark);
1672 sal_Int32& rfcSttbf, sal_Int32& rlcbSttbf)
1674 sal_uInt16
n,
nCount =
static_cast< sal_uInt16
>(rStrings.size());
1686 const OUString& rNm = rStrings[
n];
1714 ShortToSVBT16(
n, nL );
1715 rO.push_back(nL[0]);
1716 rO.push_back(nL[1]);
1722 UInt32ToSVBT32(
n, nL );
1723 rO.push_back(nL[0]);
1724 rO.push_back(nL[1]);
1725 rO.push_back(nL[2]);
1726 rO.push_back(nL[3]);
1732 for (sal_Int32
n = 0, nLen = rStr.getLength();
n < nLen; ++
n, ++pStr)
1737 rtl_TextEncoding eCodeSet)
1740 const char *pStart = sTmp.getStr();
1741 const char *pEnd = pStart + sTmp.getLength();
1743 rO.insert( rO.end(), pStart, pEnd );
1755 if (!aBytes.empty())
1770 bool bAddZero, rtl_TextEncoding eCodeSet)
1775 aBytes.push_back(0);
1778 if (!aBytes.empty())
1784 if( !rText.isEmpty() )
1794 aArr.push_back( 1 );
1839 sal_Int32
const nLen)
1842 SAL_INFO(
"sw.ww8.level2",
"<OutSwString>" );
1846 if( nStt || nLen != rStr.getLength() )
1848 OUString sOut( rStr.copy( nStt, nLen ) );
1862 SAL_INFO(
"sw.ww8.level2",
"</OutSwString>" );
1867 if (pTableTextNodeInfoInner && pTableTextNodeInfoInner->getDepth() == 1 && pTableTextNodeInfoInner->isEndOfCell())
1887 if ( nStt !=
m_pCurPam->GetMark()->GetNodeIndex() &&
1902 aData.pOOld =
nullptr;
1958 if ( !
m_pO->empty() )
1964 rData.
pOOld =
nullptr;
1976 OSL_ENSURE(
m_pO->empty(),
"pO is not empty in WW8Export::RestoreData()" );
1987 sal_uInt32 nDepth = pTableTextNodeInfoInner->getDepth();
1998 if ( nDepth > 1 && pTableTextNodeInfoInner->isEndOfCell() )
2007 sal_uInt32 nDepth = pTableTextNodeInfoInner->getDepth();
2013 if ( !pTableTextNodeInfoInner->isEndOfLine() )
2054 sal_uInt16 nFlags = 0;
2058 else if (nRowSpan < 0)
2061 if (pBox !=
nullptr)
2066 case text::VertOrientation::CENTER:
2069 case text::VertOrientation::BOTTOM:
2083 static_cast<const SwTextNode*
>(pCNd)->GetParaAttr(aCoreSet,
2087 if(pRotate && pRotate->GetValue() == 900_deg10)
2089 nFlags = nFlags | 0x0004 | 0x0008;
2091 else if(pRotate && pRotate->GetValue() == 2700_deg10 )
2093 nFlags = nFlags | 0x0004 | 0x0010;
2105 const SwTableBox * pTabBox = pTableTextNodeInfoInner->getTableBox();
2116 sal_uInt16 nTextFlow = 0;
2119 case SvxFrameDirection::Vertical_RL_TB:
2122 case SvxFrameDirection::Vertical_LR_BT:
2141 const SwTableBox * pTabBox = pTableTextNodeInfoInner->getTableBox();
2161 const SwTable * pTable = pTableTextNodeInfoInner->getTable();
2181 const SwTableBox * pTabBox = pTableTextNodeInfoInner->getTableBox();
2206 const SwTable * pTable = pTableTextNodeInfoInner->getTable();
2211 SAL_WARN(
"sw.ww8",
"FrameFormat is nil" );
2231 case text::HoriOrientation::CENTER:
2237 case text::HoriOrientation::RIGHT:
2246 case text::HoriOrientation::LEFT:
2253 case text::HoriOrientation::LEFT_AND_WIDTH:
2268 const SwTable * pTable = pTableTextNodeInfoInner->getTable();
2285 sal_uInt8 const nTPc = (nPadding << 4) | (nPcVert << 2) | nPcHorz;
2314 case text::RelOrientation::PAGE_PRINT_AREA:
2318 case text::RelOrientation::PAGE_FRAME:
2331 case text::RelOrientation::FRAME:
2335 case text::RelOrientation::PAGE_PRINT_AREA:
2345 sal_uInt8 nTPc = (nPcVert << 4) | (nPcHorz << 6);
2350 sal_Int16 nTDxaAbs = 0;
2353 case text::HoriOrientation::LEFT:
2357 case text::HoriOrientation::CENTER:
2361 case text::HoriOrientation::RIGHT:
2373 sal_Int16 nTDyaAbs = 0;
2376 case text::VertOrientation::TOP:
2380 case text::VertOrientation::CENTER:
2384 case text::VertOrientation::BOTTOM:
2414 const SwTable * pTable = pTableTextNodeInfoInner->getTable();
2423 pTableTextNodeInfoInner->getTableBoxesOfRow();
2425 sal_uInt32 nBoxes = pTableBoxes->size();
2430 sal_uInt16 nSprmSize = 2 + (nBoxes + 1) * 2 + nBoxes * 20;
2447 SAL_WARN(
"sw.ww8",
"FrameFormat is nil" );
2467 case text::HoriOrientation::CENTER:
2468 case text::HoriOrientation::RIGHT:
2472 nTableOffset = rHori.
GetPos();
2474 nTableOffset += rLRSp.
GetLeft();
2479 SwTwips nLeftPageMargin, nRightPageMargin;
2482 nTableOffset = nPageSize - nLeftPageMargin - nRightPageMargin - nTableWidth - nTableOffset;
2491 for (
const auto nCol : *pGridCols )
2498 ww8::RowSpans::const_iterator aItRowSpans = pRowSpans->begin();
2500 for (
const SwTableBox * pTabBox1 : *pTableBoxes)
2505 if (pTabBox1 !=
nullptr)
2506 pBoxFormat = pTabBox1->GetFrameFormat();
2512 static sal_uInt8 aNullBytes[] = { 0x0, 0x0 };
2515 if (pBoxFormat !=
nullptr)
2531 if (!nWidthPercent && rHori.
GetHoriOrient() == text::HoriOrientation::FULL)
2532 nWidthPercent = 100;
2535 if ( nWidthPercent > 0 && nWidthPercent <= 600 )
2548 return pTableTextNodeInfoInner->getGridColsOfRow(*
this);
2554 return pTableTextNodeInfoInner->getGridColsOfRow(*
this,
true);
2561 const SwNode *pTextNd = pTableTextNodeInfoInner->
getNode( );
2567 SAL_WARN(
"sw.ww8",
"FrameFormat is nil" );
2575 nWidthPercent = 100;
2576 bool bRelBoxSize = nWidthPercent != 0;
2578 if (nTableSz > USHRT_MAX/2 && !bRelBoxSize)
2580 OSL_ENSURE(bRelBoxSize,
"huge table width but not relative, suspicious");
2596 nPageSize = aRect.
Width();
2597 if ( 0 == nPageSize )
2606 nPageSize = aRect.
Width();
2607 if ( bManualAligned )
2616 if ( nWidthPercent )
2618 nPageSize *= nWidthPercent;
2622 SAL_WARN(
"sw.ww8",
"nWidthPercent is zero" );
2627 nPageSize = nTableSz;
2630 rPageSize = nPageSize;
2631 rRelBoxSize = bRelBoxSize;
2639 const SwTableBox * pTabBox = pTableTextNodeInfoInner->getTableBox();
2644 SvxBoxItemLine::TOP, SvxBoxItemLine::LEFT,
2645 SvxBoxItemLine::BOTTOM, SvxBoxItemLine::RIGHT
2649 for (
int i = 0;
i < 4; ++
i )
2666 const SwTableBox * pTabBox = pTableTextNodeInfoInner->getTableBox();
2669 sal_uInt8 nBoxes = std::min<size_t>(rTabBoxes.size(), 255);
2675 SvxBoxItemLine::TOP, SvxBoxItemLine::LEFT,
2676 SvxBoxItemLine::BOTTOM, SvxBoxItemLine::RIGHT
2679 sal_uInt16 nDefaultMargin[4] = {31681, 31681, 31681, 31681};
2681 if ( nBoxes && rTabBoxes.size() == nBoxes )
2683 const SvxBoxItem& rBox = rTabBoxes[ nBoxes-1 ]->GetFrameFormat()->GetBox();
2684 for (
int i = 0;
i < 4; ++
i )
2690 for (
unsigned n = 0;
n <= nBoxes; ++
n )
2692 const SvxBoxItem * pBox = (
n == nBoxes) ?
nullptr :
2693 &rTabBoxes[
n]->GetFrameFormat()->GetBox();
2696 else if( !pBox || *pLastBox != *pBox )
2708 sal_uInt16 nMargin[4];
2710 for (
int i = 0;
i < 4; ++
i )
2713 if ( nMargin[
i] == nDefaultMargin[
i] )
2717 for (
int p = 0;
p < 4; ++
p )
2719 if ( nMargin[
i] == nMargin[
p] )
2721 nSideBits[
p] |= 1 <<
i;
2728 for (
int i = 0;
i < 4; ++
i )
2750 const SwTable * pTab = pTableTextNodeInfoInner->getTable();
2751 const SwTableBox * pTabBox = pTableTextNodeInfoInner->getTableBox();
2761 if ( pTableColorProp )
2762 aRowColor = pTableColorProp->
GetColor();
2766 aRowColor = pRowColorProp->
GetColor();
2772 Color aColor = aRowColor;
2776 aColor = pCellColorProp->
GetColor();
2795 for (sal_uInt32
m : aSprmIds)
2819 if ( nStart >= nStop )
2829 Color aColor = aRowColor;
2833 aColor = pCellColorProp->
GetColor();
2856class TrackContentToExport
2863 : m_pCurPam(pCurPam)
2864 , m_nStart(nCurStart)
2874 if (bSimpleContentRemains)
2888 if (pNextNode && pCurrentNode != pNextNode)
2890 return pNextNode->
GetIndex() >= m_nStart &&
2903 while (aContentTracking.contentRemainsToExport(
m_pTableInfo.get()))
2952 bool bNeedExportBreakHere =
true;
2954 bNeedExportBreakHere =
false;
2966 bNeedExportBreakHere =
false;
2980 if (nColumnCount > 1 && rNoBalanced.
GetValue())
2982 bNeedExportBreakHere =
false;
2987 bNeedExportBreakHere =
false;
2990 if (bNeedExportBreakHere)
2995 if ( !pParentFormat )
3001 GetLineNumber().GetStartValue();
3028 if (pCurrentNode == pNextNode)
3030 SAL_WARN(
"sw.ww8",
"loop in TableInfo");
3031 pNextNode =
nullptr;
3034 if (pNextNode !=
nullptr)
3035 m_pCurPam->GetPoint()->Assign(*pNextNode);
3043 SAL_INFO(
"sw.ww8.level2",
"</WriteText>" );
3048 SAL_INFO(
"sw.ww8.level2",
"<WriteMainText>" );
3071 SAL_INFO(
"sw.ww8.level2",
"</WriteMainText>" );
3076 bool bResult =
false;
3086 if (pTableNodeInfo && pTableNodeInfo->getDepth() > 0)
3111 m_pEdn->WritePlc( *
this );
3114 m_pAtn->WritePlc( *
this );
3116 m_pSepx->WritePlcSed( *
this );
3117 m_pSepx->WritePlcHdd( *
this );
3186 std::vector<OUString> aStrings(pSttbfAssoc->
getStrings());
3188 m_pFib->m_lcbSttbfAssoc);
3199 m_pFib->m_fReadOnlyRecommended =
3201 m_pFib->m_fWriteReservation =
3210 bool bNeedsFinalPara =
false;
3218 bNeedsFinalPara |=
m_pFootnote->WriteText( *
this );
3219 bNeedsFinalPara |=
m_pSepx->WriteKFText( *
this );
3220 bNeedsFinalPara |=
m_pAtn->WriteText( *
this );
3221 bNeedsFinalPara |=
m_pEdn->WriteText( *
this );
3226 bNeedsFinalPara |=
m_pTextBxs->WriteText( *
this );
3229 if (bNeedsFinalPara)
3232 m_pPapPlc->AppendFkpEntry(
Strm().Tell(), nSprmsLen, pLastSprms);
3234 delete[] pLastSprms;
3246 if( rURL.empty() || rURL[0] !=
'#' )
3255 OUString sCmp =
aURL.copy(
nPos+1).replaceAll(
" ",
"");
3256 if( sCmp.isEmpty() )
3259 sCmp = sCmp.toAsciiLowerCase();
3260 if( sCmp ==
"outline" )
3270 else if( sCmp ==
"graphic" )
3274 if (
const SwNodeIndex* pIdx = pFormat->GetContent().GetContentIdx())
3277 else if( sCmp ==
"frame" )
3281 if (
const SwNodeIndex* pIdx = pFormat->GetContent().GetContentIdx())
3284 else if( sCmp ==
"ole" )
3288 if (
const SwNodeIndex* pIdx = pFormat->GetContent().GetContentIdx())
3291 else if( sCmp ==
"region" )
3296 if (
aName == pFormat->GetSection()->GetSectionName())
3298 if (
const SwNodeIndex* pIdx = pFormat->GetContent().GetContentIdx())
3306 else if( sCmp ==
"table" )
3313 else if (sCmp ==
"toxmark")
3321 for (sal_Int32
i = 0;
i < tmp->second; ++
i)
3325 if (pMark != &tmp->first)
3358 auto pURL =
dynamic_cast<const SwFormatURL*
>(pItem);
3363 const ImageMap *pIMap = pURL->GetMap();
3383 sal_uInt64 nLen = rIn.
TellEnd();
3387 for (std::size_t nI = 0, nBlock = 0; nI < nLen; nI +=
WW_BLOCKSIZE, ++nBlock)
3394 rCtx.
Encode(in, nBS, in, nBS);
3427 sal_uInt32 nSvxMSDffOLEConvFlags = 0;
3438 m_oOLEExp.emplace( nSvxMSDffOLEConvFlags );
3491 uno::Sequence< beans::NamedValue > aEncryptionData;
3496 if ( pEncryptionDataItem && ( pEncryptionDataItem->
GetValue() >>= aEncryptionData ) && !rCodec.
InitCodec( aEncryptionData ) )
3498 OSL_ENSURE(
false,
"Unexpected EncryptionData!" );
3499 aEncryptionData.realloc( 0 );
3502 if ( !aEncryptionData.hasElements() )
3506 if ( pPasswordItem && !pPasswordItem->
GetValue().isEmpty() && pPasswordItem->
GetValue().getLength() <= 15 )
3511 rtl_random_getBytes( aRandomPool, pDocId, 16 );
3513 rtl_random_destroyPool( aRandomPool );
3515 sal_uInt16 aPassword[16] = {};
3517 const OUString& sPassword(pPasswordItem->
GetValue());
3518 for ( sal_Int32 nChar = 0; nChar < sPassword.getLength(); ++nChar )
3519 aPassword[nChar] = sPassword[nChar];
3521 rCodec.
InitKey( aPassword, pDocId );
3528 if ( aEncryptionData.hasElements() )
3533 return aEncryptionData.hasElements();
3544 xWwStrm->SetBufferSize( 32768 );
3546 m_pFib->m_fWhichTableStm =
true;
3550 xDataStrm->SetBufferSize( 32768 );
3551 xTableStrm->SetBufferSize( 16384 );
3553 xTableStrm->SetEndian( SvStreamEndian::LITTLE );
3554 xDataStrm->SetEndian( SvStreamEndian::LITTLE );
3571 aTempMain.
GetStream( StreamMode::READWRITE | StreamMode::SHARE_DENYWRITE ) );
3577 sal_uInt8 const aRC4EncryptionHeader[ 52 ] = {0};
3624 if (pStdTextFormatColl && (pItem = pStdTextFormatColl->
GetItemIfSet(
3635 SvStream *pStrmTemp, *pTableStrmTemp, *pDataStrmTemp;
3636 pStrmTemp = xWwStrm.
get();
3637 pTableStrmTemp = xTableStrm.get();
3638 pDataStrmTemp = xDataStrm.
get();
3640 if ( pDataStrmTemp && pDataStrmTemp != pStrmTemp) {
3654 pTableStrmTemp->
Seek( 0 );
3674 m_pFib->m_fEncrypted =
true;
3675 m_pFib->m_fObfuscated =
false;
3679 pStrmTemp->
Seek( 0 );
3680 m_pFib->WriteHeader( *pStrmTemp );
3713 xWwStrm->SetBufferSize( 0 );
3714 xTableStrm->SetBufferSize( 0 );
3715 xDataStrm->SetBufferSize( 0 );
3730 0x01, 0x00, 0xFE, 0xFF, 0x03, 0x0A, 0x00, 0x00,
3731 0xFF, 0xFF, 0xFF, 0xFF, 0x06, 0x09, 0x02, 0x00,
3732 0x00, 0x00, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00,
3733 0x00, 0x00, 0x00, 0x46,
3735 0x18, 0x00, 0x00, 0x00,
3736 'M',
'i',
'c',
'r',
'o',
's',
'o',
'f',
3737 't',
' ',
'W',
'o',
'r',
'd',
'-',
'D',
3738 'o',
'k',
'u',
'm',
'e',
'n',
't', 0x0,
3740 0x0A, 0x00, 0x00, 0x00,
3741 'M',
'S',
'W',
'o',
'r',
'd',
'D',
'o',
3744 0x10, 0x00, 0x00, 0x00,
3745 'W',
'o',
'r',
'd',
'.',
'D',
'o',
'c',
3746 'u',
'm',
'e',
'n',
't',
'.',
'8', 0x0,
3748 0xF4, 0x39, 0xB2, 0x71, 0x00, 0x00, 0x00, 0x00,
3749 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
3754 aGName, SotClipboardFormatId::NONE,
"Microsoft Word-Document");
3759 OSL_ENSURE(pDocShell,
"no SwDocShell");
3761 if (!pDocShell)
return;
3763 uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
3764 pDocShell->
GetModel(), uno::UNO_QUERY_THROW);
3765 uno::Reference<document::XDocumentProperties> xDocProps(
3766 xDPS->getDocumentProperties());
3767 OSL_ENSURE(xDocProps.is(),
"DocumentProperties is null");
3769 if (!xDocProps.is())
3774 std::shared_ptr<GDIMetaFile> xMetaFile =
3776 uno::Sequence<sal_Int8> metaFile(
3787 uno::Reference< packages::XPackageEncryption > xPackageEncryption;
3788 std::shared_ptr<SvStream> pSotStorageStream;
3789 uno::Sequence< beans::NamedValue > aEncryptionData;
3794 if (pEncryptionDataItem && (pEncryptionDataItem->
GetValue() >>= aEncryptionData))
3799 if (sCryptoType.getLength())
3804 xPackageEncryption.set(
3805 xComponentContext->getServiceManager()->createInstanceWithArgumentsAndContext(
3806 "com.sun.star.comp.oox.crypto." + sCryptoType,
aArguments, xComponentContext), uno::UNO_QUERY);
3808 if (xPackageEncryption)
3813 pSotStorageStream = std::make_shared<SvMemoryStream>();
3822 if (xPackageEncryption)
3824 assert(pSotStorageStream &&
m_pStg &&
"because always set if xPackageEncryption was set");
3827 pSotStorageStream->Seek(0);
3830 xPackageEncryption->setupEncryption(aEncryptionData);
3833 uno::Sequence<beans::NamedValue> aStreams = xPackageEncryption->encrypt(xInputStream);
3836 for (
const beans::NamedValue & aStreamData : std::as_const(aStreams))
3843 while (pStorage &&
idx >= 0)
3845 OUString sPathElem = aStreamData.Name.getToken(0, L
'/',
idx);
3846 if (!sPathElem.isEmpty())
3850 sFileName = sPathElem;
3854 pStorage = pStorage->OpenSotStorage(sPathElem);
3873 uno::Sequence<sal_Int8> aStreamContent;
3874 aStreamData.Value >>= aStreamContent;
3875 size_t nBytesWritten = pStream->WriteBytes(aStreamContent.getArray(), aStreamContent.getLength());
3876 if (nBytesWritten !=
static_cast<size_t>(aStreamContent.getLength()))
3890 if( pViewShell !=
nullptr )
3924 const OUString* pFileName )
3935 , m_pTopNodeOfHdFtPage(nullptr)
3937 , m_nCharFormatStart(0)
3938 , m_nFormatCollStart(0)
3939 , m_nStyleBeforeFly(0)
3940 , m_nLastFormatId(0)
3944 , m_bOrigShowChanges(true)
3945 , m_pCurrentPageDesc(nullptr)
3946 , m_pPreviousSectionPageDesc(nullptr)
3947 , m_bFirstTOCNodeWithSection(false)
3948 , m_pChpIter(nullptr)
3949 , m_pParentFrame(nullptr)
3950 , m_pFlyOffset(nullptr)
3952 , m_pStyAttr(nullptr)
3953 , m_pOutFormatNode(nullptr)
3954 , m_pCurrentStyle(nullptr)
3955 , m_pEscher(nullptr)
3958 , m_bBreakBefore(false)
3960 , m_bOutFlyFrameAttrs(false)
3961 , m_bOutPageDescs(false)
3962 , m_bOutFirstPage(false)
3963 , m_bOutTable(false)
3965 , m_bInWriteEscher(false)
3966 , m_bStartTOX(false)
3967 , m_bInWriteTOX(false)
3968 , m_bFootnoteAtTextEnd(false)
3969 , m_bEndAtTextEnd(false)
3972 , m_bSubstituteBullets(true)
3973 , m_bTabInTOC(false)
3974 , m_bHideTabLeaderAndPageNumbers(false)
3975 , m_bExportModeRTF(false)
3976 , m_bFontSizeWritten(false)
3977 , m_bAddFootnoteTab(false)
3979 , m_nCurStart(pCurrentPam->GetPoint()->GetNodeIndex())
3980 , m_nCurEnd(pCurrentPam->GetMark()->GetNodeIndex())
3981 , m_pCurPam(pCurrentPam)
3982 , m_pOrigPam(pOriginalPam)
4001 SwDoc& rDocument, std::shared_ptr<SwUnoCursor> & pCurrentPam,
SwPaM* pOriginalPam,
4004 , m_pTableStrm(nullptr)
4005 , m_pDataStrm(nullptr)
4007 , m_pWriter(pWriter)
4027 : m_pExport( nullptr ),
4045extern "C" SAL_DLLPUBLIC_EXPORT
void ExportDOC( std::u16string_view rFltName,
const OUString& rBaseURL,
WriterRef& xRet )
4062 rWrt.
m_pFib->m_ccpText );
4079 rWrt.
m_pFib->m_lcbPlcffndText, rWrt.
m_pFib->m_fcPlcffndRef,
4080 rWrt.
m_pFib->m_lcbPlcffndRef );
4085 rWrt.
m_pFib->m_lcbPlcfendText, rWrt.
m_pFib->m_fcPlcfendRef,
4086 rWrt.
m_pFib->m_lcbPlcfendRef );
4095 + rWrt.
m_pFib->m_ccpHdr );
4102 rWrt.
m_pFib->m_lcbPlcfandText, rWrt.
m_pFib->m_fcPlcfandRef,
4103 rWrt.
m_pFib->m_lcbPlcfandRef );
4111 rWrt.
m_pFib->m_lcbPlcftxbxBkd, rWrt.
m_pFib->m_fcPlcftxbxText,
4112 rWrt.
m_pFib->m_lcbPlcftxbxText );
4117 rWrt.
m_pFib->m_lcbPlcfHdrtxbxBkd, rWrt.
m_pFib->m_fcPlcfHdrtxbxText,
4118 rWrt.
m_pFib->m_lcbPlcfHdrtxbxText );
4129 uno::Reference < io::XStream > xSrcStream =
4130 xSrcRoot->openStreamElement(
SL::aMSMacroCmds, embed::ElementModes::READ );
4135 m_pFib->m_lcbCmds = pStream->TellEnd();
4138 std::unique_ptr<sal_uInt8[]> pBuffer(
new sal_uInt8[
m_pFib->m_lcbCmds] );
4144 catch (
const uno::Exception& )
4161 const ::sw::mark::IFieldmark* pFieldmark = &rFieldmark;
4168 SAL_WARN(
"sw.ww8",
"unknown field type" );
4178 OUString ffname = rFieldmark.GetName();
4179 if (ffname.getLength() > 20)
4180 ffname = ffname.copy(0, 20);
4188 0x03, 0x6a, 0,0,0,0,
4197 m_pChpPlc->AppendFkpEntry(
Strm().Tell(),
sizeof( aArr1 ), aArr1 );
4205 FFDataHeader() : version( 0xFFFFFFFF ), bits(0), cch(0), hps(0) {}
4208 FFDataHeader aFieldHeader;
4209 aFieldHeader.bits |= (
type & 0x03);
4211 sal_Int32 ffres = 0;
4212 if ( pAsCheckbox && pAsCheckbox->IsChecked() )
4214 else if (
type == 2 )
4216 ::sw::mark::IFieldmark::parameter_map_t::const_iterator pResParameter = rFieldmark.GetParameters()->find(
ODF_FORMDROPDOWN_RESULT);
4217 if(pResParameter != rFieldmark.GetParameters()->end())
4218 pResParameter->second >>= ffres;
4222 aFieldHeader.bits |= ( (ffres<<2) & 0x7C );
4226 OUString ffhelptext = rFieldmark.GetFieldHelptext();
4227 if ( ffhelptext.getLength() > 255 )
4228 ffhelptext = ffhelptext.copy(0, 255);
4229 OUString ffstattext;
4230 OUString ffentrymcr;
4233 ::sw::mark::IFieldmark::parameter_map_t::const_iterator pParameter
4234 = rFieldmark.GetParameters()->find(
"Type");
4237 sal_uInt16
nType = 0;
4238 if ( pParameter != rFieldmark.GetParameters()->end() )
4241 pParameter->second >>= aType;
4242 if ( aType ==
"number" )
nType = 1;
4243 else if ( aType ==
"date" )
nType = 2;
4244 else if ( aType ==
"currentTime" )
nType = 3;
4245 else if ( aType ==
"currentDate" )
nType = 4;
4246 else if ( aType ==
"calculated" )
nType = 5;
4247 aFieldHeader.bits |=
nType<<11;
4252 pParameter = rFieldmark.GetParameters()->find(
"Content");
4253 if ( pParameter != rFieldmark.GetParameters()->end() )
4255 OUString aDefaultText;
4256 pParameter->second >>= aDefaultText;
4257 const sal_Int32 nLen =
std::min( sal_Int32(255), aDefaultText.getLength() );
4258 ffdeftext = aDefaultText.copy (0, nLen);
4262 pParameter = rFieldmark.GetParameters()->find(
"MaxLength");
4263 if ( pParameter != rFieldmark.GetParameters()->end() )
4266 pParameter->second >>=
nLength;
4271 pParameter = rFieldmark.GetParameters()->find(
"Format");
4272 if ( pParameter != rFieldmark.GetParameters()->end() )
4275 pParameter->second >>= aFormat;
4276 const sal_Int32 nLen =
std::min( sal_Int32(64), aFormat.getLength() );
4277 ffformat = aFormat.copy(0, nLen);
4281 pParameter = rFieldmark.GetParameters()->find(
"Help");
4282 if ( ffhelptext.isEmpty() && pParameter != rFieldmark.GetParameters()->end() )
4285 pParameter->second >>= aHelpText;
4286 const sal_Int32 nLen =
std::min( sal_Int32(255), aHelpText.getLength() );
4287 ffhelptext = aHelpText.copy (0, nLen);
4289 if ( !ffhelptext.isEmpty() )
4290 aFieldHeader.bits |= 0x1<<7;
4292 pParameter = rFieldmark.GetParameters()->find(
"Description");
4293 if ( pParameter == rFieldmark.GetParameters()->end() )
4294 pParameter = rFieldmark.GetParameters()->find(
"Hint");
4295 if ( pParameter != rFieldmark.GetParameters()->end() )
4297 OUString aStatusText;
4298 pParameter->second >>= aStatusText;
4299 const sal_Int32 nLen =
std::min( sal_Int32(138), aStatusText.getLength() );
4300 ffstattext = aStatusText.copy (0, nLen);
4302 if ( !ffstattext.isEmpty() )
4303 aFieldHeader.bits |= 0x1<<8;
4305 pParameter = rFieldmark.GetParameters()->find(
"EntryMacro");
4306 if ( pParameter != rFieldmark.GetParameters()->end() )
4308 OUString aEntryMacro;
4309 pParameter->second >>= aEntryMacro;
4310 const sal_Int32 nLen =
std::min( sal_Int32(32), aEntryMacro.getLength() );
4311 ffentrymcr = aEntryMacro.copy (0, nLen);
4314 pParameter = rFieldmark.GetParameters()->find(
"ExitMacro");
4315 if ( pParameter != rFieldmark.GetParameters()->end() )
4317 OUString aExitMacro;
4318 pParameter->second >>= aExitMacro;
4319 const sal_Int32 nLen =
std::min( sal_Int32(32), aExitMacro.getLength() );
4320 ffexitmcr = aExitMacro.copy (0, nLen);
4323 std::vector< OUString > aListItems;
4326 aFieldHeader.bits |= 0x8000;
4327 const ::sw::mark::IFieldmark::parameter_map_t*
const pParameters = rFieldmark.GetParameters();
4329 if(pListEntries != pParameters->end())
4331 uno::Sequence< OUString > vListEntries;
4332 pListEntries->second >>= vListEntries;
4333 aListItems.reserve(vListEntries.getLength());
4334 copy(std::cbegin(vListEntries), std::cend(vListEntries), back_inserter(aListItems));
4341 0,0,0,0,0,0,0,0,0,0,
4342 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
4343 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
4344 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
4347 sal_uInt32 slen =
sizeof(sal_uInt32)
4348 +
sizeof(aFieldData)
4349 +
sizeof( aFieldHeader.version ) +
sizeof( aFieldHeader.bits ) +
sizeof( aFieldHeader.cch ) +
sizeof( aFieldHeader.hps )
4350 + 2*ffname.getLength() + 4
4351 + 2*ffformat.getLength() + 4
4352 + 2*ffhelptext.getLength() + 4
4353 + 2*ffstattext.getLength() + 4
4354 + 2*ffentrymcr.getLength() + 4
4355 + 2*ffexitmcr.getLength() + 4;
4359 slen += 2*ffdeftext.getLength() + 4;
4363 const int items = aListItems.size();
4364 for(
int i = 0;
i < items;
i++ ) {
4365 OUString item = aListItems[
i];
4366 slen += 2 * item.getLength() + 2;
4372 int len =
sizeof( aFieldData );
4373 OSL_ENSURE( len == 0x44-
sizeof(sal_uInt32),
"SwWW8Writer::WriteFormData(..) - wrong aFieldData length" );
4392 const int items=aListItems.size();
4394 for(
int i=0;
i<items;
i++) {
4395 OUString item=aListItems[
i];
4412 SAL_INFO(
"sw.ww8",
"<OutWW8_TableNodeInfoInner>" << pNodeInfoInner->toString());
4417 sal_uInt32 nShadowsBefore = pNodeInfoInner->getShadowsBefore();
4418 if (nShadowsBefore > 0)
4421 pTmpNodeInfoInner = std::make_shared<ww8::WW8TableNodeInfoInner>(
nullptr);
4423 pTmpNodeInfoInner->setDepth(pNodeInfoInner->getDepth());
4424 pTmpNodeInfoInner->setEndOfCell(
true);
4426 for (sal_uInt32
n = 0;
n < nShadowsBefore; ++
n)
4439 if (pNodeInfoInner->isEndOfCell())
4441 SAL_INFO(
"sw.ww8",
"<endOfCell/>" );
4452 sal_uInt32 nShadowsAfter = pNodeInfoInner->getShadowsAfter();
4453 if (nShadowsAfter > 0)
4456 pTmpNodeInfoInner= std::make_shared<ww8::WW8TableNodeInfoInner>(
nullptr);
4458 pTmpNodeInfoInner->setDepth(pNodeInfoInner->getDepth());
4459 pTmpNodeInfoInner->setEndOfCell(
true);
4461 for (sal_uInt32
n = 0;
n < nShadowsAfter; ++
n)
4473 if (pNodeInfoInner->isEndOfLine())
4475 SAL_INFO(
"sw.ww8",
"<endOfLine/>" );
4479 ShortToSVBT16(0, nStyle);
4486 SAL_INFO(
"sw.ww8",
"</OutWW8_TableNodeInfoInner>" );
4498 SAL_INFO(
"sw.ww8", pNodeInfo->toString());
4501 ww8::WW8TableNodeInfo::Inners_t::const_reverse_iterator aIt(aInners.rbegin());
4502 ww8::WW8TableNodeInfo::Inners_t::const_reverse_iterator aEnd(aInners.rend());
4511 SAL_INFO(
"sw.ww8",
"</OutWW8_SwStartNode>" );
4525 SAL_INFO(
"sw.ww8", pNodeInfo->toString());
4528 for (
const auto& rEntry : aInners)
4534 SAL_INFO(
"sw.ww8",
"</OutWW8_SwEndNode>" );
4541 m_pKeyMap = std::make_shared<NfKeywordTable>();
@ ShowDelete
show all deletes
@ ShowInsert
show all inserts
@ DO_NOT_JUSTIFY_LINES_WITH_MANUAL_BREAK
@ DO_NOT_BREAK_WRAPPED_TABLES
static OutputDevice * GetDefaultDevice()
virtual void BulletDefinition(int, const Graphic &, Size)
Exports the definition (image, size) of a single numbering picture bullet.
ww8::WidthsPtr GetColumnWidths(ww8::WW8TableNodeInfoInner::Pointer_t const &pTableTextNodeInfoInner)
virtual MSWordExportBase & GetExport()=0
Return the right export class.
void GetTablePageSize(ww8::WW8TableNodeInfoInner const *pTableTextNodeInfoInner, tools::Long &rPageSize, bool &rRelBoxSize)
ww8::GridColsPtr GetGridCols(ww8::WW8TableNodeInfoInner::Pointer_t const &pTableTextNodeInfoInner)
virtual void TableNodeInfoInner(ww8::WW8TableNodeInfoInner::Pointer_t pNodeInfoInner)=0
const OUString & GetValue() const
BitmapChecksum GetChecksum() const
MapMode GetPrefMapMode() const
virtual const SwDrawModel * GetDrawModel() const =0
Draw Model and id accessors.
virtual sw::tExternalDataPointer getExternalData(sw::tExternalDataType eType)=0
virtual const SwRootFrame * GetCurrentLayout() const =0
virtual const SwViewShell * GetCurrentViewShell() const =0
Returns the layout set at the document.
virtual const SwRedlineTable & GetRedlineTable() const =0
virtual void SetRedlineFlags(RedlineFlags eMode)=0
Set a new redline mode.
virtual RedlineFlags GetRedlineFlags() const =0
Query the currently set redline mode.
Provides access to settings of a document.
virtual sal_uInt32 Getn32DummyCompatibilityOptions1() const =0
Get the n32DummyCompatibilityOptions1.
virtual bool get(DocumentSettingId id) const =0
Return the specified document setting.
virtual CharCompressType getCharacterCompressionType() const =0
Get the character compression type for Asian characters.
virtual const css::i18n::ForbiddenCharacters * getForbiddenCharacters(LanguageType nLang, bool bLocaleData) const =0
Return the forbidden characters.
virtual sal_uInt32 Getn32DummyCompatibilityOptions2() const =0
Get the n32DummyCompatibilityOptions2.
virtual const SwDocStat & GetDocStat() const =0
Document - Statistics.
virtual SwTextFormatColl * GetTextCollFromPool(sal_uInt16 nId, bool bRegardLanguage=true)=0
Return "Auto-Collection with ID.
const OUString & GetURL() const
static OUString decode(std::u16string_view rText, DecodeMechanism eMechanism, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8)
IMapObject * GetIMapObject(size_t nPos) const
size_t GetIMapObjectCount() const
[MS-OSHARED] FactoidType: one smart tag type.
std::vector< MSOFactoidType > m_aFactoidTypes
std::vector< OUString > m_aStringTable
[MS-OSHARED] PropertyBag: stores information about one smart tag.
std::vector< MSOProperty > m_aProperties
sal_uInt16 m_nId
Matches MSOFactoidType::m_nId in MSOPropertyBagStore::m_aFactoidTypes.
[MS-OSHARED] Property: stores information about one smart-tag key/value.
sal_uInt32 m_nValue
Index into MSOPropertyBagStore::m_aStringTable.
sal_uInt32 m_nKey
Index into MSOPropertyBagStore::m_aStringTable.
virtual const SfxPoolItem & GetItem(sal_uInt16 nWhich) const =0
virtual const SfxPoolItem * HasTextItem(sal_uInt16 nWhich) const =0
Base class for WW8Export and DocxExport.
std::unique_ptr< WW8_WrtRedlineAuthor > m_pRedlAuthors
void WriteText()
Iterate through the nodes and call the appropriate OutputNode() on them.
SvxFrameDirection TrueFrameDirection(const SwFrameFormat &rFlyFormat) const
Right to left?
RndStdIds m_eNewAnchorType
virtual void SectionBreaksAndFrames(const SwTextNode &rNode)=0
std::stack< MSWordSaveData > m_aSaveData
Stack to remember the nesting (see MSWordSaveData for more)
std::unique_ptr< WW8_WrPlcField > m_pFieldAtn
virtual ErrCode ExportDocument_Impl()=0
Format-dependent part of the actual export.
void CollectOutlineBookmarks(const SwDoc &rDoc)
sal_uInt16 m_nStyleBeforeFly
style number of the node
bool m_bFootnoteAtTextEnd
int CollectGrfsOfBullets()
Populates m_vecBulletPic with all the bullet graphics used by numberings.
bool IsInTable() const
Return whether currently exported node is in table.
bool m_bOrigShowChanges
Remember the original Show Changes mode.
const sw::BroadcastingModify * m_pOutFormatNode
sal_uInt16 m_nUniqueList
current number for creating unique list names
virtual void OutputEndNode(const SwEndNode &)
Output SwEndNode.
std::unique_ptr< MainTextPlcDrawObj > m_pSdrObjs
std::unique_ptr< WW8_WrPct > m_pPiece
std::unique_ptr< WW8_WrPlcTextBoxes > m_pHFTextBxs
virtual void SaveData(SwNodeOffset nStt, SwNodeOffset nEnd)
Remember some of the members so that we can recurse in WriteText().
RedlineFlags m_nOrigRedlineFlags
Remember the original redline mode.
std::vector< const Graphic * > m_vecBulletPic
Vector to record all the graphics of bullets.
std::unique_ptr< SvxBrushItem > getBackground()
Get background color of the document, if there is one.
ErrCode ExportDocument(bool bWriteAll)
The main function to export the document.
void OutputSectionNode(const SwSectionNode &)
Output SwSectionNode.
std::vector< const SwTOXType * > m_aTOXArr
void WriteSpecialText(SwNodeOffset nStart, SwNodeOffset nEnd, sal_uInt8 nTTyp)
Set the pCurPam appropriately and call WriteText().
std::unique_ptr< SwWW8WrGrf > m_pGrf
void OutputContentNode(SwContentNode &)
Call the right (virtual) function according to the type of the item.
std::unique_ptr< WW8_WrPlcField > m_pFieldTextBxs
std::unique_ptr< WW8_WrtBookmarks > m_pBkmks
std::shared_ptr< NfKeywordTable > m_pKeyMap
std::unique_ptr< MSWordStyles > m_pStyles
std::vector< aBookmarkPair > m_aImplicitBookmarks
ww8::WW8TableInfo::Pointer_t m_pTableInfo
const NfKeywordTable & GetNfKeywordTable()
virtual void AppendSection(const SwPageDesc *pPageDesc, const SwSectionFormat *pFormat, sal_uLong nLnNum)=0
sal_uInt16 m_nCharFormatStart
std::vector< ::sw::mark::IMark * > IMarkVector
Used to split the runs according to the bookmarks start and ends.
const SfxPoolItem * HasItem(sal_uInt16 nWhich) const
virtual void RestoreData()
Restore what was saved in SaveData().
wwFontHelper m_aFontHelper
void OutputStartNode(const SwStartNode &)
Output SwStartNode.
const SfxPoolItem & GetItem(sal_uInt16 nWhich) const
std::optional< SvxMSExportOLEObjects > m_oOLEExp
const SwAttrSet * m_pStyAttr
std::unique_ptr< WW8_WrMagicTable > m_pMagicTable
std::unique_ptr< WW8_WrPlcField > m_pFieldMain
int GetGrfIndex(const SvxBrushItem &rBrush)
Returns the index of a picture bullet, used in numberings.
std::unique_ptr< WW8_WrPlcField > m_pFieldEdn
void AddLinkTarget(std::u16string_view rURL)
void OutputSectionBreaks(const SfxItemSet *pSet, const SwNode &rNd, bool isCellOpen=false)
Start new section.
void GatherChapterFields()
Setup the chapter fields (maChapterFieldLocs).
const SwPageDesc * m_pCurrentPageDesc
sal_uInt16 m_nFormatCollStart
std::unique_ptr< WW8_WrPlcField > m_pFieldHdFt
std::unique_ptr< SwMSConvertControls > m_pOCXExp
std::unique_ptr< WW8_WrtFactoids > m_pFactoids
bool GetBookmarks(const SwTextNode &rNd, sal_Int32 nStt, sal_Int32 nEnd, IMarkVector &rArr)
bool NeedTextNodeSplit(const SwTextNode &rNd, SwSoftPageBreakList &pList) const
const SfxItemSet * m_pISet
const SwFormat * m_pCurrentStyle
const ww8::Frame * m_pParentFrame
bool GetAnnotationMarks(const SwWW8AttrIter &rAttrs, sal_Int32 nStt, sal_Int32 nEnd, IMarkVector &rArr)
std::unique_ptr< SwNumRuleTable > m_pUsedNumTable
sal_uInt16 m_nLastFormatId
Style of last TextNode in normal range.
bool m_bOutPageDescs
PageDescs (section properties) are being written.
std::unordered_map< OUString, OUString > m_TOXMarkBookmarksByURL
std::unique_ptr< WW8_WrPlcField > m_pFieldHFTextBxs
virtual AttributeOutputBase & AttrOutput() const =0
Access to the attribute output class.
std::unordered_map< SwTOXMark const *, OUString > m_TOXMarkBookmarksByTOXMark
virtual ~MSWordExportBase()
std::shared_ptr< SwUnoCursor > & m_pCurPam
std::map< OUString, LinkedTextboxInfo > m_aLinkedTextboxesHelper
MSWordExportBase(SwDoc &rDocument, std::shared_ptr< SwUnoCursor > &pCurrentPam, SwPaM *pOriginalPam)
std::unique_ptr< WW8_WrPlcField > m_pFieldFootnote
std::unique_ptr< WW8_WrPlcPn > m_pPapPlc
std::unique_ptr< HdFtPlcDrawObj > m_pHFSdrObjs
void BulletDefinitions()
Write the numbering picture bullets.
std::unique_ptr< WW8_WrPlcTextBoxes > m_pTextBxs
MSWordAttrIter * m_pChpIter
std::unique_ptr< WW8_WrPlcPn > m_pChpPlc
void SetCurPam(SwNodeOffset nStt, SwNodeOffset nEnd)
sal_uInt16 GetId(const SwTextFormatColl &rColl) const
Return the numeric id of the style.
virtual sal_uInt64 ReplaceCr(sal_uInt8 nChar)=0
std::unique_ptr< WW8_WrPlcAnnotations > m_pAtn
Class to collect and output the sections/headers/footers.
Class to collect and output the styles table.
MapUnit GetMapUnit() const
SAL_WARN_UNUSED_RESULT Point PixelToLogic(const Point &rDevicePt) const
SAL_WARN_UNUSED_RESULT Point LogicToLogic(const Point &rPtSource, const MapMode *pMapModeSource, const MapMode *pMapModeDest) const
const SdrPage * GetPage(sal_uInt16 nPgNum) const
Item2Range GetItemSurrogates(sal_uInt16 nWhich) const
const SfxPoolItem & GetDefaultItem(sal_uInt16 nWhich) const
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
sal_uInt16 ClearItem(sal_uInt16 nWhich=0)
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SfxPoolItem * GetItem(sal_uInt16 nWhich, bool bSearchInParent=true) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
const std::shared_ptr< const SfxFilter > & GetFilter() const
SfxItemSet & GetItemSet() const
sal_uInt32 GetModifyPasswordHash() const
std::shared_ptr< GDIMetaFile > GetPreviewMetaFile(bool bFullContent=false) const
css::uno::Reference< css::frame::XModel3 > GetModel() const
css::uno::Reference< css::embed::XStorage > const & GetStorage()
const css::uno::Any & GetValue() const
constexpr tools::Long Height() const
constexpr tools::Long Width() const
bool Remove(const OUString &rEleName)
tools::SvRef< SotStorageStream > OpenSotStream(const OUString &rEleName, StreamMode=StreamMode::STD_READWRITE)
void SetClass(const SvGlobalName &rClass, SotClipboardFormatId bOriginalClipFormat, const OUString &rUserTypeName)
SotStorage * OpenSotStorage(const OUString &rEleName, StreamMode=StreamMode::STD_READWRITE, bool transacted=true)
tools::SvRef< SotStorage > m_pStg
SotStorage & GetStorage() const
virtual ErrCode Write(SwPaM &, const css::uno::Reference< css::embed::XStorage > &, const OUString *, SfxMedium *=nullptr) override
SvStream & WriteInt32(sal_Int32 nInt32)
void SetEndian(SvStreamEndian SvStreamEndian)
virtual sal_uInt64 TellEnd()
std::size_t WriteBytes(const void *pData, std::size_t nSize)
SvStream & WriteInt16(sal_Int16 nInt16)
SvStream & WriteUInt16(sal_uInt16 nUInt16)
SvStream & WriteUInt32(sal_uInt32 nUInt32)
sal_uInt64 Seek(sal_uInt64 nPos)
SvStream & WriteChar(char nChar)
std::size_t ReadBytes(void *pData, std::size_t nSize)
SvStream & WriteStream(SvStream &rStream)
bool IsCalc2Excel() const
static SvtFilterOptions & Get()
bool IsImpress2PowerPoint() const
bool IsWriter2WinWord() const
bool IsMath2MathType() const
sal_Int16 GetDistance(SvxBoxItemLine nLine, bool bAllowNegative=false) const
const Color & GetColor() const
const Graphic * GetGraphic(OUString const &referer=OUString()) const
ErrCode SaveOrDelMSVBAStorage(bool bSaveInto, const OUString &rStorageName)
static ErrCode GetSaveWarningOfMSVBAStorage(SfxObjectShell &rDocS)
tools::Long GetRight() const
tools::Long GetLeft() const
SvxNumType GetNumberingType() const
tools::Long GetHeight() const
tools::Long GetWidth() const
sal_uInt16 GetUpper() const
sal_uInt16 GetLower() const
const SwModify * GetRegisteredIn() const
const SwAttrSet * GetpSwAttrSet() const
SwFormatColl & GetAnyFormatColl() const
SwSectionFormats & GetSections()
bool GotoOutline(SwPosition &rPos, const OUString &rName, SwRootFrame const *=nullptr) const
IDocumentExternalData const & getIDocumentExternalData() const
const SwNumRuleTable & GetNumRuleTable() const
const SwCharFormats * GetCharFormats() const
IDocumentRedlineAccess const & getIDocumentRedlineAccess() const
bool ContainsMSVBasic() const
const SwFlyFrameFormat * FindFlyByName(const OUString &rName, SwNodeType nNdTyp=SwNodeType::NONE) const
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
IDocumentSettingAccess const & getIDocumentSettingAccess() const
SwTableFormat * FindTableFormatByName(const OUString &rName, bool bAll=false) const
IDocumentStylePoolAccess const & getIDocumentStylePoolAccess() const
const SwAttrPool & GetAttrPool() const
IDocumentDrawModelAccess const & getIDocumentDrawModelAccess() const
SwDocShell * GetDocShell()
const SwPageDesc & GetPageDesc(const size_t i) const
IDocumentStatistics const & getIDocumentStatistics() const
const SwTOXMark & GotoTOXMark(const SwTOXMark &rCurTOXMark, SwTOXSearch eDir, bool bInReadOnly)
Ends a section of nodes in the document model.
Pagedescriptor Client of SwPageDesc that is "described" by the attribute.
Marks a node in the document model.
Base class of the Writer document model elements.
SwFrameFormat * GetFlyFormat() const
If node is in a fly return the respective format.
SwStartNode * GetStartNode()
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
SwSectionNode * GetSectionNode()
SwNodeOffset GetIndex() const
SwNodes & GetNodes()
Node is in which nodes-array/doc?
bool IsContentNode() const
const SwPageDesc * FindPageDesc(SwNodeOffset *pPgDescNdIdx=nullptr) const
Search PageDesc with which this node is formatted.
bool IsSectionNode() const
SwTableNode * FindTableNode()
Search table node, in which it is.
const SwStartNode * StartOfSectionNode() const
SwTableNode * GetTableNode()
SwNode & GetEndOfContent() const
Regular ContentSection (i.e. the BodyText).
bool IsDocNodes() const
Is the NodesArray the regular one of Doc? (and not the UndoNds, ...) Implementation in doc....
SwContentNode * GoNext(SwNodeIndex *) const
SwNodeOffset Count() const
bool IsContinusNum() const
const SwNumFormat & Get(sal_uInt16 i) const
PaM is Point and Mark: a selection of the document model.
const SwPosition * GetMark() const
const SwPosition * GetPoint() const
SwFrameFormat & GetMaster()
const SwFrameFormat * GetPageFormatOfNode(const SwNode &rNd, bool bCheckForThisPgDc=true) const
static std::map< OUString, OUString > getTextNodeStatements(const OUString &rType, SwTextNode &rTextNode)
Gets all (rTextNode, key, value) statements in RDF graphs of type rType.
Of course Writer needs its own rectangles.
void Width(tools::Long nNew)
The root element of a Writer document layout.
bool IsHideRedlines() const
Replacement for sw::DocumentRedlineManager::GetRedlineFlags() (this is layout-level redline hiding).
const SwSection & GetSection() const
SwSectionFormat * GetFormat()
SectionType GetType() const
Starts a section of nodes in the document model.
SwTableBox is one table cell in the document model.
SwFrameFormat * GetFrameFormat()
const SwStartNode * GetSttNd() const
SwTableLine is one table row in the document model.
SwFrameFormat * GetFrameFormat()
SwTableBoxes & GetTabBoxes()
const SwTable & GetTable() const
SwTable is one table in the document model, containing rows (which contain cells).
SwTableNode * GetTableNode() const
SwTableFormat * GetFrameFormat()
static SwTable * FindTable(SwFrameFormat const *const pFormat)
sal_uInt16 GetRowsToRepeat() const
Represents the style of a paragraph.
SwTextAttr subclass that tracks the location of the wrapped SwFormatURL.
const SwTextNode * GetpTextNode() const
SwTextNode is a paragraph in the document model.
const OUString & GetText() const
Value const & at(size_type nPos) const
SvxZoomType GetZoomType() const
sal_uInt16 GetZoom() const
const SwViewOption * GetViewOptions() const
virtual void CalcLayout()
bool HasFlysAt(sal_Int32 nSwPos) const
The writer class that gets called for the WW8 filter.
static sal_uLong FillUntil(SvStream &rStrm, sal_uLong nEndPos=0)
static void InsUInt32(ww::bytes &rO, sal_uInt32 n)
static void WriteString8(SvStream &rStrm, std::u16string_view rStr, bool bAddZero, rtl_TextEncoding eCodeSet)
virtual ErrCode WriteStorage() override
static void InsAsString16(ww::bytes &rO, const OUString &rStr)
IDocumentSettingAccess & getIDocumentSettingAccess()
ErrCode WriteStorageImpl()
static void FillCount(SvStream &rStrm, sal_uLong nCount)
static void WriteString_xstz(SvStream &rStrm, const OUString &rStr, bool bAddZero)
static void InsUInt16(ww::bytes &rO, sal_uInt16 n)
virtual ErrCode Write(SwPaM &, SfxMedium &, const OUString *) override
virtual ErrCode WriteMedium(SfxMedium &) override
static void InsAsString8(ww::bytes &O, std::u16string_view rStr, rtl_TextEncoding eCodeSet)
static void WriteLong(SvStream &rStrm, sal_Int32 nVal)
bool InitStd97CodecUpdateMedium(::msfilter::MSCodec_Std97 &rCodec)
static void WriteString16(SvStream &rStrm, const OUString &rStr, bool bAddZero)
static void WriteShort(SvStream &rStrm, sal_Int16 nVal)
virtual ~SwWW8Writer() override
SwWW8Writer(std::u16string_view rFltName, const OUString &rBaseURL)
virtual void TableBidi(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfo) override
virtual void TableOrientation(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner) override
virtual void TableHeight(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfo) override
virtual void TableCanSplit(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfo) override
virtual void TableDefaultBorders(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfo) override
virtual void TableRowEnd(sal_uInt32 nDepth) override
virtual void TableBackgrounds(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfo) override
virtual void TableDefinition(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfo) override
void TablePositioning(SwFrameFormat *pFlyFormat)
virtual void TableRowRedline(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfo) override
virtual void TableNodeInfoInner(ww8::WW8TableNodeInfoInner::Pointer_t pNodeInfoInner) override
WW8Export & m_rWW8Export
Reference to the export, where to get the data from.
virtual void TableSpacing(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner) override
void TableCellBorders(ww8::WW8TableNodeInfoInner::Pointer_t const &pTableTextNodeInfoInner)
virtual void TableInfoCell(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfo) override
virtual void TableCellRedline(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfo) override
virtual void TableInfoRow(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfo) override
virtual void TableVerticalCell(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfo) override
sal_Int16 m_cchFollowingPunct
static constexpr OUStringLiteral JapanNotBeginLevel1
sal_uInt16 m_iLevelOfKinsoku
static constexpr OUStringLiteral JapanNotEndLevel1
sal_uInt16 m_fKerningPunct
sal_Int16 m_cchLeadingPunct
LanguageType GetConvertedLang() const
sal_Unicode m_rgxchLPunct[nMaxLeading]
sal_Unicode m_rgxchFPunct[nMaxFollowing]
sal_uInt16 m_iJustification
Exporter of the binary Word file formats.
void Out_CellRangeBorders(const SvxBoxItem *pBox, sal_uInt8 nStart, sal_uInt8 nLimit)
static bool TransBrush(const Color &rCol, WW8_SHD &rShd)
TransBrush converts SW-Brushes to WW.
std::unique_ptr< WW8AttributeOutput > m_pAttrOutput
Converting attributes to stream data.
std::unique_ptr< WW8_WrPlcSepx > m_pSepx
Sections/headers/footers.
virtual MSWordSections & Sections() const override
Access to the sections/headers/footres.
void InsUInt16(sal_uInt16 n)
void InsInt16(sal_Int16 n)
tools::SvRef< SotStorage > m_xEscherStg
virtual void SaveData(SwNodeOffset nStt, SwNodeOffset nEnd) override
Remember some of the members so that we can recurse in WriteText().
WW8Export(SwWW8Writer *pWriter, SwDoc &rDocument, std::shared_ptr< SwUnoCursor > &pCurrentPam, SwPaM *pOriginalPam, bool bDot)
Setup the exporter.
virtual ~WW8Export() override
virtual ErrCode ExportDocument_Impl() override
Format-dependent part of the actual export.
void WriteStringAsPara(const OUString &rText)
bool m_bDot
Template or document.
virtual void WriteNumbering() override
Output the numbering table.
virtual void WriteFormData(const ::sw::mark::IFieldmark &rFieldmark) override
Write the data of the form field.
void WriteChar(sal_Unicode c) override
virtual void ExportGrfBullet(const SwTextNode &rNd) override
void InsUInt32(sal_uInt32 n)
SvStream * m_pDataStrm
Streams for WW97 Export.
virtual void AppendBookmark(const OUString &rName) override
sal_uInt16 AddRedlineAuthor(std::size_t nId)
std::unique_ptr< WW8_WrPlcFootnoteEdn > m_pFootnote
Footnotes - structure to remember them, and output.
void ExportDopTypography(WW8DopTypography &rTypo)
virtual void AppendAnnotationMarks(const SwWW8AttrIter &rAttrs, sal_Int32 nCurrentPos, sal_Int32 nLen) override
std::unique_ptr< WW8Dop > m_pDop
Document Properties.
std::unique_ptr< WW8Fib > m_pFib
File Information Block.
void WriteAsStringTable(const std::vector< OUString > &, sal_Int32 &rfcSttbf, sal_Int32 &rlcbSttbf)
virtual void AppendSmartTags(SwTextNode &rTextNode) override
virtual void AppendBookmarks(const SwTextNode &rNd, sal_Int32 nCurrentPos, sal_Int32 nLen, const SwRedlineData *pRedlineData=nullptr) override
SwTwips CurrentPageWidth(SwTwips &rLeft, SwTwips &rRight) const
virtual AttributeOutputBase & AttrOutput() const override
memory leak #i120098#, to hold the reference to unnamed SotStorage obj
virtual void SectionBreaksAndFrames(const SwTextNode &rNode) override
static void Out_SwFormatTableBox(ww::bytes &rO, const SvxBoxItem *rBox)
FormatBox2() is for TC structures in tables.
void OutGrfBullets(const ww8::Frame &rFrame)
WW8_CP Fc2Cp(sal_uLong nFc) const
SwWW8Writer & GetWriter() const
void AppendBookmarkEndWithCorrection(const OUString &rName)
virtual void WriteHyperlinkData(const ::sw::mark::IFieldmark &rFieldmark) override
std::unique_ptr< ww::bytes > m_pO
Buffer.
virtual void WriteCR(ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner=ww8::WW8TableNodeInfoInner::Pointer_t()) override
virtual void RestoreData() override
Restore what was saved in SaveData().
std::unique_ptr< WW8_WrPlcFootnoteEdn > m_pEdn
Endnotes - structure to remember them, and output.
void OutSwString(const OUString &, sal_Int32 nStt, sal_Int32 nLen)
void MoveFieldMarks(WW8_CP nFrom, WW8_CP nTo)
FIB - the File Information Block.
void setCvBack(sal_uInt32 cvBack)
void setCvFore(sal_uInt32 cvFore)
void Write(WW8Export &rExport)
[MS-DOC] SmartTagData: stores information about all smart tags in the document.
std::vector< MSOPropertyBag > m_aPropBags
void Write(WW8Export &rExport)
MSOPropertyBagStore m_aPropBagStore
FKP - Formatted disK Page.
void Write(SvStream &rStrm, SwWW8WrGrf &rGrf)
void MergeToNew(short &rVarLen, sal_uInt8 *&pNewSprms)
sal_uInt8 * CopyLastSprms(sal_uInt8 &rLen)
sal_uInt8 SearchSameSprm(sal_uInt16 nVarLen, const sal_uInt8 *pSprms)
bool IsEqualPos(WW8_FC nEndFc) const
WW8_WrFkp & operator=(const WW8_WrFkp &)=delete
void SetNewEnd(WW8_FC nEnd)
WW8_FC GetStartFc() const
WW8_WrFkp(const WW8_WrFkp &)=delete
bool Append(WW8_FC nEndFc, sal_uInt16 nVarLen, const sal_uInt8 *pSprms)
void Append(WW8_CP nCp, sal_uLong nData)
void Write(WW8Export &rWrt)
WW8_CP GetStartCp() const
WW8_FC GetStartFc() const
sal_uInt16 GetStatus() const
WW8_WrPc(WW8_FC nSFc, WW8_CP nSCp)
WW8_WrPct(WW8_FC nStartFc)
std::vector< std::unique_ptr< WW8_WrPc > > m_Pcts
void WritePc(WW8Export &rWrt)
void AppendPc(WW8_FC nStartFc)
WW8_CP Fc2Cp(sal_uLong nFc) const
std::vector< WW8_CP > m_aPos
void Write(SvStream &rStrm)
std::unique_ptr< sal_uInt8[]> m_pData
void Append(WW8_CP nCp, const void *pData)
WW8_WrPlc1(const WW8_WrPlc1 &)=delete
void Finish(sal_uLong nLastCp, sal_uLong nStartCp)
void WritePlc(WW8Export &rWrt) const
bool WriteText(WW8Export &rWrt)
void Write(WW8Export &rWrt)
std::vector< std::unique_ptr< WW8_WrFkp > > m_Fkps
sal_uInt8 * CopyLastSprms(sal_uInt8 &rLen)
void AppendFkpEntry(WW8_FC nEndFc, short nVarLen=0, const sal_uInt8 *pSprms=nullptr)
sal_uInt16 m_nFkpStartPage
WW8_WrPlcPn(const WW8_WrPlcPn &)=delete
void WriteGenericPlc(WW8Export &rWrt, sal_uInt8 nTTyp, WW8_FC &rTextStt, sal_Int32 &rTextCnt, WW8_FC &rRefStt, sal_Int32 &rRefCnt) const
bool WriteGenericText(WW8Export &rWrt, sal_uInt8 nTTyp, WW8_CP &rCount)
void WritePlc(WW8Export &rWrt) const
void MoveFieldMarks(WW8_CP nFrom, WW8_CP nTo)
Move existing field marks from one position to another.
WW8_WrtBookmarks & operator=(WW8_WrtBookmarks const &)=delete
void Append(WW8_CP nStartCp, const OUString &rNm)
Add a new bookmark to the list OR add an end position to an existing bookmark.
BKMKCPs maSttCps
Structure of one item inside this map: (startPos, (endPos, (a bool value?, bookmarkName)))
void Write(WW8Export &rWrt)
Write out bookmarks to file.
WW8_WrtBookmarks(WW8_WrtBookmarks const &)=delete
Handles export of smart tags.
WW8_WrtFactoids(WW8_WrtFactoids const &)=delete
std::vector< WW8_CP > m_aEndCPs
std::vector< std::map< OUString, OUString > > m_aStatements
void Write(WW8Export &rWrt)
void Append(WW8_CP nStartCp, WW8_CP nEndCp, const std::map< OUString, OUString > &rStatements)
WW8_WrtFactoids & operator=(WW8_WrtFactoids const &)=delete
std::vector< WW8_CP > m_aStartCPs
virtual void Write(Writer &rWrt) override
void SetStream(SvStream *const pStream)
void CreateBookmarkTable()
static std::shared_ptr< SwUnoCursor > NewUnoCursor(SwDoc &rDoc, SwNodeOffset const nStartIdx, SwNodeOffset const nEndIdx)
void SetBaseURL(const OUString &rURL)
std::shared_ptr< SwUnoCursor > m_pCurrentPam
TValueType getUnpackedValueOrDefault(const OUString &sKey, const TValueType &aDefault) const
css::uno::Any getValue(const OUString &sKey) const
bool Encode(const void *pData, std::size_t nDatLen, sal_uInt8 *pBuffer, std::size_t nBufLen)
void GetDocId(sal_uInt8 pDocId[16])
virtual css::uno::Sequence< css::beans::NamedValue > GetEncryptionData()
bool InitCodec(const css::uno::Sequence< css::beans::NamedValue > &aData)
virtual bool InitCipher(sal_uInt32 nCounter) override
void GetEncryptKey(const sal_uInt8 pSalt[16], sal_uInt8 pSaltData[16], sal_uInt8 pSaltDigest[16])
virtual void InitKey(const sal_uInt16 pPassData[16], const sal_uInt8 pDocId[16]) override
std::vector< OUString > maAuthors
SvStream * GetStream(StreamMode eMode)
static std::unique_ptr< SvStream > CreateStream(const OUString &rFileName, StreamMode eOpenMode, css::uno::Reference< css::awt::XWindow > xParentWin=nullptr)
Make exporting a Writer Frame easy.
const SwFrameFormat & GetFrameFormat() const
Get the writer SwFrameFormat that this object describes.
bool getWriteReservation() const
bool getReadOnlyRecommended() const
std::vector< OUString > & getStrings()
std::shared_ptr< WW8TableInfo > Pointer_t
const SwNode * getNextNode(const SwNode *pNode)
const SwNode * getNode() const
const SwTable * getTable() const
std::shared_ptr< WW8TableNodeInfoInner > Pointer_t
std::map< sal_uInt32, WW8TableNodeInfoInner::Pointer_t, std::greater< sal_uInt32 > > Inners_t
std::shared_ptr< WW8TableNodeInfo > Pointer_t
void InitFontTable(const SwDoc &rDoc)
rDoc used only to get the initial standard font(s) in use.
void WriteFontTable(SvStream *pTableStream, WW8Fib &pFib)
constexpr ::Color COL_AUTO(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
const char * dbg_out(const void *pVoid)
#define ERRCODE_IO_GENERAL
#define ERRCODE_IO_CANTWRITE
#define ERRCODE_IO_NOTSUPPORTED
@ Variable
Frame is variable in Var-direction.
@ Minimum
Value in Var-direction gives minimum (can be exceeded but not be less).
constexpr TypedWhichId< SwFormatURL > RES_URL(117)
constexpr TypedWhichId< SwFormatINetFormat > RES_TXTATR_INETFMT(51)
constexpr TypedWhichId< SwFormatPageDesc > RES_PAGEDESC(99)
constexpr TypedWhichId< SvxBrushItem > RES_BACKGROUND(111)
constexpr TypedWhichId< SvxHyphenZoneItem > RES_PARATR_HYPHENZONE(69)
constexpr TypedWhichId< SvxTabStopItem > RES_PARATR_TABSTOP(68)
constexpr TypedWhichId< SvxCharRotateItem > RES_CHRATR_ROTATE(32)
Sequence< PropertyValue > aArguments
constexpr OUStringLiteral FILTER_WW8
WinWord 97 filter.
#define LANGUAGE_JAPANESE
#define SAL_WARN(area, stream)
#define SAL_INFO(area, stream)
void StartProgress(TranslateId pMessResId, tools::Long nStartValue, tools::Long nEndValue, SwDocShell *pDocShell)
void EndProgress(SwDocShell const *pDocShell)
void SetProgressState(tools::Long nPosition, SwDocShell const *pDocShell)
std::unique_ptr< sal_Int32[]> pData
#define OLE_STARIMPRESS_2_POWERPOINT
#define OLE_STARWRITER_2_WINWORD
#define OLE_STARCALC_2_EXCEL
#define OLE_STARMATH_2_MATHTYPE
constexpr OUStringLiteral aMSMacroCmds
constexpr OUStringLiteral aObjectPool
constexpr OUStringLiteral aData
constexpr OUStringLiteral a1Table
Reference< XComponentContext > getProcessComponentContext()
void copy(const fs::path &src, const fs::path &dest)
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
std::shared_ptr< T > make_shared(Args &&... args)
OString OUStringToOString(std::u16string_view str, ConnectionSettings const *settings)
uno::Sequence< sal_Int8 > convertMetaFile(GDIMetaFile const *i_pThumb)
bool SaveOlePropertySet(const uno::Reference< document::XDocumentProperties > &i_xDocProps, SotStorage *i_pStorage, const uno::Sequence< sal_Int8 > *i_pThumb, const uno::Sequence< sal_Int8 > *i_pGuid, const uno::Sequence< sal_Int8 > *i_pHyperlinks)
sal_uInt16 GetSetWhichFromSwDocWhich(const SfxItemSet &rSet, const SwDoc &rDoc, sal_uInt16 nWhich)
Map a SwDoc WhichId to the equivalent Id for a given SfxItemSet.
sal_uInt32 DateTime2DTTM(const DateTime &rDT)
Convert from DTTM to Writer's DateTime.
ww8::Frames GetFrames(const SwDoc &rDoc, SwPaM const *pPaM)
Get the Floating elements in a SwDoc.
void UpdateFramePositions(ww8::Frames &rFrames)
fix up frame positions, must be called after SetRedlineFlags
auto PrepareJumpToTOXMark(SwDoc const &rDoc, std::u16string_view aName) -> std::optional< std::pair< SwTOXMark, sal_Int32 > >
std::shared_ptr< RowSpans > RowSpansPtr
std::shared_ptr< GridCols > GridColsPtr
std::shared_ptr< TableBoxVector > TableBoxVectorPtr
std::shared_ptr< Widths > WidthsPtr
const unsigned int MAXTABLECELLS
sal_uInt32 RGBToBGR(::Color nColour)
std::vector< sal_uInt8 > bytes
::std::array< OUString, NF_KEYWORD_ENTRIES_COUNT > NfKeywordTable
o3tl::strong_int< sal_Int32, struct Tag_SwNodeOffset > SwNodeOffset
SwNodeOffset min(const SwNodeOffset &a, const SwNodeOffset &b)
constexpr OUStringLiteral ODF_FORMTEXT
constexpr OUStringLiteral ODF_FORMDROPDOWN_RESULT
constexpr OUStringLiteral ODF_FORMDROPDOWN_LISTENTRY
constexpr OUStringLiteral ODF_FORMCHECKBOX
constexpr OUStringLiteral ODF_FORMDROPDOWN
@ RES_POOLCOLL_STANDARD
Standard.
#define STREAM_SEEK_TO_END
Structure that is used to save some of the WW8Export/DocxExport data.
std::shared_ptr< SwUnoCursor > pOldPam
bool bOldWriteAll
WW8Export only.
const ww8::Frame * pOldFlyFormat
const SwPageDesc * pOldPageDesc
std::unique_ptr< ww::bytes > pOOld
WW8Export only.
static constexpr sal_uInt16 val
sal_uLong nPara
paragraphs for document statistic: non-empty and non-hidden ones
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.
SwNodeOffset GetNodeIndex() const
sal_Int32 GetContentIndex() const
bool fDontUseHTMLAutoSpacing
bool fDontBreakWrappedTables
sal_Int32 cParasFootnoteEdn
void SetCompatibilityOptions(sal_uInt32 a32Bit)
sal_Int32 cWordsFootnoteEnd
sal_uInt16 wScaleSaved
Specifies the zoom percentage that was in use when the document was saved.
void Write(SvStream &rStrm, WW8Fib &rFib) const
sal_Int32 cLinesFootnoteEdn
void SetCompatibilityOptions2(sal_uInt32 a32Bit)
sal_uInt16 GetValue() const
std::vector< SwTableBox * > SwTableBoxes
const sal_Unicode cMarkSeparator
OUString BookmarkToWord(std::u16string_view rBookmark, bool *pIsMove, bool *pIsFrom)
OUString BookmarkToWriter(std::u16string_view rBookmark)
std::map< OUString, tools::Long > BKMKNames
SAL_DLLPUBLIC_EXPORT sal_uInt32 SaveOrDelMSVBAStorage_ww8(SfxObjectShell &rDoc, SotStorage &rStor, sal_Bool bSaveInto, const OUString &rStorageName)
SAL_DLLPUBLIC_EXPORT sal_uInt32 GetSaveWarningOfMSVBAStorage_ww8(SfxObjectShell &rDocS)
static void WriteDop(WW8Export &rWrt)
static sal_uInt8 nAttrMagicIdx
static sal_uInt16 lcl_TCFlags(SwDoc &rDoc, const SwTableBox *pBox, sal_Int32 nRowSpan)
static int lcl_CmpBeginEndChars(const OUString &rSWStr, const sal_Unicode *pMSStr, int nMSStrByteLen)
ww8::WW8Sttb< ww8::WW8Struct > WW8SttbAssoc
std::pair< tools::Long, BKMK > BKMKCP
constexpr OUStringLiteral sCompObj
#define DEFAULT_STYLES_COUNT
std::pair< bool, OUString > BKMK
constexpr OUStringLiteral sMainStream
std::multimap< tools::Long, BKMKCP * > BKMKCPs
SAL_DLLPUBLIC_EXPORT void ExportDOC(std::u16string_view rFltName, const OUString &rBaseURL, WriterRef &xRet)
bool checkRead(SvStream &rSt, void *pDest, sal_uInt32 nLength)
void Set_UInt32(sal_uInt8 *&p, sal_uInt32 n)
void Set_UInt8(sal_uInt8 *&p, sal_uInt8 n)
void Set_UInt16(sal_uInt8 *&p, sal_uInt16 n)