diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-02-04 11:18:12 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-02-04 11:35:08 +0100 |
commit | ae394876e7e49505efd1be514ec3893ed53d0e08 (patch) | |
tree | 85dbd60f03eb4301d4baec0118b6d02349a9be3c /sw/source/ui/frmdlg/frmpage.cxx | |
parent | a90374fc81d8fb6f41600d6901c68aaaa3052550 (diff) |
swpagerelsize ui: implement remaining height support
Change-Id: Ia603c4ac6c8e9e049473904203d2c471f03ce8a5
Diffstat (limited to 'sw/source/ui/frmdlg/frmpage.cxx')
-rw-r--r-- | sw/source/ui/frmdlg/frmpage.cxx | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx index 3942d5d475fd..8670fb019601 100644 --- a/sw/source/ui/frmdlg/frmpage.cxx +++ b/sw/source/ui/frmdlg/frmpage.cxx @@ -649,6 +649,7 @@ SwFrmPage::SwFrmPage(Window *pParent, const SfxItemSet &rSet) get(m_pHeightAutoFT, "autoheightft"); m_aHeightED.set(get<MetricField>("height")); get(m_pRelHeightCB, "relheight"); + get(m_pRelHeightRelationLB, "relheightrelation"); get(m_pAutoHeightCB, "autoheight"); get(m_pFixedRatioCB, "ratio"); @@ -823,6 +824,7 @@ void SwFrmPage::setOptimalRelWidth() m_pHoriRelationLB->set_width_request(aBiggest.Width()); m_pVertRelationLB->set_width_request(aBiggest.Width()); m_pRelWidthRelationLB->set_width_request(aBiggest.Width()); + m_pRelHeightRelationLB->set_width_request(aBiggest.Width()); m_pHoriRelationLB->Clear(); } @@ -954,12 +956,18 @@ void SwFrmPage::Reset( const SfxItemSet &rSet ) else m_pRelWidthRelationLB->Disable(); + m_pRelHeightRelationLB->InsertEntry(aFramePosString.GetString(SwFPos::FRAME)); + m_pRelHeightRelationLB->InsertEntry(aFramePosString.GetString(SwFPos::REL_PG_FRAME)); if (rFrmSize.GetHeightPercent() != 0xff && rFrmSize.GetHeightPercent() != 0) { //calculate the rerference value from the with and relative width values sal_Int32 nSpace = rFrmSize.GetHeight() * 100 / rFrmSize.GetHeightPercent(); m_aHeightED.SetRefValue( nSpace ); + + m_pRelHeightRelationLB->Enable(); } + else + m_pRelHeightRelationLB->Disable(); // general initialisation part switch(rAnchor.GetAnchorId()) @@ -1152,6 +1160,14 @@ sal_Bool SwFrmPage::FillItemSet(SfxItemSet &rSet) else if (nRelWidthRelation == 1) aSz.SetWidthPercentRelation(text::RelOrientation::PAGE_FRAME); } + sal_uInt16 nRelHeightRelation = m_pRelHeightRelationLB->GetSelectEntryPos(); + if (nRelHeightRelation != LISTBOX_ENTRY_NOTFOUND) + { + if (nRelHeightRelation == 0) + aSz.SetHeightPercentRelation(text::RelOrientation::FRAME); + else if (nRelHeightRelation == 1) + aSz.SetHeightPercentRelation(text::RelOrientation::PAGE_FRAME); + } bool bValueModified = (m_aWidthED.IsValueModified() || m_aHeightED.IsValueModified()); bool bCheckChanged = (m_pRelWidthCB->GetSavedValue() != m_pRelWidthCB->IsChecked() @@ -1743,6 +1759,7 @@ IMPL_LINK( SwFrmPage, RelSizeClickHdl, CheckBox *, pBtn ) else // pBtn == m_pRelHeightCB { m_aHeightED.ShowPercent(pBtn->IsChecked()); + m_pRelHeightRelationLB->Enable(pBtn->IsChecked()); if(pBtn->IsChecked()) m_aHeightED.get()->SetMax(MAX_PERCENT_HEIGHT); } @@ -2331,6 +2348,11 @@ void SwFrmPage::Init(const SfxItemSet& rSet, sal_Bool bReset) m_pRelWidthRelationLB->SelectEntryPos(1); else m_pRelWidthRelationLB->SelectEntryPos(0); + + if (rSize.GetHeightPercentRelation() == text::RelOrientation::PAGE_FRAME) + m_pRelHeightRelationLB->SelectEntryPos(1); + else + m_pRelHeightRelationLB->SelectEntryPos(0); } sal_uInt16* SwFrmPage::GetRanges() |