diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2024-01-01 14:31:13 +0900 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2024-01-02 04:12:32 +0100 |
commit | de385412949e2ca52c999546677744ed070d189c (patch) | |
tree | c2300c55afbeb23783d7ffcdba0d6f20427534f1 /editeng | |
parent | 92a9fa82f412daa4e5ccb5889076a1267648e0c1 (diff) |
editeng: prefix members of ImpEditEngine
Change-Id: I05a738be8956ebaa2912c6c8a20a05002d67b789
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161529
Tested-by: Tomaž Vajngerl <quikee@gmail.com>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/editeng/editeng.cxx | 84 | ||||
-rw-r--r-- | editeng/source/editeng/impedit.hxx | 153 | ||||
-rw-r--r-- | editeng/source/editeng/impedit2.cxx | 182 | ||||
-rw-r--r-- | editeng/source/editeng/impedit3.cxx | 114 | ||||
-rw-r--r-- | editeng/source/editeng/impedit4.cxx | 199 | ||||
-rw-r--r-- | editeng/source/editeng/impedit5.cxx | 20 |
6 files changed, 374 insertions, 378 deletions
diff --git a/editeng/source/editeng/editeng.cxx b/editeng/source/editeng/editeng.cxx index c5db1b5ca9ab..7af59f499e12 100644 --- a/editeng/source/editeng/editeng.cxx +++ b/editeng/source/editeng/editeng.cxx @@ -393,7 +393,7 @@ void EditEngine::SetPaperSize( const Size& rNewSize ) if ( !(bAutoPageSize || ( aNewSize.Width() != aOldSize.Width() )) ) return; - for (EditView* pView : pImpEditEngine->aEditViews) + for (EditView* pView : pImpEditEngine->maEditViews) { if ( bAutoPageSize ) pView->pImpEditView->RecalcOutputArea(); @@ -414,7 +414,7 @@ void EditEngine::SetPaperSize( const Size& rNewSize ) pImpEditEngine->UpdateViews( pImpEditEngine->GetActiveView() ); if ( pImpEditEngine->IsUpdateLayout() && pImpEditEngine->GetActiveView() ) - pImpEditEngine->pActiveView->ShowCursor( false, false ); + pImpEditEngine->mpActiveView->ShowCursor( false, false ); } } @@ -685,7 +685,7 @@ void EditEngine::CheckIdleFormatter() bool EditEngine::IsIdleFormatterActive() const { - return pImpEditEngine->aIdleFormatter.IsActive(); + return pImpEditEngine->maIdleFormatter.IsActive(); } ParaPortion* EditEngine::FindParaPortion(ContentNode const * pNode) @@ -725,7 +725,7 @@ bool EditEngine::IsCallParaInsertedOrDeleted() const void EditEngine::AppendDeletedNodeInfo(DeletedNodeInfo* pInfo) { - pImpEditEngine->aDeletedNodes.push_back(std::unique_ptr<DeletedNodeInfo>(pInfo)); + pImpEditEngine->maDeletedNodes.push_back(std::unique_ptr<DeletedNodeInfo>(pInfo)); } void EditEngine::UpdateSelections() @@ -969,12 +969,12 @@ EditPaM EditEngine::DeleteSelected(const EditSelection& rSel) void EditEngine::HandleBeginPasteOrDrop(PasteOrDropInfos& rInfos) { - pImpEditEngine->aBeginPasteOrDropHdl.Call(rInfos); + pImpEditEngine->maBeginPasteOrDropHdl.Call(rInfos); } void EditEngine::HandleEndPasteOrDrop(PasteOrDropInfos& rInfos) { - pImpEditEngine->aEndPasteOrDropHdl.Call(rInfos); + pImpEditEngine->maEndPasteOrDropHdl.Call(rInfos); } bool EditEngine::HasText() const @@ -984,7 +984,7 @@ bool EditEngine::HasText() const const EditSelectionEngine& EditEngine::GetSelectionEngine() const { - return pImpEditEngine->aSelEngine; + return pImpEditEngine->maSelEngine; } void EditEngine::SetInSelectionMode(bool b) @@ -1049,7 +1049,7 @@ bool EditEngine::PostKeyEvent( const KeyEvent& rKeyEvent, EditView* pEditView, v sal_Int32 nParas = GetParagraphCount(); Point aPos; Point aViewStart( pEditView->GetOutputArea().TopLeft() ); - tools::Long n20 = 40 * pImpEditEngine->nOnePixelInRef; + tools::Long n20 = 40 * pImpEditEngine->mnOnePixelInRef; for ( sal_Int32 n = 0; n < nParas; n++ ) { tools::Long nH = GetTextHeight( n ); @@ -1316,7 +1316,7 @@ bool EditEngine::PostKeyEvent( const KeyEvent& rKeyEvent, EditView* pEditView, v // Only at end of word... sal_Int32 nIndex = aCurSel.Max().GetIndex(); if ( ( nIndex >= aCurSel.Max().GetNode()->Len() ) || - ( pImpEditEngine->aWordDelimiters.indexOf( aCurSel.Max().GetNode()->GetChar( nIndex ) ) != -1 ) ) + ( pImpEditEngine->maWordDelimiters.indexOf( aCurSel.Max().GetNode()->GetChar( nIndex ) ) != -1 ) ) { EditPaM aStart( pImpEditEngine->WordLeft( aCurSel.Max() ) ); OUString aWord = pImpEditEngine->GetSelected( EditSelection( aStart, aCurSel.Max() ) ); @@ -1327,18 +1327,18 @@ bool EditEngine::PostKeyEvent( const KeyEvent& rKeyEvent, EditView* pEditView, v LanguageType eLang = pImpEditEngine->GetLanguage( EditPaM( aStart.GetNode(), aStart.GetIndex()+1)).nLang; LanguageTag aLanguageTag( eLang); - if (!pImpEditEngine->xLocaleDataWrapper.isInitialized()) - pImpEditEngine->xLocaleDataWrapper.init( SvtSysLocale().GetLocaleData().getComponentContext(), aLanguageTag); + if (!pImpEditEngine->mxLocaleDataWrapper.isInitialized()) + pImpEditEngine->mxLocaleDataWrapper.init( SvtSysLocale().GetLocaleData().getComponentContext(), aLanguageTag); else - pImpEditEngine->xLocaleDataWrapper.changeLocale( aLanguageTag); + pImpEditEngine->mxLocaleDataWrapper.changeLocale( aLanguageTag); - if (!pImpEditEngine->xTransliterationWrapper.isInitialized()) - pImpEditEngine->xTransliterationWrapper.init( SvtSysLocale().GetLocaleData().getComponentContext(), eLang); + if (!pImpEditEngine->mxTransliterationWrapper.isInitialized()) + pImpEditEngine->mxTransliterationWrapper.init( SvtSysLocale().GetLocaleData().getComponentContext(), eLang); else - pImpEditEngine->xTransliterationWrapper.changeLocale( eLang); + pImpEditEngine->mxTransliterationWrapper.changeLocale( eLang); - const ::utl::TransliterationWrapper* pTransliteration = pImpEditEngine->xTransliterationWrapper.get(); - Sequence< i18n::CalendarItem2 > xItem = pImpEditEngine->xLocaleDataWrapper->getDefaultCalendarDays(); + const ::utl::TransliterationWrapper* pTransliteration = pImpEditEngine->mxTransliterationWrapper.get(); + Sequence< i18n::CalendarItem2 > xItem = pImpEditEngine->mxLocaleDataWrapper->getDefaultCalendarDays(); sal_Int32 nCount = xItem.getLength(); const i18n::CalendarItem2* pArr = xItem.getConstArray(); for( sal_Int32 n = 0; n <= nCount; ++n ) @@ -1353,7 +1353,7 @@ bool EditEngine::PostKeyEvent( const KeyEvent& rKeyEvent, EditView* pEditView, v if ( aComplete.isEmpty() ) { - xItem = pImpEditEngine->xLocaleDataWrapper->getDefaultCalendarMonths(); + xItem = pImpEditEngine->mxLocaleDataWrapper->getDefaultCalendarMonths(); sal_Int32 nMonthCount = xItem.getLength(); const i18n::CalendarItem2* pMonthArr = xItem.getConstArray(); for( sal_Int32 n = 0; n <= nMonthCount; ++n ) @@ -1466,10 +1466,10 @@ sal_uInt32 EditEngine::CalcTextWidth() bool EditEngine::SetUpdateLayout(bool bUpdate, bool bRestoring) { bool bPrevUpdateLayout = pImpEditEngine->SetUpdateLayout( bUpdate ); - if (pImpEditEngine->pActiveView) + if (pImpEditEngine->mpActiveView) { // Not an activation if we are restoring the previous update mode. - pImpEditEngine->pActiveView->ShowCursor(false, false, /*bActivate=*/!bRestoring); + pImpEditEngine->mpActiveView->ShowCursor(false, false, /*bActivate=*/!bRestoring); } return bPrevUpdateLayout; } @@ -1559,43 +1559,43 @@ Link<EditStatus&, void> const & EditEngine::GetStatusEventHdl() const void EditEngine::SetHtmlImportHdl( const Link<HtmlImportInfo&,void>& rLink ) { - pImpEditEngine->aHtmlImportHdl = rLink; + pImpEditEngine->maHtmlImportHdl = rLink; } const Link<HtmlImportInfo&,void>& EditEngine::GetHtmlImportHdl() const { - return pImpEditEngine->aHtmlImportHdl; + return pImpEditEngine->maHtmlImportHdl; } void EditEngine::SetRtfImportHdl( const Link<RtfImportInfo&,void>& rLink ) { - pImpEditEngine->aRtfImportHdl = rLink; + pImpEditEngine->maRtfImportHdl = rLink; } const Link<RtfImportInfo&,void>& EditEngine::GetRtfImportHdl() const { - return pImpEditEngine->aRtfImportHdl; + return pImpEditEngine->maRtfImportHdl; } void EditEngine::SetBeginMovingParagraphsHdl( const Link<MoveParagraphsInfo&,void>& rLink ) { - pImpEditEngine->aBeginMovingParagraphsHdl = rLink; + pImpEditEngine->maBeginMovingParagraphsHdl = rLink; } void EditEngine::SetEndMovingParagraphsHdl( const Link<MoveParagraphsInfo&,void>& rLink ) { - pImpEditEngine->aEndMovingParagraphsHdl = rLink; + pImpEditEngine->maEndMovingParagraphsHdl = rLink; } void EditEngine::SetBeginPasteOrDropHdl( const Link<PasteOrDropInfos&,void>& rLink ) { - pImpEditEngine->aBeginPasteOrDropHdl = rLink; + pImpEditEngine->maBeginPasteOrDropHdl = rLink; } void EditEngine::SetEndPasteOrDropHdl( const Link<PasteOrDropInfos&,void>& rLink ) { - pImpEditEngine->aEndPasteOrDropHdl = rLink; + pImpEditEngine->maEndPasteOrDropHdl = rLink; } std::unique_ptr<EditTextObject> EditEngine::CreateTextObject( sal_Int32 nPara, sal_Int32 nParas ) @@ -1934,11 +1934,11 @@ void EditEngine::SetControlWord( EEControlBits nWord ) pNode->DestroyWrongList(); if ( bWrongs ) { - pImpEditEngine->aInvalidRect.SetLeft( 0 ); - pImpEditEngine->aInvalidRect.SetRight( pImpEditEngine->GetPaperSize().Width() ); - pImpEditEngine->aInvalidRect.SetTop( nY+1 ); - pImpEditEngine->aInvalidRect.SetBottom( nY+pPortion->GetHeight()-1 ); - pImpEditEngine->UpdateViews( pImpEditEngine->pActiveView ); + pImpEditEngine->maInvalidRect.SetLeft( 0 ); + pImpEditEngine->maInvalidRect.SetRight( pImpEditEngine->GetPaperSize().Width() ); + pImpEditEngine->maInvalidRect.SetTop( nY+1 ); + pImpEditEngine->maInvalidRect.SetBottom( nY+pPortion->GetHeight()-1 ); + pImpEditEngine->UpdateViews(pImpEditEngine->mpActiveView); } nY += pPortion->GetHeight(); } @@ -2162,14 +2162,14 @@ SfxStyleSheetPool* EditEngine::GetStyleSheetPool() void EditEngine::SetWordDelimiters( const OUString& rDelimiters ) { - pImpEditEngine->aWordDelimiters = rDelimiters; - if (pImpEditEngine->aWordDelimiters.indexOf(CH_FEATURE) == -1) - pImpEditEngine->aWordDelimiters += OUStringChar(CH_FEATURE); + pImpEditEngine->maWordDelimiters = rDelimiters; + if (pImpEditEngine->maWordDelimiters.indexOf(CH_FEATURE) == -1) + pImpEditEngine->maWordDelimiters += OUStringChar(CH_FEATURE); } const OUString& EditEngine::GetWordDelimiters() const { - return pImpEditEngine->aWordDelimiters; + return pImpEditEngine->maWordDelimiters; } void EditEngine::EraseVirtualDevice() @@ -2552,7 +2552,7 @@ void EditEngine::ParagraphHeightChanged( sal_Int32 nPara ) pImpEditEngine->GetNotifyHdl().Call( aNotify ); } - for (EditView* pView : pImpEditEngine->aEditViews) + for (EditView* pView : pImpEditEngine->maEditViews) pView->pImpEditView->ScrollStateChange(); } @@ -2834,12 +2834,12 @@ void EditEngine::SetReplaceLeadingSingleQuotationMark( bool bReplace ) bool EditEngine::IsHtmlImportHandlerSet() const { - return pImpEditEngine->aHtmlImportHdl.IsSet(); + return pImpEditEngine->maHtmlImportHdl.IsSet(); } bool EditEngine::IsRtfImportHandlerSet() const { - return pImpEditEngine->aRtfImportHdl.IsSet(); + return pImpEditEngine->maRtfImportHdl.IsSet(); } bool EditEngine::IsImportRTFStyleSheetsSet() const @@ -2849,12 +2849,12 @@ bool EditEngine::IsImportRTFStyleSheetsSet() const void EditEngine::CallHtmlImportHandler(HtmlImportInfo& rInfo) { - pImpEditEngine->aHtmlImportHdl.Call(rInfo); + pImpEditEngine->maHtmlImportHdl.Call(rInfo); } void EditEngine::CallRtfImportHandler(RtfImportInfo& rInfo) { - pImpEditEngine->aRtfImportHdl.Call(rInfo); + pImpEditEngine->maRtfImportHdl.Call(rInfo); } EditPaM EditEngine::InsertParaBreak(const EditSelection& rEditSelection) diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx index ef699b0b28ad..abc9a96c98df 100644 --- a/editeng/source/editeng/impedit.hxx +++ b/editeng/source/editeng/impedit.hxx @@ -528,13 +528,13 @@ private: EditDoc maEditDoc; // Document content // Engine Specific data ... - EditEngine* pEditEngine; - ViewsType aEditViews; - EditView* pActiveView; - std::unique_ptr<TextRanger> pTextRanger; + EditEngine* mpEditEngine; + ViewsType maEditViews; + EditView* mpActiveView; + std::unique_ptr<TextRanger> mpTextRanger; - SfxStyleSheetPool* pStylePool; - SfxItemPool* pTextObjectPool; + SfxStyleSheetPool* mpStylePool; + SfxItemPool* mpTextObjectPool; VclPtr<VirtualDevice> mpVirtDev; VclPtr<OutputDevice> mpRefDev; @@ -543,15 +543,15 @@ private: svtools::ColorConfig maColorConfig; mutable std::unique_ptr<SfxItemSet> pEmptyItemSet; - EditUndoManager* pUndoManager; + EditUndoManager* mpUndoManager; std::optional<ESelection> moUndoMarkSelection; std::unique_ptr<ImplIMEInfos> mpIMEInfos; - OUString aWordDelimiters; + OUString maWordDelimiters; - EditSelFunctionSet aSelFuncSet; - EditSelectionEngine aSelEngine; + EditSelFunctionSet maSelFuncSet; + EditSelectionEngine maSelEngine; Color maBackgroundColor; @@ -563,16 +563,16 @@ private: CharCompressType mnAsianCompressionMode; - EEHorizontalTextDirection eDefaultHorizontalTextDirection; + EEHorizontalTextDirection meDefaultHorizontalTextDirection; sal_Int32 mnBigTextObjectStart; - css::uno::Reference< css::linguistic2::XSpellChecker1 > xSpeller; - css::uno::Reference< css::linguistic2::XHyphenator > xHyphenator; - std::unique_ptr<SpellInfo> pSpellInfo; - mutable css::uno::Reference < css::i18n::XBreakIterator > xBI; - mutable css::uno::Reference < css::i18n::XExtendedInputSequenceChecker > xISC; + css::uno::Reference<css::linguistic2::XSpellChecker1> mxSpeller; + css::uno::Reference<css::linguistic2::XHyphenator> mxHyphenator; + std::unique_ptr<SpellInfo> mpSpellInfo; + mutable css::uno::Reference <css::i18n::XBreakIterator> mxBI; + mutable css::uno::Reference <css::i18n::XExtendedInputSequenceChecker> mxISC; - std::unique_ptr<ConvInfo> pConvInfo; + std::unique_ptr<ConvInfo> mpConvInfo; OUString maAutoCompleteText; @@ -580,19 +580,18 @@ private: LanguageType meDefLanguage; - OnDemandLocaleDataWrapper xLocaleDataWrapper; - OnDemandTransliterationWrapper xTransliterationWrapper; + OnDemandLocaleDataWrapper mxLocaleDataWrapper; + OnDemandTransliterationWrapper mxTransliterationWrapper; // For Formatting / Update... - std::vector<std::unique_ptr<DeletedNodeInfo> > aDeletedNodes; - tools::Rectangle aInvalidRect; - tools::Long nCurTextHeight; - tools::Long nCurTextHeightNTP; // without trailing empty paragraphs - sal_uInt16 nOnePixelInRef; + std::vector<std::unique_ptr<DeletedNodeInfo>> maDeletedNodes; + tools::Rectangle maInvalidRect; + tools::Long mnCurTextHeight; + tools::Long mnCurTextHeightNTP; // without trailing empty paragraphs + sal_uInt16 mnOnePixelInRef; - IdleFormattter aIdleFormatter; - - Timer aOnlineSpellTimer; + IdleFormattter maIdleFormatter; + Timer maOnlineSpellTimer; // For Chaining sal_Int32 mnOverflowingPara = -1; @@ -604,18 +603,18 @@ private: // If it is detected at one point that the StatusHdl has to be called, but // this should not happen immediately (critical section): - Timer aStatusTimer; - Size aLOKSpecialPaperSize; - - Link<EditStatus&,void> aStatusHdlLink; - Link<EENotify&,void> aNotifyHdl; - Link<HtmlImportInfo&,void> aHtmlImportHdl; - Link<RtfImportInfo&,void> aRtfImportHdl; - Link<MoveParagraphsInfo&,void> aBeginMovingParagraphsHdl; - Link<MoveParagraphsInfo&,void> aEndMovingParagraphsHdl; - Link<PasteOrDropInfos&,void> aBeginPasteOrDropHdl; - Link<PasteOrDropInfos&,void> aEndPasteOrDropHdl; - Link<LinkParamNone*,void> aModifyHdl; + Timer maStatusTimer; + Size maLOKSpecialPaperSize; + + Link<EditStatus&,void> maStatusHdlLink; + Link<EENotify&,void> maNotifyHdl; + Link<HtmlImportInfo&,void> maHtmlImportHdl; + Link<RtfImportInfo&,void> maRtfImportHdl; + Link<MoveParagraphsInfo&,void> maBeginMovingParagraphsHdl; + Link<MoveParagraphsInfo&,void> maEndMovingParagraphsHdl; + Link<PasteOrDropInfos&,void> maBeginPasteOrDropHdl; + Link<PasteOrDropInfos&,void> maEndPasteOrDropHdl; + Link<LinkParamNone*,void> maModifyHdl; Link<EditView*,void> maBeginDropHdl; Link<EditView*,void> maEndDropHdl; @@ -648,7 +647,7 @@ private: void InsertUndo( std::unique_ptr<EditUndo> pUndo, bool bTryMerge = false ); void ResetUndoManager(); - bool HasUndoManager() const { return pUndoManager != nullptr; } + bool HasUndoManager() const { return mpUndoManager != nullptr; } std::unique_ptr<EditUndoSetAttribs> CreateAttribUndo( EditSelection aSel, const SfxItemSet& rSet ); @@ -880,7 +879,7 @@ private: tools::Long Calc1ColumnTextHeight(tools::Long* pHeightNTP); - void IdleFormatAndLayout(EditView* pCurView) { aIdleFormatter.DoIdleFormat(pCurView); } + void IdleFormatAndLayout(EditView* pCurView) { maIdleFormatter.DoIdleFormat(pCurView); } protected: virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override; @@ -892,28 +891,28 @@ public: EditUndoManager& GetUndoManager() { - if ( !pUndoManager ) + if (!mpUndoManager) { - pUndoManager = new EditUndoManager(); - pUndoManager->SetEditEngine(pEditEngine); + mpUndoManager = new EditUndoManager(); + mpUndoManager->SetEditEngine(mpEditEngine); } - return *pUndoManager; + return *mpUndoManager; } EditUndoManager* SetUndoManager(EditUndoManager* pNew) { - EditUndoManager* pRetval = pUndoManager; + EditUndoManager* pRetval = mpUndoManager; - if(pUndoManager) + if (mpUndoManager) { - pUndoManager->SetEditEngine(nullptr); + mpUndoManager->SetEditEngine(nullptr); } - pUndoManager = pNew; + mpUndoManager = pNew; - if(pUndoManager) + if (mpUndoManager) { - pUndoManager->SetEditEngine(pEditEngine); + mpUndoManager->SetEditEngine(mpEditEngine); } return pRetval; @@ -923,8 +922,8 @@ public: bool SetUpdateLayout( bool bUpdate, EditView* pCurView = nullptr, bool bForceUpdate = false ); bool IsUpdateLayout() const { return mbUpdateLayout; } - ViewsType& GetEditViews() { return aEditViews; } - const ViewsType& GetEditViews() const { return aEditViews; } + ViewsType& GetEditViews() { return maEditViews; } + const ViewsType& GetEditViews() const { return maEditViews; } const Size& GetPaperSize() const { return maPaperSize; } void SetPaperSize(const Size& rSize) { maPaperSize = rSize; } @@ -943,8 +942,8 @@ public: void SetFixedCellHeight( bool bUseFixedCellHeight ); bool IsFixedCellHeight() const { return GetEditDoc().IsFixedCellHeight(); } - void SetDefaultHorizontalTextDirection( EEHorizontalTextDirection eHTextDir ) { eDefaultHorizontalTextDirection = eHTextDir; } - EEHorizontalTextDirection GetDefaultHorizontalTextDirection() const { return eDefaultHorizontalTextDirection; } + void SetDefaultHorizontalTextDirection( EEHorizontalTextDirection eHTextDir ) { meDefaultHorizontalTextDirection = eHTextDir; } + EEHorizontalTextDirection GetDefaultHorizontalTextDirection() const { return meDefaultHorizontalTextDirection; } void InitWritingDirections( sal_Int32 nPara ); @@ -953,7 +952,7 @@ public: bool HasDifferentRTLLevels( const ContentNode* pNode ); void SetTextRanger( std::unique_ptr<TextRanger> pRanger ); - TextRanger* GetTextRanger() const { return pTextRanger.get(); } + TextRanger* GetTextRanger() const { return mpTextRanger.get(); } const Size& GetMinAutoPaperSize() const { return maMinAutoPaperSize; } void SetMinAutoPaperSize(const Size& rSize) { maMinAutoPaperSize = rSize; } @@ -975,7 +974,7 @@ public: bool MouseMove( const MouseEvent& rMouseEvent, EditView* pView ); bool Command(const CommandEvent& rCEvt, EditView* pView); - EditSelectionEngine& GetSelEngine() { return aSelEngine; } + EditSelectionEngine& GetSelEngine() { return maSelEngine; } OUString GetSelected( const EditSelection& rSel ) const; const SfxItemSet& GetEmptyItemSet() const; @@ -1054,7 +1053,7 @@ public: bool IsModified() const { return maEditDoc.IsModified(); } void SetModifyFlag(bool b) { maEditDoc.SetModified( b ); } - void SetModifyHdl( const Link<LinkParamNone*,void>& rLink ) { aModifyHdl = rLink; } + void SetModifyHdl( const Link<LinkParamNone*,void>& rLink ) { maModifyHdl = rLink; } bool IsInSelectionMode() const { return mbInSelection; } @@ -1067,11 +1066,11 @@ public: EditPaM InsertParagraph( sal_Int32 nPara ); std::optional<EditSelection> SelectParagraph( sal_Int32 nPara ); - void SetStatusEventHdl( const Link<EditStatus&, void>& rLink ) { aStatusHdlLink = rLink; } - const Link<EditStatus&,void>& GetStatusEventHdl() const { return aStatusHdlLink; } + void SetStatusEventHdl( const Link<EditStatus&, void>& rLink ) { maStatusHdlLink = rLink; } + const Link<EditStatus&,void>& GetStatusEventHdl() const { return maStatusHdlLink; } - void SetNotifyHdl( const Link<EENotify&,void>& rLink ) { aNotifyHdl = rLink; } - const Link<EENotify&,void>& GetNotifyHdl() const { return aNotifyHdl; } + void SetNotifyHdl( const Link<EENotify&,void>& rLink ) { maNotifyHdl = rLink; } + const Link<EENotify&,void>& GetNotifyHdl() const { return maNotifyHdl; } void FormatAndLayout( EditView* pCurView = nullptr, bool bCalledFromUndo = false ); @@ -1121,7 +1120,7 @@ public: } void SetStyleSheetPool( SfxStyleSheetPool* pSPool ); - SfxStyleSheetPool* GetStyleSheetPool() const { return pStylePool; } + SfxStyleSheetPool* GetStyleSheetPool() const { return mpStylePool; } void SetStyleSheet( EditSelection aSel, SfxStyleSheet* pStyle ); void SetStyleSheet( sal_Int32 nPara, SfxStyleSheet* pStyle ); @@ -1141,28 +1140,28 @@ public: InternalEditStatus& GetStatus() { return maStatus; } void CallStatusHdl(); - void DelayedCallStatusHdl() { aStatusTimer.Start(); } + void DelayedCallStatusHdl() { maStatusTimer.Start(); } void UndoActionStart( sal_uInt16 nId ); void UndoActionStart( sal_uInt16 nId, const ESelection& rSel ); void UndoActionEnd(); - EditView* GetActiveView() const { return pActiveView; } + EditView* GetActiveView() const { return mpActiveView; } void SetActiveView( EditView* pView ); css::uno::Reference< css::linguistic2::XSpellChecker1 > const & GetSpeller(); void SetSpeller( css::uno::Reference< css::linguistic2::XSpellChecker1 > const &xSpl ) - { xSpeller = xSpl; } + { mxSpeller = xSpl; } const css::uno::Reference< css::linguistic2::XHyphenator >& - GetHyphenator() const { return xHyphenator; } + GetHyphenator() const { return mxHyphenator; } void SetHyphenator( css::uno::Reference< css::linguistic2::XHyphenator > const &xHyph ) - { xHyphenator = xHyph; } + { mxHyphenator = xHyph; } void GetAllMisspellRanges( std::vector<editeng::MisspellRanges>& rRanges ) const; void SetAllMisspellRanges( const std::vector<editeng::MisspellRanges>& rRanges ); - SpellInfo* GetSpellInfo() const { return pSpellInfo.get(); } + SpellInfo* GetSpellInfo() const { return mpSpellInfo.get(); } void SetDefaultLanguage(LanguageType eLang) { meDefLanguage = eLang; } LanguageType GetDefaultLanguage() const { return meDefLanguage; } @@ -1182,7 +1181,7 @@ public: void Convert(EditView* pEditView, weld::Widget* pDialogParent, LanguageType nSrcLang, LanguageType nDestLang, const vcl::Font *pDestFont, sal_Int32 nOptions, bool bIsInteractive, bool bMultipleDoc); void ImpConvert( OUString &rConvTxt, LanguageType &rConvTxtLang, EditView* pEditView, LanguageType nSrcLang, const ESelection &rConvRange, bool bAllowImplicitChangesForNotConvertibleText, LanguageType nTargetLang, const vcl::Font *pTargetFont ); - ConvInfo * GetConvInfo() const { return pConvInfo.get(); } + ConvInfo * GetConvInfo() const { return mpConvInfo.get(); } bool HasConvertibleTextPortion( LanguageType nLang ); void SetLanguageAndFont( const ESelection &rESel, LanguageType nLang, sal_uInt16 nLangWhichId, @@ -1218,8 +1217,8 @@ public: sal_Int32 StartSearchAndReplace( EditView* pEditView, const SvxSearchItem& rSearchItem ); bool HasText( const SvxSearchItem& rSearchItem ); - void SetEditTextObjectPool( SfxItemPool* pP ) { pTextObjectPool = pP; } - SfxItemPool* GetEditTextObjectPool() const { return pTextObjectPool; } + void SetEditTextObjectPool( SfxItemPool* pP ) { mpTextObjectPool = pP; } + SfxItemPool* GetEditTextObjectPool() const { return mpTextObjectPool; } const SvxNumberFormat * GetNumberFormat( const ContentNode* pNode ) const; sal_Int32 GetSpaceBeforeAndMinLabelWidth( const ContentNode *pNode, sal_Int32 *pnSpaceBefore = nullptr, sal_Int32 *pnMinLabelWidth = nullptr ) const; @@ -1245,10 +1244,10 @@ public: sal_Int32 GetBigTextObjectStart() const { return mnBigTextObjectStart; } - EditEngine* GetEditEnginePtr() const { return pEditEngine; } + EditEngine* GetEditEnginePtr() const { return mpEditEngine; } - void StartOnlineSpellTimer() { aOnlineSpellTimer.Start(); } - void StopOnlineSpellTimer() { aOnlineSpellTimer.Stop(); } + void StartOnlineSpellTimer() { maOnlineSpellTimer.Start(); } + void StopOnlineSpellTimer() { maOnlineSpellTimer.Stop(); } const OUString& GetAutoCompleteText() const { return maAutoCompleteText; } void SetAutoCompleteText(const OUString& rStr, bool bUpdateTipWindow); @@ -1296,8 +1295,8 @@ public: void EnableSkipOutsideFormat(bool set) { mbSkipOutsideFormat = set; } void Dispose(); - void SetLOKSpecialPaperSize(const Size& rSize) { aLOKSpecialPaperSize = rSize; } - const Size& GetLOKSpecialPaperSize() const { return aLOKSpecialPaperSize; } + void SetLOKSpecialPaperSize(const Size& rSize) { maLOKSpecialPaperSize = rSize; } + const Size& GetLOKSpecialPaperSize() const { return maLOKSpecialPaperSize; } enum class CallbackResult { diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx index 2b8263cc62cd..78a56dc926bc 100644 --- a/editeng/source/editeng/impedit2.cxx +++ b/editeng/source/editeng/impedit2.cxx @@ -96,12 +96,12 @@ ImpEditEngine::ImpEditEngine( EditEngine* pEE, SfxItemPool* pItemPool ) : maMinAutoPaperSize(0, 0), maMaxAutoPaperSize(constMaxPaperSize, constMaxPaperSize), maEditDoc( pItemPool ), - pEditEngine(pEE), - pActiveView(nullptr), - pStylePool(nullptr), - pTextObjectPool(nullptr), - pUndoManager(nullptr), - aWordDelimiters(" .,;:-`'?!_=\"{}()[]"), + mpEditEngine(pEE), + mpActiveView(nullptr), + mpStylePool(nullptr), + mpTextObjectPool(nullptr), + mpUndoManager(nullptr), + maWordDelimiters(" .,;:-`'?!_=\"{}()[]"), maBackgroundColor(COL_AUTO), mfFontScaleX(100.0), mfFontScaleY(100.0), @@ -109,13 +109,13 @@ ImpEditEngine::ImpEditEngine( EditEngine* pEE, SfxItemPool* pItemPool ) : mfSpacingScaleY(100.0), mbRoundToNearestPt(false), mnAsianCompressionMode(CharCompressType::NONE), - eDefaultHorizontalTextDirection(EEHorizontalTextDirection::Default), + meDefaultHorizontalTextDirection(EEHorizontalTextDirection::Default), mnBigTextObjectStart(20), meDefLanguage(LANGUAGE_DONTKNOW), - nCurTextHeight(0), - nCurTextHeightNTP(0), - aOnlineSpellTimer( "editeng::ImpEditEngine aOnlineSpellTimer" ), - aStatusTimer( "editeng::ImpEditEngine aStatusTimer" ), + mnCurTextHeight(0), + mnCurTextHeightNTP(0), + maOnlineSpellTimer("editeng::ImpEditEngine aOnlineSpellTimer"), + maStatusTimer("editeng::ImpEditEngine aStatusTimer"), mbKernAsianPunctuation(false), mbAddExtLeading(false), mbIsFormatting(false), @@ -140,16 +140,16 @@ ImpEditEngine::ImpEditEngine( EditEngine* pEE, SfxItemPool* pItemPool ) : EEControlBits::ALLOWBIGOBJS | EEControlBits::RTFSTYLESHEETS | EEControlBits::FORMAT100; - aSelEngine.SetFunctionSet( &aSelFuncSet ); + maSelEngine.SetFunctionSet(&maSelFuncSet); - aStatusTimer.SetTimeout( 200 ); - aStatusTimer.SetInvokeHandler( LINK( this, ImpEditEngine, StatusTimerHdl ) ); + maStatusTimer.SetTimeout(200); + maStatusTimer.SetInvokeHandler(LINK(this, ImpEditEngine, StatusTimerHdl)); - aIdleFormatter.SetPriority( TaskPriority::REPAINT ); - aIdleFormatter.SetInvokeHandler( LINK( this, ImpEditEngine, IdleFormatHdl ) ); + maIdleFormatter.SetPriority(TaskPriority::REPAINT); + maIdleFormatter.SetInvokeHandler(LINK(this, ImpEditEngine, IdleFormatHdl)); - aOnlineSpellTimer.SetTimeout( 100 ); - aOnlineSpellTimer.SetInvokeHandler( LINK( this, ImpEditEngine, OnlineSpellHdl ) ); + maOnlineSpellTimer.SetTimeout(100); + maOnlineSpellTimer.SetInvokeHandler(LINK( this, ImpEditEngine, OnlineSpellHdl)); // Access data already from here on! SetRefDevice( nullptr ); @@ -174,9 +174,9 @@ void ImpEditEngine::Dispose() ImpEditEngine::~ImpEditEngine() { - aStatusTimer.Stop(); - aOnlineSpellTimer.Stop(); - aIdleFormatter.Stop(); + maStatusTimer.Stop(); + maOnlineSpellTimer.Stop(); + maIdleFormatter.Stop(); // Destroying templates may otherwise cause unnecessary formatting, // when a parent template is destroyed. @@ -185,14 +185,14 @@ ImpEditEngine::~ImpEditEngine() SetUpdateLayout( false ); Dispose(); - // it's only legal to delete the pUndoManager if it was created by + // it's only legal to delete the mpUndoManager if it was created by // ImpEditEngine; if it was set by SetUndoManager() it must be cleared // before destroying the ImpEditEngine! - assert(!pUndoManager || typeid(*pUndoManager) == typeid(EditUndoManager)); - delete pUndoManager; - pTextRanger.reset(); + assert(!mpUndoManager || typeid(*mpUndoManager) == typeid(EditUndoManager)); + delete mpUndoManager; + mpTextRanger.reset(); mpIMEInfos.reset(); - pSpellInfo.reset(); + mpSpellInfo.reset(); } void ImpEditEngine::SetRefDevice(OutputDevice* pRef) @@ -202,7 +202,7 @@ void ImpEditEngine::SetRefDevice(OutputDevice* pRef) else mpRefDev = pSharedVCL->GetVirtualDevice(); - nOnePixelInRef = static_cast<sal_uInt16>(mpRefDev->PixelToLogic( Size( 1, 0 ) ).Width()); + mnOnePixelInRef = static_cast<sal_uInt16>(mpRefDev->PixelToLogic( Size( 1, 0 ) ).Width()); if ( IsFormatted() ) { @@ -223,7 +223,7 @@ void ImpEditEngine::SetRefMapMode( const MapMode& rMapMode ) SetRefDevice(mpRefDev); mpRefDev->SetMapMode( rMapMode ); - nOnePixelInRef = static_cast<sal_uInt16>(mpRefDev->PixelToLogic(Size(1, 0)).Width()); + mnOnePixelInRef = static_cast<sal_uInt16>(mpRefDev->PixelToLogic(Size(1, 0)).Width()); if ( IsFormatted() ) { FormatFullDoc(); @@ -318,7 +318,7 @@ bool ImpEditEngine::MouseButtonDown( const MouseEvent& rMEvt, EditView* pView ) if ( rMEvt.GetClicks() == 2 ) { // So that the SelectionEngine knows about the anchor. - aSelEngine.CursorPosChanging( true, false ); + maSelEngine.CursorPosChanging( true, false ); EditSelection aNewSelection( SelectWord( aCurSel ) ); pView->pImpEditView->DrawSelectionXOR(); @@ -329,7 +329,7 @@ bool ImpEditEngine::MouseButtonDown( const MouseEvent& rMEvt, EditView* pView ) else if ( rMEvt.GetClicks() == 3 ) { // So that the SelectionEngine knows about the anchor. - aSelEngine.CursorPosChanging( true, false ); + maSelEngine.CursorPosChanging( true, false ); EditSelection aNewSelection( aCurSel ); aNewSelection.Min().SetIndex( 0 ); @@ -536,7 +536,7 @@ bool ImpEditEngine::Command( const CommandEvent& rCEvt, EditView* pView ) if ( aSelection.nStartPara != aSelection.nEndPara ) { - sal_Int32 aParaLen = pEditEngine->GetTextLen( aSelection.nStartPara ); + sal_Int32 aParaLen = mpEditEngine->GetTextLen( aSelection.nStartPara ); aSelection.nEndPara = aSelection.nStartPara; aSelection.nEndPos = aParaLen; pView->SetSelection( aSelection ); @@ -676,14 +676,14 @@ void ImpEditEngine::Clear() EditPaM aPaM = maEditDoc.GetStartPaM(); EditSelection aSel( aPaM ); - nCurTextHeight = 0; - nCurTextHeightNTP = 0; + mnCurTextHeight = 0; + mnCurTextHeightNTP = 0; ResetUndoManager(); - for (size_t nView = aEditViews.size(); nView; ) + for (size_t nView = maEditViews.size(); nView; ) { - EditView* pView = aEditViews[--nView]; + EditView* pView = maEditViews[--nView]; pView->pImpEditView->SetEditSelection( aSel ); } @@ -700,7 +700,7 @@ EditPaM ImpEditEngine::RemoveText() EditPaM aStartPaM = maEditDoc.GetStartPaM(); EditSelection aEmptySel( aStartPaM, aStartPaM ); - for (EditView* pView : aEditViews) + for (EditView* pView : maEditViews) { pView->pImpEditView->SetEditSelection( aEmptySel ); } @@ -722,7 +722,7 @@ void ImpEditEngine::SetText(const OUString& rText) if (!rText.isEmpty()) aPaM = ImpInsertText( aEmptySel, rText ); - for (EditView* pView : aEditViews) + for (EditView* pView : maEditViews) { pView->pImpEditView->SetEditSelection( EditSelection( aPaM, aPaM ) ); // If no text then also no Format&Update @@ -730,14 +730,15 @@ void ImpEditEngine::SetText(const OUString& rText) if (rText.isEmpty() && IsUpdateLayout()) { tools::Rectangle aTmpRect( pView->GetOutputArea().TopLeft(), - Size( maPaperSize.Width(), nCurTextHeight ) ); + Size( maPaperSize.Width(), mnCurTextHeight ) ); aTmpRect.Intersection( pView->GetOutputArea() ); pView->InvalidateWindow( aTmpRect ); } } - if (rText.isEmpty()) { // otherwise it must be invalidated later, !bFormatted is enough. - nCurTextHeight = 0; - nCurTextHeightNTP = 0; + if (rText.isEmpty()) // otherwise it must be invalidated later, !bFormatted is enough. + { + mnCurTextHeight = 0; + mnCurTextHeightNTP = 0; } EnableUndo( bUndoCurrentlyEnabled ); OSL_ENSURE( !HasUndoManager() || !GetUndoManager().GetUndoActionCount(), "Undo after SetText?" ); @@ -784,8 +785,8 @@ void ImpEditEngine::ParaAttribsChanged( ContentNode const * pNode, bool bIgnoreU pPortion->MarkSelectionInvalid( 0 ); sal_Int32 nPara = maEditDoc.GetPos( pNode ); - if ( bIgnoreUndoCheck || pEditEngine->IsInUndo() ) - pEditEngine->ParaAttribsChanged( nPara ); + if (bIgnoreUndoCheck || mpEditEngine->IsInUndo()) + mpEditEngine->ParaAttribsChanged( nPara ); ParaPortion* pNextPortion = GetParaPortions().SafeGetObject( nPara+1 ); // => is formatted again anyway, if Invalid. @@ -802,7 +803,7 @@ EditSelection const & ImpEditEngine::MoveCursor( const KeyEvent& rKeyEvent, Edit // Actually, only necessary for up/down, but whatever. CheckIdleFormatter(); - EditPaM aPaM( pEditView->pImpEditView->GetEditSelection().Max() ); + EditPaM aPaM(pEditView->pImpEditView->GetEditSelection().Max()); EditPaM aOldPaM( aPaM ); @@ -948,9 +949,9 @@ EditSelection const & ImpEditEngine::MoveCursor( const KeyEvent& rKeyEvent, Edit } // May cause, a CreateAnchor or deselection all - aSelEngine.SetCurView( pEditView ); - aSelEngine.CursorPosChanging( bKeyModifySelection, aTranslatedKeyEvent.GetKeyCode().IsMod1() ); - EditPaM aOldEnd( pEditView->pImpEditView->GetEditSelection().Max() ); + maSelEngine.SetCurView(pEditView); + maSelEngine.CursorPosChanging( bKeyModifySelection, aTranslatedKeyEvent.GetKeyCode().IsMod1() ); + EditPaM aOldEnd(pEditView->pImpEditView->GetEditSelection().Max()); { EditSelection aNewSelection(pEditView->pImpEditView->GetEditSelection()); @@ -976,7 +977,7 @@ EditSelection const & ImpEditEngine::MoveCursor( const KeyEvent& rKeyEvent, Edit return pEditView->pImpEditView->GetEditSelection(); } -EditPaM ImpEditEngine::CursorVisualStartEnd( EditView const * pEditView, const EditPaM& rPaM, bool bStart ) +EditPaM ImpEditEngine::CursorVisualStartEnd( EditView const * mpEditView, const EditPaM& rPaM, bool bStart ) { EditPaM aPaM( rPaM ); @@ -989,7 +990,7 @@ EditPaM ImpEditEngine::CursorVisualStartEnd( EditView const * pEditView, const E const EditLine& rLine = pParaPortion->GetLines()[nLine]; bool bEmptyLine = rLine.GetStart() == rLine.GetEnd(); - pEditView->pImpEditView->nExtraCursorFlags = GetCursorFlags::NONE; + mpEditView->pImpEditView->nExtraCursorFlags = GetCursorFlags::NONE; if ( !bEmptyLine ) { @@ -1015,15 +1016,15 @@ EditPaM ImpEditEngine::CursorVisualStartEnd( EditView const * pEditView, const E if ( bStart ) { - pEditView->pImpEditView->SetCursorBidiLevel( bPortionRTL ? 0 : 1 ); + mpEditView->pImpEditView->SetCursorBidiLevel( bPortionRTL ? 0 : 1 ); // Maybe we must be *behind* the character - if ( bPortionRTL && pEditView->IsInsertMode() ) + if (bPortionRTL && mpEditView->IsInsertMode()) aPaM.SetIndex( aPaM.GetIndex()+1 ); } else { - pEditView->pImpEditView->SetCursorBidiLevel( bPortionRTL ? 1 : 0 ); - if ( !bPortionRTL && pEditView->IsInsertMode() ) + mpEditView->pImpEditView->SetCursorBidiLevel( bPortionRTL ? 1 : 0 ); + if ( !bPortionRTL && mpEditView->IsInsertMode() ) aPaM.SetIndex( aPaM.GetIndex()+1 ); } } @@ -1275,7 +1276,7 @@ EditPaM ImpEditEngine::CursorUp( const EditPaM& rPaM, EditView const * pView ) if ( pView->pImpEditView->nTravelXPos == TRAVEL_X_DONTKNOW ) { nX = GetXPos( pPPortion, &rLine, rPaM.GetIndex() ); - pView->pImpEditView->nTravelXPos = nX+nOnePixelInRef; + pView->pImpEditView->nTravelXPos = nX + mnOnePixelInRef; } else nX = pView->pImpEditView->nTravelXPos; @@ -1299,7 +1300,7 @@ EditPaM ImpEditEngine::CursorUp( const EditPaM& rPaM, EditView const * pView ) { const EditLine& rLine2 = pPrevPortion->GetLines()[pPrevPortion->GetLines().Count()-1]; aNewPaM.SetNode( pPrevPortion->GetNode() ); - aNewPaM.SetIndex( GetChar( pPrevPortion, &rLine2, nX+nOnePixelInRef ) ); + aNewPaM.SetIndex( GetChar( pPrevPortion, &rLine2, nX + mnOnePixelInRef ) ); } } @@ -1319,7 +1320,7 @@ EditPaM ImpEditEngine::CursorDown( const EditPaM& rPaM, EditView const * pView ) { const EditLine& rLine = pPPortion->GetLines()[nLine]; nX = GetXPos( pPPortion, &rLine, rPaM.GetIndex() ); - pView->pImpEditView->nTravelXPos = nX+nOnePixelInRef; + pView->pImpEditView->nTravelXPos = nX + mnOnePixelInRef; } else nX = pView->pImpEditView->nTravelXPos; @@ -1342,7 +1343,7 @@ EditPaM ImpEditEngine::CursorDown( const EditPaM& rPaM, EditView const * pView ) aNewPaM.SetNode( pNextPortion->GetNode() ); // Never at the very end when several lines, because then a line // below the cursor appears. - aNewPaM.SetIndex( GetChar( pNextPortion, &rLine, nX+nOnePixelInRef ) ); + aNewPaM.SetIndex( GetChar( pNextPortion, &rLine, nX + mnOnePixelInRef ) ); if ( ( aNewPaM.GetIndex() == rLine.GetEnd() ) && ( aNewPaM.GetIndex() > rLine.GetStart() ) && ( pNextPortion->GetLines().Count() > 1 ) ) aNewPaM = CursorLeft( aNewPaM ); } @@ -1437,7 +1438,7 @@ EditPaM ImpEditEngine::PageUp( const EditPaM& rPaM, EditView const * pView ) tools::Rectangle aRect = PaMtoEditCursor( rPaM ); Point aTopLeft = aRect.TopLeft(); aTopLeft.AdjustY( -(pView->GetVisArea().GetHeight() *9/10) ); - aTopLeft.AdjustX(nOnePixelInRef ); + aTopLeft.AdjustX(mnOnePixelInRef); if ( aTopLeft.Y() < 0 ) { aTopLeft.setY( 0 ); @@ -1450,7 +1451,7 @@ EditPaM ImpEditEngine::PageDown( const EditPaM& rPaM, EditView const * pView ) tools::Rectangle aRect = PaMtoEditCursor( rPaM ); Point aBottomRight = aRect.BottomRight(); aBottomRight.AdjustY(pView->GetVisArea().GetHeight() *9/10 ); - aBottomRight.AdjustX(nOnePixelInRef ); + aBottomRight.AdjustX(mnOnePixelInRef); tools::Long nHeight = GetTextHeight(); if ( aBottomRight.Y() > nHeight ) { @@ -2134,7 +2135,7 @@ void ImpEditEngine::ImpRemoveChars( const EditPaM& rPaM, sal_Int32 nChars ) break; // for } } - InsertUndo(std::make_unique<EditUndoRemoveChars>(pEditEngine, CreateEPaM(rPaM), aStr)); + InsertUndo(std::make_unique<EditUndoRemoveChars>(mpEditEngine, CreateEPaM(rPaM), aStr)); } maEditDoc.RemoveChars( rPaM, nChars ); @@ -2190,10 +2191,10 @@ EditSelection ImpEditEngine::ImpMoveParagraphs( Range aOldPositions, sal_Int32 n } MoveParagraphsInfo aMoveParagraphsInfo( aOldPositions.Min(), aOldPositions.Max(), nNewPos ); - aBeginMovingParagraphsHdl.Call( aMoveParagraphsInfo ); + maBeginMovingParagraphsHdl.Call( aMoveParagraphsInfo ); if ( IsUndoEnabled() && !IsInUndo()) - InsertUndo(std::make_unique<EditUndoMoveParagraphs>(pEditEngine, aOldPositions, nNewPos)); + InsertUndo(std::make_unique<EditUndoMoveParagraphs>(mpEditEngine, aOldPositions, nNewPos)); // do not lose sight of the Position ! ParaPortion* pDestPortion = GetParaPortions().SafeGetObject( nNewPos ); @@ -2228,7 +2229,7 @@ EditSelection ImpEditEngine::ImpMoveParagraphs( Range aOldPositions, sal_Int32 n ++i; } - aEndMovingParagraphsHdl.Call( aMoveParagraphsInfo ); + maEndMovingParagraphsHdl.Call( aMoveParagraphsInfo ); if ( GetNotifyHdl().IsSet() ) { @@ -2274,13 +2275,13 @@ EditPaM ImpEditEngine::ImpConnectParagraphs( ContentNode* pLeft, ContentNode* pR } sal_Int32 nParagraphTobeDeleted = maEditDoc.GetPos( pRight ); - aDeletedNodes.push_back(std::make_unique<DeletedNodeInfo>( pRight, nParagraphTobeDeleted )); + maDeletedNodes.push_back(std::make_unique<DeletedNodeInfo>( pRight, nParagraphTobeDeleted )); GetEditEnginePtr()->ParagraphConnected( maEditDoc.GetPos( pLeft ), maEditDoc.GetPos( pRight ) ); if ( IsUndoEnabled() && !IsInUndo() ) { - InsertUndo( std::make_unique<EditUndoConnectParas>(pEditEngine, + InsertUndo( std::make_unique<EditUndoConnectParas>(mpEditEngine, maEditDoc.GetPos( pLeft ), pLeft->Len(), pLeft->GetContentAttribs().GetItems(), pRight->GetContentAttribs().GetItems(), pLeft->GetStyleSheet(), pRight->GetStyleSheet(), bBackward ) ); @@ -2507,7 +2508,7 @@ void ImpEditEngine::ImpRemoveParagraph( sal_Int32 nPara ) ContentNode* pNextNode = maEditDoc.GetObject( nPara+1 ); std::unique_ptr<ContentNode> pNode = maEditDoc.Release(nPara); - aDeletedNodes.push_back(std::make_unique<DeletedNodeInfo>(pNode.get(), nPara)); + maDeletedNodes.push_back(std::make_unique<DeletedNodeInfo>(pNode.get(), nPara)); // The node is managed by the undo and possibly destroyed! @@ -2526,7 +2527,7 @@ void ImpEditEngine::ImpRemoveParagraph( sal_Int32 nPara ) if (IsUndoEnabled() && !IsInUndo()) { - InsertUndo(std::make_unique<EditUndoDelContent>(pEditEngine, std::move(pNode), nPara)); + InsertUndo(std::make_unique<EditUndoDelContent>(mpEditEngine, std::move(pNode), nPara)); } else { @@ -2593,7 +2594,7 @@ EditPaM ImpEditEngine::AutoCorrect( const EditSelection& rCurSel, sal_Unicode c, ContentNode* pNode = aSel.Max().GetNode(); const sal_Int32 nIndex = aSel.Max().GetIndex(); - EdtAutoCorrDoc aAuto(pEditEngine, pNode, nIndex, c); + EdtAutoCorrDoc aAuto(mpEditEngine, pNode, nIndex, c); // FIXME: this _must_ be called with reference to the actual node text! OUString const& rNodeString(pNode->GetString()); pAutoCorrect->DoAutoCorrect( @@ -2690,7 +2691,7 @@ EditPaM ImpEditEngine::InsertTextUserInput( const EditSelection& rCurSel, if ( IsUndoEnabled() && !IsInUndo() ) { - std::unique_ptr<EditUndoInsertChars> pNewUndo(new EditUndoInsertChars(pEditEngine, CreateEPaM(aPaM), OUString(c))); + std::unique_ptr<EditUndoInsertChars> pNewUndo(new EditUndoInsertChars(mpEditEngine, CreateEPaM(aPaM), OUString(c))); bool bTryMerge = !bDoOverwrite && ( c != ' ' ); InsertUndo( std::move(pNewUndo), bTryMerge ); } @@ -2810,7 +2811,7 @@ EditPaM ImpEditEngine::ImpInsertText(const EditSelection& aCurSel, const OUStrin aLine = aLine.copy( 0, nMaxNewChars ); // Delete the Rest... } if ( IsUndoEnabled() && !IsInUndo() ) - InsertUndo(std::make_unique<EditUndoInsertChars>(pEditEngine, CreateEPaM(aPaM), aLine)); + InsertUndo(std::make_unique<EditUndoInsertChars>(mpEditEngine, CreateEPaM(aPaM), aLine)); // Tabs ? if ( aLine.indexOf( '\t' ) == -1 ) aPaM = maEditDoc.InsertText( aPaM, aLine ); @@ -2868,7 +2869,7 @@ EditPaM ImpEditEngine::ImpFastInsertText( EditPaM aPaM, const OUString& rStr ) if ( ( aPaM.GetNode()->Len() + rStr.getLength() ) < MAXCHARSINPARA ) { if ( IsUndoEnabled() && !IsInUndo() ) - InsertUndo(std::make_unique<EditUndoInsertChars>(pEditEngine, CreateEPaM(aPaM), rStr)); + InsertUndo(std::make_unique<EditUndoInsertChars>(mpEditEngine, CreateEPaM(aPaM), rStr)); aPaM = maEditDoc.InsertText( aPaM, rStr ); TextModified(); @@ -2893,7 +2894,7 @@ EditPaM ImpEditEngine::ImpInsertFeature(const EditSelection& rCurSel, const SfxP return aPaM; if ( IsUndoEnabled() && !IsInUndo() ) - InsertUndo(std::make_unique<EditUndoInsertFeature>(pEditEngine, CreateEPaM(aPaM), rItem)); + InsertUndo(std::make_unique<EditUndoInsertFeature>(mpEditEngine, CreateEPaM(aPaM), rItem)); aPaM = maEditDoc.InsertFeature( aPaM, rItem ); UpdateFields(); @@ -2927,7 +2928,7 @@ EditPaM ImpEditEngine::ImpInsertParaBreak( EditPaM& rPaM, bool bKeepEndingAttrib } if ( IsUndoEnabled() && !IsInUndo() ) - InsertUndo(std::make_unique<EditUndoSplitPara>(pEditEngine, maEditDoc.GetPos(rPaM.GetNode()), rPaM.GetIndex())); + InsertUndo(std::make_unique<EditUndoSplitPara>(mpEditEngine, maEditDoc.GetPos(rPaM.GetNode()), rPaM.GetIndex())); EditPaM aPaM( maEditDoc.InsertParaBreak( rPaM, bKeepEndingAttribs ) ); if (auto pStyle = aPaM.GetNode()->GetStyleSheet()) @@ -2990,10 +2991,10 @@ EditPaM ImpEditEngine::ImpFastInsertParagraph( sal_Int32 nPara ) if ( nPara ) { assert(maEditDoc.GetObject(nPara - 1)); - InsertUndo(std::make_unique<EditUndoSplitPara>(pEditEngine, nPara-1, maEditDoc.GetObject( nPara-1 )->Len())); + InsertUndo(std::make_unique<EditUndoSplitPara>(mpEditEngine, nPara-1, maEditDoc.GetObject(nPara - 1)->Len())); } else - InsertUndo(std::make_unique<EditUndoSplitPara>(pEditEngine, 0, 0)); + InsertUndo(std::make_unique<EditUndoSplitPara>(mpEditEngine, 0, 0)); } ContentNode* pNode = new ContentNode( maEditDoc.GetItemPool() ); @@ -3358,7 +3359,7 @@ sal_uInt32 ImpEditEngine::GetTextHeight() const { assert( IsUpdateLayout() && "Should not be used for Update=FALSE: GetTextHeight" ); OSL_ENSURE( IsFormatted() || IsFormatting(), "GetTextHeight: Not formatted" ); - return nCurTextHeight; + return mnCurTextHeight; } sal_uInt32 ImpEditEngine::CalcTextWidth( bool bIgnoreExtraSpace ) @@ -3494,7 +3495,7 @@ sal_uInt32 ImpEditEngine::GetTextHeightNTP() const { assert( IsUpdateLayout() && "Should not be used for Update=FALSE: GetTextHeight" ); DBG_ASSERT( IsFormatted() || IsFormatting(), "GetTextHeight: Not formatted" ); - return nCurTextHeightNTP; + return mnCurTextHeightNTP; } tools::Long ImpEditEngine::Calc1ColumnTextHeight(tools::Long* pHeightNTP) @@ -3503,8 +3504,7 @@ tools::Long ImpEditEngine::Calc1ColumnTextHeight(tools::Long* pHeightNTP) if (pHeightNTP) *pHeightNTP = 0; // Pretend that we have ~infinite height to get total height - comphelper::ValueRestorationGuard aGuard(nCurTextHeight, - std::numeric_limits<tools::Long>::max()); + comphelper::ValueRestorationGuard aGuard(mnCurTextHeight, std::numeric_limits<tools::Long>::max()); IterateLinesAreasFunc FindLastLineBottom = [&](const LineAreaInfo& rInfo) { if (rInfo.pLine) @@ -3535,7 +3535,7 @@ tools::Long ImpEditEngine::CalcTextHeight(tools::Long* pHeightNTP) tools::Long nCurrentTextHeight; // This does the necessary column balancing for the case when the text does not fit min height. - // When the height of column (taken from nCurTextHeight) is too small, the last column will + // When the height of column (taken from mnCurTextHeight) is too small, the last column will // overflow, so the resulting height of the text will exceed the set column height. Increasing // the column height step by step by the minimal value that allows one of columns to accommodate // one line more, we finally get to the point where all the text fits. At each iteration, the @@ -3606,7 +3606,7 @@ tools::Long ImpEditEngine::CalcTextHeight(tools::Long* pHeightNTP) } return CallbackResult::Continue; }; - comphelper::ValueRestorationGuard aGuard(nCurTextHeight, nTentativeColHeight); + comphelper::ValueRestorationGuard aGuard(mnCurTextHeight, nTentativeColHeight); IterateLineAreas(GetHeightAndWantedIncrease, IterFlag::none); } while (nCurrentTextHeight > nTentativeColHeight && nWantedIncrease > 0 && nWantedIncrease != std::numeric_limits<tools::Long>::max()); @@ -3710,11 +3710,11 @@ void ImpEditEngine::UpdateSelections() { // Check whether one of the selections is at a deleted node... // If the node is valid, the index has yet to be examined! - for (EditView* pView : aEditViews) + for (EditView* pView : maEditViews) { EditSelection aCurSel( pView->pImpEditView->GetEditSelection() ); bool bChanged = false; - for (const std::unique_ptr<DeletedNodeInfo> & aDeletedNode : aDeletedNodes) + for (const std::unique_ptr<DeletedNodeInfo> & aDeletedNode : maDeletedNodes) { const DeletedNodeInfo& rInf = *aDeletedNode; if ( ( aCurSel.Min().GetNode() == rInf.GetNode() ) || @@ -3763,7 +3763,7 @@ void ImpEditEngine::UpdateSelections() } } } - aDeletedNodes.clear(); + maDeletedNodes.clear(); } EditSelection ImpEditEngine::ConvertSelection( @@ -3807,16 +3807,16 @@ void ImpEditEngine::SetActiveView( EditView* pView ) // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! // Actually, now bHasVisSel and HideSelection would be necessary !!! - if ( pView == pActiveView ) + if (pView == mpActiveView) return; - if ( pActiveView && pActiveView->HasSelection() ) - pActiveView->pImpEditView->DrawSelectionXOR(); + if (mpActiveView && mpActiveView->HasSelection()) + mpActiveView->pImpEditView->DrawSelectionXOR(); - pActiveView = pView; + mpActiveView = pView; - if ( pActiveView && pActiveView->HasSelection() ) - pActiveView->pImpEditView->DrawSelectionXOR(); + if (mpActiveView && mpActiveView->HasSelection()) + mpActiveView->pImpEditView->DrawSelectionXOR(); // NN: Quick fix for #78668#: // When editing of a cell in Calc is ended, the edit engine is not deleted, @@ -4508,7 +4508,7 @@ bool ImpEditEngine::DoVisualCursorTraveling() IMPL_LINK_NOARG(ImpEditEngine, DocModified, LinkParamNone*, void) { - aModifyHdl.Call( nullptr /*GetEditEnginePtr()*/ ); // NULL, because also used for Outliner + maModifyHdl.Call( nullptr /*GetEditEnginePtr()*/ ); // NULL, because also used for Outliner } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index b97a9493a48e..a4e0a54aaa0d 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -316,16 +316,16 @@ static bool lcl_ConnectToPrev( sal_Unicode cCh, sal_Unicode cPrevCh ) void ImpEditEngine::UpdateViews( EditView* pCurView ) { - if ( !IsUpdateLayout() || IsFormatting() || aInvalidRect.IsEmpty() ) + if ( !IsUpdateLayout() || IsFormatting() || maInvalidRect.IsEmpty() ) return; DBG_ASSERT( IsFormatted(), "UpdateViews: Doc not formatted!" ); - for (EditView* pView : aEditViews) + for (EditView* pView : maEditViews) { pView->HideCursor(); - tools::Rectangle aClipRect( aInvalidRect ); + tools::Rectangle aClipRect(maInvalidRect); tools::Rectangle aVisArea( pView->GetVisArea() ); aClipRect.Intersection( aVisArea ); @@ -347,7 +347,7 @@ void ImpEditEngine::UpdateViews( EditView* pCurView ) pCurView->ShowCursor( bGotoCursor ); } - aInvalidRect = tools::Rectangle(); + maInvalidRect = tools::Rectangle(); CallStatusHdl(); } @@ -356,18 +356,18 @@ IMPL_LINK_NOARG(ImpEditEngine, OnlineSpellHdl, Timer *, void) if ( !Application::AnyInput( VclInputFlags::KEYBOARD ) && IsUpdateLayout() && IsFormatted() ) DoOnlineSpelling(); else - aOnlineSpellTimer.Start(); + maOnlineSpellTimer.Start(); } IMPL_LINK_NOARG(ImpEditEngine, IdleFormatHdl, Timer *, void) { - aIdleFormatter.ResetRestarts(); + maIdleFormatter.ResetRestarts(); // #i97146# check if that view is still available // else probably the idle format timer fired while we're already // downing - EditView* pView = aIdleFormatter.GetView(); - for (EditView* aEditView : aEditViews) + EditView* pView = maIdleFormatter.GetView(); + for (EditView* aEditView : maEditViews) { if( aEditView == pView ) { @@ -379,7 +379,7 @@ IMPL_LINK_NOARG(ImpEditEngine, IdleFormatHdl, Timer *, void) void ImpEditEngine::CheckIdleFormatter() { - aIdleFormatter.ForceTimeout(); + maIdleFormatter.ForceTimeout(); // If not idle, but still not formatted: if ( !IsFormatted() ) FormatDoc(); @@ -441,7 +441,7 @@ void ImpEditEngine::FormatDoc() { GetEditEnginePtr()->ParagraphHeightChanged( nPara ); - for (EditView* pView : aEditViews) + for (EditView* pView : maEditViews) { ImpEditView* pImpView = pView->pImpEditView.get(); pImpView->ScrollStateChange(); @@ -456,34 +456,34 @@ void ImpEditEngine::FormatDoc() nY += pParaPortion->GetHeight(); } - aInvalidRect = tools::Rectangle(); // make empty + maInvalidRect = tools::Rectangle(); // make empty // One can also get into the formatting through UpdateMode ON=>OFF=>ON... // enable optimization first after Vobis delivery... { tools::Long nNewHeightNTP; tools::Long nNewHeight = CalcTextHeight(&nNewHeightNTP); - tools::Long nDiff = nNewHeight - nCurTextHeight; + tools::Long nDiff = nNewHeight - mnCurTextHeight; if ( nDiff ) { - aInvalidRect.Union(tools::Rectangle::Normalize( - { 0, nNewHeight }, { getWidthDirectionAware(maPaperSize), nCurTextHeight })); + maInvalidRect.Union(tools::Rectangle::Normalize( + { 0, nNewHeight }, { getWidthDirectionAware(maPaperSize), mnCurTextHeight })); maStatus.GetStatusWord() |= !IsEffectivelyVertical() ? EditStatusFlags::TextHeightChanged : EditStatusFlags::TEXTWIDTHCHANGED; } - nCurTextHeight = nNewHeight; - nCurTextHeightNTP = nNewHeightNTP; + mnCurTextHeight = nNewHeight; + mnCurTextHeightNTP = nNewHeightNTP; if ( maStatus.AutoPageSize() ) CheckAutoPageSize(); else if ( nDiff ) { - for (EditView* pView : aEditViews) + for (EditView* pView : maEditViews) { ImpEditView* pImpView = pView->pImpEditView.get(); if ( pImpView->DoAutoHeight() ) { - Size aSz( pImpView->GetOutputArea().GetWidth(), nCurTextHeight ); + Size aSz( pImpView->GetOutputArea().GetWidth(), mnCurTextHeight ); if ( aSz.Height() > maMaxAutoPaperSize.Height() ) aSz.setHeight( maMaxAutoPaperSize.Height() ); else if ( aSz.Height() < maMinAutoPaperSize.Height() ) @@ -498,7 +498,7 @@ void ImpEditEngine::FormatDoc() { auto CombineRepaintParasAreas = [&](const LineAreaInfo& rInfo) { if (aRepaintParas.count(rInfo.nPortion)) - aInvalidRect.Union(rInfo.aArea); + maInvalidRect.Union(rInfo.aArea); return CallbackResult::Continue; }; IterateLineAreas(CombineRepaintParasAreas, IterFlag::inclILS); @@ -583,10 +583,10 @@ void ImpEditEngine::CheckAutoPageSize() aSz.setWidth( aInvSize.Height() ); aSz.setHeight( aInvSize.Width() ); } - aInvalidRect = tools::Rectangle( Point(), aSz ); + maInvalidRect = tools::Rectangle( Point(), aSz ); - for (EditView* pView : aEditViews) + for (EditView* pView : maEditViews) { pView->pImpEditView->RecalcOutputArea(); } @@ -2033,8 +2033,8 @@ void ImpEditEngine::ImpBreakLine( ParaPortion* pParaPortion, EditLine* pLine, Te const OUString aWord = pNode->GetString().copy(nWordStart, nWordLen); sal_Int32 nMinTrail = nWordEnd-nMaxBreakPos+1; //+1: Before the dickey letter Reference< XHyphenatedWord > xHyphWord; - if (xHyphenator.is()) - xHyphWord = xHyphenator->hyphenate( aWord, aLocale, aWord.getLength() - nMinTrail, Sequence< PropertyValue >() ); + if (mxHyphenator.is()) + xHyphWord = mxHyphenator->hyphenate( aWord, aLocale, aWord.getLength() - nMinTrail, Sequence< PropertyValue >() ); if (xHyphWord.is()) { bool bAlternate = xHyphWord->isAlternativeSpelling(); @@ -2784,7 +2784,7 @@ void ImpEditEngine::RecalcTextPortion( ParaPortion* pParaPortion, sal_Int32 nSta void ImpEditEngine::SetTextRanger( std::unique_ptr<TextRanger> pRanger ) { - pTextRanger = std::move(pRanger); + mpTextRanger = std::move(pRanger); for ( sal_Int32 nPara = 0; nPara < GetParaPortions().Count(); nPara++ ) { @@ -2796,7 +2796,7 @@ void ImpEditEngine::SetTextRanger( std::unique_ptr<TextRanger> pRanger ) FormatFullDoc(); UpdateViews( GetActiveView() ); if ( IsUpdateLayout() && GetActiveView() ) - pActiveView->ShowCursor(false, false); + mpActiveView->ShowCursor(false, false); } void ImpEditEngine::SetVertical( bool bVertical) @@ -3267,10 +3267,10 @@ Point ImpEditEngine::MoveToNextLine( 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 maPaperSize - // and height of nCurTextHeight + // and height of mnCurTextHeight Point aOtherCorner = aOrigin; adjustXDirectionAware(aOtherCorner, getWidthDirectionAware(maPaperSize)); - adjustYDirectionAware(aOtherCorner, nCurTextHeight); + adjustYDirectionAware(aOtherCorner, mnCurTextHeight); tools::Long nNeeded = getYOverflowDirectionAware(rMovePos, tools::Rectangle::Normalize(aOrigin, aOtherCorner)); if (pnHeightNeededToNotWrap) @@ -3393,7 +3393,7 @@ void ImpEditEngine::Paint( OutputDevice& rOutDev, tools::Rectangle aClipRect, Po GetEditEnginePtr()->PaintingFirstLine(n, aLineStart, aOrigin, nOrientation, rOutDev); // Remember whether a bullet was painted. - const SfxBoolItem& rBulletState = pEditEngine->GetParaAttrib(n, EE_PARA_BULLETSTATE); + const SfxBoolItem& rBulletState = mpEditEngine->GetParaAttrib(n, EE_PARA_BULLETSTATE); bPaintBullet = rBulletState.GetValue(); } @@ -3565,13 +3565,13 @@ void ImpEditEngine::Paint( OutputDevice& rOutDev, tools::Rectangle aClipRect, Po ExtraPortionInfo *pExtraInfo = rTextPortion.GetExtraInfos(); // Do not split the Fields into different lines while editing // With EditView on Overlay bStripOnly is now set for stripping to - // primitives. To stay compatible in EditMode use pActiveView to detect + // primitives. To stay compatible in EditMode use mpActiveView to detect // when we are in EditMode. For whatever reason URLs are drawn as single // line in edit mode, originally clipped against edit area (which is no // longer done in Overlay mode and allows to *read* the URL). // It would be difficult to change this due to needed adaptations in // EditEngine (look for lineBreaksList creation) - if( nullptr == pActiveView && bStripOnly && !bParsingFields && pExtraInfo && !pExtraInfo->lineBreaksList.empty() ) + if (nullptr == mpActiveView && bStripOnly && !bParsingFields && pExtraInfo && !pExtraInfo->lineBreaksList.empty()) { bParsingFields = true; itSubLines = pExtraInfo->lineBreaksList.begin(); @@ -3606,7 +3606,7 @@ void ImpEditEngine::Paint( OutputDevice& rOutDev, tools::Rectangle aClipRect, Po { // tdf#148966 don't paint the line break following a // multiline field based on a compat flag - OutlinerEditEng* pOutlEditEng{ dynamic_cast<OutlinerEditEng*>(pEditEngine) }; + OutlinerEditEng* pOutlEditEng{ dynamic_cast<OutlinerEditEng*>(mpEditEngine)}; if (pOutlEditEng && pOutlEditEng->GetCompatFlag(SdrCompatibilityFlag::IgnoreBreakAfterMultilineField) .value_or(false)) @@ -4180,7 +4180,7 @@ void ImpEditEngine::ShowParagraph( sal_Int32 nParagraph, bool bShow ) { // Mark as deleted, so that no selection will end or begin at // this paragraph... - aDeletedNodes.push_back(std::make_unique<DeletedNodeInfo>( pPPortion->GetNode(), nParagraph )); + maDeletedNodes.push_back(std::make_unique<DeletedNodeInfo>( pPPortion->GetNode(), nParagraph )); UpdateSelections(); // The region below will not be invalidated if UpdateMode = sal_False! // If anyway, then save as sal_False before SetVisible ! @@ -4198,19 +4198,19 @@ void ImpEditEngine::ShowParagraph( sal_Int32 nParagraph, bool bShow ) { CalcHeight( pPPortion ); } - nCurTextHeight += pPPortion->GetHeight(); + mnCurTextHeight += pPPortion->GetHeight(); } else { - nCurTextHeight = 0x7fffffff; + mnCurTextHeight = 0x7fffffff; } } pPPortion->SetMustRepaint( true ); if ( IsUpdateLayout() && !IsInUndo() && !GetTextRanger() ) { - aInvalidRect = tools::Rectangle( Point( 0, GetParaPortions().GetYOffset( pPPortion ) ), - Point( GetPaperSize().Width(), nCurTextHeight ) ); + maInvalidRect = tools::Rectangle( Point( 0, GetParaPortions().GetYOffset( pPPortion ) ), + Point( GetPaperSize().Width(), mnCurTextHeight ) ); UpdateViews( GetActiveView() ); } } @@ -4241,11 +4241,11 @@ EditSelection ImpEditEngine::MoveParagraphs( Range aOldPositions, sal_Int32 nNew ParaPortion* pLowerPortion = GetParaPortions().SafeGetObject( nLastPortion ); if (pUpperPortion && pLowerPortion) { - aInvalidRect = tools::Rectangle(); // make empty - aInvalidRect.SetLeft( 0 ); - aInvalidRect.SetRight(GetColumnWidth(maPaperSize)); - aInvalidRect.SetTop( GetParaPortions().GetYOffset( pUpperPortion ) ); - aInvalidRect.SetBottom( GetParaPortions().GetYOffset( pLowerPortion ) + pLowerPortion->GetHeight() ); + maInvalidRect = tools::Rectangle(); // make empty + maInvalidRect.SetLeft( 0 ); + maInvalidRect.SetRight(GetColumnWidth(maPaperSize)); + maInvalidRect.SetTop( GetParaPortions().GetYOffset( pUpperPortion ) ); + maInvalidRect.SetBottom( GetParaPortions().GetYOffset( pLowerPortion ) + pLowerPortion->GetHeight() ); UpdateViews( pCurView ); } @@ -4284,14 +4284,14 @@ IMPL_LINK_NOARG(ImpEditEngine, StatusTimerHdl, Timer *, void) void ImpEditEngine::CallStatusHdl() { - if ( aStatusHdlLink.IsSet() && bool(maStatus.GetStatusWord()) ) + if (maStatusHdlLink.IsSet() && bool(maStatus.GetStatusWord())) { // The Status has to be reset before the Call, // since other Flags might be set in the handler... EditStatus aTmpStatus( maStatus ); maStatus.Clear(); - aStatusHdlLink.Call( aTmpStatus ); - aStatusTimer.Stop(); // If called by hand... + maStatusHdlLink.Call( aTmpStatus ); + maStatusTimer.Stop(); // If called by hand... } } @@ -4451,8 +4451,8 @@ void ImpEditEngine::SetFlatMode( bool bFlat ) FormatFullDoc(); UpdateViews(); - if ( pActiveView ) - pActiveView->ShowCursor(); + if (mpActiveView) + mpActiveView->ShowCursor(); } void ImpEditEngine::setScale(double fFontScaleX, double fFontScaleY, double fSpacingScaleX, double fSpacingScaleY) @@ -4482,7 +4482,7 @@ void ImpEditEngine::setScale(double fFontScaleX, double fFontScaleY, double fSpa { FormatFullDoc(); // (potentially) need everything redrawn - aInvalidRect = tools::Rectangle(0, 0, 1000000, 1000000); + maInvalidRect = tools::Rectangle(0, 0, 1000000, 1000000); UpdateViews(GetActiveView()); } } @@ -4502,7 +4502,7 @@ const SvxNumberFormat* ImpEditEngine::GetNumberFormat( const ContentNode *pNode // object to provide // access to the SvxNumberFormat of the Outliner. // The EditEngine implementation will just return 0. - pRes = pEditEngine->GetNumberFormat( nPara ); + pRes = mpEditEngine->GetNumberFormat( nPara ); } } @@ -4633,22 +4633,22 @@ void ImpEditEngine::ImplInitLayoutMode(OutputDevice& rOutDev, sal_Int32 nPara, s Reference < i18n::XBreakIterator > const & ImpEditEngine::ImplGetBreakIterator() const { - if ( !xBI.is() ) + if (!mxBI.is()) { - Reference< uno::XComponentContext > xContext( ::comphelper::getProcessComponentContext() ); - xBI = i18n::BreakIterator::create( xContext ); + uno::Reference<uno::XComponentContext> xContext(::comphelper::getProcessComponentContext()); + mxBI = i18n::BreakIterator::create(xContext); } - return xBI; + return mxBI; } Reference < i18n::XExtendedInputSequenceChecker > const & ImpEditEngine::ImplGetInputSequenceChecker() const { - if ( !xISC.is() ) + if (!mxISC.is()) { - Reference< uno::XComponentContext > xContext( ::comphelper::getProcessComponentContext() ); - xISC = i18n::InputSequenceChecker::create( xContext ); + uno::Reference<uno::XComponentContext> xContext(::comphelper::getProcessComponentContext()); + mxISC = i18n::InputSequenceChecker::create(xContext); } - return xISC; + return mxISC; } Color ImpEditEngine::GetAutoColor() const @@ -4867,7 +4867,7 @@ void ImpEditEngine::ImplUpdateOverflowingParaNum(tools::Long nPaperHeight) ParaPortion* pPara = GetParaPortions()[nPara]; nPH = pPara->GetHeight(); nY += nPH; - if ( nY > nPaperHeight /*nCurTextHeight*/ ) // found first paragraph overflowing + if ( nY > nPaperHeight /*mnCurTextHeight*/ ) // found first paragraph overflowing { mnOverflowingPara = nPara; SAL_INFO("editeng.chaining", "[CHAINING] Setting first overflowing #Para#: " << nPara); diff --git a/editeng/source/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx index 1a74266d270a..b5151467079a 100644 --- a/editeng/source/editeng/impedit4.cxx +++ b/editeng/source/editeng/impedit4.cxx @@ -150,7 +150,7 @@ EditPaM ImpEditEngine::ReadRTF( SvStream& rInput, EditSelection aSel ) DBG_ASSERT(pPool && pPool->GetName() == "EditEngineItemPool", "ReadRTF: no EditEnginePool!"); - EditRTFParserRef xPrsr = new EditRTFParser(rInput, aSel, *pPool, pEditEngine); + EditRTFParserRef xPrsr = new EditRTFParser(rInput, aSel, *pPool, mpEditEngine); SvParserState eState = xPrsr->CallParser(); if ( ( eState != SvParserState::Accepted ) && ( !rInput.GetError() ) ) { @@ -166,7 +166,7 @@ EditPaM ImpEditEngine::ReadHTML( SvStream& rInput, const OUString& rBaseURL, Edi aSel = ImpDeleteSelection( aSel ); EditHTMLParserRef xPrsr = new EditHTMLParser( rInput, rBaseURL, pHTTPHeaderAttrs ); - SvParserState eState = xPrsr->CallParser(pEditEngine, aSel.Max()); + SvParserState eState = xPrsr->CallParser(mpEditEngine, aSel.Max()); if ( ( eState != SvParserState::Accepted ) && ( !rInput.GetError() ) ) { rInput.SetError( EE_READWRITE_WRONGFORMAT ); @@ -1442,36 +1442,36 @@ css::lang::Locale ImpEditEngine::GetLocale( const EditPaM& rPaM ) const Reference< XSpellChecker1 > const & ImpEditEngine::GetSpeller() { - if ( !xSpeller.is() ) - xSpeller = LinguMgr::GetSpellChecker(); - return xSpeller; + if (!mxSpeller.is()) + mxSpeller = LinguMgr::GetSpellChecker(); + return mxSpeller; } void ImpEditEngine::CreateSpellInfo( bool bMultipleDocs ) { - if (!pSpellInfo) - pSpellInfo.reset( new SpellInfo ); + if (!mpSpellInfo) + mpSpellInfo.reset(new SpellInfo); else - *pSpellInfo = SpellInfo(); // reset to default values + *mpSpellInfo = SpellInfo(); // reset to default values - pSpellInfo->bMultipleDoc = bMultipleDocs; + mpSpellInfo->bMultipleDoc = bMultipleDocs; // always spell draw objects completely, starting at the top. // (spelling in only a selection or not starting with the top requires // further changes elsewhere to work properly) - pSpellInfo->aSpellStart = EPaM(); - pSpellInfo->aSpellTo = EPaM( EE_PARA_NOT_FOUND, EE_INDEX_NOT_FOUND ); + mpSpellInfo->aSpellStart = EPaM(); + mpSpellInfo->aSpellTo = EPaM( EE_PARA_NOT_FOUND, EE_INDEX_NOT_FOUND ); } EESpellState ImpEditEngine::Spell(EditView* pEditView, weld::Widget* pDialogParent, bool bMultipleDoc) { - SAL_WARN_IF( !xSpeller.is(), "editeng", "No Spell checker set!" ); + SAL_WARN_IF(!mxSpeller.is(), "editeng", "No Spell checker set!"); - if ( !xSpeller.is() ) + if (!mxSpeller.is()) return EESpellState::NoSpeller; - aOnlineSpellTimer.Stop(); + maOnlineSpellTimer.Stop(); // In MultipleDoc always from the front / rear ... if ( bMultipleDoc ) @@ -1485,7 +1485,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( maEditDoc.GetStartPaM() ) == pSpellInfo->aSpellStart ) + else if ( CreateEPaM( maEditDoc.GetStartPaM() ) == mpSpellInfo->aSpellStart ) bIsStart = true; { @@ -1503,8 +1503,8 @@ EESpellState ImpEditEngine::Spell(EditView* pEditView, weld::Widget* pDialogPare pEditView->pImpEditView->DrawSelectionXOR(); pEditView->ShowCursor( true, false ); } - EESpellState eState = pSpellInfo->eState; - pSpellInfo.reset(); + EESpellState eState = mpSpellInfo->eState; + mpSpellInfo.reset(); return eState; } @@ -1513,11 +1513,11 @@ bool ImpEditEngine::HasConvertibleTextPortion( LanguageType nSrcLang ) { bool bHasConvTxt = false; - sal_Int32 nParas = pEditEngine->GetParagraphCount(); + sal_Int32 nParas = mpEditEngine->GetParagraphCount(); for (sal_Int32 k = 0; k < nParas; ++k) { std::vector<sal_Int32> aPortions; - pEditEngine->GetPortions( k, aPortions ); + mpEditEngine->GetPortions( k, aPortions ); for ( size_t nPos = 0; nPos < aPortions.size(); ++nPos ) { sal_Int32 nEnd = aPortions[ nPos ]; @@ -1528,7 +1528,7 @@ bool ImpEditEngine::HasConvertibleTextPortion( LanguageType nSrcLang ) // specified position is evaluated. if (nEnd > nStart) // empty para? ++nStart; - LanguageType nLangFound = pEditEngine->GetLanguage( k, nStart ).nLang; + LanguageType nLangFound = mpEditEngine->GetLanguage( k, nStart ).nLang; #ifdef DEBUG lang::Locale aLocale( LanguageTag::convertToLocale( nLangFound ) ); #endif @@ -1557,9 +1557,9 @@ void ImpEditEngine::Convert( EditView* pEditView, weld::Widget* pDialogParent, // initialize pConvInfo EditSelection aCurSel( pEditView->pImpEditView->GetEditSelection() ); aCurSel.Adjust( maEditDoc ); - pConvInfo.reset(new ConvInfo); - pConvInfo->bMultipleDoc = bMultipleDoc; - pConvInfo->aConvStart = CreateEPaM( aCurSel.Min() ); + mpConvInfo.reset(new ConvInfo); + mpConvInfo->bMultipleDoc = bMultipleDoc; + mpConvInfo->aConvStart = CreateEPaM( aCurSel.Min() ); // if it is not just a selection and we are about to begin // with the current conversion for the very first time @@ -1577,16 +1577,16 @@ void ImpEditEngine::Convert( EditView* pEditView, weld::Widget* pDialogParent, // not work. Thus since chinese conversion is not interactive we start // at the begin of the paragraph to solve the problem, i.e. have the // TextConversion service get those characters together in the same call. - pConvInfo->aConvStart.nIndex = editeng::HangulHanjaConversion::IsChinese( nSrcLang ) + mpConvInfo->aConvStart.nIndex = editeng::HangulHanjaConversion::IsChinese( nSrcLang ) ? 0 : aWordStartPaM.GetIndex(); } - pConvInfo->aConvContinue = pConvInfo->aConvStart; + mpConvInfo->aConvContinue = mpConvInfo->aConvStart; bool bIsStart = false; if ( bMultipleDoc ) bIsStart = true; // Accessible from the front or from behind ... - else if ( CreateEPaM( maEditDoc.GetStartPaM() ) == pConvInfo->aConvStart ) + else if ( CreateEPaM( maEditDoc.GetStartPaM() ) == mpConvInfo->aConvStart ) bIsStart = true; TextConvWrapper aWrp( pDialogParent, @@ -1624,7 +1624,7 @@ void ImpEditEngine::Convert( EditView* pEditView, weld::Widget* pDialogParent, pEditView->pImpEditView->DrawSelectionXOR(); pEditView->ShowCursor( true, false ); } - pConvInfo.reset(); + mpConvInfo.reset(); } @@ -1633,11 +1633,11 @@ void ImpEditEngine::SetLanguageAndFont( LanguageType nLang, sal_uInt16 nLangWhichId, const vcl::Font *pFont, sal_uInt16 nFontWhichId ) { - ESelection aOldSel = pActiveView->GetSelection(); - pActiveView->SetSelection( rESel ); + ESelection aOldSel = mpActiveView->GetSelection(); + mpActiveView->SetSelection( rESel ); // set new language attribute - SfxItemSet aNewSet( pActiveView->GetEmptyItemSet() ); + SfxItemSet aNewSet(mpActiveView->GetEmptyItemSet()); aNewSet.Put( SvxLanguageItem( nLang, nLangWhichId ) ); // new font to be set? @@ -1655,9 +1655,8 @@ void ImpEditEngine::SetLanguageAndFont( } // apply new attributes - pActiveView->SetAttribs( aNewSet ); - - pActiveView->SetSelection( aOldSel ); + mpActiveView->SetAttribs(aNewSet); + mpActiveView->SetSelection(aOldSel); } @@ -1673,7 +1672,7 @@ void ImpEditEngine::ImpConvert( OUString &rConvTxt, LanguageType &rConvTxtLang, OUString aRes; LanguageType nResLang = LANGUAGE_NONE; - EditPaM aPos( CreateEditPaM( pConvInfo->aConvContinue ) ); + EditPaM aPos(CreateEditPaM(mpConvInfo->aConvContinue)); EditSelection aCurSel( aPos, aPos ); OUString aWord; @@ -1682,9 +1681,9 @@ void ImpEditEngine::ImpConvert( OUString &rConvTxt, LanguageType &rConvTxtLang, { // empty paragraph found that needs to have language and font set? if (bAllowImplicitChangesForNotConvertibleText && - pEditEngine->GetText( pConvInfo->aConvContinue.nPara ).isEmpty()) + mpEditEngine->GetText(mpConvInfo->aConvContinue.nPara).isEmpty()) { - sal_Int32 nPara = pConvInfo->aConvContinue.nPara; + sal_Int32 nPara = mpConvInfo->aConvContinue.nPara; ESelection aESel( nPara, 0, nPara, 0 ); // see comment for below same function call SetLanguageAndFont( aESel, @@ -1693,8 +1692,8 @@ void ImpEditEngine::ImpConvert( OUString &rConvTxt, LanguageType &rConvTxtLang, } - if (pConvInfo->aConvContinue.nPara == pConvInfo->aConvTo.nPara && - pConvInfo->aConvContinue.nIndex >= pConvInfo->aConvTo.nIndex) + if (mpConvInfo->aConvContinue.nPara == mpConvInfo->aConvTo.nPara && + mpConvInfo->aConvContinue.nIndex >= mpConvInfo->aConvTo.nIndex) break; sal_Int32 nAttribStart = -1; @@ -1702,7 +1701,7 @@ void ImpEditEngine::ImpConvert( OUString &rConvTxt, LanguageType &rConvTxtLang, sal_Int32 nCurPos = -1; EPaM aCurStart = CreateEPaM( aCurSel.Min() ); std::vector<sal_Int32> aPortions; - pEditEngine->GetPortions( aCurStart.nPara, aPortions ); + mpEditEngine->GetPortions(aCurStart.nPara, aPortions); for ( size_t nPos = 0; nPos < aPortions.size(); ++nPos ) { const sal_Int32 nEnd = aPortions[ nPos ]; @@ -1713,7 +1712,7 @@ void ImpEditEngine::ImpConvert( OUString &rConvTxt, LanguageType &rConvTxtLang, // thus we usually have to add 1 in order to get the language // of the text right to the cursor position const sal_Int32 nLangIdx = nEnd > nStart ? nStart + 1 : nStart; - LanguageType nLangFound = pEditEngine->GetLanguage( aCurStart.nPara, nLangIdx ).nLang; + LanguageType nLangFound = mpEditEngine->GetLanguage( aCurStart.nPara, nLangIdx ).nLang; #ifdef DEBUG lang::Locale aLocale( LanguageTag::convertToLocale( nLangFound ) ); #endif @@ -1782,26 +1781,26 @@ void ImpEditEngine::ImpConvert( OUString &rConvTxt, LanguageType &rConvTxtLang, aCurSel.Max().SetIndex( nCurPos ); } - if ( !pConvInfo->bConvToEnd ) + if ( !mpConvInfo->bConvToEnd ) { EPaM aEPaM( CreateEPaM( aCurSel.Min() ) ); - if ( !( aEPaM < pConvInfo->aConvTo ) ) + if ( !( aEPaM < mpConvInfo->aConvTo ) ) break; } // clip selected word to the converted area // (main use when conversion starts/ends **within** a word) - EditPaM aPaM( CreateEditPaM( pConvInfo->aConvStart ) ); - if (pConvInfo->bConvToEnd && + EditPaM aPaM( CreateEditPaM( mpConvInfo->aConvStart ) ); + if (mpConvInfo->bConvToEnd && aCurSel.Min().GetNode() == aPaM.GetNode() && aCurSel.Min().GetIndex() < aPaM.GetIndex()) aCurSel.Min().SetIndex( aPaM.GetIndex() ); - aPaM = CreateEditPaM( pConvInfo->aConvContinue ); + aPaM = CreateEditPaM( mpConvInfo->aConvContinue ); if (aCurSel.Min().GetNode() == aPaM.GetNode() && aCurSel.Min().GetIndex() < aPaM.GetIndex()) aCurSel.Min().SetIndex( aPaM.GetIndex() ); - aPaM = CreateEditPaM( pConvInfo->aConvTo ); - if ((!pConvInfo->bConvToEnd || rConvRange.HasRange())&& + aPaM = CreateEditPaM( mpConvInfo->aConvTo ); + if ((!mpConvInfo->bConvToEnd || rConvRange.HasRange())&& aCurSel.Max().GetNode() == aPaM.GetNode() && aCurSel.Max().GetIndex() > aPaM.GetIndex()) aCurSel.Max().SetIndex( aPaM.GetIndex() ); @@ -1815,7 +1814,7 @@ void ImpEditEngine::ImpConvert( OUString &rConvTxt, LanguageType &rConvTxtLang, if ( aRes.isEmpty() ) aCurSel = WordRight( aCurSel.Min(), css::i18n::WordType::DICTIONARY_WORD ); - pConvInfo->aConvContinue = CreateEPaM( aCurSel.Max() ); + mpConvInfo->aConvContinue = CreateEPaM( aCurSel.Max() ); } pEditView->pImpEditView->DrawSelectionXOR(); @@ -1831,7 +1830,7 @@ void ImpEditEngine::ImpConvert( OUString &rConvTxt, LanguageType &rConvTxtLang, Reference< XSpellAlternatives > ImpEditEngine::ImpSpell( EditView* pEditView ) { - DBG_ASSERT( xSpeller.is(), "No spell checker set!" ); + DBG_ASSERT(mxSpeller.is(), "No spell checker set!"); ContentNode* pLastNode = maEditDoc.GetObject( maEditDoc.Count()-1 ); EditSelection aCurSel( pEditView->pImpEditView->GetEditSelection() ); @@ -1844,7 +1843,7 @@ Reference< XSpellAlternatives > ImpEditEngine::ImpSpell( EditView* pEditView ) // Known (most likely) bug: If SpellToCurrent, the current has to be // corrected at each replacement, otherwise it may not fit exactly in // the end ... - if ( pSpellInfo->bSpellToEnd || pSpellInfo->bMultipleDoc ) + if (mpSpellInfo->bSpellToEnd || mpSpellInfo->bMultipleDoc) { if ( aCurSel.Max().GetNode() == pLastNode ) { @@ -1852,10 +1851,10 @@ Reference< XSpellAlternatives > ImpEditEngine::ImpSpell( EditView* pEditView ) break; } } - else if ( !pSpellInfo->bSpellToEnd ) + else if (!mpSpellInfo->bSpellToEnd) { EPaM aEPaM( CreateEPaM( aCurSel.Max() ) ); - if ( !( aEPaM < pSpellInfo->aSpellTo ) ) + if (!(aEPaM < mpSpellInfo->aSpellTo)) break; } @@ -1877,14 +1876,14 @@ Reference< XSpellAlternatives > ImpEditEngine::ImpSpell( EditView* pEditView ) if ( !aWord.isEmpty() ) { LanguageType eLang = GetLanguage( aCurSel.Max() ).nLang; - SvxSpellWrapper::CheckSpellLang( xSpeller, eLang ); - xSpellAlt = xSpeller->spell( aWord, static_cast<sal_uInt16>(eLang), aEmptySeq ); + SvxSpellWrapper::CheckSpellLang(mxSpeller, eLang); + xSpellAlt = mxSpeller->spell( aWord, static_cast<sal_uInt16>(eLang), aEmptySeq ); } if ( !xSpellAlt.is() ) aCurSel = WordRight( aCurSel.Min(), css::i18n::WordType::DICTIONARY_WORD ); else - pSpellInfo->eState = EESpellState::ErrorFound; + mpSpellInfo->eState = EESpellState::ErrorFound; } pEditView->pImpEditView->DrawSelectionXOR(); @@ -1925,13 +1924,13 @@ Reference< XSpellAlternatives > ImpEditEngine::ImpFindNextError(EditSelection& r } if ( !aWord.isEmpty() ) - xSpellAlt = xSpeller->spell( aWord, static_cast<sal_uInt16>(GetLanguage( aCurSel.Max() ).nLang), aEmptySeq ); + xSpellAlt = mxSpeller->spell( aWord, static_cast<sal_uInt16>(GetLanguage( aCurSel.Max() ).nLang), aEmptySeq ); if ( !xSpellAlt.is() ) aCurSel = WordRight( aCurSel.Min(), css::i18n::WordType::DICTIONARY_WORD ); else { - pSpellInfo->eState = EESpellState::ErrorFound; + mpSpellInfo->eState = EESpellState::ErrorFound; rSelection = aCurSel; } } @@ -1943,12 +1942,12 @@ bool ImpEditEngine::SpellSentence(EditView const & rEditView, { bool bRet = false; EditSelection aCurSel( rEditView.pImpEditView->GetEditSelection() ); - if(!pSpellInfo) + if (!mpSpellInfo) CreateSpellInfo( true ); - pSpellInfo->aCurSentenceStart = aCurSel.Min(); - DBG_ASSERT( xSpeller.is(), "No spell checker set!" ); - pSpellInfo->aLastSpellPortions.clear(); - pSpellInfo->aLastSpellContentSelections.clear(); + mpSpellInfo->aCurSentenceStart = aCurSel.Min(); + DBG_ASSERT(mxSpeller.is(), "No spell checker set!"); + mpSpellInfo->aLastSpellPortions.clear(); + mpSpellInfo->aLastSpellContentSelections.clear(); rToFill.clear(); //if no selection previously exists the range is extended to the end of the object if (!aCurSel.HasRange()) @@ -2015,8 +2014,8 @@ void ImpEditEngine::AddPortion( rToFill.push_back(aPortion); //save the spelled portions for later use - pSpellInfo->aLastSpellPortions.push_back(aPortion); - pSpellInfo->aLastSpellContentSelections.push_back(rSel); + mpSpellInfo->aLastSpellPortions.push_back(aPortion); + mpSpellInfo->aLastSpellContentSelections.push_back(rSel); } // Adds one or more portions of text to the SpellPortions depending on language changes @@ -2095,8 +2094,8 @@ void ImpEditEngine::ApplyChangedSentence(EditView const & rEditView, // Note: rNewPortions.size() == 0 is valid and happens when the whole // sentence got removed in the dialog - DBG_ASSERT(pSpellInfo, "pSpellInfo not initialized"); - if (!pSpellInfo || pSpellInfo->aLastSpellPortions.empty()) // no portions -> no text to be changed + DBG_ASSERT(mpSpellInfo, "mpSpellInfo not initialized"); + if (!mpSpellInfo || mpSpellInfo->aLastSpellPortions.empty()) // no portions -> no text to be changed return; // get current paragraph length to calculate later on how the sentence length changed, @@ -2105,17 +2104,17 @@ void ImpEditEngine::ApplyChangedSentence(EditView const & rEditView, sal_Int32 nOldLen = aOldSel.Max().GetNode()->Len(); UndoActionStart( EDITUNDO_INSERT ); - if(pSpellInfo->aLastSpellPortions.size() == rNewPortions.size()) + if (mpSpellInfo->aLastSpellPortions.size() == rNewPortions.size()) { - DBG_ASSERT( !rNewPortions.empty(), "rNewPortions should not be empty here" ); - DBG_ASSERT( pSpellInfo->aLastSpellPortions.size() == pSpellInfo->aLastSpellContentSelections.size(), - "aLastSpellPortions and aLastSpellContentSelections size mismatch" ); + DBG_ASSERT(!rNewPortions.empty(), "rNewPortions should not be empty here"); + DBG_ASSERT(mpSpellInfo->aLastSpellPortions.size() == mpSpellInfo->aLastSpellContentSelections.size(), + "aLastSpellPortions and aLastSpellContentSelections size mismatch"); //the simple case: the same number of elements on both sides //each changed element has to be applied to the corresponding source element svx::SpellPortions::const_iterator aCurrentNewPortion = rNewPortions.end(); - svx::SpellPortions::const_iterator aCurrentOldPortion = pSpellInfo->aLastSpellPortions.end(); - SpellContentSelections::const_iterator aCurrentOldPosition = pSpellInfo->aLastSpellContentSelections.end(); + svx::SpellPortions::const_iterator aCurrentOldPortion = mpSpellInfo->aLastSpellPortions.end(); + SpellContentSelections::const_iterator aCurrentOldPosition = mpSpellInfo->aLastSpellContentSelections.end(); bool bSetToEnd = false; do { @@ -2158,12 +2157,12 @@ void ImpEditEngine::ApplyChangedSentence(EditView const & rEditView, } else { - DBG_ASSERT( !pSpellInfo->aLastSpellContentSelections.empty(), "aLastSpellContentSelections should not be empty here" ); + DBG_ASSERT( !mpSpellInfo->aLastSpellContentSelections.empty(), "aLastSpellContentSelections should not be empty here" ); //select the complete sentence - SpellContentSelections::const_iterator aCurrentEndPosition = pSpellInfo->aLastSpellContentSelections.end(); + SpellContentSelections::const_iterator aCurrentEndPosition = mpSpellInfo->aLastSpellContentSelections.end(); --aCurrentEndPosition; - SpellContentSelections::const_iterator aCurrentStartPosition = pSpellInfo->aLastSpellContentSelections.begin(); + SpellContentSelections::const_iterator aCurrentStartPosition = mpSpellInfo->aLastSpellContentSelections.begin(); EditSelection aAllSentence(aCurrentStartPosition->Min(), aCurrentEndPosition->Max()); //delete the sentence completely @@ -2195,7 +2194,7 @@ void ImpEditEngine::ApplyChangedSentence(EditView const & rEditView, EditPaM aNext; if (bRecheck) - aNext = pSpellInfo->aCurSentenceStart; + aNext = mpSpellInfo->aCurSentenceStart; else { // restore cursor position to the end of the modified sentence. @@ -2214,9 +2213,9 @@ void ImpEditEngine::ApplyChangedSentence(EditView const & rEditView, void ImpEditEngine::PutSpellingToSentenceStart( EditView const & rEditView ) { - if( pSpellInfo && !pSpellInfo->aLastSpellContentSelections.empty() ) + if (mpSpellInfo && !mpSpellInfo->aLastSpellContentSelections.empty()) { - rEditView.pImpEditView->SetEditSelection( pSpellInfo->aLastSpellContentSelections.begin()->Min() ); + rEditView.pImpEditView->SetEditSelection(mpSpellInfo->aLastSpellContentSelections.begin()->Min()); } } @@ -2234,13 +2233,13 @@ void ImpEditEngine::DoOnlineSpelling( ContentNode* pThisNodeOnly, bool bSpellAtC even out properly with VDev on transitions from wrong => right) */ - if ( !xSpeller.is() ) + if (!mxSpeller.is()) return; EditPaM aCursorPos; - if( pActiveView && !bSpellAtCursorPos ) + if (mpActiveView && !bSpellAtCursorPos) { - aCursorPos = pActiveView->pImpEditView->GetEditSelection().Max(); + aCursorPos = mpActiveView->pImpEditView->GetEditSelection().Max(); } bool bRestartTimer = false; @@ -2296,7 +2295,7 @@ void ImpEditEngine::DoOnlineSpelling( ContentNode* pThisNodeOnly, bool bSpellAtC { const sal_Int32 nWStart = aSel.Min().GetIndex(); const sal_Int32 nWEnd = aSel.Max().GetIndex(); - if ( !xSpeller->isValid( aWord, static_cast<sal_uInt16>(GetLanguage( EditPaM( aSel.Min().GetNode(), nWStart+1 ) ).nLang), aEmptySeq ) ) + if (!mxSpeller->isValid( aWord, static_cast<sal_uInt16>(GetLanguage( EditPaM( aSel.Min().GetNode(), nWStart+1 ) ).nLang), aEmptySeq)) { // Check if already marked correctly... const sal_Int32 nXEnd = bDottAdded ? nWEnd -1 : nWEnd; @@ -2363,7 +2362,7 @@ void ImpEditEngine::DoOnlineSpelling( ContentNode* pThisNodeOnly, bool bSpellAtC maStatus.GetStatusWord() |= EditStatusFlags::WRONGWORDCHANGED; CallStatusHdl(); - if (!aEditViews.empty()) + if (!maEditViews.empty()) { // For SimpleRepaint one was painted over a range without // reaching VDEV, but then one would have to intersect, c @@ -2372,21 +2371,21 @@ void ImpEditEngine::DoOnlineSpelling( ContentNode* pThisNodeOnly, bool bSpellAtC EditPaM aEndPaM( pNode, nPaintTo ); tools::Rectangle aStartCursor( PaMtoEditCursor( aStartPaM ) ); tools::Rectangle aEndCursor( PaMtoEditCursor( aEndPaM ) ); - DBG_ASSERT( aInvalidRect.IsEmpty(), "InvalidRect set!" ); - aInvalidRect.SetLeft( 0 ); - aInvalidRect.SetRight( GetPaperSize().Width() ); - aInvalidRect.SetTop( aStartCursor.Top() ); - aInvalidRect.SetBottom( aEndCursor.Bottom() ); - if ( pActiveView && pActiveView->HasSelection() ) + DBG_ASSERT(maInvalidRect.IsEmpty(), "InvalidRect set!"); + maInvalidRect.SetLeft( 0 ); + maInvalidRect.SetRight( GetPaperSize().Width() ); + maInvalidRect.SetTop( aStartCursor.Top() ); + maInvalidRect.SetBottom( aEndCursor.Bottom() ); + if (mpActiveView && mpActiveView->HasSelection()) { // Then no output through VDev. UpdateViews(); } else if ( bSimpleRepaint ) { - for (EditView* pView : aEditViews) + for (EditView* pView : maEditViews) { - tools::Rectangle aClipRect( aInvalidRect ); + tools::Rectangle aClipRect(maInvalidRect); aClipRect.Intersection( pView->GetVisArea() ); if ( !aClipRect.IsEmpty() ) { @@ -2398,9 +2397,9 @@ void ImpEditEngine::DoOnlineSpelling( ContentNode* pThisNodeOnly, bool bSpellAtC } else { - UpdateViews( pActiveView ); + UpdateViews(mpActiveView); } - aInvalidRect = tools::Rectangle(); + maInvalidRect = tools::Rectangle(); } } // After two corrected nodes give up the control... @@ -2416,13 +2415,13 @@ void ImpEditEngine::DoOnlineSpelling( ContentNode* pThisNodeOnly, bool bSpellAtC break; } if ( bRestartTimer ) - aOnlineSpellTimer.Start(); + maOnlineSpellTimer.Start(); } EESpellState ImpEditEngine::HasSpellErrors() { - DBG_ASSERT( xSpeller.is(), "No spell checker set!" ); + DBG_ASSERT(mxSpeller.is(), "No spell checker set!"); ContentNode* pLastNode = maEditDoc.GetObject( maEditDoc.Count() - 1 ); EditSelection aCurSel( maEditDoc.GetStartPaM() ); @@ -2443,8 +2442,8 @@ EESpellState ImpEditEngine::HasSpellErrors() if ( !aWord.isEmpty() ) { LanguageType eLang = GetLanguage( aCurSel.Max() ).nLang; - SvxSpellWrapper::CheckSpellLang( xSpeller, eLang ); - xSpellAlt = xSpeller->spell( aWord, static_cast<sal_uInt16>(eLang), aEmptySeq ); + SvxSpellWrapper::CheckSpellLang(mxSpeller, eLang); + xSpellAlt = mxSpeller->spell( aWord, static_cast<sal_uInt16>(eLang), aEmptySeq ); } aCurSel = WordRight( aCurSel.Max(), css::i18n::WordType::DICTIONARY_WORD ); } @@ -2674,8 +2673,8 @@ bool ImpEditEngine::HasText( const SvxSearchItem& rSearchItem ) void ImpEditEngine::SetAutoCompleteText(const OUString& rStr, bool bClearTipWindow) { maAutoCompleteText = rStr; - if ( bClearTipWindow && pActiveView ) - Help::ShowQuickHelp( pActiveView->GetWindow(), tools::Rectangle(), OUString() ); + if ( bClearTipWindow && mpActiveView ) + Help::ShowQuickHelp( mpActiveView->GetWindow(), tools::Rectangle(), OUString() ); } namespace @@ -2972,7 +2971,7 @@ EditSelection ImpEditEngine::TransliterateText( const EditSelection& rSelection, aNewSel = aSel; ESelection aESel( CreateESel( aSel ) ); - pUndo.reset(new EditUndoTransliteration(pEditEngine, aESel, nTransliterationMode)); + pUndo.reset(new EditUndoTransliteration(mpEditEngine, aESel, nTransliterationMode)); const bool bSingleNode = aSel.Min().GetNode()== aSel.Max().GetNode(); const bool bHasAttribs = aSel.Min().GetNode()->GetCharAttribs().HasAttrib( aSel.Min().GetIndex(), aSel.Max().GetIndex() ); diff --git a/editeng/source/editeng/impedit5.cxx b/editeng/source/editeng/impedit5.cxx index 0f5af2f75db0..1a87241a1ae2 100644 --- a/editeng/source/editeng/impedit5.cxx +++ b/editeng/source/editeng/impedit5.cxx @@ -26,10 +26,8 @@ void ImpEditEngine::SetStyleSheetPool( SfxStyleSheetPool* pSPool ) { - if ( pStylePool != pSPool ) - { - pStylePool = pSPool; - } + if (mpStylePool != pSPool) + mpStylePool = pSPool; } const SfxStyleSheet* ImpEditEngine::GetStyleSheet( sal_Int32 nPara ) const @@ -77,7 +75,7 @@ void ImpEditEngine::SetStyleSheet( sal_Int32 nPara, SfxStyleSheet* pStyle ) aNewStyleName = pStyle->GetName(); InsertUndo( - std::make_unique<EditUndoSetStyleSheet>(pEditEngine, maEditDoc.GetPos( pNode ), + std::make_unique<EditUndoSetStyleSheet>(mpEditEngine, maEditDoc.GetPos( pNode ), aPrevStyleName, pCurStyle ? pCurStyle->GetFamily() : SfxStyleFamily::Para, aNewStyleName, pStyle ? pStyle->GetFamily() : SfxStyleFamily::Para, pNode->GetContentAttribs().GetItems() ) ); @@ -192,11 +190,11 @@ std::unique_ptr<EditUndoSetAttribs> ImpEditEngine::CreateAttribUndo( EditSelecti { SfxItemSet aTmpSet( GetEmptyItemSet() ); aTmpSet.Put( rSet ); - pUndo.reset( new EditUndoSetAttribs(pEditEngine, aESel, std::move(aTmpSet)) ); + pUndo.reset( new EditUndoSetAttribs(mpEditEngine, aESel, std::move(aTmpSet)) ); } else { - pUndo.reset( new EditUndoSetAttribs(pEditEngine, aESel, rSet) ); + pUndo.reset( new EditUndoSetAttribs(mpEditEngine, aESel, rSet) ); } SfxItemPool* pPool = pUndo->GetNewAttribs().GetPool(); @@ -225,7 +223,7 @@ ViewShellId ImpEditEngine::CreateViewShellId() { ViewShellId nRet(-1); - const EditView* pEditView = pEditEngine ? pEditEngine->GetActiveView() : nullptr; + const EditView* pEditView = mpEditEngine ? mpEditEngine->GetActiveView() : nullptr; const OutlinerViewShell* pViewShell = pEditView ? pEditView->GetImpEditView()->GetViewShell() : nullptr; if (pViewShell) nRet = pViewShell->GetViewShellId(); @@ -266,7 +264,7 @@ void ImpEditEngine::InsertUndo( std::unique_ptr<EditUndo> pUndo, bool bTryMerge DBG_ASSERT( !IsInUndo(), "InsertUndo in Undo mode!" ); if ( moUndoMarkSelection ) { - GetUndoManager().AddUndoAction( std::make_unique<EditUndoMarkSelection>(pEditEngine, *moUndoMarkSelection) ); + GetUndoManager().AddUndoAction( std::make_unique<EditUndoMarkSelection>(mpEditEngine, *moUndoMarkSelection) ); moUndoMarkSelection.reset(); } GetUndoManager().AddUndoAction( std::move(pUndo), bTryMerge ); @@ -692,11 +690,11 @@ void ImpEditEngine::SetParaAttribs( sal_Int32 nPara, const SfxItemSet& rSet ) { SfxItemSet aTmpSet( GetEmptyItemSet() ); aTmpSet.Put( rSet ); - InsertUndo(std::make_unique<EditUndoSetParaAttribs>(pEditEngine, nPara, pNode->GetContentAttribs().GetItems(), aTmpSet)); + InsertUndo(std::make_unique<EditUndoSetParaAttribs>(mpEditEngine, nPara, pNode->GetContentAttribs().GetItems(), aTmpSet)); } else { - InsertUndo(std::make_unique<EditUndoSetParaAttribs>(pEditEngine, nPara, pNode->GetContentAttribs().GetItems(), rSet)); + InsertUndo(std::make_unique<EditUndoSetParaAttribs>(mpEditEngine, nPara, pNode->GetContentAttribs().GetItems(), rSet)); } } |