[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source svx/source

2015-07-14 Thread matteocam
 editeng/source/editeng/impedit3.cxx |2 +-
 svx/source/svdraw/svdedxv.cxx   |   13 -
 2 files changed, 9 insertions(+), 6 deletions(-)

New commits:
commit 89c288be6f20141ad6e29374dc3c4e7084dcc348
Author: matteocam matteo.campane...@gmail.com
Date:   Tue Jul 14 20:03:31 2015 -0400

Handle UF/OF from KeyInput only

Change-Id: Icf9a248450ac6e03d6aab6c3e7d202aab7b3a171

diff --git a/editeng/source/editeng/impedit3.cxx 
b/editeng/source/editeng/impedit3.cxx
index 82fd6cd..f564a78 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -481,7 +481,7 @@ void ImpEditEngine::FormatDoc()
 
 //FIXME(matteocam)
 
-CallChainingEventHdl(); // For chaining
+//CallChainingEventHdl(); // For chaining
 
 LeaveBlockNotifications();
 }
diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index 7314e41..4bbb28d 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -540,11 +540,12 @@ void SdrObjEditView::ImpMoveCursorAfterChainingEvent()
 OutlinerView* pOLV = GetTextEditOutlinerView();
 
 TextChain *pTextChain = pTextObj-GetTextChain();
+ESelection aNewSel = pTextChain-GetPostChainingSel(pTextObj);
 
 switch ( pTextChain-GetCursorEvent(pTextObj) ) {
 
 case CursorChainingEvent::UNCHANGED:
-// Set same selection as before the chainging
+// Set same selection as before the chaining
 // We need an explicit set because the Outliner is messed up
 //after text transfer and otherwise it brings us at 
arbitrary positions.
 pOLV-SetSelection(pTextChain-GetPreChainingSel(pTextObj));
@@ -554,8 +555,7 @@ void SdrObjEditView::ImpMoveCursorAfterChainingEvent()
 SdrBeginTextEdit(pNextLink);
 // OutlinerView has changed, so we update the pointer
 pOLV = GetTextEditOutlinerView();
-pOLV-SetSelection(pTextChain-GetPostChainingSel(pTextObj)); 
// XXX
-
+pOLV-SetSelection(aNewSel); // XXX
 break;
 case CursorChainingEvent::TO_PREV_LINK:
 // XXX: To be handled
@@ -1294,14 +1294,17 @@ bool SdrObjEditView::KeyInput(const KeyEvent rKEvt, 
vcl::Window* pWin)
 pMod-SetChanged( true );
 }
 
+// FIXME(matteocam)
+ImpChainingEventHdl(NULL);
+ImpMoveCursorAfterChainingEvent();
+
 if (pWin!=NULL  pWin!=pTextEditWin) SetTextEditWin(pWin);
 #ifdef DBG_UTIL
 if (pItemBrowser!=nullptr) pItemBrowser-SetDirty();
 #endif
 ImpMakeTextCursorAreaVisible();
 
-// FIXME(matteocam)
-ImpMoveCursorAfterChainingEvent();
+
 
 return true;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source svx/source

2015-06-18 Thread matteocam
 editeng/source/outliner/overflowingtxt.cxx  |2 +-
 svx/source/svdraw/svdotextdecomposition.cxx |8 ++--
 2 files changed, 7 insertions(+), 3 deletions(-)

New commits:
commit 83e85d7477b962454d8dd39f208fa7c276fe25fb
Author: matteocam matteo.campane...@gmail.com
Date:   Fri Jun 19 00:09:29 2015 -0400

Changed way of adding ending lines for overwriting case (no insert)

Change-Id: Ie13acc2e6eadb0d9b87ceaa44e21d1b9952d606e

diff --git a/editeng/source/outliner/overflowingtxt.cxx 
b/editeng/source/outliner/overflowingtxt.cxx
index 99b2250..196d1f8 100644
--- a/editeng/source/outliner/overflowingtxt.cxx
+++ b/editeng/source/outliner/overflowingtxt.cxx
@@ -27,7 +27,7 @@ OUString OverflowingText::GetEndingLines() const
 {
 // If the only overflowing part is some lines in a paragraph,
 // the end of the overflowing text is its head.
-if (mTailTxt ==   mpMidParas == NULL)
+if (!HasOtherParas())
 return mHeadTxt;
 
 return mTailTxt;
diff --git a/svx/source/svdraw/svdotextdecomposition.cxx 
b/svx/source/svdraw/svdotextdecomposition.cxx
index 7fb4dc6..0868bf7 100644
--- a/svx/source/svdraw/svdotextdecomposition.cxx
+++ b/svx/source/svdraw/svdotextdecomposition.cxx
@@ -805,16 +805,20 @@ OutlinerParaObject 
*SdrTextObj::impGetOverflowingParaObject(SdrOutliner *pOutlin
 GetTextChain()-SetOverwriteOnOverflow(pNextTextObj, false);
 
 if (mpOverflowingText-HasOtherParas()) {
-// Make first paragraph
+// Make Para Object from the ending lines (to be appended later)
 impSetOutlinerToEmptyTxt(pOutliner);
 Paragraph *pFstPara = pOutliner-GetParagraph(0);
+pOutliner-SetText(mpOverflowingText-GetEndingLines(), pFstPara);
+OutlinerParaObject *pLastPara = pOutliner-CreateParaObject();
+
+// Set heading lines as first paragraph
 pOutliner-SetText(mpOverflowingText-GetHeadingLines(), pFstPara);
 
 // Add middle paragraphs
 if (mpOverflowingText-mpMidParas)
 pOutliner-AddText(*mpOverflowingText-mpMidParas);
 
-pOutliner-Insert(mpOverflowingText-GetEndingLines());
+pOutliner-AddText(*pLastPara);
 } else {
 impSetOutlinerToEmptyTxt(pOutliner);
 Paragraph *pFstPara = pOutliner-GetParagraph(0);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source svx/source

2015-06-15 Thread matteocam
 editeng/source/editeng/impedit3.cxx |8 +++-
 svx/source/svdraw/svdotextdecomposition.cxx |4 +++-
 2 files changed, 10 insertions(+), 2 deletions(-)

New commits:
commit f43791f1a6e6f3d978eeb46479b3a26b51b53ec6
Author: matteocam matteo.campane...@gmail.com
Date:   Mon Jun 15 15:47:45 2015 -0400

No overflow if only empty para (prevents infinite loop)

Change-Id: Ic11b127239542bf3cd8fde725ff9d88db4a29928

diff --git a/editeng/source/editeng/impedit3.cxx 
b/editeng/source/editeng/impedit3.cxx
index 91c6d58..13e6030 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -592,7 +592,13 @@ void ImpEditEngine::CheckPageOverflow()
 
 sal_uInt32 nTxtHeight = CalcTextHeight(NULL);
 
-if (nTxtHeight  nBoxHeight)
+sal_uInt32 nParaCount = GetParaPortions().Count();
+sal_uInt32 nFirstLineCount = GetLineCount(0);
+bool bOnlyOneEmptyPara = (nParaCount == 1) 
+(nFirstLineCount == 1) 
+(GetLineLen(0,0) == 0);
+
+if (nTxtHeight  nBoxHeight  !bOnlyOneEmptyPara)
 {
 // which paragraph is the first to cause higher size of the box?
 ImplUpdateOverflowingParaNum( nBoxHeight); // XXX: currently only for 
horizontal text
diff --git a/svx/source/svdraw/svdotextdecomposition.cxx 
b/svx/source/svdraw/svdotextdecomposition.cxx
index 87e0559..45edac2 100644
--- a/svx/source/svdraw/svdotextdecomposition.cxx
+++ b/svx/source/svdraw/svdotextdecomposition.cxx
@@ -765,10 +765,12 @@ OutlinerParaObject 
*SdrTextObj::impGetNonOverflowingParaObject(SdrOutliner *pOut
 if (pNonOverflowingTxt-mpHeadParas != NULL) {
 pOutliner-SetText(*pNonOverflowingTxt-mpHeadParas);
 pOutliner-AddText(*pPObj);
- } else { // set empty paraObj
+ } else  if (pNonOverflowingTxt-mPreOverflowingTxt != ) { // only 
preoverflowing txt
 //OutlinerParaObject *pEmptyPObj = pOutliner-GetEmptyParaObject();
 //pOutliner-SetText(*pEmptyPObj);
 pOutliner-SetText(*pPObj);
+} else { // no text // This case is redundant but it doesn't hurt for 
now
+pOutliner-Clear();
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source svx/source

2015-06-01 Thread matteocam
 editeng/source/editeng/editeng.cxx  |1 +
 editeng/source/outliner/outliner.cxx|1 +
 svx/source/svdraw/svdotextdecomposition.cxx |   18 +-
 3 files changed, 3 insertions(+), 17 deletions(-)

New commits:
commit 80150428de1867ae4bafd61b32c79b8dcc587885
Author: matteocam matteo.campane...@gmail.com
Date:   Mon Jun 1 16:58:05 2015 -0400

Created header for OverflowingText

Change-Id: I98cd9c8ea91ce065efc242a9302ca59976f5bb20

diff --git a/editeng/source/editeng/editeng.cxx 
b/editeng/source/editeng/editeng.cxx
index 35e6515..6193b98 100644
--- a/editeng/source/editeng/editeng.cxx
+++ b/editeng/source/editeng/editeng.cxx
@@ -59,6 +59,7 @@
 #include editeng/emphasismarkitem.hxx
 #include editeng/charscaleitem.hxx
 #include editeng/charreliefitem.hxx
+#include editeng/overflowingtxt.hxx
 
 #include sot/exchange.hxx
 #include sot/formats.hxx
diff --git a/editeng/source/outliner/outliner.cxx 
b/editeng/source/outliner/outliner.cxx
index 52a0f18..909e821 100644
--- a/editeng/source/outliner/outliner.cxx
+++ b/editeng/source/outliner/outliner.cxx
@@ -37,6 +37,7 @@
 #include editeng/eeitem.hxx
 #include editeng/editstat.hxx
 #include editeng/scripttypeitem.hxx
+#include editeng/overflowingtxt.hxx
 #include editeng/editobj.hxx
 #include svl/itemset.hxx
 #include svl/whiter.hxx
diff --git a/svx/source/svdraw/svdotextdecomposition.cxx 
b/svx/source/svdraw/svdotextdecomposition.cxx
index bf81c09..30f1fcc 100644
--- a/svx/source/svdraw/svdotextdecomposition.cxx
+++ b/svx/source/svdraw/svdotextdecomposition.cxx
@@ -49,6 +49,7 @@
 #include drawinglayer/geometry/viewinformation2d.hxx
 #include editeng/outlobj.hxx
 #include editeng/editobj.hxx
+#include editeng/overflowingtxt.hxx
 #include basegfx/matrix/b2dhommatrixtools.hxx
 
 
@@ -744,23 +745,6 @@ void SdrTextObj::impCopyTextInTextObj2(SdrTextObj 
*pNextTextObj) const
 
 
rOutliner.SetStatusEventHdl1(LINK(this,SdrTextObj,ImpDecomposeChainedText));
 
-struct OverflowingText {
-OUString mHeadTxt;
-const OutlinerParaObject *mpMidParas;
-OUString mTailTxt;
-// NOTE: mpMidParas and mTailTxt might be empty
-
-// Constructor
-OverflowingText(
-const OUString headTxt,
-const OutlinerParaObject *pMidParas = NULL,
-const OUString tailTxt = )
-: mHeadTxt(headTxt),
-  mpMidParas(pMidParas),
-  mTailTxt(tailTxt)
-{ }
-};
-
 OverflowingText aOverflowingTxt =
 OverflowingText(headTxt (On its own), NULL, I'm Appended to #);
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source svx/source

2015-06-01 Thread matteocam
 editeng/source/editeng/impedit.hxx  |6 ++--
 editeng/source/editeng/impedit3.cxx |   40 
 svx/source/svdraw/svdotextdecomposition.cxx |2 -
 3 files changed, 40 insertions(+), 8 deletions(-)

New commits:
commit 10c03833f92274e5cbb063ccec910a2b379341fa
Author: matteocam matteo.campane...@gmail.com
Date:   Mon Jun 1 16:35:43 2015 -0400

Can detect first line of overflowing

Change-Id: I18f4f00a49be9b257ea8d3f5acb7e811905b1548

diff --git a/editeng/source/editeng/impedit.hxx 
b/editeng/source/editeng/impedit.hxx
index 559a1dd..6eabd9c 100644
--- a/editeng/source/editeng/impedit.hxx
+++ b/editeng/source/editeng/impedit.hxx
@@ -466,6 +466,7 @@ private:
 
 // For Chaining
 sal_Int32 mnOverflowingPara = -1;
+sal_Int32 mnOverflowingLine = -1;
 
 IdleFormattter  aIdleFormatter;
 
@@ -691,6 +692,8 @@ private:
 const ParaPortionList  GetParaPortions() const { return aParaPortionList; 
}
 ParaPortionListGetParaPortions()   { return aParaPortionList; 
}
 
+void ImplUpdateOverflowingParaNum( sal_uInt32 );
+void ImplUpdateOverflowingLineNum( sal_uInt32, sal_uInt32, sal_uInt32 );
 protected:
 virtual voidNotify( SfxBroadcaster rBC, const SfxHint rHint 
) SAL_OVERRIDE;
 
@@ -1028,9 +1031,8 @@ public:
 boolIsFirstWordCapitalization() const   { return 
bFirstWordCapitalization; }
 
 sal_Int32 GetOverflowingParaNum() const { return mnOverflowingPara; }
-void SetOverflowingParaNum(sal_Int32 nPara) { mnOverflowingPara = nPara; }
+sal_Int32 GetOverflowingLineNum() const { return mnOverflowingLine; }
 void ClearOverflowingParaNum() { mnOverflowingPara = -1; }
-void UpdateOverflowingParaNum( sal_uInt32 );
 };
 
 inline EPaM ImpEditEngine::CreateEPaM( const EditPaM rPaM )
diff --git a/editeng/source/editeng/impedit3.cxx 
b/editeng/source/editeng/impedit3.cxx
index 3f8895f..54554af 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -617,10 +617,12 @@ void ImpEditEngine::CheckPageOverflow()
 fprintf(stderr, [OVERFLOW-CHECK] Current MaxAutoPaperSize is %d\n, 
nBoxHeight);
 fprintf(stderr, [CONTROL_STATUS] AutoPageSize is %s,  ( 
aStatus.GetControlWord()  EE_CNTRL_AUTOPAGESIZE ) ? ON\n : OFF\n );
 
-if (CalcTextHeight(NULL)  nBoxHeight)
+sal_uInt32 nTxtHeight = CalcTextHeight(NULL);
+
+if (nTxtHeight  nBoxHeight)
 {
 // which paragraph is the first to cause higher size of the box?
-UpdateOverflowingParaNum( nBoxHeight); // XXX: currently only for 
horizontal text
+ImplUpdateOverflowingParaNum( nBoxHeight); // XXX: currently only for 
horizontal text
 aStatus.SetPageOverflow(true);
 } else
 {
@@ -4632,7 +4634,7 @@ void ImpEditEngine::ImplExpandCompressedPortions( 
EditLine* pLine, ParaPortion*
 }
 }
 
-void ImpEditEngine::UpdateOverflowingParaNum(sal_uInt32 nPaperHeight)
+void ImpEditEngine::ImplUpdateOverflowingParaNum(sal_uInt32 nPaperHeight)
 {
 sal_uInt32 nY = 0;
 sal_uInt32 nPH;
@@ -4643,11 +4645,39 @@ void ImpEditEngine::UpdateOverflowingParaNum(sal_uInt32 
nPaperHeight)
 nY += nPH;
 if ( nY  nPaperHeight /*nCurTextHeight*/ ) // found first paragraph 
overflowing
 {
-SetOverflowingParaNum( nPara );
-fprintf(stderr, [CHAINING] Setting first overflowing para: %d\n, 
nPara);
+mnOverflowingPara = nPara;
+fprintf(stderr, [CHAINING] Setting first overflowing #Para#: 
%d\n, nPara);
+ImplUpdateOverflowingLineNum( nPaperHeight, nPara, nY-nPH);
 return;
 }
 }
 }
 
+void ImpEditEngine::ImplUpdateOverflowingLineNum(sal_uInt32 nPaperHeight,
+ sal_uInt32 nOverflowingPara,
+ sal_uInt32 
nHeightBeforeOverflowingPara)
+{
+sal_uInt32 nY = nHeightBeforeOverflowingPara;
+sal_uInt32 nLH;
+
+ParaPortion *pPara = GetParaPortions()[nOverflowingPara];
+
+// Like UpdateOverflowingParaNum but for each line in the first
+//  overflowing paragraph.
+for ( sal_Int32 nLine = 0; nLine  pPara-GetLines().Count(); nLine++ ) {
+EditLine *pLine = pPara-GetLines()[nLine];
+nLH = pLine-GetHeight();
+nY += nLH;
+if ( nY  nPaperHeight ) // found first line overflowing
+{
+mnOverflowingLine = nLine;
+fprintf(stderr, [CHAINING] Setting first overflowing -Line- to: 
%d\n, nLine);
+return;
+}
+}
+
+
+
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/svdraw/svdotextdecomposition.cxx 
b/svx/source/svdraw/svdotextdecomposition.cxx
index 6f29f26..bf81c09 100644
--- a/svx/source/svdraw/svdotextdecomposition.cxx
+++ b/svx/source/svdraw/svdotextdecomposition.cxx
@@ -762,7 +762,7 @@ void SdrTextObj::impCopyTextInTextObj2(SdrTextObj 
*pNextTextObj) const
 };
 
 

[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source svx/source

2014-09-21 Thread matteocam
 editeng/source/editeng/impedit3.cxx  |2 +
 svx/source/sdr/primitive2d/sdrdecompositiontools.cxx |4 +++
 svx/source/svdraw/svdotext.cxx   |   22 ---
 3 files changed, 25 insertions(+), 3 deletions(-)

New commits:
commit 9b08fb53a582938267c2470be5fcd1d41e43b074
Author: matteocam matteo.campane...@gmail.com
Date:   Sun Sep 21 20:22:51 2014 -0400

Added debugging output for referred SdrTextObj when making a new text prim.

Change-Id: I808456d0fa051a7040c4247c51e4ed4925cff010

diff --git a/editeng/source/editeng/impedit3.cxx 
b/editeng/source/editeng/impedit3.cxx
index db962b5..3f8895f 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -614,6 +614,8 @@ void ImpEditEngine::CheckPageOverflow()
 // setting overflow status
 
 sal_uInt32 nBoxHeight = GetMaxAutoPaperSize().Height();
+fprintf(stderr, [OVERFLOW-CHECK] Current MaxAutoPaperSize is %d\n, 
nBoxHeight);
+fprintf(stderr, [CONTROL_STATUS] AutoPageSize is %s,  ( 
aStatus.GetControlWord()  EE_CNTRL_AUTOPAGESIZE ) ? ON\n : OFF\n );
 
 if (CalcTextHeight(NULL)  nBoxHeight)
 {
diff --git a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx 
b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
index a61e61e..612a862 100644
--- a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
+++ b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
@@ -291,6 +291,10 @@ namespace drawinglayer
 aAnchorTransform = 
basegfx::tools::createShearXRotateTranslateB2DHomMatrix(fShearX, fRotate, 
aTranslate)
 * aAnchorTransform;
 
+// FIXME(matteocam)
+SdrTextObj *pReferredTextObj = rText.getSdrText().GetObject();
+fprintf(stderr, [MkTextPrimitive] Referring to text object: 
%p\n, pReferredTextObj);
+
 if(rText.isFitToSize())
 {
 // streched text in range
diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx
index e287961..178f0b9 100644
--- a/svx/source/svdraw/svdotext.cxx
+++ b/svx/source/svdraw/svdotext.cxx
@@ -1953,13 +1953,29 @@ void SdrTextObj::onEditOutlinerStatusEvent( EditStatus* 
pEditStatus )
 ImpAutoFitText(*pEdtOutl);
 mbInDownScale = false;
 }
-else if ( GetNextLinkInChain() != NULL )
+else if ( GetNextLinkInChain() != NULL ) // is this a chainable object?
 {
-// set the need for chaining
+// set whether there is need for chaining
 SetToBeChained( pEditStatus-IsPageOverflow() );
 fprintf(stderr, [CHAINING] Need for Chaining is %s\n,
 pEditStatus-IsPageOverflow() ? TRUE : FALSE);
-//impDecomposeChainedTextPrimitive();
+
+/*
+ *  XXX: I can see problems with circular chains here:
+ *If there is such a circular chain we get back
+ *to the first box and so on...
+*/
+
+//if ( IsRecursiveChaining() ) {
+// set non overflowing text
+
+/*
+ * XXX: what's with the Outliner?
+ * It may be that we are calling it in the wrong moment.
+ * But if we don't call it here, where?
+*/
+
+//}
 }
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source svx/source

2014-08-14 Thread matteocam
 editeng/source/editeng/impedit3.cxx |2 +-
 svx/source/svdraw/svdotext.cxx  |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 8aebd168df66261279b178444853b8ffcb845372
Author: matteocam matteo.campane...@gmail.com
Date:   Thu Aug 14 15:12:39 2014 +0200

TextObj's chaining changed only if  called for it in 
onEditOutlinerStatusEvent

Change-Id: I8736b039f3a4be519e68e3e60f87e7c32a8b2153

diff --git a/editeng/source/editeng/impedit3.cxx 
b/editeng/source/editeng/impedit3.cxx
index 8f95bce..6393b29 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -512,7 +512,7 @@ void ImpEditEngine::FormatDoc()
 
 void ImpEditEngine::CallStatusHdlChaining()
 {
-if ( aStatusHdlLinkChaining.IsSet()  aStatus.GetStatusWord() )
+if ( aStatusHdlLinkChaining.IsSet() /*  aStatus.GetStatusWord() */)
 {
 // The Status has to be reset before the Call,
 // since other Flags might be set in the handler...
diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx
index fe9dcd6..0e32745 100644
--- a/svx/source/svdraw/svdotext.cxx
+++ b/svx/source/svdraw/svdotext.cxx
@@ -1953,7 +1953,7 @@ void SdrTextObj::onEditOutlinerStatusEvent( EditStatus* 
pEditStatus )
 ImpAutoFitText(*pEdtOutl);
 mbInDownScale = false;
 }
-else if ( GetNextLinkInChain() != NULL)
+else if ( GetNextLinkInChain() != NULL  
pEditStatus-IsPageOverflow()  !nStat ) // do it only if it is a call 
explicitly for chaining (status word already cleared)
 {
 // set the need for chaining
 SetToBeChained( pEditStatus-IsPageOverflow() );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source svx/source

2014-08-14 Thread matteocam
 editeng/source/editeng/impedit3.cxx |2 +-
 svx/source/svdraw/svdotext.cxx  |4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 651a5edee2991a4ed6fa7227fb7ddb8f7168d66b
Author: matteocam matteo.campane...@gmail.com
Date:   Thu Aug 14 15:20:36 2014 +0200

Removed status words'checks for overflow

Change-Id: I10a5032be60a83dd6ca7b4429a967f9a9b80edcb

diff --git a/editeng/source/editeng/impedit3.cxx 
b/editeng/source/editeng/impedit3.cxx
index 6393b29..b0bf25e 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -518,7 +518,7 @@ void ImpEditEngine::CallStatusHdlChaining()
 // since other Flags might be set in the handler...
 EditStatus aTmpStatus( aStatus );
 aStatus.Clear(); // No need for this with chaining. It does not affect 
it either way.
-//aStatusHdlLinkChaining.Call( aTmpStatus );
+aStatusHdlLinkChaining.Call( aTmpStatus );
 aStatusTimer.Stop();// If called by hand ...
 }
 }
diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx
index 0e32745..be2d8fd 100644
--- a/svx/source/svdraw/svdotext.cxx
+++ b/svx/source/svdraw/svdotext.cxx
@@ -1936,7 +1936,7 @@ void SdrTextObj::onEditOutlinerStatusEvent( EditStatus* 
pEditStatus )
 const bool bGrowX=(nStat  EE_STAT_TEXTWIDTHCHANGED) !=0;
 const bool bGrowY=(nStat  EE_STAT_TEXTHEIGHTCHANGED) !=0;
 const bool bOverflow = (nStat  0x0100) != 0;
-if(bTextFrame  (bGrowX || bGrowY || bOverflow))
+if(bTextFrame  (bGrowX || bGrowY))
 {
 if ((bGrowX  IsAutoGrowWidth()) || (bGrowY  IsAutoGrowHeight()))
 {
@@ -1953,7 +1953,7 @@ void SdrTextObj::onEditOutlinerStatusEvent( EditStatus* 
pEditStatus )
 ImpAutoFitText(*pEdtOutl);
 mbInDownScale = false;
 }
-else if ( GetNextLinkInChain() != NULL  
pEditStatus-IsPageOverflow()  !nStat ) // do it only if it is a call 
explicitly for chaining (status word already cleared)
+else if ( GetNextLinkInChain() != NULL  !nStat ) // do it only if it 
is a call explicitly for chaining (status word already cleared)
 {
 // set the need for chaining
 SetToBeChained( pEditStatus-IsPageOverflow() );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source svx/source

2014-08-14 Thread matteocam
 editeng/source/editeng/impedit3.cxx |2 +-
 svx/source/svdraw/svdotext.cxx  |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 89f2fa2febecbb1a1ed2667b18eb3bc1b148c895
Author: matteocam matteo.campane...@gmail.com
Date:   Thu Aug 14 15:45:19 2014 +0200

No clearing of status after handling chainging

Change-Id: I421fcf3d015026c3e06a99c4a726bbc2f2111296

diff --git a/editeng/source/editeng/impedit3.cxx 
b/editeng/source/editeng/impedit3.cxx
index b0bf25e..b0db341 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -517,7 +517,7 @@ void ImpEditEngine::CallStatusHdlChaining()
 // The Status has to be reset before the Call,
 // since other Flags might be set in the handler...
 EditStatus aTmpStatus( aStatus );
-aStatus.Clear(); // No need for this with chaining. It does not affect 
it either way.
+//aStatus.Clear(); // No need for this with chaining. It does not 
affect it either way.
 aStatusHdlLinkChaining.Call( aTmpStatus );
 aStatusTimer.Stop();// If called by hand ...
 }
diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx
index be2d8fd..dd16447 100644
--- a/svx/source/svdraw/svdotext.cxx
+++ b/svx/source/svdraw/svdotext.cxx
@@ -1936,7 +1936,7 @@ void SdrTextObj::onEditOutlinerStatusEvent( EditStatus* 
pEditStatus )
 const bool bGrowX=(nStat  EE_STAT_TEXTWIDTHCHANGED) !=0;
 const bool bGrowY=(nStat  EE_STAT_TEXTHEIGHTCHANGED) !=0;
 const bool bOverflow = (nStat  0x0100) != 0;
-if(bTextFrame  (bGrowX || bGrowY))
+if(bTextFrame  (bGrowX || bGrowY || !nStat))
 {
 if ((bGrowX  IsAutoGrowWidth()) || (bGrowY  IsAutoGrowHeight()))
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source svx/source

2014-08-14 Thread matteocam
 editeng/source/editeng/impedit3.cxx |9 +
 svx/source/svdraw/svdotext.cxx  |6 +++---
 2 files changed, 8 insertions(+), 7 deletions(-)

New commits:
commit eb8d180f4fabbf57e0babba0f3b0dca402c65172
Author: matteocam matteo.campane...@gmail.com
Date:   Thu Aug 14 23:30:05 2014 +0200

Generalizing chaining to more than 2 objects

Change-Id: If3dec97d383abbb42c3fa4310025ed3b353108e0

diff --git a/editeng/source/editeng/impedit3.cxx 
b/editeng/source/editeng/impedit3.cxx
index e299061..db962b5 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -612,12 +612,13 @@ void ImpEditEngine::CheckPageOverflow()
 /* fprintf( stderr, IsPageOverflow(aPaperSize, aPrevPaperSize)
 ? YES Overflow!\n  : NO Overflow!\n ); */
 // setting overflow status
-sal_uInt32 nBoxHeight = 1783; // XXX: hard coded for testing
-//if ( IsPageOverflow( aPaperSize, aPrevPaperSize ) ) {
-if (CalcTextHeight(NULL)  nBoxHeight) // XXX: CalcTextHeight here??
+
+sal_uInt32 nBoxHeight = GetMaxAutoPaperSize().Height();
+
+if (CalcTextHeight(NULL)  nBoxHeight)
 {
 // which paragraph is the first to cause higher size of the box?
-UpdateOverflowingParaNum( nBoxHeight /*aPrevPaperSize.Height()*/ ); // 
XXX: currently only for horizontal text
+UpdateOverflowingParaNum( nBoxHeight); // XXX: currently only for 
horizontal text
 aStatus.SetPageOverflow(true);
 } else
 {
diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx
index a93d7bc..d15d67c 100644
--- a/svx/source/svdraw/svdotext.cxx
+++ b/svx/source/svdraw/svdotext.cxx
@@ -2017,9 +2017,9 @@ SdrTextObj* SdrTextObj::GetNextLinkInChain() const
 SdrTextObj *pNextTextObj = NULL;
 
 if ( pPage  pPage-GetObjCount()  1) {
-pNextTextObj =  dynamic_cast SdrTextObj * ( pPage-GetObj(1) );
-if ( pNextTextObj == NULL)
-return NULL;
+int nextIndex = (GetOrdNum()+1) % pPage-GetObjCount();
+pNextTextObj =  dynamic_cast SdrTextObj * ( pPage-GetObj( nextIndex 
) );
+
 return pNextTextObj;
 } else {
 fprintf(stderr, Make New Object please\n);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source svx/source

2014-08-13 Thread matteocam
 editeng/source/editeng/impedit3.cxx  |1 +
 editeng/source/outliner/outliner.cxx |2 +-
 svx/source/svdraw/svdotext.cxx   |3 ++-
 3 files changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 9f61bda430ff71ea509697ba33014fb77150676a
Author: matteocam matteo.campane...@gmail.com
Date:   Wed Aug 13 18:39:04 2014 +0200

Change in status word when text overflowing

Change-Id: I92439e46b72b757f396f9116d46a646e0314f43a

diff --git a/editeng/source/editeng/impedit3.cxx 
b/editeng/source/editeng/impedit3.cxx
index 8751d05..7ea5a51 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -554,6 +554,7 @@ void ImpEditEngine::CheckAutoPageSize()
 // which paragraph is the first to cause higher size of the box?
 UpdateOverflowingParaNum( nBoxHeight /*aPrevPaperSize.Height()*/ ); // 
XXX: currently only for horizontal text
 aStatus.SetPageOverflow(true);
+aStatus.GetStatusWord() |= 0x0100;
 } else
 {
 // No overflow if withing box boundaries
diff --git a/editeng/source/outliner/outliner.cxx 
b/editeng/source/outliner/outliner.cxx
index 50fa881..38f66f2 100644
--- a/editeng/source/outliner/outliner.cxx
+++ b/editeng/source/outliner/outliner.cxx
@@ -2144,7 +2144,7 @@ OutlinerParaObject *Outliner::GetOverflowingParaObject() 
const
 if ( pEditEngine-GetOverflowingParaNum()  GetParagraphCount()-1) {
 fprintf(stderr,
 [Overflowing] Ops, trying to retrieve para %d when max 
index is %d\n,
-nCount,
+pEditEngine-GetOverflowingParaNum(),
 GetParagraphCount()-1);
 return NULL;
 }
diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx
index 7bdbda4..fe9dcd6 100644
--- a/svx/source/svdraw/svdotext.cxx
+++ b/svx/source/svdraw/svdotext.cxx
@@ -1935,7 +1935,8 @@ void SdrTextObj::onEditOutlinerStatusEvent( EditStatus* 
pEditStatus )
 const sal_uInt32 nStat = pEditStatus-GetStatusWord();
 const bool bGrowX=(nStat  EE_STAT_TEXTWIDTHCHANGED) !=0;
 const bool bGrowY=(nStat  EE_STAT_TEXTHEIGHTCHANGED) !=0;
-if(bTextFrame  (bGrowX || bGrowY))
+const bool bOverflow = (nStat  0x0100) != 0;
+if(bTextFrame  (bGrowX || bGrowY || bOverflow))
 {
 if ((bGrowX  IsAutoGrowWidth()) || (bGrowY  IsAutoGrowHeight()))
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source svx/source

2014-08-12 Thread matteocam
 editeng/source/editeng/impedit3.cxx |1 +
 svx/source/svdraw/svdotext.cxx  |2 ++
 svx/source/svdraw/svdotxed.cxx  |1 +
 3 files changed, 4 insertions(+)

New commits:
commit 585a092eddcc9c4ac3f39abd798c69bc2f34a0d2
Author: matteocam matteo.campane...@gmail.com
Date:   Tue Aug 12 14:45:22 2014 +0200

Experiment: setting fixed Max height from SdrTextObj

Change-Id: I734400203befe89803a07ad73b8b9a83b61e58f3

diff --git a/editeng/source/editeng/impedit3.cxx 
b/editeng/source/editeng/impedit3.cxx
index 9944878..a9b7483 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -546,6 +546,7 @@ void ImpEditEngine::CheckAutoPageSize()
 // FIXME(matteocam)
 /* fprintf( stderr, IsPageOverflow(aPaperSize, aPrevPaperSize)
 ? YES Overflow!\n  : NO Overflow!\n ); */
+fprintf( stderr, aPaperSize.Height = %d\n, aPaperSize.Height() );
 // setting overflow status
 if ( IsPageOverflow( aPaperSize, aPrevPaperSize ) ) {
 // which paragraph is the first to cause higher size of the box?
diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx
index cbdec1e..aefaca8 100644
--- a/svx/source/svdraw/svdotext.cxx
+++ b/svx/source/svdraw/svdotext.cxx
@@ -750,6 +750,8 @@ void SdrTextObj::TakeTextRect( SdrOutliner rOutliner, 
Rectangle rTextRect, boo
 else
 {
 nHgt = 100;
+// FIXME(matteocam)
+nHgt = 2000;
 }
 
 rOutliner.SetMaxAutoPaperSize(Size(nWdt,nHgt));
diff --git a/svx/source/svdraw/svdotxed.cxx b/svx/source/svdraw/svdotxed.cxx
index 9151fe4..4f62e0b 100644
--- a/svx/source/svdraw/svdotxed.cxx
+++ b/svx/source/svdraw/svdotxed.cxx
@@ -189,6 +189,7 @@ void SdrTextObj::TakeTextEditArea(Size* pPaperMin, Size* 
pPaperMax, Rectangle* p
 else
 {
 nMaxHgt = 100;
+nMaxHgt = 2000;
 }
 
 aPaperMax.Width()=nMaxWdt;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source svx/source

2014-07-21 Thread matteocam
 editeng/source/editeng/impedit3.cxx |2 +-
 svx/source/svdraw/svdotextdecomposition.cxx |6 +-
 2 files changed, 6 insertions(+), 2 deletions(-)

New commits:
commit 64dad97fcac516bc83f31ffb79763f55948292d0
Author: matteocam matteo.campane...@gmail.com
Date:   Mon Jul 21 22:33:56 2014 +0300

Removed outdated comments. Set para obj in impCopyTextInTextObj

Change-Id: I8789403e99f7847f937ead12cd16f34e1ed164f9

diff --git a/editeng/source/editeng/impedit3.cxx 
b/editeng/source/editeng/impedit3.cxx
index ce30d8e..196d0ee 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -544,7 +544,7 @@ void ImpEditEngine::CheckAutoPageSize()
 // FIXME(matteocam)
 fprintf( stderr, IsPageOverflow(aPaperSize, aPrevPaperSize)
 ? YES Overflow!\n  : NO Overflow!\n );
-// setting overflow status // XXX: Is status reset somewhere?
+// setting overflow status
 if ( IsPageOverflow( aPaperSize, aPrevPaperSize ) )
 aStatus.SetPageOverflow(true);
 
diff --git a/svx/source/svdraw/svdotextdecomposition.cxx 
b/svx/source/svdraw/svdotextdecomposition.cxx
index 9253a9a..d9ed3e6 100644
--- a/svx/source/svdraw/svdotextdecomposition.cxx
+++ b/svx/source/svdraw/svdotextdecomposition.cxx
@@ -780,7 +780,7 @@ void SdrTextObj::impCopyTextInTextObj(SdrTextObj 
*pNextTextObj) const
 if( pText!=NULL  pText-GetOutlinerParaObject()  pModel!=NULL)
 {
 Rectangle aNextRect = pNextTextObj-aRect;
-SdrOutliner rOutliner = pNextTextObj-ImpGetDrawOutliner(); // XXX: 
shit seems to happen in here
+SdrOutliner rOutliner = pNextTextObj-ImpGetDrawOutliner();
 rOutliner.SetPaperSize(
 Size(
 aNextRect.Right()-aNextRect.Left(),
@@ -801,6 +801,10 @@ void SdrTextObj::impCopyTextInTextObj(SdrTextObj 
*pNextTextObj) const
 if (aNewRect!=aNextRect) {
 pNextTextObj-SetLogicRect(aNewRect);
 }
+
+// Set text object's string
+pNextTextObj-SetOutlinerParaObject(*pText-GetOutlinerParaObject());
+
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source svx/source

2014-07-11 Thread matteocam
 editeng/source/outliner/outliner.cxx|3 +--
 svx/source/svdraw/svdotextdecomposition.cxx |   22 ++
 2 files changed, 23 insertions(+), 2 deletions(-)

New commits:
commit 5625b440f15564f8e12d37119a1b7f9198815d45
Author: matteocam matteo.campane...@gmail.com
Date:   Fri Jul 11 16:38:46 2014 +0200

Truncation in impHandleDrawPortionInfo

Change-Id: Ief79063be0ef742148c24a3eb2d4d2cb7530987e

diff --git a/editeng/source/outliner/outliner.cxx 
b/editeng/source/outliner/outliner.cxx
index 34962f4..08f0b79 100644
--- a/editeng/source/outliner/outliner.cxx
+++ b/editeng/source/outliner/outliner.cxx
@@ -1756,8 +1756,7 @@ void Outliner::DrawingText( const Point rStartPos, const 
OUString rText, sal_I
 
 if(aDrawPortionHdl.IsSet())
 {
-// FIXME(matteocam)
-DrawPortionInfo aInfo( rStartPos, rText, nTextStart, 
std::min(nTextLen,2), rFont, nPara, nIndex, pDXArray, pWrongSpellVector,
+DrawPortionInfo aInfo( rStartPos, rText, nTextStart, nTextLen, rFont, 
nPara, nIndex, pDXArray, pWrongSpellVector,
 pFieldData, pLocale, rOverlineColor, rTextLineColor, nRightToLeft, 
false, 0, bEndOfLine, bEndOfParagraph, bEndOfBullet);
 
 aDrawPortionHdl.Call( aInfo );
diff --git a/svx/source/svdraw/svdotextdecomposition.cxx 
b/svx/source/svdraw/svdotextdecomposition.cxx
index 2f7c4e1..e044d39 100644
--- a/svx/source/svdraw/svdotextdecomposition.cxx
+++ b/svx/source/svdraw/svdotextdecomposition.cxx
@@ -510,6 +510,28 @@ namespace
 
 void impTextBreakupHandler::impHandleDrawPortionInfo(const 
DrawPortionInfo rInfo)
 {
+// FIXME(matteocam)
+
+/*
+ * We want to break the text at the 10th character if we are at
+ * the end of the paragraph.
+ * XXX: How to send it back to editengine?
+ *  [AutoFit uses SetGlobalStretch... from Outliner]
+ * XXX: how to pass on to the rest of the text This should be
+ *  drawn somewhere else?
+*/
+
+bool bTruncateText = rInfo.mbEndOfParagraph; // arbitrary property
+
+if ( bTruncateText )
+{
+// truncate it at 4
+int nTruncationPoint = 4;
+rInfo.mnTextLen = std::min( rInfo.mnTextLen, nTruncationPoint );
+}
+
+// END FIXME
+
 impCreateTextPortionPrimitive(rInfo);
 
 if(rInfo.mbEndOfLine || rInfo.mbEndOfParagraph)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits