summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-04-04 14:34:07 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-04-11 09:48:10 +0200
commit49eb02f07a5af44da59008a238e828b4a9532bef (patch)
tree43c4b4eaacd79fe0bff784a4ef71f4c1080c3912 /svx
parent5823ecd54b16974ffe8821a5ae061cd0ecc4cf84 (diff)
new loplugin:unusedvariablemore
collection of heuristics to look for local variables that are never read from i.e. do not contribute to the surrounding logic This is an expensive plugin, since it walks up the parent tree, so it is off by default. Change-Id: Ib8ba292241bd16adf299e8bba4502cb473513a06 Reviewed-on: https://gerrit.libreoffice.org/52450 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/items/numfmtsh.cxx11
-rw-r--r--svx/source/svdraw/svdobj.cxx7
-rw-r--r--svx/source/svdraw/svdotextdecomposition.cxx6
3 files changed, 1 insertions, 23 deletions
diff --git a/svx/source/items/numfmtsh.cxx b/svx/source/items/numfmtsh.cxx
index 03840282e695..211347a60e53 100644
--- a/svx/source/items/numfmtsh.cxx
+++ b/svx/source/items/numfmtsh.cxx
@@ -673,7 +673,6 @@ short SvxNumberFormatShell::FillEListWithFormats_Impl( std::vector<OUString>& rL
sal_uInt16 nMyType;
sal_uInt32 nNFEntry;
- OUString aStrComment;
OUString aNewFormNInfo;
long nIndex;
@@ -687,7 +686,6 @@ short SvxNumberFormatShell::FillEListWithFormats_Impl( std::vector<OUString>& rL
if(pNumEntry==nullptr) continue;
SvNumFormatType nMyCat=pNumEntry->GetMaskedType();
- aStrComment=pNumEntry->GetComment();
CategoryToPos_Impl(nMyCat,nMyType);
aNewFormNInfo= pNumEntry->GetFormatstring();
@@ -709,7 +707,6 @@ short SvxNumberFormatShell::FillEListWithDateTime_Impl( std::vector<OUString>& r
sal_uInt16 nMyType;
sal_uInt32 nNFEntry;
- OUString aStrComment;
OUString aNewFormNInfo;
for (long nIndex = NF_DATETIME_START; nIndex <= NF_DATETIME_END; ++nIndex)
@@ -720,7 +717,6 @@ short SvxNumberFormatShell::FillEListWithDateTime_Impl( std::vector<OUString>& r
if(pNumEntry!=nullptr)
{
SvNumFormatType nMyCat=pNumEntry->GetMaskedType();
- aStrComment=pNumEntry->GetComment();
CategoryToPos_Impl(nMyCat,nMyType);
aNewFormNInfo= pNumEntry->GetFormatstring();
@@ -782,7 +778,6 @@ short SvxNumberFormatShell::FillEListWithSysCurrencys( std::vector<OUString>& rL
DBG_ASSERT( pCurFmtTable != nullptr, "unknown NumberFormat" );
sal_uInt32 nNFEntry;
- OUString aStrComment;
OUString aNewFormNInfo;
nCurCurrencyEntryPos=0;
@@ -796,7 +791,6 @@ short SvxNumberFormatShell::FillEListWithSysCurrencys( std::vector<OUString>& rL
if(pNumEntry==nullptr) continue;
SvNumFormatType nMyCat=pNumEntry->GetMaskedType();
- aStrComment=pNumEntry->GetComment();
CategoryToPos_Impl(nMyCat,nMyType);
aNewFormNInfo= pNumEntry->GetFormatstring();
@@ -835,7 +829,6 @@ short SvxNumberFormatShell::FillEListWithSysCurrencys( std::vector<OUString>& rL
if(!bUserNewCurrency &&(pNumEntry->GetType() & SvNumFormatType::DEFINED))
{
SvNumFormatType nMyCat=pNumEntry->GetMaskedType();
- aStrComment=pNumEntry->GetComment();
CategoryToPos_Impl(nMyCat,nMyType);
aNewFormNInfo= pNumEntry->GetFormatstring();
@@ -860,7 +853,6 @@ short SvxNumberFormatShell::FillEListWithUserCurrencys( std::vector<OUString>& r
DBG_ASSERT( pCurFmtTable != nullptr, "unknown NumberFormat" );
- OUString aStrComment;
OUString aNewFormNInfo;
const NfCurrencyEntry* pTmpCurrencyEntry;
@@ -918,7 +910,6 @@ short SvxNumberFormatShell::FillEListWithUserCurrencys( std::vector<OUString>& r
pNumEntry->IsAdditionalBuiltin() )
{
SvNumFormatType nMyCat=pNumEntry->GetMaskedType();
- aStrComment = pNumEntry->GetComment();
CategoryToPos_Impl(nMyCat,nMyType);
aNewFormNInfo = pNumEntry->GetFormatstring();
@@ -1050,7 +1041,6 @@ short SvxNumberFormatShell::FillEListWithUsD_Impl( std::vector<OUString>& rList,
DBG_ASSERT( pCurFmtTable != nullptr, "unknown NumberFormat" );
- OUString aStrComment;
OUString aNewFormNInfo;
bool bAdditional = (nPrivCat != CAT_USERDEFINED &&
@@ -1067,7 +1057,6 @@ short SvxNumberFormatShell::FillEListWithUsD_Impl( std::vector<OUString>& rList,
(bAdditional && pNumEntry->IsAdditionalBuiltin()) )
{
SvNumFormatType nMyCat=pNumEntry->GetMaskedType();
- aStrComment=pNumEntry->GetComment();
CategoryToPos_Impl(nMyCat,nMyType);
aNewFormNInfo= pNumEntry->GetFormatstring();
diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx
index 29b66b5cdf92..9c65c42447bb 100644
--- a/svx/source/svdraw/svdobj.cxx
+++ b/svx/source/svdraw/svdobj.cxx
@@ -1939,7 +1939,6 @@ void SdrObject::NbcApplyNotPersistAttr(const SfxItemSet& rAttr)
const tools::Rectangle& rSnap=GetSnapRect();
const tools::Rectangle& rLogic=GetLogicRect();
Point aRef1(rSnap.Center());
- Point aRef2(aRef1); aRef2.AdjustY( 1 );
const SfxPoolItem *pPoolItem=nullptr;
if (rAttr.GetItemState(SDRATTR_TRANSFORMREF1X,true,&pPoolItem)==SfxItemState::SET) {
aRef1.setX(static_cast<const SdrTransformRef1XItem*>(pPoolItem)->GetValue() );
@@ -1947,12 +1946,6 @@ void SdrObject::NbcApplyNotPersistAttr(const SfxItemSet& rAttr)
if (rAttr.GetItemState(SDRATTR_TRANSFORMREF1Y,true,&pPoolItem)==SfxItemState::SET) {
aRef1.setY(static_cast<const SdrTransformRef1YItem*>(pPoolItem)->GetValue() );
}
- if (rAttr.GetItemState(SDRATTR_TRANSFORMREF2X,true,&pPoolItem)==SfxItemState::SET) {
- aRef2.setX(static_cast<const SdrTransformRef2XItem*>(pPoolItem)->GetValue() );
- }
- if (rAttr.GetItemState(SDRATTR_TRANSFORMREF2Y,true,&pPoolItem)==SfxItemState::SET) {
- aRef2.setY(static_cast<const SdrTransformRef2YItem*>(pPoolItem)->GetValue() );
- }
tools::Rectangle aNewSnap(rSnap);
if (rAttr.GetItemState(SDRATTR_MOVEX,true,&pPoolItem)==SfxItemState::SET) {
diff --git a/svx/source/svdraw/svdotextdecomposition.cxx b/svx/source/svdraw/svdotextdecomposition.cxx
index b50736972d35..75830c864536 100644
--- a/svx/source/svdraw/svdotextdecomposition.cxx
+++ b/svx/source/svdraw/svdotextdecomposition.cxx
@@ -1124,10 +1124,6 @@ void SdrTextObj::impDecomposeStretchTextPrimitive(
double fRotate, fShearX;
rSdrStretchTextPrimitive.getTextRangeTransform().decompose(aScale, aTranslate, fRotate, fShearX);
- // use non-mirrored B2DRange aAnchorTextRange for calculations
- basegfx::B2DRange aAnchorTextRange(aTranslate);
- aAnchorTextRange.expand(aTranslate + aScale);
-
// prepare outliner
SolarMutexGuard aSolarGuard;
SdrOutliner& rOutliner = ImpGetDrawOutliner();
@@ -1174,7 +1170,7 @@ void SdrTextObj::impDecomposeStretchTextPrimitive(
const double fScaleY(fabs(aScale.getY()) / aOutlinerScale.getY());
rOutliner.SetGlobalCharStretching(static_cast<sal_Int16>(FRound(fScaleX * 100.0)), static_cast<sal_Int16>(FRound(fScaleY * 100.0)));
- // mirroring. We are now in aAnchorTextRange sizes. When mirroring in X and Y,
+ // When mirroring in X and Y,
// move the null point which was top left to bottom right.
const bool bMirrorX(basegfx::fTools::less(aScale.getX(), 0.0));
const bool bMirrorY(basegfx::fTools::less(aScale.getY(), 0.0));