summaryrefslogtreecommitdiff
path: root/editeng/source/editeng/impedit.cxx
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2013-05-08 18:12:32 +0200
committerFridrich Strba <fridrich@documentfoundation.org>2013-06-28 12:00:06 +0000
commitda11528150df545a31df3c9863bd4c3925ccdf21 (patch)
treead7eb65227b7d03972637fcaf23a8b96cc1c55a4 /editeng/source/editeng/impedit.cxx
parent7f50f4092b7beafa5545a9a783dde760b260df4c (diff)
resolved fdo#35756 import more than 64k HTML table cells
Enhanced EditEngine to be able to hold more than 64k paragraphs. Used also in RTF import Calc and Writer, so that could benefit as well. * changed all EditEngine,Outliner,... related paragraph index/count variables from sal_uInt16 to sal_Int32 * sal_Int32 instead of sal_uInt32 to match accessibility API * matched some Outliner methods' paragraph parameters from sal_uLong to sal_Int32 * containers capable to hold size_t nevertheless are limited to a maximum of sal_Int32 * changed definition of EE_PARA_NOT_FOUND and EE_PARA_ALL to SAL_MAX_INT32 + added EE_PARA_MAX_COUNT and EE_TEXTPOS_MAX_COUNT to initialize ESelection with what previously were hard coded 0xFFFF all over the place + for similar reason added EE_TEXTPOS_ALL corresponding to EE_PARA_ALL to initialize an ESelection spanning all available text like aSel(0,0,EE_PARA_ALL,EE_TEXTPOS_ALL) Reviewed-on: https://gerrit.libreoffice.org/3838 Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com> (cherry picked from commit 2af1f5691e8d64afd5246d245d7876b5a2cd5cd8) Conflicts: editeng/inc/editeng/editeng.hxx editeng/inc/editeng/outliner.hxx editeng/inc/editeng/unoedprx.hxx editeng/inc/editeng/unoedsrc.hxx editeng/inc/editeng/unofored.hxx editeng/inc/editeng/unoforou.hxx editeng/inc/editeng/unotext.hxx editeng/source/accessibility/AccessibleHyperlink.cxx editeng/source/accessibility/AccessibleHyperlink.hxx editeng/source/editeng/editeng.cxx editeng/source/editeng/editobj.cxx editeng/source/editeng/editobj2.hxx editeng/source/editeng/impedit.hxx editeng/source/editeng/impedit3.cxx editeng/source/editeng/impedit4.cxx editeng/source/outliner/outleeng.cxx editeng/source/outliner/outleeng.hxx editeng/source/outliner/outliner.cxx editeng/source/outliner/outlvw.cxx editeng/source/uno/unoedprx.cxx editeng/source/uno/unofored.cxx editeng/source/uno/unoforou.cxx editeng/source/uno/unotext.cxx include/editeng/editobj.hxx sc/inc/editutil.hxx sc/qa/unit/subsequent_filters-test.cxx sc/source/core/data/cellvalue.cxx sc/source/core/tool/editutil.cxx sc/source/filter/xml/xmlcelli.hxx sc/source/ui/unoobj/fielduno.cxx sd/source/ui/inc/OutlineView.hxx sd/source/ui/view/drtxtob1.cxx starmath/source/accessibility.cxx starmath/source/accessibility.hxx svx/inc/svx/svdoutl.hxx svx/source/accessibility/AccessibleEmptyEditSource.cxx svx/source/sdr/properties/textproperties.cxx svx/source/svdraw/svdoutl.cxx Change-Id: I62d1b9c399cd709a4f93dbac31b219a61c46ec00 Reviewed-on: https://gerrit.libreoffice.org/4368 Reviewed-by: Fridrich Strba <fridrich@documentfoundation.org> Tested-by: Fridrich Strba <fridrich@documentfoundation.org>
Diffstat (limited to 'editeng/source/editeng/impedit.cxx')
-rw-r--r--editeng/source/editeng/impedit.cxx37
1 files changed, 19 insertions, 18 deletions
diff --git a/editeng/source/editeng/impedit.cxx b/editeng/source/editeng/impedit.cxx
index 4caa60222e06..ceced7baccba 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -171,9 +171,9 @@ void ImpEditView::DrawSelection( EditSelection aTmpSel, Region* pRegion )
ContentNode* pStartNode = aTmpSel.Min().GetNode();
ContentNode* pEndNode = aTmpSel.Max().GetNode();
- sal_uInt16 nStartPara = pEditEngine->GetEditDoc().GetPos( pStartNode );
- sal_uInt16 nEndPara = pEditEngine->GetEditDoc().GetPos( pEndNode );
- for ( sal_uInt16 nPara = nStartPara; nPara <= nEndPara; nPara++ )
+ sal_Int32 nStartPara = pEditEngine->GetEditDoc().GetPos( pStartNode );
+ sal_Int32 nEndPara = pEditEngine->GetEditDoc().GetPos( pEndNode );
+ for ( sal_Int32 nPara = nStartPara; nPara <= nEndPara; nPara++ )
{
ParaPortion* pTmpPortion = pEditEngine->GetParaPortions().SafeGetObject( nPara );
DBG_ASSERT( pTmpPortion, "Portion in Selection not found!" );
@@ -638,8 +638,8 @@ void ImpEditView::ShowCursor( sal_Bool bGotoCursor, sal_Bool bForceVisCursor, sa
EditPaM aPaM( aEditSelection.Max() );
sal_uInt16 nTextPortionStart = 0;
- sal_uInt16 nPara = pEditEngine->GetEditDoc().GetPos( aPaM.GetNode() );
- if (nPara == USHRT_MAX) // #i94322
+ sal_Int32 nPara = pEditEngine->GetEditDoc().GetPos( aPaM.GetNode() );
+ if (nPara == EE_PARA_NOT_FOUND) // #i94322
return;
const ParaPortion* pParaPortion = pEditEngine->GetParaPortions()[nPara];
@@ -1130,8 +1130,8 @@ String ImpEditView::SpellIgnoreOrAddWord( sal_Bool bAdd )
xDic->add( aWord, sal_False, String() );
}
EditDoc& rDoc = pEditEngine->GetEditDoc();
- sal_uInt16 nNodes = rDoc.Count();
- for ( sal_uInt16 n = 0; n < nNodes; n++ )
+ sal_Int32 nNodes = rDoc.Count();
+ for ( sal_Int32 n = 0; n < nNodes; n++ )
{
ContentNode* pNode = rDoc.GetObject( n );
pNode->GetWrongList()->MarkWrongsInvalid();
@@ -1158,7 +1158,7 @@ void ImpEditView::DeleteSelected()
ShowCursor( DoAutoScroll(), sal_True );
}
-const SvxFieldItem* ImpEditView::GetField( const Point& rPos, sal_uInt16* pPara, sal_uInt16* pPos ) const
+const SvxFieldItem* ImpEditView::GetField( const Point& rPos, sal_Int32* pPara, sal_uInt16* pPos ) const
{
if( !GetOutputArea().IsInside( rPos ) )
return 0;
@@ -1193,10 +1193,10 @@ const SvxFieldItem* ImpEditView::GetField( const Point& rPos, sal_uInt16* pPara,
return NULL;
}
-sal_Bool ImpEditView::IsBulletArea( const Point& rPos, sal_uInt16* pPara )
+sal_Bool ImpEditView::IsBulletArea( const Point& rPos, sal_Int32* pPara )
{
if ( pPara )
- *pPara = 0xFFFF;
+ *pPara = EE_PARA_NOT_FOUND;
if( !GetOutputArea().IsInside( rPos ) )
return sal_False;
@@ -1206,7 +1206,7 @@ sal_Bool ImpEditView::IsBulletArea( const Point& rPos, sal_uInt16* pPara )
if ( aPaM.GetIndex() == 0 )
{
- sal_uInt16 nPara = pEditEngine->GetEditDoc().GetPos( aPaM.GetNode() );
+ sal_Int32 nPara = pEditEngine->GetEditDoc().GetPos( aPaM.GetNode() );
Rectangle aBulletArea = pEditEngine->GetBulletArea( nPara );
long nY = pEditEngine->GetDocPosTopLeft( nPara ).Y();
const ParaPortion* pParaPortion = pEditEngine->GetParaPortions()[nPara];
@@ -1341,9 +1341,9 @@ sal_Bool ImpEditView::IsInSelection( const EditPaM& rPaM )
aSel.Adjust( pEditEngine->GetEditDoc() );
- sal_uInt16 nStartNode = pEditEngine->GetEditDoc().GetPos( aSel.Min().GetNode() );
- sal_uInt16 nEndNode = pEditEngine->GetEditDoc().GetPos( aSel.Max().GetNode() );
- sal_uInt16 nCurNode = pEditEngine->GetEditDoc().GetPos( rPaM.GetNode() );
+ sal_Int32 nStartNode = pEditEngine->GetEditDoc().GetPos( aSel.Min().GetNode() );
+ sal_Int32 nEndNode = pEditEngine->GetEditDoc().GetPos( aSel.Max().GetNode() );
+ sal_Int32 nCurNode = pEditEngine->GetEditDoc().GetPos( rPaM.GetNode() );
if ( ( nCurNode > nStartNode ) && ( nCurNode < nEndNode ) )
return sal_True;
@@ -1531,7 +1531,8 @@ void ImpEditView::dragGestureRecognized( const ::com::sun::star::datatransfer::d
else
{
// Field?!
- sal_uInt16 nPara, nPos;
+ sal_Int32 nPara;
+ sal_uInt16 nPos;
Point aMousePos = GetWindow()->PixelToLogic( aMousePosPixel );
const SvxFieldItem* pField = GetField( aMousePos, &nPara, &nPos );
if ( pField )
@@ -1553,7 +1554,7 @@ void ImpEditView::dragGestureRecognized( const ::com::sun::star::datatransfer::d
EditPaM aStartPaM( pEditEngine->GetEditDoc().GetObject( nPara ), 0 );
EditPaM aEndPaM( aStartPaM );
const SfxInt16Item& rLevel = (const SfxInt16Item&) pEditEngine->GetParaAttrib( nPara, EE_PARA_OUTLLEVEL );
- for ( sal_uInt16 n = nPara +1; n < pEditEngine->GetEditDoc().Count(); n++ )
+ for ( sal_Int32 n = nPara +1; n < pEditEngine->GetEditDoc().Count(); n++ )
{
const SfxInt16Item& rL = (const SfxInt16Item&) pEditEngine->GetParaAttrib( n, EE_PARA_OUTLLEVEL );
if ( rL.GetValue() > rLevel.GetValue() )
@@ -1612,7 +1613,7 @@ void ImpEditView::dragDropEnd( const ::com::sun::star::datatransfer::dnd::DragSo
ESelection aNewSel( pDragAndDropInfo->aDropSel.nEndPara, pDragAndDropInfo->aDropSel.nEndPos,
pDragAndDropInfo->aDropSel.nEndPara, pDragAndDropInfo->aDropSel.nEndPos );
sal_Bool bBeforeSelection = aDropPos.IsLess( pDragAndDropInfo->aBeginDragSel );
- sal_uInt16 nParaDiff = pDragAndDropInfo->aBeginDragSel.nEndPara - pDragAndDropInfo->aBeginDragSel.nStartPara;
+ sal_Int32 nParaDiff = pDragAndDropInfo->aBeginDragSel.nEndPara - pDragAndDropInfo->aBeginDragSel.nStartPara;
if ( bBeforeSelection )
{
// Adjust aToBeDelSel.
@@ -1843,7 +1844,7 @@ void ImpEditView::dragOver( const ::com::sun::star::datatransfer::dnd::DropTarge
pDragAndDropInfo->aDropDest = aPaM;
if ( pDragAndDropInfo->bOutlinerMode )
{
- sal_uInt16 nPara = pEditEngine->GetEditDoc().GetPos( aPaM.GetNode() );
+ sal_Int32 nPara = pEditEngine->GetEditDoc().GetPos( aPaM.GetNode() );
ParaPortion* pPPortion = pEditEngine->GetParaPortions().SafeGetObject( nPara );
long nDestParaStartY = pEditEngine->GetParaPortions().GetYOffset( pPPortion );
long nRel = aDocPos.Y() - nDestParaStartY;