summaryrefslogtreecommitdiff
path: root/vcl/source/filter
diff options
context:
space:
mode:
authorDavid Tardon <dtardon@redhat.com>2014-10-16 15:30:32 +0200
committerDavid Tardon <dtardon@redhat.com>2014-10-16 17:44:44 +0200
commit582ef22d3e8e30ffd58f092d37ffda30bd07bd9e (patch)
tree80c42b34da7e7ee05843b572f7311b3c230de9dd /vcl/source/filter
parentada4862afc3227b04c12960ded761db24f61257e (diff)
fdo#84854 it seems long is not enough on 32 bit
Fraction used BigInt internally for computations, rational does nothing like that. Change-Id: I3e9b25074f979bc291208f7c6362c3c40eb77ff5
Diffstat (limited to 'vcl/source/filter')
-rw-r--r--vcl/source/filter/graphicfilter.cxx6
-rw-r--r--vcl/source/filter/graphicfilter2.cxx6
-rw-r--r--vcl/source/filter/jpeg/JpegReader.cxx4
-rw-r--r--vcl/source/filter/sgfbram.cxx2
-rw-r--r--vcl/source/filter/sgvmain.cxx2
-rw-r--r--vcl/source/filter/sgvtext.cxx2
-rw-r--r--vcl/source/filter/wmf/emfwr.cxx4
-rw-r--r--vcl/source/filter/wmf/winmtf.cxx4
-rw-r--r--vcl/source/filter/wmf/winwmf.cxx2
-rw-r--r--vcl/source/filter/wmf/wmfwr.cxx10
10 files changed, 21 insertions, 21 deletions
diff --git a/vcl/source/filter/graphicfilter.cxx b/vcl/source/filter/graphicfilter.cxx
index 1bad8034d929..b228c6ab640a 100644
--- a/vcl/source/filter/graphicfilter.cxx
+++ b/vcl/source/filter/graphicfilter.cxx
@@ -860,7 +860,7 @@ static Graphic ImpGetScaledGraphic( const Graphic& rGraphic, FilterConfigItem& r
MapMode aMap( MAP_100TH_INCH );
sal_Int32 nDPI = rConfigItem.ReadInt32( "Resolution", 75 );
- boost::rational<long> aFrac( 1, std::min( std::max( nDPI, sal_Int32( 75 ) ), sal_Int32( 600 ) ) );
+ boost::rational<sal_Int64> aFrac( 1, std::min( std::max( nDPI, sal_Int32( 75 ) ), sal_Int32( 600 ) ) );
aMap.SetScaleX( aFrac );
aMap.SetScaleY( aFrac );
@@ -900,8 +900,8 @@ static Graphic ImpGetScaledGraphic( const Graphic& rGraphic, FilterConfigItem& r
if( aNewSize.Width() && aNewSize.Height() )
{
const Size aPreferredSize( aMtf.GetPrefSize() );
- aMtf.Scale( boost::rational<long>( aNewSize.Width(), aPreferredSize.Width() ),
- boost::rational<long>( aNewSize.Height(), aPreferredSize.Height() ) );
+ aMtf.Scale( boost::rational<sal_Int64>( aNewSize.Width(), aPreferredSize.Width() ),
+ boost::rational<sal_Int64>( aNewSize.Height(), aPreferredSize.Height() ) );
}
aGraphic = Graphic( aMtf );
}
diff --git a/vcl/source/filter/graphicfilter2.cxx b/vcl/source/filter/graphicfilter2.cxx
index 9f552e96a953..8c7851b560b2 100644
--- a/vcl/source/filter/graphicfilter2.cxx
+++ b/vcl/source/filter/graphicfilter2.cxx
@@ -336,8 +336,8 @@ bool GraphicDescriptor::ImpDetectJPG( SvStream& rStm, bool bExtendedInfo )
{
MapMode aMap;
aMap.SetMapUnit( nUnits == 1 ? MAP_INCH : MAP_CM );
- aMap.SetScaleX( boost::rational<long>( 1, nHorizontalResolution ) );
- aMap.SetScaleY( boost::rational<long>( 1, nVerticalResolution ) );
+ aMap.SetScaleX( boost::rational<sal_Int64>( 1, nHorizontalResolution ) );
+ aMap.SetScaleY( boost::rational<sal_Int64>( 1, nVerticalResolution ) );
aLogSize = OutputDevice::LogicToLogic( aPixSize, aMap, MapMode( MAP_100TH_MM ) );
}
}
@@ -489,7 +489,7 @@ bool GraphicDescriptor::ImpDetectPCX( SvStream& rStm, bool bExtendedInfo )
// set logical size
MapMode aMap( MAP_INCH, Point(),
- boost::rational<long>( 1, nDPIx ), boost::rational<long>( 1, nDPIy ) );
+ boost::rational<sal_Int64>( 1, nDPIx ), boost::rational<sal_Int64>( 1, nDPIy ) );
aLogSize = OutputDevice::LogicToLogic( aPixSize, aMap,
MapMode( MAP_100TH_MM ) );
diff --git a/vcl/source/filter/jpeg/JpegReader.cxx b/vcl/source/filter/jpeg/JpegReader.cxx
index 5d4c0479e1cf..be3afdfacd65 100644
--- a/vcl/source/filter/jpeg/JpegReader.cxx
+++ b/vcl/source/filter/jpeg/JpegReader.cxx
@@ -258,8 +258,8 @@ unsigned char * JPEGReader::CreateBitmap( JPEGCreateBitmapParam * pParam )
if( ( ( 1 == nUnit ) || ( 2 == nUnit ) ) && pParam->X_density && pParam->Y_density )
{
Point aEmptyPoint;
- boost::rational<long> aFractX( 1, pParam->X_density );
- boost::rational<long> aFractY( 1, pParam->Y_density );
+ boost::rational<sal_Int64> aFractX( 1, pParam->X_density );
+ boost::rational<sal_Int64> aFractY( 1, pParam->Y_density );
MapMode aMapMode( nUnit == 1 ? MAP_INCH : MAP_CM, aEmptyPoint, aFractX, aFractY );
Size aPrefSize = OutputDevice::LogicToLogic( aSize, aMapMode, MAP_100TH_MM );
diff --git a/vcl/source/filter/sgfbram.cxx b/vcl/source/filter/sgfbram.cxx
index ac119cae625b..2055e9272627 100644
--- a/vcl/source/filter/sgfbram.cxx
+++ b/vcl/source/filter/sgfbram.cxx
@@ -447,7 +447,7 @@ bool SgfFilterVect(SvStream& rInp, SgfHeader& rHead, SgfEntry&, GDIMetaFile& rMt
rMtf.Stop();
rMtf.WindStart();
MapMode aMap( MAP_10TH_MM, Point(),
- boost::rational<long>( 1, 4 ), boost::rational<long>( 1, 4 ) );
+ boost::rational<sal_Int64>( 1, 4 ), boost::rational<sal_Int64>( 1, 4 ) );
rMtf.SetPrefMapMode( aMap );
rMtf.SetPrefSize( Size( (short)rHead.Xsize, (short)rHead.Ysize ) );
return true;
diff --git a/vcl/source/filter/sgvmain.cxx b/vcl/source/filter/sgvmain.cxx
index 089573a36e17..e297842d93f0 100644
--- a/vcl/source/filter/sgvmain.cxx
+++ b/vcl/source/filter/sgvmain.cxx
@@ -830,7 +830,7 @@ bool SgfFilterSDrw( SvStream& rInp, SgfHeader&, SgfEntry&, GDIMetaFile& rMtf )
rMtf.Stop();
rMtf.WindStart();
- MapMode aMap(MAP_10TH_MM,Point(),boost::rational<long>(1,4),boost::rational<long>(1,4));
+ MapMode aMap(MAP_10TH_MM,Point(),boost::rational<sal_Int64>(1,4),boost::rational<sal_Int64>(1,4));
rMtf.SetPrefMapMode(aMap);
rMtf.SetPrefSize(Size((sal_Int16)aPage.Paper.Size.x,(sal_Int16)aPage.Paper.Size.y));
bRet=true;
diff --git a/vcl/source/filter/sgvtext.cxx b/vcl/source/filter/sgvtext.cxx
index 7cbf6bf9732f..2544f2bcb173 100644
--- a/vcl/source/filter/sgvtext.cxx
+++ b/vcl/source/filter/sgvtext.cxx
@@ -688,7 +688,7 @@ void FormatLine(UCHAR* TBuf, sal_uInt16& Index, ObjTextType& Atr0, ObjTextType&
sal_uInt16 i,j,k,h;
sal_uInt16 re,li;
- vOut.SetMapMode(MapMode(MAP_10TH_MM,Point(),boost::rational<long>(1,4),boost::rational<long>(1,4)));
+ vOut.SetMapMode(MapMode(MAP_10TH_MM,Point(),boost::rational<sal_Int64>(1,4),boost::rational<sal_Int64>(1,4)));
nChars=0;
SetTextContext(vOut,AktAtr,false,0,1,1,1,1);
diff --git a/vcl/source/filter/wmf/emfwr.cxx b/vcl/source/filter/wmf/emfwr.cxx
index 579ca89f20ee..37ee02a768dd 100644
--- a/vcl/source/filter/wmf/emfwr.cxx
+++ b/vcl/source/filter/wmf/emfwr.cxx
@@ -1252,8 +1252,8 @@ void EMFWriter::ImplWrite( const GDIMetaFile& rMtf )
MapMode aMapMode( aSubstitute.GetPrefMapMode() );
Size aOutSize( OutputDevice::LogicToLogic( pA->GetSize(), maVDev.GetMapMode(), aMapMode ) );
- aMapMode.SetScaleX( boost::rational<long>( aOutSize.Width(), aSubstitute.GetPrefSize().Width() ) );
- aMapMode.SetScaleY( boost::rational<long>( aOutSize.Height(), aSubstitute.GetPrefSize().Height() ) );
+ aMapMode.SetScaleX( boost::rational<sal_Int64>( aOutSize.Width(), aSubstitute.GetPrefSize().Width() ) );
+ aMapMode.SetScaleY( boost::rational<sal_Int64>( aOutSize.Height(), aSubstitute.GetPrefSize().Height() ) );
aMapMode.SetOrigin( OutputDevice::LogicToLogic( pA->GetPoint(), maVDev.GetMapMode(), aMapMode ) );
maVDev.SetMapMode( aMapMode );
ImplWrite( aSubstitute );
diff --git a/vcl/source/filter/wmf/winmtf.cxx b/vcl/source/filter/wmf/winmtf.cxx
index 1aa01fef966b..164d5ca7fc82 100644
--- a/vcl/source/filter/wmf/winmtf.cxx
+++ b/vcl/source/filter/wmf/winmtf.cxx
@@ -1510,8 +1510,8 @@ void WinMtfOutput::ImplDrawBitmap( const Point& rPos, const Size& rSize, const B
const Size aSizePixel( rBitmap.GetSizePixel() );
if ( aOutputSizePixel.Width() && aOutputSizePixel.Height() )
{
- aMapMode.SetScaleX( boost::rational<long>( aSizePixel.Width(), aOutputSizePixel.Width() ) );
- aMapMode.SetScaleY( boost::rational<long>( aSizePixel.Height(), aOutputSizePixel.Height() ) );
+ aMapMode.SetScaleX( boost::rational<sal_Int64>( aSizePixel.Width(), aOutputSizePixel.Width() ) );
+ aMapMode.SetScaleY( boost::rational<sal_Int64>( aSizePixel.Height(), aOutputSizePixel.Height() ) );
}
aVDev.SetMapMode( aMapMode );
aVDev.SetOutputSizePixel( aSizePixel );
diff --git a/vcl/source/filter/wmf/winwmf.cxx b/vcl/source/filter/wmf/winwmf.cxx
index fa2dc1b43a53..edd5c6f84426 100644
--- a/vcl/source/filter/wmf/winwmf.cxx
+++ b/vcl/source/filter/wmf/winwmf.cxx
@@ -1196,7 +1196,7 @@ bool WMFReader::ReadHeader()
Size aDevExt( 10000, 10000 );
if( ( labs( aWMFSize.Width() ) > 1 ) && ( labs( aWMFSize.Height() ) > 1 ) )
{
- const boost::rational<long> aFrac( 1, nUnitsPerInch );
+ const boost::rational<sal_Int64> aFrac( 1, nUnitsPerInch );
MapMode aWMFMap( MAP_INCH, Point(), aFrac, aFrac );
Size aSize100( OutputDevice::LogicToLogic( aWMFSize, aWMFMap, MAP_100TH_MM ) );
aDevExt = Size( labs( aSize100.Width() ), labs( aSize100.Height() ) );
diff --git a/vcl/source/filter/wmf/wmfwr.cxx b/vcl/source/filter/wmf/wmfwr.cxx
index 95473f08f08c..42d83b6e2a9e 100644
--- a/vcl/source/filter/wmf/wmfwr.cxx
+++ b/vcl/source/filter/wmf/wmfwr.cxx
@@ -1401,8 +1401,8 @@ void WMFWriter::WriteRecords( const GDIMetaFile & rMTF )
if( pA->GetMapMode().GetMapUnit() == MAP_RELATIVE )
{
MapMode aMM = pA->GetMapMode();
- boost::rational<long> aScaleX = aMM.GetScaleX();
- boost::rational<long> aScaleY = aMM.GetScaleY();
+ boost::rational<sal_Int64> aScaleX = aMM.GetScaleX();
+ boost::rational<sal_Int64> aScaleY = aMM.GetScaleY();
Point aOrigin = aSrcMapMode.GetOrigin();
BigInt aX( aOrigin.X() );
@@ -1740,7 +1740,7 @@ bool WMFWriter::WriteWMF( const GDIMetaFile& rMTF, SvStream& rTargetStream,
aTargetMapMode = MapMode( MAP_INCH );
const long nUnit = pVirDev->LogicToPixel( Size( 1, 1 ), aTargetMapMode ).Width();
- const boost::rational<long> aFrac( 1, nUnit );
+ const boost::rational<sal_Int64> aFrac( 1, nUnit );
aTargetMapMode.SetScaleX( aFrac );
aTargetMapMode.SetScaleY( aFrac );
@@ -1824,14 +1824,14 @@ bool WMFWriter::WriteWMF( const GDIMetaFile& rMTF, SvStream& rTargetStream,
sal_uInt16 WMFWriter::CalcSaveTargetMapMode(MapMode& rMapMode,
const Size& rPrefSize)
{
- boost::rational<long> aDivFrac(2, 1);
+ boost::rational<sal_Int64> aDivFrac(2, 1);
sal_uInt16 nDivisor = 1;
Size aSize = OutputDevice::LogicToLogic( rPrefSize, aSrcMapMode, rMapMode );
while( nDivisor <= 64 && (aSize.Width() > 32767 || aSize.Height() > 32767) )
{
- boost::rational<long> aFrac = rMapMode.GetScaleX();
+ boost::rational<sal_Int64> aFrac = rMapMode.GetScaleX();
aFrac *= aDivFrac;
rMapMode.SetScaleX(aFrac);