[Libreoffice-commits] core.git: Branch 'feature/chained-text-boxes' - 3 commits - include/editeng

2015-09-14 Thread matteocam
 include/editeng/overflowingtxt.hxx |5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 0e77cd1b44d69bc04a102dc6a5d0bec22d60d2fc
Author: matteocam <matteo.campane...@gmail.com>
Date:   Fri Sep 11 07:32:00 2015 +0200

Noop commit for feature/gsoc14-draw-chained-text-boxes

Change-Id: I29c4f0357f5dadd2c26f4d9b9eb7f23d9009fd89
commit ee0655c2440dcae26e5e981abe00b05d0f0bc3d1
Author: matteocam <matteo.campane...@gmail.com>
Date:   Fri Sep 11 07:31:49 2015 +0200

Use ::rtl::OUString explicitly in overflowingtxt.hxx

Change-Id: I7e196d8e048ba5ac1b09ad5acf302a43254db4fb

diff --git a/include/editeng/overflowingtxt.hxx 
b/include/editeng/overflowingtxt.hxx
index 9fbdebf..51e0fc8 100644
--- a/include/editeng/overflowingtxt.hxx
+++ b/include/editeng/overflowingtxt.hxx
@@ -34,7 +34,10 @@ namespace com { namespace sun { namespace star {
 typedef com::sun::star::uno::Reference<
 com::sun::star::datatransfer::XTransferable> TranferableText;
 
-class OUString;
+namespace rtl {
+class OUString;
+};
+using ::rtl::OUString;
 
 
 class OutlinerParaObject;
commit f48387628dc3841a82ab116a4433bdc964a2951b
Author: matteocam <matteo.campane...@gmail.com>
Date:   Tue Sep 8 10:07:59 2015 +0200

Noop commit for feature/gsoc14-draw-chained-text-boxes

Change-Id: If0002957fa69117632189611fdd7898204f82c1f
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/chained-text-boxes' - 4 commits - editeng/source include/svx sd/source svx/source

2015-09-07 Thread matteocam
 editeng/source/outliner/outlvw.cxx |   11 ++
 include/svx/svdedxv.hxx|   10 ++
 sd/source/ui/view/drviewse.cxx |5 +
 sd/source/ui/view/outlview.cxx |1 
 sd/source/ui/view/sdview.cxx   |1 
 svx/source/svdraw/svdedxv.cxx  |  145 +
 6 files changed, 171 insertions(+), 2 deletions(-)

New commits:
commit 54b576c3b3bf3d67c5ffd4ae391f6c03e3647dc1
Author: matteocam <matteo.campane...@gmail.com>
Date:   Mon Sep 7 20:01:35 2015 +0200

Handle chaining for cutting and pasting

Change-Id: Iec08e339a7f06c5fa56e67b42206b31c766f845b

diff --git a/editeng/source/outliner/outlvw.cxx 
b/editeng/source/outliner/outlvw.cxx
index 4a0d96e..edf617f 100644
--- a/editeng/source/outliner/outlvw.cxx
+++ b/editeng/source/outliner/outlvw.cxx
@@ -675,8 +675,12 @@ void OutlinerView::InsertText( const OutlinerParaObject& 
rParaObj )
 
 void OutlinerView::Cut()
 {
-if ( !ImpCalcSelectedPages( false ) || pOwner->ImpCanDeleteSelectedPages( 
this ) )
+if ( !ImpCalcSelectedPages( false ) || pOwner->ImpCanDeleteSelectedPages( 
this ) ) {
 pEditView->Cut();
+// Chaining handling
+if (aEndCutPasteLink.IsSet())
+aEndCutPasteLink.Call(NULL);
+}
 }
 
 void OutlinerView::Paste()
@@ -705,6 +709,11 @@ void OutlinerView::PasteSpecial()
 pEditView->SetEditEngineUpdateMode( true );
 pOwner->UndoActionEnd( OLUNDO_INSERT );
 pEditView->ShowCursor( true );
+
+// Chaining handling
+// NOTE: We need to do this last because it pEditView may be deleted 
if a switch of box occurs
+if (aEndCutPasteLink.IsSet())
+aEndCutPasteLink.Call(NULL);
 }
 }
 
commit 731000696b282f457a7e003297d4f158849825d4
Author: matteocam <matteo.campane...@gmail.com>
Date:   Mon Sep 7 19:58:16 2015 +0200

Handle DEL key for chaining

Change-Id: I124b1adf6df3c42a58d45eaeb0e1e053c0eea4c9

diff --git a/sd/source/ui/view/drviewse.cxx b/sd/source/ui/view/drviewse.cxx
index da65984..d9e0a99 100644
--- a/sd/source/ui/view/drviewse.cxx
+++ b/sd/source/ui/view/drviewse.cxx
@@ -950,7 +950,10 @@ void DrawViewShell::FuSupport(SfxRequest& rReq)
 {
 vcl::KeyCode aKCode(KEY_DELETE);
 KeyEvent aKEvt( 0, aKCode);
-pOLV->PostKeyEvent(aKEvt);
+//pOLV->PostKeyEvent(aKEvt);
+// We use SdrObjEditView to handle DEL for underflow 
handling
+mpDrawView->KeyInput(aKEvt, NULL);
+
 }
 }
 else
commit 1a86da45320faf5f644c1a82c07bd9b522a2a351
Author: matteocam <matteo.campane...@gmail.com>
Date:   Mon Sep 7 16:37:56 2015 +0200

Enable chaining after a key is pressed

Change-Id: I64351619dd0886f3bb0c080557864c46a17d737d

diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index 86a69e4..c263a62 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -1326,6 +1326,15 @@ bool SdrObjEditView::KeyInput(const KeyEvent& rKEvt, 
vcl::Window* pWin)
 
 if(pTextEditOutlinerView)
 {
+/* Start special handling of keys within a chain */
+// We possibly move to another box before any handling
+bool bHandled = false;
+TextChainCursorManager *pCursorManager =
+ImpHandleMotionThroughBoxesKeyInput(rKEvt, pWin, );
+if (bHandled)
+return true;
+/* End special handling of keys within a chain */
+
 if (pTextEditOutlinerView->PostKeyEvent(rKEvt, pWin))
 {
 if( mpModel )
@@ -1334,6 +1343,11 @@ bool SdrObjEditView::KeyInput(const KeyEvent& rKEvt, 
vcl::Window* pWin)
 mpModel->SetChanged();
 }
 
+/* Start chaining processing */
+ImpChainingEventHdl();
+ImpMoveCursorAfterChainingEvent(pCursorManager);
+/* End chaining processing */
+
 if (pWin!=NULL && pWin!=pTextEditWin) SetTextEditWin(pWin);
 #ifdef DBG_UTIL
 if (mpItemBrowser!=nullptr) mpItemBrowser->SetDirty();
commit 8ecbccf07bfcf82cb755f8abbe84f00576d76cc4
Author: matteocam <matteo.campane...@gmail.com>
Date:   Mon Sep 7 16:33:39 2015 +0200

Add methods and basic setup for editing-mode chaining

Change-Id: I8065bebaf2a54170bc7b3ddbd35740bcca42298d

diff --git a/include/svx/svdedxv.hxx b/include/svx/svdedxv.hxx
index 2aa9f89..c388941 100644
--- a/include/svx/svdedxv.hxx
+++ b/include/svx/svdedxv.hxx
@@ -34,6 +34,7 @@ class EditFieldInfo;
 class ImpSdrEditPara;
 struct PasteOrDropInfos;
 class SdrUndoManager;
+class TextChainCursorManager;
 
 namespace com { namespace sun { namespace star { namespace uno {
 class Any;
@@ -101,6 +102,10 @@ protected:
 // provide their document UndoManager and derive it from SdrUndoManager.
  

[Libreoffice-commits] core.git: Changes to 'feature/chained-text-boxes'

2015-09-07 Thread matteocam
New branch 'feature/chained-text-boxes' available with the following commits:
commit 3748019d58154b2851999c3ea9f2ab223c8e3bc3
Author: matteocam <matteo.campane...@gmail.com>
Date:   Mon Sep 7 12:44:37 2015 +0200

Change EndTextEdit behavior to support recursive overflow

Change-Id: I14009fa2e91b19a850e45484de7cd234e872689a

commit 21bd174f53de2bd4b4223919da2e901a8bdc52b4
Author: matteocam <matteo.campane...@gmail.com>
Date:   Mon Sep 7 12:32:14 2015 +0200

Change size settings if box is chainable (for overflow detection)

Change-Id: I3717324b3be36b9503cae195fd42249d92d2c685

commit 8d462d1d8ce950139ebbecf8f30e4f0d1147da99
Author: matteocam <matteo.campane...@gmail.com>
Date:   Mon Sep 7 12:17:30 2015 +0200

Add Chaining-related UNO attributes: definition and mechanisms

Change-Id: I7fd3969804ca9b04881ced0b1e43ab6236cbefcc

commit 41dca53f7c2d3e3210dc4cb20ff2f4fd2821f7d2
Author: matteocam <matteo.campane...@gmail.com>
Date:   Mon Sep 7 11:37:27 2015 +0200

Add chaining attributes and chaining primitive creation logic

Change-Id: I957d5261dd847fe5e950441585e879cfd5ae2fb2

commit 18f54671a39b408e46ef5b67b84dab74f094c052
Author: matteocam <matteo.campane...@gmail.com>
Date:   Sun Sep 6 12:06:47 2015 +0200

Enhance existing svx classes with chaining-related methods

Change-Id: I10829d8f07f8881af6d1a9422cbdae00e83a7ac8

commit 5243c0801228ff90150cadf27ecc446003d8629d
Author: matteocam <matteo.campane...@gmail.com>
Date:   Sun Sep 6 11:30:31 2015 +0200

Add TextChainCursor related files

Change-Id: I6c98a28ae800197d58df8791e72a00b6490a2e2e

commit f3db1edf4570f20bba9e5d9126083927fd049c09
Author: matteocam <matteo.campane...@gmail.com>
Date:   Sun Sep 6 11:29:03 2015 +0200

Add TextChainFlow related files

Change-Id: I0e4155391fff29dc4484c7aedd4e62f02c4afd25

commit 43e4e30fbe5533fb39e1a0715b822dd5d4eb03b8
Author: matteocam <matteo.campane...@gmail.com>
Date:   Sun Sep 6 11:26:43 2015 +0200

Add TextChain related files

Change-Id: I3fbf9d60cf1d1e022b33bb5b416c88847a1efc64

commit 6b35f0848def33353ec0d22c2f6609f31c838de1
Author: matteocam <matteo.campane...@gmail.com>
Date:   Sun Sep 6 11:14:02 2015 +0200

Add primitive creation methods for chaining

Change-Id: I061009a6830c3590e30900b14b2d006f68d237c1

commit 048cfdc6fe8059c6b4b34638a3a30a942e7f7e6d
Author: matteocam <matteo.campane...@gmail.com>
Date:   Sun Sep 6 10:50:39 2015 +0200

Add interface and implementations for text chaining

Change-Id: I378b96581c2b006eb880ca0f11e7ca76b686846e

___
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' - 4 commits - svx/source

2015-08-20 Thread matteocam
 svx/source/svdraw/textchainflow.cxx |6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit f73c004358ca3eada9ae57f44fdb1cf85d78fa47
Author: matteocam matteo.campane...@gmail.com
Date:   Thu Aug 20 19:54:12 2015 +0200

Experiment: always enable deep merging

Change-Id: I6c31ea55a6747aaef28d7ab32883287f6f551c31

diff --git a/svx/source/svdraw/textchainflow.cxx 
b/svx/source/svdraw/textchainflow.cxx
index c238331..922cfb3 100644
--- a/svx/source/svdraw/textchainflow.cxx
+++ b/svx/source/svdraw/textchainflow.cxx
@@ -97,7 +97,7 @@ void TextChainFlow::impCheckForFlowEvents(SdrOutliner 
*pFlowOutl, SdrOutliner *p
 bool bMustMergeParaOF = bMustMergeParaAmongLinks || mbOFisUFinduced;
 
 // XXX
-bMustMergeParaOF = false; // XXX: Experiment: no deep merging.
+bMustMergeParaOF = true; // XXX: Experiment: no deep merging.
 
 mpOverflChText = bOverflow ?
  new OFlowChainedText(pFlowOutl, bMustMergeParaOF) :
commit 3a56881bbd9c0338600d4606f1632ad06dfa7c35
Author: matteocam matteo.campane...@gmail.com
Date:   Thu Aug 20 19:51:03 2015 +0200

Experiment: disable deep merging

Change-Id: Ibcfd63433b750d7c0bec92ce7be3797ff11264d6

diff --git a/svx/source/svdraw/textchainflow.cxx 
b/svx/source/svdraw/textchainflow.cxx
index 922cfb3..c238331 100644
--- a/svx/source/svdraw/textchainflow.cxx
+++ b/svx/source/svdraw/textchainflow.cxx
@@ -97,7 +97,7 @@ void TextChainFlow::impCheckForFlowEvents(SdrOutliner 
*pFlowOutl, SdrOutliner *p
 bool bMustMergeParaOF = bMustMergeParaAmongLinks || mbOFisUFinduced;
 
 // XXX
-bMustMergeParaOF = true; // XXX: Experiment: no deep merging.
+bMustMergeParaOF = false; // XXX: Experiment: no deep merging.
 
 mpOverflChText = bOverflow ?
  new OFlowChainedText(pFlowOutl, bMustMergeParaOF) :
commit fdecbb0fb1d7bf8faa0edf0c41396f338ad7dba4
Author: matteocam matteo.campane...@gmail.com
Date:   Thu Aug 20 19:49:58 2015 +0200

Experiment: disable deep merging

Change-Id: I645883f9c93698350c320fcfd64476913c971f80

diff --git a/svx/source/svdraw/textchainflow.cxx 
b/svx/source/svdraw/textchainflow.cxx
index 0c107b3..922cfb3 100644
--- a/svx/source/svdraw/textchainflow.cxx
+++ b/svx/source/svdraw/textchainflow.cxx
@@ -95,6 +95,10 @@ void TextChainFlow::impCheckForFlowEvents(SdrOutliner 
*pFlowOutl, SdrOutliner *p
 
 // If we had an underflow before we have to deep merge paras anyway
 bool bMustMergeParaOF = bMustMergeParaAmongLinks || mbOFisUFinduced;
+
+// XXX
+bMustMergeParaOF = true; // XXX: Experiment: no deep merging.
+
 mpOverflChText = bOverflow ?
  new OFlowChainedText(pFlowOutl, bMustMergeParaOF) :
  NULL;
commit 9ac8f484b624fc94ab861f750bb8be6225e000cf
Author: matteocam matteo.campane...@gmail.com
Date:   Thu Aug 20 18:49:04 2015 +0200

Don't reset MaxAutoPaperSize in ExecuteUnderflow

Change-Id: Ib570029d6e43a57dc583b2e8992f5abe4c5d97d5

diff --git a/svx/source/svdraw/textchainflow.cxx 
b/svx/source/svdraw/textchainflow.cxx
index cad0b3c..0c107b3 100644
--- a/svx/source/svdraw/textchainflow.cxx
+++ b/svx/source/svdraw/textchainflow.cxx
@@ -173,7 +173,7 @@ void TextChainFlow::ExecuteUnderflow(SdrOutliner *pOutl)
 mpTargetLink-NbcSetOutlinerParaObject(pNewText);
 
 // Restore size and set new text
-pOutl-SetMaxAutoPaperSize(aOldSize);
+//pOutl-SetMaxAutoPaperSize(aOldSize); // XXX
 pOutl-SetText(*pNewText);
 
 //GetTextChain()-SetNilChainingEvent(mpTargetLink, false);
___
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' - 18 commits - editeng/source include/editeng include/svx svx/source

2015-08-20 Thread matteocam
 editeng/source/editeng/impedit3.cxx |6 
 editeng/source/outliner/outliner.cxx|2 
 editeng/source/outliner/outlvw.cxx  |   13 +
 editeng/source/outliner/overflowingtxt.cxx  |  193 +---
 include/editeng/editeng.hxx |2 
 include/editeng/outliner.hxx|2 
 include/editeng/overflowingtxt.hxx  |   40 +++--
 include/svx/svdedxv.hxx |4 
 svx/source/svdraw/svdedxv.cxx   |   17 +-
 svx/source/svdraw/svdotext.cxx  |3 
 svx/source/svdraw/svdotextdecomposition.cxx |   11 +
 svx/source/svdraw/textchainflow.cxx |   12 +
 12 files changed, 143 insertions(+), 162 deletions(-)

New commits:
commit f821b15b200a9d35fbc70b39b79cf4b5832dd2bc
Author: matteocam matteo.campane...@gmail.com
Date:   Thu Aug 20 00:25:37 2015 +0200

Add debugging output

Change-Id: I95f62d7ab27fa45a40fa4511a360a3499c39312a

diff --git a/editeng/source/editeng/impedit3.cxx 
b/editeng/source/editeng/impedit3.cxx
index ec18975..7965a06 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -570,9 +570,10 @@ void ImpEditEngine::CheckPageOverflow()
 ? YES Overflow!\n  : NO Overflow!\n ); */
 // setting overflow status
 
+fprintf(stderr, [CONTROL_STATUS] AutoPageSize is %s,  ( 
aStatus.GetControlWord()  EEControlBits::AUTOPAGESIZE ) ? ON\n : OFF\n );
+
 sal_uInt32 nBoxHeight = GetMaxAutoPaperSize().Height();
 fprintf(stderr, [OVERFLOW-CHECK] Current MaxAutoPaperHeight is %d\n, 
nBoxHeight);
-fprintf(stderr, [CONTROL_STATUS] AutoPageSize is %s,  ( 
aStatus.GetControlWord()  EEControlBits::AUTOPAGESIZE ) ? ON\n : OFF\n );
 
 sal_uInt32 nTxtHeight = CalcTextHeight(NULL);
 fprintf(stderr, [OVERFLOW-CHECK] Current Text Height is %d\n, 
nTxtHeight);
commit f146729d0a1465ce7b98ceeb404c29a5e4d6559b
Author: matteocam matteo.campane...@gmail.com
Date:   Thu Aug 20 00:23:15 2015 +0200

Add debugging out

Change-Id: I44ee885840eac60bc8ffed86242a3af3e772cce6

diff --git a/editeng/source/editeng/impedit3.cxx 
b/editeng/source/editeng/impedit3.cxx
index d49e699..ec18975 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -571,10 +571,11 @@ void ImpEditEngine::CheckPageOverflow()
 // setting overflow status
 
 sal_uInt32 nBoxHeight = GetMaxAutoPaperSize().Height();
-fprintf(stderr, [OVERFLOW-CHECK] Current MaxAutoPaperSize is %d\n, 
nBoxHeight);
+fprintf(stderr, [OVERFLOW-CHECK] Current MaxAutoPaperHeight is %d\n, 
nBoxHeight);
 fprintf(stderr, [CONTROL_STATUS] AutoPageSize is %s,  ( 
aStatus.GetControlWord()  EEControlBits::AUTOPAGESIZE ) ? ON\n : OFF\n );
 
 sal_uInt32 nTxtHeight = CalcTextHeight(NULL);
+fprintf(stderr, [OVERFLOW-CHECK] Current Text Height is %d\n, 
nTxtHeight);
 
 sal_uInt32 nParaCount = GetParaPortions().Count();
 sal_uInt32 nFirstLineCount = GetLineCount(0);
diff --git a/editeng/source/outliner/outliner.cxx 
b/editeng/source/outliner/outliner.cxx
index 30b7633..11e299b 100644
--- a/editeng/source/outliner/outliner.cxx
+++ b/editeng/source/outliner/outliner.cxx
@@ -2208,8 +2208,6 @@ OverflowingText *Outliner::GetOverflowingText() const
 return NULL;
 }
 
-
-
 sal_Int32 nHeadPara = pEditEngine-GetOverflowingParaNum();
 sal_uInt32 nParaCount = GetParagraphCount();
 
commit b3fe4c1539fff482558d356c90f30dfaf499f87c
Author: matteocam matteo.campane...@gmail.com
Date:   Thu Aug 20 00:14:33 2015 +0200

Add debugging out

Change-Id: Ia50dbcfdef7501c83797986d571058a6bf0c4c2d

diff --git a/editeng/source/outliner/overflowingtxt.cxx 
b/editeng/source/outliner/overflowingtxt.cxx
index d50c79c..b46ad22 100644
--- a/editeng/source/outliner/overflowingtxt.cxx
+++ b/editeng/source/outliner/overflowingtxt.cxx
@@ -149,6 +149,11 @@ bool NonOverflowingText::IsLastParaInterrupted() const
 OutlinerParaObject *NonOverflowingText::RemoveOverflowingText(Outliner 
*pOutliner) const
 {
 pOutliner-QuickDelete(maContentSel);
+fprintf(stderr, Deleting selection from (Para: %d, Pos: %d) to (Para: %d, 
Pos: %d)\n,
+maContentSel.nStartPara,
+maContentSel.nStartPos,
+maContentSel.nEndPara,
+maContentSel.nEndPos);
 return pOutliner-CreateParaObject();
 }
 
commit 2c6842cf2df903b73e3c3b1a9fadbdf4d8f85d3e
Author: matteocam matteo.campane...@gmail.com
Date:   Thu Aug 20 00:06:40 2015 +0200

Don't set text for editing outl in editing mode

Change-Id: I874a16e1727080d5747161e6f2868152da156385

diff --git a/svx/source/svdraw/textchainflow.cxx 
b/svx/source/svdraw/textchainflow.cxx
index 7087aa8..9739eee 100644
--- a/svx/source/svdraw/textchainflow.cxx
+++ b/svx/source/svdraw/textchainflow.cxx
@@ -172,7 +172,9 @@ void TextChainFlow::ExecuteUnderflow(SdrOutliner *pOutl)
 // We store the size since NbcSetOutlinerParaObject can change

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

2015-08-20 Thread matteocam
 editeng/source/outliner/overflowingtxt.cxx |   15 ---
 1 file changed, 12 insertions(+), 3 deletions(-)

New commits:
commit 08c726f26245e5fc0b35552812fc5bb53ef42c83
Author: matteocam matteo.campane...@gmail.com
Date:   Thu Aug 20 18:33:40 2015 +0200

Don't add empty paras

Change-Id: I9c507fc99f0c482b74ae398d1f44d3db3750f431

diff --git a/editeng/source/outliner/overflowingtxt.cxx 
b/editeng/source/outliner/overflowingtxt.cxx
index 9b6ae81..bd0f59f 100644
--- a/editeng/source/outliner/overflowingtxt.cxx
+++ b/editeng/source/outliner/overflowingtxt.cxx
@@ -44,6 +44,11 @@ OutlinerParaObject *TextChainingUtils::JuxtaposeParaObject(
 pOutl-SetText(*pNextPObj);
 }
 
+// Special case: if only empty text remove it at the end
+bool bOnlyOneEmptyPara = !pNextPObj ||
+ (pOutl-GetParagraphCount() == 1 
+  pNextPObj-GetTextObject().GetText(0) == );
+
 EditEngine rEditEngine = const_castEditEngine (pOutl-GetEditEngine());
 
 // XXX: this code should be moved in Outliner directly
@@ -54,8 +59,12 @@ OutlinerParaObject *TextChainingUtils::JuxtaposeParaObject(
 aStartSel.Min(),
 true);
 
-// Separate Paragraphs
-rEditEngine.InsertParaBreak(aNewSel);
+if (!bOnlyOneEmptyPara) {
+// Separate Paragraphs
+rEditEngine.InsertParaBreak(aNewSel);
+}
+
+
 
 return pOutl-CreateParaObject();
 }
@@ -65,7 +74,7 @@ OutlinerParaObject *TextChainingUtils::DeeplyMergeParaObject(
 Outliner *pOutl,
 OutlinerParaObject *pNextPObj)
 {
- if (!pNextPObj) {
+if (!pNextPObj) {
 pOutl-SetToEmptyText();
 } else {
 pOutl-SetText(*pNextPObj);
___
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-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' - editeng/source

2015-08-20 Thread matteocam
 editeng/source/outliner/outliner.cxx   |4 ++--
 editeng/source/outliner/overflowingtxt.cxx |2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 729dbfa57af9a237357dd54cd4b3f78c1ae32295
Author: matteocam matteo.campane...@gmail.com
Date:   Thu Aug 20 18:22:31 2015 +0200

Set right selection when creating OverflowingText

Change-Id: I795eca81c54e3196554915571e42978974fc0d73

diff --git a/editeng/source/outliner/outliner.cxx 
b/editeng/source/outliner/outliner.cxx
index 11e299b..9e76a00 100644
--- a/editeng/source/outliner/outliner.cxx
+++ b/editeng/source/outliner/outliner.cxx
@@ -2159,8 +2159,8 @@ NonOverflowingText *Outliner::GetNonOverflowingText() 
const
 //sal_Int32 nStartPos = 0;
 ESelection aOverflowingTextSelection;
 
-const sal_Int32 nEndPara = 100;
-const sal_Int32 nEndPos = 100;
+const sal_Int32 nEndPara = GetParagraphCount()-1;
+const sal_Int32 nEndPos = pEditEngine-GetTextLen(nEndPara);
 
 if (nLen == 0) {
 // XXX: What happens inside this case might be dependent on the 
joining paragraps or not-thingy
diff --git a/editeng/source/outliner/overflowingtxt.cxx 
b/editeng/source/outliner/overflowingtxt.cxx
index b46ad22..9b6ae81 100644
--- a/editeng/source/outliner/overflowingtxt.cxx
+++ b/editeng/source/outliner/overflowingtxt.cxx
@@ -89,7 +89,7 @@ OutlinerParaObject *TextChainingUtils::DeeplyMergeParaObject(
 TranferableText TextChainingUtils::CreateTransferableFromText(Outliner *pOutl)
 {
 const EditEngine rEditEngine = pOutl-GetEditEngine();
-sal_Int32 nLastPara = rEditEngine.GetParagraphCount()-1;
+sal_Int32 nLastPara = pOutl-GetParagraphCount()-1;
 ESelection aWholeTextSel(0, 0, nLastPara, 
rEditEngine.GetTextLen(nLastPara));
 
 return rEditEngine.CreateTransferable(aWholeTextSel);
___
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 - include/svx svx/source

2015-08-20 Thread matteocam
 include/svx/textchain.hxx |4 
 svx/source/svdraw/svdotxed.cxx|8 +++-
 svx/source/svdraw/textchain.cxx   |1 +
 svx/source/svdraw/textchaincursor.cxx |1 +
 4 files changed, 13 insertions(+), 1 deletion(-)

New commits:
commit 911c02aff6d91a6c2d3c08f10e6751a49d42d7cf
Author: matteocam matteo.campane...@gmail.com
Date:   Fri Aug 21 00:21:22 2015 +0200

Added implementation

Change-Id: I5f199a35fa1e10d11184791ce63f9b35b3728d03

diff --git a/svx/source/svdraw/textchain.cxx b/svx/source/svdraw/textchain.cxx
index 911e006..b7146c1 100644
--- a/svx/source/svdraw/textchain.cxx
+++ b/svx/source/svdraw/textchain.cxx
@@ -31,6 +31,7 @@ IMPL_CHAIN_PROP_INTERFACE(PreChainingSel, ESelection)
 IMPL_CHAIN_PROP_INTERFACE(PostChainingSel, ESelection)
 IMPL_CHAIN_PROP_INTERFACE(IsPartOfLastParaInNextLink, bool)
 IMPL_CHAIN_PROP_INTERFACE(PendingOverflowCheck, bool)
+IMPL_CHAIN_PROP_INTERFACE(SwitchingToNextBox, bool)
 
 
 /* End Definition of Properties Interface */
commit cd6a213f09aebf552624924f210190ffac32b8d3
Author: matteocam matteo.campane...@gmail.com
Date:   Fri Aug 21 00:17:35 2015 +0200

Don't use SetOutlinerParaObject if we are switching to next box

Change-Id: I685252094e90ee26d99d5852a63cf6dcb3dabaa8

diff --git a/include/svx/textchain.hxx b/include/svx/textchain.hxx
index 91e8211..81421f1 100644
--- a/include/svx/textchain.hxx
+++ b/include/svx/textchain.hxx
@@ -120,6 +120,7 @@ class ImpChainLinkProperties
 INIT_CHAIN_PROP(PostChainingSel, ESelection(0,0,0,0));
 INIT_CHAIN_PROP(IsPartOfLastParaInNextLink, false) // XXX: Should come 
from file
 INIT_CHAIN_PROP(PendingOverflowCheck, false)
+INIT_CHAIN_PROP(SwitchingToNextBox, false)
 }
 
 private:
@@ -130,6 +131,7 @@ class ImpChainLinkProperties
 DECL_CHAIN_PROP(PostChainingSel, ESelection)
 DECL_CHAIN_PROP(IsPartOfLastParaInNextLink, bool)
 DECL_CHAIN_PROP(PendingOverflowCheck, bool)
+DECL_CHAIN_PROP(SwitchingToNextBox, bool)
 
 };
 
@@ -158,6 +160,8 @@ class TextChain {
 DECL_CHAIN_PROP_INTERFACE(IsPartOfLastParaInNextLink, bool)
 // return whether there is a pending overflow check (usually when we move 
cursor after an overflow in the prev link)
 DECL_CHAIN_PROP_INTERFACE(PendingOverflowCheck, bool)
+// return whether we are currently moving the cursor to the next box 
(useful to know whether we should prevent SetOutlinerParaObject invocations in 
SdrTextObj::EndTextEdit)
+DECL_CHAIN_PROP_INTERFACE(SwitchingToNextBox, bool)
 
 
 
diff --git a/svx/source/svdraw/svdotxed.cxx b/svx/source/svdraw/svdotxed.cxx
index 0366545..dfcbae8 100644
--- a/svx/source/svdraw/svdotxed.cxx
+++ b/svx/source/svdraw/svdotxed.cxx
@@ -290,7 +290,13 @@ void SdrTextObj::EndTextEdit(SdrOutliner rOutl)
 // uses GetCurrentBoundRect() which needs to take the text into account
 // to work correct
 mbInEditMode = false;
-SetOutlinerParaObject(pNewText);
+// We don't want broadcasting if we are merely trying to move to next 
box (this prevents infinite loops)
+if (IsChainable()  GetTextChain()-GetSwitchingToNextBox(this)) {
+GetTextChain()-SetSwitchingToNextBox(this, false);
+NbcSetOutlinerParaObject(pNewText);
+} else {
+SetOutlinerParaObject(pNewText);
+}
 }
 
 /* Beginning Chaining-related code */
diff --git a/svx/source/svdraw/textchaincursor.cxx 
b/svx/source/svdraw/textchaincursor.cxx
index 87c8f86..23bd8f5 100644
--- a/svx/source/svdraw/textchaincursor.cxx
+++ b/svx/source/svdraw/textchaincursor.cxx
@@ -173,6 +173,7 @@ void TextChainCursorManager::HandleCursorEvent(
 pOLV-SetSelection(aNewSel);
 break;
 case CursorChainingEvent::TO_NEXT_LINK:
+mpTextObj-GetTextChain()-SetSwitchingToNextBox(mpTextObj, 
true);
 impChangeEditingTextObj(pNextLink, aNewSel);
 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' - svx/source

2015-08-20 Thread matteocam
 svx/source/svdraw/svdotxed.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 30e74050503faf5e49ebad7d682bfab43d5cccbe
Author: matteocam matteo.campane...@gmail.com
Date:   Fri Aug 21 00:36:40 2015 +0200

Simply set the SdrText's ParaObj

Change-Id: Ic4454474f31d4a013ebb1f69382e1e688e332813

diff --git a/svx/source/svdraw/svdotxed.cxx b/svx/source/svdraw/svdotxed.cxx
index dfcbae8..4ab5f68 100644
--- a/svx/source/svdraw/svdotxed.cxx
+++ b/svx/source/svdraw/svdotxed.cxx
@@ -293,7 +293,8 @@ void SdrTextObj::EndTextEdit(SdrOutliner rOutl)
 // We don't want broadcasting if we are merely trying to move to next 
box (this prevents infinite loops)
 if (IsChainable()  GetTextChain()-GetSwitchingToNextBox(this)) {
 GetTextChain()-SetSwitchingToNextBox(this, false);
-NbcSetOutlinerParaObject(pNewText);
+if( getActiveText() )
+getActiveText()-SetOutlinerParaObject( pNewText);
 } else {
 SetOutlinerParaObject(pNewText);
 }
___
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

2015-08-18 Thread matteocam
 editeng/source/outliner/overflowingtxt.cxx |   15 +++
 1 file changed, 11 insertions(+), 4 deletions(-)

New commits:
commit 02739f1876f6d945823d5c4663e6b37f435f4a2f
Author: matteocam matteo.campane...@gmail.com
Date:   Tue Aug 18 12:54:16 2015 +0200

Assign return value of InsertText to EditSelection

Change-Id: I6e00e408ed84c4310e276de8e0b37b230748cc13

diff --git a/editeng/source/outliner/overflowingtxt.cxx 
b/editeng/source/outliner/overflowingtxt.cxx
index 3a97c89..3454aee 100644
--- a/editeng/source/outliner/overflowingtxt.cxx
+++ b/editeng/source/outliner/overflowingtxt.cxx
@@ -184,25 +184,30 @@ OutlinerParaObject 
*OverflowingText::JuxtaposeParaObject(Outliner *pOutl, Outlin
 // XXX: this code should be moved in Outliner directly
 //  creating Outliner::InsertText(...transferable...)
 EditSelection 
aStartSel(pOutl-pEditEngine-CreateSelection(ESelection(0,0)));
-EditPaM aPaM = pOutl-pEditEngine-InsertText(mxOverflowingContent,
+EditSelection aNewSel = 
pOutl-pEditEngine-InsertText(mxOverflowingContent,
   OUString(),
   aStartSel.Min(),
   true);
 
 // Separate Paragraphs
-pOutl-pEditEngine-InsertParaBreak(EditSelection(aPaM, aPaM));
+pOutl-pEditEngine-InsertParaBreak(aNewSel);
 
 return pOutl-CreateParaObject();
 }
 
-OutlinerParaObject *OverflowingText::impMakeOverflowingParaObject(Outliner 
*pOutliner)
+// XXX: This method should probably be removed
+OutlinerParaObject *OverflowingText::impMakeOverflowingParaObject(Outliner *)
 {
+/*
 // Simply Juxtaposing; no within-para merging
 OutlinerParaObject *pOverflowingPObj = new 
OutlinerParaObject(*mpContentTextObj);
 // the OutlinerParaObject constr. at the prev line gives no valid outliner 
mode, so we set it
 pOverflowingPObj-SetOutlinerMode(pOutliner-GetOutlinerMode());
 
 return pOverflowingPObj;
+*/
+assert(0); // Should not be called
+return NULL;
 }
 
 
@@ -218,7 +223,9 @@ OutlinerParaObject 
*OverflowingText::DeeplyMergeParaObject(Outliner *pOutl, Outl
 // XXX: this code should be moved in Outliner directly
 //  creating Outliner::InsertText(...transferable...)
 EditSelection 
aStartSel(pOutl-pEditEngine-CreateSelection(ESelection(0,0)));
-EditPaM aPaM = pOutl-pEditEngine-InsertText(mxOverflowingContent,
+// We don't need to mark the selection
+// EditSelection aNewSel =
+pOutl-pEditEngine-InsertText(mxOverflowingContent,
   OUString(),
   aStartSel.Min(),
   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' - 3 commits - svx/source

2015-08-18 Thread matteocam
 svx/source/svdraw/textchainflow.cxx |   42 +---
 1 file changed, 30 insertions(+), 12 deletions(-)

New commits:
commit b876fcab266ab63105e29f2b526f6df5ef654944
Author: matteocam matteo.campane...@gmail.com
Date:   Tue Aug 18 14:25:55 2015 +0200

Set UpdateMode=True before transfering text in OF/UF

Change-Id: Id01abf614bd4c842d86aa644b947f6295d6d7d6d

diff --git a/svx/source/svdraw/textchainflow.cxx 
b/svx/source/svdraw/textchainflow.cxx
index 82bb4cd..06275e15 100644
--- a/svx/source/svdraw/textchainflow.cxx
+++ b/svx/source/svdraw/textchainflow.cxx
@@ -156,6 +156,12 @@ 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
 OutlinerParaObject *pNewText = impGetMergedUnderflowParaObject(pOutl);
@@ -173,6 +179,9 @@ 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
@@ -181,6 +190,11 @@ 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);
@@ -191,6 +205,9 @@ void TextChainFlow::ExecuteOverflow(SdrOutliner 
*pNonOverflOutl, SdrOutliner *pO
 impMoveChainedTextToNextLink(pOverflOutl);
 }
 
+// Reset update mode
+pNonOverflOutl-SetUpdateMode(bOldUpdateMode);
+
 //GetTextChain()-SetNilChainingEvent(mpTargetLink, false);
 }
 
commit 3476f9dc1ceab8dedb0f93ee9d5cf87f2f30
Author: matteocam matteo.campane...@gmail.com
Date:   Tue Aug 18 14:20:33 2015 +0200

Set UpdateMode=True even with editing outl

Change-Id: I18773c8ff7447741e87d25b849b6f6b2770531dc

diff --git a/svx/source/svdraw/textchainflow.cxx 
b/svx/source/svdraw/textchainflow.cxx
index d74e441..82bb4cd 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();
 
-// XXX: This could be reorganized moving most of this stuff inside 
EditingTextChainFlow (we need update=true anyway for TextChainFlow though)
+// 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);
 }
@@ -87,10 +87,9 @@ void TextChainFlow::impCheckForFlowEvents(SdrOutliner 
*pFlowOutl, SdrOutliner *p
 bOverflow = bIsPageOverflow  mpNextLink;
 bUnderflow = !bIsPageOverflow   mpNextLink  mpNextLink-HasText();
 
-if (pParamOutl != NULL)
-{
-pFlowOutl-SetUpdateMode(bOldUpdateMode);
-}
+// Reset update mode
+pFlowOutl-SetUpdateMode(bOldUpdateMode);
+
 
 // Get old state on whether to merge para-s or not
 // NOTE: We handle UF/OF using the _old_ state. The new one is simply saved
commit 4ad93ff450e53263a32dff01239aacd876e81e28
Author: matteocam matteo.campane...@gmail.com
Date:   Tue Aug 18 14:18:59 2015 +0200

Minor changes

Change-Id: Ife0861db9249dab3102399365ca965ca53b34e42

diff --git a/svx/source/svdraw/textchainflow.cxx 
b/svx/source/svdraw/textchainflow.cxx
index 94fac05..d74e441 100644
--- a/svx/source/svdraw/textchainflow.cxx
+++ b/svx/source/svdraw/textchainflow.cxx
@@ -244,10 +244,12 @@ SdrTextObj *TextChainFlow::GetNextLink() const
 return mpNextLink;
 }
 
-OutlinerParaObject *TextChainFlow::impGetOverflowingParaObject(SdrOutliner 
*pOutliner)
-{
-return mpOverflChText-CreateOverflowingParaObject(pOutliner,
-  
mpNextLink-GetOutlinerParaObject());
+OutlinerParaObject *TextChainFlow::impGetOverflowingParaObject(SdrOutliner *)
+{   // XXX: Should never be called (to be deleted)
+assert(0);
+return NULL;
+//return mpOverflChText-CreateOverflowingParaObject(pOutliner

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

2015-08-18 Thread matteocam
 svx/source/svdraw/textchainflow.cxx |7 +++
 1 file changed, 3 insertions(+), 4 deletions(-)

New commits:
commit 7902ac456f8648e4fd9520626d8f4dd46f611f0b
Author: matteocam matteo.campane...@gmail.com
Date:   Tue Aug 18 14:30:48 2015 +0200

Set UpdateMode=True before constructing OF/UF Chainers

Change-Id: I26980d644942953952ae5c16fa4e230cb077470c

diff --git a/svx/source/svdraw/textchainflow.cxx 
b/svx/source/svdraw/textchainflow.cxx
index 06275e15..872b4dc 100644
--- a/svx/source/svdraw/textchainflow.cxx
+++ b/svx/source/svdraw/textchainflow.cxx
@@ -87,10 +87,6 @@ void TextChainFlow::impCheckForFlowEvents(SdrOutliner 
*pFlowOutl, SdrOutliner *p
 bOverflow = bIsPageOverflow  mpNextLink;
 bUnderflow = !bIsPageOverflow   mpNextLink  mpNextLink-HasText();
 
-// Reset update mode
-pFlowOutl-SetUpdateMode(bOldUpdateMode);
-
-
 // Get old state on whether to merge para-s or not
 // NOTE: We handle UF/OF using the _old_ state. The new one is simply saved
 bool bMustMergeParaAmongLinks = 
GetTextChain()-GetIsPartOfLastParaInNextLink(mpTargetLink);
@@ -108,6 +104,9 @@ void TextChainFlow::impCheckForFlowEvents(SdrOutliner 
*pFlowOutl, SdrOutliner *p
   new UFlowChainedText(pFlowOutl, 
bMustMergeParaAmongLinks) :
   NULL;
 
+// Reset update mode // Reset it here because we use WriteRTF (needing 
updatemode = true) in the two constructors above
+pFlowOutl-SetUpdateMode(bOldUpdateMode);
+
 // NOTE: Must be called after mp*ChText abd b*flow have been set but 
before mbOFisUFinduced is reset
 impUpdateCursorInfo();
 
___
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 include/editeng

2015-08-15 Thread matteocam
 editeng/source/outliner/overflowingtxt.cxx |9 -
 include/editeng/editeng.hxx|2 ++
 include/editeng/outliner.hxx   |2 +-
 3 files changed, 7 insertions(+), 6 deletions(-)

New commits:
commit d5b80ee6210e9efac8f2a609ec8d9df5ce1153c9
Author: matteocam matteo.campane...@gmail.com
Date:   Sat Aug 15 11:14:50 2015 +0200

[unbuildable] Included required headers

Change-Id: I4f525b06982d34e0946e15cbcaa5fc8996d70f90

diff --git a/editeng/source/outliner/overflowingtxt.cxx 
b/editeng/source/outliner/overflowingtxt.cxx
index a443a82..3a97c89 100644
--- a/editeng/source/outliner/overflowingtxt.cxx
+++ b/editeng/source/outliner/overflowingtxt.cxx
@@ -26,6 +26,10 @@
 #include editeng/editobj.hxx
 #include editeng/editdata.hxx
 
+// XXX
+#include outleeng.hxx
+#include ../editeng/editdoc.hxx
+
 #include com/sun/star/datatransfer/clipboard/XClipboard.hpp
 
 
@@ -193,11 +197,6 @@ OutlinerParaObject 
*OverflowingText::JuxtaposeParaObject(Outliner *pOutl, Outlin
 
 OutlinerParaObject *OverflowingText::impMakeOverflowingParaObject(Outliner 
*pOutliner)
 {
-if (mpContentTextObj == NULL) {
-fprintf(stderr, [Chaining] OverflowingText's mpContentTextObj is 
NULL!\n);
-return NULL;
-}
-
 // Simply Juxtaposing; no within-para merging
 OutlinerParaObject *pOverflowingPObj = new 
OutlinerParaObject(*mpContentTextObj);
 // the OutlinerParaObject constr. at the prev line gives no valid outliner 
mode, so we set it
diff --git a/include/editeng/editeng.hxx b/include/editeng/editeng.hxx
index 98f5d7c..e5604461 100644
--- a/include/editeng/editeng.hxx
+++ b/include/editeng/editeng.hxx
@@ -145,6 +145,8 @@ class EDITENG_DLLPUBLIC EditEngine
 friend class EditDbg;
 friend class Outliner;
 
+friend class OverflowingText;
+
 public:
 typedef std::vectorEditView* ViewsType;
 
diff --git a/include/editeng/outliner.hxx b/include/editeng/outliner.hxx
index 07d9215..833a9ad 100644
--- a/include/editeng/outliner.hxx
+++ b/include/editeng/outliner.hxx
@@ -585,7 +585,7 @@ class EDITENG_DLLPUBLIC Outliner : public SfxBroadcaster
 friend class OutlinerUndoCheckPara;
 friend class OutlinerUndoChangeParaFlags;
 
-friend class NonOverflowingText;
+friend class OverflowingText;
 
 OutlinerEditEng*pEditEngine;
 
___
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' - 4 commits - editeng/source include/editeng include/svx svx/source

2015-08-14 Thread matteocam
 editeng/source/outliner/outliner.cxx   |3 -
 editeng/source/outliner/overflowingtxt.cxx |   82 ++---
 include/editeng/outliner.hxx   |2 
 include/editeng/overflowingtxt.hxx |   25 ++--
 include/svx/textchainflow.hxx  |8 +-
 svx/source/svdraw/svdotext.cxx |4 -
 svx/source/svdraw/textchainflow.cxx|   14 ++--
 7 files changed, 85 insertions(+), 53 deletions(-)

New commits:
commit 416b183144fc54eb3aeaee6b0fc584fa91d46dfb
Author: matteocam matteo.campane...@gmail.com
Date:   Fri Aug 14 20:36:48 2015 +0200

[unbuildable] use transferable

Change-Id: Id7a44157500b99d475c75e08db32c4942619fd4c

diff --git a/editeng/source/outliner/outliner.cxx 
b/editeng/source/outliner/outliner.cxx
index e921f1b..30b7633 100644
--- a/editeng/source/outliner/outliner.cxx
+++ b/editeng/source/outliner/outliner.cxx
@@ -2226,9 +2226,8 @@ OverflowingText *Outliner::GetOverflowingText() const
 sal_Int32 nLastParaLen = GetText(GetParagraph(nLastPara)).getLength();
 aOverflowingTextSel = ESelection(nOverflowingPara, nLen,
  nLastPara, nLastParaLen);
+return new 
OverflowingText(pEditEngine-CreateTransferable(aOverflowingTextSel));
 
-EditTextObject *pTObj = pEditEngine-CreateTextObject(aOverflowingTextSel);
-return new OverflowingText(pTObj);
 }
 
 void Outliner::ClearOverflowingParaNum()
diff --git a/editeng/source/outliner/overflowingtxt.cxx 
b/editeng/source/outliner/overflowingtxt.cxx
index b765550..a443a82 100644
--- a/editeng/source/outliner/overflowingtxt.cxx
+++ b/editeng/source/outliner/overflowingtxt.cxx
@@ -24,6 +24,9 @@
 #include editeng/outliner.hxx
 #include editeng/outlobj.hxx
 #include editeng/editobj.hxx
+#include editeng/editdata.hxx
+
+#include com/sun/star/datatransfer/clipboard/XClipboard.hpp
 
 
 /* Helper functions for *OverflowingText classes  */
@@ -115,15 +118,18 @@ OutlinerParaObject *impGetDeeplyMergedParaObject(Outliner 
*pOutl,
 
 // class OverflowingText
 
-OverflowingText::OverflowingText(EditTextObject *pTObj)
-: mpContentTextObj(pTObj-Clone())
+OverflowingText::OverflowingText(com::sun::star::uno::Reference
+com::sun::star::datatransfer::XTransferable xOverflowingContent) :
+mxOverflowingContent(xOverflowingContent)
 {
-// XXX: may have to delete pTObj
+
 }
 
+
 ESelection OverflowingText::GetInsertionPointSel() const
 {
-return getLastPositionSel(mpContentTextObj);
+assert(0);
+return getLastPositionSel(NULL);
 }
 
 // class NonOverflowingText
@@ -163,19 +169,26 @@ ESelection NonOverflowingText::GetOverflowPointSel() const
 
 // The equivalent of ToParaObject for OverflowingText. Here we are prepending 
the overflowing text to the old dest box's text
 // XXX: In a sense a better name for OverflowingText and NonOverflowingText 
are respectively DestLinkText and SourceLinkText
-OutlinerParaObject *OverflowingText::GetJuxtaposedParaObject(Outliner *pOutl, 
OutlinerParaObject *pNextPObj)
+OutlinerParaObject *OverflowingText::JuxtaposeParaObject(Outliner *pOutl, 
OutlinerParaObject *pNextPObj)
 {
-if (mpContentTextObj == NULL) {
-fprintf(stderr, [Chaining] OverflowingText's mpContentTextObj is 
NULL!\n);
-return NULL;
+if (!pNextPObj) {
+pOutl-SetToEmptyText();
+} else {
+pOutl-SetText(*pNextPObj);
 }
 
-OutlinerParaObject *pOverflowingPObj = new 
OutlinerParaObject(*mpContentTextObj);
-// the OutlinerParaObject constr. at the prev line gives no valid outliner 
mode, so we set it
-pOverflowingPObj-SetOutlinerMode(pOutl-GetOutlinerMode());
+// XXX: this code should be moved in Outliner directly
+//  creating Outliner::InsertText(...transferable...)
+EditSelection 
aStartSel(pOutl-pEditEngine-CreateSelection(ESelection(0,0)));
+EditPaM aPaM = pOutl-pEditEngine-InsertText(mxOverflowingContent,
+  OUString(),
+  aStartSel.Min(),
+  true);
 
-// Simply Juxtaposing; no within-para merging
-return impGetJuxtaposedParaObject(pOutl, pOverflowingPObj, pNextPObj);
+// Separate Paragraphs
+pOutl-pEditEngine-InsertParaBreak(EditSelection(aPaM, aPaM));
+
+return pOutl-CreateParaObject();
 }
 
 OutlinerParaObject *OverflowingText::impMakeOverflowingParaObject(Outliner 
*pOutliner)
@@ -194,11 +207,24 @@ OutlinerParaObject 
*OverflowingText::impMakeOverflowingParaObject(Outliner *pOut
 }
 
 
-OutlinerParaObject *OverflowingText::GetDeeplyMergedParaObject(Outliner 
*pOutliner, OutlinerParaObject *pNextPObj)
+OutlinerParaObject *OverflowingText::DeeplyMergeParaObject(Outliner *pOutl, 
OutlinerParaObject *pNextPObj)
 {
-OutlinerParaObject *pOverflowingPObj = 
impMakeOverflowingParaObject(pOutliner);
 
-return impGetDeeplyMergedParaObject(pOutliner, pOverflowingPObj

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

2015-08-12 Thread matteocam
 editeng/source/outliner/outliner.cxx |   36 ---
 1 file changed, 21 insertions(+), 15 deletions(-)

New commits:
commit 3c0fe30626e7b4e361d9fd6e4a864b4ec17b93f3
Author: matteocam matteo.campane...@gmail.com
Date:   Wed Aug 12 11:36:46 2015 +0200

Use GetNonOverflowingText code for QuickDelete's sel

Change-Id: If745bcca79ba6d69dcab6acaa8663027cf63f7af

diff --git a/editeng/source/outliner/outliner.cxx 
b/editeng/source/outliner/outliner.cxx
index bf4ab34..e921f1b 100644
--- a/editeng/source/outliner/outliner.cxx
+++ b/editeng/source/outliner/outliner.cxx
@@ -2089,7 +2089,7 @@ NonOverflowingText *Outliner::GetNonOverflowingText() 
const
 
 // last non-overflowing paragraph is before the first overflowing one
 sal_Int32 nCount = pEditEngine-GetOverflowingParaNum();
-//sal_Int32 nOverflowLine = pEditEngine-GetOverflowingLineNum(); // XXX: 
Unused for now
+sal_Int32 nOverflowLine = pEditEngine-GetOverflowingLineNum(); // XXX: 
Unused for now
 
 // Defensive check: oveflowing para index beyond actual # of paragraphs?
 if ( nCount  GetParagraphCount()-1) {
@@ -2107,8 +2107,11 @@ NonOverflowingText *Outliner::GetNonOverflowingText() 
const
 return NULL;
  }
 
- // Same code as GetOverflowingText (we just have to get that selection 
after all)
+// NOTE: We want the selection of the overflowing text from here
+//   At the same time we may want to consider the beginning of such 
text
+//   in a more fine grained way (i.e. as GetNonOverflowingText did)
 
+/*
 sal_Int32 nHeadPara = pEditEngine-GetOverflowingParaNum();
 sal_uInt32 nParaCount = GetParagraphCount();
 
@@ -2129,17 +2132,17 @@ NonOverflowingText *Outliner::GetNonOverflowingText() 
const
 pEditEngine-GetOverflowingLineNum()  0;
 
 return new NonOverflowingText(aOverflowingTextSel, bLastParaInterrupted);
+**/
 
-/* Old code
 
 // Only overflowing text, i.e. 1st line of 1st paragraph overflowing
 bool bItAllOverflew = nCount == 0  nOverflowLine == 0;
 if ( bItAllOverflew )
 {
 ESelection aEmptySel(0,0,0,0);
-EditTextObject *pTObj = pEditEngine-CreateTextObject(aEmptySel);
+//EditTextObject *pTObj = pEditEngine-CreateTextObject(aEmptySel);
 bool bLastParaInterrupted = true; // Last Para was interrupted since 
everything overflew
-return new NonOverflowingText(pTObj, bLastParaInterrupted);
+return new NonOverflowingText(aEmptySel, bLastParaInterrupted);
 } else { // Get the lines that of the overflowing para fit in the box
 
 sal_Int32 nOverflowingPara = nCount;
@@ -2152,29 +2155,32 @@ NonOverflowingText *Outliner::GetNonOverflowingText() 
const
 nLen += GetLineLen(nOverflowingPara, nLine);
 }
 
-sal_Int32 nStartPara = 0;
-sal_Int32 nStartPos = 0;
-ESelection aNonOverflowingTextSelection;
+//sal_Int32 nStartPara = 0;
+//sal_Int32 nStartPos = 0;
+ESelection aOverflowingTextSelection;
+
+const sal_Int32 nEndPara = 100;
+const sal_Int32 nEndPos = 100;
+
 if (nLen == 0) {
 // XXX: What happens inside this case might be dependent on the 
joining paragraps or not-thingy
 // Overflowing paragraph is empty or first line overflowing: it's 
not Non-Overflowing text then
 sal_Int32 nParaLen = 
GetText(GetParagraph(nOverflowingPara-1)).getLength();
-aNonOverflowingTextSelection =
-ESelection(nStartPara, nStartPos, nOverflowingPara-1, 
nParaLen);
+aOverflowingTextSelection =
+ESelection(nOverflowingPara-1, nParaLen, nEndPara, nEndPos);
 } else {
 // We take until we have to from the overflowing paragraph
-aNonOverflowingTextSelection =
-ESelection(nStartPara, nStartPos, nOverflowingPara, nLen);
+aOverflowingTextSelection =
+ESelection(nOverflowingPara, nLen, nEndPara, nEndPos);
 }
-EditTextObject *pTObj = 
pEditEngine-CreateTextObject(aNonOverflowingTextSelection);
+//EditTextObject *pTObj = 
pEditEngine-CreateTextObject(aNonOverflowingTextSelection);
 
 //sal_Int32 nLastLine = GetLineCount(nOverflowingPara)-1;
 bool bLastParaInterrupted =
 pEditEngine-GetOverflowingLineNum()  0;
 
-   return new NonOverflowingText(pTObj, bLastParaInterrupted);
+   return new NonOverflowingText(aOverflowingTextSelection, 
bLastParaInterrupted);
 }
-* */
 }
 
 OutlinerParaObject *Outliner::GetEmptyParaObject() const
commit e2bd4eaeb05907cb6f0c48d778524e44143bb495
Author: matteocam matteo.campane...@gmail.com
Date:   Mon Aug 10 13:27:56 2015 +0200

Noop commit for feature/gsoc14-draw-chained-text-boxes

Change-Id: Ia1b47adaf805ffc0a2f35efd1ab2eac8ae3ab1ce
___
Libreoffice-commits mailing list

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

2015-08-10 Thread matteocam
 editeng/source/outliner/outliner.cxx   |2 +-
 editeng/source/outliner/overflowingtxt.cxx |4 +++-
 include/editeng/overflowingtxt.hxx |3 ++-
 svx/source/svdraw/svdedxv.cxx  |2 +-
 4 files changed, 7 insertions(+), 4 deletions(-)

New commits:
commit b602f532c8b9b022366a561e1b61ab198321bb20
Author: matteocam matteo.campane...@gmail.com
Date:   Mon Aug 10 13:26:38 2015 +0200

Removed warnings from editeng

Change-Id: I045ec6348277fd958d91169931ba4a0194f76a51

diff --git a/editeng/source/outliner/outliner.cxx 
b/editeng/source/outliner/outliner.cxx
index 68a17c2..bf4ab34 100644
--- a/editeng/source/outliner/outliner.cxx
+++ b/editeng/source/outliner/outliner.cxx
@@ -2089,7 +2089,7 @@ NonOverflowingText *Outliner::GetNonOverflowingText() 
const
 
 // last non-overflowing paragraph is before the first overflowing one
 sal_Int32 nCount = pEditEngine-GetOverflowingParaNum();
-sal_Int32 nOverflowLine = pEditEngine-GetOverflowingLineNum();
+//sal_Int32 nOverflowLine = pEditEngine-GetOverflowingLineNum(); // XXX: 
Unused for now
 
 // Defensive check: oveflowing para index beyond actual # of paragraphs?
 if ( nCount  GetParagraphCount()-1) {
diff --git a/include/editeng/overflowingtxt.hxx 
b/include/editeng/overflowingtxt.hxx
index 76a9623..a2fb6c0 100644
--- a/include/editeng/overflowingtxt.hxx
+++ b/include/editeng/overflowingtxt.hxx
@@ -72,8 +72,9 @@ private:
 
 friend class Outliner;
 const EditTextObject *mpContentTextObj;
-const bool mbLastParaInterrupted;
 const ESelection maContentSel;
+const bool mbLastParaInterrupted;
+
 };
 
 
commit 6343fe5bcb5efcf3992e6614d5262bae48262505
Author: matteocam matteo.campane...@gmail.com
Date:   Mon Aug 10 13:24:24 2015 +0200

Remove Warning for cursor handling

Change-Id: I193ec852d965738d1b29b4c8c0c82c4bb7451a5b

diff --git a/editeng/source/outliner/overflowingtxt.cxx 
b/editeng/source/outliner/overflowingtxt.cxx
index 34f1bb4..92c6ca8 100644
--- a/editeng/source/outliner/overflowingtxt.cxx
+++ b/editeng/source/outliner/overflowingtxt.cxx
@@ -160,7 +160,9 @@ OutlinerParaObject 
*NonOverflowingText::ToParaObject(Outliner *pOutliner) const
 
 ESelection NonOverflowingText::GetOverflowPointSel() const
 {
-return getLastPositionSel(mpContentTextObj);
+//return getLastPositionSel(mpContentTextObj);
+// XXX: Not sure this can work properly
+return maContentSel;
 }
 
 // The equivalent of ToParaObject for OverflowingText. Here we are prepending 
the overflowing text to the old dest box's text
diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index c731052..7ac8413 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -1299,7 +1299,7 @@ bool SdrObjEditView::IsTextEditFrameHit(const Point 
rHit) const
 
 TextChainCursorManager *SdrObjEditView::ImpHandleMotionThroughBoxesKeyInput(
 const KeyEvent rKEvt,
-vcl::Window* pWin,
+vcl::Window*,
 bool *bOutHandled)
 {
 *bOutHandled = false;
___
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' - svx/source

2015-08-07 Thread matteocam
 svx/source/svdraw/svdotxed.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 482677679b868ba41b3829023542bed607704c7e
Author: matteocam matteo.campane...@gmail.com
Date:   Fri Aug 7 12:34:15 2015 +0200

Prevent flushing.

Change-Id: Ia3d0399fa7745904ec66b818a278ce12f73e3529

diff --git a/svx/source/svdraw/svdotxed.cxx b/svx/source/svdraw/svdotxed.cxx
index 92288ad..0366545 100644
--- a/svx/source/svdraw/svdotxed.cxx
+++ b/svx/source/svdraw/svdotxed.cxx
@@ -298,7 +298,7 @@ void SdrTextObj::EndTextEdit(SdrOutliner rOutl)
 rOutl.ClearOverflowingParaNum();
 // XXX: Experiment
 /* Flush overflow for next textbox */
-if (
+if (false 
 IsChainable() 
 GetNextLinkInChain() 
 GetTextChain()-GetPendingOverflowCheck(GetNextLinkInChain()) )
___
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

2015-08-07 Thread matteocam
 editeng/source/outliner/outlvw.cxx |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit eddc701b22134997c53edc7c1d438a343bac017a
Author: matteocam matteo.campane...@gmail.com
Date:   Fri Aug 7 12:37:54 2015 +0200

Calling chaining during undo action for paste

Change-Id: I68516eaa53703df9a96a8c5727272ee11f172788

diff --git a/editeng/source/outliner/outlvw.cxx 
b/editeng/source/outliner/outlvw.cxx
index 16c416c..2f691bd 100644
--- a/editeng/source/outliner/outlvw.cxx
+++ b/editeng/source/outliner/outlvw.cxx
@@ -707,13 +707,13 @@ void OutlinerView::PasteSpecial()
 pOwner-ImplSetLevelDependendStyleSheet( nPara );
 }
 
+// XXX: Chaining call
+if (aEndCutPasteLink.IsSet())
+aEndCutPasteLink.Call(NULL);
+
 pEditView-SetEditEngineUpdateMode( true );
 pOwner-UndoActionEnd( OLUNDO_INSERT );
 pEditView-ShowCursor( true, true );
-
-// XXX: Not sure if this should be called right before ShowCursor
-if (aEndCutPasteLink.IsSet())
-aEndCutPasteLink.Call(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' - 3 commits - editeng/source include/editeng svx/source

2015-08-07 Thread matteocam
 editeng/source/outliner/outliner.cxx   |   28 +++-
 editeng/source/outliner/outlvw.cxx |1 +
 editeng/source/outliner/overflowingtxt.cxx |   16 +---
 include/editeng/overflowingtxt.hxx |2 ++
 svx/source/svdraw/textchainflow.cxx|2 +-
 5 files changed, 44 insertions(+), 5 deletions(-)

New commits:
commit 30db056d97d95d5d68f938e390e0874f12f40e87
Author: matteocam matteo.campane...@gmail.com
Date:   Fri Aug 7 17:43:39 2015 +0200

Using QuickDelete instead of SetText for changes in Overflow

Change-Id: Ia952113a6cdd0beace331e1f63d08b124d2629b0

diff --git a/editeng/source/outliner/outliner.cxx 
b/editeng/source/outliner/outliner.cxx
index 1404868..68a17c2 100644
--- a/editeng/source/outliner/outliner.cxx
+++ b/editeng/source/outliner/outliner.cxx
@@ -2107,6 +2107,31 @@ NonOverflowingText *Outliner::GetNonOverflowingText() 
const
 return NULL;
  }
 
+ // Same code as GetOverflowingText (we just have to get that selection 
after all)
+
+sal_Int32 nHeadPara = pEditEngine-GetOverflowingParaNum();
+sal_uInt32 nParaCount = GetParagraphCount();
+
+sal_uInt32 nLen = 0;
+for ( sal_Int32 nLine = 0;
+  nLine  pEditEngine-GetOverflowingLineNum();
+  nLine++) {
+nLen += GetLineLen(nHeadPara, nLine);
+}
+
+sal_uInt32 nOverflowingPara = pEditEngine-GetOverflowingParaNum();
+ESelection aOverflowingTextSel;
+sal_Int32 nLastPara = nParaCount-1;
+sal_Int32 nLastParaLen = GetText(GetParagraph(nLastPara)).getLength();
+aOverflowingTextSel = ESelection(nOverflowingPara, nLen,
+ nLastPara, nLastParaLen);
+bool bLastParaInterrupted =
+pEditEngine-GetOverflowingLineNum()  0;
+
+return new NonOverflowingText(aOverflowingTextSel, bLastParaInterrupted);
+
+/* Old code
+
 // Only overflowing text, i.e. 1st line of 1st paragraph overflowing
 bool bItAllOverflew = nCount == 0  nOverflowLine == 0;
 if ( bItAllOverflew )
@@ -2147,8 +2172,9 @@ NonOverflowingText *Outliner::GetNonOverflowingText() 
const
 bool bLastParaInterrupted =
 pEditEngine-GetOverflowingLineNum()  0;
 
-return new NonOverflowingText(pTObj, bLastParaInterrupted);
+   return new NonOverflowingText(pTObj, bLastParaInterrupted);
 }
+* */
 }
 
 OutlinerParaObject *Outliner::GetEmptyParaObject() const
diff --git a/editeng/source/outliner/outlvw.cxx 
b/editeng/source/outliner/outlvw.cxx
index 8f7be36..39f6321 100644
--- a/editeng/source/outliner/outlvw.cxx
+++ b/editeng/source/outliner/outlvw.cxx
@@ -697,9 +697,6 @@ void OutlinerView::PasteSpecial()
 pOwner-UndoActionStart( OLUNDO_INSERT );
 
 pOwner-pEditEngine-SetUpdateMode( false );
-// XXX:Experiment with QuickDelete
-pOwner-QuickDelete(ESelection(0,0,0,1));
-
 pOwner-bPasting = true;
 pEditView-PasteSpecial();
 
diff --git a/editeng/source/outliner/overflowingtxt.cxx 
b/editeng/source/outliner/overflowingtxt.cxx
index b015c28..34f1bb4 100644
--- a/editeng/source/outliner/overflowingtxt.cxx
+++ b/editeng/source/outliner/overflowingtxt.cxx
@@ -135,6 +135,12 @@ NonOverflowingText::NonOverflowingText(const 
EditTextObject *pTObj,  bool bLastP
  // XXX: may have to delete pTObj
 }
 
+NonOverflowingText::NonOverflowingText(const ESelection aSel, bool 
bLastParaInterrupted)
+: maContentSel(aSel),
+  mbLastParaInterrupted(bLastParaInterrupted)
+{
+}
+
 bool NonOverflowingText::IsLastParaInterrupted() const
 {
 return mbLastParaInterrupted;
@@ -143,9 +149,13 @@ bool NonOverflowingText::IsLastParaInterrupted() const
 
 OutlinerParaObject *NonOverflowingText::ToParaObject(Outliner *pOutliner) const
 {
-OutlinerParaObject *pPObj = new OutlinerParaObject(*mpContentTextObj);
-pPObj-SetOutlinerMode(pOutliner-GetOutlinerMode());
-return pPObj;
+// XXX: Old code
+//OutlinerParaObject *pPObj = new OutlinerParaObject(*mpContentTextObj);
+//pPObj-SetOutlinerMode(pOutliner-GetOutlinerMode());
+//return pPObj;
+
+pOutliner-QuickDelete(maContentSel);
+return pOutliner-CreateParaObject();
 }
 
 ESelection NonOverflowingText::GetOverflowPointSel() const
diff --git a/include/editeng/overflowingtxt.hxx 
b/include/editeng/overflowingtxt.hxx
index ae9b39e..76a9623 100644
--- a/include/editeng/overflowingtxt.hxx
+++ b/include/editeng/overflowingtxt.hxx
@@ -68,10 +68,12 @@ public:
 private:
 // Constructor
 NonOverflowingText(const EditTextObject *pTObj, bool 
bLastParaInterrupted);
+NonOverflowingText(const ESelection aSel, bool bLastParaInterrupted);
 
 friend class Outliner;
 const EditTextObject *mpContentTextObj;
 const bool mbLastParaInterrupted;
+const ESelection maContentSel;
 };
 
 
diff --git a/svx/source/svdraw/textchainflow.cxx 
b/svx/source/svdraw/textchainflow.cxx
index 1da308a..71fd30f 100644
--- a/svx/source

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

2015-08-07 Thread matteocam
 svx/source/svdraw/textchainflow.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 5169902cbda85d0a9ba55c86f6c83aa6d01050a8
Author: matteocam matteo.campane...@gmail.com
Date:   Fri Aug 7 14:37:47 2015 +0200

Add debugging output for EditingTextChainFlow constructor

Change-Id: Ia9cfe90422911c37fb7bd236efc905592a9a5284

diff --git a/svx/source/svdraw/textchainflow.cxx 
b/svx/source/svdraw/textchainflow.cxx
index 581b5be..1da308a 100644
--- a/svx/source/svdraw/textchainflow.cxx
+++ b/svx/source/svdraw/textchainflow.cxx
@@ -278,6 +278,7 @@ UFlowChainedText *TextChainFlow::GetUnderflowChainedText() 
const
 EditingTextChainFlow::EditingTextChainFlow(SdrTextObj *pLinkTarget) :
 TextChainFlow(pLinkTarget)
 {
+fprintf(stderr, [TEXTCHAINFLOW] Creating a new EditingTextChainFlow\n);
 }
 
 void EditingTextChainFlow::CheckForFlowEvents(SdrOutliner *pFlowOutl)
___
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' - svx/source

2015-08-07 Thread matteocam
 svx/source/svdraw/svdedxv.cxx |   18 ++
 1 file changed, 18 insertions(+)

New commits:
commit 0a831fb805994ddeabc36c3512198e6eadb9b0d2
Author: matteocam matteo.campane...@gmail.com
Date:   Fri Aug 7 14:33:33 2015 +0200

Add UndoSetText for chaining in edit mode

Change-Id: I684c9cfed36510a967ad043cceeb71f91fd56ae8

diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index 53a0af2..c731052 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -517,9 +517,27 @@ IMPL_LINK_NOARG(SdrObjEditView,ImpChainingEventHdl)
 pTextChain-SetPreChainingSel(pTextObj, pOLV-GetSelection());
 //maPreChainingSel = new ESelection(pOLV-GetSelection());
 
+// Handling Undo
+const int nText = 0; // XXX: hardcoded index (SdrTextObj::getText 
handles only 0)
+
+SdrUndoObjSetText *pTxtUndo  = dynamic_cast SdrUndoObjSetText* 
+( 
GetModel()-GetSdrUndoFactory().CreateUndoObjectSetText(*pTextObj, nText ) );
+
 // trigger actual chaining
 pTextObj-onChainingEvent();
 
+   if (pTxtUndo!=NULL)
+{
+pTxtUndo-AfterSetText();
+if (!pTxtUndo-IsDifferent())
+{
+delete pTxtUndo;
+pTxtUndo=NULL;
+}
+}
+
+AddUndo(pTxtUndo);
+
 //maCursorEvent = new 
CursorChainingEvent(pTextChain-GetCursorEvent(pTextObj));
 //SdrTextObj *pNextLink = pTextObj-GetNextLinkInChain();
 
___
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' - include/svx svx/source

2015-08-05 Thread matteocam
 include/svx/textchain.hxx |   10 +++--
 svx/source/svdraw/svdotxed.cxx|   16 
 svx/source/svdraw/textchain.cxx   |   65 +-
 svx/source/svdraw/textchaincursor.cxx |7 +++
 4 files changed, 32 insertions(+), 66 deletions(-)

New commits:
commit 0cd61255022e054c795baf364b1a0e0ceca9cc76
Author: matteocam matteo.campane...@gmail.com
Date:   Wed Aug 5 13:18:26 2015 +0200

Handle Pending Overflow Check for domino chaining

Change-Id: I9053f858c97f68f99cea3705e08e374aedc53107

diff --git a/include/svx/textchain.hxx b/include/svx/textchain.hxx
index 631f646..91e8211 100644
--- a/include/svx/textchain.hxx
+++ b/include/svx/textchain.hxx
@@ -38,10 +38,10 @@
  *in constructor of ImpChainLinkProperties below
  *(V is the initialization value for PROPNAME)
  *
- * 2) Add
+ * 3) Add
  *  DECL_CHAIN_PROP_INTERFACE(PROPNAME, T)
  *in class TextChain (under public:);
- * 3)  Add
+ * 4)  Add
  *   IMPL_CHAIN_PROP_INTERFACE(PROPNAME, T)
  *in file svx/source/svdraw/textchain.cxx
 */
@@ -119,15 +119,17 @@ class ImpChainLinkProperties
 INIT_CHAIN_PROP(PreChainingSel, ESelection(0,0,0,0));
 INIT_CHAIN_PROP(PostChainingSel, ESelection(0,0,0,0));
 INIT_CHAIN_PROP(IsPartOfLastParaInNextLink, false) // XXX: Should come 
from file
+INIT_CHAIN_PROP(PendingOverflowCheck, false)
 }
 
 private:
-// NOTE: Remember to set default value in contructor when adding field
+// NOTE: Remember to set default value in constructor when adding field
 DECL_CHAIN_PROP(NilChainingEvent, bool)
 DECL_CHAIN_PROP(CursorEvent, CursorChainingEvent)
 DECL_CHAIN_PROP(PreChainingSel, ESelection)
 DECL_CHAIN_PROP(PostChainingSel, ESelection)
 DECL_CHAIN_PROP(IsPartOfLastParaInNextLink, bool)
+DECL_CHAIN_PROP(PendingOverflowCheck, bool)
 
 };
 
@@ -154,6 +156,8 @@ class TextChain {
 DECL_CHAIN_PROP_INTERFACE(PostChainingSel, ESelection)
 // return whether a paragraph is split between this box and the next
 DECL_CHAIN_PROP_INTERFACE(IsPartOfLastParaInNextLink, bool)
+// return whether there is a pending overflow check (usually when we move 
cursor after an overflow in the prev link)
+DECL_CHAIN_PROP_INTERFACE(PendingOverflowCheck, bool)
 
 
 
diff --git a/svx/source/svdraw/svdotxed.cxx b/svx/source/svdraw/svdotxed.cxx
index 72c6ca4..02c800fe 100644
--- a/svx/source/svdraw/svdotxed.cxx
+++ b/svx/source/svdraw/svdotxed.cxx
@@ -28,6 +28,7 @@
 #include svl/itemset.hxx
 #include editeng/eeitem.hxx
 #include svx/sdtfchim.hxx
+#include svx/textchain.hxx
 
 
 bool SdrTextObj::HasTextEdit() const
@@ -280,8 +281,23 @@ void SdrTextObj::EndTextEdit(SdrOutliner rOutl)
 SetOutlinerParaObject(pNewText);
 }
 
+/* Beginning Chaining-related code */
 // we do not need the bookmark at the overflowing check anymore.
 rOutl.ClearOverflowingParaNum();
+// XXX: Experiment
+/* Flush overflow for next textbox */
+if (IsChainable() 
+GetNextLinkInChain() 
+GetTextChain()-GetPendingOverflowCheck(GetNextLinkInChain()) )
+{
+GetTextChain()-SetPendingOverflowCheck(GetNextLinkInChain(), false);
+// NEXT: Prepare outliner for overflow
+SdrOutliner rDrawOutl = GetNextLinkInChain()-ImpGetDrawOutliner();
+rDrawOutl.SetUpdateMode(true);
+// XXX: Change name of method above to 
impHandleChainingEventsNonEditMode
+
GetNextLinkInChain()-impHandleChainingEventsDuringDecomposition(rDrawOutl);
+}
+/* End Chaining-related code */
 
 pEdtOutl = NULL;
 rOutl.Clear();
diff --git a/svx/source/svdraw/textchain.cxx b/svx/source/svdraw/textchain.cxx
index c19b924..911e006 100644
--- a/svx/source/svdraw/textchain.cxx
+++ b/svx/source/svdraw/textchain.cxx
@@ -30,6 +30,8 @@ IMPL_CHAIN_PROP_INTERFACE(NilChainingEvent, bool)
 IMPL_CHAIN_PROP_INTERFACE(PreChainingSel, ESelection)
 IMPL_CHAIN_PROP_INTERFACE(PostChainingSel, ESelection)
 IMPL_CHAIN_PROP_INTERFACE(IsPartOfLastParaInNextLink, bool)
+IMPL_CHAIN_PROP_INTERFACE(PendingOverflowCheck, bool)
+
 
 /* End Definition of Properties Interface */
 
@@ -46,69 +48,6 @@ TextChain::~TextChain()
 // XXX: Should free all LinkProperties
 }
 
-/*
-bool TextChain::IsLinkInChain(SdrTextObj *) const
-{
-return true;// XXX: Should make an actual check
-}
-
-void TextChain::AppendLink(SdrTextObj *)
-{
-// XXX
-}
-
-SdrTextObj *TextChain::GetNextLink(const SdrTextObj *pTextObj) const
-{
-return impGetNextLink(pTextObj);
-}
-
-SdrTextObj *TextChain::GetPrevLink(const SdrTextObj *pTextObj) const
-{
-return impGetPrevLink(pTextObj);
-}
-
-SdrTextObj *TextChain::impGetNextLink(const SdrTextObj *pTextObj) const
-{
-// XXX: Temporary implementation based on index number
-
-SdrTextObj *pNextTextObj = NULL;
-SdrPage *pPage = pTextObj-pPage;
-
-if ( pPage  pPage-GetObjCount()  1) {
-
-sal_uInt32 nextIndex = (pTextObj-GetOrdNum()+1

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

2015-08-05 Thread matteocam
 svx/source/svdraw/svdotext.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 9531a7d36141789d5b4d004758bf11e184f411b7
Author: matteocam matteo.campane...@gmail.com
Date:   Wed Aug 5 13:29:13 2015 +0200

Restore right MaxAutoPaperSize in SdrTextObj::ImpInitDrawOutliner

Change-Id: I51d7b8487bc68e0108b9b2f4ba3c2d4470ec99a1

diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx
index e61088b..1c0769e 100644
--- a/svx/source/svdraw/svdotext.cxx
+++ b/svx/source/svdraw/svdotext.cxx
@@ -1246,7 +1246,7 @@ void SdrTextObj::ImpInitDrawOutliner( SdrOutliner rOutl 
) const
 nStat = 
~EEControlBits(EEControlBits::STRETCHING|EEControlBits::AUTOPAGESIZE);
 rOutl.SetControlWord(nStat);
 Size aNullSize;
-Size aMaxSize(10,2418);
+Size aMaxSize(10,10);
 rOutl.SetMinAutoPaperSize(aNullSize);
 rOutl.SetMaxAutoPaperSize(aMaxSize);
 rOutl.SetPaperSize(aMaxSize);
___
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 - svx/source

2015-08-05 Thread matteocam
 svx/source/svdraw/svdotxed.cxx |   28 +++-
 1 file changed, 27 insertions(+), 1 deletion(-)

New commits:
commit 98b10d15f111c0960959c26f6fa5778f028a8228
Author: matteocam matteo.campane...@gmail.com
Date:   Wed Aug 5 15:09:34 2015 +0200

Set text object before flushing overflow checks

Change-Id: Ie7e3162616f7d1ab53198dd0190326885a31b5fc

diff --git a/svx/source/svdraw/svdotxed.cxx b/svx/source/svdraw/svdotxed.cxx
index f948674..92288ad 100644
--- a/svx/source/svdraw/svdotxed.cxx
+++ b/svx/source/svdraw/svdotxed.cxx
@@ -316,6 +316,8 @@ void SdrTextObj::EndTextEdit(SdrOutliner rOutl)
 
 // Set parameters // Code from ImpSetTextEditParams
 ImpUpdateOutlParamsForOverflow(rDrawOutl, GetNextLinkInChain());
+const OutlinerParaObject *pObj = 
GetNextLinkInChain()-GetOutlinerParaObject();
+rDrawOutl.SetText(*pObj);
 
 rDrawOutl.SetUpdateMode(true);
 // XXX: Change name of method above to 
impHandleChainingEventsNonEditMode
commit b0ad0b1a8294dd95f38fe4028787b01781e0ed68
Author: matteocam matteo.campane...@gmail.com
Date:   Wed Aug 5 14:43:58 2015 +0200

Update parameters for overflow as done for edt outl

Change-Id: I963a50e8f5a6511cfe5dc9e5fe4d308c29d64d75

diff --git a/svx/source/svdraw/svdotxed.cxx b/svx/source/svdraw/svdotxed.cxx
index 02c800fe..f948674 100644
--- a/svx/source/svdraw/svdotxed.cxx
+++ b/svx/source/svdraw/svdotxed.cxx
@@ -262,6 +262,18 @@ void SdrTextObj::TakeTextEditArea(Size* pPaperMin, Size* 
pPaperMax, Rectangle* p
 if (pViewInit!=NULL) *pViewInit=aViewInit;
 }
 
+void ImpUpdateOutlParamsForOverflow(SdrOutliner *pOutl, SdrTextObj *pTextObj)
+{
+Size aPaperMin;
+Size aPaperMax;
+Rectangle aEditArea;
+pTextObj-TakeTextEditArea(aPaperMin,aPaperMax,aEditArea,NULL);
+
+pOutl-SetMinAutoPaperSize(aPaperMin);
+pOutl-SetMaxAutoPaperSize(aPaperMax);
+pOutl-SetPaperSize(Size());
+}
+
 void SdrTextObj::EndTextEdit(SdrOutliner rOutl)
 {
 OutlinerParaObject* pNewText = NULL;
@@ -286,13 +298,25 @@ void SdrTextObj::EndTextEdit(SdrOutliner rOutl)
 rOutl.ClearOverflowingParaNum();
 // XXX: Experiment
 /* Flush overflow for next textbox */
-if (IsChainable() 
+if (
+IsChainable() 
 GetNextLinkInChain() 
 GetTextChain()-GetPendingOverflowCheck(GetNextLinkInChain()) )
 {
 GetTextChain()-SetPendingOverflowCheck(GetNextLinkInChain(), false);
 // NEXT: Prepare outliner for overflow
+/* FIXME
+ * Outliner needs to be prepared in the same way it is prepared
+ * in SdrTextObj::impDecomposeChainedTextPrimitive.
+ * This is not immediately feasible because that code needs some 
parameters
+ * that are specific of decomposition.
+ * Is there any other part where we get those parameters, e.g. who 
prepares the editing outliner? XXX
+*/
 SdrOutliner rDrawOutl = GetNextLinkInChain()-ImpGetDrawOutliner();
+
+// Set parameters // Code from ImpSetTextEditParams
+ImpUpdateOutlParamsForOverflow(rDrawOutl, GetNextLinkInChain());
+
 rDrawOutl.SetUpdateMode(true);
 // XXX: Change name of method above to 
impHandleChainingEventsNonEditMode
 
GetNextLinkInChain()-impHandleChainingEventsDuringDecomposition(rDrawOutl);
___
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

2015-08-04 Thread matteocam
 editeng/source/editeng/impedit3.cxx |6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 37ff6848c22ea01a621468808263dfdfaac69e17
Author: matteocam matteo.campane...@gmail.com
Date:   Tue Aug 4 13:50:03 2015 +0200

Use reference for ditLine ImplUpdateOverflowingLineNum

Change-Id: If3926aab7a60ea201d5dd827cf6435642ce68e03

diff --git a/editeng/source/editeng/impedit3.cxx 
b/editeng/source/editeng/impedit3.cxx
index 865081b..d49e699 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -4652,7 +4652,8 @@ void 
ImpEditEngine::ImplUpdateOverflowingLineNum(sal_uInt32 nPaperHeight,
 // Like UpdateOverflowingParaNum but for each line in the first
 //  overflowing paragraph.
 for ( sal_Int32 nLine = 0; nLine  pPara-GetLines().Count(); nLine++ ) {
-EditLine aLine = pPara-GetLines()[nLine];
+// XXX: We must use a reference here because the copy constructor 
resets the height
+EditLine aLine = pPara-GetLines()[nLine];
 nLH = aLine.GetHeight();
 nY += nLH;
 if ( nY  nPaperHeight ) // found first line overflowing
commit 131e804e2f084ae6fc832ad7b4de591bba4b2867
Author: matteocam matteo.campane...@gmail.com
Date:   Tue Aug 4 13:19:43 2015 +0200

Added assertion in ImplUpdateOverflowingLineNum

Change-Id: I7d264d09246054a0586cdd7ffe5f588e2520b3ae

diff --git a/editeng/source/editeng/impedit3.cxx 
b/editeng/source/editeng/impedit3.cxx
index ad458b6..865081b 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -4070,6 +4070,7 @@ void ImpEditEngine::CallStatusHdl()
 
 void ImpEditEngine::CallChainingEventHdl()
 {
+// XXX: We don't use this method any more at the moment.
 // only if it's the right ImpEditEngine (with right info on changes in 
text)
 if ( aChainingHdlLink.IsSet() /*  aStatus.GetStatusWord() */)
 {
@@ -4662,7 +4663,7 @@ void 
ImpEditEngine::ImplUpdateOverflowingLineNum(sal_uInt32 nPaperHeight,
 }
 }
 
-
+assert(0); // You should never get here
 
 }
 
___
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' - svx/source

2015-08-04 Thread matteocam
 svx/source/svdraw/svdotext.cxx |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit e5c4ba278c26e76564c542adb4df7610f741301b
Author: matteocam matteo.campane...@gmail.com
Date:   Tue Aug 4 12:14:21 2015 +0200

Add check when setting next-prev-next to this

Change-Id: I5ffa368c780ba06d76196073805327fbb3b7fa48

diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx
index 1b47e56..e61088b 100644
--- a/svx/source/svdraw/svdotext.cxx
+++ b/svx/source/svdraw/svdotext.cxx
@@ -2153,7 +2153,9 @@ void SdrTextObj::SetNextLinkInChain(SdrTextObj *pNextObj)
 
 // Deal with new next link's prev link
 if (mpNextInChain) {
-if (mpNextInChain-mpPrevInChain)
+// If there is a prev already at all and this is not already the 
current object
+if (mpNextInChain-mpPrevInChain 
+mpNextInChain-mpPrevInChain != this)
 mpNextInChain-mpPrevInChain-mpNextInChain = NULL;
 mpNextInChain-mpPrevInChain = this;
 }
___
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' - 1565 commits - accessibility/inc accessibility/source android/Bootstrap animations/source avmedia/Library_avmediavlc.m

2015-08-02 Thread matteocam
Rebased ref, commits from common ancestor:
commit 116aff4b41e0ef501f1998a14789626fe09820bb
Author: matteocam matteo.campane...@gmail.com
Date:   Sat Aug 1 00:50:13 2015 +0200

Minor fix

Change-Id: If5bc6647ce07cbe7e6f324c2081168238f9c258d

diff --git a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx 
b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
index 7442f6d..390683f 100644
--- a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
+++ b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
@@ -313,9 +313,8 @@ namespace drawinglayer
 aAnchorTransform,
 bWordWrap);
 }
-else if( rText.isChainable() !rText.isInEditMode() )
+else if( rText.isChainable()  !rText.isInEditMode() )
 {
-fprintf(stderr, [CHAINABLE?] Making a Chained Primitive 
for %p\n, pReferredTextObj);
 pNew = new SdrChainedTextPrimitive2D(
 rText.getSdrText(),
 rText.getOutlinerParaObject(),
commit 45c630b5b2b66b80e44ee5a29a600b36b4b076da
Author: matteocam matteo.campane...@gmail.com
Date:   Fri Jul 31 23:51:44 2015 +0200

Cleaned comments; Set IsChainable instead of true

Change-Id: Ie3974389ba6c1fe8c43a5f2fafd5baedd2a01502

diff --git a/editeng/source/editeng/impedit3.cxx 
b/editeng/source/editeng/impedit3.cxx
index 0580417..ad458b6 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -479,10 +479,6 @@ void ImpEditEngine::FormatDoc()
 
 CallStatusHdl();// If Modified...
 
-//FIXME(matteocam)
-
-//CallChainingEventHdl(); // For chaining
-
 LeaveBlockNotifications();
 }
 
diff --git a/include/svx/svdedxv.hxx b/include/svx/svdedxv.hxx
index dda8537..194d657 100644
--- a/include/svx/svdedxv.hxx
+++ b/include/svx/svdedxv.hxx
@@ -98,7 +98,7 @@ private:
 
 SVX_DLLPRIVATE void ImpClearVars();
 
-// FIXME(matteocam)
+// FIXME(matteocam):Should we have these fields?
 CursorChainingEvent *maCursorEvent;
 ESelection *maPreChainingSel;
 
diff --git a/include/svx/svdotext.hxx b/include/svx/svdotext.hxx
index e4de334..575f138 100644
--- a/include/svx/svdotext.hxx
+++ b/include/svx/svdotext.hxx
@@ -227,7 +227,6 @@ protected:
 OverflowingText *mpOverflowingText = NULL;
 bool mbIsUnchainableClone = false;
 
-//FIXME(matteocam)
 // the successor in a chain
 SdrTextObj *mpNextInChain = NULL;
 SdrTextObj *mpPrevInChain = NULL;
diff --git a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx 
b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
index ed1eb37..7442f6d 100644
--- a/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
+++ b/svx/source/sdr/primitive2d/sdrdecompositiontools.cxx
@@ -295,10 +295,6 @@ 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())
 {
 // stretched text in range
@@ -317,7 +313,7 @@ namespace drawinglayer
 aAnchorTransform,
 bWordWrap);
 }
-else if( rText.isChainable() /* !rText.isInEditMode()*/ ) // 
FIXME(matteocam)
+else if( rText.isChainable() !rText.isInEditMode() )
 {
 fprintf(stderr, [CHAINABLE?] Making a Chained Primitive 
for %p\n, pReferredTextObj);
 pNew = new SdrChainedTextPrimitive2D(
diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index 18fb749..53a0af2 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -1309,14 +1309,15 @@ bool SdrObjEditView::KeyInput(const KeyEvent rKEvt, 
vcl::Window* pWin)
 {
 if(pTextEditOutlinerView)
 {
+/* Start special handling of keys within a chain */
 // We possibly move to another box before any handling
 bool bHandled = false;
 TextChainCursorManager *pCursorManager =
 ImpHandleMotionThroughBoxesKeyInput(rKEvt, pWin, bHandled);
 if (bHandled)
 return true;
+/* End special handling of keys within a chain */
 
-// FIXME(matteocam): Old code from here
 if (pTextEditOutlinerView-PostKeyEvent(rKEvt, pWin))
 {
 if( pMod )
@@ -1325,11 +1326,10 @@ bool SdrObjEditView::KeyInput(const KeyEvent rKEvt, 
vcl::Window* pWin)
 pMod-SetChanged( true );
 }
 
-// FIXME(matteocam)
-// Start

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

2015-07-30 Thread matteocam
 editeng/source/outliner/outlvw.cxx |8 
 include/editeng/outliner.hxx   |4 ++--
 include/svx/svdedxv.hxx|2 +-
 svx/source/svdraw/svdedxv.cxx  |4 ++--
 4 files changed, 9 insertions(+), 9 deletions(-)

New commits:
commit 39a980fa88eb65a9feaeeb1b7db7f2f78070055b
Author: matteocam matteo.campane...@gmail.com
Date:   Thu Jul 30 13:48:52 2015 +0200

Change name to post-pastecutting method

Change-Id: Ie49890788ea0b7f3b58b3d4a854bbc0f09526bf9

diff --git a/editeng/source/outliner/outlvw.cxx 
b/editeng/source/outliner/outlvw.cxx
index bff66ad..16c416c 100644
--- a/editeng/source/outliner/outlvw.cxx
+++ b/editeng/source/outliner/outlvw.cxx
@@ -679,8 +679,8 @@ void OutlinerView::Cut()
 pEditView-Cut();
 
 // Chaining handling
-if (aEndPasteLink.IsSet())
-aEndPasteLink.Call(NULL);
+if (aEndCutPasteLink.IsSet())
+aEndCutPasteLink.Call(NULL);
 }
 }
 
@@ -712,8 +712,8 @@ void OutlinerView::PasteSpecial()
 pEditView-ShowCursor( true, true );
 
 // XXX: Not sure if this should be called right before ShowCursor
-if (aEndPasteLink.IsSet())
-aEndPasteLink.Call(NULL);
+if (aEndCutPasteLink.IsSet())
+aEndCutPasteLink.Call(NULL);
 }
 
 }
diff --git a/include/editeng/outliner.hxx b/include/editeng/outliner.hxx
index 74c9f72..96105e6 100644
--- a/include/editeng/outliner.hxx
+++ b/include/editeng/outliner.hxx
@@ -215,7 +215,7 @@ private:
 EDITENG_DLLPRIVATE void ImpPasted( sal_Int32 nStart, sal_Int32 
nPrevParaCount, sal_Int32 nSize);
 EDITENG_DLLPRIVATE sal_Int32ImpCalcSelectedPages( bool 
bIncludeFirstSelected );
 
-Link aEndPasteLink;
+Link aEndCutPasteLink;
 
 public:
 OutlinerView( Outliner* pOut, vcl::Window* pWindow );
@@ -376,7 +376,7 @@ public:
 OUStringGetSurroundingText() const;
 Selection   GetSurroundingTextSelection() const;
 
-voidSetEndPasteLinkHdl(const Link rLink) { aEndPasteLink = 
rLink; }
+voidSetEndCutPasteLinkHdl(const Link rLink) { aEndCutPasteLink 
= rLink; }
 };
 
 
diff --git a/include/svx/svdedxv.hxx b/include/svx/svdedxv.hxx
index 6b6f27c..b5ee30b 100644
--- a/include/svx/svdedxv.hxx
+++ b/include/svx/svdedxv.hxx
@@ -128,7 +128,7 @@ protected:
 // handler for AutoGrowing text with active Outliner
 DECL_LINK(ImpOutlinerStatusEventHdl,EditStatus*);
 DECL_LINK(ImpChainingEventHdl,void*);
-DECL_LINK(ImpAfterPasteChainingEventHdl,void*);
+DECL_LINK(ImpAfterCutOrPasteChainingEventHdl,void*);
 DECL_LINK(ImpOutlinerCalcFieldValueHdl,EditFieldInfo*);
 
 // link for EndTextEditHdl
diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index 02f7df0..14f864a 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -525,7 +525,7 @@ IMPL_LINK_NOARG(SdrObjEditView,ImpChainingEventHdl)
 return 0;
 }
 
-IMPL_LINK_NOARG(SdrObjEditView,ImpAfterPasteChainingEventHdl)
+IMPL_LINK_NOARG(SdrObjEditView,ImpAfterCutOrPasteChainingEventHdl)
 {
 SdrTextObj* pTextObj = dynamic_cast SdrTextObj * ( GetTextEditObject());
 if (!pTextObj)
@@ -800,7 +800,7 @@ bool SdrObjEditView::SdrBeginTextEdit(
 pTextEditOutlinerView-ShowCursor();
 
pTextEditOutliner-SetStatusEventHdl(LINK(this,SdrObjEditView,ImpOutlinerStatusEventHdl));
 if (pTextObj-IsChainable()) {
-
pTextEditOutlinerView-SetEndPasteLinkHdl(LINK(this,SdrObjEditView,ImpAfterPasteChainingEventHdl)
 );
+
pTextEditOutlinerView-SetEndCutPasteLinkHdl(LINK(this,SdrObjEditView,ImpAfterCutOrPasteChainingEventHdl)
 );
 /* We should call:
  *
 ImpChainingEventHdl(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' - svx/inc svx/source

2015-07-30 Thread matteocam
 svx/inc/sdr/primitive2d/sdrtextprimitive2d.hxx |2 +-
 svx/source/svdraw/svdotextdecomposition.cxx|2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 2d86d1734984090882e170097d313bc00144680d
Author: matteocam matteo.campane...@gmail.com
Date:   Thu Jul 30 11:29:40 2015 +0200

Remove wordwrap method from SdrChainedTextPrimitive

Change-Id: I2800aede1597eb0d94e9bdcb1634f2509503d1fb

diff --git a/svx/inc/sdr/primitive2d/sdrtextprimitive2d.hxx 
b/svx/inc/sdr/primitive2d/sdrtextprimitive2d.hxx
index a3e0357..c6fbe5e 100644
--- a/svx/inc/sdr/primitive2d/sdrtextprimitive2d.hxx
+++ b/svx/inc/sdr/primitive2d/sdrtextprimitive2d.hxx
@@ -353,7 +353,7 @@ namespace drawinglayer
 
 // get data
 const basegfx::B2DHomMatrix getTextRangeTransform() const { 
return maTextRangeTransform; }
-bool getWordWrap() const { return true; } // XXX: Hack! Should 
have a proper implementation
+//bool getWordWrap() const { return true; } // XXX: Hack! Should 
have a proper implementation//
 
 // compare operator
 virtual bool operator==(const BasePrimitive2D rPrimitive) const 
SAL_OVERRIDE;
diff --git a/svx/source/svdraw/svdotextdecomposition.cxx 
b/svx/source/svdraw/svdotextdecomposition.cxx
index 25feda4..5c2309f 100644
--- a/svx/source/svdraw/svdotextdecomposition.cxx
+++ b/svx/source/svdraw/svdotextdecomposition.cxx
@@ -1498,7 +1498,7 @@ void SdrTextObj::impDecomposeChainedTextPrimitive(
 const bool bVerticalWritintg(pOutlinerParaObject-IsVertical());
 const Size aAnchorTextSize(Size(nAnchorTextWidth, nAnchorTextHeight));
 
-if((rSdrChainedTextPrimitive.getWordWrap() || IsTextFrame()))
+if(IsTextFrame())
 {
 rOutliner.SetMaxAutoPaperSize(aAnchorTextSize);
 }
___
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

2015-07-30 Thread matteocam
 editeng/source/outliner/outlvw.cxx |7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

New commits:
commit 4493543f1fa9420a67ac18e904d436dc0404a8a3
Author: matteocam matteo.campane...@gmail.com
Date:   Thu Jul 30 13:29:45 2015 +0200

Handle underflow after cutting text

Change-Id: I33d83d7423a18f71ea7c1c4d1a03580354e48092

diff --git a/editeng/source/outliner/outlvw.cxx 
b/editeng/source/outliner/outlvw.cxx
index 987bd0a..bff66ad 100644
--- a/editeng/source/outliner/outlvw.cxx
+++ b/editeng/source/outliner/outlvw.cxx
@@ -675,8 +675,13 @@ void OutlinerView::InsertText( const OutlinerParaObject 
rParaObj )
 
 void OutlinerView::Cut()
 {
-if ( !ImpCalcSelectedPages( false ) || pOwner-ImpCanDeleteSelectedPages( 
this ) )
+if ( !ImpCalcSelectedPages( false ) || pOwner-ImpCanDeleteSelectedPages( 
this ) ) {
 pEditView-Cut();
+
+// Chaining handling
+if (aEndPasteLink.IsSet())
+aEndPasteLink.Call(NULL);
+}
 }
 
 void OutlinerView::Paste()
___
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 - svx/source

2015-07-29 Thread matteocam
 svx/source/svdraw/svdotext.cxx  |   52 ++--
 svx/source/svdraw/svdotextdecomposition.cxx |3 +
 2 files changed, 53 insertions(+), 2 deletions(-)

New commits:
commit 8e7192c5e053684930e82a5c6bd53905ac2a
Author: matteocam matteo.campane...@gmail.com
Date:   Wed Jul 29 18:56:51 2015 +0200

Check GetNicChainingEvent before chaining in static mode

Change-Id: Ie3e4aeea896ae3269ee196d17d80505e2491eb71

diff --git a/svx/source/svdraw/svdotextdecomposition.cxx 
b/svx/source/svdraw/svdotextdecomposition.cxx
index b627b77..25feda4 100644
--- a/svx/source/svdraw/svdotextdecomposition.cxx
+++ b/svx/source/svdraw/svdotextdecomposition.cxx
@@ -1425,6 +1425,9 @@ void 
SdrTextObj::impGetScrollTextTiming(drawinglayer::animation::AnimationEntryL
 
 void SdrTextObj::impHandleChainingEventsDuringDecomposition(SdrOutliner 
rOutliner) const
 {
+if (GetTextChain()-GetNilChainingEvent(this))
+return;
+
 GetTextChain()-SetNilChainingEvent(this, true);
 
 TextChainFlow aTxtChainFlow(const_castSdrTextObj*(this));
commit 452ac5b3b37dc3c06ff0dbe958cc65417f2ed064
Author: matteocam matteo.campane...@gmail.com
Date:   Wed Jul 29 18:54:55 2015 +0200

Set link at calls of IsChainable. (not working)

Change-Id: Ia6b57c560f20abac8cac98c29880d7aa5b962d7c

diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx
index ca28046..46b1bbc 100644
--- a/svx/source/svdraw/svdotext.cxx
+++ b/svx/source/svdraw/svdotext.cxx
@@ -1984,12 +1984,60 @@ void SdrTextObj::onEditOutlinerStatusEvent( EditStatus* 
pEditStatus )
 }
 }
 
+// XXX: Make it a method somewhere?
+SdrObject *ImpGetObjByName(SdrObjList *pObjList, OUString aObjName)
+{
+// scan the whole list
+size_t nObjCount = pObjList-GetObjCount();
+for (unsigned i = 0; i  nObjCount; i++) {
+SdrObject *pCurObj = pObjList-GetObj(i);
+
+if (pCurObj-GetName() == aObjName) {
+return pCurObj;
+}
+}
+// not found
+return NULL;
+}
+
+// XXX: Make it a (private) method of SdrTextObj
+void ImpUpdateChainLinks(SdrTextObj *pTextObj, OUString aNextLinkName)
+{
+// XXX: Current implementation constraints text boxes to be on the same 
page
+
+// No next link
+if (aNextLinkName == ) {
+pTextObj-SetNextLinkInChain(NULL);
+return;
+}
+
+SdrPage *pPage = pTextObj-GetPage();
+assert(pPage);
+SdrTextObj *pNextTextObj = dynamic_cast SdrTextObj * 
+(ImpGetObjByName(pPage, aNextLinkName));
+if (!pNextTextObj) {
+fprintf(stderr, [CHAINING] Can't find object as next link.\n);
+return;
+}
+
+pTextObj-SetNextLinkInChain(pNextTextObj);
+}
+
 bool SdrTextObj::IsChainable() const
 {
 // Read it as item
 const SfxItemSet rSet = GetObjectItemSet();
-OUString aNextName = static_castconst 
SfxStringItem(rSet.Get(SDRATTR_TEXT_CHAINNEXTNAME)).GetValue();
-return aNextName != ; // XXX: Should we also check for 
GetNilChainingEvent? (see old code below)
+OUString aNextLinkName = static_castconst 
SfxStringItem(rSet.Get(SDRATTR_TEXT_CHAINNEXTNAME)).GetValue();
+
+// Update links if any inconsistency is found
+bool bNextLinkUnsetYet = (aNextLinkName != )  !mpNextInChain;
+bool bInconsistentNextLink = mpNextInChain  mpNextInChain-GetName() != 
aNextLinkName;
+// if the link is not set despite there should be one OR if it has changed
+if (bNextLinkUnsetYet || bInconsistentNextLink) {
+ImpUpdateChainLinks(const_castSdrTextObj *(this), aNextLinkName);
+}
+
+return aNextLinkName != ; // XXX: Should we also check for 
GetNilChainingEvent? (see old code below)
 
 /*
 // Check that no overflow is going on
___
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' - svx/source

2015-07-29 Thread matteocam
 svx/source/svdraw/svdotext.cxx |   28 +++-
 1 file changed, 3 insertions(+), 25 deletions(-)

New commits:
commit c835e327d9941cf65d82fbdf66c368a4e66016b4
Author: matteocam matteo.campane...@gmail.com
Date:   Wed Jul 29 17:38:09 2015 +0200

Remove old code

Change-Id: Ie226e450d3013c92e9a0236a1c3cfd214b6edab5

diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx
index 66b8a7a..ca28046 100644
--- a/svx/source/svdraw/svdotext.cxx
+++ b/svx/source/svdraw/svdotext.cxx
@@ -1989,35 +1989,13 @@ bool SdrTextObj::IsChainable() const
 // Read it as item
 const SfxItemSet rSet = GetObjectItemSet();
 OUString aNextName = static_castconst 
SfxStringItem(rSet.Get(SDRATTR_TEXT_CHAINNEXTNAME)).GetValue();
-return aNextName != ;
-
-// XXX
-if (!GetName().startsWith(Chainable)) {
-//fprintf(stderr, [CHAINABLE?] %p is _not_ chainable\n, this);
-return false;
-}
+return aNextName != ; // XXX: Should we also check for 
GetNilChainingEvent? (see old code below)
 
+/*
 // Check that no overflow is going on
 if (!GetTextChain() || GetTextChain()-GetNilChainingEvent(this))
 return false;
-
- // XXX: Hack to have links together
-static bool bHasDoneTheLinking = false;
-
-SdrTextObj *pTxtObj0 =  dynamic_cast SdrTextObj * ( pPage-GetObj( 0 ) );
-
-if (!bHasDoneTheLinking  pPage  pPage-GetObjCount()  1  this == 
pTxtObj0)
-{
-SdrTextObj *pTxtObj1 =  dynamic_cast SdrTextObj * ( pPage-GetObj( 1 
) );
-const_castSdrTextObj *(this)-SetNextLinkInChain(pTxtObj1);
-
-bHasDoneTheLinking = true;
-}
-// end hack
-
-
-return true;
-
+*/
 }
 
 void SdrTextObj::onChainingEvent()
___
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' - svx/source

2015-07-29 Thread matteocam
 svx/source/svdraw/svdedxv.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit ba90284faa3fe85ad061ff72a9f9cca54ff8fb2d
Author: matteocam matteo.campane...@gmail.com
Date:   Wed Jul 29 19:12:07 2015 +0200

Check for links instead of chainabity when handling key input

Change-Id: Id8a7892ab5465b85a79a4347a6653de8c975416c

diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index 9324ffd..02f7df0 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -543,6 +543,7 @@ void 
SdrObjEditView::ImpMoveCursorAfterChainingEvent(TextChainCursorManager *pCu
 
 SdrTextObj* pTextObj = dynamic_castSdrTextObj*(mxTextEditObj.get());
 
+// Check if it has links to move it to
 if (!pTextObj-IsChainable())
 return;
 
@@ -1288,7 +1289,7 @@ TextChainCursorManager 
*SdrObjEditView::ImpHandleMotionThroughBoxesKeyInput(
 else
 return NULL;
 
-if (!pTextObj-IsChainable())
+if (!pTextObj-GetNextLinkInChain()  !pTextObj-GetPrevLinkInChain())
 return NULL;
 
 TextChainCursorManager *pCursorManager = new TextChainCursorManager(this, 
pTextObj);
___
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 - svx/source

2015-07-29 Thread matteocam
 svx/source/svdraw/svdotext.cxx  |2 +-
 svx/source/unodraw/unoshap2.cxx |1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 5e02310180605c7dfc1539eeb0b95d691b1557be
Author: matteocam matteo.campane...@gmail.com
Date:   Wed Jul 29 09:06:41 2015 +0200

Add chaining constant in unoshap

Change-Id: I4a7d69636df9d5b80420da8fa5bd9bea8cf1d3f0

diff --git a/svx/source/unodraw/unoshap2.cxx b/svx/source/unodraw/unoshap2.cxx
index f01fe9e..5ceff5f 100644
--- a/svx/source/unodraw/unoshap2.cxx
+++ b/svx/source/unodraw/unoshap2.cxx
@@ -670,6 +670,7 @@ SvxShapeControlPropertyMapping[] =
 { RTL_CONSTASCII_STRINGPARAM(UNO_NAME_EDIT_CHAR_COLOR),   
RTL_CONSTASCII_STRINGPARAM(TextColor) },
 { RTL_CONSTASCII_STRINGPARAM(CharBackColor), 
RTL_CONSTASCII_STRINGPARAM(CharBackColor) },
 { RTL_CONSTASCII_STRINGPARAM(CharBackTransparent), 
RTL_CONSTASCII_STRINGPARAM(CharBackTransparent) },
+{ RTL_CONSTASCII_STRINGPARAM(UNO_NAME_TEXT_CHAINNEXTNAME), 
RTL_CONSTASCII_STRINGPARAM(UNO_NAME_TEXT_CHAINNEXTNAME) },
 { RTL_CONSTASCII_STRINGPARAM(CharRelief),   
RTL_CONSTASCII_STRINGPARAM(FontRelief) },
 { RTL_CONSTASCII_STRINGPARAM(CharUnderlineColor),   
RTL_CONSTASCII_STRINGPARAM(TextLineColor) },
 { RTL_CONSTASCII_STRINGPARAM(UNO_NAME_EDIT_PARA_ADJUST), 
RTL_CONSTASCII_STRINGPARAM(Align) },
commit b240c7016c0a305c06918ff8e629226806f3f7ba
Author: matteocam matteo.campane...@gmail.com
Date:   Wed Jul 29 08:48:54 2015 +0200

Fixed operator

Change-Id: Ib82ad17855654dafc92bdf423691f3e76b54b387

diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx
index de5859e..66b8a7a 100644
--- a/svx/source/svdraw/svdotext.cxx
+++ b/svx/source/svdraw/svdotext.cxx
@@ -1989,7 +1989,7 @@ bool SdrTextObj::IsChainable() const
 // Read it as item
 const SfxItemSet rSet = GetObjectItemSet();
 OUString aNextName = static_castconst 
SfxStringItem(rSet.Get(SDRATTR_TEXT_CHAINNEXTNAME)).GetValue();
-return aNextName == ;
+return aNextName != ;
 
 // XXX
 if (!GetName().startsWith(Chainable)) {
___
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' - xmloff/source

2015-07-29 Thread matteocam
 xmloff/source/draw/ximpshap.cxx |   26 +-
 xmloff/source/draw/ximpshap.hxx |1 +
 2 files changed, 26 insertions(+), 1 deletion(-)

New commits:
commit 6338b3465f993231dcf7a6a769e3f6b5d8d729e0
Author: matteocam matteo.campane...@gmail.com
Date:   Wed Jul 29 17:06:22 2015 +0200

Set Uno property for chain-next-name from SdXMLTextBoxShapeContext

Change-Id: Ie9dab5768ff555ab2b4c90fffb0311865154f29c

diff --git a/xmloff/source/draw/ximpshap.cxx b/xmloff/source/draw/ximpshap.cxx
index c9ad9f5..6ca2075 100644
--- a/xmloff/source/draw/ximpshap.cxx
+++ b/xmloff/source/draw/ximpshap.cxx
@@ -1600,7 +1600,8 @@ SdXMLTextBoxShapeContext::SdXMLTextBoxShapeContext(
 uno::Reference drawing::XShapes  rShapes,
 bool bTemporaryShape)
 :   SdXMLShapeContext( rImport, nPrfx, rLocalName, xAttrList, rShapes, 
bTemporaryShape ),
-mnRadius(0)
+mnRadius(0),
+maChainNextName()
 {
 }
 
@@ -1619,6 +1620,12 @@ void SdXMLTextBoxShapeContext::processAttribute( 
sal_uInt16 nPrefix, const OUStr
 mnRadius, rValue);
 return;
 }
+
+if( IsXMLToken( rLocalName, XML_CHAIN_NEXT_NAME ) )
+{
+maChainNextName = rValue;
+return;
+}
 }
 
 SdXMLShapeContext::processAttribute( nPrefix, rLocalName, rValue );
@@ -1752,6 +1759,23 @@ void SdXMLTextBoxShapeContext::StartElement(const 
uno::Reference xml::sax::XAtt
 }
 }
 
+if(maChainNextName != )
+{
+uno::Reference beans::XPropertySet  xPropSet(mxShape, 
uno::UNO_QUERY);
+if(xPropSet.is())
+{
+try
+{
+xPropSet-setPropertyValue(TextChainNextName,
+   uno::makeAny( maChainNextName ) 
);
+}
+catch(const uno::Exception)
+{
+OSL_FAIL( exception during setting of name of next chain 
link!);
+}
+}
+}
+
 SdXMLShapeContext::StartElement(mxAttrList);
 }
 }
diff --git a/xmloff/source/draw/ximpshap.hxx b/xmloff/source/draw/ximpshap.hxx
index ac95e7d..50ddb25 100644
--- a/xmloff/source/draw/ximpshap.hxx
+++ b/xmloff/source/draw/ximpshap.hxx
@@ -245,6 +245,7 @@ public:
 class SdXMLTextBoxShapeContext : public SdXMLShapeContext
 {
 sal_Int32   mnRadius;
+OUStringmaChainNextName;
 
 public:
 TYPEINFO_OVERRIDE();
___
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' - svx/source

2015-07-28 Thread matteocam
 svx/source/svdraw/svdotext.cxx |5 +
 1 file changed, 5 insertions(+)

New commits:
commit 4dd36bd8b1be298d6e5d7e3e833eb644d0aeaa3a
Author: matteocam matteo.campane...@gmail.com
Date:   Tue Jul 28 09:20:13 2015 +0200

Read IsChainable as Item

Change-Id: Iee7b19bc711a8ce4934f2c5722191ae9ca87d358

diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx
index 1aa6e73..de5859e 100644
--- a/svx/source/svdraw/svdotext.cxx
+++ b/svx/source/svdraw/svdotext.cxx
@@ -1986,6 +1986,11 @@ void SdrTextObj::onEditOutlinerStatusEvent( EditStatus* 
pEditStatus )
 
 bool SdrTextObj::IsChainable() const
 {
+// Read it as item
+const SfxItemSet rSet = GetObjectItemSet();
+OUString aNextName = static_castconst 
SfxStringItem(rSet.Get(SDRATTR_TEXT_CHAINNEXTNAME)).GetValue();
+return aNextName == ;
+
 // XXX
 if (!GetName().startsWith(Chainable)) {
 //fprintf(stderr, [CHAINABLE?] %p is _not_ chainable\n, this);
___
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' - svx/source

2015-07-27 Thread matteocam
 svx/source/svdraw/svdotext.cxx |   16 
 1 file changed, 16 insertions(+)

New commits:
commit 07b44f63ee70ed57eabc33a34713c856719b19ad
Author: matteocam matteo.campane...@gmail.com
Date:   Mon Jul 27 13:49:38 2015 +0200

Add hack to link first two boxes in IsChainable

Change-Id: I2903096b48f06e086e5589d88d9147664a868660

diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx
index 5f4f2f5..d9b16b8 100644
--- a/svx/source/svdraw/svdotext.cxx
+++ b/svx/source/svdraw/svdotext.cxx
@@ -1986,6 +1986,22 @@ void SdrTextObj::onEditOutlinerStatusEvent( EditStatus* 
pEditStatus )
 
 bool SdrTextObj::IsChainable() const
 {
+// XXX: Hack to have links together
+static bool bHasDoneTheLinking = false;
+
+SdrTextObj *pTxtObj0 =  dynamic_cast SdrTextObj * ( pPage-GetObj( 0 ) );
+
+if (!bHasDoneTheLinking  pPage  pPage-GetObjCount()  1  this == 
pTxtObj0)
+{
+SdrTextObj *pTxtObj1 =  dynamic_cast SdrTextObj * ( pPage-GetObj( 1 
) );
+const_castSdrTextObj *(this)-SetNextLinkInChain(pTxtObj1);
+
+bHasDoneTheLinking = true;
+}
+
+
+
+// XXX
 if (!GetName().startsWith(Chainable)) {
 //fprintf(stderr, [CHAINABLE?] %p is _not_ chainable\n, this);
 return false;
___
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' - svx/source

2015-07-27 Thread matteocam
 svx/source/svdraw/svdotext.cxx |   24 
 1 file changed, 12 insertions(+), 12 deletions(-)

New commits:
commit b15d415316b012886ae2d0aff44f9f667263d498
Author: matteocam matteo.campane...@gmail.com
Date:   Mon Jul 27 14:07:58 2015 +0200

Make linking only for chainable boxes

Change-Id: Ia8ed6ae90abba5a0c3092c5a1d781443ea611fc9

diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx
index d9b16b8..1aa6e73 100644
--- a/svx/source/svdraw/svdotext.cxx
+++ b/svx/source/svdraw/svdotext.cxx
@@ -1986,7 +1986,17 @@ void SdrTextObj::onEditOutlinerStatusEvent( EditStatus* 
pEditStatus )
 
 bool SdrTextObj::IsChainable() const
 {
-// XXX: Hack to have links together
+// XXX
+if (!GetName().startsWith(Chainable)) {
+//fprintf(stderr, [CHAINABLE?] %p is _not_ chainable\n, this);
+return false;
+}
+
+// Check that no overflow is going on
+if (!GetTextChain() || GetTextChain()-GetNilChainingEvent(this))
+return false;
+
+ // XXX: Hack to have links together
 static bool bHasDoneTheLinking = false;
 
 SdrTextObj *pTxtObj0 =  dynamic_cast SdrTextObj * ( pPage-GetObj( 0 ) );
@@ -1998,19 +2008,9 @@ bool SdrTextObj::IsChainable() const
 
 bHasDoneTheLinking = true;
 }
+// end hack
 
 
-
-// XXX
-if (!GetName().startsWith(Chainable)) {
-//fprintf(stderr, [CHAINABLE?] %p is _not_ chainable\n, this);
-return false;
-}
-
-// Check that no overflow is going on
-if (!GetTextChain() || GetTextChain()-GetNilChainingEvent(this))
-return false;
-
 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' - include/svx

2015-07-27 Thread matteocam
 include/svx/textchain.hxx |5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 17a29e7572ff251acd5ccbe073dba26e1e2a0137
Author: matteocam matteo.campane...@gmail.com
Date:   Mon Jul 27 12:46:41 2015 +0200

Make TextChain creatable only by SdrModel

Change-Id: I5385885a9b2c72c6ce359745d74e396083de8489

diff --git a/include/svx/textchain.hxx b/include/svx/textchain.hxx
index b39cc04..631f646 100644
--- a/include/svx/textchain.hxx
+++ b/include/svx/textchain.hxx
@@ -72,6 +72,7 @@
 
 class ImpChainLinkProperties;
 class SdrTextObj;
+class SdrModel;
 
 namespace rtl {
 class OUString;
@@ -134,7 +135,7 @@ class ImpChainLinkProperties
 class TextChain {
 
 public:
-TextChain();
+
 ~TextChain();
 
 //void AppendLink(SdrTextObj *);
@@ -157,9 +158,11 @@ class TextChain {
 
 
 protected:
+TextChain();
 LinkPropertiesMap maLinkPropertiesMap;
 
 private:
+friend class SdrModel;
 //SdrTextObj *impGetNextLink(const SdrTextObj *) const;
 //SdrTextObj *impGetPrevLink(const SdrTextObj *) const;
 
___
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' - 3 commits - include/editeng include/svx svx/source

2015-07-27 Thread matteocam
 include/editeng/unoprnms.hxx  |1 +
 include/svx/svddef.hxx|3 ++-
 include/svx/svdstr.hrc|2 ++
 include/svx/unoshprp.hxx  |1 +
 svx/source/svdraw/svdattr.cxx |3 ++-
 svx/source/svdraw/svdstr.src  |5 +
 6 files changed, 13 insertions(+), 2 deletions(-)

New commits:
commit ce156079eb91050a3e83efb38f93c0f7bbeceaf9
Author: matteocam matteo.campane...@gmail.com
Date:   Mon Jul 27 17:54:08 2015 +0200

Fix last value in defs

Change-Id: I49cf99ac116f10f14ab21d2a3e738bdece659cb8

diff --git a/include/svx/svddef.hxx b/include/svx/svddef.hxx
index 1cdacb7..5b3e5e9 100644
--- a/include/svx/svddef.hxx
+++ b/include/svx/svddef.hxx
@@ -113,7 +113,7 @@
 #define SDRATTR_TEXT_WORDWRAP   (SDRATTR_MISC_FIRST +25)   /*   1122 
*/ /*   1122 */ /*   1105 */ /* Pool V2 */
 #define SDRATTR_TEXT_AUTOGROWSIZE   (SDRATTR_MISC_FIRST +26)   /*   1123 
*/ /*   1123 */ /*   1106 */ /* Pool V2 */
 #define SDRATTR_TEXT_CHAINNEXTNAME  (SDRATTR_MISC_FIRST + 27)   /*  1124 
*/ /*   11124 */
-#define SDRATTR_MISC_LAST   (SDRATTR_TEXT_AUTOGROWSIZE)/* 
1125   */ /* 1125   */ /* 1108   */ /* Pool V1: 1056 */
+#define SDRATTR_MISC_LAST   (SDRATTR_TEXT_CHAINNEXTNAME)/* 
1125   */ /* 1125   */ /* 1108   */ /* Pool V1: 1056 */
 
 #define SDRATTR_EDGE_FIRST  (SDRATTR_MISC_LAST + 1)  /* 1127   
*/ /* Pool V4 */
 #define SDRATTR_EDGEKIND(SDRATTR_EDGE_FIRST + 0)   /*   1127 
*/ /* Pool V4 */
diff --git a/svx/source/svdraw/svdattr.cxx b/svx/source/svdraw/svdattr.cxx
index 83583be..a108063 100644
--- a/svx/source/svdraw/svdattr.cxx
+++ b/svx/source/svdraw/svdattr.cxx
@@ -498,7 +498,6 @@ void SdrItemPool::TakeItemName(sal_uInt16 nWhich, OUString 
rItemName)
 case SDRATTR_TEXT_WORDWRAP  : nResId = SIP_SA_WORDWRAP;break;
 case SDRATTR_TEXT_CHAINNEXTNAME : nResId = 
SIP_SA_CHAINNEXTNAME;break;
 case SDRATTR_TEXT_AUTOGROWSIZE  : nResId = 
SIP_SA_AUTOGROWSIZE;break;
-
 case SDRATTR_EDGEKIND   : nResId = SIP_SA_EDGEKIND;break;
 case SDRATTR_EDGENODE1HORZDIST  : nResId = 
SIP_SA_EDGENODE1HORZDIST;break;
 case SDRATTR_EDGENODE1VERTDIST  : nResId = 
SIP_SA_EDGENODE1VERTDIST;break;
commit 21078f833967f5d4b3bb4bcb2599b8aad08eb0d1
Author: matteocam matteo.campane...@gmail.com
Date:   Mon Jul 27 17:49:43 2015 +0200

Added attributes for chaining around

Change-Id: I41f498ae1778a487fefd7c48f00dc514180c0683

diff --git a/include/editeng/unoprnms.hxx b/include/editeng/unoprnms.hxx
index 0566288..498d417 100644
--- a/include/editeng/unoprnms.hxx
+++ b/include/editeng/unoprnms.hxx
@@ -113,6 +113,7 @@
 #define UNO_NAME_TEXT_WRITINGMODE   TextWritingMode
 #define UNO_NAME_TEXT_FONTINDEPENDENTLINESPACING FontIndependentLineSpacing
 #define UNO_NAME_TEXT_WORDWRAP  TextWordWrap
+#define UNO_NAME_TEXT_CHAINNEXTNAME  TextChainNextName
 
 #define UNO_NAME_MEASUREKINDMeasureKind
 #define UNO_NAME_MEASURETEXTHPOSMeasureTextHorizontalPosition
diff --git a/include/svx/svdstr.hrc b/include/svx/svdstr.hrc
index 36e8719..8a94938 100644
--- a/include/svx/svdstr.hrc
+++ b/include/svx/svdstr.hrc
@@ -714,4 +714,6 @@
 #define STR_TABLE_STYLE_SETTINGS(SIP_Begin + 275)
 #define SIP_SA_CROP_MARKERS (SIP_Begin + 276)
 
+#define SIP_SA_CHAINNEXTNAME(SIP_Begin + 277)
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/unoshprp.hxx b/include/svx/unoshprp.hxx
index b7a95be..2f8e35e 100644
--- a/include/svx/unoshprp.hxx
+++ b/include/svx/unoshprp.hxx
@@ -291,6 +291,7 @@
 { 
OUString(UNO_NAME_TEXT_FONTINDEPENDENTLINESPACING),SDRATTR_TEXT_USEFIXEDCELLHEIGHT,cppu::UnoTypebool::get(),
   0,  0},   \
 { OUString(UNO_NAME_TEXT_VERTADJUST),   SDRATTR_TEXT_VERTADJUST,   
 cppu::UnoTypecss::drawing::TextVerticalAdjust::get(),0,  0},\
 { OUString(UNO_NAME_TEXT_WORDWRAP), SDRATTR_TEXT_WORDWRAP, 
 cppu::UnoTypebool::get(),0,  0}, \
+{ OUString(UNO_NAME_TEXT_CHAINNEXTNAME),SDRATTR_TEXT_CHAINNEXTNAME,
 ::cppu::UnoTypeOUString::get(),0,  0}, \
 SVX_UNOEDIT_CHAR_PROPERTIES, \
 SVX_UNOEDIT_PARA_PROPERTIES,
 
diff --git a/svx/source/svdraw/svdattr.cxx b/svx/source/svdraw/svdattr.cxx
index 18368c5..83583be 100644
--- a/svx/source/svdraw/svdattr.cxx
+++ b/svx/source/svdraw/svdattr.cxx
@@ -164,6 +164,7 @@ SdrItemPool::SdrItemPool(
 mppLocalPoolDefaults[SDRATTR_XMLATTRIBUTES -SDRATTR_START]=new 
SvXMLAttrContainerItem( SDRATTR_XMLATTRIBUTES );
 mppLocalPoolDefaults[SDRATTR_TEXT_USEFIXEDCELLHEIGHT -SDRATTR_START]=new 
SdrTextFixedCellHeightItem;
 mppLocalPoolDefaults[SDRATTR_TEXT_WORDWRAP -SDRATTR_START]=new 
SdrOnOffItem(SDRATTR_TEXT_WORDWRAP, true);
+mppLocalPoolDefaults

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

2015-07-27 Thread matteocam
 xmloff/source/draw/sdpropls.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 0f3c304253d545807a942e908a9d0a886bc21013
Author: matteocam matteo.campane...@gmail.com
Date:   Mon Jul 27 17:09:40 2015 +0200

Add TextChainNextName to the set of mapped properties

Change-Id: Ie7b11d56bc2ace27110abd0a2d0e034e54c1c2f7

diff --git a/xmloff/source/draw/sdpropls.cxx b/xmloff/source/draw/sdpropls.cxx
index 45920d9..e6764ec 100644
--- a/xmloff/source/draw/sdpropls.cxx
+++ b/xmloff/source/draw/sdpropls.cxx
@@ -146,6 +146,7 @@ const XMLPropertyMapEntry aXMLSDProperties[] =
 GMAP( NumberingRules, XML_NAMESPACE_TEXT, 
XML_LIST_STYLE, XML_SD_TYPE_NUMBULLET|MID_FLAG_ELEMENT_ITEM, 
CTF_NUMBERINGRULES ),
 GMAP( NumberingRules, XML_NAMESPACE_TEXT, 
XML_LIST_STYLE_NAME,XML_TYPE_STRING, CTF_SD_NUMBERINGRULES_NAME ),
 GMAP( TextWordWrap,   XML_NAMESPACE_FO,   
XML_WRAP_OPTION,XML_TYPE_WRAP_OPTION, 0 ),
+GMAP( TextChainNextName,  XML_NAMESPACE_DRAW,   
XML_CHAIN_NEXT_NAME,  XML_TYPE_STRING, 0 ),
 
 // shadow attributes
 GMAP( Shadow, XML_NAMESPACE_DRAW, XML_SHADOW,
 XML_SD_TYPE_SHADOW, 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' - include/svx svx/source

2015-07-27 Thread matteocam
 include/svx/svdmodel.hxx|1 +
 include/svx/svdotext.hxx|2 ++
 include/svx/textchain.hxx   |   12 ++--
 svx/source/svdraw/svdmodel.cxx  |6 ++
 svx/source/svdraw/svdotext.cxx  |   32 
 svx/source/svdraw/textchain.cxx |2 ++
 6 files changed, 49 insertions(+), 6 deletions(-)

New commits:
commit c6987ebc1dc98d0d9807ff3c9b683ade341eb8fe
Author: matteocam matteo.campane...@gmail.com
Date:   Mon Jul 27 12:00:21 2015 +0200

Implement text chain as doubly linked list in SdrTextObj

Change-Id: Id755e129b9f0dc820eae0c47b21d247ce7c4504c

diff --git a/include/svx/svdmodel.hxx b/include/svx/svdmodel.hxx
index 815ab1c..4b5c462 100644
--- a/include/svx/svdmodel.hxx
+++ b/include/svx/svdmodel.hxx
@@ -338,6 +338,7 @@ public:
 
 SdrOutliner GetChainingOutliner(const SdrTextObj* pObj=NULL) 
const;
 TextChain *GetTextChain() const;
+void SetNextLinkInTextChain(SdrTextObj *pPrev, SdrTextObj *pNext);
 
 SdrOutliner GetHitTestOutliner() const { return 
*pHitTestOutliner; }
 const SdrTextObj*GetFormattingTextObj() const;
diff --git a/include/svx/svdotext.hxx b/include/svx/svdotext.hxx
index 6dc4ed4..17a542c 100644
--- a/include/svx/svdotext.hxx
+++ b/include/svx/svdotext.hxx
@@ -230,6 +230,7 @@ protected:
 //FIXME(matteocam)
 // the successor in a chain
 SdrTextObj *mpNextInChain = NULL;
+SdrTextObj *mpPrevInChain = NULL;
 
 // indicating the for its text to be chained to another text box
 bool mbToBeChained : 1;
@@ -367,6 +368,7 @@ public:
 // Chaining // XXX: how are we using IsToBeChained at the moment?
 bool IsToBeChained() const;
 SdrTextObj *GetNextLinkInChain() const;
+void SetNextLinkInChain(SdrTextObj *);
 SdrTextObj *GetPrevLinkInChain() const;
 bool IsChainable() const;
 void SetPreventChainable();
diff --git a/include/svx/textchain.hxx b/include/svx/textchain.hxx
index 41f0fc8..b39cc04 100644
--- a/include/svx/textchain.hxx
+++ b/include/svx/textchain.hxx
@@ -137,11 +137,11 @@ class TextChain {
 TextChain();
 ~TextChain();
 
-void AppendLink(SdrTextObj *);
-bool IsLinkInChain(SdrTextObj *) const;
+//void AppendLink(SdrTextObj *);
+//bool IsLinkInChain(SdrTextObj *) const;
 
-SdrTextObj *GetNextLink(const SdrTextObj *) const;
-SdrTextObj *GetPrevLink(const SdrTextObj *) const;
+//SdrTextObj *GetNextLink(const SdrTextObj *) const;
+//SdrTextObj *GetPrevLink(const SdrTextObj *) const;
 
 ChainLinkId GetId(const SdrTextObj *) const;
 ImpChainLinkProperties *GetLinkProperties(const SdrTextObj *);
@@ -160,8 +160,8 @@ class TextChain {
 LinkPropertiesMap maLinkPropertiesMap;
 
 private:
-SdrTextObj *impGetNextLink(const SdrTextObj *) const;
-SdrTextObj *impGetPrevLink(const SdrTextObj *) const;
+//SdrTextObj *impGetNextLink(const SdrTextObj *) const;
+//SdrTextObj *impGetPrevLink(const SdrTextObj *) const;
 
 
 };
diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx
index 2260188..cd9b764 100644
--- a/svx/source/svdraw/svdmodel.cxx
+++ b/svx/source/svdraw/svdmodel.cxx
@@ -2013,6 +2013,12 @@ TextChain *SdrModel::GetTextChain() const
 return pTextChain;
 }
 
+void SdrModel::SetNextLinkInTextChain(SdrTextObj *pPrev, SdrTextObj *pNext)
+{
+// Delegate to SdrTextObj
+pPrev-SetNextLinkInChain(pNext);
+}
+
 const SdrPage* SdrModel::GetMasterPage(sal_uInt16 nPgNum) const
 {
 DBG_ASSERT(nPgNum  maMaPag.size(), SdrModel::GetMasterPage: Access out 
of range (!));
diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx
index 83bd15d..5f4f2f5 100644
--- a/svx/source/svdraw/svdotext.cxx
+++ b/svx/source/svdraw/svdotext.cxx
@@ -2082,18 +2082,50 @@ void SdrTextObj::SetObjectItemNoBroadcast(const 
SfxPoolItem rItem)
 
 SdrTextObj* SdrTextObj::GetNextLinkInChain() const
 {
+/*
 if (GetTextChain())
 return GetTextChain()-GetNextLink(this);
 
 return NULL;
+*/
+
+return mpNextInChain;
+}
+
+void SdrTextObj::SetNextLinkInChain(SdrTextObj *pNextObj)
+{
+// Basically a doubly linked list implementation
+
+SdrTextObj *pOldNextObj = mpNextInChain;
+
+// Replace next link
+mpNextInChain = pNextObj;
+// Deal with old next link's prev link
+if (pOldNextObj) {
+pOldNextObj-mpPrevInChain = NULL;
+}
+
+// Deal with new next link's prev link
+if (mpNextInChain) {
+if (mpNextInChain-mpPrevInChain)
+mpNextInChain-mpPrevInChain-mpNextInChain = NULL;
+mpNextInChain-mpPrevInChain = this;
+}
+
+// TODO: Introduce check for circular chains
+
 }
 
 SdrTextObj* SdrTextObj::GetPrevLinkInChain() const
 {
+/*
 if (GetTextChain())
 return GetTextChain()-GetPrevLink(this);
 
 return NULL;
+*/
+
+return mpPrevInChain;
 }
 
 void SdrTextObj::SetPreventChainable()
diff --git a/svx/source/svdraw/textchain.cxx b/svx/source/svdraw

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

2015-07-27 Thread matteocam
 svx/source/svdraw/textchaincursor.cxx |6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 1f2fe5b38c95e88775d4807d0f06fd78ac56c174
Author: matteocam matteo.campane...@gmail.com
Date:   Mon Jul 27 10:35:30 2015 +0200

Minor changes

Change-Id: Ibdf1c035a110eb2f95e430fe02d5e01f4ab90247

diff --git a/svx/source/svdraw/textchaincursor.cxx 
b/svx/source/svdraw/textchaincursor.cxx
index 9f4e000..6daf59b 100644
--- a/svx/source/svdraw/textchaincursor.cxx
+++ b/svx/source/svdraw/textchaincursor.cxx
@@ -77,6 +77,8 @@ void TextChainCursorManager::impDetectEvent(const KeyEvent 
rKEvt,
 sal_uInt16 nCode = rKEvt.GetKeyCode().GetCode();
 ESelection aCurSel = pOLV-GetSelection();
 
+ESelection aEndSelPrevBox(10, 10);
+
 sal_Int32 nLastPara = pOutl-GetParagraphCount()-1;
 OUString aLastParaText = pOutl-GetText(pOutl-GetParagraph(nLastPara));
 sal_Int32 nLastParaLen = aLastParaText.getLength();
@@ -110,7 +112,7 @@ void TextChainCursorManager::impDetectEvent(const KeyEvent 
rKEvt,
 if (nCode == KEY_LEFT  bAtStartOfTextContent  pPrevLink)
 {
 *pOutCursorEvt = CursorChainingEvent::TO_PREV_LINK;
-*pOutSel = ESelection(10, 10); // Set at end of selection
+*pOutSel = aEndSelPrevBox; // Set at end of selection
 *bOutHandled = true; // Nothing more to do than move cursor
 return;
 }
@@ -119,7 +121,7 @@ void TextChainCursorManager::impDetectEvent(const KeyEvent 
rKEvt,
 if (nCode == KEY_BACKSPACE  bAtStartOfTextContent  pPrevLink)
 {
 *pOutCursorEvt = CursorChainingEvent::TO_PREV_LINK;
-*pOutSel = ESelection(10, 10); // Set at end of selection
+*pOutSel = aEndSelPrevBox; // Set at end of selection
 *bOutHandled = false; // We need to delete characters after moving 
cursor
 return;
 }
___
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' - svx/source

2015-07-24 Thread matteocam
 svx/source/svdraw/svdedxv.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 1dc670f0c3768e10bb35815242f5fd2f8077b97e
Author: matteocam matteo.campane...@gmail.com
Date:   Fri Jul 24 11:15:21 2015 +0200

Remove test for next link in chain before moving cursor

Change-Id: I37a22ab3ca02d6105d632a6cd08521f7bc5ee431

diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index c9428dc..ad35d29 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -533,7 +533,7 @@ void SdrObjEditView::ImpMoveCursorAfterChainingEvent()
 
 SdrTextObj* pTextObj = dynamic_castSdrTextObj*(mxTextEditObj.get());
 
-if (!pTextObj-IsChainable() || !pTextObj-GetNextLinkInChain())
+if (!pTextObj-IsChainable())
 return;
 
 TextChain *pTextChain = pTextObj-GetTextChain();
___
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' - include/svx svx/source

2015-07-24 Thread matteocam
 include/svx/textchaincursor.hxx   |3 ++-
 svx/source/svdraw/textchaincursor.cxx |   24 +++-
 2 files changed, 21 insertions(+), 6 deletions(-)

New commits:
commit 50e6f53542903e7e17385a4be2679b2ba51d6371
Author: matteocam matteo.campane...@gmail.com
Date:   Fri Jul 24 11:00:27 2015 +0200

Handle Backspace

Change-Id: Ied9802481595f1f823ccd1abe6b6ccc97897a856

diff --git a/include/svx/textchaincursor.hxx b/include/svx/textchaincursor.hxx
index b56dd72..1d9c4de 100644
--- a/include/svx/textchaincursor.hxx
+++ b/include/svx/textchaincursor.hxx
@@ -42,7 +42,8 @@ private:
 void impChangeEditingTextObj(SdrTextObj *pTargetTextObj, ESelection 
aNewSel) const;
 void impDetectEvent(const KeyEvent rKEvt,
 CursorChainingEvent *pOutCursorEvt,
-ESelection *pOutSel) const;
+ESelection *pOutSel,
+bool *bOutHandled) const;
 };
 
 
diff --git a/svx/source/svdraw/textchaincursor.cxx 
b/svx/source/svdraw/textchaincursor.cxx
index 3952d8b..af2af7c 100644
--- a/svx/source/svdraw/textchaincursor.cxx
+++ b/svx/source/svdraw/textchaincursor.cxx
@@ -41,19 +41,22 @@ bool TextChainCursorManager::HandleKeyEvent( const 
KeyEvent rKEvt ) const
 CursorChainingEvent aCursorEvent;
 
 // check what the cursor/event situation looks like
-impDetectEvent(rKEvt, aCursorEvent, aNewSel);
+bool bCompletelyHandled = false;
+impDetectEvent(rKEvt, aCursorEvent, aNewSel, bCompletelyHandled);
 
 if (aCursorEvent == CursorChainingEvent::NULL_EVENT)
 return false;
 else {
 HandleCursorEvent(aCursorEvent, aNewSel);
-return true;
+// return value depends on the situation we are in
+return bCompletelyHandled;
 }
 }
 
 void TextChainCursorManager::impDetectEvent(const KeyEvent rKEvt,
 CursorChainingEvent *pOutCursorEvt,
-ESelection *pOutSel) const
+ESelection *pOutSel,
+bool *bOutHandled) const
 {
 SdrOutliner *pOutl = mpEditView-GetTextEditOutliner();
 OutlinerView *pOLV = mpEditView-GetTextEditOutlinerView();
@@ -80,22 +83,33 @@ void TextChainCursorManager::impDetectEvent(const KeyEvent 
rKEvt,
 ESelection aEndSel = ESelection(nLastPara, nLastParaLen);
 bool bAtEndOfTextContent = aCurSel.IsEqual(aEndSel);
 
-// Are we pushing at the end of the object?
+// Possibility: Are we pushing at the end of the object?
 if (nCode == KEY_RIGHT  bAtEndOfTextContent  pNextLink)
 {
 *pOutCursorEvt = CursorChainingEvent::TO_NEXT_LINK;
 // Selection unchanged: we are at the beginning of the box
+*bOutHandled = true; // Nothing more to do than move cursor
 return;
 }
 
 ESelection aStartSel = ESelection(0, 0);
 bool bAtStartOfTextContent = aCurSel.IsEqual(aStartSel);
 
-// Are we pushing at the start of the object?
+// Possibility: Are we pushing at the start of the object?
 if (nCode == KEY_LEFT  bAtStartOfTextContent  pPrevLink)
 {
 *pOutCursorEvt = CursorChainingEvent::TO_PREV_LINK;
 *pOutSel = ESelection(10, 10); // Set at end of selection
+*bOutHandled = true; // Nothing more to do than move cursor
+return;
+}
+
+// Possibility: Are we pushing at the start of the object and deleting 
left?
+if (nCode == KEY_BACKSPACE  bAtStartOfTextContent  pPrevLink)
+{
+*pOutCursorEvt = CursorChainingEvent::TO_PREV_LINK;
+*pOutSel = ESelection(10, 10); // Set at end of selection
+*bOutHandled = false; // We need to delete characters after moving 
cursor
 return;
 }
 
___
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 - include/svx sd/source svx/source

2015-07-24 Thread matteocam
 include/svx/textchaincursor.hxx   |4 +++-
 sd/source/ui/view/sdview.cxx  |8 
 svx/source/svdraw/textchaincursor.cxx |4 ++--
 3 files changed, 13 insertions(+), 3 deletions(-)

New commits:
commit 0fcd7e73bf81069289b6de5510fd39f9fc4697a1
Author: matteocam matteo.campane...@gmail.com
Date:   Fri Jul 24 17:38:14 2015 +0200

Handle Chaining after Paste in sd

Change-Id: I0891842228251a52a252a29adbaabbed3f8965ba

diff --git a/include/svx/textchaincursor.hxx b/include/svx/textchaincursor.hxx
index 7668773..61e6939 100644
--- a/include/svx/textchaincursor.hxx
+++ b/include/svx/textchaincursor.hxx
@@ -20,13 +20,15 @@
 #ifndef INCLUDED_SVX_TEXTCHAINCURSOR_HXX
 #define INCLUDED_SVX_TEXTCHAINCURSOR_HXX
 
+#include svx/svxdllapi.h
+
 class SdrObjEditView;
 class SdrTextObj;
 class KeyEvent;
 class SdrOutliner;
 
 
-class TextChainCursorManager
+class SVX_DLLPUBLIC TextChainCursorManager
 {
 public:
 TextChainCursorManager(SdrObjEditView *pEditView, const SdrTextObj 
*pTextObj);
diff --git a/sd/source/ui/view/sdview.cxx b/sd/source/ui/view/sdview.cxx
index b424cf7..9f2a83f 100644
--- a/sd/source/ui/view/sdview.cxx
+++ b/sd/source/ui/view/sdview.cxx
@@ -41,6 +41,8 @@
 #include svx/svdoutl.hxx
 #include svx/sdr/contact/displayinfo.hxx
 
+#include svx/textchaincursor.hxx
+
 #include svx/svdetc.hxx
 #include editeng/editstat.hxx
 
@@ -1206,6 +1208,7 @@ void View::OnBeginPasteOrDrop( PasteOrDropInfos* 
/*pInfos*/ )
 get the correct style sheet. */
 void View::OnEndPasteOrDrop( PasteOrDropInfos* pInfos )
 {
+/* Style Sheet handling */
 SdrTextObj* pTextObj = dynamic_cast SdrTextObj* ( GetTextEditObject() );
 SdrOutliner* pOutliner = GetTextEditOutliner();
 if( pOutliner  pTextObj  pTextObj-GetPage() )
@@ -1256,6 +1259,11 @@ void View::OnEndPasteOrDrop( PasteOrDropInfos* pInfos )
 }
 }
 }
+
+/* Chaining handling */
+ImpChainingEventHdl(NULL);
+TextChainCursorManager *pCursorManager = new TextChainCursorManager(this, 
pTextObj);
+ImpMoveCursorAfterChainingEvent(pCursorManager);
 }
 
 bool View::ShouldToggleOn(
commit f0aa62053f06c226a6394419ec8c345c2c634a94
Author: matteocam matteo.campane...@gmail.com
Date:   Fri Jul 24 17:16:08 2015 +0200

Detect DEL by KeyFuncType::DELETE

Change-Id: I062360a104e9ed07ac4b693536df0c45f18078b3

diff --git a/svx/source/svdraw/textchaincursor.cxx 
b/svx/source/svdraw/textchaincursor.cxx
index 35a339e..9f4e000 100644
--- a/svx/source/svdraw/textchaincursor.cxx
+++ b/svx/source/svdraw/textchaincursor.cxx
@@ -68,7 +68,7 @@ void TextChainCursorManager::impDetectEvent(const KeyEvent 
rKEvt,
 KeyFuncType eFunc = rKEvt.GetKeyCode().GetFunction();
 
 // We need to have this KeyFuncType
-if (eFunc !=  KeyFuncType::DONTKNOW)
+if (eFunc !=  KeyFuncType::DONTKNOW  eFunc != KeyFuncType::DELETE)
 {
 *pOutCursorEvt = CursorChainingEvent::NULL_EVENT;
 return;
@@ -94,7 +94,7 @@ void TextChainCursorManager::impDetectEvent(const KeyEvent 
rKEvt,
 }
 
 // Possibility: Are we pushing at the end of the object?
-if (nCode == KEY_DELETE  bAtEndOfTextContent  pNextLink)
+if (eFunc == KeyFuncType::DELETE  bAtEndOfTextContent  pNextLink)
 {
 *pOutCursorEvt = CursorChainingEvent::TO_NEXT_LINK;
 // Selection unchanged: we are at the beginning of the box
___
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 - include/svx sd/source svx/source

2015-07-24 Thread matteocam
 include/svx/svdedxv.hxx   |5 ++-
 include/svx/textchaincursor.hxx   |   17 ---
 sd/source/ui/view/drviewse.cxx|3 +-
 svx/source/svdraw/svdedxv.cxx |   36 ++--
 svx/source/svdraw/textchaincursor.cxx |   50 +-
 5 files changed, 84 insertions(+), 27 deletions(-)

New commits:
commit 8c4db4fe0f5bd10c06fb2a35b2e5cdaedad34bc3
Author: matteocam matteo.campane...@gmail.com
Date:   Fri Jul 24 16:29:47 2015 +0200

Handle DEL calling Sdr*View::KeyInput instead of OutlinerView::PostKeyEvent

Change-Id: I7f4483e5165d30786288462fe5397ee93e477673

diff --git a/sd/source/ui/view/drviewse.cxx b/sd/source/ui/view/drviewse.cxx
index 516f487..a8bb8c1 100644
--- a/sd/source/ui/view/drviewse.cxx
+++ b/sd/source/ui/view/drviewse.cxx
@@ -939,7 +939,8 @@ void DrawViewShell::FuSupport(SfxRequest rReq)
 {
 vcl::KeyCode aKCode(KEY_DELETE);
 KeyEvent aKEvt( 0, aKCode);
-pOLV-PostKeyEvent(aKEvt);
+//pOLV-PostKeyEvent(aKEvt);
+mpDrawView-KeyInput(aKEvt, NULL);
 }
 }
 else
commit ebe372b42c1e9667a60fb06e798e01dc11e2155b
Author: matteocam matteo.campane...@gmail.com
Date:   Fri Jul 24 12:04:31 2015 +0200

Handle Delete

Change-Id: I17a1886689785420fb881bea8f1d609ab3f35c4e

diff --git a/include/svx/svdedxv.hxx b/include/svx/svdedxv.hxx
index d45a12f..c7e9c99 100644
--- a/include/svx/svdedxv.hxx
+++ b/include/svx/svdedxv.hxx
@@ -34,6 +34,7 @@ class EditFieldInfo;
 class ImpSdrEditPara;
 struct PasteOrDropInfos;
 class SdrUndoManager;
+class TextChainCursorManager;
 
 enum class CursorChainingEvent;
 class ESelection;
@@ -110,8 +111,8 @@ protected:
 
 OutlinerView* ImpFindOutlinerView(vcl::Window* pWin) const;
 
-void ImpMoveCursorAfterChainingEvent();
-bool ImpHandleMotionThroughBoxesKeyInput(const KeyEvent rKEvt, 
vcl::Window* pWin);
+void ImpMoveCursorAfterChainingEvent(TextChainCursorManager 
*pCursorManager);
+TextChainCursorManager *ImpHandleMotionThroughBoxesKeyInput(const 
KeyEvent rKEvt, vcl::Window* pWin, bool *bOutHandled);
 
 // Create a new OutlinerView at the heap and initialize all required 
parameters.
 // pTextEditObj, pTextEditPV and pTextEditOutliner have to be initialized
diff --git a/include/svx/textchaincursor.hxx b/include/svx/textchaincursor.hxx
index 1d9c4de..7668773 100644
--- a/include/svx/textchaincursor.hxx
+++ b/include/svx/textchaincursor.hxx
@@ -31,19 +31,28 @@ class TextChainCursorManager
 public:
 TextChainCursorManager(SdrObjEditView *pEditView, const SdrTextObj 
*pTextObj);
 
-bool HandleKeyEvent( const KeyEvent rKEvt ) const;
+bool HandleKeyEvent( const KeyEvent rKEvt );
+
+// Used by HandledKeyEvent and basic building block for handling cursor 
event
 void HandleCursorEvent(const CursorChainingEvent aCurEvt,
-   const ESelection  aNewSel) const;
+   const ESelection  aNewSel);
+
+// To be used after chaining event to deal with some nuisances
+void  HandleCursorEventAfterChaining(const CursorChainingEvent aCurEvt,
+ const ESelection  aNewSel);
 
 private:
 SdrObjEditView *mpEditView;
 const SdrTextObj *mpTextObj;
 
-void impChangeEditingTextObj(SdrTextObj *pTargetTextObj, ESelection 
aNewSel) const;
+// flag for handling of CANC which is kind of an exceptional case
+bool mbHandlingDel;
+
+void impChangeEditingTextObj(SdrTextObj *pTargetTextObj, ESelection 
aNewSel);
 void impDetectEvent(const KeyEvent rKEvt,
 CursorChainingEvent *pOutCursorEvt,
 ESelection *pOutSel,
-bool *bOutHandled) const;
+bool *bOutHandled);
 };
 
 
diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index ad35d29..cfc5d33 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -526,9 +526,9 @@ IMPL_LINK_NOARG(SdrObjEditView,ImpChainingEventHdl)
 }
 
 
-void SdrObjEditView::ImpMoveCursorAfterChainingEvent()
+void SdrObjEditView::ImpMoveCursorAfterChainingEvent(TextChainCursorManager 
*pCursorManager)
 {
-if (!mxTextEditObj.is())
+if (!mxTextEditObj.is() || !pCursorManager)
 return;
 
 SdrTextObj* pTextObj = dynamic_castSdrTextObj*(mxTextEditObj.get());
@@ -539,8 +539,8 @@ void SdrObjEditView::ImpMoveCursorAfterChainingEvent()
 TextChain *pTextChain = pTextObj-GetTextChain();
 ESelection aNewSel = pTextChain-GetPostChainingSel(pTextObj);
 
-TextChainCursorManager aCursorManager(this, pTextObj);
-aCursorManager.HandleCursorEvent(
+
+pCursorManager-HandleCursorEventAfterChaining(
 pTextChain-GetCursorEvent(pTextObj),
 aNewSel);
 
@@ -1258,25 +1258,30 @@ bool SdrObjEditView::IsTextEditFrameHit

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

2015-07-24 Thread matteocam
 include/svx/svdedxv.hxx   |1 +
 svx/source/svdraw/svdedxv.cxx |   12 +++-
 2 files changed, 12 insertions(+), 1 deletion(-)

New commits:
commit c70006435a69471b921faf785571dfc61514e1e0
Author: matteocam matteo.campane...@gmail.com
Date:   Fri Jul 24 18:15:29 2015 +0200

Add Cursor handling after post-paste chaining

Change-Id: Id3bd5a86e09d0171f6d0afdbd228fa6e45042a6d

diff --git a/include/svx/svdedxv.hxx b/include/svx/svdedxv.hxx
index c7e9c99..6b6f27c 100644
--- a/include/svx/svdedxv.hxx
+++ b/include/svx/svdedxv.hxx
@@ -128,6 +128,7 @@ protected:
 // handler for AutoGrowing text with active Outliner
 DECL_LINK(ImpOutlinerStatusEventHdl,EditStatus*);
 DECL_LINK(ImpChainingEventHdl,void*);
+DECL_LINK(ImpAfterPasteChainingEventHdl,void*);
 DECL_LINK(ImpOutlinerCalcFieldValueHdl,EditFieldInfo*);
 
 // link for EndTextEditHdl
diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index fb71e2f..9324ffd 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -525,6 +525,16 @@ IMPL_LINK_NOARG(SdrObjEditView,ImpChainingEventHdl)
 return 0;
 }
 
+IMPL_LINK_NOARG(SdrObjEditView,ImpAfterPasteChainingEventHdl)
+{
+SdrTextObj* pTextObj = dynamic_cast SdrTextObj * ( GetTextEditObject());
+if (!pTextObj)
+return 0;
+ImpChainingEventHdl(NULL);
+TextChainCursorManager *pCursorManager = new TextChainCursorManager(this, 
pTextObj);
+ImpMoveCursorAfterChainingEvent(pCursorManager);
+return 0;
+}
 
 void SdrObjEditView::ImpMoveCursorAfterChainingEvent(TextChainCursorManager 
*pCursorManager)
 {
@@ -789,7 +799,7 @@ bool SdrObjEditView::SdrBeginTextEdit(
 pTextEditOutlinerView-ShowCursor();
 
pTextEditOutliner-SetStatusEventHdl(LINK(this,SdrObjEditView,ImpOutlinerStatusEventHdl));
 if (pTextObj-IsChainable()) {
-
pTextEditOutlinerView-SetEndPasteLinkHdl(LINK(this,SdrObjEditView,ImpChainingEventHdl)
 );
+
pTextEditOutlinerView-SetEndPasteLinkHdl(LINK(this,SdrObjEditView,ImpAfterPasteChainingEventHdl)
 );
 /* We should call:
  *
 ImpChainingEventHdl(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' - editeng/source sd/source svx/source

2015-07-24 Thread matteocam
 editeng/source/outliner/outlvw.cxx |4 
 sd/source/ui/view/sdview.cxx   |4 
 svx/source/svdraw/svdedxv.cxx  |   11 +--
 3 files changed, 13 insertions(+), 6 deletions(-)

New commits:
commit 3b81b9fa231d4b8435b9869c59bd64e7d67cfd6f
Author: matteocam matteo.campane...@gmail.com
Date:   Fri Jul 24 18:04:27 2015 +0200

Move Chaining post-paste to OutlinerView

Change-Id: If869ba6fc27d4c293a003a88c97cd52b71b9d895

diff --git a/editeng/source/outliner/outlvw.cxx 
b/editeng/source/outliner/outlvw.cxx
index 88c6d10..987bd0a 100644
--- a/editeng/source/outliner/outlvw.cxx
+++ b/editeng/source/outliner/outlvw.cxx
@@ -705,6 +705,10 @@ void OutlinerView::PasteSpecial()
 pEditView-SetEditEngineUpdateMode( true );
 pOwner-UndoActionEnd( OLUNDO_INSERT );
 pEditView-ShowCursor( true, true );
+
+// XXX: Not sure if this should be called right before ShowCursor
+if (aEndPasteLink.IsSet())
+aEndPasteLink.Call(NULL);
 }
 
 }
diff --git a/sd/source/ui/view/sdview.cxx b/sd/source/ui/view/sdview.cxx
index 9f2a83f..c1135de 100644
--- a/sd/source/ui/view/sdview.cxx
+++ b/sd/source/ui/view/sdview.cxx
@@ -1260,10 +1260,6 @@ void View::OnEndPasteOrDrop( PasteOrDropInfos* pInfos )
 }
 }
 
-/* Chaining handling */
-ImpChainingEventHdl(NULL);
-TextChainCursorManager *pCursorManager = new TextChainCursorManager(this, 
pTextObj);
-ImpMoveCursorAfterChainingEvent(pCursorManager);
 }
 
 bool View::ShouldToggleOn(
diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index cfc5d33..fb71e2f 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -788,8 +788,15 @@ bool SdrObjEditView::SdrBeginTextEdit(
 
 pTextEditOutlinerView-ShowCursor();
 
pTextEditOutliner-SetStatusEventHdl(LINK(this,SdrObjEditView,ImpOutlinerStatusEventHdl));
-if (pTextObj-IsChainable())
-
pTextEditOutliner-SetChainingEventHdl(LINK(this,SdrObjEditView,ImpChainingEventHdl)
 );
+if (pTextObj-IsChainable()) {
+
pTextEditOutlinerView-SetEndPasteLinkHdl(LINK(this,SdrObjEditView,ImpChainingEventHdl)
 );
+/* We should call:
+ *
+ImpChainingEventHdl(NULL);
+TextChainCursorManager *pCursorManager = new 
TextChainCursorManager(this, pTextObj);
+ImpMoveCursorAfterChainingEvent(pCursorManager);
+*/
+}
 
 #ifdef DBG_UTIL
 if (pItemBrowser!=nullptr) pItemBrowser-SetDirty();
___
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' - svx/source

2015-07-23 Thread matteocam
 svx/source/svdraw/textchain.cxx   |   10 +-
 svx/source/svdraw/textchaincursor.cxx |   23 ++-
 2 files changed, 23 insertions(+), 10 deletions(-)

New commits:
commit 7afcf37661e01bcc75271a82a067892ce98ce627
Author: matteocam matteo.campane...@gmail.com
Date:   Fri Jul 24 02:14:16 2015 +0200

Handle Left Arrow and Prev Link

Change-Id: I08f56fc5fc747d097d90313f4bfec14091b6f5a7

diff --git a/svx/source/svdraw/textchain.cxx b/svx/source/svdraw/textchain.cxx
index 86357c2..7cfa0a4 100644
--- a/svx/source/svdraw/textchain.cxx
+++ b/svx/source/svdraw/textchain.cxx
@@ -89,17 +89,17 @@ SdrTextObj *TextChain::impGetNextLink(const SdrTextObj 
*pTextObj) const
 
 SdrTextObj *TextChain::impGetPrevLink(const SdrTextObj *pTextObj) const
 {
-SdrTextObj *pNextTextObj = NULL;
+SdrTextObj *pPrevTextObj = NULL;
 SdrPage *pPage = pTextObj-pPage;
 
 if ( pPage  pPage-GetObjCount()  1) {
 
-sal_uInt32 nextIndex = (pTextObj-GetOrdNum()-1);
+sal_Int32 prevIndex = (pTextObj-GetOrdNum()-1);
 
-if (nextIndex  0)
-pNextTextObj =  dynamic_cast SdrTextObj * ( pPage-GetObj( 
nextIndex ) );
+if (prevIndex = 0)
+pPrevTextObj =  dynamic_cast SdrTextObj * ( pPage-GetObj( 
prevIndex ) );
 
-return pNextTextObj;
+return pPrevTextObj;
 } else {
 fprintf(stderr, Make New Object please\n);
 return NULL;
diff --git a/svx/source/svdraw/textchaincursor.cxx 
b/svx/source/svdraw/textchaincursor.cxx
index 7ca44f7..3952d8b 100644
--- a/svx/source/svdraw/textchaincursor.cxx
+++ b/svx/source/svdraw/textchaincursor.cxx
@@ -58,6 +58,9 @@ void TextChainCursorManager::impDetectEvent(const KeyEvent 
rKEvt,
 SdrOutliner *pOutl = mpEditView-GetTextEditOutliner();
 OutlinerView *pOLV = mpEditView-GetTextEditOutlinerView();
 
+SdrTextObj *pNextLink = mpTextObj-GetNextLinkInChain();
+SdrTextObj *pPrevLink = mpTextObj-GetPrevLinkInChain();
+
 KeyFuncType eFunc = rKEvt.GetKeyCode().GetFunction();
 
 // We need to have this KeyFuncType
@@ -74,17 +77,27 @@ void TextChainCursorManager::impDetectEvent(const KeyEvent 
rKEvt,
 OUString aLastParaText = pOutl-GetText(pOutl-GetParagraph(nLastPara));
 sal_Int32 nLastParaLen = aLastParaText.getLength();
 
-bool bAtEndOfTextContent =
-(aCurSel.nEndPara == nLastPara) 
-(aCurSel.nEndPos == nLastParaLen);
+ESelection aEndSel = ESelection(nLastPara, nLastParaLen);
+bool bAtEndOfTextContent = aCurSel.IsEqual(aEndSel);
 
-if (nCode == KEY_RIGHT  bAtEndOfTextContent)
+// Are we pushing at the end of the object?
+if (nCode == KEY_RIGHT  bAtEndOfTextContent  pNextLink)
 {
 *pOutCursorEvt = CursorChainingEvent::TO_NEXT_LINK;
 // Selection unchanged: we are at the beginning of the box
+return;
 }
 
-// if (nCode == KEY_LEFT  bAtStartOfTextContent) ...
+ESelection aStartSel = ESelection(0, 0);
+bool bAtStartOfTextContent = aCurSel.IsEqual(aStartSel);
+
+// Are we pushing at the start of the object?
+if (nCode == KEY_LEFT  bAtStartOfTextContent  pPrevLink)
+{
+*pOutCursorEvt = CursorChainingEvent::TO_PREV_LINK;
+*pOutSel = ESelection(10, 10); // Set at end of selection
+return;
+}
 
 // If arrived here there is no event detected
 *pOutCursorEvt = CursorChainingEvent::NULL_EVENT;
___
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' - include/svx svx/source

2015-07-23 Thread matteocam
 include/svx/textchaincursor.hxx   |   15 +-
 svx/source/svdraw/svdedxv.cxx |   48 ++
 svx/source/svdraw/textchaincursor.cxx |   44 ++-
 3 files changed, 65 insertions(+), 42 deletions(-)

New commits:
commit cdc0e22b54d8b2c20950a955070488c5603e66c0
Author: matteocam matteo.campane...@gmail.com
Date:   Thu Jul 23 23:46:47 2015 +0200

Move code for right motion into TextChainCursorManager

Change-Id: Ifa6aecbd2c55763583f2d48b0883698f876cbc6c

diff --git a/include/svx/textchaincursor.hxx b/include/svx/textchaincursor.hxx
index 71dbc60..456d3c1 100644
--- a/include/svx/textchaincursor.hxx
+++ b/include/svx/textchaincursor.hxx
@@ -20,10 +20,21 @@
 #ifndef INCLUDED_SVX_TEXTCHAINCURSOR_HXX
 #define INCLUDED_SVX_TEXTCHAINCURSOR_HXX
 
+class SdrObjEditView;
+class SdrTextObj;
+class KeyEvent;
 
-class TextChainCursorHandler
+
+class TextChainCursorManager
 {
-TextChainCursorHandler();
+public:
+TextChainCursorManager(SdrObjEditView *pEditView, const SdrTextObj 
*pTextObj);
+
+bool HandleKeyEvent( const KeyEvent rKEvt ) const;
+
+private:
+SdrObjEditView *mpEditView;
+const SdrTextObj *mpTextObj;
 };
 
 
diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index 180ae2e..89e4902 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -52,6 +52,7 @@
 #include svdglob.hxx
 #include svx/globl3d.hxx
 #include svx/textchain.hxx
+#include svx/textchaincursor.hxx
 #include editeng/outliner.hxx
 #include editeng/adjustitem.hxx
 #include svtools/colorcfg.hxx
@@ -1282,49 +1283,20 @@ bool SdrObjEditView::IsTextEditFrameHit(const Point 
rHit) const
 
 bool SdrObjEditView::ImpHandleMotionThroughBoxesKeyInput(const KeyEvent 
rKEvt, vcl::Window* pWin)
 {
-// XXX: Find a clean way to do this (even cleaner than the code commented 
below)
-// if( pTextEditOutlinerView-IsKeyEventPushingOutOfPage(rKevt, pWin)
-//   pWin = HandleKeyPushingOutOfBox(rKevt);
-KeyFuncType eFunc = rKEvt.GetKeyCode().GetFunction();
-sal_uInt16 nCode = rKEvt.GetKeyCode().GetCode();
-ESelection aCurSel = pTextEditOutlinerView-GetSelection();
-
-
 SdrTextObj* pTextObj = NULL;
 if (mxTextEditObj.is())
 pTextObj= dynamic_castSdrTextObj*(mxTextEditObj.get());
+else
+return false;
 
-bool bHandled = false;
-
-// XXX: Add check for last position in the para
-if (pTextObj  pTextObj-IsChainable()  pTextObj-GetNextLinkInChain() 

-eFunc ==  KeyFuncType::DONTKNOW)
-{
-SdrOutliner *pOutl = GetTextEditOutliner();
-sal_Int32 nLastPara = pOutl-GetParagraphCount()-1;
-OUString aLastParaText = 
pOutl-GetText(pOutl-GetParagraph(nLastPara));
-sal_Int32 nLastParaLen = aLastParaText.getLength();
-
-if (nCode == KEY_RIGHT 
-aCurSel.nEndPara == nLastPara 
-aCurSel.nEndPos == nLastParaLen
-)
-{
-fprintf(stderr, [CHAIN - CURSOR] Trying to move to next box\n );
-
-// Move to next box
-SdrEndTextEdit();
-SdrTextObj *pNextLink = pTextObj-GetNextLinkInChain();
-SdrBeginTextEdit(pNextLink);
-bHandled = true;
-}
-
+TextChainCursorManager aCursorManager(this, pTextObj);
+if( aCursorManager.HandleKeyEvent(rKEvt) ) {
+// Possibly do other stuff here if necessary...
 // XXX: Careful with the checks below (in KeyInput) for pWin and co. 
You should do them here I guess.
-
+return true;
+} else {
+return false;
 }
-
-return bHandled;
-
 }
 
 bool SdrObjEditView::KeyInput(const KeyEvent rKEvt, vcl::Window* pWin)
@@ -1356,8 +1328,6 @@ bool SdrObjEditView::KeyInput(const KeyEvent rKEvt, 
vcl::Window* pWin)
 #endif
 ImpMakeTextCursorAreaVisible();
 
-
-
 return true;
 }
 }
diff --git a/svx/source/svdraw/textchaincursor.cxx 
b/svx/source/svdraw/textchaincursor.cxx
index 45f8533..37b5931 100644
--- a/svx/source/svdraw/textchaincursor.cxx
+++ b/svx/source/svdraw/textchaincursor.cxx
@@ -17,11 +17,53 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include svx/textchain.hxx
 #include svx/textchaincursor.hxx
+#include svx/svdedxv.hxx
+#include svx/svdoutl.hxx
 
-TextChainCursorHandler::TextChainCursorHandler()
+TextChainCursorManager::TextChainCursorManager(SdrObjEditView *pEditView, 
const SdrTextObj *pTextObj) :
+mpEditView(pEditView),
+mpTextObj(pTextObj)
 {
 
 }
 
+bool TextChainCursorManager::HandleKeyEvent( const KeyEvent rKEvt ) const
+{
+bool bHandled = false;
+
+// XXX: Find a clean way to do this (even cleaner than the code commented 
below)
+// if( pTextEditOutlinerView-IsKeyEventPushingOutOfPage(rKevt, pWin)
+//   pWin = HandleKeyPushingOutOfBox(rKevt);
+KeyFuncType eFunc = rKEvt.GetKeyCode().GetFunction();
+sal_uInt16 nCode = rKEvt.GetKeyCode

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

2015-07-23 Thread matteocam
 svx/source/svdraw/svdedxv.cxx   |4 ++--
 svx/source/svdraw/textchainflow.cxx |   11 +--
 2 files changed, 7 insertions(+), 8 deletions(-)

New commits:
commit e8774374f6a572110ac2eb85330da9cec41a8c4b
Author: matteocam matteo.campane...@gmail.com
Date:   Fri Jul 24 00:24:28 2015 +0200

Set PostChainingSel even with event UNCHANGED

Change-Id: I5d5133fa46949eab8937e3e83a4e4f53f754f825

diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index 89e4902..fe7f6c4 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -546,10 +546,10 @@ void SdrObjEditView::ImpMoveCursorAfterChainingEvent()
 switch ( pTextChain-GetCursorEvent(pTextObj) ) {
 
 case CursorChainingEvent::UNCHANGED:
-// Set same selection as before the chaining
+// Set same selection as before the chaining (which is saved 
as PostChainingSel)
 // 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));
+pOLV-SetSelection(aNewSel);
 break;
 case CursorChainingEvent::TO_NEXT_LINK:
 SdrEndTextEdit();
diff --git a/svx/source/svdraw/textchainflow.cxx 
b/svx/source/svdraw/textchainflow.cxx
index 4d6352f..581b5be 100644
--- a/svx/source/svdraw/textchainflow.cxx
+++ b/svx/source/svdraw/textchainflow.cxx
@@ -317,18 +317,16 @@ void 
EditingTextChainFlow::impSetFlowOutlinerParams(SdrOutliner *pFlowOutl, SdrO
 
 void EditingTextChainFlow::impBroadcastCursorInfo() const
 {
-bool bCursorOut = false;
+ESelection aPreChainingSel = 
GetTextChain()-GetPreChainingSel(GetLinkTarget()) ;
+
+// Test whether the cursor is out of the box.
+bool bCursorOut = mbPossiblyCursorOut  
maOverflowPosSel.IsLess(aPreChainingSel);
 
 // NOTE: I handled already the stuff for the comments below. They will be 
kept temporarily till stuff settles down.
 // Possibility: 1) why don't we stop passing the actual event to the 
TextChain and instead we pass
 //  the overflow pos and mbPossiblyCursorOut
 //  2) We pass the current selection before anything happens 
and we make impBroadcastCursorInfo compute it.
 
-if (mbPossiblyCursorOut) {
-ESelection aPreChainingSel = 
GetTextChain()-GetPreChainingSel(GetLinkTarget()) ;
-// Test whether the cursor is out of the box.
-bCursorOut = maOverflowPosSel.IsLess(aPreChainingSel);
-}
 
 if (bCursorOut) {
 //maCursorEvent = CursorChainingEvent::TO_NEXT_LINK;
@@ -336,6 +334,7 @@ void EditingTextChainFlow::impBroadcastCursorInfo() const
 GetTextChain()-SetCursorEvent(GetLinkTarget(), 
CursorChainingEvent::TO_NEXT_LINK);
 } else {
 //maCursorEvent = CursorChainingEvent::UNCHANGED;
+GetTextChain()-SetPostChainingSel(GetLinkTarget(), aPreChainingSel);
 GetTextChain()-SetCursorEvent(GetLinkTarget(), 
CursorChainingEvent::UNCHANGED);
 }
 
___
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' - include/svx svx/source

2015-07-23 Thread matteocam
 include/svx/textchaincursor.hxx   |4 +++
 svx/source/svdraw/svdedxv.cxx |   31 +++-
 svx/source/svdraw/textchaincursor.cxx |   43 ++
 3 files changed, 51 insertions(+), 27 deletions(-)

New commits:
commit 70ce299e1a6c4a1d7375ddb089acfb8b60a9e8c8
Author: matteocam matteo.campane...@gmail.com
Date:   Fri Jul 24 01:03:58 2015 +0200

Add specific method for cursor event handling

Change-Id: I664e1ac9ac52d7d54e2f3ca35cbb429dc2e131cb

diff --git a/include/svx/textchaincursor.hxx b/include/svx/textchaincursor.hxx
index 456d3c1..ce5200f 100644
--- a/include/svx/textchaincursor.hxx
+++ b/include/svx/textchaincursor.hxx
@@ -31,10 +31,14 @@ public:
 TextChainCursorManager(SdrObjEditView *pEditView, const SdrTextObj 
*pTextObj);
 
 bool HandleKeyEvent( const KeyEvent rKEvt ) const;
+void HandleCursorEvent(const CursorChainingEvent aCurEvt,
+   const ESelection  aNewSel) const;
 
 private:
 SdrObjEditView *mpEditView;
 const SdrTextObj *mpTextObj;
+
+void impChangeEditingTextObj(SdrTextObj *pTargetTextObj, ESelection 
aNewSel) const;
 };
 
 
diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index fe7f6c4..15e2228 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -536,39 +536,16 @@ void SdrObjEditView::ImpMoveCursorAfterChainingEvent()
 if (!pTextObj-IsChainable() || !pTextObj-GetNextLinkInChain())
 return;
 
-
-SdrTextObj *pNextLink = pTextObj-GetNextLinkInChain();
-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 chaining (which is saved 
as PostChainingSel)
-// We need an explicit set because the Outliner is messed up
-//after text transfer and otherwise it brings us at 
arbitrary positions.
-pOLV-SetSelection(aNewSel);
-break;
-case CursorChainingEvent::TO_NEXT_LINK:
-SdrEndTextEdit();
-SdrBeginTextEdit(pNextLink);
-// OutlinerView has changed, so we update the pointer
-pOLV = GetTextEditOutlinerView();
-pOLV-SetSelection(aNewSel); // XXX
-break;
-case CursorChainingEvent::TO_PREV_LINK:
-// XXX: To be handled
-break;
-case CursorChainingEvent::NULL_EVENT:
-// Do nothing here
-break;
-}
+TextChainCursorManager aCursorManager(this, pTextObj);
+aCursorManager.HandleCursorEvent(
+pTextChain-GetCursorEvent(pTextObj),
+aNewSel);
 
 // Reset event
 pTextChain-SetCursorEvent(pTextObj, CursorChainingEvent::NULL_EVENT);
-
 }
 
 IMPL_LINK(SdrObjEditView,ImpOutlinerCalcFieldValueHdl,EditFieldInfo*,pFI)
diff --git a/svx/source/svdraw/textchaincursor.cxx 
b/svx/source/svdraw/textchaincursor.cxx
index 37b5931..a0def07 100644
--- a/svx/source/svdraw/textchaincursor.cxx
+++ b/svx/source/svdraw/textchaincursor.cxx
@@ -22,6 +22,10 @@
 #include svx/svdedxv.hxx
 #include svx/svdoutl.hxx
 
+// XXX: Possible duplication of code in behavior with stuff in ImpEditView (or 
ImpEditEngine) and OutlinerView
+
+// XXX: We violate Demeter's Law several times here, I'm afraid
+
 TextChainCursorManager::TextChainCursorManager(SdrObjEditView *pEditView, 
const SdrTextObj *pTextObj) :
 mpEditView(pEditView),
 mpTextObj(pTextObj)
@@ -66,4 +70,43 @@ bool TextChainCursorManager::HandleKeyEvent( const KeyEvent 
rKEvt ) const
 return bHandled;
 }
 
+void TextChainCursorManager::HandleCursorEvent(const CursorChainingEvent 
aCurEvt,
+   const ESelection  aNewSel) const
+{
+OutlinerView* pOLV = mpEditView-GetTextEditOutlinerView();
+SdrTextObj *pNextLink = mpTextObj-GetNextLinkInChain();
+SdrTextObj *pPrevLink = mpTextObj-GetPrevLinkInChain();
+
+switch ( aCurEvt ) {
+case CursorChainingEvent::UNCHANGED:
+// Set same selection as before the chaining (which is saved 
as PostChainingSel)
+// We need an explicit set because the Outliner is messed up
+//after text transfer and otherwise it brings us at 
arbitrary positions.
+pOLV-SetSelection(aNewSel);
+break;
+case CursorChainingEvent::TO_NEXT_LINK:
+impChangeEditingTextObj(pNextLink, aNewSel);
+break;
+case CursorChainingEvent::TO_PREV_LINK:
+impChangeEditingTextObj(pPrevLink, aNewSel);
+break;
+case CursorChainingEvent::NULL_EVENT:
+// Do nothing here
+break

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

2015-07-23 Thread matteocam
 include/svx/textchaincursor.hxx   |4 +
 svx/source/svdraw/svdedxv.cxx |3 +
 svx/source/svdraw/textchaincursor.cxx |   85 +-
 3 files changed, 61 insertions(+), 31 deletions(-)

New commits:
commit 4ded1c96716ac12fabda495901f677d366265926
Author: matteocam matteo.campane...@gmail.com
Date:   Fri Jul 24 01:38:16 2015 +0200

Add specific method for detecting event

Change-Id: I3030f4a5c80bcade440fb66d578430abb15dfc44

diff --git a/include/svx/textchaincursor.hxx b/include/svx/textchaincursor.hxx
index ce5200f..b56dd72 100644
--- a/include/svx/textchaincursor.hxx
+++ b/include/svx/textchaincursor.hxx
@@ -23,6 +23,7 @@
 class SdrObjEditView;
 class SdrTextObj;
 class KeyEvent;
+class SdrOutliner;
 
 
 class TextChainCursorManager
@@ -39,6 +40,9 @@ private:
 const SdrTextObj *mpTextObj;
 
 void impChangeEditingTextObj(SdrTextObj *pTargetTextObj, ESelection 
aNewSel) const;
+void impDetectEvent(const KeyEvent rKEvt,
+CursorChainingEvent *pOutCursorEvt,
+ESelection *pOutSel) const;
 };
 
 
diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index 15e2228..c9428dc 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -1266,6 +1266,9 @@ bool 
SdrObjEditView::ImpHandleMotionThroughBoxesKeyInput(const KeyEvent rKEvt,
 else
 return false;
 
+if (!pTextObj-IsChainable())
+return false;
+
 TextChainCursorManager aCursorManager(this, pTextObj);
 if( aCursorManager.HandleKeyEvent(rKEvt) ) {
 // Possibly do other stuff here if necessary...
diff --git a/svx/source/svdraw/textchaincursor.cxx 
b/svx/source/svdraw/textchaincursor.cxx
index a0def07..7ca44f7 100644
--- a/svx/source/svdraw/textchaincursor.cxx
+++ b/svx/source/svdraw/textchaincursor.cxx
@@ -30,49 +30,73 @@ 
TextChainCursorManager::TextChainCursorManager(SdrObjEditView *pEditView, const
 mpEditView(pEditView),
 mpTextObj(pTextObj)
 {
+assert(mpEditView);
+assert(mpTextObj);
 
 }
 
 bool TextChainCursorManager::HandleKeyEvent( const KeyEvent rKEvt ) const
 {
-bool bHandled = false;
+ESelection aNewSel;
+CursorChainingEvent aCursorEvent;
+
+// check what the cursor/event situation looks like
+impDetectEvent(rKEvt, aCursorEvent, aNewSel);
+
+if (aCursorEvent == CursorChainingEvent::NULL_EVENT)
+return false;
+else {
+HandleCursorEvent(aCursorEvent, aNewSel);
+return true;
+}
+}
+
+void TextChainCursorManager::impDetectEvent(const KeyEvent rKEvt,
+CursorChainingEvent *pOutCursorEvt,
+ESelection *pOutSel) const
+{
+SdrOutliner *pOutl = mpEditView-GetTextEditOutliner();
+OutlinerView *pOLV = mpEditView-GetTextEditOutlinerView();
 
-// XXX: Find a clean way to do this (even cleaner than the code commented 
below)
-// if( pTextEditOutlinerView-IsKeyEventPushingOutOfPage(rKevt, pWin)
-//   pWin = HandleKeyPushingOutOfBox(rKevt);
 KeyFuncType eFunc = rKEvt.GetKeyCode().GetFunction();
-sal_uInt16 nCode = rKEvt.GetKeyCode().GetCode();
-ESelection aCurSel = mpEditView-GetTextEditOutlinerView()-GetSelection();
 
-if (mpTextObj  mpTextObj-IsChainable()  
mpTextObj-GetNextLinkInChain() 
-eFunc ==  KeyFuncType::DONTKNOW)
+// We need to have this KeyFuncType
+if (eFunc !=  KeyFuncType::DONTKNOW)
 {
-SdrOutliner *pOutl = mpEditView-GetTextEditOutliner();
-sal_Int32 nLastPara = pOutl-GetParagraphCount()-1;
-OUString aLastParaText = 
pOutl-GetText(pOutl-GetParagraph(nLastPara));
-sal_Int32 nLastParaLen = aLastParaText.getLength();
-
-if (nCode == KEY_RIGHT 
-aCurSel.nEndPara == nLastPara 
-aCurSel.nEndPos == nLastParaLen
-)
-{
-fprintf(stderr, [CHAIN - CURSOR] Trying to move to next box\n );
-
-// Move to next box
-mpEditView-SdrEndTextEdit();
-SdrTextObj *pNextLink = mpTextObj-GetNextLinkInChain();
-mpEditView-SdrBeginTextEdit(pNextLink);
-bHandled = true;
-}
+*pOutCursorEvt = CursorChainingEvent::NULL_EVENT;
+return;
+}
 
+sal_uInt16 nCode = rKEvt.GetKeyCode().GetCode();
+ESelection aCurSel = pOLV-GetSelection();
+
+sal_Int32 nLastPara = pOutl-GetParagraphCount()-1;
+OUString aLastParaText = pOutl-GetText(pOutl-GetParagraph(nLastPara));
+sal_Int32 nLastParaLen = aLastParaText.getLength();
+
+bool bAtEndOfTextContent =
+(aCurSel.nEndPara == nLastPara) 
+(aCurSel.nEndPos == nLastParaLen);
+
+if (nCode == KEY_RIGHT  bAtEndOfTextContent)
+{
+*pOutCursorEvt = CursorChainingEvent::TO_NEXT_LINK;
+// Selection unchanged: we are at the beginning of the box
 }
-return bHandled;
+
+// if (nCode == KEY_LEFT

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

2015-07-23 Thread matteocam
 include/svx/textchain.hxx   |8 
 svx/source/svdraw/svdotext.cxx  |   18 +++---
 svx/source/svdraw/textchain.cxx |   26 --
 3 files changed, 27 insertions(+), 25 deletions(-)

New commits:
commit 03941b5adfa468372983331f39b9fabb962d5616
Author: matteocam matteo.campane...@gmail.com
Date:   Thu Jul 23 19:26:03 2015 +0200

Move implementation of next link in TextChain

Change-Id: If511e1d64af34d85470f1de5c43cbfb72651179e

diff --git a/include/svx/textchain.hxx b/include/svx/textchain.hxx
index ad929ed..41f0fc8 100644
--- a/include/svx/textchain.hxx
+++ b/include/svx/textchain.hxx
@@ -140,8 +140,8 @@ class TextChain {
 void AppendLink(SdrTextObj *);
 bool IsLinkInChain(SdrTextObj *) const;
 
-SdrTextObj *GetNextLink(SdrTextObj *) const;
-SdrTextObj *GetPrevLink(SdrTextObj *) const;
+SdrTextObj *GetNextLink(const SdrTextObj *) const;
+SdrTextObj *GetPrevLink(const SdrTextObj *) const;
 
 ChainLinkId GetId(const SdrTextObj *) const;
 ImpChainLinkProperties *GetLinkProperties(const SdrTextObj *);
@@ -160,8 +160,8 @@ class TextChain {
 LinkPropertiesMap maLinkPropertiesMap;
 
 private:
-SdrTextObj *impGetNextLink(SdrTextObj *) const;
-SdrTextObj *impGetPrevLink(SdrTextObj *) const;
+SdrTextObj *impGetNextLink(const SdrTextObj *) const;
+SdrTextObj *impGetPrevLink(const SdrTextObj *) const;
 
 
 };
diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx
index f315d01..35b481b 100644
--- a/svx/source/svdraw/svdotext.cxx
+++ b/svx/source/svdraw/svdotext.cxx
@@ -2082,22 +2082,10 @@ void SdrTextObj::SetObjectItemNoBroadcast(const 
SfxPoolItem rItem)
 
 SdrTextObj* SdrTextObj::GetNextLinkInChain() const
 {
-/* FIXME(matteocam) return mpNextInChain; */
-SdrTextObj *pNextTextObj = NULL;
-
-if ( pPage  pPage-GetObjCount()  1) {
-
-sal_uInt32 nextIndex = (GetOrdNum()+1);
-
-if (nextIndex  pPage-GetObjCount())
-pNextTextObj =  dynamic_cast SdrTextObj * ( pPage-GetObj( 
nextIndex ) );
-
-return pNextTextObj;
-} else {
-fprintf(stderr, Make New Object please\n);
-return NULL;
-}
+if (GetTextChain())
+return GetTextChain()-GetNextLink(this);
 
+return NULL;
 }
 
 SdrTextObj* SdrTextObj::GetPrevLinkInChain() const
diff --git a/svx/source/svdraw/textchain.cxx b/svx/source/svdraw/textchain.cxx
index 787b298..31ea1fd 100644
--- a/svx/source/svdraw/textchain.cxx
+++ b/svx/source/svdraw/textchain.cxx
@@ -19,6 +19,7 @@
 
 #include svx/textchain.hxx
 #include svx/svdotext.hxx
+#include svx/svdpage.hxx
 
 /*
  * Definition of Properties Interface
@@ -55,23 +56,36 @@ void TextChain::AppendLink(SdrTextObj *)
 // XXX
 }
 
-SdrTextObj *TextChain::GetNextLink(SdrTextObj *pTextObj) const
+SdrTextObj *TextChain::GetNextLink(const SdrTextObj *pTextObj) const
 {
 return impGetNextLink(pTextObj);
 }
 
-SdrTextObj *TextChain::GetPrevLink(SdrTextObj *pTextObj) const
+SdrTextObj *TextChain::GetPrevLink(const SdrTextObj *pTextObj) const
 {
 return impGetPrevLink(pTextObj);
 }
 
-SdrTextObj *TextChain::impGetNextLink(SdrTextObj *pTextObj) const
+SdrTextObj *TextChain::impGetNextLink(const SdrTextObj *pTextObj) const
 {
-// XXX: To be implemented
-return NULL;
+SdrTextObj *pNextTextObj = NULL;
+SdrPage *pPage = pTextObj-pPage;
+
+if ( pPage  pPage-GetObjCount()  1) {
+
+sal_uInt32 nextIndex = (pTextObj-GetOrdNum()+1);
+
+if (nextIndex  pPage-GetObjCount())
+pNextTextObj =  dynamic_cast SdrTextObj * ( pPage-GetObj( 
nextIndex ) );
+
+return pNextTextObj;
+} else {
+fprintf(stderr, Make New Object please\n);
+return NULL;
+}
 }
 
-SdrTextObj *TextChain::impGetPrevLink(SdrTextObj *pTextObj) const
+SdrTextObj *TextChain::impGetPrevLink(const SdrTextObj *pTextObj) const
 {
 // XXX: To be implemented
 return 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' - svx/source

2015-07-23 Thread matteocam
 svx/source/svdraw/svdotext.cxx  |4 +++-
 svx/source/svdraw/textchain.cxx |3 ++-
 2 files changed, 5 insertions(+), 2 deletions(-)

New commits:
commit 5d33723afcd4d03120965dc8364dd795a558e370
Author: matteocam matteo.campane...@gmail.com
Date:   Thu Jul 23 19:29:07 2015 +0200

Move (prototype) implementation of prev link in TextChain

Change-Id: I1fab18b994f807d9d1e025f7be274df8dcec8eaf

diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx
index 35b481b..83bd15d 100644
--- a/svx/source/svdraw/svdotext.cxx
+++ b/svx/source/svdraw/svdotext.cxx
@@ -2090,7 +2090,9 @@ SdrTextObj* SdrTextObj::GetNextLinkInChain() const
 
 SdrTextObj* SdrTextObj::GetPrevLinkInChain() const
 {
-// FIXME: To be implemented
+if (GetTextChain())
+return GetTextChain()-GetPrevLink(this);
+
 return NULL;
 }
 
diff --git a/svx/source/svdraw/textchain.cxx b/svx/source/svdraw/textchain.cxx
index 31ea1fd..b70 100644
--- a/svx/source/svdraw/textchain.cxx
+++ b/svx/source/svdraw/textchain.cxx
@@ -68,6 +68,8 @@ SdrTextObj *TextChain::GetPrevLink(const SdrTextObj 
*pTextObj) const
 
 SdrTextObj *TextChain::impGetNextLink(const SdrTextObj *pTextObj) const
 {
+// XXX: Temporary implementation based on index number
+
 SdrTextObj *pNextTextObj = NULL;
 SdrPage *pPage = pTextObj-pPage;
 
@@ -87,7 +89,6 @@ SdrTextObj *TextChain::impGetNextLink(const SdrTextObj 
*pTextObj) const
 
 SdrTextObj *TextChain::impGetPrevLink(const SdrTextObj *pTextObj) const
 {
-// XXX: To be implemented
 return 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' - svx/source

2015-07-23 Thread matteocam
 svx/source/svdraw/textchain.cxx |   16 +++-
 1 file changed, 15 insertions(+), 1 deletion(-)

New commits:
commit 3a0aa8f6dd052e55860cd992dbb7bed24d346445
Author: matteocam matteo.campane...@gmail.com
Date:   Thu Jul 23 20:23:44 2015 +0200

Write implementation of prev link accessor

Change-Id: I5b66071e00a4edbeb67447938c98d9fcd92158b6

diff --git a/svx/source/svdraw/textchain.cxx b/svx/source/svdraw/textchain.cxx
index b70..86357c2 100644
--- a/svx/source/svdraw/textchain.cxx
+++ b/svx/source/svdraw/textchain.cxx
@@ -89,7 +89,21 @@ SdrTextObj *TextChain::impGetNextLink(const SdrTextObj 
*pTextObj) const
 
 SdrTextObj *TextChain::impGetPrevLink(const SdrTextObj *pTextObj) const
 {
-return NULL;
+SdrTextObj *pNextTextObj = NULL;
+SdrPage *pPage = pTextObj-pPage;
+
+if ( pPage  pPage-GetObjCount()  1) {
+
+sal_uInt32 nextIndex = (pTextObj-GetOrdNum()-1);
+
+if (nextIndex  0)
+pNextTextObj =  dynamic_cast SdrTextObj * ( pPage-GetObj( 
nextIndex ) );
+
+return pNextTextObj;
+} else {
+fprintf(stderr, Make New Object please\n);
+return 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' - include/svx svx/Library_svxcore.mk svx/source

2015-07-23 Thread matteocam
 include/svx/textchaincursor.hxx   |6 ++
 svx/Library_svxcore.mk|1 +
 svx/source/svdraw/textchaincursor.cxx |1 +
 3 files changed, 8 insertions(+)

New commits:
commit 8cc7337e404f0365c52ca86f2e9c7642255e5752
Author: matteocam matteo.campane...@gmail.com
Date:   Thu Jul 23 20:45:15 2015 +0200

Add textchaincursor files

Change-Id: I1d6d5004ee1d5979dd4227141cf7544240399a4f

diff --git a/include/svx/textchaincursor.hxx b/include/svx/textchaincursor.hxx
new file mode 100644
index 000..0e6c127
--- /dev/null
+++ b/include/svx/textchaincursor.hxx
@@ -0,0 +1,6 @@
+
+
+class TextChainCursorHandler
+{
+
+};
diff --git a/svx/Library_svxcore.mk b/svx/Library_svxcore.mk
index 22ce1a3..dc90153 100644
--- a/svx/Library_svxcore.mk
+++ b/svx/Library_svxcore.mk
@@ -341,6 +341,7 @@ $(eval $(call gb_Library_add_exception_objects,svxcore,\
 svx/source/svdraw/svdxcgv \
 svx/source/svdraw/textchain \
 svx/source/svdraw/textchainflow \
+svx/source/svdraw/textchaincursor \
 svx/source/styles/CommonStylePreviewRenderer \
 svx/source/styles/CommonStyleManager \
 svx/source/table/cell \
diff --git a/svx/source/svdraw/textchaincursor.cxx 
b/svx/source/svdraw/textchaincursor.cxx
new file mode 100644
index 000..8b13789
--- /dev/null
+++ b/svx/source/svdraw/textchaincursor.cxx
@@ -0,0 +1 @@
+
___
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' - include/svx svx/source

2015-07-23 Thread matteocam
 include/svx/textchaincursor.hxx   |   29 -
 svx/source/svdraw/svdedxv.cxx |4 ++--
 svx/source/svdraw/textchaincursor.cxx |   26 ++
 3 files changed, 56 insertions(+), 3 deletions(-)

New commits:
commit f21494386f8a40fdd82511fb7204284a2f16cdf2
Author: matteocam matteo.campane...@gmail.com
Date:   Thu Jul 23 20:49:31 2015 +0200

Prototype textchaincursor files

Change-Id: Icf93a63f51cae31c804f4ab247e577f5a5deca77

diff --git a/include/svx/textchaincursor.hxx b/include/svx/textchaincursor.hxx
index 0e6c127..71dbc60 100644
--- a/include/svx/textchaincursor.hxx
+++ b/include/svx/textchaincursor.hxx
@@ -1,6 +1,33 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ *   Licensed to the Apache Software Foundation (ASF) under one or more
+ *   contributor license agreements. See the NOTICE file distributed
+ *   with this work for additional information regarding copyright
+ *   ownership. The ASF licenses this file to you under the Apache
+ *   License, Version 2.0 (the License); you may not use this file
+ *   except in compliance with the License. You may obtain a copy of
+ *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_SVX_TEXTCHAINCURSOR_HXX
+#define INCLUDED_SVX_TEXTCHAINCURSOR_HXX
 
 
 class TextChainCursorHandler
 {
-
+TextChainCursorHandler();
 };
+
+
+#endif // INCLUDED_SVX_TEXTCHAINCURSOR_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+
diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index 59b5fd4..180ae2e 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -1317,9 +1317,9 @@ bool 
SdrObjEditView::ImpHandleMotionThroughBoxesKeyInput(const KeyEvent rKEvt,
 SdrTextObj *pNextLink = pTextObj-GetNextLinkInChain();
 SdrBeginTextEdit(pNextLink);
 bHandled = true;
-} // else if (...)
+}
 
-// XXX: Careful with the checks below for pWin and co. You should do 
them here I guess.
+// XXX: Careful with the checks below (in KeyInput) for pWin and co. 
You should do them here I guess.
 
 }
 
diff --git a/svx/source/svdraw/textchaincursor.cxx 
b/svx/source/svdraw/textchaincursor.cxx
index 8b13789..45f8533 100644
--- a/svx/source/svdraw/textchaincursor.cxx
+++ b/svx/source/svdraw/textchaincursor.cxx
@@ -1 +1,27 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ *   Licensed to the Apache Software Foundation (ASF) under one or more
+ *   contributor license agreements. See the NOTICE file distributed
+ *   with this work for additional information regarding copyright
+ *   ownership. The ASF licenses this file to you under the Apache
+ *   License, Version 2.0 (the License); you may not use this file
+ *   except in compliance with the License. You may obtain a copy of
+ *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
 
+#include svx/textchaincursor.hxx
+
+TextChainCursorHandler::TextChainCursorHandler()
+{
+
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
___
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' - .gitignore include/svx svx/source

2015-07-23 Thread matteocam
 .gitignore  |9 +
 include/svx/textchain.hxx   |8 
 svx/source/svdraw/textchain.cxx |   22 --
 3 files changed, 37 insertions(+), 2 deletions(-)

New commits:
commit 6c4e8f7c160986fef5c8c2ccd1c0c22a6b620dd8
Author: matteocam matteo.campane...@gmail.com
Date:   Thu Jul 23 19:04:44 2015 +0200

Declare link accessors in TextChain

Change-Id: I2c8cc929a667f9cc59c5ec5217a2c27ca15beb2d

diff --git a/.gitignore b/.gitignore
index 6f7b854..72e65e6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -129,3 +129,12 @@ DerivedData
 # gdb config
 /.gdbinit
 /.gdb_history
+
+# Personal scripts and text
+bpoints
+core
+makeWithDebug.sh
+papercuts.txt
+startDbg.sh
+startTest.sh
+
diff --git a/include/svx/textchain.hxx b/include/svx/textchain.hxx
index 91fdef8..ad929ed 100644
--- a/include/svx/textchain.hxx
+++ b/include/svx/textchain.hxx
@@ -139,7 +139,9 @@ class TextChain {
 
 void AppendLink(SdrTextObj *);
 bool IsLinkInChain(SdrTextObj *) const;
+
 SdrTextObj *GetNextLink(SdrTextObj *) const;
+SdrTextObj *GetPrevLink(SdrTextObj *) const;
 
 ChainLinkId GetId(const SdrTextObj *) const;
 ImpChainLinkProperties *GetLinkProperties(const SdrTextObj *);
@@ -156,6 +158,12 @@ class TextChain {
 
 protected:
 LinkPropertiesMap maLinkPropertiesMap;
+
+private:
+SdrTextObj *impGetNextLink(SdrTextObj *) const;
+SdrTextObj *impGetPrevLink(SdrTextObj *) const;
+
+
 };
 
 #endif // INCLUDED_SVX_TEXTCHAIN_HXX
diff --git a/svx/source/svdraw/textchain.cxx b/svx/source/svdraw/textchain.cxx
index 25b75ae..787b298 100644
--- a/svx/source/svdraw/textchain.cxx
+++ b/svx/source/svdraw/textchain.cxx
@@ -55,11 +55,29 @@ void TextChain::AppendLink(SdrTextObj *)
 // XXX
 }
 
-SdrTextObj *TextChain::GetNextLink(SdrTextObj *) const
+SdrTextObj *TextChain::GetNextLink(SdrTextObj *pTextObj) const
 {
-return NULL; // XXX: To be changed. It'd be a mess to implement now
+return impGetNextLink(pTextObj);
 }
 
+SdrTextObj *TextChain::GetPrevLink(SdrTextObj *pTextObj) const
+{
+return impGetPrevLink(pTextObj);
+}
+
+SdrTextObj *TextChain::impGetNextLink(SdrTextObj *pTextObj) const
+{
+// XXX: To be implemented
+return NULL;
+}
+
+SdrTextObj *TextChain::impGetPrevLink(SdrTextObj *pTextObj) const
+{
+// XXX: To be implemented
+return NULL;
+}
+
+
 ImpChainLinkProperties *TextChain::GetLinkProperties(const SdrTextObj *pLink)
 {
 // if the guy does not already have properties in the map make them
___
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 include/editeng svx/source

2015-07-20 Thread matteocam
 editeng/source/outliner/outlvw.cxx |1 +
 include/editeng/outliner.hxx   |1 +
 svx/source/svdraw/svdedxv.cxx  |5 -
 3 files changed, 6 insertions(+), 1 deletion(-)

New commits:
commit cd87130df7a95691e2e73af0076b02f6a6143cf4
Author: matteocam matteo.campane...@gmail.com
Date:   Mon Jul 20 14:46:10 2015 -0400

Call chaining handling from end-of-paste handler

Change-Id: I4b11d98558d2deb6fb4465eb98b383d5a5f5f0c9

diff --git a/editeng/source/outliner/outlvw.cxx 
b/editeng/source/outliner/outlvw.cxx
index 1a9e10b..88c6d10 100644
--- a/editeng/source/outliner/outlvw.cxx
+++ b/editeng/source/outliner/outlvw.cxx
@@ -706,6 +706,7 @@ void OutlinerView::PasteSpecial()
 pOwner-UndoActionEnd( OLUNDO_INSERT );
 pEditView-ShowCursor( true, true );
 }
+
 }
 
 void OutlinerView::CreateSelectionList (std::vectorParagraph* aSelList)
diff --git a/include/editeng/outliner.hxx b/include/editeng/outliner.hxx
index dcdc3db..e1a4c91 100644
--- a/include/editeng/outliner.hxx
+++ b/include/editeng/outliner.hxx
@@ -215,6 +215,7 @@ private:
 EDITENG_DLLPRIVATE void ImpPasted( sal_Int32 nStart, sal_Int32 
nPrevParaCount, sal_Int32 nSize);
 EDITENG_DLLPRIVATE sal_Int32ImpCalcSelectedPages( bool 
bIncludeFirstSelected );
 
+
 public:
 OutlinerView( Outliner* pOut, vcl::Window* pWindow );
 virtual ~OutlinerView();
diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index 3ac3c1e..774c974 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -1294,7 +1294,6 @@ bool SdrObjEditView::KeyInput(const KeyEvent rKEvt, 
vcl::Window* pWin)
 ESelection aCurSel = pTextEditOutlinerView-GetSelection();
 
 
-
 SdrTextObj* pTextObj = NULL;
 if (mxTextEditObj.is())
 pTextObj= dynamic_castSdrTextObj*(mxTextEditObj.get());
@@ -1341,8 +1340,10 @@ bool SdrObjEditView::KeyInput(const KeyEvent rKEvt, 
vcl::Window* pWin)
 }
 
 // FIXME(matteocam)
+// Start chaining processing
 ImpChainingEventHdl(NULL);
 ImpMoveCursorAfterChainingEvent();
+// End chaining processing
 
 if (pWin!=NULL  pWin!=pTextEditWin) SetTextEditWin(pWin);
 #ifdef DBG_UTIL
@@ -2036,6 +2037,8 @@ void SdrObjEditView::OnBeginPasteOrDrop( 
PasteOrDropInfos* )
 void SdrObjEditView::OnEndPasteOrDrop( PasteOrDropInfos* )
 {
 // applications can derive from these virtual methods to do something 
before a drop or paste operation
+ImpChainingEventHdl(NULL);
+
 }
 
 sal_uInt16 SdrObjEditView::GetSelectionLevel() const
___
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 - include/svx svx/source

2015-07-20 Thread matteocam
 include/svx/svdedxv.hxx|1 
 include/svx/svdotext.hxx   |3 +
 svx/source/svdraw/svdedxv.cxx  |   81 +
 svx/source/svdraw/svdotext.cxx |6 +++
 4 files changed, 52 insertions(+), 39 deletions(-)

New commits:
commit fc94131416c9fd5a7c95dc8b7f076d75282ae38f
Author: matteocam matteo.campane...@gmail.com
Date:   Mon Jul 20 15:04:17 2015 -0400

Separated code for cursor motion with arrow keys

Change-Id: I3184929219306b68599d1bd3efffa2f7def0c572

diff --git a/include/svx/svdedxv.hxx b/include/svx/svdedxv.hxx
index 0f9de4d..d45a12f 100644
--- a/include/svx/svdedxv.hxx
+++ b/include/svx/svdedxv.hxx
@@ -111,6 +111,7 @@ protected:
 OutlinerView* ImpFindOutlinerView(vcl::Window* pWin) const;
 
 void ImpMoveCursorAfterChainingEvent();
+bool ImpHandleMotionThroughBoxesKeyInput(const KeyEvent rKEvt, 
vcl::Window* pWin);
 
 // Create a new OutlinerView at the heap and initialize all required 
parameters.
 // pTextEditObj, pTextEditPV and pTextEditOutliner have to be initialized
diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index 774c974..ab70471 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -1280,54 +1280,59 @@ bool SdrObjEditView::IsTextEditFrameHit(const Point 
rHit) const
 return bOk;
 }
 
-
-
-bool SdrObjEditView::KeyInput(const KeyEvent rKEvt, vcl::Window* pWin)
+bool SdrObjEditView::ImpHandleMotionThroughBoxesKeyInput(const KeyEvent 
rKEvt, vcl::Window* pWin)
 {
-if(pTextEditOutlinerView)
-{
-// XXX: Find a clean way to do this (even cleaner than the code 
commented below)
-// if( pTextEditOutlinerView-IsKeyEventPushingOutOfPage(rKevt, pWin)
-//   pWin = HandleKeyPushingOutOfBox(rKevt);
-KeyFuncType eFunc = rKEvt.GetKeyCode().GetFunction();
-sal_uInt16 nCode = rKEvt.GetKeyCode().GetCode();
-ESelection aCurSel = pTextEditOutlinerView-GetSelection();
+// XXX: Find a clean way to do this (even cleaner than the code commented 
below)
+// if( pTextEditOutlinerView-IsKeyEventPushingOutOfPage(rKevt, pWin)
+//   pWin = HandleKeyPushingOutOfBox(rKevt);
+KeyFuncType eFunc = rKEvt.GetKeyCode().GetFunction();
+sal_uInt16 nCode = rKEvt.GetKeyCode().GetCode();
+ESelection aCurSel = pTextEditOutlinerView-GetSelection();
 
 
-SdrTextObj* pTextObj = NULL;
-if (mxTextEditObj.is())
-pTextObj= dynamic_castSdrTextObj*(mxTextEditObj.get());
+SdrTextObj* pTextObj = NULL;
+if (mxTextEditObj.is())
+pTextObj= dynamic_castSdrTextObj*(mxTextEditObj.get());
 
-bool bHandled = false;
+bool bHandled = false;
 
-// XXX: Add check for last position in the para
-if (pTextObj  pTextObj-IsChainable()  
pTextObj-GetNextLinkInChain() 
-eFunc ==  KeyFuncType::DONTKNOW)
+// XXX: Add check for last position in the para
+if (pTextObj  pTextObj-IsChainable()  pTextObj-GetNextLinkInChain() 

+eFunc ==  KeyFuncType::DONTKNOW)
+{
+SdrOutliner *pOutl = GetTextEditOutliner();
+sal_Int32 nLastPara = pOutl-GetParagraphCount()-1;
+OUString aLastParaText = 
pOutl-GetText(pOutl-GetParagraph(nLastPara));
+sal_Int32 nLastParaLen = aLastParaText.getLength();
+
+if (nCode == KEY_RIGHT 
+aCurSel.nEndPara == nLastPara 
+aCurSel.nEndPos == nLastParaLen
+)
 {
-SdrOutliner *pOutl = GetTextEditOutliner();
-sal_Int32 nLastPara = pOutl-GetParagraphCount()-1;
-OUString aLastParaText = 
pOutl-GetText(pOutl-GetParagraph(nLastPara));
-sal_Int32 nLastParaLen = aLastParaText.getLength();
-
-if (nCode == KEY_RIGHT 
-aCurSel.nEndPara == nLastPara 
-aCurSel.nEndPos == nLastParaLen
-)
-{
-fprintf(stderr, [CHAIN - CURSOR] Trying to move to next 
box\n );
+fprintf(stderr, [CHAIN - CURSOR] Trying to move to next box\n );
 
-// Move to next box
-SdrEndTextEdit();
-SdrTextObj *pNextLink = pTextObj-GetNextLinkInChain();
-SdrBeginTextEdit(pNextLink);
-bHandled = true;
-} // else if (...)
+// Move to next box
+SdrEndTextEdit();
+SdrTextObj *pNextLink = pTextObj-GetNextLinkInChain();
+SdrBeginTextEdit(pNextLink);
+bHandled = true;
+} // else if (...)
 
-// XXX: Careful with the checks below for pWin and co. You should 
do them here I guess.
+// XXX: Careful with the checks below for pWin and co. You should do 
them here I guess.
 
-}
+}
+
+return bHandled;
+
+}
 
-if (bHandled)
+bool SdrObjEditView::KeyInput(const KeyEvent rKEvt, vcl::Window* pWin)
+{
+if(pTextEditOutlinerView)
+{
+// We possibly move

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

2015-07-20 Thread matteocam
 include/editeng/outliner.hxx  |3 +++
 svx/source/svdraw/svdedxv.cxx |1 -
 2 files changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 7345db6146fbcfc14f8041d10a5410c804a0a58b
Author: matteocam matteo.campane...@gmail.com
Date:   Mon Jul 20 16:11:27 2015 -0400

Add end paste hdl for OutlView. Remove SdrObjEditView hdl

Change-Id: Ia75f3246a651dbc4f8cd621dc1a72603c13a6ebf

diff --git a/include/editeng/outliner.hxx b/include/editeng/outliner.hxx
index e1a4c91..74c9f72 100644
--- a/include/editeng/outliner.hxx
+++ b/include/editeng/outliner.hxx
@@ -215,6 +215,7 @@ private:
 EDITENG_DLLPRIVATE void ImpPasted( sal_Int32 nStart, sal_Int32 
nPrevParaCount, sal_Int32 nSize);
 EDITENG_DLLPRIVATE sal_Int32ImpCalcSelectedPages( bool 
bIncludeFirstSelected );
 
+Link aEndPasteLink;
 
 public:
 OutlinerView( Outliner* pOut, vcl::Window* pWindow );
@@ -374,6 +375,8 @@ public:
 
 OUStringGetSurroundingText() const;
 Selection   GetSurroundingTextSelection() const;
+
+voidSetEndPasteLinkHdl(const Link rLink) { aEndPasteLink = 
rLink; }
 };
 
 
diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index ab70471..59b5fd4 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -2042,7 +2042,6 @@ void SdrObjEditView::OnBeginPasteOrDrop( 
PasteOrDropInfos* )
 void SdrObjEditView::OnEndPasteOrDrop( PasteOrDropInfos* )
 {
 // applications can derive from these virtual methods to do something 
before a drop or paste operation
-ImpChainingEventHdl(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' - 12 commits - editeng/source include/svx svx/source

2015-07-16 Thread matteocam
 editeng/source/outliner/overflowingtxt.cxx |4 +--
 include/svx/textchain.hxx  |2 -
 svx/source/svdraw/svdedxv.cxx  |   28 +++
 svx/source/svdraw/svdotext.cxx |2 -
 svx/source/svdraw/textchainflow.cxx|   30 +++--
 5 files changed, 48 insertions(+), 18 deletions(-)

New commits:
commit 8a370da33bbca5ecdb8c8d0551625f7bc843af8d
Author: matteocam matteo.campane...@gmail.com
Date:   Wed Jul 15 17:27:05 2015 -0400

Right arrow at last para moves to next link

Change-Id: Ic7e567d3d3120e0f8e2860cb90aa855dc68f760d

diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index e708471..4f857fc 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -1296,13 +1296,24 @@ bool SdrObjEditView::KeyInput(const KeyEvent rKEvt, 
vcl::Window* pWin)
 SdrOutliner *pOutl = GetTextEditOutliner();
 sal_Int32 nLastPara = pOutl-GetParagraphCount()-1;
 
-if (eFunc ==  KeyFuncType::DONTKNOW  nCode == KEY_RIGHT  
aCurSel.nEndPara == nLastPara) {
+SdrTextObj* pTextObj = NULL;
+if (mxTextEditObj.is())
+pTextObj= dynamic_castSdrTextObj*(mxTextEditObj.get());
+
+// XXX: Add check for last position in the para
+if (pTextObj  pTextObj-IsChainable()  
pTextObj-GetNextLinkInChain() 
+eFunc ==  KeyFuncType::DONTKNOW  nCode == KEY_RIGHT  
aCurSel.nEndPara == nLastPara) {
 fprintf(stderr, [CHAIN - CURSOR] Trying to move to next box\n );
 
+// Move to next box
+SdrEndTextEdit();
+SdrTextObj *pNextLink = pTextObj-GetNextLinkInChain();
+SdrBeginTextEdit(pNextLink);
+
 // XXX: Careful with the checks below for pWin and co. You should 
do them here I guess.
 return true;
 } else
-// Old code from here
+// FIXME(matteocam): Old code from here
 if (pTextEditOutlinerView-PostKeyEvent(rKEvt, pWin))
 {
 if( pMod )
commit 733cd3bb573e7904f565b0ad071d3b133b429dae
Author: matteocam matteo.campane...@gmail.com
Date:   Wed Jul 15 17:19:22 2015 -0400

First experiment with right arrow key to move to next link

Change-Id: If2c67ec0a8f87ba05098abeeaea72237d648257d

diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index 4bbb28d..e708471 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -1286,6 +1286,23 @@ bool SdrObjEditView::KeyInput(const KeyEvent rKEvt, 
vcl::Window* pWin)
 {
 if(pTextEditOutlinerView)
 {
+// XXX: Find a clean way to do this (even cleaner than the code 
commented below)
+// if( pTextEditOutlinerView-IsKeyEventPushingOutOfPage(rKevt, pWin)
+//   pWin = HandleKeyPushingOutOfBox(rKevt);
+KeyFuncType eFunc = rKEvt.GetKeyCode().GetFunction();
+sal_uInt16 nCode = rKEvt.GetKeyCode().GetCode();
+ESelection aCurSel = pTextEditOutlinerView-GetSelection();
+
+SdrOutliner *pOutl = GetTextEditOutliner();
+sal_Int32 nLastPara = pOutl-GetParagraphCount()-1;
+
+if (eFunc ==  KeyFuncType::DONTKNOW  nCode == KEY_RIGHT  
aCurSel.nEndPara == nLastPara) {
+fprintf(stderr, [CHAIN - CURSOR] Trying to move to next box\n );
+
+// XXX: Careful with the checks below for pWin and co. You should 
do them here I guess.
+return true;
+} else
+// Old code from here
 if (pTextEditOutlinerView-PostKeyEvent(rKEvt, pWin))
 {
 if( pMod )
commit 23e5c185b473ad6bb9fd4711b39a786872fef569
Author: matteocam matteo.campane...@gmail.com
Date:   Wed Jul 15 16:51:10 2015 -0400

Revert Broadcast changed text in target link when in static mode

This reverts commit cae895d03aab6ffe719f331c90699e4b6238ac97.

diff --git a/svx/source/svdraw/textchainflow.cxx 
b/svx/source/svdraw/textchainflow.cxx
index d2667e9..4d6352f 100644
--- a/svx/source/svdraw/textchainflow.cxx
+++ b/svx/source/svdraw/textchainflow.cxx
@@ -204,7 +204,7 @@ void 
TextChainFlow::impLeaveOnlyNonOverflowingText(SdrOutliner *pNonOverflOutl)
 // adds it to current outliner anyway (useful in static decomposition)
 pNonOverflOutl-SetText(*pNewText);
 
-mpTargetLink-SetOutlinerParaObject(pNewText);
+mpTargetLink-NbcSetOutlinerParaObject(pNewText);
 // For some reason the paper size is lost after last instruction, so we 
set it.
 pNonOverflOutl-SetPaperSize(Size(pNonOverflOutl-GetPaperSize().Width(),
   pNonOverflOutl-GetTextHeight()));
commit cae895d03aab6ffe719f331c90699e4b6238ac97
Author: matteocam matteo.campane...@gmail.com
Date:   Wed Jul 15 16:50:10 2015 -0400

Broadcast changed text in target link when in static mode

Change-Id: I20e72cfedfb4d690586ceb1e0470c8bef7f0dd9a

diff --git a/svx/source/svdraw/textchainflow.cxx 
b/svx/source/svdraw

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

2015-07-16 Thread matteocam
 svx/source/svdraw/svdedxv.cxx |   36 +++-
 1 file changed, 27 insertions(+), 9 deletions(-)

New commits:
commit 7d8b0eb2f2df07d4f85cd750d7b229646a6d
Author: matteocam matteo.campane...@gmail.com
Date:   Thu Jul 16 23:21:50 2015 -0400

Move cursor if at end of box

Change-Id: I355ebd71b1627d08b7b0493960c0d0f1dcf55fe7

diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index 4f857fc..3ac3c1e 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -1293,26 +1293,44 @@ bool SdrObjEditView::KeyInput(const KeyEvent rKEvt, 
vcl::Window* pWin)
 sal_uInt16 nCode = rKEvt.GetKeyCode().GetCode();
 ESelection aCurSel = pTextEditOutlinerView-GetSelection();
 
-SdrOutliner *pOutl = GetTextEditOutliner();
-sal_Int32 nLastPara = pOutl-GetParagraphCount()-1;
+
 
 SdrTextObj* pTextObj = NULL;
 if (mxTextEditObj.is())
 pTextObj= dynamic_castSdrTextObj*(mxTextEditObj.get());
 
+bool bHandled = false;
+
 // XXX: Add check for last position in the para
 if (pTextObj  pTextObj-IsChainable()  
pTextObj-GetNextLinkInChain() 
-eFunc ==  KeyFuncType::DONTKNOW  nCode == KEY_RIGHT  
aCurSel.nEndPara == nLastPara) {
-fprintf(stderr, [CHAIN - CURSOR] Trying to move to next box\n );
+eFunc ==  KeyFuncType::DONTKNOW)
+{
+SdrOutliner *pOutl = GetTextEditOutliner();
+sal_Int32 nLastPara = pOutl-GetParagraphCount()-1;
+OUString aLastParaText = 
pOutl-GetText(pOutl-GetParagraph(nLastPara));
+sal_Int32 nLastParaLen = aLastParaText.getLength();
+
+if (nCode == KEY_RIGHT 
+aCurSel.nEndPara == nLastPara 
+aCurSel.nEndPos == nLastParaLen
+)
+{
+fprintf(stderr, [CHAIN - CURSOR] Trying to move to next 
box\n );
 
-// Move to next box
-SdrEndTextEdit();
-SdrTextObj *pNextLink = pTextObj-GetNextLinkInChain();
-SdrBeginTextEdit(pNextLink);
+// Move to next box
+SdrEndTextEdit();
+SdrTextObj *pNextLink = pTextObj-GetNextLinkInChain();
+SdrBeginTextEdit(pNextLink);
+bHandled = true;
+} // else if (...)
 
 // XXX: Careful with the checks below for pWin and co. You should 
do them here I guess.
+
+}
+
+if (bHandled)
 return true;
-} else
+
 // FIXME(matteocam): Old code from here
 if (pTextEditOutlinerView-PostKeyEvent(rKEvt, pWin))
 {
___
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' - svx/source

2015-07-14 Thread matteocam
 svx/source/svdraw/textchainflow.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 07690343de9fae1484b8fc0c1f8d2e1767b8e1be
Author: matteocam matteo.campane...@gmail.com
Date:   Tue Jul 14 17:34:05 2015 -0400

Underflow can overflow cursor

Change-Id: Iff8b9f76402a358bb9d90ad712e3a6ede897a6bb

diff --git a/svx/source/svdraw/textchainflow.cxx 
b/svx/source/svdraw/textchainflow.cxx
index fe4f9fc..20c26b6 100644
--- a/svx/source/svdraw/textchainflow.cxx
+++ b/svx/source/svdraw/textchainflow.cxx
@@ -128,7 +128,7 @@ void TextChainFlow::impUpdateCursorInfo()
 // XXX: Maybe we can get rid of mbOFisUFinduced by not allowing handling 
of more than one event by the same TextChainFlow
 // if this is not an OF triggered during an UF
 
-mbPossiblyCursorOut = bOverflow  !mbOFisUFinduced;
+mbPossiblyCursorOut = bOverflow /*  !mbOFisUFinduced */; // XXX: Not 
sure we need !mbOFisUFinduced
 if (mbPossiblyCursorOut) { // if this is false, mpOverflChText might be 
NULL
 maOverflowPosSel = ESelection(mpOverflChText-GetOverflowPointSel());
 // After the chaining event the cursor is where the text from the 
source box merged with the rest
@@ -206,6 +206,7 @@ void 
TextChainFlow::impLeaveOnlyNonOverflowingText(SdrOutliner *pNonOverflOutl)
 pNonOverflOutl-SetText(*pNewText);
 
 mpTargetLink-NbcSetOutlinerParaObject(pNewText);
+// For some reason the paper size is lost after last instruction, so we 
set it.
 pNonOverflOutl-SetPaperSize(Size(pNonOverflOutl-GetPaperSize().Width(),
   pNonOverflOutl-GetTextHeight()));
 
___
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' - svx/source

2015-07-14 Thread matteocam
 svx/source/svdraw/textchainflow.cxx |   10 --
 1 file changed, 4 insertions(+), 6 deletions(-)

New commits:
commit 3f5c5eb2942f8aa7e31401a302899cc492f17519
Author: matteocam matteo.campane...@gmail.com
Date:   Tue Jul 14 18:52:03 2015 -0400

Update postChainging position properly for both UF/OF

Change-Id: I1607338bcc0fd5938e383ec2f3df451c9f8d91a8

diff --git a/svx/source/svdraw/textchainflow.cxx 
b/svx/source/svdraw/textchainflow.cxx
index a6b8b1d..607a2d6 100644
--- a/svx/source/svdraw/textchainflow.cxx
+++ b/svx/source/svdraw/textchainflow.cxx
@@ -127,18 +127,16 @@ void TextChainFlow::impUpdateCursorInfo()
 
 mbPossiblyCursorOut = bOverflow;
 
-if (mbPossiblyCursorOut  !mbOFisUFinduced) { // if this is false, 
mpOverflChText might be NULL
-maOverflowPosSel = ESelection(mpOverflChText-GetOverflowPointSel());
-// After the chaining event the cursor is where the text from the 
source box merged with the rest
-maPostChainingSel = ESelection(mpOverflChText-GetInsertionPointSel());
-} else if(mbPossiblyCursorOut  mbOFisUFinduced) {
+if(mbPossiblyCursorOut ) {
 maOverflowPosSel = ESelection(mpOverflChText-GetOverflowPointSel());
 ESelection aSelAtUFTime = 
GetTextChain()-GetPreChainingSel(GetLinkTarget());
 // Might be an invalid selection if the cursor at UF time was before
-//   the (UF-induced) Overflowing point but we don't use it in that 
case
+//   the (possibly UF-induced) Overflowing point but we don't use it 
in that case
 maPostChainingSel = 
ESelection(aSelAtUFTime.nStartPara-maOverflowPosSel.nStartPara,

aSelAtUFTime.nStartPos-maOverflowPosSel.nStartPos );
 }
+
+// XXX: It may not be necessary anymore to keep this method separated from 
EditingTextChainFlow::impBroadcastCursorInfo
 }
 
 void TextChainFlow::CheckForFlowEvents(SdrOutliner *pFlowOutl)
___
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-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' - svx/source

2015-07-14 Thread matteocam
 svx/source/svdraw/textchainflow.cxx |   15 ++-
 1 file changed, 10 insertions(+), 5 deletions(-)

New commits:
commit 4ab9ea60c4f61e552d11c05ed42c1fa5da1107cb
Author: matteocam matteo.campane...@gmail.com
Date:   Tue Jul 14 18:28:20 2015 -0400

Translate postChaining position if UF occurs

Change-Id: I74c6d0bbef6dc6cee1fc6a561f6f487e9e3ccd64

diff --git a/svx/source/svdraw/textchainflow.cxx 
b/svx/source/svdraw/textchainflow.cxx
index 20c26b6..a6b8b1d 100644
--- a/svx/source/svdraw/textchainflow.cxx
+++ b/svx/source/svdraw/textchainflow.cxx
@@ -118,9 +118,6 @@ void TextChainFlow::impCheckForFlowEvents(SdrOutliner 
*pFlowOutl, SdrOutliner *p
 
 // To check whether an overflow is underflow induced or not (useful in 
cursor checking)
 mbOFisUFinduced = bUnderflow;
-
-
-
 }
 
 void TextChainFlow::impUpdateCursorInfo()
@@ -128,11 +125,19 @@ void TextChainFlow::impUpdateCursorInfo()
 // XXX: Maybe we can get rid of mbOFisUFinduced by not allowing handling 
of more than one event by the same TextChainFlow
 // if this is not an OF triggered during an UF
 
-mbPossiblyCursorOut = bOverflow /*  !mbOFisUFinduced */; // XXX: Not 
sure we need !mbOFisUFinduced
-if (mbPossiblyCursorOut) { // if this is false, mpOverflChText might be 
NULL
+mbPossiblyCursorOut = bOverflow;
+
+if (mbPossiblyCursorOut  !mbOFisUFinduced) { // if this is false, 
mpOverflChText might be NULL
 maOverflowPosSel = ESelection(mpOverflChText-GetOverflowPointSel());
 // After the chaining event the cursor is where the text from the 
source box merged with the rest
 maPostChainingSel = ESelection(mpOverflChText-GetInsertionPointSel());
+} else if(mbPossiblyCursorOut  mbOFisUFinduced) {
+maOverflowPosSel = ESelection(mpOverflChText-GetOverflowPointSel());
+ESelection aSelAtUFTime = 
GetTextChain()-GetPreChainingSel(GetLinkTarget());
+// Might be an invalid selection if the cursor at UF time was before
+//   the (UF-induced) Overflowing point but we don't use it in that 
case
+maPostChainingSel = 
ESelection(aSelAtUFTime.nStartPara-maOverflowPosSel.nStartPara,
+   
aSelAtUFTime.nStartPos-maOverflowPosSel.nStartPos );
 }
 }
 
___
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

2015-07-13 Thread matteocam
 editeng/source/outliner/overflowingtxt.cxx |   55 ++---
 1 file changed, 50 insertions(+), 5 deletions(-)

New commits:
commit 5694e32c7cbfb9079585502fae14ba7a583db999
Author: matteocam matteo.campane...@gmail.com
Date:   Mon Jul 13 14:53:14 2015 -0400

Add rough algorithm for deep merging. Not all attrbs saved.

Change-Id: I369f0e2c9e56e0257284a038bfe707dd37a88421

diff --git a/editeng/source/outliner/overflowingtxt.cxx 
b/editeng/source/outliner/overflowingtxt.cxx
index 6a73775..ecb69d3 100644
--- a/editeng/source/outliner/overflowingtxt.cxx
+++ b/editeng/source/outliner/overflowingtxt.cxx
@@ -54,18 +54,63 @@ OutlinerParaObject *impGetJuxtaposedParaObject(Outliner 
*pOutl,
 return pPObj;
 }
 
+// In a deep merge parts of text are not only juxtaposed but the last and 
first para become the same
 OutlinerParaObject *impGetDeeplyMergedParaObject(Outliner *pOutl,
OutlinerParaObject *pPObj1,
OutlinerParaObject *pPObj2)
-{ // XXX: For now just the same
-
+{
 assert(pOutl  pPObj1   pPObj2);
 
+const EditTextObject rTObj1 = pPObj1-GetTextObject();
+const EditTextObject rTObj2 = pPObj2-GetTextObject();
+sal_Int32 nParaCount1 = rTObj1.GetParagraphCount();
+
+// If no paras in the first text, just use second text
+if (nParaCount1 == 0) {
+pOutl-SetText(*pPObj2);
+return pOutl-CreateParaObject();
+}
+
+
+sal_Int32 nLastPara1 = nParaCount1 - 1;
+
+// If last para of first text is empty, discard it and just juxtapose
+if (rTObj1.GetText(nLastPara1) ==   nParaCount1 = 2) {
+pOutl-SetText(*pPObj1);
+return impGetJuxtaposedParaObject(
+pOutl,
+pOutl-CreateParaObject(0, nLastPara1 - 1),
+pPObj2);
+}
+
+/* --- Standard procedure: when pPObj1 is 'fine' --- */
+
+
+// Cut first para of second object
+OUString aFirstParaTxt2 = rTObj2.GetText(0);
+
+// Prepare remainder for text 2
+OutlinerParaObject *pRemainderPObj2 = NULL;
+if (rTObj2.GetParagraphCount()  1) {
+pOutl-SetText(*pPObj2);
+pRemainderPObj2 = pOutl-CreateParaObject(1); // from second para on
+} else { // No text to append
+pRemainderPObj2 = NULL;
+}
+
+// Set first object as text
 pOutl-SetText(*pPObj1);
-pOutl-AddText(*pPObj2);
-OutlinerParaObject *pPObj = pOutl-CreateParaObject();
 
-return pPObj;
+// Merges LastPara(pPObj1) with FirstPara(pPObj2)
+Paragraph *pLastPara1 = pOutl-GetParagraph(nLastPara1);
+OUString aLastParaTxt1 = pOutl-GetText(pLastPara1);
+pOutl-SetText(aLastParaTxt1 + aFirstParaTxt2, pLastPara1); // XXX: This 
way it screws up attributes!
+
+// add the remainder of the second text
+if (pRemainderPObj2)
+pOutl-AddText(*pRemainderPObj2);
+
+return pOutl-CreateParaObject();
 }
 
 // class OverflowingText
___
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

2015-07-13 Thread matteocam
 editeng/source/outliner/outliner.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 7aae39ef5679db0299c34095781187546cbedff2
Author: matteocam matteo.campane...@gmail.com
Date:   Mon Jul 13 15:12:48 2015 -0400

Fix wrong definition of bLastParaIsInterrupted

Change-Id: Ib0b65afa6c44e9b6b83c2acef5044d8cd3182a00

diff --git a/editeng/source/outliner/outliner.cxx 
b/editeng/source/outliner/outliner.cxx
index a8e5be0..148efa7 100644
--- a/editeng/source/outliner/outliner.cxx
+++ b/editeng/source/outliner/outliner.cxx
@@ -2161,9 +2161,9 @@ NonOverflowingText *Outliner::GetNonOverflowingText() 
const
 }
 EditTextObject *pTObj = 
pEditEngine-CreateTextObject(aNonOverflowingTextSelection);
 
-sal_Int32 nLastLine = GetLineCount(nOverflowingPara)-1;
+//sal_Int32 nLastLine = GetLineCount(nOverflowingPara)-1;
 bool bLastParaInterrupted =
-pEditEngine-GetOverflowingLineNum()  nLastLine;
+pEditEngine-GetOverflowingLineNum()  0;
 
 return new NonOverflowingText(pTObj, bLastParaInterrupted);
 }
___
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 include/editeng

2015-07-13 Thread matteocam
 editeng/source/outliner/overflowingtxt.cxx |   78 +++--
 include/editeng/overflowingtxt.hxx |3 +
 2 files changed, 65 insertions(+), 16 deletions(-)

New commits:
commit d35ecc609fa55835f3942656dcd9330c24dc4521
Author: matteocam matteo.campane...@gmail.com
Date:   Mon Jul 13 14:08:00 2015 -0400

Add impGetDeeplyMergedParaObject. But with juxtaposition semantics

Change-Id: Idd8d8d39d7ddabc9bdfe416250c6611b21f74e11

diff --git a/editeng/source/outliner/overflowingtxt.cxx 
b/editeng/source/outliner/overflowingtxt.cxx
index eb6bfe5..6a73775 100644
--- a/editeng/source/outliner/overflowingtxt.cxx
+++ b/editeng/source/outliner/overflowingtxt.cxx
@@ -26,7 +26,7 @@
 #include editeng/editobj.hxx
 
 
-// Helper function for *OverflowingText classes
+/* Helper functions for *OverflowingText classes  */
 
 ESelection getLastPositionSel(const EditTextObject *pTObj)
 {
@@ -40,6 +40,34 @@ ESelection getLastPositionSel(const EditTextObject *pTObj)
 return aEndPos;
 }
 
+// Put a para next to each other in the same OutlinerParaObject
+OutlinerParaObject *impGetJuxtaposedParaObject(Outliner *pOutl,
+   OutlinerParaObject *pPObj1,
+   OutlinerParaObject *pPObj2)
+{
+assert(pOutl  pPObj1   pPObj2);
+
+pOutl-SetText(*pPObj1);
+pOutl-AddText(*pPObj2);
+OutlinerParaObject *pPObj = pOutl-CreateParaObject();
+
+return pPObj;
+}
+
+OutlinerParaObject *impGetDeeplyMergedParaObject(Outliner *pOutl,
+   OutlinerParaObject *pPObj1,
+   OutlinerParaObject *pPObj2)
+{ // XXX: For now just the same
+
+assert(pOutl  pPObj1   pPObj2);
+
+pOutl-SetText(*pPObj1);
+pOutl-AddText(*pPObj2);
+OutlinerParaObject *pPObj = pOutl-CreateParaObject();
+
+return pPObj;
+}
+
 // class OverflowingText
 
 OverflowingText::OverflowingText(EditTextObject *pTObj)
@@ -89,24 +117,35 @@ OutlinerParaObject 
*OverflowingText::GetJuxtaposedParaObject(Outliner *pOutl, Ou
 return NULL;
 }
 
-// Simply Juxtaposing; no within-para merging
 OutlinerParaObject *pOverflowingPObj = new 
OutlinerParaObject(*mpContentTextObj);
 // the OutlinerParaObject constr. at the prev line gives no valid outliner 
mode, so we set it
 pOverflowingPObj-SetOutlinerMode(pOutl-GetOutlinerMode());
 
-/* Actual Text Setting */
-pOutl-SetText(*pOverflowingPObj);
+// Simply Juxtaposing; no within-para merging
+return impGetJuxtaposedParaObject(pOutl, pOverflowingPObj, pNextPObj);
+}
 
-// Set selection position between new and old text
-//maInsertionPointSel = impGetEndSelection(pOutl);  // XXX: Maybe setting 
in the constructor is just right
+OutlinerParaObject *OverflowingText::impMakeOverflowingParaObject(Outliner 
*pOutliner)
+{
+if (mpContentTextObj == NULL) {
+fprintf(stderr, [Chaining] OverflowingText's mpContentTextObj is 
NULL!\n);
+return NULL;
+}
+
+// Simply Juxtaposing; no within-para merging
+OutlinerParaObject *pOverflowingPObj = new 
OutlinerParaObject(*mpContentTextObj);
+// the OutlinerParaObject constr. at the prev line gives no valid outliner 
mode, so we set it
+pOverflowingPObj-SetOutlinerMode(pOutliner-GetOutlinerMode());
 
-pOutl-AddText(*pNextPObj);
+return pOverflowingPObj;
+}
 
-// End Text Setting
 
-OutlinerParaObject *pPObj = pOutl-CreateParaObject();
-//pPObj-SetOutlinerMode(pOutl-GetOutlinerMode());
-return pPObj;
+OutlinerParaObject *OverflowingText::GetDeeplyMergedParaObject(Outliner 
*pOutliner, OutlinerParaObject *pNextPObj)
+{
+OutlinerParaObject *pOverflowingPObj = 
impMakeOverflowingParaObject(pOutliner);
+
+return impGetDeeplyMergedParaObject(pOutliner, pOverflowingPObj, 
pNextPObj);
 }
 
 // class OFlowChainedText
@@ -135,9 +174,13 @@ OutlinerParaObject 
*OFlowChainedText::CreateOverflowingParaObject(Outliner *pOut
 if (mpOverflowingTxt == NULL || pTextToBeMerged == NULL)
 return NULL;
 
-return mpOverflowingTxt-GetJuxtaposedParaObject(pOutliner, 
pTextToBeMerged );
+if (mbIsDeepMerge)
+return mpOverflowingTxt-GetJuxtaposedParaObject(pOutliner, 
pTextToBeMerged );
+else
+return mpOverflowingTxt-GetDeeplyMergedParaObject(pOutliner, 
pTextToBeMerged );
 }
 
+
 OutlinerParaObject *OFlowChainedText::CreateNonOverflowingParaObject(Outliner 
*pOutliner)
 {
 if (mpNonOverflowingTxt == NULL)
@@ -162,12 +205,15 @@ UFlowChainedText::UFlowChainedText(Outliner *pOutl, bool 
bIsDeepMerge)
 
 OutlinerParaObject *UFlowChainedText::CreateMergedUnderflowParaObject(Outliner 
*pOutl, OutlinerParaObject *pNextLinkWholeText)
 {
+OutlinerParaObject *pNewText = NULL;
 OutlinerParaObject *pCurText = mpUnderflowPObj;
 
-// NewTextForCurBox = Txt(CurBox) ++ Txt(NextBox)
-pOutl-SetText(*pCurText);
-pOutl-AddText(*pNextLinkWholeText

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

2015-07-13 Thread matteocam
 editeng/source/outliner/overflowingtxt.cxx |9 +--
 include/editeng/overflowingtxt.hxx |8 +-
 include/svx/textchainflow.hxx  |2 -
 svx/source/svdraw/textchainflow.cxx|   34 +
 4 files changed, 33 insertions(+), 20 deletions(-)

New commits:
commit 0c01a319097cc79e3860d1ac3d760de912bbe887
Author: matteocam matteo.campane...@gmail.com
Date:   Mon Jul 13 12:32:43 2015 -0400

Move logic for para merging to editeng

Change-Id: I10ed532d8a42dbcb2f4c5aaa52f1848dde6745e6

diff --git a/editeng/source/outliner/overflowingtxt.cxx 
b/editeng/source/outliner/overflowingtxt.cxx
index 45e8f51..eb6bfe5 100644
--- a/editeng/source/outliner/overflowingtxt.cxx
+++ b/editeng/source/outliner/overflowingtxt.cxx
@@ -111,10 +111,12 @@ OutlinerParaObject 
*OverflowingText::GetJuxtaposedParaObject(Outliner *pOutl, Ou
 
 // class OFlowChainedText
 
-OFlowChainedText::OFlowChainedText(Outliner *pOutl)
+OFlowChainedText::OFlowChainedText(Outliner *pOutl, bool bIsDeepMerge)
 {
 mpOverflowingTxt = pOutl-GetOverflowingText();
 mpNonOverflowingTxt = pOutl-GetNonOverflowingText();
+
+mbIsDeepMerge = bIsDeepMerge;
 }
 
 ESelection OFlowChainedText::GetInsertionPointSel() const
@@ -129,7 +131,7 @@ ESelection OFlowChainedText::GetOverflowPointSel() const
 
 OutlinerParaObject *OFlowChainedText::CreateOverflowingParaObject(Outliner 
*pOutliner, OutlinerParaObject *pTextToBeMerged)
 {
-// Just return the roughly merged paras fpr now
+// Just return the roughly merged paras for now
 if (mpOverflowingTxt == NULL || pTextToBeMerged == NULL)
 return NULL;
 
@@ -152,9 +154,10 @@ bool OFlowChainedText::IsLastParaInterrupted() const
 
 // classes UFlowChainedText
 
-UFlowChainedText::UFlowChainedText(Outliner *pOutl)
+UFlowChainedText::UFlowChainedText(Outliner *pOutl, bool bIsDeepMerge)
 {
 mpUnderflowPObj = pOutl-CreateParaObject();
+mbIsDeepMerge = bIsDeepMerge;
 }
 
 OutlinerParaObject *UFlowChainedText::CreateMergedUnderflowParaObject(Outliner 
*pOutl, OutlinerParaObject *pNextLinkWholeText)
diff --git a/include/editeng/overflowingtxt.hxx 
b/include/editeng/overflowingtxt.hxx
index 2f63cea..345daa8 100644
--- a/include/editeng/overflowingtxt.hxx
+++ b/include/editeng/overflowingtxt.hxx
@@ -81,7 +81,7 @@ private:
 
 class EDITENG_DLLPUBLIC OFlowChainedText {
 public:
-OFlowChainedText(Outliner *);
+OFlowChainedText(Outliner *, bool );
 
 OutlinerParaObject *CreateOverflowingParaObject(Outliner *, 
OutlinerParaObject *);
 OutlinerParaObject *CreateNonOverflowingParaObject(Outliner *);
@@ -99,18 +99,22 @@ class EDITENG_DLLPUBLIC OFlowChainedText {
 NonOverflowingText *mpNonOverflowingTxt;
 OverflowingText *mpOverflowingTxt;
 
+bool mbIsDeepMerge;
+
 };
 
 // UFlowChainedText is a simpler class than OFlowChainedText: it almost only 
joins para-objects
 class EDITENG_DLLPUBLIC UFlowChainedText {
 public:
-UFlowChainedText(Outliner *);
+UFlowChainedText(Outliner *, bool);
 
 OutlinerParaObject *CreateMergedUnderflowParaObject(Outliner *, 
OutlinerParaObject *);
 protected:
 
 private:
 OutlinerParaObject *mpUnderflowPObj;
+
+bool mbIsDeepMerge;
 };
 
 #endif
diff --git a/include/svx/textchainflow.hxx b/include/svx/textchainflow.hxx
index 8e8ad62..f96ce59 100644
--- a/include/svx/textchainflow.hxx
+++ b/include/svx/textchainflow.hxx
@@ -104,8 +104,6 @@ class TextChainFlow {
 OFlowChainedText *mpOverflChText;
 UFlowChainedText *mpUnderflChText;
 
-bool mbMustMergeParaAmongLinks;
-
 };
 
 
diff --git a/svx/source/svdraw/textchainflow.cxx 
b/svx/source/svdraw/textchainflow.cxx
index 50bddb5..57147d3 100644
--- a/svx/source/svdraw/textchainflow.cxx
+++ b/svx/source/svdraw/textchainflow.cxx
@@ -41,7 +41,6 @@ TextChainFlow::TextChainFlow(SdrTextObj *pChainTarget)
 maCursorEvent = CursorChainingEvent::NULL_EVENT;
 mbPossiblyCursorOut = false;
 
-mbMustMergeParaAmongLinks = false;
 }
 
 
@@ -90,11 +89,26 @@ void TextChainFlow::impCheckForFlowEvents(SdrOutliner 
*pFlowOutl, SdrOutliner *p
 pFlowOutl-SetUpdateMode(bOldUpdateMode);
 }
 
+// Get old state on whether to merge para-s or not
+// NOTE: We handle UF/OF using the _old_ state. The new one is simply saved
+bool bMustMergeParaAmongLinks = 
GetTextChain()-GetIsPartOfLastParaInNextLink(mpTargetLink);
+
 // Set (Non)OverflowingTxt here (if any)
-mpOverflChText = bOverflow ? new OFlowChainedText(pFlowOutl) : NULL;
+mpOverflChText = bOverflow ? new OFlowChainedText(pFlowOutl, 
bMustMergeParaAmongLinks) : NULL;
 
 // Set current underflowing text (if any)
-mpUnderflChText = bUnderflow ? new UFlowChainedText(pFlowOutl) : NULL;
+mpUnderflChText = bUnderflow ? new UFlowChainedText(pFlowOutl, 
bMustMergeParaAmongLinks) : NULL;
+
+// update new state on paragraph merging
+if (bOverflow

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

2015-07-13 Thread matteocam
 include/svx/textchain.hxx   |7 +--
 svx/source/svdraw/textchain.cxx |9 +
 2 files changed, 6 insertions(+), 10 deletions(-)

New commits:
commit afe335ac3bf0bcd79ee58699f132cf4ad7e5aefe
Author: matteocam matteo.campane...@gmail.com
Date:   Mon Jul 13 11:12:05 2015 -0400

Add IsPartOfLastParaInNextLink Property

Change-Id: I0410c4417bebb7ffb9cd162a1ecf3d5028f513fa

diff --git a/include/svx/textchain.hxx b/include/svx/textchain.hxx
index 6a70c8b..8d0ae47 100644
--- a/include/svx/textchain.hxx
+++ b/include/svx/textchain.hxx
@@ -117,6 +117,7 @@ class ImpChainLinkProperties
 INIT_CHAIN_PROP(CursorEvent, CursorChainingEvent::NULL_EVENT)
 INIT_CHAIN_PROP(PreChainingSel, ESelection(0,0,0,0));
 INIT_CHAIN_PROP(PostChainingSel, ESelection(0,0,0,0));
+INIT_CHAIN_PROP(IsPartOfLastParaInNextLink, false)
 }
 
 private:
@@ -125,6 +126,7 @@ class ImpChainLinkProperties
 DECL_CHAIN_PROP(CursorEvent, CursorChainingEvent)
 DECL_CHAIN_PROP(PreChainingSel, ESelection)
 DECL_CHAIN_PROP(PostChainingSel, ESelection)
+DECL_CHAIN_PROP(IsPartOfLastParaInNextLink, bool)
 
 };
 
@@ -147,9 +149,10 @@ class TextChain {
 DECL_CHAIN_PROP_INTERFACE(NilChainingEvent, bool)
 DECL_CHAIN_PROP_INTERFACE(PreChainingSel, ESelection)
 DECL_CHAIN_PROP_INTERFACE(PostChainingSel, ESelection)
+// return whether a paragraph is split between this box and the next
+DECL_CHAIN_PROP_INTERFACE(IsPartOfLastParaInNextLink, bool)
+
 
-// return whether a paragraph is split between the two links in the 
argument
-bool GetLinksHaveMergeableFirstPara(SdrTextObj *, SdrTextObj *);
 
 protected:
 LinkPropertiesMap maLinkPropertiesMap;
diff --git a/svx/source/svdraw/textchain.cxx b/svx/source/svdraw/textchain.cxx
index 36966bb..25b75ae 100644
--- a/svx/source/svdraw/textchain.cxx
+++ b/svx/source/svdraw/textchain.cxx
@@ -28,6 +28,7 @@ IMPL_CHAIN_PROP_INTERFACE(CursorEvent, CursorChainingEvent)
 IMPL_CHAIN_PROP_INTERFACE(NilChainingEvent, bool)
 IMPL_CHAIN_PROP_INTERFACE(PreChainingSel, ESelection)
 IMPL_CHAIN_PROP_INTERFACE(PostChainingSel, ESelection)
+IMPL_CHAIN_PROP_INTERFACE(IsPartOfLastParaInNextLink, bool)
 
 /* End Definition of Properties Interface */
 
@@ -59,14 +60,6 @@ SdrTextObj *TextChain::GetNextLink(SdrTextObj *) const
 return NULL; // XXX: To be changed. It'd be a mess to implement now
 }
 
-
-bool TextChain::GetLinksHaveMergeableFirstPara(SdrTextObj* /* pPrevLink */, 
SdrTextObj* /* pNextLink */)
-{
-// XXX
-return false;
-}
-
-
 ImpChainLinkProperties *TextChain::GetLinkProperties(const SdrTextObj *pLink)
 {
 // if the guy does not already have properties in the map make them
___
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 include/editeng

2015-07-13 Thread matteocam
 editeng/source/outliner/outliner.cxx   |   10 --
 editeng/source/outliner/overflowingtxt.cxx |   10 --
 include/editeng/overflowingtxt.hxx |4 +++-
 3 files changed, 19 insertions(+), 5 deletions(-)

New commits:
commit 1f71d4b088f43611094ae95d53c6bea44bf7a9ad
Author: matteocam matteo.campane...@gmail.com
Date:   Mon Jul 13 11:29:58 2015 -0400

Add bLastParaInterrupted to NonOverflowingText

Change-Id: Ie6864bfbce088fabd3fba65c3e1313bc2fafcbac

diff --git a/editeng/source/outliner/outliner.cxx 
b/editeng/source/outliner/outliner.cxx
index 2b03d26..a8e5be0 100644
--- a/editeng/source/outliner/outliner.cxx
+++ b/editeng/source/outliner/outliner.cxx
@@ -2131,7 +2131,8 @@ NonOverflowingText *Outliner::GetNonOverflowingText() 
const
 {
 ESelection aEmptySel(0,0,0,0);
 EditTextObject *pTObj = pEditEngine-CreateTextObject(aEmptySel);
-return new NonOverflowingText(pTObj);
+bool bLastParaInterrupted = true; // Last Para was interrupted since 
everything overflew
+return new NonOverflowingText(pTObj, bLastParaInterrupted);
 } else { // Get the lines that of the overflowing para fit in the box
 
 sal_Int32 nOverflowingPara = nCount;
@@ -2159,7 +2160,12 @@ NonOverflowingText *Outliner::GetNonOverflowingText() 
const
 ESelection(nStartPara, nStartPos, nOverflowingPara, nLen);
 }
 EditTextObject *pTObj = 
pEditEngine-CreateTextObject(aNonOverflowingTextSelection);
-return new NonOverflowingText(pTObj);
+
+sal_Int32 nLastLine = GetLineCount(nOverflowingPara)-1;
+bool bLastParaInterrupted =
+pEditEngine-GetOverflowingLineNum()  nLastLine;
+
+return new NonOverflowingText(pTObj, bLastParaInterrupted);
 }
 }
 
diff --git a/editeng/source/outliner/overflowingtxt.cxx 
b/editeng/source/outliner/overflowingtxt.cxx
index 339a335..9b6da0a 100644
--- a/editeng/source/outliner/overflowingtxt.cxx
+++ b/editeng/source/outliner/overflowingtxt.cxx
@@ -55,12 +55,18 @@ ESelection OverflowingText::GetInsertionPointSel() const
 
 // class NonOverflowingText
 
-NonOverflowingText::NonOverflowingText(const EditTextObject *pTObj)
-: mpContentTextObj(pTObj-Clone())
+NonOverflowingText::NonOverflowingText(const EditTextObject *pTObj,  bool 
bLastParaInterrupted)
+: mpContentTextObj(pTObj-Clone()),
+  mbLastParaInterrupted(bLastParaInterrupted)
 {
  // XXX: may have to delete pTObj
 }
 
+bool NonOverflowingText::IsLastParaInterrupted() const
+{
+return mbLastParaInterrupted;
+}
+
 
 OutlinerParaObject *NonOverflowingText::ToParaObject(Outliner *pOutliner) const
 {
diff --git a/include/editeng/overflowingtxt.hxx 
b/include/editeng/overflowingtxt.hxx
index 72d2355..449ca5a 100644
--- a/include/editeng/overflowingtxt.hxx
+++ b/include/editeng/overflowingtxt.hxx
@@ -60,13 +60,15 @@ class NonOverflowingText {
 public:
 OutlinerParaObject *ToParaObject(Outliner *) const;
 ESelection GetOverflowPointSel() const;
+bool IsLastParaInterrupted() const;
 
 private:
 // Constructor
-NonOverflowingText(const EditTextObject *pTObj);
+NonOverflowingText(const EditTextObject *pTObj, bool 
bLastParaInterrupted);
 
 friend class Outliner;
 const EditTextObject *mpContentTextObj;
+const bool mbLastParaInterrupted;
 };
 
 
___
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

2015-07-13 Thread matteocam
 editeng/source/outliner/overflowingtxt.cxx |9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

New commits:
commit 9890550e354a311714550fa42d1e8a6aae8ea04b
Author: matteocam matteo.campane...@gmail.com
Date:   Mon Jul 13 16:13:46 2015 -0400

More debugging output

Change-Id: I2a375ad899b8a284867251f5515b22d29834d1ee

diff --git a/editeng/source/outliner/overflowingtxt.cxx 
b/editeng/source/outliner/overflowingtxt.cxx
index ecb69d3..efaaa9b 100644
--- a/editeng/source/outliner/overflowingtxt.cxx
+++ b/editeng/source/outliner/overflowingtxt.cxx
@@ -219,10 +219,13 @@ OutlinerParaObject 
*OFlowChainedText::CreateOverflowingParaObject(Outliner *pOut
 if (mpOverflowingTxt == NULL || pTextToBeMerged == NULL)
 return NULL;
 
-if (mbIsDeepMerge)
+if (mbIsDeepMerge) {
+fprintf(stderr, [TEXTCHAINFLOW - OF] Deep merging paras\n );
 return mpOverflowingTxt-GetJuxtaposedParaObject(pOutliner, 
pTextToBeMerged );
-else
+} else {
+fprintf(stderr, [TEXTCHAINFLOW - OF] Juxtaposing paras\n );
 return mpOverflowingTxt-GetDeeplyMergedParaObject(pOutliner, 
pTextToBeMerged );
+}
 }
 
 
@@ -254,9 +257,11 @@ OutlinerParaObject 
*UFlowChainedText::CreateMergedUnderflowParaObject(Outliner *
 OutlinerParaObject *pCurText = mpUnderflowPObj;
 
 if (mbIsDeepMerge) {
+fprintf(stderr, [TEXTCHAINFLOW - UF] Deep merging paras\n );
 pNewText = impGetDeeplyMergedParaObject(pOutl, pCurText, 
pNextLinkWholeText);
 } else {
 // NewTextForCurBox = Txt(CurBox) ++ Txt(NextBox)
+fprintf(stderr, [TEXTCHAINFLOW - UF] Juxtaposing paras\n );
 pNewText = impGetJuxtaposedParaObject(pOutl, pCurText, 
pNextLinkWholeText);
 }
 
___
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

2015-07-13 Thread matteocam
 editeng/source/outliner/overflowingtxt.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 024ebf6859ceadd9a259b9607bdf1063516b0a29
Author: matteocam matteo.campane...@gmail.com
Date:   Mon Jul 13 16:56:13 2015 -0400

Fix juxtaposing special case in deep merge

Change-Id: Ica2e7935a4328ba05381ff44a1e5a0292b2860ea

diff --git a/editeng/source/outliner/overflowingtxt.cxx 
b/editeng/source/outliner/overflowingtxt.cxx
index 7df78b0..31b3d64 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, nParaCount - 1),
+pOutl-CreateParaObject(0, nParaCount1 - 1),
 pPObj2);
 }
 
___
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' - svx/source

2015-07-13 Thread matteocam
 svx/source/svdraw/textchainflow.cxx |7 +++
 1 file changed, 7 insertions(+)

New commits:
commit 8291a205f220a975dc2f44b6de0b06f4310fc879
Author: matteocam matteo.campane...@gmail.com
Date:   Mon Jul 13 16:02:30 2015 -0400

Add debug info for para counts

Change-Id: I0a2a6b7d783fc3c27ddaea4cc1dad6595617f948

diff --git a/svx/source/svdraw/textchainflow.cxx 
b/svx/source/svdraw/textchainflow.cxx
index 57147d3..fe4f9fc 100644
--- a/svx/source/svdraw/textchainflow.cxx
+++ b/svx/source/svdraw/textchainflow.cxx
@@ -21,12 +21,15 @@
 #include svx/svdotext.hxx
 #include svx/svdoutl.hxx
 #include editeng/outlobj.hxx
+#include editeng/editobj.hxx
 #include editeng/overflowingtxt.hxx
 #include svx/textchainflow.hxx
 
 TextChainFlow::TextChainFlow(SdrTextObj *pChainTarget)
 : mpTargetLink(pChainTarget)
 {
+fprintf(stderr, [TEXTCHAINFLOW] Creating a new TextChainFlow\n);
+
 mpTextChain = mpTargetLink-GetTextChain();
 mpNextLink = mpTargetLink-GetNextLinkInChain();
 bCheckedFlowEvents = false;
@@ -196,6 +199,9 @@ void TextChainFlow::ExecuteOverflow(SdrOutliner 
*pNonOverflOutl, SdrOutliner *pO
 void TextChainFlow::impLeaveOnlyNonOverflowingText(SdrOutliner *pNonOverflOutl)
 {
 OutlinerParaObject *pNewText = 
impGetNonOverflowingParaObject(pNonOverflOutl);
+
+fprintf(stderr, [TEXTCHAINFLOW - OF] SOURCE box set to %d paras \n, 
pNewText-GetTextObject().GetParagraphCount());
+
 // adds it to current outliner anyway (useful in static decomposition)
 pNonOverflOutl-SetText(*pNewText);
 
@@ -214,6 +220,7 @@ void 
TextChainFlow::impMoveChainedTextToNextLink(SdrOutliner *pOverflOutl)
 }
 
 OutlinerParaObject *pNewText = impGetOverflowingParaObject(pOverflOutl);
+fprintf(stderr, [TEXTCHAINFLOW - OF] DEST box set to %d paras \n, 
pNewText-GetTextObject().GetParagraphCount());
 if (pNewText)
 mpNextLink-NbcSetOutlinerParaObject(pNewText);
 }
___
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' - editeng/source include/editeng include/svx svx/source

2015-07-13 Thread matteocam
 editeng/source/outliner/overflowingtxt.cxx |6 ++
 include/editeng/overflowingtxt.hxx |2 ++
 include/svx/textchainflow.hxx  |2 ++
 svx/source/svdraw/textchainflow.cxx|   10 ++
 4 files changed, 20 insertions(+)

New commits:
commit 92a56f1fb97e3a095fa2702ba6970b056fef7bf6
Author: matteocam matteo.campane...@gmail.com
Date:   Mon Jul 13 12:01:16 2015 -0400

Add TextChainFlow info for merging paras

Change-Id: Ieb1f951e083c11b9c18a9a15180e8aff7ef02db7

diff --git a/editeng/source/outliner/overflowingtxt.cxx 
b/editeng/source/outliner/overflowingtxt.cxx
index 9b6da0a..45e8f51 100644
--- a/editeng/source/outliner/overflowingtxt.cxx
+++ b/editeng/source/outliner/overflowingtxt.cxx
@@ -144,6 +144,12 @@ OutlinerParaObject 
*OFlowChainedText::CreateNonOverflowingParaObject(Outliner *p
 return mpNonOverflowingTxt-ToParaObject(pOutliner);
 }
 
+bool OFlowChainedText::IsLastParaInterrupted() const
+{
+return mpNonOverflowingTxt-IsLastParaInterrupted();
+}
+
+
 // classes UFlowChainedText
 
 UFlowChainedText::UFlowChainedText(Outliner *pOutl)
diff --git a/include/editeng/overflowingtxt.hxx 
b/include/editeng/overflowingtxt.hxx
index 449ca5a..2f63cea 100644
--- a/include/editeng/overflowingtxt.hxx
+++ b/include/editeng/overflowingtxt.hxx
@@ -89,6 +89,8 @@ class EDITENG_DLLPUBLIC OFlowChainedText {
 ESelection GetInsertionPointSel() const;
 ESelection GetOverflowPointSel() const;
 
+bool IsLastParaInterrupted() const;
+
 protected:
 void impSetOutlinerToEmptyTxt(Outliner *);
 
diff --git a/include/svx/textchainflow.hxx b/include/svx/textchainflow.hxx
index f96ce59..8e8ad62 100644
--- a/include/svx/textchainflow.hxx
+++ b/include/svx/textchainflow.hxx
@@ -104,6 +104,8 @@ class TextChainFlow {
 OFlowChainedText *mpOverflChText;
 UFlowChainedText *mpUnderflChText;
 
+bool mbMustMergeParaAmongLinks;
+
 };
 
 
diff --git a/svx/source/svdraw/textchainflow.cxx 
b/svx/source/svdraw/textchainflow.cxx
index 4c48266..50bddb5 100644
--- a/svx/source/svdraw/textchainflow.cxx
+++ b/svx/source/svdraw/textchainflow.cxx
@@ -40,6 +40,8 @@ TextChainFlow::TextChainFlow(SdrTextObj *pChainTarget)
 
 maCursorEvent = CursorChainingEvent::NULL_EVENT;
 mbPossiblyCursorOut = false;
+
+mbMustMergeParaAmongLinks = false;
 }
 
 
@@ -100,6 +102,14 @@ void TextChainFlow::impCheckForFlowEvents(SdrOutliner 
*pFlowOutl, SdrOutliner *p
 // To check whether an overflow is underflow induced or not (useful in 
cursor checking)
 mbOFisUFinduced = bUnderflow;
 
+// Save old state and update new
+mbMustMergeParaAmongLinks = 
GetTextChain()-GetIsPartOfLastParaInNextLink(mpTargetLink);
+
+if (bOverflow)
+GetTextChain()-SetIsPartOfLastParaInNextLink(mpTargetLink, 
mpOverflChText-IsLastParaInterrupted());
+else // Overflows determine merging or not. If no OF, just merge 
everything next time.
+GetTextChain()-SetIsPartOfLastParaInNextLink(mpTargetLink, true);
+
 }
 
 void TextChainFlow::impUpdateCursorInfo()
___
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' - include/svx svx/source

2015-07-10 Thread matteocam
 include/svx/textchain.hxx   |   12 ++--
 svx/source/svdraw/svdedxv.cxx   |2 +-
 svx/source/svdraw/svdotext.cxx  |4 
 svx/source/svdraw/svdotextdecomposition.cxx |3 +++
 svx/source/svdraw/textchain.cxx |4 ++--
 svx/source/svdraw/textchainflow.cxx |5 +
 6 files changed, 21 insertions(+), 9 deletions(-)

New commits:
commit 942824a9e0c9bb679e0393122eb38fe4d4f212a1
Author: matteocam matteo.campane...@gmail.com
Date:   Fri Jul 10 12:56:24 2015 -0400

Prevent multiple chaining events for static text

Change-Id: I3d42cc161dbb2002df710f0bd424bc89fdbfb224

diff --git a/include/svx/textchain.hxx b/include/svx/textchain.hxx
index 69b197e..6a70c8b 100644
--- a/include/svx/textchain.hxx
+++ b/include/svx/textchain.hxx
@@ -53,15 +53,15 @@
 a##PropName = (PropDefault);
 
 #define DECL_CHAIN_PROP_INTERFACE(PropName, PropType) \
-PropType Get##PropName (SdrTextObj *); \
-void Set##PropName (SdrTextObj *, PropType);
+PropType Get##PropName (const SdrTextObj *); \
+void Set##PropName (const SdrTextObj *, PropType);
 
 #define IMPL_CHAIN_PROP_INTERFACE(PropName, PropType) \
-PropType TextChain::Get##PropName (SdrTextObj *pTarget) { \
+PropType TextChain::Get##PropName (const SdrTextObj *pTarget) { \
 ImpChainLinkProperties *pLinkProperties = GetLinkProperties(pTarget); \
 return pLinkProperties-a##PropName; \
 } \
-void TextChain::Set##PropName (SdrTextObj *pTarget, PropType aPropParam) \
+void TextChain::Set##PropName (const SdrTextObj *pTarget, PropType 
aPropParam) \
 { \
 ImpChainLinkProperties *pLinkProperties = GetLinkProperties(pTarget); \
 pLinkProperties-a##PropName = aPropParam; \
@@ -139,8 +139,8 @@ class TextChain {
 bool IsLinkInChain(SdrTextObj *) const;
 SdrTextObj *GetNextLink(SdrTextObj *) const;
 
-ChainLinkId GetId(SdrTextObj *) const;
-ImpChainLinkProperties *GetLinkProperties(SdrTextObj *);
+ChainLinkId GetId(const SdrTextObj *) const;
+ImpChainLinkProperties *GetLinkProperties(const SdrTextObj *);
 
 // Specific Link Properties
 DECL_CHAIN_PROP_INTERFACE(CursorEvent, CursorChainingEvent)
diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index 5e00942..80bd5ff 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -497,7 +497,7 @@ IMPL_LINK_NOARG(SdrObjEditView,ImpChainingEventHdl)
 }
 
 // We prevent to trigger further handling of overflow/underflow 
for pTextObj
-pTextChain-SetNilChainingEvent(pTextObj, true);
+pTextChain-SetNilChainingEvent(pTextObj, true); // XXX
 
 // Save previous selection pos // NOTE: It must be done to have 
the right CursorEvent in KeyInput
 pTextChain-SetPreChainingSel(pTextObj, pOLV-GetSelection());
diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx
index 0a33fa4..afa40df 100644
--- a/svx/source/svdraw/svdotext.cxx
+++ b/svx/source/svdraw/svdotext.cxx
@@ -2073,6 +2073,10 @@ SdrTextObj* SdrTextObj::GetNextLinkInChain() const
 /* FIXME(matteocam) return mpNextInChain; */
 SdrTextObj *pNextTextObj = NULL;
 
+// Check that no overflow is going on // XXX: This should be moved in 
IsChainable
+if (GetTextChain()-GetNilChainingEvent(this))
+return NULL;
+
 if ( pPage  pPage-GetObjCount()  1) {
 
 if (!GetName().startsWith(Chainable)) {
diff --git a/svx/source/svdraw/svdotextdecomposition.cxx 
b/svx/source/svdraw/svdotextdecomposition.cxx
index 954f261..241ec8b 100644
--- a/svx/source/svdraw/svdotextdecomposition.cxx
+++ b/svx/source/svdraw/svdotextdecomposition.cxx
@@ -1490,6 +1490,7 @@ void SdrTextObj::impDecomposeChainedTextPrimitive(
  // We need the outliner we get the overflow info from as well as
  //  the outliner for drawing (e.g. a drawing or chaining outliner)
  // maybe the latter ones can be passed at the time of overflow and such
+GetTextChain()-SetNilChainingEvent(this, true);
 TextChainFlow aTxtChainFlow(const_castSdrTextObj*(this));
 bool bIsOverflow;
 
@@ -1514,6 +1515,8 @@ void SdrTextObj::impDecomposeChainedTextPrimitive(
 aTxtChainFlow.ExecuteOverflow(rOutliner, rChainingOutl);
 }
 
+GetTextChain()-SetNilChainingEvent(this, false);
+
 /* End overflow/underflow handling */
 
 // set visualizing page at Outliner; needed e.g. for PageNumberField 
decomposition
diff --git a/svx/source/svdraw/textchain.cxx b/svx/source/svdraw/textchain.cxx
index a7bd1b6..36966bb 100644
--- a/svx/source/svdraw/textchain.cxx
+++ b/svx/source/svdraw/textchain.cxx
@@ -67,7 +67,7 @@ bool TextChain::GetLinksHaveMergeableFirstPara(SdrTextObj* /* 
pPrevLink */, SdrT
 }
 
 
-ImpChainLinkProperties *TextChain::GetLinkProperties(SdrTextObj *pLink)
+ImpChainLinkProperties *TextChain::GetLinkProperties(const SdrTextObj *pLink)
 {
 // if the guy does

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

2015-07-10 Thread matteocam
 include/svx/svdotext.hxx|1 
 svx/source/svdraw/svdotextdecomposition.cxx |   62 ++--
 2 files changed, 33 insertions(+), 30 deletions(-)

New commits:
commit cf9aae1558581a6e3851ab1db039bb16e86699be
Author: matteocam matteo.campane...@gmail.com
Date:   Fri Jul 10 17:35:24 2015 -0400

Use a separate method for static chaining

Change-Id: I289b411b5867c5e2b06f75633790f407bc3dbba1

diff --git a/include/svx/svdotext.hxx b/include/svx/svdotext.hxx
index 4ab6313..761c4e0 100644
--- a/include/svx/svdotext.hxx
+++ b/include/svx/svdotext.hxx
@@ -626,6 +626,7 @@ public:
 drawinglayer::primitive2d::Primitive2DSequence rTarget,
 const drawinglayer::primitive2d::SdrChainedTextPrimitive2D 
rSdrChainedTextPrimitive,
 const drawinglayer::geometry::ViewInformation2D aViewInformation) 
const;
+void impHandleChainingEventsDuringDecomposition(SdrOutliner rOutliner) 
const;
 
 
 // timing generators
diff --git a/svx/source/svdraw/svdotextdecomposition.cxx 
b/svx/source/svdraw/svdotextdecomposition.cxx
index 241ec8b..b627b77 100644
--- a/svx/source/svdraw/svdotextdecomposition.cxx
+++ b/svx/source/svdraw/svdotextdecomposition.cxx
@@ -1423,6 +1423,37 @@ void 
SdrTextObj::impGetScrollTextTiming(drawinglayer::animation::AnimationEntryL
 }
 }
 
+void SdrTextObj::impHandleChainingEventsDuringDecomposition(SdrOutliner 
rOutliner) const
+{
+GetTextChain()-SetNilChainingEvent(this, true);
+
+TextChainFlow aTxtChainFlow(const_castSdrTextObj*(this));
+bool bIsOverflow;
+
+aTxtChainFlow.CheckForFlowEvents(rOutliner);
+
+if (aTxtChainFlow.IsUnderflow()  !IsInEditMode())
+{
+// underflow-induced overflow
+aTxtChainFlow.ExecuteUnderflow(rOutliner);
+bIsOverflow = aTxtChainFlow.IsOverflow();
+} else {
+// standard overflow (no underlow before)
+bIsOverflow = aTxtChainFlow.IsOverflow();
+}
+
+if (bIsOverflow  !IsInEditMode()) {
+// Initialize Chaining Outliner
+SdrOutliner rChainingOutl = pModel-GetChainingOutliner(this);
+ImpInitDrawOutliner( rChainingOutl );
+rChainingOutl.SetUpdateMode(true);
+// We must pass the chaining outliner otherwise we would mess up 
decomposition
+aTxtChainFlow.ExecuteOverflow(rOutliner, rChainingOutl);
+}
+
+GetTextChain()-SetNilChainingEvent(this, false);
+}
+
 void SdrTextObj::impDecomposeChainedTextPrimitive(
 drawinglayer::primitive2d::Primitive2DSequence rTarget,
 const drawinglayer::primitive2d::SdrChainedTextPrimitive2D 
rSdrChainedTextPrimitive,
@@ -1486,36 +1517,7 @@ void SdrTextObj::impDecomposeChainedTextPrimitive(
 
 /* Begin overflow/underflow handling */
 
- // any parameter in the constructor?
- // We need the outliner we get the overflow info from as well as
- //  the outliner for drawing (e.g. a drawing or chaining outliner)
- // maybe the latter ones can be passed at the time of overflow and such
-GetTextChain()-SetNilChainingEvent(this, true);
-TextChainFlow aTxtChainFlow(const_castSdrTextObj*(this));
-bool bIsOverflow;
-
-aTxtChainFlow.CheckForFlowEvents(rOutliner);
-
-if (aTxtChainFlow.IsUnderflow()  !IsInEditMode())
-{
-// underflow-induced overflow
-aTxtChainFlow.ExecuteUnderflow(rOutliner);
-bIsOverflow = aTxtChainFlow.IsOverflow();
-} else {
-// standard overflow (no underlow before)
-bIsOverflow = aTxtChainFlow.IsOverflow();
-}
-
-if (bIsOverflow  !IsInEditMode()) {
-// Initialize Chaining Outliner
-SdrOutliner rChainingOutl = pModel-GetChainingOutliner(this);
-ImpInitDrawOutliner( rChainingOutl );
-rChainingOutl.SetUpdateMode(true);
-// We must pass the chaining outliner otherwise we would mess up 
decomposition
-aTxtChainFlow.ExecuteOverflow(rOutliner, rChainingOutl);
-}
-
-GetTextChain()-SetNilChainingEvent(this, false);
+impHandleChainingEventsDuringDecomposition(rOutliner);
 
 /* End overflow/underflow handling */
 
___
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' - 3 commits - include/svx svx/source

2015-07-10 Thread matteocam
 include/svx/svdotext.hxx|2 +-
 svx/source/svdraw/svdedxv.cxx   |5 +
 svx/source/svdraw/svdotext.cxx  |   31 +--
 svx/source/svdraw/textchainflow.cxx |6 ++
 4 files changed, 29 insertions(+), 15 deletions(-)

New commits:
commit 9ea78c59302bc8b7451aa886e8894610c9c34140
Author: matteocam matteo.campane...@gmail.com
Date:   Fri Jul 10 16:17:58 2015 -0400

Fixed some errors and removed recursive static drawing

Change-Id: I8098dbed7a711b4dad31add1e2ec76d163d0d371

diff --git a/include/svx/svdotext.hxx b/include/svx/svdotext.hxx
index ceeb633..4ab6313 100644
--- a/include/svx/svdotext.hxx
+++ b/include/svx/svdotext.hxx
@@ -367,7 +367,7 @@ public:
 // Chaining
 bool IsToBeChained() const;
 SdrTextObj *GetNextLinkInChain() const;
-bool IsChainable() const { return GetNextLinkInChain() != NULL; }
+bool IsChainable() const;
 void SetPreventChainable();
 bool GetPreventChainable() const;
 TextChain *GetTextChain() const;
diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index 80bd5ff..3abebed 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -491,6 +491,11 @@ IMPL_LINK_NOARG(SdrObjEditView,ImpChainingEventHdl)
 if( pTextObj  pOLV)
 {
 TextChain *pTextChain = pTextObj-GetTextChain();
+
+ // XXX: IsChainable and GetNilChainingEvent are a bit mixed up atm
+if (!pTextObj-IsChainable()) {
+return 0;
+}
 // This is true during an underflow-caused overflow (with 
pEdtOutl-SetText())
 if (pTextChain-GetNilChainingEvent(pTextObj)) {
 return 0;
diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx
index afa40df..567afd9 100644
--- a/svx/source/svdraw/svdotext.cxx
+++ b/svx/source/svdraw/svdotext.cxx
@@ -1566,8 +1566,8 @@ void SdrTextObj::SetToBeChained(bool bToBeChained)
 
 TextChain *SdrTextObj::GetTextChain() const
 {
-if (!IsChainable())
-return NULL;
+//if (!IsChainable())
+//return NULL;
 
 return pModel-GetTextChain();
 }
@@ -1984,11 +1984,23 @@ void SdrTextObj::onEditOutlinerStatusEvent( EditStatus* 
pEditStatus )
 }
 }
 
-void SdrTextObj::onChainingEvent()
+bool SdrTextObj::IsChainable() const
 {
-if (!IsChainable() || GetNextLinkInChain() == NULL)
-return;
+if (!GetName().startsWith(Chainable)) {
+fprintf(stderr, [CHAINABLE?] %p is _not_ chainable\n, this);
+return false;
+}
 
+// Check that no overflow is going on
+if (!GetTextChain() || GetTextChain()-GetNilChainingEvent(this))
+return false;
+
+return true;
+
+}
+
+void SdrTextObj::onChainingEvent()
+{
 if (!pEdtOutl)
 return;
 
@@ -2073,17 +2085,8 @@ SdrTextObj* SdrTextObj::GetNextLinkInChain() const
 /* FIXME(matteocam) return mpNextInChain; */
 SdrTextObj *pNextTextObj = NULL;
 
-// Check that no overflow is going on // XXX: This should be moved in 
IsChainable
-if (GetTextChain()-GetNilChainingEvent(this))
-return NULL;
-
 if ( pPage  pPage-GetObjCount()  1) {
 
-if (!GetName().startsWith(Chainable)) {
-fprintf(stderr, [CHAINABLE?] %p is _not_ chainable\n, this);
-return NULL;
-}
-
 sal_uInt32 nextIndex = (GetOrdNum()+1);
 
 if (nextIndex  pPage-GetObjCount())
diff --git a/svx/source/svdraw/textchainflow.cxx 
b/svx/source/svdraw/textchainflow.cxx
index c7531f1..8907e3a 100644
--- a/svx/source/svdraw/textchainflow.cxx
+++ b/svx/source/svdraw/textchainflow.cxx
@@ -145,8 +145,14 @@ void TextChainFlow::ExecuteUnderflow(SdrOutliner *pOutl)
 if (!mpTargetLink-GetPreventChainable())
 mpNextLink-NbcSetOutlinerParaObject(pOutl-GetEmptyParaObject());
 
+// We store the size since NbcSetOutlinerParaObject can change it
+Size aOldSize = pOutl-GetMaxAutoPaperSize();
+
 mpTargetLink-NbcSetOutlinerParaObject(pNewText);
 
+pOutl-SetMaxAutoPaperSize(aOldSize);
+pOutl-SetText(*pNewText);
+
 //GetTextChain()-SetNilChainingEvent(mpTargetLink, false);
 
 // Check for new overflow
commit cbd8c9dcfd45329cc7afa0b5e17f6363e2254d3f
Author: matteocam matteo.campane...@gmail.com
Date:   Fri Jul 10 13:36:50 2015 -0400

Revert Revert Prevent multiple chaining events for static text

This reverts commit f2497029a458b6f33e62776c09f23227c7b3407d.

diff --git a/include/svx/textchain.hxx b/include/svx/textchain.hxx
index 69b197e..6a70c8b 100644
--- a/include/svx/textchain.hxx
+++ b/include/svx/textchain.hxx
@@ -53,15 +53,15 @@
 a##PropName = (PropDefault);
 
 #define DECL_CHAIN_PROP_INTERFACE(PropName, PropType) \
-PropType Get##PropName (SdrTextObj *); \
-void Set##PropName (SdrTextObj *, PropType);
+PropType Get##PropName (const SdrTextObj *); \
+void Set##PropName (const SdrTextObj *, PropType);
 
 #define IMPL_CHAIN_PROP_INTERFACE

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

2015-07-10 Thread matteocam
 svx/source/svdraw/textchainflow.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 7ebce5de15644a99c3ff209aa2adadbb110e670b
Author: matteocam matteo.campane...@gmail.com
Date:   Fri Jul 10 18:18:32 2015 -0400

Set MaxAutoPaperSize explicitly after NbcSetOutlinerParaObj

Change-Id: I00b0f02818b8e1192dc88420f443cedc61beb2a1

diff --git a/svx/source/svdraw/textchainflow.cxx 
b/svx/source/svdraw/textchainflow.cxx
index 8907e3a..d144d28 100644
--- a/svx/source/svdraw/textchainflow.cxx
+++ b/svx/source/svdraw/textchainflow.cxx
@@ -150,8 +150,10 @@ void TextChainFlow::ExecuteUnderflow(SdrOutliner *pOutl)
 
 mpTargetLink-NbcSetOutlinerParaObject(pNewText);
 
+// Restore size and set new text
 pOutl-SetMaxAutoPaperSize(aOldSize);
 pOutl-SetText(*pNewText);
+pOutl-SetMaxAutoPaperSize(Size(pOutl-GetMaxAutoPaperSize().Width(), 
pOutl-GetTextHeight()));
 
 //GetTextChain()-SetNilChainingEvent(mpTargetLink, false);
 
___
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' - svx/source

2015-07-10 Thread matteocam
 svx/source/svdraw/textchainflow.cxx |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit bbb9450d0f57c03e19884dacf0a8e135b38a1662
Author: matteocam matteo.campane...@gmail.com
Date:   Fri Jul 10 18:29:32 2015 -0400

Set explicitly paper size

Change-Id: Idfb03e306199a38522ec35585fda2a0f9687e6dd

diff --git a/svx/source/svdraw/textchainflow.cxx 
b/svx/source/svdraw/textchainflow.cxx
index d144d28..4c48266 100644
--- a/svx/source/svdraw/textchainflow.cxx
+++ b/svx/source/svdraw/textchainflow.cxx
@@ -153,7 +153,6 @@ void TextChainFlow::ExecuteUnderflow(SdrOutliner *pOutl)
 // Restore size and set new text
 pOutl-SetMaxAutoPaperSize(aOldSize);
 pOutl-SetText(*pNewText);
-pOutl-SetMaxAutoPaperSize(Size(pOutl-GetMaxAutoPaperSize().Width(), 
pOutl-GetTextHeight()));
 
 //GetTextChain()-SetNilChainingEvent(mpTargetLink, false);
 
@@ -172,6 +171,7 @@ void TextChainFlow::ExecuteOverflow(SdrOutliner 
*pNonOverflOutl, SdrOutliner *pO
 {
 impMoveChainedTextToNextLink(pOverflOutl);
 }
+
 //GetTextChain()-SetNilChainingEvent(mpTargetLink, false);
 }
 
@@ -182,6 +182,8 @@ void 
TextChainFlow::impLeaveOnlyNonOverflowingText(SdrOutliner *pNonOverflOutl)
 pNonOverflOutl-SetText(*pNewText);
 
 mpTargetLink-NbcSetOutlinerParaObject(pNewText);
+pNonOverflOutl-SetPaperSize(Size(pNonOverflOutl-GetPaperSize().Width(),
+  pNonOverflOutl-GetTextHeight()));
 
 }
 
___
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 -

2015-07-10 Thread matteocam
 0 files changed

New commits:
commit 628d7a3119a411b1cf720883a5bdc129021643ca
Author: matteocam matteo.campane...@gmail.com
Date:   Fri Jul 10 18:49:19 2015 -0400

Revert Attempt to block UF-s from propagating. It  does not help.

This reverts commit 9d29ab065da5bb39069223fb30d67eeedb743608.

diff --git a/include/svx/textchain.hxx b/include/svx/textchain.hxx
index 5690225..6a70c8b 100644
--- a/include/svx/textchain.hxx
+++ b/include/svx/textchain.hxx
@@ -114,7 +114,6 @@ class ImpChainLinkProperties
 
 ImpChainLinkProperties() {
 INIT_CHAIN_PROP(NilChainingEvent, false)
-INIT_CHAIN_PROP(JustHandledUnderflow, false)
 INIT_CHAIN_PROP(CursorEvent, CursorChainingEvent::NULL_EVENT)
 INIT_CHAIN_PROP(PreChainingSel, ESelection(0,0,0,0));
 INIT_CHAIN_PROP(PostChainingSel, ESelection(0,0,0,0));
@@ -123,7 +122,6 @@ class ImpChainLinkProperties
 private:
 // NOTE: Remember to set default value in contructor when adding field
 DECL_CHAIN_PROP(NilChainingEvent, bool)
-DECL_CHAIN_PROP(JustHandledUnderflow, bool)
 DECL_CHAIN_PROP(CursorEvent, CursorChainingEvent)
 DECL_CHAIN_PROP(PreChainingSel, ESelection)
 DECL_CHAIN_PROP(PostChainingSel, ESelection)
@@ -147,7 +145,6 @@ class TextChain {
 // Specific Link Properties
 DECL_CHAIN_PROP_INTERFACE(CursorEvent, CursorChainingEvent)
 DECL_CHAIN_PROP_INTERFACE(NilChainingEvent, bool)
-DECL_CHAIN_PROP_INTERFACE(JustHandledUnderflow, bool)
 DECL_CHAIN_PROP_INTERFACE(PreChainingSel, ESelection)
 DECL_CHAIN_PROP_INTERFACE(PostChainingSel, ESelection)
 
diff --git a/svx/source/svdraw/svdotextdecomposition.cxx 
b/svx/source/svdraw/svdotextdecomposition.cxx
index 49eab43..b627b77 100644
--- a/svx/source/svdraw/svdotextdecomposition.cxx
+++ b/svx/source/svdraw/svdotextdecomposition.cxx
@@ -1425,11 +1425,6 @@ void 
SdrTextObj::impGetScrollTextTiming(drawinglayer::animation::AnimationEntryL
 
 void SdrTextObj::impHandleChainingEventsDuringDecomposition(SdrOutliner 
rOutliner) const
 {
-if (GetTextChain()-GetJustHandledUnderflow(this)) {
-GetTextChain()-SetJustHandledUnderflow(this, false);
-return;
-}
-
 GetTextChain()-SetNilChainingEvent(this, true);
 
 TextChainFlow aTxtChainFlow(const_castSdrTextObj*(this));
@@ -1442,8 +1437,6 @@ void 
SdrTextObj::impHandleChainingEventsDuringDecomposition(SdrOutliner rOutlin
 // underflow-induced overflow
 aTxtChainFlow.ExecuteUnderflow(rOutliner);
 bIsOverflow = aTxtChainFlow.IsOverflow();
-
-GetTextChain()-SetJustHandledUnderflow(this, true);
 } else {
 // standard overflow (no underlow before)
 bIsOverflow = aTxtChainFlow.IsOverflow();
diff --git a/svx/source/svdraw/textchain.cxx b/svx/source/svdraw/textchain.cxx
index f05d769..36966bb 100644
--- a/svx/source/svdraw/textchain.cxx
+++ b/svx/source/svdraw/textchain.cxx
@@ -26,7 +26,6 @@
 
 IMPL_CHAIN_PROP_INTERFACE(CursorEvent, CursorChainingEvent)
 IMPL_CHAIN_PROP_INTERFACE(NilChainingEvent, bool)
-IMPL_CHAIN_PROP_INTERFACE(JustHandledUnderflow, bool)
 IMPL_CHAIN_PROP_INTERFACE(PreChainingSel, ESelection)
 IMPL_CHAIN_PROP_INTERFACE(PostChainingSel, ESelection)
 
commit 9d29ab065da5bb39069223fb30d67eeedb743608
Author: matteocam matteo.campane...@gmail.com
Date:   Fri Jul 10 18:48:15 2015 -0400

Attempt to block UF-s from propagating

Change-Id: Id843bd6e4e0ca7678ab3f9b3ccd8155a60bdfff5

diff --git a/include/svx/textchain.hxx b/include/svx/textchain.hxx
index 6a70c8b..5690225 100644
--- a/include/svx/textchain.hxx
+++ b/include/svx/textchain.hxx
@@ -114,6 +114,7 @@ class ImpChainLinkProperties
 
 ImpChainLinkProperties() {
 INIT_CHAIN_PROP(NilChainingEvent, false)
+INIT_CHAIN_PROP(JustHandledUnderflow, false)
 INIT_CHAIN_PROP(CursorEvent, CursorChainingEvent::NULL_EVENT)
 INIT_CHAIN_PROP(PreChainingSel, ESelection(0,0,0,0));
 INIT_CHAIN_PROP(PostChainingSel, ESelection(0,0,0,0));
@@ -122,6 +123,7 @@ class ImpChainLinkProperties
 private:
 // NOTE: Remember to set default value in contructor when adding field
 DECL_CHAIN_PROP(NilChainingEvent, bool)
+DECL_CHAIN_PROP(JustHandledUnderflow, bool)
 DECL_CHAIN_PROP(CursorEvent, CursorChainingEvent)
 DECL_CHAIN_PROP(PreChainingSel, ESelection)
 DECL_CHAIN_PROP(PostChainingSel, ESelection)
@@ -145,6 +147,7 @@ class TextChain {
 // Specific Link Properties
 DECL_CHAIN_PROP_INTERFACE(CursorEvent, CursorChainingEvent)
 DECL_CHAIN_PROP_INTERFACE(NilChainingEvent, bool)
+DECL_CHAIN_PROP_INTERFACE(JustHandledUnderflow, bool)
 DECL_CHAIN_PROP_INTERFACE(PreChainingSel, ESelection)
 DECL_CHAIN_PROP_INTERFACE(PostChainingSel, ESelection)
 
diff --git a/svx/source/svdraw/svdotextdecomposition.cxx 
b/svx/source/svdraw/svdotextdecomposition.cxx
index b627b77..49eab43 100644
--- a/svx/source/svdraw/svdotextdecomposition.cxx
+++ b/svx/source/svdraw/svdotextdecomposition.cxx

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

2015-07-09 Thread matteocam
 editeng/source/outliner/overflowingtxt.cxx |   22 +-
 include/editeng/overflowingtxt.hxx |   12 
 2 files changed, 29 insertions(+), 5 deletions(-)

New commits:
commit 6c36f1508baf0089f260e4ad7ddff57532bb125f
Author: matteocam matteo.campane...@gmail.com
Date:   Thu Jul 9 14:52:01 2015 -0400

Clone EditTextObjects before using them for *OverflowingText

Change-Id: I0624b90967d5599534b3b159cb3e0838778ec3d9

diff --git a/editeng/source/outliner/overflowingtxt.cxx 
b/editeng/source/outliner/overflowingtxt.cxx
index 868daa6..339a335 100644
--- a/editeng/source/outliner/overflowingtxt.cxx
+++ b/editeng/source/outliner/overflowingtxt.cxx
@@ -25,6 +25,9 @@
 #include editeng/outlobj.hxx
 #include editeng/editobj.hxx
 
+
+// Helper function for *OverflowingText classes
+
 ESelection getLastPositionSel(const EditTextObject *pTObj)
 {
 sal_Int32 nLastPara = pTObj-GetParagraphCount()-1;
@@ -37,8 +40,12 @@ ESelection getLastPositionSel(const EditTextObject *pTObj)
 return aEndPos;
 }
 
-OverflowingText::OverflowingText(EditTextObject *pTObj) : 
mpContentTextObj(pTObj)
+// class OverflowingText
+
+OverflowingText::OverflowingText(EditTextObject *pTObj)
+: mpContentTextObj(pTObj-Clone())
 {
+// XXX: may have to delete pTObj
 }
 
 ESelection OverflowingText::GetInsertionPointSel() const
@@ -46,6 +53,15 @@ ESelection OverflowingText::GetInsertionPointSel() const
 return getLastPositionSel(mpContentTextObj);
 }
 
+// class NonOverflowingText
+
+NonOverflowingText::NonOverflowingText(const EditTextObject *pTObj)
+: mpContentTextObj(pTObj-Clone())
+{
+ // XXX: may have to delete pTObj
+}
+
+
 OutlinerParaObject *NonOverflowingText::ToParaObject(Outliner *pOutliner) const
 {
 OutlinerParaObject *pPObj = new OutlinerParaObject(*mpContentTextObj);
@@ -87,6 +103,8 @@ OutlinerParaObject 
*OverflowingText::GetJuxtaposedParaObject(Outliner *pOutl, Ou
 return pPObj;
 }
 
+// class OFlowChainedText
+
 OFlowChainedText::OFlowChainedText(Outliner *pOutl)
 {
 mpOverflowingTxt = pOutl-GetOverflowingText();
@@ -120,6 +138,8 @@ OutlinerParaObject 
*OFlowChainedText::CreateNonOverflowingParaObject(Outliner *p
 return mpNonOverflowingTxt-ToParaObject(pOutliner);
 }
 
+// classes UFlowChainedText
+
 UFlowChainedText::UFlowChainedText(Outliner *pOutl)
 {
 mpUnderflowPObj = pOutl-CreateParaObject();
diff --git a/include/editeng/overflowingtxt.hxx 
b/include/editeng/overflowingtxt.hxx
index 4e97fcc..72d2355 100644
--- a/include/editeng/overflowingtxt.hxx
+++ b/include/editeng/overflowingtxt.hxx
@@ -31,6 +31,11 @@ class OutlinerParaObject;
 class EditTextObject;
 class Outliner;
 
+/*
+ * The classes OverflowingText and NonOverflowingText handle the
+ * actual preparation of the OutlinerParaObjects to be used in destination
+ * and source box respectively.
+*/
 
 class OverflowingText
 {
@@ -58,9 +63,7 @@ public:
 
 private:
 // Constructor
-NonOverflowingText(const EditTextObject *pTObj)
-: mpContentTextObj(pTObj)
-{ }
+NonOverflowingText(const EditTextObject *pTObj);
 
 friend class Outliner;
 const EditTextObject *mpContentTextObj;
@@ -69,7 +72,8 @@ private:
 
 /*
  * classes OFlowChainedText and UFlowChainedText:
- * contain and handle the state of a broken up text _after_ a flow event.
+ * contain and handle the state of a broken up text _after_ a flow event
+ * (respectively after Overflow and Underflow).
  *
 */
 
___
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' - 3 commits - editeng/source include/svx svx/source

2015-07-09 Thread matteocam
 editeng/source/outliner/overflowingtxt.cxx |  102 -
 include/svx/textchain.hxx  |5 -
 include/svx/textchainflow.hxx  |1 
 svx/source/svdraw/svdedxv.cxx  |   26 ---
 svx/source/svdraw/textchain.cxx|1 
 svx/source/svdraw/textchainflow.cxx|   33 ++---
 6 files changed, 32 insertions(+), 136 deletions(-)

New commits:
commit 8151008453e5fdac0ecf851274f916965acd7045
Author: matteocam matteo.campane...@gmail.com
Date:   Thu Jul 9 14:34:31 2015 -0400

Don't set new position after tranferring cursor

Change-Id: I3d3d716ed05c6ffac001306850a73fb2280a40bb

diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index d0e77dd..5e00942 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -549,7 +549,7 @@ void SdrObjEditView::ImpMoveCursorAfterChainingEvent()
 SdrBeginTextEdit(pNextLink);
 // OutlinerView has changed, so we update the pointer
 pOLV = GetTextEditOutlinerView();
-pOLV-SetSelection(pTextChain-GetPostChainingSel(pTextObj));
+
//pOLV-SetSelection(pTextChain-GetPostChainingSel(pTextObj)); // XXX
 
 break;
 case CursorChainingEvent::TO_PREV_LINK:
commit 1dde1fdd2f15cd8e010c18f14a3b6d6fce099aee
Author: matteocam matteo.campane...@gmail.com
Date:   Thu Jul 9 11:39:43 2015 -0400

Fix cross initialization in switch

Change-Id: Ifc41ae8ce8eb7c4a607790b29079f9a792ba1859

diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index 9589d87..d0e77dd 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -549,8 +549,7 @@ void SdrObjEditView::ImpMoveCursorAfterChainingEvent()
 SdrBeginTextEdit(pNextLink);
 // OutlinerView has changed, so we update the pointer
 pOLV = GetTextEditOutlinerView();
-ESelection 
aPostChainingSel(pTextChain-GetPostChainingSel(pTextObj));
-pOLV-SetSelection(aPostChainingSel);
+pOLV-SetSelection(pTextChain-GetPostChainingSel(pTextObj));
 
 break;
 case CursorChainingEvent::TO_PREV_LINK:
commit 6445d4d5004396af69632bde1708714593af292d
Author: matteocam matteo.campane...@gmail.com
Date:   Wed Jul 8 23:56:24 2015 -0400

Set Position of Cursor in Dest Box after chaining

Change-Id: I399e4ab82cb1d6089043cfa801e9e6e948eca9f9

diff --git a/editeng/source/outliner/overflowingtxt.cxx 
b/editeng/source/outliner/overflowingtxt.cxx
index 304e04b..868daa6 100644
--- a/editeng/source/outliner/overflowingtxt.cxx
+++ b/editeng/source/outliner/overflowingtxt.cxx
@@ -87,39 +87,6 @@ OutlinerParaObject 
*OverflowingText::GetJuxtaposedParaObject(Outliner *pOutl, Ou
 return pPObj;
 }
 
-/*
-ESelection OverflowingText::impGetEndSelection(Outliner *pOutl) const
-{
-const sal_Int32 nParaCount = pOutl-GetParagraphCount();
-const sal_Int32 nLastParaIndex = nParaCount  1 ? nParaCount - 1 : 0;
-Paragraph* pLastPara = pOutl-GetParagraph( nLastParaIndex);
-const sal_Int32 nLenLastPara = pOutl-GetText(pLastPara).getLength();
-// Selection at end of editing area
-ESelection 
aEndSel(nLastParaIndex,nLenLastPara,nLastParaIndex,nLenLastPara);
-return aEndSel;
-}
-* */
-
-/*
-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 (!HasOtherParas())
-return mHeadTxt;
-
-return mTailTxt;
-}
-
-OUString OverflowingText::GetHeadingLines() const
-{
-return mHeadTxt;
-}
-* */
-
-
-
-
 OFlowChainedText::OFlowChainedText(Outliner *pOutl)
 {
 mpOverflowingTxt = pOutl-GetOverflowingText();
@@ -143,74 +110,6 @@ OutlinerParaObject 
*OFlowChainedText::CreateOverflowingParaObject(Outliner *pOut
 return NULL;
 
 return mpOverflowingTxt-GetJuxtaposedParaObject(pOutliner, 
pTextToBeMerged );
-
-/*
-if (mpOverflowingTxt == NULL || pTextToBeMerged == NULL)
-return NULL;
-
-pOutliner-SetText(*pTextToBeMerged);
-
-// Get text of first paragraph of destination box
-Paragraph *pOldPara0 = pOutliner-GetParagraph(0);
-OUString aOldPara0Txt;
-if (pOldPara0)
-aOldPara0Txt = pOutliner-GetText(pOldPara0);
-
-// Get other paras of destination box (from second on)
-OutlinerParaObject *pOldParasTail = NULL;
-if (pOutliner-GetParagraphCount()  1)
-pOldParasTail = pOutliner-CreateParaObject(1);
-
-// Create ParaObject appending old first para in the dest. box
-//   to last part of overflowing text
-Paragraph *pTmpPara0 = NULL;
-OutlinerParaObject *pJoiningPara = NULL;
-
-if (pOldPara0) {
-//pOutliner-Clear(); // you need a clear outliner here
-pOutliner-SetToEmptyText();
-
-pTmpPara0 = pOutliner-GetParagraph(0

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

2015-07-08 Thread matteocam
 include/svx/svdedxv.hxx   |9 +
 svx/source/svdraw/svdedxv.cxx |   64 +++---
 2 files changed, 57 insertions(+), 16 deletions(-)

New commits:
commit e76ca3b674ebd74bdd1ad81dc9ab942c7151f0e1
Author: matteocam matteo.campane...@gmail.com
Date:   Wed Jul 8 09:00:20 2015 -0400

Move to the other box after OF.

Change-Id: I5184cfb09bb796821fa12a07f085bf790d46b792

diff --git a/include/svx/svdedxv.hxx b/include/svx/svdedxv.hxx
index 010032e..0f9de4d 100644
--- a/include/svx/svdedxv.hxx
+++ b/include/svx/svdedxv.hxx
@@ -35,6 +35,9 @@ class ImpSdrEditPara;
 struct PasteOrDropInfos;
 class SdrUndoManager;
 
+enum class CursorChainingEvent;
+class ESelection;
+
 namespace com { namespace sun { namespace star { namespace uno {
 class Any;
 } } } }
@@ -94,6 +97,10 @@ private:
 
 SVX_DLLPRIVATE void ImpClearVars();
 
+// FIXME(matteocam)
+CursorChainingEvent *maCursorEvent;
+ESelection *maPreChainingSel;
+
 protected:
 // central method to get an SdrUndoManager for enhanced TextEdit. Default 
will
 // try to return a dynamic_casted GetModel()-GetSdrUndoManager(). 
Applications
@@ -103,6 +110,8 @@ protected:
 
 OutlinerView* ImpFindOutlinerView(vcl::Window* pWin) const;
 
+void ImpMoveCursorAfterChainingEvent();
+
 // Create a new OutlinerView at the heap and initialize all required 
parameters.
 // pTextEditObj, pTextEditPV and pTextEditOutliner have to be initialized
 OutlinerView* ImpMakeOutlinerView(vcl::Window* pWin, bool bNoPaint, 
OutlinerView* pGivenView) const;
diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index febb1c5..c09dfb1 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -500,7 +500,7 @@ IMPL_LINK_NOARG(SdrObjEditView,ImpChainingEventHdl)
 pTextChain-SetNilChainingEvent(pTextObj, true);
 
 // Save previous selection pos
-ESelection aPreChainingSel(pOLV-GetSelection());
+maPreChainingSel = new ESelection(pOLV-GetSelection());
 
 // trigger actual chaining
 pTextObj-onChainingEvent();
@@ -508,22 +508,9 @@ IMPL_LINK_NOARG(SdrObjEditView,ImpChainingEventHdl)
 // XXX: this logic could be put in a separate approppriate class
 /* Cursor motion stuff */
 
-CursorChainingEvent aCursorEvent = 
pTextChain-GetCursorEvent(pTextObj);
-SdrTextObj *pNextLink = pTextObj-GetNextLinkInChain();
+maCursorEvent = new 
CursorChainingEvent(pTextChain-GetCursorEvent(pTextObj));
+//SdrTextObj *pNextLink = pTextObj-GetNextLinkInChain();
 
-switch (aCursorEvent) {
-
-case CursorChainingEvent::UNCHANGED:
-pOLV-SetSelection(aPreChainingSel);
-break;
-case CursorChainingEvent::TO_NEXT_LINK:
-//SdrEndTextEdit(true);
-//SdrBeginTextEdit(pNextLink, nullptr, nullptr, false, 
nullptr, nullptr, true, true);
-break;
-case CursorChainingEvent::TO_PREV_LINK:
-// XXX: To be handled
-break;
-}
 
 // Find last Para
 /*
@@ -545,6 +532,47 @@ IMPL_LINK_NOARG(SdrObjEditView,ImpChainingEventHdl)
 return 0;
 }
 
+
+void SdrObjEditView::ImpMoveCursorAfterChainingEvent()
+{
+if (!mxTextEditObj.is())
+return;
+
+SdrTextObj* pTextObj = dynamic_castSdrTextObj*(mxTextEditObj.get());
+
+if (!pTextObj-IsChainable() || !pTextObj-GetNextLinkInChain())
+return;
+
+assert(maCursorEvent);
+assert(maPreChainingSel);
+
+SdrTextObj *pNextLink = pTextObj-GetNextLinkInChain();
+OutlinerView* pOLV = GetTextEditOutlinerView();
+
+switch (*maCursorEvent) {
+
+case CursorChainingEvent::UNCHANGED:
+pOLV-SetSelection(*maPreChainingSel);
+break;
+case CursorChainingEvent::TO_NEXT_LINK:
+SdrEndTextEdit();
+SdrBeginTextEdit(pNextLink);
+
+//SdrEndTextEdit(true);
+//SdrBeginTextEdit(pNextLink, nullptr, nullptr, false, 
nullptr, nullptr, true, true);
+break;
+case CursorChainingEvent::TO_PREV_LINK:
+// XXX: To be handled
+break;
+}
+
+// Default case
+// XXX: You should delete the old ones here too.
+maCursorEvent = NULL;
+maPreChainingSel = NULL;
+
+}
+
 IMPL_LINK(SdrObjEditView,ImpOutlinerCalcFieldValueHdl,EditFieldInfo*,pFI)
 {
 bool bOk=false;
@@ -1274,6 +1302,10 @@ bool SdrObjEditView::KeyInput(const KeyEvent rKEvt, 
vcl::Window* pWin)
 if (pItemBrowser!=nullptr) pItemBrowser-SetDirty();
 #endif
 ImpMakeTextCursorAreaVisible();
+
+// FIXME(matteocam)
+ImpMoveCursorAfterChainingEvent();
+
 return true

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

2015-07-08 Thread matteocam
 editeng/source/outliner/overflowingtxt.cxx |   57 -
 include/editeng/overflowingtxt.hxx |7 +++
 svx/source/svdraw/textchainflow.cxx|5 +-
 3 files changed, 50 insertions(+), 19 deletions(-)

New commits:
commit abf19ac0252a7f21bb276ed98ee73312096eaf93
Author: matteocam matteo.campane...@gmail.com
Date:   Wed Jul 8 09:31:28 2015 -0400

Save insertion point in dest box when making overflowing text

Change-Id: If08717c89d424b3e248d628e289f00da2d340d94

diff --git a/editeng/source/outliner/overflowingtxt.cxx 
b/editeng/source/outliner/overflowingtxt.cxx
index 49284f6..77f4829 100644
--- a/editeng/source/outliner/overflowingtxt.cxx
+++ b/editeng/source/outliner/overflowingtxt.cxx
@@ -31,23 +31,8 @@ OutlinerParaObject 
*NonOverflowingText::ToParaObject(Outliner *pOutliner) const
 return pPObj;
 }
 
-/*
-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 (!HasOtherParas())
-return mHeadTxt;
-
-return mTailTxt;
-}
-
-OUString OverflowingText::GetHeadingLines() const
-{
-return mHeadTxt;
-}
-* */
-
+// The equivalent of ToParaObject for OverflowingText. Here we are prepending 
the overflowing text to the old dest box's text
+// XXX: In a sense a better name for OverflowingText and NonOverflowingText 
are respectively DestLinkText and SourceLinkText
 OutlinerParaObject *OverflowingText::GetJuxtaposedParaObject(Outliner *pOutl, 
OutlinerParaObject *pNextPObj)
 {
 if (mpContentTextObj == NULL) {
@@ -59,14 +44,52 @@ OutlinerParaObject 
*OverflowingText::GetJuxtaposedParaObject(Outliner *pOutl, Ou
 OutlinerParaObject *pOverflowingPObj = new 
OutlinerParaObject(*mpContentTextObj);
 // the OutlinerParaObject constr. at the prev line gives no valid outliner 
mode, so we set it
 pOverflowingPObj-SetOutlinerMode(pOutl-GetOutlinerMode());
+
+/* Actual Text Setting */
 pOutl-SetText(*pOverflowingPObj);
+
+// Set selection position between new and old text
+maInsertionPointSel = impGetEndSelection(pOutl);
+
 pOutl-AddText(*pNextPObj);
 
+// End Text Setting
+
 OutlinerParaObject *pPObj = pOutl-CreateParaObject();
 //pPObj-SetOutlinerMode(pOutl-GetOutlinerMode());
 return pPObj;
 }
 
+ESelection OverflowingText::impGetEndSelection(Outliner *pOutl) const
+{
+const sal_Int32 nParaCount = pOutl-GetParagraphCount();
+const sal_Int32 nLastParaIndex = nParaCount  1 ? nParaCount - 1 : 0;
+Paragraph* pLastPara = pOutl-GetParagraph( nLastParaIndex);
+const sal_Int32 nLenLastPara = pOutl-GetText(pLastPara).getLength();
+// Selection at end of editing area
+ESelection 
aEndSel(nLastParaIndex,nLenLastPara,nLastParaIndex,nLenLastPara);
+return aEndSel;
+}
+
+/*
+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 (!HasOtherParas())
+return mHeadTxt;
+
+return mTailTxt;
+}
+
+OUString OverflowingText::GetHeadingLines() const
+{
+return mHeadTxt;
+}
+* */
+
+
+
 
 OFlowChainedText::OFlowChainedText(Outliner *pOutl)
 {
diff --git a/include/editeng/overflowingtxt.hxx 
b/include/editeng/overflowingtxt.hxx
index 797264b..be5530b 100644
--- a/include/editeng/overflowingtxt.hxx
+++ b/include/editeng/overflowingtxt.hxx
@@ -22,6 +22,7 @@
 
 #include editeng/macros.hxx
 #include editeng/editengdllapi.h
+#include editeng/editdata.hxx
 
 class OUString;
 
@@ -39,9 +40,12 @@ public:
 
 OverflowingText(EditTextObject *pTObj) : mpContentTextObj(pTObj)
 {
+ESelection aStartPos(0,0,0,0);
+maInsertionPointSel = aStartPos;
 }
 
 OutlinerParaObject *GetJuxtaposedParaObject(Outliner *, 
OutlinerParaObject *);
+ESelection GetInsertionPointSel() const;
 
 //OUString GetHeadingLines() const;
 //OUString GetEndingLines() const;
@@ -49,6 +53,9 @@ public:
 
 private:
 const EditTextObject *mpContentTextObj;
+ESelection maInsertionPointSel;
+
+ESelection impGetEndSelection(Outliner *pOutl) const;
 };
 
 class NonOverflowingText {
diff --git a/svx/source/svdraw/textchainflow.cxx 
b/svx/source/svdraw/textchainflow.cxx
index 2647afa..9e794bc 100644
--- a/svx/source/svdraw/textchainflow.cxx
+++ b/svx/source/svdraw/textchainflow.cxx
@@ -63,7 +63,8 @@ void TextChainFlow::impSetFlowOutlinerParams(SdrOutliner *, 
SdrOutliner *)
 void TextChainFlow::impCheckForFlowEvents(SdrOutliner *pFlowOutl, SdrOutliner 
*pParamOutl)
 {
 bool bOldUpdateMode = pFlowOutl-GetUpdateMode();
-// NOTE: Nah you probably don't need this
+
+// XXX: This could be reorganized moving most of this stuff inside 
EditingTextChainFlow (we need update=true anyway for TextChainFlow though)
 if (pParamOutl != NULL)
 {
 // We need this since it's required to check

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

2015-07-08 Thread matteocam
 include/svx/textchain.hxx   |   88 
 svx/source/svdraw/svdedxv.cxx   |   14 -
 svx/source/svdraw/textchain.cxx |   39 ---
 svx/source/svdraw/textchainflow.cxx |2 
 4 files changed, 89 insertions(+), 54 deletions(-)

New commits:
commit 4c9e5c5862d1aed26f96228c2fe01ebf0de8fd01
Author: matteocam matteo.campane...@gmail.com
Date:   Wed Jul 8 10:29:51 2015 -0400

Define macro system for text chain properties

Change-Id: Id50a9996e0b60e0650dbd67fdb4ebbc8ef2f1d4a

diff --git a/include/svx/textchain.hxx b/include/svx/textchain.hxx
index 730489b..efd52ef 100644
--- a/include/svx/textchain.hxx
+++ b/include/svx/textchain.hxx
@@ -20,6 +20,52 @@
 #ifndef INCLUDED_SVX_TEXTCHAIN_HXX
 #define INCLUDED_SVX_TEXTCHAIN_HXX
 
+/*
+ * Properties can be accessed and set from a TextChain with:
+ * - T TextChain::GetPROPNAME(SdrTextObj *)
+ * - void TextChain::SetPROPNAME(SdrTextObj *, T)
+ * where T and PROPNAME are respectively type and name of a property.
+ *
+ * To add a property PROPNAME of type T (and its interface) in TextChain:
+ * 1) Add
+ *  DECL_CHAIN_PROP(PROPNAME, T)
+ *in class ImpChainLinkProperties;
+ * 2) Add
+ *  INIT_CHAIN_PROP(PROPNAME, V)
+ *in constructor of ImpChainLinkProperties below
+ *(V is the initialization value for PROPNAME)
+ *
+ * 2) Add
+ *  DECL_CHAIN_PROP_INTERFACE(PROPNAME, T)
+ *in class TextChain (under public:);
+ * 3)  Add
+ *   IMPL_CHAIN_PROP_INTERFACE(PROPNAME, T)
+ *in file svx/source/svdraw/textchain.cxx
+*/
+
+#define DECL_CHAIN_PROP(PropName, PropType) \
+PropType a##PropName;
+
+#define INIT_CHAIN_PROP(PropName, PropDefault) \
+a##PropName = (PropDefault);
+
+#define DECL_CHAIN_PROP_INTERFACE(PropName, PropType) \
+PropType Get##PropName (SdrTextObj *); \
+void Set##PropName (SdrTextObj *, PropType);
+
+#define IMPL_CHAIN_PROP_INTERFACE(PropName, PropType) \
+PropType TextChain::Get##PropName (SdrTextObj *pTarget) { \
+ImpChainLinkProperties *pLinkProperties = GetLinkProperties(pTarget); \
+return pLinkProperties-a##PropName; \
+} \
+void TextChain::Set##PropName (SdrTextObj *pTarget, PropType aPropParam) \
+{ \
+ImpChainLinkProperties *pLinkProperties = GetLinkProperties(pTarget); \
+pLinkProperties-a##PropName = aPropParam; \
+}
+
+/* End Special Properties Macro */
+
 #include map
 
 class ImpChainLinkProperties;
@@ -39,16 +85,40 @@ enum class CursorChainingEvent
 UNCHANGED
 };
 
+/*
+ * // Note Sure I need the code here
+struct CursorChainingInfo
+{
+public:
+CursorChainingEvent GetEvent() const;
+ESelection GetPreChainingSel() const;
+ESelection GetPostChainingSel() const;
+
+void SetEvent(CursorChainingEvent aEvent) { maEvent = aEvent; }
+void SetPreChainingSel(ESelection aSel) { maPreChainingSel = aSel; }
+void SetPostChainingSel(ESelection aSel) { maPostChaingingSel = aSel; }
+private:
+CursorChainingEvent maEvent;
+ESelection maPreChainingSel;
+ESelection maPostChainingSel;
+};
+* */
+
 class ImpChainLinkProperties
 {
 protected:
 friend class TextChain;
 
-ImpChainLinkProperties();
+ImpChainLinkProperties() {
+INIT_CHAIN_PROP(NilChainingEvent, false)
+INIT_CHAIN_PROP(CursorEvent, CursorChainingEvent::UNCHANGED)
+}
 
+private:
 // NOTE: Remember to set default value in contructor when adding field
-bool bNilChainingEvent;
-CursorChainingEvent aCursorEvent; // XXX: replace with enum instead of 
bool?
+DECL_CHAIN_PROP(NilChainingEvent, bool)
+DECL_CHAIN_PROP(CursorEvent, CursorChainingEvent)
+
 };
 
 
@@ -62,18 +132,18 @@ class TextChain {
 bool IsLinkInChain(SdrTextObj *) const;
 SdrTextObj *GetNextLink(SdrTextObj *) const;
 
-CursorChainingEvent GetCursorEvent(SdrTextObj *);
-void SetCursorEvent(SdrTextObj *, CursorChainingEvent);
-
 ChainLinkId GetId(SdrTextObj *) const;
 ImpChainLinkProperties *GetLinkProperties(SdrTextObj *);
 
+// Specific Link Properties
+DECL_CHAIN_PROP_INTERFACE(CursorEvent, CursorChainingEvent)
+DECL_CHAIN_PROP_INTERFACE(NilChainingEvent, bool)
+
+
+
 // return whether a paragraph is split between the two links in the 
argument
 bool GetLinksHaveMergeableFirstPara(SdrTextObj *, SdrTextObj *);
 
-bool GetNilChainingEvent(SdrTextObj *pTarget);
-void SetNilChainingEvent(SdrTextObj *, bool);
-
 protected:
 LinkPropertiesMap maLinkPropertiesMap;
 };
diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index c09dfb1..04bf0df 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -505,23 +505,9 @@ IMPL_LINK_NOARG(SdrObjEditView,ImpChainingEventHdl)
 // trigger actual chaining
 pTextObj-onChainingEvent();
 
-// XXX: this logic could be put in a separate approppriate class

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

2015-07-08 Thread matteocam
 include/svx/textchain.hxx   |7 ++-
 svx/source/svdraw/svdedxv.cxx   |   19 +--
 svx/source/svdraw/textchain.cxx |1 +
 3 files changed, 16 insertions(+), 11 deletions(-)

New commits:
commit 849d8130c32ed8bd4016bd637eabaf8681615ee6
Author: matteocam matteo.campane...@gmail.com
Date:   Wed Jul 8 10:54:38 2015 -0400

Reset chaining cursor event after handling it

Change-Id: I6c03b4a4340e1ee0c7498dae78c8563b54ef191f

diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index 2908ce7..3b5f021 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -553,6 +553,9 @@ void SdrObjEditView::ImpMoveCursorAfterChainingEvent()
 break;
 }
 
+// Reset event
+pTextChain-SetCursorEvent(pTextObj, CursorChainingEvent::UNCHANGED);
+
 }
 
 IMPL_LINK(SdrObjEditView,ImpOutlinerCalcFieldValueHdl,EditFieldInfo*,pFI)
commit 82183e28056e2e661801c9f549f4be9dcf2d4249
Author: matteocam matteo.campane...@gmail.com
Date:   Wed Jul 8 10:46:13 2015 -0400

Implemented PreChainingSel as a TextChain property

Change-Id: Ifec26d8c49b1471f7ae25deca962516f1480e0dc

diff --git a/include/svx/textchain.hxx b/include/svx/textchain.hxx
index efd52ef..77e3b32 100644
--- a/include/svx/textchain.hxx
+++ b/include/svx/textchain.hxx
@@ -20,6 +20,9 @@
 #ifndef INCLUDED_SVX_TEXTCHAIN_HXX
 #define INCLUDED_SVX_TEXTCHAIN_HXX
 
+#include editeng/editdata.hxx
+#include map
+
 /*
  * Properties can be accessed and set from a TextChain with:
  * - T TextChain::GetPROPNAME(SdrTextObj *)
@@ -66,7 +69,6 @@
 
 /* End Special Properties Macro */
 
-#include map
 
 class ImpChainLinkProperties;
 class SdrTextObj;
@@ -112,12 +114,14 @@ class ImpChainLinkProperties
 ImpChainLinkProperties() {
 INIT_CHAIN_PROP(NilChainingEvent, false)
 INIT_CHAIN_PROP(CursorEvent, CursorChainingEvent::UNCHANGED)
+INIT_CHAIN_PROP(PreChainingSel, ESelection(0,0,0,0));
 }
 
 private:
 // NOTE: Remember to set default value in contructor when adding field
 DECL_CHAIN_PROP(NilChainingEvent, bool)
 DECL_CHAIN_PROP(CursorEvent, CursorChainingEvent)
+DECL_CHAIN_PROP(PreChainingSel, ESelection)
 
 };
 
@@ -138,6 +142,7 @@ class TextChain {
 // Specific Link Properties
 DECL_CHAIN_PROP_INTERFACE(CursorEvent, CursorChainingEvent)
 DECL_CHAIN_PROP_INTERFACE(NilChainingEvent, bool)
+DECL_CHAIN_PROP_INTERFACE(PreChainingSel, ESelection)
 
 
 
diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index 3ca380d..2908ce7 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -500,12 +500,13 @@ IMPL_LINK_NOARG(SdrObjEditView,ImpChainingEventHdl)
 pTextChain-SetNilChainingEvent(pTextObj, true);
 
 // Save previous selection pos
-maPreChainingSel = new ESelection(pOLV-GetSelection());
+pTextChain-SetPreChainingSel(pTextObj, pOLV-GetSelection());
+//maPreChainingSel = new ESelection(pOLV-GetSelection());
 
 // trigger actual chaining
 pTextObj-onChainingEvent();
 
-maCursorEvent = new 
CursorChainingEvent(pTextChain-GetCursorEvent(pTextObj));
+//maCursorEvent = new 
CursorChainingEvent(pTextChain-GetCursorEvent(pTextObj));
 //SdrTextObj *pNextLink = pTextObj-GetNextLinkInChain();
 
 // NOTE: Must be called. Don't let the function return if you set 
it to true and not reset it
@@ -529,16 +530,16 @@ void SdrObjEditView::ImpMoveCursorAfterChainingEvent()
 if (!pTextObj-IsChainable() || !pTextObj-GetNextLinkInChain())
 return;
 
-if(!maCursorEvent || !maPreChainingSel)
-return;
 
 SdrTextObj *pNextLink = pTextObj-GetNextLinkInChain();
 OutlinerView* pOLV = GetTextEditOutlinerView();
 
-switch (*maCursorEvent) {
+TextChain *pTextChain = pTextObj-GetTextChain();
+
+switch ( pTextChain-GetCursorEvent(pTextObj) ) {
 
 case CursorChainingEvent::UNCHANGED:
-pOLV-SetSelection(*maPreChainingSel);
+
pOLV-SetSelection(pTextChain-GetPreChainingSel(pTextObj));
 break;
 case CursorChainingEvent::TO_NEXT_LINK:
 SdrEndTextEdit();
@@ -552,11 +553,6 @@ void SdrObjEditView::ImpMoveCursorAfterChainingEvent()
 break;
 }
 
-// Default case
-// XXX: You should delete the old ones here too.
-maCursorEvent = NULL;
-maPreChainingSel = NULL;
-
 }
 
 IMPL_LINK(SdrObjEditView,ImpOutlinerCalcFieldValueHdl,EditFieldInfo*,pFI)
diff --git a/svx/source/svdraw/textchain.cxx b/svx/source/svdraw/textchain.cxx
index a9b59a9..270712e 100644
--- a/svx/source/svdraw/textchain.cxx
+++ b/svx/source/svdraw/textchain.cxx
@@ -26,6 +26,7 @@
 
 IMPL_CHAIN_PROP_INTERFACE(CursorEvent, CursorChainingEvent)
 IMPL_CHAIN_PROP_INTERFACE(NilChainingEvent, bool)
+IMPL_CHAIN_PROP_INTERFACE(PreChainingSel

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

2015-07-08 Thread matteocam
 svx/source/svdraw/svdedxv.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 777fb6d2791b63daaf0a74ebe9157af7881c5079
Author: matteocam matteo.campane...@gmail.com
Date:   Wed Jul 8 10:31:41 2015 -0400

Change asserts to test+return for cursor pos

Change-Id: Ief817c654ea5ac2b1cbc3ab535e9478dcb242724

diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index 04bf0df..3ca380d 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -529,8 +529,8 @@ void SdrObjEditView::ImpMoveCursorAfterChainingEvent()
 if (!pTextObj-IsChainable() || !pTextObj-GetNextLinkInChain())
 return;
 
-assert(maCursorEvent);
-assert(maPreChainingSel);
+if(!maCursorEvent || !maPreChainingSel)
+return;
 
 SdrTextObj *pNextLink = pTextObj-GetNextLinkInChain();
 OutlinerView* pOLV = GetTextEditOutlinerView();
___
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' - include/svx svx/source

2015-07-08 Thread matteocam
 include/svx/textchainflow.hxx   |   16 
 svx/source/svdraw/svdedxv.cxx   |1 -
 svx/source/svdraw/textchainflow.cxx |   22 ++
 3 files changed, 26 insertions(+), 13 deletions(-)

New commits:
commit d59384c316e6a161ae86edcb8bfaa3b837ff33b8
Author: matteocam matteo.campane...@gmail.com
Date:   Wed Jul 8 11:30:31 2015 -0400

Change Cursor Info only in EditingTextChainFlow

Change-Id: Iaf21679f416607c8c59d1c88484a306727abd7cc

diff --git a/include/svx/textchainflow.hxx b/include/svx/textchainflow.hxx
index 70ff6e4..ade3404 100644
--- a/include/svx/textchainflow.hxx
+++ b/include/svx/textchainflow.hxx
@@ -20,6 +20,9 @@
 #ifndef INCLUDED_SVX_TEXTCHAINFLOW_HXX
 #define INCLUDED_SVX_TEXTCHAINFLOW_HXX
 
+
+#include svx/textchain.hxx
+
 class SdrTextObj;
 class SdrOutliner;
 class NonOverflowingText;
@@ -59,10 +62,11 @@ class TextChainFlow {
 
 //  -- Protected Members --
 protected:
+CursorChainingEvent maCursorEvent;
 
 void impCheckForFlowEvents(SdrOutliner *, SdrOutliner *);
 
-TextChain *GetTextChain();
+TextChain *GetTextChain() const;
 
 virtual void impLeaveOnlyNonOverflowingText(SdrOutliner *);
 virtual void impMoveChainedTextToNextLink(SdrOutliner *);
@@ -77,7 +81,7 @@ class TextChainFlow {
 //  -- Private Members --
 private:
 
-void impUpdateCursorEvent(SdrOutliner *, bool);
+void impUpdateCursorInfo(SdrOutliner *, bool);
 
 SdrTextObj *mpTargetLink;
 SdrTextObj *mpNextLink;
@@ -92,6 +96,7 @@ class TextChainFlow {
 OFlowChainedText *mpOverflChText;
 UFlowChainedText *mpUnderflChText;
 
+// XXX: It would be nice to get rid of this
 bool mbOFisUFinduced;
 };
 
@@ -99,19 +104,22 @@ class TextChainFlow {
 // NOTE: EditingTextChainFlow might be strongly coupled with behavior in 
SdrTextObj::onChainingEvent
 class EditingTextChainFlow : public TextChainFlow
 {
-public:
+public:
 EditingTextChainFlow(SdrTextObj *);
 virtual void CheckForFlowEvents(SdrOutliner *) SAL_OVERRIDE;
 
 //virtual void ExecuteOverflow(SdrOutliner *, SdrOutliner *) SAL_OVERRIDE;
 
-protected:
+protected:
 virtual void impLeaveOnlyNonOverflowingText(SdrOutliner *) SAL_OVERRIDE;
 
 virtual void impSetTextForEditingOutliner(OutlinerParaObject *);
 
 virtual void impSetFlowOutlinerParams(SdrOutliner *, SdrOutliner *) 
SAL_OVERRIDE;
 
+private:
+void impBroadcasCursorInfo() const;
+
 };
 
 #endif // INCLUDED_SVX_TEXTCHAINFLOW_HXX
diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index 3b5f021..2b165c7 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -544,7 +544,6 @@ void SdrObjEditView::ImpMoveCursorAfterChainingEvent()
 case CursorChainingEvent::TO_NEXT_LINK:
 SdrEndTextEdit();
 SdrBeginTextEdit(pNextLink);
-
 //SdrEndTextEdit(true);
 //SdrBeginTextEdit(pNextLink, nullptr, nullptr, false, 
nullptr, nullptr, true, true);
 break;
diff --git a/svx/source/svdraw/textchainflow.cxx 
b/svx/source/svdraw/textchainflow.cxx
index 4b80ea4..2700bf3 100644
--- a/svx/source/svdraw/textchainflow.cxx
+++ b/svx/source/svdraw/textchainflow.cxx
@@ -18,7 +18,6 @@
  */
 
 
-#include svx/textchain.hxx
 #include svx/svdotext.hxx
 #include svx/svdoutl.hxx
 #include editeng/outlobj.hxx
@@ -38,6 +37,8 @@ TextChainFlow::TextChainFlow(SdrTextObj *pChainTarget)
 
 mpOverflChText = NULL;
 mpUnderflChText = NULL;
+
+maCursorEvent = CursorChainingEvent::UNCHANGED;
 }
 
 
@@ -78,7 +79,7 @@ void TextChainFlow::impCheckForFlowEvents(SdrOutliner 
*pFlowOutl, SdrOutliner *p
 bOverflow = bIsPageOverflow  mpNextLink;
 bUnderflow = !bIsPageOverflow   mpNextLink  mpNextLink-HasText();
 
-impUpdateCursorEvent(pFlowOutl, bOverflow);
+impUpdateCursorInfo(pFlowOutl, bOverflow);
 
 if (pParamOutl != NULL)
 {
@@ -96,7 +97,7 @@ void TextChainFlow::impCheckForFlowEvents(SdrOutliner 
*pFlowOutl, SdrOutliner *p
 
 }
 
-void TextChainFlow::impUpdateCursorEvent(SdrOutliner *, bool bIsOverflow)
+void TextChainFlow::impUpdateCursorInfo(SdrOutliner *, bool bIsOverflow)
 {
 // XXX: Current implementation might create problems with UF-
 //  In fact UF causes a
@@ -105,12 +106,10 @@ void TextChainFlow::impUpdateCursorEvent(SdrOutliner *, 
bool bIsOverflow)
 if (bIsOverflow  !mbOFisUFinduced) {
 bool bCursorOut = true; // XXX: Should have real check
 if (bCursorOut) {
-GetTextChain()-SetCursorEvent(GetLinkTarget(),
- CursorChainingEvent::TO_NEXT_LINK);
+maCursorEvent = CursorChainingEvent::TO_NEXT_LINK;
 }
 } else {
-GetTextChain()-SetCursorEvent(GetLinkTarget(),
- CursorChainingEvent::UNCHANGED);
+maCursorEvent = CursorChainingEvent::UNCHANGED;
 }
 }
 
@@ -210,7 +209,7

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

2015-07-08 Thread matteocam
 include/svx/textchain.hxx |5 +++--
 svx/source/svdraw/svdedxv.cxx |2 +-
 2 files changed, 4 insertions(+), 3 deletions(-)

New commits:
commit bfc9fc2eaa7d27bcadc99aa1ea277a83abc69ef9
Author: matteocam matteo.campane...@gmail.com
Date:   Wed Jul 8 11:46:22 2015 -0400

Add and handle CursorChainEvent::NULL_EVENT

Change-Id: I051b2487593271a5b689ba586a6cc1619e77b4a6

diff --git a/include/svx/textchain.hxx b/include/svx/textchain.hxx
index 77e3b32..7920a72 100644
--- a/include/svx/textchain.hxx
+++ b/include/svx/textchain.hxx
@@ -84,7 +84,8 @@ enum class CursorChainingEvent
 {
 TO_NEXT_LINK,
 TO_PREV_LINK,
-UNCHANGED
+UNCHANGED,
+NULL_EVENT
 };
 
 /*
@@ -113,7 +114,7 @@ class ImpChainLinkProperties
 
 ImpChainLinkProperties() {
 INIT_CHAIN_PROP(NilChainingEvent, false)
-INIT_CHAIN_PROP(CursorEvent, CursorChainingEvent::UNCHANGED)
+INIT_CHAIN_PROP(CursorEvent, CursorChainingEvent::NULL_EVENT)
 INIT_CHAIN_PROP(PreChainingSel, ESelection(0,0,0,0));
 }
 
diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index 2b165c7..d893dab 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -553,7 +553,7 @@ void SdrObjEditView::ImpMoveCursorAfterChainingEvent()
 }
 
 // Reset event
-pTextChain-SetCursorEvent(pTextObj, CursorChainingEvent::UNCHANGED);
+pTextChain-SetCursorEvent(pTextObj, CursorChainingEvent::NULL_EVENT);
 
 }
 
___
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 include/editeng include/svx svx/source

2015-07-08 Thread matteocam
 editeng/source/outliner/outliner.cxx   |5 
 editeng/source/outliner/overflowingtxt.cxx |   31 -
 include/editeng/overflowingtxt.hxx |   27 ++---
 include/svx/textchainflow.hxx  |2 -
 svx/source/svdraw/textchainflow.cxx|8 ++-
 5 files changed, 45 insertions(+), 28 deletions(-)

New commits:
commit 7b5adb6f56dcd448cb2f92dd9dc679abb1479d50
Author: matteocam matteo.campane...@gmail.com
Date:   Wed Jul 8 14:41:58 2015 -0400

Add Selection getters to (Non)OverflowingText

Change-Id: Ia5f485c3f3adf6ae0cab3cf12ebb1119048eec83

diff --git a/editeng/source/outliner/outliner.cxx 
b/editeng/source/outliner/outliner.cxx
index 301ee0c..2b03d26 100644
--- a/editeng/source/outliner/outliner.cxx
+++ b/editeng/source/outliner/outliner.cxx
@@ -2144,7 +2144,6 @@ NonOverflowingText *Outliner::GetNonOverflowingText() 
const
 nLen += GetLineLen(nOverflowingPara, nLine);
 }
 
-/* BEGIN Experiment with ESelection and EditTextobject */
 sal_Int32 nStartPara = 0;
 sal_Int32 nStartPos = 0;
 ESelection aNonOverflowingTextSelection;
@@ -2201,7 +2200,6 @@ OverflowingText *Outliner::GetOverflowingText() const
 nLen += GetLineLen(nHeadPara, nLine);
 }
 
-/* BEGIN experiment ESEL */
 sal_uInt32 nOverflowingPara = pEditEngine-GetOverflowingParaNum();
 ESelection aOverflowingTextSel;
 sal_Int32 nLastPara = nParaCount-1;
@@ -2211,9 +2209,6 @@ OverflowingText *Outliner::GetOverflowingText() const
 
 EditTextObject *pTObj = pEditEngine-CreateTextObject(aOverflowingTextSel);
 return new OverflowingText(pTObj);
-
-/* END experiment ESel */
-
 }
 
 void Outliner::ClearOverflowingParaNum()
diff --git a/editeng/source/outliner/overflowingtxt.cxx 
b/editeng/source/outliner/overflowingtxt.cxx
index 77f4829..03ed385 100644
--- a/editeng/source/outliner/overflowingtxt.cxx
+++ b/editeng/source/outliner/overflowingtxt.cxx
@@ -23,6 +23,28 @@
 #include editeng/overflowingtxt.hxx
 #include editeng/outliner.hxx
 #include editeng/outlobj.hxx
+#include editeng/editobj.hxx
+
+ESelection getLastPositionSel(const EditTextObject *pTObj)
+{
+sal_Int32 nLastPara = pTObj-GetParagraphCount()-1;
+// If text is empty
+if (nLastPara  0 )
+nLastPara = 0;
+sal_Int32 nLen = pTObj-GetText(nLastPara).getLength();
+ESelection aEndPos(nLastPara, nLen, nLastPara, nLen);
+
+return aEndPos;
+}
+
+OverflowingText::OverflowingText(EditTextObject *pTObj) : 
mpContentTextObj(pTObj)
+{
+}
+
+ESelection OverflowingText::GetInsertionPointSel() const
+{
+return getLastPositionSel(mpContentTextObj);
+}
 
 OutlinerParaObject *NonOverflowingText::ToParaObject(Outliner *pOutliner) const
 {
@@ -31,6 +53,11 @@ OutlinerParaObject 
*NonOverflowingText::ToParaObject(Outliner *pOutliner) const
 return pPObj;
 }
 
+ESelection NonOverflowingText::GetOverflowPointSel() const
+{
+return getLastPositionSel(mpContentTextObj);
+}
+
 // The equivalent of ToParaObject for OverflowingText. Here we are prepending 
the overflowing text to the old dest box's text
 // XXX: In a sense a better name for OverflowingText and NonOverflowingText 
are respectively DestLinkText and SourceLinkText
 OutlinerParaObject *OverflowingText::GetJuxtaposedParaObject(Outliner *pOutl, 
OutlinerParaObject *pNextPObj)
@@ -49,7 +76,7 @@ OutlinerParaObject 
*OverflowingText::GetJuxtaposedParaObject(Outliner *pOutl, Ou
 pOutl-SetText(*pOverflowingPObj);
 
 // Set selection position between new and old text
-maInsertionPointSel = impGetEndSelection(pOutl);
+//maInsertionPointSel = impGetEndSelection(pOutl);  // XXX: Maybe setting 
in the constructor is just right
 
 pOutl-AddText(*pNextPObj);
 
@@ -60,6 +87,7 @@ OutlinerParaObject 
*OverflowingText::GetJuxtaposedParaObject(Outliner *pOutl, Ou
 return pPObj;
 }
 
+/*
 ESelection OverflowingText::impGetEndSelection(Outliner *pOutl) const
 {
 const sal_Int32 nParaCount = pOutl-GetParagraphCount();
@@ -70,6 +98,7 @@ ESelection OverflowingText::impGetEndSelection(Outliner 
*pOutl) const
 ESelection 
aEndSel(nLastParaIndex,nLenLastPara,nLastParaIndex,nLenLastPara);
 return aEndSel;
 }
+* */
 
 /*
 OUString OverflowingText::GetEndingLines() const
diff --git a/include/editeng/overflowingtxt.hxx 
b/include/editeng/overflowingtxt.hxx
index be5530b..7faa9a9 100644
--- a/include/editeng/overflowingtxt.hxx
+++ b/include/editeng/overflowingtxt.hxx
@@ -36,14 +36,6 @@ class OverflowingText
 {
 
 public:
-// Constructor
-
-OverflowingText(EditTextObject *pTObj) : mpContentTextObj(pTObj)
-{
-ESelection aStartPos(0,0,0,0);
-maInsertionPointSel = aStartPos;
-}
-
 OutlinerParaObject *GetJuxtaposedParaObject(Outliner *, 
OutlinerParaObject *);
 ESelection GetInsertionPointSel() const;
 
@@ -52,25 +44,26 @@ public:
 //bool HasOtherParas() const

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

2015-07-08 Thread matteocam
 editeng/source/outliner/overflowingtxt.cxx |   10 +
 include/editeng/overflowingtxt.hxx |4 +-
 include/svx/textchainflow.hxx  |   11 -
 svx/source/svdraw/svdedxv.cxx  |2 -
 svx/source/svdraw/textchainflow.cxx|   57 -
 5 files changed, 53 insertions(+), 31 deletions(-)

New commits:
commit b0273e17cdf5a0f0877c3bc64543b333727cfdc7
Author: matteocam matteo.campane...@gmail.com
Date:   Wed Jul 8 23:06:07 2015 -0400

Test for actual cursor overflow

Change-Id: Ia306b8ee15d986c773787a500a23a886caf20087

diff --git a/editeng/source/outliner/overflowingtxt.cxx 
b/editeng/source/outliner/overflowingtxt.cxx
index 03ed385..304e04b 100644
--- a/editeng/source/outliner/overflowingtxt.cxx
+++ b/editeng/source/outliner/overflowingtxt.cxx
@@ -126,6 +126,16 @@ OFlowChainedText::OFlowChainedText(Outliner *pOutl)
 mpNonOverflowingTxt = pOutl-GetNonOverflowingText();
 }
 
+ESelection OFlowChainedText::GetInsertionPointSel() const
+{
+return mpOverflowingTxt-GetInsertionPointSel();
+}
+
+ESelection OFlowChainedText::GetOverflowPointSel() const
+{
+return mpNonOverflowingTxt-GetOverflowPointSel();
+}
+
 OutlinerParaObject *OFlowChainedText::CreateOverflowingParaObject(Outliner 
*pOutliner, OutlinerParaObject *pTextToBeMerged)
 {
 // Just return the roughly merged paras fpr now
diff --git a/include/editeng/overflowingtxt.hxx 
b/include/editeng/overflowingtxt.hxx
index 7faa9a9..4e97fcc 100644
--- a/include/editeng/overflowingtxt.hxx
+++ b/include/editeng/overflowingtxt.hxx
@@ -49,7 +49,6 @@ private:
 OverflowingText(EditTextObject *pTObj);
 
 const EditTextObject *mpContentTextObj;
-ESelection maInsertionPointSel;
 };
 
 class NonOverflowingText {
@@ -81,7 +80,8 @@ class EDITENG_DLLPUBLIC OFlowChainedText {
 OutlinerParaObject *CreateOverflowingParaObject(Outliner *, 
OutlinerParaObject *);
 OutlinerParaObject *CreateNonOverflowingParaObject(Outliner *);
 
-ESelection GetInsertionPointSel() const { return 
mpOverflowingTxt-GetInsertionPointSel(); }
+ESelection GetInsertionPointSel() const;
+ESelection GetOverflowPointSel() const;
 
 protected:
 void impSetOutlinerToEmptyTxt(Outliner *);
diff --git a/include/svx/textchainflow.hxx b/include/svx/textchainflow.hxx
index b2373e8..00a04f3 100644
--- a/include/svx/textchainflow.hxx
+++ b/include/svx/textchainflow.hxx
@@ -62,7 +62,12 @@ class TextChainFlow {
 
 //  -- Protected Members --
 protected:
+
+// Cursor related
+bool mbPossiblyCursorOut;
 CursorChainingEvent maCursorEvent;
+ESelection maOverflowPosSel;
+
 
 void impCheckForFlowEvents(SdrOutliner *, SdrOutliner *);
 
@@ -80,8 +85,10 @@ class TextChainFlow {
 
 //  -- Private Members --
 private:
+// XXX: It would be nice to get rid of this
+bool mbOFisUFinduced;
 
-void impUpdateCursorInfo(SdrOutliner *, bool);
+void impUpdateCursorInfo();
 
 SdrTextObj *mpTargetLink;
 SdrTextObj *mpNextLink;
@@ -96,8 +103,6 @@ class TextChainFlow {
 OFlowChainedText *mpOverflChText;
 UFlowChainedText *mpUnderflChText;
 
-// XXX: It would be nice to get rid of this
-bool mbOFisUFinduced;
 };
 
 
diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index d893dab..16373c3 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -499,7 +499,7 @@ IMPL_LINK_NOARG(SdrObjEditView,ImpChainingEventHdl)
 // We prevent to trigger further handling of overflow/underflow 
for pTextObj
 pTextChain-SetNilChainingEvent(pTextObj, true);
 
-// Save previous selection pos
+// Save previous selection pos // NOTE: It must be done to have 
the right CursorEvent in KeyInput
 pTextChain-SetPreChainingSel(pTextObj, pOLV-GetSelection());
 //maPreChainingSel = new ESelection(pOLV-GetSelection());
 
diff --git a/svx/source/svdraw/textchainflow.cxx 
b/svx/source/svdraw/textchainflow.cxx
index 161e615..1df7fe3 100644
--- a/svx/source/svdraw/textchainflow.cxx
+++ b/svx/source/svdraw/textchainflow.cxx
@@ -38,7 +38,8 @@ TextChainFlow::TextChainFlow(SdrTextObj *pChainTarget)
 mpOverflChText = NULL;
 mpUnderflChText = NULL;
 
-maCursorEvent = CursorChainingEvent::UNCHANGED;
+maCursorEvent = CursorChainingEvent::NULL_EVENT;
+mbPossiblyCursorOut = false;
 }
 
 
@@ -79,8 +80,6 @@ void TextChainFlow::impCheckForFlowEvents(SdrOutliner 
*pFlowOutl, SdrOutliner *p
 bOverflow = bIsPageOverflow  mpNextLink;
 bUnderflow = !bIsPageOverflow   mpNextLink  mpNextLink-HasText();
 
-impUpdateCursorInfo(pFlowOutl, bOverflow);
-
 if (pParamOutl != NULL)
 {
 pFlowOutl-SetUpdateMode(bOldUpdateMode);
@@ -92,22 +91,22 @@ void TextChainFlow::impCheckForFlowEvents(SdrOutliner 
*pFlowOutl, SdrOutliner *p
 // Set current underflowing text (if any)
 mpUnderflChText = bUnderflow ? new

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

2015-07-07 Thread matteocam
 svx/source/svdraw/svdedxv.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit acbb6e612333883a573f8f17cab66696d04b899c
Author: matteocam matteo.campane...@gmail.com
Date:   Tue Jul 7 20:43:54 2015 -0400

Disable window switch after overflow

Change-Id: I48c446a608cb9aa912b4ace858aaccb26689fd7d

diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index 8cb9779..febb1c5 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -517,8 +517,8 @@ IMPL_LINK_NOARG(SdrObjEditView,ImpChainingEventHdl)
 pOLV-SetSelection(aPreChainingSel);
 break;
 case CursorChainingEvent::TO_NEXT_LINK:
-SdrEndTextEdit(true);
-SdrBeginTextEdit(pNextLink, nullptr, nullptr, false, 
nullptr, nullptr, true, true);
+//SdrEndTextEdit(true);
+//SdrBeginTextEdit(pNextLink, nullptr, nullptr, false, 
nullptr, nullptr, true, true);
 break;
 case CursorChainingEvent::TO_PREV_LINK:
 // XXX: To be handled
___
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' - include/svx svx/source

2015-07-07 Thread matteocam
 include/svx/textchainflow.hxx   |2 +-
 svx/source/svdraw/textchainflow.cxx |   19 ---
 2 files changed, 13 insertions(+), 8 deletions(-)

New commits:
commit 0b4dfe7c504b67f6aabf168bd7c2f21345de6d13
Author: matteocam matteo.campane...@gmail.com
Date:   Tue Jul 7 22:55:58 2015 -0400

Don't change cursor if UF-induced OF occurs

Change-Id: Ibf3fdee16ca40aed8cde52cc55181fc103b6c81e

diff --git a/include/svx/textchainflow.hxx b/include/svx/textchainflow.hxx
index aa17f1e..70ff6e4 100644
--- a/include/svx/textchainflow.hxx
+++ b/include/svx/textchainflow.hxx
@@ -92,7 +92,7 @@ class TextChainFlow {
 OFlowChainedText *mpOverflChText;
 UFlowChainedText *mpUnderflChText;
 
-
+bool mbOFisUFinduced;
 };
 
 
diff --git a/svx/source/svdraw/textchainflow.cxx 
b/svx/source/svdraw/textchainflow.cxx
index 74f15a1..2647afa 100644
--- a/svx/source/svdraw/textchainflow.cxx
+++ b/svx/source/svdraw/textchainflow.cxx
@@ -34,6 +34,8 @@ TextChainFlow::TextChainFlow(SdrTextObj *pChainTarget)
 
 bUnderflow = bOverflow = false;
 
+mbOFisUFinduced = false;
+
 mpOverflChText = NULL;
 mpUnderflChText = NULL;
 
@@ -73,32 +75,35 @@ void TextChainFlow::impCheckForFlowEvents(SdrOutliner 
*pFlowOutl, SdrOutliner *p
 
 bool bIsPageOverflow = pFlowOutl-IsPageOverflow();
 
-impUpdateCursorEvent(pFlowOutl, bIsPageOverflow);
+// NOTE: overflow and underflow cannot be both true
+bOverflow = bIsPageOverflow  mpNextLink;
+bUnderflow = !bIsPageOverflow   mpNextLink  mpNextLink-HasText();
+
+impUpdateCursorEvent(pFlowOutl, bOverflow);
 
 if (pParamOutl != NULL)
 {
 pFlowOutl-SetUpdateMode(bOldUpdateMode); // XXX: Plausibly should be 
the prev. state
 }
 
-// NOTE: overflow and underflow cannot be both true
-bOverflow = bIsPageOverflow  mpNextLink;
-bUnderflow = !bIsPageOverflow   mpNextLink  mpNextLink-HasText();
-
 // Set (Non)OverflowingTxt here (if any)
 mpOverflChText = bOverflow ? new OFlowChainedText(pFlowOutl) : NULL;
 
 // Set current underflowing text (if any)
 mpUnderflChText = bUnderflow ? new UFlowChainedText(pFlowOutl) : NULL;
 
+// To check whether an overflow is underflow induced or not (useful in 
cursor checking)
+mbOFisUFinduced = bUnderflow;
+
 }
 
-void TextChainFlow::impUpdateCursorEvent(SdrOutliner *pFlowOutl, bool 
bIsOverflow)
+void TextChainFlow::impUpdateCursorEvent(SdrOutliner *, bool bIsOverflow)
 {
 // XXX: Current implementation might create problems with UF-
 //  In fact UF causes a
 
 
-if (bIsOverflow) {
+if (bIsOverflow  !mbOFisUFinduced) {
 bool bCursorOut = true; // XXX: Should have real check
 if (bCursorOut) {
 GetTextChain()-SetCursorEvent(GetLinkTarget(),
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


  1   2   3   4   >