35#include <osl/diagnose.h>
36#include <osl/thread.h>
59#include <rtl/tencinfo.h>
64#include <com/sun/star/linguistic2/XThesaurus.hpp>
65#include <com/sun/star/i18n/ScriptType.hpp>
66#include <com/sun/star/i18n/WordType.hpp>
77#include <unordered_map>
97 aPaM =
ReadHTML( rInput, rBaseURL, rSel, pHTTPHeaderAttrs );
100 OSL_FAIL(
"Read: Unknown Format" );
150 "ReadRTF: no EditEnginePool!");
154 if ( ( eState != SvParserState::Accepted ) && ( !rInput.
GetError() ) )
159 return xPrsr->GetCurPaM();
169 if ( ( eState != SvParserState::Accepted ) && ( !rInput.
GetError() ) )
174 return xPrsr->GetCurSelection().Max();
195 OSL_FAIL(
"Write: Unknown Format" );
201 sal_Int32 nStartNode, nEndNode;
216 for ( sal_Int32 nNode = nStartNode; nNode <= nEndNode; nNode++ )
219 DBG_ASSERT( pNode,
"Node not found: Search&Replace" );
221 sal_Int32 nStartPos = 0;
222 sal_Int32 nEndPos = pNode->
Len();
225 if ( nNode == nStartNode )
227 if ( nNode == nEndNode )
238 std::vector<std::unique_ptr<SvxFontItem>>& rFontTable,
SvxColorList& rColorList )
244 pAttrItem = rLst.
Next();
246 return rLst.
Count() != 0;
251 std::size_t nAttr = 0;
275 assert(
IsUpdateLayout() &&
"WriteRTF for UpdateMode = sal_False!" );
280 sal_Int32 nStartNode, nEndNode;
292 rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252;
295 std::vector<std::unique_ptr<SvxFontItem>> aFontTable;
300 for ( sal_uInt16 nScriptType = 0; nScriptType < 3; nScriptType++ )
303 if ( nScriptType == 1 )
305 else if ( nScriptType == 2 )
311 bool bAlreadyExist =
false;
312 size_t nTestMax = nScriptType ? aFontTable.size() : 1;
313 for (
size_t nTest = 0; !bAlreadyExist && ( nTest < nTestMax ); nTest++ )
315 bAlreadyExist = *aFontTable[ nTest ] == *pFontItem;
318 if ( !bAlreadyExist )
319 aFontTable.emplace_back(
new SvxFontItem( *pFontItem ) );
325 for ( std::vector<SvxFontItem*>::size_type j = 0; j < aFontTable.size(); j++ )
359 rtl_TextEncoding eChrSet = pFontItem->
GetCharSet();
367 SAL_WARN_IF(eChrSet == RTL_TEXTENCODING_SYMBOL,
"editeng",
"OpenSymbol should not have charset of RTL_TEXTENCODING_SYMBOL in new documents");
368 eChrSet = RTL_TEXTENCODING_UTF8;
370 DBG_ASSERT( eChrSet != 9,
"SystemCharSet?!" );
371 if( RTL_TEXTENCODING_DONTKNOW == eChrSet )
372 eChrSet = osl_getThreadTextEncoding();
390 aColorList.push_back(rDefault.
GetValue());
394 auto pColorItem(
dynamic_cast<SvxColorItem const*
>(pItem));
395 if (pColorItem && pColorItem->GetValue() !=
COL_AUTO)
397 aColorList.push_back(pColorItem->GetValue());
402 for ( SvxColorList::size_type j = 0; j < aColorList.size(); j++ )
419 std::unordered_map<SfxStyleSheetBase*, sal_uInt32> aStyleSheetToIdMap;
423 std::shared_ptr<SfxStyleSheetIterator> aSSSIterator = std::make_shared<SfxStyleSheetIterator>(
GetStyleSheetPool(),
424 SfxStyleFamily::All);
428 pStyle = aSSSIterator->Next() )
430 aStyleSheetToIdMap[pStyle] =
nId;
434 if ( aSSSIterator->Count() )
437 sal_uInt32 nStyle = 0;
441 pStyle = aSSSIterator->Next() )
446 sal_uInt32 nNumber = nStyle + 1;
452 if ( pStyle->GetItemSet().GetItemState( nParAttr ) == SfxItemState::SET )
454 const SfxPoolItem& rItem = pStyle->GetItemSet().Get( nParAttr );
460 if ( !pStyle->GetParent().isEmpty() && ( pStyle->GetParent() != pStyle->GetName() ) )
465 nNumber = aStyleSheetToIdMap.find(pParent)->second;
472 if ( !pStyle->GetFollow().isEmpty() && ( pStyle->GetFollow() != pStyle->GetName() ) )
477 nNumber = aStyleSheetToIdMap.find(pNext)->second;
501 MapMode aTwpMode( MapUnit::MapTwip );
511 for ( sal_Int32 nNode = nStartNode; nNode <= nEndNode; nNode++ )
514 DBG_ASSERT( pNode,
"Node not found: Search&Replace" );
524 sal_uInt32 nNumber = aStyleSheetToIdMap.find(pNode->
GetStyleSheet())->second;
534 WriteItemAsRTF( rItem, rOutput, nNode, 0, aFontTable, aColorList );
546 WriteItemAsRTF( rItem, rOutput, nNode, 0, aFontTable, aColorList );
555 DBG_ASSERT( pParaPortion,
"Portion not found: WriteRTF" );
558 sal_Int32 nStartPos = 0;
559 sal_Int32 nEndPos = pNode->
Len();
560 sal_Int32 nStartPortion = 0;
562 bool bFinishPortion =
false;
563 sal_Int32 nPortionStart;
565 if ( nNode == nStartNode )
569 if ( nStartPos != 0 )
571 aAttribItems.
Clear();
573 if ( aAttribItems.
Count() )
577 WriteItemListAsRTF( aAttribItems, rOutput, nNode, nStartPos, aFontTable, aColorList );
578 bFinishPortion =
true;
580 aAttribItems.
Clear();
583 if ( nNode == nEndNode )
591 for ( sal_Int32
n = 0;
n <= nEndPortion;
n++ )
594 if (
n < nStartPortion )
607 aAttribItems.
Clear();
628 if (
n == nStartPortion )
630 if (
n == nEndPortion )
637 if ( bFinishPortion )
640 bFinishPortion =
false;
659 std::vector<std::unique_ptr<SvxFontItem>>& rFontTable,
SvxColorList& rColorList )
661 sal_uInt16 nWhich = rItem.
Which();
687 sal_Int32 nTxtFirst =
static_cast<const SvxLRSpaceItem&
>(rItem).GetTextFirstLineOffset();
691 sal_uInt32 nTxtLeft =
static_cast< sal_uInt32
>(
static_cast<const SvxLRSpaceItem&
>(rItem).GetTextLeft());
692 nTxtLeft =
static_cast<sal_uInt32
>(
LogicToTwips( nTxtLeft ));
695 sal_uInt32 nTxtRight =
static_cast<const SvxLRSpaceItem&
>(rItem).GetRight();
703 sal_uInt32 nUpper =
static_cast<const SvxULSpaceItem&
>(rItem).GetUpper();
704 nUpper =
static_cast<sal_uInt32
>(
LogicToTwips( nUpper ));
707 sal_uInt32 nLower =
static_cast<const SvxULSpaceItem&
>(rItem).GetLower();
733 switch ( eJustification )
747 for ( sal_uInt16
i = 0;
i < rTabs.
Count();
i++ )
757 SvxColorList::const_iterator
const iter = std::find(
758 rColorList.begin(), rColorList.end(),
760 assert(iter != rColorList.end());
761 sal_uInt32
const n = iter - rColorList.begin();
771 for (
size_t i = 0;
i < rFontTable.size(); ++
i)
773 if (*rFontTable[
i] == rItem)
876 if ( nRelief == FontRelief::Embossed )
878 if ( nRelief == FontRelief::Engraved )
885 if ( nMark == FontEmphasisMark::NONE )
887 else if ( nMark == (FontEmphasisMark::Accent | FontEmphasisMark::PosAbove) )
928 MapMode aPntMode( MapUnit::MapPoint );
932 sal_uInt16
const nProp =
static_cast<const SvxEscapementItem&
>(rItem).GetProportionalHeight();
933 sal_uInt16 nProp100 = nProp*100;
937 double fAutoAscent = .8;
938 double fAutoDescent = .2;
941 fAutoAscent = rFontMetric.
GetAscent() / fFontHeight;
942 fAutoDescent = rFontMetric.
GetDescent() / fFontHeight;
946 nEsc = fAutoAscent * (100 - nProp);
951 nEsc = fAutoDescent * -(100 - nProp);
960 tools::Long nUpDown = nFontHeight * std::abs( nEsc ) / 100;
996 sal_Int32 nStartNode, nEndNode;
997 sal_Int32 nTextPortions = 0;
1003 bool bOnlyFullParagraphs = !( aSel.
Min().
GetIndex() ||
1015 for ( nNode = nStartNode; nNode <= nEndNode; nNode++ )
1018 DBG_ASSERT( pNode,
"Node not found: Search&Replace" );
1020 if ( bOnlyFullParagraphs )
1026 sal_Int32 nStartPos = 0;
1027 sal_Int32 nEndPos = pNode->
Len();
1029 bool bEmptyPara = nEndPos == 0;
1031 if ( ( nNode == nStartNode ) && !bOnlyFullParagraphs )
1033 if ( ( nNode == nEndNode ) && !bOnlyFullParagraphs )
1037 ContentInfo *pC = pTxtObj->CreateAndInsertContent();
1050 pC->
SetText(pNode->
Copy(nStartPos, nEndPos-nStartPos));
1054 std::size_t nAttr = 0;
1061 ( ( pAttr->
GetEnd() > nStartPos ) && ( pAttr->
GetStart() < nEndPos ) ) )
1065 if ( ( nNode == nStartNode ) && ( nStartPos != 0 ) )
1071 if ( nNode == nEndNode )
1073 if ( aX.
GetEnd() > (nEndPos-nStartPos) )
1074 aX.
GetEnd() = nEndPos-nStartPos;
1076 DBG_ASSERT( aX.
GetEnd() <= (nEndPos-nStartPos),
"CreateTextObject: Attribute too long!" );
1077 if ( !aX.
GetLen() && !bEmptyPara )
1078 pTxtObj->DestroyAttrib(aX);
1080 rCAttriblist.push_back(std::move(aX));
1087 if ( bAllowBigObjects && bOnlyFullParagraphs && pNode->
GetWrongList() )
1094 if ( bAllowBigObjects && bOnlyFullParagraphs &&
IsFormatted() &&
IsUpdateLayout() && ( nTextPortions >= nBigObjectStart ) )
1097 pTxtObj->SetPortionInfo(std::unique_ptr<XParaPortionList>(pXList));
1098 for ( nNode = nStartNode; nNode <= nEndNode; nNode++ )
1127 int nTPLen = 0, nTxtLen = 0;
1131 nTxtLen += pParaPortion->
GetLines()[--nTest].GetLen();
1132 DBG_ASSERT( ( nTPLen == pParaPortion->
GetNode()->
Len() ) && ( nTxtLen == pParaPortion->
GetNode()->
Len() ),
"CreateBinTextObject: ParaPortion not completely formatted!" );
1176 bool bUsePortionInfo =
false;
1189 bUsePortionInfo =
true;
1192 bool bConvertMetricOfItems =
false;
1196 eSourceUnit = rTextObjectImpl.
GetMetric();
1198 if ( eSourceUnit != eDestUnit )
1199 bConvertMetricOfItems =
true;
1205 sal_Int32 nContents =
static_cast<sal_Int32
>(rTextObjectImpl.
GetContents().size());
1206 SAL_WARN_IF( nContents < 0,
"editeng",
"ImpEditEngine::InsertTextObject - contents overflow " << nContents);
1209 for (sal_Int32
n = 0;
n < nContents; ++
n, ++nPara)
1212 bool bNewContent = aPaM.
GetNode()->
Len() == 0;
1213 const sal_Int32 nStartPos = aPaM.
GetIndex();
1218 DBG_ASSERT( pPortion,
"Blind Portion in FastInsertText" );
1226 bool bUpdateFields =
false;
1227 for (
size_t nAttr = 0; nAttr < nNewAttribs; ++nAttr)
1234 if ( !bAllreadyHasAttribs || rX.
IsFeature() )
1242 if ( !bConvertMetricOfItems )
1246 std::unique_ptr<SfxPoolItem> pNew(rX.
GetItem()->
Clone());
1253 bUpdateFields =
true;
1263 if ( bUpdateFields )
1270#if OSL_DEBUG_LEVEL > 0 && !defined NDEBUG
1274 bool bParaAttribs =
false;
1275 if ( bNewContent || ( (
n > 0 ) && (
n < (nContents-1) ) ) )
1283 DBG_ASSERT( pStyle,
"InsertBinTextObject - Style not found!" );
1286 if ( !bConvertMetricOfItems )
1294 if ( bNewContent && bUsePortionInfo )
1298 DBG_ASSERT( pParaPortion,
"InsertBinTextObject: ParaPortion?" );
1307 for ( sal_uInt16 _n = 0; _n <
nCount; _n++ )
1317 for ( sal_uInt16
m = 0;
m <
nCount;
m++ )
1326 int nTPLen = 0, nTxtLen = 0;
1330 nTxtLen += pParaPortion->
GetLines()[--nTest].GetLen();
1331 DBG_ASSERT( ( nTPLen == pParaPortion->
GetNode()->
Len() ) && ( nTxtLen == pParaPortion->
GetNode()->
Len() ),
"InsertTextObject: ParaPortion not completely formatted!" );
1335 if ( !bParaAttribs )
1348 if (
n < ( nContents-1) )
1364 std::vector<editeng::MisspellRanges> aRanges;
1366 for (sal_Int32
i = 0,
n = rDoc.
Count();
i <
n; ++
i)
1373 aRanges.emplace_back(
i, std::vector(pWrongList->
GetRanges()));
1376 aRanges.swap(rRanges);
1382 for (
auto const& rParaRanges : rRanges)
1390 pWrongList->
SetRanges(std::vector(rParaRanges.maRanges));
1411 if ( pEndPos && pAttr && ( pAttr->
GetEnd() < *pEndPos ) )
1412 *pEndPos = pAttr->
GetEnd();
1466 bool bIsStart =
false;
1477 if ( !bMultipleDoc )
1482 aCurSel.
Min() = aCurSel.
Max();
1495 bool bHasConvTxt =
false;
1498 for (sal_Int32 k = 0; k < nParas; ++k)
1500 std::vector<sal_Int32> aPortions;
1502 for (
size_t nPos = 0;
nPos < aPortions.size(); ++
nPos )
1504 sal_Int32 nEnd = aPortions[
nPos ];
1505 sal_Int32 nStart =
nPos > 0 ? aPortions[
nPos - 1 ] : 0;
1516 bHasConvTxt = (nSrcLang == nLangFound) ||
1529 sal_Int32 nOptions,
bool bIsInteractive,
bool bMultipleDoc )
1567 bool bIsStart =
false;
1574 ::comphelper::getProcessComponentContext(),
1578 nOptions, bIsInteractive,
1579 bIsStart, pEditView );
1598 if ( !bMultipleDoc )
1603 aCurSel.
Min() = aCurSel.
Max();
1615 const vcl::Font *pFont, sal_uInt16 nFontWhichId )
1635 aNewSet.
Put( aFontItem );
1647 bool bAllowImplicitChangesForNotConvertibleText,
1662 while (aRes.isEmpty())
1665 if (bAllowImplicitChangesForNotConvertibleText &&
1668 sal_Int32 nPara =
pConvInfo->aConvContinue.nPara;
1681 sal_Int32 nAttribStart = -1;
1682 sal_Int32 nAttribEnd = -1;
1683 sal_Int32 nCurPos = -1;
1685 std::vector<sal_Int32> aPortions;
1687 for (
size_t nPos = 0;
nPos < aPortions.size(); ++
nPos )
1689 const sal_Int32 nEnd = aPortions[
nPos ];
1690 const sal_Int32 nStart =
nPos > 0 ? aPortions[
nPos - 1 ] : 0;
1696 const sal_Int32 nLangIdx = nEnd > nStart ? nStart + 1 : nStart;
1701 bool bLangOk = (nLangFound == nSrcLang) ||
1707 DBG_ASSERT(nEnd >= aCurStart.
nIndex,
"error while scanning attributes (a)" );
1708 DBG_ASSERT(nEnd >= nAttribEnd,
"error while scanning attributes (b)" );
1709 if ( nLangFound == nResLang)
1714 if (nAttribStart<0 &&
1715 nEnd > aCurStart.
nIndex && bLangOk)
1717 nAttribStart = nStart;
1719 nResLang = nLangFound;
1726 if (nAttribStart >= 0 && nAttribStart < aCurStart.
nIndex)
1728 nAttribStart = aCurStart.
nIndex;
1736 if (bAllowImplicitChangesForNotConvertibleText &&
1737 !bLangOk && !bIsAsianScript && nEnd > aCurStart.
nIndex)
1753 if (nAttribStart>=0 && nAttribEnd>=0)
1758 else if (nCurPos>=0)
1769 if ( !( aEPaM < pConvInfo->aConvTo ) )
1792 if ( !aWord.isEmpty() )
1796 if ( aRes.isEmpty() )
1797 aCurSel =
WordRight( aCurSel.
Min(), css::i18n::WordType::DICTIONARY_WORD );
1808 if ( !rConvTxt.isEmpty() )
1809 rConvTxtLang = nResLang;
1819 aCurSel.
Min() = aCurSel.
Max();
1821 Reference< XSpellAlternatives > xSpellAlt;
1822 Sequence< PropertyValue > aEmptySeq;
1823 while (!xSpellAlt.is())
1839 if ( !( aEPaM < pSpellInfo->aSpellTo ) )
1843 aCurSel =
SelectWord( aCurSel, css::i18n::WordType::DICTIONARY_WORD );
1854 aWord += OUStringChar(cNext);
1858 if ( !aWord.isEmpty() )
1862 xSpellAlt =
xSpeller->spell( aWord,
static_cast<sal_uInt16
>(eLang), aEmptySeq );
1865 if ( !xSpellAlt.is() )
1866 aCurSel =
WordRight( aCurSel.
Min(), css::i18n::WordType::DICTIONARY_WORD );
1882 Reference< XSpellAlternatives > xSpellAlt;
1883 Sequence< PropertyValue > aEmptySeq;
1884 while (!xSpellAlt.is())
1893 aCurSel =
SelectWord( aCurSel, css::i18n::WordType::DICTIONARY_WORD );
1904 aWord += OUStringChar(cNext);
1908 if ( !aWord.isEmpty() )
1911 if ( !xSpellAlt.is() )
1912 aCurSel =
WordRight( aCurSel.
Min(), css::i18n::WordType::DICTIONARY_WORD );
1916 rSelection = aCurSel;
1932 pSpellInfo->aLastSpellContentSelections.clear();
1949 aSentencePaM.
Max() = aCurSel.
Max();
1984 const uno::Reference< XSpellAlternatives >& xAlt,
1996 rToFill.push_back(aPortion);
1999 pSpellInfo->aLastSpellPortions.push_back(aPortion);
2000 pSpellInfo->aLastSpellContentSelections.push_back(rSel);
2007 const Reference< XSpellAlternatives >& xAlt,
2033 bool bIsField = pFieldAttr &&
2037 sal_Int32 nEndField = bIsField ? pFieldAttr->
GetEnd() : -1;
2042 bool bIsEndField = nEndField == aCursor.
GetIndex();
2046 bIsField = _pFieldAttr &&
2052 nEndField = _pFieldAttr->
GetEnd();
2055 if(eCurLanguage != eStartLanguage || bIsField || bIsEndField)
2057 eStartLanguage = eCurLanguage;
2062 AddPortion(aSelection, xAlt, rToFill, bIsEndField);
2068 AddPortion(aSelection, xAlt, rToFill, bIsField);
2089 if(
pSpellInfo->aLastSpellPortions.size() == rNewPortions.size())
2091 DBG_ASSERT( !rNewPortions.empty(),
"rNewPortions should not be empty here" );
2093 "aLastSpellPortions and aLastSpellContentSelections size mismatch" );
2097 svx::SpellPortions::const_iterator aCurrentNewPortion = rNewPortions.end();
2098 svx::SpellPortions::const_iterator aCurrentOldPortion =
pSpellInfo->aLastSpellPortions.end();
2099 SpellContentSelections::const_iterator aCurrentOldPosition =
pSpellInfo->aLastSpellContentSelections.end();
2100 bool bSetToEnd =
false;
2103 --aCurrentNewPortion;
2104 --aCurrentOldPortion;
2105 --aCurrentOldPosition;
2111 rEditView.
pImpEditView->SetEditSelection( aCurrentOldPosition->Max() );
2122 if(aCurrentNewPortion->sText != aCurrentOldPortion->sText)
2128 ImpInsertText( *aCurrentOldPosition, aCurrentNewPortion->sText );
2130 else if(aCurrentNewPortion->eLanguage != aCurrentOldPortion->eLanguage)
2138 while(aCurrentNewPortion != rNewPortions.begin());
2142 DBG_ASSERT( !
pSpellInfo->aLastSpellContentSelections.empty(),
"aLastSpellContentSelections should not be empty here" );
2145 SpellContentSelections::const_iterator aCurrentEndPosition =
pSpellInfo->aLastSpellContentSelections.end();
2146 --aCurrentEndPosition;
2147 SpellContentSelections::const_iterator aCurrentStartPosition =
pSpellInfo->aLastSpellContentSelections.begin();
2148 EditSelection aAllSentence(aCurrentStartPosition->Min(), aCurrentEndPosition->Max());
2153 for(
const auto& rCurrentNewPortion : rNewPortions)
2157 if(eCurLanguage != rCurrentNewPortion.eLanguage)
2172 aCurrentPaM =
ImpInsertText( aCurrentPaM , rCurrentNewPortion.sText );
2185 const sal_Int32 nDelta = rEditView.
pImpEditView->GetEditSelection().Max().GetNode()->Len() - nOldLen;
2186 const sal_Int32 nEndOfSentence = aOldSel.
Max().
GetIndex() + nDelta;
2227 bool bRestartTimer =
false;
2231 sal_Int32 nInvalids = 0;
2232 Sequence< PropertyValue > aEmptySeq;
2233 for ( sal_Int32
n = 0;
n < nNodes;
n++ )
2236 if ( pThisNodeOnly )
2237 pNode = pThisNodeOnly;
2246 sal_Int32 nPaintFrom = -1;
2247 sal_Int32 nPaintTo = 0;
2248 bool bSimpleRepaint =
true;
2252 EditPaM aPaM( pNode, nInvStart );
2260 aSel =
SelectWord( aSel, i18n::WordType::DICTIONARY_WORD );
2263 bool bDottAdded =
false;
2275 bool bChanged =
false;
2276 if (!aWord.isEmpty())
2283 const sal_Int32 nXEnd = bDottAdded ? nWEnd -1 : nWEnd;
2284 if ( !pWrongList->
HasWrong( nWStart, nXEnd ) )
2288 bool bCursorPos =
false;
2289 if ( aCursorPos.
GetNode() == pNode )
2291 if ( ( nWStart <= aCursorPos.
GetIndex() ) && nWEnd >= aCursorPos.
GetIndex() )
2298 bRestartTimer =
true;
2317 bSimpleRepaint =
false;
2324 nPaintFrom = nWStart;
2330 aSel =
WordRight( aSel.
Max(), i18n::WordType::DICTIONARY_WORD );
2331 if ( bChanged && ( aSel.
Min().
GetNode() == pNode ) &&
2342 if ( nPaintFrom>=0 )
2352 EditPaM aStartPaM( pNode, nPaintFrom );
2353 EditPaM aEndPaM( pNode, nPaintTo );
2366 else if ( bSimpleRepaint )
2375 aClipRect.
SetPos( pView->pImpEditView->GetWindowPos( aClipRect.
TopLeft() ) );
2376 pView->pImpEditView->InvalidateAtWindow(aClipRect);
2389 if ( bInterruptible && ( nInvalids >= 2 ) )
2391 bRestartTimer =
true;
2396 if ( pThisNodeOnly )
2399 if ( bRestartTimer )
2412 Reference< XSpellAlternatives > xSpellAlt;
2413 Sequence< PropertyValue > aEmptySeq;
2414 while ( !xSpellAlt.is() )
2416 if ( ( aCurSel.
Max().
GetNode() == pLastNode ) &&
2422 aCurSel =
SelectWord( aCurSel, css::i18n::WordType::DICTIONARY_WORD );
2424 if ( !aWord.isEmpty() )
2428 xSpellAlt =
xSpeller->spell( aWord,
static_cast<sal_uInt16
>(eLang), aEmptySeq );
2430 aCurSel =
WordRight( aCurSel.
Max(), css::i18n::WordType::DICTIONARY_WORD );
2445 aCurSel =
SelectWord( aCurSel, css::i18n::WordType::DICTIONARY_WORD );
2455 if (xDlg->Execute() ==
RET_OK)
2470 sal_Int32 nFound = 0;
2475 if ( ( rSearchItem.
GetCommand() == SvxSearchCmd::FIND ) ||
2476 ( rSearchItem.
GetCommand() == SvxSearchCmd::FIND_ALL ) )
2478 if (
Search( rSearchItem, pEditView ) )
2481 else if ( rSearchItem.
GetCommand() == SvxSearchCmd::REPLACE )
2491 if(
Search( rSearchItem, pEditView ) )
2494 else if ( rSearchItem.
GetCommand() == SvxSearchCmd::REPLACE_ALL )
2505 bool bFound =
ImpSearch( aTmpItem, aCurSel, aStartPaM, aFoundSel );
2512 bFound =
ImpSearch( aTmpItem, aCurSel, aStartPaM, aFoundSel );
2538 aStartPaM = aSel.
Min();
2541 bool bFound =
ImpSearch( rSearchItem, aSel, aStartPaM, aFoundSel );
2542 if ( bFound && ( aFoundSel == aSel ) )
2544 aStartPaM = aSel.
Min();
2545 bFound =
ImpSearch( rSearchItem, aSel, aStartPaM, aFoundSel );
2554 pEditView->
pImpEditView->SetEditSelection( aFoundSel );
2574 if ( bSearchInSelection )
2586 for ( sal_Int32 nNode = nStartNode;
2587 bBack ? ( nNode >= nEndNode ) : ( nNode <= nEndNode) ;
2588 bBack ? nNode-- : nNode++ )
2596 sal_Int32 nStartPos = 0;
2598 if ( nNode == nStartNode )
2605 if ( ( nNode == nEndNode ) && bSearchInSelection )
2615 bool bFound =
false;
2620 nStartPos = nEndPos;
2623 bFound = aSearcher.
SearchBackward( aParaStr, &nStartPos, &nEndPos);
2627 bFound = aSearcher.
SearchForward( aParaStr, &nStartPos, &nEndPos);
2652 return ImpSearch( aTmpItem, aDummySel, aStartPaM, aFoundSel );
2664 struct eeTransliterationChgData
2670 uno::Sequence< sal_Int32 > aOffsets;
2686 if (nTransliterationMode == TransliterationFlags::SENTENCE_CASE)
2701 bool bChanges =
false;
2702 bool bLenChanged =
false;
2703 std::unique_ptr<EditUndoTransliteration> pUndo;
2708 for ( sal_Int32 nNode = nStartNode; nNode <= nEndNode; nNode++ )
2711 const OUString& aNodeStr = pNode->
GetString();
2712 const sal_Int32 nStartPos = nNode==nStartNode ? aSel.
Min().
GetIndex() : 0;
2713 const sal_Int32 nEndPos = nNode==nEndNode ? aSel.
Max().
GetIndex() : aNodeStr.getLength();
2715 sal_Int32 nCurrentStart = nStartPos;
2716 sal_Int32 nCurrentEnd = nEndPos;
2724 const sal_Int16 nWordType = i18n::WordType::ANYWORD_IGNOREWHITESPACES;
2732 std::vector< eeTransliterationChgData > aChanges;
2733 eeTransliterationChgData aChgData;
2735 if (nTransliterationMode == TransliterationFlags::TITLE_CASE)
2739 i18n::Boundary aSttBndry;
2740 i18n::Boundary aEndBndry;
2741 aSttBndry = _xBI->getWordBoundary(
2742 aNodeStr, nStartPos,
2745 aEndBndry = _xBI->getWordBoundary(
2751 if (aSttBndry.endPos <= nStartPos)
2753 aSttBndry = _xBI->nextWord(
2754 aNodeStr, aSttBndry.endPos,
2759 if (aEndBndry.startPos >= nEndPos)
2761 aEndBndry = _xBI->previousWord(
2762 aNodeStr, aEndBndry.startPos,
2775 if (nNode == nStartNode) {
2776 aSttBndry.startPos = std::max(aSttBndry.startPos, aSel.
Min().
GetIndex());
2777 aSttBndry.endPos = std::min(aSttBndry.endPos, aSel.
Max().
GetIndex());
2778 aEndBndry.startPos = std::max(aEndBndry.startPos, aSttBndry.startPos);
2779 aEndBndry.endPos = std::min(aEndBndry.endPos, aSel.
Max().
GetIndex());
2782 i18n::Boundary aCurWordBndry( aSttBndry );
2783 while (aCurWordBndry.endPos && aCurWordBndry.startPos <= aEndBndry.startPos)
2785 nCurrentStart = aCurWordBndry.startPos;
2786 nCurrentEnd = aCurWordBndry.endPos;
2787 sal_Int32 nLen = nCurrentEnd - nCurrentStart;
2788 DBG_ASSERT( nLen > 0,
"invalid word length of 0" );
2790 Sequence< sal_Int32 > aOffsets;
2791 OUString aNewText( aTransliterationWrapper.
transliterate(aNodeStr,
2793 nCurrentStart, nLen, &aOffsets ));
2795 if (aNodeStr != aNewText)
2797 aChgData.nStart = nCurrentStart;
2798 aChgData.nLen = nLen;
2800 aChgData.aNewText = aNewText;
2801 aChgData.aOffsets = aOffsets;
2802 aChanges.push_back( aChgData );
2804#if OSL_DEBUG_LEVEL > 1
2805 OUString aSelTxt (
GetSelected( aChgData.aSelection ) );
2809 aCurWordBndry = _xBI->nextWord(aNodeStr, nCurrentStart,
2813 DBG_ASSERT( nCurrentEnd >= aEndBndry.endPos,
"failed to reach end of transliteration" );
2815 else if (nTransliterationMode == TransliterationFlags::SENTENCE_CASE)
2819 sal_Int32 nLastStart = _xBI->beginOfSentence(
2822 sal_Int32 nLastEnd = _xBI->endOfSentence(
2823 aNodeStr, nLastStart,
2827 nCurrentStart = _xBI->beginOfSentence(
2828 aNodeStr, nStartPos,
2830 nCurrentEnd = _xBI->endOfSentence(
2831 aNodeStr, nCurrentStart,
2835 if (nCurrentEnd <= nStartPos)
2841 i18n::Boundary aBndry = _xBI->nextWord( aNodeStr, nCurrentEnd,
2843 i18n::WordType::DICTIONARY_WORD);
2846 nCurrentStart = _xBI->beginOfSentence(
2847 aNodeStr, aBndry.startPos,
2849 nCurrentEnd = _xBI->endOfSentence(
2850 aNodeStr, nCurrentStart,
2854 if (nLastStart >= nEndPos)
2860 i18n::Boundary aBndry = _xBI->previousWord( aNodeStr, nLastStart,
2862 i18n::WordType::DICTIONARY_WORD);
2863 nLastEnd = _xBI->endOfSentence(
2864 aNodeStr, aBndry.startPos,
2866 if (nCurrentEnd > nLastEnd)
2867 nCurrentEnd = nLastEnd;
2871 nCurrentStart = std::max(aSel.
Min().
GetIndex(), nCurrentStart);
2872 nCurrentEnd = std::min(aSel.
Max().
GetIndex(), nCurrentEnd);
2873 nLastStart = std::max(aSel.
Min().
GetIndex(), nLastStart);
2874 nLastEnd = std::min(aSel.
Max().
GetIndex(), nLastEnd);
2876 while (nCurrentStart < nLastEnd)
2878 const sal_Int32 nLen = nCurrentEnd - nCurrentStart;
2879 DBG_ASSERT( nLen > 0,
"invalid word length of 0" );
2881 Sequence< sal_Int32 > aOffsets;
2882 OUString aNewText( aTransliterationWrapper.
transliterate( aNodeStr,
2884 nCurrentStart, nLen, &aOffsets ));
2886 if (aNodeStr != aNewText)
2888 aChgData.nStart = nCurrentStart;
2889 aChgData.nLen = nLen;
2891 aChgData.aNewText = aNewText;
2892 aChgData.aOffsets = aOffsets;
2893 aChanges.push_back( aChgData );
2896 i18n::Boundary aFirstWordBndry = _xBI->nextWord(
2897 aNodeStr, nCurrentEnd,
2900 nCurrentStart = aFirstWordBndry.startPos;
2901 nCurrentEnd = _xBI->endOfSentence(
2902 aNodeStr, nCurrentStart,
2905 DBG_ASSERT( nCurrentEnd >= nLastEnd,
"failed to reach end of transliteration" );
2911 if ( bConsiderLanguage )
2914 if ( nCurrentEnd > nEndPos )
2915 nCurrentEnd = nEndPos;
2918 const sal_Int32 nLen = nCurrentEnd - nCurrentStart;
2920 Sequence< sal_Int32 > aOffsets;
2921 OUString aNewText( aTransliterationWrapper.
transliterate( aNodeStr, nLanguage, nCurrentStart, nLen, &aOffsets ) );
2923 if (aNodeStr != aNewText)
2925 aChgData.nStart = nCurrentStart;
2926 aChgData.nLen = nLen;
2928 aChgData.aNewText = aNewText;
2929 aChgData.aOffsets = aOffsets;
2930 aChanges.push_back( aChgData );
2933 nCurrentStart = nCurrentEnd;
2934 }
while( nCurrentEnd < nEndPos );
2937 if (!aChanges.empty())
2943 for (
const eeTransliterationChgData & aChange : aChanges)
2960 if (bSingleNode && !bHasAttribs)
2968 for (
size_t i = 0;
i < aChanges.size(); ++
i)
2970 eeTransliterationChgData& rData = aChanges[ aChanges.size() - 1 -
i ];
2973 if (rData.nLen != rData.aNewText.getLength())
2977 const sal_Int32 nDiffs =
2979 rData.nStart, rData.aNewText, rData.aOffsets );
2982 if (aSel.
Max().
GetNode() == rData.aSelection.Max().GetNode())
2985 sal_Int32 nSelNode =
aEditDoc.
GetPos( rData.aSelection.Min().GetNode() );
2995 pUndo->SetNewSelection( aESel );
3015 sal_Int32 nCurrentStart,
3016 std::u16string_view rNewText,
3017 const uno::Sequence< sal_Int32 >& rOffsets )
3020 sal_Int32 nCharsAfterTransliteration = rOffsets.getLength();
3021 const sal_Int32* pOffsets = rOffsets.getConstArray();
3023 for ( sal_Int32
n = 0;
n < nCharsAfterTransliteration;
n++ )
3025 sal_Int32 nCurrentPos = nCurrentStart+
n;
3026 sal_Int32 nDiff = (nCurrentPos-nDiffs) - pOffsets[
n];
3030 DBG_ASSERT( nCurrentPos < pNode->Len(),
"TransliterateText - String smaller than expected!" );
3031 pNode->
SetChar( nCurrentPos, rNewText[
n] );
3033 else if ( nDiff < 0 )
3036 DBG_ASSERT( nCurrentPos < pNode->Len(),
"TransliterateText - String smaller than expected!" );
3037 pNode->
SetChar( nCurrentPos, rNewText[
n] );
3039 DBG_ASSERT( (nCurrentPos+1) < pNode->
Len(),
"TransliterateText - String smaller than expected!" );
3044 DBG_ASSERT( nDiff == 1,
"TransliterateText - Diff other than expected! But should work..." );
3048 nDiffs = sal::static_int_cast< short >(nDiffs + nDiff);
3103 MapMode aTwipsMode( MapUnit::MapTwip );
3104 aSz =
pRefDev->LogicToLogic( aSz,
nullptr, &aTwipsMode );
AttribsType & GetAttribs()
const EditCharAttrib * FindFeature(sal_Int32 nPos) const
static void DbgCheckAttribs(CharAttribList const &rAttribs)
bool HasAttrib(sal_Int32 nStartPos, sal_Int32 nEndPos) const
void InsertAttrib(EditCharAttrib *pAttrib)
const EditCharAttrib * FindAttrib(sal_uInt16 nWhich, sal_Int32 nPos) const
const SfxPoolItem & GetItem(sal_uInt16 nWhich) const
SfxStyleFamily GetFamily() const
const SfxItemSet & GetParaAttribs() const
void SetStyle(const OUString &rStyle)
const WrongList * GetWrongList() const
const std::vector< XEditAttribute > & GetCharAttribs() const
void SetFamily(const SfxStyleFamily &rFamily)
void SetText(const OUString &rStr)
void SetWrongList(WrongList *p)
const OUString & GetStyle() const
void SetChar(sal_Int32 nPos, sal_Unicode c)
CharAttribList & GetCharAttribs()
sal_Unicode GetChar(sal_Int32 nPos) const
const OUString & GetString() const
ContentAttribs & GetContentAttribs()
WrongList * GetWrongList()
void UnExpandPositions(sal_Int32 &rStartPos, sal_Int32 &rEndPos)
re-write offsets in the expanded text to string offsets
OUString Copy(sal_Int32 nPos) const
OUString GetExpandedText(sal_Int32 nStartPos=0, sal_Int32 nEndPos=-1) const
return content including expanded fields
void SetWrongList(WrongList *p)
sal_Int32 GetExpandedLen() const
return length including expanded fields
SfxStyleSheet * GetStyleSheet()
virtual VclPtr< AbstractThesaurusDialog > CreateThesaurusDialog(weld::Widget *, css::uno::Reference< css::linguistic2::XThesaurus > xThesaurus, const OUString &rWord, LanguageType nLanguage)=0
static EditAbstractDialogFactory * Create()
const SfxPoolItem * GetItem() const
EditPaM GetEndPaM() const
void InsertAttrib(const SfxPoolItem &rItem, ContentNode *pNode, sal_Int32 nStart, sal_Int32 nEnd)
const SvxFont & GetDefFont() const
sal_Int32 GetPos(const ContentNode *pNode) const
void RemoveChars(EditPaM aPaM, sal_Int32 nChars)
SfxItemPool & GetItemPool()
OUString GetParaAsString(sal_Int32 nNode) const
const ContentNode * GetObject(sal_Int32 nPos) const
sal_uInt16 GetDefTab() const
EditPaM InsertText(EditPaM aPaM, std::u16string_view rStr)
EditPaM GetStartPaM() const
void GetPortions(sal_Int32 nPara, std::vector< sal_Int32 > &rList)
OUString GetText(LineEnd eEnd=LINEEND_LF) const
editeng::LanguageSpan GetLanguage(const EditPaM &rPaM) const
sal_Int32 GetParagraphCount() const
void SetIndex(sal_Int32 n)
void SetNode(ContentNode *p)
const ContentNode * GetNode() const
sal_Int32 GetIndex() const
bool DbgIsBuggy(EditDoc const &rDoc) const
void Adjust(const EditDoc &rNodes)
EditStatusFlags GetStatusWord() const
MapUnit GetMetric() const
ContentInfosType & GetContents()
XParaPortionList * GetPortionInfo() const
virtual bool GetVertical() const =0
virtual TextRotation GetRotation() const =0
ESelection GetSelection() const
bool HasSelection() const
void SetSelection(const ESelection &rNewSel)
void InsertText(const OUString &rNew, bool bSelect=false, bool bLOKShowSelect=true)
void ShowCursor(bool bGotoCursor=true, bool bForceVisCursor=true, bool bActivate=false)
const SfxItemSet & GetEmptyItemSet() const
vcl::Window * GetWindow() const
void SetAttribs(const SfxItemSet &rSet)
std::unique_ptr< ImpEditView > pImpEditView
tools::Long GetDescent() const
tools::Long GetAscent() const
static void ShowQuickHelp(vcl::Window *pParent, const tools::Rectangle &rScreenRect, const OUString &rHelpText, QuickHelpFlags nStyle=QuickHelpFlags::NONE)
SfxStyleSheetPool * GetStyleSheetPool() const
void WriteXML(SvStream &rOutput, const EditSelection &rSel)
EESpellState StartThesaurus(EditView *pEditView, weld::Widget *pDialogParent)
short ReplaceTextOnly(ContentNode *pNode, sal_Int32 nCurrentStart, std::u16string_view rText, const css::uno::Sequence< sal_Int32 > &rOffsets)
sal_Int32 nBigTextObjectStart
css::uno::Reference< css::linguistic2::XSpellAlternatives > ImpSpell(EditView *pEditView)
sal_uInt16 GetLineHeight(sal_Int32 nParagraph, sal_Int32 nLine)
sal_Int32 StartSearchAndReplace(EditView *pEditView, const SvxSearchItem &rSearchItem)
css::uno::Reference< css::linguistic2::XSpellChecker1 > xSpeller
const SfxItemSet & GetEmptyItemSet() const
EditPaM ImpFastInsertText(EditPaM aPaM, const OUString &rStr)
const Size & GetPaperSize() const
void Convert(EditView *pEditView, weld::Widget *pDialogParent, LanguageType nSrcLang, LanguageType nDestLang, const vcl::Font *pDestFont, sal_Int32 nOptions, bool bIsInteractive, bool bMultipleDoc)
bool HasText(const SvxSearchItem &rSearchItem)
const MapMode & GetRefMapMode() const
EditPaM ImpFastInsertParagraph(sal_Int32 nPara)
css::lang::Locale GetLocale(const EditPaM &rPaM) const
void SetParaAttribs(sal_Int32 nPara, const SfxItemSet &rSet)
void UndoActionStart(sal_uInt16 nId)
OUString GetSelected(const EditSelection &rSel) const
EditPaM ReadHTML(SvStream &rInput, const OUString &rBaseURL, EditSelection aSel, SvKeyValueIterator *pHTTPHeaderAttrs)
ErrCode WriteRTF(SvStream &rOutput, EditSelection aSel)
void DoOnlineSpelling(ContentNode *pThisNodeOnly=nullptr, bool bSpellAtCursorPos=false, bool bInterruptible=true)
SvtScriptType GetItemScriptType(const EditSelection &rSel) const
TextRotation GetRotation() const
void SetAutoCompleteText(const OUString &rStr, bool bUpdateTipWindow)
void SetAsianCompressionMode(CharCompressType n)
bool IsAddExtLeading() const
EPaM CreateEPaM(const EditPaM &rPaM) const
EditEngine * GetEditEnginePtr() const
EditPaM CreateEditPaM(const EPaM &rEPaM)
const ParaPortion * FindParaPortion(const ContentNode *pNode) const
EESpellState HasSpellErrors()
EditPaM CursorRight(const EditPaM &rPaM, sal_uInt16 nCharacterIteratorMode=css::i18n::CharacterIteratorMode::SKIPCELL)
void UpdateViews(EditView *pCurView=nullptr)
void SeekCursor(ContentNode *pNode, sal_Int32 nPos, SvxFont &rFont, OutputDevice *pOut=nullptr)
css::uno::Reference< css::linguistic2::XSpellChecker1 > const & GetSpeller()
editeng::LanguageSpan GetLanguage(const EditPaM &rPaM, sal_Int32 *pEndPos=nullptr) const
SfxItemSet GetAttribs(sal_Int32 nPara, sal_Int32 nStart, sal_Int32 nEnd, GetAttribsFlags nFlags=GetAttribsFlags::ALL) const
bool SpellSentence(EditView const &rView, svx::SpellPortions &rToFill)
EditPaM ImpInsertParaBreak(EditPaM &rPaM, bool bKeepEndingAttribs=true)
sal_uInt16 GetI18NScriptType(const EditPaM &rPaM, sal_Int32 *pEndPos=nullptr) const
std::unique_ptr< SpellInfo > pSpellInfo
EditSelection SelectSentence(const EditSelection &rCurSel) const
EditSelection TransliterateText(const EditSelection &rSelection, TransliterationFlags nTransliterationMode)
CharCompressType nAsianCompressionMode
void SetModifyFlag(bool b)
void EnableUndo(bool bEnable)
void SetRotation(TextRotation nRotation)
InternalEditStatus aStatus
void AddPortion(const EditSelection &rSel, const css::uno::Reference< css::linguistic2::XSpellAlternatives > &xAlt, svx::SpellPortions &rToFill, bool bIsField)
SfxItemPool * GetEditTextObjectPool() const
void SetAttribs(EditSelection aSel, const SfxItemSet &rSet, SetAttribsMode nSpecial=SetAttribsMode::NONE, bool bSetSelection=true)
EditPaM WordRight(const EditPaM &rPaM, sal_Int16 nWordType=css::i18n::WordType::ANYWORD_IGNOREWHITESPACES)
tools::Long GetColumnWidth(const Size &rPaperSize) const
void FormatAndLayout(EditView *pCurView=nullptr, bool bCalledFromUndo=false)
std::unique_ptr< EditTextObject > GetEmptyTextObject()
void AddPortionIterated(EditView const &rEditView, const EditSelection &rSel, const css::uno::Reference< css::linguistic2::XSpellAlternatives > &xAlt, svx::SpellPortions &rToFill)
bool bKernAsianPunctuation
void Write(SvStream &rOutput, EETextFormat eFormat, const EditSelection &rSel)
std::unique_ptr< ConvInfo > pConvInfo
EditPaM Read(SvStream &rInput, const OUString &rBaseURL, EETextFormat eFormat, const EditSelection &rSel, SvKeyValueIterator *pHTTPHeaderAttrs=nullptr)
bool IsScriptChange(const EditPaM &rPaM) const
EditPaM ReadXML(SvStream &rInput, EditSelection aSel)
EditUndoManager & GetUndoManager()
void PutSpellingToSentenceStart(EditView const &rEditView)
VclPtr< OutputDevice > pRefDev
bool ImpSearch(const SvxSearchItem &rSearchItem, const EditSelection &rSearchSelection, const EditPaM &rStartPos, EditSelection &rFoundSel)
css::uno::Reference< css::linguistic2::XSpellAlternatives > ImpFindNextError(EditSelection &rSelection)
bool HasConvertibleTextPortion(LanguageType nLang)
void GetAllMisspellRanges(std::vector< editeng::MisspellRanges > &rRanges) const
void ImpConvert(OUString &rConvTxt, LanguageType &rConvTxtLang, EditView *pEditView, LanguageType nSrcLang, const ESelection &rConvRange, bool bAllowImplicitChangesForNotConvertibleText, LanguageType nTargetLang, const vcl::Font *pTargetFont)
bool HasUndoManager() const
OutputDevice * GetRefDevice() const
EditSelection InsertTextObject(const EditTextObject &, EditPaM aPaM)
void CreateSpellInfo(bool bMultipleDocs)
void SetAllMisspellRanges(const std::vector< editeng::MisspellRanges > &rRanges)
bool WriteItemListAsRTF(ItemList &rLst, SvStream &rOutput, sal_Int32 nPara, sal_Int32 nPos, std::vector< std::unique_ptr< SvxFontItem > > &rFontTable, SvxColorList &rColorList)
EditPaM ImpDeleteSelection(const EditSelection &rCurSel)
EESpellState Spell(EditView *pEditView, weld::Widget *pDialogParent, bool bMultipleDoc)
void SetVertical(bool bVertical)
sal_Int32 LogicToTwips(sal_Int32 n)
ESelection CreateESel(const EditSelection &rSel) const
void ApplyChangedSentence(EditView const &rEditView, const svx::SpellPortions &rNewPortions, bool bRecheck)
void InsertUndo(std::unique_ptr< EditUndo > pUndo, bool bTryMerge=false)
void SetKernAsianPunctuation(bool b)
tools::Rectangle PaMtoEditCursor(EditPaM aPaM, GetCursorFlags nFlags=GetCursorFlags::NONE)
EditPaM ReadText(SvStream &rInput, EditSelection aSel)
InternalEditStatus & GetStatus()
double roundToNearestPt(double fInput) const
EditPaM ReadRTF(SvStream &rInput, EditSelection aSel)
void SetLanguageAndFont(const ESelection &rESel, LanguageType nLang, sal_uInt16 nLangWhichId, const vcl::Font *pFont, sal_uInt16 nFontWhichId)
css::uno::Reference< css::i18n::XBreakIterator > const & ImplGetBreakIterator() const
bool SetUpdateLayout(bool bUpdate, EditView *pCurView=nullptr, bool bForceUpdate=false)
EditSelection SelectWord(const EditSelection &rCurSelection, sal_Int16 nWordType=css::i18n::WordType::ANYWORD_IGNOREWHITESPACES, bool bAcceptStartOfWord=true)
void WriteItemAsRTF(const SfxPoolItem &rItem, SvStream &rOutput, sal_Int32 nPara, sal_Int32 nPos, std::vector< std::unique_ptr< SvxFontItem > > &rFontTable, SvxColorList &rColorList)
void SetAddExtLeading(bool b)
void SetText(const OUString &rText)
bool IsUpdateLayout() const
std::unique_ptr< EditTextObject > CreateTextObject()
EditPaM ImpInsertText(const EditSelection &aCurEditSelection, const OUString &rStr)
ErrCode WriteText(SvStream &rOutput, EditSelection aSel)
OUString aAutoCompleteText
bool IsUndoEnabled() const
tools::Rectangle aInvalidRect
EditPaM InsertText(const EditSelection &aCurEditSelection, const OUString &rStr)
void SetStyleSheet(EditSelection aSel, SfxStyleSheet *pStyle)
const ParaPortionList & GetParaPortions() const
void CheckIdleFormatter()
bool Search(const SvxSearchItem &rSearchItem, EditView *pView)
bool AllowBigObjects() const
bool UseCharAttribs() const
void Insert(const SfxPoolItem *pItem)
const SfxPoolItem * Next()
const SfxPoolItem * First()
const css::lang::Locale & getLocale(bool bResolveSystem=true) const
static css::lang::Locale convertToLocale(LanguageType nLangID, bool bResolveSystem=true)
static css::uno::Reference< css::linguistic2::XThesaurus > GetThesaurus()
static css::uno::Reference< css::linguistic2::XSpellChecker1 > GetSpellChecker()
SAL_WARN_UNUSED_RESULT Point LogicToLogic(const Point &rPtSource, const MapMode *pMapModeSource, const MapMode *pMapModeDest) const
FontMetric GetFontMetric() const
TextPortionList & GetTextPortions()
sal_Int32 nFirstLineOffset
void MarkInvalid(sal_Int32 nStart, sal_Int32 nDiff)
tools::Long GetHeight() const
sal_Int32 GetFirstLineOffset() const
ContentNode * GetNode() const
EditLineList & GetLines()
void MarkSelectionInvalid(sal_Int32 nStart)
constexpr tools::Long X() const
sal_Int16 GetValue() const
Item2Range GetItemSurrogates(sal_uInt16 nWhich) const
SfxItemPool * GetSecondaryPool() const
const SfxPoolItem & GetDefaultItem(sal_uInt16 nWhich) const
const OUString & GetName() const
virtual MapUnit GetMetric(sal_uInt16 nWhich) const
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
bool Set(const SfxItemSet &, bool bDeep=true)
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const=0
virtual SfxStyleSheetBase * Find(const OUString &, SfxStyleFamily eFam, SfxStyleSearchBits n=SfxStyleSearchBits::All)
const OUString & GetName() const
SfxStyleFamily GetFamily() const
virtual SfxItemSet & GetItemSet()
constexpr tools::Long Width() const
SvStream & WriteNumberAsString(N n)
bool WriteByteStringLine(std::u16string_view rStr, rtl_TextEncoding eDestCharSet)
bool ReadByteStringLine(OUString &rStr, rtl_TextEncoding eSrcCharSet, sal_Int32 nMaxBytesToRead=0xFFFE)
SvStream & WriteOString(std::string_view rStr)
void SetError(ErrCode nErrorCode)
SvStream & WriteChar(char nChar)
rtl_TextEncoding GetStreamCharSet() const
SvxColorItem item describes a color.
const Color & GetValue() const
This item describes a Font.
void SetStyleName(const OUString &rStyleName)
FontFamily GetFamily() const
FontPitch GetPitch() const
void SetFamily(FontFamily _eFamily)
void SetPitch(FontPitch _ePitch)
void SetFamilyName(const OUString &rFamilyName)
rtl_TextEncoding GetCharSet() const
const OUString & GetFamilyName() const
void SetCharSet(rtl_TextEncoding _eEncoding)
LanguageType GetLanguage() const
SvxInterLineSpaceRule GetInterLineSpaceRule() const
void SetBackward(bool bNewBackward)
SvxSearchCmd GetCommand() const
void SetSelection(bool bNewSelection)
const OUString & GetReplaceString() const
const i18nutil::SearchOptions2 & GetSearchOptions() const
bool GetSelection() const
static sal_Int16 CheckSpellLang(css::uno::Reference< css::linguistic2::XSpellChecker1 > const &xSpell, LanguageType nLang)
void Append(TextPortion *p)
sal_Int32 FindPortion(sal_Int32 nCharPos, sal_Int32 &rPortionStart, bool bPreferStartingPortion=false) const
virtual void Start(bool bStartTimer=true) override
Keeps track of misspelled ranges in paragraph.
void ResetInvalidRange(size_t nStart, size_t nEnd)
const std::vector< editeng::MisspellRange > & GetRanges() const
bool HasWrong(size_t nStart, size_t nEnd) const
WrongList * Clone() const
void ClearWrongs(size_t nStart, size_t nEnd, const ContentNode *pNode)
size_t GetInvalidEnd() const
void InsertWrong(size_t nStart, size_t nEnd)
void SetRanges(std::vector< editeng::MisspellRange > &&rRanges)
size_t GetInvalidStart() const
bool HasAnyWrong(size_t nStart, size_t nEnd) const
const SfxPoolItem * GetItem() const
double getSpacingScaleY() const
double getFontScaleY() const
sal_uInt32 GetPaperWidth() const
bool RefDevIsVirtual() const
void push_back(XParaPortion *p)
OutputDevice * GetRefDevPtr() const
const MapMode & GetRefMapMode() const
double getSpacingScaleX() const
double getFontScaleX() const
static bool IsChinese(LanguageType nLang)
bool SearchForward(const OUString &rStr, sal_Int32 *pStart, sal_Int32 *pEnd, css::util::SearchResult *pRes=nullptr)
bool SearchBackward(const OUString &rStr, sal_Int32 *pStart, sal_Int32 *pEnd, css::util::SearchResult *pRes=nullptr)
OUString transliterate(const OUString &rStr, sal_Int32 nStart, sal_Int32 nLen) const
bool needLanguageForTheMode() const
FontFamily GetFamilyType()
const OUString & GetStyleName() const
const OUString & GetFamilyName() const
const Size & GetFontSize() const
rtl_TextEncoding GetCharSet() const
constexpr ::Color COL_AUTO(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
#define DBG_ASSERT(sCon, aError)
virtual css::uno::Reference< css::embed::XEmbeddedObject > GetObject() override
#define EE_PARA_NOT_FOUND
#define EDITUNDO_REPLACEALL
#define EE_INDEX_NOT_FOUND
#define EE_READWRITE_WRONGFORMAT
bool IsScriptItemValid(sal_uInt16 nItemId, short nScriptType)
EditCharAttrib * MakeCharAttrib(SfxItemPool &rPool, const SfxPoolItem &rAttr, sal_Int32 nS, sal_Int32 nE)
sal_uInt16 GetScriptItemId(sal_uInt16 nItemId, SvtScriptType nScriptType)
void ConvertItem(std::unique_ptr< SfxPoolItem > &rPoolItem, MapUnit eSourceUnit, MapUnit eDestUnit)
void ConvertAndPutItems(SfxItemSet &rDest, const SfxItemSet &rSource, const MapUnit *pSourceUnit, const MapUnit *pDestUnit)
std::vector< Color > SvxColorList
EditCharAttrib * GetAttrib(CharAttribList::AttribsType &rAttribs, std::size_t nAttr)
EditTextObjectImpl & toImpl(EditTextObject &rObj)
constexpr TypedWhichId< SvxContourItem > EE_CHAR_OUTLINE(EE_CHAR_START+8)
constexpr TypedWhichId< SvxKerningItem > EE_CHAR_KERNING(EE_CHAR_START+12)
constexpr TypedWhichId< SvxFontItem > EE_CHAR_FONTINFO_CJK(EE_CHAR_START+17)
constexpr TypedWhichId< SvxFieldItem > EE_FEATURE_FIELD(EE_FEATURE_NOTCONV+1)
constexpr TypedWhichId< SvxTabStopItem > EE_PARA_TABS(EE_PARA_START+17)
constexpr TypedWhichId< SvxUnderlineItem > EE_CHAR_UNDERLINE(EE_CHAR_START+5)
constexpr TypedWhichId< SvxAdjustItem > EE_PARA_JUST(EE_PARA_START+16)
constexpr TypedWhichId< SvxFontHeightItem > EE_CHAR_FONTHEIGHT(EE_CHAR_START+2)
constexpr TypedWhichId< SvxAutoKernItem > EE_CHAR_PAIRKERNING(EE_CHAR_START+11)
constexpr TypedWhichId< SvxShadowedItem > EE_CHAR_SHADOW(EE_CHAR_START+9)
constexpr TypedWhichId< SvxULSpaceItem > EE_PARA_ULSPACE(EE_PARA_START+14)
constexpr TypedWhichId< SvxOverlineItem > EE_CHAR_OVERLINE(EE_CHAR_START+29)
constexpr sal_uInt16 EE_PARA_START(EE_ITEMS_START+0)
constexpr TypedWhichId< SvxLanguageItem > EE_CHAR_LANGUAGE_CTL(EE_CHAR_START+16)
constexpr sal_uInt16 EE_FEATURE_LINEBR(EE_FEATURE_TAB+1)
constexpr TypedWhichId< SvxWeightItem > EE_CHAR_WEIGHT(EE_CHAR_START+4)
constexpr TypedWhichId< SvxLRSpaceItem > EE_PARA_LRSPACE(EE_PARA_START+13)
constexpr TypedWhichId< SvxColorItem > EE_CHAR_COLOR(EE_CHAR_START+0)
constexpr TypedWhichId< SvxWeightItem > EE_CHAR_WEIGHT_CTL(EE_CHAR_START+22)
constexpr TypedWhichId< SvxCrossedOutItem > EE_CHAR_STRIKEOUT(EE_CHAR_START+6)
constexpr TypedWhichId< SvxPostureItem > EE_CHAR_ITALIC(EE_CHAR_START+7)
constexpr TypedWhichId< SvxLineSpacingItem > EE_PARA_SBL(EE_PARA_START+15)
constexpr TypedWhichId< SvxEmphasisMarkItem > EE_CHAR_EMPHASISMARK(EE_CHAR_START+25)
constexpr TypedWhichId< SvxEscapementItem > EE_CHAR_ESCAPEMENT(EE_CHAR_START+10)
constexpr sal_uInt16 EE_CHAR_END(EE_CHAR_START+32)
constexpr TypedWhichId< SfxInt16Item > EE_PARA_OUTLLEVEL(EE_PARA_START+11)
constexpr TypedWhichId< SvxFontHeightItem > EE_CHAR_FONTHEIGHT_CTL(EE_CHAR_START+20)
constexpr TypedWhichId< SvxWeightItem > EE_CHAR_WEIGHT_CJK(EE_CHAR_START+21)
constexpr TypedWhichId< SvxLanguageItem > EE_CHAR_LANGUAGE_CJK(EE_CHAR_START+15)
constexpr TypedWhichId< SvxFrameDirectionItem > EE_PARA_WRITINGDIR(EE_PARA_START+0)
constexpr sal_uInt16 EE_FEATURE_TAB(EE_FEATURE_START+0)
constexpr TypedWhichId< SvxPostureItem > EE_CHAR_ITALIC_CJK(EE_CHAR_START+23)
constexpr TypedWhichId< SvxFontItem > EE_CHAR_FONTINFO_CTL(EE_CHAR_START+18)
constexpr TypedWhichId< SvxPostureItem > EE_CHAR_ITALIC_CTL(EE_CHAR_START+24)
constexpr TypedWhichId< SvxLRSpaceItem > EE_PARA_OUTLLRSPACE(EE_PARA_START+10)
constexpr TypedWhichId< SvxLanguageItem > EE_CHAR_LANGUAGE(EE_CHAR_START+14)
constexpr TypedWhichId< SvxCharReliefItem > EE_CHAR_RELIEF(EE_CHAR_START+26)
constexpr TypedWhichId< SvxFontHeightItem > EE_CHAR_FONTHEIGHT_CJK(EE_CHAR_START+19)
constexpr TypedWhichId< SvxFontItem > EE_CHAR_FONTINFO(EE_CHAR_START+1)
#define SVSTREAM_WRITE_ERROR
#define DFLT_ESC_AUTO_SUB
#define DFLT_ESC_AUTO_SUPER
UNOTOOLS_DLLPUBLIC bool IsOpenSymbol(std::u16string_view rFontName)
@ Horizontal_RL_TB
Horizontal, from right to left, from top to bottom (typical for arabic/hebrew languages).
static void lcl_FindValidAttribs(ItemList &rLst, ContentNode *pNode, sal_Int32 nIndex, sal_uInt16 nScriptType)
#define SAL_WARN_IF(condition, area, stream)
SVT_DLLPUBLIC SvStream & Out_String(SvStream &, std::u16string_view, rtl_TextEncoding eDestEnc=RTL_TEXTENCODING_MS_1252)
SvtScriptType FromI18NToSvtScriptType(sal_Int16 nI18NType)
SvtScriptType GetScriptTypeOfLanguage(LanguageType nLang)
B2IRange fround(const B2DRange &rRange)
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
constexpr Point convert(const Point &rPoint, o3tl::Length eFrom, o3tl::Length eTo)
std::vector< SpellPortion > SpellPortions
#define OOO_STRING_SVTOOLS_RTF_SNEXT
#define OOO_STRING_SVTOOLS_RTF_F
#define OOO_STRING_SVTOOLS_RTF_TX
#define OOO_STRING_SVTOOLS_RTF_OUTL
#define OOO_STRING_SVTOOLS_RTF_OL
#define OOO_STRING_SVTOOLS_RTF_SB
#define OOO_STRING_SVTOOLS_RTF_SA
#define OOO_STRING_SVTOOLS_RTF_ACCCOMMA
#define OOO_STRING_SVTOOLS_RTF_OLNONE
#define OOO_STRING_SVTOOLS_RTF_QC
#define OOO_STRING_SVTOOLS_RTF_SL
#define OOO_STRING_SVTOOLS_RTF_RED
#define OOO_STRING_SVTOOLS_RTF_IMPR
#define OOO_STRING_SVTOOLS_RTF_B
#define OOO_STRING_SVTOOLS_RTF_S
#define OOO_STRING_SVTOOLS_RTF_ACCNONE
#define OOO_STRING_SVTOOLS_RTF_RTF
#define OOO_STRING_SVTOOLS_RTF_CF
#define OOO_STRING_SVTOOLS_RTF_KERNING
#define OOO_STRING_SVTOOLS_RTF_FI
#define OOO_STRING_SVTOOLS_RTF_SHAD
#define OOO_STRING_SVTOOLS_RTF_FROMAN
#define OOO_STRING_SVTOOLS_RTF_FS
#define OOO_STRING_SVTOOLS_RTF_FDECOR
#define OOO_STRING_SVTOOLS_RTF_ULD
#define OOO_STRING_SVTOOLS_RTF_STRIKE
#define OOO_STRING_SVTOOLS_RTF_UL
#define OOO_STRING_SVTOOLS_RTF_QL
#define OOO_STRING_SVTOOLS_RTF_PAR
#define OOO_STRING_SVTOOLS_RTF_SBASEDON
#define OOO_STRING_SVTOOLS_RTF_FSCRIPT
#define OOO_STRING_SVTOOLS_RTF_FCHARSET
#define OOO_STRING_SVTOOLS_RTF_QR
#define OOO_STRING_SVTOOLS_RTF_BLUE
#define OOO_STRING_SVTOOLS_RTF_ANSI
#define OOO_STRING_SVTOOLS_RTF_DEFTAB
#define OOO_STRING_SVTOOLS_RTF_DN
#define OOO_STRING_SVTOOLS_RTF_EXPNDTW
#define OOO_STRING_SVTOOLS_RTF_OLD
#define OOO_STRING_SVTOOLS_RTF_ACCDOT
#define OOO_STRING_SVTOOLS_RTF_STYLESHEET
#define OOO_STRING_SVTOOLS_RTF_UP
#define OOO_STRING_SVTOOLS_RTF_OLDB
#define OOO_STRING_SVTOOLS_RTF_FPRQ
#define OOO_STRING_SVTOOLS_RTF_GREEN
#define OOO_STRING_SVTOOLS_RTF_IGNORE
#define OOO_STRING_SVTOOLS_RTF_COLORTBL
#define OOO_STRING_SVTOOLS_RTF_FSWISS
#define OOO_STRING_SVTOOLS_RTF_FMODERN
#define OOO_STRING_SVTOOLS_RTF_PLAIN
#define OOO_STRING_SVTOOLS_RTF_ULDB
#define OOO_STRING_SVTOOLS_RTF_RI
#define OOO_STRING_SVTOOLS_RTF_SLMULT
#define OOO_STRING_SVTOOLS_RTF_ULNONE
#define OOO_STRING_SVTOOLS_RTF_LI
#define OOO_STRING_SVTOOLS_RTF_FONTTBL
#define OOO_STRING_SVTOOLS_RTF_EMBO
#define OOO_STRING_SVTOOLS_RTF_I
#define OOO_STRING_SVTOOLS_RTF_FNIL
#define OOO_STRING_SVTOOLS_RTF_TAB
#define OOO_STRING_SVTOOLS_RTF_PARD
TOOLS_DLLPUBLIC SvStream & endl(SvStream &rStr)
TextPortionList aTextPortions
sal_uInt16 nFirstLineOffset
contains a portion of text that has the same language attributes applied and belongs to the same scri...
OUString sText
contains the text of the portion.
css::uno::Reference< css::linguistic2::XSpellAlternatives > xAlternatives
for wrong words this reference is filled with the error information otherwise it's an empty reference
bool bIsField
Marks the portion as field, footnote symbol or any other special content that should be protected aga...
LanguageType eLanguage
contains the language applied to the text.
void SvxWriteXML(EditEngine &rEditEngine, SvStream &rStream, const ESelection &rSel)
this function exports the selected content of an edit engine into a xml stream
EditPaM SvxReadXML(EditEngine &rEditEngine, SvStream &rStream, const ESelection &rSel)
this function imports xml from the stream into the selected of an edit engine