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

matteocam matteo.campanelli at gmail.com
Mon Jun 8 12:25:32 PDT 2015


 editeng/source/editeng/editeng.cxx                |    4 -
 editeng/source/editeng/impedit.hxx                |    3 -
 editeng/source/outliner/outlin2.cxx               |   17 ++++---
 include/editeng/editeng.hxx                       |    5 +-
 include/editeng/editstat.hxx                      |    3 -
 include/editeng/outliner.hxx                      |    5 +-
 include/svx/svdotext.hxx                          |    4 +
 svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx |    2 
 svx/source/svdraw/svdedxv.cxx                     |    2 
 svx/source/svdraw/svdotext.cxx                    |   53 ++++++++++++----------
 svx/source/svdraw/svdotextdecomposition.cxx       |    4 -
 svx/source/svdraw/svdotxed.cxx                    |    8 +++
 svx/source/svdraw/svdoutl.cxx                     |    3 +
 13 files changed, 74 insertions(+), 39 deletions(-)

New commits:
commit 8814f293560bda0859a98c86bc0098064af154f5
Author: matteocam <matteo.campanelli at gmail.com>
Date:   Mon Jun 8 15:24:26 2015 -0400

    Changed handlers from onEditOutlinerStatusEvent to BegTextEdit+SetTextObj
    
    Change-Id: I3234f33bca4b9e74dc7942b0106be6e943925ff5

diff --git a/editeng/source/editeng/editeng.cxx b/editeng/source/editeng/editeng.cxx
index a86e088..6aaf967 100644
--- a/editeng/source/editeng/editeng.cxx
+++ b/editeng/source/editeng/editeng.cxx
@@ -1528,9 +1528,9 @@ void EditEngine::SetStatusEventHdl( const Link& rLink )
     pImpEditEngine->SetStatusEventHdl( rLink );
 }
 
-void EditEngine::SetStatusEventHdl1( const Link& rLink )
+void EditEngine::SetChainingEventHdl( const Link& rLink )
 {
-    pImpEditEngine->SetStatusEventHdlChaining( rLink );
+    pImpEditEngine->SetChainingEventHdl( rLink );
 }
 
 Link EditEngine::GetStatusEventHdl() const
diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx
index 6eabd9c..4bc4eb5 100644
--- a/editeng/source/editeng/impedit.hxx
+++ b/editeng/source/editeng/impedit.hxx
@@ -847,7 +847,8 @@ public:
 
     void            SetStatusEventHdl( const Link& rLink )  { aStatusHdlLink = rLink; }
     Link            GetStatusEventHdl() const               { return aStatusHdlLink; }
-    void            SetStatusEventHdlChaining( const Link& rLink )  { aStatusHdlLinkChaining = rLink; }
+
+    void            SetChainingEventHdl( const Link& rLink )  { aStatusHdlLinkChaining = rLink; }
 
     void            SetNotifyHdl( const Link& rLink )       { aNotifyHdl = rLink; }
     Link            GetNotifyHdl() const            { return aNotifyHdl; }
diff --git a/editeng/source/outliner/outlin2.cxx b/editeng/source/outliner/outlin2.cxx
index ca69fcd..1bf8a7d 100644
--- a/editeng/source/outliner/outlin2.cxx
+++ b/editeng/source/outliner/outlin2.cxx
@@ -118,6 +118,18 @@ Link Outliner::GetModifyHdl() const
     return pEditEngine->GetModifyHdl();
 }
 
+void Outliner::SetChainingEventHdl( const Link& rLink )
+{
+    pEditEngine->SetChainingEventHdl( rLink );
+}
+
+/*
+Link Outliner::GetChainingEventHdl() const
+{
+    return pEditEngine->GetChainingEventHdl();
+}
+*/
+
 void Outliner::SetNotifyHdl( const Link& rLink )
 {
     pEditEngine->aOutlinerNotifyHdl = rLink;
@@ -139,11 +151,6 @@ Link Outliner::GetStatusEventHdl() const
     return pEditEngine->GetStatusEventHdl();
 }
 
-void Outliner::SetStatusEventHdl1( const Link& rLink )
-{
-    pEditEngine->SetStatusEventHdl1( rLink );
-}
-
 void Outliner::SetDefTab( sal_uInt16 nTab )
 {
     pEditEngine->SetDefTab( nTab );
diff --git a/include/editeng/editeng.hxx b/include/editeng/editeng.hxx
index 08c6522..1f9fafb 100644
--- a/include/editeng/editeng.hxx
+++ b/include/editeng/editeng.hxx
@@ -359,9 +359,12 @@ public:
     sal_uLong       Write( SvStream& rOutput, EETextFormat );
 
     void            SetStatusEventHdl( const Link& rLink );
-    void            SetStatusEventHdl1( const Link& rLink ); // for chaining
     Link            GetStatusEventHdl() const;
 
+    void            SetChainingEventHdl( const Link& rLink );
+    //Link            GetChainingEventHdl( const Link& rLink );
+
+
     void            SetNotifyHdl( const Link& rLink );
     Link            GetNotifyHdl() const;
 
diff --git a/include/editeng/editstat.hxx b/include/editeng/editstat.hxx
index 36a816d..0c89b94 100644
--- a/include/editeng/editstat.hxx
+++ b/include/editeng/editstat.hxx
@@ -71,7 +71,6 @@
 #define EE_STAT_TEXTWIDTHCHANGED    0x00000020
 #define EE_STAT_TEXTHEIGHTCHANGED   0x00000040
 #define EE_STAT_WRONGWORDCHANGED    0x00000080
-#define EE_STAT_CHAININGSET     0x00000100
 // #define EE_STAT_MODIFIED         0x00000100
 
 /*
@@ -114,7 +113,7 @@ public:
     sal_Int32&  GetPrevParagraph()          { return nPrevPara; }
 
     bool        IsPageOverflow() const      { return bIsPageOverflow; }
-    void        SetPageOverflow(bool isOverflow) { GetStatusWord() |= EE_STAT_CHAININGSET; bIsPageOverflow = isOverflow; }
+    void        SetPageOverflow(bool isOverflow) { bIsPageOverflow = isOverflow; }
 };
 
 #define SPELLCMD_IGNOREWORD         0x0001
diff --git a/include/editeng/outliner.hxx b/include/editeng/outliner.hxx
index 7093835..0105caf3 100644
--- a/include/editeng/outliner.hxx
+++ b/include/editeng/outliner.hxx
@@ -804,7 +804,10 @@ public:
 
     void            SetStatusEventHdl( const Link& rLink );
     Link            GetStatusEventHdl() const;
-    void            SetStatusEventHdl1( const Link& rLink );
+
+    void            SetChainingEventHdl( const Link& rLink );
+
+
 
     void            Draw( OutputDevice* pOutDev, const Rectangle& rOutRect );
     void            Draw( OutputDevice* pOutDev, const Point& rStartPos, short nOrientation = 0 );
diff --git a/include/svx/svdotext.hxx b/include/svx/svdotext.hxx
index 75df5ed..1da98d9 100644
--- a/include/svx/svdotext.hxx
+++ b/include/svx/svdotext.hxx
@@ -541,6 +541,8 @@ public:
     /** called from the SdrObjEditView during text edit when the status of the edit outliner changes */
     virtual void onEditOutlinerStatusEvent( EditStatus* pEditStatus );
 
+    virtual void onOverflowStatusEvent( bool bIsPageOverflow );
+
 
 
     // transformation interface for StarOfficeAPI. This implements support for
@@ -610,7 +612,7 @@ public:
     void impLeaveOnlyNonOverflowingText() const;
 
     // Handler for Chained Text
-    DECL_LINK(ImpDecomposeChainedText,EditStatus*);
+    DECL_LINK(ImpDecomposeChainedText,bool);
 
     // timing generators
     void impGetBlinkTextTiming(drawinglayer::animation::AnimationEntryList& rAnimList) const;
diff --git a/svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx
index 7e9334c..4e4edee 100644
--- a/svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx
+++ b/svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx
@@ -499,7 +499,7 @@ namespace drawinglayer
             return encapsulateWithTextHierarchyBlockPrimitive2D(aRetval);
         }
 
-        SdrTextPrimitive2D* SdrChainedTextPrimitive2D::createTransformedClone(const basegfx::B2DHomMatrix& rTransform) const
+        SdrTextPrimitive2D* SdrChainedTextPrimitive2D::createTransformedClone(const basegfx::B2DHomMatrix& ) const
         {
             //FIXME(matteocam)
             assert(0);
diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index 03a00c3..e334ecc 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -713,7 +713,7 @@ bool SdrObjEditView::SdrBeginTextEdit(
             pTextEditOutlinerView->ShowCursor();
             pTextEditOutliner->SetStatusEventHdl(LINK(this,SdrObjEditView,ImpOutlinerStatusEventHdl));
             // FIXME(matteocam) // For chaining
-            pTextEditOutliner->SetStatusEventHdl1(LINK(this,SdrObjEditView,ImpOutlinerStatusEventHdl));
+            //pTextEditOutliner->SetStatusEventHdl1(LINK(this,SdrObjEditView,ImpOutlinerStatusEventHdl));
 #ifdef DBG_UTIL
             if (pItemBrowser!=NULL) pItemBrowser->SetDirty();
 #endif
diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx
index 302346d..243cdef 100644
--- a/svx/source/svdraw/svdotext.cxx
+++ b/svx/source/svdraw/svdotext.cxx
@@ -1936,8 +1936,7 @@ void SdrTextObj::onEditOutlinerStatusEvent( EditStatus* pEditStatus )
     const sal_uInt32 nStat = pEditStatus->GetStatusWord();
     const bool bGrowX=(nStat & EE_STAT_TEXTWIDTHCHANGED) !=0;
     const bool bGrowY=(nStat & EE_STAT_TEXTHEIGHTCHANGED) !=0;
-    const bool bChainingSet = (nStat & EE_STAT_CHAININGSET) != 0;
-    if(bTextFrame && (bGrowX || bGrowY || bChainingSet))
+    if(bTextFrame && (bGrowX || bGrowY) )
     {
         if ((bGrowX && IsAutoGrowWidth()) || (bGrowY && IsAutoGrowHeight()))
         {
@@ -1954,31 +1953,42 @@ void SdrTextObj::onEditOutlinerStatusEvent( EditStatus* pEditStatus )
             ImpAutoFitText(*pEdtOutl);
             mbInDownScale = false;
         }
-        else if ( GetNextLinkInChain() != NULL ) // is this a chainable object?
-        {
-            // set whether there is need for chaining
-            // (used in EndTextEdit to crop the overflowing part)
-            // XXX: might be removed later when we remove text in real time
-            SetToBeChained( pEditStatus->IsPageOverflow() );
-            fprintf(stderr, "[CHAINING] Need for Chaining is %s\n",
-                pEditStatus->IsPageOverflow() ? "TRUE" : "FALSE");
-
-            // Pushes text in next link on the fly
-            if ( pEditStatus->IsPageOverflow() ) {
+    }
+}
+
+void SdrTextObj::onOverflowStatusEvent( bool bIsPageOverflow )
+{
+    // FIXME: Should have a IsChainable or something.
+    if (IsAutoGrowWidth() || IsAutoGrowHeight() || IsAutoFit())
+        return;
+
+    if ( GetNextLinkInChain() != NULL ) // is this a chainable object?
+    {
+        // set whether there is need for chaining
+        // (used in EndTextEdit to crop the overflowing part)
+        // XXX: might be removed later when we remove text in real time
+        SetToBeChained( bIsPageOverflow );
+        fprintf(stderr, "[CHAINING] Need for Chaining is %s\n",
+            bIsPageOverflow ? "TRUE" : "FALSE");
+
+        // Pushes text in next link on the fly
+        if ( bIsPageOverflow ) {
+            if (pEdtOutl != NULL)
                 mpOverflowingText = pEdtOutl->GetOverflowingText();
-                SdrTextObj *pNextTextObj = GetNextLinkInChain();
+            else
+                mpOverflowingText = ImpGetDrawOutliner().GetOverflowingText();
 
-                impLeaveOnlyNonOverflowingText();
+            SdrTextObj *pNextTextObj = GetNextLinkInChain();
 
-                // Transfer overflowing text
-                impMoveChainedTextToNextLink(pNextTextObj);
-            }
+            impLeaveOnlyNonOverflowingText();
 
+            // Transfer overflowing text
+            impMoveChainedTextToNextLink(pNextTextObj);
         }
+
     }
 }
 
-
 /** returns the currently active text. */
 SdrText* SdrTextObj::getActiveText() const
 {
@@ -2042,10 +2052,9 @@ SdrTextObj* SdrTextObj::GetNextLinkInChain() const
 
 }
 
-IMPL_LINK(SdrTextObj,ImpDecomposeChainedText,EditStatus*,pEditStat)
+IMPL_LINK(SdrTextObj,ImpDecomposeChainedText,bool,bIsPageOverflow)
 {
-    // XXX: Check on the outliner here?
-    onEditOutlinerStatusEvent( pEditStat );
+    onOverflowStatusEvent( bIsPageOverflow );
     return 0;
 }
 
diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx
index 62dd5d0..71ae619 100644
--- a/svx/source/svdraw/svdotextdecomposition.cxx
+++ b/svx/source/svdraw/svdotextdecomposition.cxx
@@ -778,7 +778,7 @@ void SdrTextObj::impMoveChainedTextToNextLink(SdrTextObj *pNextTextObj) const
 
     SdrOutliner &rOutliner = ImpGetDrawOutliner();
 
-    rOutliner.SetStatusEventHdl1(LINK(this,SdrTextObj,ImpDecomposeChainedText));
+    //rOutliner.SetChainingEventHdl(LINK(this,SdrTextObj,ImpDecomposeChainedText));
 
     if (mpOverflowingText != NULL) {
         // XXX: Not sure if necessary
@@ -836,7 +836,7 @@ void SdrTextObj::impMoveChainedTextToNextLink(SdrTextObj *pNextTextObj) const
         pNextTextObj->NbcSetOutlinerParaObject(pNewText);
     }
 
-    rOutliner.SetStatusEventHdl1(Link());
+//    rOutliner.SetChainingEventHdl(Link());
 
 }
 
diff --git a/svx/source/svdraw/svdotxed.cxx b/svx/source/svdraw/svdotxed.cxx
index 62e2c01..570e284 100644
--- a/svx/source/svdraw/svdotxed.cxx
+++ b/svx/source/svdraw/svdotxed.cxx
@@ -65,6 +65,7 @@ bool SdrTextObj::BegTextEdit(SdrOutliner& rOutl)
 
     // FIXME(matteocam)
     bool bIsChained = true; // XXX: get it from a method
+    // What is this??
     // disable AUTOPAGESIZE
     if ( bIsChained ) {
         sal_uIntPtr nStat1=rOutl.GetControlWord();
@@ -125,6 +126,10 @@ bool SdrTextObj::BegTextEdit(SdrOutliner& rOutl)
     rOutl.UpdateFields();
     rOutl.ClearModifyFlag();
 
+    // FIXME(matteocam)
+    // XXX: Possibly move this (and respective setting line in BegTextEdit) in SdrObjEditView::SdrEnd(Begin)TextEdit?
+    rOutl.SetChainingEventHdl(LINK(this,SdrTextObj,ImpDecomposeChainedText) );
+
     return true;
 }
 
@@ -310,6 +315,9 @@ void SdrTextObj::EndTextEdit(SdrOutliner& rOutl)
     // we do not need the bookmark at the overflowing check anymore.
     rOutl.ClearOverflowingParaNum();
 
+    // FIXME(matteocam)
+    rOutl.SetChainingEventHdl(Link());
+
     pEdtOutl = NULL;
     rOutl.Clear();
     sal_uInt32 nStat = rOutl.GetControlWord();
diff --git a/svx/source/svdraw/svdoutl.cxx b/svx/source/svdraw/svdoutl.cxx
index 3b14316..7245cd3 100644
--- a/svx/source/svdraw/svdoutl.cxx
+++ b/svx/source/svdraw/svdoutl.cxx
@@ -61,6 +61,9 @@ void SdrOutliner::SetTextObj( const SdrTextObj* pObj )
         SetMaxAutoPaperSize( aMaxSize );
         SetPaperSize( aMaxSize );
         ClearPolygon();
+
+        // FIXME(matteoca)
+        SetChainingEventHdl( LINK(pObj,SdrTextObj,ImpDecomposeChainedText) );
     }
 
     mpTextObj.reset( const_cast< SdrTextObj* >(pObj) );


More information about the Libreoffice-commits mailing list