diff options
Diffstat (limited to 'sc/source')
56 files changed, 265 insertions, 259 deletions
diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx index 6a55bd3867d4..a88f31664406 100644 --- a/sc/source/core/data/column2.cxx +++ b/sc/source/core/data/column2.cxx @@ -83,7 +83,7 @@ inline bool IsAmbiguousScript( sal_uInt8 nScript ) long ScColumn::GetNeededSize( SCROW nRow, OutputDevice* pDev, double nPPTX, double nPPTY, - const boost::rational<long>& rZoomX, const boost::rational<long>& rZoomY, + const Fraction& rZoomX, const Fraction& rZoomY, bool bWidth, const ScNeededSizeOptions& rOptions, const ScPatternAttr** ppPatternChange ) const { @@ -240,7 +240,7 @@ long ScColumn::GetNeededSize( // bGetFont is set also if script type changes if (rOptions.bGetFont) { - boost::rational<long> aFontZoom = ( eOrient == SVX_ORIENTATION_STANDARD ) ? rZoomX : rZoomY; + Fraction aFontZoom = ( eOrient == SVX_ORIENTATION_STANDARD ) ? rZoomX : rZoomY; vcl::Font aFont; // font color doesn't matter here pPattern->GetFont( aFont, SC_AUTOCOL_BLACK, pDev, &aFontZoom, pCondSet, nScript ); @@ -413,7 +413,7 @@ long ScColumn::GetNeededSize( // space for AutoFilter button: 20 * nZoom/100 if ( pFlag->HasAutoFilter() && !bTextWysiwyg ) - nDocWidth -= (rZoomX.numerator()*20)/rZoomX.denominator(); + nDocWidth -= (rZoomX.GetNumerator()*20)/rZoomX.GetDenominator(); aPaper.Width() = nDocWidth; @@ -501,7 +501,7 @@ long ScColumn::GetNeededSize( aHMMMode).Height(); // With non-100% zoom and several lines or paragraphs, don't shrink below the result with FORMAT100 set - if ( !bTextWysiwyg && ( rZoomY.numerator() != 1 || rZoomY.denominator() != 1 ) && + if ( !bTextWysiwyg && ( rZoomY.GetNumerator() != 1 || rZoomY.GetDenominator() != 1 ) && ( pEngine->GetParagraphCount() > 1 || ( bBreak && pEngine->GetLineCount(0) > 1 ) ) ) { pEngine->SetControlWord( nCtrl | EE_CNTRL_FORMAT100 ); @@ -551,7 +551,7 @@ long ScColumn::GetNeededSize( sal_Int16 nFlags = static_cast<const ScMergeFlagAttr&>(pPattern->GetItem(ATTR_MERGE_FLAG)).GetValue(); if (nFlags & SC_MF_AUTO) - nValue += (rZoomX.numerator()*20)/rZoomX.denominator(); + nValue += (rZoomX.GetNumerator()*20)/rZoomX.GetDenominator(); } return nValue; } @@ -616,7 +616,7 @@ public: } sal_uInt16 ScColumn::GetOptimalColWidth( - OutputDevice* pDev, double nPPTX, double nPPTY, const boost::rational<long>& rZoomX, const boost::rational<long>& rZoomY, + OutputDevice* pDev, double nPPTX, double nPPTY, const Fraction& rZoomX, const Fraction& rZoomY, bool bFormula, sal_uInt16 nOldWidth, const ScMarkData* pMarkData, const ScColWidthParam* pParam) const { if (maCells.block_size() == 1 && maCells.begin()->type == sc::element_type_empty) diff --git a/sc/source/core/data/dociter.cxx b/sc/source/core/data/dociter.cxx index 3613477e948a..2c5a59710f4a 100644 --- a/sc/source/core/data/dociter.cxx +++ b/sc/source/core/data/dociter.cxx @@ -40,7 +40,7 @@ #include "scmatrix.hxx" #include <rowheightcontext.hxx> -#include <tools/rational.hxx> +#include <tools/fract.hxx> #include <editeng/editobj.hxx> #include <svl/sharedstring.hxx> @@ -2544,7 +2544,7 @@ void ScDocRowHeightUpdater::update() ScProgress aProgress(mrDoc.GetDocumentShell(), ScGlobal::GetRscString(STR_PROGRESS_HEIGHTING), nCellCount); - boost::rational<long> aZoom(1, 1); + Fraction aZoom(1, 1); itr = mpTabRangesArray->begin(); sal_uInt32 nProgressStart = 0; sc::RowHeightContext aCxt(mfPPTX, mfPPTY, aZoom, aZoom, mpOutDev); @@ -2582,7 +2582,7 @@ void ScDocRowHeightUpdater::updateAll() ScProgress aProgress(mrDoc.GetDocumentShell(), ScGlobal::GetRscString(STR_PROGRESS_HEIGHTING), nCellCount); - boost::rational<long> aZoom(1, 1); + Fraction aZoom(1, 1); sc::RowHeightContext aCxt(mfPPTX, mfPPTY, aZoom, aZoom, mpOutDev); sal_uLong nProgressStart = 0; for (SCTAB nTab = 0; nTab < mrDoc.GetTableCount(); ++nTab) diff --git a/sc/source/core/data/documen8.cxx b/sc/source/core/data/documen8.cxx index 9c01a44633b4..f6132be7b9e8 100644 --- a/sc/source/core/data/documen8.cxx +++ b/sc/source/core/data/documen8.cxx @@ -569,7 +569,7 @@ bool ScDocument::IdleCalcTextWidth() // true = demnaechst wieder vers } sal_uInt16 nZoom = getScaleValue(*pStyle, ATTR_PAGE_SCALE); - boost::rational<long> aZoomFract(nZoom, 100); + Fraction aZoomFract(nZoom, 100); // Start at specified cell position (nCol, nRow, nTab). ScColumn* pCol = &pTab->aCol[aScope.Col()]; @@ -655,7 +655,7 @@ bool ScDocument::IdleCalcTextWidth() // true = demnaechst wieder vers if (getScaleValue(*pStyle, ATTR_PAGE_SCALETOPAGES) == 0) { nZoom = getScaleValue(*pStyle, ATTR_PAGE_SCALE); - aZoomFract = boost::rational<long>(nZoom, 100); + aZoomFract = Fraction(nZoom, 100); } else nZoom = 0; diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index e35c2b14017d..c8c8af7fc87a 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -3883,7 +3883,7 @@ sal_uLong ScDocument::GetRowOffset( SCROW nRow, SCTAB nTab, bool bHiddenAsZero ) sal_uInt16 ScDocument::GetOptimalColWidth( SCCOL nCol, SCTAB nTab, OutputDevice* pDev, double nPPTX, double nPPTY, - const boost::rational<long>& rZoomX, const boost::rational<long>& rZoomY, + const Fraction& rZoomX, const Fraction& rZoomY, bool bFormula, const ScMarkData* pMarkData, const ScColWidthParam* pParam ) { @@ -3897,7 +3897,7 @@ sal_uInt16 ScDocument::GetOptimalColWidth( SCCOL nCol, SCTAB nTab, OutputDevice* long ScDocument::GetNeededSize( SCCOL nCol, SCROW nRow, SCTAB nTab, OutputDevice* pDev, double nPPTX, double nPPTY, - const boost::rational<long>& rZoomX, const boost::rational<long>& rZoomY, + const Fraction& rZoomX, const Fraction& rZoomY, bool bWidth, bool bTotalSize ) { if ( ValidTab(nTab) && nTab < static_cast<SCTAB>(maTabs.size()) && maTabs[nTab] ) @@ -4586,7 +4586,7 @@ const ScStyleSheet* ScDocument::GetSelectionStyle( const ScMarkData& rMark ) con void ScDocument::StyleSheetChanged( const SfxStyleSheetBase* pStyleSheet, bool bRemoved, OutputDevice* pDev, double nPPTX, double nPPTY, - const boost::rational<long>& rZoomX, const boost::rational<long>& rZoomY ) + const Fraction& rZoomX, const Fraction& rZoomY ) { TableContainer::iterator it = maTabs.begin(); for (; it != maTabs.end(); ++it) diff --git a/sc/source/core/data/drwlayer.cxx b/sc/source/core/data/drwlayer.cxx index 7a040a94194a..daf4f8adcec5 100644 --- a/sc/source/core/data/drwlayer.cxx +++ b/sc/source/core/data/drwlayer.cxx @@ -824,7 +824,7 @@ void ScDrawLayer::RecalcPos( SdrObject* pObj, ScDrawObjData& rData, bool bNegati double fXFrac = static_cast<double>(aNew.GetWidth()) / static_cast<double>(aOld.GetWidth()); double fYFrac = static_cast<double>(aNew.GetHeight()) / static_cast<double>(aOld.GetHeight()); - pObj->NbcResize(aNew.TopLeft(), rational_FromDouble(fXFrac), rational_FromDouble(fYFrac)); + pObj->NbcResize(aNew.TopLeft(), Fraction(fXFrac), Fraction(fYFrac)); } // order of these lines is important, modify rData.maLastRect carefully it is used as both // a value and a flag for initialisation @@ -1421,19 +1421,19 @@ void ScDrawLayer::CopyFromClip( ScDrawLayer* pClipModel, SCTAB nSourceTab, const long nWidthDiff = nDestWidth - nSourceWidth; long nHeightDiff = nDestHeight - nSourceHeight; - boost::rational<long> aHorFract(1,1); - boost::rational<long> aVerFract(1,1); + Fraction aHorFract(1,1); + Fraction aVerFract(1,1); bool bResize = false; // sizes can differ by 1 from twips->1/100mm conversion for equal cell sizes, // don't resize to empty size when pasting into hidden columns or rows if ( std::abs(nWidthDiff) > 1 && nDestWidth > 1 && nSourceWidth > 1 ) { - aHorFract = boost::rational<long>( nDestWidth, nSourceWidth ); + aHorFract = Fraction( nDestWidth, nSourceWidth ); bResize = true; } if ( std::abs(nHeightDiff) > 1 && nDestHeight > 1 && nSourceHeight > 1 ) { - aVerFract = boost::rational<long>( nDestHeight, nSourceHeight ); + aVerFract = Fraction( nDestHeight, nSourceHeight ); bResize = true; } Point aRefPos = rDestRange.TopLeft(); // for resizing (after moving) diff --git a/sc/source/core/data/patattr.cxx b/sc/source/core/data/patattr.cxx index 0c73e0f20ea6..5e46e084c90d 100644 --- a/sc/source/core/data/patattr.cxx +++ b/sc/source/core/data/patattr.cxx @@ -216,7 +216,7 @@ SvxCellOrientation ScPatternAttr::GetCellOrientation( const SfxItemSet* pCondSet void ScPatternAttr::GetFont( vcl::Font& rFont, const SfxItemSet& rItemSet, ScAutoFontColorMode eAutoMode, - OutputDevice* pOutDev, const boost::rational<long>* pScale, + OutputDevice* pOutDev, const Fraction* pScale, const SfxItemSet* pCondSet, sal_uInt8 nScript, const Color* pBackConfigColor, const Color* pTextConfigColor ) { @@ -375,7 +375,7 @@ void ScPatternAttr::GetFont( if ( pOutDev != NULL ) { Size aEffSize; - boost::rational<long> aFraction( 1,1 ); + Fraction aFraction( 1,1 ); if (pScale) aFraction = *pScale; Size aSize( 0, (long) nFontHeight ); @@ -385,7 +385,7 @@ void ScPatternAttr::GetFont( aEffSize = pOutDev->LogicToPixel( aSize, aSrcMode ); else { - boost::rational<long> aFractOne(1,1); + Fraction aFractOne(1,1); aDestMode.SetScaleX( aFractOne ); aDestMode.SetScaleY( aFractOne ); aEffSize = OutputDevice::LogicToLogic( aSize, aSrcMode, aDestMode ); @@ -481,7 +481,7 @@ void ScPatternAttr::GetFont( void ScPatternAttr::GetFont( vcl::Font& rFont, ScAutoFontColorMode eAutoMode, - OutputDevice* pOutDev, const boost::rational<long>* pScale, + OutputDevice* pOutDev, const Fraction* pScale, const SfxItemSet* pCondSet, sal_uInt8 nScript, const Color* pBackConfigColor, const Color* pTextConfigColor ) const { diff --git a/sc/source/core/data/rowheightcontext.cxx b/sc/source/core/data/rowheightcontext.cxx index de392f3fa9e2..46f3c6dad9ca 100644 --- a/sc/source/core/data/rowheightcontext.cxx +++ b/sc/source/core/data/rowheightcontext.cxx @@ -12,7 +12,7 @@ namespace sc { RowHeightContext::RowHeightContext( - double fPPTX, double fPPTY, const boost::rational<long>& rZoomX, const boost::rational<long>& rZoomY, + double fPPTX, double fPPTY, const Fraction& rZoomX, const Fraction& rZoomY, OutputDevice* pOutDev ) : mfPPTX(fPPTX), mfPPTY(fPPTY), maZoomX(rZoomX), maZoomY(rZoomY), diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx index 95721c2dc8b3..f6871f6767e6 100644 --- a/sc/source/core/data/table1.cxx +++ b/sc/source/core/data/table1.cxx @@ -430,7 +430,7 @@ void ScTable::SetLink( sal_uInt8 nMode, sal_uInt16 ScTable::GetOptimalColWidth( SCCOL nCol, OutputDevice* pDev, double nPPTX, double nPPTY, - const boost::rational<long>& rZoomX, const boost::rational<long>& rZoomY, + const Fraction& rZoomX, const Fraction& rZoomY, bool bFormula, const ScMarkData* pMarkData, const ScColWidthParam* pParam ) { @@ -441,7 +441,7 @@ sal_uInt16 ScTable::GetOptimalColWidth( SCCOL nCol, OutputDevice* pDev, long ScTable::GetNeededSize( SCCOL nCol, SCROW nRow, OutputDevice* pDev, double nPPTX, double nPPTY, - const boost::rational<long>& rZoomX, const boost::rational<long>& rZoomY, + const Fraction& rZoomX, const Fraction& rZoomY, bool bWidth, bool bTotalSize ) { ScNeededSizeOptions aOptions; @@ -1801,7 +1801,7 @@ void ScTable::MaybeAddExtraColumn(SCCOL& rCol, SCROW nRow, OutputDevice* pDev, d aOptions.bFormula = bFormula; aOptions.bSkipMerged = false; - boost::rational<long> aZoom(1,1); + Fraction aZoom(1,1); nPixel = aCol[rCol].GetNeededSize( nRow, pDev, nPPTX, nPPTY, aZoom, aZoom, true, aOptions, NULL ); diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx index 10d48dcdbb6d..381d32bcfbb5 100644 --- a/sc/source/core/data/table2.cxx +++ b/sc/source/core/data/table2.cxx @@ -2547,7 +2547,7 @@ bool ScTable::IsStyleSheetUsed( const ScStyleSheet& rStyle, bool bGatherAllStyle void ScTable::StyleSheetChanged( const SfxStyleSheetBase* pStyleSheet, bool bRemoved, OutputDevice* pDev, double nPPTX, double nPPTY, - const boost::rational<long>& rZoomX, const boost::rational<long>& rZoomY ) + const Fraction& rZoomX, const Fraction& rZoomY ) { ScFlatBoolRowSegments aUsedRows; for (SCCOL i = 0; i <= MAXCOL; ++i) diff --git a/sc/source/filter/rtf/eeimpars.cxx b/sc/source/filter/rtf/eeimpars.cxx index 1ba6ca2ad959..1989a2e9534b 100644 --- a/sc/source/filter/rtf/eeimpars.cxx +++ b/sc/source/filter/rtf/eeimpars.cxx @@ -429,10 +429,10 @@ void ScEEImport::WriteToDocument( bool bSizeColsRows, double nOutputFactor, SvNu } DELETEZ( pProgress ); // SetOptimalHeight has its own ProgressBar // Adjust line height, base is 100% zoom - boost::rational<long> aZoom( 1, 1 ); + Fraction aZoom( 1, 1 ); // Factor is printer to display ratio - double nPPTX = ScGlobal::nScreenPPTX * boost::rational_cast<double>(aZoom) / nOutputFactor; - double nPPTY = ScGlobal::nScreenPPTY * boost::rational_cast<double>(aZoom); + double nPPTX = ScGlobal::nScreenPPTX * (double) aZoom / nOutputFactor; + double nPPTY = ScGlobal::nScreenPPTY * (double) aZoom; VirtualDevice aVirtDev; sc::RowHeightContext aCxt(nPPTX, nPPTY, aZoom, aZoom, &aVirtDev); aCxt.setExtraHeight(ScGlobal::nLastRowHeightExtra); diff --git a/sc/source/ui/app/client.cxx b/sc/source/ui/app/client.cxx index db3e22f7a8d7..97665f04fa36 100644 --- a/sc/source/ui/app/client.cxx +++ b/sc/source/ui/app/client.cxx @@ -213,11 +213,11 @@ void ScClient::ViewChanged() if (pDrawObj) { Rectangle aLogicRect = pDrawObj->GetLogicRect(); - boost::rational<long> aFractX = GetScaleWidth(); - boost::rational<long> aFractY = GetScaleHeight(); + Fraction aFractX = GetScaleWidth(); + Fraction aFractY = GetScaleHeight(); aFractX *= aVisSize.Width(); aFractY *= aVisSize.Height(); - aVisSize = Size( boost::rational_cast<long>(aFractX), boost::rational_cast<long>(aFractY) ); // Scaled for Draw model + aVisSize = Size( (long) aFractX, (long) aFractY ); // Scaled for Draw model // pClientData->SetObjArea before pDrawObj->SetLogicRect, so that we don't // calculate wrong scalings: diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx index bd5ae06f405c..4717da786bfd 100644 --- a/sc/source/ui/app/inputhdl.cxx +++ b/sc/source/ui/app/inputhdl.cxx @@ -569,7 +569,7 @@ ScInputHandler::~ScInputHandler() delete pFormulaDataPara; } -void ScInputHandler::SetRefScale( const boost::rational<long>& rX, const boost::rational<long>& rY ) +void ScInputHandler::SetRefScale( const Fraction& rX, const Fraction& rY ) { if ( rX != aScaleX || rY != aScaleY ) { diff --git a/sc/source/ui/cctrl/dpcontrol.cxx b/sc/source/ui/cctrl/dpcontrol.cxx index 02022a1d348d..ec4507637e72 100644 --- a/sc/source/ui/cctrl/dpcontrol.cxx +++ b/sc/source/ui/cctrl/dpcontrol.cxx @@ -27,7 +27,7 @@ #include "docpool.hxx" #include "patattr.hxx" -ScDPFieldButton::ScDPFieldButton(OutputDevice* pOutDev, const StyleSettings* pStyle, const boost::rational<long>* pZoomX, const boost::rational<long>* pZoomY, ScDocument* pDoc) : +ScDPFieldButton::ScDPFieldButton(OutputDevice* pOutDev, const StyleSettings* pStyle, const Fraction* pZoomX, const Fraction* pZoomY, ScDocument* pDoc) : mpDoc(pDoc), mpOutDev(pOutDev), mpStyle(pStyle), @@ -40,12 +40,12 @@ ScDPFieldButton::ScDPFieldButton(OutputDevice* pOutDev, const StyleSettings* pSt if (pZoomX) maZoomX = *pZoomX; else - maZoomX = boost::rational<long>(1, 1); + maZoomX = Fraction(1, 1); if (pZoomY) maZoomY = *pZoomY; else - maZoomY = boost::rational<long>(1, 1); + maZoomY = Fraction(1, 1); } ScDPFieldButton::~ScDPFieldButton() diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx index b3085442ce17..778e29438698 100644 --- a/sc/source/ui/docshell/docfunc.cxx +++ b/sc/source/ui/docshell/docfunc.cxx @@ -153,7 +153,7 @@ bool ScDocFunc::AdjustRowHeight( const ScRange& rRange, bool bPaint ) SCROW nEndRow = rRange.aEnd.Row(); ScSizeDeviceProvider aProv( &rDocShell ); - boost::rational<long> aOne(1,1); + Fraction aOne(1,1); sc::RowHeightContext aCxt(aProv.GetPPTX(), aProv.GetPPTY(), aOne, aOne, aProv.GetDevice()); bool bChanged = rDoc.SetOptimalHeight(aCxt, nStartRow, nEndRow, nTab); @@ -3358,7 +3358,7 @@ static sal_uInt16 lcl_GetOptimalColWidth( ScDocShell& rDocShell, SCCOL nCol, SCT double nPPTY = aProv.GetPPTY(); ScDocument& rDoc = rDocShell.GetDocument(); - boost::rational<long> aOne(1,1); + Fraction aOne(1,1); sal_uInt16 nTwips = rDoc.GetOptimalColWidth( nCol, nTab, pDev, nPPTX, nPPTY, aOne, aOne, bFormula, NULL ); @@ -3451,7 +3451,7 @@ bool ScDocFunc::SetWidthOrHeight( } ScSizeDeviceProvider aProv( &rDocShell ); - boost::rational<long> aOne(1,1); + Fraction aOne(1,1); sc::RowHeightContext aCxt(aProv.GetPPTX(), aProv.GetPPTY(), aOne, aOne, aProv.GetDevice()); aCxt.setForceAutoSize(bAll); rDoc.SetOptimalHeight(aCxt, nStartNo, nEndNo, nTab); diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx index 6b25a783e6fe..0db4a22e40ec 100644 --- a/sc/source/ui/docshell/docsh.cxx +++ b/sc/source/ui/docshell/docsh.cxx @@ -1457,9 +1457,9 @@ bool ScDocShell::ConvertFrom( SfxMedium& rMedium ) CalcOutputFactor(); if ( bRet && (bSetColWidths || bSetRowHeights) ) { // Adjust column width/row height; base 100% zoom - boost::rational<long> aZoom( 1, 1 ); - double nPPTX = ScGlobal::nScreenPPTX * boost::rational_cast<double>(aZoom) / GetOutputFactor(); // Factor is printer display ratio - double nPPTY = ScGlobal::nScreenPPTY * boost::rational_cast<double>(aZoom); + Fraction aZoom( 1, 1 ); + double nPPTX = ScGlobal::nScreenPPTX * (double) aZoom / GetOutputFactor(); // Factor is printer display ratio + double nPPTY = ScGlobal::nScreenPPTY * (double) aZoom; VirtualDevice aVirtDev; // all sheets (for Excel import) SCTAB nTabCount = aDocument.GetTableCount(); diff --git a/sc/source/ui/docshell/docsh5.cxx b/sc/source/ui/docshell/docsh5.cxx index 88fc80417e9f..c1ac7036c9b4 100644 --- a/sc/source/ui/docshell/docsh5.cxx +++ b/sc/source/ui/docshell/docsh5.cxx @@ -368,7 +368,7 @@ void ScDocShell::CancelAutoDBRange() bool ScDocShell::AdjustRowHeight( SCROW nStartRow, SCROW nEndRow, SCTAB nTab ) { ScSizeDeviceProvider aProv(this); - boost::rational<long> aZoom(1,1); + Fraction aZoom(1,1); sc::RowHeightContext aCxt(aProv.GetPPTX(), aProv.GetPPTY(), aZoom, aZoom, aProv.GetDevice()); bool bChange = aDocument.SetOptimalHeight(aCxt, nStartRow,nEndRow, nTab); @@ -383,7 +383,7 @@ void ScDocShell::UpdateAllRowHeights( const ScMarkData* pTabMark ) // update automatic row heights ScSizeDeviceProvider aProv(this); - boost::rational<long> aZoom(1,1); + Fraction aZoom(1,1); sc::RowHeightContext aCxt(aProv.GetPPTX(), aProv.GetPPTY(), aZoom, aZoom, aProv.GetDevice()); aDocument.UpdateAllRowHeights(aCxt, pTabMark); } diff --git a/sc/source/ui/drawfunc/fuins1.cxx b/sc/source/ui/drawfunc/fuins1.cxx index f8e5dfc35da5..3c92010345c7 100644 --- a/sc/source/ui/drawfunc/fuins1.cxx +++ b/sc/source/ui/drawfunc/fuins1.cxx @@ -131,7 +131,7 @@ static void lcl_InsertGraphic( const Graphic& rGraphic, MapMode aDestMap( MAP_100TH_MM ); if ( aSourceMap.GetMapUnit() == MAP_PIXEL && pDrawView ) { - boost::rational<long> aScaleX, aScaleY; + Fraction aScaleX, aScaleY; pDrawView->CalcNormScale( aScaleX, aScaleY ); aDestMap.SetScaleX(aScaleX); aDestMap.SetScaleY(aScaleY); diff --git a/sc/source/ui/inc/dpcontrol.hxx b/sc/source/ui/inc/dpcontrol.hxx index 461c1100fca8..e574f672429b 100644 --- a/sc/source/ui/inc/dpcontrol.hxx +++ b/sc/source/ui/inc/dpcontrol.hxx @@ -22,7 +22,7 @@ #include <rtl/ustring.hxx> #include <tools/gen.hxx> -#include <tools/rational.hxx> +#include <tools/fract.hxx> class OutputDevice; class Point; @@ -37,7 +37,7 @@ class ScDocument; class ScDPFieldButton { public: - ScDPFieldButton(OutputDevice* pOutDev, const StyleSettings* pStyle, const boost::rational<long>* pZoomX = NULL, const boost::rational<long>* pZoomY = NULL, + ScDPFieldButton(OutputDevice* pOutDev, const StyleSettings* pStyle, const Fraction* pZoomX = NULL, const Fraction* pZoomY = NULL, ScDocument* pDoc = NULL); ~ScDPFieldButton(); @@ -58,9 +58,9 @@ private: private: Point maPos; Size maSize; - OUString maText; - boost::rational<long> maZoomX; - boost::rational<long> maZoomY; + OUString maText; + Fraction maZoomX; + Fraction maZoomY; ScDocument* mpDoc; OutputDevice* mpOutDev; const StyleSettings* mpStyle; diff --git a/sc/source/ui/inc/drawutil.hxx b/sc/source/ui/inc/drawutil.hxx index 740ee0380ada..6a011ae290e2 100644 --- a/sc/source/ui/inc/drawutil.hxx +++ b/sc/source/ui/inc/drawutil.hxx @@ -22,7 +22,7 @@ #include "address.hxx" -namespace boost { template<typename T> class rational; } +class Fraction; class OutputDevice; class ScDocument; @@ -31,9 +31,9 @@ class ScDrawUtil public: static void CalcScale( ScDocument* pDoc, SCTAB nTab, SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, - OutputDevice* pDev, const boost::rational<long>& rZoomX, const boost::rational<long>& rZoomY, + OutputDevice* pDev, const Fraction& rZoomX, const Fraction& rZoomY, double nPPTX, double nPPTY, - boost::rational<long>& rScaleX, boost::rational<long>& rScaleY ); + Fraction& rScaleX, Fraction& rScaleY ); }; #endif diff --git a/sc/source/ui/inc/drawview.hxx b/sc/source/ui/inc/drawview.hxx index 923af0f9a0fd..d19cb263a746 100644 --- a/sc/source/ui/inc/drawview.hxx +++ b/sc/source/ui/inc/drawview.hxx @@ -37,8 +37,8 @@ class ScDrawView: public FmFormView OutputDevice* pDev; //! needed ? ScDocument* pDoc; SCTAB nTab; - boost::rational<long> aScaleX; // Factor for Drawing-MapMode - boost::rational<long> aScaleY; + Fraction aScaleX; // Factor for Drawing-MapMode + Fraction aScaleY; SdrDropMarkerOverlay* pDropMarker; SdrObject* pDropMarkObj; bool bInConstruct; @@ -94,12 +94,12 @@ public: void DoCut(); void DoCopy(); - void GetScale( boost::rational<long>& rFractX, boost::rational<long>& rFractY ) const; + void GetScale( Fraction& rFractX, Fraction& rFractY ) const; void RecalcScale(); void UpdateWorkArea(); SCTAB GetTab() const { return nTab; } - void CalcNormScale( boost::rational<long>& rFractX, boost::rational<long>& rFractY ) const; + void CalcNormScale( Fraction& rFractX, Fraction& rFractY ) const; void SetPageAnchored(); void SetCellAnchored(); diff --git a/sc/source/ui/inc/inputhdl.hxx b/sc/source/ui/inc/inputhdl.hxx index dd8752a5c52d..65ea47c3c927 100644 --- a/sc/source/ui/inc/inputhdl.hxx +++ b/sc/source/ui/inc/inputhdl.hxx @@ -24,7 +24,7 @@ #include "address.hxx" #include "typedstrdata.hxx" -#include <tools/rational.hxx> +#include <tools/fract.hxx> #include <tools/gen.hxx> #include <tools/link.hxx> #include <vcl/vclevent.hxx> @@ -99,11 +99,11 @@ private: bool bCellHasPercentFormat:1; bool bLastIsSymbol:1; bool mbDocumentDisposing:1; - sal_uLong nValidation; + sal_uLong nValidation; SvxCellHorJustify eAttrAdjust; - boost::rational<long> aScaleX; // for ref MapMode - boost::rational<long> aScaleY; + Fraction aScaleX; // for ref MapMode + Fraction aScaleY; ScTabViewShell* pRefViewSh; ScTabViewShell* pActiveViewSh; @@ -209,7 +209,7 @@ public: void ShowTip( const OUString& rText ); // at Cursor void ShowTipBelow( const OUString& rText ); - void SetRefScale( const boost::rational<long>& rX, const boost::rational<long>& rY ); + void SetRefScale( const Fraction& rX, const Fraction& rY ); void UpdateRefDevice(); EditView* GetActiveView(); diff --git a/sc/source/ui/inc/output.hxx b/sc/source/ui/inc/output.hxx index dd42cd8fe737..8a9649848ba4 100644 --- a/sc/source/ui/inc/output.hxx +++ b/sc/source/ui/inc/output.hxx @@ -23,7 +23,7 @@ #include "address.hxx" #include "cellvalue.hxx" #include <tools/color.hxx> -#include <tools/rational.hxx> +#include <tools/fract.hxx> #include <com/sun/star/embed/XEmbeddedObject.hpp> #include <drawinglayer/processor2d/baseprocessor2d.hxx> @@ -164,8 +164,8 @@ private: ScOutputType eType; // Screen/Printer ... double mnPPTX; // Pixel per Twips double mnPPTY; - boost::rational<long> aZoomX; - boost::rational<long> aZoomY; + Fraction aZoomX; + Fraction aZoomY; SdrObject* pEditObj; // Omit when painting @@ -262,8 +262,8 @@ public: SCTAB nNewTab, long nNewScrX, long nNewScrY, SCCOL nNewX1, SCROW nNewY1, SCCOL nNewX2, SCROW nNewY2, double nPixelPerTwipsX, double nPixelPerTwipsY, - const boost::rational<long>* pZoomX = NULL, - const boost::rational<long>* pZoomY = NULL ); + const Fraction* pZoomX = NULL, + const Fraction* pZoomY = NULL ); ~ScOutputData(); diff --git a/sc/source/ui/inc/tabview.hxx b/sc/source/ui/inc/tabview.hxx index 1cbb87afec6a..0bc4751487c4 100644 --- a/sc/source/ui/inc/tabview.hxx +++ b/sc/source/ui/inc/tabview.hxx @@ -298,7 +298,7 @@ public: * @param bSameTabButMoved true if the same sheet as before is activated. */ void TabChanged( bool bSameTabButMoved = false ); - void SetZoom( const boost::rational<long>& rNewX, const boost::rational<long>& rNewY, bool bAll ); + void SetZoom( const Fraction& rNewX, const Fraction& rNewY, bool bAll ); SC_DLLPUBLIC void RefreshZoom(); void SetPagebreakMode( bool bSet ); diff --git a/sc/source/ui/inc/tabvwsh.hxx b/sc/source/ui/inc/tabvwsh.hxx index 053a1e9053e6..9020c2184c84 100644 --- a/sc/source/ui/inc/tabvwsh.hxx +++ b/sc/source/ui/inc/tabvwsh.hxx @@ -208,7 +208,7 @@ protected: virtual void InnerResizePixel( const Point &rOfs, const Size &rSize ) SAL_OVERRIDE; // neu virtual void OuterResizePixel( const Point &rOfs, const Size &rSize ) SAL_OVERRIDE; - virtual void SetZoomFactor( const boost::rational<long>& rZoomX, const boost::rational<long>& rZoomY ) SAL_OVERRIDE; + virtual void SetZoomFactor( const Fraction &rZoomX, const Fraction &rZoomY ) SAL_OVERRIDE; virtual void QueryObjAreaPixel( Rectangle& rRect ) const SAL_OVERRIDE; diff --git a/sc/source/ui/inc/viewdata.hxx b/sc/source/ui/inc/viewdata.hxx index 1505f4dd0ab8..515bc67a4f75 100644 --- a/sc/source/ui/inc/viewdata.hxx +++ b/sc/source/ui/inc/viewdata.hxx @@ -109,10 +109,10 @@ class ScViewDataTable // per-sheet data friend class ScViewData; private: SvxZoomType eZoomType; // selected zoom type (normal view) - boost::rational<long> aZoomX; // selected zoom X - boost::rational<long> aZoomY; // selected zoom Y (displayed) - boost::rational<long> aPageZoomX; // zoom in page break preview mode - boost::rational<long> aPageZoomY; + Fraction aZoomX; // selected zoom X + Fraction aZoomY; // selected zoom Y (displayed) + Fraction aPageZoomX; // zoom in page break preview mode + Fraction aPageZoomY; long nTPosX[2]; // MapMode - Offset (Twips) long nTPosY[2]; @@ -174,10 +174,10 @@ private: MapMode aLogicMode; // skalierter 1/100mm-MapMode SvxZoomType eDefZoomType; // default zoom and type for missing TabData - boost::rational<long> aDefZoomX; - boost::rational<long> aDefZoomY; - boost::rational<long> aDefPageZoomX; // zoom in page break preview mode - boost::rational<long> aDefPageZoomY; + Fraction aDefZoomX; + Fraction aDefZoomY; + Fraction aDefPageZoomX; // zoom in page break preview mode + Fraction aDefPageZoomY; ScRefType eRefType; @@ -305,15 +305,15 @@ public: void SetZoomType( SvxZoomType eNew, bool bAll ); void SetZoomType( SvxZoomType eNew, std::vector< SCTAB >& tabs ); - void SetZoom( const boost::rational<long>& rNewX, const boost::rational<long>& rNewY, std::vector< SCTAB >& tabs ); - void SetZoom( const boost::rational<long>& rNewX, const boost::rational<long>& rNewY, bool bAll ); + void SetZoom( const Fraction& rNewX, const Fraction& rNewY, std::vector< SCTAB >& tabs ); + void SetZoom( const Fraction& rNewX, const Fraction& rNewY, bool bAll ); void RefreshZoom(); void SetSelCtrlMouseClick( bool bTmp ) { bSelCtrlMouseClick = bTmp; } SvxZoomType GetZoomType() const { return pThisTab->eZoomType; } - const boost::rational<long>& GetZoomX() const { return bPagebreak ? pThisTab->aPageZoomX : pThisTab->aZoomX; } - const boost::rational<long>& GetZoomY() const { return bPagebreak ? pThisTab->aPageZoomY : pThisTab->aZoomY; } + const Fraction& GetZoomX() const { return bPagebreak ? pThisTab->aPageZoomX : pThisTab->aZoomX; } + const Fraction& GetZoomY() const { return bPagebreak ? pThisTab->aPageZoomY : pThisTab->aZoomY; } void SetShowGrid( bool bShow ); bool GetShowGrid() const { return pThisTab->bShowGrid; } @@ -446,7 +446,7 @@ public: void SetScreen( const Rectangle& rVisArea ); void SetScreenPos( const Point& rVisAreaStart ); - void UpdateScreenZoom( const boost::rational<long>& rNewX, const boost::rational<long>& rNewY ); + void UpdateScreenZoom( const Fraction& rNewX, const Fraction& rNewY ); Size GetScrSize() const { return aScrSize; } diff --git a/sc/source/ui/undo/undobase.cxx b/sc/source/ui/undo/undobase.cxx index 23bb99345fda..2e244ec1a9be 100644 --- a/sc/source/ui/undo/undobase.cxx +++ b/sc/source/ui/undo/undobase.cxx @@ -258,8 +258,8 @@ bool ScBlockUndo::AdjustHeight() ScDocument& rDoc = pDocShell->GetDocument(); VirtualDevice aVirtDev; - boost::rational<long> aZoomX( 1, 1 ); - boost::rational<long> aZoomY = aZoomX; + Fraction aZoomX( 1, 1 ); + Fraction aZoomY = aZoomX; double nPPTX, nPPTY; ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell(); if (pViewShell) @@ -356,8 +356,8 @@ void ScMultiBlockUndo::AdjustHeight() ScDocument& rDoc = pDocShell->GetDocument(); VirtualDevice aVirtDev; - boost::rational<long> aZoomX( 1, 1 ); - boost::rational<long> aZoomY = aZoomX; + Fraction aZoomX( 1, 1 ); + Fraction aZoomY = aZoomX; double nPPTX, nPPTY; ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell(); if (pViewShell) diff --git a/sc/source/ui/undo/undoblk3.cxx b/sc/source/ui/undo/undoblk3.cxx index 661b43495c61..1cd2ce779f94 100644 --- a/sc/source/ui/undo/undoblk3.cxx +++ b/sc/source/ui/undo/undoblk3.cxx @@ -842,8 +842,8 @@ void ScUndoAutoFormat::Redo() if (bSize) { VirtualDevice aVirtDev; - boost::rational<long> aZoomX(1,1); - boost::rational<long> aZoomY = aZoomX; + Fraction aZoomX(1,1); + Fraction aZoomY = aZoomX; double nPPTX,nPPTY; ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell(); if (pViewShell) diff --git a/sc/source/ui/undo/undostyl.cxx b/sc/source/ui/undo/undostyl.cxx index 01bfc89a1705..d84d55abd4c2 100644 --- a/sc/source/ui/undo/undostyl.cxx +++ b/sc/source/ui/undo/undostyl.cxx @@ -110,7 +110,7 @@ static void lcl_DocStyleChanged( ScDocument* pDoc, SfxStyleSheetBase* pStyle, bo Point aLogic = aVDev.LogicToPixel( Point(1000,1000), MAP_TWIP ); double nPPTX = aLogic.X() / 1000.0; double nPPTY = aLogic.Y() / 1000.0; - boost::rational<long> aZoom(1,1); + Fraction aZoom(1,1); pDoc->StyleSheetChanged( pStyle, bRemoved, &aVDev, nPPTX, nPPTY, aZoom, aZoom ); ScInputHandler* pHdl = SC_MOD()->GetInputHdl(); diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx index 314dddb7ef79..f553e5153923 100644 --- a/sc/source/ui/unoobj/docuno.cxx +++ b/sc/source/ui/unoobj/docuno.cxx @@ -1283,13 +1283,17 @@ void SAL_CALL ScModelObj::render( sal_Int32 nSelRenderer, const uno::Any& aSelec // Scale and move the target rectangle from aLocationMM to aLocationPixel, // to get the target rectangle in pixels. - boost::rational<long> aScaleX( aLocationPixel.GetWidth(), aLocationMM.GetWidth() ); - boost::rational<long> aScaleY( aLocationPixel.GetHeight(), aLocationMM.GetHeight() ); - - long nX1 = aLocationPixel.Left() + boost::rational_cast<long>( (aTargetRect.Left() - aLocationMM.Left()) * aScaleX ); - long nX2 = aLocationPixel.Left() + boost::rational_cast<long>( (aTargetRect.Right() - aLocationMM.Left()) * aScaleX ); - long nY1 = aLocationPixel.Top() + boost::rational_cast<long>( (aTargetRect.Top() - aLocationMM.Top()) * aScaleY ); - long nY2 = aLocationPixel.Top() + boost::rational_cast<long>( (aTargetRect.Bottom() - aLocationMM.Top()) * aScaleY ); + Fraction aScaleX( aLocationPixel.GetWidth(), aLocationMM.GetWidth() ); + Fraction aScaleY( aLocationPixel.GetHeight(), aLocationMM.GetHeight() ); + + long nX1 = aLocationPixel.Left() + (long) + ( Fraction( aTargetRect.Left() - aLocationMM.Left(), 1 ) * aScaleX ); + long nX2 = aLocationPixel.Left() + (long) + ( Fraction( aTargetRect.Right() - aLocationMM.Left(), 1 ) * aScaleX ); + long nY1 = aLocationPixel.Top() + (long) + ( Fraction( aTargetRect.Top() - aLocationMM.Top(), 1 ) * aScaleY ); + long nY2 = aLocationPixel.Top() + (long) + ( Fraction( aTargetRect.Bottom() - aLocationMM.Top(), 1 ) * aScaleY ); if ( nX1 > aLocationPixel.Right() ) nX1 = aLocationPixel.Right(); if ( nX2 > aLocationPixel.Right() ) nX2 = aLocationPixel.Right(); diff --git a/sc/source/ui/unoobj/styleuno.cxx b/sc/source/ui/unoobj/styleuno.cxx index 0817ec8ae23a..d06f68bd1115 100644 --- a/sc/source/ui/unoobj/styleuno.cxx +++ b/sc/source/ui/unoobj/styleuno.cxx @@ -758,7 +758,7 @@ void SAL_CALL ScStyleFamilyObj::removeByName( const OUString& aName ) Point aLogic = aVDev.LogicToPixel( Point(1000,1000), MAP_TWIP ); double nPPTX = aLogic.X() / 1000.0; double nPPTY = aLogic.Y() / 1000.0; - boost::rational<long> aZoom(1,1); + Fraction aZoom(1,1); rDoc.StyleSheetChanged( pStyle, false, &aVDev, nPPTX, nPPTY, aZoom, aZoom ); pDocShell->PostPaint( 0,0,0, MAXCOL,MAXROW,MAXTAB, PAINT_GRID|PAINT_LEFT ); pDocShell->SetDocumentModified(); @@ -1100,7 +1100,7 @@ void SAL_CALL ScStyleObj::setParentStyle( const OUString& rParentStyle ) Point aLogic = aVDev.LogicToPixel( Point(1000,1000), MAP_TWIP ); double nPPTX = aLogic.X() / 1000.0; double nPPTY = aLogic.Y() / 1000.0; - boost::rational<long> aZoom(1,1); + Fraction aZoom(1,1); rDoc.StyleSheetChanged( pStyle, false, &aVDev, nPPTX, nPPTY, aZoom, aZoom ); pDocShell->PostPaint( 0,0,0, MAXCOL,MAXROW,MAXTAB, PAINT_GRID|PAINT_LEFT ); @@ -1464,7 +1464,7 @@ void SAL_CALL ScStyleObj::setAllPropertiesToDefault() Point aLogic = aVDev.LogicToPixel( Point(1000,1000), MAP_TWIP ); double nPPTX = aLogic.X() / 1000.0; double nPPTY = aLogic.Y() / 1000.0; - boost::rational<long> aZoom(1,1); + Fraction aZoom(1,1); rDoc.StyleSheetChanged( pStyle, false, &aVDev, nPPTX, nPPTY, aZoom, aZoom ); pDocShell->PostPaint( 0,0,0, MAXCOL,MAXROW,MAXTAB, PAINT_GRID|PAINT_LEFT ); @@ -1843,7 +1843,7 @@ void ScStyleObj::SetOnePropertyValue( const OUString& rPropertyName, const SfxIt Point aLogic = aVDev.LogicToPixel( Point(1000,1000), MAP_TWIP ); double nPPTX = aLogic.X() / 1000.0; double nPPTY = aLogic.Y() / 1000.0; - boost::rational<long> aZoom(1,1); + Fraction aZoom(1,1); rDoc.StyleSheetChanged( pStyle, false, &aVDev, nPPTX, nPPTY, aZoom, aZoom ); pDocShell->PostPaint( 0,0,0, MAXCOL,MAXROW,MAXTAB, PAINT_GRID|PAINT_LEFT ); diff --git a/sc/source/ui/unoobj/viewuno.cxx b/sc/source/ui/unoobj/viewuno.cxx index dfd80686a17b..764800fce1cf 100644 --- a/sc/source/ui/unoobj/viewuno.cxx +++ b/sc/source/ui/unoobj/viewuno.cxx @@ -1446,8 +1446,8 @@ sal_Int16 ScTabViewObj::GetZoom(void) const ScTabViewShell* pViewSh = GetViewShell(); if (pViewSh) { - const boost::rational<long>& rZoomY = pViewSh->GetViewData().GetZoomY(); // Y wird angezeigt - return (sal_Int16)(( rZoomY.numerator() * 100 ) / rZoomY.denominator()); + const Fraction& rZoomY = pViewSh->GetViewData().GetZoomY(); // Y wird angezeigt + return (sal_Int16)(( rZoomY.GetNumerator() * 100 ) / rZoomY.GetDenominator()); } return 0; } @@ -1468,7 +1468,7 @@ void ScTabViewObj::SetZoom(sal_Int16 nZoom) pScMod->SetAppOptions( aNewOpt ); } } - boost::rational<long> aFract( nZoom, 100 ); + Fraction aFract( nZoom, 100 ); pViewSh->SetZoom( aFract, aFract, true ); pViewSh->PaintGrid(); pViewSh->PaintTop(); diff --git a/sc/source/ui/vba/excelvbahelper.cxx b/sc/source/ui/vba/excelvbahelper.cxx index 3771b6fcd3c9..6a745588fc16 100644 --- a/sc/source/ui/vba/excelvbahelper.cxx +++ b/sc/source/ui/vba/excelvbahelper.cxx @@ -97,7 +97,7 @@ getUnoSheetModuleObj( const uno::Reference< table::XCellRange >& xRange ) throw void implSetZoom( const uno::Reference< frame::XModel >& xModel, sal_Int16 nZoom, std::vector< SCTAB >& nTabs ) { ScTabViewShell* pViewSh = excel::getBestViewShell( xModel ); - boost::rational<long> aFract( nZoom, 100 ); + Fraction aFract( nZoom, 100 ); pViewSh->GetViewData().SetZoom( aFract, aFract, nTabs ); pViewSh->RefreshZoom(); } diff --git a/sc/source/ui/view/drawutil.cxx b/sc/source/ui/view/drawutil.cxx index 21840f50ffaf..668337aac0da 100644 --- a/sc/source/ui/view/drawutil.cxx +++ b/sc/source/ui/view/drawutil.cxx @@ -27,9 +27,9 @@ void ScDrawUtil::CalcScale( ScDocument* pDoc, SCTAB nTab, SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, OutputDevice* pDev, - const boost::rational<long>& rZoomX, const boost::rational<long>& rZoomY, + const Fraction& rZoomX, const Fraction& rZoomY, double nPPTX, double nPPTY, - boost::rational<long>& rScaleX, boost::rational<long>& rScaleY ) + Fraction& rScaleX, Fraction& rScaleY ) { long nPixelX = 0; long nTwipsX = 0; @@ -63,27 +63,27 @@ void ScDrawUtil::CalcScale( ScDocument* pDoc, SCTAB nTab, // because ReduceInaccurate is called later anyway. if ( aPixelLog.X() && nTwipsX ) - rScaleX = rational_FromDouble( ((double)aPixelLog.X()) * - ((double)rZoomX.numerator()) / + rScaleX = Fraction( ((double)aPixelLog.X()) * + ((double)rZoomX.GetNumerator()) / ((double)nTwipsX) / ((double)HMM_PER_TWIPS) / - ((double)rZoomX.denominator()) ); + ((double)rZoomX.GetDenominator()) ); else - rScaleX = boost::rational<long>( 1, 1 ); + rScaleX = Fraction( 1, 1 ); if ( aPixelLog.Y() && nTwipsY ) - rScaleY = rational_FromDouble( ((double)aPixelLog.Y()) * - ((double)rZoomY.numerator()) / + rScaleY = Fraction( ((double)aPixelLog.Y()) * + ((double)rZoomY.GetNumerator()) / ((double)nTwipsY) / ((double)HMM_PER_TWIPS) / - ((double)rZoomY.denominator()) ); + ((double)rZoomY.GetDenominator()) ); else - rScaleY = boost::rational<long>( 1, 1 ); + rScaleY = Fraction( 1, 1 ); // 25 bits of accuracy are needed to always hit the right part of // cells in the last rows (was 17 before 1M rows). - rational_ReduceInaccurate(rScaleX, 25); - rational_ReduceInaccurate(rScaleY, 25); + rScaleX.ReduceInaccurate( 25 ); + rScaleY.ReduceInaccurate( 25 ); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/view/drawvie4.cxx b/sc/source/ui/view/drawvie4.cxx index 6a8add5ccc4e..08a3565d28ca 100644 --- a/sc/source/ui/view/drawvie4.cxx +++ b/sc/source/ui/view/drawvie4.cxx @@ -437,7 +437,7 @@ uno::Reference<datatransfer::XTransferable> ScDrawView::CopyToTransferable() // Korrektur fuer 100% berechnen, unabhaengig von momentanen Einstellungen -void ScDrawView::CalcNormScale( boost::rational<long>& rFractX, boost::rational<long>& rFractY ) const +void ScDrawView::CalcNormScale( Fraction& rFractX, Fraction& rFractY ) const { double nPPTX = ScGlobal::nScreenPPTX; double nPPTY = ScGlobal::nScreenPPTY; @@ -453,7 +453,7 @@ void ScDrawView::CalcNormScale( boost::rational<long>& rFractX, boost::rational< if (nEndRow<20) nEndRow = 1000; - boost::rational<long> aZoom(1,1); + Fraction aZoom(1,1); ScDrawUtil::CalcScale( pDoc, nTab, 0,0, nEndCol,nEndRow, pDev, aZoom,aZoom, nPPTX, nPPTY, rFractX,rFractY ); } @@ -513,7 +513,7 @@ void ScDrawView::SetMarkedOriginalSize() { // Pixel-Korrektur beruecksichtigen, damit Bitmap auf dem Bildschirm stimmt - boost::rational<long> aNormScaleX, aNormScaleY; + Fraction aNormScaleX, aNormScaleY; CalcNormScale( aNormScaleX, aNormScaleY ); aDestMap.SetScaleX(aNormScaleX); aDestMap.SetScaleY(aNormScaleY); @@ -535,8 +535,8 @@ void ScDrawView::SetMarkedOriginalSize() Rectangle aDrawRect = pObj->GetLogicRect(); pUndoGroup->AddAction( new SdrUndoGeoObj( *pObj ) ); - pObj->Resize( aDrawRect.TopLeft(), boost::rational<long>( aOriginalSize.Width(), aDrawRect.GetWidth() ), - boost::rational<long>( aOriginalSize.Height(), aDrawRect.GetHeight() ) ); + pObj->Resize( aDrawRect.TopLeft(), Fraction( aOriginalSize.Width(), aDrawRect.GetWidth() ), + Fraction( aOriginalSize.Height(), aDrawRect.GetHeight() ) ); ++nDone; } } diff --git a/sc/source/ui/view/drawview.cxx b/sc/source/ui/view/drawview.cxx index 00e31a2910d0..718091033af3 100644 --- a/sc/source/ui/view/drawview.cxx +++ b/sc/source/ui/view/drawview.cxx @@ -286,7 +286,7 @@ void ScDrawView::DoCut() EndUndo(); } -void ScDrawView::GetScale( boost::rational<long>& rFractX, boost::rational<long>& rFractY ) const +void ScDrawView::GetScale( Fraction& rFractX, Fraction& rFractY ) const { rFractX = aScaleX; rFractY = aScaleY; @@ -296,8 +296,8 @@ void ScDrawView::RecalcScale() { double nPPTX; double nPPTY; - boost::rational<long> aZoomX(1,1); - boost::rational<long> aZoomY(1,1); + Fraction aZoomX(1,1); + Fraction aZoomY(1,1); if (pViewData) { @@ -614,8 +614,8 @@ void ScDrawView::UpdateUserViewOptions() SetSnapEnabled( rGrid.GetUseGridSnap() ); SetGridSnap( rGrid.GetUseGridSnap() ); - boost::rational<long> aFractX( rGrid.GetFldDrawX(), rGrid.GetFldDivisionX() + 1 ); - boost::rational<long> aFractY( rGrid.GetFldDrawY(), rGrid.GetFldDivisionY() + 1 ); + Fraction aFractX( rGrid.GetFldDrawX(), rGrid.GetFldDivisionX() + 1 ); + Fraction aFractY( rGrid.GetFldDrawY(), rGrid.GetFldDivisionY() + 1 ); SetSnapGridWidth( aFractX, aFractY ); SetGridCoarse( Size( rGrid.GetFldDrawX(), rGrid.GetFldDrawY() ) ); diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index 7fd9bdec0ab5..60f0c7e289b2 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -4625,8 +4625,8 @@ void ScGridWindow::UpdateFormulas() ScTableInfo aTabInfo; rDoc.FillInfo( aTabInfo, nX1, nY1, nX2, nY2, nTab, nPPTX, nPPTY, false, false ); - boost::rational<long> aZoomX = pViewData->GetZoomX(); - boost::rational<long> aZoomY = pViewData->GetZoomY(); + Fraction aZoomX = pViewData->GetZoomX(); + Fraction aZoomY = pViewData->GetZoomY(); ScOutputData aOutputData( this, OUTTYPE_WINDOW, aTabInfo, &rDoc, nTab, nScrX, nScrY, nX1, nY1, nX2, nY2, nPPTX, nPPTY, &aZoomX, &aZoomY ); diff --git a/sc/source/ui/view/gridwin3.cxx b/sc/source/ui/view/gridwin3.cxx index 9cbaa2a9139b..e9ac6ca2054a 100644 --- a/sc/source/ui/view/gridwin3.cxx +++ b/sc/source/ui/view/gridwin3.cxx @@ -247,8 +247,8 @@ MapMode ScGridWindow::GetDrawMapMode( bool bForce ) ScDrawView* pDrView = pViewData->GetView()->GetScDrawView(); if ( pDrView || bForce ) { - boost::rational<long> aScaleX; - boost::rational<long> aScaleY; + Fraction aScaleX; + Fraction aScaleY; if (pDrView) pDrView->GetScale( aScaleX, aScaleY ); else diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx index 56f35ecb4496..0991b7e5bed5 100644 --- a/sc/source/ui/view/gridwin4.cxx +++ b/sc/source/ui/view/gridwin4.cxx @@ -77,7 +77,7 @@ static void lcl_LimitRect( Rectangle& rRect, const Rectangle& rVisible ) static void lcl_DrawOneFrame( OutputDevice* pDev, const Rectangle& rInnerPixel, const OUString& rTitle, const Color& rColor, bool bTextBelow, - double nPPTX, double nPPTY, const boost::rational<long>& rZoomY, + double nPPTX, double nPPTY, const Fraction& rZoomY, ScDocument* pDoc, ScViewData* pButtonViewData, bool bLayoutRTL ) { // pButtonViewData wird nur benutzt, um die Button-Groesse zu setzen, @@ -132,8 +132,8 @@ static void lcl_DrawOneFrame( OutputDevice* pDev, const Rectangle& rInnerPixel, ScDDComboBoxButton aComboButton((vcl::Window*)pDev); aComboButton.SetOptSizePixel(); - long nBWidth = ( aComboButton.GetSizePixel().Width() * rZoomY.numerator() ) - / rZoomY.denominator(); + long nBWidth = ( aComboButton.GetSizePixel().Width() * rZoomY.GetNumerator() ) + / rZoomY.GetDenominator(); long nBHeight = nVer + aTextSize.Height() + 1; Size aButSize( nBWidth, nBHeight ); long nButtonPos = bLayoutRTL ? aOuter.Left() : aOuter.Right()-nBWidth+1; @@ -470,8 +470,8 @@ void ScGridWindow::Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, ScUpdateMod nPPTX, nPPTY, false, bFormulaMode, &pViewData->GetMarkData() ); - boost::rational<long> aZoomX = pViewData->GetZoomX(); - boost::rational<long> aZoomY = pViewData->GetZoomY(); + Fraction aZoomX = pViewData->GetZoomX(); + Fraction aZoomY = pViewData->GetZoomY(); ScOutputData aOutputData( this, OUTTYPE_WINDOW, aTabInfo, &rDoc, nTab, nScrX, nScrY, nX1, nY1, nX2, nY2, nPPTX, nPPTY, &aZoomX, &aZoomY ); diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx index 617288e69ef2..1e94298dc046 100644 --- a/sc/source/ui/view/output.cxx +++ b/sc/source/ui/view/output.cxx @@ -145,7 +145,7 @@ ScOutputData::ScOutputData( OutputDevice* pNewDev, ScOutputType eNewType, SCTAB nNewTab, long nNewScrX, long nNewScrY, SCCOL nNewX1, SCROW nNewY1, SCCOL nNewX2, SCROW nNewY2, double nPixelPerTwipsX, double nPixelPerTwipsY, - const boost::rational<long>* pZoomX, const boost::rational<long>* pZoomY ) : + const Fraction* pZoomX, const Fraction* pZoomY ) : mpDev( pNewDev ), mpRefDevice( pNewDev ), // default is output device pFmtDevice( pNewDev ), // default is output device @@ -193,11 +193,11 @@ ScOutputData::ScOutputData( OutputDevice* pNewDev, ScOutputType eNewType, if (pZoomX) aZoomX = *pZoomX; else - aZoomX = boost::rational<long>(1,1); + aZoomX = Fraction(1,1); if (pZoomY) aZoomY = *pZoomY; else - aZoomY = boost::rational<long>(1,1); + aZoomY = Fraction(1,1); nVisX1 = nX1; nVisY1 = nY1; diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx index a5a9af577aae..9f7e48ff2276 100644 --- a/sc/source/ui/view/output2.cxx +++ b/sc/source/ui/view/output2.cxx @@ -231,7 +231,7 @@ void ScDrawStringsVars::SetShrinkScale( long nScale, sal_uInt8 nScript ) // call GetFont with a modified fraction, use only the height - boost::rational<long> aFraction( nScale, 100 ); + Fraction aFraction( nScale, 100 ); if ( !bPixelToLogic ) aFraction *= pOutput->aZoomY; vcl::Font aTmpFont; @@ -810,12 +810,12 @@ double ScOutputData::GetStretch() if ( mpRefDevice == pFmtDevice ) { MapMode aOld = mpRefDevice->GetMapMode(); - return boost::rational_cast<double>(aOld.GetScaleY()) / boost::rational_cast<double>(aOld.GetScaleX()) * boost::rational_cast<double>(this->aZoomY) / boost::rational_cast<double>(this->aZoomX); + return ((double)aOld.GetScaleY()) / ((double)aOld.GetScaleX()) * ((double)aZoomY) / ((double)aZoomX); } else { // when formatting for printer, device map mode has already been taken care of - return boost::rational_cast<double>(this->aZoomY) / boost::rational_cast<double>(this->aZoomX); + return ((double)aZoomY) / ((double)aZoomX); } } @@ -2787,7 +2787,7 @@ void ScOutputData::DrawEditStandard(DrawEditParam& rParam) // #i85342# screen display and formatting for printer, // use same GetEditArea call as in ScViewData::SetEditEngine - boost::rational<long> aFract(1,1); + Fraction aFract(1,1); Rectangle aUtilRect = ScEditUtil( mpDoc, rParam.mnCellX, rParam.mnCellY, nTab, Point(0,0), pFmtDevice, HMM_PER_TWIPS, HMM_PER_TWIPS, aFract, aFract ).GetEditArea( rParam.mpPattern, false ); aLogicSize.Width() = aUtilRect.GetWidth(); @@ -3809,7 +3809,7 @@ void ScOutputData::DrawEditStacked(DrawEditParam& rParam) // #i85342# screen display and formatting for printer, // use same GetEditArea call as in ScViewData::SetEditEngine - boost::rational<long> aFract(1,1); + Fraction aFract(1,1); Rectangle aUtilRect = ScEditUtil( mpDoc, rParam.mnCellX, rParam.mnCellY, nTab, Point(0,0), pFmtDevice, HMM_PER_TWIPS, HMM_PER_TWIPS, aFract, aFract ).GetEditArea( rParam.mpPattern, false ); aLogicSize.Width() = aUtilRect.GetWidth(); @@ -4165,7 +4165,7 @@ void ScOutputData::DrawEditAsianVertical(DrawEditParam& rParam) // #i85342# screen display and formatting for printer, // use same GetEditArea call as in ScViewData::SetEditEngine - boost::rational<long> aFract(1,1); + Fraction aFract(1,1); Rectangle aUtilRect = ScEditUtil( mpDoc, rParam.mnCellX, rParam.mnCellY, nTab, Point(0,0), pFmtDevice, HMM_PER_TWIPS, HMM_PER_TWIPS, aFract, aFract ).GetEditArea( rParam.mpPattern, false ); aLogicSize.Width() = aUtilRect.GetWidth(); diff --git a/sc/source/ui/view/overlayobject.cxx b/sc/source/ui/view/overlayobject.cxx index 1e2fe00972fd..778e44f0dfe0 100644 --- a/sc/source/ui/view/overlayobject.cxx +++ b/sc/source/ui/view/overlayobject.cxx @@ -20,6 +20,7 @@ #include "overlayobject.hxx" #include <vcl/outdev.hxx> #include <vcl/lineinfo.hxx> +#include <tools/fract.hxx> #include <basegfx/range/b2drange.hxx> #include <basegfx/polygon/b2dpolygon.hxx> #include <basegfx/polygon/b2dpolygontools.hxx> diff --git a/sc/source/ui/view/preview.cxx b/sc/source/ui/view/preview.cxx index ab843eec4a89..786711ec9e95 100644 --- a/sc/source/ui/view/preview.cxx +++ b/sc/source/ui/view/preview.cxx @@ -344,8 +344,8 @@ void ScPreview::DoPrint( ScPreviewLocationData* pFillLocation ) UpdateDrawView(); // Spreedsheet eventually changes } - boost::rational<long> aPreviewZoom( nZoom, 100 ); - boost::rational<long> aHorPrevZoom( long( 100 * nZoom / pDocShell->GetOutputFactor() ), 10000 ); + Fraction aPreviewZoom( nZoom, 100 ); + Fraction aHorPrevZoom( (long)( 100 * nZoom / pDocShell->GetOutputFactor() ), 10000 ); MapMode aMMMode( MAP_100TH_MM, Point(), aHorPrevZoom, aPreviewZoom ); bool bDoPrint = ( pFillLocation == NULL ); @@ -732,8 +732,8 @@ void ScPreview::SetZoom(sal_uInt16 nNewZoom) // apply new MapMode and call UpdateScrollBars to update aOffset - boost::rational<long> aPreviewZoom( nZoom, 100 ); - boost::rational<long> aHorPrevZoom( long( 100 * nZoom / pDocShell->GetOutputFactor() ), 10000 ); + Fraction aPreviewZoom( nZoom, 100 ); + Fraction aHorPrevZoom( (long)( 100 * nZoom / pDocShell->GetOutputFactor() ), 10000 ); MapMode aMMMode( MAP_100TH_MM, Point(), aHorPrevZoom, aPreviewZoom ); SetMapMode( aMMMode ); @@ -961,8 +961,8 @@ void ScPreview::DataChanged( const DataChangedEvent& rDCEvt ) void ScPreview::MouseButtonDown( const MouseEvent& rMEvt ) { - boost::rational<long> aPreviewZoom( nZoom, 100 ); - boost::rational<long> aHorPrevZoom( long( 100 * nZoom / pDocShell->GetOutputFactor() ), 10000 ); + Fraction aPreviewZoom( nZoom, 100 ); + Fraction aHorPrevZoom( (long)( 100 * nZoom / pDocShell->GetOutputFactor() ), 10000 ); MapMode aMMMode( MAP_100TH_MM, Point(), aHorPrevZoom, aPreviewZoom ); aButtonDownChangePoint = PixelToLogic( rMEvt.GetPosPixel(),aMMMode ); @@ -1044,8 +1044,8 @@ void ScPreview::MouseButtonDown( const MouseEvent& rMEvt ) void ScPreview::MouseButtonUp( const MouseEvent& rMEvt ) { - boost::rational<long> aPreviewZoom( nZoom, 100 ); - boost::rational<long> aHorPrevZoom( long( 100 * nZoom / pDocShell->GetOutputFactor() ), 10000 ); + Fraction aPreviewZoom( nZoom, 100 ); + Fraction aHorPrevZoom( (long)( 100 * nZoom / pDocShell->GetOutputFactor() ), 10000 ); MapMode aMMMode( MAP_100TH_MM, Point(), aHorPrevZoom, aPreviewZoom ); aButtonUpPt = PixelToLogic( rMEvt.GetPosPixel(),aMMMode ); @@ -1294,8 +1294,8 @@ void ScPreview::MouseButtonUp( const MouseEvent& rMEvt ) void ScPreview::MouseMove( const MouseEvent& rMEvt ) { - boost::rational<long> aPreviewZoom( nZoom, 100 ); - boost::rational<long> aHorPrevZoom( long( 100 * nZoom / pDocShell->GetOutputFactor() ), 10000 ); + Fraction aPreviewZoom( nZoom, 100 ); + Fraction aHorPrevZoom( (long)( 100 * nZoom / pDocShell->GetOutputFactor() ), 10000 ); MapMode aMMMode( MAP_100TH_MM, Point(), aHorPrevZoom, aPreviewZoom ); Point aMouseMovePoint = PixelToLogic( rMEvt.GetPosPixel(), aMMMode ); @@ -1540,8 +1540,8 @@ void ScPreview::SwitchView() void ScPreview::DragMove( long nDragMovePos, sal_uInt16 nFlags ) { - boost::rational<long> aPreviewZoom( nZoom, 100 ); - boost::rational<long> aHorPrevZoom( long( 100 * nZoom / pDocShell->GetOutputFactor() ), 10000 ); + Fraction aPreviewZoom( nZoom, 100 ); + Fraction aHorPrevZoom( (long)( 100 * nZoom / pDocShell->GetOutputFactor() ), 10000 ); MapMode aMMMode( MAP_100TH_MM, Point(), aHorPrevZoom, aPreviewZoom ); SetMapMode( aMMMode ); long nPos = nDragMovePos; diff --git a/sc/source/ui/view/printfun.cxx b/sc/source/ui/view/printfun.cxx index 0e2bda3c4421..bb379604e695 100644 --- a/sc/source/ui/view/printfun.cxx +++ b/sc/source/ui/view/printfun.cxx @@ -1593,7 +1593,7 @@ void ScPrintFunc::PrintArea( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, if ( !pPrinter ) { OutputDevice* pRefDev = pDoc->GetPrinter(); // use the printer also for Preview - boost::rational<long> aPrintFrac( nZoom, 100 ); // without nManualZoom + Fraction aPrintFrac( nZoom, 100 ); // without nManualZoom // MapMode, as it would arrive at the printer: pRefDev->SetMapMode( MapMode( MAP_100TH_MM, Point(), aPrintFrac, aPrintFrac ) ); @@ -2543,13 +2543,13 @@ void ScPrintFunc::InitModes() // set MapModes from nZoom etc. long nEffZoom = nZoom * (long) nManualZoom; nScaleX = nScaleY = HMM_PER_TWIPS; // output in 1/100 mm - boost::rational<long> aZoomFract( nEffZoom,10000 ); - boost::rational<long> aHorFract = aZoomFract; + Fraction aZoomFract( nEffZoom,10000 ); + Fraction aHorFract = aZoomFract; if ( !pPrinter && !bIsRender ) // adjust scale for preview { double nFact = pDocShell->GetOutputFactor(); - aHorFract = boost::rational<long>( long( nEffZoom / nFact ), 10000 ); + aHorFract = Fraction( (long)( nEffZoom / nFact ), 10000 ); } aLogicMode = MapMode( MAP_100TH_MM, Point(), aHorFract, aZoomFract ); @@ -2557,7 +2557,7 @@ void ScPrintFunc::InitModes() // set MapModes from nZoom etc. Point aLogicOfs( -aOffset.X(), -aOffset.Y() ); aOffsetMode = MapMode( MAP_100TH_MM, aLogicOfs, aHorFract, aZoomFract ); - Point aTwipsOfs( long( -aOffset.X() / nScaleX + 0.5 ), long( -aOffset.Y() / nScaleY + 0.5 ) ); + Point aTwipsOfs( (long) ( -aOffset.X() / nScaleX + 0.5 ), (long) ( -aOffset.Y() / nScaleY + 0.5 ) ); aTwipMode = MapMode( MAP_TWIP, aTwipsOfs, aHorFract, aZoomFract ); } diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx index 6802dd0e7bf7..9150af64bee9 100644 --- a/sc/source/ui/view/tabview.cxx +++ b/sc/source/ui/view/tabview.cxx @@ -697,11 +697,11 @@ void ScTabView::UpdateVarZoom() if ( eZoomType != SVX_ZOOM_PERCENT && !bInZoomUpdate ) { bInZoomUpdate = true; - const boost::rational<long>& rOldX = GetViewData().GetZoomX(); - const boost::rational<long>& rOldY = GetViewData().GetZoomY(); - long nOldPercent = ( rOldY.numerator() * 100 ) / rOldY.denominator(); + const Fraction& rOldX = GetViewData().GetZoomX(); + const Fraction& rOldY = GetViewData().GetZoomY(); + long nOldPercent = ( rOldY.GetNumerator() * 100 ) / rOldY.GetDenominator(); sal_uInt16 nNewZoom = CalcZoom( eZoomType, (sal_uInt16)nOldPercent ); - boost::rational<long> aNew( nNewZoom, 100 ); + Fraction aNew( nNewZoom, 100 ); if ( aNew != rOldX || aNew != rOldY ) { @@ -924,8 +924,8 @@ bool ScTabView::ScrollCommand( const CommandEvent& rCEvt, ScSplitPos ePos ) // for ole inplace editing, the scale is defined by the visarea and client size // and can't be changed directly - const boost::rational<long>& rOldY = aViewData.GetZoomY(); - long nOld = long(( rOldY.numerator() * 100 ) / rOldY.denominator()); + const Fraction& rOldY = aViewData.GetZoomY(); + long nOld = (long)(( rOldY.GetNumerator() * 100 ) / rOldY.GetDenominator()); long nNew = nOld; if ( pData->GetMode() == COMMAND_WHEEL_ZOOM_SCALE ) { @@ -943,7 +943,7 @@ bool ScTabView::ScrollCommand( const CommandEvent& rCEvt, ScSplitPos ePos ) bool bSyncZoom = SC_MOD()->GetAppOptions().GetSynchronizeZoom(); SetZoomType( SVX_ZOOM_PERCENT, bSyncZoom ); - boost::rational<long> aFract( nNew, 100 ); + Fraction aFract( nNew, 100 ); SetZoom( aFract, aFract, bSyncZoom ); PaintGrid(); PaintTop(); diff --git a/sc/source/ui/view/tabview2.cxx b/sc/source/ui/view/tabview2.cxx index e19348adeed2..c79d356065ae 100644 --- a/sc/source/ui/view/tabview2.cxx +++ b/sc/source/ui/view/tabview2.cxx @@ -1111,7 +1111,7 @@ static bool lcl_FitsInWindow( double fScaleX, double fScaleY, sal_uInt16 nZoom, SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, SCCOL nFixPosX, SCROW nFixPosY ) { - double fZoomFactor = boost::rational_cast<double>(boost::rational<long>(nZoom, 100)); + double fZoomFactor = (double)Fraction(nZoom,100); fScaleX *= fZoomFactor; fScaleY *= fZoomFactor; diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx index 749f542747d4..028a5ff6cce9 100644 --- a/sc/source/ui/view/tabview3.cxx +++ b/sc/source/ui/view/tabview3.cxx @@ -2337,8 +2337,8 @@ void ScTabView::RecalcPPT() // call view SetZoom (including draw scale, split update etc) // and paint only if values changed - boost::rational<long> aZoomX = aViewData.GetZoomX(); - boost::rational<long> aZoomY = aViewData.GetZoomY(); + Fraction aZoomX = aViewData.GetZoomX(); + Fraction aZoomY = aViewData.GetZoomY(); SetZoom( aZoomX, aZoomY, false ); PaintGrid(); diff --git a/sc/source/ui/view/tabview5.cxx b/sc/source/ui/view/tabview5.cxx index 65f6d072323f..8d08c29a1d25 100644 --- a/sc/source/ui/view/tabview5.cxx +++ b/sc/source/ui/view/tabview5.cxx @@ -370,7 +370,7 @@ void ScTabView::SetZoomType( SvxZoomType eNew, bool bAll ) aViewData.SetZoomType( eNew, bAll ); } -void ScTabView::SetZoom( const boost::rational<long>& rNewX, const boost::rational<long>& rNewY, bool bAll ) +void ScTabView::SetZoom( const Fraction& rNewX, const Fraction& rNewY, bool bAll ) { aViewData.SetZoom( rNewX, rNewY, bAll ); if (pDrawView) diff --git a/sc/source/ui/view/tabvwsh3.cxx b/sc/source/ui/view/tabvwsh3.cxx index ded17ef4177e..68044eea1059 100644 --- a/sc/source/ui/view/tabvwsh3.cxx +++ b/sc/source/ui/view/tabvwsh3.cxx @@ -627,9 +627,9 @@ void ScTabViewShell::Execute( SfxRequest& rReq ) bool bSyncZoom = SC_MOD()->GetAppOptions().GetSynchronizeZoom(); SvxZoomType eOldZoomType = GetZoomType(); SvxZoomType eNewZoomType = eOldZoomType; - const boost::rational<long>& rOldY = GetViewData().GetZoomY(); // Y wird angezeigt - sal_uInt16 nOldZoom = (sal_uInt16)(( rOldY.numerator() * 100 ) - / rOldY.denominator()); + const Fraction& rOldY = GetViewData().GetZoomY(); // Y wird angezeigt + sal_uInt16 nOldZoom = (sal_uInt16)(( rOldY.GetNumerator() * 100 ) + / rOldY.GetDenominator()); sal_uInt16 nZoom = nOldZoom; bool bCancel = false; @@ -720,7 +720,7 @@ void ScTabViewShell::Execute( SfxRequest& rReq ) aNewOpt.SetZoomType( GetZoomType() ); pScMod->SetAppOptions( aNewOpt ); } - boost::rational<long> aFract( nZoom, 100 ); + Fraction aFract( nZoom, 100 ); SetZoom( aFract, aFract, bSyncZoom ); PaintGrid(); PaintTop(); @@ -749,7 +749,7 @@ void ScTabViewShell::Execute( SfxRequest& rReq ) aNewOpt.SetZoomType( GetZoomType() ); pScMod->SetAppOptions( aNewOpt ); } - boost::rational<long> aFract( nCurrentZoom,100 ); + Fraction aFract( nCurrentZoom,100 ); SetZoom( aFract, aFract, bSyncZoom ); PaintGrid(); PaintTop(); diff --git a/sc/source/ui/view/tabvwsh4.cxx b/sc/source/ui/view/tabvwsh4.cxx index ee241c451ae3..6123f565bd39 100644 --- a/sc/source/ui/view/tabvwsh4.cxx +++ b/sc/source/ui/view/tabvwsh4.cxx @@ -333,8 +333,8 @@ void ScTabViewShell::UpdateOleZoom() { vcl::Window* pWin = GetActiveWin(); Size aWinHMM = pWin->PixelToLogic( pWin->GetOutputSizePixel(), MAP_100TH_MM ); - SetZoomFactor( boost::rational<long>( aWinHMM.Width(),aObjSize.Width() ), - boost::rational<long>( aWinHMM.Height(),aObjSize.Height() ) ); + SetZoomFactor( Fraction( aWinHMM.Width(),aObjSize.Width() ), + Fraction( aWinHMM.Height(),aObjSize.Height() ) ); } } } @@ -362,8 +362,8 @@ void ScTabViewShell::InnerResizePixel( const Point &rOfs, const Size &rSize ) if ( aObjSize.Width() > 0 && aObjSize.Height() > 0 ) { Size aLogicSize = GetWindow()->PixelToLogic( aSize, MAP_100TH_MM ); - SfxViewShell::SetZoomFactor( boost::rational<long>( aLogicSize.Width(),aObjSize.Width() ), - boost::rational<long>( aLogicSize.Height(),aObjSize.Height() ) ); + SfxViewShell::SetZoomFactor( Fraction( aLogicSize.Width(),aObjSize.Width() ), + Fraction( aLogicSize.Height(),aObjSize.Height() ) ); } Point aPos( rOfs ); @@ -401,19 +401,19 @@ void ScTabViewShell::OuterResizePixel( const Point &rOfs, const Size &rSize ) ForceMove(); } -void ScTabViewShell::SetZoomFactor( const boost::rational<long>& rZoomX, const boost::rational<long>& rZoomY ) +void ScTabViewShell::SetZoomFactor( const Fraction &rZoomX, const Fraction &rZoomY ) { // fuer OLE... - boost::rational<long> aFrac20( 1,5 ); - boost::rational<long> aFrac400( 4,1 ); + Fraction aFrac20( 1,5 ); + Fraction aFrac400( 4,1 ); - boost::rational<long> aNewX( rZoomX ); + Fraction aNewX( rZoomX ); if ( aNewX < aFrac20 ) aNewX = aFrac20; if ( aNewX > aFrac400 ) aNewX = aFrac400; - boost::rational<long> aNewY( rZoomY ); + Fraction aNewY( rZoomY ); if ( aNewY < aFrac20 ) aNewY = aFrac20; if ( aNewY > aFrac400 ) @@ -1727,7 +1727,7 @@ ScTabViewShell::ScTabViewShell( SfxViewFrame* pViewFrame, } else { - boost::rational<long> aFract( rAppOpt.GetZoom(), 100 ); + Fraction aFract( rAppOpt.GetZoom(), 100 ); SetZoom( aFract, aFract, true ); SetZoomType( rAppOpt.GetZoomType(), true ); } diff --git a/sc/source/ui/view/tabvwsha.cxx b/sc/source/ui/view/tabvwsha.cxx index 5c2727a50667..adde73054bbb 100644 --- a/sc/source/ui/view/tabvwsha.cxx +++ b/sc/source/ui/view/tabvwsha.cxx @@ -287,8 +287,9 @@ void ScTabViewShell::GetState( SfxItemSet& rSet ) rSet.DisableItem( nWhich ); else { - const boost::rational<long>& rOldY = GetViewData().GetZoomY(); - sal_uInt16 nZoom = (sal_uInt16)(( rOldY.numerator() * 100 ) / rOldY.denominator()); + const Fraction& rOldY = GetViewData().GetZoomY(); + sal_uInt16 nZoom = (sal_uInt16)(( rOldY.GetNumerator() * 100 ) + / rOldY.GetDenominator()); rSet.Put( SvxZoomItem( SVX_ZOOM_PERCENT, nZoom, nWhich ) ); } break; @@ -299,8 +300,8 @@ void ScTabViewShell::GetState( SfxItemSet& rSet ) rSet.DisableItem( nWhich ); else { - const boost::rational<long>& rOldY = GetViewData().GetZoomY(); - sal_uInt16 nCurrentZoom = (sal_uInt16)(( rOldY.numerator() * 100 ) / rOldY.denominator()); + const Fraction& rOldY = GetViewData().GetZoomY(); + sal_uInt16 nCurrentZoom = (sal_uInt16)(( rOldY.GetNumerator() * 100 ) / rOldY.GetDenominator()); if( nCurrentZoom ) { diff --git a/sc/source/ui/view/tabvwshb.cxx b/sc/source/ui/view/tabvwshb.cxx index 5b422dfb15c5..9fe7f0faae30 100644 --- a/sc/source/ui/view/tabvwshb.cxx +++ b/sc/source/ui/view/tabvwshb.cxx @@ -85,10 +85,10 @@ void ScTabViewShell::ConnectObject( SdrOle2Obj* pObj ) Size aOleSize = pObj->GetOrigObjSize(); - boost::rational<long> aScaleWidth (aDrawSize.Width(), aOleSize.Width() ); - boost::rational<long> aScaleHeight(aDrawSize.Height(), aOleSize.Height() ); - rational_ReduceInaccurate(aScaleWidth, 10); // kompatibel zum SdrOle2Obj - rational_ReduceInaccurate(aScaleHeight, 10); + Fraction aScaleWidth (aDrawSize.Width(), aOleSize.Width() ); + Fraction aScaleHeight(aDrawSize.Height(), aOleSize.Height() ); + aScaleWidth.ReduceInaccurate(10); // kompatibel zum SdrOle2Obj + aScaleHeight.ReduceInaccurate(10); pClient->SetSizeScale(aScaleWidth,aScaleHeight); // sichtbarer Ausschnitt wird nur inplace veraendert! @@ -145,17 +145,17 @@ bool ScTabViewShell::ActivateObject( SdrOle2Obj* pObj, long nVerb ) awt::Size aSz( aOleSize.Width(), aOleSize.Height() ); xObj->setVisualAreaSize( pClient->GetAspect(), aSz ); } - boost::rational<long> aOne( 1, 1 ); + Fraction aOne( 1, 1 ); pClient->SetSizeScale( aOne, aOne ); } else { // calculate scale from client and VisArea size - boost::rational<long> aScaleWidth (aDrawSize.Width(), aOleSize.Width() ); - boost::rational<long> aScaleHeight(aDrawSize.Height(), aOleSize.Height() ); - rational_ReduceInaccurate(aScaleWidth, 10); // kompatibel zum SdrOle2Obj - rational_ReduceInaccurate(aScaleHeight, 10); + Fraction aScaleWidth (aDrawSize.Width(), aOleSize.Width() ); + Fraction aScaleHeight(aDrawSize.Height(), aOleSize.Height() ); + aScaleWidth.ReduceInaccurate(10); // kompatibel zum SdrOle2Obj + aScaleHeight.ReduceInaccurate(10); pClient->SetSizeScale(aScaleWidth,aScaleHeight); } diff --git a/sc/source/ui/view/tabvwshh.cxx b/sc/source/ui/view/tabvwshh.cxx index a54edd9b8473..acc30375c587 100644 --- a/sc/source/ui/view/tabvwshh.cxx +++ b/sc/source/ui/view/tabvwshh.cxx @@ -123,12 +123,12 @@ void ScTabViewShell::ExecuteObject( SfxRequest& rReq ) pDrView->MoveMarkedObj( Size( 0, nNewVal - aRect.Top() ) ); else if ( nSlotId == SID_OBJECT_WIDTH ) pDrView->ResizeMarkedObj( aRect.TopLeft(), - boost::rational<long>( nNewVal, aRect.GetWidth() ), - boost::rational<long>( 1, 1 ) ); + Fraction( nNewVal, aRect.GetWidth() ), + Fraction( 1, 1 ) ); else // if ( nSlotId == SID_OBJECT_HEIGHT ) pDrView->ResizeMarkedObj( aRect.TopLeft(), - boost::rational<long>( 1, 1 ), - boost::rational<long>( nNewVal, aRect.GetHeight() ) ); + Fraction( 1, 1 ), + Fraction( nNewVal, aRect.GetHeight() ) ); bDone = true; } } diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx index 1dd2d255a0d7..af08c7080b74 100644 --- a/sc/source/ui/view/viewdata.cxx +++ b/sc/source/ui/view/viewdata.cxx @@ -144,8 +144,8 @@ void ScViewDataTable::WriteUserDataSequence(uno::Sequence <beans::PropertyValue> pSettings[SC_POSITION_BOTTOM].Name = OUString(SC_POSITIONBOTTOM); pSettings[SC_POSITION_BOTTOM].Value <<= sal_Int32(nPosY[SC_SPLIT_BOTTOM]); - sal_Int32 nZoomValue ((aZoomY.numerator() * 100) / aZoomY.denominator()); - sal_Int32 nPageZoomValue ((aPageZoomY.numerator() * 100) / aPageZoomY.denominator()); + sal_Int32 nZoomValue ((aZoomY.GetNumerator() * 100) / aZoomY.GetDenominator()); + sal_Int32 nPageZoomValue ((aPageZoomY.GetNumerator() * 100) / aPageZoomY.GetDenominator()); pSettings[SC_TABLE_ZOOM_TYPE].Name = OUString(SC_ZOOMTYPE); pSettings[SC_TABLE_ZOOM_TYPE].Value <<= sal_Int16(eZoomType); pSettings[SC_TABLE_ZOOM_VALUE].Name = OUString(SC_ZOOMVALUE); @@ -248,14 +248,14 @@ void ScViewDataTable::ReadUserDataSequence(const uno::Sequence <beans::PropertyV else if (sName.equalsAscii(SC_ZOOMVALUE) ) { aSettings[i].Value >>= nTemp32; - boost::rational<long> aZoom(nTemp32, 100); + Fraction aZoom(nTemp32, 100); aZoomX = aZoomY = aZoom; rHasZoom = true; } else if (sName.equalsAscii(SC_PAGEVIEWZOOMVALUE) ) { aSettings[i].Value >>= nTemp32; - boost::rational<long> aZoom(nTemp32, 100); + Fraction aZoom(nTemp32, 100); aPageZoomX = aPageZoomY = aZoom; rHasZoom = true; } @@ -616,21 +616,21 @@ void ScViewData::SetZoomType( SvxZoomType eNew, bool bAll ) SetZoomType( eNew, vTabs ); } -void ScViewData::SetZoom( const boost::rational<long>& rNewX, const boost::rational<long>& rNewY, std::vector< SCTAB >& tabs ) +void ScViewData::SetZoom( const Fraction& rNewX, const Fraction& rNewY, std::vector< SCTAB >& tabs ) { bool bAll = ( tabs.empty() ); if ( !bAll ) // create associated table data CreateTabData( tabs ); - boost::rational<long> aFrac20( 1,5 ); - boost::rational<long> aFrac400( 4,1 ); + Fraction aFrac20( 1,5 ); + Fraction aFrac400( 4,1 ); - boost::rational<long> aValidX = rNewX; + Fraction aValidX = rNewX; if (aValidX<aFrac20) aValidX = aFrac20; if (aValidX>aFrac400) aValidX = aFrac400; - boost::rational<long> aValidY = rNewY; + Fraction aValidY = rNewY; if (aValidY<aFrac20) aValidY = aFrac20; if (aValidY>aFrac400) @@ -690,7 +690,7 @@ void ScViewData::SetZoom( const boost::rational<long>& rNewX, const boost::ratio RefreshZoom(); } -void ScViewData::SetZoom( const boost::rational<long>& rNewX, const boost::rational<long>& rNewY, bool bAll ) +void ScViewData::SetZoom( const Fraction& rNewX, const Fraction& rNewY, bool bAll ) { std::vector< SCTAB > vTabs; if ( !bAll ) // get selected tabs @@ -1033,7 +1033,7 @@ void ScViewData::SetEditEngine( ScSplitPos eWhich, // if text is formatted for printer, use the exact same paper width // (and same line breaks) as for output. - boost::rational<long> aFract(1,1); + Fraction aFract(1,1); Rectangle aUtilRect = ScEditUtil( pDoc,nNewX,nNewY,nTabNo, Point(0,0), pWin, HMM_PER_TWIPS, HMM_PER_TWIPS, aFract, aFract ).GetEditArea( pPattern, false ); aPaperSize.Width() = aUtilRect.GetWidth(); @@ -2120,31 +2120,31 @@ bool ScViewData::IsMinimized() return pView->IsMinimized(); } -void ScViewData::UpdateScreenZoom( const boost::rational<long>& rNewX, const boost::rational<long>& rNewY ) +void ScViewData::UpdateScreenZoom( const Fraction& rNewX, const Fraction& rNewY ) { - boost::rational<long> aOldX = GetZoomX(); - boost::rational<long> aOldY = GetZoomY(); + Fraction aOldX = GetZoomX(); + Fraction aOldY = GetZoomY(); SetZoom( rNewX, rNewY, false ); - boost::rational<long> aWidth = GetZoomX(); - aWidth *= aScrSize.Width(); + Fraction aWidth = GetZoomX(); + aWidth *= Fraction( aScrSize.Width(),1 ); aWidth /= aOldX; - boost::rational<long> aHeight = GetZoomY(); - aHeight *= aScrSize.Height(); + Fraction aHeight = GetZoomY(); + aHeight *= Fraction( aScrSize.Height(),1 ); aHeight /= aOldY; - aScrSize.Width() = boost::rational_cast<long>(aWidth); - aScrSize.Height() = boost::rational_cast<long>(aHeight); + aScrSize.Width() = (long) aWidth; + aScrSize.Height() = (long) aHeight; } void ScViewData::CalcPPT() { - nPPTX = ScGlobal::nScreenPPTX * boost::rational_cast<double>(this->GetZoomX()); + nPPTX = ScGlobal::nScreenPPTX * (double) GetZoomX(); if (pDocShell) nPPTX = nPPTX / pDocShell->GetOutputFactor(); // Faktor ist Drucker zu Bildschirm - nPPTY = ScGlobal::nScreenPPTY * boost::rational_cast<double>(this->GetZoomY()); + nPPTY = ScGlobal::nScreenPPTY * (double) GetZoomY(); // if detective objects are present, // try to adjust horizontal scale so the most common column width has minimal rounding errors, @@ -2192,9 +2192,9 @@ void ScViewData::WriteUserData(OUString& rData) // PosX[links]/PosX[rechts]/PosY[oben]/PosY[unten] // wenn Zeilen groesser 8192, "+" statt "/" - sal_uInt16 nZoom = (sal_uInt16)((pThisTab->aZoomY.numerator() * 100) / pThisTab->aZoomY.denominator()); + sal_uInt16 nZoom = (sal_uInt16)((pThisTab->aZoomY.GetNumerator() * 100) / pThisTab->aZoomY.GetDenominator()); rData = OUString::number( nZoom ) + "/"; - nZoom = (sal_uInt16)((pThisTab->aPageZoomY.numerator() * 100) / pThisTab->aPageZoomY.denominator()); + nZoom = (sal_uInt16)((pThisTab->aPageZoomY.GetNumerator() * 100) / pThisTab->aPageZoomY.GetDenominator()); rData += OUString::number( nZoom ) + "/"; if (bPagebreak) rData += "1"; @@ -2259,15 +2259,15 @@ void ScViewData::ReadUserData(const OUString& rData) // nicht pro Tabelle: SCTAB nTabStart = 2; - boost::rational<long> aZoomX, aZoomY, aPageZoomX, aPageZoomY; // evaluate (all sheets?) + Fraction aZoomX, aZoomY, aPageZoomX, aPageZoomY; // evaluate (all sheets?) OUString aZoomStr = rData.getToken(0, ';'); // Zoom/PageZoom/Modus sal_uInt16 nNormZoom = sal::static_int_cast<sal_uInt16>(aZoomStr.getToken(0,'/').toInt32()); if ( nNormZoom >= MINZOOM && nNormZoom <= MAXZOOM ) - aZoomX = aZoomY = boost::rational<long>( nNormZoom, 100 ); // "normal" zoom (always) + aZoomX = aZoomY = Fraction( nNormZoom, 100 ); // "normal" zoom (always) sal_uInt16 nPageZoom = sal::static_int_cast<sal_uInt16>(aZoomStr.getToken(1,'/').toInt32()); if ( nPageZoom >= MINZOOM && nPageZoom <= MAXZOOM ) - aPageZoomX = aPageZoomY = boost::rational<long>( nPageZoom, 100 ); // Pagebreak-zoom, if set + aPageZoomX = aPageZoomY = Fraction( nPageZoom, 100 ); // Pagebreak-zoom, if set sal_Unicode cMode = aZoomStr.getToken(2,'/')[0]; // 0 or "0"/"1" SetPagebreakMode( cMode == '1' ); // SetPagebreakMode muss immer gerufen werden wegen CalcPPT / RecalcPixPos() @@ -2447,8 +2447,8 @@ void ScViewData::WriteExtOptions( ScExtDocOptions& rDocOpt ) const // view mode and zoom rTabSett.mbPageMode = bPagebreak; - rTabSett.mnNormalZoom = boost::rational_cast<long>(pViewTab->aZoomY * rational_FromDouble(100.)); - rTabSett.mnPageZoom = boost::rational_cast<long>(pViewTab->aPageZoomY * rational_FromDouble(100.)); + rTabSett.mnNormalZoom = static_cast< long >( pViewTab->aZoomY * Fraction( 100.0 ) ); + rTabSett.mnPageZoom = static_cast< long >( pViewTab->aPageZoomY * Fraction( 100.0 ) ); } } } @@ -2579,9 +2579,9 @@ void ScViewData::ReadExtOptions( const ScExtDocOptions& rDocOpt ) // zoom for each sheet if( rTabSett.mnNormalZoom ) - rViewTab.aZoomX = rViewTab.aZoomY = boost::rational<long>( rTabSett.mnNormalZoom, 100L ); + rViewTab.aZoomX = rViewTab.aZoomY = Fraction( rTabSett.mnNormalZoom, 100L ); if( rTabSett.mnPageZoom ) - rViewTab.aPageZoomX = rViewTab.aPageZoomY = boost::rational<long>( rTabSett.mnPageZoom, 100L ); + rViewTab.aPageZoomX = rViewTab.aPageZoomY = Fraction( rTabSett.mnPageZoom, 100L ); rViewTab.bShowGrid = rTabSett.mbShowGrid; @@ -2599,9 +2599,9 @@ void ScViewData::ReadExtOptions( const ScExtDocOptions& rDocOpt ) // view mode and default zoom (for new sheets) from current sheet if( rTabSett.mnNormalZoom ) - aDefZoomX = aDefZoomY = boost::rational<long>( rTabSett.mnNormalZoom, 100L ); + aDefZoomX = aDefZoomY = Fraction( rTabSett.mnNormalZoom, 100L ); if( rTabSett.mnPageZoom ) - aDefPageZoomX = aDefPageZoomY = boost::rational<long>( rTabSett.mnPageZoom, 100L ); + aDefPageZoomX = aDefPageZoomY = Fraction( rTabSett.mnPageZoom, 100L ); /* #i46820# set pagebreak mode via SetPagebreakMode(), this will update map modes that are needed to draw text correctly. */ SetPagebreakMode( rTabSett.mbPageMode ); @@ -2662,8 +2662,8 @@ void ScViewData::WriteUserDataSequence(uno::Sequence <beans::PropertyValue>& rSe pSettings[SC_ACTIVE_TABLE].Value <<= sName; pSettings[SC_HORIZONTAL_SCROLL_BAR_WIDTH].Name = OUString(SC_HORIZONTALSCROLLBARWIDTH); pSettings[SC_HORIZONTAL_SCROLL_BAR_WIDTH].Value <<= sal_Int32(pView->GetTabBarWidth()); - sal_Int32 nZoomValue ((pThisTab->aZoomY.numerator() * 100) / pThisTab->aZoomY.denominator()); - sal_Int32 nPageZoomValue ((pThisTab->aPageZoomY.numerator() * 100) / pThisTab->aPageZoomY.denominator()); + sal_Int32 nZoomValue ((pThisTab->aZoomY.GetNumerator() * 100) / pThisTab->aZoomY.GetDenominator()); + sal_Int32 nPageZoomValue ((pThisTab->aPageZoomY.GetNumerator() * 100) / pThisTab->aPageZoomY.GetDenominator()); pSettings[SC_ZOOM_TYPE].Name = OUString(SC_ZOOMTYPE); pSettings[SC_ZOOM_TYPE].Value <<= sal_Int16(pThisTab->eZoomType); pSettings[SC_ZOOM_VALUE].Name = OUString(SC_ZOOMVALUE); @@ -2787,7 +2787,7 @@ void ScViewData::ReadUserDataSequence(const uno::Sequence <beans::PropertyValue> { if (rSettings[i].Value >>= nTemp32) { - boost::rational<long> aZoom(nTemp32, 100); + Fraction aZoom(nTemp32, 100); aDefZoomX = aDefZoomY = aZoom; } } @@ -2795,7 +2795,7 @@ void ScViewData::ReadUserDataSequence(const uno::Sequence <beans::PropertyValue> { if (rSettings[i].Value >>= nTemp32) { - boost::rational<long> aZoom(nTemp32, 100); + Fraction aZoom(nTemp32, 100); aDefPageZoomX = aDefPageZoomY = aZoom; } } diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx index 76e2309c6a4f..c2c4de149596 100644 --- a/sc/source/ui/view/viewfun2.cxx +++ b/sc/source/ui/view/viewfun2.cxx @@ -114,15 +114,15 @@ bool ScViewFunc::AdjustBlockHeight( bool bPaint, ScMarkData* pMarkData ) double nPPTX = GetViewData().GetPPTX(); double nPPTY = GetViewData().GetPPTY(); - boost::rational<long> aZoomX = GetViewData().GetZoomX(); - boost::rational<long> aZoomY = GetViewData().GetZoomY(); + Fraction aZoomX = GetViewData().GetZoomX(); + Fraction aZoomY = GetViewData().GetZoomY(); ScSizeDeviceProvider aProv(pDocSh); if (aProv.IsPrinter()) { nPPTX = aProv.GetPPTX(); nPPTY = aProv.GetPPTY(); - aZoomX = aZoomY = boost::rational<long>( 1, 1 ); + aZoomX = aZoomY = Fraction( 1, 1 ); } sc::RowHeightContext aCxt(nPPTX, nPPTY, aZoomX, aZoomY, aProv.GetDevice()); @@ -165,8 +165,8 @@ bool ScViewFunc::AdjustRowHeight( SCROW nStartRow, SCROW nEndRow, bool bPaint ) SCTAB nTab = GetViewData().GetTabNo(); double nPPTX = GetViewData().GetPPTX(); double nPPTY = GetViewData().GetPPTY(); - boost::rational<long> aZoomX = GetViewData().GetZoomX(); - boost::rational<long> aZoomY = GetViewData().GetZoomY(); + Fraction aZoomX = GetViewData().GetZoomX(); + Fraction aZoomY = GetViewData().GetZoomY(); sal_uInt16 nOldPixel = 0; if (nStartRow == nEndRow) nOldPixel = (sal_uInt16) (rDoc.GetRowHeight(nStartRow,nTab) * nPPTY); @@ -176,7 +176,7 @@ bool ScViewFunc::AdjustRowHeight( SCROW nStartRow, SCROW nEndRow, bool bPaint ) { nPPTX = aProv.GetPPTX(); nPPTY = aProv.GetPPTY(); - aZoomX = aZoomY = boost::rational<long>( 1, 1 ); + aZoomX = aZoomY = Fraction( 1, 1 ); } sc::RowHeightContext aCxt(nPPTX, nPPTY, aZoomX, aZoomY, aProv.GetDevice()); bool bChanged = rDoc.SetOptimalHeight(aCxt, nStartRow, nEndRow, nTab); diff --git a/sc/source/ui/view/viewfun7.cxx b/sc/source/ui/view/viewfun7.cxx index 1e27dd1e9be1..b937eb3bf121 100644 --- a/sc/source/ui/view/viewfun7.cxx +++ b/sc/source/ui/view/viewfun7.cxx @@ -420,7 +420,7 @@ bool ScViewFunc::PasteGraphic( const Point& rPos, const Graphic& rGraphic, if (aSourceMap.GetMapUnit() == MAP_PIXEL) { // consider pixel correction, so bitmap fits to screen - boost::rational<long> aScaleX, aScaleY; + Fraction aScaleX, aScaleY; pScDrawView->CalcNormScale( aScaleX, aScaleY ); aDestMap.SetScaleX(aScaleX); aDestMap.SetScaleY(aScaleY); diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx index 4f89e13103e9..6a537b8616a3 100644 --- a/sc/source/ui/view/viewfunc.cxx +++ b/sc/source/ui/view/viewfunc.cxx @@ -228,15 +228,15 @@ sal_uInt16 ScViewFunc::GetOptimalColWidth( SCCOL nCol, SCTAB nTab, bool bFormula double nPPTX = GetViewData().GetPPTX(); double nPPTY = GetViewData().GetPPTY(); - boost::rational<long> aZoomX = GetViewData().GetZoomX(); - boost::rational<long> aZoomY = GetViewData().GetZoomY(); + Fraction aZoomX = GetViewData().GetZoomX(); + Fraction aZoomY = GetViewData().GetZoomY(); ScSizeDeviceProvider aProv(pDocSh); if (aProv.IsPrinter()) { nPPTX = aProv.GetPPTX(); nPPTY = aProv.GetPPTY(); - aZoomX = aZoomY = boost::rational<long>( 1, 1 ); + aZoomX = aZoomY = Fraction( 1, 1 ); } sal_uInt16 nTwips = rDoc.GetOptimalColWidth( nCol, nTab, aProv.GetDevice(), @@ -1960,15 +1960,15 @@ void ScViewFunc::SetWidthOrHeight( double nPPTX = GetViewData().GetPPTX(); double nPPTY = GetViewData().GetPPTY(); - boost::rational<long> aZoomX = GetViewData().GetZoomX(); - boost::rational<long> aZoomY = GetViewData().GetZoomY(); + Fraction aZoomX = GetViewData().GetZoomX(); + Fraction aZoomY = GetViewData().GetZoomY(); ScSizeDeviceProvider aProv(pDocSh); if (aProv.IsPrinter()) { nPPTX = aProv.GetPPTX(); nPPTY = aProv.GetPPTY(); - aZoomX = aZoomY = boost::rational<long>( 1, 1 ); + aZoomX = aZoomY = Fraction( 1, 1 ); } sc::RowHeightContext aCxt(nPPTX, nPPTY, aZoomX, aZoomY, aProv.GetDevice()); @@ -2194,15 +2194,15 @@ void ScViewFunc::ModifyCellSize( ScDirection eDir, bool bOptimal ) { double nPPTX = GetViewData().GetPPTX(); double nPPTY = GetViewData().GetPPTY(); - boost::rational<long> aZoomX = GetViewData().GetZoomX(); - boost::rational<long> aZoomY = GetViewData().GetZoomY(); + Fraction aZoomX = GetViewData().GetZoomX(); + Fraction aZoomY = GetViewData().GetZoomY(); ScSizeDeviceProvider aProv(pDocSh); if (aProv.IsPrinter()) { nPPTX = aProv.GetPPTX(); nPPTY = aProv.GetPPTY(); - aZoomX = aZoomY = boost::rational<long>( 1, 1 ); + aZoomX = aZoomY = Fraction( 1, 1 ); } long nPixel = rDoc.GetNeededSize( nCol, nRow, nTab, aProv.GetDevice(), |