[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 
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 
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_MEASUREKIND"MeasureKind"
 #define UNO_NAME_MEASURETEXTHPOS"MeasureTextHorizontalPosition"
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::UnoType::get(),
   0,  0},   \
 { OUString(UNO_NAME_TEXT_VERTADJUST),   SDRATTR_TEXT_VERTADJUST,   
 cppu::UnoType::get(),0,  0},\
 { OUString(UNO_NAME_TEXT_WORDWRAP), SDRATTR_TEXT_WORDWRAP, 
 cppu::UnoType::get(),0,  0}, \
+{ OUString(UNO_NAME_TEXT_CHAINNEXTNAME),SDRATTR_TEXT_CHAINNEXTNAME,
 ::cppu::UnoType::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[SDRATTR_TEXT_CHAINNEXTNAME-SDRATTR_START]=new 
SfxStringItem(SDRATTR_TEXT_CHAINNEXTNAME, "");

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

2015-06-15 Thread matteocam
 include/editeng/overflowingtxt.hxx  |2 -
 include/svx/svdotext.hxx|7 ++-
 svx/source/svdraw/svdotext.cxx  |   22 +++
 svx/source/svdraw/svdotextdecomposition.cxx |   55 +---
 4 files changed, 46 insertions(+), 40 deletions(-)

New commits:
commit 9aa0cc23f6e7fcf7bad76ec66bec397bb1267b31
Author: matteocam 
Date:   Mon Jun 15 14:20:20 2015 -0400

Prevent decomposition primitives to be called recursively

Change-Id: Iab626d01c7b2850feb1f5d792373615a65e32070

diff --git a/svx/source/svdraw/svdotextdecomposition.cxx 
b/svx/source/svdraw/svdotextdecomposition.cxx
index 6a0e40d..b030462 100644
--- a/svx/source/svdraw/svdotextdecomposition.cxx
+++ b/svx/source/svdraw/svdotextdecomposition.cxx
@@ -775,6 +775,7 @@ OutlinerParaObject 
*SdrTextObj::impGetNonOverflowingParaObject(SdrOutliner *pOut
  return pOutliner->CreateParaObject();
 }
 
+/* Following function should not be called while decomposing static text */
 void SdrTextObj::impLeaveOnlyNonOverflowingText(SdrOutliner *pOutliner) const
 {
 OutlinerParaObject *pNewText = impGetNonOverflowingParaObject(pOutliner);
@@ -1566,36 +1567,6 @@ void SdrTextObj::impDecomposeChainedTextPrimitive(
 const drawinglayer::primitive2d::SdrChainedTextPrimitive2D& 
rSdrChainedTextPrimitive,
 const drawinglayer::geometry::ViewInformation2D& aViewInformation) 
const
 {
-/* // Previous code - To maybe be resumed later on
-// FIXME(matteocam)
-// fprintf(stderr, "Object #0 = %p, Object #1 = %p\n",
-//  pPage->GetObj(0), pPage->GetObj(1));
-
-//impMoveChainedTextToNextLink(pNextTextObj); // just do it
-
-// put overflowing text in next text box
-if (IsToBeChained()) {
-SdrTextObj *pNextTextObj = GetNextLinkInChain();
-assert (pNextTextObj);
-// NOTE: Commented because we do not need to do this anymore (maybe 
and for now)
-//impMoveChainedTextToNextLink(pNextTextObj); // XXX: it actually 
moves the overflowing text currently
-
-// XXX:
-//const_cast(this)->impLeaveOnlyNonOverflowingText();
-// Let's reset the status now to prevent infinite loops
-const_cast(this)->SetToBeChained( false );
-impLeaveOnlyNonOverflowingText();
-
-//SdrOutliner rOutl = pNextTextObj->ImpGetDrawOutliner();
-//pNextTextObj->BegTextEdit( rOutl );
-// XXX: Also, will all those calls currently in 
impMoveChainedTextToNextLink be necessary too?
-
-}*/
-
-/* -- Beginning code from impDecomposeAutoFitText -- */
-// XXX: The idea is, _for_now_, to do exactly what it does there but 
without the text stretching,
-//  hopefully to get a "neutral" decomposition
-
 // decompose matrix to have position and size of text
 basegfx::B2DVector aScale, aTranslate;
 double fRotate, fShearX;
@@ -1659,13 +1630,21 @@ void SdrTextObj::impDecomposeChainedTextPrimitive(
 if ( rOutliner.IsPageOverflow() && !IsInEditMode()) {
 // Save the overflowing text before changing the outliner's state
 const_cast(this)->mpOverflowingText = 
rOutliner.GetOverflowingText();
-impLeaveOnlyNonOverflowingText(&rOutliner);
+
+/* Leave only non overflowing text */
+OutlinerParaObject *pNewTextCurBox = 
impGetNonOverflowingParaObject(&rOutliner);
+// we need this when we are in editing mode
+// XXX: we use next line just to be sure for now
+if (pEdtOutl != NULL)
+pEdtOutl->SetText(*pNewTextCurBox);
+// adds it to current outliner anyway (useful in static decomposition)
+rOutliner.SetText(*pNewTextCurBox);
 
 /* Get chaining outliner  here */
 // Code adapted from ImpGetDrawOutliner
 SdrOutliner &rChainingOutl = pModel->GetChainingOutliner(this);
 ImpInitDrawOutliner( rChainingOutl );
-rOutliner.SetUpdateMode(true);
+rChainingOutl.SetUpdateMode(true);
 
 /* Transfer of text to next link */
 if (GetNextLinkInChain()
commit b570fb9b63b01823d99345736e55385fcc1734fc
Author: matteocam 
Date:   Fri Jun 12 12:11:37 2015 -0400

Special case of dragging handled. Transfer of text by decomposition 
prevented

Change-Id: Ib84d087a73e957583047a3206171dfe3ab906b7f

diff --git a/include/editeng/overflowingtxt.hxx 
b/include/editeng/overflowingtxt.hxx
index 1546835..973729f 100644
--- a/include/editeng/overflowingtxt.hxx
+++ b/include/editeng/overflowingtxt.hxx
@@ -56,7 +56,7 @@ class NonOverflowingText {
   mPreOverflowingTxt(preOverflowingTxt)
 {
 if (pHeadParas == NULL) // Redundant line for debugging
-DBG_ASSERT( pHeadParas != NULL, "pHeadParas is null?!" 
);
+DBG_ASSERT( pHeadParas != NULL, "pHeadParas is null?! 
All text is overflowing then" );
 }
 };
 
diff --git a/include/svx/svdotext.hxx b/include/svx