diff options
author | Jan Holesovsky <kendy@suse.cz> | 2011-04-22 15:07:40 +0200 |
---|---|---|
committer | Jan Holesovsky <kendy@suse.cz> | 2011-04-22 15:07:40 +0200 |
commit | bc3bbd2bb4b629ec612beeeeadd959a2fb6426c2 (patch) | |
tree | 230225ef40deb8214edb308a21876f642b341942 /reportdesign/source/core | |
parent | 2933795a13ec243e9bff571583df409266746164 (diff) | |
parent | 1ba7b7c30f13bc3764a338a5a90c2fc7ff09afa6 (diff) |
Merge commit 'ooo/DEV300_m106' into libreoffice-3-4
Conflicts:
dbaccess/source/core/api/CacheSet.cxx
dbaccess/source/core/api/KeySet.cxx
dbaccess/source/core/api/KeySet.hxx
dbaccess/source/core/api/OptimisticSet.hxx
dbaccess/source/core/api/RowSet.cxx
dbaccess/source/core/api/RowSetCache.cxx
dbaccess/source/core/api/query.cxx
dbaccess/source/core/dataaccess/SharedConnection.cxx
dbaccess/source/ui/app/AppController.cxx
dbaccess/source/ui/app/makefile.mk
dbaccess/source/ui/control/FieldDescControl.cxx
dbaccess/source/ui/querydesign/query.src
dbaccess/source/ui/tabledesign/TEditControl.cxx
reportdesign/source/ui/report/ReportController.cxx
reportdesign/source/ui/report/ReportSection.cxx
reportdesign/source/ui/report/SectionWindow.cxx
reportdesign/source/ui/report/StartMarker.cxx
reportdesign/source/ui/report/ViewsWindow.cxx
Diffstat (limited to 'reportdesign/source/core')
-rw-r--r-- | reportdesign/source/core/sdr/RptObject.cxx | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/reportdesign/source/core/sdr/RptObject.cxx b/reportdesign/source/core/sdr/RptObject.cxx index 4969f740c7bb..09bf34044676 100644 --- a/reportdesign/source/core/sdr/RptObject.cxx +++ b/reportdesign/source/core/sdr/RptObject.cxx @@ -1027,14 +1027,40 @@ void OOle2Obj::NbcMove( const Size& rSize ) // stop listening OObjectBase::EndListening(sal_False); + bool bPositionFixed = false; + Size aUndoSize(0,0); + bool bUndoMode = false; if ( m_xReportComponent.is() ) { OReportModel* pRptModel = static_cast<OReportModel*>(GetModel()); + if (pRptModel->GetUndoEnv().IsUndoMode()) + { + // if we are locked from outside, then we must not handle wrong moves, we are in UNDO mode + bUndoMode = true; + } OXUndoEnvironment::OUndoEnvLock aLock(pRptModel->GetUndoEnv()); - m_xReportComponent->setPositionX(m_xReportComponent->getPositionX() + rSize.A()); - m_xReportComponent->setPositionY(m_xReportComponent->getPositionY() + rSize.B()); - } + // LLA: why there exists getPositionX and getPositionY and NOT getPosition() which return a Point? + int nNewX = m_xReportComponent->getPositionX() + rSize.A(); + // can this hinder us to set components outside the area? + // if (nNewX < 0) + // { + // nNewX = 0; + // } + m_xReportComponent->setPositionX(nNewX); + int nNewY = m_xReportComponent->getPositionY() + rSize.B(); + if (nNewY < 0 && !bUndoMode) + { + aUndoSize.B() = abs(nNewY); + bPositionFixed = true; + nNewY = 0; + } + m_xReportComponent->setPositionY(nNewY); + } + if (bPositionFixed) + { + GetModel()->AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoMoveObject(*this, aUndoSize)); + } // set geometry properties SetPropsFromRect(GetLogicRect()); |