summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-06-27 15:08:50 +0200
committerNoel Grandin <noelgrandin@gmail.com>2016-06-28 11:21:17 +0000
commit48a8d6d8434908690bc2a51d27f1051bd550c9b0 (patch)
tree066f8fc9753bdba62f87f205baface6e729857bf /tools
parentf7d6f3e4e3fda3cd4936880918e2831246634a3e (diff)
loplugin:singlevalfields in various
Change-Id: Ia0d8f463a4dba9ec63aa0159441e3e607dd3bf5e Reviewed-on: https://gerrit.libreoffice.org/26738 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/source/generic/b3dtrans.cxx99
-rw-r--r--tools/source/generic/config.cxx2
2 files changed, 21 insertions, 80 deletions
diff --git a/tools/source/generic/b3dtrans.cxx b/tools/source/generic/b3dtrans.cxx
index f4a0920fe93b..3d0d977cc9ef 100644
--- a/tools/source/generic/b3dtrans.cxx
+++ b/tools/source/generic/b3dtrans.cxx
@@ -145,7 +145,6 @@ void B3dTransformationSet::Reset()
mfNearBound = 0.001;
mfFarBound = 1.001;
- meRatio = Base3DRatioGrow;
mfRatio = 0.0;
maViewportRectangle = Rectangle(-1, -1, 2, 2);
@@ -155,7 +154,6 @@ void B3dTransformationSet::Reset()
mbProjectionValid = false;
mbObjectToDeviceValid = false;
- mbWorldToViewValid = false;
CalcViewport();
}
@@ -173,9 +171,7 @@ void B3dTransformationSet::SetOrientation(const basegfx::B3DPoint& rVRP, const b
maOrientation.identity();
Orientation(maOrientation, rVRP, rVPN, rVUP);
- mbInvTransObjectToEyeValid = false;
mbObjectToDeviceValid = false;
- mbWorldToViewValid = false;
PostSetOrientation();
}
@@ -209,7 +205,6 @@ void B3dTransformationSet::PostSetProjection()
// invalidate dependent matrices
mbObjectToDeviceValid = false;
- mbWorldToViewValid = false;
}
/// Transformations for viewport
@@ -234,57 +229,20 @@ void B3dTransformationSet::CalcViewport()
fActRatio = fBoundHeight / fBoundWidth;
// FIXME else in this case has a lot of problems, should this return.
- switch(meRatio)
+ // scale down larger part
+ if(fActRatio > mfRatio)
{
- case Base3DRatioShrink :
- {
- // Dilate smaller part
- if(fActRatio > mfRatio)
- {
- // enlarge X
- fFactor = 1.0 / fActRatio;
- fRight *= fFactor;
- fLeft *= fFactor;
- }
- else
- {
- // enlarge Y
- fFactor = fActRatio;
- fTop *= fFactor;
- fBottom *= fFactor;
- }
- break;
- }
- case Base3DRatioGrow :
- {
- // scale down larger part
- if(fActRatio > mfRatio)
- {
- // scale down Y
- fFactor = fActRatio;
- fTop *= fFactor;
- fBottom *= fFactor;
- }
- else
- {
- // scale down X
- fFactor = 1.0 / fActRatio;
- fRight *= fFactor;
- fLeft *= fFactor;
- }
- break;
- }
- case Base3DRatioMiddle :
- {
- // averaging
- fFactor = ((1.0 / fActRatio) + 1.0) / 2.0;
- fRight *= fFactor;
- fLeft *= fFactor;
- fFactor = (fActRatio + 1.0) / 2.0;
- fTop *= fFactor;
- fBottom *= fFactor;
- break;
- }
+ // scale down Y
+ fFactor = fActRatio;
+ fTop *= fFactor;
+ fBottom *= fFactor;
+ }
+ else
+ {
+ // scale down X
+ fFactor = 1.0 / fActRatio;
+ fRight *= fFactor;
+ fLeft *= fFactor;
}
}
@@ -335,7 +293,6 @@ void B3dTransformationSet::SetRatio(double fNew)
mfRatio = fNew;
mbProjectionValid = false;
mbObjectToDeviceValid = false;
- mbWorldToViewValid = false;
}
}
@@ -350,7 +307,6 @@ void B3dTransformationSet::SetDeviceRectangle(double fL, double fR, double fB, d
mbProjectionValid = false;
mbObjectToDeviceValid = false;
- mbWorldToViewValid = false;
// Broadcast changes
DeviceRectangleChange();
@@ -368,7 +324,6 @@ void B3dTransformationSet::SetPerspective(bool bNew)
mbPerspective = bNew;
mbProjectionValid = false;
mbObjectToDeviceValid = false;
- mbWorldToViewValid = false;
}
}
@@ -381,7 +336,6 @@ void B3dTransformationSet::SetViewportRectangle(Rectangle& rRect, Rectangle& rVi
mbProjectionValid = false;
mbObjectToDeviceValid = false;
- mbWorldToViewValid = false;
}
}
@@ -448,8 +402,7 @@ B3dCamera::B3dCamera(
aCorrectedPosition(rPos),
aLookAt(rLkAt),
fFocalLength(fFocLen),
- fBankAngle(fBnkAng),
- bUseFocalLength(false)
+ fBankAngle(fBnkAng)
{
CalcNewViewportValues();
}
@@ -506,23 +459,13 @@ bool B3dCamera::CalcFocalLength()
double fWidth = GetDeviceRectangleWidth();
bool bRetval = false;
- if(bUseFocalLength)
- {
- // Update position if focal length changes
- aCorrectedPosition = basegfx::B3DPoint(0.0, 0.0, fFocalLength * fWidth / 35.0);
- aCorrectedPosition = EyeToWorldCoor(aCorrectedPosition);
- bRetval = true;
- }
- else
- {
- // Adjust focal length based on given position
- basegfx::B3DPoint aOldPosition;
- aOldPosition = WorldToEyeCoor(aOldPosition);
- if(fWidth != 0.0)
- fFocalLength = aOldPosition.getZ() / fWidth * 35.0;
- if(fFocalLength < 5.0)
- fFocalLength = 5.0;
- }
+ // Adjust focal length based on given position
+ basegfx::B3DPoint aOldPosition;
+ aOldPosition = WorldToEyeCoor(aOldPosition);
+ if(fWidth != 0.0)
+ fFocalLength = aOldPosition.getZ() / fWidth * 35.0;
+ if(fFocalLength < 5.0)
+ fFocalLength = 5.0;
return bRetval;
}
diff --git a/tools/source/generic/config.cxx b/tools/source/generic/config.cxx
index 621a5451b5d8..ab7c6234c557 100644
--- a/tools/source/generic/config.cxx
+++ b/tools/source/generic/config.cxx
@@ -57,7 +57,6 @@ struct ImplConfigData
sal_uIntPtr mnDataUpdateId;
sal_uIntPtr mnTimeStamp;
LineEnd meLineEnd;
- sal_uInt16 mnRefCount;
bool mbModified;
bool mbRead;
bool mbIsUTF8BOM;
@@ -588,7 +587,6 @@ static ImplConfigData* ImplGetConfigData( const OUString& rFileName )
pData->mpFirstGroup = nullptr;
pData->mnDataUpdateId = 0;
pData->meLineEnd = LINEEND_CRLF;
- pData->mnRefCount = 0;
pData->mbRead = false;
pData->mbIsUTF8BOM = false;
ImplReadConfig( pData );