64#include <vcl/font.hxx>
67#include <editeng/editids.hrc>
80 std::optional<sal_uInt16> pNormal;
81 std::optional<sal_uInt16> pCJK;
82 std::optional<sal_uInt16> pCTL;
83 switch( rItem.
Which() )
85 case SID_ATTR_CHAR_FONT:
91 case SID_ATTR_CHAR_FONTHEIGHT:
92 pNormal =
aPlainMap[SID_ATTR_CHAR_FONTHEIGHT];
93 pCJK =
aPlainMap[SID_ATTR_CHAR_CJK_FONTHEIGHT];
94 pCTL =
aPlainMap[SID_ATTR_CHAR_CTL_FONTHEIGHT];
97 case SID_ATTR_CHAR_POSTURE:
98 pNormal =
aPlainMap[SID_ATTR_CHAR_POSTURE];
99 pCJK =
aPlainMap[SID_ATTR_CHAR_CJK_POSTURE];
100 pCTL =
aPlainMap[SID_ATTR_CHAR_CTL_POSTURE];
103 case SID_ATTR_CHAR_WEIGHT:
104 pNormal =
aPlainMap[SID_ATTR_CHAR_WEIGHT];
105 pCJK =
aPlainMap[SID_ATTR_CHAR_CJK_WEIGHT];
106 pCTL =
aPlainMap[SID_ATTR_CHAR_CTL_WEIGHT];
109 case SID_ATTR_CHAR_LANGUAGE:
110 pNormal =
aPlainMap[SID_ATTR_CHAR_LANGUAGE];
111 pCJK =
aPlainMap[SID_ATTR_CHAR_CJK_LANGUAGE];
112 pCTL =
aPlainMap[SID_ATTR_CHAR_CTL_LANGUAGE];
182 DBG_ASSERT( pSet,
"A SfxItemSet has to be provided as argument!" );
183 bool bFirstToken =
true;
184 bool bContinue =
true;
223 auto xNew(std::make_unique<SvxRTFItemStackType>(*pCurrent, *
mxInsertPosition,
true));
229 xNew->aAttrSet.SetParent( pCurrent ? &pCurrent->
aAttrSet :
nullptr );
420 pSet->
Put( aLSpace );
484 goto SET_FONTALIGNMENT;
486 goto SET_FONTALIGNMENT;
488 goto SET_FONTALIGNMENT;
490 goto SET_FONTALIGNMENT;
492 goto SET_FONTALIGNMENT;
507 SID_ATTR_CHAR_WEIGHT );
514 if (
const sal_uInt16 wid =
aPlainMap[SID_ATTR_CHAR_CASEMAP];
531 if (
const sal_uInt16 nEsc =
aPlainMap[SID_ATTR_CHAR_ESCAPEMENT])
556 if (
const sal_uInt16 nEsc =
aPlainMap[SID_ATTR_CHAR_ESCAPEMENT])
606 SID_ATTR_CHAR_FONT );
631 SID_ATTR_CHAR_FONTHEIGHT );
642 SID_ATTR_CHAR_POSTURE );
686 goto ATTR_SETUNDERLINE;
690 goto ATTR_SETUNDERLINE;
693 goto ATTR_SETUNDERLINE;
696 goto ATTR_SETUNDERLINE;
699 goto ATTR_SETUNDERLINE;
702 goto ATTR_SETUNDERLINE;
705 goto ATTR_SETUNDERLINE;
708 goto ATTR_SETUNDERLINE;
711 goto ATTR_SETUNDERLINE;
714 goto ATTR_SETUNDERLINE;
717 goto ATTR_SETUNDERLINE;
720 goto ATTR_SETUNDERLINE;
723 goto ATTR_SETUNDERLINE;
726 goto ATTR_SETUNDERLINE;
729 goto ATTR_SETUNDERLINE;
732 goto ATTR_SETUNDERLINE;
735 goto ATTR_SETUNDERLINE;
744 goto ATTR_SETUNDERLINE;
747 if (
const sal_uInt16 wid =
aPlainMap[SID_ATTR_CHAR_UNDERLINE])
754 if (
const sal_uInt16 wid =
aPlainMap[SID_ATTR_CHAR_UNDERLINE])
756 std::unique_ptr<SvxUnderlineItem> aUL(std::make_unique<SvxUnderlineItem>(
LINESTYLE_SINGLE, wid));
759 if (SfxItemState::SET == pSet->
GetItemState(wid,
false, &pItem))
779 pSet->
Put(std::move(aUL));
787 goto ATTR_SETOVERLINE;
791 goto ATTR_SETOVERLINE;
794 goto ATTR_SETOVERLINE;
797 goto ATTR_SETOVERLINE;
800 goto ATTR_SETOVERLINE;
803 goto ATTR_SETOVERLINE;
806 goto ATTR_SETOVERLINE;
809 goto ATTR_SETOVERLINE;
812 goto ATTR_SETOVERLINE;
815 goto ATTR_SETOVERLINE;
818 goto ATTR_SETOVERLINE;
821 goto ATTR_SETOVERLINE;
824 goto ATTR_SETOVERLINE;
827 goto ATTR_SETOVERLINE;
830 goto ATTR_SETOVERLINE;
833 goto ATTR_SETOVERLINE;
836 goto ATTR_SETOVERLINE;
845 goto ATTR_SETOVERLINE;
857 std::unique_ptr<SvxOverlineItem> aOL(std::make_unique<SvxOverlineItem>(
LINESTYLE_SINGLE, wid));
860 if (SfxItemState::SET == pSet->
GetItemState(wid,
false, &pItem))
870 aOL.reset(pSet->
Get(wid,
false).
Clone());
880 pSet->
Put(std::move(aOL));
886 if (
const sal_uInt16 nEsc =
aPlainMap[SID_ATTR_CHAR_ESCAPEMENT])
911 if (
const sal_uInt16 wid =
aPlainMap[SID_ATTR_CHAR_COLOR])
920 if (
const sal_uInt16 wid =
aPlainMap[SID_ATTR_BRUSH_CHAR])
928 if (
const sal_uInt16 wid =
aPlainMap[SID_ATTR_CHAR_LANGUAGE])
935 if (
const sal_uInt16 wid =
aPlainMap[SID_ATTR_CHAR_CJK_LANGUAGE])
943 SID_ATTR_CHAR_LANGUAGE );
972 eEmphasis = FontEmphasisMark::NONE;
973 goto ATTR_SETEMPHASIS;
975 eEmphasis = (FontEmphasisMark::Dot | FontEmphasisMark::PosAbove);
976 goto ATTR_SETEMPHASIS;
979 eEmphasis = (FontEmphasisMark::Accent | FontEmphasisMark::PosAbove);
993 case 1: cStt =
'('; cEnd =
')';
break;
994 case 2: cStt =
'['; cEnd =
']';
break;
995 case 3: cStt =
'<'; cEnd =
'>';
break;
996 case 4: cStt =
'{'; cEnd =
'}';
break;
997 default: cStt = 0; cEnd = 0;
break;
1008 if (nTokenValue < 1 || nTokenValue > 600)
1062 bool bHandled =
false;
1087 if (
const sal_uInt16 wid =
aPlainMap[SID_ATTR_CHAR_ESCAPEMENT])
1096 aPardMap[SID_ATTR_PARA_HYPHENZONE]);
1099 if(
aPardMap[SID_ATTR_PARA_HYPHENZONE] &&
1111 pSet->
Put( aHypenZone );
1182 "} did not follow { as expected");
1205 if (bHandled && !bFirstToken)
1241 bFirstToken =
false;
1247 bool bMethodOwnsToken =
false;
1251 bool bContinue =
true;
1261 aAttr.
Insert( aTabStop );
1298 if (bMethodOwnsToken)
1315 bMethodOwnsToken =
true;
1317 }
while( bContinue );
1327 switch( nBorderTyp )
1356 std::unique_ptr<SvxBoxItem> aAttr(std::make_unique<SvxBoxItem>(
aPardMap[SID_ATTR_BORDER_OUTER]));
1365 bool bContinue =
true;
1369 bool bDoubleWidth =
false;
1386 if (nBorderTyp != 0)
1396 if (nBorderTyp != 0)
1406 if (nBorderTyp != 0)
1416 if (nBorderTyp != 0)
1470 bDoubleWidth =
false;
1473 bDoubleWidth =
true;
1490 switch( nBorderTyp )
1509 aAttr->SetAllDistances(
static_cast<sal_uInt16
>(
nTokenValue) );
1525 }
while( bContinue );
1528 if ( bDoubleWidth ) nWidth *= 2;
1539 nColor = (nColor * nShading) / 100;
1540 nFillColor = (nFillColor * ( 100 - nShading )) / 100;
1541 return nColor + nFillColor;
1548 bool bContinue =
true;
1549 sal_uInt16 nColor = USHRT_MAX, nFillColor = USHRT_MAX;
1629 }
while( bContinue );
1635 if( USHRT_MAX != nFillColor )
1640 else if( USHRT_MAX != nColor )
1645 if( USHRT_MAX != nColor )
1650 if( USHRT_MAX != nFillColor )
1657 if( 0 == nFillValue || 100 == nFillValue )
1679 bool bNewStkEntry =
true;
1687 auto xNew(std::make_unique<SvxRTFItemStackType>(*pCurrent, *
mxInsertPosition,
true));
1693 xNew->aAttrSet.SetParent( pCurrent ? &pCurrent->
aAttrSet :
nullptr );
1701 bNewStkEntry =
false;
1710 std::map<sal_uInt16, sal_uInt16>::const_iterator aIt;
1711 std::map<sal_uInt16, sal_uInt16>::const_iterator aEnd;
1725 for (; aIt != aEnd; ++aIt)
1727 const sal_uInt16 wid = aIt->second;
1737 if (SfxItemState::SET == pDfltSet->
GetItemState(wid,
false, &pDef))
1743 GetItemState(wid,
true, &pItem) &&
1744 *( pDef = &pDfltSet->
Get(wid)) != *pItem )
1748 if (SfxItemState::SET == pDfltSet->
GetItemState(wid,
false, &pDef))
1814 if (
const sal_uInt16 wid =
aPardMap[SID_ATTR_TABSTOP])
@ THICKTHIN_MEDIUMGAP
Double border line with a thick line outside and a thin line inside separated by a medium gap.
@ INSET
Inset border line.
@ EMBOSSED
3D embossed border line.
@ ENGRAVED
3D engraved border line.
@ THINTHICK_SMALLGAP
Double border line with a thin line outside and a thick line inside separated by a small gap.
@ DASHED
Dashed border line.
@ THICKTHIN_LARGEGAP
Double border line with a thick line outside and a thin line inside separated by a large gap.
@ OUTSET
Outset border line.
@ THINTHICK_MEDIUMGAP
Double border line with a thin line outside and a thick line inside separated by a medium gap.
@ SOLID
Solid border line.
@ THICKTHIN_SMALLGAP
Double border line with a thick line outside and a thin line inside separated by a small gap.
@ THINTHICK_LARGEGAP
Double border line with a thin line outside and a thick line inside separated by a large gap.
@ DOTTED
Dotted border line.
@ DOUBLE
Double border line.
sal_uInt8 GetBlue() const
sal_uInt8 GetGreen() const
const SfxPoolItem * GetCurItem() const
const SfxPoolItem * NextItem()
void SetPoolDefaultItem(const SfxPoolItem &)
static bool IsSlot(sal_uInt16 nId)
const SfxItemSet * GetParent() const
sal_uInt16 ClearItem(sal_uInt16 nWhich=0)
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
void SetWhich(sal_uInt16 nId)
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const=0
TokenStackType * GetStackPtr(short nCnt)
bool IsParserWorking() const
T SkipToken(short nCnt=-1)
rtl_TextEncoding GetCodeSet() const
void SetEncoding(rtl_TextEncoding eEnc)
static const sal_Int16 Hairline
void SetLine(const editeng::SvxBorderLine *pNew, SvxBoxItemLine nLine)
SvxColorItem item describes a color.
sal_uInt8 & GetProportionalHeight()
This item describes a Font.
sal_uInt8 & GetMaxHyphens()
void SetPageEnd(const bool bNew)
sal_uInt8 & GetMinTrail()
void SetRight(const tools::Long nR, const sal_uInt16 nProp=100)
void SetTextLeft(const tools::Long nL, const sal_uInt16 nProp=100)
void SetTextFirstLineOffset(const short nF, const sal_uInt16 nProp=100)
void SetPropLineSpace(const sal_uInt16 nProp)
sal_uInt16 GetLineHeight() const
void SetLineSpaceRule(SvxLineSpaceRule e)
void SetLineHeight(const sal_uInt16 nHeight)
SvxRTFItemStackList maChildList
std::optional< EditNodeIdx > mxStartNodeIdx
void SetStartPos(const EditPosition &rPos)
void ReadBackgroundAttr(int nToken, SfxItemSet &rSet, bool bTableDef=false)
WhichRangesContainer aWhichMap
bool IsChkStyleAttr() const
std::optional< EditPosition > mxInsertPosition
void ReadAttr(int nToken, SfxItemSet *pSet)
void ReadBorderAttr(int nToken, SfxItemSet &rSet, bool bTableDef=false)
const vcl::Font & GetFont(sal_uInt16 nId)
void RTFPardPlain(bool bPard, SfxItemSet **ppSet)
const SfxItemSet & GetRTFDefaults()
void SetDefault(int nToken, int nValue)
virtual void UnknownAttrToken(int nToken)
const Color & GetColor(size_t nId) const
void SetScriptAttr(RTF_CharTypeDef eType, SfxItemSet &rSet, SfxPoolItem &rItem)
std::deque< std::unique_ptr< SvxRTFItemStackType > > aAttrStack
void ReadTabAttr(int nToken, SfxItemSet &rSet)
bool Insert(const SvxTabStop &rTab)
sal_Unicode & GetDecimal()
SvxTabAdjust & GetAdjustment()
void SetLower(const sal_uInt16 nL, const sal_uInt16 nProp=100)
void SetUpper(const sal_uInt16 nU, const sal_uInt16 nProp=100)
void SetWidth(tools::Long nWidth)
void SetColor(const Color &rColor)
void SetBorderLineStyle(SvxBorderLineStyle nNew)
FontFamily GetFamilyType()
const OUString & GetStyleName() const
const OUString & GetFamilyName() const
rtl_TextEncoding GetCharSet() const
constexpr ::Color COL_WHITE(0xFF, 0xFF, 0xFF)
constexpr ::Color COL_BLACK(0x00, 0x00, 0x00)
#define DBG_ASSERT(sCon, aError)
#define DFLT_ESC_AUTO_SUB
#define DFLT_ESC_AUTO_SUPER
@ Horizontal_RL_TB
Horizontal, from right to left, from top to bottom (typical for arabic/hebrew languages).
@ Horizontal_LR_TB
Horizontal, from left to right, from top to bottom (typical for western languages).
#define SAL_WARN_IF(condition, area, stream)
static void SetBorderLine(int nBorderTyp, SvxBoxItem &rItem, const SvxBorderLine &rBorder)
static sal_uInt32 CalcShading(sal_uInt32 nColor, sal_uInt32 nFillColor, sal_uInt8 nShading)
std::map< sal_uInt16, sal_uInt16 > data