28#include <com/sun/star/form/XFormComponent.hpp>
29#include <com/sun/star/drawing/XShape.hpp>
30#include <com/sun/star/drawing/XShapes.hpp>
31#include <com/sun/star/drawing/XControlShape.hpp>
32#include <com/sun/star/lang/XMultiServiceFactory.hpp>
33#include <com/sun/star/container/XIndexContainer.hpp>
34#include <com/sun/star/text/VertOrientation.hpp>
35#include <com/sun/star/text/TextContentAnchorType.hpp>
36#include <com/sun/star/beans/XPropertyContainer.hpp>
37#include <com/sun/star/beans/PropertyAttribute.hpp>
73#include <rtl/character.hxx>
97 sal_Int32
const nPos(rStr.indexOf(0x01));
98 if (pF->
nLCode &&
nPos != -1 && nPos < pF->nLCode) {
135 OUString aBookmarkName;
142 SAL_WARN(
"sw.ww8",
"broken offset, ignoring");
146 sal_uInt16 bkmFindIdx;
147 OUString aBookmarkFind=pB->
GetBookmark(currentCP-1, nEnd, bkmFindIdx);
149 if (!aBookmarkFind.isEmpty()) {
151 if (!aBookmarkFind.isEmpty()) {
152 aBookmarkName=aBookmarkFind;
158 if (pB!=
nullptr && aBookmarkName.isEmpty()) {
162 if (!aBookmarkName.isEmpty()) {
165 if ( aFormula.
msToolTip.getLength() < 139 )
171 if ( aFormula.
mfType == 1 )
172 m_aFieldStack.back().getParameters()[
"Type"] <<= OUString(
"number");
173 else if ( aFormula.
mfType == 2 )
174 m_aFieldStack.back().getParameters()[
"Type"] <<= OUString(
"date");
175 else if ( aFormula.
mfType == 3 )
176 m_aFieldStack.back().getParameters()[
"Type"] <<= OUString(
"currentTime");
177 else if ( aFormula.
mfType == 4 )
178 m_aFieldStack.back().getParameters()[
"Type"] <<= OUString(
"currentDate");
179 else if ( aFormula.
mfType == 5 )
180 m_aFieldStack.back().getParameters()[
"Type"] <<= OUString(
"calculated");
193 if (rStr[pF->
nLCode-1]==0x01)
204 OUString aBookmarkName;
210 sal_uInt16 bkmFindIdx;
211 OUString aBookmarkFind=pB->
GetBookmark(currentCP-1, currentCP+currentLen-1, bkmFindIdx);
213 if (!aBookmarkFind.isEmpty()) {
215 if (!aBookmarkFind.isEmpty()) {
216 aBookmarkName=aBookmarkFind;
221 if (pB!=
nullptr && aBookmarkName.isEmpty()) {
225 if (!aBookmarkName.isEmpty())
230 OSL_ENSURE(pFieldmark!=
nullptr,
"hmmm; why was the bookmark not created?");
231 if (pFieldmark!=
nullptr) {
232 IFieldmark::parameter_map_t*
const pParameters = pFieldmark->GetParameters();
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())
299 IFieldmark *pFieldmark =
301 OSL_ENSURE(pFieldmark!=
nullptr,
"hmmm; why was the bookmark not created?");
302 if ( pFieldmark !=
nullptr )
304 uno::Sequence< OUString > vListEntries(aFormula.
maListEntries.size());
363 sal_Int32 nV6DxaSpace;
394 nStartAt(1), nLevel(0), bStartAt(
true), bFormat(
false) {}
450 , pNumRule(rLFO.pNumRule)
451 , nIdLst(rLFO.nIdLst)
452 , nLfoLvl(rLFO.nLfoLvl)
453 , bOverride(rLFO.nLfoLvl != 0)
475 explicit ListWithId(sal_uInt32 nIdLst) : mnIdLst(nIdLst) {}
476 bool operator() (
const std::unique_ptr<WW8LSTInfo>& pEntry)
const
477 {
return (pEntry->nIdLst == mnIdLst); }
489 return aResult->get();
648 sal_uInt16 nLevelStyle,
bool bSetStartNo, sal_uInt16 ,
ww::bytes &rParaSprms)
665 aLVL.nAlign = (aBits1 & 0x03);
666 if( aBits1 & 0x10 ) aLVL.bV6Prev =
true;
667 if( aBits1 & 0x20 ) aLVL.bV6PrSp =
true;
668 if( aBits1 & 0x40 ) aLVL.bV6 =
true;
695 if( aLVL.nLenGrpprlPapx )
698 if (aLVL.nLenGrpprlPapx !=
m_rSt.
ReadBytes(&aGrpprlPapx, aLVL.nLenGrpprlPapx))
703 aSprm =
GrpprlHasSprm(0x845E,aGrpprlPapx[0],aLVL.nLenGrpprlPapx);
709 rParaSprms.push_back(*pBegin++);
710 short nDxaLeft = SVBT16ToUInt16(aSprm.
pSprm);
711 aLVL.nDxaLeft = (0 < nDxaLeft) ? o3tl::narrowing<sal_uInt16>(nDxaLeft)
712 : o3tl::narrowing<sal_uInt16>(-nDxaLeft);
716 aSprm =
GrpprlHasSprm(0x8411,aGrpprlPapx[0],aLVL.nLenGrpprlPapx);
718 aSprm =
GrpprlHasSprm(0x8460,aGrpprlPapx[0],aLVL.nLenGrpprlPapx);
724 rParaSprms.push_back(*pBegin++);
725 aLVL.nDxaLeft1 = SVBT16ToUInt16(aSprm.
pSprm);
729 aSprm =
GrpprlHasSprm(0xC615,aGrpprlPapx[0],aLVL.nLenGrpprlPapx);
740 nTabPos = SVBT16ToUInt16(pSprm);
749 OSL_ENSURE(bDone,
"tab setting in numbering is "
750 "of unexpected configuration");
761 const sal_uInt16 nDesired = aLVL.nDxaLeft + aLVL.nDxaLeft1;
763 bool bDoAdjust =
false;
764 if ( nDesired < aLVL.nDxaLeft )
766 if ( nDesired < nTabPos && nTabPos < aLVL.nDxaLeft )
773 if ( aLVL.nDxaLeft < nTabPos && nTabPos < nDesired )
781 aLVL.nDxaLeft = (0 < nTabPos)
782 ? o3tl::narrowing<sal_uInt16>(nTabPos)
783 : o3tl::narrowing<sal_uInt16>(-nTabPos);
785 aLVL.nDxaLeft1 = nDesired - aLVL.nDxaLeft;
793 sal_uInt16 nWitchPicIsBullet = USHRT_MAX;
794 bool bIsPicBullet =
false;
796 if( aLVL.nLenGrpprlChpx )
799 if (aLVL.nLenGrpprlChpx !=
m_rSt.
ReadBytes(&aGrpprlChpx, aLVL.nLenGrpprlChpx))
807 nWitchPicIsBullet = *aSprmWhichPis.
pSprm;
811 bIsPicBullet = (*aSprmIsPicBullet.
pSprm) & 0x0001;
821 sal_uInt16 nNewColl = nLevelStyle;
833 WW8SprmIter aSprmIter(&aGrpprlChpx[0], aLVL.nLenGrpprlChpx,
861 if (style::NumberingType::CHAR_SPECIAL ==
nType)
863 cBullet = !sNumString.isEmpty()
864 ? sNumString.iterateCodePoints(&
o3tl::temporary(sal_Int32(0))) : 0x2190;
869 else if (style::NumberingType::BITMAP ==
nType)
871 cGrfBulletCP = nWitchPicIsBullet;
874 switch( aLVL.nAlign )
877 eAdj = SvxAdjust::Left;
880 eAdj = SvxAdjust::Center;
883 eAdj = SvxAdjust::Right;
887 eAdj = SvxAdjust::Left;
891 OSL_ENSURE(
false,
"Value of aLVL.nAlign is not supported" );
893 eAdj = SvxAdjust::Left;
898 if( bSetStartNo && 0 <= aLVL.nStartAt)
899 rNumFormat.
SetStart(o3tl::narrowing<sal_uInt16>(aLVL.nStartAt));
903 if( style::NumberingType::CHAR_SPECIAL ==
nType )
911 else if (style::NumberingType::BITMAP ==
nType)
918 OUString sListFormat = sNumString;
919 if (sListFormat.getLength())
921 sal_uInt32 nExtraOffset = 0;
923 while (nLevelB <
nMaxLevel && aLVL.aOfsNumsXCH[nLevelB])
926 sal_uInt8 nOffset = aLVL.aOfsNumsXCH[nLevelB] + nExtraOffset - 1;
927 if (nOffset >= sListFormat.getLength())
929 SAL_WARN(
"sw.ww8",
"List level reference is beyond the border. Ignored.");
933 sal_uInt8 nReplacement = sListFormat[nOffset] + 1;
935 OUString sReplacement(
"%" + OUString::number(nReplacement) +
"%");
936 sListFormat = sListFormat.replaceAt(nOffset, 1, sReplacement);
939 nExtraOffset += sReplacement.getLength() - 1;
956 if (eAdj == SvxAdjust::Right)
977 switch ( ixchFollow )
1002 WW8aISet
const & rListItemSet,
WW8aCFormat& rCharFormat,
bool& bNewCharFormatCreated,
1003 const OUString& sPrefix )
1005 bNewCharFormatCreated =
false;
1011 SfxItemSet* pThisLevelItemSet = rListItemSet[nLevel].get();
1013 if( pThisLevelItemSet && pThisLevelItemSet->
Count())
1017 for (
sal_uInt8 nLowerLevel = 0; nLowerLevel < nLevel; ++nLowerLevel)
1019 SfxItemSet* pLowerLevelItemSet = rListItemSet[nLowerLevel].get();
1020 if( pLowerLevelItemSet
1021 && (pLowerLevelItemSet->
Count() == pThisLevelItemSet->
Count()) )
1023 nIdenticalItemSetLevel = nLowerLevel;
1028 (SfxItemState::SET != pLowerLevelItemSet->
GetItemState(
1029 pItemIter->
Which(),
false, &pItem ) )
1031 (*pItem != *pItemIter) )
1039 }
while (pItemIter);
1041 if( nIdenticalItemSetLevel !=
nMaxLevel )
1047 if (
nMaxLevel == nIdenticalItemSetLevel)
1051 +
"z" + OUString::number( nLevel ) );
1055 bNewCharFormatCreated =
true;
1062 pFormat = rCharFormat[ nIdenticalItemSetLevel ];
1066 rCharFormat[ nLevel ] = pFormat;
1097 rNumRule.
Set(nLevel, aNumFormat);
1125 : maSprmParser(rReader_.GetFib()), m_rReader(rReader_)
1126 ,
m_rDoc(m_rReader.GetDoc())
1127 , m_rFib(m_rReader.GetFib()), m_rSt(rSt_)
1129 , m_nLastLFOPosition(USHRT_MAX)
1152 sal_uInt16 nListCount(0);
1154 nRemainingPlcfLst -= 2;
1155 bOk = nListCount > 0;
1161 const size_t nMinRecordSize = 10 + 2*
nMaxLevel;
1163 if (nListCount > nMaxRecords)
1165 SAL_WARN(
"sw.ww8",
"Parsing error: " << nMaxRecords <<
1166 " max possible entries, but " << nListCount <<
" claimed, truncating");
1167 nListCount = nMaxRecords;
1169 for (sal_uInt16 nList=0; nList < nListCount; ++nList)
1171 if (nRemainingPlcfLst <
cbLSTF)
1180 for (sal_uInt16 & nLevel : aLST.aIdSty)
1189 aLST.bSimpleList =
true;
1191 aLST.bRestartHdn =
true;
1210 aLST.bSimpleList || (aBits1 & 0x10));
1215 nRemainingPlcfLst -=
cbLSTF;
1220 sal_uInt16 nLSTInfos =
static_cast< sal_uInt16
>(
maLSTInfos.size());
1221 for (sal_uInt16 nList = 0; nList < nLSTInfos; ++nList)
1226 if( !pListInfo || !pListInfo->
pNumRule )
break;
1233 for (sal_uInt16 nLevel = 0; nLevel < nLvlCount; ++nLevel)
1237 bLVLOk =
ReadLVL( aNumFormat, aItemSet[nLevel],
1238 pListInfo->
aIdSty[nLevel],
true, nLevel,
1243 rMyNumRule.
Set( nLevel, aNumFormat );
1251 for (sal_uInt16 nLevel = 0; nLevel < nLvlCount; ++nLevel)
1254 AdjustLVL( nLevel, rMyNumRule, aItemSet,
1266 sal_Int32 nLfoCount(0);
1268 bOk = nLfoCount > 0;
1275 for (sal_Int32 nLfo = 0; nLfo < nLfoCount; ++nLfo)
1293 if (pParentListInfo)
1296 aLFO.pNumRule = pParentListInfo->
pNumRule;
1302 std::unique_ptr<WW8LFOInfo> pLFOInfo(
new WW8LFOInfo(aLFO));
1303 if (pParentListInfo)
1307 int nMaxSize = pParentListInfo->
maParaSprms.size();
1308 pLFOInfo->maParaSprms.resize(nMaxSize);
1309 for (
int i = 0;
i < nMaxSize; ++
i)
1322 for (
size_t nLfo = 0; nLfo < nLFOInfos; ++nLfo)
1329 if (!pParentListInfo)
1335 OSL_ENSURE(pParentNumRule,
"ww: Impossible lists, please report");
1336 if( !pParentNumRule )
1340 const OUString
sPrefix(
"WW8NumSt" + OUString::number( nLfo + 1 ));
1378 while (nTest == 0xFFFFFFFF);
1397 aLFOLVL.nLevel = aBits1 & 0x0F;
1398 if( (0xFF > aBits1) &&
1402 aLFOLVL.bStartAt =
true;
1404 aLFOLVL.bStartAt =
false;
1412 aLFOLVL.bFormat =
true;
1416 ReadLVL(aNumFormat, aItemSet[nLevel],
1417 pParentListInfo->
aIdSty[nLevel],
1418 aLFOLVL.bStartAt, nLevel,
1424 else if (aLFOLVL.bStartAt)
1427 writer_cast<sal_uInt16>(aLFOLVL.nStartAt));
1432 rLFOInfo.
pNumRule->
Set(aLFOLVL.nLevel, aNumFormat);
1444 bool bNewCharFormatCreated =
false;
1448 bNewCharFormatCreated,
sPrefix );
1465 if (rpInfo->pNumRule && !rpInfo->bUsedInDoc &&
1466 rpInfo->pNumRule->IsAutoRule())
1474 if ((*aIter)->bOverride
1475 && (*aIter)->pNumRule
1476 && !(*aIter)->bUsedInDoc
1477 && (*aIter)->pNumRule->IsAutoRule())
1562 if( pParentListInfo )
1572 bool bRestart(
false);
1573 sal_uInt16 nStart(0);
1574 bool bNewstart(
false);
1584 OSL_ENSURE(pParentListInfo,
"ww: Impossible lists, please report");
1585 if (pParentListInfo && pParentListInfo->
pNumRule)
1587 const WW8LFOLVL &rOverride = rLFOInfo.
maOverrides[nLevel];
1588 bool bNoChangeFromParent =
1592 if (bNoChangeFromParent)
1597 if (bFirstUse && rOverride.bStartAt)
1611 nStart = writer_cast<sal_uInt16>
1625 if (bRestart || bNewstart)
1643 OSL_ENSURE( pTextNode,
"No Text-Node at PaM-Position" );
1661 const bool bApplyListStyle =
false;
1717 OSL_ENSURE(
m_pCurrentColl,
"Cannot be called outside of style import");
1722 if (nCurrentLFO < USHRT_MAX)
1731 std::vector<sal_uInt8> aParaSprms;
1758 std::vector<sal_uInt8> aParaSprms;
1762 if (pNmRule !=
nullptr)
1782 const bool bSetAttr)
1793 OSL_ENSURE(pTextNd,
"No Text-Node at PaM-Position");
1806 if (nCurrentLFO < USHRT_MAX && nCurrentLevel ==
MAXLEVEL)
1809 std::vector<sal_uInt8> aParaSprms;
1811 m_xLstManager->GetNumRuleForActivation( nCurrentLFO, nCurrentLevel,
1812 aParaSprms, pTextNd) :
nullptr;
1814 if (pRule ==
nullptr && bSetAttr)
1817 if (bSetAttr && pTextNd->
GetNumRule() != pRule
1838 bool bApplyListLevelIndentDirectlyAtPara(
true);
1846 bApplyListLevelIndentDirectlyAtPara =
false;
1851 if (!bApplyListLevelIndentDirectlyAtPara)
1854 auto pListIndent = std::make_unique<SfxItemSet>(
m_rDoc.
GetAttrPool(), svl::Items<RES_MARGIN_FIRSTLINE, RES_MARGIN_TEXTLEFT>);
1857 OSL_ENSURE(pItem,
"impossible");
1859 pListIndent->Put(*pItem);
1862 pListIndent->Put(*pItem);
1869 if (
short nLen =
static_cast< short >(aParaSprms.size()))
1871 std::unique_ptr<SfxItemSet> pOldCurrentItemSet(
SetCurrentItemSet(std::move(pListIndent)));
1945 assert(
false &&
"m_nLFOPosition is usually reset immediately, so we rarely ever get here.");
1970 short nData = SVBT16ToUInt16(
pData );
2009 pTextNode->SetAttr( aEmptyRule );
2012 std::shared_ptr<SvxFirstLineIndentItem> pFirstLine(std::make_shared<SvxFirstLineIndentItem>(
RES_MARGIN_FIRSTLINE));
2022 pFirstLine->SetTextFirstLineOffset(0);
2026 pTextNode->SetAttr(*pFirstLine);
2027 pTextNode->SetAttr(leftMargin);
2076 WW8_CP nEndCp = nStart+1;
2082 while(nStart <= nEndCp)
2106 if (bValid && aPic.
lcb > 0x3A)
2123 const uno::Reference< lang::XMultiServiceFactory > & rServiceFactory =
2124 GetServiceFactory();
2126 if(!rServiceFactory.is())
2130 uno::Reference< form::XFormComponent> xFComp;
2132 if (rFormula.
Import(rServiceFactory, xFComp, aSz))
2134 uno::Reference <drawing::XShape> xShapeRef;
2136 GetShapes()->add(xShapeRef);
2152 SAL_WARN(
"sw.ww8",
"Parsing error: invalid header for FFData");
2166 OSL_ENSURE( iType == nWhich,
"something wrong, expect control type read from stream doesn't match nWhich passed in");
2167 if ( iType != nWhich )
2189 sal_uInt16 wDef = 0;
2196 msDefault = ( wDef == 0 ) ? std::u16string_view(
u"0" ) : std::u16string_view(
u"1" );
2215 sal_uInt16 fExtend = 0;
2217 sal_uInt16 nStringsCnt = 0;
2221 if (fExtend != 0xFFFF)
2226 sal_uInt16 cbExtra = 0;
2229 OSL_ENSURE(bAllOk,
"Unknown formfield dropdown list structure");
2232 const size_t nMinRecordSize =
sizeof(sal_uInt16);
2233 const size_t nMaxRecords = pDataStream->
remainingSize() / nMinRecordSize;
2234 if (nStringsCnt > nMaxRecords)
2236 SAL_WARN(
"sw.ww8",
"Parsing error: " << nMaxRecords <<
2237 " max possible entries, but " << nStringsCnt <<
" claimed, truncating");
2238 nStringsCnt = nMaxRecords;
2241 for (sal_uInt32 nI = 0; nI < nStringsCnt; ++nI)
2254 mfType = (nField & 0x38)>>3;
2266 uno::Reference<beans::XPropertySet>
const & rPropSet)
2269 struct CtrlFontMapEntry
2271 sal_uInt16 nWhichId;
2272 const char* pPropNm;
2274 const CtrlFontMapEntry aMapTable[] =
2287 uno::Reference< beans::XPropertySetInfo > xPropSetInfo =
2288 rPropSet->getPropertySetInfo();
2291 for (
const CtrlFontMapEntry* pMap = aMapTable; pMap->nWhichId; ++pMap)
2295 OSL_ENSURE(pItem,
"Impossible");
2299 switch ( pMap->nWhichId )
2304 if (xPropSetInfo->hasPropertyByName(aNm =
"TextColor"))
2307 rPropSet->setPropertyValue(aNm, aTmp);
2316 if (xPropSetInfo->hasPropertyByName(aNm =
"FontStyleName"))
2319 rPropSet->setPropertyValue( aNm, aTmp );
2321 if (xPropSetInfo->hasPropertyByName(aNm =
"FontFamily"))
2323 aTmp <<= static_cast<sal_Int16>(pFontItem->
GetFamily());
2324 rPropSet->setPropertyValue( aNm, aTmp );
2326 if (xPropSetInfo->hasPropertyByName(aNm =
"FontCharset"))
2328 aTmp <<= static_cast<sal_Int16>(pFontItem->
GetCharSet());
2329 rPropSet->setPropertyValue( aNm, aTmp );
2331 if (xPropSetInfo->hasPropertyByName(aNm =
"FontPitch"))
2333 aTmp <<= static_cast<sal_Int16>(pFontItem->
GetPitch());
2334 rPropSet->setPropertyValue( aNm, aTmp );
2350 aTmp <<= static_cast<float>(aSize.
Height()) / 20.0;
2363 aTmp <<= static_cast<sal_Int16>(
static_cast<const SvxUnderlineItem*
>(pItem)->GetLineStyle());
2368 aTmp <<= static_cast<sal_Int16>(
static_cast<const SvxCrossedOutItem*
>(pItem)->GetStrikeout() );
2373 aTmp <<= static_cast<sal_Int16>(
static_cast<const SvxPostureItem*
>(pItem)->GetPosture() );
2382 if (bSet && xPropSetInfo->hasPropertyByName(OUString::createFromAscii(pMap->pPropNm)))
2383 rPropSet->setPropertyValue(OUString::createFromAscii(pMap->pPropNm), aTmp);
2387 OSL_ENSURE(
pOut,
"Impossible");
2391 pOut->SetMapMode(
MapMode( MapUnit::Map100thMM ));
2392 pOut->SetFont( aFont );
2393 aRet.Width =
pOut->GetTextWidth(rString);
2395 aRet.Height =
pOut->GetTextHeight();
2402 lang::XMultiServiceFactory> &rServiceFactory,
2403 uno::Reference <form::XFormComponent> &rFComp,awt::Size &rSz )
2405 uno::Reference<uno::XInterface> xCreate = rServiceFactory->createInstance(
"com.sun.star.form.component.ComboBox");
2409 rFComp.set(xCreate, uno::UNO_QUERY);
2413 uno::Reference<beans::XPropertySet> xPropSet(xCreate, uno::UNO_QUERY);
2420 xPropSet->setPropertyValue(
"Name", aTmp );
2425 xPropSet->setPropertyValue(
"HelpText", aTmp );
2428 xPropSet->setPropertyValue(
"Dropdown", css::uno::Any(
true));
2433 uno::Sequence< OUString > aListSource(nLen);
2434 auto aListSourceRange = asNonConstRange(aListSource);
2435 for (sal_uInt32 nI = 0; nI < nLen; ++nI)
2437 aTmp <<= aListSource;
2438 xPropSet->setPropertyValue(
"StringItemList", aTmp );
2446 aTmp <<= aListSource[0];
2449 xPropSet->setPropertyValue(
"DefaultText", aTmp );
2455 static constexpr OUStringLiteral aBlank =
2456 u"\u2002\u2002\u2002\u2002\u2002";
2469(uno::Reference<beans::XPropertySet>
const & xPropSet,
2470 const OUString & rPropertyName,
const OUString & rValue)
2472 uno::Reference<beans::XPropertySetInfo> xPropSetInfo =
2473 xPropSet->getPropertySetInfo();
2474 if (xPropSetInfo.is() &&
2475 ! xPropSetInfo->hasPropertyByName(rPropertyName))
2477 uno::Reference<beans::XPropertyContainer>
2478 xPropContainer(xPropSet, uno::UNO_QUERY);
2480 xPropContainer->addProperty
2482 static_cast<sal_Int16
>(beans::PropertyAttribute::BOUND |
2483 beans::PropertyAttribute::REMOVABLE),
2488 xPropSet->setPropertyValue(rPropertyName, aAnyValue );
2492 lang::XMultiServiceFactory> &rServiceFactory,
2493 uno::Reference <form::XFormComponent> &rFComp,awt::Size &rSz )
2495 uno::Reference< uno::XInterface > xCreate = rServiceFactory->createInstance(
"com.sun.star.form.component.CheckBox");
2499 rFComp.set( xCreate, uno::UNO_QUERY );
2503 uno::Reference< beans::XPropertySet > xPropSet( xCreate, uno::UNO_QUERY );
2513 xPropSet->setPropertyValue(
"Name", aTmp );
2515 aTmp <<= static_cast<sal_Int16>(
mnChecked);
2516 xPropSet->setPropertyValue(
"DefaultState", aTmp);
2534 const uno::Reference< form::XFormComponent > & rFComp,
2535 const awt::Size& rSize, uno::Reference< drawing::XShape > *pShape,
2538 const uno::Reference< container::XIndexContainer > &rComps = GetFormComps();
2540 rComps->insertByIndex( rComps->getCount(), aTmp );
2542 const uno::Reference< lang::XMultiServiceFactory > &rServiceFactory =
2543 GetServiceFactory();
2544 if( !rServiceFactory.is() )
2547 uno::Reference< uno::XInterface > xCreate = rServiceFactory->createInstance(
2548 "com.sun.star.drawing.ControlShape");
2552 uno::Reference< drawing::XShape > xShape(xCreate, uno::UNO_QUERY);
2554 OSL_ENSURE(xShape.is(),
"Did not get XShape");
2555 xShape->setSize(rSize);
2557 uno::Reference< beans::XPropertySet > xShapePropSet(
2558 xCreate, uno::UNO_QUERY );
2562 text::TextContentAnchorType nTemp;
2564 nTemp = text::TextContentAnchorType_AT_PARAGRAPH;
2566 nTemp = text::TextContentAnchorType_AS_CHARACTER;
2568 xShapePropSet->setPropertyValue(
"AnchorType",
uno::Any(
static_cast<sal_Int16
>(nTemp)) );
2570 xShapePropSet->setPropertyValue(
"VertOrient",
uno::Any(sal_Int16(text::VertOrientation::TOP)) );
2572 uno::Reference< text::XText > xDummyTextRef;
2573 uno::Reference< text::XTextRange > xTextRg =
2577 xShapePropSet->setPropertyValue(
"TextRange", aTmp );
2580 uno::Reference< drawing::XControlShape > xControlShape( xShape,
2582 uno::Reference< awt::XControlModel > xControlModel( rFComp,
2584 xControlShape->setControl( xControlModel );
static OutputDevice * GetDefaultDevice()
virtual bool InsertPoolItem(const SwPaM &rRg, const SfxPoolItem &, const SetAttrMode nFlags=SetAttrMode::DEFAULT, SwRootFrame const *pLayout=nullptr, SwTextAttr **ppNewTextAttr=nullptr)=0
Insert an attribute.
virtual SwFieldType * GetSysFieldType(const SwFieldIds eWhich) const =0
Provides access to the marks of a document.
virtual sw::mark::IFieldmark * makeNoTextFieldBookmark(const SwPaM &rPaM, const OUString &rName, const OUString &rType)=0
const SfxPoolItem * GetCurItem() const
const SfxPoolItem * NextItem()
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const=0
constexpr tools::Long Height() const
constexpr tools::Long Width() const
SvStream & ReadUInt32(sal_uInt32 &rUInt32)
sal_uInt64 Seek(sal_uInt64 nPos)
SvStream & ReadInt32(sal_Int32 &rInt32)
std::size_t ReadBytes(void *pData, std::size_t nSize)
sal_uInt64 SeekRel(sal_Int64 nPos)
SvStream & ReadUInt16(sal_uInt16 &rUInt16)
sal_uInt64 remainingSize()
SvStream & ReadUChar(unsigned char &rChar)
static SvtFilterOptions & Get()
bool IsUseEnhancedFields() const
void SetTextFirstLineOffset(const short nF, const sal_uInt16 nProp=100)
sal_uInt32 GetHeight() const
FontFamily GetFamily() const
FontPitch GetPitch() const
const OUString & GetStyleName() const
rtl_TextEncoding GetCharSet() const
const OUString & GetFamilyName() const
void SetNumberingType(SvxNumType nSet)
SvxNumType GetNumberingType() const
void SetTextLeft(const tools::Long nL, const sal_uInt16 nProp=100)
const SwCharFormat * GetDfltCharFormat() const
OUString GetUniqueNumRuleName(const OUString *pChkStr=nullptr, bool bAutoNum=true) const
const SwNumRuleTable & GetNumRuleTable() const
SwNumRule * GetOutlineNumRule() const
IDocumentContentOperations const & getIDocumentContentOperations() const
IDocumentFieldsAccess const & getIDocumentFieldsAccess() const
IDocumentMarkAccess * getIDocumentMarkAccess()
bool DelNumRule(const OUString &rName, bool bBroadCast=false)
const SwAttrPool & GetAttrPool() const
SwCharFormat * MakeCharFormat(const OUString &rFormatName, SwCharFormat *pDerivedFrom, bool bBroadcast=false)
bool SetTextFormatColl(const SwPaM &rRg, SwTextFormatColl *pFormat, const bool bReset=true, const bool bResetListAttrs=false, SwRootFrame const *pLayout=nullptr)
Add 4th optional parameter <bResetListAttrs>.
sal_uInt16 MakeNumRule(const OUString &rName, const SwNumRule *pCpy=nullptr, bool bBroadcast=false, const SvxNumberFormat::SvxNumPositionAndSpaceMode eDefaultNumberFormatPositionAndSpaceMode=SvxNumberFormat::LABEL_WIDTH_AND_POSITION)
Field type for dropdown boxes.
void SetSelectedItem(const OUString &rItem)
Sets the selected item.
void SetToolTip(const OUString &rToolTip)
Sets the tool tip of the field.
void SetItems(std::vector< OUString > &&rItems)
Sets the items of the dropdown box.
void SetHelp(const OUString &rHelp)
Sets the help text of the field.
void SetName(const OUString &rName)
Sets the name of the field.
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
void InsertFormula(WW8FormulaControl &rFormula)
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
void SetAutoRule(bool bFlag)
sal_uInt8 GetPoolHlpFileId() const
bool IsOutlineRule() const
bool IsContinusNum() const
const SwNumFormat & Get(sal_uInt16 i) const
void Set(sal_uInt16 i, const SwNumFormat *)
const OUString & GetName() const
sal_uInt16 GetPoolFormatId() const
Query and set PoolFormat IDs.
void SetContinusNum(bool bFlag)
SwNumRuleType GetRuleType() const
sal_uInt16 GetPoolHelpId() const
Query and set Help-IDs for document styles.
PaM is Point and Mark: a selection of the document model.
SwNode & GetPointNode() const
const SwPosition * GetPoint() const
Represents the style of a paragraph.
SwTextNode is a paragraph in the document model.
void SetAttrListLevel(int nLevel)
Sets the list level of this text node.
void SetListRestart(bool bRestart)
virtual bool SetAttr(const SfxPoolItem &) override
overriding to handle change of certain paragraph attributes
void SetCountedInList(bool bCounted)
SwNumRule * GetNumRule(bool bInParent=true) const
Returns numbering rule of this text node.
void SetAttrListRestartValue(SwNumberTree::tSwNumTreeNumber nNum)
virtual bool ResetAttr(sal_uInt16 nWhich1, sal_uInt16 nWhich2=0) override
sal_uInt16 m_nLFOPosition
eF_ResT Read_F_FormTextBox(WW8FieldDesc *pF, OUString &rStr)
css::awt::Size MiserableDropDownFormHack(const OUString &rString, css::uno::Reference< css::beans::XPropertySet > const &rPropSet)
std::vector< SwWW8StyInf > m_vColl
void Read_ANLevelNo(sal_uInt16, const sal_uInt8 *pData, short nLen)
std::unique_ptr< SwMSConvertControls > m_xFormImpl
eF_ResT Read_F_OCX(WW8FieldDesc *, OUString &)
eF_ResT Read_F_FormCheckBox(WW8FieldDesc *pF, OUString &rStr)
std::unique_ptr< SwWW8FltControlStack > m_xCtrlStck
eF_ResT Read_F_HTMLControl(WW8FieldDesc *pF, OUString &rStr)
bool ImportFormulaControl(WW8FormulaControl &rBox, WW8_CP nStart, SwWw8ControlType nWhich)
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.
sal_uInt16 GetToggleAttrFlags() const
sal_uInt16 m_nCurrentColl
void SetNCurrentColl(sal_uInt16 nColl)
void Read_ListLevel(sal_uInt16 nId, const sal_uInt8 *pData, short nLen)
sal_uInt16 StyleUsingLFO(sal_uInt16 nLFOIndex) const
std::shared_ptr< WW8PLCFMan > m_xPlcxMan
sal_uInt16 GetToggleBiDiAttrFlags() const
void RegisterNumFormat(sal_uInt16 nCurrentLFO, sal_uInt8 nCurrentLevel)
void SetToggleAttrFlags(sal_uInt16 nFlags)
std::deque< WW8FieldEntry > m_aFieldStack
const SwNumRule * m_pChosenWW8OutlineStyle
bool IsInvalidOrToBeMergedTabCell() const
void Read_PicLoc(sal_uInt16, const sal_uInt8 *pData, short nLen)
std::unique_ptr< WW8ListManager > m_xLstManager
OUString GetFieldResult(WW8FieldDesc const *pF)
eF_ResT Read_F_FormListBox(WW8FieldDesc *pF, OUString &rStr)
void SetStylesList(sal_uInt16 nStyle, sal_uInt16 nCurrentLFO, sal_uInt8 nCurrentLevel)
void RegisterNumFormatOnTextNode(sal_uInt16 nCurrentLFO, sal_uInt8 nCurrentLevel, const bool bSetAttr=true)
SwFormat * m_pCurrentColl
std::unique_ptr< WW8RStyle > m_xStyles
sal_uInt16 GetCurrentColl() const
void SetToggleBiDiAttrFlags(sal_uInt16 nFlags)
static SAL_WARN_UNUSED_RESULT bool PicRead(SvStream *pDataStream, WW8_PIC *pPic, bool bVer67)
std::optional< wwSprmParser > m_oSprmParser
std::unique_ptr< SfxItemSet > SetCurrentItemSet(std::unique_ptr< SfxItemSet > pItemSet)
bool SetTextFormatCollAndListLevel(const SwPaM &rRg, SwWW8StyInf &rStyleInfo)
void RegisterNumFormatOnStyle(sal_uInt16 nStyle)
const SfxPoolItem * GetFormatAttr(sal_uInt16 nWhich)
short ImportSprm(const sal_uInt8 *pPos, sal_Int32 nMemLen, sal_uInt16 nId=0)
bool m_bListRelevantIndentSet
SwNumRule * m_pOutlineNumrule
std::shared_ptr< SvxRightMarginItem > m_pWordRightMargin
bool IsWW8BuiltInHeadingStyle() const
bool HasWW8OutlineLevel() const
std::shared_ptr< SvxFirstLineIndentItem > m_pWordFirstLine
std::shared_ptr< SvxTextLeftMarginItem > m_pWordLeftMargin
sal_uInt8 m_nVersion
Program-Version asked for by us: in Ctor we check if it matches the value of nFib.
sal_uInt16 m_nLastLFOPosition
wwSprmParser maSprmParser
std::vector< std::unique_ptr< WW8LSTInfo > > maLSTInfos
SprmResult GrpprlHasSprm(sal_uInt16 nId, sal_uInt8 &rSprms, sal_uInt8 nLen)
SwNumRule * CreateNextRule(bool bSimple)
WW8LSTInfo * GetLSTByListId(sal_uInt32 nIdLst) const
SwNumRule * GetNumRuleForActivation(sal_uInt16 nLFOPosition, const sal_uInt8 nLevel, std::vector< sal_uInt8 > &rParaSprms, SwTextNode *pNode=nullptr)
WW8ListManager(SvStream &rSt_, SwWW8ImplReader &rReader_)
bool ReadLVL(SwNumFormat &rNumFormat, std::unique_ptr< SfxItemSet > &rpItemSet, sal_uInt16 nLevelStyle, bool bSetStartNo, sal_uInt16 nLevel, ww::bytes &rParaSprms)
void AdjustLVL(sal_uInt8 nLevel, SwNumRule &rNumRule, WW8aISet const &rListItemSet, WW8aCFormat &aCharFormat, bool &bNewCharFormatCreated, const OUString &aPrefix=OUString())
std::unique_ptr< SfxItemSet > WW8aISet[nMaxLevel]
SwNumRule * GetNumRule(size_t i)
SwCharFormat * WW8aCFormat[nMaxLevel]
static SvxNumType GetSvxNumTypeFromMSONFC(sal_uInt16 nMSONFC)
std::vector< std::unique_ptr< WW8LFOInfo > > m_LFOInfos
SwWW8ImplReader & m_rReader
void SetStatus(sal_uInt16 nIndex, eBookStatus eStat)
OUString GetUniqueBookmarkName(const OUString &rSuggestedName)
OUString GetBookmark(tools::Long nStart, tools::Long nEnd, sal_uInt16 &nIndex)
void Restore(SwWW8ImplReader *pRdr)
simple Iterator for SPRMs
const sal_uInt8 * GetSprms() const
sal_Int32 GetRemLen() const
sal_uInt16 GetCurrentId() const
virtual void SetChecked(bool checked)=0
void SetFontSize(const Size &)
void SetStyleName(const OUString &rStyleName)
void SetPitch(FontPitch ePitch)
void SetColor(const Color &)
void SetItalic(FontItalic)
void SetWeight(FontWeight)
void SetFamily(FontFamily)
void SetUnderline(FontLineStyle)
void SetCharSet(rtl_TextEncoding)
const Size & GetFontSize() const
void SetFamilyName(const OUString &rFamilyName)
void SetStrikeout(FontStrikeout)
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.
#define suppress_fun_call_w_exception(expr)
constexpr TypedWhichId< SvxCrossedOutItem > RES_CHRATR_CROSSEDOUT(5)
constexpr TypedWhichId< SvxUnderlineItem > RES_CHRATR_UNDERLINE(14)
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_FONTSIZE(8)
constexpr TypedWhichId< SvxFirstLineIndentItem > RES_MARGIN_FIRSTLINE(91)
constexpr TypedWhichId< SvxWeightItem > RES_CHRATR_WEIGHT(15)
constexpr TypedWhichId< SvxPostureItem > RES_CHRATR_POSTURE(11)
constexpr TypedWhichId< SwNumRuleItem > RES_PARATR_NUMRULE(72)
constexpr TypedWhichId< SvxRightMarginItem > RES_MARGIN_RIGHT(93)
constexpr TypedWhichId< SvxTextLeftMarginItem > RES_MARGIN_TEXTLEFT(92)
constexpr TypedWhichId< SvxFontItem > RES_CHRATR_FONT(7)
constexpr TypedWhichId< SvxColorItem > RES_CHRATR_COLOR(3)
const SfxPoolItem * GetDfltAttr(sal_uInt16 nWhich)
Get the default attribute from corresponding default attribute table.
#define SAL_WARN(area, stream)
std::unique_ptr< sal_Int32[]> pData
const sal_uInt16 LN_PAnld
constexpr OUStringLiteral aCheckBox
constexpr OUStringLiteral aTextField
constexpr OUStringLiteral aListBox
OUString sanitizeStringSurrogates(const OUString &rString)
sal_Int32 getTokenCount(std::string_view rIn, char cTok)
const vcl::Font & GetDefBulletFont()
retrieve font used for the default bullet list characters
std::enable_if< std::is_signed< T >::value, bool >::type checked_add(T a, T b, T &result)
constexpr Point convert(const Point &rPoint, o3tl::Length eFrom, o3tl::Length eTo)
constexpr T & temporary(T &&x)
VCL_DLLPUBLIC float ConvertFontWeight(FontWeight eWeight)
std::vector< sal_uInt8 > bytes
constexpr OUStringLiteral ODF_FORMTEXT
constexpr OUStringLiteral ODF_FORMCHECKBOX_HELPTEXT
constexpr OUStringLiteral ODF_FORMDROPDOWN_RESULT
constexpr OUStringLiteral ODF_FORMDROPDOWN_LISTENTRY
constexpr OUStringLiteral ODF_FORMCHECKBOX
constexpr OUStringLiteral ODF_FORMDROPDOWN
TOOLS_DLLPUBLIC bool checkSeek(SvStream &rSt, sal_uInt64 nOffset)
static constexpr sal_uInt16 val
WW8_CP nLen
total length (to skip over text)
WW8_CP nSCode
start of instructions code
WW8LFOInfo(const WW8LFO &rLFO)
std::vector< ww::bytes > maParaSprms
std::vector< WW8LFOLVL > maOverrides
WW8LSTInfo(SwNumRule *pNumRule_, const WW8LST &aLST)
std::vector< ww::bytes > maParaSprms
const sal_uInt8 * pMemPos
SVX_NUM_IROHA_FULLWIDTH_JA
SVX_NUM_FULL_WIDTH_ARABIC
SVX_NUM_CHARS_LOWER_LETTER_N
SVX_NUM_CHARS_CYRILLIC_LOWER_LETTER_RU
SVX_NUM_NUMBER_TRADITIONAL_JA
SVX_NUM_NUMBER_UPPER_ZH_TW
SVX_NUM_HANGUL_SYLLABLE_KO
SVX_NUM_CHARS_ARABIC_ABJAD
SVX_NUM_IROHA_HALFWIDTH_JA
SVX_NUM_CHARS_UPPER_LETTER_N
SVX_NUM_CHARS_CYRILLIC_UPPER_LETTER_RU
constexpr sal_uInt8 MAXLEVEL
void UseListIndent(SwWW8StyInf &rStyle, const SwNumFormat &rFormat)
SwCharFormat * WW8aCFormat[WW8ListManager::nMaxLevel]
void SetStyleIndent(SwWW8StyInf &rStyle, const SwNumFormat &rFormat)
static void lcl_AddToPropertyContainer(uno::Reference< beans::XPropertySet > const &xPropSet, const OUString &rPropertyName, const OUString &rValue)
static bool IsEqualFormatting(const SwNumRule &rOne, const SwNumRule &rTwo)
sal_uInt16 WW8aIdSty[WW8ListManager::nMaxLevel]
void SyncIndentWithList(SvxFirstLineIndentItem &rFirstLine, SvxTextLeftMarginItem &rLeftMargin, const SwNumFormat &rFormat, const bool bFirstLineOfstSet, const bool bLeftIndentSet)
tools::Long GetListFirstLineIndent(const SwNumFormat &rFormat)
OUString read_uInt16_BeltAndBracesString(SvStream &rStrm)
OUString read_uInt16_PascalString(SvStream &rStrm)