include/svx/textchainflow.hxx | 15 ++++++++++--- svx/source/svdraw/textchainflow.cxx | 40 ++++++++++++++++++++++++++++++------ 2 files changed, 46 insertions(+), 9 deletions(-)
New commits: commit f175965e22c57565ee2ffd2105b4c26a817835ca Author: matteocam <matteo.campane...@gmail.com> Date: Mon Jun 29 13:59:33 2015 -0400 Moved editing-specific code Change-Id: I9fa410a60fb6341c5f031cc152141c03975b409e diff --git a/include/svx/textchainflow.hxx b/include/svx/textchainflow.hxx index 8528a9f..10ba90a 100644 --- a/include/svx/textchainflow.hxx +++ b/include/svx/textchainflow.hxx @@ -45,7 +45,7 @@ class TextChainFlow { void ExecuteUnderflow(SdrOutliner *); // Uses two outliners: one for the non-overfl text and one for overflowing (might be the same) - void ExecuteOverflow(SdrOutliner *, SdrOutliner *); + virtual void ExecuteOverflow(SdrOutliner *, SdrOutliner *); SdrTextObj *GetLinkTarget(); @@ -55,8 +55,8 @@ class TextChainFlow { TextChain *GetTextChain(); - void impLeaveOnlyNonOverflowingText(SdrOutliner *); - void impMoveChainedTextToNextLink(SdrOutliner *); + virtual void impLeaveOnlyNonOverflowingText(SdrOutliner *); + virtual void impMoveChainedTextToNextLink(SdrOutliner *); OutlinerParaObject *impGetNonOverflowingParaObject(SdrOutliner *pOutliner); OutlinerParaObject *impGetOverflowingParaObject(SdrOutliner *pOutliner); @@ -88,6 +88,15 @@ class EditingTextChainFlow : public TextChainFlow public: EditingTextChainFlow(SdrTextObj *); virtual void CheckForFlowEvents(SdrOutliner *) SAL_OVERRIDE; + + //virtual void ExecuteOverflow(SdrOutliner *, SdrOutliner *) SAL_OVERRIDE; + + + protected: + virtual void impLeaveOnlyNonOverflowingText(SdrOutliner *) SAL_OVERRIDE; + + virtual void impSetTextForEditingOutliner(OutlinerParaObject *); + }; #endif // INCLUDED_SVX_TEXTCHAINFLOW_HXX diff --git a/svx/source/svdraw/textchainflow.cxx b/svx/source/svdraw/textchainflow.cxx index ec5dc9a..652e803 100644 --- a/svx/source/svdraw/textchainflow.cxx +++ b/svx/source/svdraw/textchainflow.cxx @@ -63,7 +63,7 @@ void TextChainFlow::impCheckForFlowEvents(SdrOutliner *pFlowOutl, SdrOutliner *p if (pParamOutl != NULL) { // XXX: Set parameters - // XXX: does this work if you do it before setting the text? + // XXX: does this work if you do it before setting the text? Seems so. pFlowOutl->SetUpdateMode(true); pFlowOutl->SetMaxAutoPaperSize(pParamOutl->GetMaxAutoPaperSize()); pFlowOutl->SetMinAutoPaperSize(pParamOutl->GetMinAutoPaperSize()); @@ -152,15 +152,11 @@ void TextChainFlow::ExecuteOverflow(SdrOutliner *pNonOverflOutl, SdrOutliner *pO void TextChainFlow::impLeaveOnlyNonOverflowingText(SdrOutliner *pNonOverflOutl) { OutlinerParaObject *pNewText = impGetNonOverflowingParaObject(pNonOverflOutl); - - // XXX - if (mpTargetLink->pEdtOutl != NULL) { - mpTargetLink->pEdtOutl->SetText(*pNewText); - } // adds it to current outliner anyway (useful in static decomposition) pNonOverflOutl->SetText(*pNewText); mpTargetLink->NbcSetOutlinerParaObject(pNewText); + } void TextChainFlow::impMoveChainedTextToNextLink(SdrOutliner *pOverflOutl) @@ -308,4 +304,36 @@ void EditingTextChainFlow::CheckForFlowEvents(SdrOutliner *pFlowOutl) } +/* +void EditingTextChainFlow::ExecuteOverflow(SdrOutliner *pOutl1, SdrOutliner *pOutl2) +{ + + + impSetTextForEditingOutliner + + // Set cursor + pEditView->pImpEditView->SetEditSelection( aCurSel ); + pEditView->pImpEditView->DrawSelection(); + pEditView->ShowCursor( true, false ); + + +} +* +* */ + +void EditingTextChainFlow::impLeaveOnlyNonOverflowingText(SdrOutliner *pNonOverflOutl) +{ + OutlinerParaObject *pNewText = impGetNonOverflowingParaObject(pNonOverflOutl); + impSetTextForEditingOutliner(pNewText); + + GetLinkTarget()->NbcSetOutlinerParaObject(pNewText); +} + +void EditingTextChainFlow::impSetTextForEditingOutliner(OutlinerParaObject *pNewText) +{ + if (GetLinkTarget()->pEdtOutl != NULL) { + GetLinkTarget()->pEdtOutl->SetText(*pNewText); + } +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits