21#include <com/sun/star/uno/Any.hxx>
22#include <com/sun/star/drawing/LineStyle.hpp>
23#include <com/sun/star/script/Converter.hpp>
24#include <com/sun/star/table/ShadowLocation.hpp>
25#include <com/sun/star/table/ShadowFormat.hpp>
26#include <com/sun/star/table/BorderLine2.hpp>
27#include <com/sun/star/table/BorderLineStyle.hpp>
28#include <com/sun/star/style/BreakType.hpp>
29#include <com/sun/star/style/GraphicLocation.hpp>
30#include <com/sun/star/awt/Size.hpp>
31#include <com/sun/star/text/WritingMode2.hpp>
32#include <com/sun/star/frame/status/UpperLowerMarginScale.hpp>
33#include <com/sun/star/frame/status/LeftRightMarginScale.hpp>
34#include <com/sun/star/drawing/ShadingPattern.hpp>
35#include <com/sun/star/graphic/XGraphic.hpp>
36#include <com/sun/star/util/XComplexColor.hpp>
38#include <osl/diagnose.h>
47#include <rtl/math.hxx>
48#include <rtl/ustring.hxx>
54#include <editeng/editrids.hrc>
73#include <libxml/xmlwriter.h>
81#include <boost/property_tree/ptree.hpp>
86using namespace ::com::sun::star::table::BorderLineStyle;
117 case SfxItemPresentation::Nameless:
118 rText = OUString::number(
GetValue() );
121 case SfxItemPresentation::Complete:
126 rText =
EditResId(RID_SVXSTR_PAPERBIN_SETTINGS);
129 rText =
EditResId(RID_SVXSTR_PAPERBIN) +
" " + OUString::number(
nValue );
153 nMemberId &= ~CONVERT_TWIPS;
167 default: OSL_FAIL(
"Wrong MemberId!");
return false;
177 nMemberId &= ~CONVERT_TWIPS;
202 if(!(rVal >>= nVal ))
217 default: OSL_FAIL(
"Wrong MemberId!");
233 assert(SfxPoolItem::operator==(rAttr));
254 case SfxItemPresentation::Nameless:
260 case SfxItemPresentation::Complete:
261 rText =
EditResId(RID_SVXITEMS_SIZE_WIDTH) +
296 , m_nRightGutterMargin(0),
297 nPropFirstLineOffset( 100 ),
298 nPropLeftMargin( 100 ),
299 nPropRightMargin( 100 ),
300 bAutoFirst ( false ),
301 bExplicitZeroMarginValRight(false),
302 bExplicitZeroMarginValLeft(false)
309 const sal_uInt16 nId )
315 , m_nRightGutterMargin(0),
316 nPropFirstLineOffset( 100 ),
317 nPropLeftMargin( 100 ),
318 nPropRightMargin( 100 ),
319 bAutoFirst ( false ),
320 bExplicitZeroMarginValRight(false),
321 bExplicitZeroMarginValLeft(false)
330 nMemberId &= ~CONVERT_TWIPS;
336 css::frame::status::LeftRightMarginScale aLRSpace;
385 OSL_FAIL(
"unknown MemberId");
394 nMemberId &= ~CONVERT_TWIPS;
405 css::frame::status::LeftRightMarginScale aLRSpace;
406 if(!(rVal >>= aLRSpace))
462 OSL_FAIL(
"unknown MemberId");
498 const short nF,
const sal_uInt16 nProp)
545 auto const nTxtLeft = (nL * nProp) / 100;
582 , m_nLeftMargin(nLeft)
590 nMemberId &= ~CONVERT_TWIPS;
603 OSL_FAIL(
"unknown MemberId");
611 nMemberId &= ~CONVERT_TWIPS;
618 if (!(rVal >>= nVal))
640 OSL_FAIL(
"unknown MemberId");
648 assert(SfxPoolItem::operator==(rAttr));
671 case SfxItemPresentation::Nameless:
681 eCoreUnit, ePresUnit, &rIntl);
685 case SfxItemPresentation::Complete:
687 rText =
EditResId(RID_SVXITEMS_LRSPACE_LEFT);
717 (void)xmlTextWriterStartElement(pWriter, BAD_CAST(
"SvxLeftMarginItem"));
718 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"whichId"), BAD_CAST(OString::number(
Which()).getStr()));
719 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"m_nLeftMargin"), BAD_CAST(OString::number(
m_nLeftMargin).getStr()));
720 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"m_nPropLeftMargin"), BAD_CAST(OString::number(
m_nPropLeftMargin).getStr()));
721 (void)xmlTextWriterEndElement(pWriter);
728 boost::property_tree::ptree aState;
730 MapUnit eTargetUnit = MapUnit::MapInch;
733 MapUnit::MapTwip, eTargetUnit,
nullptr);
735 aState.put(
"left", sLeft);
736 aState.put(
"unit",
"inch");
738 aTree.push_back(std::make_pair(
"state", aState));
750 , m_nTextLeftMargin(nLeft)
758 nMemberId &= ~CONVERT_TWIPS;
764 css::frame::status::LeftRightMarginScale aLRSpace;
780 OSL_FAIL(
"unknown MemberId");
788 nMemberId &= ~CONVERT_TWIPS;
795 if (!(rVal >>= nVal))
817 OSL_FAIL(
"unknown MemberId");
825 assert(SfxPoolItem::operator==(rAttr));
848 case SfxItemPresentation::Nameless:
858 eCoreUnit, ePresUnit, &rIntl);
862 case SfxItemPresentation::Complete:
864 rText =
EditResId(RID_SVXITEMS_LRSPACE_LEFT);
894 (void)xmlTextWriterStartElement(pWriter, BAD_CAST(
"SvxTextLeftMarginItem"));
895 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"whichId"), BAD_CAST(OString::number(
Which()).getStr()));
896 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"m_nTextLeftMargin"), BAD_CAST(OString::number(
m_nTextLeftMargin).getStr()));
897 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"m_nPropLeftMargin"), BAD_CAST(OString::number(
m_nPropLeftMargin).getStr()));
898 (void)xmlTextWriterEndElement(pWriter);
905 boost::property_tree::ptree aState;
907 MapUnit eTargetUnit = MapUnit::MapInch;
910 MapUnit::MapTwip, eTargetUnit,
nullptr);
912 aState.put(
"left", sLeft);
913 aState.put(
"unit",
"inch");
915 aTree.push_back(std::make_pair(
"state", aState));
927 , m_nFirstLineOffset(nFirst)
935 nMemberId &= ~CONVERT_TWIPS;
951 OSL_FAIL(
"unknown MemberId");
959 nMemberId &= ~CONVERT_TWIPS;
966 if (!(rVal >>= nVal))
992 OSL_FAIL(
"unknown MemberId");
1000 assert(SfxPoolItem::operator==(rAttr));
1024 case SfxItemPresentation::Nameless:
1034 eCoreUnit, ePresUnit, &rIntl);
1038 case SfxItemPresentation::Complete:
1040 rText +=
EditResId(RID_SVXITEMS_LRSPACE_FLINE);
1049 eCoreUnit, ePresUnit, &rIntl)
1071 (void)xmlTextWriterStartElement(pWriter, BAD_CAST(
"SvxFirstLineIndentItem"));
1072 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"whichId"), BAD_CAST(OString::number(
Which()).getStr()));
1073 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"m_nFirstLineOffset"), BAD_CAST(OString::number(
m_nFirstLineOffset).getStr()));
1074 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"m_nPropFirstLineOffset"), BAD_CAST(OString::number(
m_nPropFirstLineOffset).getStr()));
1075 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"m_bAutoFirst"), BAD_CAST(OString::number(
int(
m_bAutoFirst)).getStr()));
1076 (void)xmlTextWriterEndElement(pWriter);
1083 boost::property_tree::ptree aState;
1085 MapUnit eTargetUnit = MapUnit::MapInch;
1088 MapUnit::MapTwip, eTargetUnit,
nullptr);
1090 aState.put(
"firstline", sFirstline);
1091 aState.put(
"unit",
"inch");
1093 aTree.push_back(std::make_pair(
"state", aState));
1105 , m_nRightMargin(nRight)
1113 nMemberId &= ~CONVERT_TWIPS;
1119 css::frame::status::LeftRightMarginScale aLRSpace;
1135 OSL_FAIL(
"unknown MemberId");
1143 nMemberId &= ~CONVERT_TWIPS;
1150 if (!(rVal >>= nVal))
1172 OSL_FAIL(
"unknown MemberId");
1180 assert(SfxPoolItem::operator==(rAttr));
1203 case SfxItemPresentation::Nameless:
1213 eCoreUnit, ePresUnit, &rIntl);
1217 case SfxItemPresentation::Complete:
1219 rText +=
EditResId(RID_SVXITEMS_LRSPACE_RIGHT);
1228 eCoreUnit, ePresUnit, &rIntl)
1250 (void)xmlTextWriterStartElement(pWriter, BAD_CAST(
"SvxRightMarginItem"));
1251 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"whichId"), BAD_CAST(OString::number(
Which()).getStr()));
1252 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"m_nRightMargin"), BAD_CAST(OString::number(
m_nRightMargin).getStr()));
1253 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"m_nPropRightMargin"), BAD_CAST(OString::number(
m_nPropRightMargin).getStr()));
1254 (void)xmlTextWriterEndElement(pWriter);
1261 boost::property_tree::ptree aState;
1263 MapUnit eTargetUnit = MapUnit::MapInch;
1266 MapUnit::MapTwip, eTargetUnit,
nullptr);
1268 aState.put(
"right", sRight);
1269 aState.put(
"unit",
"inch");
1271 aTree.push_back(std::make_pair(
"state", aState));
1285 nMemberId &= ~CONVERT_TWIPS;
1296 OSL_FAIL(
"unknown MemberId");
1304 nMemberId &= ~CONVERT_TWIPS;
1311 if (!(rVal >>= nVal))
1320 OSL_FAIL(
"unknown MemberId");
1328 assert(SfxPoolItem::operator==(rAttr));
1364 (void)xmlTextWriterStartElement(pWriter, BAD_CAST(
"SvxGutterLeftMarginItem"));
1365 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"whichId"), BAD_CAST(OString::number(
Which()).getStr()));
1366 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"m_nGutterMargin"),
1368 (void)xmlTextWriterEndElement(pWriter);
1375 boost::property_tree::ptree aState;
1378 aState.put(
"unit",
"inch");
1380 aTree.push_back(std::make_pair(
"state", aState));
1394 nMemberId &= ~CONVERT_TWIPS;
1403 OSL_FAIL(
"unknown MemberId");
1414 nMemberId &= ~CONVERT_TWIPS;
1422 OSL_FAIL(
"unknown MemberId");
1434 assert(SfxPoolItem::operator==(rAttr));
1470 (void)xmlTextWriterStartElement(pWriter, BAD_CAST(
"SvxGutterRightMarginItem"));
1471 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"whichId"), BAD_CAST(OString::number(
Which()).getStr()));
1472 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"m_nRightGutterMargin"),
1474 (void)xmlTextWriterEndElement(pWriter);
1481 boost::property_tree::ptree aState;
1484 aState.put(
"unit",
"inch");
1486 aTree.push_back(std::make_pair(
"state", aState));
1494 assert(SfxPoolItem::operator==(rAttr));
1527 case SfxItemPresentation::Nameless:
1536 eCoreUnit, ePresUnit, &rIntl );
1545 eCoreUnit, ePresUnit, &rIntl );
1554 eCoreUnit, ePresUnit, &rIntl );
1557 case SfxItemPresentation::Complete:
1559 rText =
EditResId(RID_SVXITEMS_LRSPACE_LEFT);
1571 rText +=
EditResId(RID_SVXITEMS_LRSPACE_FLINE);
1578 eCoreUnit, ePresUnit, &rIntl ) +
1583 rText +=
EditResId(RID_SVXITEMS_LRSPACE_RIGHT);
1590 eCoreUnit, ePresUnit, &rIntl ) +
1617 (void)xmlTextWriterStartElement(pWriter, BAD_CAST(
"SvxLRSpaceItem"));
1618 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"whichId"), BAD_CAST(OString::number(
Which()).getStr()));
1619 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"nFirstLineOffset"), BAD_CAST(OString::number(
nFirstLineOffset).getStr()));
1620 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"nLeftMargin"), BAD_CAST(OString::number(
nLeftMargin).getStr()));
1621 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"nRightMargin"), BAD_CAST(OString::number(
nRightMargin).getStr()));
1622 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"m_nGutterMargin"),
1624 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"m_nRightGutterMargin"),
1626 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"nPropFirstLineOffset"), BAD_CAST(OString::number(
nPropFirstLineOffset).getStr()));
1627 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"nPropLeftMargin"), BAD_CAST(OString::number(
nPropLeftMargin).getStr()));
1628 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"nPropRightMargin"), BAD_CAST(OString::number(
nPropRightMargin).getStr()));
1629 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"bAutoFirst"), BAD_CAST(OString::number(
int(
bAutoFirst)).getStr()));
1630 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"bExplicitZeroMarginValRight"), BAD_CAST(OString::number(
int(
bExplicitZeroMarginValRight)).getStr()));
1631 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"bExplicitZeroMarginValLeft"), BAD_CAST(OString::number(
int(
bExplicitZeroMarginValLeft)).getStr()));
1632 (void)xmlTextWriterEndElement(pWriter);
1640 boost::property_tree::ptree aState;
1642 MapUnit eTargetUnit = MapUnit::MapInch;
1645 MapUnit::MapTwip, eTargetUnit,
nullptr);
1648 MapUnit::MapTwip, eTargetUnit,
nullptr);
1651 MapUnit::MapTwip, eTargetUnit,
nullptr);
1653 aState.put(
"left", sLeft);
1654 aState.put(
"right", sRight);
1655 aState.put(
"firstline", sFirstline);
1656 aState.put(
"unit",
"inch");
1658 aTree.push_back(std::make_pair(
"state", aState));
1676 const sal_uInt16 nId )
1690 nMemberId &= ~CONVERT_TWIPS;
1696 css::frame::status::UpperLowerMarginScale aUpperLowerMarginScale;
1699 aUpperLowerMarginScale.ScaleUpper =
static_cast<sal_Int16
>(
nPropUpper);
1700 aUpperLowerMarginScale.ScaleLower =
static_cast<sal_Int16
>(
nPropLower);
1701 rVal <<= aUpperLowerMarginScale;
1717 nMemberId &= ~CONVERT_TWIPS;
1724 css::frame::status::UpperLowerMarginScale aUpperLowerMarginScale;
1725 if ( !(rVal >>= aUpperLowerMarginScale ))
1730 if( aUpperLowerMarginScale.ScaleUpper > 1 )
1731 nPropUpper = aUpperLowerMarginScale.ScaleUpper;
1732 if( aUpperLowerMarginScale.ScaleLower > 1 )
1733 nPropUpper = aUpperLowerMarginScale.ScaleLower;
1738 if(!(rVal >>= nVal))
1743 if(!(rVal >>= nVal) || nVal < 0)
1748 if (!(rVal >>= bVal))
1756 if((rVal >>= nRel) && nRel > 1 )
1769 OSL_FAIL(
"unknown MemberId");
1778 assert(SfxPoolItem::operator==(rAttr));
1804 case SfxItemPresentation::Nameless:
1823 case SfxItemPresentation::Complete:
1825 rText =
EditResId(RID_SVXITEMS_ULSPACE_UPPER);
1870 (void)xmlTextWriterStartElement(pWriter, BAD_CAST(
"SvxULSpaceItem"));
1871 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"whichId"), BAD_CAST(OString::number(
Which()).getStr()));
1872 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"nUpper"), BAD_CAST(OString::number(
nUpper).getStr()));
1873 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"nLower"), BAD_CAST(OString::number(
nLower).getStr()));
1874 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"bContext"), BAD_CAST(OString::boolean(
bContext).getStr()));
1875 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"nPropUpper"), BAD_CAST(OString::number(
nPropUpper).getStr()));
1876 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"nPropLower"), BAD_CAST(OString::number(
nPropLower).getStr()));
1877 (void)xmlTextWriterEndElement(pWriter);
1884 boost::property_tree::ptree aState;
1886 MapUnit eTargetUnit = MapUnit::MapInch;
1889 MapUnit::MapTwip, eTargetUnit,
nullptr);
1892 MapUnit::MapTwip, eTargetUnit,
nullptr);
1894 aState.put(
"upper", sUpper);
1895 aState.put(
"lower", sLower);
1896 aState.put(
"unit",
"inch");
1898 aTree.push_back(std::make_pair(
"state", aState));
1919 pId = RID_SVXITEMS_PRINT_TRUE;
1940 pId = RID_SVXITEMS_OPAQUE_TRUE;
1948 assert(SfxPoolItem::operator==(rAttr));
1959 nMemberId &= ~CONVERT_TWIPS;
1967 OSL_FAIL(
"Wrong MemberId");
1978 nMemberId &= ~CONVERT_TWIPS;
1986 OSL_FAIL(
"Wrong MemberId");
2005 TranslateId pId = RID_SVXITEMS_PROT_CONTENT_FALSE;
2008 pId = RID_SVXITEMS_PROT_CONTENT_TRUE;
2010 pId = RID_SVXITEMS_PROT_SIZE_FALSE;
2013 pId = RID_SVXITEMS_PROT_SIZE_TRUE;
2015 pId = RID_SVXITEMS_PROT_POS_FALSE;
2018 pId = RID_SVXITEMS_PROT_POS_TRUE;
2026 (void)xmlTextWriterStartElement(pWriter, BAD_CAST(
"SvxProtectItem"));
2027 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"whichId"), BAD_CAST(OString::number(
Which()).getStr()));
2028 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"content"), BAD_CAST(OString::boolean(
bCntnt).getStr()));
2029 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"size"), BAD_CAST(OString::boolean(
bSize).getStr()));
2030 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"position"), BAD_CAST(OString::boolean(
bPos).getStr()));
2031 (void)xmlTextWriterEndElement(pWriter);
2036 const Color *pColor,
const sal_uInt16 nW,
2051 nMemberId &= ~CONVERT_TWIPS;
2053 table::ShadowFormat aShadow;
2054 table::ShadowLocation eSet = table::ShadowLocation_NONE;
2063 aShadow.Location = eSet;
2070 switch ( nMemberId )
2073 case MID_WIDTH: rVal <<= aShadow.ShadowWidth;
break;
2076 case 0: rVal <<= aShadow;
break;
2078 default: OSL_FAIL(
"Wrong MemberId!");
return false;
2087 nMemberId &= ~CONVERT_TWIPS;
2089 table::ShadowFormat aShadow;
2092 switch ( nMemberId )
2096 bRet = (rVal >>= aShadow.Location);
2100 bRet = (rVal >>= nVal);
2101 aShadow.Location =
static_cast<table::ShadowLocation
>(nVal);
2107 case MID_WIDTH: rVal >>= aShadow.ShadowWidth;
break;
2110 case 0: rVal >>= aShadow;
break;
2113 sal_Int32 nTransparence = 0;
2114 if ((rVal >>= nTransparence) && !o3tl::checked_multiply<sal_Int32>(nTransparence, 255, nTransparence))
2117 aColor.
SetAlpha(255 - rtl::math::round(
float(nTransparence) / 100));
2118 aShadow.Color = sal_Int32(aColor);
2122 default: OSL_FAIL(
"Wrong MemberId!");
return false;
2127 switch( aShadow.Location )
2148 assert(SfxPoolItem::operator==(rAttr));
2163 sal_uInt16 nSpace = 0;
2192 OSL_FAIL(
"wrong shadow" );
2199 RID_SVXITEMS_SHADOW_NONE,
2200 RID_SVXITEMS_SHADOW_TOPLEFT,
2201 RID_SVXITEMS_SHADOW_TOPRIGHT,
2202 RID_SVXITEMS_SHADOW_BOTTOMLEFT,
2203 RID_SVXITEMS_SHADOW_BOTTOMRIGHT
2216 case SfxItemPresentation::Nameless:
2222 pId = RID_SVXITEMS_TRANSPARENT_TRUE;
2230 case SfxItemPresentation::Complete:
2232 rText =
EditResId(RID_SVXITEMS_SHADOW_COMPLETE) +
2238 pId = RID_SVXITEMS_TRANSPARENT_TRUE;
2283 (void)xmlTextWriterStartElement(pWriter, BAD_CAST(
"SvxShadowItem"));
2284 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"whichId"), BAD_CAST(OString::number(
Which()).getStr()));
2285 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"aShadowColor"), BAD_CAST(
aShadowColor.
AsRGBHexString().toUtf8().getStr()));
2286 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"nWidth"), BAD_CAST(OString::number(
nWidth).getStr()));
2287 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"eLocation"), BAD_CAST(OString::number(
static_cast<int>(
eLocation)).getStr()));
2289 (void)xmlTextWriterEndElement(pWriter);
2296 , mpTopBorderLine(rCopy.mpTopBorderLine ? new SvxBorderLine(*rCopy.mpTopBorderLine) : nullptr)
2297 , mpBottomBorderLine(rCopy.mpBottomBorderLine ? new SvxBorderLine(*rCopy.mpBottomBorderLine) : nullptr)
2298 , mpLeftBorderLine(rCopy.mpLeftBorderLine ? new SvxBorderLine(*rCopy.mpLeftBorderLine) : nullptr)
2299 , mpRightBorderLine(rCopy.mpRightBorderLine ? new SvxBorderLine(*rCopy.mpRightBorderLine) : nullptr)
2300 , mnTopDistance(rCopy.mnTopDistance)
2301 , mnBottomDistance(rCopy.mnBottomDistance)
2302 , mnLeftDistance(rCopy.mnLeftDistance)
2303 , mnRightDistance(rCopy.mnRightDistance)
2304 , maTempComplexColors(rCopy.maTempComplexColors)
2305 , mbRemoveAdjCellBorder(rCopy.mbRemoveAdjCellBorder)
2322 (void)xmlTextWriterStartElement(pWriter, BAD_CAST(
"SvxBoxItem"));
2323 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"top-dist"),
2325 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"bottom-dist"),
2327 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"left-dist"),
2329 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"right-dist"),
2332 (void)xmlTextWriterEndElement(pWriter);
2337 boost::property_tree::ptree aTree;
2339 boost::property_tree::ptree aState;
2345 aTree.push_back(std::make_pair(
"state", aState));
2346 aTree.put(
"commandName",
".uno:BorderOuter");
2352static bool CompareBorderLine(
const std::unique_ptr<SvxBorderLine> & pBrd1,
const SvxBorderLine* pBrd2)
2354 if( pBrd1.get() == pBrd2 )
2356 if( pBrd1 ==
nullptr || pBrd2 ==
nullptr)
2358 return *pBrd1 == *pBrd2;
2364 assert(SfxPoolItem::operator==(rAttr));
2383 table::BorderLine2 aLine;
2386 aLine.Color = sal_Int32(pLine->GetColor());
2387 aLine.InnerLineWidth = sal_uInt16( bConvert ?
convertTwipToMm100(pLine->GetInWidth() ): pLine->GetInWidth() );
2388 aLine.OuterLineWidth = sal_uInt16( bConvert ?
convertTwipToMm100(pLine->GetOutWidth()): pLine->GetOutWidth() );
2389 aLine.LineDistance = sal_uInt16( bConvert ?
convertTwipToMm100(pLine->GetDistance()): pLine->GetDistance() );
2390 aLine.LineStyle = sal_Int16(pLine->GetBorderLineStyle());
2391 aLine.LineWidth = sal_uInt32( bConvert ?
convertTwipToMm100( pLine->GetWidth( ) ) : pLine->GetWidth( ) );
2395 aLine.Color = aLine.InnerLineWidth = aLine.OuterLineWidth = aLine.LineDistance = 0;
2396 aLine.LineStyle = table::BorderLineStyle::NONE;
2404 table::BorderLine2 aRetLine;
2405 sal_Int16 nDist = 0;
2406 bool bDistMember =
false;
2407 nMemberId &= ~CONVERT_TWIPS;
2413 uno::Sequence< uno::Any >
aSeq{
2530lcl_lineToSvxLine(
const table::BorderLine& rLine, SvxBorderLine& rSvxLine,
bool bConvert,
bool bGuessWidth)
2532 rSvxLine.SetColor(
Color(ColorTransparency, rLine.Color));
2535 rSvxLine.GuessLinesWidths( rSvxLine.GetBorderLineStyle(),
2541 bool bRet = !rSvxLine.isEmpty();
2550 return lcl_lineToSvxLine(rLine, rSvxLine, bConvert,
true);
2561 rSvxLine.SetBorderLineStyle( nStyle );
2563 bool bGuessWidth =
true;
2564 if ( rLine.LineWidth )
2570 (rLine.InnerLineWidth > 0) && (rLine.OuterLineWidth > 0);
2573 return lcl_lineToSvxLine(rLine, rSvxLine, bConvert, bGuessWidth);
2581lcl_extractBorderLine(
const uno::Any& rAny, table::BorderLine2& rLine)
2586 table::BorderLine aBorderLine;
2587 if (rAny >>= aBorderLine)
2589 rLine.Color = aBorderLine.Color;
2590 rLine.InnerLineWidth = aBorderLine.InnerLineWidth;
2591 rLine.OuterLineWidth = aBorderLine.OuterLineWidth;
2592 rLine.LineDistance = aBorderLine.LineDistance;
2593 rLine.LineStyle = table::BorderLineStyle::SOLID;
2600template<
typename Item,
typename Line>
2602lcl_setLine(
const uno::Any& rAny, Item& rItem,
Line nLine,
const bool bConvert)
2605 table::BorderLine2 aBorderLine;
2606 if (lcl_extractBorderLine(rAny, aBorderLine))
2608 SvxBorderLine aLine;
2610 rItem.SetLine( bSet ? &aLine :
nullptr, nLine);
2622 bool bDistMember =
false;
2623 nMemberId &= ~CONVERT_TWIPS;
2628 uno::Sequence< uno::Any >
aSeq;
2629 if (( rVal >>=
aSeq ) && (
aSeq.getLength() == 9 ))
2633 for (
size_t n(0);
n != std::size(aBorders); ++
n)
2635 if (!lcl_setLine(
aSeq[
n], *
this, aBorders[
n], bConvert))
2642 for ( sal_Int32
n = 4;
n < 9;
n++ )
2644 sal_Int32 nDist = 0;
2645 if (
aSeq[
n] >>= nDist )
2693 drawing::LineStyle eDrawingStyle;
2694 rVal >>= eDrawingStyle;
2696 switch ( eDrawingStyle )
2699 case drawing::LineStyle_NONE:
2701 case drawing::LineStyle_SOLID:
2704 case drawing::LineStyle_DASH:
2742 css::uno::Reference<css::util::XComplexColor> xComplexColor;
2743 if (!(rVal >>= xComplexColor))
2746 if (xComplexColor.is())
2757 css::uno::Reference<css::util::XComplexColor> xComplexColor;
2758 if (!(rVal >>= xComplexColor))
2761 if (xComplexColor.is())
2772 css::uno::Reference<css::util::XComplexColor> xComplexColor;
2773 if (!(rVal >>= xComplexColor))
2776 if (xComplexColor.is())
2787 css::uno::Reference<css::util::XComplexColor> xComplexColor;
2788 if (!(rVal >>= xComplexColor))
2791 if (xComplexColor.is())
2800 sal_Int32 nDist = 0;
2801 if(!(rVal >>= nDist))
2815 SvxBorderLine aLine;
2819 table::BorderLine2 aBorderLine;
2820 if( lcl_extractBorderLine(rVal, aBorderLine) )
2824 else if (rVal.getValueTypeClass() == uno::TypeClass_SEQUENCE )
2827 uno::Reference < script::XTypeConverter >
xConverter
2828 ( script::Converter::create(::comphelper::getProcessComponentContext()) );
2829 uno::Sequence < uno::Any >
aSeq;
2832 catch (
const uno::Exception&) {}
2835 if (
aSeq.getLength() >= 4 &&
aSeq.getLength() <= 6)
2838 if (
aSeq[0] >>= nVal )
2839 aBorderLine.Color = nVal;
2840 if (
aSeq[1] >>= nVal )
2841 aBorderLine.InnerLineWidth =
static_cast<sal_Int16
>(nVal);
2842 if (
aSeq[2] >>= nVal )
2843 aBorderLine.OuterLineWidth =
static_cast<sal_Int16
>(nVal);
2844 if (
aSeq[3] >>= nVal )
2845 aBorderLine.LineDistance =
static_cast<sal_Int16
>(nVal);
2846 if (
aSeq.getLength() >= 5)
2848 if (
aSeq[4] >>= nVal)
2850 aBorderLine.LineStyle = nVal;
2852 if (
aSeq.getLength() >= 6)
2854 if (
aSeq[5] >>= nVal)
2856 aBorderLine.LineWidth = nVal;
2868 SetLine(bSet ? &aLine :
nullptr, nLine);
2891 case SfxItemPresentation::Nameless:
2897 rText =
mpTopBorderLine->GetValueString( eCoreUnit, ePresUnit, &rIntl ) + cpDelimTmp;
2906 rText +=
mpBottomBorderLine->GetValueString( eCoreUnit, ePresUnit, &rIntl ) + cpDelimTmp;
2910 rText +=
mpLeftBorderLine->GetValueString( eCoreUnit, ePresUnit, &rIntl ) + cpDelimTmp;
2914 rText +=
mpRightBorderLine->GetValueString( eCoreUnit, ePresUnit, &rIntl ) + cpDelimTmp;
2922 rText += cpDelimTmp +
2931 case SfxItemPresentation::Complete:
2935 rText =
EditResId(RID_SVXITEMS_BORDER_NONE) + cpDelimTmp;
2939 rText =
EditResId(RID_SVXITEMS_BORDER_COMPLETE);
2945 rText +=
mpTopBorderLine->GetValueString( eCoreUnit, ePresUnit, &rIntl,
true ) + cpDelimTmp;
2951 rText +=
EditResId(RID_SVXITEMS_BORDER_TOP) +
2952 mpTopBorderLine->GetValueString( eCoreUnit, ePresUnit, &rIntl,
true ) +
2957 rText +=
EditResId(RID_SVXITEMS_BORDER_BOTTOM) +
2963 rText +=
EditResId(RID_SVXITEMS_BORDER_LEFT) +
2969 rText +=
EditResId(RID_SVXITEMS_BORDER_RIGHT) +
2976 rText +=
EditResId(RID_SVXITEMS_BORDER_DISTANCE);
2986 rText +=
EditResId(RID_SVXITEMS_BORDER_TOP) +
3036 const SvxBorderLine *pRet =
nullptr;
3053 OSL_FAIL(
"wrong line" );
3063 std::unique_ptr<SvxBorderLine> pTmp( pNew ?
new SvxBorderLine( *pNew ) :
nullptr );
3080 OSL_FAIL(
"wrong line" );
3102 sal_Int16 nDist = 0;
3118 OSL_FAIL(
"wrong line" );
3121 if (!bAllowNegative && nDist < 0)
3146 OSL_FAIL(
"wrong line" );
3152 SvxBorderLine* pTmp =
nullptr;
3153 sal_uInt16 nWidth = 0;
3169 OSL_FAIL(
"wrong line" );
3173 nWidth = pTmp->GetScaledWidth();
3180 SvxBorderLine* pTmp =
nullptr;
3181 sal_Int16 nDist = 0;
3201 OSL_FAIL(
"wrong line" );
3206 nDist = nDist + pTmp->GetScaledWidth();
3208 else if( !bEvenIfNoLine )
3211 if (!bAllowNegative && nDist < 0)
3224 auto nIndex = size_t(eLine);
3261 , mbMinimumDistance(false)
3269 , mpHorizontalLine(rCopy.mpHorizontalLine ? new SvxBorderLine(*rCopy.mpHorizontalLine) : nullptr)
3270 , mpVerticalLine(rCopy.mpVerticalLine ? new SvxBorderLine(*rCopy.mpVerticalLine) : nullptr)
3271 , mbEnableHorizontalLine(rCopy.mbEnableHorizontalLine)
3272 , mbEnableVerticalLine(rCopy.mbEnableVerticalLine)
3273 , mbDistance(rCopy.mbDistance)
3274 , mbMinimumDistance (rCopy.mbMinimumDistance)
3275 , mnValidFlags(rCopy.mnValidFlags)
3276 , mnDefaultMinimumDistance(rCopy.mnDefaultMinimumDistance)
3287 boost::property_tree::ptree aTree;
3289 boost::property_tree::ptree aState;
3293 aTree.push_back(std::make_pair(
"state", aState));
3294 aTree.put(
"commandName",
".uno:BorderInner");
3302 assert(SfxPoolItem::operator==(rAttr));
3319 std::unique_ptr<SvxBorderLine> pCopy(pNew ?
new SvxBorderLine(*pNew) :
nullptr);
3331 OSL_FAIL(
"wrong line" );
3377 table::BorderLine2 aRetLine;
3379 bool bIntMember =
false;
3380 nMemberId &= ~CONVERT_TWIPS;
3392 css::uno::Sequence< css::uno::Any >
aSeq{
3427 default: OSL_FAIL(
"Wrong MemberId!");
return false;
3440 nMemberId &= ~CONVERT_TWIPS;
3446 css::uno::Sequence< css::uno::Any >
aSeq;
3447 if (( rVal >>=
aSeq ) && (
aSeq.getLength() == 5 ))
3455 sal_Int16 nFlags( 0 );
3456 sal_Int32 nVal( 0 );
3457 if (
aSeq[2] >>= nFlags )
3459 SetTable ( ( nFlags & 0x01 ) != 0 );
3460 SetDist ( ( nFlags & 0x02 ) != 0 );
3465 if (
aSeq[3] >>= nFlags )
3469 if ((
aSeq[4] >>= nVal ) && ( nVal >= 0 ))
3485 table::BorderLine2 aBorderLine;
3486 if( lcl_extractBorderLine(rVal, aBorderLine) )
3490 else if (rVal.getValueTypeClass() == uno::TypeClass_SEQUENCE )
3493 uno::Reference < script::XTypeConverter >
xConverter( script::Converter::create(::comphelper::getProcessComponentContext()) );
3495 uno::Sequence < uno::Any >
aSeq;
3497 catch (
const uno::Exception&) {}
3499 if ((aNew >>=
aSeq) &&
3500 aSeq.getLength() >= 4 &&
aSeq.getLength() <= 6)
3503 if (
aSeq[0] >>= nVal )
3504 aBorderLine.Color = nVal;
3505 if (
aSeq[1] >>= nVal )
3506 aBorderLine.InnerLineWidth =
static_cast<sal_Int16
>(nVal);
3507 if (
aSeq[2] >>= nVal )
3508 aBorderLine.OuterLineWidth =
static_cast<sal_Int16
>(nVal);
3509 if (
aSeq[3] >>= nVal )
3510 aBorderLine.LineDistance =
static_cast<sal_Int16
>(nVal);
3511 if (
aSeq.getLength() >= 5)
3513 if (
aSeq[4] >>= nVal)
3515 aBorderLine.LineStyle = nVal;
3517 if (
aSeq.getLength() >= 6)
3519 if (
aSeq[5] >>= nVal)
3521 aBorderLine.LineWidth = nVal;
3532 css::uno::Sequence < sal_Int16 >
aSeq;
3534 if (
aSeq.getLength() >= 4 &&
aSeq.getLength() <= 6)
3536 aBorderLine.Color =
aSeq[0];
3537 aBorderLine.InnerLineWidth =
aSeq[1];
3538 aBorderLine.OuterLineWidth =
aSeq[2];
3539 aBorderLine.LineDistance =
aSeq[3];
3540 if (
aSeq.getLength() >= 5)
3542 aBorderLine.LineStyle =
aSeq[4];
3543 if (
aSeq.getLength() >= 6)
3545 aBorderLine.LineWidth =
aSeq[5];
3555 SvxBorderLine aLine;
3563 sal_Int16 nFlags = sal_Int16();
3564 bRet = (rVal >>= nFlags);
3567 SetTable ( ( nFlags & 0x01 ) != 0 );
3568 SetDist ( ( nFlags & 0x02 ) != 0 );
3576 sal_Int16 nFlags = sal_Int16();
3577 bRet = (rVal >>= nFlags);
3585 bRet = (rVal >>= nVal);
3586 if ( bRet && nVal>=0 )
3594 default: OSL_FAIL(
"Wrong MemberId!");
return false;
3605 sal_Int32 nBorderWidth)
3609 sal_Int32 nNewMargin = nMargin;
3610 sal_Int32 nNewBorderDistance = nBorderDistance;
3614 nNewMargin = nBorderDistance;
3615 nNewBorderDistance = nMargin - nBorderDistance -
nBorderWidth;
3628 nNewBorderDistance = std::max<sal_Int32>(nMargin -
nBorderWidth, 0);
3630 else if (nNewBorderDistance < 0)
3632 nNewMargin = nMargin;
3635 nMargin = nNewMargin;
3636 nBorderDistance = nNewBorderDistance;
3674 const sal_Int32 nT2BT = pLnT ? nT : 0;
3675 const sal_Int32 nT2BL = pLnL ? nL : 0;
3676 const sal_Int32 nT2BB = pLnB ? nB : 0;
3677 const sal_Int32 nT2BR = pLnR ? nR : 0;
3680 const sal_Int32 nE2BT = pLnT ? std::max<sal_Int32>(rMargins.
nTop - nT - nWidthT, 0) : 0;
3681 const sal_Int32 nE2BL = pLnL ? std::max<sal_Int32>(rMargins.
nLeft - nL - nWidthL, 0) : 0;
3682 const sal_Int32 nE2BB = pLnB ? std::max<sal_Int32>(rMargins.
nBottom - nB - nWidthB, 0) : 0;
3683 const sal_Int32 nE2BR = pLnR ? std::max<sal_Int32>(rMargins.
nRight - nR - nWidthR, 0) : 0;
3685 const sal_Int32 n32pt = 32 * 20;
3687 if (nT2BT >= 0 && nT2BT < n32pt && nT2BL >= 0 && nT2BL < n32pt && nT2BB >= 0 && nT2BB < n32pt && nT2BR >= 0 && nT2BR < n32pt)
3694 if (nE2BT < n32pt && nE2BL < n32pt && nE2BB < n32pt && nE2BR < n32pt)
3702 (nT2BT + nT2BL + nT2BB + nT2BR) > (nE2BT + nE2BL + nE2BB + nE2BR);
3708 rDistances.
nTop = sal::static_int_cast<sal_uInt16>(nE2BT);
3709 rDistances.
nLeft = sal::static_int_cast<sal_uInt16>(nE2BL);
3710 rDistances.
nBottom = sal::static_int_cast<sal_uInt16>(nE2BB);
3711 rDistances.
nRight = sal::static_int_cast<sal_uInt16>(nE2BR);
3715 rDistances.
nTop = sal::static_int_cast<sal_uInt16>(nT2BT);
3716 rDistances.
nLeft = sal::static_int_cast<sal_uInt16>(nT2BL);
3717 rDistances.
nBottom = sal::static_int_cast<sal_uInt16>(nT2BB);
3718 rDistances.
nRight = sal::static_int_cast<sal_uInt16>(nT2BR);
3728 assert(SfxPoolItem::operator==(rAttr));
3750 RID_SVXITEMS_BREAK_NONE,
3751 RID_SVXITEMS_BREAK_COLUMN_BEFORE,
3752 RID_SVXITEMS_BREAK_COLUMN_AFTER,
3753 RID_SVXITEMS_BREAK_COLUMN_BOTH,
3754 RID_SVXITEMS_BREAK_PAGE_BEFORE,
3755 RID_SVXITEMS_BREAK_PAGE_AFTER,
3756 RID_SVXITEMS_BREAK_PAGE_BOTH
3758 static_assert(std::size(RID_SVXITEMS_BREAK) == size_t(
SvxBreak::End),
"unexpected size");
3765 style::BreakType eBreak = style::BreakType_NONE;
3782 style::BreakType nBreak;
3784 if(!(rVal >>= nBreak))
3790 nBreak =
static_cast<style::BreakType
>(
nValue);
3835 pId = RID_SVXITEMS_FMTKEEP_TRUE;
3842 (void)xmlTextWriterStartElement(pWriter, BAD_CAST(
"SvxFormatKeepItem"));
3846 (void)xmlTextWriterEndElement(pWriter);
3857 pLine(rCpy.pLine ? new SvxBorderLine( *rCpy.pLine ) : nullptr)
3869 assert(SfxPoolItem::operator==(rAttr));
3882 nMemId &= ~CONVERT_TWIPS;
3897 OSL_FAIL(
"Wrong MemberId" );
3909 nMemId &= ~CONVERT_TWIPS;
3913 table::BorderLine2 aLine;
3914 if ( lcl_extractBorderLine(rVal, aLine) )
3917 pLine.reset(
new SvxBorderLine );
3924 else if ( rVal >>= nVal )
3927 pLine.reset(
new SvxBorderLine );
3936 OSL_FAIL(
"Wrong MemberId" );
3958 rText =
pLine->GetValueString( eCoreUnit, ePresUnit, &rIntl,
3959 (SfxItemPresentation::Complete == ePres) );
3966 if (
pLine )
pLine->ScaleMetrics( nMult, nDiv );
3978 pLine.reset( pNew ?
new SvxBorderLine( *pNew ) :
nullptr );
3985 , nShadingValue(ShadingPattern::
CLEAR)
3986 , nGraphicTransparency(0)
3996 , nShadingValue(ShadingPattern::
CLEAR)
3997 , nGraphicTransparency(0)
4006 , maComplexColor(rComplexColor)
4008 , nShadingValue(ShadingPattern::
CLEAR)
4009 , nGraphicTransparency(0)
4019 , nShadingValue(ShadingPattern::
CLEAR)
4021 , nGraphicTransparency(0)
4032 , nShadingValue(ShadingPattern::
CLEAR)
4034 , nGraphicTransparency(0)
4046 , nShadingValue(ShadingPattern::
CLEAR)
4047 , nGraphicTransparency(0)
4048 , maStrLink(
std::move(aLink))
4049 , maStrFilter(
std::move(aFilter))
4058 , aColor(rItem.aColor)
4059 , maComplexColor(rItem.maComplexColor)
4060 , aFilterColor(rItem.aFilterColor)
4061 , nShadingValue(rItem.nShadingValue)
4062 , xGraphicObject(rItem.xGraphicObject ? new
GraphicObject(*rItem.xGraphicObject) : nullptr)
4063 , nGraphicTransparency(rItem.nGraphicTransparency)
4064 , maStrLink(rItem.maStrLink)
4065 , maStrFilter(rItem.maStrFilter)
4066 , eGraphicPos(rItem.eGraphicPos)
4067 , bLoadAgain(rItem.bLoadAgain)
4073 , aColor(
std::move(rItem.aColor))
4074 , maComplexColor(
std::move(rItem.maComplexColor))
4075 , aFilterColor(
std::move(rItem.aFilterColor))
4076 , nShadingValue(
std::move(rItem.nShadingValue))
4077 , xGraphicObject(
std::move(rItem.xGraphicObject))
4078 , nGraphicTransparency(
std::move(rItem.nGraphicTransparency))
4079 , maStrLink(
std::move(rItem.maStrLink))
4080 , maStrFilter(
std::move(rItem.maStrFilter))
4081 , eGraphicPos(
std::move(rItem.eGraphicPos))
4082 , bLoadAgain(
std::move(rItem.bLoadAgain))
4097 else if (!
GetColor().IsFullyTransparent())
4110 return sal_Int8(nPercent ? (50 + 0xfe * nPercent) / 100 : 0);
4116 return static_cast<sal_Int8>((nTrans * 100 + 127) / 254);
4122 nMemberId &= ~CONVERT_TWIPS;
4138 rVal <<= xComplexColor;
4144 rVal <<= static_cast<style::GraphicLocation>(
static_cast<sal_Int16
>(
eGraphicPos));
4154 uno::Reference<graphic::XGraphic> xGraphic;
4191 nMemberId &= ~CONVERT_TWIPS;
4198 if ( !( rVal >>= aNewCol ) )
4209 sal_Int32 nTrans = 0;
4210 if ( !( rVal >>= nTrans ) || nTrans < 0 || nTrans > 100 )
4218 css::uno::Reference<css::util::XComplexColor> xComplexColor;
4219 if (!(rVal >>= xComplexColor))
4222 if (xComplexColor.is())
4229 style::GraphicLocation eLocation;
4230 if ( !( rVal>>=eLocation ) )
4233 if ( !( rVal >>=
nValue ) )
4235 eLocation =
static_cast<style::GraphicLocation
>(
nValue);
4252 OUString
aURL = rVal.get<OUString>();
4257 auto xGraphic = rVal.get<uno::Reference<graphic::XGraphic>>();
4265 std::unique_ptr<GraphicObject> xOldGrfObj(std::move(
xGraphicObject));
4274 else if (aGraphic.
IsNone())
4296 if(nTmp >= 0 && nTmp <= 100)
4308 if (!(rVal >>= nVal))
4334 pId = RID_SVXITEMS_TRANSPARENT_TRUE;
4339 rText =
EditResId(RID_SVXITEMS_GRAPHIC);
4347 assert(SfxPoolItem::operator==(rAttr));
4403 bool bGraphicLoaded =
false;
4413 bGraphicLoaded =
true;
4423 if( INetProtocol::Data == aGraphicURL.
GetProtocol() )
4425 std::unique_ptr<SvMemoryStream>
const xMemStream(aGraphicURL.
getData());
4430 bGraphicLoaded =
true;
4441 if(bGraphicLoaded && GraphicType::NONE != aGraphic.
GetType())
4468 return( pGrafObj ? &( pGrafObj->
GetGraphic() ) :
nullptr );
4506 OSL_FAIL(
"SetGraphic() on linked graphic! :-/" );
4526 OSL_FAIL(
"SetGraphic() on linked graphic! :-/" );
4532 if ( rNew.isEmpty() )
4560 (void)xmlTextWriterStartElement(pWriter, BAD_CAST(
"SvxBrushItem"));
4561 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"whichId"), BAD_CAST(OString::number(
Which()).getStr()));
4562 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"color"), BAD_CAST(
aColor.
AsRGBHexString().toUtf8().getStr()));
4563 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"filtercolor"), BAD_CAST(
aFilterColor.
AsRGBHexString().toUtf8().getStr()));
4564 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"shadingValue"), BAD_CAST(OString::number(
nShadingValue).getStr()));
4565 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"link"), BAD_CAST(
maStrLink.toUtf8().getStr()));
4566 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"filter"), BAD_CAST(
maStrFilter.toUtf8().getStr()));
4567 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"graphicPos"), BAD_CAST(OString::number(
eGraphicPos).getStr()));
4568 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"loadAgain"), BAD_CAST(OString::boolean(
bLoadAgain).getStr()));
4569 (void)xmlTextWriterEndElement(pWriter);
4574 sal_uInt16 _nWhich )
4593 RID_SVXITEMS_FRMDIR_HORI_LEFT_TOP,
4594 RID_SVXITEMS_FRMDIR_HORI_RIGHT_TOP,
4595 RID_SVXITEMS_FRMDIR_VERT_TOP_RIGHT,
4596 RID_SVXITEMS_FRMDIR_VERT_TOP_LEFT,
4597 RID_SVXITEMS_FRMDIR_ENVIRONMENT,
4598 RID_SVXITEMS_FRMDIR_VERT_BOT_LEFT,
4599 RID_SVXITEMS_FRMDIR_VERT_TOP_RIGHT90
4601 return RID_SVXITEMS_FRMDIR[
nIndex];
4617 sal_Int16 nVal = sal_Int16();
4618 bool bRet = ( rVal >>= nVal );
4624 case text::WritingMode2::LR_TB:
4627 case text::WritingMode2::RL_TB:
4630 case text::WritingMode2::TB_RL:
4633 case text::WritingMode2::TB_LR:
4636 case text::WritingMode2::BT_LR:
4639 case text::WritingMode2::TB_RL90:
4642 case text::WritingMode2::PAGE:
4664 nVal = text::WritingMode2::LR_TB;
4667 nVal = text::WritingMode2::RL_TB;
4670 nVal = text::WritingMode2::TB_RL;
4673 nVal = text::WritingMode2::TB_LR;
4676 nVal = text::WritingMode2::BT_LR;
4679 nVal = text::WritingMode2::TB_RL90;
4682 nVal = text::WritingMode2::PAGE;
4685 OSL_FAIL(
"Unknown SvxFrameDirection value!");
4700 (void)xmlTextWriterStartElement(pWriter, BAD_CAST(
"SvxFrameDirectionItem"));
4701 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST(
"m_nWhich"),
4702 BAD_CAST(OString::number(
Which()).getStr()));
4703 (void)xmlTextWriterWriteAttribute(
4704 pWriter, BAD_CAST(
"m_nValue"),
4705 BAD_CAST(OString::number(
static_cast<sal_Int16
>(
GetValue())).getStr()));
4706 (void)xmlTextWriterEndElement(pWriter);
css::chart::ChartAxisLabelPosition ePos
constexpr auto convertTwipToMm100(N n)
@ DASHED
Dashed border line.
@ DOUBLE_THIN
Double border line consisting of two fixed thin lines separated by a variable gap.
@ BORDER_LINE_STYLE_MAX
Maximum valid border line style value.
@ SOLID
Solid border line.
@ DOUBLE
Double border line.
static const AllSettings & GetSettings()
static tools::Long Scale(tools::Long nVal, tools::Long nMult, tools::Long nDiv)
sal_uInt8 GetValue() const
Color GetRGBColor() const
OUString AsRGBHexString() const
sal_uInt8 GetAlpha() const
bool IsTransparent() const
void SetAlpha(sal_uInt8 nAlpha)
void SetAlpha(sal_uInt8 cAlpha)
static GraphicFilter & GetGraphicFilter()
const Graphic & GetGraphic() const
css::uno::Reference< css::graphic::XGraphic > GetXGraphic() const
GraphicType GetType() const
std::unique_ptr< SvMemoryStream > getData() const
INetProtocol GetProtocol() const
virtual void dumpAsXml(xmlTextWriterPtr pWriter) const override
virtual sal_uInt16 GetEnumValue() const override
void SetValue(EnumT nTheValue)
virtual void dumpAsXml(xmlTextWriterPtr pWriter) const
virtual boost::property_tree::ptree dumpAsJSON() const
constexpr tools::Long Height() const
void setWidth(tools::Long nWidth)
void setHeight(tools::Long nHeight)
constexpr tools::Long Width() const
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &) const override
virtual SvxBoxInfoItem * Clone(SfxItemPool *pPool=nullptr) const override
SvxBoxInfoItemValidFlags mnValidFlags
bool mbEnableVerticalLine
true = Enable inner horizontal line.
bool mbDistance
true = Enable inner vertical line.
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
std::unique_ptr< editeng::SvxBorderLine > mpVerticalLine
virtual ~SvxBoxInfoItem() override
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
virtual void ScaleMetrics(tools::Long nMult, tools::Long nDiv) override
sal_uInt16 mnDefaultMinimumDistance
bool mbEnableHorizontalLine
static SfxPoolItem * CreateDefault()
void SetMinDist(bool bNew)
void SetDefDist(sal_uInt16 nNew)
std::unique_ptr< editeng::SvxBorderLine > mpHorizontalLine
const editeng::SvxBorderLine * GetHori() const
sal_uInt16 GetDefDist() const
virtual bool operator==(const SfxPoolItem &) const override
const editeng::SvxBorderLine * GetVert() const
virtual bool HasMetrics() const override
virtual boost::property_tree::ptree dumpAsJSON() const override
SvxBoxInfoItem(const sal_uInt16 nId)
void SetLine(const editeng::SvxBorderLine *pNew, SvxBoxInfoItemLine nLine)
static bool LineToSvxLine(const css::table::BorderLine &rLine, editeng::SvxBorderLine &rSvxLine, bool bConvert)
const editeng::SvxBorderLine * GetTop() const
void tryMigrateComplexColor(SvxBoxItemLine eLine)
virtual bool HasMetrics() const override
sal_Int16 CalcLineSpace(SvxBoxItemLine nLine, bool bEvenIfNoLine=false, bool bAllowNegative=false) const
std::unique_ptr< editeng::SvxBorderLine > mpBottomBorderLine
virtual SvxBoxItem * Clone(SfxItemPool *pPool=nullptr) const override
const editeng::SvxBorderLine * GetLine(SvxBoxItemLine nLine) const
sal_uInt16 GetSmallestDistance() const
const editeng::SvxBorderLine * GetRight() const
void dumpAsXml(xmlTextWriterPtr pWriter) const override
std::unique_ptr< editeng::SvxBorderLine > mpTopBorderLine
virtual void ScaleMetrics(tools::Long nMult, tools::Long nDiv) override
static SfxPoolItem * CreateDefault()
void SetLine(const editeng::SvxBorderLine *pNew, SvxBoxItemLine nLine)
static css::table::BorderLine2 SvxLineToLine(const editeng::SvxBorderLine *pLine, bool bConvert)
sal_Int16 mnRightDistance
virtual bool operator==(const SfxPoolItem &) const override
bool mbRemoveAdjCellBorder
SvxBoxItem(const sal_uInt16 nId)
const editeng::SvxBorderLine * GetLeft() const
std::array< model::ComplexColor, 4 > maTempComplexColors
virtual boost::property_tree::ptree dumpAsJSON() const override
sal_uInt16 CalcLineWidth(SvxBoxItemLine nLine) const
std::unique_ptr< editeng::SvxBorderLine > mpLeftBorderLine
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &) const override
sal_Int16 GetDistance(SvxBoxItemLine nLine, bool bAllowNegative=false) const
void SetDistance(sal_Int16 nNew, SvxBoxItemLine nLine)
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
std::unique_ptr< editeng::SvxBorderLine > mpRightBorderLine
sal_Int16 mnBottomDistance
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
virtual ~SvxBoxItem() override
const editeng::SvxBorderLine * GetBottom() const
bool HasBorder(bool bTreatPaddingAsBorder) const
void SetAllDistances(sal_Int16 nNew)
SvxBrushItem(sal_uInt16 nWhich)
void SetGraphicPos(SvxGraphicPosition eNew)
const GraphicObject * GetGraphicObject(OUString const &referer=OUString()) const
model::ComplexColor maComplexColor
void setGraphicTransparency(sal_Int8 nNew)
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
const Color & GetColor() const
static SfxPoolItem * CreateDefault()
void SetGraphicLink(const OUString &rNew)
const Graphic * GetGraphic(OUString const &referer=OUString()) const
void ApplyGraphicTransparency_Impl()
virtual ~SvxBrushItem() override
SvxGraphicPosition eGraphicPos
virtual bool operator==(const SfxPoolItem &) const override
static sal_Int8 TransparencyToPercent(sal_Int32 nTrans)
void SetGraphicObject(const GraphicObject &rNewObj)
std::unique_ptr< GraphicObject > xGraphicObject
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
void dumpAsXml(xmlTextWriterPtr pWriter) const override
SvxGraphicPosition GetGraphicPos() const
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &) const override
sal_Int8 nGraphicTransparency
void SetGraphic(const Graphic &rNew)
virtual SvxBrushItem * Clone(SfxItemPool *pPool=nullptr) const override
void SetGraphicFilter(const OUString &rNew)
first line indent that may be applied to paragraphs
virtual SvxFirstLineIndentItem * Clone(SfxItemPool *pPool=nullptr) const override
virtual boost::property_tree::ptree dumpAsJSON() const override
virtual bool operator==(const SfxPoolItem &) const override
short m_nFirstLineOffset
First-line indent always relative to GetTextLeft()
bool m_bAutoFirst
Automatic calculation of the first line indent.
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
void SetPropTextFirstLineOffset(const sal_uInt16 nProp)
void SetTextFirstLineOffset(const short nF, const sal_uInt16 nProp=100)
void dumpAsXml(xmlTextWriterPtr pWriter) const override
sal_uInt16 GetPropTextFirstLineOffset() const
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
void SetAutoFirst(const bool bNew)
short GetTextFirstLineOffset() const
sal_uInt16 m_nPropFirstLineOffset
virtual void ScaleMetrics(tools::Long nMult, tools::Long nDiv) override
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &) const override
SvxFirstLineIndentItem(const sal_uInt16 nId)
virtual bool HasMetrics() const override
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
virtual ~SvxFrameDirectionItem() override
void dumpAsXml(xmlTextWriterPtr pWriter) const override
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
SvxFrameDirectionItem(SvxFrameDirection nValue, sal_uInt16 nWhich)
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &) const override
virtual SvxFrameDirectionItem * Clone(SfxItemPool *pPool=nullptr) const override
gutter margin - for page styles
virtual void ScaleMetrics(tools::Long nMult, tools::Long nDiv) override
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &) const override
virtual boost::property_tree::ptree dumpAsJSON() const override
void SetGutterMargin(const tools::Long nGutterMargin)
virtual bool operator==(const SfxPoolItem &) const override
SvxGutterLeftMarginItem(const sal_uInt16 nId)
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
tools::Long GetGutterMargin() const
virtual bool HasMetrics() const override
tools::Long m_nGutterMargin
The amount of extra space added to the left margin.
void dumpAsXml(xmlTextWriterPtr pWriter) const override
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
virtual SvxGutterLeftMarginItem * Clone(SfxItemPool *pPool=nullptr) const override
gutter margin - for page styles
virtual SvxGutterRightMarginItem * Clone(SfxItemPool *pPool=nullptr) const override
virtual bool HasMetrics() const override
void dumpAsXml(xmlTextWriterPtr pWriter) const override
virtual bool operator==(const SfxPoolItem &) const override
SvxGutterRightMarginItem(const sal_uInt16 nId)
tools::Long m_nRightGutterMargin
The amount of extra space added to the right margin, on mirrored pages.
virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString &rText, const IntlWrapper &) const override
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
tools::Long GetRightGutterMargin() const
virtual boost::property_tree::ptree dumpAsJSON() const override
virtual void ScaleMetrics(tools::Long nMult, tools::Long nDiv) override
void SetGutterMargin(const tools::Long nGutterMargin)
void SetPropTextFirstLineOffset(const sal_uInt16 nProp)
tools::Long GetRightGutterMargin() const
bool bExplicitZeroMarginValLeft
short nFirstLineOffset
First-line indent always relative to GetTextLeft()
void SetExplicitZeroMarginValRight(const bool eR)
sal_uInt16 GetPropLeft() const
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const override
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
sal_uInt16 GetPropRight() const
bool IsExplicitZeroMarginValRight() const
sal_uInt16 nPropLeftMargin
bool IsExplicitZeroMarginValLeft() const
sal_uInt16 nPropFirstLineOffset
short GetTextFirstLineOffset() const