summaryrefslogtreecommitdiff
path: root/sw/source/filter
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/filter')
-rw-r--r--sw/source/filter/html/htmlflywriter.cxx8
-rw-r--r--sw/source/filter/writer/wrtswtbl.cxx8
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx2
-rw-r--r--sw/source/filter/ww8/rtfexport.cxx2
-rw-r--r--sw/source/filter/ww8/writerhelper.cxx18
-rw-r--r--sw/source/filter/ww8/wrtw8esh.cxx8
-rw-r--r--sw/source/filter/ww8/ww8graf.cxx18
-rw-r--r--sw/source/filter/ww8/ww8par4.cxx8
8 files changed, 37 insertions, 35 deletions
diff --git a/sw/source/filter/html/htmlflywriter.cxx b/sw/source/filter/html/htmlflywriter.cxx
index 17e207eed8b5..6a0d313b6316 100644
--- a/sw/source/filter/html/htmlflywriter.cxx
+++ b/sw/source/filter/html/htmlflywriter.cxx
@@ -1120,8 +1120,8 @@ OUString lclWriteOutImap(SwHTMLWriter& rHTMLWrt, const SfxItemSet& rItemSet, con
} while (bFound);
bool bScale = false;
- boost::rational<long> aScaleX(1, 1);
- boost::rational<long> aScaleY(1, 1);
+ Fraction aScaleX(1, 1);
+ Fraction aScaleY(1, 1);
const SwFmtFrmSize& rFrmSize = rFrmFmt.GetFrmSize();
const SvxBoxItem& rBox = rFrmFmt.GetBox();
@@ -1137,7 +1137,7 @@ OUString lclWriteOutImap(SwHTMLWriter& rHTMLWrt, const SfxItemSet& rItemSet, con
if (rRealSize.Width() != nWidth)
{
- aScaleX = boost::rational<long>(nWidth, rRealSize.Width());
+ aScaleX = Fraction(nWidth, rRealSize.Width());
bScale = true;
}
}
@@ -1154,7 +1154,7 @@ OUString lclWriteOutImap(SwHTMLWriter& rHTMLWrt, const SfxItemSet& rItemSet, con
if (rRealSize.Height() != nHeight)
{
- aScaleY = boost::rational<long>(nHeight, rRealSize.Height());
+ aScaleY = Fraction(nHeight, rRealSize.Height());
bScale = true;
}
}
diff --git a/sw/source/filter/writer/wrtswtbl.cxx b/sw/source/filter/writer/wrtswtbl.cxx
index 3285e1379636..cfa1781afff8 100644
--- a/sw/source/filter/writer/wrtswtbl.cxx
+++ b/sw/source/filter/writer/wrtswtbl.cxx
@@ -20,7 +20,7 @@
#include <hintids.hxx>
#include <editeng/boxitem.hxx>
#include <editeng/brushitem.hxx>
-#include <tools/rational.hxx>
+#include <tools/fract.hxx>
#include <wrtswtbl.hxx>
#include <swtable.hxx>
#include <frmfmt.hxx>
@@ -344,7 +344,8 @@ sal_uInt16 SwWriteTable::GetRelWidth( sal_uInt16 nCol, sal_uInt16 nColSpan ) con
{
long nWidth = GetRawWidth( nCol, nColSpan );
- return (sal_uInt16) boost::rational_cast<long>(boost::rational<long>(nWidth * 256 + GetBaseWidth() / 2, GetBaseWidth()));
+ return (sal_uInt16)(long)Fraction( nWidth*256 + GetBaseWidth()/2,
+ GetBaseWidth() );
}
sal_uInt16 SwWriteTable::GetPrcWidth( sal_uInt16 nCol, sal_uInt16 nColSpan ) const
@@ -353,7 +354,8 @@ sal_uInt16 SwWriteTable::GetPrcWidth( sal_uInt16 nCol, sal_uInt16 nColSpan ) con
// Looks funny, but is nothing more than
// [(100 * nWidth) + .5] without rounding errors
- return (sal_uInt16) boost::rational_cast<long>(boost::rational<long>(nWidth * 100 + GetBaseWidth() / 2, GetBaseWidth()));
+ return (sal_uInt16)(long)Fraction( nWidth*100 + GetBaseWidth()/2,
+ GetBaseWidth() );
}
long SwWriteTable::GetAbsHeight(long nRawHeight, size_t const nRow,
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 9b0a164a7e69..be93040e6e95 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -6723,7 +6723,7 @@ void DocxAttributeOutput::FootnotesEndnotes( bool bFootnotes )
{
const SwPageFtnInfo& rFtnInfo = m_rExport.pDoc->GetPageDesc(0).GetFtnInfo();
// Request a separator only in case the width is larger than zero.
- bSeparator = boost::rational_cast<double>(rFtnInfo.GetWidth()) > 0;
+ bSeparator = double(rFtnInfo.GetWidth()) > 0;
}
if (bSeparator)
diff --git a/sw/source/filter/ww8/rtfexport.cxx b/sw/source/filter/ww8/rtfexport.cxx
index c776688fdce7..e0bebb95255f 100644
--- a/sw/source/filter/ww8/rtfexport.cxx
+++ b/sw/source/filter/ww8/rtfexport.cxx
@@ -396,7 +396,7 @@ void RtfExport::WriteFootnoteSettings()
{
const SwPageFtnInfo& rFtnInfo = pDoc->GetPageDesc(0).GetFtnInfo();
// Request a separator only in case the width is larger than zero.
- bool bSeparator = boost::rational_cast<double>(rFtnInfo.GetWidth()) > 0;
+ bool bSeparator = double(rFtnInfo.GetWidth()) > 0;
Strm().WriteChar('{').WriteCharPtr(OOO_STRING_SVTOOLS_RTF_IGNORE).WriteCharPtr(OOO_STRING_SVTOOLS_RTF_FTNSEP);
if (bSeparator)
diff --git a/sw/source/filter/ww8/writerhelper.cxx b/sw/source/filter/ww8/writerhelper.cxx
index aa0362d2191a..0fc558f546b1 100644
--- a/sw/source/filter/ww8/writerhelper.cxx
+++ b/sw/source/filter/ww8/writerhelper.cxx
@@ -666,9 +666,9 @@ namespace sw
{
Polygon aPoly(PolygonFromPolyPolygon(rPolyPoly));
const Size &rOrigSize = pNd->GetGraphic().GetPrefSize();
- boost::rational<long> aMapPolyX(ww::nWrap100Percent, rOrigSize.Width());
- boost::rational<long> aMapPolyY(ww::nWrap100Percent, rOrigSize.Height());
- aPoly.Scale(boost::rational_cast<double>(aMapPolyX), boost::rational_cast<double>(aMapPolyY));
+ Fraction aMapPolyX(ww::nWrap100Percent, rOrigSize.Width());
+ Fraction aMapPolyY(ww::nWrap100Percent, rOrigSize.Height());
+ aPoly.Scale(aMapPolyX, aMapPolyY);
/*
a) stretch right bound by 15twips
@@ -678,15 +678,15 @@ namespace sw
See the import for details
*/
const Size &rSize = pNd->GetTwipSize();
- boost::rational<long> aMoveHack(ww::nWrap100Percent, rSize.Width());
- aMoveHack *= boost::rational<long>(15, 1);
- long nMove(boost::rational_cast<long>(aMoveHack));
+ Fraction aMoveHack(ww::nWrap100Percent, rSize.Width());
+ aMoveHack *= Fraction(15, 1);
+ long nMove(aMoveHack);
- boost::rational<long> aHackX(ww::nWrap100Percent + nMove,
+ Fraction aHackX(ww::nWrap100Percent + nMove,
ww::nWrap100Percent);
- boost::rational<long> aHackY(ww::nWrap100Percent - nMove,
+ Fraction aHackY(ww::nWrap100Percent - nMove,
ww::nWrap100Percent);
- aPoly.Scale(boost::rational_cast<double>(aHackX), boost::rational_cast<double>(aHackY));
+ aPoly.Scale(aHackX, aHackY);
aPoly.Move(-nMove, 0);
return aPoly;
diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx
index a259e9130d57..104cdbeddb01 100644
--- a/sw/source/filter/ww8/wrtw8esh.cxx
+++ b/sw/source/filter/ww8/wrtw8esh.cxx
@@ -2155,12 +2155,12 @@ void SwBasicEscherEx::Init()
// MS-DFF-Properties sind grossteils in EMU (English Metric Units) angegeben
// 1mm=36000emu, 1twip=635emu
- boost::rational<long> aFact(360, 1);
+ Fraction aFact(360, 1);
aFact /= GetMapFactor(MAP_100TH_MM, eMap).X();
// create little values
- aFact = boost::rational<long>(aFact.numerator(), aFact.denominator());
- mnEmuMul = aFact.numerator();
- mnEmuDiv = aFact.denominator();
+ aFact = Fraction(aFact.GetNumerator(), aFact.GetDenominator());
+ mnEmuMul = aFact.GetNumerator();
+ mnEmuDiv = aFact.GetDenominator();
SetHellLayerId(rWrt.pDoc->getIDocumentDrawModelAccess().GetHellId());
}
diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx
index 02abc6c6f2d1..56324f571182 100644
--- a/sw/source/filter/ww8/ww8graf.cxx
+++ b/sw/source/filter/ww8/ww8graf.cxx
@@ -1951,20 +1951,20 @@ void SwWW8ImplReader::MapWrapIntoFlyFmt(SvxMSDffImportRec* pRecord,
b) stretch bottom bound to where I think it should have been
in the first place
*/
- boost::rational<long> aMoveHack(ww::nWrap100Percent, rSize.Width());
- aMoveHack *= boost::rational<long>(15, 1);
- long nMove(boost::rational_cast<long>(aMoveHack));
+ Fraction aMoveHack(ww::nWrap100Percent, rSize.Width());
+ aMoveHack *= Fraction(15, 1);
+ long nMove(aMoveHack);
aPoly.Move(nMove, 0);
- boost::rational<long> aHackX(ww::nWrap100Percent, ww::nWrap100Percent + nMove);
- boost::rational<long> aHackY(ww::nWrap100Percent, ww::nWrap100Percent - nMove);
- aPoly.Scale(boost::rational_cast<double>(aHackX), boost::rational_cast<double>(aHackY));
+ Fraction aHackX(ww::nWrap100Percent, ww::nWrap100Percent + nMove);
+ Fraction aHackY(ww::nWrap100Percent, ww::nWrap100Percent - nMove);
+ aPoly.Scale(aHackX, aHackY);
// Turn polygon back into units that match the graphic's
const Size &rOrigSize = pNd->GetGraphic().GetPrefSize();
- boost::rational<long> aMapPolyX(rOrigSize.Width(), ww::nWrap100Percent);
- boost::rational<long> aMapPolyY(rOrigSize.Height(), ww::nWrap100Percent);
- aPoly.Scale(boost::rational_cast<double>(aMapPolyX), boost::rational_cast<double>(aMapPolyY));
+ Fraction aMapPolyX(rOrigSize.Width(), ww::nWrap100Percent);
+ Fraction aMapPolyY(rOrigSize.Height(), ww::nWrap100Percent);
+ aPoly.Scale(aMapPolyX, aMapPolyY);
// #i47277# - contour is already in unit of the
// graphic preferred unit. Thus, call method <SetContour(..)>
diff --git a/sw/source/filter/ww8/ww8par4.cxx b/sw/source/filter/ww8/ww8par4.cxx
index b7dcac3b7831..b09fec67d5bf 100644
--- a/sw/source/filter/ww8/ww8par4.cxx
+++ b/sw/source/filter/ww8/ww8par4.cxx
@@ -170,8 +170,8 @@ static bool SwWw6ReadMetaStream(GDIMetaFile& rWMF, OLE_MFP* pMfp,
// neue Groesse am MetaFile setzen
Size aOldSiz( rWMF.GetPrefSize() );
Size aNewSiz( pMfp->xExt, pMfp->yExt );
- boost::rational<long> aFracX( aNewSiz.Width(), aOldSiz.Width() );
- boost::rational<long> aFracY( aNewSiz.Height(), aOldSiz.Height() );
+ Fraction aFracX( aNewSiz.Width(), aOldSiz.Width() );
+ Fraction aFracY( aNewSiz.Height(), aOldSiz.Height() );
rWMF.Scale( aFracX, aFracY );
rWMF.SetPrefSize( aNewSiz );
@@ -326,8 +326,8 @@ bool SwWW8ImplReader::ImportOleWMF(SvStorageRef xSrc1,GDIMetaFile &rWMF,
aFinalSize = OutputDevice::LogicToLogic(
aFinalSize, MAP_TWIP, rWMF.GetPrefMapMode() );
aOrigSize = rWMF.GetPrefSize();
- boost::rational<long> aScaleX(aFinalSize.Width(),aOrigSize.Width());
- boost::rational<long> aScaleY(aFinalSize.Height(),aOrigSize.Height());
+ Fraction aScaleX(aFinalSize.Width(),aOrigSize.Width());
+ Fraction aScaleY(aFinalSize.Height(),aOrigSize.Height());
rWMF.Scale( aScaleX, aScaleY );
bOk = true;
}