27 #include <com/sun/star/form/XFormComponent.hpp>
28 #include <com/sun/star/drawing/XShape.hpp>
29 #include <com/sun/star/drawing/XShapes.hpp>
30 #include <com/sun/star/drawing/XControlShape.hpp>
31 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
32 #include <com/sun/star/container/XIndexContainer.hpp>
33 #include <com/sun/star/text/VertOrientation.hpp>
34 #include <com/sun/star/text/TextContentAnchorType.hpp>
35 #include <com/sun/star/beans/XPropertyContainer.hpp>
36 #include <com/sun/star/beans/PropertyAttribute.hpp>
72 #include <rtl/character.hxx>
86 if( m_bObj && m_nPicLocFc )
87 m_nObjLocFc = m_nPicLocFc;
96 sal_Int32
const nPos(rStr.indexOf(0x01));
97 if (pF->
nLCode &&
nPos != -1 && nPos < pF->nLCode) {
134 OUString aBookmarkName;
141 SAL_WARN(
"sw.ww8",
"broken offset, ignoring");
145 sal_uInt16 bkmFindIdx;
146 OUString aBookmarkFind=pB->
GetBookmark(currentCP-1, nEnd, bkmFindIdx);
148 if (!aBookmarkFind.isEmpty()) {
150 if (!aBookmarkFind.isEmpty()) {
151 aBookmarkName=aBookmarkFind;
157 if (pB!=
nullptr && aBookmarkName.isEmpty()) {
161 if (!aBookmarkName.isEmpty()) {
162 m_aFieldStack.back().SetBookmarkName(aBookmarkName);
164 if ( aFormula.
msToolTip.getLength() < 139 )
165 m_aFieldStack.back().getParameters()[
"Description"] <<= aFormula.
msToolTip;
166 m_aFieldStack.back().getParameters()[
"Name"] <<= aFormula.
msTitle;
168 m_aFieldStack.back().getParameters()[
"MaxLength"] <<= aFormula.
mnMaxLen;
170 if ( aFormula.
mfType == 1 )
171 m_aFieldStack.back().getParameters()[
"Type"] <<= OUString(
"number");
172 else if ( aFormula.
mfType == 2 )
173 m_aFieldStack.back().getParameters()[
"Type"] <<= OUString(
"date");
174 else if ( aFormula.
mfType == 3 )
175 m_aFieldStack.back().getParameters()[
"Type"] <<= OUString(
"currentTime");
176 else if ( aFormula.
mfType == 4 )
177 m_aFieldStack.back().getParameters()[
"Type"] <<= OUString(
"currentDate");
178 else if ( aFormula.
mfType == 5 )
179 m_aFieldStack.back().getParameters()[
"Type"] <<= OUString(
"calculated");
192 if (rStr[pF->
nLCode-1]==0x01)
199 m_xFormImpl->InsertFormula(aFormula);
203 OUString aBookmarkName;
209 sal_uInt16 bkmFindIdx;
210 OUString aBookmarkFind=pB->
GetBookmark(currentCP-1, currentCP+currentLen-1, bkmFindIdx);
212 if (!aBookmarkFind.isEmpty()) {
214 if (!aBookmarkFind.isEmpty()) {
215 aBookmarkName=aBookmarkFind;
220 if (pB!=
nullptr && aBookmarkName.isEmpty()) {
224 if (!aBookmarkName.isEmpty())
229 OSL_ENSURE(pFieldmark!=
nullptr,
"hmmm; why was the bookmark not created?");
230 if (pFieldmark!=
nullptr) {
275 OUString aBookmarkName;
282 sal_uInt16 bkmFindIdx;
283 OUString aBookmarkFind=pB->
GetBookmark(currentCP-1, currentCP+currentLen-1, bkmFindIdx);
285 if (!aBookmarkFind.isEmpty())
288 if (!aBookmarkFind.isEmpty())
289 aBookmarkName=aBookmarkFind;
293 if (pB!=
nullptr && aBookmarkName.isEmpty())
296 if (!aBookmarkName.isEmpty())
301 OSL_ENSURE(pFieldmark!=
nullptr,
"hmmm; why was the bookmark not created?");
302 if ( pFieldmark !=
nullptr )
304 uno::Sequence< OUString > vListEntries(aFormula.
maListEntries.size());
319 if( m_bObj && m_nPicLocFc )
320 m_nObjLocFc = m_nPicLocFc;
362 sal_Int32 nV6DxaSpace;
393 nStartAt(1), nLevel(0), bStartAt(
true), bFormat(
false) {}
413 : pNumRule(pNumRule_), nIdLst(aLST.nIdLst),
414 bSimpleList(aLST.bSimpleList), bUsedInDoc(false)
416 memcpy( aIdSty, aLST.aIdSty,
sizeof( aIdSty ));
449 , pNumRule(rLFO.pNumRule)
450 , nIdLst(rLFO.nIdLst)
451 , nLfoLvl(rLFO.nLfoLvl)
452 , bOverride(rLFO.nLfoLvl != 0)
474 explicit ListWithId(sal_uInt32 nIdLst) : mnIdLst(nIdLst) {}
475 bool operator() (
const std::unique_ptr<WW8LSTInfo>& pEntry)
const
476 {
return (pEntry->nIdLst == mnIdLst); }
488 return aResult->get();
494 while (i < rString.getLength())
497 if (rtl::isHighSurrogate(c))
499 if (i+1 == rString.getLength()
500 || !rtl::isLowSurrogate(rString[i+1]))
502 SAL_WARN(
"sw.ww8",
"Surrogate error: high without low");
503 return rString.copy(0, i);
507 if (rtl::isLowSurrogate(c))
509 SAL_WARN(
"sw.ww8",
"Surrogate error: low without high");
510 return rString.copy(0, i);
618 sal_uInt16 nLevelStyle,
bool bSetStartNo, sal_uInt16 ,
ww::bytes &rParaSprms)
635 aLVL.nAlign = (aBits1 & 0x03);
636 if( aBits1 & 0x10 ) aLVL.bV6Prev =
true;
637 if( aBits1 & 0x20 ) aLVL.bV6PrSp =
true;
638 if( aBits1 & 0x40 ) aLVL.bV6 =
true;
665 if( aLVL.nLenGrpprlPapx )
668 if (aLVL.nLenGrpprlPapx !=
rSt.
ReadBytes(&aGrpprlPapx, aLVL.nLenGrpprlPapx))
673 aSprm =
GrpprlHasSprm(0x845E,aGrpprlPapx[0],aLVL.nLenGrpprlPapx);
679 rParaSprms.push_back(*pBegin++);
680 short nDxaLeft = SVBT16ToUInt16(aSprm.
pSprm);
681 aLVL.nDxaLeft = (0 < nDxaLeft) ? static_cast<sal_uInt16>(nDxaLeft)
682 :
static_cast<sal_uInt16
>(-nDxaLeft);
686 aSprm =
GrpprlHasSprm(0x8411,aGrpprlPapx[0],aLVL.nLenGrpprlPapx);
688 aSprm =
GrpprlHasSprm(0x8460,aGrpprlPapx[0],aLVL.nLenGrpprlPapx);
694 rParaSprms.push_back(*pBegin++);
695 aLVL.nDxaLeft1 = SVBT16ToUInt16(aSprm.
pSprm);
699 aSprm =
GrpprlHasSprm(0xC615,aGrpprlPapx[0],aLVL.nLenGrpprlPapx);
710 nTabPos = SVBT16ToUInt16(pSprm);
719 OSL_ENSURE(bDone,
"tab setting in numbering is "
720 "of unexpected configuration");
731 const sal_uInt16 nDesired = aLVL.nDxaLeft + aLVL.nDxaLeft1;
733 bool bDoAdjust =
false;
734 if ( nDesired < aLVL.nDxaLeft )
736 if ( nDesired < nTabPos && nTabPos < aLVL.nDxaLeft )
743 if ( aLVL.nDxaLeft < nTabPos && nTabPos < nDesired )
751 aLVL.nDxaLeft = (0 < nTabPos)
752 ? static_cast<sal_uInt16>(nTabPos)
753 :
static_cast<sal_uInt16
>(-nTabPos);
755 aLVL.nDxaLeft1 = nDesired - aLVL.nDxaLeft;
763 sal_uInt16 nWitchPicIsBullet =
USHRT_MAX;
764 bool bIsPicBullet =
false;
766 if( aLVL.nLenGrpprlChpx )
769 if (aLVL.nLenGrpprlChpx !=
rSt.
ReadBytes(&aGrpprlChpx, aLVL.nLenGrpprlChpx))
777 nWitchPicIsBullet = *aSprmWhichPis.
pSprm;
781 bIsPicBullet = (*aSprmIsPicBullet.
pSprm) & 0x0001;
791 sal_uInt16 nNewColl = nLevelStyle;
803 WW8SprmIter aSprmIter(&aGrpprlChpx[0], aLVL.nLenGrpprlChpx,
831 if (style::NumberingType::CHAR_SPECIAL == nType)
833 cBullet = !sNumString.isEmpty()
834 ? sNumString.iterateCodePoints(&
o3tl::temporary(sal_Int32(0))) : 0x2190;
839 else if (style::NumberingType::BITMAP == nType)
841 cGrfBulletCP = nWitchPicIsBullet;
844 switch( aLVL.nAlign )
847 eAdj = SvxAdjust::Left;
850 eAdj = SvxAdjust::Center;
853 eAdj = SvxAdjust::Right;
857 eAdj = SvxAdjust::Left;
861 OSL_ENSURE(
false,
"Value of aLVL.nAlign is not supported" );
863 eAdj = SvxAdjust::Left;
868 if( bSetStartNo && 0 <= aLVL.nStartAt)
869 rNumFormat.
SetStart(static_cast<sal_uInt16>(aLVL.nStartAt));
873 if( style::NumberingType::CHAR_SPECIAL == nType )
881 else if (style::NumberingType::BITMAP == nType)
888 OUString sListFormat = sNumString;
889 if (sListFormat.getLength())
891 sal_uInt32 nExtraOffset = 0;
893 while (nLevelB < nMaxLevel && aLVL.aOfsNumsXCH[nLevelB])
896 sal_uInt8 nOffset = aLVL.aOfsNumsXCH[nLevelB] + nExtraOffset - 1;
897 if (nOffset >= sListFormat.getLength())
899 SAL_WARN(
"sw.ww8",
"List level reference is beyond the border. Ignored.");
903 sal_uInt8 nReplacement = sListFormat[nOffset] + 1;
905 OUString sReplacement(
"%" + OUString::number(nReplacement));
906 sListFormat = sListFormat.replaceAt(nOffset, 1, sReplacement);
909 nExtraOffset += sReplacement.getLength() - 1;
926 if (eAdj == SvxAdjust::Right)
947 switch ( ixchFollow )
972 WW8aISet
const & rListItemSet,
WW8aCFormat& rCharFormat,
bool& bNewCharFormatCreated,
973 const OUString& sPrefix )
975 bNewCharFormatCreated =
false;
981 SfxItemSet* pThisLevelItemSet = rListItemSet[nLevel].get();
983 if( pThisLevelItemSet && pThisLevelItemSet->
Count())
987 for (
sal_uInt8 nLowerLevel = 0; nLowerLevel < nLevel; ++nLowerLevel)
989 SfxItemSet* pLowerLevelItemSet = rListItemSet[nLowerLevel].get();
990 if( pLowerLevelItemSet
991 && (pLowerLevelItemSet->
Count() == pThisLevelItemSet->
Count()) )
993 nIdenticalItemSetLevel = nLowerLevel;
999 pItemIter->
Which(),
false, &pItem ) )
1001 (*pItem != *pItemIter) )
1009 }
while (pItemIter);
1011 if( nIdenticalItemSetLevel !=
nMaxLevel )
1017 if (
nMaxLevel == nIdenticalItemSetLevel)
1020 const OUString
aName( (!sPrefix.isEmpty() ? sPrefix : rNumRule.
GetName())
1021 +
"z" + OUString::number( nLevel ) );
1025 bNewCharFormatCreated =
true;
1032 pFormat = rCharFormat[ nIdenticalItemSetLevel ];
1036 rCharFormat[ nLevel ] = pFormat;
1048 const OUString
aName( (!sPrefix.isEmpty() ? sPrefix : rNumRule.
GetName())
1049 +
"z" + OUString::number( nLevel ) );
1052 bNewCharFormatCreated =
true;
1053 rCharFormat[ nLevel ] = pFormat;
1082 rNumRule.
Set(nLevel, aNumFormat);
1110 : maSprmParser(rReader_.GetFib()), rReader(rReader_)
1111 , rDoc(rReader.GetDoc())
1112 , rFib(rReader.GetFib()), rSt(rSt_)
1137 sal_uInt16 nListCount(0);
1139 nRemainingPlcfLst -= 2;
1140 bOk = nListCount > 0;
1146 const size_t nMinRecordSize = 10 + 2*
nMaxLevel;
1148 if (nListCount > nMaxRecords)
1150 SAL_WARN(
"sw.ww8",
"Parsing error: " << nMaxRecords <<
1151 " max possible entries, but " << nListCount <<
" claimed, truncating");
1152 nListCount = nMaxRecords;
1154 for (sal_uInt16 nList=0; nList < nListCount; ++nList)
1156 if (nRemainingPlcfLst <
cbLSTF)
1165 for (sal_uInt16 & nLevel : aLST.aIdSty)
1174 aLST.bSimpleList =
true;
1176 aLST.bRestartHdn =
true;
1195 aLST.bSimpleList || (aBits1 & 0x10));
1200 nRemainingPlcfLst -=
cbLSTF;
1205 sal_uInt16 nLSTInfos =
static_cast< sal_uInt16
>(
maLSTInfos.size());
1206 for (sal_uInt16 nList = 0; nList < nLSTInfos; ++nList)
1211 if( !pListInfo || !pListInfo->
pNumRule )
break;
1218 for (sal_uInt16 nLevel = 0; nLevel < nLvlCount; ++nLevel)
1222 bLVLOk =
ReadLVL( aNumFormat, aItemSet[nLevel],
1223 pListInfo->
aIdSty[nLevel],
true, nLevel,
1228 rMyNumRule.
Set( nLevel, aNumFormat );
1236 for (sal_uInt16 nLevel = 0; nLevel < nLvlCount; ++nLevel)
1239 AdjustLVL( nLevel, rMyNumRule, aItemSet,
1251 sal_Int32 nLfoCount(0);
1253 bOk = nLfoCount > 0;
1260 for (sal_Int32 nLfo = 0; nLfo < nLfoCount; ++nLfo)
1278 if (pParentListInfo)
1281 aLFO.pNumRule = pParentListInfo->
pNumRule;
1287 std::unique_ptr<WW8LFOInfo> pLFOInfo(
new WW8LFOInfo(aLFO));
1288 if (pParentListInfo)
1292 int nMaxSize = pParentListInfo->
maParaSprms.size();
1293 pLFOInfo->maParaSprms.resize(nMaxSize);
1294 for (
int i = 0;
i < nMaxSize; ++
i)
1307 for (
size_t nLfo = 0; nLfo < nLFOInfos; ++nLfo)
1314 if (!pParentListInfo)
1320 OSL_ENSURE(pParentNumRule,
"ww: Impossible lists, please report");
1321 if( !pParentNumRule )
1325 const OUString
sPrefix(
"WW8NumSt" + OUString::number( nLfo + 1 ));
1363 while (nTest == 0xFFFFFFFF);
1382 aLFOLVL.nLevel = aBits1 & 0x0F;
1383 if( (0xFF > aBits1) &&
1387 aLFOLVL.bStartAt =
true;
1389 aLFOLVL.bStartAt =
false;
1397 aLFOLVL.bFormat =
true;
1401 ReadLVL(aNumFormat, aItemSet[nLevel],
1402 pParentListInfo->
aIdSty[nLevel],
1403 aLFOLVL.bStartAt, nLevel,
1409 else if (aLFOLVL.bStartAt)
1411 aNumFormat.SetStart(
1412 writer_cast<sal_uInt16>(aLFOLVL.nStartAt));
1417 rLFOInfo.
pNumRule->
Set(aLFOLVL.nLevel, aNumFormat);
1429 bool bNewCharFormatCreated =
false;
1433 bNewCharFormatCreated, sPrefix );
1450 if (rpInfo->pNumRule && !rpInfo->bUsedInDoc &&
1451 rpInfo->pNumRule->IsAutoRule())
1459 if ((*aIter)->bOverride
1460 && (*aIter)->pNumRule
1461 && !(*aIter)->bUsedInDoc
1462 && (*aIter)->pNumRule->IsAutoRule())
1517 if ( aFormat.GetNumAdjust() == SvxAdjust::Right)
1519 else if ( aFormat.GetNumAdjust() == SvxAdjust::Left)
1520 aFormat.SetNumAdjust(SvxAdjust::Right);
1542 if( pParentListInfo )
1552 bool bRestart(
false);
1553 sal_uInt16 nStart(0);
1554 bool bNewstart(
false);
1564 OSL_ENSURE(pParentListInfo,
"ww: Impossible lists, please report");
1565 if (pParentListInfo && pParentListInfo->
pNumRule)
1567 const WW8LFOLVL &rOverride = rLFOInfo.
maOverrides[nLevel];
1568 bool bNoChangeFromParent =
1572 if (bNoChangeFromParent)
1577 if (bFirstUse && rOverride.bStartAt)
1605 if (bRestart || bNewstart)
1623 OSL_ENSURE( pTextNode,
"No Text-Node at PaM-Position" );
1641 const bool bApplyListStyle =
false;
1693 OSL_ENSURE(
m_pCurrentColl,
"Cannot be called outside of style import");
1708 std::vector<sal_uInt8> aParaSprms;
1710 nCurrentLFO, nCurrentLevel, aParaSprms);
1738 std::vector<sal_uInt8> aParaSprms;
1739 pNmRule =
m_xLstManager->GetNumRuleForActivation(nLFO, nLevel,
1742 if (pNmRule !=
nullptr)
1764 const bool bSetAttr)
1775 OSL_ENSURE(pTextNd,
"No Text-Node at PaM-Position");
1779 std::vector<sal_uInt8> aParaSprms;
1781 m_xLstManager->GetNumRuleForActivation( nCurrentLFO, nCurrentLevel,
1782 aParaSprms, pTextNd) :
nullptr;
1784 if (pRule ==
nullptr && bSetAttr)
1787 if (bSetAttr && pTextNd->
GetNumRule() != pRule
1803 bool bApplyListLevelIndentDirectlyAtPara(
true);
1811 bApplyListLevelIndentDirectlyAtPara =
false;
1816 if (!bApplyListLevelIndentDirectlyAtPara)
1823 OSL_ENSURE(pItem,
"impossible");
1825 xListIndent->Put(*pItem);
1832 if (
short nLen = static_cast< short >(aParaSprms.size()))
1834 std::unique_ptr<SfxItemSet> xOldCurrentItemSet(
SetCurrentItemSet(std::move(xListIndent)));
1925 short nData = SVBT16ToUInt16( pData );
1956 pTextNode->SetAttr( aEmptyRule );
1959 std::shared_ptr<SvxLRSpaceItem> aLR(std::make_shared<SvxLRSpaceItem>(
RES_LR_SPACE));
1964 aLR.reset(static_cast<SvxLRSpaceItem*>(pLR->
Clone()));
1967 aLR->SetTextLeft(0);
1968 aLR->SetTextFirstLineOffset(0);
1971 pTextNode->SetAttr( *aLR );
2024 WW8_CP nEndCp = nStart+1;
2030 while(nStart <= nEndCp)
2071 const uno::Reference< lang::XMultiServiceFactory > & rServiceFactory =
2072 GetServiceFactory();
2074 if(!rServiceFactory.is())
2078 uno::Reference< form::XFormComponent> xFComp;
2080 if (rFormula.
Import(rServiceFactory, xFComp, aSz))
2082 uno::Reference <drawing::XShape> xShapeRef;
2084 GetShapes()->add(xShapeRef);
2098 if (nVersion != 0xFFFFFFFF)
2100 SAL_WARN(
"sw.ww8",
"Parsing error: invalid header for FFData");
2114 OSL_ENSURE( iType == nWhich,
"something wrong, expect control type read from stream doesn't match nWhich passed in");
2115 if ( iType != nWhich )
2137 sal_uInt16 wDef = 0;
2144 msDefault = ( wDef == 0 ) ? OUStringLiteral(
u"0" ) : OUStringLiteral(
u"1" );
2163 sal_uInt16 fExtend = 0;
2165 sal_uInt16 nStringsCnt = 0;
2169 if (fExtend != 0xFFFF)
2174 sal_uInt16 cbExtra = 0;
2177 OSL_ENSURE(bAllOk,
"Unknown formfield dropdown list structure");
2180 const size_t nMinRecordSize =
sizeof(sal_uInt16);
2181 const size_t nMaxRecords = pDataStream->
remainingSize() / nMinRecordSize;
2182 if (nStringsCnt > nMaxRecords)
2184 SAL_WARN(
"sw.ww8",
"Parsing error: " << nMaxRecords <<
2185 " max possible entries, but " << nStringsCnt <<
" claimed, truncating");
2186 nStringsCnt = nMaxRecords;
2189 for (sal_uInt32 nI = 0; nI < nStringsCnt; ++nI)
2202 mfType = (nField & 0x38)>>3;
2214 uno::Reference<beans::XPropertySet>
const & rPropSet)
2217 struct CtrlFontMapEntry
2219 sal_uInt16 nWhichId;
2220 const char* pPropNm;
2222 const CtrlFontMapEntry aMapTable[] =
2235 uno::Reference< beans::XPropertySetInfo > xPropSetInfo =
2236 rPropSet->getPropertySetInfo();
2239 for (
const CtrlFontMapEntry* pMap = aMapTable; pMap->nWhichId; ++pMap)
2243 OSL_ENSURE(pItem,
"Impossible");
2247 switch ( pMap->nWhichId )
2252 if (xPropSetInfo->hasPropertyByName(aNm =
"TextColor"))
2255 rPropSet->setPropertyValue(aNm, aTmp);
2264 if (xPropSetInfo->hasPropertyByName(aNm =
"FontStyleName"))
2267 rPropSet->setPropertyValue( aNm, aTmp );
2269 if (xPropSetInfo->hasPropertyByName(aNm =
"FontFamily"))
2271 aTmp <<= static_cast<sal_Int16>(pFontItem->
GetFamily());
2272 rPropSet->setPropertyValue( aNm, aTmp );
2274 if (xPropSetInfo->hasPropertyByName(aNm =
"FontCharset"))
2276 aTmp <<= static_cast<sal_Int16>(pFontItem->
GetCharSet());
2277 rPropSet->setPropertyValue( aNm, aTmp );
2279 if (xPropSetInfo->hasPropertyByName(aNm =
"FontPitch"))
2281 aTmp <<= static_cast<sal_Int16>(pFontItem->
GetPitch());
2282 rPropSet->setPropertyValue( aNm, aTmp );
2298 aTmp <<= static_cast<float>(aSize.Height()) / 20.0;
2307 static_cast<const SvxWeightItem*>(pItem)->GetWeight() );
2308 aFont.
SetWeight( static_cast<const SvxWeightItem*>(pItem)->GetWeight() );
2312 aTmp <<= static_cast<sal_Int16>(
static_cast<const SvxUnderlineItem*
>(pItem)->GetLineStyle());
2313 aFont.
SetUnderline(static_cast<const SvxUnderlineItem*>(pItem)->GetLineStyle());
2317 aTmp <<= static_cast<sal_Int16>(
static_cast<const SvxCrossedOutItem*
>(pItem)->GetStrikeout() );
2318 aFont.
SetStrikeout( static_cast<const SvxCrossedOutItem*>(pItem)->GetStrikeout() );
2322 aTmp <<= static_cast<sal_Int16>(
static_cast<const SvxPostureItem*
>(pItem)->GetPosture() );
2323 aFont.
SetItalic( static_cast<const SvxPostureItem*>(pItem)->GetPosture() );
2331 if (bSet && xPropSetInfo->hasPropertyByName(OUString::createFromAscii(pMap->pPropNm)))
2332 rPropSet->setPropertyValue(OUString::createFromAscii(pMap->pPropNm), aTmp);
2336 OSL_ENSURE(pOut,
"Impossible");
2339 pOut->
Push( PushFlags::FONT | PushFlags::MAPMODE );
2351 lang::XMultiServiceFactory> &rServiceFactory,
2352 uno::Reference <form::XFormComponent> &rFComp,awt::Size &rSz )
2354 uno::Reference<uno::XInterface> xCreate = rServiceFactory->createInstance(
"com.sun.star.form.component.ComboBox");
2358 rFComp.set(xCreate, uno::UNO_QUERY);
2362 uno::Reference<beans::XPropertySet> xPropSet(xCreate, uno::UNO_QUERY);
2369 xPropSet->setPropertyValue(
"Name", aTmp );
2374 xPropSet->setPropertyValue(
"HelpText", aTmp );
2377 xPropSet->setPropertyValue(
"Dropdown", css::uno::makeAny(
true));
2382 uno::Sequence< OUString > aListSource(nLen);
2383 for (sal_uInt32 nI = 0; nI < nLen; ++nI)
2385 aTmp <<= aListSource;
2386 xPropSet->setPropertyValue(
"StringItemList", aTmp );
2394 aTmp <<= aListSource[0];
2397 xPropSet->setPropertyValue(
"DefaultText", aTmp );
2403 static constexpr OUStringLiteral aBlank =
2404 u"\u2002\u2002\u2002\u2002\u2002";
2417 (uno::Reference<beans::XPropertySet>
const & xPropSet,
2418 const OUString & rPropertyName,
const OUString & rValue)
2420 uno::Reference<beans::XPropertySetInfo> xPropSetInfo =
2421 xPropSet->getPropertySetInfo();
2422 if (xPropSetInfo.is() &&
2423 ! xPropSetInfo->hasPropertyByName(rPropertyName))
2425 uno::Reference<beans::XPropertyContainer>
2426 xPropContainer(xPropSet, uno::UNO_QUERY);
2428 xPropContainer->addProperty
2430 static_cast<sal_Int16>(beans::PropertyAttribute::BOUND |
2431 beans::PropertyAttribute::REMOVABLE),
2436 xPropSet->setPropertyValue(rPropertyName, aAnyValue );
2440 lang::XMultiServiceFactory> &rServiceFactory,
2441 uno::Reference <form::XFormComponent> &rFComp,awt::Size &rSz )
2443 uno::Reference< uno::XInterface > xCreate = rServiceFactory->createInstance(
"com.sun.star.form.component.CheckBox");
2447 rFComp.set( xCreate, uno::UNO_QUERY );
2451 uno::Reference< beans::XPropertySet > xPropSet( xCreate, uno::UNO_QUERY );
2461 xPropSet->setPropertyValue(
"Name", aTmp );
2463 aTmp <<= static_cast<sal_Int16>(
mnChecked);
2464 xPropSet->setPropertyValue(
"DefaultState", aTmp);
2482 const uno::Reference< form::XFormComponent > & rFComp,
2483 const awt::Size& rSize, uno::Reference< drawing::XShape > *pShape,
2486 const uno::Reference< container::XIndexContainer > &rComps = GetFormComps();
2488 rComps->insertByIndex( rComps->getCount(), aTmp );
2490 const uno::Reference< lang::XMultiServiceFactory > &rServiceFactory =
2491 GetServiceFactory();
2492 if( !rServiceFactory.is() )
2495 uno::Reference< uno::XInterface > xCreate = rServiceFactory->createInstance(
2496 "com.sun.star.drawing.ControlShape");
2500 uno::Reference< drawing::XShape > xShape(xCreate, uno::UNO_QUERY);
2502 OSL_ENSURE(xShape.is(),
"Did not get XShape");
2503 xShape->setSize(rSize);
2505 uno::Reference< beans::XPropertySet > xShapePropSet(
2506 xCreate, uno::UNO_QUERY );
2510 text::TextContentAnchorType nTemp;
2512 nTemp = text::TextContentAnchorType_AT_PARAGRAPH;
2514 nTemp = text::TextContentAnchorType_AS_CHARACTER;
2516 xShapePropSet->setPropertyValue(
"AnchorType",
uno::Any(static_cast<sal_Int16>(nTemp)) );
2518 xShapePropSet->setPropertyValue(
"VertOrient",
uno::Any(sal_Int16(text::VertOrientation::TOP)) );
2520 uno::Reference< text::XText > xDummyTextRef;
2521 uno::Reference< text::XTextRange > xTextRg =
2525 xShapePropSet->setPropertyValue(
"TextRange", aTmp );
2528 uno::Reference< drawing::XControlShape > xControlShape( xShape,
2530 uno::Reference< awt::XControlModel > xControlModel( rFComp,
2532 xControlShape->setControl( xControlModel );
void SetToolTip(const OUString &rToolTip)
Sets the tool tip of the field.
void SetFamily(FontFamily)
void Read_ListLevel(sal_uInt16 nId, const sal_uInt8 *pData, short nLen)
SvxNumType GetNumberingType() const
void AdjustLVL(sal_uInt8 nLevel, SwNumRule &rNumRule, WW8aISet const &rListItemSet, WW8aCFormat &aCharFormat, bool &bNewCharFormatCreated, const OUString &aPrefix=OUString())
simple Iterator for SPRMs
void SetStrikeout(FontStrikeout)
constexpr TypedWhichId< SvxCrossedOutItem > RES_CHRATR_CROSSEDOUT(5)
void SetListRestart(bool bRestart)
void SetStyleIndent(SwWW8StyInf &rStyle, const SwNumFormat &rFormat)
std::unique_ptr< SwWW8FltControlStack > m_xCtrlStck
SVX_NUM_CHARS_UPPER_LETTER_N
OUString GetUniqueBookmarkName(const OUString &rSuggestedName)
SwNode & GetNode(bool bPoint=true) const
std::map< OUString, css::uno::Any > parameter_map_t
void SetFontSize(const Size &)
std::unique_ptr< WW8RStyle > m_xStyles
static bool IsEqualFormatting(const SwNumRule &rOne, const SwNumRule &rTwo)
SwCharFormat * MakeCharFormat(const OUString &rFormatName, SwCharFormat *pDerivedFrom, bool bBroadcast=false)
WW8_CP nSCode
start of instructions code
SwNumRule * m_pOutlineNumrule
SvStream & ReadUInt16(sal_uInt16 &rUInt16)
void SetAutoRule(bool bFlag)
virtual bool SetAttr(const SfxPoolItem &) override
overriding to handle change of certain paragraph attributes
SVX_NUM_FULL_WIDTH_ARABIC
void UseListIndent(SwWW8StyInf &rStyle, const SwNumFormat &rFormat)
Point LogicToLogic(const Point &rPtSource, const MapMode *pMapModeSource, const MapMode *pMapModeDest) const
static void lcl_AddToPropertyContainer(uno::Reference< beans::XPropertySet > const &xPropSet, const OUString &rPropertyName, const OUString &rValue)
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const =0
SprmResult findSprmData(sal_uInt16 nId, sal_uInt8 *pSprms, sal_Int32 nLen) const
Returns the offset to data of the first sprm of id nId, 0.
std::vector< sal_uInt8 > bytes
constexpr TypedWhichId< SwNumRuleItem > RES_PARATR_NUMRULE(72)
void SetNCurrentColl(sal_uInt16 nColl)
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_FONTSIZE(8)
sal_uInt16 GetCurrentId() const
sal_uInt16 GetPoolFormatId() const
Query and set PoolFormat IDs.
const sal_uInt8 * pMemPos
Provides access to the marks of a document.
void SetContinusNum(bool bFlag)
void SetWeight(FontWeight)
SwCharFormat * WW8aCFormat[nMaxLevel]
sal_uInt64 Seek(sal_uInt64 nPos)
constexpr TypedWhichId< SvxUnderlineItem > RES_CHRATR_UNDERLINE(14)
void InsertFormula(WW8FormulaControl &rFormula)
std::unique_ptr< WW8ListManager, o3tl::default_delete< WW8ListManager > > m_xLstManager
WW8_CP nLen
total length (to skip over text)
const OUString & GetName() const
sal_uInt16 GetPoolHelpId() const
Query and set Help-IDs for document styles.
OUString GetUniqueNumRuleName(const OUString *pChkStr=nullptr, bool bAutoNum=true) const
const SfxPoolItem * GetFormatAttr(sal_uInt16 nWhich)
void SetCharSet(rtl_TextEncoding)
IDocumentMarkAccess * getIDocumentMarkAccess()
#define ODF_FORMCHECKBOX_HELPTEXT
static constexpr sal_uInt16 val
IDocumentContentOperations const & getIDocumentContentOperations() const
FontPitch GetPitch() const
SwNumRule * GetNumRule(size_t i)
bool m_bListRelevantIndentSet
constexpr TypedWhichId< SvxFontItem > RES_CHRATR_FONT(7)
#define ODF_FORMDROPDOWN_RESULT
sal_Int32 getTokenCount(const OString &rIn, char cTok)
FontFamily GetFamily() const
sal_uInt64 SeekRel(sal_Int64 nPos)
bool ImportFormulaControl(WW8FormulaControl &rBox, WW8_CP nStart, SwWw8ControlType nWhich)
void RegisterNumFormat(sal_uInt16 nCurrentLFO, sal_uInt8 nCurrentLevel)
static SvxNumType GetSvxNumTypeFromMSONFC(sal_uInt16 nMSONFC)
static OutputDevice * GetDefaultDevice()
WW8LSTInfo * GetLSTByListId(sal_uInt32 nIdLst) const
constexpr OUStringLiteral aListBox
IDocumentFieldsAccess const & getIDocumentFieldsAccess() const
void Read_LFOPosition(sal_uInt16 nId, const sal_uInt8 *pData, short nLen)
read and interpret the sprmPIlfo used to determine which list contains the paragraph.
wwSprmParser maSprmParser
const SfxPoolItem * NextItem()
void SetTextLeft(const tools::Long nL, const sal_uInt16 nProp=100)
const SwCharFormat * GetDfltCharFormat() const
std::vector< WW8LFOLVL > maOverrides
std::vector< SwWW8StyInf > m_vColl
bool SetTextFormatColl(const SwPaM &rRg, SwTextFormatColl *pFormat, const bool bReset=true, const bool bResetListAttrs=false, SwRootFrame const *pLayout=nullptr)
Add 4th optional parameter .
rtl_TextEncoding GetCharSet() const
std::unique_ptr< SfxItemSet > WW8aISet[nMaxLevel]
Ret writer_cast(Param in)
A static_cast style cast for conversion of word types to writer's.
WW8LSTInfo(SwNumRule *pNumRule_, const WW8LST &aLST)
tools::Long GetListFirstLineIndent(const SwNumFormat &rFormat)
bool IsWW8BuiltInHeadingStyle() const
virtual parameter_map_t * GetParameters()=0
SVX_NUM_IROHA_FULLWIDTH_JA
const SfxPoolItem * GetDfltAttr(sal_uInt16 nWhich)
Get the default attribute from corresponding default attribute table.
void SetUnderline(FontLineStyle)
void SetCountedInList(bool bCounted)
void SetSelectedItem(const OUString &rItem)
Sets the selected item.
sal_uInt64 remainingSize()
void SetPitch(FontPitch ePitch)
const OUString & GetStyleName() const
constexpr TypedWhichId< SvxWeightItem > RES_CHRATR_WEIGHT(15)
sal_uInt16 GetCurrentColl() const
bool IsContinusNum() const
void SetStylesList(sal_uInt16 nStyle, sal_uInt16 nCurrentLFO, sal_uInt8 nCurrentLevel)
sal_uInt8 m_nVersion
Program-Version asked for by us: in Ctor we check if it matches the value of nFib.
SvStream & ReadUInt32(sal_uInt32 &rUInt32)
eF_ResT Read_F_FormCheckBox(WW8FieldDesc *pF, OUString &rStr)
PaM is Point and Mark: a selection of the document model.
std::vector< ww::bytes > maParaSprms
short ImportSprm(const sal_uInt8 *pPos, sal_Int32 nMemLen, sal_uInt16 nId=0)
SVX_NUM_IROHA_HALFWIDTH_JA
bool checkSeek(SvStream &rSt, sal_uInt64 nOffset)
static SvtFilterOptions & Get()
void SetFamilyName(const OUString &rFamilyName)
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
sal_uInt16 m_nCurrentColl
bool HasWW8OutlineLevel() const
const SwPosition * GetPoint() const
SwNumRuleType GetRuleType() const
void SetToggleAttrFlags(sal_uInt16 nFlags)
std::unique_ptr< SfxItemSet > SetCurrentItemSet(std::unique_ptr< SfxItemSet > pItemSet)
const vcl::Font & GetDefBulletFont()
retrieve font used for the default bullet list characters
sal_uInt16 WW8aIdSty[WW8ListManager::nMaxLevel]
void Read_ANLevelNo(sal_uInt16, const sal_uInt8 *pData, short nLen)
std::shared_ptr< SvxLRSpaceItem > maWordLR
void SetTextFirstLineOffset(const short nF, const sal_uInt16 nProp=100)
void RegisterNumFormatOnStyle(sal_uInt16 nStyle)
tools::Long Width() const
std::enable_if< std::is_signed< T >::value, bool >::type checked_add(T a, T b, T &result)
virtual bool InsertControl(const css::uno::Reference< css::form::XFormComponent > &rFComp, const css::awt::Size &rSize, css::uno::Reference< css::drawing::XShape > *pShape, bool bFloatingCtrl) override
SwNumRule * GetNumRule(bool bInParent=true) const
Returns numbering rule of this text node.
eF_ResT Read_F_FormTextBox(WW8FieldDesc *pF, OUString &rStr)
const Size & GetFontSize() const
void Restore(SwWW8ImplReader *pRdr)
sal_uInt16 nLastLFOPosition
const sal_uInt16 LN_PAnld
sal_uInt8 GetPoolHlpFileId() const
sal_uInt16 GetToggleAttrFlags() const
SvStream & ReadUChar(unsigned char &rChar)
std::vector< std::unique_ptr< WW8LSTInfo > > maLSTInfos
eF_ResT Read_F_FormListBox(WW8FieldDesc *pF, OUString &rStr)
sal_uInt16 StyleUsingLFO(sal_uInt16 nLFOIndex) const
virtual sw::mark::IFieldmark * makeNoTextFieldBookmark(const SwPaM &rPaM, const OUString &rName, const OUString &rType)=0
SVX_NUM_CHARS_LOWER_LETTER_N
std::vector< std::unique_ptr< WW8LFOInfo > > m_LFOInfos
void RegisterNumFormatOnTextNode(sal_uInt16 nCurrentLFO, sal_uInt8 nCurrentLevel, const bool bSetAttr=true)
void SetColor(const Color &)
constexpr T & temporary(T &&x)
SvStream & ReadInt32(sal_Int32 &rInt32)
std::size_t ReadBytes(void *pData, std::size_t nSize)
void SetName(const OUString &rName)
Sets the name of the field.
WW8LFOInfo(const WW8LFO &rLFO)
sal_Int32 GetRemLen() const
constexpr TypedWhichId< SvxColorItem > RES_CHRATR_COLOR(3)
SVX_NUM_NUMBER_UPPER_ZH_TW
const SwNumFormat & Get(sal_uInt16 i) const
void SetToggleBiDiAttrFlags(sal_uInt16 nFlags)
void SetStatus(sal_uInt16 nIndex, eBookStatus eStat)
const OUString & GetFamilyName() const
SwTextNode is a paragraph in the document model.
WW8ListManager(SvStream &rSt_, SwWW8ImplReader &rReader_)
void SetAttrListLevel(int nLevel)
Sets the list level of this text node.
#define ODF_FORMCHECKBOX_NAME
void Set(sal_uInt16 i, const SwNumFormat *)
void SetStyleName(const OUString &rStyleName)
constexpr sal_uInt16 RES_CHRATR_BEGIN(HINT_BEGIN)
void SyncIndentWithList(SvxLRSpaceItem &rLR, const SwNumFormat &rFormat, const bool bFirstLineOfstSet, const bool bLeftIndentSet)
SVX_NUM_NUMBER_TRADITIONAL_JA
constexpr OUStringLiteral aCheckBox
void SetFont(const vcl::Font &rNewFont)
const o3tl::enumarray< SvxAdjust, unsigned short > aSvxToUnoAdjust USHRT_MAX
virtual bool InsertPoolItem(const SwPaM &rRg, const SfxPoolItem &, const SetAttrMode nFlags=SetAttrMode::DEFAULT, SwRootFrame const *pLayout=nullptr, bool bExpandCharToPara=false, SwTextAttr **ppNewTextAttr=nullptr)=0
Insert an attribute.
static void PicRead(SvStream *pDataStream, WW8_PIC *pPic, bool bVer67)
VCL_DLLPUBLIC float ConvertFontWeight(FontWeight eWeight)
const SwNumRuleTable & GetNumRuleTable() const
tools::Long GetTextHeight() const
#define ODF_FORMDROPDOWN_LISTENTRY
eF_ResT Read_F_OCX(WW8FieldDesc *, OUString &)
tools::Long GetTextWidth(const OUString &rStr, sal_Int32 nIndex=0, sal_Int32 nLen=-1, vcl::TextLayoutCache const *=nullptr, SalLayoutGlyphs const *const pLayoutCache=nullptr) const
bool ReadLVL(SwNumFormat &rNumFormat, std::unique_ptr< SfxItemSet > &rpItemSet, sal_uInt16 nLevelStyle, bool bSetStartNo, sal_uInt16 nLevel, ww::bytes &rParaSprms)
bool IsInvalidOrToBeMergedTabCell() const
sal_uInt16 MakeNumRule(const OUString &rName, const SwNumRule *pCpy=nullptr, bool bBroadcast=false, const SvxNumberFormat::SvxNumPositionAndSpaceMode eDefaultNumberFormatPositionAndSpaceMode=SvxNumberFormat::LABEL_WIDTH_AND_POSITION)
~WW8ListManager() COVERITY_NOEXCEPT_FALSE
constexpr TypedWhichId< SvxLRSpaceItem > RES_LR_SPACE(91)
SVX_NUM_HANGUL_SYLLABLE_KO
constexpr sal_uInt16 RES_CHRATR_END(46)
SwNumRule * CreateNextRule(bool bSimple)
void SetItalic(FontItalic)
std::unique_ptr< wwSprmParser > m_xSprmParser
void Read_PicLoc(sal_uInt16, const sal_uInt8 *pData, short nLen)
std::shared_ptr< WW8PLCFMan > m_xPlcxMan
sal_uInt16 GetToggleBiDiAttrFlags() const
#define SAL_WARN(area, stream)
void SetHelp(const OUString &rHelp)
Sets the help text of the field.
std::vector< ww::bytes > maParaSprms
virtual SwFieldType * GetSysFieldType(const SwFieldIds eWhich) const =0
bool DelNumRule(const OUString &rName, bool bBroadCast=false)
static OUString sanitizeString(const OUString &rString)
constexpr OUStringLiteral aTextField
OUString read_uInt16_BeltAndBracesString(SvStream &rStrm)
void SetNumberingType(SvxNumType nSet)
virtual void SetChecked(bool checked)=0
virtual bool ResetAttr(sal_uInt16 nWhich1, sal_uInt16 nWhich2=0) override
SwFormat * m_pCurrentColl
OUString read_uInt16_PascalString(SvStream &rStrm)
OUString GetBookmark(tools::Long nStart, tools::Long nEnd, sal_uInt16 &nIndex)
SwCharFormat * WW8aCFormat[WW8ListManager::nMaxLevel]
void Push(PushFlags nFlags=PushFlags::ALL)
bool IsUseEnhancedFields() const
constexpr TypedWhichId< SvxPostureItem > RES_CHRATR_POSTURE(11)
bool SetTextFormatCollAndListLevel(const SwPaM &rRg, SwWW8StyInf &rStyleInfo)
void SetAttrListRestartValue(SwNumberTree::tSwNumTreeNumber nNum)
bool IsOutlineRule() const
const sal_uInt8 * GetSprms() const
const SfxPoolItem * GetCurItem() const
const SwAttrPool & GetAttrPool() const
sal_uInt16 m_nLFOPosition
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
void SetItems(const std::vector< OUString > &rItems)
Sets the items of the dropdown box.
SwWW8ImplReader & rReader
SwNumRule * GetNumRuleForActivation(sal_uInt16 nLFOPosition, const sal_uInt8 nLevel, std::vector< sal_uInt8 > &rParaSprms, SwTextNode *pNode=nullptr)
SwNumRule * GetOutlineNumRule() const
SprmResult GrpprlHasSprm(sal_uInt16 nId, sal_uInt8 &rSprms, sal_uInt8 nLen)
css::awt::Size MiserableDropDownFormHack(const OUString &rString, css::uno::Reference< css::beans::XPropertySet > const &rPropSet)
eF_ResT Read_F_HTMLControl(WW8FieldDesc *pF, OUString &rStr)