summaryrefslogtreecommitdiff
path: root/editeng
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2018-04-07 11:45:13 +0200
committerStephan Bergmann <sbergman@redhat.com>2018-04-07 14:13:18 +0200
commitd36f7c5bd2115fcdd26ba8ff7b6a0446dea70bd4 (patch)
tree5ae4b15f3302a538ac55d714ba0529ca4c1de87a /editeng
parent61d57bcebd1a246603cbcd9ad5e0a7df1a8d66cd (diff)
Revert "long->sal_Int32 in tools/gen.hxx"
This reverts commit 8bc951daf79decbd8a599a409c6d33c5456710e0. As discussed at <https://lists.freedesktop.org/archives/libreoffice/2018-April/079955.html> "long->sal_Int32 in tools/gen.hxx", that commit caused lots of problems with signed integer overflow, and the original plan was to redo it to consistently use sal_Int64 instead of sal_Int32. <https://gerrit.libreoffice.org/#/c/52471/> "sal_Int32->sal_Int64 in tools/gen.hxx" tried that. However, it failed miserably on Windows, causing odd failures like not writing out Pictures/*.svm streams out into .odp during CppunitTest_sd_export_ooxml2. So the next best approach is to just revert the original commit, at least for now. Includes revert of follow-up 8c50aff2175e85c54957d98ce32af40a3a87e168 "Fix Library_vclplug_qt5". Change-Id: Ia8bf34272d1ed38aac00e5d07a9d13fb03f439ae Reviewed-on: https://gerrit.libreoffice.org/52532 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'editeng')
-rw-r--r--editeng/source/editeng/editdbg.cxx16
-rw-r--r--editeng/source/editeng/editeng.cxx6
-rw-r--r--editeng/source/editeng/impedit2.cxx8
-rw-r--r--editeng/source/editeng/impedit3.cxx12
4 files changed, 21 insertions, 21 deletions
diff --git a/editeng/source/editeng/editdbg.cxx b/editeng/source/editeng/editdbg.cxx
index 6b929d7f1358..3dbdadb6af22 100644
--- a/editeng/source/editeng/editdbg.cxx
+++ b/editeng/source/editeng/editdbg.cxx
@@ -212,7 +212,7 @@ OString DbgOutItem(const SfxItemPool& rPool, const SfxPoolItem& rItem)
MapMode aPntMap( MapUnit::MapPoint );
aSz = OutputDevice::LogicToLogic( aSz, aItemMapMode, aPntMap );
aDebStr.append(" Points=");
- aDebStr.append(aSz.Height());
+ aDebStr.append(static_cast<sal_Int32>(aSz.Height()));
}
break;
case EE_CHAR_FONTWIDTH:
@@ -282,7 +282,7 @@ OString DbgOutItem(const SfxItemPool& rPool, const SfxPoolItem& rItem)
MapMode aPntMap( MapUnit::MapPoint );
aSz = OutputDevice::LogicToLogic( aSz, aItemMapMode, aPntMap );
aDebStr.append(" Points=");
- aDebStr.append(aSz.Height());
+ aDebStr.append(static_cast<sal_Int32>(aSz.Height()));
}
break;
case EE_CHAR_WLM:
@@ -389,7 +389,7 @@ void EditDbg::ShowEditEngineData( EditEngine* pEE, bool bInfoBox )
aPortionStr.append(' ');
aPortionStr.append(rPortion.GetLen());
aPortionStr.append('(');
- aPortionStr.append(rPortion.GetSize().Width());
+ aPortionStr.append(static_cast<sal_Int32>(rPortion.GetSize().Width()));
aPortionStr.append(')');
aPortionStr.append('[');
aPortionStr.append(static_cast<sal_Int32>(rPortion.GetKind()));
@@ -456,9 +456,9 @@ void EditDbg::ShowEditEngineData( EditEngine* pEE, bool bInfoBox )
fprintf( fp, "\n================================================================================" );
fprintf( fp, "\nControl: %x", unsigned( pEE->GetControlWord() ) );
fprintf( fp, "\nRefMapMode: %i", int( pEE->pImpEditEngine->pRefDev->GetMapMode().GetMapUnit() ) );
- fprintf( fp, "\nPaperSize: %" SAL_PRIdINT32 " x %" SAL_PRIdINT32, pEE->GetPaperSize().Width(), pEE->GetPaperSize().Height() );
- fprintf( fp, "\nMaxAutoPaperSize: %" SAL_PRIdINT32 " x %" SAL_PRIdINT32, pEE->GetMaxAutoPaperSize().Width(), pEE->GetMaxAutoPaperSize().Height() );
- fprintf( fp, "\nMinAutoPaperSize: %" SAL_PRIdINT32 " x %" SAL_PRIdINT32, pEE->GetMinAutoPaperSize().Width(), pEE->GetMinAutoPaperSize().Height() );
+ fprintf( fp, "\nPaperSize: %li x %li", pEE->GetPaperSize().Width(), pEE->GetPaperSize().Height() );
+ fprintf( fp, "\nMaxAutoPaperSize: %li x %li", pEE->GetMaxAutoPaperSize().Width(), pEE->GetMaxAutoPaperSize().Height() );
+ fprintf( fp, "\nMinAutoPaperSize: %li x %li", pEE->GetMinAutoPaperSize().Width(), pEE->GetMinAutoPaperSize().Height() );
fprintf( fp, "\nUpdate: %i", pEE->GetUpdateMode() );
fprintf( fp, "\nNumber of Views: %" SAL_PRI_SIZET "i", pEE->GetViewCount() );
for ( size_t nView = 0; nView < pEE->GetViewCount(); nView++ )
@@ -467,9 +467,9 @@ void EditDbg::ShowEditEngineData( EditEngine* pEE, bool bInfoBox )
DBG_ASSERT( pV, "View not found!" );
fprintf( fp, "\nView %zu: Focus=%i", nView, pV->GetWindow()->HasFocus() );
tools::Rectangle aR( pV->GetOutputArea() );
- fprintf( fp, "\n OutputArea: nX=%" SAL_PRIdINT32 ", nY=%" SAL_PRIdINT32 ", dX=%" SAL_PRIdINT32 ", dY=%" SAL_PRIdINT32 ", MapMode = %i", aR.TopLeft().X(), aR.TopLeft().Y(), aR.GetSize().Width(), aR.GetSize().Height() , int( pV->GetWindow()->GetMapMode().GetMapUnit() ) );
+ fprintf( fp, "\n OutputArea: nX=%li, nY=%li, dX=%li, dY=%li, MapMode = %i", aR.TopLeft().X(), aR.TopLeft().Y(), aR.GetSize().Width(), aR.GetSize().Height() , int( pV->GetWindow()->GetMapMode().GetMapUnit() ) );
aR = pV->GetVisArea();
- fprintf( fp, "\n VisArea: nX=%" SAL_PRIdINT32 ", nY=%" SAL_PRIdINT32 ", dX=%" SAL_PRIdINT32 ", dY=%" SAL_PRIdINT32, aR.TopLeft().X(), aR.TopLeft().Y(), aR.GetSize().Width(), aR.GetSize().Height() );
+ fprintf( fp, "\n VisArea: nX=%li, nY=%li, dX=%li, dY=%li", aR.TopLeft().X(), aR.TopLeft().Y(), aR.GetSize().Width(), aR.GetSize().Height() );
ESelection aSel = pV->GetSelection();
fprintf( fp, "\n Selection: Start=%" SAL_PRIdINT32 ",%" SAL_PRIdINT32 ", End=%" SAL_PRIdINT32 ",%" SAL_PRIdINT32, aSel.nStartPara, aSel.nStartPos, aSel.nEndPara, aSel.nEndPos );
}
diff --git a/editeng/source/editeng/editeng.cxx b/editeng/source/editeng/editeng.cxx
index 01bc8dadc7e2..6e7ffce529f3 100644
--- a/editeng/source/editeng/editeng.cxx
+++ b/editeng/source/editeng/editeng.cxx
@@ -1813,17 +1813,17 @@ SvxFont EditEngine::GetStandardSvxFont( sal_Int32 nPara )
void EditEngine::StripPortions()
{
ScopedVclPtrInstance< VirtualDevice > aTmpDev;
- tools::Rectangle aBigRect( Point( 0, 0 ), Size( RECT_MAX, RECT_MAX ) );
+ tools::Rectangle aBigRect( Point( 0, 0 ), Size( 0x7FFFFFFF, 0x7FFFFFFF ) );
if ( IsVertical() )
{
if( IsTopToBottom() )
{
aBigRect.SetRight( 0 );
- aBigRect.SetLeft( RECT_MIN );
+ aBigRect.SetLeft( -0x7FFFFFFF );
}
else
{
- aBigRect.SetTop( RECT_MIN );
+ aBigRect.SetTop( -0x7FFFFFFF );
aBigRect.SetBottom( 0 );
}
}
diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx
index c58c76b4e8a5..19e035fafccd 100644
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -87,9 +87,9 @@ static sal_uInt16 lcl_CalcExtraSpace( const SvxLineSpacingItem& rLSItem )
ImpEditEngine::ImpEditEngine( EditEngine* pEE, SfxItemPool* pItemPool ) :
pSharedVCL(EditDLL::Get().GetSharedVclResources()),
- aPaperSize( RECT_MAX, RECT_MAX ),
+ aPaperSize( 0x7FFFFFFF, 0x7FFFFFFF ),
aMinAutoPaperSize( 0x0, 0x0 ),
- aMaxAutoPaperSize( RECT_MAX, RECT_MAX ),
+ aMaxAutoPaperSize( 0x7FFFFFFF, 0x7FFFFFFF ),
aEditDoc( pItemPool ),
aWordDelimiters(" .,;:-`'?!_=\"{}()[]"),
bKernAsianPunctuation(false),
@@ -4265,9 +4265,9 @@ void ImpEditEngine::SetValidPaperSize( const Size& rNewSz )
aPaperSize = rNewSz;
long nMinWidth = aStatus.AutoPageWidth() ? aMinAutoPaperSize.Width() : 0;
- long nMaxWidth = aStatus.AutoPageWidth() ? aMaxAutoPaperSize.Width() : RECT_MAX;
+ long nMaxWidth = aStatus.AutoPageWidth() ? aMaxAutoPaperSize.Width() : 0x7FFFFFFF;
long nMinHeight = aStatus.AutoPageHeight() ? aMinAutoPaperSize.Height() : 0;
- long nMaxHeight = aStatus.AutoPageHeight() ? aMaxAutoPaperSize.Height() : RECT_MAX;
+ long nMaxHeight = aStatus.AutoPageHeight() ? aMaxAutoPaperSize.Height() : 0x7FFFFFFF;
// Minimum/Maximum width:
if ( aPaperSize.Width() < nMinWidth )
diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx
index 369017cac794..7cc6dfddb695 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -404,7 +404,7 @@ void ImpEditEngine::FormatDoc()
if ( aInvalidRect.IsEmpty() )
{
// For Paperwidth 0 (AutoPageSize) it would otherwise be Empty()...
- long nWidth = std::max<sal_Int32>( 1, ( !IsVertical() ? aPaperSize.Width() : aPaperSize.Height() ) );
+ long nWidth = std::max( long(1), ( !IsVertical() ? aPaperSize.Width() : aPaperSize.Height() ) );
Range aInvRange( GetInvalidYOffsets( pParaPortion ) );
aInvalidRect = tools::Rectangle( Point( 0, nY+aInvRange.Min() ),
Size( nWidth, aInvRange.Len() ) );
@@ -733,7 +733,7 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY )
{
aBulletArea = GetEditEnginePtr()->GetBulletArea( GetParaPortions().GetPos( pParaPortion ) );
if ( aBulletArea.Right() > 0 )
- pParaPortion->SetBulletX( static_cast<sal_Int32>(GetXValue( long(aBulletArea.Right()) )) );
+ pParaPortion->SetBulletX( static_cast<sal_Int32>(GetXValue( aBulletArea.Right() )) );
else
pParaPortion->SetBulletX( 0 ); // if Bullet is set incorrectly
}
@@ -1711,7 +1711,7 @@ void ImpEditEngine::CreateAndInsertEmptyLine( ParaPortion* pParaPortion )
{
aBulletArea = GetEditEnginePtr()->GetBulletArea( GetParaPortions().GetPos( pParaPortion ) );
if ( aBulletArea.Right() > 0 )
- pParaPortion->SetBulletX( static_cast<sal_Int32>(GetXValue( long(aBulletArea.Right()) )) );
+ pParaPortion->SetBulletX( static_cast<sal_Int32>(GetXValue( aBulletArea.Right() )) );
else
pParaPortion->SetBulletX( 0 ); // If Bullet set incorrectly.
if ( pParaPortion->GetBulletX() > nStartX )
@@ -4038,8 +4038,8 @@ EditSelection ImpEditEngine::MoveParagraphs( Range aOldPositions, sal_Int32 nNew
{
// in this case one can redraw directly without invalidating the
// Portions
- sal_Int32 nFirstPortion = std::min( aOldPositions.Min(), nNewPos );
- sal_Int32 nLastPortion = std::max( aOldPositions.Max(), nNewPos );
+ sal_Int32 nFirstPortion = std::min( static_cast<sal_Int32>(aOldPositions.Min()), nNewPos );
+ sal_Int32 nLastPortion = std::max( static_cast<sal_Int32>(aOldPositions.Max()), nNewPos );
ParaPortion* pUpperPortion = GetParaPortions().SafeGetObject( nFirstPortion );
ParaPortion* pLowerPortion = GetParaPortions().SafeGetObject( nLastPortion );
@@ -4057,7 +4057,7 @@ EditSelection ImpEditEngine::MoveParagraphs( Range aOldPositions, sal_Int32 nNew
else
{
// redraw from the upper invalid position
- sal_Int32 nFirstInvPara = std::min( aOldPositions.Min(), nNewPos );
+ sal_Int32 nFirstInvPara = std::min( static_cast<sal_Int32>(aOldPositions.Min()), nNewPos );
InvalidateFromParagraph( nFirstInvPara );
}
return aSel;