diff options
Diffstat (limited to 'editeng/source')
-rw-r--r-- | editeng/source/editeng/editeng.cxx | 4 | ||||
-rw-r--r-- | editeng/source/editeng/impedit.cxx | 12 | ||||
-rw-r--r-- | editeng/source/editeng/impedit.hxx | 2 | ||||
-rw-r--r-- | editeng/source/editeng/impedit3.cxx | 9 |
4 files changed, 26 insertions, 1 deletions
diff --git a/editeng/source/editeng/editeng.cxx b/editeng/source/editeng/editeng.cxx index 15b140cd97a3..03836af7b511 100644 --- a/editeng/source/editeng/editeng.cxx +++ b/editeng/source/editeng/editeng.cxx @@ -2501,13 +2501,15 @@ void EditEngine::StyleSheetChanged( SfxStyleSheet* /* pStyle */ ) void EditEngine::ParagraphHeightChanged( sal_Int32 nPara ) { - if ( GetNotifyHdl().IsSet() ) { EENotify aNotify( EE_NOTIFY_TextHeightChanged ); aNotify.nParagraph = nPara; pImpEditEngine->GetNotifyHdl().Call( aNotify ); } + + for (EditView* pView : pImpEditEngine->aEditViews) + pView->pImpEditView->ScrollStateChange(); } OUString EditEngine::GetUndoComment( sal_uInt16 nId ) const diff --git a/editeng/source/editeng/impedit.cxx b/editeng/source/editeng/impedit.cxx index 2fc7252c5f23..8b61a4aee975 100644 --- a/editeng/source/editeng/impedit.cxx +++ b/editeng/source/editeng/impedit.cxx @@ -1428,6 +1428,15 @@ void ImpEditView::ShowCursor( bool bGotoCursor, bool bForceVisCursor ) } } +// call this so users of EditViewCallbacks can update their scrollbar state +// so called when we have either scrolled to a new location +// or the size of document has changed +void ImpEditView::ScrollStateChange() +{ + if (EditViewCallbacks* pCallbacks = getEditViewCallbacks()) + pCallbacks->EditViewScrollStateChange(); +} + Pair ImpEditView::Scroll( long ndX, long ndY, ScrollRangeCheck nRangeCheck ) { DBG_ASSERT( pEditEngine->pImpEditEngine->IsFormatted(), "Scroll: Not formatted!" ); @@ -1561,6 +1570,9 @@ Pair ImpEditView::Scroll( long ndX, long ndY, ScrollRangeCheck nRangeCheck ) pEditEngine->pImpEditEngine->GetNotifyHdl().Call( aNotify ); } + if (EditViewCallbacks* pCallbacks = getEditViewCallbacks()) + pCallbacks->EditViewScrollStateChange(); + if (comphelper::LibreOfficeKit::isActive()) { DrawSelectionXOR(); diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx index 59db76fea44d..da33598365dd 100644 --- a/editeng/source/editeng/impedit.hxx +++ b/editeng/source/editeng/impedit.hxx @@ -390,6 +390,8 @@ public: void DrawSelectionXOR( EditSelection, vcl::Region* pRegion = nullptr, OutputDevice* pTargetDevice = nullptr ); void GetSelectionRectangles(EditSelection aTmpSel, std::vector<tools::Rectangle>& rLogicRects); + void ScrollStateChange(); + vcl::Window* GetWindow() const { return pOutWin; } void SetSelectionMode( EESelectionMode eMode ); diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index 3b362a7704d4..0d88eeba800d 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -399,7 +399,16 @@ void ImpEditEngine::FormatDoc() } bGrow = true; if ( IsCallParaInsertedOrDeleted() ) + { GetEditEnginePtr()->ParagraphHeightChanged( nPara ); + + for (EditView* pView : aEditViews) + { + ImpEditView* pImpView = pView->pImpEditView.get(); + pImpView->ScrollStateChange(); + } + + } pParaPortion->SetMustRepaint( false ); } |