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>
98#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
99#include <com/sun/star/document/XDocumentProperties.hpp>
107#include <rtl/random.h>
183typedef std::pair<bool,OUString>
BKMK;
184typedef std::pair<tools::Long,BKMK>
BKMKCP;
185typedef std::multimap<tools::Long,BKMKCP*>
BKMKCPs;
218 delete rEntry.second;
219 rEntry.second =
nullptr;
226 std::pair<BKMKNames::iterator, bool> aResult =
maSwBkmkNms.insert(std::pair<OUString,tools::Long>(rNm,0L));
231 maSttCps.insert(std::pair<tools::Long,BKMKCP*>(nStartCp,pBKCP));
232 aResult.first->second =
static_cast<tools::Long>(nStartCp);
236 std::pair<CPItr,CPItr> aRange =
maSttCps.equal_range(aResult.first->second);
237 for (
CPItr aItr = aRange.first;aItr != aRange.second;++aItr)
239 if (aItr->second && aItr->second->second.second == rNm)
241 if (aItr->second->second.first)
243 aItr->second->first =
static_cast<tools::Long>(nStartCp);
255 std::vector<OUString> aNames;
264 aEndCps.insert(std::pair<tools::Long,BKMKCP*>(rEntry.second->first, rEntry.second));
265 aNames.push_back(rEntry.second->second.second);
272 for (
const auto& rEntry : aEndCps)
276 rEntry.second->first =
n;
304 std::pair<CPItr,CPItr> aRange =
maSttCps.equal_range(nFrom);
305 CPItr aItr = aRange.first;
306 while (aItr != aRange.second)
310 if (aItr->second->first ==
static_cast<tools::Long>(nFrom))
312 aItr->second->second.first =
true;
313 aItr->second->first = nTo;
315 maSttCps.insert(std::pair<tools::Long,BKMKCP*>(nTo,aItr->second));
316 aItr->second =
nullptr;
317 aRange =
maSttCps.equal_range(nFrom);
337 void Append(
WW8_CP nStartCp,
WW8_CP nEndCp,
const std::map<OUString, OUString>& rStatements);
358 rExport.
m_pDop->fEmbedFactoids =
true;
362 rExport.
m_pFib->m_fcSttbfBkmkFactoid = rStream.
Tell();
377 rExport.
m_pFib->m_lcbSttbfBkmkFactoid = rStream.
Tell() - rExport.
m_pFib->m_fcSttbfBkmkFactoid;
379 rExport.
m_pFib->m_fcPlcfBkfFactoid = rStream.
Tell();
392 rExport.
m_pFib->m_lcbPlcfBkfFactoid = rStream.
Tell() - rExport.
m_pFib->m_fcPlcfBkfFactoid;
394 rExport.
m_pFib->m_fcPlcfBklFactoid = rStream.
Tell();
405 rExport.
m_pFib->m_lcbPlcfBklFactoid = rStream.
Tell() - rExport.
m_pFib->m_fcPlcfBklFactoid;
407 rExport.
m_pFib->m_fcFactoidData = rStream.
Tell();
410 aFactoidType.
m_nId = 1;
411 aFactoidType.
m_aUri =
"http://www.w3.org/1999/02/22-rdf-syntax-ns#";
412 aFactoidType.
m_aTag =
"RDF";
416 std::set<OUString> aSet;
417 for (
const std::map<OUString, OUString>& rStatements :
m_aStatements)
420 for (
const auto& rPair : rStatements)
422 aSet.insert(rPair.first);
423 aSet.insert(rPair.second);
427 for (
const std::map<OUString, OUString>& rStatements :
m_aStatements)
430 aPropertyBag.
m_nId = 1;
431 for (
const auto& rPair : rStatements)
434 aProperty.
m_nKey = std::distance(aSet.begin(), aSet.find(rPair.first));
435 aProperty.
m_nValue = std::distance(aSet.begin(), aSet.find(rPair.second));
441 aSmartTagData.
Write(rExport);
442 rExport.
m_pFib->m_lcbFactoidData = rStream.
Tell() - rExport.
m_pFib->m_fcFactoidData;
445#define DEFAULT_STYLES_COUNT 16
465 rDop.
dxaTab = o3tl::narrowing<sal_uInt16>(rTabStop[0].GetTabPos());
473 case SvxZoomType::WHOLEPAGE: rDop.
zkSaved = 1;
break;
474 case SvxZoomType::PAGEWIDTH: rDop.
zkSaved = 2;
break;
475 case SvxZoomType::OPTIMAL: rDop.
zkSaved = 3;
break;
489 rDop.
cPg =
static_cast< sal_Int16
>(rDStat.
nPage);
494 OSL_ENSURE(pDocShell,
"no SwDocShell");
495 uno::Reference<document::XDocumentProperties> xDocProps;
496 uno::Reference<beans::XPropertySet> xProps;
499 uno::Reference<lang::XComponent> xModelComp = pDocShell->
GetModel();
500 xProps.set(xModelComp, uno::UNO_QUERY);
501 uno::Reference<document::XDocumentPropertiesSupplier> xDPS(xModelComp, uno::UNO_QUERY_THROW);
502 xDocProps = xDPS->getDocumentProperties();
503 OSL_ENSURE(xDocProps.is(),
"DocumentProperties is null");
537 ::util::DateTime uDT = xDocProps->getCreationDate();
539 uDT = xDocProps->getModificationDate();
541 uDT = xDocProps->getPrintDate();
566 if( nMSStrByteLen > rSWStr.getLength() )
567 nMSStrByteLen = rSWStr.getLength()+1;
570 return memcmp( rSWStr.getStr(), pMSStr, nMSStrByteLen );
584 0x0021, 0x0025, 0x0029, 0x002c, 0x002e, 0x003a, 0x003b, 0x003f,
585 0x005d, 0x007d, 0x00a2, 0x00b0, 0x2019, 0x201d, 0x2030, 0x2032,
586 0x2033, 0x2103, 0x3001, 0x3002, 0x3005, 0x3009, 0x300b, 0x300d,
587 0x300f, 0x3011, 0x3015, 0x3041, 0x3043, 0x3045, 0x3047, 0x3049,
588 0x3063, 0x3083, 0x3085, 0x3087, 0x308e, 0x309b, 0x309c, 0x309d,
589 0x309e, 0x30a1, 0x30a3, 0x30a5, 0x30a7, 0x30a9, 0x30c3, 0x30e3,
590 0x30e5, 0x30e7, 0x30ee, 0x30f5, 0x30f6, 0x30fb, 0x30fc, 0x30fd,
591 0x30fe, 0xff01, 0xff05, 0xff09, 0xff0c, 0xff0e, 0xff1a, 0xff1b,
592 0xff1f, 0xff3d, 0xff5d, 0xff61, 0xff63, 0xff64, 0xff65, 0xff67,
593 0xff68, 0xff69, 0xff6a, 0xff6b, 0xff6c, 0xff6d, 0xff6e, 0xff6f,
594 0xff70, 0xff9e, 0xff9f, 0xffe0
598 0x0021, 0x0029, 0x002c, 0x002e, 0x003a, 0x003b, 0x003f, 0x005d,
599 0x007d, 0x00a8, 0x00b7, 0x02c7, 0x02c9, 0x2015, 0x2016, 0x2019,
600 0x201d, 0x2026, 0x2236, 0x3001, 0x3002, 0x3003, 0x3005, 0x3009,
601 0x300b, 0x300d, 0x300f, 0x3011, 0x3015, 0x3017, 0xff01, 0xff02,
602 0xff07, 0xff09, 0xff0c, 0xff0e, 0xff1a, 0xff1b, 0xff1f, 0xff3d,
603 0xff40, 0xff5c, 0xff5d, 0xff5e, 0xffe0
607 0x0021, 0x0025, 0x0029, 0x002c, 0x002e, 0x003a, 0x003b, 0x003f,
608 0x005d, 0x007d, 0x00a2, 0x00b0, 0x2019, 0x201d, 0x2032, 0x2033,
609 0x2103, 0x3009, 0x300b, 0x300d, 0x300f, 0x3011, 0x3015, 0xff01,
610 0xff05, 0xff09, 0xff0c, 0xff0e, 0xff1a, 0xff1b, 0xff1f, 0xff3d,
615 0x0021, 0x0029, 0x002c, 0x002e, 0x003a, 0x003b, 0x003f, 0x005d,
616 0x007d, 0x00a2, 0x00b7, 0x2013, 0x2014, 0x2019, 0x201d, 0x2022,
617 0x2025, 0x2026, 0x2027, 0x2032, 0x2574, 0x3001, 0x3002, 0x3009,
618 0x300b, 0x300d, 0x300f, 0x3011, 0x3015, 0x301e, 0xfe30, 0xfe31,
619 0xfe33, 0xfe34, 0xfe36, 0xfe38, 0xfe3a, 0xfe3c, 0xfe3e, 0xfe40,
620 0xfe42, 0xfe44, 0xfe4f, 0xfe50, 0xfe51, 0xfe52, 0xfe54, 0xfe55,
621 0xfe56, 0xfe57, 0xfe5a, 0xfe5c, 0xfe5e, 0xff01, 0xff09, 0xff0c,
622 0xff0e, 0xff1a, 0xff1b, 0xff1f, 0xff5c, 0xff5d, 0xff64
630 0x0024, 0x0028, 0x005b, 0x005c, 0x007b, 0x00a3, 0x00a5, 0x2018,
631 0x201c, 0x3008, 0x300a, 0x300c, 0x300e, 0x3010, 0x3014, 0xff04,
632 0xff08, 0xff3b, 0xff5b, 0xff62, 0xffe1, 0xffe5
636 0x0028, 0x005b, 0x007b, 0x00b7, 0x2018, 0x201c, 0x3008, 0x300a,
637 0x300c, 0x300e, 0x3010, 0x3014, 0x3016, 0xff08, 0xff0e, 0xff3b,
638 0xff5b, 0xffe1, 0xffe5
642 0x0028, 0x005b, 0x005c, 0x007b, 0x00a3, 0x00a5, 0x2018, 0x201c,
643 0x3008, 0x300a, 0x300c, 0x300e, 0x3010, 0x3014, 0xff04, 0xff08,
644 0xff3b, 0xff5b, 0xffe6
648 0x0028, 0x005b, 0x007b, 0x00a3, 0x00a5, 0x2018, 0x201c, 0x2035,
649 0x3008, 0x300a, 0x300c, 0x300e, 0x3010, 0x3014, 0x301d, 0xfe35,
650 0xfe37, 0xfe39, 0xfe3b, 0xfe3d, 0xfe3f, 0xfe41, 0xfe43, 0xfe59,
651 0xfe5b, 0xfe5d, 0xff08, 0xff5b
655 const i18n::ForbiddenCharacters *pForbidden =
nullptr;
656 const i18n::ForbiddenCharacters *pUseMe =
nullptr;
685 if (
nullptr != pForbidden)
689 aLangNotEnd[ nIdx ],
sizeof(aLangNotEnd[ nIdx ]) ) ||
691 aLangNotBegin[ nIdx ],
sizeof(aLangNotBegin[ nIdx ]) ) )
707 pForbidden->beginLine,
729 OSL_ENSURE( nNoNeeded<=1,
"Example of unexportable forbidden chars" );
734 (pUseMe->beginLine.getLength());
739 (pUseMe->endLine.getLength());
774 OSL_ENSURE(
false,
"Where is my ItemSet / pChpIter ?" );
789 OSL_ENSURE(nWhich != 0,
"All broken, Impossible");
797 m_nDataLen(16 * nStructSz),
798 m_nStructSiz( nStructSz )
809 OSL_ENSURE(b,
"Prev called on empty list");
810 return b ?
m_aPos.back() : 0;
831 m_aPos.push_back( nLastCp );
859 pfc = &rWrt.
m_pFib->m_fcPlcffldMom;
860 plc = &rWrt.
m_pFib->m_lcbPlcffldMom;
863 pfc = &rWrt.
m_pFib->m_fcPlcffldHdr;
864 plc = &rWrt.
m_pFib->m_lcbPlcffldHdr;
868 pfc = &rWrt.
m_pFib->m_fcPlcffldFootnote;
869 plc = &rWrt.
m_pFib->m_lcbPlcffldFootnote;
873 pfc = &rWrt.
m_pFib->m_fcPlcffldEdn;
874 plc = &rWrt.
m_pFib->m_lcbPlcffldEdn;
878 pfc = &rWrt.
m_pFib->m_fcPlcffldAtn;
879 plc = &rWrt.
m_pFib->m_lcbPlcffldAtn;
883 pfc = &rWrt.
m_pFib->m_fcPlcffldTxbx;
884 plc = &rWrt.
m_pFib->m_lcbPlcffldTxbx;
888 pfc = &rWrt.
m_pFib->m_fcPlcffldHdrTxbx;
889 plc = &rWrt.
m_pFib->m_lcbPlcffldHdrTxbx;
912 rWrt.
m_pFib->m_fcPlcfTch = nFcStart;
926 UInt32ToSVBT32(nData,nLittle);
933 static const sal_uInt32 aNulls[16] =
935 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
950 nEndPos = (nCurPos + 0x1ff) & ~0x1ffUL;
952 if( nEndPos > nCurPos )
954#if OSL_DEBUG_LEVEL > 0
956 OSL_ENSURE( nEndPos == nCurPos,
"Wrong FillUntil()" );
966 m_Fkps.push_back(std::make_unique<WW8_WrFkp>(
m_ePlc, nStartFc));
999 nVarLen =
static_cast< short >(
p - aHugePapx);
1000 pSprms = pNewSprms = aHugePapx;
1004 else if( nVarLen && pF->
IsEqualPos( nEndFc ))
1014 bool bOk = pF->
Append(nEndFc, nVarLen, pNewSprms);
1020 m_Fkps.push_back(std::unique_ptr<WW8_WrFkp>(pF));
1021 if( !pF->
Append( nEndFc, nVarLen, pNewSprms ) )
1023 OSL_ENSURE(
false,
"Unable to insert Sprm" );
1026 if( pNewSprms != pSprms )
1034 for(
const std::unique_ptr<WW8_WrFkp> & rp :
m_Fkps)
1054 decltype(
m_Fkps)::size_type
i;
1063 m_Fkps[
i - 1 ]->GetEndFc() );
1084 : m_ePlc(ePl), m_nStartGrp(511), m_nOldStartGrp(511),
1085 m_nItemSize( (
CHP == ePl ) ? 1 : 13 ),
1086 m_nIMax(0), m_nOldVarLen(0), m_bCombined(false)
1090 memset(
m_pFkp, 0, 4 * 128 );
1091 memset(
m_pOfs, 0, 4 * 128 );
1092 reinterpret_cast<sal_Int32*
>(
m_pFkp)[0] = nStartFc;
1097 delete[]
reinterpret_cast<sal_Int32 *
>(
m_pFkp);
1098 delete[]
reinterpret_cast<sal_Int32 *
>(
m_pOfs);
1119 const sal_uInt8*
p =
m_pFkp + ( o3tl::narrowing<sal_uInt16>(nStart) << 1 );
1122 : ((o3tl::narrowing<sal_uInt16>(*
p++) << 1 ) == (( nVarLen+1) & 0xfffe)) )
1123 && !memcmp(
p, pSprms, nVarLen ) )
1133 sal_uInt8 *pStart=
nullptr,*pRet=
nullptr;
1142 const sal_uInt8*
p =
m_pFkp + ( o3tl::narrowing<sal_uInt16>(nStart) << 1 );
1153 memcpy(pRet,
p,rLen);
1160 assert((!nVarLen || pSprms) &&
"Item pointer missing");
1162 OSL_ENSURE( nVarLen < ( (
m_ePlc ==
PAP ) ? 497U : 502U ),
"Sprms too long !" );
1166 OSL_ENSURE(
false,
"Fkp::Append: Fkp is already combined" );
1172 OSL_ENSURE( nEndFc >=
n,
"+Fkp: FC backwards" );
1173 OSL_ENSURE( !nVarLen || !pSprms || nEndFc !=
n,
1174 "+Fkp: used same FC multiple times" );
1183 if (nVarLen && !nOldP)
1188 : (
m_nStartGrp - (((nVarLen + 1) & 0xFFFE)+1)) & 0xFFFE )
1203 if( nVarLen && !nOldP )
1211 ? ( nVarLen < 256 ) ? static_cast<sal_uInt8>(nVarLen) : 255
1212 : ( ( nVarLen + 1 ) >> 1 ));
1214 m_pFkp[ nOffset ] = nCnt;
1215 memcpy(
m_pFkp + nOffset + 1, pSprms, nVarLen );
1238#if defined OSL_BIGENDIAN
1243 *
p = OSL_SWAPDWORD( *
p );
1253 for(
p =
m_pFkp + 511 - 4;
p >= pEnd;
p-- )
1264 memcpy(
p,
nPos, 4 );
1318 return SVBT32ToUInt32(
m_pFkp );
1319 return reinterpret_cast<sal_Int32*
>(
m_pFkp)[0];
1344 if ( !nStartCp && !
m_Pcts.empty())
1346 OSL_ENSURE(1 ==
m_Pcts.size(),
"empty Piece!");
1356 nStartCp +=
m_Pcts.back()->GetStartCp();
1359 m_Pcts.push_back(std::make_unique<WW8_WrPc>(nStartFc, nStartCp));
1364 sal_uInt64 nPctStart;
1369 nOldPos = nPctStart + 1;
1372 for (
auto const& it :
m_Pcts)
1380 nStartCp +=
m_Pcts.back()->GetStartCp();
1384 for (
auto const& it :
m_Pcts)
1392 rWrt.
m_pFib->m_fcClx = nPctStart;
1394 rWrt.
m_pFib->m_lcbClx = nEndPos - nPctStart;
1398 nEndPos - nPctStart-5 );
1404 OSL_ENSURE( !
m_Pcts.empty(),
"SetParaBreak : m_Pcts.empty()" );
1405 m_Pcts.back()->SetStatus();
1411 OSL_ENSURE( !
m_Pcts.empty(),
"Fc2Cp no piece available" );
1415 return nFc +
m_Pcts.back()->GetStartCp();
1420 std::vector< const ::sw::mark::IMark* >
aArr;
1422 const sal_Int32 nCurrentEnd = nCurrentPos + nLen;
1428 for(const ::sw::mark::IMark*
p :
aArr)
1430 const ::sw::mark::IMark& rBkmk = *
p;
1431 if(
dynamic_cast< const ::sw::mark::IFieldmark *
>(&rBkmk))
1434 const SwPosition* pPos = &rBkmk.GetMarkPos();
1436 if(rBkmk.IsExpanded())
1437 pOPos = &rBkmk.GetOtherMarkPos();
1442 pOPos = &rBkmk.GetMarkPos();
1447 nContent < nCurrentEnd ) )
1454 nContent < nCurrentEnd )
1469 const sal_Int32 nStart = pMark->GetMarkStart().GetContentIndex();
1470 if (nStart == nCurrentPos)
1482 if (!aStatements.empty())
1491 m_pBkmks->MoveFieldMarks(nFrom, nTo);
1496 sal_uInt64 nSttCP =
Fc2Cp(
Strm().Tell() );
1502 sal_uInt64 nEndCP =
Fc2Cp(
Strm().Tell() );
1503 m_pBkmks->Append( nEndCP - 1, rName );
1509 std::unique_ptr<SvxBrushItem> aBrush = std::make_unique<SvxBrushItem>(
RES_BACKGROUND);
1512 if (SfxItemState::SET == eState)
1515 if (aBrush->GetColor() !=
COL_AUTO)
1527 for (
size_t n = 0;
n < nCountRule; ++
n)
1531 for (sal_uInt16 nLvl = 0; nLvl < nLevels; ++nLvl)
1567 const MapMode aMapMode(MapUnit::MapTwip);
1587 OUString aPicBullets(
"_PictureBullets");
1654 rWW8Wrt.
m_pFib->m_lcbSttbfRMark);
1668 sal_Int32& rfcSttbf, sal_Int32& rlcbSttbf)
1670 sal_uInt16
n,
nCount =
static_cast< sal_uInt16
>(rStrings.size());
1682 const OUString& rNm = rStrings[
n];
1710 ShortToSVBT16(
n, nL );
1711 rO.push_back(nL[0]);
1712 rO.push_back(nL[1]);
1718 UInt32ToSVBT32(
n, nL );
1719 rO.push_back(nL[0]);
1720 rO.push_back(nL[1]);
1721 rO.push_back(nL[2]);
1722 rO.push_back(nL[3]);
1728 for (sal_Int32
n = 0, nLen = rStr.getLength();
n < nLen; ++
n, ++pStr)
1733 rtl_TextEncoding eCodeSet)
1736 const char *pStart = sTmp.getStr();
1737 const char *pEnd = pStart + sTmp.getLength();
1739 rO.insert( rO.end(), pStart, pEnd );
1751 if (!aBytes.empty())
1766 bool bAddZero, rtl_TextEncoding eCodeSet)
1771 aBytes.push_back(0);
1774 if (!aBytes.empty())
1780 if( !rText.isEmpty() )
1790 aArr.push_back( 1 );
1835 sal_Int32
const nLen)
1838 SAL_INFO(
"sw.ww8.level2",
"<OutSwString>" );
1842 if( nStt || nLen != rStr.getLength() )
1844 OUString sOut( rStr.copy( nStt, nLen ) );
1858 SAL_INFO(
"sw.ww8.level2",
"</OutSwString>" );
1863 if (pTableTextNodeInfoInner && pTableTextNodeInfoInner->getDepth() == 1 && pTableTextNodeInfoInner->isEndOfCell())
1883 if ( nStt !=
m_pCurPam->GetMark()->GetNodeIndex() &&
1898 aData.pOOld =
nullptr;
1954 if ( !
m_pO->empty() )
1960 rData.
pOOld =
nullptr;
1972 OSL_ENSURE(
m_pO->empty(),
"pO is not empty in WW8Export::RestoreData()" );
1983 sal_uInt32 nDepth = pTableTextNodeInfoInner->getDepth();
1994 if ( nDepth > 1 && pTableTextNodeInfoInner->isEndOfCell() )
2003 sal_uInt32 nDepth = pTableTextNodeInfoInner->getDepth();
2009 if ( !pTableTextNodeInfoInner->isEndOfLine() )
2050 sal_uInt16 nFlags = 0;
2054 else if (nRowSpan < 0)
2057 if (pBox !=
nullptr)
2062 case text::VertOrientation::CENTER:
2065 case text::VertOrientation::BOTTOM:
2079 static_cast<const SwTextNode*
>(pCNd)->GetParaAttr(aCoreSet,
2083 if(pRotate && pRotate->GetValue() == 900_deg10)
2085 nFlags = nFlags | 0x0004 | 0x0008;
2087 else if(pRotate && pRotate->GetValue() == 2700_deg10 )
2089 nFlags = nFlags | 0x0004 | 0x0010;
2101 const SwTableBox * pTabBox = pTableTextNodeInfoInner->getTableBox();
2112 sal_uInt16 nTextFlow = 0;
2115 case SvxFrameDirection::Vertical_RL_TB:
2118 case SvxFrameDirection::Vertical_LR_BT:
2137 const SwTableBox * pTabBox = pTableTextNodeInfoInner->getTableBox();
2157 const SwTable * pTable = pTableTextNodeInfoInner->getTable();
2177 const SwTableBox * pTabBox = pTableTextNodeInfoInner->getTableBox();
2202 const SwTable * pTable = pTableTextNodeInfoInner->getTable();
2207 SAL_WARN(
"sw.ww8",
"FrameFormat is nil" );
2227 case text::HoriOrientation::CENTER:
2233 case text::HoriOrientation::RIGHT:
2242 case text::HoriOrientation::LEFT:
2249 case text::HoriOrientation::LEFT_AND_WIDTH:
2264 const SwTable * pTable = pTableTextNodeInfoInner->getTable();
2281 sal_uInt8 const nTPc = (nPadding << 4) | (nPcVert << 2) | nPcHorz;
2302 const SwTable * pTable = pTableTextNodeInfoInner->getTable();
2311 pTableTextNodeInfoInner->getTableBoxesOfRow();
2313 sal_uInt32 nBoxes = pTableBoxes->size();
2318 sal_uInt16 nSprmSize = 2 + (nBoxes + 1) * 2 + nBoxes * 20;
2335 SAL_WARN(
"sw.ww8",
"FrameFormat is nil" );
2355 case text::HoriOrientation::CENTER:
2356 case text::HoriOrientation::RIGHT:
2360 nTableOffset = rHori.
GetPos();
2362 nTableOffset += rLRSp.
GetLeft();
2367 SwTwips nLeftPageMargin, nRightPageMargin;
2370 nTableOffset = nPageSize - nLeftPageMargin - nRightPageMargin - nTableWidth - nTableOffset;
2379 for (
const auto nCol : *pGridCols )
2386 ww8::RowSpans::const_iterator aItRowSpans = pRowSpans->begin();
2388 for (
const SwTableBox * pTabBox1 : *pTableBoxes)
2393 if (pTabBox1 !=
nullptr)
2394 pBoxFormat = pTabBox1->GetFrameFormat();
2400 static sal_uInt8 aNullBytes[] = { 0x0, 0x0 };
2403 if (pBoxFormat !=
nullptr)
2419 if (!nWidthPercent && rHori.
GetHoriOrient() == text::HoriOrientation::FULL)
2420 nWidthPercent = 100;
2423 if ( nWidthPercent > 0 && nWidthPercent <= 600 )
2433 return pTableTextNodeInfoInner->getGridColsOfRow(*
this);
2439 return pTableTextNodeInfoInner->getGridColsOfRow(*
this,
true);
2446 const SwNode *pTextNd = pTableTextNodeInfoInner->
getNode( );
2452 SAL_WARN(
"sw.ww8",
"FrameFormat is nil" );
2460 nWidthPercent = 100;
2461 bool bRelBoxSize = nWidthPercent != 0;
2463 if (nTableSz > USHRT_MAX/2 && !bRelBoxSize)
2465 OSL_ENSURE(bRelBoxSize,
"huge table width but not relative, suspicious");
2481 nPageSize = aRect.
Width();
2482 if ( 0 == nPageSize )
2491 nPageSize = aRect.
Width();
2492 if ( bManualAligned )
2501 if ( nWidthPercent )
2503 nPageSize *= nWidthPercent;
2507 SAL_WARN(
"sw.ww8",
"nWidthPercent is zero" );
2512 nPageSize = nTableSz;
2515 rPageSize = nPageSize;
2516 rRelBoxSize = bRelBoxSize;
2524 const SwTableBox * pTabBox = pTableTextNodeInfoInner->getTableBox();
2529 SvxBoxItemLine::TOP, SvxBoxItemLine::LEFT,
2530 SvxBoxItemLine::BOTTOM, SvxBoxItemLine::RIGHT
2534 for (
int i = 0;
i < 4; ++
i )
2551 const SwTableBox * pTabBox = pTableTextNodeInfoInner->getTableBox();
2554 sal_uInt8 nBoxes = std::min<size_t>(rTabBoxes.size(), 255);
2560 SvxBoxItemLine::TOP, SvxBoxItemLine::LEFT,
2561 SvxBoxItemLine::BOTTOM, SvxBoxItemLine::RIGHT
2564 sal_uInt16 nDefaultMargin[4] = {31681, 31681, 31681, 31681};
2566 if ( nBoxes && rTabBoxes.size() == nBoxes )
2568 const SvxBoxItem& rBox = rTabBoxes[ nBoxes-1 ]->GetFrameFormat()->GetBox();
2569 for (
int i = 0;
i < 4; ++
i )
2575 for (
unsigned n = 0;
n <= nBoxes; ++
n )
2577 const SvxBoxItem * pBox = (
n == nBoxes) ?
nullptr :
2578 &rTabBoxes[
n]->GetFrameFormat()->GetBox();
2581 else if( !pBox || *pLastBox != *pBox )
2593 sal_uInt16 nMargin[4];
2595 for (
int i = 0;
i < 4; ++
i )
2598 if ( nMargin[
i] == nDefaultMargin[
i] )
2602 for (
int p = 0;
p < 4; ++
p )
2604 if ( nMargin[
i] == nMargin[
p] )
2606 nSideBits[
p] |= 1 <<
i;
2613 for (
int i = 0;
i < 4; ++
i )
2635 const SwTable * pTab = pTableTextNodeInfoInner->getTable();
2636 const SwTableBox * pTabBox = pTableTextNodeInfoInner->getTableBox();
2646 if ( pTableColorProp )
2647 aRowColor = pTableColorProp->
GetColor();
2651 aRowColor = pRowColorProp->
GetColor();
2657 Color aColor = aRowColor;
2661 aColor = pCellColorProp->
GetColor();
2680 for (sal_uInt32
m : aSprmIds)
2704 if ( nStart >= nStop )
2714 Color aColor = aRowColor;
2718 aColor = pCellColorProp->
GetColor();
2741class TrackContentToExport
2748 : m_pCurPam(pCurPam)
2749 , m_nStart(nCurStart)
2759 if (bSimpleContentRemains)
2773 if (pNextNode && pCurrentNode != pNextNode)
2775 return pNextNode->
GetIndex() >= m_nStart &&
2788 while (aContentTracking.contentRemainsToExport(
m_pTableInfo.get()))
2837 bool bNeedExportBreakHere =
true;
2839 bNeedExportBreakHere =
false;
2851 bNeedExportBreakHere =
false;
2865 if (nColumnCount > 1 && rNoBalanced.
GetValue())
2867 bNeedExportBreakHere =
false;
2872 bNeedExportBreakHere =
false;
2875 if (bNeedExportBreakHere)
2880 if ( !pParentFormat )
2886 GetLineNumber().GetStartValue();
2913 if (pCurrentNode == pNextNode)
2915 SAL_WARN(
"sw.ww8",
"loop in TableInfo");
2916 pNextNode =
nullptr;
2919 if (pNextNode !=
nullptr)
2920 m_pCurPam->GetPoint()->Assign(*pNextNode);
2928 SAL_INFO(
"sw.ww8.level2",
"</WriteText>" );
2933 SAL_INFO(
"sw.ww8.level2",
"<WriteMainText>" );
2956 SAL_INFO(
"sw.ww8.level2",
"</WriteMainText>" );
2961 bool bResult =
false;
2971 if (pTableNodeInfo && pTableNodeInfo->getDepth() > 0)
2996 m_pEdn->WritePlc( *
this );
2999 m_pAtn->WritePlc( *
this );
3001 m_pSepx->WritePlcSed( *
this );
3002 m_pSepx->WritePlcHdd( *
this );
3071 std::vector<OUString> aStrings(pSttbfAssoc->
getStrings());
3073 m_pFib->m_lcbSttbfAssoc);
3084 m_pFib->m_fReadOnlyRecommended =
3086 m_pFib->m_fWriteReservation =
3095 bool bNeedsFinalPara =
false;
3103 bNeedsFinalPara |=
m_pFootnote->WriteText( *
this );
3104 bNeedsFinalPara |=
m_pSepx->WriteKFText( *
this );
3105 bNeedsFinalPara |=
m_pAtn->WriteText( *
this );
3106 bNeedsFinalPara |=
m_pEdn->WriteText( *
this );
3111 bNeedsFinalPara |=
m_pTextBxs->WriteText( *
this );
3114 if (bNeedsFinalPara)
3117 m_pPapPlc->AppendFkpEntry(
Strm().Tell(), nSprmsLen, pLastSprms);
3119 delete[] pLastSprms;
3131 if( rURL.empty() || rURL[0] !=
'#' )
3140 OUString sCmp =
aURL.copy(
nPos+1).replaceAll(
" ",
"");
3141 if( sCmp.isEmpty() )
3144 sCmp = sCmp.toAsciiLowerCase();
3146 bool noBookmark =
false;
3148 if( sCmp ==
"outline" )
3161 else if( sCmp ==
"graphic" )
3172 else if( sCmp ==
"frame" )
3183 else if( sCmp ==
"ole" )
3194 else if( sCmp ==
"region" )
3200 if (
aName == pFormat->GetSection()->GetSectionName()
3201 &&
nullptr != (pIdx =
const_cast<SwNodeIndex*
>(pFormat->GetContent().GetContentIdx())))
3209 else if( sCmp ==
"table" )
3223 else if (sCmp ==
"toxmark")
3228 std::optional<std::pair<SwTOXMark, sal_Int32>>
const tmp(
3233 for (sal_Int32
i = 0;
i < tmp->second; ++
i)
3237 if (pMark != &tmp->first)
3247 aImplicitBookmark.first =
aURL;
3248 aImplicitBookmark.second = nIdx;
3277 auto pURL =
dynamic_cast<const SwFormatURL*
>(pItem);
3282 const ImageMap *pIMap = pURL->GetMap();
3302 sal_uInt64 nLen = rIn.
TellEnd();
3306 for (std::size_t nI = 0, nBlock = 0; nI < nLen; nI +=
WW_BLOCKSIZE, ++nBlock)
3313 rCtx.
Encode(in, nBS, in, nBS);
3346 sal_uInt32 nSvxMSDffOLEConvFlags = 0;
3410 uno::Sequence< beans::NamedValue > aEncryptionData;
3415 if ( pEncryptionDataItem && ( pEncryptionDataItem->
GetValue() >>= aEncryptionData ) && !rCodec.
InitCodec( aEncryptionData ) )
3417 OSL_ENSURE(
false,
"Unexpected EncryptionData!" );
3418 aEncryptionData.realloc( 0 );
3421 if ( !aEncryptionData.hasElements() )
3425 if ( pPasswordItem && !pPasswordItem->
GetValue().isEmpty() && pPasswordItem->
GetValue().getLength() <= 15 )
3430 rtl_random_getBytes( aRandomPool, pDocId, 16 );
3432 rtl_random_destroyPool( aRandomPool );
3434 sal_uInt16 aPassword[16] = {};
3436 const OUString& sPassword(pPasswordItem->
GetValue());
3437 for ( sal_Int32 nChar = 0; nChar < sPassword.getLength(); ++nChar )
3438 aPassword[nChar] = sPassword[nChar];
3440 rCodec.
InitKey( aPassword, pDocId );
3447 if ( aEncryptionData.hasElements() )
3452 return aEncryptionData.hasElements();
3463 xWwStrm->SetBufferSize( 32768 );
3465 m_pFib->m_fWhichTableStm =
true;
3469 xDataStrm->SetBufferSize( 32768 );
3470 xTableStrm->SetBufferSize( 16384 );
3472 xTableStrm->SetEndian( SvStreamEndian::LITTLE );
3473 xDataStrm->SetEndian( SvStreamEndian::LITTLE );
3490 aTempMain.
GetStream( StreamMode::READWRITE | StreamMode::SHARE_DENYWRITE ) );
3496 sal_uInt8 const aRC4EncryptionHeader[ 52 ] = {0};
3543 if (pStdTextFormatColl && (pItem = pStdTextFormatColl->
GetItemIfSet(
3554 SvStream *pStrmTemp, *pTableStrmTemp, *pDataStrmTemp;
3555 pStrmTemp = xWwStrm.
get();
3556 pTableStrmTemp = xTableStrm.get();
3557 pDataStrmTemp = xDataStrm.
get();
3559 if ( pDataStrmTemp && pDataStrmTemp != pStrmTemp) {
3573 pTableStrmTemp->
Seek( 0 );
3593 m_pFib->m_fEncrypted =
true;
3594 m_pFib->m_fObfuscated =
false;
3598 pStrmTemp->
Seek( 0 );
3599 m_pFib->WriteHeader( *pStrmTemp );
3632 xWwStrm->SetBufferSize( 0 );
3633 xTableStrm->SetBufferSize( 0 );
3634 xDataStrm->SetBufferSize( 0 );
3649 0x01, 0x00, 0xFE, 0xFF, 0x03, 0x0A, 0x00, 0x00,
3650 0xFF, 0xFF, 0xFF, 0xFF, 0x06, 0x09, 0x02, 0x00,
3651 0x00, 0x00, 0x00, 0x00, 0xC0, 0x00, 0x00, 0x00,
3652 0x00, 0x00, 0x00, 0x46,
3654 0x18, 0x00, 0x00, 0x00,
3655 'M',
'i',
'c',
'r',
'o',
's',
'o',
'f',
3656 't',
' ',
'W',
'o',
'r',
'd',
'-',
'D',
3657 'o',
'k',
'u',
'm',
'e',
'n',
't', 0x0,
3659 0x0A, 0x00, 0x00, 0x00,
3660 'M',
'S',
'W',
'o',
'r',
'd',
'D',
'o',
3663 0x10, 0x00, 0x00, 0x00,
3664 'W',
'o',
'r',
'd',
'.',
'D',
'o',
'c',
3665 'u',
'm',
'e',
'n',
't',
'.',
'8', 0x0,
3667 0xF4, 0x39, 0xB2, 0x71, 0x00, 0x00, 0x00, 0x00,
3668 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
3673 aGName, SotClipboardFormatId::NONE,
"Microsoft Word-Document");
3678 OSL_ENSURE(pDocShell,
"no SwDocShell");
3680 if (!pDocShell)
return;
3682 uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
3683 pDocShell->
GetModel(), uno::UNO_QUERY_THROW);
3684 uno::Reference<document::XDocumentProperties> xDocProps(
3685 xDPS->getDocumentProperties());
3686 OSL_ENSURE(xDocProps.is(),
"DocumentProperties is null");
3688 if (!xDocProps.is())
3693 std::shared_ptr<GDIMetaFile> xMetaFile =
3695 uno::Sequence<sal_Int8> metaFile(
3706 uno::Reference< packages::XPackageEncryption > xPackageEncryption;
3707 std::shared_ptr<SvStream> pSotStorageStream;
3708 uno::Sequence< beans::NamedValue > aEncryptionData;
3713 if (pEncryptionDataItem && (pEncryptionDataItem->
GetValue() >>= aEncryptionData))
3718 if (sCryptoType.getLength())
3723 xPackageEncryption.set(
3724 xComponentContext->getServiceManager()->createInstanceWithArgumentsAndContext(
3725 "com.sun.star.comp.oox.crypto." + sCryptoType,
aArguments, xComponentContext), uno::UNO_QUERY);
3727 if (xPackageEncryption)
3732 pSotStorageStream = std::make_shared<SvMemoryStream>();
3741 if (xPackageEncryption)
3743 assert(pSotStorageStream &&
m_pStg &&
"because always set if xPackageEncryption was set");
3746 pSotStorageStream->Seek(0);
3749 xPackageEncryption->setupEncryption(aEncryptionData);
3752 uno::Sequence<beans::NamedValue> aStreams = xPackageEncryption->encrypt(xInputStream);
3755 for (
const beans::NamedValue & aStreamData : std::as_const(aStreams))
3762 while (pStorage &&
idx >= 0)
3764 OUString sPathElem = aStreamData.Name.getToken(0, L
'/',
idx);
3765 if (!sPathElem.isEmpty())
3769 sFileName = sPathElem;
3773 pStorage = pStorage->OpenSotStorage(sPathElem);
3792 uno::Sequence<sal_Int8> aStreamContent;
3793 aStreamData.Value >>= aStreamContent;
3794 size_t nBytesWritten = pStream->WriteBytes(aStreamContent.getArray(), aStreamContent.getLength());
3795 if (nBytesWritten !=
static_cast<size_t>(aStreamContent.getLength()))
3809 if( pViewShell !=
nullptr )
3843 const OUString* pFileName )
3854 , m_pTopNodeOfHdFtPage(nullptr)
3856 , m_nCharFormatStart(0)
3857 , m_nFormatCollStart(0)
3858 , m_nStyleBeforeFly(0)
3859 , m_nLastFormatId(0)
3863 , m_bOrigShowChanges(true)
3864 , m_pCurrentPageDesc(nullptr)
3865 , m_pPreviousSectionPageDesc(nullptr)
3866 , m_bFirstTOCNodeWithSection(false)
3867 , m_pChpIter(nullptr)
3868 , m_pParentFrame(nullptr)
3869 , m_pFlyOffset(nullptr)
3871 , m_pStyAttr(nullptr)
3872 , m_pOutFormatNode(nullptr)
3873 , m_pCurrentStyle(nullptr)
3874 , m_pEscher(nullptr)
3877 , m_bBreakBefore(false)
3879 , m_bOutFlyFrameAttrs(false)
3880 , m_bOutPageDescs(false)
3881 , m_bOutFirstPage(false)
3882 , m_bOutTable(false)
3884 , m_bInWriteEscher(false)
3885 , m_bStartTOX(false)
3886 , m_bInWriteTOX(false)
3887 , m_bFootnoteAtTextEnd(false)
3888 , m_bEndAtTextEnd(false)
3891 , m_bSubstituteBullets(true)
3892 , m_bTabInTOC(false)
3893 , m_bHideTabLeaderAndPageNumbers(false)
3894 , m_bExportModeRTF(false)
3895 , m_bFontSizeWritten(false)
3896 , m_bAddFootnoteTab(false)
3898 , m_nCurStart(pCurrentPam->GetPoint()->GetNodeIndex())
3899 , m_nCurEnd(pCurrentPam->GetMark()->GetNodeIndex())
3900 , m_pCurPam(pCurrentPam)
3901 , m_pOrigPam(pOriginalPam)
3920 SwDoc& rDocument, std::shared_ptr<SwUnoCursor> & pCurrentPam,
SwPaM* pOriginalPam,
3923 , m_pTableStrm(nullptr)
3924 , m_pDataStrm(nullptr)
3926 , m_pWriter(pWriter)
3946 : m_pExport( nullptr ),
3964extern "C" SAL_DLLPUBLIC_EXPORT
void ExportDOC( std::u16string_view rFltName,
const OUString& rBaseURL,
WriterRef& xRet )
3981 rWrt.
m_pFib->m_ccpText );
3998 rWrt.
m_pFib->m_lcbPlcffndText, rWrt.
m_pFib->m_fcPlcffndRef,
3999 rWrt.
m_pFib->m_lcbPlcffndRef );
4004 rWrt.
m_pFib->m_lcbPlcfendText, rWrt.
m_pFib->m_fcPlcfendRef,
4005 rWrt.
m_pFib->m_lcbPlcfendRef );
4014 + rWrt.
m_pFib->m_ccpHdr );
4021 rWrt.
m_pFib->m_lcbPlcfandText, rWrt.
m_pFib->m_fcPlcfandRef,
4022 rWrt.
m_pFib->m_lcbPlcfandRef );
4030 rWrt.
m_pFib->m_lcbPlcftxbxBkd, rWrt.
m_pFib->m_fcPlcftxbxText,
4031 rWrt.
m_pFib->m_lcbPlcftxbxText );
4036 rWrt.
m_pFib->m_lcbPlcfHdrtxbxBkd, rWrt.
m_pFib->m_fcPlcfHdrtxbxText,
4037 rWrt.
m_pFib->m_lcbPlcfHdrtxbxText );
4048 uno::Reference < io::XStream > xSrcStream =
4049 xSrcRoot->openStreamElement(
SL::aMSMacroCmds, embed::ElementModes::READ );
4054 m_pFib->m_lcbCmds = pStream->TellEnd();
4057 std::unique_ptr<sal_uInt8[]> pBuffer(
new sal_uInt8[
m_pFib->m_lcbCmds] );
4063 catch (
const uno::Exception& )
4080 const ::sw::mark::IFieldmark* pFieldmark = &rFieldmark;
4087 SAL_WARN(
"sw.ww8",
"unknown field type" );
4097 OUString ffname = rFieldmark.GetName();
4098 if (ffname.getLength() > 20)
4099 ffname = ffname.copy(0, 20);
4107 0x03, 0x6a, 0,0,0,0,
4116 m_pChpPlc->AppendFkpEntry(
Strm().Tell(),
sizeof( aArr1 ), aArr1 );
4124 FFDataHeader() : version( 0xFFFFFFFF ), bits(0), cch(0), hps(0) {}
4127 FFDataHeader aFieldHeader;
4128 aFieldHeader.bits |= (
type & 0x03);
4130 sal_Int32 ffres = 0;
4131 if ( pAsCheckbox && pAsCheckbox->IsChecked() )
4133 else if (
type == 2 )
4135 ::sw::mark::IFieldmark::parameter_map_t::const_iterator pResParameter = rFieldmark.GetParameters()->find(
ODF_FORMDROPDOWN_RESULT);
4136 if(pResParameter != rFieldmark.GetParameters()->end())
4137 pResParameter->second >>= ffres;
4141 aFieldHeader.bits |= ( (ffres<<2) & 0x7C );
4145 OUString ffhelptext = rFieldmark.GetFieldHelptext();
4146 if ( ffhelptext.getLength() > 255 )
4147 ffhelptext = ffhelptext.copy(0, 255);
4148 OUString ffstattext;
4149 OUString ffentrymcr;
4152 ::sw::mark::IFieldmark::parameter_map_t::const_iterator pParameter
4153 = rFieldmark.GetParameters()->find(
"Type");
4156 sal_uInt16
nType = 0;
4157 if ( pParameter != rFieldmark.GetParameters()->end() )
4160 pParameter->second >>= aType;
4161 if ( aType ==
"number" )
nType = 1;
4162 else if ( aType ==
"date" )
nType = 2;
4163 else if ( aType ==
"currentTime" )
nType = 3;
4164 else if ( aType ==
"currentDate" )
nType = 4;
4165 else if ( aType ==
"calculated" )
nType = 5;
4166 aFieldHeader.bits |=
nType<<11;
4171 pParameter = rFieldmark.GetParameters()->find(
"Content");
4172 if ( pParameter != rFieldmark.GetParameters()->end() )
4174 OUString aDefaultText;
4175 pParameter->second >>= aDefaultText;
4176 const sal_Int32 nLen =
std::min( sal_Int32(255), aDefaultText.getLength() );
4177 ffdeftext = aDefaultText.copy (0, nLen);
4181 pParameter = rFieldmark.GetParameters()->find(
"MaxLength");
4182 if ( pParameter != rFieldmark.GetParameters()->end() )
4185 pParameter->second >>=
nLength;
4190 pParameter = rFieldmark.GetParameters()->find(
"Format");
4191 if ( pParameter != rFieldmark.GetParameters()->end() )
4194 pParameter->second >>= aFormat;
4195 const sal_Int32 nLen =
std::min( sal_Int32(64), aFormat.getLength() );
4196 ffformat = aFormat.copy(0, nLen);
4200 pParameter = rFieldmark.GetParameters()->find(
"Help");
4201 if ( ffhelptext.isEmpty() && pParameter != rFieldmark.GetParameters()->end() )
4204 pParameter->second >>= aHelpText;
4205 const sal_Int32 nLen =
std::min( sal_Int32(255), aHelpText.getLength() );
4206 ffhelptext = aHelpText.copy (0, nLen);
4208 if ( !ffhelptext.isEmpty() )
4209 aFieldHeader.bits |= 0x1<<7;
4211 pParameter = rFieldmark.GetParameters()->find(
"Description");
4212 if ( pParameter == rFieldmark.GetParameters()->end() )
4213 pParameter = rFieldmark.GetParameters()->find(
"Hint");
4214 if ( pParameter != rFieldmark.GetParameters()->end() )
4216 OUString aStatusText;
4217 pParameter->second >>= aStatusText;
4218 const sal_Int32 nLen =
std::min( sal_Int32(138), aStatusText.getLength() );
4219 ffstattext = aStatusText.copy (0, nLen);
4221 if ( !ffstattext.isEmpty() )
4222 aFieldHeader.bits |= 0x1<<8;
4224 pParameter = rFieldmark.GetParameters()->find(
"EntryMacro");
4225 if ( pParameter != rFieldmark.GetParameters()->end() )
4227 OUString aEntryMacro;
4228 pParameter->second >>= aEntryMacro;
4229 const sal_Int32 nLen =
std::min( sal_Int32(32), aEntryMacro.getLength() );
4230 ffentrymcr = aEntryMacro.copy (0, nLen);
4233 pParameter = rFieldmark.GetParameters()->find(
"ExitMacro");
4234 if ( pParameter != rFieldmark.GetParameters()->end() )
4236 OUString aExitMacro;
4237 pParameter->second >>= aExitMacro;
4238 const sal_Int32 nLen =
std::min( sal_Int32(32), aExitMacro.getLength() );
4239 ffexitmcr = aExitMacro.copy (0, nLen);
4242 std::vector< OUString > aListItems;
4245 aFieldHeader.bits |= 0x8000;
4246 const ::sw::mark::IFieldmark::parameter_map_t*
const pParameters = rFieldmark.GetParameters();
4248 if(pListEntries != pParameters->end())
4250 uno::Sequence< OUString > vListEntries;
4251 pListEntries->second >>= vListEntries;
4252 aListItems.reserve(vListEntries.getLength());
4253 copy(std::cbegin(vListEntries), std::cend(vListEntries), back_inserter(aListItems));
4260 0,0,0,0,0,0,0,0,0,0,
4261 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
4262 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
4263 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
4266 sal_uInt32 slen =
sizeof(sal_uInt32)
4267 +
sizeof(aFieldData)
4268 +
sizeof( aFieldHeader.version ) +
sizeof( aFieldHeader.bits ) +
sizeof( aFieldHeader.cch ) +
sizeof( aFieldHeader.hps )
4269 + 2*ffname.getLength() + 4
4270 + 2*ffformat.getLength() + 4
4271 + 2*ffhelptext.getLength() + 4
4272 + 2*ffstattext.getLength() + 4
4273 + 2*ffentrymcr.getLength() + 4
4274 + 2*ffexitmcr.getLength() + 4;
4278 slen += 2*ffdeftext.getLength() + 4;
4282 const int items = aListItems.size();
4283 for(
int i = 0;
i < items;
i++ ) {
4284 OUString item = aListItems[
i];
4285 slen += 2 * item.getLength() + 2;
4291 int len =
sizeof( aFieldData );
4292 OSL_ENSURE( len == 0x44-
sizeof(sal_uInt32),
"SwWW8Writer::WriteFormData(..) - wrong aFieldData length" );
4311 const int items=aListItems.size();
4313 for(
int i=0;
i<items;
i++) {
4314 OUString item=aListItems[
i];
4331 SAL_INFO(
"sw.ww8",
"<OutWW8_TableNodeInfoInner>" << pNodeInfoInner->toString());
4336 sal_uInt32 nShadowsBefore = pNodeInfoInner->getShadowsBefore();
4337 if (nShadowsBefore > 0)
4340 pTmpNodeInfoInner = std::make_shared<ww8::WW8TableNodeInfoInner>(
nullptr);
4342 pTmpNodeInfoInner->setDepth(pNodeInfoInner->getDepth());
4343 pTmpNodeInfoInner->setEndOfCell(
true);
4345 for (sal_uInt32
n = 0;
n < nShadowsBefore; ++
n)
4358 if (pNodeInfoInner->isEndOfCell())
4360 SAL_INFO(
"sw.ww8",
"<endOfCell/>" );
4371 sal_uInt32 nShadowsAfter = pNodeInfoInner->getShadowsAfter();
4372 if (nShadowsAfter > 0)
4375 pTmpNodeInfoInner= std::make_shared<ww8::WW8TableNodeInfoInner>(
nullptr);
4377 pTmpNodeInfoInner->setDepth(pNodeInfoInner->getDepth());
4378 pTmpNodeInfoInner->setEndOfCell(
true);
4380 for (sal_uInt32
n = 0;
n < nShadowsAfter; ++
n)
4392 if (pNodeInfoInner->isEndOfLine())
4394 SAL_INFO(
"sw.ww8",
"<endOfLine/>" );
4398 ShortToSVBT16(0, nStyle);
4405 SAL_INFO(
"sw.ww8",
"</OutWW8_TableNodeInfoInner>" );
4417 SAL_INFO(
"sw.ww8", pNodeInfo->toString());
4420 ww8::WW8TableNodeInfo::Inners_t::const_reverse_iterator aIt(aInners.rbegin());
4421 ww8::WW8TableNodeInfo::Inners_t::const_reverse_iterator aEnd(aInners.rend());
4430 SAL_INFO(
"sw.ww8",
"</OutWW8_SwStartNode>" );
4444 SAL_INFO(
"sw.ww8", pNodeInfo->toString());
4447 for (
const auto& rEntry : aInners)
4453 SAL_INFO(
"sw.ww8",
"</OutWW8_SwEndNode>" );
4460 m_pKeyMap = std::make_shared<NfKeywordTable>();
@ ShowDelete
show all deletes
@ ShowInsert
show all inserts
@ DO_NOT_JUSTIFY_LINES_WITH_MANUAL_BREAK
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()
std::unique_ptr< SvxMSExportOLEObjects > m_pOLEExp
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
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::sha