[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source include/svx svx/source
matteocam
matteo.campanelli at gmail.com
Mon Jun 8 14:02:13 PDT 2015
editeng/source/editeng/impedit.hxx | 7 +++---
editeng/source/editeng/impedit3.cxx | 31 +++++++++++++---------------
include/svx/svdotext.hxx | 2 -
svx/source/svdraw/svdotext.cxx | 4 +--
svx/source/svdraw/svdotextdecomposition.cxx | 14 +++++++++---
5 files changed, 32 insertions(+), 26 deletions(-)
New commits:
commit 2e80a08b2b600069452c0109e598736de5138639
Author: matteocam <matteo.campanelli at gmail.com>
Date: Mon Jun 8 17:00:11 2015 -0400
Fixed chaining handlers in ImpEditEng. Checked for pEdtOutl
Change-Id: I193d623a109ee751af30971c5b51e4715c59d147
diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx
index 4bc4eb5..578371d 100644
--- a/editeng/source/editeng/impedit.hxx
+++ b/editeng/source/editeng/impedit.hxx
@@ -467,6 +467,7 @@ private:
// For Chaining
sal_Int32 mnOverflowingPara = -1;
sal_Int32 mnOverflowingLine = -1;
+ bool mbNeedsChainingHandling = false;
IdleFormattter aIdleFormatter;
@@ -476,7 +477,7 @@ private:
// this should not happen immediately (critical section):
Timer aStatusTimer;
Link aStatusHdlLink;
- Link aStatusHdlLinkChaining;
+ Link aChainingHdlLink;
Link aNotifyHdl;
Link aImportHdl;
Link aBeginMovingParagraphsHdl;
@@ -848,7 +849,7 @@ public:
void SetStatusEventHdl( const Link& rLink ) { aStatusHdlLink = rLink; }
Link GetStatusEventHdl() const { return aStatusHdlLink; }
- void SetChainingEventHdl( const Link& rLink ) { aStatusHdlLinkChaining = rLink; }
+ void SetChainingEventHdl( const Link& rLink ) { aChainingHdlLink = rLink; }
void SetNotifyHdl( const Link& rLink ) { aNotifyHdl = rLink; }
Link GetNotifyHdl() const { return aNotifyHdl; }
@@ -886,7 +887,7 @@ public:
InternalEditStatus& GetStatus() { return aStatus; }
void CallStatusHdl();
- void CallStatusHdlChaining();
+ void CallChainingEventHdl();
void DelayedCallStatusHdl() { aStatusTimer.Start(); }
void CallNotify( EENotify& rNotify );
diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx
index 54554af..6e06ac2 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -505,26 +505,11 @@ void ImpEditEngine::FormatDoc()
CallStatusHdl(); // If Modified...
//FIXME(matteocam)
- CallStatusHdlChaining(); // XXX: hard coded for chaining
+ CallChainingEventHdl(); // For chaining
LeaveBlockNotifications();
}
-void ImpEditEngine::CallStatusHdlChaining()
-{
- // only if it's the right ImpEditEngine (with right info on changes in text)
- if ( aStatusHdlLinkChaining.IsSet() /* && aStatus.GetStatusWord() */)
- {
- CheckPageOverflow();
- // The Status has to be reset before the Call,
- // since other Flags might be set in the handler...
- EditStatus aTmpStatus( aStatus );
- aStatus.Clear();
- aStatusHdlLinkChaining.Call( &aTmpStatus );
- aStatusTimer.Stop(); // If called by hand ...
- }
-}
-
bool ImpEditEngine::ImpCheckRefMapMode()
{
bool bChange = false;
@@ -624,10 +609,12 @@ void ImpEditEngine::CheckPageOverflow()
// which paragraph is the first to cause higher size of the box?
ImplUpdateOverflowingParaNum( nBoxHeight); // XXX: currently only for horizontal text
aStatus.SetPageOverflow(true);
+ mbNeedsChainingHandling = true;
} else
{
// No overflow if withing box boundaries
aStatus.SetPageOverflow(false);
+ mbNeedsChainingHandling = false;
}
}
@@ -4095,6 +4082,18 @@ void ImpEditEngine::CallStatusHdl()
}
}
+void ImpEditEngine::CallChainingEventHdl()
+{
+ // only if it's the right ImpEditEngine (with right info on changes in text)
+ if ( aChainingHdlLink.IsSet() /* && aStatus.GetStatusWord() */)
+ {
+ CheckPageOverflow();
+ aChainingHdlLink.Call( &mbNeedsChainingHandling );
+
+ }
+}
+
+
ContentNode* ImpEditEngine::GetPrevVisNode( ContentNode* pCurNode )
{
const ParaPortion* pPortion = FindParaPortion( pCurNode );
diff --git a/include/svx/svdotext.hxx b/include/svx/svdotext.hxx
index 1da98d9..7583736 100644
--- a/include/svx/svdotext.hxx
+++ b/include/svx/svdotext.hxx
@@ -612,7 +612,7 @@ public:
void impLeaveOnlyNonOverflowingText() const;
// Handler for Chained Text
- DECL_LINK(ImpDecomposeChainedText,bool);
+ DECL_LINK(ImpDecomposeChainedText,bool*);
// timing generators
void impGetBlinkTextTiming(drawinglayer::animation::AnimationEntryList& rAnimList) const;
diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx
index 243cdef..519c5f8 100644
--- a/svx/source/svdraw/svdotext.cxx
+++ b/svx/source/svdraw/svdotext.cxx
@@ -2052,9 +2052,9 @@ SdrTextObj* SdrTextObj::GetNextLinkInChain() const
}
-IMPL_LINK(SdrTextObj,ImpDecomposeChainedText,bool,bIsPageOverflow)
+IMPL_LINK(SdrTextObj,ImpDecomposeChainedText,bool*,bIsPageOverflow)
{
- onOverflowStatusEvent( bIsPageOverflow );
+ onOverflowStatusEvent( *bIsPageOverflow );
return 0;
}
diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx
index 71ae619..a07b718 100644
--- a/svx/source/svdraw/svdotextdecomposition.cxx
+++ b/svx/source/svdraw/svdotextdecomposition.cxx
@@ -730,12 +730,18 @@ void SdrTextObj::impDecomposeContourTextPrimitive(
OutlinerParaObject *SdrTextObj::impGetNonOverflowingParaObject() const
{
+ NonOverflowingText *pNonOverflowingTxt;
// Cut non overflowing text
- NonOverflowingText *pNonOverflowingTxt =
- pEdtOutl->GetNonOverflowingText();
+ if (pEdtOutl != NULL)
+ pNonOverflowingTxt =
+ pEdtOutl->GetNonOverflowingText();
+ else
+ pNonOverflowingTxt =
+ ImpGetDrawOutliner().GetNonOverflowingText();
+
SdrOutliner &rOutliner = ImpGetDrawOutliner();
rOutliner.Clear();
- rOutliner.SetStyleSheet( 0, pEdtOutl->GetStyleSheet(0));
+ //rOutliner.SetStyleSheet( 0, pEdtOutl->GetStyleSheet(0));
if (pNonOverflowingTxt->mPreOverflowingTxt == "" &&
pNonOverflowingTxt->mpHeadParas != NULL) {
@@ -748,7 +754,7 @@ OutlinerParaObject *SdrTextObj::impGetNonOverflowingParaObject() const
rOutliner.SetText(pNonOverflowingTxt->mPreOverflowingTxt, pTmpPara0);
OutlinerParaObject *pPObj = rOutliner.CreateParaObject();
rOutliner.Clear();
- rOutliner.SetStyleSheet( 0, pEdtOutl->GetStyleSheet(0));
+ //rOutliner.SetStyleSheet( 0, pEdtOutl->GetStyleSheet(0));
if (pNonOverflowingTxt->mpHeadParas != NULL)
rOutliner.SetText(*pNonOverflowingTxt->mpHeadParas);
More information about the Libreoffice-commits
mailing list