diff options
author | Noel Grandin <noel@peralex.com> | 2016-06-24 14:48:36 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2016-06-27 05:19:12 +0000 |
commit | d6d1fc2683eeb88a569795e6bd27ad5db035f511 (patch) | |
tree | cc98260f62d71ff5fb4af58d4b7e747e8793f06e /svx/source/svdraw/svdtrans.cxx | |
parent | 98747742b20c82382ed16b193e7bec175e905978 (diff) |
loplugin:singlevalfields in svx(part1)
Change-Id: I9f655f0573ea301faa6cb54733832c26864eae4f
Reviewed-on: https://gerrit.libreoffice.org/26639
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'svx/source/svdraw/svdtrans.cxx')
-rw-r--r-- | svx/source/svdraw/svdtrans.cxx | 47 |
1 files changed, 2 insertions, 45 deletions
diff --git a/svx/source/svdraw/svdtrans.cxx b/svx/source/svdraw/svdtrans.cxx index 5ba0648524f6..554731b220be 100644 --- a/svx/source/svdraw/svdtrans.cxx +++ b/svx/source/svdraw/svdtrans.cxx @@ -690,41 +690,6 @@ void GetMeterOrInch(MapUnit eMU, short& rnKomma, long& rnMul, long& rnDiv, bool& rbInch=bInch; } -void GetMeterOrInch(FieldUnit eFU, short& rnKomma, long& rnMul, long& rnDiv, bool& rbMetr, bool& rbInch) -{ - rnMul=1; rnDiv=1; - short nKomma=0; - bool bMetr = false, bInch = false; - switch (eFU) { - case FUNIT_NONE : break; - // metrically - case FUNIT_100TH_MM : bMetr = true; nKomma=5; break; - case FUNIT_MM : bMetr = true; nKomma=3; break; - case FUNIT_CM : bMetr = true; nKomma=2; break; - case FUNIT_M : bMetr = true; nKomma=0; break; - case FUNIT_KM : bMetr = true; nKomma=-3; break; - // Inch - case FUNIT_TWIP : bInch = true; rnDiv=144; nKomma=1; break; // 1Twip = 1/1440" - case FUNIT_POINT : bInch = true; rnDiv=72; break; // 1Pt = 1/72" - case FUNIT_PICA : bInch = true; rnDiv=6; break; // 1Pica = 1/6" ? - case FUNIT_INCH : bInch = true; break; // 1" = 1" - case FUNIT_FOOT : bInch = true; rnMul=12; break; // 1Ft = 12" - case FUNIT_MILE : bInch = true; rnMul=6336; nKomma=-1; break; // 1mile = 63360" - // others - case FUNIT_CUSTOM : break; - case FUNIT_PERCENT : nKomma=2; break; - // TODO: Add code to handle the following (added to remove warning) - case FUNIT_CHAR : break; - case FUNIT_LINE : break; - case FUNIT_PIXEL : break; - case FUNIT_DEGREE : break; - case FUNIT_SECOND : break; - case FUNIT_MILLISECOND : break; - } // switch - rnKomma=nKomma; - rbMetr=bMetr; - rbInch=bInch; -} void SdrFormatter::Undirty() { @@ -732,16 +697,8 @@ void SdrFormatter::Undirty() long nMul1,nDiv1,nMul2,nDiv2; short nKomma1,nKomma2; // first: normalize to m or in - if (!bSrcFU) { - GetMeterOrInch(eSrcMU,nKomma1,nMul1,nDiv1,bSrcMetr,bSrcInch); - } else { - GetMeterOrInch(eSrcFU,nKomma1,nMul1,nDiv1,bSrcMetr,bSrcInch); - } - if (!bDstFU) { - GetMeterOrInch(eDstMU,nKomma2,nMul2,nDiv2,bDstMetr,bDstInch); - } else { - GetMeterOrInch(eDstFU,nKomma2,nMul2,nDiv2,bDstMetr,bDstInch); - } + GetMeterOrInch(eSrcMU,nKomma1,nMul1,nDiv1,bSrcMetr,bSrcInch); + GetMeterOrInch(eDstMU,nKomma2,nMul2,nDiv2,bDstMetr,bDstInch); nMul1*=nDiv2; nDiv1*=nMul2; nKomma1=nKomma1-nKomma2; |