diff options
author | Ashod Nakashian <ashod.nakashian@collabora.co.uk> | 2018-03-30 23:34:03 -0400 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2018-06-07 10:45:18 +0200 |
commit | 455878f78ef6322f8b7832ddd22b4f64a05d3756 (patch) | |
tree | 9dcaa3dba617f3373f1101ee94b430415088c42b /svx | |
parent | 7939efc7136987fad348baca2cd686a00aee73cd (diff) |
svx: sd: cosmetics
Change-Id: Ic82e0b20b6e0f0ecdd308969c85c887ef84d2340
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/svdraw/svdedtv.cxx | 18 | ||||
-rw-r--r-- | svx/source/svdraw/svdedtv2.cxx | 52 |
2 files changed, 34 insertions, 36 deletions
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; i<nInsAnz; i++) + for (sal_uIntPtr i = 0; i < nInsAnz; i++) { - if( bUndo ) + if (bUndo) AddUndo(GetModel()->GetSdrUndoFactory().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(); |