27#include <rtl/tencinfo.h>
85#include <lineinfo.hxx>
91#include <com/sun/star/i18n/ScriptType.hpp>
104 if (pLine && !pLine->
isEmpty())
110 case SvxBorderLineStyle::SOLID:
118 case SvxBorderLineStyle::DOTTED:
121 case SvxBorderLineStyle::DASHED:
124 case SvxBorderLineStyle::DOUBLE:
125 case SvxBorderLineStyle::DOUBLE_THIN:
128 case SvxBorderLineStyle::THINTHICK_SMALLGAP:
131 case SvxBorderLineStyle::THINTHICK_MEDIUMGAP:
134 case SvxBorderLineStyle::THINTHICK_LARGEGAP:
137 case SvxBorderLineStyle::THICKTHIN_SMALLGAP:
140 case SvxBorderLineStyle::THICKTHIN_MEDIUMGAP:
143 case SvxBorderLineStyle::THICKTHIN_LARGEGAP:
146 case SvxBorderLineStyle::EMBOSSED:
149 case SvxBorderLineStyle::ENGRAVED:
152 case SvxBorderLineStyle::OUTSET:
155 case SvxBorderLineStyle::INSET:
158 case SvxBorderLineStyle::FINE_DASHED:
161 case SvxBorderLineStyle::DASH_DOT:
164 case SvxBorderLineStyle::DASH_DOT_DOT:
167 case SvxBorderLineStyle::NONE:
173 double const fConverted(
178 + OString::number(
static_cast<sal_Int32
>(fConverted)));
184 aRet.append(
static_cast<sal_Int32
>(fConverted) / 2);
195 return aRet.makeStringAndClear();
199 const char* pStr, sal_uInt16 nDist,
207 aRet.append(
static_cast<sal_Int32
>(nDist));
209 if (eShadowLocation == SvxShadowLocation::BottomRight)
211 return aRet.makeStringAndClear();
230 sal_uInt32 nRow = pTextNodeInfo->getRow();
231 sal_uInt32 nCell = pTextNodeInfo->getCell();
238 OSL_ENSURE(pDeepInner,
"TableNodeInfoInner not found");
250 if ((nRow == 0 && nCell == 0) || (
m_nTableDepth == 0 && pTextNodeInfo->getDepth()))
255 sal_uInt32 nCurrentDepth = pTextNodeInfo->getDepth();
260 for (sal_uInt32 nDepth =
m_nTableDepth + 1; nDepth <= pTextNodeInfo->getDepth();
264 pTextNodeInfo->getInnerForDepth(nDepth));
283 bool bLastPara =
false;
337 OSL_ENSURE(
m_aStyles.getLength() == 0,
"m_aStyles is not empty");
406 bool bSingleEmptyRun)
408 SAL_INFO(
"sw.rtf", __func__ <<
", bSingleEmptyRun: " << bSingleEmptyRun);
440 OSL_ENSURE(
m_aStyles.getLength() == 0,
"m_aStyles is not empty");
455 const OString aNormal =
m_aStyles.makeStringAndClear();
467 if (!aAssocRtlch.isEmpty())
475 if (!aAssocRtlch.isEmpty())
480 if (!aAssocHich.isEmpty())
484 if (!aNormal.isEmpty())
488 if (!aAssocDbch.isEmpty())
500 case i18n::ScriptType::LATIN:
503 case i18n::ScriptType::ASIAN:
506 case i18n::ScriptType::COMPLEX:
514 return aBuf.makeStringAndClear();
520 SAL_INFO(
"sw.rtf", __func__ <<
", rText: " << rText);
543 aStr +=
"(\\s\\up " + OUString::number((aWW8Ruby.
GetBaseHeight() + 10) / 20 - 1) +
"(";
589 const OUString& rURL =
m_aURLs.top();
596 if (isAtEndOfParagraph)
618 SAL_INFO(
"sw.rtf",
"TODO: " << __func__);
626 if (pRedline->
GetType() == RedlineType::Insert)
634 else if (pRedline->
GetType() == RedlineType::Delete)
651 SAL_INFO(
"sw.rtf",
"TODO: " << __func__);
657 OStringBuffer aStyle;
659 aStyle.append(
static_cast<sal_Int32
>(nStyle));
661 aStyle.append(*pStyle);
690 const SwTable* pTable = pTableTextNodeInfoInner->getTable();
701 static const SvxBoxItemLine aBorders[] = { SvxBoxItemLine::TOP, SvxBoxItemLine::LEFT,
702 SvxBoxItemLine::BOTTOM, SvxBoxItemLine::RIGHT };
704 static const char* aRowPadNames[]
708 static const char* aRowPadUnits[]
712 for (
int i = 0;
i < 4; ++
i)
721 const double fWidthRatio =
m_pTableWrt->GetAbsWidthRatio();
723 sal_uInt32 nRow = pTableTextNodeInfoInner->getRow();
724 if (nRow >= aRows.
size())
726 SAL_WARN(
"sw.ww8",
"RtfAttributeOutput::TableDefinition: out of range row: " << nRow);
733 sal_uInt32 nCurrentDepth = pTableTextNodeInfoInner->getDepth();
735 for (sal_uInt32
i = 0;
i <
m_aCells[nCurrentDepth];
i++)
740 pTableTextNodeInfoInner->setCell(
i);
748 + rtl::math::round(nSz * fWidthRatio)));
763 SwWriteTableRow* pRow = aRows[pTableTextNodeInfoInner->getRow()].get();
765 = pRow->
GetCells()[pTableTextNodeInfoInner->getCell()].get();
772 static const SvxBoxItemLine aBorders[] = { SvxBoxItemLine::TOP, SvxBoxItemLine::LEFT,
773 SvxBoxItemLine::BOTTOM, SvxBoxItemLine::RIGHT };
774 static const char* aBorderNames[]
779 static const char* aCellPadNames[]
782 static const char* aCellPadUnits[]
785 for (
int i = 0;
i < 4; ++
i)
789 if (rBox.GetDistance(aBorders[
i]))
794 m_aRowDefs.append(
static_cast<sal_Int32
>(rBox.GetDistance(aBorders[
i])));
802 const SwTable* pTable = pTableTextNodeInfoInner->getTable();
803 const SwTableBox* pTableBox = pTableTextNodeInfoInner->getTableBox();
810 aColor = pTableColorProp->GetColor();
814 if (pRowColorProp && pRowColorProp->GetColor() !=
COL_AUTO)
815 aColor = pRowColorProp->GetColor();
818 SwWriteTableRow* pRow = aRows[pTableTextNodeInfoInner->getRow()].get();
820 = pRow->
GetCells()[pTableTextNodeInfoInner->getCell()].get();
824 if (pBrushItem->GetColor() !=
COL_AUTO)
825 aColor = pBrushItem->GetColor();
847 const SwTableBox* pTabBox = pTableTextNodeInfoInner->getTableBox();
855 sal_Int32 nHeight = 0;
879 const SwTableBox* pTabBox = pTableTextNodeInfoInner->getTableBox();
891 const SwTable* pTable = pTableTextNodeInfoInner->getTable();
904 SwWriteTableRow* pRow = aRows[pTableTextNodeInfoInner->getRow()].get();
906 = pRow->
GetCells()[pTableTextNodeInfoInner->getCell()].get();
924 if (!pVertOrientItem)
929 case text::VertOrientation::CENTER:
932 case text::VertOrientation::BOTTOM:
952 const SwTable* pTable = pTableTextNodeInfoInner->getTable();
958 case text::HoriOrientation::CENTER:
959 aTableAdjust.setLength(0);
962 case text::HoriOrientation::RIGHT:
963 aTableAdjust.setLength(0);
967 case text::HoriOrientation::LEFT_AND_WIDTH:
981 SAL_INFO(
"sw.rtf",
"TODO: " << __func__);
993 const SwTable* pTable = pTableTextNodeInfoInner->getTable();
998 bool bRelBoxSize =
false;
1008 m_pTableWrt = std::make_unique<SwWriteTable>(pTable, pLayout);
1023 sal_uInt32 nCurrentDepth = pTableTextNodeInfoInner->getDepth();
1024 SAL_INFO(
"sw.rtf", __func__ <<
", (depth is " << nCurrentDepth <<
")");
1033 if (nCurrentDepth > 1)
1135 sal_uInt32 nRow = pInner->getRow();
1137 const SwTable* pTable = pInner->getTable();
1139 sal_uInt16 nLinesCount = rLines.
size();
1141 if (pInner->isEndOfCell())
1145 if (pInner->isEndOfLine())
1149 if (pInner->isEndOfLine() && (nRow + 1) == nLinesCount)
1160 OSL_ENSURE(
m_aStylesheet.getLength() == 0,
"m_aStylesheet is not empty");
1177 sal_uInt16 nNext, sal_uInt16 , sal_uInt16 ,
1178 sal_uInt16 nSlot,
bool bAutoUpdate)
1180 SAL_INFO(
"sw.rtf", __func__ <<
", rName = '" << rName <<
"'");
1189 if (nBase != 0x0FFF)
1230 m_aStyles.append(
static_cast<sal_Int32
>(nLvl));
1232 m_aStyles.append(
static_cast<sal_Int32
>(nLvl));
1318 sal_uInt16 nOpt = (1 << 5);
1348 const ::std::optional<sal_uInt16>& oPageRestartNumber)
1350 if (oPageRestartNumber)
1357 const char* pStr =
nullptr;
1385 SAL_INFO(
"sw.rtf", __func__ <<
", nBreakCode = " <<
int(nBreakCode));
1391 const char*
sType =
nullptr;
1426 const char*
pOut =
nullptr;
1517 sal_uInt16 nNumberingType,
SvxAdjust eAdjust,
1520 sal_Int16 nIndentAt, sal_Int16 nFirstLineIndex,
1521 sal_Int16 ,
const OUString& rNumberingString,
1532 sal_uInt16 nVal = 0;
1533 switch (nNumberingType)
1593 case style::NumberingType::HANGUL_SYLLABLE_KO:
1596 case style::NumberingType::HANGUL_JAMO_KO:
1599 case style::NumberingType::HANGUL_CIRCLED_SYLLABLE_KO:
1602 case style::NumberingType::HANGUL_CIRCLED_JAMO_KO:
1605 case style::NumberingType::NUMBER_HANGUL_KO:
1608 case style::NumberingType::NUMBER_DIGITAL_KO:
1611 case style::NumberingType::NUMBER_DIGITAL2_KO:
1614 case style::NumberingType::NUMBER_LEGAL_KO:
1634 case SvxAdjust::Center:
1637 case SvxAdjust::Right:
1722 bool bHasInstructions = !rFieldCmd.isEmpty();
1725 if (bHasInstructions)
1739 if (bHasInstructions)
1751 if (bHasInstructions)
1766 std::vector<OUString>& rEnds)
1768 for (
const auto& rStart : rStarts)
1776 for (
const auto& rEnd : rEnds)
1786 std::vector<OUString>& rEnds)
1788 for (
const auto& rStart : rStarts)
1801 for (
const auto& rEnd : rEnds)
1809 const sal_Int32
nId = it->second;
1829 const char* pStr,
bool bTitlepg)
1855void lcl_TextFrameShadow(std::vector<std::pair<OString, OString>>& rFlyProperties,
1859 if (aShadowItem.
GetLocation() == SvxShadowLocation::NONE)
1862 rFlyProperties.push_back(std::make_pair<OString, OString>(
"fShadow", OString::number(1)));
1866 rFlyProperties.push_back(std::make_pair<OString, OString>(
1870 OString aShadowWidth = OString::number(sal_Int32(aShadowItem.
GetWidth() / 20) * 12700);
1875 case SvxShadowLocation::TopLeft:
1876 aOffsetX =
"-" + aShadowWidth;
1877 aOffsetY =
"-" + aShadowWidth;
1879 case SvxShadowLocation::TopRight:
1880 aOffsetX = aShadowWidth;
1881 aOffsetY =
"-" + aShadowWidth;
1883 case SvxShadowLocation::BottomLeft:
1884 aOffsetX =
"-" + aShadowWidth;
1885 aOffsetY = aShadowWidth;
1887 case SvxShadowLocation::BottomRight:
1888 aOffsetX = aShadowWidth;
1889 aOffsetY = aShadowWidth;
1891 case SvxShadowLocation::NONE:
1892 case SvxShadowLocation::End:
1895 if (!aOffsetX.isEmpty())
1896 rFlyProperties.emplace_back(
"shadowOffsetX", aOffsetX);
1897 if (!aOffsetY.isEmpty())
1898 rFlyProperties.emplace_back(
"shadowOffsetY", aOffsetY);
1901void lcl_TextFrameRelativeSize(std::vector<std::pair<OString, OString>>& rFlyProperties,
1910 rFlyProperties.push_back(
1911 std::make_pair<OString, OString>(
"pctHoriz", OString::number(nWidthPercent * 10)));
1916 case text::RelOrientation::PAGE_FRAME:
1923 rFlyProperties.emplace_back(std::make_pair(
"sizerelh", aRelation));
1929 rFlyProperties.push_back(
1930 std::make_pair<OString, OString>(
"pctVert", OString::number(nHeightPercent * 10)));
1935 case text::RelOrientation::PAGE_FRAME:
1942 rFlyProperties.emplace_back(std::make_pair(
"sizerelv", aRelation));
1962 std::unique_ptr<SwWriteTable> pTableWrt(std::move(
m_pTableWrt));
2169 const uno::Reference<awt::XControlModel>& xControlModel
2170 = pFormObj->GetUnoControlModel();
2171 uno::Reference<lang::XServiceInfo> xInfo(xControlModel, uno::UNO_QUERY);
2174 uno::Reference<beans::XPropertySet> xPropSet(xControlModel, uno::UNO_QUERY);
2175 uno::Reference<beans::XPropertySetInfo> xPropSetInfo
2176 = xPropSet->getPropertySetInfo();
2178 if (xInfo->supportsService(
"com.sun.star.form.component.CheckBox"))
2191 if (xPropSetInfo->hasPropertyByName(
sName))
2193 xPropSet->getPropertyValue(
sName) >>=
aStr;
2203 if (xPropSetInfo->hasPropertyByName(
sName))
2205 xPropSet->getPropertyValue(
sName) >>=
aStr;
2214 sName =
"HelpF1Text";
2215 if (xPropSetInfo->hasPropertyByName(
sName))
2217 xPropSet->getPropertyValue(
sName) >>=
aStr;
2226 sal_Int16 nTemp = 0;
2227 xPropSet->getPropertyValue(
"DefaultState") >>= nTemp;
2230 xPropSet->getPropertyValue(
"State") >>= nTemp;
2239 else if (xInfo->supportsService(
"com.sun.star.form.component.TextField"))
2251 for (
int i = 0;
i < 8;
i++)
2252 aBuf.append(
char(0x00));
2253 xPropSet->getPropertyValue(
"Name") >>= aTmp;
2255 aBuf.append(
static_cast<char>(
aStr.getLength()));
2257 aBuf.append(
char(0x00));
2258 xPropSet->getPropertyValue(
"DefaultText") >>= aTmp;
2260 aBuf.append(
static_cast<char>(
aStr.getLength()));
2262 for (
int i = 0;
i < 11;
i++)
2263 aBuf.append(
char(0x00));
2265 pStr =
aStr.getStr();
2266 for (
int i = 0;
i <
aStr.getLength();
i++, pStr++)
2270 xPropSet->getPropertyValue(
"Text") >>= aTmp;
2277 if (xPropSetInfo->hasPropertyByName(
sName))
2279 xPropSet->getPropertyValue(
sName) >>= aTmp;
2288 sName =
"HelpF1Text";
2289 if (xPropSetInfo->hasPropertyByName(
sName))
2291 xPropSet->getPropertyValue(
sName) >>= aTmp;
2301 else if (xInfo->supportsService(
"com.sun.star.form.component.ListBox"))
2304 uno::Sequence<sal_Int16> aIntSeq;
2305 uno::Sequence<OUString> aStrSeq;
2315 xPropSet->getPropertyValue(
"DefaultSelection") >>= aIntSeq;
2316 if (aIntSeq.hasElements())
2323 xPropSet->getPropertyValue(
"SelectedItems") >>= aIntSeq;
2324 if (aIntSeq.hasElements())
2332 if (xPropSetInfo->hasPropertyByName(
sName))
2334 xPropSet->getPropertyValue(
sName) >>=
aStr;
2344 if (xPropSetInfo->hasPropertyByName(
sName))
2346 xPropSet->getPropertyValue(
sName) >>=
aStr;
2355 sName =
"HelpF1Text";
2356 if (xPropSetInfo->hasPropertyByName(
sName))
2358 xPropSet->getPropertyValue(
sName) >>=
aStr;
2367 xPropSet->getPropertyValue(
"StringItemList") >>= aStrSeq;
2368 for (
const auto& rStr : std::as_const(aStrSeq))
2380 SAL_INFO(
"sw.rtf", __func__ <<
" unhandled form control: '"
2381 << xInfo->getImplementationName() <<
"'");
2404 SAL_INFO(
"sw.rtf", __func__ <<
": unknown type ("
2412 switch (rCaseMap.GetValue())
2414 case SvxCaseMap::SmallCaps:
2417 case SvxCaseMap::Uppercase:
2440 if (!rContour.GetValue())
2464 short nEsc = rEscapement.
GetEsc();
2466 sal_Int32 nProp100 = nProp * 100;
2477 nEsc = .8 * (100 - nProp);
2482 nEsc = .2 * -(100 - nProp);
2514 m_aStyles.append(
static_cast<sal_Int32
>(
round(fHeight * nEsc / 1000)));
2539 switch (rFontSize.Which())
2560 m_aStyles.append(
static_cast<sal_Int32
>(rKerning.GetValue() / 5));
2562 m_aStyles.append(
static_cast<sal_Int32
>(rKerning.GetValue()));
2567 switch (rLanguage.Which())
2572 static_cast<sal_Int32
>(
static_cast<sal_uInt16
>(rLanguage.
GetLanguage())));
2575 static_cast<sal_Int32
>(
static_cast<sal_uInt16
>(rLanguage.
GetLanguage())));
2580 static_cast<sal_Int32
>(
static_cast<sal_uInt16
>(rLanguage.
GetLanguage())));
2583 static_cast<sal_Int32
>(
static_cast<sal_uInt16
>(rLanguage.
GetLanguage())));
2588 static_cast<sal_Int32
>(
static_cast<sal_uInt16
>(rLanguage.
GetLanguage())));
2603 if (!rShadow.GetValue())
2609 const char* pStr =
nullptr;
2693 m_aStyles.append(
static_cast<sal_Int32
>(rAutoKern.GetValue() ? 1 : 0));
2699 m_aStyles.append(
static_cast<sal_Int32
>(rBlink.GetValue() ? 2 : 0));
2786 if (
v == FontEmphasisMark::NONE)
2788 else if (
v == (FontEmphasisMark::Dot | FontEmphasisMark::PosAbove))
2790 else if (
v == (FontEmphasisMark::Accent | FontEmphasisMark::PosAbove))
2792 else if (
v == (FontEmphasisMark::Circle | FontEmphasisMark::PosAbove))
2794 else if (
v == (FontEmphasisMark::Dot | FontEmphasisMark::PosBelow))
2807 if (!cStart && !cEnd)
2809 else if (
'{' == cStart ||
'}' == cEnd)
2811 else if (
'<' == cStart ||
'>' == cEnd)
2813 else if (
'[' == cStart ||
']' == cEnd)
2825 m_aStyles.append(
static_cast<sal_Int32
>(rScaleWidth.GetValue()));
2831 switch (rRelief.GetValue())
2833 case FontRelief::Embossed:
2836 case FontRelief::Engraved:
2851 if (!rHidden.GetValue())
2856 const sal_uInt16 nDist,
const bool bShadow)
2860 bShadow ? SvxShadowLocation::BottomRight : SvxShadowLocation::NONE));
2877 if (pTextAtr &&
nullptr != (pFormat = pTextAtr->
GetCharFormat()))
2890 m_aStyles.append(
static_cast<sal_Int32
>(nStyle));
2907 SAL_INFO(
"sw.rtf", __func__ <<
" start");
2944 SAL_INFO(
"sw.rtf", __func__ <<
" end");
2950 m_aStyles.append(
static_cast<sal_Int32
>(nSpace));
2952 m_aStyles.append(
static_cast<sal_Int32
>(nMulti));
2959 case SvxAdjust::Left:
2962 case SvxAdjust::Right:
2965 case SvxAdjust::BlockLine:
2966 case SvxAdjust::Block:
2972 case SvxAdjust::Center:
2982 if (!rSplit.GetValue())
2988 if (rWidows.GetValue())
3002 for (sal_uInt16
n = 0;
n < rTabStop.
Count();
n++)
3007 const char* pFill =
nullptr;
3031 const char* pAdjStr =
nullptr;
3034 case SvxTabAdjust::Right:
3037 case SvxTabAdjust::Decimal:
3040 case SvxTabAdjust::Center:
3068 if (USHRT_MAX == nNumId || 0 == nNumId ||
nullptr == pTextNd)
3073 if (!pRule || !pTextNd->
IsInList())
3077 "sw.rtf",
"text node does not have valid list level");
3081 pFormat = &pRule->
Get(nLvl);
3106 sText = OUString(&cBullet, 1);
3111 if (!sText.isEmpty())
3119 if (!sText.isEmpty())
3152 SAL_INFO(
"sw.rtf",
"TODO: " << __func__);
3157 SAL_INFO(
"sw.rtf",
"TODO: " << __func__);
3187 SAL_INFO(
"sw.rtf",
"TODO: " << __func__);
3208 SAL_INFO(
"sw.rtf",
"TODO: " << __func__);
3223 = pBoxItem->CalcLineSpace(SvxBoxItemLine::LEFT,
true);
3225 = pBoxItem->CalcLineSpace(SvxBoxItemLine::RIGHT,
true);
3381 css::text::WrapTextMode eSurround = rSurround.
GetSurround();
3382 bool bGold = css::text::WrapTextMode_DYNAMIC == eSurround;
3384 eSurround = css::text::WrapTextMode_PARALLEL;
3393 std::optional<sal_Int32> oWrk;
3396 case css::text::WrapTextMode_NONE:
3399 case css::text::WrapTextMode_THROUGH:
3402 case css::text::WrapTextMode_PARALLEL:
3406 case css::text::WrapTextMode_DYNAMIC:
3433 case text::RelOrientation::PAGE_FRAME:
3435 std::make_pair<OString, OString>(
"posrelv", OString::number(1)));
3439 std::make_pair<OString, OString>(
"posrelv", OString::number(2)));
3448 case text::VertOrientation::TOP:
3449 case text::VertOrientation::LINE_TOP:
3451 std::make_pair<OString, OString>(
"posv", OString::number(1)));
3453 case text::VertOrientation::BOTTOM:
3454 case text::VertOrientation::LINE_BOTTOM:
3456 std::make_pair<OString, OString>(
"posv", OString::number(3)));
3458 case text::VertOrientation::CENTER:
3459 case text::VertOrientation::LINE_CENTER:
3461 std::make_pair<OString, OString>(
"posv", OString::number(2)));
3483 case text::RelOrientation::PAGE_FRAME:
3485 std::make_pair<OString, OString>(
"posrelh", OString::number(1)));
3489 std::make_pair<OString, OString>(
"posrelh", OString::number(2)));
3498 case text::HoriOrientation::LEFT:
3500 std::make_pair<OString, OString>(
"posh", OString::number(1)));
3502 case text::HoriOrientation::CENTER:
3504 std::make_pair<OString, OString>(
"posh", OString::number(2)));
3506 case text::HoriOrientation::RIGHT:
3508 std::make_pair<OString, OString>(
"posh", OString::number(3)));
3533 case RndStdIds::FLY_AT_PAGE:
3537 case RndStdIds::FLY_AT_PARA:
3538 case RndStdIds::FLY_AS_CHAR:
3573 "fillType", OString::number(7)));
3586 case css::awt::GradientStyle_LINEAR:
3588 case css::awt::GradientStyle_AXIAL:
3590 std::make_pair<OString, OString>(
"fillFocus", OString::number(50)));
3592 case css::awt::GradientStyle_RADIAL:
3593 case css::awt::GradientStyle_ELLIPTICAL:
3594 case css::awt::GradientStyle_SQUARE:
3595 case css::awt::GradientStyle_RECT:
3603 static const SvxBoxItemLine aBorders[] = { SvxBoxItemLine::TOP, SvxBoxItemLine::LEFT,
3604 SvxBoxItemLine::BOTTOM, SvxBoxItemLine::RIGHT };
3605 static const char* aBorderNames[]
3632 if (!pLeft && !pRight && !pBottom && !pTop)
3635 m_aFlyProperties.push_back(std::make_pair<OString, OString>(
"fLine",
"0"));
3655 m_aFlyProperties.push_back(std::make_pair<OString, OString>(
"fLine",
"0"));
3664 double const fConverted(
3668 std::make_pair<OString, OString>(
"lineWidth", OString::number(nWidth)));
3676 && nDist == rBox.
GetDistance(SvxBoxItemLine::LEFT)
3677 && nDist == rBox.
GetDistance(SvxBoxItemLine::BOTTOM)
3678 && nDist == rBox.
GetDistance(SvxBoxItemLine::RIGHT))
3685 eShadowLocation = pItem->GetLocation();
3688 const char** pBrdNms = aBorderNames;
3689 for (
int i = 0;
i < 4; ++
i, ++pBrd, ++pBrdNms)
3721 for (sal_uInt16
n = 0;
n < nCols;)
3740 if (rItem.GetValue())
3746 SAL_INFO(
"sw.rtf",
"TODO: " << __func__);
3758 if (nDir == SvxFrameDirection::Environment)
3763 if (nDir == SvxFrameDirection::Vertical_RL_TB)
3778 if (nDir == SvxFrameDirection::Vertical_RL_TB)
3781 m_aFlyProperties.push_back(std::make_pair<OString, OString>(
"txflTextFlow",
"3"));
3783 else if (rDirection.GetValue() == SvxFrameDirection::Vertical_LR_BT)
3786 m_aFlyProperties.push_back(std::make_pair<OString, OString>(
"txflTextFlow",
"2"));
3791 if (nDir == SvxFrameDirection::Horizontal_RL_TB)
3799 const std::map<OUString, css::uno::Any>& rMap = rItem.
GetGrabBag();
3800 for (
const auto& rValue : rMap)
3802 if (rValue.first ==
"ParaTopMarginBeforeAutoSpacing")
3808 else if (rValue.first ==
"ParaBottomMarginAfterAutoSpacing")
3839 SAL_INFO(
"sw.rtf",
"TODO: " << __func__);
3844 SAL_INFO(
"sw.rtf",
"TODO: " << __func__);
3850 SAL_INFO(
"sw.rtf",
"TODO: " << __func__);
3901 " MACROBUTTON None ");
3909 , m_rExport(rExport)
3910 , m_pPrevPageDesc(nullptr)
3915 , m_bControlLtrRtl(false)
3916 , m_nNextAnnotationMarkId(0)
3917 , m_nCurrentAnnotationMarkId(-1)
3918 , m_bTableCellOpen(false)
3920 , m_bTableAfterCell(false)
3921 , m_nColBreakNeeded(false)
3922 , m_bBufferSectionBreaks(false)
3923 , m_bBufferSectionHeaders(false)
3924 , m_bLastTable(true)
3925 , m_bWroteCellInfo(false)
3926 , m_bTableRowEnded(false)
3927 , m_bIsBeforeFirstParagraph(true)
3928 , m_bSingleEmptyRun(false)
3931 , m_pFlyFrameSize(nullptr)
3932 , m_bParaBeforeAutoSpacing(false)
3933 , m_nParaBeforeSpacing(0)
3934 , m_bParaAfterAutoSpacing(false)
3935 , m_nParaAfterSpacing(0)
4020 sal_uInt16 nVal = 0;
4035static void lcl_AppendSP(OStringBuffer& rBuffer,
const char cName[],
const OUString& rValue,
4040 rBuffer.append(cName);
4044 rBuffer.append(
"}}");
4049 const char* pBLIPType,
const sal_uInt8* pGraphicAry, sal_uInt64 nSize,
4051 bool bWritePicProp =
true,
const SwAttrSet* pAttrSet =
nullptr)
4054 if (pBLIPType && nSize && pGraphicAry)
4060 if (pFlyFrameFormat && bWritePicProp)
4067 lcl_AppendSP(aRet,
"wzDescription", sDescription, rExport);
4086 nXCroppedSize = 100;
4088 nYCroppedSize = 100;
4094 aRet.append(
static_cast<sal_Int32
>((100 * rRendered.
Width()) / nXCroppedSize));
4096 aRet.append(
static_cast<sal_Int32
>((100 * rRendered.
Height()) / nYCroppedSize));
4103 aRet.append(rCr.
GetTop());
4108 aRet.append(
static_cast<sal_Int32
>(rMapped.
Width()));
4110 aRet.append(
static_cast<sal_Int32
>(rMapped.
Height()));
4113 aRet.append(
static_cast<sal_Int32
>(rOrig.
Width()));
4115 aRet.append(
static_cast<sal_Int32
>(rOrig.
Height()));
4117 aRet.append(pBLIPType);
4120 aRet.append(sal_Int32(8));
4126 pStream->WriteOString(aRet);
4136 pStream->WriteOString(aRet);
4140 return aRet.makeStringAndClear();
4148 Size aRendered(aSize);
4158 SAL_WARN(
"sw.rtf",
"failed to export the graphic");
4159 sal_uInt32 nSize = aStream.
TellEnd();
4168 SAL_WARN(
"sw.rtf",
"failed to export the graphic");
4180 sal_Int64 nAspect = rOLENode.
GetAspect();
4188 uno::Reference<util::XCloseable> xClosable = xObj->getComponent();
4189 if (!xClosable.is())
4191 auto pBase =
dynamic_cast<oox::FormulaImExportBase*
>(xClosable.get());
4192 SAL_WARN_IF(!pBase,
"sw.rtf",
"Math OLE object cannot write out RTF");
4223 sal_uInt32 nSize = 0;
4228 if (rGraphic.
GetType() == GraphicType::NONE)
4235 const char* pBLIPType =
nullptr;
4240 pGraphicAry = aGraphicLink.
GetData();
4241 switch (aGraphicLink.
GetType())
4251 case GfxLinkType::NativeBmp:
4253 pGraphicAry =
nullptr;
4256 case GfxLinkType::NativeJpg:
4259 case GfxLinkType::NativePng:
4262 case GfxLinkType::NativeWmf:
4266 case GfxLinkType::NativeGif:
4268 aConvertDestinationFormat = ConvertDataFormat::PNG;
4281 (eGraphicType == GraphicType::Bitmap)
4282 ? ConvertDataFormat::PNG
4283 : ConvertDataFormat::WMF))
4299 Size aRendered(aSize);
4308 if (pFlyFrameFormat == &rFrame.GetFrameFormat())
4343 std::vector<std::pair<OString, OString>> aFlyProperties{
4359 if (pPolyPoly && pPolyPoly->
Count())
4362 *pPolyPoly, pNd,
true);
4363 OStringBuffer aVerticies;
4364 for (sal_uInt16
i = 0;
i < aPoly.
GetSize(); ++
i)
4365 aVerticies.append(
";(" + OString::number(aPoly[
i].X()) +
","
4366 + OString::number(aPoly[
i].Y()) +
")");
4367 aFlyProperties.push_back(std::make_pair<OString, OString>(
4368 "pWrapPolygonVertices",
4369 "8;" + OString::number(aPoly.
GetSize()) + aVerticies));
4375 if (!pFlyFrameFormat->
GetOpaque().GetValue())
4376 aFlyProperties.push_back(std::make_pair<OString, OString>(
"fBehindDocument",
"1"));