diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-08-06 12:47:09 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-08-06 14:20:06 +0200 |
commit | bfc298d02ca6275588d5897d97ced9498a3e91aa (patch) | |
tree | 45f290e8a753a2e382b940ed7f3c43b2bac959cd /svx/source/svdraw/svdotext.cxx | |
parent | ee9cb297c583cb5a2e6ed388af31fffc79f282ca (diff) |
loplugin:flatten in svx/svdraw
Change-Id: I8379e5ebaee2090d2b4dbd05d55b55000915cd7c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100233
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx/source/svdraw/svdotext.cxx')
-rw-r--r-- | svx/source/svdraw/svdotext.cxx | 94 |
1 files changed, 47 insertions, 47 deletions
diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx index e43fdedae0cf..1d4ae9094aa5 100644 --- a/svx/source/svdraw/svdotext.cxx +++ b/svx/source/svdraw/svdotext.cxx @@ -1173,18 +1173,18 @@ void SdrTextObj::ImpSetupDrawOutlinerForPaint( bool bContourFrame, TakeTextRect(rOutliner, rTextRect, false, &rAnchorRect); rPaintRect = rTextRect; - if (!bContourFrame) + if (bContourFrame) + return; + + // FitToSize can't be used together with ContourFrame for now + if (IsFitToSize()) { - // FitToSize can't be used together with ContourFrame for now - if (IsFitToSize()) - { - ImpSetCharStretching(rOutliner,rTextRect.GetSize(),rAnchorRect.GetSize(),rFitXCorrection); - rPaintRect=rAnchorRect; - } - else if (IsAutoFit()) - { - ImpAutoFitText(rOutliner); - } + ImpSetCharStretching(rOutliner,rTextRect.GetSize(),rAnchorRect.GetSize(),rFitXCorrection); + rPaintRect=rAnchorRect; + } + else if (IsAutoFit()) + { + ImpAutoFitText(rOutliner); } } @@ -1400,28 +1400,28 @@ void SdrTextObj::NbcSetOutlinerParaObjectForText( std::unique_ptr<OutlinerParaOb void SdrTextObj::NbcReformatText() { SdrText* pText = getActiveText(); - if( pText && pText->GetOutlinerParaObject() ) + if( !(pText && pText->GetOutlinerParaObject()) ) + return; + + pText->ReformatText(); + if (bTextFrame) { - pText->ReformatText(); - if (bTextFrame) - { - NbcAdjustTextFrameWidthAndHeight(); - } - else - { - // the SnapRect keeps its size - SetBoundRectDirty(); - SetRectsDirty(true); - } - SetTextSizeDirty(); - ActionChanged(); - // i22396 - // Necessary here since we have no compare operator at the outliner - // para object which may detect changes regarding the combination - // of outliner para data and configuration (e.g., change of - // formatting of text numerals) - GetViewContact().flushViewObjectContacts(false); + NbcAdjustTextFrameWidthAndHeight(); } + else + { + // the SnapRect keeps its size + SetBoundRectDirty(); + SetRectsDirty(true); + } + SetTextSizeDirty(); + ActionChanged(); + // i22396 + // Necessary here since we have no compare operator at the outliner + // para object which may detect changes regarding the combination + // of outliner para data and configuration (e.g., change of + // formatting of text numerals) + GetViewContact().flushViewObjectContacts(false); } SdrObjGeoData* SdrTextObj::NewGeoData() const @@ -1852,23 +1852,23 @@ void SdrTextObj::onEditOutlinerStatusEvent( EditStatus* pEditStatus ) const EditStatusFlags nStat = pEditStatus->GetStatusWord(); const bool bGrowX = bool(nStat & EditStatusFlags::TEXTWIDTHCHANGED); const bool bGrowY = bool(nStat & EditStatusFlags::TextHeightChanged); - if(bTextFrame && (bGrowX || bGrowY)) + if(!(bTextFrame && (bGrowX || bGrowY))) + return; + + if ((bGrowX && IsAutoGrowWidth()) || (bGrowY && IsAutoGrowHeight())) { - if ((bGrowX && IsAutoGrowWidth()) || (bGrowY && IsAutoGrowHeight())) - { - AdjustTextFrameWidthAndHeight(); - } - else if ( (IsAutoFit() || IsFitToSize()) && !mbInDownScale) - { - assert(pEdtOutl); - mbInDownScale = true; - - // sucks that we cannot disable paints via - // pEdtOutl->SetUpdateMode(FALSE) - but EditEngine skips - // formatting as well, then. - ImpAutoFitText(*pEdtOutl); - mbInDownScale = false; - } + AdjustTextFrameWidthAndHeight(); + } + else if ( (IsAutoFit() || IsFitToSize()) && !mbInDownScale) + { + assert(pEdtOutl); + mbInDownScale = true; + + // sucks that we cannot disable paints via + // pEdtOutl->SetUpdateMode(FALSE) - but EditEngine skips + // formatting as well, then. + ImpAutoFitText(*pEdtOutl); + mbInDownScale = false; } } |