Bugzilla – Attachment 67171 Details for
Bug 54930
EDITING Report builder: mouse-resize control allows to move top of control to out of section
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
in-progress patch
backup.patch (text/plain), 3.08 KB, created by
Lionel Elie Mamane
on 2012-09-14 15:41:01 UTC
(
hide
)
Description:
in-progress patch
Filename:
MIME Type:
Creator:
Lionel Elie Mamane
Created:
2012-09-14 15:41:01 UTC
Size:
3.08 KB
patch
obsolete
>diff --git a/reportdesign/source/core/sdr/RptObject.cxx b/reportdesign/source/core/sdr/RptObject.cxx >index 699a755..e55583b 100644 >--- a/reportdesign/source/core/sdr/RptObject.cxx >+++ b/reportdesign/source/core/sdr/RptObject.cxx >@@ -79,6 +79,8 @@ > #include "UndoEnv.hxx" > #include <algorithm> > #include <functional> >+#include <math.h> >+#include <rtl/math.hxx> > > namespace rptui > { >@@ -772,14 +774,56 @@ void OUnoObject::NbcMove( const Size& rSize ) > > //---------------------------------------------------------------------------- > >-void OUnoObject::NbcResize(const Point& rRef, const Fraction& xFract, const Fraction& yFract) >+void OUnoObject::NbcResize(const Point& rRef, const Fraction& rxFract, const Fraction& ryFract) > { > DBG_CHKTHIS( rpt_OUnoObject,NULL); >- SdrUnoObj::NbcResize( rRef, xFract, yFract ); > > // stop listening > OObjectBase::EndListening(sal_False); > >+ Fraction xFract(rxFract); >+ Fraction yFract(ryFract); >+ >+ bool bSizeFixed = false; >+ Size aUndoSize(0,0); >+ bool bUndoMode = false; >+ if ( m_xReportComponent.is() ) >+ { >+ OReportModel* pRptModel = dynamic_cast<OReportModel*>(GetModel()); >+ assert(pRptModel); >+ if (pRptModel->GetUndoEnv().IsUndoMode()) >+ { >+ // if we are locked from outside, then we must not handle wrong resizes, we are in UNDO mode >+ bUndoMode = true; >+ } >+ OXUndoEnvironment::OUndoEnvLock aLock(pRptModel->GetUndoEnv()); >+ >+ // svx/source/svdraw/ >+ Rectangle tmpRect(aRect); >+ fprintf(stderr, "Before resize aRect is (%ld, %ld, %ld, %ld)\n", aRect.Left(), aRect.Right(), aRect.Top(), aRect.Bottom()); >+ fprintf(stderr, "Before testing resize: tmpRect.Top()=%ld, yFract.Numerator=%ld, yFract.Denominator=%ld\n", tmpRect.Top(), yFract.GetNumerator(), yFract.GetDenominator()); >+ ResizeRect(tmpRect, rRef, rxFract, ryFract); >+ // long newTop = rRef.Y() + Round(((double)(aRect.Top() -rRef.Y())*yFract.GetNumerator())/xFact.GetDenominator()); >+ if ( tmpRect.Top() < 0 && !bUndoMode) >+ { >+ fprintf(stderr, "Before correcting resize: tmpRect.Top()=%ld, yFract.Numerator=%ld, yFract.Denominator=%ld\n", tmpRect.Top(), yFract.GetNumerator(), yFract.GetDenominator()); >+ aUndoSize.B() = abs(tmpRect.Top()); >+ bSizeFixed = true; >+ yFract=Fraction( rRef.Y(), rRef.Y() - aRect.Top() ); >+ tmpRect=aRect; >+ ResizeRect(tmpRect, rRef, xFract, yFract); >+ fprintf(stderr, "After correcting resize: tmpRect.Top()=%ld, yFract.Numerator=%ld, yFract.Denominator=%ld\n", tmpRect.Top(), yFract.GetNumerator(), yFract.GetDenominator()); >+ } >+ // TODO: same for Left/X >+ >+ SdrUnoObj::NbcResize( rRef, xFract, yFract ); >+ fprintf(stderr, "After resize aRect is (%ld, %ld, %ld, %ld)\n", aRect.Left(), aRect.Right(), aRect.Top(), aRect.Bottom()); >+ } >+ if (bSizeFixed) >+ { >+ GetModel()->AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoMoveObject(*this, aUndoSize)); >+ } >+ > // set geometry properties > SetPropsFromRect(GetLogicRect()); >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 54930
: 67171