Kaydet (Commit) 74ef8a41 authored tarafından Maxim Monastirsky's avatar Maxim Monastirsky

Introduce ParaspaceIncrease/Decrease commands in Writer and Calc

Change-Id: Ia8933697fd7bd827bb69c0976f13112eb2131888
üst 6521e61c
...@@ -1002,9 +1002,11 @@ ...@@ -1002,9 +1002,11 @@
//UUUU //UUUU
#define SID_OFFER_IMPORT ( SID_SVX_START + 1143 ) #define SID_OFFER_IMPORT ( SID_SVX_START + 1143 )
#define SID_DRAWINGLAYER_FILLSTYLES ( SID_SVX_START + 1144) #define SID_DRAWINGLAYER_FILLSTYLES ( SID_SVX_START + 1144)
#define SID_PARASPACE_INCREASE ( SID_SVX_START + 1145 )
#define SID_PARASPACE_DECREASE ( SID_SVX_START + 1146 )
// IMPORTANT NOTE: adjust SID_SVX_FIRSTFREE, when adding new slot id // IMPORTANT NOTE: adjust SID_SVX_FIRSTFREE, when adding new slot id
#define SID_SVX_FIRSTFREE (SID_DRAWINGLAYER_FILLSTYLES + 1) #define SID_SVX_FIRSTFREE (SID_PARASPACE_DECREASE + 1)
// Overflow check for slot IDs // Overflow check for slot IDs
......
...@@ -92,6 +92,8 @@ interface TableDrawText ...@@ -92,6 +92,8 @@ interface TableDrawText
SID_ATTR_PARA_LINESPACE_10 [ ExecMethod = ExecuteAttr; StateMethod = GetAttrState; Export = FALSE; ] SID_ATTR_PARA_LINESPACE_10 [ ExecMethod = ExecuteAttr; StateMethod = GetAttrState; Export = FALSE; ]
SID_ATTR_PARA_LINESPACE_15 [ ExecMethod = ExecuteAttr; StateMethod = GetAttrState; Export = FALSE; ] SID_ATTR_PARA_LINESPACE_15 [ ExecMethod = ExecuteAttr; StateMethod = GetAttrState; Export = FALSE; ]
SID_ATTR_PARA_LINESPACE_20 [ ExecMethod = ExecuteAttr; StateMethod = GetAttrState; Export = FALSE; ] SID_ATTR_PARA_LINESPACE_20 [ ExecMethod = ExecuteAttr; StateMethod = GetAttrState; Export = FALSE; ]
SID_PARASPACE_INCREASE [ ExecMethod = ExecuteAttr; StateMethod = GetAttrState; Export = FALSE; ]
SID_PARASPACE_DECREASE [ ExecMethod = ExecuteAttr; StateMethod = GetAttrState; Export = FALSE; ]
SID_SET_SUPER_SCRIPT [ ExecMethod = ExecuteAttr; StateMethod = GetAttrState; Export = FALSE; ] SID_SET_SUPER_SCRIPT [ ExecMethod = ExecuteAttr; StateMethod = GetAttrState; Export = FALSE; ]
SID_SET_SUB_SCRIPT [ ExecMethod = ExecuteAttr; StateMethod = GetAttrState; Export = FALSE; ] SID_SET_SUB_SCRIPT [ ExecMethod = ExecuteAttr; StateMethod = GetAttrState; Export = FALSE; ]
SID_ATTR_CHAR_KERNING [ ExecMethod = ExecuteAttr; StateMethod = GetAttrState; Export = FALSE; ] SID_ATTR_CHAR_KERNING [ ExecMethod = ExecuteAttr; StateMethod = GetAttrState; Export = FALSE; ]
......
...@@ -761,6 +761,31 @@ void ScDrawTextObjectBar::ExecuteAttr( SfxRequest &rReq ) ...@@ -761,6 +761,31 @@ void ScDrawTextObjectBar::ExecuteAttr( SfxRequest &rReq )
} }
break; break;
case SID_PARASPACE_INCREASE:
case SID_PARASPACE_DECREASE:
{
SvxULSpaceItem aULSpace(
static_cast< const SvxULSpaceItem& >( aEditAttr.Get( EE_PARA_ULSPACE ) ) );
sal_uInt16 nUpper = aULSpace.GetUpper();
sal_uInt16 nLower = aULSpace.GetLower();
if ( nSlot == SID_PARASPACE_INCREASE )
{
nUpper += 100;
nLower += 100;
}
else
{
nUpper = std::max< sal_Int16 >( nUpper - 100, 0 );
nLower = std::max< sal_Int16 >( nLower - 100, 0 );
}
aULSpace.SetUpper( nUpper );
aULSpace.SetLower( nLower );
aNewAttr.Put( aULSpace );
}
break;
default: default:
bSet = false; bSet = false;
} }
...@@ -1023,9 +1048,20 @@ void ScDrawTextObjectBar::GetAttrState( SfxItemSet& rDestSet ) ...@@ -1023,9 +1048,20 @@ void ScDrawTextObjectBar::GetAttrState( SfxItemSet& rDestSet )
aULSP.SetWhich(SID_ATTR_PARA_ULSPACE); aULSP.SetWhich(SID_ATTR_PARA_ULSPACE);
rDestSet.Put(aULSP); rDestSet.Put(aULSP);
Invalidate(SID_ATTR_PARA_ULSPACE); Invalidate(SID_ATTR_PARA_ULSPACE);
Invalidate(SID_PARASPACE_INCREASE);
Invalidate(SID_PARASPACE_DECREASE);
eState = aAttrSet.GetItemState( EE_PARA_ULSPACE ); eState = aAttrSet.GetItemState( EE_PARA_ULSPACE );
if ( eState == SfxItemState::DONTCARE ) if( eState >= SfxItemState::DEFAULT )
{
if ( !aULSP.GetUpper() && !aULSP.GetLower() )
rDestSet.DisableItem( SID_PARASPACE_DECREASE );
}
else
{
rDestSet.DisableItem( SID_PARASPACE_INCREASE );
rDestSet.DisableItem( SID_PARASPACE_DECREASE );
rDestSet.InvalidateItem(SID_ATTR_PARA_ULSPACE); rDestSet.InvalidateItem(SID_ATTR_PARA_ULSPACE);
}
// Zeilenabstand // Zeilenabstand
......
...@@ -360,8 +360,7 @@ ...@@ -360,8 +360,7 @@
#define SID_EXPAND_PAGE (SID_SD_START+343) #define SID_EXPAND_PAGE (SID_SD_START+343)
#define SID_SUMMARY_PAGE (SID_SD_START+344) #define SID_SUMMARY_PAGE (SID_SD_START+344)
#define SID_LEAVE_ALL_GROUPS (SID_SD_START+345) #define SID_LEAVE_ALL_GROUPS (SID_SD_START+345)
#define SID_PARASPACE_INCREASE (SID_SD_START+346) // free
#define SID_PARASPACE_DECREASE (SID_SD_START+347)
#define SID_SLIDE_MASTERPAGE (SID_SD_START+348) #define SID_SLIDE_MASTERPAGE (SID_SD_START+348)
#define SID_HANDOUT_MASTERPAGE (SID_SD_START+349) #define SID_HANDOUT_MASTERPAGE (SID_SD_START+349)
#define SID_NOTES_MASTERPAGE (SID_SD_START+350) #define SID_NOTES_MASTERPAGE (SID_SD_START+350)
......
...@@ -4897,58 +4897,6 @@ SfxStringItem PageStatus SID_STATUS_PAGE ...@@ -4897,58 +4897,6 @@ SfxStringItem PageStatus SID_STATUS_PAGE
GroupId = GID_VIEW; GroupId = GID_VIEW;
] ]
SfxBoolItem ParaspaceDecrease SID_PARASPACE_DECREASE
[
/* flags: */
AutoUpdate = TRUE,
Cachable = Cachable,
FastCall = FALSE,
HasCoreId = FALSE,
HasDialog = FALSE,
ReadOnlyDoc = FALSE,
Toggle = FALSE,
Container = FALSE,
RecordAbsolute = FALSE,
RecordPerSet;
Synchron;
Readonly = FALSE,
/* config: */
AccelConfig = TRUE,
MenuConfig = TRUE,
StatusBarConfig = FALSE,
ToolBoxConfig = TRUE,
GroupId = GID_FORMAT;
]
SfxBoolItem ParaspaceIncrease SID_PARASPACE_INCREASE
[
/* flags: */
AutoUpdate = TRUE,
Cachable = Cachable,
FastCall = FALSE,
HasCoreId = FALSE,
HasDialog = FALSE,
ReadOnlyDoc = FALSE,
Toggle = FALSE,
Container = FALSE,
RecordAbsolute = FALSE,
RecordPerSet;
Synchron;
Readonly = FALSE,
/* config: */
AccelConfig = TRUE,
MenuConfig = TRUE,
StatusBarConfig = FALSE,
ToolBoxConfig = TRUE,
GroupId = GID_FORMAT;
]
SfxBoolItem PickThrough SID_PICK_THROUGH SfxBoolItem PickThrough SID_PICK_THROUGH
[ [
......
...@@ -16167,3 +16167,50 @@ SfxVoidItem FormatCellBorders SID_CELL_FORMAT_BORDER ...@@ -16167,3 +16167,50 @@ SfxVoidItem FormatCellBorders SID_CELL_FORMAT_BORDER
GroupId = GID_FORMAT; GroupId = GID_FORMAT;
] ]
SfxVoidItem ParaspaceDecrease SID_PARASPACE_DECREASE
()
[
/* flags: */
AutoUpdate = TRUE,
Cachable = Cachable,
FastCall = FALSE,
HasCoreId = FALSE,
HasDialog = FALSE,
ReadOnlyDoc = FALSE,
Toggle = FALSE,
Container = FALSE,
RecordAbsolute = FALSE,
RecordPerSet;
Synchron;
/* config: */
AccelConfig = TRUE,
MenuConfig = TRUE,
StatusBarConfig = FALSE,
ToolBoxConfig = TRUE,
GroupId = GID_FORMAT;
]
SfxVoidItem ParaspaceIncrease SID_PARASPACE_INCREASE
()
[
/* flags: */
AutoUpdate = TRUE,
Cachable = Cachable,
FastCall = FALSE,
HasCoreId = FALSE,
HasDialog = FALSE,
ReadOnlyDoc = FALSE,
Toggle = FALSE,
Container = FALSE,
RecordAbsolute = FALSE,
RecordPerSet;
Synchron;
/* config: */
AccelConfig = TRUE,
MenuConfig = TRUE,
StatusBarConfig = FALSE,
ToolBoxConfig = TRUE,
GroupId = GID_FORMAT;
]
...@@ -44,16 +44,12 @@ const char UNO_PROMOTE[] = ".uno:Promote"; ...@@ -44,16 +44,12 @@ const char UNO_PROMOTE[] = ".uno:Promote";
const char UNO_DEMOTE[] = ".uno:Demote"; const char UNO_DEMOTE[] = ".uno:Demote";
const char UNO_HANGINGINDENT2[] = ".uno:HangingIndent2"; const char UNO_HANGINGINDENT2[] = ".uno:HangingIndent2";
const char UNO_PARASPACEINC[] = ".uno:ParaspaceIncrease";
const char UNO_PARASPACEDEC[] = ".uno:ParaspaceDecrease";
namespace svx {namespace sidebar { namespace svx {namespace sidebar {
#define DEFAULT_VALUE 0 #define DEFAULT_VALUE 0
#define MAX_DURCH 5670 #define MAX_DURCH 5670
#define INDENT_STEP 706 #define INDENT_STEP 706
#define UL_STEP 58
#define MAX_SW 1709400 #define MAX_SW 1709400
#define MAX_SC_SD 116220200 #define MAX_SC_SD 116220200
...@@ -246,24 +242,6 @@ void ParaPropertyPanel::InitToolBoxSpacing() ...@@ -246,24 +242,6 @@ void ParaPropertyPanel::InitToolBoxSpacing()
mpTopDist->SetAccessibleName(mpTopDist->GetQuickHelpText()); mpTopDist->SetAccessibleName(mpTopDist->GetQuickHelpText());
mpBottomDist->SetAccessibleName(mpBottomDist->GetQuickHelpText()); mpBottomDist->SetAccessibleName(mpBottomDist->GetQuickHelpText());
// Use a form of image loading that can handle both .uno:<command>
// and private:graphirepository... syntax. This is necessary to
// handle the workaround for accessing the images of commands
// ParaspaceIncrease and ParaspaceDecrease.
// See issue 122446 for more details.
const sal_uInt16 nIdParaSpaceInc = mpTbxUL_IncDec->GetItemId(UNO_PARASPACEINC);
const sal_uInt16 nIdParaSpaceDec = mpTbxUL_IncDec->GetItemId(UNO_PARASPACEDEC);
mpTbxUL_IncDec->SetItemImage(
nIdParaSpaceInc,
sfx2::sidebar::Tools::GetImage("private:graphicrepository/cmd/sc_paraspaceincrease.png" /* i#122446 */, mxFrame));
mpTbxUL_IncDec->SetItemImage(
nIdParaSpaceDec,
sfx2::sidebar::Tools::GetImage("private:graphicrepository/cmd/sc_paraspacedecrease.png" /* i#122446 */, mxFrame));
aLink = LINK( this, ParaPropertyPanel, ClickUL_IncDec_Hdl_Impl );
mpTbxUL_IncDec->SetSelectHdl(aLink);
m_eULSpaceUnit = maULSpaceControl.GetCoreMetric(); m_eULSpaceUnit = maULSpaceControl.GetCoreMetric();
} }
...@@ -405,57 +383,6 @@ IMPL_LINK_NOARG( ParaPropertyPanel, ULSpaceHdl_Impl) ...@@ -405,57 +383,6 @@ IMPL_LINK_NOARG( ParaPropertyPanel, ULSpaceHdl_Impl)
return 0L; return 0L;
} }
IMPL_LINK(ParaPropertyPanel, ClickUL_IncDec_Hdl_Impl, ToolBox *, pControl)
{
const OUString aCommand(pControl->GetItemCommand(pControl->GetCurItemId()));
if( aCommand == UNO_PARASPACEINC)
{
SvxULSpaceItem aMargin( SID_ATTR_PARA_ULSPACE );
maUpper += UL_STEP;
sal_Int64 nVal = OutputDevice::LogicToLogic( maUpper, (MapUnit)(SFX_MAPUNIT_TWIP), MAP_100TH_MM );
nVal = OutputDevice::LogicToLogic( (long)nVal, MAP_100TH_MM, (MapUnit)m_eLRSpaceUnit );
aMargin.SetUpper( (const sal_uInt16)nVal );
maLower += UL_STEP;
nVal = OutputDevice::LogicToLogic( maLower, (MapUnit)(SFX_MAPUNIT_TWIP), MAP_100TH_MM );
nVal = OutputDevice::LogicToLogic( (long)nVal, MAP_100TH_MM, (MapUnit)m_eLRSpaceUnit );
aMargin.SetLower( (const sal_uInt16)nVal );
GetBindings()->GetDispatcher()->Execute(
SID_ATTR_PARA_ULSPACE, SfxCallMode::RECORD, &aMargin, 0L);
}
else if( aCommand == UNO_PARASPACEDEC)
{
SvxULSpaceItem aMargin( SID_ATTR_PARA_ULSPACE );
if( maUpper >= UL_STEP )
{
maUpper -= UL_STEP;
sal_Int64 nVal = OutputDevice::LogicToLogic( maUpper, (MapUnit)(SFX_MAPUNIT_TWIP), MAP_100TH_MM );
nVal = OutputDevice::LogicToLogic( (long)nVal, MAP_100TH_MM, (MapUnit)m_eLRSpaceUnit );
aMargin.SetUpper( (const sal_uInt16)nVal );
}
else
aMargin.SetUpper( DEFAULT_VALUE );
if( maLower >= UL_STEP )
{
maLower -= UL_STEP;
sal_Int64 nVal = OutputDevice::LogicToLogic( maLower, (MapUnit)(SFX_MAPUNIT_TWIP), MAP_100TH_MM );
nVal = OutputDevice::LogicToLogic( (long)nVal, MAP_100TH_MM, (MapUnit)m_eLRSpaceUnit );
aMargin.SetLower( (const sal_uInt16)nVal );
}
else
aMargin.SetLower( DEFAULT_VALUE );
GetBindings()->GetDispatcher()->Execute(
SID_ATTR_PARA_ULSPACE, SfxCallMode::RECORD, &aMargin, 0L);
}
return( 0L );
}
// for Paragraph State change // for Paragraph State change
void ParaPropertyPanel::NotifyItemUpdate( void ParaPropertyPanel::NotifyItemUpdate(
sal_uInt16 nSID, sal_uInt16 nSID,
...@@ -677,19 +604,16 @@ void ParaPropertyPanel::StateChangedULImpl( sal_uInt16 /*nSID*/, SfxItemState eS ...@@ -677,19 +604,16 @@ void ParaPropertyPanel::StateChangedULImpl( sal_uInt16 /*nSID*/, SfxItemState eS
nVal = OutputDevice::LogicToLogic( maLower, (MapUnit)(SFX_MAPUNIT_TWIP), MAP_100TH_MM ); nVal = OutputDevice::LogicToLogic( maLower, (MapUnit)(SFX_MAPUNIT_TWIP), MAP_100TH_MM );
nVal = mpBottomDist->Normalize( nVal ); nVal = mpBottomDist->Normalize( nVal );
mpBottomDist->SetValue( nVal, FUNIT_100TH_MM ); mpBottomDist->SetValue( nVal, FUNIT_100TH_MM );
mpTbxUL_IncDec->Enable();
} }
else if(eState == SfxItemState::DISABLED ) else if(eState == SfxItemState::DISABLED )
{ {
mpTopDist->Disable(); mpTopDist->Disable();
mpBottomDist->Disable(); mpBottomDist->Disable();
mpTbxUL_IncDec->Disable();
} }
else else
{ {
mpTopDist->SetEmptyFieldValue(); mpTopDist->SetEmptyFieldValue();
mpBottomDist->SetEmptyFieldValue(); mpBottomDist->SetEmptyFieldValue();
mpTbxUL_IncDec->Disable();
} }
} }
...@@ -821,7 +745,6 @@ ParaPropertyPanel::ParaPropertyPanel(vcl::Window* pParent, ...@@ -821,7 +745,6 @@ ParaPropertyPanel::ParaPropertyPanel(vcl::Window* pParent,
get(mpTbxIndent_IncDec, "indent"); get(mpTbxIndent_IncDec, "indent");
get(mpTbxProDemote, "promotedemote"); get(mpTbxProDemote, "promotedemote");
get(mpTbxUL_IncDec, "paraspacing");
initial(); initial();
m_aMetricCtl.RequestUpdate(); m_aMetricCtl.RequestUpdate();
......
...@@ -71,7 +71,6 @@ private: ...@@ -71,7 +71,6 @@ private:
ToolBox* mpTBxNumBullet; ToolBox* mpTBxNumBullet;
ToolBox* mpTBxBackColor; ToolBox* mpTBxBackColor;
//Paragraph spacing //Paragraph spacing
ToolBox* mpTbxUL_IncDec;
SvxRelativeField* mpTopDist; SvxRelativeField* mpTopDist;
SvxRelativeField* mpBottomDist; SvxRelativeField* mpBottomDist;
ToolBox* mpTbxIndent_IncDec; ToolBox* mpTbxIndent_IncDec;
...@@ -120,7 +119,6 @@ private: ...@@ -120,7 +119,6 @@ private:
DECL_LINK(ClickIndent_IncDec_Hdl_Impl, ToolBox*); DECL_LINK(ClickIndent_IncDec_Hdl_Impl, ToolBox*);
DECL_LINK(ClickProDemote_Hdl_Impl, ToolBox*); DECL_LINK(ClickProDemote_Hdl_Impl, ToolBox*);
DECL_LINK(ULSpaceHdl_Impl, void*); DECL_LINK(ULSpaceHdl_Impl, void*);
DECL_LINK(ClickUL_IncDec_Hdl_Impl, ToolBox*);
void StateChangedIndentImpl( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState ); void StateChangedIndentImpl( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState );
void StateChangedULImpl( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState ); void StateChangedULImpl( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState );
......
...@@ -278,7 +278,7 @@ ...@@ -278,7 +278,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkToolbar" id="paraspacing"> <object class="sfxlo-SidebarToolBox" id="paraspacing">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="has_tooltip">True</property> <property name="has_tooltip">True</property>
...@@ -286,12 +286,8 @@ ...@@ -286,12 +286,8 @@
<property name="show_arrow">False</property> <property name="show_arrow">False</property>
<child> <child>
<object class="GtkToolButton" id="paraspaceinc"> <object class="GtkToolButton" id="paraspaceinc">
<property name="width_request">25</property>
<property name="height_request">25</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="has_tooltip">True</property>
<property name="tooltip_text" translatable="yes">Increase Paragraph Spacing</property>
<property name="action_name">.uno:ParaspaceIncrease</property> <property name="action_name">.uno:ParaspaceIncrease</property>
<property name="use_underline">True</property> <property name="use_underline">True</property>
</object> </object>
...@@ -304,8 +300,6 @@ ...@@ -304,8 +300,6 @@
<object class="GtkToolButton" id="paraspacedec"> <object class="GtkToolButton" id="paraspacedec">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="has_tooltip">True</property>
<property name="tooltip_text" translatable="yes">Decrease Paragraph Spacing</property>
<property name="action_name">.uno:ParaspaceDecrease</property> <property name="action_name">.uno:ParaspaceDecrease</property>
<property name="use_underline">True</property> <property name="use_underline">True</property>
</object> </object>
......
...@@ -198,6 +198,17 @@ interface _Annotation ...@@ -198,6 +198,17 @@ interface _Annotation
StateMethod = GetState ; StateMethod = GetState ;
] ]
SID_PARASPACE_INCREASE
[
ExecMethod = Exec;
StateMethod = GetState;
]
SID_PARASPACE_DECREASE
[
ExecMethod = Exec;
StateMethod = GetState;
]
FN_INSERT_STRING FN_INSERT_STRING
[ [
ExecMethod = Exec ; ExecMethod = Exec ;
......
...@@ -427,6 +427,18 @@ interface BaseTextEditView ...@@ -427,6 +427,18 @@ interface BaseTextEditView
StateMethod = StateTabWin ; StateMethod = StateTabWin ;
] ]
SID_PARASPACE_INCREASE
[
ExecMethod = ExecTabWin;
StateMethod = StateTabWin;
]
SID_PARASPACE_DECREASE
[
ExecMethod = ExecTabWin;
StateMethod = StateTabWin;
]
SID_ATTR_PAGE_COLUMN SID_ATTR_PAGE_COLUMN
[ [
ExecMethod = ExecTabWin ; ExecMethod = ExecTabWin ;
......
...@@ -211,6 +211,18 @@ interface TextDrawText ...@@ -211,6 +211,18 @@ interface TextDrawText
StateMethod = GetState ; StateMethod = GetState ;
] ]
SID_PARASPACE_INCREASE
[
ExecMethod = Execute;
StateMethod = GetState;
]
SID_PARASPACE_DECREASE
[
ExecMethod = Execute;
StateMethod = GetState;
]
SID_ATTR_PARA_LINESPACE // api: SID_ATTR_PARA_LINESPACE // api:
[ [
ExecMethod = Execute ; ExecMethod = Execute ;
......
...@@ -193,6 +193,31 @@ void SwAnnotationShell::Exec( SfxRequest &rReq ) ...@@ -193,6 +193,31 @@ void SwAnnotationShell::Exec( SfxRequest &rReq )
sal_uInt16 nEEWhich = 0; sal_uInt16 nEEWhich = 0;
switch (nSlot) switch (nSlot)
{ {
case SID_PARASPACE_INCREASE:
case SID_PARASPACE_DECREASE:
{
SvxULSpaceItem aULSpace(
static_cast< const SvxULSpaceItem& >( aEditAttr.Get( EE_PARA_ULSPACE ) ) );
sal_uInt16 nUpper = aULSpace.GetUpper();
sal_uInt16 nLower = aULSpace.GetLower();
if ( nSlot == SID_PARASPACE_INCREASE )
{
nUpper = std::min< sal_uInt16 >( nUpper + 57, 5670 );
nLower = std::min< sal_uInt16 >( nLower + 57, 5670 );
}
else
{
nUpper = std::max< sal_Int16 >( nUpper - 57, 0 );
nLower = std::max< sal_Int16 >( nLower - 57, 0 );
}
aULSpace.SetUpper( nUpper );
aULSpace.SetLower( nLower );
aNewAttr.Put( aULSpace );
rReq.Done();
}
break;
case SID_ATTR_PARA_LRSPACE: case SID_ATTR_PARA_LRSPACE:
{ {
SvxLRSpaceItem aParaMargin(static_cast<const SvxLRSpaceItem&>(rReq. SvxLRSpaceItem aParaMargin(static_cast<const SvxLRSpaceItem&>(rReq.
...@@ -659,16 +684,29 @@ void SwAnnotationShell::GetState(SfxItemSet& rSet) ...@@ -659,16 +684,29 @@ void SwAnnotationShell::GetState(SfxItemSet& rSet)
} }
break; break;
case SID_ATTR_PARA_ULSPACE: case SID_ATTR_PARA_ULSPACE:
case SID_PARASPACE_INCREASE:
case SID_PARASPACE_DECREASE:
{ {
SfxItemState eState = aEditAttr.GetItemState( EE_PARA_ULSPACE ); SfxItemState eState = aEditAttr.GetItemState( EE_PARA_ULSPACE );
if( eState >= SfxItemState::DEFAULT ) if( eState >= SfxItemState::DEFAULT )
{ {
SvxULSpaceItem aULSpace = static_cast<const SvxULSpaceItem&>( aEditAttr.Get( EE_PARA_ULSPACE ) ); SvxULSpaceItem aULSpace = static_cast<const SvxULSpaceItem&>( aEditAttr.Get( EE_PARA_ULSPACE ) );
if ( !aULSpace.GetUpper() && !aULSpace.GetLower() )
rSet.DisableItem( SID_PARASPACE_DECREASE );
else if ( aULSpace.GetUpper() >= 5670 && aULSpace.GetLower() >= 5670 )
rSet.DisableItem( SID_PARASPACE_INCREASE );
if ( nSlotId == SID_ATTR_PARA_ULSPACE )
{
aULSpace.SetWhich(SID_ATTR_PARA_ULSPACE); aULSpace.SetWhich(SID_ATTR_PARA_ULSPACE);
rSet.Put(aULSpace); rSet.Put(aULSpace);
} }
}
else else
rSet.InvalidateItem(nSlotId); {
rSet.DisableItem( SID_PARASPACE_INCREASE );
rSet.DisableItem( SID_PARASPACE_DECREASE );
rSet.InvalidateItem( SID_ATTR_PARA_ULSPACE );
}
} }
break; break;
case SID_ATTR_CHAR_FONT: case SID_ATTR_CHAR_FONT:
......
...@@ -242,7 +242,31 @@ void SwDrawTextShell::Execute( SfxRequest &rReq ) ...@@ -242,7 +242,31 @@ void SwDrawTextShell::Execute( SfxRequest &rReq )
rReq.Done(); rReq.Done();
} }
break; break;
case SID_PARASPACE_INCREASE:
case SID_PARASPACE_DECREASE:
{
SvxULSpaceItem aULSpace(
static_cast< const SvxULSpaceItem& >( aEditAttr.Get( EE_PARA_ULSPACE ) ) );
sal_uInt16 nUpper = aULSpace.GetUpper();
sal_uInt16 nLower = aULSpace.GetLower();
if ( nSlot == SID_PARASPACE_INCREASE )
{
nUpper = std::min< sal_uInt16 >( nUpper + 57, 5670 );
nLower = std::min< sal_uInt16 >( nLower + 57, 5670 );
}
else
{
nUpper = std::max< sal_Int16 >( nUpper - 57, 0 );
nLower = std::max< sal_Int16 >( nLower - 57, 0 );
}
aULSpace.SetUpper( nUpper );
aULSpace.SetLower( nLower );
aNewAttr.Put( aULSpace );
rReq.Done();
}
break;
case SID_ATTR_PARA_LINESPACE_10: case SID_ATTR_PARA_LINESPACE_10:
{ {
SvxLineSpacingItem aItem(SVX_LINESPACE_ONE_LINE, EE_PARA_SBL); SvxLineSpacingItem aItem(SVX_LINESPACE_ONE_LINE, EE_PARA_SBL);
...@@ -695,16 +719,29 @@ ASK_ADJUST: ...@@ -695,16 +719,29 @@ ASK_ADJUST:
} }
break; break;
case SID_ATTR_PARA_ULSPACE: case SID_ATTR_PARA_ULSPACE:
case SID_PARASPACE_INCREASE:
case SID_PARASPACE_DECREASE:
{ {
SfxItemState eState = aEditAttr.GetItemState(EE_PARA_ULSPACE); SfxItemState eState = aEditAttr.GetItemState(EE_PARA_ULSPACE);
if( eState >= SfxItemState::DEFAULT ) if( eState >= SfxItemState::DEFAULT )
{ {
SvxULSpaceItem aULSpace = static_cast<const SvxULSpaceItem&>( aEditAttr.Get( EE_PARA_ULSPACE ) ); SvxULSpaceItem aULSpace = static_cast<const SvxULSpaceItem&>( aEditAttr.Get( EE_PARA_ULSPACE ) );
if ( !aULSpace.GetUpper() && !aULSpace.GetLower() )
rSet.DisableItem( SID_PARASPACE_DECREASE );
else if ( aULSpace.GetUpper() >= 5670 && aULSpace.GetLower() >= 5670 )
rSet.DisableItem( SID_PARASPACE_INCREASE );
if ( nSlotId == SID_ATTR_PARA_ULSPACE )
{
aULSpace.SetWhich(SID_ATTR_PARA_ULSPACE); aULSpace.SetWhich(SID_ATTR_PARA_ULSPACE);
rSet.Put(aULSpace); rSet.Put(aULSpace);
} }
}
else else
rSet.InvalidateItem(nSlotId); {
rSet.DisableItem( SID_PARASPACE_INCREASE );
rSet.DisableItem( SID_PARASPACE_DECREASE );
rSet.InvalidateItem( SID_ATTR_PARA_ULSPACE );
}
nSlotId = 0; nSlotId = 0;
} }
break; break;
......
...@@ -751,7 +751,40 @@ void SwView::ExecTabWin( SfxRequest& rReq ) ...@@ -751,7 +751,40 @@ void SwView::ExecTabWin( SfxRequest& rReq )
rSh.SetAttrItem( aParaMargin ); rSh.SetAttrItem( aParaMargin );
} }
break; break;
case SID_PARASPACE_INCREASE:
case SID_PARASPACE_DECREASE:
{
SfxItemSet aULSpaceSet( GetPool(), RES_UL_SPACE, RES_UL_SPACE );
rSh.GetCurAttr( aULSpaceSet );
SvxULSpaceItem aULSpace(
static_cast< const SvxULSpaceItem& >( aULSpaceSet.Get( RES_UL_SPACE ) ) );
sal_uInt16 nUpper = aULSpace.GetUpper();
sal_uInt16 nLower = aULSpace.GetLower();
if ( nSlot == SID_PARASPACE_INCREASE )
{
nUpper = std::min< sal_uInt16 >( nUpper + 57, 5670 );
nLower = std::min< sal_uInt16 >( nLower + 57, 5670 );
}
else
{
nUpper = std::max< sal_Int16 >( nUpper - 57, 0 );
nLower = std::max< sal_Int16 >( nLower - 57, 0 );
}
aULSpace.SetUpper( nUpper );
aULSpace.SetLower( nLower );
SwTxtFmtColl* pColl = rSh.GetCurTxtFmtColl();
if( pColl && pColl->IsAutoUpdateFmt() )
{
aULSpaceSet.Put( aULSpace );
rSh.AutoUpdatePara( pColl, aULSpaceSet );
}
else
rSh.SetAttrItem( aULSpace );
}
break;
case SID_RULER_BORDERS_VERTICAL: case SID_RULER_BORDERS_VERTICAL:
case SID_RULER_BORDERS: case SID_RULER_BORDERS:
if ( pReqArgs ) if ( pReqArgs )
...@@ -1253,15 +1286,29 @@ void SwView::StateTabWin(SfxItemSet& rSet) ...@@ -1253,15 +1286,29 @@ void SwView::StateTabWin(SfxItemSet& rSet)
} }
case SID_ATTR_PARA_ULSPACE: case SID_ATTR_PARA_ULSPACE:
case SID_PARASPACE_INCREASE:
case SID_PARASPACE_DECREASE:
{ {
SvxULSpaceItem aUL = static_cast<const SvxULSpaceItem&>(aCoreSet.Get(RES_UL_SPACE)); SvxULSpaceItem aUL = static_cast<const SvxULSpaceItem&>(aCoreSet.Get(RES_UL_SPACE));
aUL.SetWhich(nWhich);
SfxItemState e = aCoreSet.GetItemState(RES_UL_SPACE); SfxItemState e = aCoreSet.GetItemState(RES_UL_SPACE);
if( e >= SfxItemState::DEFAULT ) if( e >= SfxItemState::DEFAULT )
{
if ( !aUL.GetUpper() && !aUL.GetLower() )
rSet.DisableItem( SID_PARASPACE_DECREASE );
else if ( aUL.GetUpper() >= 5670 && aUL.GetLower() >= 5670 )
rSet.DisableItem( SID_PARASPACE_INCREASE );
if ( nWhich == SID_ATTR_PARA_ULSPACE )
{
aUL.SetWhich( SID_ATTR_PARA_ULSPACE );
rSet.Put( aUL ); rSet.Put( aUL );
}
}
else else
rSet.InvalidateItem(nWhich); {
rSet.DisableItem( SID_PARASPACE_INCREASE );
rSet.DisableItem( SID_PARASPACE_DECREASE );
rSet.InvalidateItem( SID_ATTR_PARA_ULSPACE );
}
} }
break; break;
......
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