include/svx/textchainflow.hxx | 16 ++++++++++++---- svx/source/svdraw/svdedxv.cxx | 1 - svx/source/svdraw/textchainflow.cxx | 22 ++++++++++++++-------- 3 files changed, 26 insertions(+), 13 deletions(-)
New commits: commit d59384c316e6a161ae86edcb8bfaa3b837ff33b8 Author: matteocam <matteo.campane...@gmail.com> Date: Wed Jul 8 11:30:31 2015 -0400 Change Cursor Info only in EditingTextChainFlow Change-Id: Iaf21679f416607c8c59d1c88484a306727abd7cc diff --git a/include/svx/textchainflow.hxx b/include/svx/textchainflow.hxx index 70ff6e4..ade3404 100644 --- a/include/svx/textchainflow.hxx +++ b/include/svx/textchainflow.hxx @@ -20,6 +20,9 @@ #ifndef INCLUDED_SVX_TEXTCHAINFLOW_HXX #define INCLUDED_SVX_TEXTCHAINFLOW_HXX + +#include <svx/textchain.hxx> + class SdrTextObj; class SdrOutliner; class NonOverflowingText; @@ -59,10 +62,11 @@ class TextChainFlow { // -- Protected Members -- protected: + CursorChainingEvent maCursorEvent; void impCheckForFlowEvents(SdrOutliner *, SdrOutliner *); - TextChain *GetTextChain(); + TextChain *GetTextChain() const; virtual void impLeaveOnlyNonOverflowingText(SdrOutliner *); virtual void impMoveChainedTextToNextLink(SdrOutliner *); @@ -77,7 +81,7 @@ class TextChainFlow { // -- Private Members -- private: - void impUpdateCursorEvent(SdrOutliner *, bool); + void impUpdateCursorInfo(SdrOutliner *, bool); SdrTextObj *mpTargetLink; SdrTextObj *mpNextLink; @@ -92,6 +96,7 @@ class TextChainFlow { OFlowChainedText *mpOverflChText; UFlowChainedText *mpUnderflChText; + // XXX: It would be nice to get rid of this bool mbOFisUFinduced; }; @@ -99,19 +104,22 @@ class TextChainFlow { // NOTE: EditingTextChainFlow might be strongly coupled with behavior in SdrTextObj::onChainingEvent class EditingTextChainFlow : public TextChainFlow { - public: +public: EditingTextChainFlow(SdrTextObj *); virtual void CheckForFlowEvents(SdrOutliner *) SAL_OVERRIDE; //virtual void ExecuteOverflow(SdrOutliner *, SdrOutliner *) SAL_OVERRIDE; - protected: +protected: virtual void impLeaveOnlyNonOverflowingText(SdrOutliner *) SAL_OVERRIDE; virtual void impSetTextForEditingOutliner(OutlinerParaObject *); virtual void impSetFlowOutlinerParams(SdrOutliner *, SdrOutliner *) SAL_OVERRIDE; +private: + void impBroadcasCursorInfo() const; + }; #endif // INCLUDED_SVX_TEXTCHAINFLOW_HXX diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx index 3b5f021..2b165c7 100644 --- a/svx/source/svdraw/svdedxv.cxx +++ b/svx/source/svdraw/svdedxv.cxx @@ -544,7 +544,6 @@ void SdrObjEditView::ImpMoveCursorAfterChainingEvent() case CursorChainingEvent::TO_NEXT_LINK: SdrEndTextEdit(); SdrBeginTextEdit(pNextLink); - //SdrEndTextEdit(true); //SdrBeginTextEdit(pNextLink, nullptr, nullptr, false, nullptr, nullptr, true, true); break; diff --git a/svx/source/svdraw/textchainflow.cxx b/svx/source/svdraw/textchainflow.cxx index 4b80ea4..2700bf3 100644 --- a/svx/source/svdraw/textchainflow.cxx +++ b/svx/source/svdraw/textchainflow.cxx @@ -18,7 +18,6 @@ */ -#include <svx/textchain.hxx> #include <svx/svdotext.hxx> #include <svx/svdoutl.hxx> #include <editeng/outlobj.hxx> @@ -38,6 +37,8 @@ TextChainFlow::TextChainFlow(SdrTextObj *pChainTarget) mpOverflChText = NULL; mpUnderflChText = NULL; + + maCursorEvent = CursorChainingEvent::UNCHANGED; } @@ -78,7 +79,7 @@ void TextChainFlow::impCheckForFlowEvents(SdrOutliner *pFlowOutl, SdrOutliner *p bOverflow = bIsPageOverflow && mpNextLink; bUnderflow = !bIsPageOverflow && mpNextLink && mpNextLink->HasText(); - impUpdateCursorEvent(pFlowOutl, bOverflow); + impUpdateCursorInfo(pFlowOutl, bOverflow); if (pParamOutl != NULL) { @@ -96,7 +97,7 @@ void TextChainFlow::impCheckForFlowEvents(SdrOutliner *pFlowOutl, SdrOutliner *p } -void TextChainFlow::impUpdateCursorEvent(SdrOutliner *, bool bIsOverflow) +void TextChainFlow::impUpdateCursorInfo(SdrOutliner *, bool bIsOverflow) { // XXX: Current implementation might create problems with UF- // In fact UF causes a @@ -105,12 +106,10 @@ void TextChainFlow::impUpdateCursorEvent(SdrOutliner *, bool bIsOverflow) if (bIsOverflow && !mbOFisUFinduced) { bool bCursorOut = true; // XXX: Should have real check if (bCursorOut) { - GetTextChain()->SetCursorEvent(GetLinkTarget(), - CursorChainingEvent::TO_NEXT_LINK); + maCursorEvent = CursorChainingEvent::TO_NEXT_LINK; } } else { - GetTextChain()->SetCursorEvent(GetLinkTarget(), - CursorChainingEvent::UNCHANGED); + maCursorEvent = CursorChainingEvent::UNCHANGED; } } @@ -210,7 +209,7 @@ OutlinerParaObject *TextChainFlow::impGetMergedUnderflowParaObject(SdrOutliner * return mpUnderflChText->CreateMergedUnderflowParaObject(pOutliner, mpNextLink->GetOutlinerParaObject()); } -TextChain *TextChainFlow::GetTextChain() +TextChain *TextChainFlow::GetTextChain() const { return mpTextChain; } @@ -241,6 +240,8 @@ void EditingTextChainFlow::CheckForFlowEvents(SdrOutliner *pFlowOutl) else impCheckForFlowEvents(pFlowOutl, GetLinkTarget()->pEdtOutl); + // Broadcast events for cursor handling + impBroadcasCursorInfo(); } /* @@ -286,6 +287,11 @@ void EditingTextChainFlow::impSetFlowOutlinerParams(SdrOutliner *pFlowOutl, SdrO //pFlowOutl->SetEditTextObjectPool(pParamOutl->GetEditTextObjectPool()); } +void EditingTextChainFlow::impBroadcasCursorInfo() const +{ + GetTextChain()->SetCursorEvent(GetLinkTarget(), maCursorEvent); +} + /* * * Some notes on how to set style sheets: _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits