summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Balland-Poirier <laurent.balland-poirier@laposte.net>2017-04-22 01:22:11 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-08-13 13:47:40 +0200
commit0b133fdb67cc56fba46ec355283144e611e8bf83 (patch)
treea6e7425efc743a73e36f603915755ea3c619ad59
parent68b0a61f7d4f89fd25b7725830b828c821da7dad (diff)
tdf#61561 Increase limitation placement and enlargement
Limit placement to +/- page size Limit enlargement to - object size/+ page size Change-Id: I180dc8dfd3ce24e917b9e0893bb640aa9995293b Reviewed-on: https://gerrit.libreoffice.org/36815 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--sd/source/ui/dlg/copydlg.cxx19
-rw-r--r--sd/uiconfig/sdraw/ui/copydlg.ui4
2 files changed, 21 insertions, 2 deletions
diff --git a/sd/source/ui/dlg/copydlg.cxx b/sd/source/ui/dlg/copydlg.cxx
index 80209f44ddf1..fc39e1b57777 100644
--- a/sd/source/ui/dlg/copydlg.cxx
+++ b/sd/source/ui/dlg/copydlg.cxx
@@ -124,6 +124,25 @@ void CopyDlg::dispose()
*/
void CopyDlg::Reset()
{
+ // Set Min/Max values
+ ::tools::Rectangle aRect = mpView->GetAllMarkedRect();
+ Size aPageSize = mpView->GetSdrPageView()->GetPage()->GetSize();
+ SetMetricValue( *m_pMtrFldMoveX, Fraction(1000000L) / maUIScale, MapUnit::Map100thMM);
+ double fScaleFactor = m_pMtrFldMoveX->GetValue()/1000000.0;
+
+ long nPageWidth = aPageSize.Width() * fScaleFactor;
+ long nPageHeight = aPageSize.Height() * fScaleFactor;
+ long nRectWidth = aRect.GetWidth() * fScaleFactor;
+ long nRectHeight = aRect.GetHeight() * fScaleFactor;
+ m_pMtrFldMoveX->SetMin( -nPageWidth );
+ m_pMtrFldMoveX->SetMax( nPageWidth );
+ m_pMtrFldMoveY->SetMin( -nPageHeight );
+ m_pMtrFldMoveY->SetMax( nPageHeight );
+ m_pMtrFldWidth->SetMin( -nRectWidth );
+ m_pMtrFldWidth->SetMax( nPageWidth );
+ m_pMtrFldHeight->SetMin( -nRectHeight );
+ m_pMtrFldHeight->SetMax( nPageHeight );
+
const SfxPoolItem* pPoolItem = nullptr;
OUString aStr( GetExtraData() );
diff --git a/sd/uiconfig/sdraw/ui/copydlg.ui b/sd/uiconfig/sdraw/ui/copydlg.ui
index 87baa25e17ae..8ba01c9f8aa3 100644
--- a/sd/uiconfig/sdraw/ui/copydlg.ui
+++ b/sd/uiconfig/sdraw/ui/copydlg.ui
@@ -16,8 +16,8 @@
<property name="page_increment">10</property>
</object>
<object class="GtkAdjustment" id="adjustment3">
- <property name="lower">-120</property>
- <property name="upper">120</property>
+ <property name="lower">-1000000</property>
+ <property name="upper">1000000</property>
<property name="step_increment">0.10000000000000001</property>
<property name="page_increment">1</property>
</object>