20 #include <com/sun/star/table/TableSortField.hpp>
26 #include <osl/endian.h>
55 #include <unoprnms.hxx>
57 #include <unotext.hxx>
58 #include <com/sun/star/text/TextMarkupType.hpp>
64 #include <com/sun/star/beans/PropertyAttribute.hpp>
65 #include <com/sun/star/beans/NamedValue.hpp>
66 #include <com/sun/star/i18n/WordType.hpp>
78 SwPaM(rDoc.GetNodes())
92 const SwPaM* pTmp = &rPaM;
101 while(&rPaM != (pTmp = pTmp->
GetNext()))
135 aStream.
SetEndian( SvStreamEndian::BIG );
137 aStream.
SetEndian( SvStreamEndian::LITTLE );
146 xWrt->m_bASCII_NoLastLineEnd =
true;
147 xWrt->m_bExportParagraphNumbering =
false;
150 xWrt->SetAsciiOptions( aOpt );
151 xWrt->m_bUCS2_WithStartChar =
false;
153 const bool bOldShowProgress = xWrt->m_bShowProgress;
154 xWrt->m_bShowProgress =
false;
155 xWrt->m_bHideDeleteRedlines = pLayout && pLayout->
IsHideRedlines();
167 rtl_uString *pStr = rtl_uString_alloc(lUniLen);
169 rBuffer = OUString(pStr, SAL_NO_ACQUIRE);
172 xWrt->m_bShowProgress = bOldShowProgress;
186 if (!(rValue >>= uStyle))
188 throw lang::IllegalArgumentException();
197 throw lang::IllegalArgumentException();
209 if (!(rValue >>= uStyle))
211 throw lang::IllegalArgumentException();
213 std::shared_ptr<SfxItemSet> pStyle = bPara ?
218 throw lang::IllegalArgumentException();
244 throw lang::IllegalArgumentException();
250 SwPaM *pTmpCursor = &rPaM;
253 pTmpCursor = pTmpCursor->
GetNext();
254 }
while ( pTmpCursor != &rPaM );
263 if (!(rValue >>= uDescName))
267 std::unique_ptr<SwFormatPageDesc> pNewDesc;
272 *static_cast<const SwFormatPageDesc*>(pItem)));
281 if (!pNewDesc->GetPageDesc() ||
282 (pNewDesc->GetPageDesc()->GetName() != sDescName))
285 if (!sDescName.isEmpty())
290 throw lang::IllegalArgumentException();
292 pNewDesc->RegisterToPageDesc(*pPageDesc);
313 sal_uInt16 nStt = (nTmp < 0 ? USHRT_MAX : static_cast<sal_uInt16>(nTmp));
317 if( rCursor.
GetNext() != &rCursor )
322 for(
size_t n = 0;
n < aRangeArr.
Count(); ++
n )
340 uno::Sequence<OUString> aCharStyles;
341 if (!(rValue >>= aCharStyles))
346 for (sal_Int32 nStyle = 0; nStyle < aCharStyles.getLength(); nStyle++)
350 aStyle <<= aCharStyles.getConstArray()[nStyle];
370 if (!(rValue >>= uStyle))
372 throw lang::IllegalArgumentException();
384 throw lang::IllegalArgumentException();
386 std::unique_ptr<SwFormatDrop> pDrop;
388 if (SfxItemState::SET ==
391 pDrop.reset(
new SwFormatDrop(*static_cast<const SwFormatDrop*>(pItem)));
398 pDrop->SetCharFormat(xStyle->GetCharFormat());
399 rItemSet.
Put(*pDrop);
406 if (!(rValue >>= sTmp))
408 throw lang::IllegalArgumentException();
411 std::unique_ptr<SwFormatRuby> pRuby;
413 if (SfxItemState::SET ==
416 pRuby.reset(
new SwFormatRuby(*static_cast<const SwFormatRuby*>(pItem)));
425 pRuby->SetCharFormatName(sStyle);
426 pRuby->SetCharFormatId(0);
427 if (!sStyle.isEmpty())
431 pRuby->SetCharFormatId(nId);
433 rItemSet.
Put(*pRuby);
441 if (!(rEntry.
nFlags & beans::PropertyAttribute::MAYBEVOID) &&
454 rValue, rItemSet,
false);
464 rValue, rItemSet,
true);
482 throw lang::IllegalArgumentException();
486 sal_Int16 nLevel = 0;
487 if (rValue >>= nLevel)
489 if (nLevel < 0 ||
MAXLEVEL <= nLevel)
491 throw lang::IllegalArgumentException(
492 "invalid NumberingLevel",
nullptr, 0);
501 if (rValue >>= sListId)
508 bool bIsNumber(
false);
509 if ((rValue >>= bIsNumber) && !bIsNumber)
516 uno::Sequence<beans::NamedValue>
props;
517 if (rValue >>= props)
527 for (beans::NamedValue
const & prop : std::as_const(props))
530 rMap.getByName(prop.Name);
533 if (prop.Name ==
"CharStyleName")
538 throw beans::UnknownPropertyException(
539 "Unknown property: " + prop.Name);
541 if (pEntry->
nFlags & beans::PropertyAttribute::READONLY)
543 throw beans::PropertyVetoException(
544 "Property is read-only: " + prop.Name);
546 rPropSet.setPropertyValue(*pEntry, prop.Value, items);
552 item.SetStyleHandle(std::make_shared<SfxItemSet>(items));
562 if (!(rValue >>= bVal))
564 throw lang::IllegalArgumentException();
601 rValue, rPam.
GetDoc(), rItemSet);
618 static const sal_uLong nMaxLookup = 1000;
621 SwPaM *pTmpCursor = &rPaM;
627 if( nEndNd - nSttNd >= nMaxLookup )
636 SwTextNode const*
const pNd = rNds[
n ]->GetTextNode();
645 else if( pFormat != pNdFormat )
653 pTmpCursor = pTmpCursor->
GetNext();
654 }
while ( pTmpCursor != &rPaM );
655 return bError ?
nullptr : pFormat;
669 uno::Reference<text::XText>
const & xParent,
673 , m_xParentText(xParent)
674 , m_pUnoCursor(rDoc.CreateUnoCursor(rPoint))
679 *m_pUnoCursor->
GetMark() = *pMark;
685 throw uno::RuntimeException(
"SwXTextCursor: disposed or invalid",
nullptr);
691 {
return *
m_pImpl->m_pUnoCursor; }
694 {
return m_pImpl->m_pUnoCursor.get(); }
697 {
return m_pImpl->m_pUnoCursor.get(); }
700 {
return m_pImpl->m_pUnoCursor ? &
m_pImpl->m_pUnoCursor->GetDoc() :
nullptr; }
703 {
return m_pImpl->m_pUnoCursor ? &
m_pImpl->m_pUnoCursor->GetDoc() :
nullptr; }
707 uno::Reference< text::XText >
const& xParent,
711 :
m_pImpl( new Impl(rDoc, eType, xParent, rPos, pMark) )
717 :
m_pImpl( new Impl(rSourceCursor.GetDoc(), eType,
718 xParent, *rSourceCursor.GetPoint(),
719 rSourceCursor.HasMark() ? rSourceCursor.GetMark() : nullptr) )
728 const bool bForceExpandHints)
735 SwDoc& rDoc = pUnoCursor->GetDoc();
737 const sal_Int32 nTextLen = rText.getLength();
739 auto pCurrent = pUnoCursor;
742 if (pCurrent->HasMark())
750 rDoc, *pCurrent, rText, bForceExpandHints ) );
751 OSL_ENSURE( bSuccess,
"Doc->Insert(Str) failed." );
754 pCurrent->Left(rText.getLength());
756 pCurrent = pCurrent->GetNext();
757 }
while (pCurrent != pUnoCursor);
769 uno::Reference<text::XText>
const & xParentText,
773 SwXMeta const *
const pXMeta( dynamic_cast<SwXMeta*>(xParentText.get()) );
774 OSL_ENSURE(pXMeta,
"no parent?");
776 throw uno::RuntimeException();
780 const bool bSuccess( pXMeta->
SetContentRange(pTextNode, nStart, nEnd) );
781 OSL_ENSURE(bSuccess,
"no pam?");
783 throw uno::RuntimeException();
789 case META_INIT_START:
795 case META_CHECK_BOTH:
796 if (*rCursor.
Start() < start)
798 *rCursor.
Start() = start;
801 if (*rCursor.
End() > end)
803 *rCursor.
End() = end;
815 auto pCursor(
m_pImpl->m_pUnoCursor );
817 dynamic_cast<SwXMeta*>(
m_pImpl->m_xParentText.get()) );
818 OSL_ENSURE(pXMeta,
"no meta?");
819 if (pCursor && pXMeta)
826 OSL_ENSURE(bSuccess,
"no pam?");
830 if ( (*pCursor->GetPoint() == end)
831 || (*pCursor->GetMark() == end))
843 return "SwXTextCursor";
851 uno::Sequence< OUString > SAL_CALL
855 "com.sun.star.text.TextCursor",
856 "com.sun.star.style.CharacterProperties",
857 "com.sun.star.style.CharacterPropertiesAsian",
858 "com.sun.star.style.CharacterPropertiesComplex",
859 "com.sun.star.style.ParagraphProperties",
860 "com.sun.star.style.ParagraphPropertiesAsian",
861 "com.sun.star.style.ParagraphPropertiesComplex",
862 "com.sun.star.text.TextSortable"
868 class theSwXTextCursorUnoTunnelId :
public rtl::Static< UnoTunnelIdInit, theSwXTextCursorUnoTunnelId > {};
879 const sal_Int64 nRet( ::sw::UnoTunnelImpl<SwXTextCursor>(rId,
this) );
889 if (rUnoCursor.HasMark())
891 if (*rUnoCursor.GetPoint() > *rUnoCursor.GetMark())
895 rUnoCursor.DeleteMark();
905 if (rUnoCursor.HasMark())
907 if (*rUnoCursor.GetPoint() < *rUnoCursor.GetMark())
911 rUnoCursor.DeleteMark();
920 auto pUnoCursor(
m_pImpl->m_pUnoCursor);
921 if(pUnoCursor && pUnoCursor->GetMark())
923 bRet = (*pUnoCursor->GetPoint() == *pUnoCursor->GetMark());
936 bool bRet = rUnoCursor.Left( nCount);
954 bool bRet = rUnoCursor.Right(nCount);
987 rUnoCursor.GetPoint()->nContent.Assign(pCNode, 0);
998 &rUnoCursor.GetPoint()->nNode,
true,
false);
1001 rUnoCursor.GetPoint()->nContent.Assign(pCNode, 0);
1051 const uno::Reference< text::XTextRange > & xRange,
sal_Bool bExpand)
1057 throw uno::RuntimeException();
1062 uno::Reference<lang::XUnoTunnel> xRangeTunnel( xRange, uno::UNO_QUERY);
1065 if(xRangeTunnel.is())
1067 pRange = ::sw::UnoTunnelGetImplementation<SwXTextRange>(xRangeTunnel);
1069 ::sw::UnoTunnelGetImplementation<OTextCursorHelper>(xRangeTunnel);
1072 if (!pRange && !pCursor)
1074 throw uno::RuntimeException();
1078 const SwPaM * pPam(
nullptr);
1081 pPam = pCursor->
GetPaM();
1093 throw uno::RuntimeException();
1112 while ( pOwnStartNode !=
nullptr
1120 while ( pTmp !=
nullptr
1128 if (!pOwnStartNode || !pTmp)
1130 throw uno::RuntimeException();
1135 throw uno::RuntimeException();
1140 if ( pOwnStartNode != pTmp )
1142 throw uno::RuntimeException();
1151 CopyPam,
m_pImpl->m_xParentText, META_CHECK_BOTH) );
1154 throw uno::RuntimeException(
1155 "gotoRange: parameter range not contained in nesting"
1156 " text content for which this cursor was created",
1157 static_cast<text::XWordCursor*>(
this));
1165 const SwPosition aOwnLeft(*rOwnCursor.Start());
1166 const SwPosition aOwnRight(*rOwnCursor.End());
1172 if (aOwnRight > rParamRight)
1173 *rOwnCursor.GetPoint() = aOwnRight;
1175 *rOwnCursor.GetPoint() = rParamRight;
1176 rOwnCursor.SetMark();
1177 if (aOwnLeft < rParamLeft)
1178 *rOwnCursor.GetMark() = aOwnLeft;
1180 *rOwnCursor.GetMark() = rParamLeft;
1185 *rOwnCursor.GetPoint() = *pPam->
GetPoint();
1188 rOwnCursor.SetMark();
1189 *rOwnCursor.GetMark() = *pPam->
GetMark();
1193 rOwnCursor.DeleteMark();
1205 rUnoCursor.
IsStartWordWT( i18n::WordType::DICTIONARY_WORD );
1216 rUnoCursor.
IsEndWordWT( i18n::WordType::DICTIONARY_WORD );
1232 SwPosition *
const pPoint = rUnoCursor.GetPoint();
1238 if (rUnoCursor.GetContentNode() &&
1239 (pPoint->
nContent == rUnoCursor.GetContentNode()->Len()))
1241 rUnoCursor.Right(1);
1246 rUnoCursor.GoNextWordWT( i18n::WordType::DICTIONARY_WORD );
1276 SwPosition *
const pPoint = rUnoCursor.GetPoint();
1288 rUnoCursor.GoPrevWordWT( i18n::WordType::DICTIONARY_WORD );
1315 SwPosition *
const pPoint = rUnoCursor.GetPoint();
1319 const sal_Int16 nWordType = i18n::WordType::DICTIONARY_WORD;
1321 if (!rUnoCursor.IsEndWordWT( nWordType ))
1323 rUnoCursor.GoEndWordWT( nWordType );
1328 bRet = rUnoCursor.IsEndWordWT( nWordType );
1331 pPoint->
nNode = rOldNode;
1351 SwPosition *
const pPoint = rUnoCursor.GetPoint();
1355 const sal_Int16 nWordType = i18n::WordType::DICTIONARY_WORD;
1357 if (!rUnoCursor.IsStartWordWT( nWordType ))
1359 rUnoCursor.GoStartWordWT( nWordType );
1364 bRet = rUnoCursor.IsStartWordWT( nWordType );
1367 pPoint->
nNode = rOldNode;
1391 if (!bRet && (!rUnoCursor.HasMark() ||
1392 *rUnoCursor.GetPoint() == *rUnoCursor.GetMark()))
1394 SwCursor aCursor(*rUnoCursor.GetPoint(),
nullptr);
1397 bRet = aOrigPos == *aCursor.GetPoint();
1411 (rUnoCursor.GetPoint()->nContent == rUnoCursor.GetContentNode()->Len());
1415 if (!bRet && (!rUnoCursor.HasMark() ||
1416 *rUnoCursor.GetPoint() == *rUnoCursor.GetMark()))
1418 SwCursor aCursor(*rUnoCursor.GetPoint(),
nullptr);
1421 bRet = aOrigPos == *aCursor.GetPoint();
1444 if (!rUnoCursor.IsStartWordWT(css::i18n::WordType::ANYWORD_IGNOREWHITESPACES))
1446 const bool bNextWord = rUnoCursor.GoNextWordWT(i18n::WordType::ANYWORD_IGNOREWHITESPACES);
1447 if (bWasEOS && !bNextWord)
1524 bool bRet = !bAlreadyParaEnd
1579 OSL_ENSURE( bRet,
"gotoStartOfParagraph failed" );
1604 OSL_ENSURE( bRet,
"gotoEndOfParagraph failed" );
1640 uno::Reference< text::XText > SAL_CALL
1645 return m_pImpl->m_xParentText;
1648 uno::Reference< text::XTextRange > SAL_CALL
1655 uno::Reference< text::XTextRange > xRet;
1656 SwPaM aPam(*rUnoCursor.Start());
1657 const uno::Reference< text::XText > xParent =
getText();
1663 *rUnoCursor.GetPoint()) );
1664 pXCursor->gotoStart(
false);
1665 xRet =
static_cast<text::XWordCursor*
>(pXCursor.get());
1674 uno::Reference< text::XTextRange > SAL_CALL
1681 uno::Reference< text::XTextRange > xRet;
1682 SwPaM aPam(*rUnoCursor.End());
1683 const uno::Reference< text::XText > xParent =
getText();
1689 *rUnoCursor.GetPoint()) );
1690 pXCursor->gotoEnd(
false);
1691 xRet =
static_cast<text::XWordCursor*
>(pXCursor.get());
1719 && dynamic_cast<SwXMeta&>(*
m_pImpl->m_xParentText)
1720 .CheckForOwnMemberMeta(*
GetPaM(),
true) );
1726 std::u16string_view rPropertyName)
1734 throw beans::UnknownPropertyException(
1735 OUString::Concat(
"Unknown property: ") + rPropertyName,
1736 static_cast<cppu::OWeakObject *>(
nullptr));
1739 beans::PropertyState eTemp;
1741 *pEntry, rPaM, &aAny, eTemp );
1760 const OUString& rPropertyName,
1764 uno::Sequence< beans::PropertyValue > aValues(1);
1765 aValues[0].Name = rPropertyName;
1766 aValues[0].Value = rValue;
1784 const uno::Sequence< beans::PropertyValue > &rPropertyValues,
1787 if (!rPropertyValues.hasElements())
1791 OUString aUnknownExMsg, aPropertyVetoExMsg;
1794 const sal_uInt16 zero = 0;
1796 std::vector<std::pair<const SfxItemPropertySimpleEntry*, const uno::Any&>>
aEntries;
1797 aEntries.reserve(rPropertyValues.getLength());
1798 for (
const auto& rPropVal : rPropertyValues)
1800 const OUString &rPropertyName = rPropVal.Name;
1808 aUnknownExMsg +=
"Unknown property: '" + rPropertyName +
"' ";
1811 else if (pEntry->
nFlags & beans::PropertyAttribute::READONLY)
1813 aPropertyVetoExMsg +=
"Property is read-only: '" + rPropertyName +
"' ";
1816 aItemSet.MergeRange(pEntry->
nWID, pEntry->
nWID);
1817 aEntries.emplace_back(pEntry, rPropVal.Value);
1820 if (!aEntries.empty())
1824 bool bPreviousPropertyCausesSideEffectsInNodes =
false;
1825 for (
size_t i = 0;
i < aEntries.size(); ++
i)
1828 bool bPropertyCausesSideEffectsInNodes =
1832 if (i == 0 || bPreviousPropertyCausesSideEffectsInNodes)
1834 aItemSet.ClearItem();
1838 const uno::Any &rValue = aEntries[
i].second;
1843 if (i + 1 == aEntries.size() || bPropertyCausesSideEffectsInNodes)
1846 bPreviousPropertyCausesSideEffectsInNodes = bPropertyCausesSideEffectsInNodes;
1850 if (!aUnknownExMsg.isEmpty())
1851 throw beans::UnknownPropertyException(aUnknownExMsg, static_cast<cppu::OWeakObject *>(
nullptr));
1852 if (!aPropertyVetoExMsg.isEmpty())
1853 throw beans::PropertyVetoException(aPropertyVetoExMsg, static_cast<cppu::OWeakObject *>(
nullptr));
1858 bool NotInRange(sal_uInt16 nWID, sal_uInt16 nStart, sal_uInt16 nEnd)
1860 return nWID < nStart || nWID > nEnd;
1864 uno::Sequence< beans::PropertyState >
1867 const uno::Sequence< OUString >& rPropertyNames,
1870 const OUString* pNames = rPropertyNames.getConstArray();
1871 uno::Sequence< beans::PropertyState > aRet(rPropertyNames.getLength());
1872 beans::PropertyState* pStates = aRet.getArray();
1874 std::unique_ptr<SfxItemSet> pSet;
1875 std::unique_ptr<SfxItemSet> pSetParent;
1877 for (sal_Int32 i = 0, nEnd = rPropertyNames.getLength();
i < nEnd;
i++)
1886 pStates[i] = beans::PropertyState_DEFAULT_VALUE;
1893 pStates[i] = beans::PropertyState::PropertyState_MAKE_FIXED_SIZE;
1898 throw beans::UnknownPropertyException(
1899 "Unknown property: " + pNames[i],
1900 static_cast<cppu::OWeakObject *>(
nullptr));
1908 pStates[i] = beans::PropertyState_DEFAULT_VALUE;
1916 *pEntry, rPaM,
nullptr, pStates[i] );
1941 RES_UNKNOWNATR_CONTAINER>{}));
1947 pStates[i] = ( pSet->Count() )
1949 : beans::PropertyState_DEFAULT_VALUE;
1952 if( beans::PropertyState_DIRECT_VALUE == pStates[i] )
1956 pSetParent = pSet->Clone(
false );
1959 rPaM, *pSetParent,
true,
false );
1962 pStates[i] = ( pSetParent->Count() )
1964 : beans::PropertyState_DEFAULT_VALUE;
1974 const OUString& rPropertyName)
1976 uno::Sequence< OUString > aStrings { rPropertyName };
1977 uno::Sequence< beans::PropertyState >
aSeq =
1996 *pTemp->GetPoint() = aEnd;
2007 std::u16string_view rPropertyName)
2014 throw beans::UnknownPropertyException(
2015 OUString::Concat(
"Unknown property: ") + rPropertyName,
2016 static_cast<cppu::OWeakObject *>(
nullptr));
2019 if (pEntry->
nFlags & beans::PropertyAttribute::READONLY)
2021 throw uno::RuntimeException(
2022 OUString::Concat(
"setPropertyToDefault: property is read-only: ")
2023 + rPropertyName,
nullptr);
2046 std::u16string_view rPropertyName)
2052 throw beans::UnknownPropertyException(
2053 OUString::Concat(
"Unknown property: ") + rPropertyName,
2054 static_cast<cppu::OWeakObject *>(
nullptr));
2068 uno::Reference< beans::XPropertySetInfo > SAL_CALL
2073 static uno::Reference< beans::XPropertySetInfo > xRef = [&]()
2079 {
u"", 0, css::uno::Type(), 0, 0 }
2081 const uno::Reference< beans::XPropertySetInfo > xInfo =
2082 m_pImpl->m_rPropSet.getPropertySetInfo();
2084 const uno::Sequence<beans::Property> aPropSeq = xInfo->getProperties();
2094 const OUString& rPropertyName,
const uno::Any& rValue)
2103 if (!(rValue >>= bSet))
2105 throw lang::IllegalArgumentException();
2107 rUnoCursor.SetSkipOverHiddenSections(bSet);
2112 if (!(rValue >>= bSet))
2114 throw lang::IllegalArgumentException();
2116 rUnoCursor.SetSkipOverProtectSections(bSet);
2121 m_pImpl->m_rPropSet, rPropertyName, rValue);
2135 const bool bSet = rUnoCursor.IsSkipOverHiddenSections();
2140 const bool bSet = rUnoCursor.IsSkipOverProtectSections();
2146 m_pImpl->m_rPropSet, rPropertyName);
2154 const uno::Reference< beans::XPropertyChangeListener >& )
2156 OSL_FAIL(
"SwXTextCursor::addPropertyChangeListener(): not implemented");
2162 const uno::Reference< beans::XPropertyChangeListener >& )
2164 OSL_FAIL(
"SwXTextCursor::removePropertyChangeListener(): not implemented");
2170 const uno::Reference< beans::XVetoableChangeListener >& )
2172 OSL_FAIL(
"SwXTextCursor::addVetoableChangeListener(): not implemented");
2178 const uno::Reference< beans::XVetoableChangeListener >& )
2180 OSL_FAIL(
"SwXTextCursor::removeVetoableChangeListener(): not implemented");
2183 beans::PropertyState SAL_CALL
2191 rUnoCursor,
m_pImpl->m_rPropSet, rPropertyName);
2195 uno::Sequence< beans::PropertyState > SAL_CALL
2197 const uno::Sequence< OUString >& rPropertyNames)
2204 rUnoCursor,
m_pImpl->m_rPropSet, rPropertyNames);
2211 uno::Sequence < OUString > aSequence ( &rPropertyName, 1 );
2219 const uno::Sequence < OUString > aSequence ( &rPropertyName, 1 );
2224 const uno::Sequence< OUString >& aPropertyNames,
2225 const uno::Sequence< uno::Any >& aValues )
2227 if( aValues.getLength() != aPropertyNames.getLength() )
2229 OSL_FAIL(
"mis-matched property value sequences" );
2230 throw lang::IllegalArgumentException();
2238 uno::Sequence< beans::PropertyValue >
aPropertyValues( aValues.getLength() );
2239 for ( sal_Int32 i = 0; i < aPropertyNames.getLength(); i++ )
2245 OSL_FAIL(
"invalid property name for batch setting");
2246 throw lang::IllegalArgumentException();
2255 catch (
const css::beans::UnknownPropertyException& e)
2258 throw lang::WrappedTargetException(
2259 "wrapped Exception " + e.Message,
2260 uno::Reference<uno::XInterface>(), a);
2264 uno::Sequence< uno::Any > SAL_CALL
2268 uno::Sequence< uno::Any > aValues( aPropertyNames.getLength() );
2269 std::transform(aPropertyNames.begin(), aPropertyNames.end(), aValues.begin(),
2275 const uno::Sequence< OUString >& ,
2276 const uno::Reference< css::beans::XPropertiesChangeListener >& )
2278 OSL_FAIL(
"SwXTextCursor::addPropertiesChangeListener(): not implemented");
2281 const uno::Reference< css::beans::XPropertiesChangeListener >& )
2283 OSL_FAIL(
"SwXTextCursor::removePropertiesChangeListener(): not implemented");
2287 const uno::Sequence< OUString >& ,
2288 const uno::Reference< css::beans::XPropertiesChangeListener >& )
2290 OSL_FAIL(
"SwXTextCursor::firePropertiesChangeEvent(): not implemented");
2317 const sal_uInt16 nStart = *pIdRange++;
2318 const sal_uInt16 nEnd = *pIdRange++;
2319 for (sal_uInt16
nId = nStart + 1;
nId <= nEnd; ++
nId)
2337 if (!aParaWhichIds.empty())
2342 if (!aWhichIds.
empty())
2344 rUnoCursor.GetDoc().ResetAttrs(rUnoCursor,
true, aWhichIds);
2350 const uno::Sequence< OUString >& rPropertyNames)
2356 if ( !rPropertyNames.hasElements() )
2359 SwDoc& rDoc = rUnoCursor.GetDoc();
2362 for (
const OUString& rName : rPropertyNames)
2365 m_pImpl->m_rPropSet.getPropertyMap().getByName( rName );
2373 throw beans::UnknownPropertyException(
2374 "Unknown property: " + rName,
2375 static_cast<cppu::OWeakObject *>(
this));
2377 if (pEntry->
nFlags & beans::PropertyAttribute::READONLY)
2379 throw uno::RuntimeException(
2380 "setPropertiesToDefault: property is read-only: " + rName,
2381 static_cast<cppu::OWeakObject *>(
this));
2401 if (!aParaWhichIds.
empty())
2405 if (!aWhichIds.
empty())
2407 rDoc.
ResetAttrs(rUnoCursor,
true, aWhichIds);
2411 uno::Sequence< uno::Any > SAL_CALL
2413 const uno::Sequence< OUString >& rPropertyNames)
2419 const sal_Int32
nCount = rPropertyNames.getLength();
2420 uno::Sequence< uno::Any > aRet(nCount);
2423 SwDoc& rDoc = rUnoCursor.GetDoc();
2424 const OUString *pNames = rPropertyNames.getConstArray();
2426 for (sal_Int32 i = 0; i < nCount; i++)
2429 m_pImpl->m_rPropSet.getPropertyMap().getByName( pNames[i] );
2437 throw beans::UnknownPropertyException(
2438 "Unknown property: " + pNames[i],
2439 static_cast<cppu::OWeakObject *>(
nullptr));
2458 SwNode& node = rUnoCursor.GetNode();
2462 if (txtNode ==
nullptr)
return;
2464 if ( text::TextMarkupType::SPELLCHECK == nType )
2469 else if( text::TextMarkupType::PROOFREADING == nType )
2474 else if ( text::TextMarkupType::SMARTTAG == nType )
2483 if (fmtColl ==
nullptr)
return;
2491 const OUString& rRedlineType,
2492 const uno::Sequence< beans::PropertyValue >& rRedlineProperties)
2502 const uno::Sequence< beans::PropertyValue >& rOptions)
2511 uno::Sequence< beans::PropertyValue >
2514 uno::Sequence< beans::PropertyValue > aRet(5);
2515 beans::PropertyValue* pArray = aRet.getArray();
2518 aVal <<= bFromTable;
2519 pArray[0] = beans::PropertyValue(
"IsSortInTable", -1, aVal,
2520 beans::PropertyState_DIRECT_VALUE);
2523 pArray[1] = beans::PropertyValue(
"Delimiter", -1, aVal,
2524 beans::PropertyState_DIRECT_VALUE);
2527 pArray[2] = beans::PropertyValue(
"IsSortColumns", -1, aVal,
2528 beans::PropertyState_DIRECT_VALUE);
2530 aVal <<= sal_Int32(3);
2531 pArray[3] = beans::PropertyValue(
"MaxSortFieldsCount", -1, aVal,
2532 beans::PropertyState_DIRECT_VALUE);
2534 uno::Sequence< table::TableSortField > aFields(3);
2535 table::TableSortField* pFields = aFields.getArray();
2539 uno::Sequence< OUString >
aSeq(
2541 const bool bHasElements = aSeq.hasElements();
2542 OSL_ENSURE( bHasElements,
"list of collator algorithms is empty!");
2546 aCollAlg = aSeq.getConstArray()[0];
2549 pFields[0].Field = 1;
2550 pFields[0].IsAscending =
true;
2551 pFields[0].IsCaseSensitive =
false;
2552 pFields[0].FieldType = table::TableSortFieldType_ALPHANUMERIC;
2553 pFields[0].CollatorLocale = aLang;
2554 pFields[0].CollatorAlgorithm = aCollAlg;
2556 pFields[1].Field = 1;
2557 pFields[1].IsAscending =
true;
2558 pFields[1].IsCaseSensitive =
false;
2559 pFields[1].FieldType = table::TableSortFieldType_ALPHANUMERIC;
2560 pFields[1].CollatorLocale = aLang;
2561 pFields[1].CollatorAlgorithm = aCollAlg;
2563 pFields[2].Field = 1;
2564 pFields[2].IsAscending =
true;
2565 pFields[2].IsCaseSensitive =
false;
2566 pFields[2].FieldType = table::TableSortFieldType_ALPHANUMERIC;
2567 pFields[2].CollatorLocale = aLang;
2568 pFields[2].CollatorAlgorithm = aCollAlg;
2571 pArray[4] = beans::PropertyValue(
"SortFields", -1, aVal,
2572 beans::PropertyState_DIRECT_VALUE);
2577 uno::Sequence< beans::PropertyValue > SAL_CALL
2586 const uno::Sequence< beans::PropertyValue >& rDescriptor,
2592 rSortOpt.
cDeli =
' ';
2595 std::unique_ptr<SwSortKey> pKey1(
new SwSortKey);
2597 pKey1->bIsNumeric =
true;
2600 std::unique_ptr<SwSortKey> pKey2(
new SwSortKey);
2602 pKey2->bIsNumeric =
true;
2605 std::unique_ptr<SwSortKey> pKey3(
new SwSortKey);
2607 pKey3->bIsNumeric =
true;
2609 SwSortKey* aKeys[3] = {pKey1.get(), pKey2.get(), pKey3.get()};
2611 bool bOldSortdescriptor(
false);
2612 bool bNewSortdescriptor(
false);
2614 for (
const beans::PropertyValue& rProperty : rDescriptor)
2616 uno::Any aValue( rProperty.Value );
2617 const OUString& rPropName = rProperty.Name;
2620 if ( rPropName ==
"IsSortInTable" )
2631 else if ( rPropName ==
"Delimiter" )
2635 if (aValue >>= uChar)
2637 rSortOpt.
cDeli = uChar;
2639 else if (aValue >>= nChar)
2643 rSortOpt.
cDeli = nChar;
2651 else if ( rPropName ==
"SortColumns" )
2653 bOldSortdescriptor =
true;
2655 if (aValue >>= bTemp)
2664 else if ( rPropName ==
"IsCaseSensitive" )
2666 bOldSortdescriptor =
true;
2668 if (aValue >>= bTemp)
2677 else if ( rPropName ==
"CollatorLocale" )
2679 bOldSortdescriptor =
true;
2680 lang::Locale aLocale;
2681 if (aValue >>= aLocale)
2690 else if (rPropName.startsWith(
"CollatorAlgorithm") &&
2691 rPropName.getLength() == 18 &&
2692 (rPropName[17] >=
'0' && rPropName[17] <=
'9'))
2694 bOldSortdescriptor =
true;
2695 sal_uInt16
nIndex = rPropName[17];
2698 if ((aValue >>= aText) && nIndex < 3)
2707 else if (rPropName.startsWith(
"SortRowOrColumnNo") &&
2708 rPropName.getLength() == 18 &&
2709 (rPropName[17] >=
'0' && rPropName[17] <=
'9'))
2711 bOldSortdescriptor =
true;
2712 sal_uInt16 nIndex = rPropName[17];
2714 sal_Int16 nCol = -1;
2729 else if (rPropName.startsWith(
"IsSortNumeric") &&
2730 rPropName.getLength() == 14 &&
2731 (rPropName[13] >=
'0' && rPropName[13] <=
'9'))
2733 bOldSortdescriptor =
true;
2734 sal_uInt16 nIndex = rPropName[13];
2735 nIndex = nIndex -
'0';
2737 if (bTemp && nIndex < 3)
2746 else if (rPropName.startsWith(
"IsSortAscending") &&
2747 rPropName.getLength() == 16 &&
2748 (rPropName[15] >=
'0' && rPropName[15] <=
'9'))
2750 bOldSortdescriptor =
true;
2751 sal_uInt16 nIndex = rPropName[15];
2754 if (bTemp && nIndex < 3)
2765 else if ( rPropName ==
"IsSortColumns" )
2767 bNewSortdescriptor =
true;
2777 else if ( rPropName ==
"SortFields" )
2779 bNewSortdescriptor =
true;
2780 uno::Sequence < table::TableSortField > aFields;
2781 if (aValue >>= aFields)
2783 sal_Int32
nCount(aFields.getLength());
2786 table::TableSortField* pFields = aFields.getArray();
2787 for (sal_Int32 i = 0; i <
nCount; ++i)
2789 rSortOpt.
bIgnoreCase = !pFields[i].IsCaseSensitive;
2792 aKeys[i]->
sSortType = pFields[i].CollatorAlgorithm;
2794 static_cast<sal_uInt16
>(pFields[i].Field);
2795 aKeys[i]->
bIsNumeric = (pFields[i].FieldType ==
2796 table::TableSortFieldType_NUMERIC);
2797 aKeys[i]->
eSortOrder = (pFields[i].IsAscending)
2813 if (bNewSortdescriptor && bOldSortdescriptor)
2815 OSL_FAIL(
"someone tried to set the old deprecated and "
2816 "the new sortdescriptor");
2822 rSortOpt.
aKeys.push_back(std::move(pKey1));
2826 rSortOpt.
aKeys.push_back(std::move(pKey2));
2830 rSortOpt.
aKeys.push_back(std::move(pKey3));
2833 return bRet && !rSortOpt.
aKeys.empty();
2843 if (!rUnoCursor.HasMark())
2849 throw uno::RuntimeException(
"Bad sort properties");
2858 const sal_Int32 nCntStt = rStart.nContent.GetIndex();
2860 rUnoCursor.GetDoc().SortText(rUnoCursor, aSortOpt);
2863 rUnoCursor.DeleteMark();
2864 rUnoCursor.GetPoint()->nNode.Assign( aPrevIdx.
GetNode(), +1 );
2866 sal_Int32 nLen = pCNd->
Len();
2871 rUnoCursor.GetPoint()->nContent.Assign(pCNd, nLen );
2872 rUnoCursor.SetMark();
2874 rUnoCursor.GetPoint()->nNode += nOffset;
2876 rUnoCursor.GetPoint()->nContent.Assign( pCNd2, pCNd2->
Len() );
2880 uno::Reference< container::XEnumeration > SAL_CALL
2884 if (rServiceName !=
"com.sun.star.text.TextContent")
2885 throw uno::RuntimeException();
2890 uno::Reference< container::XEnumeration > SAL_CALL
2897 SwXText* pParentText = comphelper::getUnoTunnelImplementation<SwXText>(
m_pImpl->m_xParentText);
2898 OSL_ENSURE(pParentText,
"parent is not a SwXText");
2901 throw uno::RuntimeException();
2904 auto pNewCursor(rUnoCursor.GetDoc().CreateUnoCursor(*rUnoCursor.GetPoint()) );
2905 if (rUnoCursor.HasMark())
2907 pNewCursor->SetMark();
2908 *pNewCursor->GetMark() = *rUnoCursor.GetMark();
2926 uno::Sequence< OUString > SAL_CALL
2929 uno::Sequence<OUString> aRet {
"com.sun.star.text.TextContent" };
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
SwStartNode * FindSttNodeByType(SwStartNodeType eTyp)
virtual void SAL_CALL invalidateMarkings(::sal_Int32 nType) override
const SwEndNode * EndOfSectionNode() const
Starts a section of nodes in the document model.
const SfxItemPropertySimpleEntry * getByName(std::u16string_view rName) const
std::shared_ptr< SwUnoCursor > CreateUnoCursor(const SwPosition &rPos, bool bTableCursor=false)
virtual void SAL_CALL firePropertiesChangeEvent(const css::uno::Sequence< OUString > &aPropertyNames, const css::uno::Reference< css::beans::XPropertiesChangeListener > &xListener) override
virtual sal_Int32 Len() const
constexpr TypedWhichId< SwFormatPageDesc > RES_PAGEDESC(93)
constexpr TypedWhichId< SvXMLAttrContainerItem > RES_UNKNOWNATR_CONTAINER(RES_UNKNOWNATR_BEGIN)
virtual sal_Bool SAL_CALL goLeft(sal_Int16 nCount, sal_Bool bExpand) override
virtual OUString SAL_CALL getImplementationName() override
SwMoveFnCollection const & fnParaEnd
::sw::UnoImplPtr< Impl > m_pImpl
SwNode & GetNode(bool bPoint=true) const
virtual sal_Bool SAL_CALL gotoEndOfSentence(sal_Bool Expand) override
static bool propertyCausesSideEffectsInNodes(sal_uInt16 nWID)
static sal_uInt16 g_ParaResetableSetRange[]
Represents the style of a paragraph.
Marks a position in the document model.
bool IsSectionNode() const
virtual sal_Bool SAL_CALL gotoStartOfParagraph(sal_Bool Expand) override
::cppu::WeakImplHelper< css::lang::XServiceInfo, css::beans::XPropertySet, css::beans::XPropertyState, css::beans::XMultiPropertySet, css::beans::XMultiPropertyStates, css::container::XEnumerationAccess, css::container::XContentEnumerationAccess, css::util::XSortable, css::document::XDocumentInsertable, css::text::XSentenceCursor, css::text::XWordCursor, css::text::XParagraphCursor, css::text::XRedline, css::text::XMarkingAccess > SwXTextCursor_Base
virtual css::uno::Type SAL_CALL getElementType() override
Pagedescriptor Client of SwPageDesc that is "described" by the attribute.
#define PROPERTY_MAP_TEXT_CURSOR
SvStream & WriteUInt16(sal_uInt16 nUInt16)
SwSortDirection eDirection
virtual sal_Bool SAL_CALL isStartOfParagraph() override
virtual void ResetError() override
virtual sal_Bool SAL_CALL goRight(sal_Int16 nCount, sal_Bool bExpand) override
SwDocShell * GetDocShell()
bool GoCurrPara(SwPaM &rPam, SwMoveFnCollection const &aPosPara)
virtual bool SetAttr(const SfxPoolItem &) override
overriding to handle change of certain paragraph attributes
static void lcl_EnumerateIds(sal_uInt16 const *pIdRange, o3tl::sorted_vector< sal_uInt16 > &rWhichIds)
static void FillUIName(const OUString &rName, OUString &rFillName, SwGetPoolIdFromName)
virtual sal_Bool SAL_CALL isEndOfWord() override
virtual const SwDoc * GetDoc() const override
static LanguageType convertToLanguageType(const css::lang::Locale &rLocale, bool bResolveSystem=true)
virtual ~SwUnoInternalPaM() override
#define MID_RUBY_CHARSTYLE
const SwPosition * GetMark() const
bool IsEndWordWT(sal_Int16 nWordType, SwRootFrame const *pLayout=nullptr) const
virtual sal_Bool SAL_CALL gotoPreviousWord(sal_Bool bExpand) override
virtual SwUndoId EndUndo(SwUndoId const eUndoId, SwRewriter const *const pRewriter)=0
Closes undo block.
const SfxItemPropertySet * GetPropertySet(sal_uInt16 PropertyId)
virtual sal_Int64 SAL_CALL getSomething(const css::uno::Sequence< sal_Int8 > &rIdentifier) override
SwMoveFnCollection const & fnParaStart
virtual void SAL_CALL addVetoableChangeListener(const OUString &rPropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &xListener) override
constexpr TypedWhichId< SwFormatAutoFormat > RES_AUTO_STYLE(126)
void resetCursorPropertyValue(const SfxItemPropertySimpleEntry &rEntry, SwPaM &rPam)
void DeleteAndInsert(OUString const &rText, const bool bForceExpandHints)
sal_uInt64 Seek(sal_uInt64 nPos)
bool IsAtEndOfMeta() const
constexpr TypedWhichId< SvxFormatBreakItem > RES_BREAK(94)
std::vector< std::unique_ptr< SwSortKey > > aKeys
bool getCursorPropertyValue(const SfxItemPropertySimpleEntry &rEntry, SwPaM &rPam, Any *pAny, PropertyState &eState, const SwTextNode *pNode)
void SetNumRuleStart(const SwPosition &rPos, bool bFlag=true)
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
static SwXParagraphEnumeration * Create(css::uno::Reference< css::text::XText > const &xParent, const std::shared_ptr< SwUnoCursor > &pCursor, const CursorType eType, SwTableBox const *const pTableBox=nullptr)
ErrCode Write(WriterRef const &rxWriter, const OUString *=nullptr)
void SetPropertyValues(SwPaM &rPaM, const SfxItemPropertySet &rPropSet, const css::uno::Sequence< css::beans::PropertyValue > &rPropertyValues, const SetAttrMode nAttrMode=SetAttrMode::DEFAULT)
IDocumentUndoRedo & GetIDocumentUndoRedo()
const uno::Reference< text::XText > m_xParentText
virtual css::uno::Reference< css::text::XText > SAL_CALL getText() override
virtual sal_Bool SAL_CALL gotoPreviousSentence(sal_Bool Expand) override
virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getStart() override
virtual bool DeleteAndJoin(SwPaM &, const bool bForceJoinNext=false)=0
complete delete of a given PaM
css::uno::Any GetPropertyDefault(SwPaM const &rPaM, const SfxItemPropertySet &rPropSet, std::u16string_view rPropertyName)
bool ConvertSortProperties(const css::uno::Sequence< css::beans::PropertyValue > &rDescriptor, SwSortOptions &rSortOpt)
#define MID_PAGEDESC_PAGEDESCNAME
IDocumentContentOperations const & getIDocumentContentOperations() const
void SetSmartTags(SwWrongList *pNew, bool bDelete=true)
void SetGrammarCheckDirty(bool bNew) const
The root element of a Writer document layout.
static void lcl_setAutoStyle(IStyleAccess &rStyleAccess, const uno::Any &rValue, SfxItemSet &rSet, const bool bPara)
#define MID_DROPCAP_CHAR_STYLE_NAME
virtual sal_Bool SAL_CALL gotoNextWord(sal_Bool bExpand) override
SwUnoInternalPaM & operator=(const SwPaM &rPaM)
const SwSection & GetSection() const
SwContentNode * GetContentNode(bool bPoint=true) const
virtual void SAL_CALL setPropertyToDefault(const OUString &rPropertyName) override
virtual void SAL_CALL sort(const css::uno::Sequence< css::beans::PropertyValue > &xDescriptor) override
#define PROPERTY_MAP_CHAR_AUTO_STYLE
const SwCharFormat * GetDfltCharFormat() const
#define FN_UNO_PARA_NUM_AUTO_FORMAT
virtual sal_Bool SAL_CALL gotoStartOfSentence(sal_Bool Expand) override
constexpr sal_uInt16 RES_PARATR_BEGIN(RES_TXTATR_END)
static SwPageDesc * GetByName(SwDoc &rDoc, std::u16string_view rName)
static void lcl_setCharStyle(SwDoc &rDoc, const uno::Any &rValue, SfxItemSet &rSet)
virtual void SAL_CALL collapseToStart() override
void GetCursorAttr(SwPaM &rPam, SfxItemSet &rSet, const bool bOnlyTextAttr=false, const bool bGetFromChrFormat=true)
static void lcl_SelectParaAndReset(SwPaM &rPaM, SwDoc &rDoc, o3tl::sorted_vector< sal_uInt16 > const &rWhichIds)
Any SAL_CALL getCaughtException()
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const
void ResetAttrs(const SwPaM &rRg, bool bTextAttr=true, const o3tl::sorted_vector< sal_uInt16 > &rAttrs=o3tl::sorted_vector< sal_uInt16 >(), const bool bSendDataChangedEvents=true, SwRootFrame const *pLayout=nullptr)
Reset attributes.
bool SetTextFormatColl(const SwPaM &rRg, SwTextFormatColl *pFormat, const bool bReset=true, const bool bResetListAttrs=false, SwRootFrame const *pLayout=nullptr)
Add 4th optional parameter .
virtual sal_Bool SAL_CALL gotoEndOfWord(sal_Bool bExpand) override
#define UNO_NAME_IS_SKIP_PROTECTED_TEXT
constexpr TypedWhichId< SwFormatDrop > RES_PARATR_DROP(70)
static SwXParaFrameEnumeration * Create(const SwPaM &rPaM, const enum ParaFrameMode eParaFrameMode, SwFrameFormat *const pFormat=nullptr)
sal_uLong GetIndex() const
virtual sal_Bool SAL_CALL isEndOfParagraph() override
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
static SW_DLLPUBLIC sal_uInt16 GetPoolIdFromUIName(const OUString &rName, SwGetPoolIdFromName)
constexpr TypedWhichId< SwFormatRuby > RES_TXTATR_CJK_RUBY(53)
constexpr TypedWhichId< SwFormatCharFormat > RES_TXTATR_CHARFMT(52)
static sal_uInt16 g_ResetableSetRange[]
void GetTextFromPam(SwPaM &rPam, OUString &rBuffer, SwRootFrame const *pLayout=nullptr)
virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getEnd() override
virtual css::uno::Sequence< OUString > SAL_CALL getAvailableServiceNames() override
void SetCountedInList(bool bCounted)
void getPropertyValue(const SfxItemPropertySimpleEntry &rEntry, const SfxItemSet &rSet, css::uno::Any &rAny) const
constexpr TypedWhichId< SwFormatAutoFormat > RES_TXTATR_AUTOFMT(50)
void SetWrongDirty(WrongState eNew) const
SwCharFormat * GetCharFormat()
bool SetCursorPropertyValue(SfxItemPropertySimpleEntry const &rEntry, css::uno::Any const &rValue, SwPaM &rPam, SfxItemSet &rItemSet)
SwXTextCursor(SwDoc &rDoc, css::uno::Reference< css::text::XText > const &xParent, const CursorType eType, SwPosition const &rPos, SwPosition const *const pMark=nullptr)
SwPaM & SetPam(size_t nArrPos, SwPaM &rPam)
constexpr TypedWhichId< SwFormatINetFormat > RES_TXTATR_INETFMT(51)
void SelectPam(SwPaM &rPam, const bool bExpand)
virtual sal_Bool SAL_CALL hasElements() override
SwFormatColl & GetAnyFormatColl() const
const SfxItemPropertySet & m_rPropSet
void SetPropertyToDefault(SwPaM &rPaM, const SfxItemPropertySet &rPropSet, std::u16string_view rPropertyName)
virtual void SAL_CALL setString(const OUString &rString) override
virtual sal_Bool SAL_CALL gotoNextSentence(sal_Bool Expand) override
void SetNodeNumStart(const SwPosition &rPos, sal_uInt16 nStt)
void SetListId(OUString const &rListId)
virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL createSortDescriptor() override
bool GoPrevPara(SwPaM &rPam, SwMoveFnCollection const &aPosPara)
void SetCharSet(rtl_TextEncoding nVal)
#define FN_UNO_PAGE_STYLE
virtual void SAL_CALL addPropertyChangeListener(const OUString &rPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
PaM is Point and Mark: a selection of the document model.
static void lcl_setRubyCharstyle(SfxItemSet &rItemSet, uno::Any const &rValue)
SwPaM(SwPaM const &rPaM)=delete
bool IsEndOfPara(SwPaM &rUnoCursor)
sal_uInt16 ClearItem(sal_uInt16 nWhich=0)
virtual void SAL_CALL setPropertiesToDefault(const css::uno::Sequence< OUString > &rPropertyNames) override
virtual OUString SAL_CALL getString() override
virtual SwUndoId StartUndo(SwUndoId const eUndoId, SwRewriter const *const pRewriter)=0
Opens undo block.
virtual css::beans::PropertyState SAL_CALL getPropertyState(const OUString &rPropertyName) override
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
void SetSmartTagDirty(bool bNew) const
const SwStartNode * StartOfSectionNode() const
const SwPosition * GetPoint() const
virtual ~SwXTextCursor() override
virtual const SwPaM * GetPaM() const override
constexpr sal_uInt16 RES_PARATR_LIST_END(88)
bool IsHiddenFlag() const
SwContentNode * GetContentNode()
virtual void SAL_CALL gotoStart(sal_Bool bExpand) override
virtual sal_Bool SAL_CALL isCollapsed() override
bool HasMark() const
A PaM marks a selection if Point and Mark are distinct positions.
void SetTextFormatColl(const css::uno::Any &rAny, SwPaM &rPaM)
static bool lcl_ForceIntoMeta(SwPaM &rCursor, uno::Reference< text::XText > const &xParentText, const enum ForceIntoMetaMode eMode)
virtual SfxStyleSheetBasePool * GetStyleSheetPool() override
For Style PI.
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
bool IsStartOfPara(SwPaM &rUnoCursor)
const SfxItemPropertyMap & getPropertyMap() const
void setPropertyValue(const SfxItemPropertySimpleEntry &rEntry, const css::uno::Any &aVal, SfxItemSet &rSet) const
css::beans::PropertyState getPropertyState(const OUString &rName, const SfxItemSet &rSet) const
bool GoCurrSection(SwPaM &rPam, SwMoveFnCollection const &fnMove)
virtual sal_Bool SAL_CALL isStartOfSentence() override
Marks a node in the document model.
virtual void SAL_CALL gotoRange(const css::uno::Reference< css::text::XTextRange > &xRange, sal_Bool bExpand) override
css::uno::Type const & get()
static void lcl_setDropcapCharStyle(SwPaM const &rPam, SfxItemSet &rItemSet, uno::Any const &rValue)
bool GoInDoc(SwPaM &rPam, SwMoveFnCollection const &fnMove)
virtual void SAL_CALL makeRedline(const OUString &rRedlineType, const css::uno::Sequence< css::beans::PropertyValue > &RedlineProperties) override
#define FN_UNO_RANGE_BEGIN
PropertyValueVector_t aPropertyValues
virtual sal_Bool SAL_CALL gotoPreviousParagraph(sal_Bool Expand) override
virtual css::uno::Sequence< css::beans::PropertyState > SAL_CALL getPropertyStates(const css::uno::Sequence< OUString > &rPropertyNames) override
#define FN_UNO_NUM_START_VALUE
void InsertFile(SwUnoCursor *pUnoCursor, const OUString &rURL, const uno::Sequence< beans::PropertyValue > &rOptions)
virtual sal_Int64 SAL_CALL getSomething(const css::uno::Sequence< sal_Int8 > &aIdentifier) override
const SfxPoolItem & GetDefaultItem(sal_uInt16 nWhich) const
virtual css::uno::Sequence< css::uno::Any > SAL_CALL getPropertyValues(const css::uno::Sequence< OUString > &aPropertyNames) override
#define FN_SKIP_PROTECTED_TEXT
virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() override
enumrange< T >::Iterator end(enumrange< T >)
#define FILTER_TEXT_DLG
text filter with encoding dialog
const SwPosition * Start() const
#define IMPLEMENT_FORWARD_REFCOUNT(classname, refcountbase)
virtual css::uno::Any SAL_CALL queryInterface(css::uno::Type const &rType) SAL_OVERRIDE
std::size_t ReadBytes(void *pData, std::size_t nSize)
#define UNO_NAME_IS_SKIP_HIDDEN_TEXT
constexpr sal_uInt16 RES_UNKNOWNATR_BEGIN(RES_BOXATR_END)
void SetGrammarCheck(SwGrammarMarkUp *pNew, bool bDelete=true)
virtual std::shared_ptr< SfxItemSet > getByName(const OUString &rName, SwAutoStyleFamily eFamily)=0
It's slow to iterate through a stylepool looking for a special name, but if the style has been insert...
const LanguageTag & getLocale()
virtual const SwPaM * GetPaM() const =0
static bool lcl_setCharFormatSequence(SwPaM &rPam, uno::Any const &rValue)
css::uno::Any GetPropertyValue(SwPaM &rPaM, const SfxItemPropertySet &rPropSet, std::u16string_view rPropertyName)
constexpr sal_uInt16 RES_FRMATR_END(131)
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
SwTextNode is a paragraph in the document model.
void SetAttrListLevel(int nLevel)
Sets the list level of this text node.
constexpr sal_uInt16 RES_UNKNOWNATR_END(152)
SwUnoCursor & GetCursor()
SwUnoInternalPaM(const SwUnoInternalPaM &)=delete
constexpr sal_uInt16 RES_TXTATR_END(RES_TXTATR_NOEND_END)
SwTextFormatColl * GetCollection()
virtual sal_Bool SAL_CALL gotoStartOfWord(sal_Bool bExpand) override
constexpr sal_uInt16 RES_CHRATR_BEGIN(HINT_BEGIN)
#define FN_NUMBER_NEWSTART
virtual void SAL_CALL setPropertyValue(const OUString &rPropertyName, const css::uno::Any &rValue) override
virtual void SAL_CALL insertDocumentFromURL(const OUString &rURL, const css::uno::Sequence< css::beans::PropertyValue > &rOptions) override
#define FN_UNO_CHARFMT_SEQUENCE
virtual void SAL_CALL addPropertiesChangeListener(const css::uno::Sequence< OUString > &aPropertyNames, const css::uno::Reference< css::beans::XPropertiesChangeListener > &xListener) override
css::uno::Sequence< css::beans::PropertyState > GetPropertyStates(SwPaM &rPaM, const SfxItemPropertySet &rPropSet, const css::uno::Sequence< OUString > &rPropertyNames, const SwGetPropertyStatesCaller eCaller=SW_PROPERTY_STATE_CALLER_DEFAULT)
const o3tl::enumarray< SvxAdjust, unsigned short > aSvxToUnoAdjust USHRT_MAX
SwMoveFnCollection const & fnSectionEnd
SwMoveFnCollection const & fnMoveForward
SwPam::Move()/Find() default argument.
static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId()
SwGetPropertyStatesCaller
void SetEndian(SvStreamEndian SvStreamEndian)
sal_Int32 GetIndex() const
virtual sal_Bool SAL_CALL gotoEndOfParagraph(sal_Bool Expand) override
virtual sal_Bool SAL_CALL isEndOfSentence() override
void SetPropertyValue(SwPaM &rPaM, const SfxItemPropertySet &rPropSet, const OUString &rPropertyName, const css::uno::Any &rValue, const SetAttrMode nAttrMode=SetAttrMode::DEFAULT)
virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createContentEnumeration(const OUString &rServiceName) override
constexpr sal_uInt16 RES_PARATR_LIST_BEGIN(RES_PARATR_END)
Impl(SwDoc &rDoc, const CursorType eType, uno::Reference< text::XText > const &xParent, SwPosition const &rPoint, SwPosition const *const pMark)
const SwPosition * End() const
constexpr sal_uInt16 RES_PARATR_END(82)
void SetWrong(SwWrongList *pNew, bool bDelete=true)
bool GoNextPara(SwPaM &rPam, SwMoveFnCollection const &aPosPara)
SwUnoPropertyMapProvider aSwMapProvider
virtual void SAL_CALL collapseToEnd() override
Sequence< sal_Int8 > aSeq
virtual void SAL_CALL setPropertyValues(const css::uno::Sequence< OUString > &aPropertyNames, const css::uno::Sequence< css::uno::Any > &aValues) override
void makeRedline(SwPaM const &rPaM, std::u16string_view rRedlineType, const uno::Sequence< beans::PropertyValue > &rRedlineProperties)
virtual void SAL_CALL setAllPropertiesToDefault() override
virtual void SAL_CALL removePropertiesChangeListener(const css::uno::Reference< css::beans::XPropertiesChangeListener > &xListener) override
bool IsHideRedlines() const
Replacement for sw::DocumentRedlineManager::GetRedlineFlags() (this is layout-level redline hiding)...
virtual sal_Bool SAL_CALL gotoNextParagraph(sal_Bool Expand) override
SwMoveFnCollection const & fnSectionStart
constexpr sal_uInt16 RES_CHRATR_END(46)
virtual void CallSwClientNotify(const SfxHint &rHint) const override
SwMoveFnCollection const & fnMoveBackward
SwTableNode * FindTableNode()
Search table node, in which it is.
virtual void SAL_CALL removeVetoableChangeListener(const OUString &rPropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &xListener) override
SwFormatColl * GetCurTextFormatColl(SwPaM &rPam, const bool bConditional)
void SetCursorAttr(SwPaM &rPam, const SfxItemSet &rSet, const SetAttrMode nAttrMode, const bool bTableMode=false)
void setNumberingProperty(const Any &rValue, SwPaM &rPam)
virtual sal_Bool SAL_CALL supportsService(const OUString &rServiceName) override
ScXMLEditAttributeMap::Entry const aEntries[]
constexpr TypedWhichId< SwFormatAutoFormat > RES_PARATR_LIST_AUTOFMT(87)
SwContentNode * GoNextSection(SwNodeIndex *, bool bSkipHidden=true, bool bSkipProtect=true) const
Go to next content-node that is not protected or hidden (Both set FALSE ==> GoNext/GoPrevious!!!).
static void lcl_SetNodeNumStart(SwPaM &rCursor, uno::Any const &rValue)
bool SetPageDesc(const css::uno::Any &rValue, SwDoc &rDoc, SfxItemSet &rSet)
SwFormatColl * GetFormatColl() const
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &rPropertyName) override
void GetWriter(const OUString &rFltName, const OUString &rBaseURL, WriterRef &xRet)
Return writer based on the name.
bool DocInsertStringSplitCR(SwDoc &rDoc, const SwPaM &rNewCursor, const OUString &rText, const bool bForceExpandHints)
virtual void SAL_CALL removePropertyChangeListener(const OUString &rPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
detail::Optional< bool >::type tryAccess< bool >(css::uno::Any const &any)
virtual void SetMark()
Unless this is called, the getter method of Mark will return Point.
css::beans::PropertyState GetPropertyState(SwPaM &rPaM, const SfxItemPropertySet &rPropSet, const OUString &rPropertyName)
virtual sal_Bool SAL_CALL isStartOfWord() override
std::pair< const_iterator, bool > insert(Value &&x)
IStyleAccess & GetIStyleAccess()
#define FN_SKIP_HIDDEN_TEXT
virtual SfxStyleSheetBase * Find(const OUString &, SfxStyleFamily eFam, SfxStyleSearchBits n=SfxStyleSearchBits::All)
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual css::uno::Any SAL_CALL getPropertyDefault(const OUString &rPropertyName) override
virtual css::uno::Sequence< css::uno::Any > SAL_CALL getPropertyDefaults(const css::uno::Sequence< OUString > &rPropertyNames) override
constexpr sal_uInt16 RES_FRMATR_BEGIN(RES_PARATR_LIST_END)
virtual void SAL_CALL gotoEnd(sal_Bool bExpand) override
SwContentNode * GoNext(SwNodeIndex *) const
css::uno::Sequence< css::beans::PropertyValue > CreateSortDescriptor(const bool bFromTable)
css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType, Interface1 *p1)
#define FN_UNO_PARA_STYLE
bool IsStartWordWT(sal_Int16 nWordType, SwRootFrame const *pLayout=nullptr) const
constexpr TypedWhichId< SvXMLAttrContainerItem > RES_TXTATR_UNKNOWN_CONTAINER(54)
const SwAttrPool & GetAttrPool() const
sw::UnoCursorPointer m_pUnoCursor
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
CollatorWrapper & GetAppCollator()
SwUnoCursor & GetCursorOrThrow()
Base class of the Writer document model elements.