diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-10-15 08:48:36 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-10-17 08:25:06 +0200 |
commit | 16690220ed6e68f2e9674a09b5008f38c5e6ed8d (patch) | |
tree | 2f830b7ac23f136585e7dc4adf5d456f4995cc99 /tools | |
parent | 86d70dc840b88ed827d6d8febaf512264009951d (diff) |
loplugin:singlevalfields
tighten up the handling of binary operators
Change-Id: I262ec57bf7142fa094d240738150a94d83fd15ee
Reviewed-on: https://gerrit.libreoffice.org/61777
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/source/generic/b3dtrans.cxx | 13 | ||||
-rw-r--r-- | tools/source/generic/config.cxx | 21 |
2 files changed, 11 insertions, 23 deletions
diff --git a/tools/source/generic/b3dtrans.cxx b/tools/source/generic/b3dtrans.cxx index f892b11a5154..99aee062eafc 100644 --- a/tools/source/generic/b3dtrans.cxx +++ b/tools/source/generic/b3dtrans.cxx @@ -21,6 +21,11 @@ #include <osl/diagnose.h> + // Near and far clipping planes +static constexpr double gfNearBound = 0.001; +static constexpr double gfFarBound = 1.001; + + // B3dTransformationSet -------------------------------------------------------- // Transformations for all 3D output @@ -142,8 +147,6 @@ void B3dTransformationSet::Reset() mfLeftBound = mfBottomBound = -1.0; mfRightBound = mfTopBound = 1.0; - mfNearBound = 0.001; - mfFarBound = 1.001; mfRatio = 0.0; @@ -250,16 +253,16 @@ void B3dTransformationSet::CalcViewport() // OpenGL needs a little more rough additional size to not let // the front face vanish. Changed from SMALL_DVALUE to 0.000001, // which is 1/10000th, comared with 1/tenth of a million from SMALL_DVALUE. - const double fDistPart((mfFarBound - mfNearBound) * 0.0001); + const double fDistPart((gfFarBound - gfNearBound) * 0.0001); // To avoid critical clipping, set Near & Far generously if(mbPerspective) { - Frustum(aNewProjection, fLeft, fRight, fBottom, fTop, mfNearBound - fDistPart, mfFarBound + fDistPart); + Frustum(aNewProjection, fLeft, fRight, fBottom, fTop, gfNearBound - fDistPart, gfFarBound + fDistPart); } else { - Ortho(aNewProjection, fLeft, fRight, fBottom, fTop, mfNearBound - fDistPart, mfFarBound + fDistPart); + Ortho(aNewProjection, fLeft, fRight, fBottom, fTop, gfNearBound - fDistPart, gfFarBound + fDistPart); } // Set to true to guarantee loop termination diff --git a/tools/source/generic/config.cxx b/tools/source/generic/config.cxx index 169f6e6455aa..a9ee7f1cc274 100644 --- a/tools/source/generic/config.cxx +++ b/tools/source/generic/config.cxx @@ -56,7 +56,6 @@ struct ImplConfigData OUString maFileName; sal_uInt32 mnDataUpdateId; sal_uInt32 mnTimeStamp; - LineEnd meLineEnd; bool mbModified; bool mbRead; bool mbIsUTF8BOM; @@ -373,22 +372,9 @@ static sal_uInt8* ImplGetConfigBuffer( const ImplConfigData* pData, sal_uInt32& sal_uInt32 nKeyLen; sal_uInt32 nLineEndLen; - if ( pData->meLineEnd == LINEEND_CR ) - { - aLineEndBuf[0] = '\r'; - nLineEndLen = 1; - } - else if ( pData->meLineEnd == LINEEND_LF ) - { - aLineEndBuf[0] = '\n'; - nLineEndLen = 1; - } - else - { - aLineEndBuf[0] = '\r'; - aLineEndBuf[1] = '\n'; - nLineEndLen = 2; - } + aLineEndBuf[0] = '\r'; + aLineEndBuf[1] = '\n'; + nLineEndLen = 2; nBufLen = 0; pGroup = pData->mpFirstGroup; @@ -584,7 +570,6 @@ static std::unique_ptr<ImplConfigData> ImplGetConfigData( const OUString& rFileN pData->maFileName = rFileName; pData->mpFirstGroup = nullptr; pData->mnDataUpdateId = 0; - pData->meLineEnd = LINEEND_CRLF; pData->mbRead = false; pData->mbIsUTF8BOM = false; ImplReadConfig( pData.get() ); |