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

matteocam matteo.campanelli at gmail.com
Fri May 29 12:10:00 PDT 2015


 svx/source/svdraw/svdotextdecomposition.cxx |   39 +++++++++++++++++++++++++---
 1 file changed, 35 insertions(+), 4 deletions(-)

New commits:
commit c2defbdb1bac442958e4a01258fb6e5f4c3ba234
Author: matteocam <matteo.campanelli at gmail.com>
Date:   Fri May 29 15:08:57 2015 -0400

    Inserts an arbitrary string in front of 1st para in next box
    
    Change-Id: If3d5257d5ebb866351fadbddc52be906e5d7aad5

diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx
index 5cdea14..5705da5 100644
--- a/svx/source/svdraw/svdotextdecomposition.cxx
+++ b/svx/source/svdraw/svdotextdecomposition.cxx
@@ -738,13 +738,44 @@ void SdrTextObj::impCopyTextInTextObj(SdrTextObj *pNextTextObj) const
     if ( this ==  pNextTextObj )
         return;
 
-   SdrOutliner &rOutliner = ImpGetDrawOutliner();
-   rOutliner.SetStatusEventHdl1(LINK(this,SdrTextObj,ImpDecomposeChainedText));
+    SdrOutliner &rOutliner = ImpGetDrawOutliner();
+
+    // append a string in front of everything
+    // NOTE: Trying with set-text first
 
-   // Push text through the chain if there's any
     if (mpOverflowingText) {
-        pNextTextObj->NbcSetOutlinerParaObject(mpOverflowingText);
+        // Set text first
+
+        rOutliner.SetText(*mpOverflowingText);
+        Paragraph *pFstPara = rOutliner.GetParagraph(0);
+        OUString aTxtFstPara = rOutliner.GetText(pFstPara);
+
+        rOutliner.SetText("X" + aTxtFstPara, pFstPara);
+        // gets the whole thing
+        OutlinerParaObject *pNewText = rOutliner.CreateParaObject();
+        // draws everything - result = "X" ++ overflowingText
+        pNextTextObj->NbcSetOutlinerParaObject(pNewText);
     }
+
+
+    /*
+    // Code inspired by SvxOutlinerForwarder::AppendTextPortion
+    sal_Int32 nLen = 0;
+
+    EditEngine& rEditEngine = const_cast< EditEngine& >( rOutliner.GetEditEngine() );
+    sal_Int32 nParaCount = rEditEngine.GetParagraphCount();
+    DBG_ASSERT( 0 <= nPara && nPara < nParaCount, "paragraph index out of bounds" );
+    if (0 <= nPara && nPara < nParaCount)
+    {
+        nLen = rEditEngine.GetTextLen( nPara );
+        rEditEngine.QuickInsertText( rText, ESelection( nPara, nLen, nPara, nLen ) );
+    }
+    * */
+
+   rOutliner.SetStatusEventHdl1(LINK(this,SdrTextObj,ImpDecomposeChainedText));
+
+   // Push text through the chain if there's any
+
     rOutliner.SetStatusEventHdl1(Link());
 
 }


More information about the Libreoffice-commits mailing list