diff options
author | Rishabh <kris.kr296@gmail.com> | 2016-02-11 03:49:37 +0530 |
---|---|---|
committer | Katarina Behrens <Katarina.Behrens@cib.de> | 2016-02-12 09:05:13 +0000 |
commit | 0acbf9404a40e5ca87642af299218846d51cf009 (patch) | |
tree | e9a87c29ae269e70dfde13a42b35787c5809326e /svx/source | |
parent | da4b5fe46c0d6bdcc1c0fbdbb52b448c4dc96bca (diff) |
tdf#82396:Incorrect behavior on update of Size values in sidebar
Added limits for Width and Height
Change-Id: I2aa80c86aeca826009b4594e5e9a0d5ed7f67ef9
Reviewed-on: https://gerrit.libreoffice.org/22274
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de>
Diffstat (limited to 'svx/source')
-rw-r--r-- | svx/source/sidebar/possize/PosSizePropertyPanel.cxx | 11 | ||||
-rw-r--r-- | svx/source/sidebar/possize/PosSizePropertyPanel.hxx | 2 |
2 files changed, 10 insertions, 3 deletions
diff --git a/svx/source/sidebar/possize/PosSizePropertyPanel.cxx b/svx/source/sidebar/possize/PosSizePropertyPanel.cxx index 026fb8c55aaa..11e4f005ffa2 100644 --- a/svx/source/sidebar/possize/PosSizePropertyPanel.cxx +++ b/svx/source/sidebar/possize/PosSizePropertyPanel.cxx @@ -917,7 +917,7 @@ void PosSizePropertyPanel::MetricState( SfxItemState eState, const SfxPoolItem* SetFieldUnit( *mpMtrPosY, meDlgUnit, true ); if(bPosYBlank) mpMtrPosY->SetText(OUString()); - SetPosXYMinMax(); + SetPosSizeMinMax(); if (mpMtrWidth->GetText().isEmpty()) bWidthBlank = true; @@ -1051,7 +1051,7 @@ void PosSizePropertyPanel::DisableControls() } } -void PosSizePropertyPanel::SetPosXYMinMax() +void PosSizePropertyPanel::SetPosSizeMinMax() { SdrPageView* pPV = mpView->GetSdrPageView(); if (!pPV) @@ -1096,6 +1096,13 @@ void PosSizePropertyPanel::SetPosXYMinMax() mpMtrPosY->SetFirst(basegfx::fround64(fTop)); mpMtrPosY->SetMax(basegfx::fround64(fBottom)); mpMtrPosY->SetLast(basegfx::fround64(fBottom)); + + double fMaxWidth = maWorkArea.getWidth() - (maRect.getMinX() - fLeft); + double fMaxHeight = maWorkArea.getHeight() - (maRect.getMinY() - fTop); + mpMtrWidth->SetMax(basegfx::fround64(fMaxWidth)); + mpMtrWidth->SetLast(basegfx::fround64(fMaxWidth)); + mpMtrHeight->SetMax(basegfx::fround64(fMaxHeight)); + mpMtrHeight->SetLast(basegfx::fround64(fMaxHeight)); } void PosSizePropertyPanel::UpdateUIScale() diff --git a/svx/source/sidebar/possize/PosSizePropertyPanel.hxx b/svx/source/sidebar/possize/PosSizePropertyPanel.hxx index 5aa420116325..21ada21e093d 100644 --- a/svx/source/sidebar/possize/PosSizePropertyPanel.hxx +++ b/svx/source/sidebar/possize/PosSizePropertyPanel.hxx @@ -167,7 +167,7 @@ private: void MetricState( SfxItemState eState, const SfxPoolItem* pState ); static FieldUnit GetCurrentUnit( SfxItemState eState, const SfxPoolItem* pState ); void DisableControls(); - void SetPosXYMinMax(); + void SetPosSizeMinMax(); /** Check if the UI scale has changed and handle such a change. UI scale is an SD only feature. The UI scale is represented by items |