editeng/source/editeng/editeng.cxx | 22 +-- editeng/source/editeng/impedit.hxx | 166 +++++++++++------------ editeng/source/editeng/impedit2.cxx | 252 ++++++++++++++++++------------------ editeng/source/editeng/impedit3.cxx | 156 +++++++++++----------- editeng/source/editeng/impedit4.cxx | 158 +++++++++++----------- editeng/source/editeng/impedit5.cxx | 114 ++++++++-------- 6 files changed, 432 insertions(+), 436 deletions(-)
New commits: commit b63f768941ca870f0930ff400e3bc6ff829bea4a Author: Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk> AuthorDate: Sat Sep 30 22:56:27 2023 +0200 Commit: Tomaž Vajngerl <qui...@gmail.com> CommitDate: Thu Oct 12 01:28:05 2023 +0200 prefix some members of ImpEditEngine Change-Id: I9975bed2af853374a10b87c468840ff22b230157 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157833 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <qui...@gmail.com> diff --git a/editeng/source/editeng/editeng.cxx b/editeng/source/editeng/editeng.cxx index 0dd24c941069..6cb28954aedc 100644 --- a/editeng/source/editeng/editeng.cxx +++ b/editeng/source/editeng/editeng.cxx @@ -588,7 +588,7 @@ sal_Int32 EditEngine::GetTextLen() const sal_Int32 EditEngine::GetParagraphCount() const { - return pImpEditEngine->aEditDoc.Count(); + return pImpEditEngine->maEditDoc.Count(); } sal_Int32 EditEngine::GetLineCount( sal_Int32 nParagraph ) const @@ -994,7 +994,7 @@ const EditSelectionEngine& EditEngine::GetSelectionEngine() const void EditEngine::SetInSelectionMode(bool b) { - pImpEditEngine->bInSelection = b; + pImpEditEngine->mbInSelection = b; } bool EditEngine::PostKeyEvent( const KeyEvent& rKeyEvent, EditView* pEditView, vcl::Window const * pFrameWin ) @@ -1863,28 +1863,28 @@ void EditEngine::SetFlatMode( bool bFlat) bool EditEngine::IsFlatMode() const { - return !( pImpEditEngine->aStatus.UseCharAttribs() ); + return !( pImpEditEngine->GetStatus().UseCharAttribs() ); } void EditEngine::SetSingleLine(bool bValue) { - if (bValue == pImpEditEngine->aStatus.IsSingleLine()) + if (bValue == pImpEditEngine->GetStatus().IsSingleLine()) return; if (bValue) - pImpEditEngine->aStatus.TurnOnFlags(EEControlBits::SINGLELINE); + pImpEditEngine->GetStatus().TurnOnFlags(EEControlBits::SINGLELINE); else - pImpEditEngine->aStatus.TurnOffFlags(EEControlBits::SINGLELINE); + pImpEditEngine->GetStatus().TurnOffFlags(EEControlBits::SINGLELINE); } void EditEngine::SetControlWord( EEControlBits nWord ) { - if ( nWord == pImpEditEngine->aStatus.GetControlWord() ) + if ( nWord == pImpEditEngine->GetStatus().GetControlWord() ) return; - EEControlBits nPrev = pImpEditEngine->aStatus.GetControlWord(); - pImpEditEngine->aStatus.GetControlWord() = nWord; + EEControlBits nPrev = pImpEditEngine->GetStatus().GetControlWord(); + pImpEditEngine->GetStatus().GetControlWord() = nWord; EEControlBits nChanges = nPrev ^ nWord; if ( pImpEditEngine->IsFormatted() ) @@ -1952,7 +1952,7 @@ void EditEngine::SetControlWord( EEControlBits nWord ) EEControlBits EditEngine::GetControlWord() const { - return pImpEditEngine->aStatus.GetControlWord(); + return pImpEditEngine->GetStatus().GetControlWord(); } tools::Long EditEngine::GetFirstLineStartX( sal_Int32 nParagraph ) @@ -2437,7 +2437,7 @@ EPosition EditEngine::FindDocPosition( const Point& rDocPos ) const EditPaM aPaM = const_cast<EditEngine*>(this)->pImpEditEngine->GetPaM( rDocPos, false ); if ( aPaM.GetNode() ) { - aPos.nPara = pImpEditEngine->aEditDoc.GetPos( aPaM.GetNode() ); + aPos.nPara = pImpEditEngine->maEditDoc.GetPos( aPaM.GetNode() ); aPos.nIndex = aPaM.GetIndex(); } return aPos; diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx index 2fba7bd778f4..df7a11c97dcb 100644 --- a/editeng/source/editeng/impedit.hxx +++ b/editeng/source/editeng/impedit.hxx @@ -494,17 +494,13 @@ class ImpEditEngine : public SfxListener, public svl::StyleSheetUser private: std::shared_ptr<editeng::SharedVclResources> pSharedVCL; - - // Data ... - - // Document Specific data ... - ParaPortionList aParaPortionList; // Formatting - Size aPaperSize; // Layout - Size aMinAutoPaperSize; // Layout ? - Size aMaxAutoPaperSize; // Layout ? + ParaPortionList maParaPortionList; // Formatting + Size maPaperSize; // Layout + Size maMinAutoPaperSize; // Layout ? + Size maMaxAutoPaperSize; // Layout ? tools::Long mnMinColumnWrapHeight = 0; // Corresponds to graphic object height - EditDoc aEditDoc; // Document content + EditDoc maEditDoc; // Document content // Engine Specific data ... EditEngine* pEditEngine; @@ -540,11 +536,11 @@ private: double mfSpacingScaleY; bool mbRoundToNearestPt; - CharCompressType nAsianCompressionMode; + CharCompressType mnAsianCompressionMode; EEHorizontalTextDirection eDefaultHorizontalTextDirection; - sal_Int32 nBigTextObjectStart; + sal_Int32 mnBigTextObjectStart; css::uno::Reference< css::linguistic2::XSpellChecker1 > xSpeller; css::uno::Reference< css::linguistic2::XHyphenator > xHyphenator; std::unique_ptr<SpellInfo> pSpellInfo; @@ -553,11 +549,11 @@ private: std::unique_ptr<ConvInfo> pConvInfo; - OUString aAutoCompleteText; + OUString maAutoCompleteText; - InternalEditStatus aStatus; + InternalEditStatus maStatus; - LanguageType eDefLanguage; + LanguageType meDefLanguage; OnDemandLocaleDataWrapper xLocaleDataWrapper; OnDemandTransliterationWrapper xTransliterationWrapper; @@ -598,25 +594,25 @@ private: Link<EditView*,void> maBeginDropHdl; Link<EditView*,void> maEndDropHdl; - bool bKernAsianPunctuation:1; - bool bAddExtLeading:1; - bool bIsFormatting:1; - bool bFormatted:1; - bool bInSelection:1; - bool bIsInUndo:1; - bool bUpdateLayout:1; - bool bUndoEnabled:1; - bool bDowning:1; - bool bUseAutoColor:1; - bool bForceAutoColor:1; - bool bCallParaInsertedOrDeleted:1; - bool bFirstWordCapitalization:1; // specifies if auto-correction should capitalize the first word or not - bool mbLastTryMerge:1; - bool mbReplaceLeadingSingleQuotationMark:1; - bool mbSkipOutsideFormat:1; - bool mbFuzzing:1; - - bool mbNbspRunNext; // can't be a bitfield as it is passed as bool& + bool mbKernAsianPunctuation : 1; + bool mbAddExtLeading : 1; + bool mbIsFormatting : 1; + bool mbFormatted : 1; + bool mbInSelection : 1; + bool mbIsInUndo : 1; + bool mbUpdateLayout : 1; + bool mbUndoEnabled : 1; + bool mbDowning : 1; + bool mbUseAutoColor : 1; + bool mbForceAutoColor : 1; + bool mbCallParaInsertedOrDeleted : 1; + bool mbFirstWordCapitalization : 1; // specifies if auto-correction should capitalize the first word or not + bool mbLastTryMerge : 1; + bool mbReplaceLeadingSingleQuotationMark : 1; + bool mbSkipOutsideFormat : 1; + bool mbFuzzing : 1; + + bool mbNbspRunNext; // can't be a bitfield as it is passed as bool& // Methods... @@ -744,7 +740,7 @@ private: double scaleXSpacingValue(tools::Long nXValue) const { - if (!aStatus.DoStretch() || mfSpacingScaleX == 100.0) + if (!maStatus.DoStretch() || mfSpacingScaleX == 100.0) return nXValue; return double(nXValue) * mfSpacingScaleX / 100.0; @@ -752,7 +748,7 @@ private: double scaleYSpacingValue(sal_uInt16 nYValue) const { - if (!aStatus.DoStretch() || mfSpacingScaleY == 100.0) + if (!maStatus.DoStretch() || mfSpacingScaleY == 100.0) return nYValue; return double(nYValue) * mfSpacingScaleY / 100.0; @@ -760,7 +756,7 @@ private: double scaleYFontValue(sal_uInt16 nYValue) const { - if (!aStatus.DoStretch() || (mfFontScaleY == 100.0)) + if (!maStatus.DoStretch() || (mfFontScaleY == 100.0)) return nYValue; return double(nYValue) * mfFontScaleY / 100.0; @@ -768,7 +764,7 @@ private: double scaleXFontValue(tools::Long nXValue) const { - if (!aStatus.DoStretch() || (mfFontScaleX == 100.0)) + if (!maStatus.DoStretch() || (mfFontScaleX == 100.0)) return nXValue; return double(nXValue) * mfFontScaleY / 100.0; @@ -789,10 +785,10 @@ private: tools::Long CalcVertLineSpacing(Point& rStartPos) const; Color GetAutoColor() const; - void EnableAutoColor( bool b ) { bUseAutoColor = b; } - bool IsAutoColorEnabled() const { return bUseAutoColor; } - void ForceAutoColor( bool b ) { bForceAutoColor = b; } - bool IsForceAutoColor() const { return bForceAutoColor; } + void EnableAutoColor( bool b ) { mbUseAutoColor = b; } + bool IsAutoColorEnabled() const { return mbUseAutoColor; } + void ForceAutoColor( bool b ) { mbForceAutoColor = b; } + bool IsForceAutoColor() const { return mbForceAutoColor; } inline VirtualDevice* GetVirtualDevice( const MapMode& rMapMode, DrawModeFlags nDrawMode ); void EraseVirtualDevice() { pVirtDev.disposeAndClear(); } @@ -823,11 +819,11 @@ private: ImpEditEngine(EditEngine* pEditEngine, SfxItemPool* pPool); void InitDoc(bool bKeepParaAttribs); - EditDoc& GetEditDoc() { return aEditDoc; } - const EditDoc& GetEditDoc() const { return aEditDoc; } + EditDoc& GetEditDoc() { return maEditDoc; } + const EditDoc& GetEditDoc() const { return maEditDoc; } - const ParaPortionList& GetParaPortions() const { return aParaPortionList; } - ParaPortionList& GetParaPortions() { return aParaPortionList; } + const ParaPortionList& GetParaPortions() const { return maParaPortionList; } + ParaPortionList& GetParaPortions() { return maParaPortionList; } tools::Long Calc1ColumnTextHeight(tools::Long* pHeightNTP); @@ -846,13 +842,13 @@ public: // @return the previous bUpdateLayout state bool SetUpdateLayout( bool bUpdate, EditView* pCurView = nullptr, bool bForceUpdate = false ); - bool IsUpdateLayout() const { return bUpdateLayout; } + bool IsUpdateLayout() const { return mbUpdateLayout; } ViewsType& GetEditViews() { return aEditViews; } const ViewsType& GetEditViews() const { return aEditViews; } - const Size& GetPaperSize() const { return aPaperSize; } - void SetPaperSize( const Size& rSz ) { aPaperSize = rSz; } + const Size& GetPaperSize() const { return maPaperSize; } + void SetPaperSize(const Size& rSize) { maPaperSize = rSize; } void SetVertical( bool bVertical); bool IsEffectivelyVertical() const { return GetEditDoc().IsEffectivelyVertical(); } @@ -880,11 +876,11 @@ public: void SetTextRanger( std::unique_ptr<TextRanger> pRanger ); TextRanger* GetTextRanger() const { return pTextRanger.get(); } - const Size& GetMinAutoPaperSize() const { return aMinAutoPaperSize; } - void SetMinAutoPaperSize( const Size& rSz ) { aMinAutoPaperSize = rSz; } + const Size& GetMinAutoPaperSize() const { return maMinAutoPaperSize; } + void SetMinAutoPaperSize(const Size& rSize) { maMinAutoPaperSize = rSize; } - const Size& GetMaxAutoPaperSize() const { return aMaxAutoPaperSize; } - void SetMaxAutoPaperSize( const Size& rSz ) { aMaxAutoPaperSize = rSz; } + const Size& GetMaxAutoPaperSize() const { return maMaxAutoPaperSize; } + void SetMaxAutoPaperSize(const Size& rSize) { maMaxAutoPaperSize = rSize; } void SetMinColumnWrapHeight(tools::Long nVal) { mnMinColumnWrapHeight = nVal; } @@ -908,15 +904,15 @@ public: void UpdateSelections(); void EnableUndo( bool bEnable ); - bool IsUndoEnabled() const { return bUndoEnabled; } - void SetUndoMode( bool b ) { bIsInUndo = b; } - bool IsInUndo() const { return bIsInUndo; } + bool IsUndoEnabled() const { return mbUndoEnabled; } + void SetUndoMode( bool b ) { mbIsInUndo = b; } + bool IsInUndo() const { return mbIsInUndo; } - void SetCallParaInsertedOrDeleted( bool b ) { bCallParaInsertedOrDeleted = b; } - bool IsCallParaInsertedOrDeleted() const { return bCallParaInsertedOrDeleted; } + void SetCallParaInsertedOrDeleted( bool b ) { mbCallParaInsertedOrDeleted = b; } + bool IsCallParaInsertedOrDeleted() const { return mbCallParaInsertedOrDeleted; } - bool IsFormatted() const { return bFormatted; } - bool IsFormatting() const { return bIsFormatting; } + bool IsFormatted() const { return mbFormatted; } + bool IsFormatting() const { return mbIsFormatting; } void SetText(const OUString& rText); EditPaM DeleteSelected(const EditSelection& rEditSelection); @@ -977,11 +973,11 @@ public: tools::Rectangle GetEditCursor(const ParaPortion* pPortion, const EditLine* pLine, sal_Int32 nIndex, GetCursorFlags nFlags); - bool IsModified() const { return aEditDoc.IsModified(); } - void SetModifyFlag( bool b ) { aEditDoc.SetModified( b ); } + bool IsModified() const { return maEditDoc.IsModified(); } + void SetModifyFlag(bool b) { maEditDoc.SetModified( b ); } void SetModifyHdl( const Link<LinkParamNone*,void>& rLink ) { aModifyHdl = rLink; } - bool IsInSelectionMode() const { return bInSelection; } + bool IsInSelectionMode() const { return mbInSelection; } // For Undo/Redo void Undo( EditView* pView ); @@ -1029,7 +1025,7 @@ public: const MapMode& GetRefMapMode() const { return pRefDev->GetMapMode(); } void SetRefMapMode( const MapMode& rMapMode ); - InternalEditStatus& GetStatus() { return aStatus; } + InternalEditStatus& GetStatus() { return maStatus; } void CallStatusHdl(); void DelayedCallStatusHdl() { aStatusTimer.Start(); } @@ -1054,8 +1050,8 @@ public: SpellInfo* GetSpellInfo() const { return pSpellInfo.get(); } - void SetDefaultLanguage( LanguageType eLang ) { eDefLanguage = eLang; } - LanguageType GetDefaultLanguage() const { return eDefLanguage; } + void SetDefaultLanguage(LanguageType eLang) { meDefLanguage = eLang; } + LanguageType GetDefaultLanguage() const { return meDefLanguage; } editeng::LanguageSpan GetLanguage( const EditPaM& rPaM, sal_Int32* pEndPos = nullptr ) const; css::lang::Locale GetLocale( const EditPaM& rPaM ) const; @@ -1133,24 +1129,24 @@ public: rY = mfSpacingScaleY; } - sal_Int32 GetBigTextObjectStart() const { return nBigTextObjectStart; } + sal_Int32 GetBigTextObjectStart() const { return mnBigTextObjectStart; } EditEngine* GetEditEnginePtr() const { return pEditEngine; } void StartOnlineSpellTimer() { aOnlineSpellTimer.Start(); } void StopOnlineSpellTimer() { aOnlineSpellTimer.Stop(); } - const OUString& GetAutoCompleteText() const { return aAutoCompleteText; } + const OUString& GetAutoCompleteText() const { return maAutoCompleteText; } void SetAutoCompleteText(const OUString& rStr, bool bUpdateTipWindow); EditSelection TransliterateText( const EditSelection& rSelection, TransliterationFlags nTransliterationMode ); short ReplaceTextOnly( ContentNode* pNode, sal_Int32 nCurrentStart, std::u16string_view rText, const css::uno::Sequence< sal_Int32 >& rOffsets ); void SetAsianCompressionMode( CharCompressType n ); - CharCompressType GetAsianCompressionMode() const { return nAsianCompressionMode; } + CharCompressType GetAsianCompressionMode() const { return mnAsianCompressionMode; } void SetKernAsianPunctuation( bool b ); - bool IsKernAsianPunctuation() const { return bKernAsianPunctuation; } + bool IsKernAsianPunctuation() const { return mbKernAsianPunctuation; } sal_Int32 GetOverflowingParaNum() const { return mnOverflowingPara; } sal_Int32 GetOverflowingLineNum() const { return mnOverflowingLine; } @@ -1158,7 +1154,7 @@ public: void SetAddExtLeading( bool b ); - bool IsAddExtLeading() const { return bAddExtLeading; } + bool IsAddExtLeading() const { return mbAddExtLeading; } static std::shared_ptr<SvxForbiddenCharactersTable> const & GetForbiddenCharsTable(); static void SetForbiddenCharsTable( const std::shared_ptr<SvxForbiddenCharactersTable>& xForbiddenChars ); @@ -1172,8 +1168,8 @@ public: const Link<EditView*,void>& GetEndDropHdl() const { return maEndDropHdl; } /// specifies if auto-correction should capitalize the first word or not (default is on) - void SetFirstWordCapitalization( bool bCapitalize ) { bFirstWordCapitalization = bCapitalize; } - bool IsFirstWordCapitalization() const { return bFirstWordCapitalization; } + void SetFirstWordCapitalization( bool bCapitalize ) { mbFirstWordCapitalization = bCapitalize; } + bool IsFirstWordCapitalization() const { return mbFirstWordCapitalization; } /** specifies if auto-correction should replace a leading single quotation mark (apostrophe) or not (default is on) */ @@ -1235,14 +1231,14 @@ public: inline EPaM ImpEditEngine::CreateEPaM( const EditPaM& rPaM ) const { const ContentNode* pNode = rPaM.GetNode(); - return EPaM( aEditDoc.GetPos( pNode ), rPaM.GetIndex() ); + return EPaM(maEditDoc.GetPos(pNode), rPaM.GetIndex()); } inline EditPaM ImpEditEngine::CreateEditPaM( const EPaM& rEPaM ) { - DBG_ASSERT( rEPaM.nPara < aEditDoc.Count(), "CreateEditPaM: invalid paragraph" ); - DBG_ASSERT( aEditDoc[ rEPaM.nPara ]->Len() >= rEPaM.nIndex, "CreateEditPaM: invalid Index" ); - return EditPaM( aEditDoc[ rEPaM.nPara], rEPaM.nIndex ); + DBG_ASSERT( rEPaM.nPara < maEditDoc.Count(), "CreateEditPaM: invalid paragraph" ); + DBG_ASSERT( maEditDoc[ rEPaM.nPara ]->Len() >= rEPaM.nIndex, "CreateEditPaM: invalid Index" ); + return EditPaM( maEditDoc[ rEPaM.nPara], rEPaM.nIndex ); } inline ESelection ImpEditEngine::CreateESel( const EditSelection& rSel ) const @@ -1250,23 +1246,23 @@ inline ESelection ImpEditEngine::CreateESel( const EditSelection& rSel ) const const ContentNode* pStartNode = rSel.Min().GetNode(); const ContentNode* pEndNode = rSel.Max().GetNode(); ESelection aESel; - aESel.nStartPara = aEditDoc.GetPos( pStartNode ); + aESel.nStartPara = maEditDoc.GetPos( pStartNode ); aESel.nStartPos = rSel.Min().GetIndex(); - aESel.nEndPara = aEditDoc.GetPos( pEndNode ); + aESel.nEndPara = maEditDoc.GetPos( pEndNode ); aESel.nEndPos = rSel.Max().GetIndex(); return aESel; } inline EditSelection ImpEditEngine::CreateSel( const ESelection& rSel ) { - DBG_ASSERT( rSel.nStartPara < aEditDoc.Count(), "CreateSel: invalid start paragraph" ); - DBG_ASSERT( rSel.nEndPara < aEditDoc.Count(), "CreateSel: invalid end paragraph" ); + DBG_ASSERT( rSel.nStartPara < maEditDoc.Count(), "CreateSel: invalid start paragraph" ); + DBG_ASSERT( rSel.nEndPara < maEditDoc.Count(), "CreateSel: invalid end paragraph" ); EditSelection aSel; - aSel.Min().SetNode( aEditDoc[ rSel.nStartPara ] ); + aSel.Min().SetNode( maEditDoc[ rSel.nStartPara ] ); aSel.Min().SetIndex( rSel.nStartPos ); - aSel.Max().SetNode( aEditDoc[ rSel.nEndPara ] ); + aSel.Max().SetNode( maEditDoc[ rSel.nEndPara ] ); aSel.Max().SetIndex( rSel.nEndPos ); - DBG_ASSERT( !aSel.DbgIsBuggy( aEditDoc ), "CreateSel: incorrect selection!" ); + DBG_ASSERT( !aSel.DbgIsBuggy( maEditDoc ), "CreateSel: incorrect selection!" ); return aSel; } @@ -1320,14 +1316,14 @@ inline SfxUndoManager* ImpEditEngine::SetUndoManager(SfxUndoManager* pNew) inline const ParaPortion* ImpEditEngine::FindParaPortion( const ContentNode* pNode ) const { - sal_Int32 nPos = aEditDoc.GetPos( pNode ); + sal_Int32 nPos = maEditDoc.GetPos( pNode ); DBG_ASSERT( nPos < GetParaPortions().Count(), "Portionloser Node?" ); return GetParaPortions()[ nPos ]; } inline ParaPortion* ImpEditEngine::FindParaPortion( ContentNode const * pNode ) { - sal_Int32 nPos = aEditDoc.GetPos( pNode ); + sal_Int32 nPos = maEditDoc.GetPos( pNode ); DBG_ASSERT( nPos < GetParaPortions().Count(), "Portionloser Node?" ); return GetParaPortions()[ nPos ]; } diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx index 61b3d0062748..fa5dc5903b60 100644 --- a/editeng/source/editeng/impedit2.cxx +++ b/editeng/source/editeng/impedit2.cxx @@ -89,10 +89,10 @@ static sal_uInt16 lcl_CalcExtraSpace( const SvxLineSpacingItem& rLSItem ) ImpEditEngine::ImpEditEngine( EditEngine* pEE, SfxItemPool* pItemPool ) : pSharedVCL(EditDLL::Get().GetSharedVclResources()), - aPaperSize( 0x7FFFFFFF, 0x7FFFFFFF ), - aMinAutoPaperSize( 0x0, 0x0 ), - aMaxAutoPaperSize( 0x7FFFFFFF, 0x7FFFFFFF ), - aEditDoc( pItemPool ), + maPaperSize( 0x7FFFFFFF, 0x7FFFFFFF ), + maMinAutoPaperSize( 0x0, 0x0 ), + maMaxAutoPaperSize( 0x7FFFFFFF, 0x7FFFFFFF ), + maEditDoc( pItemPool ), pEditEngine(pEE), pActiveView(nullptr), pStylePool(nullptr), @@ -105,34 +105,34 @@ ImpEditEngine::ImpEditEngine( EditEngine* pEE, SfxItemPool* pItemPool ) : mfSpacingScaleX(100.0), mfSpacingScaleY(100.0), mbRoundToNearestPt(false), - nAsianCompressionMode(CharCompressType::NONE), + mnAsianCompressionMode(CharCompressType::NONE), eDefaultHorizontalTextDirection(EEHorizontalTextDirection::Default), - nBigTextObjectStart(20), - eDefLanguage(LANGUAGE_DONTKNOW), + mnBigTextObjectStart(20), + meDefLanguage(LANGUAGE_DONTKNOW), nCurTextHeight(0), nCurTextHeightNTP(0), aOnlineSpellTimer( "editeng::ImpEditEngine aOnlineSpellTimer" ), aStatusTimer( "editeng::ImpEditEngine aStatusTimer" ), - bKernAsianPunctuation(false), - bAddExtLeading(false), - bIsFormatting(false), - bFormatted(false), - bInSelection(false), - bIsInUndo(false), - bUpdateLayout(true), - bUndoEnabled(true), - bDowning(false), - bUseAutoColor(true), - bForceAutoColor(false), - bCallParaInsertedOrDeleted(false), - bFirstWordCapitalization(true), + mbKernAsianPunctuation(false), + mbAddExtLeading(false), + mbIsFormatting(false), + mbFormatted(false), + mbInSelection(false), + mbIsInUndo(false), + mbUpdateLayout(true), + mbUndoEnabled(true), + mbDowning(false), + mbUseAutoColor(true), + mbForceAutoColor(false), + mbCallParaInsertedOrDeleted(false), + mbFirstWordCapitalization(true), mbLastTryMerge(false), mbReplaceLeadingSingleQuotationMark(true), mbSkipOutsideFormat(false), mbFuzzing(utl::ConfigManager::IsFuzzing()), mbNbspRunNext(false) { - aStatus.GetControlWord() = EEControlBits::USECHARATTRIBS | EEControlBits::DOIDLEFORMAT | + maStatus.GetControlWord() = EEControlBits::USECHARATTRIBS | EEControlBits::DOIDLEFORMAT | EEControlBits::PASTESPECIAL | EEControlBits::UNDOATTRIBS | EEControlBits::ALLOWBIGOBJS | EEControlBits::RTFSTYLESHEETS | EEControlBits::FORMAT100; @@ -152,9 +152,9 @@ ImpEditEngine::ImpEditEngine( EditEngine* pEE, SfxItemPool* pItemPool ) : SetRefDevice( nullptr ); InitDoc( false ); - bCallParaInsertedOrDeleted = true; + mbCallParaInsertedOrDeleted = true; - aEditDoc.SetModifyHdl( LINK( this, ImpEditEngine, DocModified ) ); + maEditDoc.SetModifyHdl( LINK( this, ImpEditEngine, DocModified ) ); StartListening(*SfxGetpApp()); } @@ -178,7 +178,7 @@ ImpEditEngine::~ImpEditEngine() // Destroying templates may otherwise cause unnecessary formatting, // when a parent template is destroyed. // And this after the destruction of the data! - bDowning = true; + mbDowning = true; SetUpdateLayout( false ); Dispose(); @@ -230,23 +230,23 @@ void ImpEditEngine::SetRefMapMode( const MapMode& rMapMode ) void ImpEditEngine::InitDoc(bool bKeepParaAttribs) { - sal_Int32 nParas = aEditDoc.Count(); + sal_Int32 nParas = maEditDoc.Count(); for ( sal_Int32 n = bKeepParaAttribs ? 1 : 0; n < nParas; n++ ) { - if ( aEditDoc[n]->GetStyleSheet() ) - EndListening( *aEditDoc[n]->GetStyleSheet() ); + if ( maEditDoc[n]->GetStyleSheet() ) + EndListening( *maEditDoc[n]->GetStyleSheet() ); } if ( bKeepParaAttribs ) - aEditDoc.RemoveText(); + maEditDoc.RemoveText(); else - aEditDoc.Clear(); + maEditDoc.Clear(); GetParaPortions().Reset(); - GetParaPortions().Insert(0, std::make_unique<ParaPortion>( aEditDoc[0] )); + GetParaPortions().Insert(0, std::make_unique<ParaPortion>( maEditDoc[0] )); - bFormatted = false; + mbFormatted = false; if ( IsCallParaInsertedOrDeleted() ) { @@ -255,7 +255,7 @@ void ImpEditEngine::InitDoc(bool bKeepParaAttribs) } if ( GetStatus().DoOnlineSpelling() ) - aEditDoc.GetObject( 0 )->CreateWrongList(); + maEditDoc.GetObject( 0 )->CreateWrongList(); } EditPaM ImpEditEngine::DeleteSelected(const EditSelection& rSel) @@ -270,12 +270,12 @@ OUString ImpEditEngine::GetSelected( const EditSelection& rSel ) const return OUString(); EditSelection aSel( rSel ); - aSel.Adjust( aEditDoc ); + aSel.Adjust( maEditDoc ); ContentNode* pStartNode = aSel.Min().GetNode(); ContentNode* pEndNode = aSel.Max().GetNode(); - sal_Int32 nStartNode = aEditDoc.GetPos( pStartNode ); - sal_Int32 nEndNode = aEditDoc.GetPos( pEndNode ); + sal_Int32 nStartNode = maEditDoc.GetPos( pStartNode ); + sal_Int32 nEndNode = maEditDoc.GetPos( pEndNode ); OSL_ENSURE( nStartNode <= nEndNode, "Selection not sorted ?" ); @@ -285,7 +285,7 @@ OUString ImpEditEngine::GetSelected( const EditSelection& rSel ) const // iterate over the paragraphs ... for ( sal_Int32 nNode = nStartNode; nNode <= nEndNode; nNode++ ) { - const ContentNode* pNode = aEditDoc.GetObject( nNode ); + const ContentNode* pNode = maEditDoc.GetObject( nNode ); assert(pNode); const sal_Int32 nStartPos = nNode==nStartNode ? aSel.Min().GetIndex() : 0; @@ -608,7 +608,7 @@ bool ImpEditEngine::MouseButtonUp( const MouseEvent& rMEvt, EditView* pView ) // non-tiled-rendering case, but it has been here since 2000 (and before) // so who knows what corner case it was supposed to solve back then if (!comphelper::LibreOfficeKit::isActive()) - bInSelection = false; + mbInSelection = false; // Special treatments EditSelection aCurSel( pView->pImpEditView->GetEditSelection() ); @@ -670,7 +670,7 @@ void ImpEditEngine::Clear() { InitDoc( false ); - EditPaM aPaM = aEditDoc.GetStartPaM(); + EditPaM aPaM = maEditDoc.GetStartPaM(); EditSelection aSel( aPaM ); nCurTextHeight = 0; @@ -695,14 +695,14 @@ EditPaM ImpEditEngine::RemoveText() { InitDoc( true ); - EditPaM aStartPaM = aEditDoc.GetStartPaM(); + EditPaM aStartPaM = maEditDoc.GetStartPaM(); EditSelection aEmptySel( aStartPaM, aStartPaM ); for (EditView* pView : aEditViews) { pView->pImpEditView->SetEditSelection( aEmptySel ); } ResetUndoManager(); - return aEditDoc.GetStartPaM(); + return maEditDoc.GetStartPaM(); } @@ -727,7 +727,7 @@ void ImpEditEngine::SetText(const OUString& rText) if (rText.isEmpty() && IsUpdateLayout()) { tools::Rectangle aTmpRect( pView->GetOutputArea().TopLeft(), - Size( aPaperSize.Width(), nCurTextHeight ) ); + Size( maPaperSize.Width(), nCurTextHeight ) ); aTmpRect.Intersection( pView->GetOutputArea() ); pView->InvalidateWindow( aTmpRect ); } @@ -745,7 +745,7 @@ const SfxItemSet& ImpEditEngine::GetEmptyItemSet() const { if ( !pEmptyItemSet ) { - pEmptyItemSet = std::make_unique<SfxItemSetFixed<EE_ITEMS_START, EE_ITEMS_END>>(const_cast<SfxItemPool&>(aEditDoc.GetItemPool())); + pEmptyItemSet = std::make_unique<SfxItemSetFixed<EE_ITEMS_START, EE_ITEMS_END>>(const_cast<SfxItemPool&>(maEditDoc.GetItemPool())); for ( sal_uInt16 nWhich = EE_ITEMS_START; nWhich <= EE_CHAR_END; nWhich++) { pEmptyItemSet->ClearItem( nWhich ); @@ -762,13 +762,13 @@ void ImpEditEngine::CursorMoved( const ContentNode* pPrevNode ) // Delete empty attributes, but only if paragraph is not empty! if (pPrevNode->GetCharAttribs().HasEmptyAttribs() && pPrevNode->Len()) { - const_cast<ContentNode*>(pPrevNode)->GetCharAttribs().DeleteEmptyAttribs(aEditDoc.GetItemPool()); + const_cast<ContentNode*>(pPrevNode)->GetCharAttribs().DeleteEmptyAttribs(maEditDoc.GetItemPool()); } } void ImpEditEngine::TextModified() { - bFormatted = false; + mbFormatted = false; if ( GetNotifyHdl().IsSet() ) { @@ -782,14 +782,14 @@ void ImpEditEngine::ParaAttribsChanged( ContentNode const * pNode, bool bIgnoreU { assert(pNode && "ParaAttribsChanged: Which one?"); - aEditDoc.SetModified( true ); - bFormatted = false; + maEditDoc.SetModified( true ); + mbFormatted = false; ParaPortion* pPortion = FindParaPortion( pNode ); assert(pPortion); pPortion->MarkSelectionInvalid( 0 ); - sal_Int32 nPara = aEditDoc.GetPos( pNode ); + sal_Int32 nPara = maEditDoc.GetPos( pNode ); if ( bIgnoreUndoCheck || pEditEngine->IsInUndo() ) pEditEngine->ParaAttribsChanged( nPara ); @@ -1414,14 +1414,14 @@ EditPaM ImpEditEngine::CursorEndOfParagraph( const EditPaM& rPaM ) EditPaM ImpEditEngine::CursorStartOfDoc() { - EditPaM aPaM( aEditDoc.GetObject( 0 ), 0 ); + EditPaM aPaM( maEditDoc.GetObject( 0 ), 0 ); return aPaM; } EditPaM ImpEditEngine::CursorEndOfDoc() { - ContentNode* pLastNode = aEditDoc.GetObject( aEditDoc.Count()-1 ); - ParaPortion* pLastPortion = GetParaPortions().SafeGetObject( aEditDoc.Count()-1 ); + ContentNode* pLastNode = maEditDoc.GetObject( maEditDoc.Count()-1 ); + ParaPortion* pLastPortion = GetParaPortions().SafeGetObject( maEditDoc.Count()-1 ); OSL_ENSURE( pLastNode && pLastPortion, "CursorEndOfDoc: Node or Portion not found" ); if (!(pLastNode && pLastPortion)) return EditPaM(); @@ -1431,7 +1431,7 @@ EditPaM ImpEditEngine::CursorEndOfDoc() pLastNode = GetPrevVisNode( pLastPortion->GetNode() ); OSL_ENSURE( pLastNode, "No visible paragraph?" ); if ( !pLastNode ) - pLastNode = aEditDoc.GetObject( aEditDoc.Count()-1 ); + pLastNode = maEditDoc.GetObject( maEditDoc.Count()-1 ); } EditPaM aPaM( pLastNode, pLastNode->Len() ); @@ -1472,8 +1472,8 @@ EditPaM ImpEditEngine::WordLeft( const EditPaM& rPaM ) if ( nCurrentPos == 0 ) { // Previous paragraph... - sal_Int32 nCurPara = aEditDoc.GetPos( aNewPaM.GetNode() ); - ContentNode* pPrevNode = aEditDoc.GetObject( --nCurPara ); + sal_Int32 nCurPara = maEditDoc.GetPos( aNewPaM.GetNode() ); + ContentNode* pPrevNode = maEditDoc.GetObject( --nCurPara ); if ( pPrevNode ) { aNewPaM.SetNode( pPrevNode ); @@ -1522,8 +1522,8 @@ EditPaM ImpEditEngine::WordRight( const EditPaM& rPaM, sal_Int16 nWordType ) if ( aNewPaM.GetIndex() >= nMax ) { // Next paragraph ... - sal_Int32 nCurPara = aEditDoc.GetPos( aNewPaM.GetNode() ); - ContentNode* pNextNode = aEditDoc.GetObject( ++nCurPara ); + sal_Int32 nCurPara = maEditDoc.GetPos( aNewPaM.GetNode() ); + ContentNode* pNextNode = maEditDoc.GetObject( ++nCurPara ); if ( pNextNode ) { aNewPaM.SetNode( pNextNode ); @@ -1857,7 +1857,7 @@ sal_uInt16 ImpEditEngine::GetI18NScriptType( const EditPaM& rPaM, sal_Int32* pEn SvtScriptType ImpEditEngine::GetItemScriptType( const EditSelection& rSel ) const { EditSelection aSel( rSel ); - aSel.Adjust( aEditDoc ); + aSel.Adjust( maEditDoc ); SvtScriptType nScriptType = SvtScriptType::NONE; @@ -2060,7 +2060,7 @@ sal_uInt8 ImpEditEngine::GetRightToLeft( sal_Int32 nPara, sal_Int32 nPos, sal_In { sal_uInt8 nRightToLeft = 0; - ContentNode* pNode = aEditDoc.GetObject( nPara ); + ContentNode* pNode = maEditDoc.GetObject( nPara ); if ( pNode && pNode->Len() ) { ParaPortion* pParaPortion = GetParaPortions().SafeGetObject( nPara ); @@ -2091,7 +2091,7 @@ SvxAdjust ImpEditEngine::GetJustification( sal_Int32 nPara ) const { SvxAdjust eJustification = SvxAdjust::Left; - if ( !aStatus.IsOutliner() ) + if (!maStatus.IsOutliner()) { eJustification = GetParaAttrib( nPara, EE_PARA_JUST ).GetAdjust(); @@ -2143,7 +2143,7 @@ void ImpEditEngine::ImpRemoveChars( const EditPaM& rPaM, sal_Int32 nChars ) InsertUndo(std::make_unique<EditUndoRemoveChars>(pEditEngine, CreateEPaM(rPaM), aStr)); } - aEditDoc.RemoveChars( rPaM, nChars ); + maEditDoc.RemoveChars( rPaM, nChars ); } EditSelection ImpEditEngine::ImpMoveParagraphs( Range aOldPositions, sal_Int32 nNewPos ) @@ -2157,7 +2157,7 @@ EditSelection ImpEditEngine::ImpMoveParagraphs( Range aOldPositions, sal_Int32 n if ( !bValidAction ) { - aSelection = aEditDoc.GetStartPaM(); + aSelection = maEditDoc.GetStartPaM(); return aSelection; } @@ -2209,7 +2209,7 @@ EditSelection ImpEditEngine::ImpMoveParagraphs( Range aOldPositions, sal_Int32 n { // always aOldPositions.Min(), since Remove(). std::unique_ptr<ParaPortion> pTmpPortion = GetParaPortions().Release(aOldPositions.Min()); - aEditDoc.Release( aOldPositions.Min() ); + maEditDoc.Release( aOldPositions.Min() ); aTmpPortionList.Append(std::move(pTmpPortion)); } @@ -2227,7 +2227,7 @@ EditSelection ImpEditEngine::ImpMoveParagraphs( Range aOldPositions, sal_Int32 n aSelection.Max().SetIndex( pTmpPortion->GetNode()->Len() ); ContentNode* pN = pTmpPortion->GetNode(); - aEditDoc.Insert(nRealNewPos+i, pN); + maEditDoc.Insert(nRealNewPos+i, pN); GetParaPortions().Insert(nRealNewPos+i, std::move(pTmpPortion)); ++i; @@ -2244,7 +2244,7 @@ EditSelection ImpEditEngine::ImpMoveParagraphs( Range aOldPositions, sal_Int32 n GetNotifyHdl().Call( aNotify ); } - aEditDoc.SetModified( true ); + maEditDoc.SetModified( true ); if ( pRecalc1 ) CalcHeight( pRecalc1 ); @@ -2256,7 +2256,7 @@ EditSelection ImpEditEngine::ImpMoveParagraphs( Range aOldPositions, sal_Int32 n CalcHeight( pRecalc4 ); #if OSL_DEBUG_LEVEL > 0 && !defined NDEBUG - ParaPortionList::DbgCheck(GetParaPortions(), aEditDoc); + ParaPortionList::DbgCheck(GetParaPortions(), maEditDoc); #endif return aSelection; } @@ -2265,28 +2265,28 @@ EditSelection ImpEditEngine::ImpMoveParagraphs( Range aOldPositions, sal_Int32 n EditPaM ImpEditEngine::ImpConnectParagraphs( ContentNode* pLeft, ContentNode* pRight, bool bBackward ) { OSL_ENSURE( pLeft != pRight, "Join together the same paragraph ?" ); - OSL_ENSURE( aEditDoc.GetPos( pLeft ) != EE_PARA_NOT_FOUND, "Inserted node not found (1)" ); - OSL_ENSURE( aEditDoc.GetPos( pRight ) != EE_PARA_NOT_FOUND, "Inserted node not found (2)" ); + OSL_ENSURE( maEditDoc.GetPos( pLeft ) != EE_PARA_NOT_FOUND, "Inserted node not found (1)" ); + OSL_ENSURE( maEditDoc.GetPos( pRight ) != EE_PARA_NOT_FOUND, "Inserted node not found (2)" ); // #i120020# it is possible that left and right are *not* in the desired order (left/right) // so correct it. This correction is needed, else an invalid SfxLinkUndoAction will be // created from ConnectParagraphs below. Assert this situation, it should be corrected by the // caller. - if(aEditDoc.GetPos( pLeft ) > aEditDoc.GetPos( pRight )) + if (maEditDoc.GetPos( pLeft ) > maEditDoc.GetPos( pRight )) { OSL_ENSURE(false, "ImpConnectParagraphs with wrong order of pLeft/pRight nodes (!)"); std::swap(pLeft, pRight); } - sal_Int32 nParagraphTobeDeleted = aEditDoc.GetPos( pRight ); + sal_Int32 nParagraphTobeDeleted = maEditDoc.GetPos( pRight ); aDeletedNodes.push_back(std::make_unique<DeletedNodeInfo>( pRight, nParagraphTobeDeleted )); - GetEditEnginePtr()->ParagraphConnected( aEditDoc.GetPos( pLeft ), aEditDoc.GetPos( pRight ) ); + GetEditEnginePtr()->ParagraphConnected( maEditDoc.GetPos( pLeft ), maEditDoc.GetPos( pRight ) ); if ( IsUndoEnabled() && !IsInUndo() ) { InsertUndo( std::make_unique<EditUndoConnectParas>(pEditEngine, - aEditDoc.GetPos( pLeft ), pLeft->Len(), + maEditDoc.GetPos( pLeft ), pLeft->Len(), pLeft->GetContentAttribs().GetItems(), pRight->GetContentAttribs().GetItems(), pLeft->GetStyleSheet(), pRight->GetStyleSheet(), bBackward ) ); } @@ -2328,7 +2328,7 @@ EditPaM ImpEditEngine::ImpConnectParagraphs( ContentNode* pLeft, ContentNode* pR if ( IsCallParaInsertedOrDeleted() ) GetEditEnginePtr()->ParagraphDeleted( nParagraphTobeDeleted ); - EditPaM aPaM = aEditDoc.ConnectParagraphs( pLeft, pRight ); + EditPaM aPaM = maEditDoc.ConnectParagraphs( pLeft, pRight ); GetParaPortions().Remove( nParagraphTobeDeleted ); pLeftPortion->MarkSelectionInvalid( aPaM.GetIndex() ); @@ -2354,7 +2354,7 @@ EditPaM ImpEditEngine::ImpConnectParagraphs( ContentNode* pLeft, ContentNode* pR EditPaM ImpEditEngine::DeleteLeftOrRight( const EditSelection& rSel, sal_uInt8 nMode, DeleteMode nDelMode ) { - OSL_ENSURE( !rSel.DbgIsBuggy( aEditDoc ), "Index out of range in DeleteLeftOrRight" ); + OSL_ENSURE( !rSel.DbgIsBuggy( maEditDoc ), "Index out of range in DeleteLeftOrRight" ); if ( rSel.HasRange() ) // only then Delete Selection return ImpDeleteSelection( rSel ); @@ -2449,7 +2449,7 @@ EditPaM ImpEditEngine::ImpDeleteSelection(const EditSelection& rCurSel) return rCurSel.Min(); EditSelection aCurSel(rCurSel); - aCurSel.Adjust( aEditDoc ); + aCurSel.Adjust( maEditDoc ); EditPaM aStartPaM(aCurSel.Min()); EditPaM aEndPaM(aCurSel.Max()); @@ -2459,8 +2459,8 @@ EditPaM ImpEditEngine::ImpDeleteSelection(const EditSelection& rCurSel) OSL_ENSURE( aStartPaM.GetIndex() <= aStartPaM.GetNode()->Len(), "Index out of range in ImpDeleteSelection" ); OSL_ENSURE( aEndPaM.GetIndex() <= aEndPaM.GetNode()->Len(), "Index out of range in ImpDeleteSelection" ); - sal_Int32 nStartNode = aEditDoc.GetPos( aStartPaM.GetNode() ); - sal_Int32 nEndNode = aEditDoc.GetPos( aEndPaM.GetNode() ); + sal_Int32 nStartNode = maEditDoc.GetPos( aStartPaM.GetNode() ); + sal_Int32 nEndNode = maEditDoc.GetPos( aEndPaM.GetNode() ); OSL_ENSURE( nEndNode != EE_PARA_NOT_FOUND, "Start > End ?!" ); OSL_ENSURE( nStartNode <= nEndNode, "Start > End ?!" ); @@ -2505,15 +2505,15 @@ EditPaM ImpEditEngine::ImpDeleteSelection(const EditSelection& rCurSel) void ImpEditEngine::ImpRemoveParagraph( sal_Int32 nPara ) { - ContentNode* pNode = aEditDoc.GetObject( nPara ); - ContentNode* pNextNode = aEditDoc.GetObject( nPara+1 ); + ContentNode* pNode = maEditDoc.GetObject( nPara ); + ContentNode* pNextNode = maEditDoc.GetObject( nPara+1 ); assert(pNode); aDeletedNodes.push_back(std::make_unique<DeletedNodeInfo>( pNode, nPara )); // The node is managed by the undo and possibly destroyed! - aEditDoc.Release( nPara ); + maEditDoc.Release( nPara ); GetParaPortions().Remove( nPara ); if ( IsCallParaInsertedOrDeleted() ) @@ -2531,7 +2531,7 @@ void ImpEditEngine::ImpRemoveParagraph( sal_Int32 nPara ) InsertUndo(std::make_unique<EditUndoDelContent>(pEditEngine, pNode, nPara)); else { - aEditDoc.RemoveItemsFromPool(*pNode); + maEditDoc.RemoveItemsFromPool(*pNode); if ( pNode->GetStyleSheet() ) EndListening( *pNode->GetStyleSheet() ); delete pNode; @@ -2635,7 +2635,7 @@ EditPaM ImpEditEngine::InsertTextUserInput( const EditSelection& rCurSel, // If selected, then do not also overwrite a character! EditSelection aTmpSel( aPaM ); aTmpSel.Max().SetIndex( aTmpSel.Max().GetIndex()+1 ); - OSL_ENSURE( !aTmpSel.DbgIsBuggy( aEditDoc ), "Overwrite: Wrong selection! "); + OSL_ENSURE( !aTmpSel.DbgIsBuggy( maEditDoc ), "Overwrite: Wrong selection! "); ImpDeleteSelection( aTmpSel ); } @@ -2697,7 +2697,7 @@ EditPaM ImpEditEngine::InsertTextUserInput( const EditSelection& rCurSel, InsertUndo( std::move(pNewUndo), bTryMerge ); } - aEditDoc.InsertText( aPaM, OUStringChar(c) ); + maEditDoc.InsertText( aPaM, OUStringChar(c) ); ParaPortion* pPortion = FindParaPortion( aPaM.GetNode() ); assert(pPortion); pPortion->MarkInvalid( aPaM.GetIndex(), 1 ); @@ -2744,7 +2744,7 @@ EditPaM ImpEditEngine::ImpInsertText(const EditSelection& aCurSel, const OUStrin sal_Int32 nStart = 0; while ( nStart < aText.getLength() ) { - sal_Int32 nEnd = !aStatus.IsSingleLine() ? + sal_Int32 nEnd = !maStatus.IsSingleLine() ? aText.indexOf( LINE_SEP, nStart ) : -1; if ( nEnd == -1 ) nEnd = aText.getLength(); // not dereference! @@ -2815,7 +2815,7 @@ EditPaM ImpEditEngine::ImpInsertText(const EditSelection& aCurSel, const OUStrin InsertUndo(std::make_unique<EditUndoInsertChars>(pEditEngine, CreateEPaM(aPaM), aLine)); // Tabs ? if ( aLine.indexOf( '\t' ) == -1 ) - aPaM = aEditDoc.InsertText( aPaM, aLine ); + aPaM = maEditDoc.InsertText( aPaM, aLine ); else { sal_Int32 nStart2 = 0; @@ -2826,10 +2826,10 @@ EditPaM ImpEditEngine::ImpInsertText(const EditSelection& aCurSel, const OUStrin nEnd2 = aLine.getLength(); // not dereference! if ( nEnd2 > nStart2 ) - aPaM = aEditDoc.InsertText( aPaM, aLine.subView( nStart2, nEnd2-nStart2 ) ); + aPaM = maEditDoc.InsertText( aPaM, aLine.subView( nStart2, nEnd2-nStart2 ) ); if ( nEnd2 < aLine.getLength() ) { - aPaM = aEditDoc.InsertFeature( aPaM, aTabItem ); + aPaM = maEditDoc.InsertFeature( aPaM, aTabItem ); } nStart2 = nEnd2+1; } @@ -2872,7 +2872,7 @@ EditPaM ImpEditEngine::ImpFastInsertText( EditPaM aPaM, const OUString& rStr ) if ( IsUndoEnabled() && !IsInUndo() ) InsertUndo(std::make_unique<EditUndoInsertChars>(pEditEngine, CreateEPaM(aPaM), rStr)); - aPaM = aEditDoc.InsertText( aPaM, rStr ); + aPaM = maEditDoc.InsertText( aPaM, rStr ); TextModified(); } else @@ -2896,7 +2896,7 @@ EditPaM ImpEditEngine::ImpInsertFeature(const EditSelection& rCurSel, const SfxP if ( IsUndoEnabled() && !IsInUndo() ) InsertUndo(std::make_unique<EditUndoInsertFeature>(pEditEngine, CreateEPaM(aPaM), rItem)); - aPaM = aEditDoc.InsertFeature( aPaM, rItem ); + aPaM = maEditDoc.InsertFeature( aPaM, rItem ); UpdateFields(); ParaPortion* pPortion = FindParaPortion( aPaM.GetNode() ); @@ -2921,7 +2921,7 @@ EditPaM ImpEditEngine::ImpInsertParaBreak( const EditSelection& rCurSel ) EditPaM ImpEditEngine::ImpInsertParaBreak( EditPaM& rPaM, bool bKeepEndingAttribs ) { - if ( aEditDoc.Count() >= EE_PARA_MAX_COUNT ) + if ( maEditDoc.Count() >= EE_PARA_MAX_COUNT ) { SAL_WARN( "editeng", "ImpEditEngine::ImpInsertParaBreak - can't process more than " << EE_PARA_MAX_COUNT << " paragraphs!"); @@ -2929,9 +2929,9 @@ EditPaM ImpEditEngine::ImpInsertParaBreak( EditPaM& rPaM, bool bKeepEndingAttrib } if ( IsUndoEnabled() && !IsInUndo() ) - InsertUndo(std::make_unique<EditUndoSplitPara>(pEditEngine, aEditDoc.GetPos(rPaM.GetNode()), rPaM.GetIndex())); + InsertUndo(std::make_unique<EditUndoSplitPara>(pEditEngine, maEditDoc.GetPos(rPaM.GetNode()), rPaM.GetIndex())); - EditPaM aPaM( aEditDoc.InsertParaBreak( rPaM, bKeepEndingAttribs ) ); + EditPaM aPaM( maEditDoc.InsertParaBreak( rPaM, bKeepEndingAttribs ) ); if (auto pStyle = aPaM.GetNode()->GetStyleSheet()) StartListening(*pStyle, DuplicateHandling::Allow); @@ -2989,21 +2989,21 @@ EditPaM ImpEditEngine::ImpFastInsertParagraph( sal_Int32 nPara ) { if ( nPara ) { - assert(aEditDoc.GetObject(nPara - 1)); - InsertUndo(std::make_unique<EditUndoSplitPara>(pEditEngine, nPara-1, aEditDoc.GetObject( nPara-1 )->Len())); + assert(maEditDoc.GetObject(nPara - 1)); + InsertUndo(std::make_unique<EditUndoSplitPara>(pEditEngine, nPara-1, maEditDoc.GetObject( nPara-1 )->Len())); } else InsertUndo(std::make_unique<EditUndoSplitPara>(pEditEngine, 0, 0)); } - ContentNode* pNode = new ContentNode( aEditDoc.GetItemPool() ); + ContentNode* pNode = new ContentNode( maEditDoc.GetItemPool() ); // If flat mode, then later no Font is set: - pNode->GetCharAttribs().GetDefFont() = aEditDoc.GetDefFont(); + pNode->GetCharAttribs().GetDefFont() = maEditDoc.GetDefFont(); if ( GetStatus().DoOnlineSpelling() ) pNode->CreateWrongList(); - aEditDoc.Insert(nPara, pNode); + maEditDoc.Insert(nPara, pNode); GetParaPortions().Insert(nPara, std::make_unique<ParaPortion>( pNode )); if ( IsCallParaInsertedOrDeleted() ) @@ -3015,9 +3015,9 @@ EditPaM ImpEditEngine::ImpFastInsertParagraph( sal_Int32 nPara ) EditPaM ImpEditEngine::InsertParaBreak(const EditSelection& rCurSel) { EditPaM aPaM(ImpInsertParaBreak(rCurSel)); - if ( aStatus.DoAutoIndenting() ) + if ( maStatus.DoAutoIndenting() ) { - sal_Int32 nPara = aEditDoc.GetPos( aPaM.GetNode() ); + sal_Int32 nPara = maEditDoc.GetPos( aPaM.GetNode() ); OSL_ENSURE( nPara > 0, "AutoIndenting: Error!" ); const OUString aPrevParaText( GetEditDoc().GetParaAsString( nPara-1 ) ); sal_Int32 n = 0; @@ -3065,9 +3065,9 @@ bool ImpEditEngine::UpdateFields() EditCharAttribField aCurrent(rField); rField.Reset(); - if (!aStatus.MarkNonUrlFields() && !aStatus.MarkUrlFields()) + if (!maStatus.MarkNonUrlFields() && !maStatus.MarkUrlFields()) ; // nothing marked - else if (aStatus.MarkNonUrlFields() && aStatus.MarkUrlFields()) + else if (maStatus.MarkNonUrlFields() && maStatus.MarkUrlFields()) rField.GetFieldColor() = GetColorConfig().GetColorValue(svtools::WRITERFIELDSHADINGS).nColor; else { @@ -3077,7 +3077,7 @@ bool ImpEditEngine::UpdateFields() if (const SvxFieldData* pFieldData = pFieldItem->GetField()) bURL = (dynamic_cast<const SvxURLField* >(pFieldData) != nullptr); } - if ((bURL && aStatus.MarkUrlFields()) || (!bURL && aStatus.MarkNonUrlFields())) + if ((bURL && maStatus.MarkUrlFields()) || (!bURL && maStatus.MarkNonUrlFields())) rField.GetFieldColor() = GetColorConfig().GetColorValue( svtools::WRITERFIELDSHADINGS ).nColor; } @@ -3199,7 +3199,7 @@ void ImpEditEngine::IterateLineAreas(const IterateLinesAreasFunc& f, IterFlag eO const Point aOrigin(0, 0); Point aLineStart(aOrigin); const tools::Long nVertLineSpacing = CalcVertLineSpacing(aLineStart); - const tools::Long nColumnWidth = GetColumnWidth(aPaperSize); + const tools::Long nColumnWidth = GetColumnWidth(maPaperSize); sal_Int16 nColumn = 0; for (sal_Int32 n = 0, nPortions = GetParaPortions().Count(); n < nPortions; ++n) { @@ -3226,7 +3226,7 @@ void ImpEditEngine::IterateLineAreas(const IterateLinesAreasFunc& f, IterFlag eO bSkipThis = eResult == CallbackResult::SkipThisPortion; sal_uInt16 nSBL = 0; - if (!aStatus.IsOutliner()) + if (!maStatus.IsOutliner()) { const SvxLineSpacingItem& rLSItem = pPortion->GetNode()->GetContentAttribs().GetItem(EE_PARA_SBL); @@ -3245,7 +3245,7 @@ void ImpEditEngine::IterateLineAreas(const IterateLinesAreasFunc& f, IterFlag eO MoveToNextLine(aLineStart, nLineHeight, nColumn, aOrigin, &aInfo.nHeightNeededToNotWrap); const bool bInclILS = eOptions & IterFlag::inclILS; - if (bInclILS && (nLine != nLines - 1) && !aStatus.IsOutliner()) + if (bInclILS && (nLine != nLines - 1) && !maStatus.IsOutliner()) { adjustYDirectionAware(aLineStart, nSBL); nLineHeight += nSBL; @@ -3268,10 +3268,10 @@ void ImpEditEngine::IterateLineAreas(const IterateLinesAreasFunc& f, IterFlag eO bSkipThis = eResult == CallbackResult::SkipThisPortion; } - if (!bInclILS && (nLine != nLines - 1) && !aStatus.IsOutliner()) + if (!bInclILS && (nLine != nLines - 1) && !maStatus.IsOutliner()) adjustYDirectionAware(aLineStart, nSBL); } - if (!aStatus.IsOutliner()) + if (!maStatus.IsOutliner()) { const SvxULSpaceItem& rULItem = pPortion->GetNode()->GetContentAttribs().GetItem(EE_PARA_ULSPACE); @@ -3288,7 +3288,7 @@ ImpEditEngine::GetPortionAndLine(Point aDocPos) { // First find the column from the point sal_Int32 nClickColumn = 0; - for (tools::Long nColumnStart = 0, nColumnWidth = GetColumnWidth(aPaperSize);; + for (tools::Long nColumnStart = 0, nColumnWidth = GetColumnWidth(maPaperSize);; nColumnStart += mnColumnSpacing + nColumnWidth, ++nClickColumn) { if (aDocPos.X() <= nColumnStart + nColumnWidth + mnColumnSpacing / 2) @@ -3772,11 +3772,11 @@ EditSelection ImpEditEngine::ConvertSelection( EditSelection aNewSelection; // Start... - ContentNode* pNode = aEditDoc.GetObject( nStartPara ); + ContentNode* pNode = maEditDoc.GetObject( nStartPara ); sal_Int32 nIndex = nStartPos; if ( !pNode ) { - pNode = aEditDoc[ aEditDoc.Count()-1 ]; + pNode = maEditDoc[ maEditDoc.Count()-1 ]; nIndex = pNode->Len(); } else if ( nIndex > pNode->Len() ) @@ -3786,11 +3786,11 @@ EditSelection ImpEditEngine::ConvertSelection( aNewSelection.Min().SetIndex( nIndex ); // End... - pNode = aEditDoc.GetObject( nEndPara ); + pNode = maEditDoc.GetObject( nEndPara ); nIndex = nEndPos; if ( !pNode ) { - pNode = aEditDoc[ aEditDoc.Count()-1 ]; + pNode = maEditDoc[ maEditDoc.Count()-1 ]; nIndex = pNode->Len(); } else if ( nIndex > pNode->Len() ) @@ -4341,7 +4341,7 @@ void ImpEditEngine::CalcHeight( ParaPortion* pPortion ) for (sal_Int32 nLine = 0; nLine < pPortion->GetLines().Count(); ++nLine) pPortion->nHeight += pPortion->GetLines()[nLine].GetHeight(); - if ( aStatus.IsOutliner() ) + if (maStatus.IsOutliner()) return; const SvxULSpaceItem& rULItem = pPortion->GetNode()->GetContentAttribs().GetItem( EE_PARA_ULSPACE ); @@ -4352,7 +4352,7 @@ void ImpEditEngine::CalcHeight( ParaPortion* pPortion ) { if ( pPortion->GetLines().Count() > 1 ) pPortion->nHeight += ( pPortion->GetLines().Count() - 1 ) * nSBL; - if ( aStatus.ULSpaceSummation() ) + if (maStatus.ULSpaceSummation()) pPortion->nHeight += nSBL; } @@ -4370,7 +4370,7 @@ void ImpEditEngine::CalcHeight( ParaPortion* pPortion ) } - if ( !nPortion || aStatus.ULSpaceSummation() ) + if ( !nPortion || maStatus.ULSpaceSummation() ) return; ParaPortion* pPrev = GetParaPortions().SafeGetObject( nPortion-1 ); @@ -4432,24 +4432,24 @@ void ImpEditEngine::CalcHeight( ParaPortion* pPortion ) void ImpEditEngine::SetValidPaperSize( const Size& rNewSz ) { - aPaperSize = rNewSz; + maPaperSize = rNewSz; - tools::Long nMinWidth = aStatus.AutoPageWidth() ? aMinAutoPaperSize.Width() : 0; - tools::Long nMaxWidth = aStatus.AutoPageWidth() ? aMaxAutoPaperSize.Width() : 0x7FFFFFFF; - tools::Long nMinHeight = aStatus.AutoPageHeight() ? aMinAutoPaperSize.Height() : 0; - tools::Long nMaxHeight = aStatus.AutoPageHeight() ? aMaxAutoPaperSize.Height() : 0x7FFFFFFF; + tools::Long nMinWidth = maStatus.AutoPageWidth() ? maMinAutoPaperSize.Width() : 0; + tools::Long nMaxWidth = maStatus.AutoPageWidth() ? maMaxAutoPaperSize.Width() : 0x7FFFFFFF; + tools::Long nMinHeight = maStatus.AutoPageHeight() ? maMinAutoPaperSize.Height() : 0; + tools::Long nMaxHeight = maStatus.AutoPageHeight() ? maMaxAutoPaperSize.Height() : 0x7FFFFFFF; // Minimum/Maximum width: - if ( aPaperSize.Width() < nMinWidth ) - aPaperSize.setWidth( nMinWidth ); - else if ( aPaperSize.Width() > nMaxWidth ) - aPaperSize.setWidth( nMaxWidth ); + if ( maPaperSize.Width() < nMinWidth ) + maPaperSize.setWidth( nMinWidth ); + else if ( maPaperSize.Width() > nMaxWidth ) + maPaperSize.setWidth( nMaxWidth ); // Minimum/Maximum height: - if ( aPaperSize.Height() < nMinHeight ) - aPaperSize.setHeight( nMinHeight ); - else if ( aPaperSize.Height() > nMaxHeight ) - aPaperSize.setHeight( nMaxHeight ); + if ( maPaperSize.Height() < nMinHeight ) + maPaperSize.setHeight( nMinHeight ); + else if ( maPaperSize.Height() > nMaxHeight ) + maPaperSize.setHeight( nMaxHeight ); } std::shared_ptr<SvxForbiddenCharactersTable> const & ImpEditEngine::GetForbiddenCharsTable() diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index e02959bb2e07..7ed7423bbded 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -402,7 +402,7 @@ void ImpEditEngine::FormatDoc() if (!IsUpdateLayout() || IsFormatting()) return; - bIsFormatting = true; + mbIsFormatting = true; // Then I can also start the spell-timer... if ( GetStatus().DoOnlineSpelling() ) @@ -466,14 +466,14 @@ void ImpEditEngine::FormatDoc() if ( nDiff ) { aInvalidRect.Union(tools::Rectangle::Normalize( - { 0, nNewHeight }, { getWidthDirectionAware(aPaperSize), nCurTextHeight })); - aStatus.GetStatusWord() |= !IsEffectivelyVertical() ? EditStatusFlags::TextHeightChanged : EditStatusFlags::TEXTWIDTHCHANGED; + { 0, nNewHeight }, { getWidthDirectionAware(maPaperSize), nCurTextHeight })); + maStatus.GetStatusWord() |= !IsEffectivelyVertical() ? EditStatusFlags::TextHeightChanged : EditStatusFlags::TEXTWIDTHCHANGED; } nCurTextHeight = nNewHeight; nCurTextHeightNTP = nNewHeightNTP; - if ( aStatus.AutoPageSize() ) + if ( maStatus.AutoPageSize() ) CheckAutoPageSize(); else if ( nDiff ) { @@ -483,10 +483,10 @@ void ImpEditEngine::FormatDoc() if ( pImpView->DoAutoHeight() ) { Size aSz( pImpView->GetOutputArea().GetWidth(), nCurTextHeight ); - if ( aSz.Height() > aMaxAutoPaperSize.Height() ) - aSz.setHeight( aMaxAutoPaperSize.Height() ); - else if ( aSz.Height() < aMinAutoPaperSize.Height() ) - aSz.setHeight( aMinAutoPaperSize.Height() ); + if ( aSz.Height() > maMaxAutoPaperSize.Height() ) + aSz.setHeight( maMaxAutoPaperSize.Height() ); + else if ( aSz.Height() < maMinAutoPaperSize.Height() ) + aSz.setHeight( maMinAutoPaperSize.Height() ); pImpView->ResetOutputArea( tools::Rectangle( pImpView->GetOutputArea().TopLeft(), aSz ) ); } @@ -504,8 +504,8 @@ void ImpEditEngine::FormatDoc() } } - bIsFormatting = false; - bFormatted = true; + mbIsFormatting = false; + mbFormatted = true; if ( bMapChanged ) GetRefDevice()->Pop(); @@ -517,7 +517,7 @@ bool ImpEditEngine::ImpCheckRefMapMode() { bool bChange = false; - if ( aStatus.DoFormat100() ) + if ( maStatus.DoFormat100() ) { MapMode aMapMode( GetRefDevice()->GetMapMode() ); if ( aMapMode.GetScaleX().GetNumerator() != aMapMode.GetScaleX().GetDenominator() ) @@ -542,20 +542,20 @@ void ImpEditEngine::CheckAutoPageSize() { Size aPrevPaperSize( GetPaperSize() ); if ( GetStatus().AutoPageWidth() ) - aPaperSize.setWidth( !IsEffectivelyVertical() ? CalcTextWidth( true ) : GetTextHeight() ); + maPaperSize.setWidth( !IsEffectivelyVertical() ? CalcTextWidth( true ) : GetTextHeight() ); if ( GetStatus().AutoPageHeight() ) - aPaperSize.setHeight( !IsEffectivelyVertical() ? GetTextHeight() : CalcTextWidth( true ) ); + maPaperSize.setHeight( !IsEffectivelyVertical() ? GetTextHeight() : CalcTextWidth( true ) ); - SetValidPaperSize( aPaperSize ); // consider Min, Max + SetValidPaperSize( maPaperSize ); // consider Min, Max - if ( aPaperSize == aPrevPaperSize ) + if ( maPaperSize == aPrevPaperSize ) return; - if ( ( !IsEffectivelyVertical() && ( aPaperSize.Width() != aPrevPaperSize.Width() ) ) - || ( IsEffectivelyVertical() && ( aPaperSize.Height() != aPrevPaperSize.Height() ) ) ) + if ( ( !IsEffectivelyVertical() && ( maPaperSize.Width() != aPrevPaperSize.Width() ) ) + || ( IsEffectivelyVertical() && ( maPaperSize.Height() != aPrevPaperSize.Height() ) ) ) { // If ahead is centered / right or tabs... - aStatus.GetStatusWord() |= !IsEffectivelyVertical() ? EditStatusFlags::TEXTWIDTHCHANGED : EditStatusFlags::TextHeightChanged; + maStatus.GetStatusWord() |= !IsEffectivelyVertical() ? EditStatusFlags::TEXTWIDTHCHANGED : EditStatusFlags::TextHeightChanged; for ( sal_Int32 nPara = 0; nPara < GetParaPortions().Count(); nPara++ ) { // Only paragraphs which are not aligned to the left need to be @@ -570,10 +570,10 @@ void ImpEditEngine::CheckAutoPageSize() } } - Size aInvSize = aPaperSize; - if ( aPaperSize.Width() < aPrevPaperSize.Width() ) + Size aInvSize = maPaperSize; + if ( maPaperSize.Width() < aPrevPaperSize.Width() ) aInvSize.setWidth( aPrevPaperSize.Width() ); - if ( aPaperSize.Height() < aPrevPaperSize.Height() ) + if ( maPaperSize.Height() < aPrevPaperSize.Height() ) aInvSize.setHeight( aPrevPaperSize.Height() ); Size aSz( aInvSize ); @@ -593,7 +593,7 @@ void ImpEditEngine::CheckAutoPageSize() void ImpEditEngine::CheckPageOverflow() { - SAL_INFO("editeng.chaining", "[CONTROL_STATUS] AutoPageSize is " << (( aStatus.GetControlWord() & EEControlBits::AUTOPAGESIZE ) ? "ON" : "OFF") ); + SAL_INFO("editeng.chaining", "[CONTROL_STATUS] AutoPageSize is " << (( maStatus.GetControlWord() & EEControlBits::AUTOPAGESIZE ) ? "ON" : "OFF") ); tools::Long nBoxHeight = GetMaxAutoPaperSize().Height(); SAL_INFO("editeng.chaining", "[OVERFLOW-CHECK] Current MaxAutoPaperHeight is " << nBoxHeight); @@ -611,12 +611,12 @@ void ImpEditEngine::CheckPageOverflow() { // which paragraph is the first to cause higher size of the box? ImplUpdateOverflowingParaNum( nBoxHeight); // XXX: currently only for horizontal text - //aStatus.SetPageOverflow(true); + //maStatus.SetPageOverflow(true); mbNeedsChainingHandling = true; } else { // No overflow if within box boundaries - //aStatus.SetPageOverflow(false); + //maStatus.SetPageOverflow(false); mbNeedsChainingHandling = false; } @@ -666,7 +666,7 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY ) // bail out to avoid possibly formatting a lot of text that will not be used. For the first // paragraph still format at least a bit. if( mbSkipOutsideFormat && nPara != 0 - && !aStatus.AutoPageHeight() && aPaperSize.Height() < nCurrentPosY ) + && !maStatus.AutoPageHeight() && maPaperSize.Height() < nCurrentPosY ) { return false; } @@ -830,8 +830,8 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY ) } } - const bool bAutoSize = IsEffectivelyVertical() ? aStatus.AutoPageHeight() : aStatus.AutoPageWidth(); - tools::Long nMaxLineWidth = GetColumnWidth(bAutoSize ? aMaxAutoPaperSize : aPaperSize); + const bool bAutoSize = IsEffectivelyVertical() ? maStatus.AutoPageHeight() : maStatus.AutoPageWidth(); + tools::Long nMaxLineWidth = GetColumnWidth(bAutoSize ? maMaxAutoPaperSize : maPaperSize); nMaxLineWidth -= scaleXSpacingValue(rLRItem.GetRight()); nMaxLineWidth -= nStartX; @@ -839,7 +839,7 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY ) // If PaperSize == long_max, one cannot take away any negative // first line indent. (Overflow) if ( ( nMaxLineWidth < 0 ) && ( nStartX < 0 ) ) - nMaxLineWidth = GetColumnWidth(aPaperSize) - scaleXSpacingValue(rLRItem.GetRight()); + nMaxLineWidth = GetColumnWidth(maPaperSize) - scaleXSpacingValue(rLRItem.GetRight()); // If still less than 0, it may be just the right edge. if ( nMaxLineWidth <= 0 ) @@ -1011,11 +1011,11 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY ) // Search for Tab-Pos... tools::Long nCurPos = nTmpWidth + nStartX; // consider scaling - if (aStatus.DoStretch() && (mfFontScaleX != 100.0)) + if (maStatus.DoStretch() && (mfFontScaleX != 100.0)) nCurPos = basegfx::fround(double(nCurPos) * 100.0 / std::max(mfFontScaleX, 1.0)); short nAllSpaceBeforeText = static_cast< short >(rLRItem.GetTextLeft()/* + rLRItem.GetTextLeft()*/ + nSpaceBeforeAndMinLabelWidth); - aCurrentTab.aTabStop = pNode->GetContentAttribs().FindTabStop( nCurPos - nAllSpaceBeforeText /*rLRItem.GetTextLeft()*/, aEditDoc.GetDefTab() ); + aCurrentTab.aTabStop = pNode->GetContentAttribs().FindTabStop( nCurPos - nAllSpaceBeforeText /*rLRItem.GetTextLeft()*/, maEditDoc.GetDefTab() ); aCurrentTab.nTabPos = scaleXFontValue(tools::Long(aCurrentTab.aTabStop.GetTabPos() + nAllSpaceBeforeText/*rLRItem.GetTextLeft()*/)); aCurrentTab.bValid = false; @@ -1051,7 +1051,7 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY ) nTmpWidth = aCurrentTab.nTabPos-nStartX; // If this is the first token on the line, - // and nTmpWidth > aPaperSize.Width, => infinite loop! + // and nTmpWidth > maPaperSize.Width, => infinite loop! if ( ( nTmpWidth >= nXWidth ) && ( nTmpPortion == pLine->GetStartPortion() ) ) { // What now? @@ -1166,7 +1166,7 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY ) rArray.insert(rArray.begin()+nPos, pPortion->GetSize().Width()); pPortion->SetKind(PortionKind::FIELD); // If this is the first token on the line, - // and nTmpWidth > aPaperSize.Width, => infinite loop! + // and nTmpWidth > maPaperSize.Width, => infinite loop! if ( ( nTmpWidth >= nXWidth ) && ( nTmpPortion == pLine->GetStartPortion() ) ) { nTmpWidth = nXWidth-1; @@ -1298,7 +1298,7 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY ) nTmpPos = nTmpPos + nPortionLen; nPortionEnd = nTmpPos; nTmpPortion++; - if ( aStatus.OneCharPerLine() ) + if (maStatus.OneCharPerLine()) bEOL = true; } @@ -1310,7 +1310,7 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY ) // this was possibly a portion too far: bool bFixedEnd = false; - if ( aStatus.OneCharPerLine() ) + if (maStatus.OneCharPerLine()) { // State before Portion (apart from nTmpWidth): nTmpPos -= pPortion ? nPortionLen : 0; @@ -1374,7 +1374,7 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY ) pLine->SetEndPortion( pParaPortion->GetTextPortions().Count() - 1 ); } - if ( aStatus.OneCharPerLine() ) + if (maStatus.OneCharPerLine()) { pLine->SetEnd( nPortionEnd ); pLine->SetEndPortion( nTmpPortion-1 ); @@ -1393,7 +1393,7 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY ) else if ( !bEOL && !bContinueLastPortion ) { DBG_ASSERT( pPortion && ((nPortionEnd-nPortionStart) == pPortion->GetLen()), "However, another portion?!" ); - tools::Long nRemainingWidth = !aStatus.IsSingleLine() ? + tools::Long nRemainingWidth = !maStatus.IsSingleLine() ? nMaxLineWidth - nTmpWidth : pLine->GetCharPosArray()[pLine->GetCharPosArray().size() - 1] + 1; bool bCanHyphenate = ( aTmpFont.GetCharSet() != RTL_TEXTENCODING_SYMBOL ); if ( bCompressedChars && pPortion && ( pPortion->GetLen() > 1 ) && pPortion->GetExtraInfos() && pPortion->GetExtraInfos()->bCompressed ) @@ -1458,7 +1458,7 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY ) bSameLineAgain = true; } - if ( !bSameLineAgain && !aStatus.IsOutliner() ) + if (!bSameLineAgain && !maStatus.IsOutliner()) { if ( rLSItem.GetLineSpaceRule() == SvxLineSpaceRule::Min ) { @@ -1534,14 +1534,14 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY ) } } - if ( ( !IsEffectivelyVertical() && aStatus.AutoPageWidth() ) || - ( IsEffectivelyVertical() && aStatus.AutoPageHeight() ) ) + if ( ( !IsEffectivelyVertical() && maStatus.AutoPageWidth() ) || + ( IsEffectivelyVertical() && maStatus.AutoPageHeight() ) ) { // If the row fits within the current paper width, then this width // has to be used for the Alignment. If it does not fit or if it // will change the paper width, it will be formatted again for // Justification! = LEFT anyway. - tools::Long nMaxLineWidthFix = GetColumnWidth(aPaperSize) - scaleXSpacingValue(rLRItem.GetRight()) - nStartX; + tools::Long nMaxLineWidthFix = GetColumnWidth(maPaperSize) - scaleXSpacingValue(rLRItem.GetRight()) - nStartX; if ( aTextSize.Width() < nMaxLineWidthFix ) nMaxLineWidth = nMaxLineWidthFix; } @@ -1698,7 +1698,7 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY ) // Format at least two lines though, in case something detects whether // the text has been wrapped or something similar. if( mbSkipOutsideFormat && nLine > 2 - && !aStatus.AutoPageHeight() && aPaperSize.Height() < nCurrentPosY ) + && !maStatus.AutoPageHeight() && maPaperSize.Height() < nCurrentPosY ) { if ( pLine && ( nIndex >= pNode->Len()) ) nDelFromLine = nLine; @@ -1805,11 +1805,11 @@ void ImpEditEngine::CreateAndInsertEmptyLine( ParaPortion* pParaPortion ) if ( nLineHeight > pTmpLine->GetHeight() ) pTmpLine->SetHeight( nLineHeight ); - if ( !aStatus.IsOutliner() ) + if (!maStatus.IsOutliner()) { sal_Int32 nPara = GetParaPortions().GetPos( pParaPortion ); SvxAdjust eJustification = GetJustification( nPara ); - tools::Long nMaxLineWidth = GetColumnWidth(aPaperSize); + tools::Long nMaxLineWidth = GetColumnWidth(maPaperSize); nMaxLineWidth -= scaleXSpacingValue(rLRItem.GetRight()); if ( nMaxLineWidth < 0 ) nMaxLineWidth = 1; @@ -1821,7 +1821,7 @@ void ImpEditEngine::CreateAndInsertEmptyLine( ParaPortion* pParaPortion ) pTmpLine->SetStartPosX( nStartX ); - if ( !aStatus.IsOutliner() ) + if (!maStatus.IsOutliner()) { if ( rLSItem.GetLineSpaceRule() == SvxLineSpaceRule::Min ) { @@ -1970,7 +1970,7 @@ void ImpEditEngine::ImpBreakLine( ParaPortion* pParaPortion, EditLine* pLine, Te aUserOptions.allowPunctuationOutsideMargin = bAllowPunctuationOutsideMargin; aUserOptions.allowHyphenateEnglish = false; - if (!aStatus.IsSingleLine()) + if (!maStatus.IsSingleLine()) { i18n::LineBreakResults aLBR = _xBI->getLineBreak( pNode->GetString(), nMaxBreakPos, aLocale, nMinBreakPos, aHyphOptions, aUserOptions ); @@ -2799,7 +2799,7 @@ void ImpEditEngine::SetVertical( bool bVertical) if ( IsEffectivelyVertical() != bVertical) { GetEditDoc().SetVertical(bVertical); - bool bUseCharAttribs = bool(aStatus.GetControlWord() & EEControlBits::USECHARATTRIBS); + bool bUseCharAttribs = bool(maStatus.GetControlWord() & EEControlBits::USECHARATTRIBS); GetEditDoc().CreateDefFont( bUseCharAttribs ); if ( IsFormatted() ) { @@ -2814,7 +2814,7 @@ void ImpEditEngine::SetRotation(TextRotation nRotation) if (GetEditDoc().GetRotation() == nRotation) return; // not modified GetEditDoc().SetRotation(nRotation); - bool bUseCharAttribs = bool(aStatus.GetControlWord() & EEControlBits::USECHARATTRIBS); + bool bUseCharAttribs = bool(maStatus.GetControlWord() & EEControlBits::USECHARATTRIBS); GetEditDoc().CreateDefFont( bUseCharAttribs ); if ( IsFormatted() ) { @@ -2913,7 +2913,7 @@ void ImpEditEngine::SeekCursor( ContentNode* pNode, sal_Int32 nPos, SvxFont& rFo /* * Scan through char attributes of pNode */ - if ( aStatus.UseCharAttribs() ) + if (maStatus.UseCharAttribs()) { CharAttribList::AttribsType& rAttribs = pNode->GetCharAttribs().GetAttribs(); size_t nAttr = 0; @@ -2957,12 +2957,12 @@ void ImpEditEngine::SeekCursor( ContentNode* pNode, sal_Int32 nPos, SvxFont& rFo if ( (rFont.GetKerning() != FontKerning::NONE) && IsKernAsianPunctuation() && ( nScriptTypeI18N == i18n::ScriptType::ASIAN ) ) rFont.SetKerning( rFont.GetKerning() | FontKerning::Asian ); - if ( aStatus.DoNotUseColors() ) + if (maStatus.DoNotUseColors()) { rFont.SetColor( /* rColorItem.GetValue() */ COL_BLACK ); } - if ( aStatus.DoStretch() || ( nRelWidth != 100 ) ) + if (maStatus.DoStretch() || ( nRelWidth != 100 )) { // For the current Output device, because otherwise if RefDev=Printer its looks // ugly on the screen! @@ -2981,7 +2981,7 @@ void ImpEditEngine::SeekCursor( ContentNode* pNode, sal_Int32 nPos, SvxFont& rFo Size aRealSz( aMetric.GetFontSize() ); rFont.SetPropr( 100 ); - if ( aStatus.DoStretch() ) + if (maStatus.DoStretch()) { if (mfFontScaleY != 100.0) { @@ -3261,10 +3261,10 @@ Point ImpEditEngine::MoveToNextLine( // Move the point by the requested distance in Y direction adjustYDirectionAware(rMovePos, nLineHeight); // Check if the resulting position has moved beyond the limits, and more columns left. - // The limits are defined by a rectangle starting from aOrigin with width of aPaperSize + // The limits are defined by a rectangle starting from aOrigin with width of maPaperSize // and height of nCurTextHeight Point aOtherCorner = aOrigin; - adjustXDirectionAware(aOtherCorner, getWidthDirectionAware(aPaperSize)); + adjustXDirectionAware(aOtherCorner, getWidthDirectionAware(maPaperSize)); adjustYDirectionAware(aOtherCorner, nCurTextHeight); tools::Long nNeeded = getYOverflowDirectionAware(rMovePos, tools::Rectangle::Normalize(aOrigin, aOtherCorner)); @@ -3282,7 +3282,7 @@ Point ImpEditEngine::MoveToNextLine( // Move the point by the requested distance in Y direction adjustYDirectionAware(rMovePos, nLineHeight); // Move the point by the column+spacing distance in X direction - adjustXDirectionAware(rMovePos, GetColumnWidth(aPaperSize) + mnColumnSpacing); + adjustXDirectionAware(rMovePos, GetColumnWidth(maPaperSize) + mnColumnSpacing); } } @@ -3482,7 +3482,7 @@ void ImpEditEngine::Paint( OutputDevice& rOutDev, tools::Rectangle aClipRect, Po * (U+200B ZERO WIDTH SPACE and U+2060 WORD * JOINER) it is assumed to be not relevant * for MarkUrlFields(). */ - if ( aStatus.MarkNonUrlFields() ) + if (maStatus.MarkNonUrlFields()) { sal_Int32 nTmpIdx; const sal_Int32 nTmpEnd = nTextStart + rTextPortion.GetLen(); @@ -4009,7 +4009,7 @@ void ImpEditEngine::Paint( OutputDevice& rOutDev, tools::Rectangle aClipRect, Po } } - if ( ( nLine != nLastLine ) && !aStatus.IsOutliner() ) + if ((nLine != nLastLine ) && !maStatus.IsOutliner()) { adjustYDirectionAware(aStartPos, nSBL); } @@ -4019,7 +4019,7 @@ void ImpEditEngine::Paint( OutputDevice& rOutDev, tools::Rectangle aClipRect, Po break; } - if ( !aStatus.IsOutliner() ) + if (!maStatus.IsOutliner()) { const SvxULSpaceItem& rULItem = pPortion->GetNode()->GetContentAttribs().GetItem( EE_PARA_ULSPACE ); tools::Long nUL = scaleYSpacingValue(rULItem.GetLower()); @@ -4119,14 +4119,14 @@ void ImpEditEngine::InsertContent( ContentNode* pNode, sal_Int32 nPos ) DBG_ASSERT( pNode, "NULL-Pointer in InsertContent! " ); DBG_ASSERT( IsInUndo(), "InsertContent only for Undo()!" ); GetParaPortions().Insert(nPos, std::make_unique<ParaPortion>( pNode )); - aEditDoc.Insert(nPos, pNode); + maEditDoc.Insert(nPos, pNode); if ( IsCallParaInsertedOrDeleted() ) GetEditEnginePtr()->ParagraphInserted( nPos ); } EditPaM ImpEditEngine::SplitContent( sal_Int32 nNode, sal_Int32 nSepPos ) { - ContentNode* pNode = aEditDoc.GetObject( nNode ); + ContentNode* pNode = maEditDoc.GetObject( nNode ); DBG_ASSERT( pNode, "Invalid Node in SplitContent" ); DBG_ASSERT( IsInUndo(), "SplitContent only for Undo()!" ); DBG_ASSERT( nSepPos <= pNode->Len(), "Index out of range: SplitContent" ); @@ -4136,8 +4136,8 @@ EditPaM ImpEditEngine::SplitContent( sal_Int32 nNode, sal_Int32 nSepPos ) EditPaM ImpEditEngine::ConnectContents( sal_Int32 nLeftNode, bool bBackward ) { - ContentNode* pLeftNode = aEditDoc.GetObject( nLeftNode ); - ContentNode* pRightNode = aEditDoc.GetObject( nLeftNode+1 ); + ContentNode* pLeftNode = maEditDoc.GetObject( nLeftNode ); + ContentNode* pRightNode = maEditDoc.GetObject( nLeftNode+1 ); DBG_ASSERT( pLeftNode, "Invalid left node in ConnectContents "); DBG_ASSERT( pRightNode, "Invalid right node in ConnectContents "); return ImpConnectParagraphs( pLeftNode, pRightNode, bBackward ); @@ -4145,8 +4145,8 @@ EditPaM ImpEditEngine::ConnectContents( sal_Int32 nLeftNode, bool bBackward ) bool ImpEditEngine::SetUpdateLayout( bool bUp, EditView* pCurView, bool bForceUpdate ) { - const bool bPrevUpdateLayout = bUpdateLayout; - const bool bChanged = (bUpdateLayout != bUp); + const bool bPrevUpdateLayout = mbUpdateLayout; + const bool mbChanged = (mbUpdateLayout != bUp); // When switching from true to false, all selections were visible, // => paint over @@ -4154,8 +4154,8 @@ bool ImpEditEngine::SetUpdateLayout( bool bUp, EditView* pCurView, bool bForceUp // If !bFormatted, e.g. after SetText, then if UpdateMode=true // formatting is not needed immediately, probably because more text is coming. // At latest it is formatted at a Paint/CalcTextWidth. - bUpdateLayout = bUp; - if ( bUpdateLayout && ( bChanged || bForceUpdate ) ) + mbUpdateLayout = bUp; + if ( mbUpdateLayout && ( mbChanged || bForceUpdate ) ) FormatAndLayout( pCurView ); return bPrevUpdateLayout; } @@ -4236,7 +4236,7 @@ EditSelection ImpEditEngine::MoveParagraphs( Range aOldPositions, sal_Int32 nNew { aInvalidRect = tools::Rectangle(); // make empty aInvalidRect.SetLeft( 0 ); - aInvalidRect.SetRight(GetColumnWidth(aPaperSize)); + aInvalidRect.SetRight(GetColumnWidth(maPaperSize)); aInvalidRect.SetTop( GetParaPortions().GetYOffset( pUpperPortion ) ); aInvalidRect.SetBottom( GetParaPortions().GetYOffset( pLowerPortion ) + pLowerPortion->GetHeight() ); @@ -4277,12 +4277,12 @@ IMPL_LINK_NOARG(ImpEditEngine, StatusTimerHdl, Timer *, void) void ImpEditEngine::CallStatusHdl() { - if ( aStatusHdlLink.IsSet() && bool(aStatus.GetStatusWord()) ) + if ( aStatusHdlLink.IsSet() && bool(maStatus.GetStatusWord()) ) { // The Status has to be reset before the Call, // since other Flags might be set in the handler... - EditStatus aTmpStatus( aStatus ); - aStatus.Clear(); + EditStatus aTmpStatus( maStatus ); + maStatus.Clear(); aStatusHdlLink.Call( aTmpStatus ); aStatusTimer.Stop(); // If called by hand... } @@ -4366,7 +4366,7 @@ tools::Long ImpEditEngine::CalcVertLineSpacing(Point& rStartPos) const } } - tools::Long nTotalSpace = getHeightDirectionAware(aPaperSize); + tools::Long nTotalSpace = getHeightDirectionAware(maPaperSize); nTotalSpace -= nTotalOccupiedHeight; if (nTotalSpace <= 0 || nTotalLineCount <= 1) return 0; @@ -4411,8 +4411,8 @@ std::optional<EditSelection> ImpEditEngine::SelectParagraph( sal_Int32 nPara ) void ImpEditEngine::FormatAndLayout( EditView* pCurView, bool bCalledFromUndo ) { - if ( bDowning ) - return ; + if (mbDowning) + return; if ( IsInUndo() ) IdleFormatAndLayout( pCurView ); @@ -4432,15 +4432,15 @@ void ImpEditEngine::FormatAndLayout( EditView* pCurView, bool bCalledFromUndo ) void ImpEditEngine::SetFlatMode( bool bFlat ) { - if ( bFlat != aStatus.UseCharAttribs() ) + if ( bFlat != maStatus.UseCharAttribs() ) return; if ( !bFlat ) - aStatus.TurnOnFlags( EEControlBits::USECHARATTRIBS ); + maStatus.TurnOnFlags( EEControlBits::USECHARATTRIBS ); else - aStatus.TurnOffFlags( EEControlBits::USECHARATTRIBS ); + maStatus.TurnOffFlags( EEControlBits::USECHARATTRIBS ); - aEditDoc.CreateDefFont( !bFlat ); + maEditDoc.CreateDefFont( !bFlat ); FormatFullDoc(); UpdateViews(); @@ -4471,7 +4471,7 @@ void ImpEditEngine::setScale(double fFontScaleX, double fFontScaleY, double fSpa mfSpacingScaleY = fSpacingScaleX; } - if (bChanged && aStatus.DoStretch()) + if (bChanged && maStatus.DoStretch()) { FormatFullDoc(); // (potentially) need everything redrawn @@ -4533,7 +4533,7 @@ sal_Int32 ImpEditEngine::GetSpaceBeforeAndMinLabelWidth( const SvxLRSpaceItem& ImpEditEngine::GetLRSpaceItem( ContentNode* pNode ) { - return pNode->GetContentAttribs().GetItem( aStatus.IsOutliner() ? EE_PARA_OUTLLRSPACE : EE_PARA_LRSPACE ); + return pNode->GetContentAttribs().GetItem( maStatus.IsOutliner() ? EE_PARA_OUTLLRSPACE : EE_PARA_LRSPACE ); } // select a representative text language for the digit type according to the diff --git a/editeng/source/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx index 995d713c304b..d6e31e7ec57e 100644 --- a/editeng/source/editeng/impedit4.cxx +++ b/editeng/source/editeng/impedit4.cxx @@ -141,7 +141,7 @@ EditPaM ImpEditEngine::ReadRTF( SvStream& rInput, EditSelection aSel ) // The SvRTF parser expects the Which-mapping passed on in the pool, not // dependent on a secondary. - SfxItemPool* pPool = &aEditDoc.GetItemPool(); + SfxItemPool* pPool = &maEditDoc.GetItemPool(); while (pPool->GetSecondaryPool() && pPool->GetName() != "EditEngineItemPool") { pPool = pPool->GetSecondaryPool(); @@ -203,20 +203,20 @@ ErrCode ImpEditEngine::WriteText( SvStream& rOutput, EditSelection aSel ) bool bRange = aSel.HasRange(); if ( bRange ) { - aSel.Adjust( aEditDoc ); - nStartNode = aEditDoc.GetPos( aSel.Min().GetNode() ); - nEndNode = aEditDoc.GetPos( aSel.Max().GetNode() ); + aSel.Adjust( maEditDoc ); + nStartNode = maEditDoc.GetPos( aSel.Min().GetNode() ); + nEndNode = maEditDoc.GetPos( aSel.Max().GetNode() ); } else { nStartNode = 0; - nEndNode = aEditDoc.Count()-1; + nEndNode = maEditDoc.Count()-1; } // iterate over the paragraphs ... for ( sal_Int32 nNode = nStartNode; nNode <= nEndNode; nNode++ ) { - ContentNode* pNode = aEditDoc.GetObject( nNode ); + ContentNode* pNode = maEditDoc.GetObject( nNode ); DBG_ASSERT( pNode, "Node not found: Search&Replace" ); sal_Int32 nStartPos = 0; @@ -279,10 +279,10 @@ ErrCode ImpEditEngine::WriteRTF( SvStream& rOutput, EditSelection aSel ) FormatDoc(); sal_Int32 nStartNode, nEndNode; - aSel.Adjust( aEditDoc ); + aSel.Adjust( maEditDoc ); - nStartNode = aEditDoc.GetPos( aSel.Min().GetNode() ); - nEndNode = aEditDoc.GetPos( aSel.Max().GetNode() ); + nStartNode = maEditDoc.GetPos( aSel.Min().GetNode() ); + nEndNode = maEditDoc.GetPos( aSel.Max().GetNode() ); // RTF header ... rOutput.WriteChar( '{' ) ; @@ -295,9 +295,9 @@ ErrCode ImpEditEngine::WriteRTF( SvStream& rOutput, EditSelection aSel ) // Generate and write out Font table ... std::vector<std::unique_ptr<SvxFontItem>> aFontTable; // default font must be up front, so DEF font in RTF - aFontTable.emplace_back( new SvxFontItem( aEditDoc.GetItemPool().GetDefaultItem( EE_CHAR_FONTINFO ) ) ); - aFontTable.emplace_back( new SvxFontItem( aEditDoc.GetItemPool().GetDefaultItem( EE_CHAR_FONTINFO_CJK ) ) ); - aFontTable.emplace_back( new SvxFontItem( aEditDoc.GetItemPool().GetDefaultItem( EE_CHAR_FONTINFO_CTL ) ) ); + aFontTable.emplace_back( new SvxFontItem( maEditDoc.GetItemPool().GetDefaultItem( EE_CHAR_FONTINFO ) ) ); + aFontTable.emplace_back( new SvxFontItem( maEditDoc.GetItemPool().GetDefaultItem( EE_CHAR_FONTINFO_CJK ) ) ); + aFontTable.emplace_back( new SvxFontItem( maEditDoc.GetItemPool().GetDefaultItem( EE_CHAR_FONTINFO_CTL ) ) ); for ( sal_uInt16 nScriptType = 0; nScriptType < 3; nScriptType++ ) { sal_uInt16 nWhich = EE_CHAR_FONTINFO; @@ -306,7 +306,7 @@ ErrCode ImpEditEngine::WriteRTF( SvStream& rOutput, EditSelection aSel ) else if ( nScriptType == 2 ) nWhich = EE_CHAR_FONTINFO_CTL; - for (const SfxPoolItem* pItem : aEditDoc.GetItemPool().GetItemSurrogates(nWhich)) + for (const SfxPoolItem* pItem : maEditDoc.GetItemPool().GetItemSurrogates(nWhich)) { SvxFontItem const*const pFontItem = static_cast<const SvxFontItem*>(pItem); bool bAlreadyExist = false; @@ -385,12 +385,12 @@ ErrCode ImpEditEngine::WriteRTF( SvStream& rOutput, EditSelection aSel ) SvxColorList aColorList; // COL_AUTO should be the default color, always put it first aColorList.emplace_back(COL_AUTO); - SvxColorItem const& rDefault(aEditDoc.GetItemPool().GetDefaultItem(EE_CHAR_COLOR)); + SvxColorItem const& rDefault(maEditDoc.GetItemPool().GetDefaultItem(EE_CHAR_COLOR)); if (rDefault.GetValue() != COL_AUTO) // is the default always AUTO? { aColorList.push_back(rDefault.GetValue()); } - for (const SfxPoolItem* pItem : aEditDoc.GetItemPool().GetItemSurrogates(EE_CHAR_COLOR)) + for (const SfxPoolItem* pItem : maEditDoc.GetItemPool().GetItemSurrogates(EE_CHAR_COLOR)) { auto pColorItem(dynamic_cast<SvxColorItem const*>(pItem)); if (pColorItem && pColorItem->GetValue() != COL_AUTO) // may be null! @@ -493,7 +493,7 @@ ErrCode ImpEditEngine::WriteRTF( SvStream& rOutput, EditSelection aSel ) rOutput.WriteChar( '{' ).WriteOString( OOO_STRING_SVTOOLS_RTF_IGNORE ).WriteOString( "\\EditEnginePoolDefaults" ); for ( sal_uInt16 nPoolDefItem = EE_PARA_START; nPoolDefItem <= EE_CHAR_END; nPoolDefItem++) { - const SfxPoolItem& rItem = aEditDoc.GetItemPool().GetDefaultItem( nPoolDefItem ); + const SfxPoolItem& rItem = maEditDoc.GetItemPool().GetDefaultItem( nPoolDefItem ); WriteItemAsRTF( rItem, rOutput, 0, 0, aFontTable, aColorList ); } rOutput.WriteChar( '}' ) << endl; @@ -501,7 +501,7 @@ ErrCode ImpEditEngine::WriteRTF( SvStream& rOutput, EditSelection aSel ) // DefTab: MapMode aTwpMode( MapUnit::MapTwip ); sal_uInt16 nDefTabTwps = static_cast<sal_uInt16>(GetRefDevice()->LogicToLogic( - Point( aEditDoc.GetDefTab(), 0 ), + Point( maEditDoc.GetDefTab(), 0 ), &GetRefMapMode(), &aTwpMode ).X()); rOutput.WriteOString( OOO_STRING_SVTOOLS_RTF_DEFTAB ); rOutput.WriteNumberAsString( nDefTabTwps ); @@ -511,7 +511,7 @@ ErrCode ImpEditEngine::WriteRTF( SvStream& rOutput, EditSelection aSel ) rOutput.WriteChar( '{' ) << endl; for ( sal_Int32 nNode = nStartNode; nNode <= nEndNode; nNode++ ) { - ContentNode* pNode = aEditDoc.GetObject( nNode ); + ContentNode* pNode = maEditDoc.GetObject( nNode ); DBG_ASSERT( pNode, "Node not found: Search&Replace" ); // The paragraph attributes in advance ... @@ -924,7 +924,7 @@ void ImpEditEngine::WriteItemAsRTF( const SfxPoolItem& rItem, SvStream& rOutput, case EE_CHAR_ESCAPEMENT: { SvxFont aFont; - ContentNode* pNode = aEditDoc.GetObject( nPara ); + ContentNode* pNode = maEditDoc.GetObject( nPara ); SeekCursor( pNode, nPos, aFont ); MapMode aPntMode( MapUnit::MapPoint ); tools::Long nFontHeight = GetRefDevice()->LogicToLogic( @@ -992,8 +992,8 @@ void ImpEditEngine::WriteItemAsRTF( const SfxPoolItem& rItem, SvStream& rOutput, std::unique_ptr<EditTextObject> ImpEditEngine::GetEmptyTextObject() { EditSelection aEmptySel; - aEmptySel.Min() = aEditDoc.GetStartPaM(); - aEmptySel.Max() = aEditDoc.GetStartPaM(); + aEmptySel.Min() = maEditDoc.GetStartPaM(); + aEmptySel.Max() = maEditDoc.GetStartPaM(); return CreateTextObject( aEmptySel ); } @@ -1001,15 +1001,15 @@ std::unique_ptr<EditTextObject> ImpEditEngine::GetEmptyTextObject() std::unique_ptr<EditTextObject> ImpEditEngine::CreateTextObject() { EditSelection aCompleteSelection; - aCompleteSelection.Min() = aEditDoc.GetStartPaM(); - aCompleteSelection.Max() = aEditDoc.GetEndPaM(); + aCompleteSelection.Min() = maEditDoc.GetStartPaM(); + aCompleteSelection.Max() = maEditDoc.GetEndPaM(); return CreateTextObject( aCompleteSelection ); } std::unique_ptr<EditTextObject> ImpEditEngine::CreateTextObject(const EditSelection& rSel) { - return CreateTextObject(rSel, GetEditTextObjectPool(), aStatus.AllowBigObjects(), nBigTextObjectStart); + return CreateTextObject(rSel, GetEditTextObjectPool(), maStatus.AllowBigObjects(), mnBigTextObjectStart); } std::unique_ptr<EditTextObject> ImpEditEngine::CreateTextObject( EditSelection aSel, SfxItemPool* pPool, bool bAllowBigObjects, sal_Int32 nBigObjectStart ) @@ -1017,9 +1017,9 @@ std::unique_ptr<EditTextObject> ImpEditEngine::CreateTextObject( EditSelection a sal_Int32 nStartNode, nEndNode; sal_Int32 nTextPortions = 0; - aSel.Adjust( aEditDoc ); - nStartNode = aEditDoc.GetPos( aSel.Min().GetNode() ); - nEndNode = aEditDoc.GetPos( aSel.Max().GetNode() ); + aSel.Adjust( maEditDoc ); + nStartNode = maEditDoc.GetPos( aSel.Min().GetNode() ); + nEndNode = maEditDoc.GetPos( aSel.Max().GetNode() ); bool bOnlyFullParagraphs = !( aSel.Min().GetIndex() || ( aSel.Max().GetIndex() < aSel.Max().GetNode()->Len() ) ); @@ -1027,7 +1027,7 @@ std::unique_ptr<EditTextObject> ImpEditEngine::CreateTextObject( EditSelection a // Templates are not saved! // (Only the name and family, template itself must be in App!) - const MapUnit eMapUnit = aEditDoc.GetItemPool().GetMetric(DEF_METRIC); + const MapUnit eMapUnit = maEditDoc.GetItemPool().GetMetric(DEF_METRIC); auto pTxtObj(std::make_unique<EditTextObjectImpl>(pPool, eMapUnit, GetVertical(), GetRotation(), GetItemScriptType(aSel))); @@ -1035,7 +1035,7 @@ std::unique_ptr<EditTextObject> ImpEditEngine::CreateTextObject( EditSelection a sal_Int32 nNode; for ( nNode = nStartNode; nNode <= nEndNode; nNode++ ) { - ContentNode* pNode = aEditDoc.GetObject( nNode ); + ContentNode* pNode = maEditDoc.GetObject( nNode ); DBG_ASSERT( pNode, "Node not found: Search&Replace" ); if ( bOnlyFullParagraphs ) @@ -1114,7 +1114,7 @@ std::unique_ptr<EditTextObject> ImpEditEngine::CreateTextObject( EditSelection a // sleeper set up when Olli paragraphs not hacked! if ( bAllowBigObjects && bOnlyFullParagraphs && IsFormatted() && IsUpdateLayout() && ( nTextPortions >= nBigObjectStart ) ) { - XParaPortionList* pXList = new XParaPortionList(GetRefDevice(), GetColumnWidth(aPaperSize), mfFontScaleX, mfFontScaleY, mfSpacingScaleX, mfSpacingScaleY); + XParaPortionList* pXList = new XParaPortionList(GetRefDevice(), GetColumnWidth(maPaperSize), mfFontScaleX, mfFontScaleY, mfSpacingScaleX, mfSpacingScaleY); pTxtObj->SetPortionInfo(std::unique_ptr<XParaPortionList>(pXList)); for ( nNode = nStartNode; nNode <= nEndNode; nNode++ ) { @@ -1165,7 +1165,7 @@ void ImpEditEngine::SetText( const EditTextObject& rTextObject ) bool _bUndo = IsUndoEnabled(); SetText( OUString() ); - EditPaM aPaM = aEditDoc.GetStartPaM(); + EditPaM aPaM = maEditDoc.GetStartPaM(); SetUpdateLayout( false ); EnableUndo( false ); @@ -1181,7 +1181,7 @@ void ImpEditEngine::SetText( const EditTextObject& rTextObject ) EditSelection ImpEditEngine::InsertText( const EditTextObject& rTextObject, EditSelection aSel ) { - aSel.Adjust( aEditDoc ); + aSel.Adjust( maEditDoc ); if ( aSel.HasRange() ) aSel = ImpDeleteSelection( aSel ); EditSelection aNewSel = InsertTextObject( rTextObject, aSel.Max() ); @@ -1192,13 +1192,13 @@ EditSelection ImpEditEngine::InsertTextObject( const EditTextObject& rTextObject { // Optimize: No getPos undFindParaportion, instead calculate index! EditSelection aSel( aPaM, aPaM ); - DBG_ASSERT( !aSel.DbgIsBuggy( aEditDoc ), "InsertBibTextObject: Selection broken!(1)" ); + DBG_ASSERT( !aSel.DbgIsBuggy( maEditDoc ), "InsertBibTextObject: Selection broken!(1)" ); bool bUsePortionInfo = false; const EditTextObjectImpl& rTextObjectImpl = toImpl(rTextObject); XParaPortionList* pPortionInfo = rTextObjectImpl.GetPortionInfo(); - if ( pPortionInfo && ( static_cast<tools::Long>(pPortionInfo->GetPaperWidth()) == GetColumnWidth(aPaperSize) ) + if (pPortionInfo && ( static_cast<tools::Long>(pPortionInfo->GetPaperWidth()) == GetColumnWidth(maPaperSize)) && pPortionInfo->GetRefMapMode() == GetRefDevice()->GetMapMode() && pPortionInfo->getFontScaleX() == mfFontScaleX && pPortionInfo->getFontScaleY() == mfFontScaleY @@ -1215,7 +1215,7 @@ EditSelection ImpEditEngine::InsertTextObject( const EditTextObject& rTextObject if (rTextObjectImpl.HasMetric()) { eSourceUnit = rTextObjectImpl.GetMetric(); - eDestUnit = aEditDoc.GetItemPool().GetMetric( DEF_METRIC ); + eDestUnit = maEditDoc.GetItemPool().GetMetric( DEF_METRIC ); if ( eSourceUnit != eDestUnit ) bConvertMetricOfItems = true; } @@ -1225,7 +1225,7 @@ EditSelection ImpEditEngine::InsertTextObject( const EditTextObject& rTextObject // number paragraphs and is fearlessly incremented. sal_Int32 nContents = static_cast<sal_Int32>(rTextObjectImpl.GetContents().size()); SAL_WARN_IF( nContents < 0, "editeng", "ImpEditEngine::InsertTextObject - contents overflow " << nContents); - sal_Int32 nPara = aEditDoc.GetPos( aPaM.GetNode() ); + sal_Int32 nPara = maEditDoc.GetPos( aPaM.GetNode() ); for (sal_Int32 n = 0; n < nContents; ++n, ++nPara) { @@ -1261,12 +1261,12 @@ EditSelection ImpEditEngine::InsertTextObject( const EditTextObject& rTextObject DBG_ASSERT( rX.GetEnd() <= aPaM.GetNode()->Len(), "InsertBinTextObject: Attribute too large!" ); EditCharAttrib* pAttr; if ( !bConvertMetricOfItems ) - pAttr = MakeCharAttrib( aEditDoc.GetItemPool(), *(rX.GetItem()), rX.GetStart()+nStartPos, rX.GetEnd()+nStartPos ); + pAttr = MakeCharAttrib( maEditDoc.GetItemPool(), *(rX.GetItem()), rX.GetStart()+nStartPos, rX.GetEnd()+nStartPos ); else { std::unique_ptr<SfxPoolItem> pNew(rX.GetItem()->Clone()); ConvertItem( pNew, eSourceUnit, eDestUnit ); - pAttr = MakeCharAttrib( aEditDoc.GetItemPool(), *pNew, rX.GetStart()+nStartPos, rX.GetEnd()+nStartPos ); + pAttr = MakeCharAttrib( maEditDoc.GetItemPool(), *pNew, rX.GetStart()+nStartPos, rX.GetEnd()+nStartPos ); } DBG_ASSERT( pAttr->GetEnd() <= aPaM.GetNode()->Len(), "InsertBinTextObject: Attribute does not fit! (1)" ); aPaM.GetNode()->GetCharAttribs().InsertAttrib( pAttr ); @@ -1277,7 +1277,7 @@ EditSelection ImpEditEngine::InsertTextObject( const EditTextObject& rTextObject { DBG_ASSERT( rX.GetEnd()+nStartPos <= aPaM.GetNode()->Len(), "InsertBinTextObject: Attribute does not fit! (2)" ); // Tabs and other Features can not be inserted through InsertAttrib: - aEditDoc.InsertAttrib( aPaM.GetNode(), rX.GetStart()+nStartPos, rX.GetEnd()+nStartPos, *rX.GetItem() ); + maEditDoc.InsertAttrib( aPaM.GetNode(), rX.GetStart()+nStartPos, rX.GetEnd()+nStartPos, *rX.GetItem() ); } } } @@ -1305,12 +1305,12 @@ EditSelection ImpEditEngine::InsertTextObject( const EditTextObject& rTextObject SetStyleSheet( nPara, pStyle ); } if ( !bConvertMetricOfItems ) - SetParaAttribs( aEditDoc.GetPos( aPaM.GetNode() ), pC->GetParaAttribs() ); + SetParaAttribs( maEditDoc.GetPos( aPaM.GetNode() ), pC->GetParaAttribs() ); else { SfxItemSet aAttribs( GetEmptyItemSet() ); ConvertAndPutItems( aAttribs, pC->GetParaAttribs(), &eSourceUnit, &eDestUnit ); - SetParaAttribs( aEditDoc.GetPos( aPaM.GetNode() ), aAttribs ); + SetParaAttribs( maEditDoc.GetPos( aPaM.GetNode() ), aAttribs ); } if ( bNewContent && bUsePortionInfo ) { @@ -1355,8 +1355,8 @@ EditSelection ImpEditEngine::InsertTextObject( const EditTextObject& rTextObject } if ( !bParaAttribs ) // DefFont is not calculated for FastInsertParagraph { - aPaM.GetNode()->GetCharAttribs().GetDefFont() = aEditDoc.GetDefFont(); - if ( aStatus.UseCharAttribs() ) + aPaM.GetNode()->GetCharAttribs().GetDefFont() = maEditDoc.GetDefFont(); + if (maStatus.UseCharAttribs()) aPaM.GetNode()->CreateDefFont(); } @@ -1376,7 +1376,7 @@ EditSelection ImpEditEngine::InsertTextObject( const EditTextObject& rTextObject } aSel.Max() = aPaM; - DBG_ASSERT( !aSel.DbgIsBuggy( aEditDoc ), "InsertBibTextObject: Selection broken!(1)" ); + DBG_ASSERT( !aSel.DbgIsBuggy( maEditDoc ), "InsertBibTextObject: Selection broken!(1)" ); return aSel; } @@ -1478,7 +1478,7 @@ EESpellState ImpEditEngine::Spell(EditView* pEditView, weld::Widget* pDialogPare // In MultipleDoc always from the front / rear ... if ( bMultipleDoc ) { - pEditView->pImpEditView->SetEditSelection( aEditDoc.GetStartPaM() ); + pEditView->pImpEditView->SetEditSelection( maEditDoc.GetStartPaM() ); } EditSelection aCurSel( pEditView->pImpEditView->GetEditSelection() ); @@ -1487,7 +1487,7 @@ EESpellState ImpEditEngine::Spell(EditView* pEditView, weld::Widget* pDialogPare bool bIsStart = false; if ( bMultipleDoc ) bIsStart = true; // Accessible from the front or from behind ... - else if ( CreateEPaM( aEditDoc.GetStartPaM() ) == pSpellInfo->aSpellStart ) + else if ( CreateEPaM( maEditDoc.GetStartPaM() ) == pSpellInfo->aSpellStart ) bIsStart = true; { @@ -1553,12 +1553,12 @@ void ImpEditEngine::Convert( EditView* pEditView, weld::Widget* pDialogParent, // In MultipleDoc always from the front / rear ... if ( bMultipleDoc ) - pEditView->pImpEditView->SetEditSelection( aEditDoc.GetStartPaM() ); ... etc. - the rest is truncated