diff options
author | Sahil Gautam <sahil@libreoffice.org> | 2024-06-18 08:51:36 +0000 |
---|---|---|
committer | Heiko Tietze <heiko.tietze@documentfoundation.org> | 2024-06-19 15:38:27 +0200 |
commit | 86cd6036273a9031212e131141c03ed4e16e011b (patch) | |
tree | f96515f4b56a99778fc569e9195fa7854e65a763 | |
parent | b344a611d7636d4fdf8cf221fb7b8bcfdcdb6824 (diff) |
tdf#159543 - Proper feedback needed when resizing a frame...
When autosize (a frame property) is enabled, then the (text) frame
manages it's height/width based on the content such that all the text
is visible. The user cannot decrease the height/width to be less than
the content height/width, but the resize handles show up, and clicking and
dragging is enabled, which shows a blue virtual resize frame.
This patch adds UI feedback mechanism such that if the drag leads
to some change in any dimention of the original frame, then the
frame color will remain blue, otherwise it turns red.
Change-Id: Id4b3e3ae2c9864154e6028ca03008261bbc3e1b8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165817
Tested-by: Jenkins
Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
-rw-r--r-- | chart2/source/controller/main/DragMethod_RotateDiagram.cxx | 2 | ||||
-rw-r--r-- | chart2/source/controller/main/DragMethod_RotateDiagram.hxx | 2 | ||||
-rw-r--r-- | include/svx/svddrgmt.hxx | 14 | ||||
-rw-r--r-- | include/svx/svddrgv.hxx | 2 | ||||
-rw-r--r-- | include/svx/svdedtv.hxx | 1 | ||||
-rw-r--r-- | include/svx/svdobj.hxx | 1 | ||||
-rw-r--r-- | svx/inc/dragmt3d.hxx | 2 | ||||
-rw-r--r-- | svx/source/engine3d/dragmt3d.cxx | 2 | ||||
-rw-r--r-- | svx/source/svdraw/svddrgmt.cxx | 33 | ||||
-rw-r--r-- | svx/source/svdraw/svddrgv.cxx | 4 | ||||
-rw-r--r-- | svx/source/svdraw/svdedtv1.cxx | 9 | ||||
-rw-r--r-- | svx/source/svdraw/svdobj.cxx | 5 | ||||
-rw-r--r-- | sw/source/core/draw/dflyobj.cxx | 7 | ||||
-rw-r--r-- | sw/source/core/inc/dflyobj.hxx | 1 | ||||
-rw-r--r-- | sw/source/core/inc/flyfrm.hxx | 1 | ||||
-rw-r--r-- | sw/source/core/layout/fly.cxx | 67 |
16 files changed, 128 insertions, 25 deletions
diff --git a/chart2/source/controller/main/DragMethod_RotateDiagram.cxx b/chart2/source/controller/main/DragMethod_RotateDiagram.cxx index 6e496dbe1c4e..c7bac7c33749 100644 --- a/chart2/source/controller/main/DragMethod_RotateDiagram.cxx +++ b/chart2/source/controller/main/DragMethod_RotateDiagram.cxx @@ -173,7 +173,7 @@ bool DragMethod_RotateDiagram::EndSdrDrag(bool /*bCopy*/) } void DragMethod_RotateDiagram::CreateOverlayGeometry( sdr::overlay::OverlayManager& rOverlayManager, - const sdr::contact::ObjectContact& rObjectContact) + const sdr::contact::ObjectContact& rObjectContact, bool /* bIsGeometrySizeValid */) { ::basegfx::B3DHomMatrix aCurrentTransform; aCurrentTransform.translate( -FIXED_SIZE_FOR_3D_CHART_VOLUME/2.0, diff --git a/chart2/source/controller/main/DragMethod_RotateDiagram.hxx b/chart2/source/controller/main/DragMethod_RotateDiagram.hxx index 69e9050eeb4e..d50fb42354ea 100644 --- a/chart2/source/controller/main/DragMethod_RotateDiagram.hxx +++ b/chart2/source/controller/main/DragMethod_RotateDiagram.hxx @@ -54,7 +54,7 @@ public: virtual void CreateOverlayGeometry( sdr::overlay::OverlayManager& rOverlayManager, - const sdr::contact::ObjectContact& rObjectContact) override; + const sdr::contact::ObjectContact& rObjectContact, bool bIsGeometrySizeValid=true) override; private: E3dScene* m_pScene; diff --git a/include/svx/svddrgmt.hxx b/include/svx/svddrgmt.hxx index 5b01852ea363..58639bc85df5 100644 --- a/include/svx/svddrgmt.hxx +++ b/include/svx/svddrgmt.hxx @@ -41,7 +41,7 @@ public: SdrDragEntry(); virtual ~SdrDragEntry(); - virtual drawinglayer::primitive2d::Primitive2DContainer createPrimitive2DSequenceInCurrentState(SdrDragMethod& rDragMethod) = 0; + virtual drawinglayer::primitive2d::Primitive2DContainer createPrimitive2DSequenceInCurrentState(SdrDragMethod& rDragMethod, bool IsDragSizeValid=true) = 0; // data read access bool getAddToTransparent() const { return mbAddToTransparent; } @@ -57,7 +57,7 @@ public: SdrDragEntryPolyPolygon(basegfx::B2DPolyPolygon aOriginalPolyPolygon); virtual ~SdrDragEntryPolyPolygon() override; - virtual drawinglayer::primitive2d::Primitive2DContainer createPrimitive2DSequenceInCurrentState(SdrDragMethod& rDragMethod) override; + virtual drawinglayer::primitive2d::Primitive2DContainer createPrimitive2DSequenceInCurrentState(SdrDragMethod& rDragMethod, bool IsDragSizeValid=true) override; }; @@ -80,7 +80,7 @@ public: const SdrObject& getOriginal() const { return maOriginal; } SdrObject* getClone() { return mxClone.get(); } - virtual drawinglayer::primitive2d::Primitive2DContainer createPrimitive2DSequenceInCurrentState(SdrDragMethod& rDragMethod) override; + virtual drawinglayer::primitive2d::Primitive2DContainer createPrimitive2DSequenceInCurrentState(SdrDragMethod& rDragMethod, bool IsDragSizeValid=true) override; }; @@ -93,7 +93,7 @@ public: SdrDragEntryPrimitive2DSequence(drawinglayer::primitive2d::Primitive2DContainer&& rSequence); virtual ~SdrDragEntryPrimitive2DSequence() override; - virtual drawinglayer::primitive2d::Primitive2DContainer createPrimitive2DSequenceInCurrentState(SdrDragMethod& rDragMethod) override; + virtual drawinglayer::primitive2d::Primitive2DContainer createPrimitive2DSequenceInCurrentState(SdrDragMethod& rDragMethod, bool IsDragSizeValid=true) override; }; @@ -107,7 +107,7 @@ public: SdrDragEntryPointGlueDrag(std::vector< basegfx::B2DPoint >&& rPositions, bool bIsPointDrag); virtual ~SdrDragEntryPointGlueDrag() override; - virtual drawinglayer::primitive2d::Primitive2DContainer createPrimitive2DSequenceInCurrentState(SdrDragMethod& rDragMethod) override; + virtual drawinglayer::primitive2d::Primitive2DContainer createPrimitive2DSequenceInCurrentState(SdrDragMethod& rDragMethod, bool IsDragSizeValid=true) override; }; @@ -190,7 +190,7 @@ public: // #i58950# virtual destructor was missing virtual ~SdrDragMethod(); - void Show(); + void Show(bool IsValidSize=true); void Hide(); bool IsShiftPressed() const { return mbShiftPressed; } void SetShiftPressed(bool bShiftPressed) { mbShiftPressed = bShiftPressed; } @@ -203,7 +203,7 @@ public: virtual void CreateOverlayGeometry( sdr::overlay::OverlayManager& rOverlayManager, - const sdr::contact::ObjectContact& rObjectContact); + const sdr::contact::ObjectContact& rObjectContact, bool bIsGeometrySizeValid=true); SAL_DLLPRIVATE void destroyOverlayGeometry(); virtual basegfx::B2DHomMatrix getCurrentTransformation() const; diff --git a/include/svx/svddrgv.hxx b/include/svx/svddrgv.hxx index a717cdbf3f0f..ee91134bdc5f 100644 --- a/include/svx/svddrgv.hxx +++ b/include/svx/svddrgv.hxx @@ -62,7 +62,7 @@ protected: protected: virtual void SetMarkHandles(SfxViewShell* pOtherShell) override; - SAL_DLLPRIVATE void ShowDragObj(); + SAL_DLLPRIVATE void ShowDragObj(bool IsSizeValid=true); SAL_DLLPRIVATE void HideDragObj(); bool ImpBegInsObjPoint(bool bIdxZwang, const Point& rPnt, bool bNewObj, OutputDevice* pOut); diff --git a/include/svx/svdedtv.hxx b/include/svx/svdedtv.hxx index 56fcfacaaaeb..7d7670048a59 100644 --- a/include/svx/svdedtv.hxx +++ b/include/svx/svdedtv.hxx @@ -235,6 +235,7 @@ public: void SetMarkedObjRect(const tools::Rectangle& rRect); void MoveMarkedObj(const Size& rSiz, bool bCopy=false); void ResizeMarkedObj(const Point& rRef, const Fraction& xFact, const Fraction& yFact, bool bCopy=false); + bool IsMarkedObjSizeValid(Size& aTargetSize); SAL_DLLPRIVATE void ResizeMultMarkedObj(const Point& rRef, const Fraction& xFact, const Fraction& yFact, const bool bWdh, const bool bHgt); SAL_DLLPRIVATE Degree100 GetMarkedObjRotate() const; void RotateMarkedObj(const Point& rRef, Degree100 nAngle, bool bCopy=false); diff --git a/include/svx/svdobj.hxx b/include/svx/svdobj.hxx index 1dd8dd52eb59..8dd17bdc00f5 100644 --- a/include/svx/svdobj.hxx +++ b/include/svx/svdobj.hxx @@ -523,6 +523,7 @@ public: /// Nbc means "no broadcast". virtual void NbcMove (const Size& rSiz); virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact); + virtual bool IsSizeValid(Size aTargetSize); virtual void NbcCrop (const basegfx::B2DPoint& rRef, double fxFact, double fyFact); virtual void NbcRotate(const Point& rRef, Degree100 nAngle, double sn, double cs) = 0; // Utility for call sites that don't have sin and cos handy diff --git a/svx/inc/dragmt3d.hxx b/svx/inc/dragmt3d.hxx index 879dd6019ed1..466e207fbf09 100644 --- a/svx/inc/dragmt3d.hxx +++ b/svx/inc/dragmt3d.hxx @@ -78,7 +78,7 @@ public: // for migration from XOR to overlay virtual void CreateOverlayGeometry( sdr::overlay::OverlayManager& rOverlayManager, - const sdr::contact::ObjectContact& rObjectContact) override; + const sdr::contact::ObjectContact& rObjectContact, bool IsGeometrySizeValid=true) override; }; // Derivative of SdrDragMethod for spinning 3D objects diff --git a/svx/source/engine3d/dragmt3d.cxx b/svx/source/engine3d/dragmt3d.cxx index d76eb48ab921..2c5147321ae6 100644 --- a/svx/source/engine3d/dragmt3d.cxx +++ b/svx/source/engine3d/dragmt3d.cxx @@ -214,7 +214,7 @@ void E3dDragMethod::MoveSdrDrag(const Point& /*rPnt*/) // for migration from XOR to overlay void E3dDragMethod::CreateOverlayGeometry( sdr::overlay::OverlayManager& rOverlayManager, - const sdr::contact::ObjectContact& rObjectContact) + const sdr::contact::ObjectContact& rObjectContact, bool /* bIsGeometrySizeValid */) { // We do client-side object manipulation with the Kit API if (comphelper::LibreOfficeKit::isActive()) diff --git a/svx/source/svdraw/svddrgmt.cxx b/svx/source/svdraw/svddrgmt.cxx index 369559233843..6ae713bba303 100644 --- a/svx/source/svdraw/svddrgmt.cxx +++ b/svx/source/svdraw/svddrgmt.cxx @@ -92,7 +92,7 @@ SdrDragEntryPolyPolygon::~SdrDragEntryPolyPolygon() { } -drawinglayer::primitive2d::Primitive2DContainer SdrDragEntryPolyPolygon::createPrimitive2DSequenceInCurrentState(SdrDragMethod& rDragMethod) +drawinglayer::primitive2d::Primitive2DContainer SdrDragEntryPolyPolygon::createPrimitive2DSequenceInCurrentState(SdrDragMethod& rDragMethod, bool IsDragSizeValid) { drawinglayer::primitive2d::Primitive2DContainer aRetval; @@ -118,9 +118,13 @@ drawinglayer::primitive2d::Primitive2DContainer SdrDragEntryPolyPolygon::createP aColB, fStripeLength); - const basegfx::BColor aHilightColor(SvtOptionsDrawinglayer::getHilightColor().getBColor()); - const double fTransparence(SvtOptionsDrawinglayer::GetTransparentSelectionPercent() * 0.01); + basegfx::BColor aHilightColor; + if (IsDragSizeValid) + aHilightColor = SvtOptionsDrawinglayer::getHilightColor().getBColor(); + else + aHilightColor = basegfx::BColor(1.0, 0, 0); + const double fTransparence(SvtOptionsDrawinglayer::GetTransparentSelectionPercent() * 0.01); aRetval[1] = new drawinglayer::primitive2d::PolyPolygonSelectionPrimitive2D( std::move(aCopy), aHilightColor, @@ -164,7 +168,7 @@ void SdrDragEntrySdrObject::prepareCurrentState(SdrDragMethod& rDragMethod) } } -drawinglayer::primitive2d::Primitive2DContainer SdrDragEntrySdrObject::createPrimitive2DSequenceInCurrentState(SdrDragMethod&) +drawinglayer::primitive2d::Primitive2DContainer SdrDragEntrySdrObject::createPrimitive2DSequenceInCurrentState(SdrDragMethod&, bool /* IsDragSizeValid */) { const SdrObject* pSource = &maOriginal; @@ -194,7 +198,7 @@ SdrDragEntryPrimitive2DSequence::~SdrDragEntryPrimitive2DSequence() { } -drawinglayer::primitive2d::Primitive2DContainer SdrDragEntryPrimitive2DSequence::createPrimitive2DSequenceInCurrentState(SdrDragMethod& rDragMethod) +drawinglayer::primitive2d::Primitive2DContainer SdrDragEntryPrimitive2DSequence::createPrimitive2DSequenceInCurrentState(SdrDragMethod& rDragMethod, bool /* IsDragSizeValid */) { return drawinglayer::primitive2d::Primitive2DContainer { new drawinglayer::primitive2d::TransformPrimitive2D( @@ -215,7 +219,7 @@ SdrDragEntryPointGlueDrag::~SdrDragEntryPointGlueDrag() { } -drawinglayer::primitive2d::Primitive2DContainer SdrDragEntryPointGlueDrag::createPrimitive2DSequenceInCurrentState(SdrDragMethod& rDragMethod) +drawinglayer::primitive2d::Primitive2DContainer SdrDragEntryPointGlueDrag::createPrimitive2DSequenceInCurrentState(SdrDragMethod& rDragMethod, bool /* IsDragSizeValid */) { drawinglayer::primitive2d::Primitive2DContainer aRetval; @@ -647,9 +651,9 @@ SdrDragMethod::~SdrDragMethod() clearSdrDragEntries(); } -void SdrDragMethod::Show() +void SdrDragMethod::Show(bool IsValidSize) { - getSdrDragView().ShowDragObj(); + getSdrDragView().ShowDragObj(IsValidSize); } void SdrDragMethod::Hide() @@ -671,7 +675,7 @@ typedef std::map< const SdrObject*, SdrObject* > SdrObjectAndCloneMap; void SdrDragMethod::CreateOverlayGeometry( sdr::overlay::OverlayManager& rOverlayManager, - const sdr::contact::ObjectContact& rObjectContact) + const sdr::contact::ObjectContact& rObjectContact, bool bIsGeometrySizeValid) { // We do client-side object manipulation with the Kit API if (comphelper::LibreOfficeKit::isActive()) @@ -754,7 +758,8 @@ void SdrDragMethod::CreateOverlayGeometry( for(auto & pCandidate: maSdrDragEntries) { - const drawinglayer::primitive2d::Primitive2DContainer aCandidateResult(pCandidate->createPrimitive2DSequenceInCurrentState(*this)); + const drawinglayer::primitive2d::Primitive2DContainer aCandidateResult( + pCandidate->createPrimitive2DSequenceInCurrentState(*this, bIsGeometrySizeValid)); if(!aCandidateResult.empty()) { @@ -2002,7 +2007,13 @@ void SdrDragResize::MoveSdrDrag(const Point& rNoSnapPnt) DragStat().NextMove(aPnt); aXFact=aNewXFact; aYFact=aNewYFact; - Show(); + + aNewXFact = double(aNewXFact) > 0 ? aNewXFact : Fraction(1, 1); + aNewYFact = double(aNewYFact) > 0 ? aNewYFact : Fraction(1, 1); + Size aTargetSize( + GetMarkedRect().GetSize().scale(aNewXFact.GetNumerator(), aNewXFact.GetDenominator(), + aNewYFact.GetNumerator(), aNewYFact.GetDenominator())); + Show(getSdrDragView().IsMarkedObjSizeValid(aTargetSize)); } } } diff --git a/svx/source/svdraw/svddrgv.cxx b/svx/source/svdraw/svddrgv.cxx index d123e900e9c7..a8584437bb54 100644 --- a/svx/source/svdraw/svddrgv.cxx +++ b/svx/source/svdraw/svddrgv.cxx @@ -795,7 +795,7 @@ bool SdrDragView::BegInsGluePoint(const Point& rPnt) return bRet; } -void SdrDragView::ShowDragObj() +void SdrDragView::ShowDragObj(bool IsSizeValid) { if(!mpCurrentSdrDragMethod || maDragStat.IsShown()) return; @@ -823,7 +823,7 @@ void SdrDragView::ShowDragObj() { mpCurrentSdrDragMethod->CreateOverlayGeometry( *xOverlayManager, - rPageWindow.GetObjectContact()); + rPageWindow.GetObjectContact(), IsSizeValid); // #i101679# Force changed overlay to be shown xOverlayManager->flush(); diff --git a/svx/source/svdraw/svdedtv1.cxx b/svx/source/svdraw/svdedtv1.cxx index bf1cc6f9a638..6a098d3568a0 100644 --- a/svx/source/svdraw/svdedtv1.cxx +++ b/svx/source/svdraw/svdedtv1.cxx @@ -216,6 +216,15 @@ void SdrEditView::MoveMarkedObj(const Size& rSiz, bool bCopy) EndUndo(); } +bool SdrEditView::IsMarkedObjSizeValid(Size& aTargetSize) +{ + SdrMark* pM=GetMarkedObjectList().GetMark(0); + SdrObject* pO=pM->GetMarkedSdrObj(); + if (!pO->IsSizeValid(aTargetSize)) + return false; + return true; +} + void SdrEditView::ResizeMarkedObj(const Point& rRef, const Fraction& xFact, const Fraction& yFact, bool bCopy) { const bool bUndo = IsUndoEnabled(); diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx index 6de40fde7cca..a598517d6893 100644 --- a/svx/source/svdraw/svdobj.cxx +++ b/svx/source/svdraw/svdobj.cxx @@ -1471,6 +1471,11 @@ void SdrObject::NbcResize(const Point& rRef, const Fraction& xFact, const Fracti SetBoundAndSnapRectsDirty(); } +bool SdrObject::IsSizeValid(Size /* aTargetSize */) +{ + return true; +} + void SdrObject::NbcRotate(const Point& rRef, Degree100 nAngle) { if (nAngle) diff --git a/sw/source/core/draw/dflyobj.cxx b/sw/source/core/draw/dflyobj.cxx index 26254ad9e9f2..a168958d9835 100644 --- a/sw/source/core/draw/dflyobj.cxx +++ b/sw/source/core/draw/dflyobj.cxx @@ -974,6 +974,13 @@ void SwVirtFlyDrawObj::NbcCrop(const basegfx::B2DPoint& rRef, double fxFact, dou pSh->EndAllAction(); } +bool SwVirtFlyDrawObj::IsSizeValid(Size aTargetSize) +{ + SwBorderAttrAccess aAccess( SwFrame::GetCache(), GetFlyFrame() ); + const SwBorderAttrs &rAttrs = *aAccess.Get(); + return GetFlyFrame()->IsResizeValid(&rAttrs, aTargetSize); +} + void SwVirtFlyDrawObj::NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact) { const SwFrame* pTmpFrame = GetFlyFrame()->GetAnchorFrame(); diff --git a/sw/source/core/inc/dflyobj.hxx b/sw/source/core/inc/dflyobj.hxx index 701d63328923..f20f590ced64 100644 --- a/sw/source/core/inc/dflyobj.hxx +++ b/sw/source/core/inc/dflyobj.hxx @@ -116,6 +116,7 @@ public: virtual void NbcMove (const Size& rSiz) override; virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact) override; + virtual bool IsSizeValid(Size aTargetSize) override; virtual void NbcCrop(const basegfx::B2DPoint& rRef, double fxFact, double fyFact) override; virtual void Move (const Size& rSiz) override; virtual void Resize(const Point& rRef, const Fraction& xFact, diff --git a/sw/source/core/inc/flyfrm.hxx b/sw/source/core/inc/flyfrm.hxx index 2a4091b7859a..1f083dd6aca0 100644 --- a/sw/source/core/inc/flyfrm.hxx +++ b/sw/source/core/inc/flyfrm.hxx @@ -182,6 +182,7 @@ public: virtual void Paste( SwFrame* pParent, SwFrame* pSibling = nullptr ) override; #endif + bool IsResizeValid(const SwBorderAttrs *pAttrs, Size aTargetSize); SwTwips Shrink_( SwTwips, bool bTst ); SwTwips Grow_ ( SwTwips, bool bTst ); void Invalidate_( SwPageFrame const *pPage = nullptr ); diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx index 313f047ece98..8bef565a5f4f 100644 --- a/sw/source/core/layout/fly.cxx +++ b/sw/source/core/layout/fly.cxx @@ -2431,6 +2431,73 @@ SwTwips SwFlyFrame::Shrink_( SwTwips nDist, bool bTst ) return 0; } +bool SwFlyFrame::IsResizeValid(const SwBorderAttrs *pAttrs, Size aTargetSize) +{ + SwFormatFrameSize rFrameSz = GetFormat()->GetFrameSize(); + Size aFrameSize = rFrameSz.GetSize(); + bool bAutosizeHeight = !HasFixSize() && IsMinHeight(); + bool bAutosizeWidth = !m_bFormatHeightOnly && rFrameSz.GetWidthSizeType() == SwFrameSize::Minimum; + + if (!bAutosizeHeight && !bAutosizeWidth) + return true; + + bool bIsValidResize = true; + + /** + if (either AutoSizeWidth or AutoSizeHeight, not both), + if the autosize dimention goes smaller than min value and the other dimention changed + return valid + else + remember invalid + */ + tools::Long nMinFrameHeight = 0; + if (bAutosizeHeight) + { + const SwTwips nUL = pAttrs->CalcTopLine() + pAttrs->CalcBottomLine(); + rFrameSz.SetHeight(aTargetSize.Height()); + rFrameSz.SetWidth(aTargetSize.Width()); + Size aRelSize( CalcRel( rFrameSz ) ); + + tools::Long nMinHeight = 0; + SwRectFnSet aRectFnSet(this); + nMinHeight = aRectFnSet.IsVert() ? aRelSize.Width() : aRelSize.Height(); + SwTwips nRemaining = CalcContentHeight(pAttrs, nMinHeight, nUL); + nMinFrameHeight = nRemaining + nUL; + + if (nMinHeight < nMinFrameHeight) + { + bIsValidResize = false; + // if height less than minHeight and width changed when not AutoSizeWidth + if (!bAutosizeWidth && aTargetSize.Width() != aFrameSize.Width()) + return true; + } + } + + tools::Long nMinFrameWidth = 0; + if (bAutosizeWidth) + { + const SwTwips nLR = pAttrs->CalcLeftLine() + pAttrs->CalcRightLine(); + const SwTwips nAutoWidth = lcl_CalcAutoWidth( *this ); + nMinFrameWidth = nAutoWidth + nLR; + + if (aTargetSize.Width() < nMinFrameWidth) + bIsValidResize = false; + if (!bAutosizeHeight && aTargetSize.Height() != aFrameSize.Height()) + return true; + } + + // if not valid resize, and both AutoSizeWidth and AutoSizeHeight, + // then consider resize is valid if any one of the dimentions was changed from it's original size + // (the frame's dimentions), and the destination dimention is a valid one. + if (bAutosizeWidth && bAutosizeHeight && !bIsValidResize) + { + return (aTargetSize.Width() != aFrameSize.Width() && aTargetSize.Width() >= nMinFrameWidth) || + (aTargetSize.Height() != aFrameSize.Height() && aTargetSize.Height() >= nMinFrameHeight); + } + + return bIsValidResize; +} + Size SwFlyFrame::ChgSize( const Size& aNewSize ) { // #i53298# |