Kaydet (Commit) 9480887e authored tarafından Miklos Vajna's avatar Miklos Vajna

swpagerelsize ui: read WidthPercentRelation from doc model

Change-Id: Idb5774bf2a51881b385433d3476bf27b5e9b0014
üst 332ddac2
...@@ -642,6 +642,7 @@ SwFrmPage::SwFrmPage(Window *pParent, const SfxItemSet &rSet) ...@@ -642,6 +642,7 @@ SwFrmPage::SwFrmPage(Window *pParent, const SfxItemSet &rSet)
get(m_pWidthAutoFT, "autowidthft"); get(m_pWidthAutoFT, "autowidthft");
m_aWidthED.set(get<MetricField>("width")); m_aWidthED.set(get<MetricField>("width"));
get(m_pRelWidthCB, "relwidth"); get(m_pRelWidthCB, "relwidth");
get(m_pRelWidthRelationLB, "relwidthrelation");
get(m_pAutoWidthCB, "autowidth"); get(m_pAutoWidthCB, "autowidth");
get(m_pHeightFT, "heightft"); get(m_pHeightFT, "heightft");
...@@ -821,6 +822,7 @@ void SwFrmPage::setOptimalRelWidth() ...@@ -821,6 +822,7 @@ void SwFrmPage::setOptimalRelWidth()
Size aBiggest(m_pHoriRelationLB->GetOptimalSize()); Size aBiggest(m_pHoriRelationLB->GetOptimalSize());
m_pHoriRelationLB->set_width_request(aBiggest.Width()); m_pHoriRelationLB->set_width_request(aBiggest.Width());
m_pVertRelationLB->set_width_request(aBiggest.Width()); m_pVertRelationLB->set_width_request(aBiggest.Width());
m_pRelWidthRelationLB->set_width_request(aBiggest.Width());
m_pHoriRelationLB->Clear(); m_pHoriRelationLB->Clear();
} }
...@@ -944,6 +946,9 @@ void SwFrmPage::Reset( const SfxItemSet &rSet ) ...@@ -944,6 +946,9 @@ void SwFrmPage::Reset( const SfxItemSet &rSet )
//calculate the rerference value from the with and relative width values //calculate the rerference value from the with and relative width values
sal_Int32 nSpace = rFrmSize.GetWidth() * 100 / rFrmSize.GetWidthPercent(); sal_Int32 nSpace = rFrmSize.GetWidth() * 100 / rFrmSize.GetWidthPercent();
m_aWidthED.SetRefValue( nSpace ); 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) if (rFrmSize.GetHeightPercent() != 0xff && rFrmSize.GetHeightPercent() != 0)
...@@ -2308,6 +2313,11 @@ void SwFrmPage::Init(const SfxItemSet& rSet, sal_Bool bReset) ...@@ -2308,6 +2313,11 @@ void SwFrmPage::Init(const SfxItemSet& rSet, sal_Bool bReset)
} }
m_pRelWidthCB->SaveValue(); m_pRelWidthCB->SaveValue();
m_pRelHeightCB->SaveValue(); m_pRelHeightCB->SaveValue();
if (rSize.GetWidthPercentRelation() == text::RelOrientation::PAGE_FRAME)
m_pRelWidthRelationLB->SelectEntryPos(1);
else
m_pRelWidthRelationLB->SelectEntryPos(0);
} }
sal_uInt16* SwFrmPage::GetRanges() sal_uInt16* SwFrmPage::GetRanges()
......
...@@ -48,6 +48,7 @@ class SwFrmPage: public SfxTabPage ...@@ -48,6 +48,7 @@ class SwFrmPage: public SfxTabPage
FixedText* m_pWidthAutoFT; FixedText* m_pWidthAutoFT;
PercentField m_aWidthED; PercentField m_aWidthED;
CheckBox* m_pRelWidthCB; CheckBox* m_pRelWidthCB;
ListBox* m_pRelWidthRelationLB;
CheckBox* m_pAutoWidthCB; CheckBox* m_pAutoWidthCB;
FixedText* m_pHeightFT; FixedText* m_pHeightFT;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment