diff options
author | Eike Rathke <erack@redhat.com> | 2013-05-08 18:12:32 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2013-05-10 14:01:38 +0000 |
commit | 2af1f5691e8d64afd5246d245d7876b5a2cd5cd8 (patch) | |
tree | e8a51d852010730d4af4a14d445664cf8ee6475c /sd/source/ui/func | |
parent | ebef182253e7d49c5439ab5053a7243ad24207a7 (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)
Change-Id: I62d1b9c399cd709a4f93dbac31b219a61c46ec00
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>
Diffstat (limited to 'sd/source/ui/func')
-rw-r--r-- | sd/source/ui/func/fuexpand.cxx | 20 | ||||
-rw-r--r-- | sd/source/ui/func/fuinsfil.cxx | 14 | ||||
-rw-r--r-- | sd/source/ui/func/fuprobjs.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/func/fusumry.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/func/futext.cxx | 2 |
5 files changed, 22 insertions, 22 deletions
diff --git a/sd/source/ui/func/fuexpand.cxx b/sd/source/ui/func/fuexpand.cxx index 2fe6e0984166..ce2e0ba33e91 100644 --- a/sd/source/ui/func/fuexpand.cxx +++ b/sd/source/ui/func/fuexpand.cxx @@ -116,9 +116,9 @@ void FuExpandPage::DoExecute( SfxRequest& ) // remove hard paragraph- and character attributes SfxItemSet aEmptyEEAttr(mpDoc->GetPool(), EE_ITEMS_START, EE_ITEMS_END); - sal_uLong nParaCount1 = pOutl->GetParagraphCount(); + sal_Int32 nParaCount1 = pOutl->GetParagraphCount(); - for (sal_uInt16 nPara = 0; nPara < nParaCount1; nPara++) + for (sal_Int32 nPara = 0; nPara < nParaCount1; nPara++) { pOutl->QuickRemoveCharAttribs(nPara); pOutl->SetParaAttribs(nPara, aEmptyEEAttr); @@ -129,8 +129,8 @@ void FuExpandPage::DoExecute( SfxRequest& ) while (pPara) { - sal_uLong nParaPos = pOutl->GetAbsPos( pPara ); - sal_Int16 nDepth = pOutl->GetDepth( (sal_uInt16) nParaPos ); + sal_Int32 nParaPos = pOutl->GetAbsPos( pPara ); + sal_Int16 nDepth = pOutl->GetDepth( nParaPos ); if ( nDepth == 0 ) { // page with title & structuring! @@ -181,7 +181,7 @@ void FuExpandPage::DoExecute( SfxRequest& ) // create title text objects SdrTextObj* pTextObj = (SdrTextObj*) pPage->GetPresObj(PRESOBJ_TITLE); - OutlinerParaObject* pOutlinerParaObject = pOutl->CreateParaObject( (sal_uInt16) nParaPos, 1); + OutlinerParaObject* pOutlinerParaObject = pOutl->CreateParaObject( nParaPos, 1); pOutlinerParaObject->SetOutlinerMode(OUTLINERMODE_TITLEOBJECT); if( pOutlinerParaObject->GetDepth(0) != -1 ) @@ -205,7 +205,7 @@ void FuExpandPage::DoExecute( SfxRequest& ) SfxStyleSheet* pSheet = pPage->GetStyleSheetForPresObj(PRESOBJ_TITLE); pTextObj->NbcSetStyleSheet(pSheet, sal_False); - sal_uLong nChildCount = pOutl->GetChildCount(pPara); + sal_Int32 nChildCount = pOutl->GetChildCount(pPara); if (nChildCount > 0) { @@ -213,18 +213,18 @@ void FuExpandPage::DoExecute( SfxRequest& ) SdrTextObj* pOutlineObj = (SdrTextObj*) pPage->GetPresObj(PRESOBJ_OUTLINE); pPara = pOutl->GetParagraph( ++nParaPos ); - OutlinerParaObject* pOPO = pOutl->CreateParaObject( (sal_uInt16) nParaPos, (sal_uInt16) nChildCount); + OutlinerParaObject* pOPO = pOutl->CreateParaObject( nParaPos, nChildCount); SdrOutliner* pTempOutl = SdrMakeOutliner( OUTLINERMODE_OUTLINEOBJECT, mpDoc ); pTempOutl->SetText( *pOPO ); - sal_uLong nParaCount2 = pTempOutl->GetParagraphCount(); - sal_uLong nPara; + sal_Int32 nParaCount2 = pTempOutl->GetParagraphCount(); + sal_Int32 nPara; for( nPara = 0; nPara < nParaCount2; nPara++ ) { pTempOutl->SetDepth ( pTempOutl->GetParagraph( nPara ), - pTempOutl->GetDepth((sal_uInt16) nPara ) - 1); + pTempOutl->GetDepth( nPara ) - 1); } delete pOPO; diff --git a/sd/source/ui/func/fuinsfil.cxx b/sd/source/ui/func/fuinsfil.cxx index 96de0c01aa15..e84696fc78f3 100644 --- a/sd/source/ui/func/fuinsfil.cxx +++ b/sd/source/ui/func/fuinsfil.cxx @@ -570,14 +570,14 @@ void FuInsertFile::InsTextOrRTFinOlMode(SfxMedium* pMedium) while( !pDocliner->HasParaFlag( pPara, PARAFLAG_ISPAGE ) ) pPara = pDocliner->GetParent(pPara); - sal_uLong nTargetPos = pDocliner->GetAbsPos(pPara) + 1; + sal_Int32 nTargetPos = pDocliner->GetAbsPos(pPara) + 1; // apply layout of predecessor page sal_uInt16 nPage = 0; pPara = pDocliner->GetParagraph( pDocliner->GetAbsPos( pPara ) - 1 ); while (pPara) { - sal_uLong nPos = pDocliner->GetAbsPos( pPara ); + sal_Int32 nPos = pDocliner->GetAbsPos( pPara ); if ( pDocliner->HasParaFlag( pPara, PARAFLAG_ISPAGE ) ) nPage++; pPara = pDocliner->GetParagraph( nPos - 1 ); @@ -613,14 +613,14 @@ void FuInsertFile::InsTextOrRTFinOlMode(SfxMedium* pMedium) } else { - sal_uLong nParaCount = pOutliner->GetParagraphCount(); + sal_Int32 nParaCount = pOutliner->GetParagraphCount(); // for progress bar: number of level-0-paragraphs sal_uInt16 nNewPages = 0; pPara = pOutliner->GetParagraph( 0 ); while (pPara) { - sal_uLong nPos = pOutliner->GetAbsPos( pPara ); + sal_Int32 nPos = pOutliner->GetAbsPos( pPara ); if( pOutliner->HasParaFlag( pPara, PARAFLAG_ISPAGE ) ) nNewPages++; pPara = pOutliner->GetParagraph( ++nPos ); @@ -637,13 +637,13 @@ void FuInsertFile::InsTextOrRTFinOlMode(SfxMedium* pMedium) pDocliner->GetUndoManager().EnterListAction( String(SdResId(STR_UNDO_INSERT_FILE)), String() ); - sal_uLong nSourcePos = 0; + sal_Int32 nSourcePos = 0; SfxStyleSheet* pStyleSheet = pPage->GetStyleSheetForPresObj( PRESOBJ_OUTLINE ); Paragraph* pSourcePara = pOutliner->GetParagraph( 0 ); while (pSourcePara) { - sal_uLong nPos = pOutliner->GetAbsPos( pSourcePara ); - sal_Int16 nDepth = pOutliner->GetDepth( (sal_uInt16) nPos ); + sal_Int32 nPos = pOutliner->GetAbsPos( pSourcePara ); + sal_Int16 nDepth = pOutliner->GetDepth( nPos ); // only take the last paragraph if it is filled if (nSourcePos < nParaCount - 1 || diff --git a/sd/source/ui/func/fuprobjs.cxx b/sd/source/ui/func/fuprobjs.cxx index 1b4535143d2a..81e3d588b7a7 100644 --- a/sd/source/ui/func/fuprobjs.cxx +++ b/sd/source/ui/func/fuprobjs.cxx @@ -89,14 +89,14 @@ void FuPresentationObjects::DoExecute( SfxRequest& ) std::vector<Paragraph*>::const_iterator iter = aSelList.begin(); Paragraph* pPara = aSelList.empty() ? NULL : *iter; - nDepth = pOutl->GetDepth((sal_uInt16)pOutl->GetAbsPos( pPara ) ); + nDepth = pOutl->GetDepth(pOutl->GetAbsPos( pPara ) ); bool bPage = pOutl->HasParaFlag( pPara, PARAFLAG_ISPAGE ); while( iter != aSelList.end() ) { pPara = *iter; - nTmp = pOutl->GetDepth((sal_uInt16) pOutl->GetAbsPos( pPara ) ); + nTmp = pOutl->GetDepth( pOutl->GetAbsPos( pPara ) ); if( nDepth != nTmp ) { diff --git a/sd/source/ui/func/fusumry.cxx b/sd/source/ui/func/fusumry.cxx index 1d915002af9a..4009e31c7099 100644 --- a/sd/source/ui/func/fusumry.cxx +++ b/sd/source/ui/func/fusumry.cxx @@ -189,9 +189,9 @@ void FuSummaryPage::DoExecute( SfxRequest& ) // remove hard break- and character attributes SfxItemSet aEmptyEEAttr(mpDoc->GetPool(), EE_ITEMS_START, EE_ITEMS_END); - sal_uLong nParaCount = pOutl->GetParagraphCount(); + sal_Int32 nParaCount = pOutl->GetParagraphCount(); - for (sal_uInt16 nPara = 0; nPara < nParaCount; nPara++) + for (sal_Int32 nPara = 0; nPara < nParaCount; nPara++) { pOutl->SetStyleSheet( nPara, pStyle ); pOutl->QuickRemoveCharAttribs(nPara); diff --git a/sd/source/ui/func/futext.cxx b/sd/source/ui/func/futext.cxx index 7830f199a29c..a6c04a596925 100644 --- a/sd/source/ui/func/futext.cxx +++ b/sd/source/ui/func/futext.cxx @@ -1010,7 +1010,7 @@ void FuText::SetInEditMode(const MouseEvent& rMEvt, sal_Bool bQuickDrag) if (!GetTextObj()->GetOutlinerParaObject() && mpView->GetTextEditOutliner()) { ::Outliner* pOutl = mpView->GetTextEditOutliner(); - sal_uLong nParaAnz = pOutl->GetParagraphCount(); + sal_Int32 nParaAnz = pOutl->GetParagraphCount(); Paragraph* p1stPara = pOutl->GetParagraph( 0 ); if (nParaAnz==1 && p1stPara) |