summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Hallot <olivier.hallot@alta.org.br>2013-03-07 22:04:20 -0300
committerCaolán McNamara <caolanm@redhat.com>2013-03-08 09:27:14 +0000
commitd400bb0d33acd81226fbeea56eaa9ae02a8b1c05 (patch)
tree1bcbd9d151961664e0f6244f9a7df258238de347
parent3d4723f80a37e719359ad78ad063bc39ac28cd32 (diff)
Small improvement in page widget ui
Save a coupe of bytes and better use of widget features Change-Id: I6860339a8b62c7e95605a0abc47e99d7ef49696b Reviewed-on: https://gerrit.libreoffice.org/2590 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--cui/source/inc/page.hxx9
-rw-r--r--cui/source/tabpages/page.cxx27
-rw-r--r--cui/uiconfig/ui/pageformatpage.ui167
3 files changed, 96 insertions, 107 deletions
diff --git a/cui/source/inc/page.hxx b/cui/source/inc/page.hxx
index 64e06de105a3..fa18d962d709 100644
--- a/cui/source/inc/page.hxx
+++ b/cui/source/inc/page.hxx
@@ -120,15 +120,10 @@ class SvxPageDescPage : public SfxTabPage
String sStandardRegister;
- FixedText* m_pInsideText;
- FixedText* m_pOutsideText;
+ FixedText* m_pInsideLbl;
+ FixedText* m_pOutsideLbl;
FixedText* m_pPrintRangeQueryText;
- OUString aInsideText;
- OUString aOutsideText;
- OUString aLeftText;
- OUString aRightText;
-
long nFirstLeftMargin;
long nFirstRightMargin;
long nFirstTopMargin;
diff --git a/cui/source/tabpages/page.cxx b/cui/source/tabpages/page.cxx
index fe2c43d90fa8..f04d6a6ce811 100644
--- a/cui/source/tabpages/page.cxx
+++ b/cui/source/tabpages/page.cxx
@@ -223,8 +223,8 @@ SvxPageDescPage::SvxPageDescPage( Window* pParent, const SfxItemSet& rAttr ) :
get(m_pAdaptBox,"checkAdaptBox");
// Strings stored in UI
- get(m_pInsideText,"labelInner");
- get(m_pOutsideText,"labelOuter");
+ get(m_pInsideLbl,"labelInner");
+ get(m_pOutsideLbl,"labelOuter");
get(m_pPrintRangeQueryText,"labelMsg");
bBorderModified = sal_False;
@@ -370,11 +370,6 @@ SvxPageDescPage::~SvxPageDescPage()
void SvxPageDescPage::Init_Impl()
{
- aLeftText = m_pLeftMarginLbl->GetText();
- aRightText = m_pRightMarginLbl->GetText();
- aInsideText = m_pInsideText->GetText();
- aOutsideText = m_pOutsideText->GetText();
-
// adjust the handler
m_pLayoutBox->SetSelectHdl( LINK( this, SvxPageDescPage, LayoutHdl_Impl ) );
m_pPaperSizeBox->SetDropDownLineCount(10);
@@ -900,19 +895,17 @@ IMPL_LINK_NOARG(SvxPageDescPage, LayoutHdl_Impl)
if ( nPos == SVX_PAGE_MIRROR )
{
- if ( m_pLeftMarginLbl->GetText() != aInsideText )
- m_pLeftMarginLbl->SetText( aInsideText );
-
- if ( m_pRightMarginLbl->GetText() != aOutsideText )
- m_pRightMarginLbl->SetText( aOutsideText );
+ m_pLeftMarginLbl->Hide();
+ m_pRightMarginLbl->Hide();
+ m_pInsideLbl->Show();
+ m_pOutsideLbl->Show();
}
else
{
- if ( m_pLeftMarginLbl->GetText() != aLeftText )
- m_pLeftMarginLbl->SetText( aLeftText );
-
- if ( m_pRightMarginLbl->GetText() != aRightText )
- m_pRightMarginLbl->SetText( aRightText );
+ m_pLeftMarginLbl->Show();
+ m_pRightMarginLbl->Show();
+ m_pInsideLbl->Hide();
+ m_pOutsideLbl->Hide();
}
UpdateExample_Impl( true );
return 0;
diff --git a/cui/uiconfig/ui/pageformatpage.ui b/cui/uiconfig/ui/pageformatpage.ui
index 1463671c5959..a3fe19661271 100644
--- a/cui/uiconfig/ui/pageformatpage.ui
+++ b/cui/uiconfig/ui/pageformatpage.ui
@@ -342,38 +342,6 @@
<property name="row_spacing">6</property>
<property name="column_spacing">12</property>
<child>
- <object class="GtkLabel" id="labelLeftMargin">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Left:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">spinMargLeft:0.00cm</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="labelRightMargin">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Right:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">spinMargRight:0.00cm</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">1</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
- </child>
- <child>
<object class="GtkLabel" id="labelTopMargin">
<property name="visible">True</property>
<property name="can_focus">False</property>
@@ -461,6 +429,88 @@
<property name="height">1</property>
</packing>
</child>
+ <child>
+ <object class="GtkBox" id="box2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <object class="GtkLabel" id="labelRightMargin">
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Right:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">spinMargRight:0.00cm</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="labelOuter">
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">O_uter:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">spinMargRight:0.00cm</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">1</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkBox" id="box3">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <object class="GtkLabel" id="labelLeftMargin">
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Left:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">spinMargLeft:0.00cm</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="labelInner">
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">I_nner:</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">spinMargLeft:0.00cm</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
</object>
</child>
</object>
@@ -731,49 +781,11 @@
</packing>
</child>
<child>
- <object class="GtkGrid" id="grid1">
- <property name="visible">True</property>
+ <object class="GtkLabel" id="labelMsg">
<property name="can_focus">False</property>
- <child>
- <object class="GtkLabel" id="labelInner">
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">I_nner:</property>
- <property name="use_underline">True</property>
- </object>
- <packing>
- <property name="left_attach">0</property>
- <property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="labelOuter">
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">O_uter:</property>
- <property name="use_underline">True</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="labelMsg">
- <property name="can_focus">False</property>
- <property name="label" translatable="yes">The margin settings are out of print range.
+ <property name="label" translatable="yes">The margin settings are out of print range.
Do you still want to apply these settings?</property>
- </object>
- <packing>
- <property name="left_attach">2</property>
- <property name="top_attach">0</property>
- <property name="width">1</property>
- <property name="height">1</property>
- </packing>
- </child>
</object>
<packing>
<property name="left_attach">0</property>
@@ -946,16 +958,5 @@ Do you still want to apply these settings?</property>
</object>
<object class="GtkSizeGroup" id="sizegroup6">
<property name="ignore_hidden">True</property>
- <widgets>
- <widget name="labelFormat"/>
- <widget name="labelWidth"/>
- <widget name="labelHeight"/>
- <widget name="labelOrientation"/>
- <widget name="labelTextFlow"/>
- <widget name="labelLeftMargin"/>
- <widget name="labelRightMargin"/>
- <widget name="labelTopMargin"/>
- <widget name="labelBottomMargin"/>
- </widgets>
</object>
</interface>