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