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

2014-08-14 Thread matteocam
 editeng/source/editeng/impedit.hxx  |2 +
 editeng/source/editeng/impedit3.cxx |   43 
 include/editeng/editstat.hxx|   12 +-
 svx/source/svdraw/svdotext.cxx  |6 ++---
 4 files changed, 36 insertions(+), 27 deletions(-)

New commits:
commit b515d44b620f9f667a0fb172583a62d0300e5a21
Author: matteocam 
Date:   Thu Aug 14 17:59:54 2014 +0200

Fixed overflow and chaining in edit status

Change-Id: I5c9c2f37056674090551dff1ccf90d306cc456f5

diff --git a/editeng/source/editeng/impedit3.cxx 
b/editeng/source/editeng/impedit3.cxx
index 19d2452..e299061 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -619,7 +619,6 @@ void ImpEditEngine::CheckPageOverflow()
 // which paragraph is the first to cause higher size of the box?
 UpdateOverflowingParaNum( nBoxHeight /*aPrevPaperSize.Height()*/ ); // 
XXX: currently only for horizontal text
 aStatus.SetPageOverflow(true);
-aStatus.GetStatusWord() |= 0x0100;
 } else
 {
 // No overflow if withing box boundaries
diff --git a/include/editeng/editstat.hxx b/include/editeng/editstat.hxx
index 0aadd3d..36a816d 100644
--- a/include/editeng/editstat.hxx
+++ b/include/editeng/editstat.hxx
@@ -71,6 +71,7 @@
 #define EE_STAT_TEXTWIDTHCHANGED0x0020
 #define EE_STAT_TEXTHEIGHTCHANGED   0x0040
 #define EE_STAT_WRONGWORDCHANGED0x0080
+#define EE_STAT_CHAININGSET 0x0100
 // #define EE_STAT_MODIFIED 0x0100
 
 /*
@@ -91,14 +92,15 @@ protected:
 sal_uLong   nStatusBits;
 sal_uLong   nControlBits;
 sal_Int32   nPrevPara;  // for EE_STAT_CRSRLEFTPARA
-
 boolbIsPageOverflow;
 
 public:
-EditStatus(){ nStatusBits = 0; nControlBits = 0;
-  nPrevPara = -1; bIsPageOverflow = 
false; }
+EditStatus(){ nStatusBits = 0;
+  nControlBits = 0;
+  nPrevPara = -1;
+  bIsPageOverflow = false; }
 
-voidClear() { nStatusBits = 0; /*bIsPageOverflow = 
false;*/ }
+voidClear() { nStatusBits = 0; bIsPageOverflow = 
false; }
 voidSetControlBits( sal_uLong nMask, bool bOn )
 { SetFlags( nControlBits, nMask, bOn ); }
 
@@ -112,7 +114,7 @@ public:
 sal_Int32&  GetPrevParagraph()  { return nPrevPara; }
 
 boolIsPageOverflow() const  { return bIsPageOverflow; }
-voidSetPageOverflow(bool isOverflow) { bIsPageOverflow = 
isOverflow; }
+voidSetPageOverflow(bool isOverflow) { GetStatusWord() |= 
EE_STAT_CHAININGSET; bIsPageOverflow = isOverflow; }
 };
 
 #define SPELLCMD_IGNOREWORD 0x0001
diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx
index ed6a201..a93d7bc 100644
--- a/svx/source/svdraw/svdotext.cxx
+++ b/svx/source/svdraw/svdotext.cxx
@@ -1935,8 +1935,8 @@ 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 bOverflow = (nStat & 0x0100) != 0;
-if(bTextFrame && (bGrowX || bGrowY || bOverflow))
+const bool bChainingSet = (nStat & EE_STAT_CHAININGSET) != 0;
+if(bTextFrame && (bGrowX || bGrowY || bChainingSet))
 {
 if ((bGrowX && IsAutoGrowWidth()) || (bGrowY && IsAutoGrowHeight()))
 {
@@ -1953,7 +1953,7 @@ void SdrTextObj::onEditOutlinerStatusEvent( EditStatus* 
pEditStatus )
 ImpAutoFitText(*pEdtOutl);
 mbInDownScale = false;
 }
-else if ( GetNextLinkInChain() != NULL && bOverflow ) // do it only if 
it is a call explicitly for chaining (status word already cleared)
+else if ( GetNextLinkInChain() != NULL )
 {
 // set the need for chaining
 SetToBeChained( pEditStatus->IsPageOverflow() );
commit 9f7ebc397fbc6602ac3787f77a61cd05d1716bf0
Author: matteocam 
Date:   Thu Aug 14 17:08:34 2014 +0200

Overflow detection coupled with handler. Using status word for overflow

Change-Id: I01abba89b4e14016d3c21103410963ead2cd097b

diff --git a/editeng/source/editeng/impedit.hxx 
b/editeng/source/editeng/impedit.hxx
index ac95eaa..e8ede1b 100644
--- a/editeng/source/editeng/impedit.hxx
+++ b/editeng/source/editeng/impedit.hxx
@@ -552,6 +552,8 @@ private:
 voidRecalcFormatterFontMetrics( FormatterFontMetric& 
rCurMetrics, SvxFont& rFont );
 voidCheckAutoPageSize();
 
+voidCheckPageOverflow();
+
 voidImpBreakLine( ParaPortion* pParaPortion, EditLine* 
pLine, TextPortion* pPortion, sal_Int32 nPo

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

2014-07-17 Thread matteocam
 editeng/source/editeng/impedit.hxx  |2 ++
 editeng/source/editeng/impedit3.cxx |   18 +++---
 include/editeng/editstat.hxx|7 ++-
 svx/source/svdraw/svdotext.cxx  |4 
 4 files changed, 19 insertions(+), 12 deletions(-)

New commits:
commit 8f2cfe1d868a43ce293528a09cd44f4e018be755
Author: matteocam 
Date:   Fri Jul 18 02:03:21 2014 +0200

IsPageOverflow in ImpEditEngine. PageOverflow in EditStatus.

Change-Id: I3f2bba42b1f59278db43990c48cfa600ff739d2f

diff --git a/editeng/source/editeng/impedit.hxx 
b/editeng/source/editeng/impedit.hxx
index 9252bd0..506d597 100644
--- a/editeng/source/editeng/impedit.hxx
+++ b/editeng/source/editeng/impedit.hxx
@@ -260,8 +260,6 @@ protected:
 throw (::com::sun::star::uno::RuntimeException,
std::exception) SAL_OVERRIDE;
 
-bool IsPageOverflow( const Size aCurPaperSize, const Size aPrevPaperSize ) 
const;
-
 void ShowDDCursor( const Rectangle& rRect );
 void HideDDCursor();
 
@@ -727,6 +725,8 @@ public:
 const Size& GetMaxAutoPaperSize() const { return 
aMaxAutoPaperSize; }
 voidSetMaxAutoPaperSize( const Size& rSz )  { 
aMaxAutoPaperSize = rSz; }
 
+bool IsPageOverflow( const Size aCurPaperSize, const Size aPrevPaperSize ) 
const;
+
 voidFormatDoc();
 voidFormatFullDoc();
 voidUpdateViews( EditView* pCurView = 0 );
diff --git a/editeng/source/editeng/impedit3.cxx 
b/editeng/source/editeng/impedit3.cxx
index bef5162..48c2450 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -542,11 +542,8 @@ void ImpEditEngine::CheckAutoPageSize()
 SetValidPaperSize( aPaperSize );// consider Min, Max
 
 // FIXME(matteocam)
-fprintf( stderr, IsPageOverflow( aStatus.GetStatusWord(),
-IsVertical(),
-aPrevPaperSize,
-aPaperSize)
- ? "YES Overflow!\n"  : "NO Overflow!\n" );
+fprintf( stderr, IsPageOverflow(aPaperSize, aPrevPaperSize)
+? "YES Overflow!\n"  : "NO Overflow!\n" );
 
 if ( aPaperSize != aPrevPaperSize )
 {
diff --git a/include/editeng/editstat.hxx b/include/editeng/editstat.hxx
index 8fd9f40..e62ef82 100644
--- a/include/editeng/editstat.hxx
+++ b/include/editeng/editstat.hxx
@@ -92,8 +92,11 @@ protected:
 sal_uLong   nControlBits;
 sal_Int32   nPrevPara;  // for EE_STAT_CRSRLEFTPARA
 
+boolbIsPageOverflow;
+
 public:
-EditStatus(){ nStatusBits = 0; nControlBits = 0; 
nPrevPara = -1; }
+EditStatus(){ nStatusBits = 0; nControlBits = 0;
+  nPrevPara = -1; bIsPageOverflow = 
false; }
 
 voidClear() { nStatusBits = 0; }
 voidSetControlBits( sal_uLong nMask, bool bOn )
@@ -107,6 +110,8 @@ public:
 
 sal_Int32   GetPrevParagraph() const{ return nPrevPara; }
 sal_Int32&  GetPrevParagraph()  { return nPrevPara; }
+
+boolIsPageOverflow() const  { return bIsPageOverflow; }
 };
 
 #define SPELLCMD_IGNOREWORD 0x0001
diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx
index 5d113a9..b24d90d 100644
--- a/svx/source/svdraw/svdotext.cxx
+++ b/svx/source/svdraw/svdotext.cxx
@@ -1925,6 +1925,10 @@ void SdrTextObj::onEditOutlinerStatusEvent( EditStatus* 
pEditStatus )
 ImpAutoFitText(*pEdtOutl);
 mbInDownScale = false;
 }
+else if (IsChained() && pEditStatus->IsOverflow())
+{
+
+}
 }
 }
 
commit 02ee8c2b17c8c96ad89a79c8c8c5e419c7161552
Author: matteocam 
Date:   Thu Jul 17 23:20:07 2014 +0200

IsPageOverflow in ImpEditEngine

Change-Id: If6f7641de8e182df6231db7895d4809a7ddb3acb

diff --git a/editeng/source/editeng/impedit.hxx 
b/editeng/source/editeng/impedit.hxx
index b225ac6..9252bd0 100644
--- a/editeng/source/editeng/impedit.hxx
+++ b/editeng/source/editeng/impedit.hxx
@@ -260,6 +260,8 @@ protected:
 throw (::com::sun::star::uno::RuntimeException,
std::exception) SAL_OVERRIDE;
 
+bool IsPageOverflow( const Size aCurPaperSize, const Size aPrevPaperSize ) 
const;
+
 void ShowDDCursor( const Rectangle& rRect );
 void HideDDCursor();
 
diff --git a/editeng/source/editeng/impedit3.cxx 
b/editeng/source/editeng/impedit3.cxx
index b291967..bef5162 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -353,19 +353,18 @@ void ImpEditEngine::FormatFullDoc()
 FormatDoc();
 }
 
-bool IsPageOverflow(const sal_uInt32 aStatus, bool isVertical,
-const Size aPrevPaperSize, const Size aPaperSize)
+bool ImpEditEngine::IsPageOverflow( const Size aCurPaperSize, const Size 
aPrevPape

[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 
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 
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