116#include <section.hxx>
121#include <com/sun/star/i18n/ScriptType.hpp>
122#include <com/sun/star/i18n/XBreakIterator.hpp>
146using ::editeng::SvxBorderLine;
155 if ( nScript == i18n::ScriptType::ASIAN )
178 else if ( nScript == i18n::ScriptType::COMPLEX )
213 for (
const auto& rItem : rItems )
216 sal_uInt16 nWhich = pItem->
Which();
239 for (
const auto& rCharItem : aCharItems)
242 sal_uInt16 nCharWhich = pCharItem->
Which();
260 if (bWriteCombChars &&
292 pInherited =
static_cast<SwTextFormatColl&
>( pNd->GetAnyFormatColl() ).GetAttrSet().GetItem(nWhich);
315 bool bExportParentItemSet )
317 if( !(bExportParentItemSet ||
rSet.
Count()) )
329 if (
nullptr != pItem )
344 if ( pRuleItem->
GetValue().isEmpty() &&
351 if ( pRuleItem->
GetValue().isEmpty() &&
368 for (
const auto& rItem : aItems )
371 sal_uInt16 nWhich = pItem->
Which();
380 if (!bAlreadyOutputBrushItem && pFill
381 && (pFill->GetValue() == drawing::FillStyle_SOLID || pFill->GetValue() == drawing::FillStyle_NONE)
384 const bool bFillStyleNone = pFill->GetValue() == drawing::FillStyle_NONE;
386 std::unique_ptr<SvxBrushItem> pInherited;
396 if (!bFillStyleNone || (pInherited && *pInherited != *aBrush))
423 SwNodeIndex aEnd( *pSttIdx->GetNode().EndOfSectionNode() );
428 [nStart, nEnd](
SwNodeOffset i) { return ( nStart <= i ) && ( i <= nEnd ); });
450 bool bNewPageDesc =
false;
494 bool bNewPageDesc =
false;
496 bool bExtraPageBreakBeforeSectionBreak =
false;
502 bool bBreakSet =
false;
525 if ( pSet && pSet->
Count() )
545 assert(aStart <= aDocEnd &&
"impossible: end section must have one content node");
560 bExtraPageBreakBeforeSectionBreak =
true;
566 bool bRemoveHardBreakInsideTable =
false;
580 bRemoveHardBreakInsideTable =
true;
587 if ( !bRemoveHardBreakInsideTable )
601 if ( pBreak->GetBreak() == SvxBreak::PageBefore )
608 if (!bNewPageDesc && pBreak->GetBreak() == SvxBreak::PageBefore
644 bool bHackInBreak =
false;
650 if ( rBreak.
GetBreak() == SvxBreak::PageBefore )
741 OSL_ENSURE( pNewPgDescFormat || pNewPgDesc,
"Neither page desc format nor page desc provided." );
743 if ( pNewPgDescFormat )
745 m_pSepx->AppendSep(
Fc2Cp( nFcPos ), *pNewPgDescFormat, rNd, pFormat, nLnNm );
747 else if ( pNewPgDesc )
749 m_pSepx->AppendSep(
Fc2Cp( nFcPos ), pNewPgDesc, rNd, pFormat, nLnNm );
761 for ( sal_uInt16 nCnt = 0; nCnt < aTStop.
Count(); ++nCnt )
804 case style::NumberingType::TEXT_NUMBER: nRet = 5;
break;
805 case style::NumberingType::TEXT_CARDINAL: nRet = 6;
break;
806 case style::NumberingType::TEXT_ORDINAL: nRet = 7;
break;
807 case style::NumberingType::AIU_HALFWIDTH_JA: nRet = 12;
break;
808 case style::NumberingType::IROHA_HALFWIDTH_JA: nRet = 13;
break;
809 case style::NumberingType::FULLWIDTH_ARABIC: nRet = 14;
break;
810 case style::NumberingType::NUMBER_TRADITIONAL_JA: nRet = 16;
break;
811 case style::NumberingType::CIRCLE_NUMBER: nRet = 18;
break;
812 case style::NumberingType::AIU_FULLWIDTH_JA: nRet = 20;
break;
813 case style::NumberingType::IROHA_FULLWIDTH_JA: nRet = 21;
break;
817 case style::NumberingType::HANGUL_SYLLABLE_KO: nRet = 24;
break;
818 case style::NumberingType::HANGUL_JAMO_KO: nRet = 25;
break;
819 case style::NumberingType::HANGUL_CIRCLED_SYLLABLE_KO: nRet = 24;
break;
820 case style::NumberingType::HANGUL_CIRCLED_JAMO_KO: nRet = 25;
break;
821 case style::NumberingType::TIAN_GAN_ZH: nRet = 30;
break;
822 case style::NumberingType::DI_ZI_ZH: nRet = 31;
break;
823 case style::NumberingType::NUMBER_UPPER_ZH_TW: nRet = 34;
break;
824 case style::NumberingType::NUMBER_UPPER_ZH: nRet = 38;
break;
825 case style::NumberingType::NUMBER_DIGITAL_KO: nRet = 41;
break;
826 case style::NumberingType::NUMBER_HANGUL_KO: nRet = 42;
break;
827 case style::NumberingType::NUMBER_LEGAL_KO: nRet = 43;
break;
828 case style::NumberingType::NUMBER_DIGITAL2_KO: nRet = 44;
break;
829 case style::NumberingType::NUMBER_HEBREW: nRet = 45;
break;
830 case style::NumberingType::CHARS_ARABIC: nRet = 46;
break;
831 case style::NumberingType::CHARS_HEBREW: nRet = 47;
break;
832 case style::NumberingType::CHARS_ARABIC_ABJAD: nRet = 48;
break;
833 case style::NumberingType::CHARS_PERSIAN:
834 case style::NumberingType::CHARS_NEPALI: nRet = 49;
break;
835 case style::NumberingType::CHARS_THAI: nRet = 53;
break;
836 case style::NumberingType::CHARS_CYRILLIC_LOWER_LETTER_N_RU:
837 case style::NumberingType::CHARS_CYRILLIC_LOWER_LETTER_RU: nRet = 58;
break;
838 case style::NumberingType::CHARS_CYRILLIC_UPPER_LETTER_N_RU:
839 case style::NumberingType::CHARS_CYRILLIC_UPPER_LETTER_RU: nRet = 59;
break;
872 if (
static_cast<const SwTextFormatColl*
>(pParent)->IsAssignedToListLevelOfOutlineStyle())
889 bool bCallOutSet =
true;
893 switch( rFormat.
Which() )
901 if (
static_cast<const SwTextFormatColl&
>(rFormat).IsAssignedToListLevelOfOutlineStyle())
902 nLvl =
static_cast<const SwTextFormatColl&
>(rFormat).GetAssignedOutlineStyleLevel();
924 aSet.
Put(leftMargin);
943 aSet.
Put(rFirstLine);
944 aSet.
Put(rLeftMargin);
979 if (SfxItemState::SET != aSet.GetItemState(
RES_SURROUND))
985 switch (pXFillStyleItem->GetValue())
987 case drawing::FillStyle_NONE:
989 case drawing::FillStyle_SOLID:
1006 bCallOutSet =
false;
1013 OSL_ENSURE(
false,
"Which format is exported here?" );
1026 std::vector<SwGetRefField*> vpRFields;
1028 return std::any_of(vpRFields.begin(), vpRFields.end(),
1029 [rName](
SwGetRefField* pF) { return rName == pF->GetSetRefName(); });
1035 std::vector<SwGetRefField*> vpRFields;
1037 return std::any_of(vpRFields.begin(), vpRFields.end(),
1038 [nSeqNo](
SwGetRefField* pF) { return nSeqNo == pF->GetSeqNo(); });
1049 sRet =
"Ref_" + *
pName;
1055 sRet =
"Ref_" + *
pName;
1065 sRet =
"_RefF" + OUString::number( nSeqNo );
1068 sRet =
"_RefE" + OUString::number( nSeqNo );
1087 if (nScript == i18n::ScriptType::COMPLEX && !bIsRTL)
1101 if ( pTextNodeInfoInner )
1103 if ( pTextNodeInfoInner->isEndOfLine() )
1108 ShortToSVBT16( 0, nSty );
1133 const OUString &rComment = pRedlineData->
GetComment();
1137 rComment !=
SwResId(STR_REDLINE_COMMENT_DELETED) &&
1138 rComment !=
SwResId(STR_REDLINE_COMMENT_ADDED))
1150 for(
auto aIter = aRange.first; aIter != aRange.second; ++aIter)
1165 for(
auto aIter = aRange.first; aIter != aRange.second; ++aIter)
1179 sal_uInt16 nNewFieldResults = pCurrentFields ? pCurrentFields->
ResultCount() : 0;
1187 if ( !bExportedFieldResult )
1220 ShortToSVBT16( nStyle, nSty );
1233 OSL_ENSURE(
nId <= 1,
"out of range" );
1342 case SvxCaseMap::SmallCaps:
1345 case SvxCaseMap::Uppercase:
1348 case SvxCaseMap::Capitalize:
1387 bWord = pWordline->GetValue();
1389 SAL_WARN(
"sw.ww8",
"m_rWW8Export has an RES_CHRATR_WORDLINEMODE item, but it's of the wrong type.");
1470 switch ( rLanguage.Which() )
1514 else if (
DFLT_ESC_PROP == nProp || nProp < 1 || nProp > 100 )
1526 nEsc = .8 * (100 - nProp);
1533 nEsc = .2 * -(100 - nProp);
1543 if ( 0 != b && 0xFF != b )
1551 if( 100 != nProp || !b )
1561 switch ( rHeight.Which() )
1589 switch ( rRelief.GetValue() )
1593 default:
nId = 0;
break;
1646 static const sal_uInt8 aZeroArr[ 3 ] = { 0, 0, 0 };
1654 if (
v == FontEmphasisMark::NONE)
1656 else if (
v == (FontEmphasisMark::Accent | FontEmphasisMark::PosAbove))
1658 else if (
v == (FontEmphasisMark::Circle | FontEmphasisMark::PosAbove))
1660 else if (
v == (FontEmphasisMark::Dot | FontEmphasisMark::PosBelow))
1730namespace sw {
namespace util {
1741 OSL_ENSURE(
false,
"WW8AttributeOutput::TextINetFormat(..) - missing unvisited character format at hyperlink attribute" );
1768 OUString
const * pLinkStr,
1769 bool bIncludeEmptyPicLocation =
false )
1777 rWrt.
m_pChpPlc->AppendFkpEntry(rWrt.
Strm().
Tell(), aItems.size(), aItems.data());
1782 if ( bIncludeEmptyPicLocation &&
1783 ( c == 0x13 || c == 0x14 || c == 0x15 ) )
1790 if ( c == 0x01 && pLinkStr)
1795 const sal_uInt32 nLinkPosInDataStrm =
rStrm.
Tell();
1797 const sal_uInt16 nEmptyHdrLen = 0x44;
1798 sal_uInt8 aEmptyHeader[ nEmptyHdrLen ] = { 0 };
1799 aEmptyHeader[ 4 ] = 0x44;
1802 const sal_uInt16 nFixHdrLen = 0x19;
1803 sal_uInt8 const aFixHeader[ nFixHdrLen ] =
1805 0x08, 0xD0, 0xC9, 0xEA, 0x79, 0xF9, 0xBA, 0xCE,
1806 0x11, 0x8C, 0x82, 0x00, 0xAA, 0x00, 0x4B, 0xA9,
1807 0x0B, 0x02, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00,
1812 sal_uInt32 nStrLen( pLinkStr->getLength() + 1 );
1818 const sal_uInt32 nCurrPos =
rStrm.
Tell();
1838 aItems.push_back( 1 );
1840 rWrt.
m_pChpPlc->AppendFkpEntry(rWrt.
Strm().
Tell(), aItems.size(), aItems.data());
1846 return rField.
ExpandField(
true,
nullptr).replace(0x0A, 0x0B);
1876 OSL_ENSURE(
false,
"what type of SubDoc is that?" );
1882 const OUString& rFieldCmd,
FieldFlags nMode )
1884 OUString sFieldCmd(rFieldCmd);
1903 assert(eFieldType <= 0x5F);
1907 const bool bIncludeEmptyPicLocation = ( eFieldType ==
ww::ePAGE );
1913 aField13[0] |= 0x80;
1914 aField13[1] =
static_cast< sal_uInt8 >(eFieldType);
1923 bool bHandleBookmark =
false;
1930 bHandleBookmark =
true;
1933 if ( bHandleBookmark )
1937 const sal_uInt16 nSubType = pField->
GetSubType();
1960 static const sal_uInt8 aField14[2] = { 0x14, 0xff };
1972 if( !sOut.isEmpty() )
2011 aField15[0] |= (0x4 << 5);
2018 aField15[1] |= 0x10;
2034 const OUString sStr{ OUString::Concat(
" [") + rName +
"] " };
2041 std::vector<const SwTOXType*>::iterator it
2062 SwFormTokens::iterator aIt = aPattern.begin();
2066 if (! aPattern.empty())
2068 bool bPgNumFnd =
false;
2071 while( ++aIt != aPattern.end() && !bPgNumFnd )
2073 eTType = aIt->eTokenType;
2087 sal_Int32
nCount = std::min<sal_Int32>(5, aIt->sText.getLength());
2088 rText = aIt->sText.copy(0,
nCount);
2111 for (sal_uInt16 nI = 1; nI <= nTOXLvl; ++nI)
2116 if ( !aPattern.empty() )
2118 SwFormTokens::iterator aIt = aPattern.begin();
2123 while ( ++aIt != aPattern.end() )
2125 eTType = aIt->eTokenType;
2143 if(
GetExport().GetExportFormat() == MSWordExportBase::ExportFormat::RTF)
2150 for(
size_t i = 0;
i < pTextAttrs->
Count(); ++
i )
2160 const sal_uInt16 nSeqFieldNumber =
static_cast<const SwSetExpField*
>(pField)->GetSeqNumber();
2163 bool bHaveFullBkm =
false;
2164 bool bHaveLabelAndNumberBkm =
false;
2165 bool bHaveCaptionOnlyBkm =
false;
2166 bool bHaveNumberOnlyBkm =
false;
2167 bool bRunSplittedAtSep =
false;
2168 for(
auto const & pFieldType : *pFieldTypes )
2181 const OUString& aText = rNode.
GetText();
2182 const sal_Int32 nCategoryStart = aText.indexOf(pRefField->
GetSetRefName());
2183 const sal_Int32 nPosBeforeSeparator = std::max(nCategoryStart, pHt->
GetStart());
2184 bool bCategoryFirst = nCategoryStart < pHt->
GetStart();
2185 sal_Int32 nSeparatorPos = 0;
2188 nSeparatorPos = aLocalAttrIter.
WhereNext();
2189 while (nSeparatorPos <= nPosBeforeSeparator)
2192 nSeparatorPos = aLocalAttrIter.
WhereNext();
2197 nSeparatorPos = nCategoryStart + pRefField->
GetSetRefName().getLength();
2199 sal_Int32 nRefTextPos = 0;
2200 if(nSeparatorPos < aText.getLength())
2203 if(nRefTextPos != nSeparatorPos)
2205 if(!bRunSplittedAtSep)
2210 bRunSplittedAtSep =
true;
2213 aLocalAttrIter.
SplitRun(nSeparatorPos);
2214 aLocalAttrIter.
SplitRun(nRefTextPos);
2216 else if (bCategoryFirst)
2218 if(!bRunSplittedAtSep)
2221 bRunSplittedAtSep =
true;
2223 aLocalAttrIter.
SplitRun(nSeparatorPos);
2236 sal_Int32 nLastAttrStart = 0;
2237 sal_Int32 nActAttr = aLocalAttrIter.
WhereNext();
2238 while (nActAttr < rNode.
GetText().getLength())
2240 nLastAttrStart = nActAttr;
2245 bHaveFullBkm =
true;
2250 if(!bHaveLabelAndNumberBkm)
2252 sName +=
"_label_and_number";
2259 sal_Int32 nCatLastRun = 0;
2260 sal_Int32 nNextAttr = aLocalAttrIter2.
WhereNext();
2261 while (nNextAttr < nSeparatorPos)
2263 nCatLastRun = nNextAttr;
2265 nNextAttr = aLocalAttrIter2.
WhereNext();
2269 bHaveLabelAndNumberBkm =
true;
2275 if(!bHaveCaptionOnlyBkm)
2278 sal_Int32 nLastAttrStart = 0;
2279 sal_Int32 nActAttr = aLocalAttrIter.
WhereNext();
2280 while (nActAttr < rNode.
GetText().getLength())
2282 nLastAttrStart = nActAttr;
2287 bHaveCaptionOnlyBkm =
true;
2293 if(!bHaveNumberOnlyBkm)
2296 bHaveNumberOnlyBkm =
true;
2330 static const char sEntryEnd[] =
"\" ";
2333 OUString sStr = pTOX ->GetMSTOCExpression();
2334 if ( sStr.isEmpty() )
2336 OUString sUserTypeName;
2337 auto aType = pTOX->GetType();
2341 sUserTypeName = pTOX->GetTOXType()->GetTypeName();
2342 if ( !sUserTypeName.isEmpty() )
2354 sal_Int32 nCol = rColumns.size();
2359 if(
GetExport().AddSectionBreaksForTOX() )
2363 pParent ? pParent->
GetFormat() :
nullptr, 0);
2367 sStr +=
"\\c \"" + OUString::number( nCol ) +
"\"";
2371 if (pTOX->GetTOXForm().IsCommaSeparated())
2375 sStr +=
"\\h \"A\" ";
2377 if (!sUserTypeName.isEmpty())
2379 sStr +=
"\\f \"" + sUserTypeName +
"\"";
2382 if (!pTOX->GetTOXForm().IsCommaSeparated())
2393 else if ((4 == nRet) || (2 == nRet))
2398 sStr +=
"\\e \"" + aFillText + sEntryEnd;
2405 if (!pTOX->IsFromObjectNames())
2408 const OUString& seqName = pTOX->GetSequenceName();
2409 if(!seqName.isEmpty())
2411 sStr +=
"\"" + seqName + sEntryEnd;
2417 else if( 3 == nRet || 4 == nRet )
2419 sStr +=
"\\p \"" + aText + sEntryEnd;
2428 OUString
const& rStyle(pTOX->GetStyleNames(0));
2433 OUString
const converted(
GetExport().m_pStyles->GetStyleWWName(pColl));
2434 if (!converted.isEmpty())
2436 sStr +=
"\\t \"" + converted + sEntryEnd;
2456 sal_uInt16
n, nTOXLvl = pTOX->GetLevel();
2481 + OUStringChar(
static_cast<char>(
'A' +
GetExport( ).
GetId( *pTOX->GetTOXType() ) ))
2487 sStr +=
"\\b \"" + pTOX->GetBookmarkName() + sEntryEnd;
2514 for(
n = rColls.
size();
n; )
2531 sal_uInt8 nMaxMSAutoEvaluate = nPosOfLowestNonStandardLvl < nTOXLvl ? nPosOfLowestNonStandardLvl : static_cast<sal_uInt8>(nTOXLvl);
2534 if ( nMaxMSAutoEvaluate )
2539 sStr +=
"\\o \"1-" + OUString::number(nMaxMSAutoEvaluate) + sEntryEnd;
2545 if( nMaxMSAutoEvaluate < nTOXLvl )
2548 for(
n = rColls.
size();
n;)
2554 if (nTestLvl < nTOXLvl && nTestLvl >= nMaxMSAutoEvaluate)
2556 if (!sTOption.isEmpty())
2558 sTOption += pColl->
GetName() + tsep + OUString::number(nTestLvl + 1);
2574 const OUString& rStyles = pTOX->GetStyleNames(
n );
2575 if( !rStyles.isEmpty() )
2578 const OUString sLvl{tsep + OUString::number(
n + 1)};
2581 if( !sStyle.isEmpty() )
2586 OUString
const converted(
GetExport().m_pStyles->GetStyleWWName(pColl));
2587 if (!converted.isEmpty() &&
2591 if( !sTOption.isEmpty() )
2593 sTOption += converted + sLvl;
2597 }
while( -1 !=
nPos );
2606 bool bFirstFillText =
true, bOnlyText =
true;
2607 for(
n = 0;
n < nTOXLvl; ++
n )
2624 bOnlyText = bOnlyText && 3 == nRet;
2625 if( 3 == nRet || 4 == nRet )
2627 if( bFirstFillText )
2629 else if( aFillText != aText )
2631 bFirstFillText =
false;
2640 + OUString::number( nNoPgStt )
2642 + OUString::number( nNoPgEnd )
2647 sStr +=
"\\p \"" + aFillText + sEntryEnd;
2651 if( !sTOption.isEmpty() )
2653 sStr +=
"\\t \"" + sTOption + sEntryEnd;
2663 if (!sStr.isEmpty())
2666 if (
GetExport().GetExportFormat() == MSWordExportBase::ExportFormat::RTF)
2672 if (
GetExport().GetExportFormat() == MSWordExportBase::ExportFormat::RTF)
2674 EndRun(
nullptr, -42, -1,
true);
2694 sal_Int32 nCol = rColumns.size();
2712 bool bHasFormat =
false;
2714 sal_uInt32 nFormatIdx = rField.
GetFormat();
2730 if (!sFormat.isEmpty())
2734 rStr =
"\\@\"" + sFormat +
"\" " ;
2747 rStr +=
"\\* ALPHABETIC ";
2751 rStr +=
"\\* alphabetic ";
2754 rStr +=
"\\* ROMAN ";
2757 rStr +=
"\\* roman ";
2760 rStr +=
"\\* Ordinal ";
2763 rStr +=
"\\* Ordtext ";
2766 rStr +=
"\\* Cardtext ";
2770 "Unknown numbering type exported as default of Arabic");
2773 rStr +=
"\\* ARABIC ";
2802 return " " + OUString::createFromAscii(pField) +
" ";
2809 const OUString sExpand(rField.
GetPar2().replace(0x0A, 0x0B));
2823 const OUString &rVar = pSet->
GetPar2();
2840 if (!rVar.isEmpty())
2857 uno::Sequence<OUString> aItems =
2877 if ( !sVar.isEmpty() )
2893OUString EscapeToken(
const OUString& rCommand)
2895 bool bWasEscaped =
false;
2897 const int nBufferLen = rCommand.getLength()*1.5;
2898 OUStringBuffer sResult(nBufferLen);
2899 sResult.append(
'"');
2900 for (sal_Int32 i = 0;
i < rCommand.getLength(); ++
i)
2909 sResult.append(
'\\');
2921 sResult.append(
'"');
2922 return sResult.makeStringAndClear();
2932 bool bWriteExpand =
false;
2933 const sal_uInt16 nSubType = pField->
GetSubType();
2944 bWriteExpand =
true;
2959 bool bShowAsWell =
false;
2962 const OUString sVar = pSet->
GetPar2();
2981 SetField( *pField, eFieldNo, sStr );
2987 bWriteExpand =
true;
3033 bWriteExpand =
true;
3038 switch (0xff & nSubType)
3061 else if (
GetExport().GetNumberFormat(*pField, sStr) || sStr.isEmpty())
3065 bWriteExpand =
false;
3074 else if (
GetExport().GetNumberFormat(*pField, sStr) || sStr.isEmpty())
3080 (
GetExport().GetNumberFormat(*pField, sStr) || sStr.isEmpty()))
3089 if (pDocInfoField !=
nullptr)
3090 sStr =
"\"" + pDocInfoField->
GetName() +
"\"";
3092 bWriteExpand =
false;
3104 bWriteExpand =
true;
3110 if (!
GetExport().GetNumberFormat(*pField, sStr))
3111 bWriteExpand =
true;
3143 bWriteExpand =
true;
3149 switch (0xFF & nSubType)
3171 bWriteExpand =
true;
3250 if(
GetExport().GetExportFormat() == MSWordExportBase::ExportFormat::RTF)
3275 sName +=
"_label_and_number";
3278 sName +=
"_caption_only";
3281 sName +=
"_number_only";
3329 sStr +=
" \\p \\h ";
3332 sStr +=
" \\n \\h ";
3341 bWriteExpand =
true;
3365 nHeight = (nHeight + 10) / 20;
3372 const sal_Int32 nAbove = (pField->
GetPar1().getLength()+1)/2;
3375 + OUString::number(nHeight/2)
3377 + pField->
GetPar1().subView(0, nAbove)
3379 + OUString::number(nHeight/5)
3381 + pField->
GetPar1().subView(nAbove)
3390 bWriteExpand =
true;
3405 + OUString::number(aCopy.
GetLevel() + 1)
3406 +
" \\* MERGEFORMAT ";
3408 bWriteExpand =
false;
3414 OUString sExpand(pField->
GetPar2());
3415 if (!sExpand.isEmpty())
3420 OUString aCond = pField->
GetPar1();
3421 OUString aTrueFalse = pField->
GetPar2();
3422 sal_Int32
nPos = aTrueFalse.indexOf(
'|');
3431 aTrue = aTrueFalse.subView(0,
nPos);
3432 aFalse = aTrueFalse.subView(
nPos + 1);
3434 if (aTrue.getLength() > 1 && aTrue.startsWith(
"\"") && aTrue.endsWith(
"\""))
3435 aTrue = aTrue.copy(1, aTrue.getLength() - 2);
3436 if (aFalse.getLength() > 1 && aFalse.startsWith(
"\"") && aFalse.endsWith(
"\""))
3437 aFalse = aFalse.copy(1, aFalse.getLength() - 2);
3441 + aTrue.replaceAll(
"\"",
"'") +
"\" \"" + aFalse.replaceAll(
"\"",
"'")
3455 const OUString sStr =
" MACROBUTTON "
3456 + pField->
GetPar1().replaceFirst(
"StarOffice.Standard.Modul1.",
"")
3477 bWriteExpand =
true;
3490 Point aLayPos = pTextNd->FindLayoutRect(
false, &origin ).Pos();
3568 OSL_FAIL(
"Unknown vert alignment" );
3581 const bool bAutoNum = rFootnote.
GetNumStr().isEmpty();
3586 0x03, 0x6a, 0, 0, 0, 0,
3590 aAttrArr.insert(aAttrArr.end(), aSpec, aSpec+
sizeof(aSpec));
3619 pOutArr->insert( pOutArr->begin(), aAttrArr.begin(), aAttrArr.end() );
3623 std::unique_ptr<ww::bytes> pOwnOutArr(
new ww::bytes);
3627 pOwnOutArr->insert(pOwnOutArr->begin(), aAttrArr.begin(), aAttrArr.end());
3633 std::unique_ptr<ww::bytes> pOld = std::move(
m_pO);
3634 m_pO = std::move(pOwnOutArr);
3649 pOwnOutArr = std::move(
m_pO);
3650 m_pO = std::move(pOld);
3652 m_pChpPlc->AppendFkpEntry(
Strm().Tell(), pOwnOutArr->size(),
3653 pOwnOutArr->data() );
3705 if ( !sBkmkNm.isEmpty() )
3762 if (!cStart && !cEnd)
3764 else if ((cStart ==
'{') || (cEnd ==
'}'))
3766 else if ((cStart ==
'<') || (cEnd ==
'>'))
3768 else if ((cStart ==
'[') || (cEnd ==
']'))
3773 static const sal_uInt8 aZeroArr[ 3 ] = { 0, 0, 0 };
3779 sal_uInt16 nOutLvl = rItem.
GetValue();
3787 if ((pInherited && pInherited->
GetValue() == nOutLvl)
3788 || (!pInherited && !nOutLvl))
3820 OUString
const listId(pTextNd->
GetListId());
3821 if (!listId.isEmpty()
3826 SwList const*
const pList(
3833 assert(pAbstractRule);
3834 if (pAbstractRule == pRule && !bListRestart)
3842 *pRule, listId, *pAbstractRule) + 1;
3855 else if (bListRestart)
3859 if (USHRT_MAX != nNumId)
3873 if (pC->IsAssignedToListLevelOfOutlineStyle())
3874 nLvl =
static_cast< sal_uInt8 >( pC->GetAssignedOutlineStyleLevel() );
3893 sal_Int32
const nLvl, sal_Int32
const nNumId)
3895 if (USHRT_MAX == nNumId)
3932 default: nH = o3tl::narrowing<sal_uInt16>(rSize.
GetHeight()) | 0x8000;
break;
3969 OSL_ENSURE( nChar,
"replaced with 0 crashes WW97/95" );
3971 bool bReplaced =
false;
3977 sal_uInt16 nUCode=0;
3984 if ((nChar == 0x0c) &&
3997 if( nUCode == 0x0d )
4006 else if ((nUCode == 0x0c) && (nChar == 0x0e))
4032 else if ( nDepth > 1 )
4070 case SvxBreak::NONE:
4071 case SvxBreak::PageBefore:
4072 case SvxBreak::PageBoth:
4082 bool bBefore =
false;
4084 bool bCheckForFollowPageDesc =
false;
4088 case SvxBreak::NONE:
4093 case SvxBreak::ColumnBefore:
4096 case SvxBreak::ColumnAfter:
4097 case SvxBreak::ColumnBoth:
4105 case SvxBreak::PageBefore:
4110 if (
GetExport().PreferPageBreakBefore())
4121 case SvxBreak::PageAfter:
4122 case SvxBreak::PageBoth:
4129 bCheckForFollowPageDesc =
true;
4137 if ( ( bBefore ==
GetExport().m_bBreakBefore ) && nC )
4140 bool bFollowPageDescWritten =
false;
4141 if ( bCheckForFollowPageDesc )
4143 bFollowPageDescWritten =
4147 if ( !bFollowPageDescWritten )
4165 sal_uInt32 nPageCharSize = 0;
4167 if (pSwFormat !=
nullptr)
4174 sal_Int32 nCharWidth = nPitch - nPageCharSize;
4175 sal_Int32 nFraction = nCharWidth % 20;
4176 if ( nCharWidth < 0 )
4177 nFraction = 20 + nFraction;
4178 nFraction = ( nFraction * 0xFFF ) / 20;
4179 nFraction = ( nFraction & 0x00000FFF );
4181 sal_Int32 nMain = nCharWidth / 20;
4182 if ( nCharWidth < 0 )
4184 nMain = nMain * 0x1000;
4185 nMain = ( nMain & 0xFFFFF000 );
4187 return sal_uInt32( nFraction + nMain );
4195 sal_uInt16 nGridType = 0;
4199 OSL_FAIL(
"Unknown grid type");
4231 switch ( rPaperBin.GetValue() )
4233 case 0: nVal = 15;
break;
4234 case 1: nVal = 1;
break;
4235 case 2: nVal = 4;
break;
4236 default: nVal = 0;
break;
4433 ( css::text::WrapTextMode_NONE != rSurround.
GetSurround() ) ? 2 : 1 );
4448 nPos =
static_cast<short>(rFlyVert.
GetPos());
4450 case text::VertOrientation::CENTER:
4451 case text::VertOrientation::LINE_CENTER:
4454 case text::VertOrientation::BOTTOM:
4455 case text::VertOrientation::LINE_BOTTOM:
4458 case text::VertOrientation::TOP:
4459 case text::VertOrientation::LINE_TOP:
4486 nPos =
static_cast<short>(rFlyHori.
GetPos());
4490 case text::HoriOrientation::LEFT:
4493 case text::HoriOrientation::RIGHT:
4496 case text::HoriOrientation::CENTER:
4497 case text::HoriOrientation::FULL:
4518 case RndStdIds::FLY_AT_PAGE:
4520 nP |= (1 << 4) | (2 << 6);
4523 case RndStdIds::FLY_AT_FLY:
4524 case RndStdIds::FLY_AT_CHAR:
4525 case RndStdIds::FLY_AT_PARA:
4526 case RndStdIds::FLY_AS_CHAR:
4528 nP |= (2 << 4) | (0 << 6);
4565 if ( rFillStyle.GetValue() != drawing::FillStyle_NONE )
4585 sal_uInt16 nDist,
bool bShadow)
4587 sal_uInt32 nColBGR = 0;
4588 sal_uInt16 nWidth = ::editeng::ConvertBorderWidthToWord(
4589 rLine.GetBorderLineStyle(), rLine.GetWidth());
4598 switch (rLine.GetBorderLineStyle())
4600 case SvxBorderLineStyle::SOLID:
4608 case SvxBorderLineStyle::DOTTED:
4611 case SvxBorderLineStyle::DASHED:
4614 case SvxBorderLineStyle::DOUBLE:
4615 case SvxBorderLineStyle::DOUBLE_THIN:
4618 case SvxBorderLineStyle::THINTHICK_SMALLGAP:
4621 case SvxBorderLineStyle::THINTHICK_MEDIUMGAP:
4624 case SvxBorderLineStyle::THINTHICK_LARGEGAP:
4627 case SvxBorderLineStyle::THICKTHIN_SMALLGAP:
4630 case SvxBorderLineStyle::THICKTHIN_MEDIUMGAP:
4633 case SvxBorderLineStyle::THICKTHIN_LARGEGAP:
4636 case SvxBorderLineStyle::EMBOSSED:
4639 case SvxBorderLineStyle::ENGRAVED:
4642 case SvxBorderLineStyle::OUTSET:
4645 case SvxBorderLineStyle::INSET:
4648 case SvxBorderLineStyle::FINE_DASHED:
4651 case SvxBorderLineStyle::DASH_DOT:
4654 case SvxBorderLineStyle::DASH_DOT_DOT:
4662 nWidth = (( nWidth * 8 ) + 10 ) / 20;
4674 sal_uInt16 nLDist = rtl::math::round(nDist / 20.0);
4689 sal_uInt16 nDist, sal_uInt16 nSprmNo, sal_uInt16 nSprmNoVer9,
bool bShadow)
4691 OSL_ENSURE( ( nSprmNo == 0 ) ||
4692 ( nSprmNo >= 38 && nSprmNo <= 41 ) ||
4697 "Sprm for border out is of range" );
4702 if( pLine && pLine->GetBorderLineStyle() != SvxBorderLineStyle::NONE )
4714 rO.insert( rO.end(), aBrcVer8.
aBits1, aBrcVer8.
aBits2+2 );
4716 if ( nSprmNoVer9 != 0 )
4720 rO.insert( rO.end(), aBrcVer9.
aBits1, aBrcVer9.
aBits2+4);
4734 SvxBoxItemLine::TOP, SvxBoxItemLine::LEFT, SvxBoxItemLine::BOTTOM, SvxBoxItemLine::RIGHT
4736 static const sal_uInt16 aPBrc[] =
4745 static const sal_uInt16 aSBrc[] =
4756 for( sal_uInt16
i = 0;
i < 4; ++
i, ++pBrd )
4758 const SvxBorderLine* pLn = rBox.
GetLine( *pBrd );
4760 sal_uInt16 nSprmNo, nSprmNoVer9 = 0;
4764 nSprmNoVer9 = aSBrc[
i+4];
4769 nSprmNoVer9 = aPBrc[
i+4];
4773 nSprmNoVer9, bShadow );
4790 SvxBoxItemLine::TOP, SvxBoxItemLine::LEFT, SvxBoxItemLine::BOTTOM, SvxBoxItemLine::RIGHT
4792 static const SvxBorderLine aBorderLine;
4796 const SvxBorderLine* pLn;
4797 if (pBox !=
nullptr)
4798 pLn = pBox->
GetLine( rBorder );
4800 pLn = & aBorderLine;
4814 SvxBoxItemLine::TOP, SvxBoxItemLine::LEFT, SvxBoxItemLine::BOTTOM, SvxBoxItemLine::RIGHT
4817 for(
int i = 0;
i < 4; ++
i )
4819 const SvxBorderLine* pLn = pBox->
GetLine( aBorders[
i] );
4824 m_pO->push_back( 11 );
4825 m_pO->push_back( nStart );
4826 m_pO->push_back( nLimit );
4827 m_pO->push_back( 1<<
i );
4840 bool bShadow =
false