summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-02-03 16:31:48 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-02-03 19:52:44 +0100
commit9480887ee8524411b13e6942a549370939608338 (patch)
tree613a26e90aa72bed8c0c73c325bf734f1aba7a79
parent332ddac2e2a57f56ea5a736569b0763a1f763821 (diff)
swpagerelsize ui: read WidthPercentRelation from doc model
Change-Id: Idb5774bf2a51881b385433d3476bf27b5e9b0014
-rw-r--r--sw/source/ui/frmdlg/frmpage.cxx10
-rw-r--r--sw/source/ui/inc/frmpage.hxx1
2 files changed, 11 insertions, 0 deletions
diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx
index 1559dda1a225..0b5733a7c240 100644
--- a/sw/source/ui/frmdlg/frmpage.cxx
+++ b/sw/source/ui/frmdlg/frmpage.cxx
@@ -642,6 +642,7 @@ SwFrmPage::SwFrmPage(Window *pParent, const SfxItemSet &rSet)
get(m_pWidthAutoFT, "autowidthft");
m_aWidthED.set(get<MetricField>("width"));
get(m_pRelWidthCB, "relwidth");
+ get(m_pRelWidthRelationLB, "relwidthrelation");
get(m_pAutoWidthCB, "autowidth");
get(m_pHeightFT, "heightft");
@@ -821,6 +822,7 @@ void SwFrmPage::setOptimalRelWidth()
Size aBiggest(m_pHoriRelationLB->GetOptimalSize());
m_pHoriRelationLB->set_width_request(aBiggest.Width());
m_pVertRelationLB->set_width_request(aBiggest.Width());
+ m_pRelWidthRelationLB->set_width_request(aBiggest.Width());
m_pHoriRelationLB->Clear();
}
@@ -944,6 +946,9 @@ void SwFrmPage::Reset( const SfxItemSet &rSet )
//calculate the rerference value from the with and relative width values
sal_Int32 nSpace = rFrmSize.GetWidth() * 100 / rFrmSize.GetWidthPercent();
m_aWidthED.SetRefValue( nSpace );
+
+ m_pRelWidthRelationLB->InsertEntry(aFramePosString.GetString(SwFPos::FRAME));
+ m_pRelWidthRelationLB->InsertEntry(aFramePosString.GetString(SwFPos::REL_PG_FRAME));
}
if (rFrmSize.GetHeightPercent() != 0xff && rFrmSize.GetHeightPercent() != 0)
@@ -2308,6 +2313,11 @@ void SwFrmPage::Init(const SfxItemSet& rSet, sal_Bool bReset)
}
m_pRelWidthCB->SaveValue();
m_pRelHeightCB->SaveValue();
+
+ if (rSize.GetWidthPercentRelation() == text::RelOrientation::PAGE_FRAME)
+ m_pRelWidthRelationLB->SelectEntryPos(1);
+ else
+ m_pRelWidthRelationLB->SelectEntryPos(0);
}
sal_uInt16* SwFrmPage::GetRanges()
diff --git a/sw/source/ui/inc/frmpage.hxx b/sw/source/ui/inc/frmpage.hxx
index 11aacc015dc7..515a0bec77df 100644
--- a/sw/source/ui/inc/frmpage.hxx
+++ b/sw/source/ui/inc/frmpage.hxx
@@ -48,6 +48,7 @@ class SwFrmPage: public SfxTabPage
FixedText* m_pWidthAutoFT;
PercentField m_aWidthED;
CheckBox* m_pRelWidthCB;
+ ListBox* m_pRelWidthRelationLB;
CheckBox* m_pAutoWidthCB;
FixedText* m_pHeightFT;