[Libreoffice-commits] core.git: Branch 'feature/gsoc14-draw-chained-text-boxes' - editeng/source
matteocam
matteo.campanelli at gmail.com
Fri Aug 8 07:38:50 PDT 2014
editeng/source/editeng/impedit.hxx | 2 +-
editeng/source/editeng/impedit3.cxx | 4 ++--
editeng/source/outliner/outliner.cxx | 6 +++---
3 files changed, 6 insertions(+), 6 deletions(-)
New commits:
commit 1671b24b4d64875f56967bed4e9068c0d7e693f9
Author: matteocam <matteo.campanelli at gmail.com>
Date: Fri Aug 8 16:38:14 2014 +0200
Fixed off-by-one in Outliner::GetNonOverflowingParaObject
Change-Id: Ifbb3e0282735e69d17a2c6ebd1586ed26ddcb9e2
diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx
index 2ed9175..d53e5fd 100644
--- a/editeng/source/editeng/impedit.hxx
+++ b/editeng/source/editeng/impedit.hxx
@@ -1023,7 +1023,7 @@ public:
sal_Int32 GetOverflowingParaNum() const { return mnOverflowingPara; }
void SetOverflowingParaNum(sal_Int32 nPara) { mnOverflowingPara = nPara; }
void ClearOverflowingParaNum() { mnOverflowingPara = -1; }
- void UpdateOverflowingParaNum();
+ void UpdateOverflowingParaNum( sal_uInt32 );
};
inline EPaM ImpEditEngine::CreateEPaM( const EditPaM& rPaM )
diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx
index a29e3ad..9944878 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -4601,7 +4601,7 @@ void ImpEditEngine::ImplExpandCompressedPortions( EditLine* pLine, ParaPortion*
}
}
-void ImpEditEngine::UpdateOverflowingParaNum()
+void ImpEditEngine::UpdateOverflowingParaNum(sal_uInt32 nPaperHeight)
{
sal_uInt32 nY = 0;
sal_uInt32 nPH;
@@ -4610,7 +4610,7 @@ void ImpEditEngine::UpdateOverflowingParaNum()
ParaPortion* pPara = GetParaPortions()[nPara];
nPH = pPara->GetHeight();
nY += nPH;
- if ( nY > aPaperSize.Height() /*nCurTextHeight*/ ) // found first paragraph overflowing
+ if ( nY > nPaperHeight /*nCurTextHeight*/ ) // found first paragraph overflowing
{
SetOverflowingParaNum( nPara );
fprintf(stderr, "[CHAINING] Setting first overflowing para: %d\n", nPara);
diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx
index 66d9cd4..1ecef6b 100644
--- a/editeng/source/outliner/outliner.cxx
+++ b/editeng/source/outliner/outliner.cxx
@@ -2098,9 +2098,9 @@ OutlinerParaObject *Outliner::GetNonOverflowingParaObject() const
if ( GetParagraphCount() < 1 )
return NULL;
- // XXX: returns first paragraph
sal_Int32 nStartPara = 0;
- sal_Int32 nCount = pEditEngine->GetOverflowingParaNum()-1;
+ // last non-overflowing paragraph is before the first overflowing one
+ sal_Int32 nCount = pEditEngine->GetOverflowingParaNum();
//sal_Int32 nCount = 1;
if ( nCount == 0 ) // Only overflowing text
@@ -2130,7 +2130,7 @@ OutlinerParaObject *Outliner::GetNonOverflowingParaObject() const
}
OutlinerParaObject *Outliner::GetOverflowingParaObject() const
{
- if ( pEditEngine->GetOverflowingParaNum() )
+ if ( pEditEngine->GetOverflowingParaNum() >= 0)
return CreateParaObject( pEditEngine->GetOverflowingParaNum() );
return NULL;
More information about the Libreoffice-commits
mailing list