From 83e2c70b62226cc50b773beb375241fc0f672365 Mon Sep 17 00:00:00 2001 From: Ashod Nakashian Date: Fri, 30 Mar 2018 23:34:03 -0400 Subject: svx: sd: cosmetics Change-Id: Ic82e0b20b6e0f0ecdd308969c85c887ef84d2340 (cherry picked from commit 9510d017af8f36953bd17ac4ae4ab7768684665c) --- include/svx/svdograf.hxx | 4 +-- sd/source/filter/pdf/sdpdffilter.cxx | 2 +- sd/source/ui/view/drviews2.cxx | 4 +-- svx/source/svdraw/svdedtv.cxx | 18 ++++++++----- svx/source/svdraw/svdedtv2.cxx | 52 ++++++++++++++++-------------------- 5 files changed, 39 insertions(+), 41 deletions(-) diff --git a/include/svx/svdograf.hxx b/include/svx/svdograf.hxx index 1718b967a4c3..24f56557df1a 100644 --- a/include/svx/svdograf.hxx +++ b/include/svx/svdograf.hxx @@ -175,7 +175,7 @@ public: void StartAnimation(); virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const override; - virtual sal_uInt16 GetObjIdentifier() const override; + virtual sal_uInt16 GetObjIdentifier() const override; virtual OUString TakeObjNameSingul() const override; virtual OUString TakeObjNamePlural() const override; @@ -187,7 +187,7 @@ public: SdrGrafObj& operator=(const SdrGrafObj& rObj); virtual sal_uInt32 GetHdlCount() const override; - virtual SdrHdl* GetHdl(sal_uInt32 nHdlNum) const override; + virtual SdrHdl* GetHdl(sal_uInt32 nHdlNum) const override; virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact) override; virtual void NbcMirror(const Point& rRef1, const Point& rRef2) override; diff --git a/sd/source/filter/pdf/sdpdffilter.cxx b/sd/source/filter/pdf/sdpdffilter.cxx index 7e83356daa7c..50318a12b46f 100644 --- a/sd/source/filter/pdf/sdpdffilter.cxx +++ b/sd/source/filter/pdf/sdpdffilter.cxx @@ -111,7 +111,7 @@ bool SdPdfFilter::Import() auto pPdfData = std::make_shared>(aPdfData); mrDocument.CreateFirstPages(); - for (int i = 0; i < aBitmaps.size() - 1; ++i) + for (size_t i = 0; i < aBitmaps.size() - 1; ++i) { mrDocument.DuplicatePage(0); } diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx index e6b9b92604fa..3cd62ffb4b8d 100644 --- a/sd/source/ui/view/drviews2.cxx +++ b/sd/source/ui/view/drviews2.cxx @@ -2769,9 +2769,9 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) SdrGrafObj* pGraf= dynamic_cast< SdrGrafObj *>( pObj ); SdrOle2Obj* pOle2= dynamic_cast< SdrOle2Obj *>( pObj ); - if(pGraf) + if (pGraf != nullptr) { - if(pGraf->HasGDIMetaFile()) + if (pGraf->HasGDIMetaFile()) { nCount += pGraf->GetGraphic().GetGDIMetaFile().GetActionSize(); } diff --git a/svx/source/svdraw/svdedtv.cxx b/svx/source/svdraw/svdedtv.cxx index 980399c0d6c6..6db2aeb45d9c 100644 --- a/svx/source/svdraw/svdedtv.cxx +++ b/svx/source/svdraw/svdedtv.cxx @@ -456,9 +456,10 @@ bool SdrEditView::IsDismantlePossible(bool bMakeLines) const void SdrEditView::CheckPossibilities() { - if (mbSomeObjChgdFlag) bPossibilitiesDirty=true; + if (mbSomeObjChgdFlag) + bPossibilitiesDirty=true; - if(mbSomeObjChgdFlag) + if (mbSomeObjChgdFlag) { // This call IS necessary to correct the MarkList, in which // no longer to the model belonging objects still can reside. @@ -466,17 +467,20 @@ void SdrEditView::CheckPossibilities() CheckMarked(); } - if (bPossibilitiesDirty) { + if (bPossibilitiesDirty) + { ImpResetPossibilityFlags(); SortMarkedObjects(); - const size_t nMarkCount=GetMarkedObjectCount(); - if (nMarkCount!=0) { - bReverseOrderPossible=nMarkCount>=2; + const size_t nMarkCount = GetMarkedObjectCount(); + if (nMarkCount != 0) + { + bReverseOrderPossible = (nMarkCount >= 2); size_t nMovableCount=0; bGroupPossible=nMarkCount>=2; bCombinePossible=nMarkCount>=2; - if (nMarkCount==1) { + if (nMarkCount==1) + { // check bCombinePossible more thoroughly // still missing ... const SdrObject* pObj=GetMarkedObjectByIndex(0); diff --git a/svx/source/svdraw/svdedtv2.cxx b/svx/source/svdraw/svdedtv2.cxx index 7f1f061527d1..8d2fe58b611a 100644 --- a/svx/source/svdraw/svdedtv2.cxx +++ b/svx/source/svdraw/svdedtv2.cxx @@ -2021,15 +2021,14 @@ void SdrEditView::DoImportMarkedMtf(SvdProgressInfo *pProgrInfo) SortMarkedObjects(); SdrMarkList aForTheDescription; SdrMarkList aNewMarked; - const size_t nCount=GetMarkedObjectCount(); - - for (size_t nm=nCount; nm>0;) - { // create Undo objects for all new objects + for (size_t nm =GetMarkedObjectCount(); nm > 0; ) + { + // create Undo objects for all new objects // check for cancellation between the metafiles - if( pProgrInfo != nullptr ) + if (pProgrInfo != nullptr) { pProgrInfo->SetNextObject(); - if(!pProgrInfo->ReportActions(0)) + if (!pProgrInfo->ReportActions(0)) break; } @@ -2047,77 +2046,72 @@ void SdrEditView::DoImportMarkedMtf(SvdProgressInfo *pProgrInfo) if (pGraf && (pGraf->HasGDIMetaFile() || pGraf->isEmbeddedVectorGraphicData())) { GDIMetaFile aMetaFile(GetMetaFile(pGraf)); - if(aMetaFile.GetActionSize()) + if (aMetaFile.GetActionSize()) { aLogicRect = pGraf->GetLogicRect(); ImpSdrGDIMetaFileImport aFilter(*mpModel, pObj->GetLayer(), aLogicRect); nInsAnz = aFilter.DoImport(aMetaFile, *pOL, nInsPos, pProgrInfo); } } - if ( pOle2!=nullptr && pOle2->GetGraphic() ) + + if (pOle2 != nullptr && pOle2->GetGraphic()) { aLogicRect = pOle2->GetLogicRect(); ImpSdrGDIMetaFileImport aFilter(*mpModel, pObj->GetLayer(), aLogicRect); nInsAnz = aFilter.DoImport(pOle2->GetGraphic()->GetGDIMetaFile(), *pOL, nInsPos, pProgrInfo); } - if (nInsAnz!=0) + + if (nInsAnz != 0) { // transformation GeoStat aGeoStat(pGraf ? pGraf->GetGeoStat() : pOle2->GetGeoStat()); - size_t nObj=nInsPos; + size_t nObj = nInsPos; - if(aGeoStat.nShearAngle) - { + if (aGeoStat.nShearAngle) aGeoStat.RecalcTan(); - } - if(aGeoStat.nRotationAngle) - { + if (aGeoStat.nRotationAngle) aGeoStat.RecalcSinCos(); - } - for (sal_uIntPtr i=0; iGetSdrUndoFactory().CreateUndoNewObject(*pOL->GetObj(nObj))); // update new MarkList SdrObject* pCandidate = pOL->GetObj(nObj); // apply original transformation - if(aGeoStat.nShearAngle) - { + if (aGeoStat.nShearAngle) pCandidate->NbcShear(aLogicRect.TopLeft(), aGeoStat.nShearAngle, aGeoStat.nTan, false); - } - if(aGeoStat.nRotationAngle) - { + if (aGeoStat.nRotationAngle) pCandidate->NbcRotate(aLogicRect.TopLeft(), aGeoStat.nRotationAngle, aGeoStat.nSin, aGeoStat.nCos); - } SdrMark aNewMark(pCandidate, pPV); aNewMarked.InsertEntry(aNewMark); nObj++; } + aForTheDescription.InsertEntry(*pM); - if( bUndo ) + if (bUndo) AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoDeleteObject(*pObj)); // remove object from selection and delete GetMarkedObjectListWriteAccess().DeleteMark(TryToFindMarkedObject(pObj)); pOL->RemoveObject(nInsPos-1); - if( !bUndo ) + if (!bUndo) SdrObject::Free(pObj); } } - if(aNewMarked.GetMarkCount()) + if (aNewMarked.GetMarkCount()) { // create new selection - for(size_t a = 0; a < aNewMarked.GetMarkCount(); ++a) + for (size_t a = 0; a < aNewMarked.GetMarkCount(); ++a) { GetMarkedObjectListWriteAccess().InsertEntry(*aNewMarked.GetMark(a)); } @@ -2125,7 +2119,7 @@ void SdrEditView::DoImportMarkedMtf(SvdProgressInfo *pProgrInfo) SortMarkedObjects(); } - if( bUndo ) + if (bUndo) { SetUndoComment(SvxResId(STR_EditImportMtf),aForTheDescription.GetMarkDescription()); EndUndo(); -- cgit v1.2.3