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 /sw | |
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 'sw')
-rw-r--r-- | sw/inc/docufld.hxx | 2 | ||||
-rw-r--r-- | sw/source/core/fields/docufld.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/docxattributeoutput.cxx | 4 | ||||
-rw-r--r-- | sw/source/filter/ww8/docxexport.cxx | 4 | ||||
-rw-r--r-- | sw/source/filter/ww8/rtfsdrexport.cxx | 4 | ||||
-rw-r--r-- | sw/source/filter/ww8/wrtw8esh.cxx | 6 | ||||
-rw-r--r-- | sw/source/filter/ww8/wrtww8.hxx | 4 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8graf.cxx | 8 | ||||
-rw-r--r-- | sw/source/ui/docvw/AnnotationWin.cxx | 4 | ||||
-rw-r--r-- | sw/source/ui/docvw/PostItMgr.cxx | 3 | ||||
-rw-r--r-- | sw/source/ui/docvw/SidebarWin.cxx | 2 | ||||
-rw-r--r-- | sw/source/ui/shells/annotsh.cxx | 4 | ||||
-rw-r--r-- | sw/source/ui/shells/drwtxtsh.cxx | 4 | ||||
-rw-r--r-- | sw/source/ui/shells/langhelper.cxx | 2 | ||||
-rw-r--r-- | sw/source/ui/uno/unotxdoc.cxx | 8 |
15 files changed, 31 insertions, 30 deletions
diff --git a/sw/inc/docufld.hxx b/sw/inc/docufld.hxx index c5c1cfe1a45c..272a6d3bb1c5 100644 --- a/sw/inc/docufld.hxx +++ b/sw/inc/docufld.hxx @@ -556,7 +556,7 @@ public: const OutlinerParaObject* GetTextObject() const; void SetTextObject( OutlinerParaObject* pText ); - sal_uInt32 GetNumberOfParagraphs() const; + sal_Int32 GetNumberOfParagraphs() const; virtual bool QueryValue( com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ) const; virtual bool PutValue( const com::sun::star::uno::Any& rVal, sal_uInt16 nWhich ); diff --git a/sw/source/core/fields/docufld.cxx b/sw/source/core/fields/docufld.cxx index 7f0f2e953a26..521cdcecefcb 100644 --- a/sw/source/core/fields/docufld.cxx +++ b/sw/source/core/fields/docufld.cxx @@ -1849,7 +1849,7 @@ void SwPostItField::SetTextObject( OutlinerParaObject* pText ) mpText = pText; } -sal_uInt32 SwPostItField::GetNumberOfParagraphs() const +sal_Int32 SwPostItField::GetNumberOfParagraphs() const { return (mpText) ? mpText->Count() : 1; } diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 95ce729b259b..6130b7d51f49 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -2618,11 +2618,11 @@ void DocxAttributeOutput::WriteOutliner(const OutlinerParaObject& rParaObj) const EditTextObject& rEditObj = rParaObj.GetTextObject(); MSWord_SdrAttrIter aAttrIter( m_rExport, rEditObj, TXT_HFTXTBOX ); - sal_uInt16 nPara = rEditObj.GetParagraphCount(); + sal_Int32 nPara = rEditObj.GetParagraphCount(); m_pSerializer->startElementNS( XML_w, XML_textbox, FSEND ); m_pSerializer->startElementNS( XML_w, XML_txbxContent, FSEND ); - for (sal_uInt16 n = 0; n < nPara; ++n) + for (sal_Int32 n = 0; n < nPara; ++n) { if( n ) aAttrIter.NextPara( n ); diff --git a/sw/source/filter/ww8/docxexport.cxx b/sw/source/filter/ww8/docxexport.cxx index e04f12d93e91..9840c45704e3 100644 --- a/sw/source/filter/ww8/docxexport.cxx +++ b/sw/source/filter/ww8/docxexport.cxx @@ -756,8 +756,8 @@ void DocxExport::WriteOutliner(const OutlinerParaObject& rParaObj, sal_uInt8 nTy const EditTextObject& rEditObj = rParaObj.GetTextObject(); MSWord_SdrAttrIter aAttrIter( *this, rEditObj, nTyp ); - sal_uInt16 nPara = rEditObj.GetParagraphCount(); - for( sal_uInt16 n = 0; n < nPara; ++n ) + sal_Int32 nPara = rEditObj.GetParagraphCount(); + for( sal_Int32 n = 0; n < nPara; ++n ) { if( n ) aAttrIter.NextPara( n ); diff --git a/sw/source/filter/ww8/rtfsdrexport.cxx b/sw/source/filter/ww8/rtfsdrexport.cxx index b42d0291194e..dc9c1b627ca0 100644 --- a/sw/source/filter/ww8/rtfsdrexport.cxx +++ b/sw/source/filter/ww8/rtfsdrexport.cxx @@ -532,10 +532,10 @@ void RtfSdrExport::WriteOutliner(const OutlinerParaObject& rParaObj) const EditTextObject& rEditObj = rParaObj.GetTextObject(); MSWord_SdrAttrIter aAttrIter( m_rExport, rEditObj, TXT_HFTXTBOX ); - sal_uInt16 nPara = rEditObj.GetParagraphCount(); + sal_Int32 nPara = rEditObj.GetParagraphCount(); m_rAttrOutput.RunText().append('{').append(OOO_STRING_SVTOOLS_RTF_SHPTXT).append(' '); - for (sal_uInt16 n = 0; n < nPara; ++n) + for (sal_Int32 n = 0; n < nPara; ++n) { if( n ) aAttrIter.NextPara( n ); diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx index 2e0ad109b163..6cbd5abf673f 100644 --- a/sw/source/filter/ww8/wrtw8esh.cxx +++ b/sw/source/filter/ww8/wrtw8esh.cxx @@ -843,7 +843,7 @@ MSWord_SdrAttrIter::MSWord_SdrAttrIter( MSWordExportBase& rWr, NextPara( 0 ); } -void MSWord_SdrAttrIter::NextPara( sal_uInt16 nPar ) +void MSWord_SdrAttrIter::NextPara( sal_Int32 nPar ) { nPara = nPar; // Attributwechsel an Pos 0 wird ignoriert, da davon ausgegangen @@ -1123,9 +1123,9 @@ void WW8Export::WriteOutliner(const OutlinerParaObject& rParaObj, sal_uInt8 nTyp const EditTextObject& rEditObj = rParaObj.GetTextObject(); MSWord_SdrAttrIter aAttrIter( *this, rEditObj, nTyp ); - sal_uInt16 nPara = rEditObj.GetParagraphCount(); + sal_Int32 nPara = rEditObj.GetParagraphCount(); sal_uInt8 bNul = 0; - for( sal_uInt16 n = 0; n < nPara; ++n ) + for( sal_Int32 n = 0; n < nPara; ++n ) { if( n ) aAttrIter.NextPara( n ); diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx index 3339bfe614a2..c48e101a97fc 100644 --- a/sw/source/filter/ww8/wrtww8.hxx +++ b/sw/source/filter/ww8/wrtww8.hxx @@ -1398,7 +1398,7 @@ private: std::vector<EECharAttrib> aTxtAtrArr; std::vector<const EECharAttrib*> aChrTxtAtrArr; std::vector<rtl_TextEncoding> aChrSetArr; - sal_uInt16 nPara; + sal_Int32 nPara; xub_StrLen nAktSwPos; xub_StrLen nTmpSwPos; // for HasItem() rtl_TextEncoding eNdChrSet; @@ -1414,7 +1414,7 @@ private: public: MSWord_SdrAttrIter( MSWordExportBase& rWr, const EditTextObject& rEditObj, sal_uInt8 nType ); - void NextPara( sal_uInt16 nPar ); + void NextPara( sal_Int32 nPar ); void OutParaAttr(bool bCharAttr); void OutEEField(const SfxPoolItem& rHt); diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx index e27f56954617..f1b7244531bb 100644 --- a/sw/source/filter/ww8/ww8graf.cxx +++ b/sw/source/filter/ww8/ww8graf.cxx @@ -461,9 +461,9 @@ SdrObject* SwWW8ImplReader::ReadPolyLine( WW8_DPHEAD* pHd, const WW8_DO* pDo, ESelection SwWW8ImplReader::GetESelection( long nCpStart, long nCpEnd ) { - sal_uInt16 nPCnt = mpDrawEditEngine->GetParagraphCount(); - sal_uInt16 nSP = 0; - sal_uInt16 nEP = 0; + sal_Int32 nPCnt = mpDrawEditEngine->GetParagraphCount(); + sal_Int32 nSP = 0; + sal_Int32 nEP = 0; while( (nSP < nPCnt) && (nCpStart >= mpDrawEditEngine->GetTextLen( nSP ) + 1) ) { @@ -478,7 +478,7 @@ ESelection SwWW8ImplReader::GetESelection( long nCpStart, long nCpEnd ) nCpEnd -= mpDrawEditEngine->GetTextLen( nEP ) + 1; nEP++; } - return ESelection( nSP, (sal_uInt16)nCpStart, nEP, (sal_uInt16)nCpEnd ); + return ESelection( nSP, nCpStart, nEP, nCpEnd ); } // InsertTxbxStyAttrs() setzt die Style-Attribute in den uebergebenen ItemSet. diff --git a/sw/source/ui/docvw/AnnotationWin.cxx b/sw/source/ui/docvw/AnnotationWin.cxx index 7aaa4e317be8..2b0da09b3bbe 100644 --- a/sw/source/ui/docvw/AnnotationWin.cxx +++ b/sw/source/ui/docvw/AnnotationWin.cxx @@ -242,12 +242,12 @@ void SwAnnotationWin::InitAnswer(OutlinerParaObject* pText) GetOutlinerView()->InsertText(OUString("..."),false); GetOutlinerView()->InsertText(OUString("\"\n"),false); - GetOutlinerView()->SetSelection(ESelection(0x0,0x0,0xFFFF,0xFFFF)); + GetOutlinerView()->SetSelection(ESelection(0,0,EE_PARA_ALL,EE_TEXTPOS_ALL)); SfxItemSet aAnswerSet( DocView().GetDocShell()->GetPool() ); aAnswerSet.Put(SvxFontHeightItem(200,80,EE_CHAR_FONTHEIGHT)); aAnswerSet.Put(SvxPostureItem(ITALIC_NORMAL,EE_CHAR_ITALIC)); GetOutlinerView()->SetAttribs(aAnswerSet); - GetOutlinerView()->SetSelection(ESelection(0xFFFF,0xFFFF,0xFFFF,0xFFFF)); + GetOutlinerView()->SetSelection(ESelection(EE_PARA_MAX_COUNT,EE_TEXTPOS_MAX_COUNT,EE_PARA_MAX_COUNT,EE_TEXTPOS_MAX_COUNT)); //remove all attributes and reset our standard ones GetOutlinerView()->GetEditView().RemoveAttribsKeepLanguages(true); diff --git a/sw/source/ui/docvw/PostItMgr.cxx b/sw/source/ui/docvw/PostItMgr.cxx index d035f3159f48..d45e5bdf36e6 100644 --- a/sw/source/ui/docvw/PostItMgr.cxx +++ b/sw/source/ui/docvw/PostItMgr.cxx @@ -1766,7 +1766,8 @@ sal_uInt16 SwPostItMgr::SearchReplace(const SwFmtFld &pFld, const ::com::sun::st if (bSrchForward) pWin->GetOutlinerView()->SetSelection(ESelection(0,0,0,0)); else - pWin->GetOutlinerView()->SetSelection(ESelection(0xFFFF,0xFFFF,0xFFFF,0xFFFF)); + pWin->GetOutlinerView()->SetSelection( + ESelection(EE_PARA_MAX_COUNT,EE_TEXTPOS_MAX_COUNT,EE_PARA_MAX_COUNT,EE_TEXTPOS_MAX_COUNT)); SvxSearchItem aItem(SID_SEARCH_ITEM ); aItem.SetSearchOptions(rSearchOptions); aItem.SetBackward(!bSrchForward); diff --git a/sw/source/ui/docvw/SidebarWin.cxx b/sw/source/ui/docvw/SidebarWin.cxx index 37cb17d517f5..fa0fed69916b 100644 --- a/sw/source/ui/docvw/SidebarWin.cxx +++ b/sw/source/ui/docvw/SidebarWin.cxx @@ -761,7 +761,7 @@ void SwSidebarWin::SetLanguage(const SvxLanguageItem aNewItem) Engine()->SetModifyHdl( Link() ); ESelection aOld = GetOutlinerView()->GetSelection(); - ESelection aNewSelection( 0, 0, (sal_uInt16)Engine()->GetParagraphCount()-1, USHRT_MAX ); + ESelection aNewSelection( 0, 0, Engine()->GetParagraphCount()-1, EE_TEXTPOS_ALL ); GetOutlinerView()->SetSelection( aNewSelection ); SfxItemSet aEditAttr(GetOutlinerView()->GetAttribs()); aEditAttr.Put(aNewItem); diff --git a/sw/source/ui/shells/annotsh.cxx b/sw/source/ui/shells/annotsh.cxx index 8e3e08dedaa8..2b0151918950 100644 --- a/sw/source/ui/shells/annotsh.cxx +++ b/sw/source/ui/shells/annotsh.cxx @@ -257,9 +257,9 @@ void SwAnnotationShell::Exec( SfxRequest &rReq ) Outliner * pOutliner = pOLV->GetOutliner(); if(pOutliner) { - sal_uLong nParaCount = pOutliner->GetParagraphCount(); + sal_Int32 nParaCount = pOutliner->GetParagraphCount(); if (nParaCount > 0) - pOLV->SelectRange(0L, sal_uInt16(nParaCount) ); + pOLV->SelectRange(0L, nParaCount ); } break; } diff --git a/sw/source/ui/shells/drwtxtsh.cxx b/sw/source/ui/shells/drwtxtsh.cxx index 6060f6c7b2ed..ca238ae0bfc6 100644 --- a/sw/source/ui/shells/drwtxtsh.cxx +++ b/sw/source/ui/shells/drwtxtsh.cxx @@ -434,9 +434,9 @@ void SwDrawTextShell::ExecDraw(SfxRequest &rReq) SdrOutliner * pOutliner = pSdrView->GetTextEditOutliner(); if(pOutliner) { - sal_uLong nParaCount = pOutliner->GetParagraphCount(); + sal_Int32 nParaCount = pOutliner->GetParagraphCount(); if (nParaCount > 0) - pOLV->SelectRange(0L, sal_uInt16(nParaCount) ); + pOLV->SelectRange(0L, nParaCount ); } } break; diff --git a/sw/source/ui/shells/langhelper.cxx b/sw/source/ui/shells/langhelper.cxx index b8d503caad29..336157533c61 100644 --- a/sw/source/ui/shells/langhelper.cxx +++ b/sw/source/ui/shells/langhelper.cxx @@ -592,7 +592,7 @@ namespace SwLangHelper void SelectPara( EditView &rEditView, const ESelection &rCurSel ) { - ESelection aParaSel( rCurSel.nStartPara, 0, rCurSel.nStartPara, USHRT_MAX ); + ESelection aParaSel( rCurSel.nStartPara, 0, rCurSel.nStartPara, EE_TEXTPOS_ALL ); rEditView.SetSelection( aParaSel ); } diff --git a/sw/source/ui/uno/unotxdoc.cxx b/sw/source/ui/uno/unotxdoc.cxx index 1d502ca092ed..f8d33f0ce148 100644 --- a/sw/source/ui/uno/unotxdoc.cxx +++ b/sw/source/ui/uno/unotxdoc.cxx @@ -3265,12 +3265,12 @@ uno::Sequence< lang::Locale > SAL_CALL SwXTextDocument::getDocumentLanguages( if(pOutliner) { EditEngine& rEditEng = (EditEngine&)pOutliner->GetEditEngine(); - sal_uLong nParCount = pOutliner->GetParagraphCount(); - for (sal_uLong nPar=0; nPar<nParCount; nPar++) + sal_Int32 nParCount = pOutliner->GetParagraphCount(); + for (sal_Int32 nPar=0; nPar<nParCount; nPar++) { //every paragraph std::vector<sal_uInt16> aPortions; - rEditEng.GetPortions( (sal_uInt16)nPar, aPortions ); + rEditEng.GetPortions( nPar, aPortions ); for ( size_t nPos = aPortions.size(); nPos; ) { @@ -3278,7 +3278,7 @@ uno::Sequence< lang::Locale > SAL_CALL SwXTextDocument::getDocumentLanguages( --nPos; sal_uInt16 nEnd = aPortions[ nPos ]; sal_uInt16 nStart = nPos ? aPortions[ nPos - 1 ] : 0; - ESelection aSelection( (sal_uInt16)nPar, nStart, (sal_uInt16)nPar, nEnd ); + ESelection aSelection( nPar, nStart, nPar, nEnd ); SfxItemSet aAttr = rEditEng.GetAttribs( aSelection ); LanguageType nLang = LANGUAGE_DONTKNOW; |