[Libreoffice-commits] core.git: basctl/source basic/source chart2/source connectivity/inc connectivity/source cui/source dbaccess/source desktop/source drawinglayer/source editeng/source filter/source forms/source include/oox include/sfx2 include/svtools include/svx include/tools include/vcl reportdesign/inc reportdesign/source sc/inc sc/source sd/source sfx2/inc sfx2/source starmath/inc starmath/source svtools/source svx/inc svx/source sw/inc sw/source toolkit/source tools/CppunitTest_tools_test.mk tools/Library_tl.mk tools/qa tools/source tools/test vcl/inc vcl/source writerfilter/source
Juan Picca
jumapico at gmail.com
Thu Oct 9 04:33:59 PDT 2014
basctl/source/dlged/dlged.cxx | 4
basctl/source/dlged/dlgedobj.cxx | 4
basctl/source/inc/dlgedobj.hxx | 4
basic/source/runtime/methods1.cxx | 4
chart2/source/controller/main/ChartController_Window.cxx | 4
chart2/source/view/main/DrawModelWrapper.cxx | 2
connectivity/inc/pch/precompiled_dbtools.hxx | 2
connectivity/source/commontools/RowFunctionParser.cxx | 2
cui/source/tabpages/grfpage.cxx | 4
cui/source/tabpages/transfrm.cxx | 28
dbaccess/source/ui/inc/JoinController.hxx | 2
desktop/source/lib/init.cxx | 2
drawinglayer/source/primitive2d/metafileprimitive2d.cxx | 6
editeng/source/editeng/impedit3.cxx | 6
filter/source/graphicfilter/eos2met/eos2met.cxx | 36
filter/source/graphicfilter/epict/epict.cxx | 38
filter/source/graphicfilter/eps/eps.cxx | 4
filter/source/graphicfilter/ios2met/ios2met.cxx | 4
filter/source/graphicfilter/ipict/ipict.cxx | 6
filter/source/graphicfilter/ipsd/ipsd.cxx | 4
filter/source/graphicfilter/itiff/itiff.cxx | 2
filter/source/msfilter/eschesdo.cxx | 2
filter/source/msfilter/msdffimp.cxx | 44
filter/source/msfilter/svdfppt.cxx | 6
filter/source/pdf/pdfexport.cxx | 1
filter/source/svg/svgwriter.cxx | 8
forms/source/richtext/richtextimplcontrol.cxx | 2
include/oox/export/chartexport.hxx | 2
include/oox/export/shapes.hxx | 2
include/sfx2/ipclient.hxx | 10
include/sfx2/objsh.hxx | 4
include/sfx2/viewfrm.hxx | 4
include/sfx2/viewsh.hxx | 4
include/svtools/imap.hxx | 4
include/svtools/imapcirc.hxx | 4
include/svtools/imappoly.hxx | 4
include/svtools/imaprect.hxx | 4
include/svtools/ruler.hxx | 6
include/svx/obj3d.hxx | 2
include/svx/scene3d.hxx | 4
include/svx/sdr/properties/defaultproperties.hxx | 2
include/svx/sdr/properties/properties.hxx | 4
include/svx/svddrag.hxx | 6
include/svx/svddrgmt.hxx | 4
include/svx/svdedtv.hxx | 6
include/svx/svdetc.hxx | 6
include/svx/svdglev.hxx | 2
include/svx/svdmodel.hxx | 22
include/svx/svdoashp.hxx | 4
include/svx/svdobj.hxx | 4
include/svx/svdocapt.hxx | 2
include/svx/svdocirc.hxx | 2
include/svx/svdoedge.hxx | 2
include/svx/svdograf.hxx | 2
include/svx/svdogrp.hxx | 4
include/svx/svdomeas.hxx | 2
include/svx/svdoole2.hxx | 4
include/svx/svdopath.hxx | 2
include/svx/svdorect.hxx | 2
include/svx/svdotable.hxx | 2
include/svx/svdotext.hxx | 6
include/svx/svdouno.hxx | 2
include/svx/svdovirt.hxx | 4
include/svx/svdpoev.hxx | 2
include/svx/svdsnpv.hxx | 12
include/svx/svdtrans.hxx | 40
include/svx/sxfiitm.hxx | 10
include/svx/sxsiitm.hxx | 4
include/tools/bigint.hxx | 4
include/tools/fract.hxx | 142 --
include/tools/rational.hxx | 25
include/vcl/gdimtf.hxx | 2
include/vcl/mapmod.hxx | 16
include/vcl/virdev.hxx | 2
include/vcl/window.hxx | 4
reportdesign/inc/RptObject.hxx | 6
reportdesign/source/core/sdr/RptObject.cxx | 6
reportdesign/source/ui/inc/DesignView.hxx | 2
reportdesign/source/ui/inc/ReportWindow.hxx | 2
reportdesign/source/ui/inc/ScrollHelper.hxx | 2
reportdesign/source/ui/inc/SectionWindow.hxx | 2
reportdesign/source/ui/inc/StartMarker.hxx | 2
reportdesign/source/ui/inc/UITools.hxx | 2
reportdesign/source/ui/inc/ViewsWindow.hxx | 2
reportdesign/source/ui/misc/UITools.cxx | 2
reportdesign/source/ui/report/DesignView.cxx | 2
reportdesign/source/ui/report/EndMarker.cxx | 4
reportdesign/source/ui/report/ReportController.cxx | 2
reportdesign/source/ui/report/ReportSection.cxx | 4
reportdesign/source/ui/report/ReportWindow.cxx | 28
reportdesign/source/ui/report/ScrollHelper.cxx | 12
reportdesign/source/ui/report/SectionWindow.cxx | 20
reportdesign/source/ui/report/StartMarker.cxx | 20
reportdesign/source/ui/report/ViewsWindow.cxx | 14
reportdesign/source/ui/report/dlgedfunc.cxx | 6
sc/inc/column.hxx | 6
sc/inc/document.hxx | 8
sc/inc/editutil.hxx | 8
sc/inc/patattr.hxx | 6
sc/inc/pch/precompiled_sc.hxx | 2
sc/inc/rowheightcontext.hxx | 12
sc/inc/table.hxx | 6
sc/source/core/data/column2.cxx | 12
sc/source/core/data/dociter.cxx | 6
sc/source/core/data/documen8.cxx | 4
sc/source/core/data/document.cxx | 6
sc/source/core/data/drwlayer.cxx | 10
sc/source/core/data/patattr.cxx | 8
sc/source/core/data/rowheightcontext.cxx | 2
sc/source/core/data/table1.cxx | 6
sc/source/core/data/table2.cxx | 2
sc/source/filter/rtf/eeimpars.cxx | 6
sc/source/ui/app/client.cxx | 6
sc/source/ui/app/inputhdl.cxx | 2
sc/source/ui/cctrl/dpcontrol.cxx | 6
sc/source/ui/docshell/docfunc.cxx | 6
sc/source/ui/docshell/docsh.cxx | 6
sc/source/ui/docshell/docsh5.cxx | 4
sc/source/ui/drawfunc/fuins1.cxx | 2
sc/source/ui/inc/dpcontrol.hxx | 10
sc/source/ui/inc/drawutil.hxx | 6
sc/source/ui/inc/drawview.hxx | 8
sc/source/ui/inc/inputhdl.hxx | 10
sc/source/ui/inc/output.hxx | 10
sc/source/ui/inc/tabview.hxx | 2
sc/source/ui/inc/tabvwsh.hxx | 2
sc/source/ui/inc/viewdata.hxx | 26
sc/source/ui/undo/undobase.cxx | 8
sc/source/ui/undo/undoblk3.cxx | 4
sc/source/ui/undo/undostyl.cxx | 2
sc/source/ui/unoobj/docuno.cxx | 18
sc/source/ui/unoobj/styleuno.cxx | 8
sc/source/ui/unoobj/viewuno.cxx | 6
sc/source/ui/vba/excelvbahelper.cxx | 2
sc/source/ui/view/drawutil.cxx | 24
sc/source/ui/view/drawvie4.cxx | 10
sc/source/ui/view/drawview.cxx | 10
sc/source/ui/view/gridwin.cxx | 4
sc/source/ui/view/gridwin3.cxx | 4
sc/source/ui/view/gridwin4.cxx | 10
sc/source/ui/view/output.cxx | 6
sc/source/ui/view/output2.cxx | 12
sc/source/ui/view/overlayobject.cxx | 1
sc/source/ui/view/preview.cxx | 24
sc/source/ui/view/printfun.cxx | 10
sc/source/ui/view/tabview.cxx | 14
sc/source/ui/view/tabview2.cxx | 2
sc/source/ui/view/tabview3.cxx | 4
sc/source/ui/view/tabview5.cxx | 2
sc/source/ui/view/tabvwsh3.cxx | 10
sc/source/ui/view/tabvwsh4.cxx | 20
sc/source/ui/view/tabvwsha.cxx | 9
sc/source/ui/view/tabvwshb.cxx | 18
sc/source/ui/view/tabvwshh.cxx | 8
sc/source/ui/view/viewdata.cxx | 74 -
sc/source/ui/view/viewfun2.cxx | 12
sc/source/ui/view/viewfun7.cxx | 2
sc/source/ui/view/viewfunc.cxx | 18
sd/source/core/drawdoc.cxx | 6
sd/source/core/sdpage.cxx | 22
sd/source/filter/eppt/eppt.cxx | 2
sd/source/filter/eppt/epptbase.hxx | 2
sd/source/filter/eppt/pptx-text.cxx | 4
sd/source/ui/animations/motionpathtag.cxx | 2
sd/source/ui/annotations/annotationwindow.cxx | 2
sd/source/ui/app/optsitem.cxx | 4
sd/source/ui/app/sdmod2.cxx | 8
sd/source/ui/dlg/animobjs.cxx | 18
sd/source/ui/dlg/copydlg.cxx | 30
sd/source/ui/dlg/dlgsnap.cxx | 16
sd/source/ui/dlg/docprev.cxx | 2
sd/source/ui/dlg/vectdlg.cxx | 8
sd/source/ui/docshell/docshel2.cxx | 4
sd/source/ui/docshell/sdclient.cxx | 4
sd/source/ui/func/fucopy.cxx | 4
sd/source/ui/inc/DrawViewShell.hxx | 2
sd/source/ui/inc/ViewShell.hxx | 4
sd/source/ui/inc/ViewShellBase.hxx | 4
sd/source/ui/inc/animobjs.hxx | 6
sd/source/ui/inc/copydlg.hxx | 2
sd/source/ui/inc/dlgsnap.hxx | 4
sd/source/ui/inc/vectdlg.hxx | 2
sd/source/ui/slidesorter/inc/view/SlsLayouter.hxx | 4
sd/source/ui/tools/PreviewRenderer.cxx | 4
sd/source/ui/unoidl/UnoDocumentSettings.cxx | 8
sd/source/ui/unoidl/unomodel.cxx | 8
sd/source/ui/view/DocumentRenderer.cxx | 20
sd/source/ui/view/ViewShellBase.cxx | 8
sd/source/ui/view/drviews1.cxx | 4
sd/source/ui/view/drviews5.cxx | 2
sd/source/ui/view/drviewsa.cxx | 22
sd/source/ui/view/frmview.cxx | 26
sd/source/ui/view/sdview.cxx | 12
sd/source/ui/view/sdview3.cxx | 4
sd/source/ui/view/sdview4.cxx | 4
sd/source/ui/view/sdwindow.cxx | 10
sd/source/ui/view/viewshe2.cxx | 16
sfx2/inc/pch/precompiled_sfx.hxx | 2
sfx2/source/doc/objembed.cxx | 8
sfx2/source/view/ipclient.cxx | 40
sfx2/source/view/viewfrm2.cxx | 2
sfx2/source/view/viewsh.cxx | 4
starmath/inc/node.hxx | 12
starmath/inc/pch/precompiled_sm.hxx | 2
starmath/inc/utility.hxx | 24
starmath/inc/view.hxx | 2
starmath/source/ElementsDockingWindow.cxx | 2
starmath/source/mathmlexport.cxx | 12
starmath/source/mathmlimport.cxx | 6
starmath/source/node.cxx | 42
starmath/source/parse.cxx | 10
starmath/source/utility.cxx | 6
starmath/source/view.cxx | 26
starmath/source/visitors.cxx | 2
svtools/source/brwbox/brwbox1.cxx | 6
svtools/source/brwbox/brwbox2.cxx | 4
svtools/source/brwbox/datwin.cxx | 18
svtools/source/brwbox/datwin.hxx | 6
svtools/source/control/ctrltool.cxx | 2
svtools/source/control/ruler.cxx | 6
svtools/source/filter/exportdialog.cxx | 4
svtools/source/graphic/grfmgr.cxx | 2
svtools/source/misc/imap.cxx | 42
svx/inc/pch/precompiled_svxcore.hxx | 2
svx/inc/sdr/properties/itemsettools.hxx | 4
svx/inc/svdoopengl.hxx | 2
svx/inc/sxmsitm.hxx | 4
svx/inc/sxreaitm.hxx | 8
svx/inc/sxreoitm.hxx | 8
svx/source/customshapes/EnhancedCustomShape3d.cxx | 8
svx/source/customshapes/EnhancedCustomShapeFunctionParser.cxx | 12
svx/source/dialog/connctrl.cxx | 28
svx/source/dialog/graphctl.cxx | 6
svx/source/dialog/measctrl.cxx | 26
svx/source/dialog/pagectrl.cxx | 10
svx/source/engine3d/obj3d.cxx | 6
svx/source/engine3d/scene3d.cxx | 4
svx/source/fmcomp/gridctrl.cxx | 2
svx/source/form/fmvwimp.cxx | 12
svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx | 10
svx/source/sdr/properties/attributeproperties.cxx | 2
svx/source/sdr/properties/defaultproperties.cxx | 2
svx/source/sdr/properties/itemsettools.cxx | 11
svx/source/sdr/properties/properties.cxx | 2
svx/source/sidebar/possize/PosSizePropertyPanel.cxx | 36
svx/source/sidebar/possize/PosSizePropertyPanel.hxx | 2
svx/source/svdraw/svdattr.cxx | 32
svx/source/svdraw/svddrag.cxx | 8
svx/source/svdraw/svddrgm1.hxx | 4
svx/source/svdraw/svddrgmt.cxx | 64 -
svx/source/svdraw/svdedtv1.cxx | 20
svx/source/svdraw/svdfmtf.cxx | 8
svx/source/svdraw/svdfmtf.hxx | 4
svx/source/svdraw/svdglev.cxx | 4
svx/source/svdraw/svdibrow.cxx | 2
svx/source/svdraw/svdmodel.cxx | 36
svx/source/svdraw/svdoashp.cxx | 20
svx/source/svdraw/svdobj.cxx | 28
svx/source/svdraw/svdocapt.cxx | 2
svx/source/svdraw/svdocirc.cxx | 8
svx/source/svdraw/svdoedge.cxx | 6
svx/source/svdraw/svdograf.cxx | 6
svx/source/svdraw/svdogrp.cxx | 22
svx/source/svdraw/svdomeas.cxx | 20
svx/source/svdraw/svdoole2.cxx | 50
svx/source/svdraw/svdoopengl.cxx | 2
svx/source/svdraw/svdopath.cxx | 8
svx/source/svdraw/svdorect.cxx | 2
svx/source/svdraw/svdotext.cxx | 10
svx/source/svdraw/svdotxdr.cxx | 12
svx/source/svdraw/svdotxed.cxx | 2
svx/source/svdraw/svdotxtr.cxx | 8
svx/source/svdraw/svdouno.cxx | 2
svx/source/svdraw/svdovirt.cxx | 6
svx/source/svdraw/svdpntv.cxx | 6
svx/source/svdraw/svdpoev.cxx | 8
svx/source/svdraw/svdsnpv.cxx | 4
svx/source/svdraw/svdtext.cxx | 4
svx/source/svdraw/svdtrans.cxx | 72 -
svx/source/svdraw/svdview.cxx | 4
svx/source/svdraw/svdxcgv.cxx | 32
svx/source/table/svdotable.cxx | 2
svx/source/unodraw/UnoGraphicExporter.cxx | 16
svx/source/unodraw/unoshape.cxx | 4
sw/inc/accmap.hxx | 6
sw/inc/dcontact.hxx | 4
sw/inc/pagedesc.hxx | 8
sw/inc/pagepreviewlayout.hxx | 6
sw/inc/pch/precompiled_sw.hxx | 2
sw/source/core/access/accmap.cxx | 10
sw/source/core/doc/tblrwcl.cxx | 10
sw/source/core/docnode/ndnotxt.cxx | 4
sw/source/core/draw/dcontact.cxx | 6
sw/source/core/draw/dflyobj.cxx | 4
sw/source/core/frmedt/fecopy.cxx | 4
sw/source/core/graphic/ndgrf.cxx | 8
sw/source/core/inc/dflyobj.hxx | 8
sw/source/core/inc/viewimp.hxx | 4
sw/source/core/layout/anchoreddrawobject.cxx | 7
sw/source/core/layout/fly.cxx | 8
sw/source/core/layout/paintfrm.cxx | 19
sw/source/core/text/porlay.hxx | 2
sw/source/core/txtnode/fntcache.cxx | 10
sw/source/core/view/pagepreviewlayout.cxx | 14
sw/source/core/view/viewimp.cxx | 6
sw/source/core/view/viewpg.cxx | 10
sw/source/core/view/viewsh.cxx | 10
sw/source/core/view/vnew.cxx | 2
sw/source/filter/html/htmlflywriter.cxx | 8
sw/source/filter/writer/wrtswtbl.cxx | 8
sw/source/filter/ww1/w1filter.cxx | 4
sw/source/filter/ww8/docxattributeoutput.cxx | 2
sw/source/filter/ww8/rtfexport.cxx | 2
sw/source/filter/ww8/writerhelper.cxx | 18
sw/source/filter/ww8/wrtw8esh.cxx | 8
sw/source/filter/ww8/ww8graf.cxx | 18
sw/source/filter/ww8/ww8par4.cxx | 8
sw/source/ui/misc/pgfnote.cxx | 6
sw/source/uibase/docvw/PostItMgr.cxx | 20
sw/source/uibase/docvw/SidebarWin.cxx | 38
sw/source/uibase/frmdlg/colex.cxx | 2
sw/source/uibase/inc/pview.hxx | 2
sw/source/uibase/inc/view.hxx | 2
sw/source/uibase/uiview/pview.cxx | 2
sw/source/uibase/uiview/swcli.cxx | 8
sw/source/uibase/uiview/view.cxx | 2
sw/source/uibase/uiview/viewmdi.cxx | 2
sw/source/uibase/uiview/viewport.cxx | 18
sw/source/uibase/utlui/uiitems.cxx | 6
sw/source/uibase/wrtsh/wrtsh1.cxx | 12
toolkit/source/awt/vclxtoolkit.cxx | 4
toolkit/source/awt/vclxwindow.cxx | 2
tools/CppunitTest_tools_test.mk | 1
tools/Library_tl.mk | 2
tools/qa/cppunit/test_rational.cxx | 101 ++
tools/source/generic/fract.cxx | 504 ----------
tools/source/generic/rational.cxx | 172 +++
tools/test/tests.cxx | 111 --
vcl/inc/unx/salgdi.h | 2
vcl/inc/window.h | 2
vcl/source/filter/graphicfilter.cxx | 6
vcl/source/filter/graphicfilter2.cxx | 6
vcl/source/filter/jpeg/JpegReader.cxx | 4
vcl/source/filter/sgfbram.cxx | 2
vcl/source/filter/sgvmain.cxx | 2
vcl/source/filter/sgvtext.cxx | 2
vcl/source/filter/wmf/emfwr.cxx | 4
vcl/source/filter/wmf/winmtf.cxx | 4
vcl/source/filter/wmf/winwmf.cxx | 2
vcl/source/filter/wmf/wmfwr.cxx | 42
vcl/source/gdi/cvtsvm.cxx | 10
vcl/source/gdi/dibtools.cxx | 4
vcl/source/gdi/gdimtf.cxx | 12
vcl/source/gdi/impgraph.cxx | 12
vcl/source/gdi/mapmod.cxx | 8
vcl/source/gdi/pdfwriter_impl.cxx | 4
vcl/source/gdi/pdfwriter_impl2.cxx | 4
vcl/source/gdi/textlayout.cxx | 2
vcl/source/gdi/virdev.cxx | 2
vcl/source/outdev/font.cxx | 2
vcl/source/outdev/map.cxx | 157 +--
vcl/source/window/window.cxx | 2
vcl/source/window/window2.cxx | 26
writerfilter/source/dmapper/WrapPolygonHandler.cxx | 18
writerfilter/source/dmapper/WrapPolygonHandler.hxx | 4
365 files changed, 1879 insertions(+), 2448 deletions(-)
New commits:
commit 47a2d7642d249d70b5da0c330a73f3a0032e4bba
Author: Juan Picca <jumapico at gmail.com>
Date: Fri Sep 19 14:19:30 2014 -0300
fdo#81356: convert Fraction to boost::rational<long> - wip
* Added rational util functions used by Fraction class not
available in the boost::rational class.
* Replaced usage of Fraction by boost::rational<long>
* Removed code that relies on:
1. fraction.IsValid() -- rational only allow valid values, ie
denominator() != 0
2. rational.denominator() == 0 -- always false
3. rational.denominator() < 0 -- always false but implementation
detail: http://www.boost.org/doc/libs/release/libs/rational/rational.html#Internal%20representation
* Simplified code that relies on:
1. rational.denominator() != 0 -- always true
* BUGS EXIST because Fraction allows the creation of invalid values but
boost::rational throws the exception boost::bad_rational
Change-Id: I84970a4956afb3f91ac0c8f726547466319420f9
Reviewed-on: https://gerrit.libreoffice.org/11551
Reviewed-by: David Tardon <dtardon at redhat.com>
Tested-by: David Tardon <dtardon at redhat.com>
diff --git a/basctl/source/dlged/dlged.cxx b/basctl/source/dlged/dlged.cxx
index 9800c4c..5d8373a 100644
--- a/basctl/source/dlged/dlged.cxx
+++ b/basctl/source/dlged/dlged.cxx
@@ -234,7 +234,7 @@ DlgEditor::DlgEditor (
pDlgEdView->SetWorkArea( Rectangle( Point( 0, 0 ), pDlgEdPage->GetSize() ) );
pDlgEdView->SetGridCoarse( aGridSize );
- pDlgEdView->SetSnapGridWidth(Fraction(aGridSize.Width(), 1), Fraction(aGridSize.Height(), 1));
+ pDlgEdView->SetSnapGridWidth(boost::rational<long>(aGridSize.Width(),1), boost::rational<long>(aGridSize.Height(),1));
pDlgEdView->SetGridSnap( bGridSnap );
pDlgEdView->SetGridVisible( bGridVisible );
pDlgEdView->SetDragStripes(false);
@@ -508,7 +508,7 @@ IMPL_LINK_NOARG(DlgEditor, PaintTimeout)
Size aSize = rWindow.PixelToLogic( Size( 400, 300 ) );
// align with grid
- Size aGridSize_(long(pDlgEdView->GetSnapGridWidthX()), long(pDlgEdView->GetSnapGridWidthY()));
+ Size aGridSize_(boost::rational_cast<long>(pDlgEdView->GetSnapGridWidthX()), boost::rational_cast<long>(pDlgEdView->GetSnapGridWidthY()));
aSize.Width() -= aSize.Width() % aGridSize_.Width();
aSize.Height() -= aSize.Height() % aGridSize_.Height();
diff --git a/basctl/source/dlged/dlgedobj.cxx b/basctl/source/dlged/dlgedobj.cxx
index 4d52b5f..89a0207 100644
--- a/basctl/source/dlged/dlgedobj.cxx
+++ b/basctl/source/dlged/dlgedobj.cxx
@@ -940,7 +940,7 @@ void DlgEdObj::NbcMove( const Size& rSize )
GetDlgEdForm()->GetDlgEditor().SetDialogModelChanged(true);
}
-void DlgEdObj::NbcResize(const Point& rRef, const Fraction& xFract, const Fraction& yFract)
+void DlgEdObj::NbcResize(const Point& rRef, const boost::rational<long>& xFract, const boost::rational<long>& yFract)
{
SdrUnoObj::NbcResize( rRef, xFract, yFract );
@@ -1590,7 +1590,7 @@ void DlgEdForm::NbcMove( const Size& rSize )
GetDlgEditor().SetDialogModelChanged(true);
}
-void DlgEdForm::NbcResize(const Point& rRef, const Fraction& xFract, const Fraction& yFract)
+void DlgEdForm::NbcResize(const Point& rRef, const boost::rational<long>& xFract, const boost::rational<long>& yFract)
{
SdrUnoObj::NbcResize( rRef, xFract, yFract );
diff --git a/basctl/source/inc/dlgedobj.hxx b/basctl/source/inc/dlgedobj.hxx
index 525a551..33e489f 100644
--- a/basctl/source/inc/dlgedobj.hxx
+++ b/basctl/source/inc/dlgedobj.hxx
@@ -63,7 +63,7 @@ protected:
const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rxSFac);
virtual void NbcMove( const Size& rSize ) SAL_OVERRIDE;
- virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact) SAL_OVERRIDE;
+ virtual void NbcResize(const Point& rRef, const boost::rational<long>& xFact, const boost::rational<long>& yFact) SAL_OVERRIDE;
virtual bool EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd) SAL_OVERRIDE;
using SfxListener::StartListening;
@@ -153,7 +153,7 @@ private:
protected:
virtual void NbcMove( const Size& rSize ) SAL_OVERRIDE;
- virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact) SAL_OVERRIDE;
+ virtual void NbcResize(const Point& rRef, const boost::rational<long>& xFact, const boost::rational<long>& yFact) SAL_OVERRIDE;
virtual bool EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd) SAL_OVERRIDE;
public:
diff --git a/basic/source/runtime/methods1.cxx b/basic/source/runtime/methods1.cxx
index 56879a7..472d4b7 100644
--- a/basic/source/runtime/methods1.cxx
+++ b/basic/source/runtime/methods1.cxx
@@ -1340,8 +1340,8 @@ static double GetDialogZoomFactor( bool bX, long nValue )
if( pDevice )
{
Size aRefSize( nValue, nValue );
- Fraction aFracX( 1, 26 );
- Fraction aFracY( 1, 24 );
+ boost::rational<long> aFracX( 1, 26 );
+ boost::rational<long> aFracY( 1, 24 );
MapMode aMap( MAP_APPFONT, Point(), aFracX, aFracY );
Size aScaledSize = pDevice->LogicToPixel( aRefSize, aMap );
aRefSize = pDevice->LogicToPixel( aRefSize, MapMode(MAP_TWIP) );
diff --git a/chart2/source/controller/main/ChartController_Window.cxx b/chart2/source/controller/main/ChartController_Window.cxx
index c367f65..d8fbd16 100644
--- a/chart2/source/controller/main/ChartController_Window.cxx
+++ b/chart2/source/controller/main/ChartController_Window.cxx
@@ -244,8 +244,8 @@ void SAL_CALL ChartController::setPosSize(
MapMode aNewMapMode(
MAP_100TH_MM,
Point(0,0),
- Fraction(nScaleXNumerator, nScaleXDenominator),
- Fraction(nScaleYNumerator, nScaleYDenominator) );
+ boost::rational<long>(nScaleXNumerator, nScaleXDenominator),
+ boost::rational<long>(nScaleYNumerator, nScaleYDenominator) );
m_pChartWindow->SetMapMode(aNewMapMode);
m_pChartWindow->setPosSizePixel( X, Y, Width, Height, Flags );
diff --git a/chart2/source/view/main/DrawModelWrapper.cxx b/chart2/source/view/main/DrawModelWrapper.cxx
index d917ee1..65d98b6 100644
--- a/chart2/source/view/main/DrawModelWrapper.cxx
+++ b/chart2/source/view/main/DrawModelWrapper.cxx
@@ -99,7 +99,7 @@ DrawModelWrapper::DrawModelWrapper( const uno::Reference<uno::XComponentContext>
m_pChartItemPool = ChartItemPool::CreateChartItemPool();
SetScaleUnit(MAP_100TH_MM);
- SetScaleFraction(Fraction(1, 1));
+ SetScaleFraction(boost::rational<long>(1, 1));
SetDefaultFontHeight(423); // 12pt
SfxItemPool* pMasterPool = &GetItemPool();
diff --git a/connectivity/inc/pch/precompiled_dbtools.hxx b/connectivity/inc/pch/precompiled_dbtools.hxx
index 40fa64c..3d63700 100644
--- a/connectivity/inc/pch/precompiled_dbtools.hxx
+++ b/connectivity/inc/pch/precompiled_dbtools.hxx
@@ -168,7 +168,7 @@
#include <svtools/miscopt.hxx>
#include <tools/debug.hxx>
#include <tools/diagnose_ex.h>
-#include <tools/fract.hxx>
+#include <tools/rational.hxx>
#include <tools/wldcrd.hxx>
#include <unotools/confignode.hxx>
#include <unotools/datetime.hxx>
diff --git a/connectivity/source/commontools/RowFunctionParser.cxx b/connectivity/source/commontools/RowFunctionParser.cxx
index c296337..f6df2ea 100644
--- a/connectivity/source/commontools/RowFunctionParser.cxx
+++ b/connectivity/source/commontools/RowFunctionParser.cxx
@@ -30,7 +30,7 @@
#include <boost/spirit/include/classic_core.hpp>
#include "RowFunctionParser.hxx"
#include <rtl/ustring.hxx>
-#include <tools/fract.hxx>
+#include <tools/rational.hxx>
diff --git a/cui/source/tabpages/grfpage.cxx b/cui/source/tabpages/grfpage.cxx
index 0fcd835..59e24f9 100644
--- a/cui/source/tabpages/grfpage.cxx
+++ b/cui/source/tabpages/grfpage.cxx
@@ -812,8 +812,8 @@ void SvxCropExample::SetFrameSize( const Size& rSz )
if(!aFrameSize.Height())
aFrameSize.Height() = 1;
Size aWinSize( GetOutputSizePixel() );
- Fraction aXScale( aWinSize.Width() * 4, aFrameSize.Width() * 5 );
- Fraction aYScale( aWinSize.Height() * 4, aFrameSize.Height() * 5 );
+ boost::rational<long> aXScale( aWinSize.Width() * 4, aFrameSize.Width() * 5 );
+ boost::rational<long> aYScale( aWinSize.Height() * 4, aFrameSize.Height() * 5 );
if( aYScale < aXScale )
aXScale = aYScale;
diff --git a/cui/source/tabpages/transfrm.cxx b/cui/source/tabpages/transfrm.cxx
index c6273945..ff024ad 100644
--- a/cui/source/tabpages/transfrm.cxx
+++ b/cui/source/tabpages/transfrm.cxx
@@ -90,9 +90,9 @@ static void lcl_ConvertRect(basegfx::B2DRange& rRange, const sal_uInt16 nDigits,
rRange = basegfx::B2DRange(aTopLeft, aBottomRight);
}
-static void lcl_ScaleRect(basegfx::B2DRange& rRange, const Fraction aUIScale)
+static void lcl_ScaleRect(basegfx::B2DRange& rRange, const boost::rational<long> aUIScale)
{
- const double fFactor(1.0 / double(aUIScale));
+ const double fFactor(1.0 / boost::rational_cast<double>(aUIScale));
rRange = basegfx::B2DRange(rRange.getMinimum() * fFactor, rRange.getMaximum() * fFactor);
}
@@ -254,7 +254,7 @@ void SvxAngleTabPage::Construct()
}
// take scale into account
- const Fraction aUIScale(pView->GetModel()->GetUIScale());
+ const boost::rational<long> aUIScale = pView->GetModel()->GetUIScale();
lcl_ScaleRect(maRange, aUIScale);
// take UI units into account
@@ -274,7 +274,7 @@ bool SvxAngleTabPage::FillItemSet(SfxItemSet* rSet)
if(m_pCtlAngle->IsValueModified() || m_pMtrPosX->IsValueModified() || m_pMtrPosY->IsValueModified())
{
- const double fUIScale(double(pView->GetModel()->GetUIScale()));
+ const double fUIScale(boost::rational_cast<double>(this->pView->GetModel()->GetUIScale()));
const double fTmpX((GetCoreValue(*m_pMtrPosX, ePoolUnit) + maAnchor.getX()) * fUIScale);
const double fTmpY((GetCoreValue(*m_pMtrPosY, ePoolUnit) + maAnchor.getY()) * fUIScale);
@@ -292,7 +292,7 @@ bool SvxAngleTabPage::FillItemSet(SfxItemSet* rSet)
void SvxAngleTabPage::Reset(const SfxItemSet* rAttrs)
{
- const double fUIScale(double(pView->GetModel()->GetUIScale()));
+ const double fUIScale(boost::rational_cast<double>(this->pView->GetModel()->GetUIScale()));
const SfxPoolItem* pItem = GetItem( *rAttrs, SID_ATTR_TRANSFORM_ROT_X );
if(pItem)
@@ -475,9 +475,9 @@ bool SvxSlantTabPage::FillItemSet(SfxItemSet* rAttrs)
if( m_pMtrRadius->IsValueChangedFromSaved() )
{
- Fraction aUIScale = pView->GetModel()->GetUIScale();
+ boost::rational<long> aUIScale = pView->GetModel()->GetUIScale();
long nTmp = GetCoreValue( *m_pMtrRadius, ePoolUnit );
- nTmp = Fraction( nTmp ) * aUIScale;
+ nTmp = boost::rational_cast<long>(nTmp * aUIScale);
rAttrs->Put( makeSdrEckenradiusItem( nTmp ) );
bModified = true;
@@ -527,7 +527,7 @@ void SvxSlantTabPage::Reset(const SfxItemSet* rAttrs)
if( pItem )
{
- const double fUIScale(double(pView->GetModel()->GetUIScale()));
+ const double fUIScale(boost::rational_cast<double>(this->pView->GetModel()->GetUIScale()));
const double fTmp((double)((const SdrMetricItem*)pItem)->GetValue() / fUIScale);
SetMetricValue(*m_pMtrRadius, basegfx::fround(fTmp), ePoolUnit);
}
@@ -758,7 +758,7 @@ void SvxPositionSizeTabPage::Construct()
}
// take scale into account
- const Fraction aUIScale(mpView->GetModel()->GetUIScale());
+ const boost::rational<long> aUIScale = mpView->GetModel()->GetUIScale();
lcl_ScaleRect( maWorkRange, aUIScale );
lcl_ScaleRect( maRange, aUIScale );
@@ -790,7 +790,7 @@ bool SvxPositionSizeTabPage::FillItemSet( SfxItemSet* rOutAttrs )
{
if ( m_pMtrPosX->IsValueModified() || m_pMtrPosY->IsValueModified() )
{
- const double fUIScale(double(mpView->GetModel()->GetUIScale()));
+ const double fUIScale(boost::rational_cast<double>(this->mpView->GetModel()->GetUIScale()));
double fX((GetCoreValue( *m_pMtrPosX, mePoolUnit ) + maAnchor.getX()) * fUIScale);
double fY((GetCoreValue( *m_pMtrPosY, mePoolUnit ) + maAnchor.getY()) * fUIScale);
@@ -828,19 +828,19 @@ bool SvxPositionSizeTabPage::FillItemSet( SfxItemSet* rOutAttrs )
if ( m_pMtrWidth->IsValueModified() || m_pMtrHeight->IsValueModified() )
{
- Fraction aUIScale = mpView->GetModel()->GetUIScale();
+ boost::rational<long> aUIScale = mpView->GetModel()->GetUIScale();
// get Width
double nWidth = static_cast<double>(m_pMtrWidth->GetValue( meDlgUnit ));
nWidth = MetricField::ConvertDoubleValue( nWidth, m_pMtrWidth->GetBaseValue(), m_pMtrWidth->GetDecimalDigits(), meDlgUnit, FUNIT_100TH_MM );
- long lWidth = long(nWidth * (double)aUIScale);
+ long lWidth = long(nWidth * boost::rational_cast<double>(aUIScale));
lWidth = OutputDevice::LogicToLogic( lWidth, MAP_100TH_MM, (MapUnit)mePoolUnit );
lWidth = static_cast<long>(m_pMtrWidth->Denormalize( lWidth ));
// get Height
double nHeight = static_cast<double>(m_pMtrHeight->GetValue( meDlgUnit ));
nHeight = MetricField::ConvertDoubleValue( nHeight, m_pMtrHeight->GetBaseValue(), m_pMtrHeight->GetDecimalDigits(), meDlgUnit, FUNIT_100TH_MM );
- long lHeight = long(nHeight * (double)aUIScale);
+ long lHeight = long(nHeight * boost::rational_cast<double>(aUIScale));
lHeight = OutputDevice::LogicToLogic( lHeight, MAP_100TH_MM, (MapUnit)mePoolUnit );
lHeight = static_cast<long>(m_pMtrHeight->Denormalize( lHeight ));
@@ -899,7 +899,7 @@ bool SvxPositionSizeTabPage::FillItemSet( SfxItemSet* rOutAttrs )
void SvxPositionSizeTabPage::Reset( const SfxItemSet* )
{
const SfxPoolItem* pItem;
- const double fUIScale(double(mpView->GetModel()->GetUIScale()));
+ const double fUIScale(boost::rational_cast<double>(this->mpView->GetModel()->GetUIScale()));
if ( !mbPageDisabled )
{
diff --git a/dbaccess/source/ui/inc/JoinController.hxx b/dbaccess/source/ui/inc/JoinController.hxx
index d4faccf..c527a3e 100644
--- a/dbaccess/source/ui/inc/JoinController.hxx
+++ b/dbaccess/source/ui/inc/JoinController.hxx
@@ -47,7 +47,7 @@ namespace dbaui
TTableConnectionData m_vTableConnectionData;
TTableWindowData m_vTableData;
- Fraction m_aZoom;
+ boost::rational<long> m_aZoom;
::dbtools::SQLExceptionInfo m_aExceptionInfo;
OAddTableDlg* m_pAddTableDialog;
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 60c53fb..465cd5e 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -558,7 +558,7 @@ void doc_paintTile (LibreOfficeKitDocument* pThis,
VirtualDevice aDevice(0, (sal_uInt16)32);
boost::shared_array< sal_uInt8 > aBuffer( pBuffer, NoDelete< sal_uInt8 >() );
aDevice.SetOutputSizePixelScaleOffsetAndBuffer(
- Size(nCanvasWidth, nCanvasHeight), Fraction(1.0), Point(),
+ Size(nCanvasWidth, nCanvasHeight), rational_FromDouble(1.0), Point(),
aBuffer, true );
pDoc->paintTile(aDevice, nCanvasWidth, nCanvasHeight,
diff --git a/drawinglayer/source/primitive2d/metafileprimitive2d.cxx b/drawinglayer/source/primitive2d/metafileprimitive2d.cxx
index b546ede..f51099b 100644
--- a/drawinglayer/source/primitive2d/metafileprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/metafileprimitive2d.cxx
@@ -573,7 +573,7 @@ namespace
basegfx::B2DHomMatrix getTransformFromMapMode(const MapMode& rMapMode)
{
basegfx::B2DHomMatrix aMapping;
- const Fraction aNoScale(1, 1);
+ const boost::rational<long> aNoScale(1, 1);
const Point& rOrigin(rMapMode.GetOrigin());
if(0 != rOrigin.X() || 0 != rOrigin.Y())
@@ -584,8 +584,8 @@ namespace
if(rMapMode.GetScaleX() != aNoScale || rMapMode.GetScaleY() != aNoScale)
{
aMapping.scale(
- double(rMapMode.GetScaleX()),
- double(rMapMode.GetScaleY()));
+ boost::rational_cast<double>(rMapMode.GetScaleX()),
+ boost::rational_cast<double>(rMapMode.GetScaleY()));
}
return aMapping;
diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx
index 06180a1..1f5cd00 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -494,14 +494,14 @@ bool ImpEditEngine::ImpCheckRefMapMode()
if ( aStatus.DoFormat100() )
{
MapMode aMapMode( GetRefDevice()->GetMapMode() );
- if ( aMapMode.GetScaleX().GetNumerator() != aMapMode.GetScaleX().GetDenominator() )
+ if ( aMapMode.GetScaleX().numerator() != aMapMode.GetScaleX().denominator() )
bChange = true;
- else if ( aMapMode.GetScaleY().GetNumerator() != aMapMode.GetScaleY().GetDenominator() )
+ else if ( aMapMode.GetScaleY().numerator() != aMapMode.GetScaleY().denominator() )
bChange = true;
if ( bChange )
{
- Fraction Scale1( 1, 1 );
+ boost::rational<long> Scale1( 1, 1 );
aMapMode.SetScaleX( Scale1 );
aMapMode.SetScaleY( Scale1 );
GetRefDevice()->Push();
diff --git a/filter/source/graphicfilter/eos2met/eos2met.cxx b/filter/source/graphicfilter/eos2met/eos2met.cxx
index d1a1459..33f5f51 100644
--- a/filter/source/graphicfilter/eos2met/eos2met.cxx
+++ b/filter/source/graphicfilter/eos2met/eos2met.cxx
@@ -2169,50 +2169,50 @@ void METWriter::WriteOrders( const GDIMetaFile* pMTF )
if ( pA->GetMapMode().GetMapUnit() == MAP_RELATIVE )
{
MapMode aMM = pA->GetMapMode();
- Fraction aScaleX = aMM.GetScaleX();
- Fraction aScaleY = aMM.GetScaleY();
+ boost::rational<long> aScaleX = aMM.GetScaleX();
+ boost::rational<long> aScaleY = aMM.GetScaleY();
Point aOrigin = aPictureMapMode.GetOrigin();
BigInt aX( aOrigin.X() );
- aX *= BigInt( aScaleX.GetDenominator() );
+ aX *= BigInt( aScaleX.denominator() );
if( aOrigin.X() >= 0 )
{
- if( aScaleX.GetNumerator() >= 0 )
- aX += BigInt( aScaleX.GetNumerator()/2 );
+ if( aScaleX.numerator() >= 0 )
+ aX += BigInt( aScaleX.numerator()/2 );
else
- aX -= BigInt( (aScaleX.GetNumerator()+1)/2 );
+ aX -= BigInt( (aScaleX.numerator()+1)/2 );
}
else
{
- if( aScaleX.GetNumerator() >= 0 )
- aX -= BigInt( (aScaleX.GetNumerator()-1)/2 );
+ if( aScaleX.numerator() >= 0 )
+ aX -= BigInt( (aScaleX.numerator()-1)/2 );
else
- aX += BigInt( aScaleX.GetNumerator()/2 );
+ aX += BigInt( aScaleX.numerator()/2 );
}
- aX /= BigInt( aScaleX.GetNumerator() );
+ aX /= BigInt( aScaleX.numerator() );
aOrigin.X() = (long) aX + aMM.GetOrigin().X();
BigInt aY( aOrigin.Y() );
- aY *= BigInt( aScaleY.GetDenominator() );
+ aY *= BigInt( aScaleY.denominator() );
if( aOrigin.Y() >= 0 )
{
- if( aScaleY.GetNumerator() >= 0 )
- aY += BigInt( aScaleY.GetNumerator()/2 );
+ if( aScaleY.numerator() >= 0 )
+ aY += BigInt( aScaleY.numerator()/2 );
else
- aY -= BigInt( (aScaleY.GetNumerator()+1)/2 );
+ aY -= BigInt( (aScaleY.numerator()+1)/2 );
}
else
{
- if( aScaleY.GetNumerator() >= 0 )
- aY -= BigInt( (aScaleY.GetNumerator()-1)/2 );
+ if( aScaleY.numerator() >= 0 )
+ aY -= BigInt( (aScaleY.numerator()-1)/2 );
else
- aY += BigInt( aScaleY.GetNumerator()/2 );
+ aY += BigInt( aScaleY.numerator()/2 );
}
- aY /= BigInt( aScaleY.GetNumerator() );
+ aY /= BigInt( aScaleY.numerator() );
aOrigin.Y() = (long)aY + aMM.GetOrigin().Y();
aPictureMapMode.SetOrigin( aOrigin );
diff --git a/filter/source/graphicfilter/epict/epict.cxx b/filter/source/graphicfilter/epict/epict.cxx
index 1aad8c1e22..b0f61f3 100644
--- a/filter/source/graphicfilter/epict/epict.cxx
+++ b/filter/source/graphicfilter/epict/epict.cxx
@@ -1962,48 +1962,48 @@ void PictWriter::WriteOpcodes( const GDIMetaFile & rMTF )
if( pA->GetMapMode().GetMapUnit() == MAP_RELATIVE )
{
MapMode aMM = pA->GetMapMode();
- Fraction aScaleX = aMM.GetScaleX();
- Fraction aScaleY = aMM.GetScaleY();
+ boost::rational<long> aScaleX = aMM.GetScaleX();
+ boost::rational<long> aScaleY = aMM.GetScaleY();
Point aOrigin = aSrcMapMode.GetOrigin();
BigInt aX( aOrigin.X() );
- aX *= BigInt( aScaleX.GetDenominator() );
+ aX *= BigInt( aScaleX.denominator() );
if( aOrigin.X() >= 0 )
{
- if( aScaleX.GetNumerator() >= 0 )
- aX += BigInt( aScaleX.GetNumerator()/2 );
+ if( aScaleX.numerator() >= 0 )
+ aX += BigInt( aScaleX.numerator()/2 );
else
- aX -= BigInt( (aScaleX.GetNumerator()+1)/2 );
+ aX -= BigInt( (aScaleX.numerator()+1)/2 );
}
else
{
- if( aScaleX.GetNumerator() >= 0 )
- aX -= BigInt( (aScaleX.GetNumerator()-1)/2 );
+ if( aScaleX.numerator() >= 0 )
+ aX -= BigInt( (aScaleX.numerator()-1)/2 );
else
- aX += BigInt( aScaleX.GetNumerator()/2 );
+ aX += BigInt( aScaleX.numerator()/2 );
}
- aX /= BigInt( aScaleX.GetNumerator() );
+ aX /= BigInt( aScaleX.numerator() );
aOrigin.X() = (long)aX + aMM.GetOrigin().X();
BigInt aY( aOrigin.Y() );
- aY *= BigInt( aScaleY.GetDenominator() );
+ aY *= BigInt( aScaleY.denominator() );
if( aOrigin.Y() >= 0 )
{
- if( aScaleY.GetNumerator() >= 0 )
- aY += BigInt( aScaleY.GetNumerator()/2 );
+ if( aScaleY.numerator() >= 0 )
+ aY += BigInt( aScaleY.numerator()/2 );
else
- aY -= BigInt( (aScaleY.GetNumerator()+1)/2 );
+ aY -= BigInt( (aScaleY.numerator()+1)/2 );
}
else
{
- if( aScaleY.GetNumerator() >= 0 )
- aY -= BigInt( (aScaleY.GetNumerator()-1)/2 );
+ if( aScaleY.numerator() >= 0 )
+ aY -= BigInt( (aScaleY.numerator()-1)/2 );
else
- aY += BigInt( aScaleY.GetNumerator()/2 );
+ aY += BigInt( aScaleY.numerator()/2 );
}
- aY /= BigInt( aScaleY.GetNumerator() );
+ aY /= BigInt( aScaleY.numerator() );
aOrigin.Y() = (long)aY + aMM.GetOrigin().Y();
aSrcMapMode.SetOrigin( aOrigin );
@@ -2183,7 +2183,7 @@ bool PictWriter::WritePict(const GDIMetaFile & rMTF, SvStream & rTargetStream, F
{
PictWriterAttrStackMember* pAt;
MapMode aMap72( MAP_INCH );
- Fraction aDPIFrac( 1, 72 );
+ boost::rational<long> aDPIFrac( 1, 72 );
bStatus=true;
nLastPercent=0;
diff --git a/filter/source/graphicfilter/eps/eps.cxx b/filter/source/graphicfilter/eps/eps.cxx
index 19465a6..c9b1314 100644
--- a/filter/source/graphicfilter/eps/eps.cxx
+++ b/filter/source/graphicfilter/eps/eps.cxx
@@ -2376,8 +2376,8 @@ void PSWriter::ImplGetMapMode( const MapMode& rMapMode )
{
ImplWriteLine( "tm setmatrix" );
double fMul = ImplGetScaling( rMapMode );
- double fScaleX = (double)rMapMode.GetScaleX() * fMul;
- double fScaleY = (double)rMapMode.GetScaleY() * fMul;
+ double fScaleX = boost::rational_cast<double>(rMapMode.GetScaleX()) * fMul;
+ double fScaleY = boost::rational_cast<double>(rMapMode.GetScaleY()) * fMul;
ImplTranslate( rMapMode.GetOrigin().X() * fScaleX, rMapMode.GetOrigin().Y() * fScaleY );
ImplScale( fScaleX, fScaleY );
}
diff --git a/filter/source/graphicfilter/ios2met/ios2met.cxx b/filter/source/graphicfilter/ios2met/ios2met.cxx
index cc2d6bb..f3b61dc 100644
--- a/filter/source/graphicfilter/ios2met/ios2met.cxx
+++ b/filter/source/graphicfilter/ios2met/ios2met.cxx
@@ -2125,9 +2125,9 @@ void OS2METReader::ReadDsc(sal_uInt16 nDscID, sal_uInt16 /*nDscLen*/)
ReadCoord(b32);
if (nUnitType==0x00 && xr>0 && yr>0)
- aGlobMapMode=MapMode(MAP_INCH,Point(0,0),Fraction(10,xr),Fraction(10,yr));
+ aGlobMapMode=MapMode(MAP_INCH,Point(0,0),boost::rational<long>(10,xr),boost::rational<long>(10,yr));
else if (nUnitType==0x01 && xr>0 && yr>0)
- aGlobMapMode=MapMode(MAP_CM,Point(0,0),Fraction(10,xr),Fraction(10,yr));
+ aGlobMapMode=MapMode(MAP_CM,Point(0,0),boost::rational<long>(10,xr),boost::rational<long>(10,yr));
else
aGlobMapMode=MapMode();
diff --git a/filter/source/graphicfilter/ipict/ipict.cxx b/filter/source/graphicfilter/ipict/ipict.cxx
index 41ba717..b0d07d8 100644
--- a/filter/source/graphicfilter/ipict/ipict.cxx
+++ b/filter/source/graphicfilter/ipict/ipict.cxx
@@ -166,8 +166,8 @@ private:
Size aActOvalSize;
vcl::Font aActFont;
- Fraction aHRes;
- Fraction aVRes;
+ boost::rational<long> aHRes;
+ boost::rational<long> aVRes;
bool Callback(sal_uInt16 nPercent);
@@ -1841,7 +1841,7 @@ void PictReader::ReadPict( SvStream & rStreamPict, GDIMetaFile & rGDIMetaFile )
aActFont.SetSize(Size(0,12));
aActFont.SetAlign(ALIGN_BASELINE);
- aHRes = aVRes = Fraction( 1, 1 );
+ aHRes = aVRes = boost::rational<long>( 1, 1 );
pVirDev = new VirtualDevice();
pVirDev->EnableOutput(false);
diff --git a/filter/source/graphicfilter/ipsd/ipsd.cxx b/filter/source/graphicfilter/ipsd/ipsd.cxx
index c95991d..dbba04c 100644
--- a/filter/source/graphicfilter/ipsd/ipsd.cxx
+++ b/filter/source/graphicfilter/ipsd/ipsd.cxx
@@ -148,8 +148,8 @@ bool PSDReader::ReadPSD(Graphic & rGraphic )
if ( mnXResFixed && mnYResFixed )
{
Point aEmptyPoint;
- Fraction aFractX( 1, mnXResFixed >> 16 );
- Fraction aFractY( 1, mnYResFixed >> 16 );
+ boost::rational<long> aFractX( 1, mnXResFixed >> 16 );
+ boost::rational<long> aFractY( 1, mnYResFixed >> 16 );
MapMode aMapMode( MAP_INCH, aEmptyPoint, aFractX, aFractY );
Size aPrefSize = OutputDevice::LogicToLogic( aBitmapSize, aMapMode, MAP_100TH_MM );
rGraphic.SetPrefSize( aPrefSize );
diff --git a/filter/source/graphicfilter/itiff/itiff.cxx b/filter/source/graphicfilter/itiff/itiff.cxx
index 4606271..82575a5 100644
--- a/filter/source/graphicfilter/itiff/itiff.cxx
+++ b/filter/source/graphicfilter/itiff/itiff.cxx
@@ -1127,7 +1127,7 @@ void TIFFReader::MakePalCol( void )
nRX=(sal_uLong)(fXResolution*2.54+0.5);
nRY=(sal_uLong)(fYResolution*2.54+0.5);
}
- MapMode aMapMode(MAP_INCH,Point(0,0),Fraction(1,nRX),Fraction(1,nRY));
+ MapMode aMapMode(MAP_INCH,Point(0,0),boost::rational<long>(1,nRX),boost::rational<long>(1,nRY));
aBitmap.SetPrefMapMode(aMapMode);
aBitmap.SetPrefSize(Size(nImageWidth,nImageLength));
}
diff --git a/filter/source/msfilter/eschesdo.cxx b/filter/source/msfilter/eschesdo.cxx
index 2e92270..0c2b757 100644
--- a/filter/source/msfilter/eschesdo.cxx
+++ b/filter/source/msfilter/eschesdo.cxx
@@ -64,7 +64,7 @@ ImplEESdrWriter::ImplEESdrWriter( EscherEx& rEx )
: mpEscherEx(&rEx)
, maMapModeSrc(MAP_100TH_MM)
// PowerPoint: 576 dpi, WinWord: 1440 dpi, Excel: 1440 dpi
- , maMapModeDest( MAP_INCH, Point(), Fraction( 1, EES_MAP_FRACTION ), Fraction( 1, EES_MAP_FRACTION ) )
+ , maMapModeDest( MAP_INCH, Point(), boost::rational<long>( 1, EES_MAP_FRACTION ), boost::rational<long>( 1, EES_MAP_FRACTION ) )
, mpPicStrm(NULL)
, mpHostAppData(NULL)
, mnPagesWritten(0)
diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx
index 1fe026c..26db18f 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -170,9 +170,9 @@ void Impl_OlePres::Write( SvStream & rStm )
{
// Always to 1/100 mm, until Mtf-Solution found
// Assumption (no scaling, no origin translation)
- DBG_ASSERT( pMtf->GetPrefMapMode().GetScaleX() == Fraction( 1, 1 ),
+ DBG_ASSERT( pMtf->GetPrefMapMode().GetScaleX() == boost::rational<long>( 1, 1 ),
"X-Skalierung im Mtf" );
- DBG_ASSERT( pMtf->GetPrefMapMode().GetScaleY() == Fraction( 1, 1 ),
+ DBG_ASSERT( pMtf->GetPrefMapMode().GetScaleY() == boost::rational<long>( 1, 1 ),
"Y-Skalierung im Mtf" );
DBG_ASSERT( pMtf->GetPrefMapMode().GetOrigin() == Point(),
"Origin-Verschiebung im Mtf" );
@@ -183,8 +183,8 @@ void Impl_OlePres::Write( SvStream & rStm )
Size aS( aPrefS );
aS = OutputDevice::LogicToLogic( aS, nMU, MAP_100TH_MM );
- pMtf->Scale( Fraction( aS.Width(), aPrefS.Width() ),
- Fraction( aS.Height(), aPrefS.Height() ) );
+ pMtf->Scale( boost::rational<long>( aS.Width(), aPrefS.Width() ),
+ boost::rational<long>( aS.Height(), aPrefS.Height() ) );
pMtf->SetPrefMapMode( MAP_100TH_MM );
pMtf->SetPrefSize( aS );
}
@@ -3088,11 +3088,11 @@ void SvxMSDffManager::ScaleEmu( sal_Int32& rVal ) const
sal_uInt32 SvxMSDffManager::ScalePt( sal_uInt32 nVal ) const
{
MapUnit eMap = pSdrModel->GetScaleUnit();
- Fraction aFact( GetMapFactor( MAP_POINT, eMap ).X() );
- long aMul = aFact.GetNumerator();
- long aDiv = aFact.GetDenominator() * 65536;
- aFact = Fraction( aMul, aDiv ); // try again to shorten it
- return BigMulDiv( nVal, aFact.GetNumerator(), aFact.GetDenominator() );
+ boost::rational<long> aFact( GetMapFactor( MAP_POINT, eMap ).X() );
+ long aMul = aFact.numerator();
+ long aDiv = aFact.denominator() * 65536;
+ aFact = boost::rational<long>( aMul, aDiv ); // try again to shorten it
+ return BigMulDiv( nVal, aFact.numerator(), aFact.denominator() );
}
sal_Int32 SvxMSDffManager::ScalePoint( sal_Int32 nVal ) const
@@ -3108,31 +3108,31 @@ void SvxMSDffManager::SetModel(SdrModel* pModel, long nApplicationScale)
// PPT works in units of 576DPI
// WW on the other side uses twips, i.e. 1440DPI.
MapUnit eMap = pSdrModel->GetScaleUnit();
- Fraction aFact( GetMapFactor(MAP_INCH, eMap).X() );
- long nMul=aFact.GetNumerator();
- long nDiv=aFact.GetDenominator()*nApplicationScale;
- aFact=Fraction(nMul,nDiv); // try again to shorten it
+ boost::rational<long> aFact = GetMapFactor(MAP_INCH, eMap).X();
+ long nMul=aFact.numerator();
+ long nDiv=aFact.denominator()*nApplicationScale;
+ aFact=boost::rational<long>(nMul,nDiv); // try again to shorten it
// For 100TH_MM -> 2540/576=635/144
// For Twip -> 1440/576=5/2
- nMapMul = aFact.GetNumerator();
- nMapDiv = aFact.GetDenominator();
+ nMapMul = aFact.numerator();
+ nMapDiv = aFact.denominator();
bNeedMap = nMapMul!=nMapDiv;
// MS-DFF-Properties are mostly given in EMU (English Metric Units)
// 1mm=36000emu, 1twip=635emu
aFact=GetMapFactor(MAP_100TH_MM,eMap).X();
- nMul=aFact.GetNumerator();
- nDiv=aFact.GetDenominator()*360;
- aFact=Fraction(nMul,nDiv); // try again to shorten it
+ nMul=aFact.numerator();
+ nDiv=aFact.denominator()*360;
+ aFact=boost::rational<long>(nMul,nDiv); // try again to shorten it
// For 100TH_MM -> 1/360
// For Twip -> 14,40/(25,4*360)=144/91440=1/635
- nEmuMul=aFact.GetNumerator();
- nEmuDiv=aFact.GetDenominator();
+ nEmuMul=aFact.numerator();
+ nEmuDiv=aFact.denominator();
// And something for typographic Points
aFact=GetMapFactor(MAP_POINT,eMap).X();
- nPntMul=aFact.GetNumerator();
- nPntDiv=aFact.GetDenominator();
+ nPntMul=aFact.numerator();
+ nPntDiv=aFact.denominator();
}
else
{
diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx
index e4c54f0..b6300bb 100644
--- a/filter/source/msfilter/svdfppt.cxx
+++ b/filter/source/msfilter/svdfppt.cxx
@@ -2470,9 +2470,9 @@ Size SdrPowerPointImport::GetPageSize() const
long nInchMul = 1, nInchDiv = 1;
if ( bInch )
{ // temporarily convert size (for rounding it) from inch to metric units
- Fraction aFact(GetMapFactor(eMap,MAP_100TH_MM).X());
- nInchMul = aFact.GetNumerator();
- nInchDiv = aFact.GetDenominator();
+ boost::rational<long> aFact = GetMapFactor(eMap,MAP_100TH_MM).X();
+ nInchMul = aFact.numerator();
+ nInchDiv = aFact.denominator();
aRet.Width() = BigMulDiv( aRet.Width(), nInchMul, nInchDiv );
aRet.Height() = BigMulDiv( aRet.Height(), nInchMul, nInchDiv );
}
diff --git a/filter/source/pdf/pdfexport.cxx b/filter/source/pdf/pdfexport.cxx
index 8aceae6..5d19fd7 100644
--- a/filter/source/pdf/pdfexport.cxx
+++ b/filter/source/pdf/pdfexport.cxx
@@ -23,7 +23,6 @@
#include "pdf.hrc"
#include "tools/urlobj.hxx"
-#include "tools/fract.hxx"
#include "tools/poly.hxx"
#include "vcl/mapmod.hxx"
#include "vcl/virdev.hxx"
diff --git a/filter/source/svg/svgwriter.cxx b/filter/source/svg/svgwriter.cxx
index 6d2efba..6dff611 100644
--- a/filter/source/svg/svgwriter.cxx
+++ b/filter/source/svg/svgwriter.cxx
@@ -3583,14 +3583,14 @@ void SVGActionWriter::WriteMetaFile( const Point& rPos100thmm,
{
MapMode aMapMode( rMtf.GetPrefMapMode() );
Size aPrefSize( rMtf.GetPrefSize() );
- Fraction aFractionX( aMapMode.GetScaleX() );
- Fraction aFractionY( aMapMode.GetScaleY() );
+ boost::rational<long> aFractionX = aMapMode.GetScaleX();
+ boost::rational<long> aFractionY = aMapMode.GetScaleY();
mpVDev->Push();
Size aSize( OutputDevice::LogicToLogic( rSize100thmm, MAP_100TH_MM, aMapMode ) );
- aMapMode.SetScaleX( aFractionX *= Fraction( aSize.Width(), aPrefSize.Width() ) );
- aMapMode.SetScaleY( aFractionY *= Fraction( aSize.Height(), aPrefSize.Height() ) );
+ aMapMode.SetScaleX( aFractionX *= boost::rational<long>( aSize.Width(), aPrefSize.Width() ) );
+ aMapMode.SetScaleY( aFractionY *= boost::rational<long>( aSize.Height(), aPrefSize.Height() ) );
Point aOffset( OutputDevice::LogicToLogic( rPos100thmm, MAP_100TH_MM, aMapMode ) );
aMapMode.SetOrigin( aOffset += aMapMode.GetOrigin() );
diff --git a/forms/source/richtext/richtextimplcontrol.cxx b/forms/source/richtext/richtextimplcontrol.cxx
index 2bae5a4..55e039c 100644
--- a/forms/source/richtext/richtextimplcontrol.cxx
+++ b/forms/source/richtext/richtextimplcontrol.cxx
@@ -515,7 +515,7 @@ namespace frm
void RichTextControlImpl::notifyZoomChanged()
{
- const Fraction& rZoom = m_pAntiImpl->GetZoom();
+ const boost::rational<long>& rZoom = m_pAntiImpl->GetZoom();
MapMode aMapMode( m_pAntiImpl->GetMapMode() );
aMapMode.SetScaleX( rZoom );
diff --git a/include/oox/export/chartexport.hxx b/include/oox/export/chartexport.hxx
index 02ee8f1..74f9236 100644
--- a/include/oox/export/chartexport.hxx
+++ b/include/oox/export/chartexport.hxx
@@ -84,7 +84,7 @@ public:
private:
sal_Int32 mnXmlNamespace;
sal_Int32 mnSeriesCount;
- Fraction maFraction;
+ boost::rational<long> maFraction;
::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > mxChartModel;
com::sun::star::uno::Reference< com::sun::star::chart::XDiagram > mxDiagram;
com::sun::star::uno::Reference< com::sun::star::chart2::XDiagram > mxNewDiagram;
diff --git a/include/oox/export/shapes.hxx b/include/oox/export/shapes.hxx
index 995ef35..250729b 100644
--- a/include/oox/export/shapes.hxx
+++ b/include/oox/export/shapes.hxx
@@ -66,7 +66,7 @@ protected:
private:
sal_Int32 mnXmlNamespace;
- Fraction maFraction;
+ boost::rational<long> maFraction;
MapMode maMapModeSrc, maMapModeDest;
::com::sun::star::awt::Size MapSize( const ::com::sun::star::awt::Size& ) const;
diff --git a/include/sfx2/ipclient.hxx b/include/sfx2/ipclient.hxx
index 10ab174..350c7ac 100644
--- a/include/sfx2/ipclient.hxx
+++ b/include/sfx2/ipclient.hxx
@@ -34,7 +34,7 @@ class SfxInPlaceClient_Impl;
class SfxViewShell;
class SfxObjectShell;
namespace vcl { class Window; }
-class Fraction;
+namespace boost { template<typename T> class rational; }
@@ -74,10 +74,10 @@ public:
bool SetObjArea( const Rectangle & );
Rectangle GetObjArea() const;
Rectangle GetScaledObjArea() const;
- void SetSizeScale( const Fraction & rScaleWidth, const Fraction & rScaleHeight );
- bool SetObjAreaAndScale( const Rectangle&, const Fraction&, const Fraction& );
- const Fraction& GetScaleWidth() const;
- const Fraction& GetScaleHeight() const;
+ void SetSizeScale( const boost::rational<long> & rScaleWidth, const boost::rational<long> & rScaleHeight );
+ bool SetObjAreaAndScale( const Rectangle&, const boost::rational<long>&, const boost::rational<long>& );
+ const boost::rational<long>& GetScaleWidth() const;
+ const boost::rational<long>& GetScaleHeight() const;
void Invalidate();
static SfxInPlaceClient* GetClient( SfxObjectShell* pDoc, const com::sun::star::uno::Reference < com::sun::star::embed::XEmbeddedObject >& xObject );
sal_Int64 GetAspect() const;
diff --git a/include/sfx2/objsh.hxx b/include/sfx2/objsh.hxx
index d9d4e95..42487bc 100644
--- a/include/sfx2/objsh.hxx
+++ b/include/sfx2/objsh.hxx
@@ -638,8 +638,8 @@ public:
SAL_DLLPRIVATE void DoDraw_Impl( OutputDevice* pDev,
const Point & rViewPos,
- const Fraction & rScaleX,
- const Fraction & rScaleY,
+ const boost::rational<long>& rScaleX,
+ const boost::rational<long>& rScaleY,
const JobSetup & rSetup,
sal_uInt16 nAspect );
diff --git a/include/sfx2/viewfrm.hxx b/include/sfx2/viewfrm.hxx
index 1d043fc..9acc0e2 100644
--- a/include/sfx2/viewfrm.hxx
+++ b/include/sfx2/viewfrm.hxx
@@ -43,7 +43,7 @@ class SfxProgress;
class SvData;
class SfxViewShell;
class SystemWindow;
-class Fraction;
+namespace boost { template<typename T> class rational; }
class Point;
class Size;
class SfxChildWindow;
@@ -118,7 +118,7 @@ public:
SfxBindings& GetBindings() { return *pBindings; }
const SfxBindings& GetBindings() const { return *pBindings; }
vcl::Window& GetWindow() const;
- virtual void SetZoomFactor( const Fraction &rZoomX, const Fraction &rZoomY );
+ virtual void SetZoomFactor( const boost::rational<long>& rZoomX, const boost::rational<long>& rZoomY );
SfxProgress* GetProgress() const;
diff --git a/include/sfx2/viewsh.hxx b/include/sfx2/viewsh.hxx
index 20114cfa..827bdfd 100644
--- a/include/sfx2/viewsh.hxx
+++ b/include/sfx2/viewsh.hxx
@@ -39,7 +39,7 @@
class SfxBaseController;
class Size;
-class Fraction;
+namespace boost { template<typename T> class rational; }
namespace vcl { class Window; }
class KeyEvent;
class WorkWindow;
@@ -146,7 +146,7 @@ protected:
virtual void InnerResizePixel( const Point &rOfs, const Size &rSize );
virtual void OuterResizePixel( const Point &rOfs, const Size &rSize );
- virtual void SetZoomFactor( const Fraction &rZoomX, const Fraction &rZoomY );
+ virtual void SetZoomFactor( const boost::rational<long>& rZoomX, const boost::rational<long>& rZoomY );
virtual void Move();
diff --git a/include/svtools/imap.hxx b/include/svtools/imap.hxx
index 951251d..37a5133 100644
--- a/include/svtools/imap.hxx
+++ b/include/svtools/imap.hxx
@@ -27,7 +27,7 @@
class Point;
class Rectangle;
class Size;
-class Fraction;
+namespace boost { template<typename T> class rational; }
class IMapObject;
typedef ::std::vector< IMapObject* > IMapObjectList_impl;
@@ -117,7 +117,7 @@ public:
void SetName( const OUString& rName ) { aName = rName; }
// skaliert alle Objekte der ImageMap entpr. dem uebergebenen Faktor
- void Scale( const Fraction& rFractX, const Fraction& rFracY );
+ void Scale( const boost::rational<long>& rFractX, const boost::rational<long>& rFracY );
// Im-/Export
void Write ( SvStream& rOStm, const OUString& rBaseURL ) const;
diff --git a/include/svtools/imapcirc.hxx b/include/svtools/imapcirc.hxx
index 2ce4127..fd6c164 100644
--- a/include/svtools/imapcirc.hxx
+++ b/include/svtools/imapcirc.hxx
@@ -23,7 +23,7 @@
#include <tools/gen.hxx>
#include <svtools/imapobj.hxx>
-class Fraction;
+namespace boost { template<typename T> class rational; }
class SVT_DLLPUBLIC IMapCircleObject : public IMapObject
{
@@ -60,7 +60,7 @@ public:
// liefert das BoundRect des Kreis-Objektes in 1/100mm
virtual Rectangle GetBoundRect() const SAL_OVERRIDE;
- void Scale( const Fraction& rFractX, const Fraction& rFracY );
+ void Scale( const boost::rational<long>& rFractX, const boost::rational<long>& rFracY );
using IMapObject::IsEqual;
bool IsEqual( const IMapCircleObject& rEqObj );
diff --git a/include/svtools/imappoly.hxx b/include/svtools/imappoly.hxx
index 79ca52a..e01b311 100644
--- a/include/svtools/imappoly.hxx
+++ b/include/svtools/imappoly.hxx
@@ -24,7 +24,7 @@
#include <svtools/imapobj.hxx>
#include <tools/poly.hxx>
-class Fraction;
+namespace boost { template<typename T> class rational; }
class SVT_DLLPUBLIC IMapPolygonObject : public IMapObject
{
@@ -66,7 +66,7 @@ public:
const Rectangle& GetExtraEllipse() const { return aEllipse; }
void SetExtraEllipse( const Rectangle& rEllipse );
- void Scale( const Fraction& rFractX, const Fraction& rFracY );
+ void Scale( const boost::rational<long>& rFractX, const boost::rational<long>& rFracY );
using IMapObject::IsEqual;
bool IsEqual( const IMapPolygonObject& rEqObj );
diff --git a/include/svtools/imaprect.hxx b/include/svtools/imaprect.hxx
index 17c9684..6855fb3 100644
--- a/include/svtools/imaprect.hxx
+++ b/include/svtools/imaprect.hxx
@@ -23,7 +23,7 @@
#include <svtools/imapobj.hxx>
#include <tools/gen.hxx>
-class Fraction;
+namespace boost { template<typename T> class rational; }
class SVT_DLLPUBLIC IMapRectangleObject : public IMapObject
{
@@ -58,7 +58,7 @@ public:
// liefert das BoundRect des Rechteck-Objektes in 1/100mm
virtual Rectangle GetBoundRect() const SAL_OVERRIDE { return aRect; }
- void Scale( const Fraction& rFractX, const Fraction& rFracY );
+ void Scale( const boost::rational<long>& rFractX, const boost::rational<long>& rFracY );
using IMapObject::IsEqual;
bool IsEqual( const IMapRectangleObject& rEqObj );
diff --git a/include/svtools/ruler.hxx b/include/svtools/ruler.hxx
index 49d4e42..a27a921 100644
--- a/include/svtools/ruler.hxx
+++ b/include/svtools/ruler.hxx
@@ -644,7 +644,7 @@ private:
RulerType meDragType;
MapUnit meSourceUnit;
FieldUnit meUnit;
- Fraction maZoom;
+ boost::rational<long> maZoom;
bool mbCalc;
bool mbFormat;
bool mbDrag;
@@ -745,8 +745,8 @@ public:
void SetUnit( FieldUnit eNewUnit );
FieldUnit GetUnit() const { return meUnit; }
- void SetZoom( const Fraction& rNewZoom );
- Fraction GetZoom() const { return maZoom; }
+ void SetZoom( const boost::rational<long>& rNewZoom );
+ boost::rational<long> GetZoom() const { return maZoom; }
void SetSourceUnit( MapUnit eNewUnit ) { meSourceUnit = eNewUnit; }
MapUnit GetSourceUnit() const { return meSourceUnit; }
diff --git a/include/svx/obj3d.hxx b/include/svx/obj3d.hxx
index ac7e524..c1e3796 100644
--- a/include/svx/obj3d.hxx
+++ b/include/svx/obj3d.hxx
@@ -153,7 +153,7 @@ public:
virtual void SetPage(SdrPage* pNewPage) SAL_OVERRIDE;
virtual void SetModel(SdrModel* pNewModel) SAL_OVERRIDE;
virtual void NbcMove(const Size& rSize) SAL_OVERRIDE;
- virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact) SAL_OVERRIDE;
+ virtual void NbcResize(const Point& rRef, const boost::rational<long>& xFact, const boost::rational<long>& yFact) SAL_OVERRIDE;
virtual SdrObjList* GetSubList() const SAL_OVERRIDE;
// Insert 3D object into the group; transfer to other owner!
diff --git a/include/svx/scene3d.hxx b/include/svx/scene3d.hxx
index 332fa2a..b519126 100644
--- a/include/svx/scene3d.hxx
+++ b/include/svx/scene3d.hxx
@@ -191,8 +191,8 @@ public:
virtual void NbcSetSnapRect(const Rectangle& rRect) SAL_OVERRIDE;
virtual void NbcMove(const Size& rSize) SAL_OVERRIDE;
- virtual void NbcResize(const Point& rRef, const Fraction& rXFact,
- const Fraction& rYFact) SAL_OVERRIDE;
+ virtual void NbcResize(const Point& rRef, const boost::rational<long>& rXFact,
+ const boost::rational<long>& rYFact) SAL_OVERRIDE;
virtual void RecalcSnapRect() SAL_OVERRIDE;
virtual E3dScene* GetScene() const SAL_OVERRIDE;
diff --git a/include/svx/sdr/properties/defaultproperties.hxx b/include/svx/sdr/properties/defaultproperties.hxx
index 97fca16..9e9defe 100644
--- a/include/svx/sdr/properties/defaultproperties.hxx
+++ b/include/svx/sdr/properties/defaultproperties.hxx
@@ -94,7 +94,7 @@ namespace sdr
virtual void ForceDefaultAttributes();
// Scale the included ItemSet.
- virtual void Scale(const Fraction& rScale) SAL_OVERRIDE;
+ virtual void Scale(const boost::rational<long>& rScale) SAL_OVERRIDE;
};
} // end of namespace properties
} // end of namespace sdr
diff --git a/include/svx/sdr/properties/properties.hxx b/include/svx/sdr/properties/properties.hxx
index 6229e45..2bb32df 100644
--- a/include/svx/sdr/properties/properties.hxx
+++ b/include/svx/sdr/properties/properties.hxx
@@ -30,7 +30,7 @@ class SdrObject;
class SfxItemSet;
class SfxPoolItem;
class SfxStyleSheet;
-class Fraction;
+namespace boost { template<typename T> class rational; }
class SfxItemPool;
class SdrModel;
@@ -146,7 +146,7 @@ namespace sdr
// Scale the local ItemSet as far as it contains metric items. This needs to be
// overloaded to do it for hierarchical objects like e.g. groups.
- virtual void Scale(const Fraction& rScale);
+ virtual void Scale(const boost::rational<long>& rScale);
// Move local items to a new ItemPool. This needs to be
// overloaded to do it for hierarchical objects like e.g. groups.
diff --git a/include/svx/svddrag.hxx b/include/svx/svddrag.hxx
index fd43db2..1a11e0c 100644
--- a/include/svx/svddrag.hxx
+++ b/include/svx/svddrag.hxx
@@ -22,7 +22,7 @@
#include <tools/gen.hxx>
-#include <tools/fract.hxx>
+#include <tools/rational.hxx>
#include <svx/svxdllapi.h>
// Status information for specialized object dragging. In order for the model
@@ -146,8 +146,8 @@ public:
bool CheckMinMoved(const Point& rPnt);
long GetDX() const { return GetNow().X()-GetPrev().X(); }
long GetDY() const { return GetNow().Y()-GetPrev().Y(); }
- Fraction GetXFact() const;
- Fraction GetYFact() const;
+ boost::rational<long> GetXFact() const;
+ boost::rational<long> GetYFact() const;
SdrDragMethod* GetDragMethod() const { return pDragMethod; }
void SetDragMethod(SdrDragMethod* pMth) { pDragMethod=pMth; }
diff --git a/include/svx/svddrgmt.hxx b/include/svx/svddrgmt.hxx
index 6e2fa4a..ad37eee 100644
--- a/include/svx/svddrgmt.hxx
+++ b/include/svx/svddrgmt.hxx
@@ -258,8 +258,8 @@ public:
class SVX_DLLPUBLIC SdrDragResize : public SdrDragMethod
{
protected:
- Fraction aXFact;
- Fraction aYFact;
+ boost::rational<long> aXFact;
+ boost::rational<long> aYFact;
public:
TYPEINFO_OVERRIDE();
diff --git a/include/svx/svdedtv.hxx b/include/svx/svdedtv.hxx
index 1782820..12b27b8 100644
--- a/include/svx/svdedtv.hxx
+++ b/include/svx/svdedtv.hxx
@@ -212,8 +212,8 @@ public:
// waagerechte Linie hat z.B. immer eine Hoehe von 0.
void SetMarkedObjRect(const Rectangle& rRect, bool bCopy=false);
void MoveMarkedObj(const Size& rSiz, bool bCopy=false);
- void ResizeMarkedObj(const Point& rRef, const Fraction& xFact, const Fraction& yFact, bool bCopy=false);
- void ResizeMultMarkedObj(const Point& rRef, const Fraction& xFact, const Fraction& yFact, const bool bCopy, const bool bWdh, const bool bHgt);
+ void ResizeMarkedObj(const Point& rRef, const boost::rational<long>& xFact, const boost::rational<long>& yFact, bool bCopy=false);
+ void ResizeMultMarkedObj(const Point& rRef, const boost::rational<long>& xFact, const boost::rational<long>& yFact, const bool bCopy, const bool bWdh, const bool bHgt);
long GetMarkedObjRotate() const;
void RotateMarkedObj(const Point& rRef, long nWink, bool bCopy=false);
void MirrorMarkedObj(const Point& rRef1, const Point& rRef2, bool bCopy=false);
@@ -228,7 +228,7 @@ public:
void CopyMarkedObj();
void SetAllMarkedRect(const Rectangle& rRect, bool bCopy=false) { SetMarkedObjRect(rRect,bCopy); }
void MoveAllMarked(const Size& rSiz, bool bCopy=false) { MoveMarkedObj (rSiz,bCopy); }
- void ResizeAllMarked(const Point& rRef, const Fraction& xFact, const Fraction& yFact, bool bCopy=false) { ResizeMarkedObj (rRef,xFact,yFact,bCopy); }
+ void ResizeAllMarked(const Point& rRef, const boost::rational<long>& xFact, const boost::rational<long>& yFact, bool bCopy=false) { ResizeMarkedObj (rRef,xFact,yFact,bCopy); }
long GetAllMarkedRotate() const { return GetMarkedObjRotate(); }
void RotateAllMarked(const Point& rRef, long nWink, bool bCopy=false) { RotateMarkedObj(rRef,nWink,bCopy); }
void MirrorAllMarked(const Point& rRef1, const Point& rRef2, bool bCopy=false) { MirrorMarkedObj(rRef1,rRef2,bCopy); }
diff --git a/include/svx/svdetc.hxx b/include/svx/svdetc.hxx
index e524364..2ec177c 100644
--- a/include/svx/svdetc.hxx
+++ b/include/svx/svdetc.hxx
@@ -62,7 +62,7 @@ friend class SdrAttrObj;
Color aFontColor;
sal_uIntPtr nFontHeight;
MapUnit eMapUnit;
- Fraction aMapFraction;
+ boost::rational<long> aMapFraction;
private:
static SdrEngineDefaults& GetDefaults();
@@ -92,8 +92,8 @@ public:
static void SetMapUnit(MapUnit eMap) { GetDefaults().eMapUnit=eMap; }
static MapUnit GetMapUnit() { return GetDefaults().eMapUnit; }
// Default MapFraction ist 1/1.
- static void SetMapFraction(const Fraction& rMap) { GetDefaults().aMapFraction=rMap; }
- static Fraction GetMapFraction() { return GetDefaults().aMapFraction; }
+ static void SetMapFraction(const boost::rational<long>& rMap) { GetDefaults().aMapFraction=rMap; }
+ static boost::rational<long> GetMapFraction() { return GetDefaults().aMapFraction; }
// Einen Outliner mit den engineglobalen
// Defaulteinstellungen auf dem Heap erzeugen.
diff --git a/include/svx/svdglev.hxx b/include/svx/svdglev.hxx
index 8a9e420..b1576bd 100644
--- a/include/svx/svdglev.hxx
+++ b/include/svx/svdglev.hxx
@@ -78,7 +78,7 @@ public:
void DeleteMarkedGluePoints();
void MoveMarkedGluePoints (const Size& rSiz, bool bCopy=false);
- void ResizeMarkedGluePoints(const Point& rRef, const Fraction& xFact, const Fraction& yFact, bool bCopy=false);
+ void ResizeMarkedGluePoints(const Point& rRef, const boost::rational<long>& xFact, const boost::rational<long>& yFact, bool bCopy=false);
void RotateMarkedGluePoints(const Point& rRef, long nWink, bool bCopy=false);
void MirrorMarkedGluePoints(const Point& rRef1, const Point& rRef2, bool bCopy=false);
void MirrorMarkedGluePointsHorizontal(bool bCopy=false);
diff --git a/include/svx/svdmodel.hxx b/include/svx/svdmodel.hxx
index 0d9b03b..850185e 100644
--- a/include/svx/svdmodel.hxx
+++ b/include/svx/svdmodel.hxx
@@ -155,12 +155,12 @@ protected:
Link aIOProgressLink;
OUString aTablePath;
Size aMaxObjSize; // e.g. for auto-growing text
- Fraction aObjUnit; // description of the coordinate units for ClipBoard, Drag&Drop, ...
+ boost::rational<long> aObjUnit; // description of the coordinate units for ClipBoard, Drag&Drop, ...
MapUnit eObjUnit; // see above
FieldUnit eUIUnit; // unit, scale (e.g. 1/1000) for the UI (status bar) is set by ImpSetUIUnit()
- Fraction aUIScale; // see above
+ boost::rational<long> aUIScale; // see above
OUString aUIUnitStr; // see above
- Fraction aUIUnitFact; // see above
+ boost::rational<long> aUIUnitFact; // see above
int nUIUnitKomma; // see above
SdrLayerAdmin* pLayerAdmin;
@@ -374,10 +374,10 @@ public:
// with the correct sizes.
MapUnit GetScaleUnit() const { return eObjUnit; }
void SetScaleUnit(MapUnit eMap);
- const Fraction& GetScaleFraction() const { return aObjUnit; }
- void SetScaleFraction(const Fraction& rFrac);
+ const boost::rational<long>& GetScaleFraction() const { return aObjUnit; }
+ void SetScaleFraction(const boost::rational<long>& rFrac);
// Setting both simultaneously performs a little better
- void SetScaleUnit(MapUnit eMap, const Fraction& rFrac);
+ void SetScaleUnit(MapUnit eMap, const boost::rational<long>& rFrac);
// maximal size e.g. for auto growing texts
const Size& GetMaxObjSize() const { return aMaxObjSize; }
@@ -387,12 +387,12 @@ public:
void SetUIUnit(FieldUnit eUnit);
FieldUnit GetUIUnit() const { return eUIUnit; }
// The scale of the drawing. Default 1/1.
- void SetUIScale(const Fraction& rScale);
- const Fraction& GetUIScale() const { return aUIScale; }
+ void SetUIScale(const boost::rational<long>& rScale);
+ const boost::rational<long>& GetUIScale() const { return aUIScale; }
// Setting both simultaneously performs a little better
- void SetUIUnit(FieldUnit eUnit, const Fraction& rScale);
+ void SetUIUnit(FieldUnit eUnit, const boost::rational<long>& rScale);
- const Fraction& GetUIUnitFact() const { return aUIUnitFact; }
+ const boost::rational<long>& GetUIUnitFact() const { return aUIUnitFact; }
const OUString& GetUIUnitStr() const { return aUIUnitStr; }
int GetUIUnitKomma() const { return nUIUnitKomma; }
bool IsUIOnlyKomma() const { return bUIOnlyKomma; }
@@ -400,7 +400,7 @@ public:
static void TakeUnitStr(FieldUnit eUnit, OUString& rStr);
void TakeMetricStr(long nVal, OUString& rStr, bool bNoUnitChars = false, sal_Int32 nNumDigits = -1) const;
void TakeWinkStr(long nWink, OUString& rStr, bool bNoDegChar = false) const;
- void TakePercentStr(const Fraction& rVal, OUString& rStr, bool bNoPercentChar = false) const;
+ void TakePercentStr(const boost::rational<long>& rVal, OUString& rStr, bool bNoPercentChar = false) const;
// RecalcPageNums is ordinarily only called by the Page.
bool IsPagNumsDirty() const { return bPagNumsDirty; };
diff --git a/include/svx/svdoashp.hxx b/include/svx/svdoashp.hxx
index 169dd13..bca9283 100644
--- a/include/svx/svdoashp.hxx
+++ b/include/svx/svdoashp.hxx
@@ -188,13 +188,13 @@ public:
virtual const Rectangle& GetLogicRect() const SAL_OVERRIDE;
virtual void Move(const Size& rSiz) SAL_OVERRIDE;
- virtual void Resize(const Point& rRef, const Fraction& xFact, const Fraction& yFact, bool bUnsetRelative = true) SAL_OVERRIDE;
+ virtual void Resize(const Point& rRef, const boost::rational<long>& xFact, const boost::rational<long>& yFact, bool bUnsetRelative = true) SAL_OVERRIDE;
virtual void Shear(const Point& rRef, long nWink, double tn, bool bVShear) SAL_OVERRIDE;
virtual void SetSnapRect(const Rectangle& rRect) SAL_OVERRIDE;
virtual void SetLogicRect(const Rectangle& rRect) SAL_OVERRIDE;
virtual void NbcMove(const Size& rSiz) SAL_OVERRIDE;
- virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact) SAL_OVERRIDE;
+ virtual void NbcResize(const Point& rRef, const boost::rational<long>& xFact, const boost::rational<long>& yFact) SAL_OVERRIDE;
virtual void NbcRotate(const Point& rRef, long nWink, double sn, double cs) SAL_OVERRIDE;
virtual void NbcMirror(const Point& rRef1, const Point& rRef2) SAL_OVERRIDE;
virtual void NbcShear(const Point& rRef, long nWink, double tn, bool bVShear) SAL_OVERRIDE;
diff --git a/include/svx/svdobj.hxx b/include/svx/svdobj.hxx
index 81b176a..f1dc3a3 100644
--- a/include/svx/svdobj.hxx
+++ b/include/svx/svdobj.hxx
@@ -672,13 +672,13 @@ public:
// Objekte sollten i.d.R. nur die Nbc-Methoden ueberladen.
// Nbc bedeutet: 'NoBroadcast'.
virtual void NbcMove (const Size& rSiz);
- virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact);
+ virtual void NbcResize(const Point& rRef, const boost::rational<long>& xFact, const boost::rational<long>& yFact);
virtual void NbcRotate(const Point& rRef, long nWink, double sn, double cs);
virtual void NbcMirror(const Point& rRef1, const Point& rRef2);
virtual void NbcShear (const Point& rRef, long nWink, double tn, bool bVShear);
virtual void Move (const Size& rSiz);
- virtual void Resize(const Point& rRef, const Fraction& xFact, const Fraction& yFact, bool bUnsetRelative = true);
+ virtual void Resize(const Point& rRef, const boost::rational<long>& xFact, const boost::rational<long>& yFact, bool bUnsetRelative = true);
virtual void Rotate(const Point& rRef, long nWink, double sn, double cs);
virtual void Mirror(const Point& rRef1, const Point& rRef2);
virtual void Shear (const Point& rRef, long nWink, double tn, bool bVShear);
diff --git a/include/svx/svdocapt.hxx b/include/svx/svdocapt.hxx
index e7e3728..a10b0f7 100644
--- a/include/svx/svdocapt.hxx
+++ b/include/svx/svdocapt.hxx
@@ -116,7 +116,7 @@ public:
virtual Pointer GetCreatePointer() const SAL_OVERRIDE;
virtual void NbcMove(const Size& rSiz) SAL_OVERRIDE;
- virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact) SAL_OVERRIDE;
+ virtual void NbcResize(const Point& rRef, const boost::rational<long>& xFact, const boost::rational<long>& yFact) SAL_OVERRIDE;
virtual void NbcSetRelativePos(const Point& rPnt) SAL_OVERRIDE;
virtual Point GetRelativePos() const SAL_OVERRIDE;
diff --git a/include/svx/svdocirc.hxx b/include/svx/svdocirc.hxx
index 40386fd..036a4be 100644
--- a/include/svx/svdocirc.hxx
+++ b/include/svx/svdocirc.hxx
@@ -112,7 +112,7 @@ public:
virtual basegfx::B2DPolyPolygon TakeCreatePoly(const SdrDragStat& rDrag) const SAL_OVERRIDE;
virtual Pointer GetCreatePointer() const SAL_OVERRIDE;
virtual void NbcMove(const Size& aSiz) SAL_OVERRIDE;
- virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact) SAL_OVERRIDE;
+ virtual void NbcResize(const Point& rRef, const boost::rational<long>& xFact, const boost::rational<long>& yFact) SAL_OVERRIDE;
virtual void NbcMirror(const Point& rRef1, const Point& rRef2) SAL_OVERRIDE;
virtual void NbcShear (const Point& rRef, long nWink, double tn, bool bVShear) SAL_OVERRIDE;
virtual SdrObject* DoConvertToPolyObj(bool bBezier, bool bAddText) const SAL_OVERRIDE;
diff --git a/include/svx/svdoedge.hxx b/include/svx/svdoedge.hxx
index 438c5e7..8161ca5 100644
--- a/include/svx/svdoedge.hxx
+++ b/include/svx/svdoedge.hxx
@@ -264,7 +264,7 @@ public:
virtual void NbcSetSnapRect(const Rectangle& rRect) SAL_OVERRIDE;
virtual void NbcMove(const Size& aSize) SAL_OVERRIDE;
- virtual void NbcResize(const Point& rRefPnt, const Fraction& aXFact, const Fraction& aYFact) SAL_OVERRIDE;
+ virtual void NbcResize(const Point& rRefPnt, const boost::rational<long>& aXFact, const boost::rational<long>& aYFact) SAL_OVERRIDE;
// #i54102# added rotate, mirrorn and shear support
virtual void NbcRotate(const Point& rRef, long nWink, double sn, double cs) SAL_OVERRIDE;
diff --git a/include/svx/svdograf.hxx b/include/svx/svdograf.hxx
index e600609..3179369 100644
--- a/include/svx/svdograf.hxx
+++ b/include/svx/svdograf.hxx
@@ -162,7 +162,7 @@ public:
virtual sal_uInt32 GetHdlCount() const SAL_OVERRIDE;
virtual SdrHdl* GetHdl(sal_uInt32 nHdlNum) const SAL_OVERRIDE;
- virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact) SAL_OVERRIDE;
+ virtual void NbcResize(const Point& rRef, const boost::rational<long>& xFact, const boost::rational<long>& yFact) SAL_OVERRIDE;
virtual void NbcRotate(const Point& rRef, long nWink, double sn, double cs) SAL_OVERRIDE;
virtual void NbcMirror(const Point& rRef1, const Point& rRef2) SAL_OVERRIDE;
virtual void NbcShear (const Point& rRef, long nWink, double tn, bool bVShear) SAL_OVERRIDE;
diff --git a/include/svx/svdogrp.hxx b/include/svx/svdogrp.hxx
index 4a89e8f..4dc70df 100644
--- a/include/svx/svdogrp.hxx
+++ b/include/svx/svdogrp.hxx
@@ -85,7 +85,7 @@ public:
virtual long GetShearAngle(bool bVertical = false) const SAL_OVERRIDE;
virtual void Move(const Size& rSiz) SAL_OVERRIDE;
- virtual void Resize(const Point& rRef, const Fraction& xFact, const Fraction& yFact, bool bUnsetRelative = true) SAL_OVERRIDE;
+ virtual void Resize(const Point& rRef, const boost::rational<long>& xFact, const boost::rational<long>& yFact, bool bUnsetRelative = true) SAL_OVERRIDE;
virtual void Rotate(const Point& rRef, long nWink, double sn, double cs) SAL_OVERRIDE;
virtual void Mirror(const Point& rRef1, const Point& rRef2) SAL_OVERRIDE;
virtual void Shear(const Point& rRef, long nWink, double tn, bool bVShear) SAL_OVERRIDE;
@@ -95,7 +95,7 @@ public:
virtual void SetLogicRect(const Rectangle& rRect) SAL_OVERRIDE;
virtual void NbcMove(const Size& rSiz) SAL_OVERRIDE;
- virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact) SAL_OVERRIDE;
+ virtual void NbcResize(const Point& rRef, const boost::rational<long>& xFact, const boost::rational<long>& yFact) SAL_OVERRIDE;
virtual void NbcRotate(const Point& rRef, long nWink, double sn, double cs) SAL_OVERRIDE;
virtual void NbcMirror(const Point& rRef1, const Point& rRef2) SAL_OVERRIDE;
virtual void NbcShear(const Point& rRef, long nWink, double tn, bool bVShear) SAL_OVERRIDE;
diff --git a/include/svx/svdomeas.hxx b/include/svx/svdomeas.hxx
index 5cea5fe..f0cb6a7 100644
--- a/include/svx/svdomeas.hxx
+++ b/include/svx/svdomeas.hxx
@@ -117,7 +117,7 @@ public:
virtual Pointer GetCreatePointer() const SAL_OVERRIDE;
virtual void NbcMove(const Size& rSiz) SAL_OVERRIDE;
- virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact) SAL_OVERRIDE;
+ virtual void NbcResize(const Point& rRef, const boost::rational<long>& xFact, const boost::rational<long>& yFact) SAL_OVERRIDE;
virtual void NbcRotate(const Point& rRef, long nWink, double sn, double cs) SAL_OVERRIDE;
virtual void NbcMirror(const Point& rRef1, const Point& rRef2) SAL_OVERRIDE;
virtual void NbcShear(const Point& rRef, long nWink, double tn, bool bVShear) SAL_OVERRIDE;
diff --git a/include/svx/svdoole2.hxx b/include/svx/svdoole2.hxx
index f14646b..a27a35e 100644
--- a/include/svx/svdoole2.hxx
+++ b/include/svx/svdoole2.hxx
@@ -136,7 +136,7 @@ public:
SdrOle2Obj& operator=(const SdrOle2Obj& rObj);
virtual void NbcMove(const Size& rSize) SAL_OVERRIDE;
- virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact) SAL_OVERRIDE;
+ virtual void NbcResize(const Point& rRef, const boost::rational<long>& xFact, const boost::rational<long>& yFact) SAL_OVERRIDE;
virtual void NbcSetSnapRect(const Rectangle& rRect) SAL_OVERRIDE;
virtual void NbcSetLogicRect(const Rectangle& rRect) SAL_OVERRIDE;
virtual void SetGeoData(const SdrObjGeoData& rGeo) SAL_OVERRIDE;
@@ -167,7 +167,7 @@ public:
const OUString& aMediaType );
::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > GetParentXModel() const;
- bool CalculateNewScaling( Fraction& aScaleWidth, Fraction& aScaleHeight, Size& aObjAreaSize );
+ bool CalculateNewScaling( boost::rational<long>& aScaleWidth, boost::rational<long>& aScaleHeight, Size& aObjAreaSize );
bool AddOwnLightClient();
// handy to get the empty replacement graphic without accessing all the old stuff
diff --git a/include/svx/svdopath.hxx b/include/svx/svdopath.hxx
index b9cb18f..f3e4a46 100644
--- a/include/svx/svdopath.hxx
+++ b/include/svx/svdopath.hxx
@@ -114,7 +114,7 @@ public:
basegfx::B2DPolyPolygon getDragPolyPolygon(const SdrDragStat& rDrag) const;
virtual void NbcMove(const Size& aSize) SAL_OVERRIDE;
- virtual void NbcResize(const Point& rRefPnt, const Fraction& aXFact, const Fraction& aYFact) SAL_OVERRIDE;
+ virtual void NbcResize(const Point& rRefPnt, const boost::rational<long>& aXFact, const boost::rational<long>& aYFact) SAL_OVERRIDE;
virtual void NbcRotate(const Point& rRefPnt, long nAngle, double fSin, double fCos) SAL_OVERRIDE;
virtual void NbcMirror(const Point& rRefPnt1, const Point& rRefPnt2) SAL_OVERRIDE;
virtual void NbcShear(const Point& rRefPnt, long nAngle, double fTan, bool bVShear) SAL_OVERRIDE;
diff --git a/include/svx/svdorect.hxx b/include/svx/svdorect.hxx
index afd1d57..db40274 100644
--- a/include/svx/svdorect.hxx
+++ b/include/svx/svdorect.hxx
@@ -105,7 +105,7 @@ public:
virtual Pointer GetCreatePointer() const SAL_OVERRIDE;
virtual void NbcMove(const Size& rSiz) SAL_OVERRIDE;
- virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact) SAL_OVERRIDE;
+ virtual void NbcResize(const Point& rRef, const boost::rational<long>& xFact, const boost::rational<long>& yFact) SAL_OVERRIDE;
virtual void NbcRotate(const Point& rRef, long nWink, double sn, double cs) SAL_OVERRIDE;
virtual void NbcMirror(const Point& rRef1, const Point& rRef2) SAL_OVERRIDE;
virtual void NbcShear(const Point& rRef, long nWink, double tn, bool bVShear) SAL_OVERRIDE;
diff --git a/include/svx/svdotable.hxx b/include/svx/svdotable.hxx
index 2594a35..8b461b6 100644
--- a/include/svx/svdotable.hxx
+++ b/include/svx/svdotable.hxx
@@ -241,7 +241,7 @@ public:
virtual Pointer GetCreatePointer() const SAL_OVERRIDE;
virtual void NbcMove(const Size& rSiz) SAL_OVERRIDE;
- virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact) SAL_OVERRIDE;
+ virtual void NbcResize(const Point& rRef, const boost::rational<long>& xFact, const boost::rational<long>& yFact) SAL_OVERRIDE;
virtual bool BegTextEdit(SdrOutliner& rOutl) SAL_OVERRIDE;
virtual void EndTextEdit(SdrOutliner& rOutl) SAL_OVERRIDE;
diff --git a/include/svx/svdotext.hxx b/include/svx/svdotext.hxx
index a2b7b1f..94a032c 100644
--- a/include/svx/svdotext.hxx
+++ b/include/svx/svdotext.hxx
@@ -264,7 +264,7 @@ private:
Rectangle& rTextRect,
Rectangle& rAnchorRect,
Rectangle& rPaintRect,
- Fraction& aFitXKorreg ) const;
+ boost::rational<long>& aFitXKorreg ) const;
void ImpAutoFitText( SdrOutliner& rOutliner ) const;
static void ImpAutoFitText( SdrOutliner& rOutliner, const Size& rShapeSize, bool bIsVerticalWriting );
SVX_DLLPRIVATE SdrObject* ImpConvertContainedTextToSdrPathObjs(bool bToPoly) const;
@@ -284,7 +284,7 @@ protected:
SdrObject* ImpConvertMakeObj(const basegfx::B2DPolyPolygon& rPolyPolygon, bool bClosed, bool bBezier, bool bNoSetAttr = false) const;
SdrObject* ImpConvertAddText(SdrObject* pObj, bool bBezier) const;
void ImpSetTextStyleSheetListeners();
- void ImpSetCharStretching(SdrOutliner& rOutliner, const Size& rTextSize, const Size& rShapeSize, Fraction& rFitXKorreg) const;
+ void ImpSetCharStretching(SdrOutliner& rOutliner, const Size& rTextSize, const Size& rShapeSize, boost::rational<long>& rFitXKorreg) const;
void ImpJustifyRect(Rectangle& rRect) const;
void ImpCheckShear();
Rectangle ImpDragCalcRect(const SdrDragStat& rDrag) const;
@@ -465,7 +465,7 @@ public:
virtual Pointer GetCreatePointer() const SAL_OVERRIDE;
virtual void NbcMove(const Size& rSiz) SAL_OVERRIDE;
- virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact) SAL_OVERRIDE;
+ virtual void NbcResize(const Point& rRef, const boost::rational<long>& xFact, const boost::rational<long>& yFact) SAL_OVERRIDE;
virtual void NbcRotate(const Point& rRef, long nWink, double sn, double cs) SAL_OVERRIDE;
virtual void NbcMirror(const Point& rRef1, const Point& rRef2) SAL_OVERRIDE;
virtual void NbcShear(const Point& rRef, long nWink, double tn, bool bVShear) SAL_OVERRIDE;
diff --git a/include/svx/svdouno.hxx b/include/svx/svdouno.hxx
index 0a796da..f22cb57 100644
--- a/include/svx/svdouno.hxx
+++ b/include/svx/svdouno.hxx
@@ -80,7 +80,7 @@ public:
virtual SdrUnoObj* Clone() const SAL_OVERRIDE;
SdrUnoObj& operator= (const SdrUnoObj& rObj);
- virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact) SAL_OVERRIDE;
+ virtual void NbcResize(const Point& rRef, const boost::rational<long>& xFact, const boost::rational<long>& yFact) SAL_OVERRIDE;
virtual void NbcSetLayer(SdrLayerID nLayer) SAL_OVERRIDE;
// SpecialDrag support
diff --git a/include/svx/svdovirt.hxx b/include/svx/svdovirt.hxx
index 766b807..82c311e 100644
--- a/include/svx/svdovirt.hxx
+++ b/include/svx/svdovirt.hxx
@@ -101,13 +101,13 @@ public:
virtual basegfx::B2DPolyPolygon TakeCreatePoly(const SdrDragStat& rDrag) const SAL_OVERRIDE;
virtual void NbcMove(const Size& rSiz) SAL_OVERRIDE;
- virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact) SAL_OVERRIDE;
+ virtual void NbcResize(const Point& rRef, const boost::rational<long>& xFact, const boost::rational<long>& yFact) SAL_OVERRIDE;
virtual void NbcRotate(const Point& rRef, long nWink, double sn, double cs) SAL_OVERRIDE;
virtual void NbcMirror(const Point& rRef1, const Point& rRef2) SAL_OVERRIDE;
virtual void NbcShear(const Point& rRef, long nWink, double tn, bool bVShear) SAL_OVERRIDE;
virtual void Move(const Size& rSiz) SAL_OVERRIDE;
- virtual void Resize(const Point& rRef, const Fraction& xFact, const Fraction& yFact, bool bUnsetRelative = true) SAL_OVERRIDE;
+ virtual void Resize(const Point& rRef, const boost::rational<long>& xFact, const boost::rational<long>& yFact, bool bUnsetRelative = true) SAL_OVERRIDE;
virtual void Rotate(const Point& rRef, long nWink, double sn, double cs) SAL_OVERRIDE;
virtual void Mirror(const Point& rRef1, const Point& rRef2) SAL_OVERRIDE;
virtual void Shear(const Point& rRef, long nWink, double tn, bool bVShear) SAL_OVERRIDE;
diff --git a/include/svx/svdpoev.hxx b/include/svx/svdpoev.hxx
index ef73aa4..b0adf6d 100644
--- a/include/svx/svdpoev.hxx
+++ b/include/svx/svdpoev.hxx
@@ -64,7 +64,7 @@ public:
bool IsDeleteMarkedPointsPossible() const SAL_OVERRIDE;
void MoveMarkedPoints(const Size& rSiz);
- void ResizeMarkedPoints(const Point& rRef, const Fraction& xFact, const Fraction& yFact);
+ void ResizeMarkedPoints(const Point& rRef, const boost::rational<long>& xFact, const boost::rational<long>& yFact);
void RotateMarkedPoints(const Point& rRef, long nWink);
// Hierbei entstehen eventuell beliebig viele neue Objekte:
diff --git a/include/svx/svdsnpv.hxx b/include/svx/svdsnpv.hxx
index 815656a..c963d80 100644
--- a/include/svx/svdsnpv.hxx
+++ b/include/svx/svdsnpv.hxx
@@ -51,10 +51,10 @@ protected:
class ImplHelpLineOverlay* mpHelpLineOverlay;
Size aMagnSiz;
- Fraction aSnapWdtX;
- Fraction aSnapWdtY;
+ boost::rational<long> aSnapWdtX;
+ boost::rational<long> aSnapWdtY;
- sal_uInt16 nMagnSizPix;
+ sal_uInt16 nMagnSizPix;
long nSnapAngle;
long nEliminatePolyPointLimitAngle;
@@ -98,9 +98,9 @@ public:
virtual void BrkAction() SAL_OVERRIDE; // f.abg.Klassen Actions z,B, Draggen abbrechen.
virtual void TakeActionRect(Rectangle& rRect) const SAL_OVERRIDE;
- void SetSnapGridWidth(const Fraction& rX, const Fraction& rY) { aSnapWdtX=rX; aSnapWdtY=rY; }
- const Fraction& GetSnapGridWidthX() const { return aSnapWdtX; }
- const Fraction& GetSnapGridWidthY() const { return aSnapWdtY; }
+ void SetSnapGridWidth(const boost::rational<long>& rX, const boost::rational<long>& rY) { aSnapWdtX=rX; aSnapWdtY=rY; }
+ const boost::rational<long>& GetSnapGridWidthX() const { return aSnapWdtX; }
+ const boost::rational<long>& GetSnapGridWidthY() const { return aSnapWdtY; }
void SetSnapMagnetic(const Size& rSiz) { if (rSiz!=aMagnSiz) { aMagnSiz=rSiz; } }
const Size& GetSnapMagnetic() const { return aMagnSiz; }
diff --git a/include/svx/svdtrans.hxx b/include/svx/svdtrans.hxx
index b287c23..d29ab1f 100644
--- a/include/svx/svdtrans.hxx
+++ b/include/svx/svdtrans.hxx
@@ -22,7 +22,7 @@
#include <rtl/ustring.hxx>
#include <svx/svxdllapi.h>
-#include <tools/fract.hxx>
+#include <tools/rational.hxx>
#include <tools/gen.hxx>
#include <tools/poly.hxx>
#include <vcl/field.hxx>
@@ -55,10 +55,10 @@ inline void MovePoly(Polygon& rPoly, const Size& S) { rPoly.Move(S.Width(),
inline void MovePoly(tools::PolyPolygon& rPoly, const Size& S) { rPoly.Move(S.Width(),S.Height()); }
void MoveXPoly(XPolygon& rPoly, const Size& S);
-SVX_DLLPUBLIC void ResizeRect(Rectangle& rRect, const Point& rRef, const Fraction& xFact, const Fraction& yFact, bool bNoJustify = false);
-inline void ResizePoint(Point& rPnt, const Point& rRef, Fraction xFact, Fraction yFact);
-void ResizePoly(Polygon& rPoly, const Point& rRef, const Fraction& xFact, const Fraction& yFact);
-void ResizeXPoly(XPolygon& rPoly, const Point& rRef, const Fraction& xFact, const Fraction& yFact);
+SVX_DLLPUBLIC void ResizeRect(Rectangle& rRect, const Point& rRef, const boost::rational<long>& xFact, const boost::rational<long>& yFact, bool bNoJustify = false);
+inline void ResizePoint(Point& rPnt, const Point& rRef, boost::rational<long> xFact, boost::rational<long> yFact);
+void ResizePoly(Polygon& rPoly, const Point& rRef, const boost::rational<long>& xFact, const boost::rational<long>& yFact);
+void ResizeXPoly(XPolygon& rPoly, const Point& rRef, const boost::rational<long>& xFact, const boost::rational<long>& yFact);
inline void RotatePoint(Point& rPnt, const Point& rRef, double sn, double cs);
SVX_DLLPUBLIC void RotatePoly(Polygon& rPoly, const Point& rRef, double sn, double cs);
@@ -102,12 +102,10 @@ void CrookStretchPoly(XPolyPolygon& rPoly, const Point& rCenter, const Point& rR
/* Inline */
/**************************************************************************************************/
-inline void ResizePoint(Point& rPnt, const Point& rRef, Fraction xFact, Fraction yFact)
+inline void ResizePoint(Point& rPnt, const Point& rRef, boost::rational<long> xFact, boost::rational<long> yFact)
{
- if (xFact.GetDenominator()==0) xFact=Fraction(xFact.GetNumerator(),1); // DivZero abfangen
- if (yFact.GetDenominator()==0) yFact=Fraction(yFact.GetNumerator(),1); // DivZero abfangen
- rPnt.X()=rRef.X()+ Round(((double)(rPnt.X()-rRef.X())*xFact.GetNumerator())/xFact.GetDenominator());
- rPnt.Y()=rRef.Y()+ Round(((double)(rPnt.Y()-rRef.Y())*yFact.GetNumerator())/yFact.GetDenominator());
+ rPnt.X()=rRef.X()+ Round(((double)(rPnt.X()-rRef.X())*xFact.numerator())/xFact.denominator());
+ rPnt.Y()=rRef.Y()+ Round(((double)(rPnt.Y()-rRef.Y())*yFact.numerator())/yFact.denominator());
}
inline void RotatePoint(Point& rPnt, const Point& rRef, double sn, double cs)
@@ -221,25 +219,25 @@ SVX_DLLPUBLIC void OrthoDistance4(const Point& rPt0, Point& rPt, bool bBigOrtho)
// Rechnung und Zwischenergebnis sind BigInt.
SVX_DLLPUBLIC long BigMulDiv(long nVal, long nMul, long nDiv);
-// Fehlerbehaftetes Kuerzen einer Fraction.
+// Fehlerbehaftetes Kuerzen einer boost::rational<long>.
// nDigits gibt an, wieviele signifikante Stellen in
// Zaehler/Nenner mindestens erhalten bleiben sollen.
-void Kuerzen(Fraction& rF, unsigned nDigits);
+void Kuerzen(boost::rational<long>& rF, unsigned nDigits);
class FrPair {
- Fraction aX;
- Fraction aY;
+ boost::rational<long> aX;
+ boost::rational<long> aY;
public:
FrPair() : aX(0,1),aY(0,1) {}
- FrPair(const Fraction& rBoth) : aX(rBoth),aY(rBoth) {}
- FrPair(const Fraction& rX, const Fraction& rY) : aX(rX),aY(rY) {}
+ FrPair(const boost::rational<long>& rBoth) : aX(rBoth),aY(rBoth) {}
+ FrPair(const boost::rational<long>& rX, const boost::rational<long>& rY) : aX(rX),aY(rY) {}
FrPair(long nMul, long nDiv) : aX(nMul,nDiv),aY(nMul,nDiv) {}
FrPair(long xMul, long xDiv, long yMul, long yDiv): aX(xMul,xDiv),aY(yMul,yDiv) {}
- const Fraction& X() const { return aX; }
- const Fraction& Y() const { return aY; }
- Fraction& X() { return aX; }
- Fraction& Y() { return aY; }
+ const boost::rational<long>& X() const { return aX; }
+ const boost::rational<long>& Y() const { return aY; }
+ boost::rational<long>& X() { return aX; }
+ boost::rational<long>& Y() { return aY; }
};
// Fuer die Umrechnung von Masseinheiten
@@ -265,7 +263,7 @@ inline bool IsInch(FieldUnit eU) {
}
class SVX_DLLPUBLIC SdrFormatter {
- Fraction aScale;
+ boost::rational<long> aScale;
long nMul_;
long nDiv_;
short nKomma_;
diff --git a/include/svx/sxfiitm.hxx b/include/svx/sxfiitm.hxx
index 570ebd0..6aa43ac 100644
--- a/include/svx/sxfiitm.hxx
+++ b/include/svx/sxfiitm.hxx
@@ -20,26 +20,26 @@
#define INCLUDED_SVX_SXFIITM_HXX
#include <svl/poolitem.hxx>
-#include <tools/fract.hxx>
+#include <tools/rational.hxx>
/*************************************************************************/
/* FractionItem */
/*************************************************************************/
class SdrFractionItem: public SfxPoolItem {
- Fraction nValue;
+ boost::rational<long> nValue;
public:
TYPEINFO_VISIBILITY( SVX_DLLPUBLIC );
SdrFractionItem(sal_uInt16 nId=0): SfxPoolItem(nId) {}
- SdrFractionItem(sal_uInt16 nId, const Fraction& rVal): SfxPoolItem(nId), nValue(rVal) {}
+ SdrFractionItem(sal_uInt16 nId, const boost::rational<long>& rVal): SfxPoolItem(nId), nValue(rVal) {}
SdrFractionItem(sal_uInt16 nId, SvStream& rIn);
virtual bool operator==(const SfxPoolItem&) const SAL_OVERRIDE;
virtual bool GetPresentation(SfxItemPresentation ePresentation, SfxMapUnit eCoreMetric, SfxMapUnit ePresentationMetric, OUString &rText, const IntlWrapper * = 0) const SAL_OVERRIDE;
virtual SfxPoolItem* Create(SvStream&, sal_uInt16 nVer) const SAL_OVERRIDE;
virtual SvStream& Store(SvStream&, sal_uInt16 nItemVers) const SAL_OVERRIDE;
virtual SfxPoolItem* Clone(SfxItemPool *pPool=NULL) const SAL_OVERRIDE;
- const Fraction& GetValue() const { return nValue; }
- void SetValue(const Fraction& rVal) { nValue = rVal; }
+ const boost::rational<long>& GetValue() const { return nValue; }
+ void SetValue(const boost::rational<long>& rVal) { nValue = rVal; }
};
diff --git a/include/svx/sxsiitm.hxx b/include/svx/sxsiitm.hxx
index 29fdf62..8a7625a 100644
--- a/include/svx/sxsiitm.hxx
+++ b/include/svx/sxsiitm.hxx
@@ -24,8 +24,8 @@
class SdrScaleItem: public SdrFractionItem {
public:
TYPEINFO_OVERRIDE();
- SdrScaleItem(sal_uInt16 nId=0): SdrFractionItem(nId,Fraction(1,1)) {}
- SdrScaleItem(sal_uInt16 nId, const Fraction& rVal): SdrFractionItem(nId,rVal) {}
+ SdrScaleItem(sal_uInt16 nId=0): SdrFractionItem(nId, boost::rational<long>(1,1) ) {}
+ SdrScaleItem(sal_uInt16 nId, const boost::rational<long>& rVal): SdrFractionItem(nId,rVal) {}
SdrScaleItem(sal_uInt16 nId, SvStream& rIn): SdrFractionItem(nId,rIn) {}
virtual bool GetPresentation(SfxItemPresentation ePresentation, SfxMapUnit eCoreMetric, SfxMapUnit ePresentationMetric, OUString &rText, const IntlWrapper * = 0) const SAL_OVERRIDE;
virtual SfxPoolItem* Create(SvStream&, sal_uInt16 nVer) const SAL_OVERRIDE;
diff --git a/include/tools/bigint.hxx b/include/tools/bigint.hxx
index 33d19bc..c4c1c6d 100644
--- a/include/tools/bigint.hxx
+++ b/include/tools/bigint.hxx
@@ -28,8 +28,6 @@ class SvStream;
#define MAX_DIGITS 8
-class Fraction;
-
class TOOLS_DLLPUBLIC SAL_WARN_UNUSED BigInt
{
private:
@@ -144,8 +142,6 @@ public:
TOOLS_DLLPUBLIC friend bool operator> ( const BigInt& rVal1, const BigInt& rVal2 );
friend inline bool operator<=( const BigInt& rVal1, const BigInt& rVal2 );
friend inline bool operator>=( const BigInt& rVal1, const BigInt& rVal2 );
-
- friend class Fraction;
};
inline BigInt::operator short() const
diff --git a/include/tools/fract.hxx b/include/tools/fract.hxx
deleted file mode 100644
index 10e810e..0000000
--- a/include/tools/fract.hxx
+++ /dev/null
@@ -1,142 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-#ifndef INCLUDED_TOOLS_FRACT_HXX
-#define INCLUDED_TOOLS_FRACT_HXX
-
-#include <tools/toolsdllapi.h>
-
-class SvStream;
-
-class TOOLS_DLLPUBLIC SAL_WARN_UNUSED Fraction
-{
-private:
- long nNumerator;
- long nDenominator;
-
-public:
- Fraction() { nNumerator = 0; nDenominator = 1; }
- Fraction( const Fraction & rFrac );
- Fraction( long nNum, long nDen=1 );
- Fraction( double dVal );
-
- bool IsValid() const;
-
- long GetNumerator() const { return nNumerator; }
- long GetDenominator() const { return nDenominator; }
-
- operator long() const;
- operator double() const;
-
- Fraction& operator=( const Fraction& rfrFrac );
-
- Fraction& operator+=( const Fraction& rfrFrac );
- Fraction& operator-=( const Fraction& rfrFrac );
- Fraction& operator*=( const Fraction& rfrFrac );
- Fraction& operator/=( const Fraction& rfrFrac );
-
- void ReduceInaccurate( unsigned nSignificantBits );
-
- friend inline Fraction operator+( const Fraction& rVal1, const Fraction& rVal2 );
- friend inline Fraction operator-( const Fraction& rVal1, const Fraction& rVal2 );
- friend inline Fraction operator*( const Fraction& rVal1, const Fraction& rVal2 );
- friend inline Fraction operator/( const Fraction& rVal1, const Fraction& rVal2 );
-
- TOOLS_DLLPUBLIC friend bool operator==( const Fraction& rVal1, const Fraction& rVal2 );
- friend inline bool operator!=( const Fraction& rVal1, const Fraction& rVal2 );
- TOOLS_DLLPUBLIC friend bool operator< ( const Fraction& rVal1, const Fraction& rVal2 );
- TOOLS_DLLPUBLIC friend bool operator> ( const Fraction& rVal1, const Fraction& rVal2 );
- friend inline bool operator<=( const Fraction& rVal1, const Fraction& rVal2 );
- friend inline bool operator>=( const Fraction& rVal1, const Fraction& rVal2 );
-
- TOOLS_DLLPUBLIC friend SvStream& ReadFraction( SvStream& rIStream, Fraction& rFract );
- TOOLS_DLLPUBLIC friend SvStream& WriteFraction( SvStream& rOStream, const Fraction& rFract );
-};
-
-inline Fraction::Fraction( const Fraction& rFrac )
-{
- nNumerator = rFrac.nNumerator;
- nDenominator = rFrac.nDenominator;
-}
-
-inline Fraction& Fraction::operator=( const Fraction& rFrac )
-{
- nNumerator = rFrac.nNumerator;
- nDenominator = rFrac.nDenominator;
- return *this;
-}
-
-inline bool Fraction::IsValid() const
-{
- return (nDenominator > 0);
-}
-
-inline Fraction::operator long() const
-{
- if ( nDenominator > 0 )
- return (nNumerator / nDenominator);
- else
- return 0;
-}
-
-inline Fraction operator+( const Fraction& rVal1, const Fraction& rVal2 )
-{
- Fraction aErg( rVal1 );
- aErg += rVal2;
- return aErg;
-}
-
-inline Fraction operator-( const Fraction& rVal1, const Fraction& rVal2 )
-{
- Fraction aErg( rVal1 );
- aErg -= rVal2;
- return aErg;
-}
-
-inline Fraction operator*( const Fraction& rVal1, const Fraction& rVal2 )
-{
- Fraction aErg( rVal1 );
- aErg *= rVal2;
- return aErg;
-}
-
-inline Fraction operator/( const Fraction& rVal1, const Fraction& rVal2 )
-{
- Fraction aErg( rVal1 );
- aErg /= rVal2;
- return aErg;
-}
-
-inline bool operator !=( const Fraction& rVal1, const Fraction& rVal2 )
-{
- return !(rVal1 == rVal2);
-}
-
-inline bool operator <=( const Fraction& rVal1, const Fraction& rVal2 )
-{
- return !(rVal1 > rVal2);
-}
-
-inline bool operator >=( const Fraction& rVal1, const Fraction& rVal2 )
-{
- return !(rVal1 < rVal2);
-}
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/tools/rational.hxx b/include/tools/rational.hxx
new file mode 100644
index 0000000..0eeb103
--- /dev/null
+++ b/include/tools/rational.hxx
@@ -0,0 +1,25 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ */
+#ifndef INCLUDED_TOOLS_RATIONAL_HXX
+#define INCLUDED_TOOLS_RATIONAL_HXX
+
+#include <boost/rational.hpp>
+#include <tools/toolsdllapi.h>
+
+class SvStream;
+
+TOOLS_DLLPUBLIC boost::rational<long> rational_FromDouble(double dVal);
+TOOLS_DLLPUBLIC void rational_ReduceInaccurate(boost::rational<long>& rRational, unsigned nSignificantBits);
+TOOLS_DLLPUBLIC SvStream& ReadFraction(SvStream& rIStream, boost::rational<long>& rRational);
+TOOLS_DLLPUBLIC SvStream& WriteFraction(SvStream& rOStream, const boost::rational<long>& rRational);
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/gdimtf.hxx b/include/vcl/gdimtf.hxx
index 5a80213..128895f 100644
--- a/include/vcl/gdimtf.hxx
+++ b/include/vcl/gdimtf.hxx
@@ -136,7 +136,7 @@ public:
// additional Move method getting specifics how to handle MapMode( MAP_PIXEL )
void Move( long nX, long nY, long nDPIX, long nDPIY );
void Scale( double fScaleX, double fScaleY );
- void Scale( const Fraction& rScaleX, const Fraction& rScaleY );
+ void Scale( const boost::rational<long>& rScaleX, const boost::rational<long>& rScaleY );
void Rotate( long nAngle10 );
void Clip( const Rectangle& );
/* get the bound rect of the contained actions
diff --git a/include/vcl/mapmod.hxx b/include/vcl/mapmod.hxx
index 10e06d2..211727f 100644
--- a/include/vcl/mapmod.hxx
+++ b/include/vcl/mapmod.hxx
@@ -21,7 +21,7 @@
#define INCLUDED_VCL_MAPMOD_HXX
#include <tools/gen.hxx>
-#include <tools/fract.hxx>
+#include <tools/rational.hxx>
#include <tools/solar.h>
#include <vcl/dllapi.h>
#include <tools/resid.hxx>
@@ -44,8 +44,8 @@ private:
sal_uLong mnRefCount;
MapUnit meUnit;
Point maOrigin;
- Fraction maScaleX;
- Fraction maScaleY;
+ boost::rational<long> maScaleX;
+ boost::rational<long> maScaleY;
bool mbSimple;
friend SvStream& ReadImplMapMode( SvStream& rIStm, ImplMapMode& rMapMode );
@@ -75,7 +75,7 @@ public:
MapMode( const MapMode& rMapMode );
MapMode( MapUnit eUnit );
MapMode( MapUnit eUnit, const Point& rLogicOrg,
- const Fraction& rScaleX, const Fraction& rScaleY );
+ const boost::rational<long>& rScaleX, const boost::rational<long>& rScaleY );
~MapMode();
void SetMapUnit( MapUnit eUnit );
@@ -86,11 +86,11 @@ public:
const Point& GetOrigin() const
{ return mpImplMapMode->maOrigin; }
- void SetScaleX( const Fraction& rScaleX );
- const Fraction& GetScaleX() const
+ void SetScaleX( const boost::rational<long>& rScaleX );
+ const boost::rational<long>& GetScaleX() const
{ return mpImplMapMode->maScaleX; }
- void SetScaleY( const Fraction& rScaleY );
- const Fraction& GetScaleY() const
+ void SetScaleY( const boost::rational<long>& rScaleY );
+ const boost::rational<long>& GetScaleY() const
{ return mpImplMapMode->maScaleY; }
MapMode& operator=( const MapMode& rMapMode );
diff --git a/include/vcl/virdev.hxx b/include/vcl/virdev.hxx
index 624cb2f..4886410 100644
--- a/include/vcl/virdev.hxx
+++ b/include/vcl/virdev.hxx
@@ -124,7 +124,7 @@ public:
bool SetOutputSizePixel( const Size& rNewSize, bool bErase = true );
bool SetOutputSizePixelScaleOffsetAndBuffer( const Size& rNewSize,
- const Fraction& rScale,
+ const boost::rational<long>& rScale,
const Point& rNewOffset,
const basebmp::RawMemorySharedArray &pBuffer,
const bool bTopDown = false );
diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx
index decc15c..14c23bd 100644
--- a/include/vcl/window.hxx
+++ b/include/vcl/window.hxx
@@ -1009,8 +1009,8 @@ public:
void SetCursor( vcl::Cursor* pCursor );
vcl::Cursor* GetCursor() const;
- void SetZoom( const Fraction& rZoom );
- const Fraction& GetZoom() const;
+ void SetZoom( const boost::rational<long>& rZoom );
+ const boost::rational<long>& GetZoom() const;
bool IsZoom() const;
long CalcZoom( long n ) const;
diff --git a/reportdesign/inc/RptObject.hxx b/reportdesign/inc/RptObject.hxx
index 6f2cfca..d91e271 100644
--- a/reportdesign/inc/RptObject.hxx
+++ b/reportdesign/inc/RptObject.hxx
@@ -148,7 +148,7 @@ protected:
OCustomShape(const OUString& _sComponentName);
virtual void NbcMove( const Size& rSize ) SAL_OVERRIDE;
- virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact) SAL_OVERRIDE;
+ virtual void NbcResize(const Point& rRef, const boost::rational<long>& xFact, const boost::rational<long>& yFact) SAL_OVERRIDE;
virtual void NbcSetLogicRect(const Rectangle& rRect) SAL_OVERRIDE;
virtual bool EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd) SAL_OVERRIDE;
@@ -196,7 +196,7 @@ protected:
virtual void NbcMove( const Size& rSize ) SAL_OVERRIDE;
- virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact) SAL_OVERRIDE;
+ virtual void NbcResize(const Point& rRef, const boost::rational<long>& xFact, const boost::rational<long>& yFact) SAL_OVERRIDE;
virtual void NbcSetLogicRect(const Rectangle& rRect) SAL_OVERRIDE;
virtual bool EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd) SAL_OVERRIDE;
@@ -244,7 +244,7 @@ protected:
virtual ~OUnoObject();
virtual void NbcMove( const Size& rSize ) SAL_OVERRIDE;
- virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact) SAL_OVERRIDE;
+ virtual void NbcResize(const Point& rRef, const boost::rational<long>& xFact, const boost::rational<long>& yFact) SAL_OVERRIDE;
virtual void NbcSetLogicRect(const Rectangle& rRect) SAL_OVERRIDE;
virtual bool EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd) SAL_OVERRIDE;
diff --git a/reportdesign/source/core/sdr/RptObject.cxx b/reportdesign/source/core/sdr/RptObject.cxx
index 0d76ae2..5c0d525 100644
--- a/reportdesign/source/core/sdr/RptObject.cxx
+++ b/reportdesign/source/core/sdr/RptObject.cxx
@@ -538,7 +538,7 @@ void OCustomShape::NbcMove( const Size& rSize )
SdrObjCustomShape::NbcMove( rSize );
}
-void OCustomShape::NbcResize(const Point& rRef, const Fraction& xFract, const Fraction& yFract)
+void OCustomShape::NbcResize(const Point& rRef, const boost::rational<long>& xFract, const boost::rational<long>& yFract)
{
SdrObjCustomShape::NbcResize( rRef, xFract, yFract );
@@ -749,7 +749,7 @@ void OUnoObject::NbcMove( const Size& rSize )
-void OUnoObject::NbcResize(const Point& rRef, const Fraction& xFract, const Fraction& yFract)
+void OUnoObject::NbcResize(const Point& rRef, const boost::rational<long>& xFract, const boost::rational<long>& yFract)
{
SdrUnoObj::NbcResize( rRef, xFract, yFract );
@@ -1050,7 +1050,7 @@ void OOle2Obj::NbcMove( const Size& rSize )
-void OOle2Obj::NbcResize(const Point& rRef, const Fraction& xFract, const Fraction& yFract)
+void OOle2Obj::NbcResize(const Point& rRef, const boost::rational<long>& xFract, const boost::rational<long>& yFract)
{
SdrOle2Obj::NbcResize( rRef, xFract, yFract );
diff --git a/reportdesign/source/ui/inc/DesignView.hxx b/reportdesign/source/ui/inc/DesignView.hxx
index 2b219ea..4c36ab7 100644
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list