[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - include/svx sd/source svx/source
matteocam
matteo.campanelli at gmail.com
Thu Jun 18 22:22:13 PDT 2015
include/svx/svdedxv.hxx | 1 +
include/svx/svdotext.hxx | 12 ++++++------
sd/source/ui/view/outlview.cxx | 1 +
svx/source/svdraw/svdedxv.cxx | 17 +++++++++++++++--
svx/source/svdraw/svdotext.cxx | 26 +++++++-------------------
svx/source/svdraw/svdotxed.cxx | 7 -------
6 files changed, 30 insertions(+), 34 deletions(-)
New commits:
commit b4143933ae098e985ec5bf5b7bd92dc4c7b35aa3
Author: matteocam <matteo.campanelli at gmail.com>
Date: Fri Jun 19 01:21:04 2015 -0400
Chaining handlers moved from SdrTextObj::*TextEdit to SdrObjEditView
Change-Id: I047433cdedeebb076d3e98e44209f3a582e31be1
diff --git a/include/svx/svdedxv.hxx b/include/svx/svdedxv.hxx
index 0a8eeac..1bedfce 100644
--- a/include/svx/svdedxv.hxx
+++ b/include/svx/svdedxv.hxx
@@ -117,6 +117,7 @@ protected:
// Handler fuer AutoGrowing und Chained Text bei aktivem Outliner
DECL_LINK(ImpOutlinerStatusEventHdl,EditStatus*);
+ DECL_LINK(ImpChainingEventHdl,void*);
DECL_LINK(ImpOutlinerCalcFieldValueHdl,EditFieldInfo*);
// link for EndTextEditHdl
diff --git a/include/svx/svdotext.hxx b/include/svx/svdotext.hxx
index 9dcb58a..e66dff0 100644
--- a/include/svx/svdotext.hxx
+++ b/include/svx/svdotext.hxx
@@ -323,6 +323,10 @@ protected:
virtual ~SdrTextObj();
+ virtual void onOverflowStatusEvent( );
+ virtual void onUnderflowStatusEvent( );
+
+
public:
TYPEINFO_OVERRIDE();
@@ -548,9 +552,8 @@ public:
/** called from the SdrObjEditView during text edit when the status of the edit outliner changes */
virtual void onEditOutlinerStatusEvent( EditStatus* pEditStatus );
-
- virtual void onOverflowStatusEvent( );
- virtual void onUnderflowStatusEvent( );
+ /** called from the SdrObjEditView during text edit when a chain of boxes is to be updated */
+ virtual void onChainingEvent();
@@ -621,9 +624,6 @@ public:
void impLeaveOnlyNonOverflowingText(SdrOutliner *pOutliner) const;
OutlinerParaObject *impGetNonOverflowingParaObject(SdrOutliner *pOutliner) const;
- // Handler for Chained Text
- DECL_LINK(ImpDecomposeChainedText,void*);
-
// timing generators
void impGetBlinkTextTiming(drawinglayer::animation::AnimationEntryList& rAnimList) const;
void impGetScrollTextTiming(drawinglayer::animation::AnimationEntryList& rAnimList, double fFrameLength, double fTextLength) const;
diff --git a/sd/source/ui/view/outlview.cxx b/sd/source/ui/view/outlview.cxx
index 4436bdd..543b59c 100644
--- a/sd/source/ui/view/outlview.cxx
+++ b/sd/source/ui/view/outlview.cxx
@@ -1413,6 +1413,7 @@ void OutlineView::ResetLinks() const
mrOutliner.SetDrawPortionHdl(aEmptyLink);
mrOutliner.SetBeginPasteOrDropHdl(aEmptyLink);
mrOutliner.SetEndPasteOrDropHdl(aEmptyLink);
+ mrOutliner.SetChainingEventHdl(aEmptyLink);
}
sal_Int8 OutlineView::AcceptDrop( const AcceptDropEvent&, DropTargetHelper&, ::sd::Window*, sal_uInt16, sal_uInt16)
diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index e334ecc..e6f2cc9 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -472,6 +472,19 @@ IMPL_LINK(SdrObjEditView,ImpOutlinerStatusEventHdl,EditStatus*,pEditStat)
return 0;
}
+IMPL_LINK_NOARG(SdrObjEditView,ImpChainingEventHdl)
+{
+ if(pTextEditOutliner )
+ {
+ SdrTextObj* pTextObj = dynamic_cast< SdrTextObj * >( mxTextEditObj.get() );
+ if( pTextObj )
+ {
+ pTextObj->onChainingEvent();
+ }
+ }
+ return 0;
+}
+
IMPL_LINK(SdrObjEditView,ImpOutlinerCalcFieldValueHdl,EditFieldInfo*,pFI)
{
bool bOk=false;
@@ -712,8 +725,8 @@ bool SdrObjEditView::SdrBeginTextEdit(
pTextEditOutlinerView->ShowCursor();
pTextEditOutliner->SetStatusEventHdl(LINK(this,SdrObjEditView,ImpOutlinerStatusEventHdl));
- // FIXME(matteocam) // For chaining
- //pTextEditOutliner->SetStatusEventHdl1(LINK(this,SdrObjEditView,ImpOutlinerStatusEventHdl));
+ pTextEditOutliner->SetChainingEventHdl(LINK(this,SdrObjEditView,ImpChainingEventHdl) );
+
#ifdef DBG_UTIL
if (pItemBrowser!=NULL) pItemBrowser->SetDirty();
#endif
diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx
index 911dadc..b6b390e 100644
--- a/svx/source/svdraw/svdotext.cxx
+++ b/svx/source/svdraw/svdotext.cxx
@@ -1986,16 +1986,6 @@ void SdrTextObj::onOverflowStatusEvent( )
void SdrTextObj::onUnderflowStatusEvent( )
{
- // Underflow:
- /*
- *
- * If there is no overflow and other guy has text then:
- * 1) get the text of the other guy and add it to the last paragraph
- * (if the paragraphs are to be merged, no otherwise).
- * 2) Set the text of the other guy to what is left
- *
- */
-
SdrTextObj *pNextLink = GetNextLinkInChain();
SdrOutliner &aDrawOutliner = ImpGetDrawOutliner();
@@ -2008,14 +1998,13 @@ void SdrTextObj::onUnderflowStatusEvent( )
if (!pNextLink->HasText())
return;
-
-
// 1) get the text of the other guy and add it to the last paragraph
// XXX: For now it's not merging anything just adding the while thing as a separate para
OutlinerParaObject *pNextLinkWholeText = pNextLink->GetOutlinerParaObject();
if (pNextLinkWholeText) {
- // Set text from this object
+
OutlinerParaObject *pCurText = GetOutlinerParaObject();
+ // NewTextForCurBox = Txt(CurBox) ++ Txt(NextBox)
aDrawOutliner.SetText(*pCurText);
aDrawOutliner.AddText(*pNextLinkWholeText);
OutlinerParaObject *pNewText = aDrawOutliner.CreateParaObject();
@@ -2030,9 +2019,8 @@ void SdrTextObj::onUnderflowStatusEvent( )
if (pEdtOutl != NULL)
pEdtOutl->SetText(*pNewText);
- const_cast<SdrTextObj*>(this)->NbcSetOutlinerParaObject(pNewText);
+ //const_cast<SdrTextObj*>(this)->NbcSetOutlinerParaObject(pNewText);
}
-
}
/** returns the currently active text. */
@@ -2128,13 +2116,13 @@ bool SdrTextObj::GetPreventChainable() const
return pClone;
}
-IMPL_LINK_NOARG(SdrTextObj,ImpDecomposeChainedText)
+void SdrTextObj::onChainingEvent()
{
if (!IsChainable() || GetNextLinkInChain() == NULL)
- return 0;
+ return;
if (!pEdtOutl)
- return 0;
+ return;
bool bIsPageOverflow = pEdtOutl->IsPageOverflow();
@@ -2148,7 +2136,7 @@ IMPL_LINK_NOARG(SdrTextObj,ImpDecomposeChainedText)
} else {
onUnderflowStatusEvent();
}
- return 0;
+ return;
}
diff --git a/svx/source/svdraw/svdotxed.cxx b/svx/source/svdraw/svdotxed.cxx
index 3fcd600..3487cd5 100644
--- a/svx/source/svdraw/svdotxed.cxx
+++ b/svx/source/svdraw/svdotxed.cxx
@@ -126,10 +126,6 @@ bool SdrTextObj::BegTextEdit(SdrOutliner& rOutl)
rOutl.UpdateFields();
rOutl.ClearModifyFlag();
- // FIXME(matteocam)
- // XXX: Possibly move this (and respective setting line in BegTextEdit) in SdrObjEditView::SdrEnd(Begin)TextEdit?
- rOutl.SetChainingEventHdl(LINK(this,SdrTextObj,ImpDecomposeChainedText) );
-
return true;
}
@@ -290,9 +286,6 @@ void SdrTextObj::EndTextEdit(SdrOutliner& rOutl)
// we do not need the bookmark at the overflowing check anymore.
rOutl.ClearOverflowingParaNum();
- // FIXME(matteocam)
- rOutl.SetChainingEventHdl(Link());
-
pEdtOutl = NULL;
rOutl.Clear();
sal_uInt32 nStat = rOutl.GetControlWord();
More information about the Libreoffice-commits
mailing list