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

2015-08-20 Thread matteocam
 editeng/source/editeng/impedit3.cxx |6 ++
 svx/source/svdraw/textchainflow.cxx |   25 +
 2 files changed, 11 insertions(+), 20 deletions(-)

New commits:
commit b35661fab277d98e9b45df6626e947c1edd597dd
Author: matteocam matteo.campane...@gmail.com
Date:   Thu Aug 20 18:01:20 2015 +0200

Set UpdateMode to true only if necessary

Change-Id: If4c0517328271ce2b1c7e184981de6c2b7c14560

diff --git a/svx/source/svdraw/textchainflow.cxx 
b/svx/source/svdraw/textchainflow.cxx
index 9739eee..cad0b3c 100644
--- a/svx/source/svdraw/textchainflow.cxx
+++ b/svx/source/svdraw/textchainflow.cxx
@@ -71,12 +71,12 @@ void TextChainFlow::impCheckForFlowEvents(SdrOutliner 
*pFlowOutl, SdrOutliner *p
 {
 bool bOldUpdateMode = pFlowOutl-GetUpdateMode();
 
-// We need this since it's required to check overflow
-pFlowOutl-SetUpdateMode(true);
-
 // XXX: This could be reorganized moving most of this stuff inside 
EditingTextChainFlow
 if (pParamOutl != NULL)
 {
+// We need this since it's required to check overflow
+pFlowOutl-SetUpdateMode(true);
+
 // XXX: does this work if you do it before setting the text? Seems so.
 impSetFlowOutlinerParams(pFlowOutl, pParamOutl);
 }
@@ -105,7 +105,8 @@ void TextChainFlow::impCheckForFlowEvents(SdrOutliner 
*pFlowOutl, SdrOutliner *p
   NULL;
 
 // Reset update mode // Reset it here because we use WriteRTF (needing 
updatemode = true) in the two constructors above
-pFlowOutl-SetUpdateMode(bOldUpdateMode);
+if (!bOldUpdateMode) // Reset only if the old value was false
+pFlowOutl-SetUpdateMode(bOldUpdateMode);
 
 // NOTE: Must be called after mp*ChText abd b*flow have been set but 
before mbOFisUFinduced is reset
 impUpdateCursorInfo();
@@ -155,11 +156,6 @@ bool TextChainFlow::IsUnderflow() const
 // XXX:Would it be possible to unify undeflow and its possibly following 
overrflow?
 void TextChainFlow::ExecuteUnderflow(SdrOutliner *pOutl)
 {
-bool bOldUpdateMode = pOutl-GetUpdateMode();
-
-// We need this since it's required by WriteRTF
-pOutl-SetUpdateMode(true);
-
 
 //GetTextChain()-SetNilChainingEvent(mpTargetLink, true);
 // making whole text
@@ -180,9 +176,6 @@ void TextChainFlow::ExecuteUnderflow(SdrOutliner *pOutl)
 pOutl-SetMaxAutoPaperSize(aOldSize);
 pOutl-SetText(*pNewText);
 
-// Reset update mode
-pOutl-SetUpdateMode(bOldUpdateMode);
-
 //GetTextChain()-SetNilChainingEvent(mpTargetLink, false);
 
 // Check for new overflow
@@ -191,11 +184,6 @@ void TextChainFlow::ExecuteUnderflow(SdrOutliner *pOutl)
 
 void TextChainFlow::ExecuteOverflow(SdrOutliner *pNonOverflOutl, SdrOutliner 
*pOverflOutl)
 {
-bool bOldUpdateMode = pNonOverflOutl-GetUpdateMode();
-
-// We need this since it's required by WriteRTF
-pNonOverflOutl-SetUpdateMode(true);
-
 //GetTextChain()-SetNilChainingEvent(mpTargetLink, true);
 // Leave only non overflowing text
 impLeaveOnlyNonOverflowingText(pNonOverflOutl);
@@ -206,9 +194,6 @@ void TextChainFlow::ExecuteOverflow(SdrOutliner 
*pNonOverflOutl, SdrOutliner *pO
 impMoveChainedTextToNextLink(pOverflOutl);
 }
 
-// Reset update mode
-pNonOverflOutl-SetUpdateMode(bOldUpdateMode);
-
 //GetTextChain()-SetNilChainingEvent(mpTargetLink, false);
 }
 
commit 0dccde9fc86aa74061d39e72c5139477d560c0a3
Author: matteocam matteo.campane...@gmail.com
Date:   Thu Aug 20 17:48:06 2015 +0200

Show height of first line during OF check

Change-Id: I20e5ca90cb147c841645fd28df0846f41a3dcb42

diff --git a/editeng/source/editeng/impedit3.cxx 
b/editeng/source/editeng/impedit3.cxx
index 7965a06..8a38539 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -4658,6 +4658,12 @@ void 
ImpEditEngine::ImplUpdateOverflowingLineNum(sal_uInt32 nPaperHeight,
 EditLine aLine = pPara-GetLines()[nLine];
 nLH = aLine.GetHeight();
 nY += nLH;
+
+// Debugging output
+if (nLine == 0) {
+fprintf(stderr, [CHAINING] First line has height %d\n, nLH);
+}
+
 if ( nY  nPaperHeight ) // found first line overflowing
 {
 mnOverflowingLine = nLine;
___
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' - 2 commits - editeng/source svx/source

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

New commits:
commit 6fc58c5c561b5f3f02a9317a470c73ce63e3fcf8
Author: matteocam matteo.campane...@gmail.com
Date:   Mon Jul 13 16:55:17 2015 -0400

Fix juxtaposing special case in deep merge

Change-Id: I67bb19b45f503abcb863f378132b58bc81b603a1

diff --git a/editeng/source/outliner/overflowingtxt.cxx 
b/editeng/source/outliner/overflowingtxt.cxx
index efaaa9b..7df78b0 100644
--- a/editeng/source/outliner/overflowingtxt.cxx
+++ b/editeng/source/outliner/overflowingtxt.cxx
@@ -79,7 +79,7 @@ OutlinerParaObject *impGetDeeplyMergedParaObject(Outliner 
*pOutl,
 pOutl-SetText(*pPObj1);
 return impGetJuxtaposedParaObject(
 pOutl,
-pOutl-CreateParaObject(0, nLastPara1 - 1),
+pOutl-CreateParaObject(0, nParaCount - 1),
 pPObj2);
 }
 
commit d13e5209a7e074210b8555aadd892623dc9ff086
Author: matteocam matteo.campane...@gmail.com
Date:   Mon Jul 13 16:49:18 2015 -0400

Change cursor

Change-Id: I893008684b640e90e07b3e770780a395c12267ca

diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index 3abebed..7314e41 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -554,7 +554,7 @@ void SdrObjEditView::ImpMoveCursorAfterChainingEvent()
 SdrBeginTextEdit(pNextLink);
 // OutlinerView has changed, so we update the pointer
 pOLV = GetTextEditOutlinerView();
-
//pOLV-SetSelection(pTextChain-GetPostChainingSel(pTextObj)); // XXX
+pOLV-SetSelection(pTextChain-GetPostChainingSel(pTextObj)); 
// XXX
 
 break;
 case CursorChainingEvent::TO_PREV_LINK:
___
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' - 2 commits - editeng/source svx/source

2014-08-12 Thread matteocam
 editeng/source/editeng/impedit3.cxx |7 ---
 svx/source/svdraw/svdotxed.cxx  |   10 +++---
 2 files changed, 11 insertions(+), 6 deletions(-)

New commits:
commit 0c2c384c82ff36da734f5ec1165560a9e3d99104
Author: matteocam matteo.campane...@gmail.com
Date:   Tue Aug 12 18:25:47 2014 +0200

Hard-coding of text box height. Using that for Overflowing Paragraphs

Change-Id: I96a9eb8337744b8c76bd735faca89085e6698490

diff --git a/editeng/source/editeng/impedit3.cxx 
b/editeng/source/editeng/impedit3.cxx
index a9b7483..5e0c19b 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -548,10 +548,11 @@ void ImpEditEngine::CheckAutoPageSize()
 ? YES Overflow!\n  : NO Overflow!\n ); */
 fprintf( stderr, aPaperSize.Height = %d\n, aPaperSize.Height() );
 // setting overflow status
-if ( IsPageOverflow( aPaperSize, aPrevPaperSize ) ) {
+sal_uInt32 nHeight = 1783; // XXX: hard coded for testing
+//if ( IsPageOverflow( aPaperSize, aPrevPaperSize ) ) {
+if (GetTextHeight()  1783) // XXX: CalcTextHeight here??
 // which paragraph is the first to cause higher size of the box?
-UpdateOverflowingParaNum( aPrevPaperSize.Height() ); // XXX: currently 
only for horizontal text
-
+UpdateOverflowingParaNum( 1783 /*aPrevPaperSize.Height()*/ ); // XXX: 
currently only for horizontal text
 aStatus.SetPageOverflow(true);
 }
 
commit 7b832c475e8386307f9473abf098279ff1ec7065
Author: matteocam matteo.campane...@gmail.com
Date:   Tue Aug 12 18:17:19 2014 +0200

Chained mode for BegTextEdit

Change-Id: I21a52ca01cbacce8d2f5e8ff735f895e9fd7c6a4

diff --git a/svx/source/svdraw/svdotxed.cxx b/svx/source/svdraw/svdotxed.cxx
index 2cbf851..5ca8a05 100644
--- a/svx/source/svdraw/svdotxed.cxx
+++ b/svx/source/svdraw/svdotxed.cxx
@@ -63,9 +63,13 @@ bool SdrTextObj::BegTextEdit(SdrOutliner rOutl)
 }
 
 // FIXME(matteocam)
-sal_uIntPtr nStat1=rOutl.GetControlWord();
-nStat1 =~EE_CNTRL_AUTOPAGESIZE;
-rOutl.SetControlWord(nStat1);
+bool bIsChained = true; // XXX: get it from a method
+// disable AUTOPAGESIZE
+if ( bIsChained ) {
+sal_uIntPtr nStat1=rOutl.GetControlWord();
+nStat1 =~EE_CNTRL_AUTOPAGESIZE;
+rOutl.SetControlWord(nStat1);
+}
 
 OutlinerParaObject* pOutlinerParaObject = GetOutlinerParaObject();
 if(pOutlinerParaObject!=NULL)
___
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' - 2 commits - editeng/source svx/source

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

New commits:
commit ff6679cf9410bdcce2a47228d1a8ece4f168a046
Author: matteocam matteo.campane...@gmail.com
Date:   Thu Aug 7 18:10:57 2014 +0200

Debugging output for Overflowing paragraph

Change-Id: I0ac2fc1da4d70d8f382d4652934ceb63944dd3fc

diff --git a/editeng/source/editeng/impedit3.cxx 
b/editeng/source/editeng/impedit3.cxx
index db1aad8..a6a21ae 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -429,6 +429,7 @@ void ImpEditEngine::FormatDoc()
 // FIXME(matteocam)
 // set possible point for chainging
 mnOverflowingPara = nPara;
+fprintf(stderr, [CHAINING] Setting first overflowing para: 
%d\n, nPara);
 }
 
 // InvalidRect set only once...
commit f5a1c7c94ddd06d44393db4cec2a4912075dde00
Author: matteocam matteo.campane...@gmail.com
Date:   Thu Aug 7 18:01:26 2014 +0200

Check whether text box is not its own next link in chain

Change-Id: I440856afa23ef77b65df0b8e77482383bfc54934

diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx
index d70995b..cbdec1e 100644
--- a/svx/source/svdraw/svdotext.cxx
+++ b/svx/source/svdraw/svdotext.cxx
@@ -1947,11 +1947,8 @@ void SdrTextObj::onEditOutlinerStatusEvent( EditStatus* 
pEditStatus )
 }
 else if ( GetNextLinkInChain() != NULL   
pEditStatus-IsPageOverflow())
 {
-// FIXME(matteocam): should include check that the TextBox has a 
next chain link
-
 // set the need for chaining
 SetToBeChained( true );
-
 //impDecomposeChainedTextPrimitive();
 }
 }
diff --git a/svx/source/svdraw/svdotxed.cxx b/svx/source/svdraw/svdotxed.cxx
index cffa559..76d3296 100644
--- a/svx/source/svdraw/svdotxed.cxx
+++ b/svx/source/svdraw/svdotxed.cxx
@@ -261,7 +261,7 @@ void SdrTextObj::EndTextEdit(SdrOutliner rOutl)
 
 // FIXME(matteocam)
 // TODO: move this to one level higher
-if ( IsToBeChained() )
+if ( IsToBeChained()  GetNextLinkInChain() != this) // XXX: 
defensive check
 {
 // set non overflow part of text to current box
 pNewText = rOutl.GetNonOverflowingParaObject();
___
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' - 2 commits - editeng/source svx/source

2014-07-16 Thread matteocam
 editeng/source/editeng/impedit3.cxx |   11 +++
 svx/source/svdraw/svdotextdecomposition.cxx |   14 +++---
 2 files changed, 18 insertions(+), 7 deletions(-)

New commits:
commit b77c335b73c0928c95e4b829b7462ff1303503d6
Author: matteocam matteo.campane...@gmail.com
Date:   Wed Jul 16 16:58:06 2014 +0200

Overflow Check with oldSize  curSize AND FLAG check

Change-Id: I798b12355f78b75696de8bdcc24c69c43d7ac6ac

diff --git a/editeng/source/editeng/impedit3.cxx 
b/editeng/source/editeng/impedit3.cxx
index e220750..ad3d2ab 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -353,6 +353,17 @@ void ImpEditEngine::FormatFullDoc()
 FormatDoc();
 }
 
+bool IsPageOverflow(const sal_uInt32 aStatus, bool isVertical,
+const Size aPrevPaperSize, const Size aPaperSize)
+{
+const bool bGrowX=(aStatus  EE_STAT_TEXTWIDTHCHANGED) !=0;
+const bool bGrowY=(aStatus  EE_STAT_TEXTHEIGHTCHANGED) !=0;
+
+return ( bGrowY  isVertical  aPaperSize.Height()  
aPrevPaperSize.Height() ) ||
+   ( bGrowX  !isVertical  aPaperSize.Width()  
aPrevPaperSize.Width() );
+
+}
+
 void ImpEditEngine::FormatDoc()
 {
 if (!GetUpdateMode() || IsFormatting())
commit 88a34ae0d5243523d202b8b6fa1f7c7ba19dd47e
Author: matteocam matteo.campane...@gmail.com
Date:   Wed Jul 16 16:57:54 2014 +0200

Removed debugging barrier for copying text experiment

Change-Id: I8cd3897606b2abab3ef791d858d132f9f9cda9da

diff --git a/svx/source/svdraw/svdotextdecomposition.cxx 
b/svx/source/svdraw/svdotextdecomposition.cxx
index 09bb8e3..59f5acc 100644
--- a/svx/source/svdraw/svdotextdecomposition.cxx
+++ b/svx/source/svdraw/svdotextdecomposition.cxx
@@ -812,12 +812,6 @@ void SdrTextObj::impDecomposeAutoFitTextPrimitive(
 /* BEGIN Experiments */
 // FIXME(matteocam)
 
- // for debugging purposes:
-// carry out experiments only when setting b=false from gdb
-bool b = true;
-if (b)
-return;
-
 // we use (text) object 0 and 1 for these experiments:
 // copying text from one to the other.
 
@@ -832,7 +826,13 @@ void SdrTextObj::impDecomposeAutoFitTextPrimitive(
 return;
 }
 
-impCopyTextInTextObj(pNextTextObj);
+// for debugging purposes:
+// carry out experiments only when setting b=false from gdb
+//bool b = true;
+//if (!b) {
+impCopyTextInTextObj(pNextTextObj); // just do it
+//return;
+//}
 
 /* END Experiments */
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits