diff options
author | Miklos Vajna <vmiklos@suse.cz> | 2012-03-09 15:48:53 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@suse.cz> | 2012-03-12 18:42:33 +0100 |
commit | 8631dbf85fb5ed56d225e32ea5a9c36c96b0d649 (patch) | |
tree | c5a2a7ff72a39b19d8b736aa2372a5c013d5bcef /cui | |
parent | 03f9b6bebc0ca77021be46664c7bcbe4cb297503 (diff) |
cui: implement contextual spacing UI
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/inc/paragrph.hxx | 2 | ||||
-rw-r--r-- | cui/source/tabpages/paragrph.cxx | 16 | ||||
-rw-r--r-- | cui/source/tabpages/paragrph.hrc | 1 | ||||
-rw-r--r-- | cui/source/tabpages/paragrph.src | 21 |
4 files changed, 32 insertions, 8 deletions
diff --git a/cui/source/inc/paragrph.hxx b/cui/source/inc/paragrph.hxx index 7a7af80ad4ea..1267298e5b68 100644 --- a/cui/source/inc/paragrph.hxx +++ b/cui/source/inc/paragrph.hxx @@ -85,6 +85,7 @@ private: SvxRelativeField aTopDist; FixedText aBottomLabel; SvxRelativeField aBottomDist; + CheckBox aContextualCB; // Zeilenabstand FixedLine aLineDistFrm; @@ -132,6 +133,7 @@ public: void SetPageWidth( sal_uInt16 nPageWidth ); void EnableRelativeMode(); void EnableRegisterMode(); + void EnableContextualMode(); void EnableAutoFirstLine(); void EnableAbsLineDist(long nMinTwip); void EnableNegativeMode(); diff --git a/cui/source/tabpages/paragrph.cxx b/cui/source/tabpages/paragrph.cxx index 5672b4537533..a2334b5de2ec 100644 --- a/cui/source/tabpages/paragrph.cxx +++ b/cui/source/tabpages/paragrph.cxx @@ -282,7 +282,8 @@ sal_Bool SvxStdParagraphTabPage::FillItemSet( SfxItemSet& rOutSet ) } } - if ( aTopDist.IsValueModified() || aBottomDist.IsValueModified() ) + if ( aTopDist.IsValueModified() || aBottomDist.IsValueModified() + || aContextualCB.GetSavedValue() != aContextualCB.IsChecked()) { nWhich = GetWhich( SID_ATTR_ULSPACE ); SfxMapUnit eUnit = pPool->GetMetric( nWhich ); @@ -314,6 +315,7 @@ sal_Bool SvxStdParagraphTabPage::FillItemSet( SfxItemSet& rOutSet ) aMargin.SetUpper( (sal_uInt16)GetCoreValue( aTopDist, eUnit ) ); aMargin.SetLower( (sal_uInt16)GetCoreValue( aBottomDist, eUnit ) ); } + aMargin.SetContextValue(aContextualCB.IsChecked()); eState = GetItemSet().GetItemState( nWhich ); if ( !pOld || !( *(const SvxULSpaceItem*)pOld == aMargin ) || @@ -574,6 +576,7 @@ void SvxStdParagraphTabPage::Reset( const SfxItemSet& rSet ) SetMetricValue( aTopDist, rOldItem.GetUpper(), eUnit ); SetMetricValue( aBottomDist, rOldItem.GetLower(), eUnit ); } + aContextualCB.Check(rOldItem.GetContext()); } else { @@ -618,6 +621,7 @@ void SvxStdParagraphTabPage::Reset( const SfxItemSet& rSet ) ELRLoseFocusHdl( NULL ); aAutoCB.SaveValue(); + aContextualCB.SaveValue(); aLineDist.SaveValue(); } @@ -667,6 +671,7 @@ SvxStdParagraphTabPage::SvxStdParagraphTabPage( Window* pParent, aTopDist ( this, CUI_RES( ED_TOPDIST ) ), aBottomLabel ( this, CUI_RES( FT_BOTTOMDIST ) ), aBottomDist ( this, CUI_RES( ED_BOTTOMDIST ) ), + aContextualCB ( this, CUI_RES( CB_CONTEXTUALSPACING ) ), aLineDistFrm ( this, CUI_RES( FL_LINEDIST ) ), aLineDist ( this, CUI_RES( LB_LINEDIST ) ), @@ -959,6 +964,11 @@ void SvxStdParagraphTabPage::EnableRegisterMode() aRegisterFL.Show(); } +void SvxStdParagraphTabPage::EnableContextualMode() +{ + aContextualCB.Show(); +} + IMPL_LINK( SvxStdParagraphTabPage, AutoHdl_Impl, CheckBox*, pBox ) { sal_Bool bEnable = !pBox->IsChecked(); @@ -994,6 +1004,7 @@ void SvxStdParagraphTabPage::PageCreated(SfxAllItemSet aSet) 0x0002 --->EnableRegisterMode() 0x0004 --->EnableAutoFirstLine() 0x0008 --->EnableNegativeMode() + 0x0010 --->EnableContextualMode() */ SFX_ITEMSET_ARG (&aSet,pPageWidthItem,SfxUInt16Item,SID_SVXSTDPARAGRAPHTABPAGE_PAGEWIDTH,sal_False); SFX_ITEMSET_ARG (&aSet,pFlagSetItem,SfxUInt32Item,SID_SVXSTDPARAGRAPHTABPAGE_FLAGSET,sal_False); @@ -1021,6 +1032,9 @@ void SvxStdParagraphTabPage::PageCreated(SfxAllItemSet aSet) if (( 0x0008 & pFlagSetItem->GetValue()) == 0x0008 ) EnableNegativeMode(); + if (pFlagSetItem) + if (( 0x0010 & pFlagSetItem->GetValue()) == 0x0010 ) + EnableContextualMode(); } diff --git a/cui/source/tabpages/paragrph.hrc b/cui/source/tabpages/paragrph.hrc index c6158a22ceda..bb9a3fc9cf18 100644 --- a/cui/source/tabpages/paragrph.hrc +++ b/cui/source/tabpages/paragrph.hrc @@ -42,6 +42,7 @@ #define FT_BOTTOMDIST 22 #define ED_BOTTOMDIST 23 #define FL_DIST 24 +#define CB_CONTEXTUALSPACING 25 #define BTN_LEFTALIGN 30 #define BTN_RIGHTALIGN 31 diff --git a/cui/source/tabpages/paragrph.src b/cui/source/tabpages/paragrph.src index b5659ca76f1c..d6de18e53d1e 100644 --- a/cui/source/tabpages/paragrph.src +++ b/cui/source/tabpages/paragrph.src @@ -36,7 +36,7 @@ TabPage RID_SVXPAGE_STD_PARAGRAPH HelpId = HID_FORMAT_PARAGRAPH_STD ; Hide = TRUE ; Text [ en-US ] = "Indents and Spacing" ; - Size = MAP_APPFONT ( 260 , 185 ) ; + Size = MAP_APPFONT ( 260 , 199 ) ; FixedText FT_LEFTINDENT { Pos = MAP_APPFONT ( 12 , 16 ) ; @@ -168,6 +168,13 @@ TabPage RID_SVXPAGE_STD_PARAGRAPH Last = 9999 ; SpinSize = 10 ; }; + CheckBox CB_CONTEXTUALSPACING + { + Pos = MAP_APPFONT ( 12 , 118 ) ; + Size = MAP_APPFONT ( 173 , 10 ) ; + Hide = TRUE ; + Text [ en-US ] = "Don't add space between paragraphs of the same style" ; + }; FixedLine FL_DIST { Pos = MAP_APPFONT ( 6 , 77 ) ; @@ -177,7 +184,7 @@ TabPage RID_SVXPAGE_STD_PARAGRAPH ListBox LB_LINEDIST { HelpID = "cui:ListBox:RID_SVXPAGE_STD_PARAGRAPH:LB_LINEDIST"; - Pos = MAP_APPFONT ( 12 , 133 ) ; + Pos = MAP_APPFONT ( 12 , 147 ) ; Size = MAP_APPFONT ( 55 , 72 ) ; DropDown = TRUE ; StringList [ en-US ] = @@ -197,7 +204,7 @@ TabPage RID_SVXPAGE_STD_PARAGRAPH FixedText FT_LINEDIST { Disable = TRUE ; - Pos = MAP_APPFONT ( 70 , 135 ) ; + Pos = MAP_APPFONT ( 70 , 149 ) ; Size = MAP_APPFONT ( 60 , 8 ) ; Text [ en-US ] = "of" ; Left = TRUE ; @@ -207,7 +214,7 @@ TabPage RID_SVXPAGE_STD_PARAGRAPH HelpID = "cui:MetricField:RID_SVXPAGE_STD_PARAGRAPH:ED_LINEDISTPERCENT"; Disable = TRUE ; Border = TRUE ; - Pos = MAP_APPFONT ( 135 , 133 ) ; + Pos = MAP_APPFONT ( 135 , 147 ) ; Size = MAP_APPFONT ( 40 , 12 ) ; Group = TRUE ; Left = TRUE ; @@ -242,7 +249,7 @@ TabPage RID_SVXPAGE_STD_PARAGRAPH }; FixedLine FL_LINEDIST { - Pos = MAP_APPFONT ( 6 , 122 ) ; + Pos = MAP_APPFONT ( 6 , 136 ) ; Size = MAP_APPFONT ( 173 , 8 ) ; Text [ en-US ] = "Line spacing" ; }; @@ -255,14 +262,14 @@ TabPage RID_SVXPAGE_STD_PARAGRAPH CheckBox CB_REGISTER { HelpID = "cui:CheckBox:RID_SVXPAGE_STD_PARAGRAPH:CB_REGISTER"; - Pos = MAP_APPFONT ( 12 , 162 ) ; + Pos = MAP_APPFONT ( 12 , 176 ) ; Size = MAP_APPFONT ( 120 , 10 ) ; Hide = TRUE ; Text [ en-US ] = "A~ctivate" ; }; FixedLine FL_REGISTER { - Pos = MAP_APPFONT ( 6 , 151 ) ; + Pos = MAP_APPFONT ( 6 , 165 ) ; Size = MAP_APPFONT ( 173 , 8 ) ; Hide = TRUE ; Text [ en-US ] = "Register-true" ; |