[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - svx/source
matteocam
matteo.campanelli at gmail.com
Thu Jul 31 12:28:41 PDT 2014
svx/source/svdraw/svdotextdecomposition.cxx | 58 ++++++++++++++--------------
svx/source/svdraw/svdotxed.cxx | 8 ---
2 files changed, 30 insertions(+), 36 deletions(-)
New commits:
commit d7270b2f63688bb09ed0a9328a2fde57b38eace6
Author: matteocam <matteo.campanelli at gmail.com>
Date: Thu Jul 31 22:28:15 2014 +0300
Copy second paragraph by impCopyTextInTextObj
Change-Id: Ia2131655e4c280c8f054dbd3dda2f230cabff415
diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx
index ad2cfe6..fdfabdd 100644
--- a/svx/source/svdraw/svdotextdecomposition.cxx
+++ b/svx/source/svdraw/svdotextdecomposition.cxx
@@ -775,35 +775,33 @@ void SdrTextObj::impCopyTextInTextObj(SdrTextObj *pNextTextObj) const
return;
// trying to copy text in obj 1
- SdrText* pText = getActiveText();
+ //SdrText* pText = getActiveText();
+
+ Rectangle &aNextRect = pNextTextObj->aRect;
+ SdrOutliner& rOutliner = pNextTextObj->ImpGetDrawOutliner();
+ rOutliner.SetPaperSize(
+ Size(
+ aNextRect.Right()-aNextRect.Left(),
+ aNextRect.Bottom()-aNextRect.Top()
+ )
+ );
+ rOutliner.SetUpdateMode(true);
+ rOutliner.SetText(*mpOverflowingText); // XXX: copies overflown text
+ Size aNewSize(rOutliner.CalcTextSize());
+ // create OutlinerParaObject for pNextTextObj
+ OutlinerParaObject* pNewParaObject=rOutliner.CreateParaObject();
+ rOutliner.Clear();
+
+ aNewSize.Width()++; // because of possible rounding errors
+ aNewSize.Width()+=GetTextLeftDistance()+GetTextRightDistance();
+ aNewSize.Height()+=GetTextUpperDistance()+GetTextLowerDistance();
+
+ Rectangle aNewRect(aNextRect);
+ aNewRect.SetSize(aNewSize);
+ pNextTextObj->ImpJustifyRect(aNewRect);
+ if (aNewRect!=aNextRect) {
+ pNextTextObj->SetLogicRect(aNewRect);
- if( pText!=NULL && pText->GetOutlinerParaObject() && pModel!=NULL)
- {
- Rectangle &aNextRect = pNextTextObj->aRect;
- SdrOutliner& rOutliner = pNextTextObj->ImpGetDrawOutliner();
- rOutliner.SetPaperSize(
- Size(
- aNextRect.Right()-aNextRect.Left(),
- aNextRect.Bottom()-aNextRect.Top()
- )
- );
- rOutliner.SetUpdateMode(true);
- rOutliner.SetText(*pText->GetOutlinerParaObject());
- Size aNewSize(rOutliner.CalcTextSize());
- // create OutlinerParaObject for pNextTextObj
- OutlinerParaObject* pNewParaObject=rOutliner.CreateParaObject();
- rOutliner.Clear();
-
- aNewSize.Width()++; // because of possible rounding errors
- aNewSize.Width()+=GetTextLeftDistance()+GetTextRightDistance();
- aNewSize.Height()+=GetTextUpperDistance()+GetTextLowerDistance();
-
- Rectangle aNewRect(aNextRect);
- aNewRect.SetSize(aNewSize);
- pNextTextObj->ImpJustifyRect(aNewRect);
- if (aNewRect!=aNextRect) {
- pNextTextObj->SetLogicRect(aNewRect);
- }
// Set text object's string
pNextTextObj->SetOutlinerParaObject( pNewParaObject );
@@ -1517,8 +1515,10 @@ void SdrTextObj::impDecomposeChainedTextPrimitive(
// put overflowing text in next text box
if (mpOverflowingText != NULL) {
SdrTextObj *pNextTextObj = GetNextLinkInChain();
- //pNextTextObj->SetOutlinerParaObject( mpOverflowingText );
+ assert (pNextTextObj);
+ impCopyTextInTextObj(pNextTextObj);
+ //pNextTextObj->SetOutlinerParaObject( mpOverflowingText );
//SdrOutliner rOutl = pNextTextObj->ImpGetDrawOutliner();
//pNextTextObj->BegTextEdit( rOutl );
// XXX: Also, will all those calls currently in impCopyTextInTextObj be necessary too?
diff --git a/svx/source/svdraw/svdotxed.cxx b/svx/source/svdraw/svdotxed.cxx
index ec533bb..cffa559 100644
--- a/svx/source/svdraw/svdotxed.cxx
+++ b/svx/source/svdraw/svdotxed.cxx
@@ -265,16 +265,10 @@ void SdrTextObj::EndTextEdit(SdrOutliner& rOutl)
{
// set non overflow part of text to current box
pNewText = rOutl.GetNonOverflowingParaObject();
- pNextText = rOutl.GetOverflowingParaObject();
// set overflowing text for SdrChainedTextPrimitive2D
+ pNextText = rOutl.GetOverflowingParaObject();
mpOverflowingText = pNextText;
//SetOverflowingText( pNextText );
-
- // XXX: should this SdrTextObj know "how much text to ask" by CreateParaObject?
- // No, it must be the editengine (or outliner) to give it since it is
- // a special case: we want to have something that may be interrupted
- // within a paragraph itself.
-
}
else // standard case
{
More information about the Libreoffice-commits
mailing list