summaryrefslogtreecommitdiff
path: root/svx/source/svdraw
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 /svx/source/svdraw
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 'svx/source/svdraw')
-rw-r--r--svx/source/svdraw/svdedxv.cxx17
-rw-r--r--svx/source/svdraw/svdomeas.cxx2
-rw-r--r--svx/source/svdraw/svdotext.cxx4
-rw-r--r--svx/source/svdraw/svdotextpathdecomposition.cxx8
-rw-r--r--svx/source/svdraw/svdotxat.cxx12
-rw-r--r--svx/source/svdraw/svdotxed.cxx2
-rw-r--r--svx/source/svdraw/svdotxfl.cxx2
-rw-r--r--svx/source/svdraw/svdoutl.cxx2
-rw-r--r--svx/source/svdraw/svdview.cxx4
9 files changed, 26 insertions, 27 deletions
diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index f047b7839959..15365ead6ad9 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -1249,11 +1249,11 @@ sal_Bool SdrObjEditView::ImpIsTextEditAllSelected() const
{
if(SdrTextObj::HasTextImpl( pTextEditOutliner ) )
{
- const sal_uInt32 nParaAnz=pTextEditOutliner->GetParagraphCount();
+ const sal_Int32 nParaAnz=pTextEditOutliner->GetParagraphCount();
Paragraph* pLastPara=pTextEditOutliner->GetParagraph( nParaAnz > 1 ? nParaAnz - 1 : 0 );
ESelection aESel(pTextEditOutlinerView->GetSelection());
- if (aESel.nStartPara==0 && aESel.nStartPos==0 && aESel.nEndPara==sal_uInt16(nParaAnz-1))
+ if (aESel.nStartPara==0 && aESel.nStartPos==0 && aESel.nEndPara==(nParaAnz-1))
{
XubString aStr(pTextEditOutliner->GetText(pLastPara));
@@ -1261,7 +1261,7 @@ sal_Bool SdrObjEditView::ImpIsTextEditAllSelected() const
bRet = sal_True;
}
// in case the selection was done backwards
- if (!bRet && aESel.nEndPara==0 && aESel.nEndPos==0 && aESel.nStartPara==sal_uInt16(nParaAnz-1))
+ if (!bRet && aESel.nEndPara==0 && aESel.nEndPos==0 && aESel.nStartPara==(nParaAnz-1))
{
XubString aStr(pTextEditOutliner->GetText(pLastPara));
@@ -1550,9 +1550,8 @@ sal_Bool SdrObjEditView::SetStyleSheet(SfxStyleSheet* pStyleSheet, sal_Bool bDon
{
Outliner* pOutliner = pTextEditOutlinerView->GetOutliner();
- const sal_uIntPtr nParaCount = pOutliner->GetParagraphCount();
- sal_uIntPtr nPara;
- for( nPara = 0; nPara < nParaCount; nPara++ )
+ const sal_Int32 nParaCount = pOutliner->GetParagraphCount();
+ for( sal_Int32 nPara = 0; nPara < nParaCount; nPara++ )
{
pOutliner->SetStyleSheet( nPara, pStyleSheet );
}
@@ -1916,11 +1915,11 @@ void SdrObjEditView::ApplyFormatPaintBrushToText( SfxItemSet& rFormatSet, SdrTex
SdrOutliner& rOutliner = rTextObj.ImpGetDrawOutliner();
rOutliner.SetText(*pParaObj);
- sal_uInt32 nParaCount(rOutliner.GetParagraphCount());
+ sal_Int32 nParaCount(rOutliner.GetParagraphCount());
if(nParaCount)
{
- for(sal_uInt16 nPara = 0; nPara < nParaCount; nPara++)
+ for(sal_Int32 nPara = 0; nPara < nParaCount; nPara++)
{
if( !bNoCharacterFormats )
rOutliner.QuickRemoveCharAttribs( nPara, /* remove all */0 );
@@ -1930,7 +1929,7 @@ void SdrObjEditView::ApplyFormatPaintBrushToText( SfxItemSet& rFormatSet, SdrTex
rOutliner.SetParaAttribs(nPara, aSet);
}
- OutlinerParaObject* pTemp = rOutliner.CreateParaObject(0, (sal_uInt16)nParaCount);
+ OutlinerParaObject* pTemp = rOutliner.CreateParaObject(0, nParaCount);
rOutliner.Clear();
rTextObj.NbcSetOutlinerParaObjectForText(pTemp,pText);
diff --git a/svx/source/svdraw/svdomeas.cxx b/svx/source/svdraw/svdomeas.cxx
index a2ad1574dca5..f85c5cd1b094 100644
--- a/svx/source/svdraw/svdomeas.cxx
+++ b/svx/source/svdraw/svdomeas.cxx
@@ -571,7 +571,7 @@ basegfx::B2DPolyPolygon SdrMeasureObj::ImpCalcXPoly(const ImpMeasurePoly& rPol)
return aRetval;
}
-bool SdrMeasureObj::CalcFieldValue(const SvxFieldItem& rField, sal_uInt16 nPara, sal_uInt16 nPos,
+bool SdrMeasureObj::CalcFieldValue(const SvxFieldItem& rField, sal_Int32 nPara, sal_uInt16 nPos,
bool bEdit,
Color*& rpTxtColor, Color*& rpFldColor, XubString& rRet) const
{
diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx
index 7a662aa645a2..3edc37bdf3f1 100644
--- a/svx/source/svdraw/svdotext.cxx
+++ b/svx/source/svdraw/svdotext.cxx
@@ -468,7 +468,7 @@ bool SdrTextObj::HasTextImpl( SdrOutliner* pOutliner )
if(pOutliner)
{
Paragraph* p1stPara=pOutliner->GetParagraph( 0 );
- sal_uIntPtr nParaAnz=pOutliner->GetParagraphCount();
+ sal_Int32 nParaAnz=pOutliner->GetParagraphCount();
if(p1stPara==NULL)
nParaAnz=0;
@@ -843,7 +843,7 @@ OutlinerParaObject* SdrTextObj::GetEditOutlinerParaObject() const
OutlinerParaObject* pPara=NULL;
if( HasTextImpl( pEdtOutl ) )
{
- sal_uInt16 nParaAnz = static_cast< sal_uInt16 >( pEdtOutl->GetParagraphCount() );
+ sal_Int32 nParaAnz = pEdtOutl->GetParagraphCount();
pPara = pEdtOutl->CreateParaObject(0, nParaAnz);
}
return pPara;
diff --git a/svx/source/svdraw/svdotextpathdecomposition.cxx b/svx/source/svdraw/svdotextpathdecomposition.cxx
index 2bb9e7a6193a..097b47639177 100644
--- a/svx/source/svdraw/svdotextpathdecomposition.cxx
+++ b/svx/source/svdraw/svdotextpathdecomposition.cxx
@@ -74,7 +74,7 @@ namespace
String maText;
xub_StrLen mnTextStart;
xub_StrLen mnTextLength;
- sal_uInt16 mnParagraph;
+ sal_Int32 mnParagraph;
xub_StrLen mnIndex;
SvxFont maFont;
::std::vector< double > maDblDXArray; // double DXArray, font size independent -> unit coordinate system
@@ -127,7 +127,7 @@ namespace
const String& getText() const { return maText; }
xub_StrLen getTextStart() const { return mnTextStart; }
xub_StrLen getTextLength() const { return mnTextLength; }
- sal_uInt16 getParagraph() const { return mnParagraph; }
+ sal_Int32 getParagraph() const { return mnParagraph; }
xub_StrLen getIndex() const { return mnIndex; }
const SvxFont& getFont() const { return maFont; }
bool isRTL() const { return mbRTL; }
@@ -705,7 +705,7 @@ void SdrTextObj::impDecomposePathTextPrimitive(
// get loop count
sal_uInt32 nLoopCount(rPathPolyPolygon.count());
- if(rOutliner.GetParagraphCount() < nLoopCount)
+ if(static_cast<sal_uInt32>(rOutliner.GetParagraphCount()) < nLoopCount)
{
nLoopCount = rOutliner.GetParagraphCount();
}
@@ -730,7 +730,7 @@ void SdrTextObj::impDecomposePathTextPrimitive(
{
const impPathTextPortion& rCandidate = rPathTextPortions[b];
- if(rCandidate.getParagraph() == a)
+ if(static_cast<sal_uInt32>(rCandidate.getParagraph()) == a)
{
aParagraphTextPortions.push_back(&rCandidate);
}
diff --git a/svx/source/svdraw/svdotxat.cxx b/svx/source/svdraw/svdotxat.cxx
index 30ee13c1adb4..e4877dd649fa 100644
--- a/svx/source/svdraw/svdotxat.cxx
+++ b/svx/source/svdraw/svdotxat.cxx
@@ -234,9 +234,9 @@ void SdrTextObj::ImpSetTextStyleSheetListeners()
const EditTextObject& rTextObj=pOutlinerParaObject->GetTextObject();
XubString aStyleName;
SfxStyleFamily eStyleFam;
- sal_uInt16 nParaAnz=rTextObj.GetParagraphCount();
+ sal_Int32 nParaAnz=rTextObj.GetParagraphCount();
- for(sal_uInt16 nParaNum(0); nParaNum < nParaAnz; nParaNum++)
+ for(sal_Int32 nParaNum(0); nParaNum < nParaAnz; nParaNum++)
{
rTextObj.GetStyleSheet(nParaNum, aStyleName, eStyleFam);
@@ -335,7 +335,7 @@ void SdrTextObj::RemoveOutlinerCharacterAttribs( const std::vector<sal_uInt16>&
pOutliner->SetText(*pOutlinerParaObject);
}
- ESelection aSelAll( 0, 0, 0xffff, 0xffff );
+ ESelection aSelAll( 0, 0, EE_PARA_ALL, EE_TEXTPOS_ALL );
std::vector<sal_uInt16>::const_iterator aIter( rCharWhichIds.begin() );
while( aIter != rCharWhichIds.end() )
{
@@ -344,8 +344,8 @@ void SdrTextObj::RemoveOutlinerCharacterAttribs( const std::vector<sal_uInt16>&
if(!pEdtOutl || (pText != getActiveText()) )
{
- const sal_uInt32 nParaCount = pOutliner->GetParagraphCount();
- OutlinerParaObject* pTemp = pOutliner->CreateParaObject(0, (sal_uInt16)nParaCount);
+ const sal_Int32 nParaCount = pOutliner->GetParagraphCount();
+ OutlinerParaObject* pTemp = pOutliner->CreateParaObject(0, nParaCount);
pOutliner->Clear();
NbcSetOutlinerParaObjectForText(pTemp, pText);
}
@@ -364,7 +364,7 @@ bool SdrTextObj::HasText() const
if( pOPO )
{
const EditTextObject& rETO = pOPO->GetTextObject();
- sal_uInt16 nParaCount = rETO.GetParagraphCount();
+ sal_Int32 nParaCount = rETO.GetParagraphCount();
if( nParaCount > 0 )
bHasText = (nParaCount > 1) || (rETO.GetText( 0 ).Len() != 0);
diff --git a/svx/source/svdraw/svdotxed.cxx b/svx/source/svdraw/svdotxed.cxx
index a92b17cdc0b6..07f72bf7a6a2 100644
--- a/svx/source/svdraw/svdotxed.cxx
+++ b/svx/source/svdraw/svdotxed.cxx
@@ -234,7 +234,7 @@ void SdrTextObj::EndTextEdit(SdrOutliner& rOutl)
// to make the gray field background vanish again
rOutl.UpdateFields();
- sal_uInt16 nParaAnz = static_cast< sal_uInt16 >( rOutl.GetParagraphCount() );
+ sal_Int32 nParaAnz = rOutl.GetParagraphCount();
pNewText = rOutl.CreateParaObject( 0, nParaAnz );
// need to end edit mode early since SetOutlinerParaObject already
diff --git a/svx/source/svdraw/svdotxfl.cxx b/svx/source/svdraw/svdotxfl.cxx
index d83419f590d9..264f5e4ac36c 100644
--- a/svx/source/svdraw/svdotxfl.cxx
+++ b/svx/source/svdraw/svdotxfl.cxx
@@ -40,7 +40,7 @@ void SdrRegisterFieldClasses()
///////////////////////////////////////////////////////////////////////////////////////////////// */
-bool SdrTextObj::CalcFieldValue(const SvxFieldItem& /*rField*/, sal_uInt16 /*nPara*/, sal_uInt16 /*nPos*/,
+bool SdrTextObj::CalcFieldValue(const SvxFieldItem& /*rField*/, sal_Int32 /*nPara*/, sal_uInt16 /*nPos*/,
bool /*bEdit*/, Color*& /*rpTxtColor*/, Color*& /*rpFldColor*/, XubString& /*rRet*/) const
{
return false;
diff --git a/svx/source/svdraw/svdoutl.cxx b/svx/source/svdraw/svdoutl.cxx
index f7bd33e70725..35bf43038d86 100644
--- a/svx/source/svdraw/svdoutl.cxx
+++ b/svx/source/svdraw/svdoutl.cxx
@@ -74,7 +74,7 @@ void SdrOutliner::SetTextObjNoInit( const SdrTextObj* pObj )
mpTextObj.reset( const_cast< SdrTextObj* >(pObj) );
}
-XubString SdrOutliner::CalcFieldValue(const SvxFieldItem& rField, sal_uInt16 nPara, sal_uInt16 nPos,
+XubString SdrOutliner::CalcFieldValue(const SvxFieldItem& rField, sal_Int32 nPara, sal_uInt16 nPos,
Color*& rpTxtColor, Color*& rpFldColor)
{
bool bOk = false;
diff --git a/svx/source/svdraw/svdview.cxx b/svx/source/svdraw/svdview.cxx
index 1b1f0c3ad967..aa267b0e60cc 100644
--- a/svx/source/svdraw/svdview.cxx
+++ b/svx/source/svdraw/svdview.cxx
@@ -1228,7 +1228,7 @@ XubString SdrView::GetStatusText()
ESelection aSel(pTextEditOutlinerView->GetSelection());
long nPar=aSel.nEndPara,nLin=0,nCol=aSel.nEndPos;
if (aSel.nEndPara>0) {
- for (sal_uInt16 nParaNum=0; nParaNum<aSel.nEndPara; nParaNum++) {
+ for (sal_Int32 nParaNum=0; nParaNum<aSel.nEndPara; nParaNum++) {
nLin+=pTextEditOutliner->GetLineCount(nParaNum);
}
}
@@ -1345,7 +1345,7 @@ SdrViewContext SdrView::GetContext() const
void SdrView::MarkAll()
{
if (IsTextEdit()) {
- GetTextEditOutlinerView()->SetSelection(ESelection(0,0,0xFFFF,0xFFFF));
+ GetTextEditOutlinerView()->SetSelection(ESelection(0,0,EE_PARA_ALL,EE_TEXTPOS_ALL));
#ifdef DBG_UTIL
if (pItemBrowser!=NULL) pItemBrowser->SetDirty();
#endif