summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/svx/svxids.hrc4
-rw-r--r--sc/sdi/drtxtob.sdi2
-rw-r--r--sc/source/ui/drawfunc/drtxtob.cxx38
-rw-r--r--sd/inc/app.hrc3
-rw-r--r--sd/sdi/sdraw.sdi52
-rw-r--r--svx/sdi/svx.sdi47
-rw-r--r--svx/source/sidebar/paragraph/ParaPropertyPanel.cxx77
-rw-r--r--svx/source/sidebar/paragraph/ParaPropertyPanel.hxx2
-rw-r--r--svx/uiconfig/ui/sidebarparagraph.ui8
-rw-r--r--sw/sdi/_annotsh.sdi11
-rw-r--r--sw/sdi/_viewsh.sdi12
-rw-r--r--sw/sdi/drwtxtsh.sdi12
-rw-r--r--sw/source/uibase/shells/annotsh.cxx46
-rw-r--r--sw/source/uibase/shells/drwtxtex.cxx43
-rw-r--r--sw/source/uibase/uiview/viewtab.cxx55
15 files changed, 259 insertions, 153 deletions
diff --git a/include/svx/svxids.hrc b/include/svx/svxids.hrc
index 23a9df59f6f9..beaf54f1d3c9 100644
--- a/include/svx/svxids.hrc
+++ b/include/svx/svxids.hrc
@@ -1002,9 +1002,11 @@
//UUUU
#define SID_OFFER_IMPORT ( SID_SVX_START + 1143 )
#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
-#define SID_SVX_FIRSTFREE (SID_DRAWINGLAYER_FILLSTYLES + 1)
+#define SID_SVX_FIRSTFREE (SID_PARASPACE_DECREASE + 1)
// Overflow check for slot IDs
diff --git a/sc/sdi/drtxtob.sdi b/sc/sdi/drtxtob.sdi
index 903f6ee0a9af..9a77b17ca9a5 100644
--- a/sc/sdi/drtxtob.sdi
+++ b/sc/sdi/drtxtob.sdi
@@ -92,6 +92,8 @@ interface TableDrawText
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_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_SUB_SCRIPT [ ExecMethod = ExecuteAttr; StateMethod = GetAttrState; Export = FALSE; ]
SID_ATTR_CHAR_KERNING [ ExecMethod = ExecuteAttr; StateMethod = GetAttrState; Export = FALSE; ]
diff --git a/sc/source/ui/drawfunc/drtxtob.cxx b/sc/source/ui/drawfunc/drtxtob.cxx
index 06f5d7bfc2a0..4f7637baef5b 100644
--- a/sc/source/ui/drawfunc/drtxtob.cxx
+++ b/sc/source/ui/drawfunc/drtxtob.cxx
@@ -761,6 +761,31 @@ void ScDrawTextObjectBar::ExecuteAttr( SfxRequest &rReq )
}
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:
bSet = false;
}
@@ -1023,9 +1048,20 @@ void ScDrawTextObjectBar::GetAttrState( SfxItemSet& rDestSet )
aULSP.SetWhich(SID_ATTR_PARA_ULSPACE);
rDestSet.Put(aULSP);
Invalidate(SID_ATTR_PARA_ULSPACE);
+ Invalidate(SID_PARASPACE_INCREASE);
+ Invalidate(SID_PARASPACE_DECREASE);
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);
+ }
// Zeilenabstand
diff --git a/sd/inc/app.hrc b/sd/inc/app.hrc
index 213057745ff8..a39734f959b0 100644
--- a/sd/inc/app.hrc
+++ b/sd/inc/app.hrc
@@ -360,8 +360,7 @@
#define SID_EXPAND_PAGE (SID_SD_START+343)
#define SID_SUMMARY_PAGE (SID_SD_START+344)
#define SID_LEAVE_ALL_GROUPS (SID_SD_START+345)
-#define SID_PARASPACE_INCREASE (SID_SD_START+346)
-#define SID_PARASPACE_DECREASE (SID_SD_START+347)
+// free
#define SID_SLIDE_MASTERPAGE (SID_SD_START+348)
#define SID_HANDOUT_MASTERPAGE (SID_SD_START+349)
#define SID_NOTES_MASTERPAGE (SID_SD_START+350)
diff --git a/sd/sdi/sdraw.sdi b/sd/sdi/sdraw.sdi
index a397d021ad1c..1de1319c0dff 100644
--- a/sd/sdi/sdraw.sdi
+++ b/sd/sdi/sdraw.sdi
@@ -4897,58 +4897,6 @@ SfxStringItem PageStatus SID_STATUS_PAGE
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
[
diff --git a/svx/sdi/svx.sdi b/svx/sdi/svx.sdi
index 565ee340d1f2..c312f1f9bf58 100644
--- a/svx/sdi/svx.sdi
+++ b/svx/sdi/svx.sdi
@@ -16167,3 +16167,50 @@ SfxVoidItem FormatCellBorders SID_CELL_FORMAT_BORDER
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;
+]
diff --git a/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx b/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx
index e6949e41339a..9d10e21750e6 100644
--- a/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx
+++ b/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx
@@ -44,16 +44,12 @@ const char UNO_PROMOTE[] = ".uno:Promote";
const char UNO_DEMOTE[] = ".uno:Demote";
const char UNO_HANGINGINDENT2[] = ".uno:HangingIndent2";
-const char UNO_PARASPACEINC[] = ".uno:ParaspaceIncrease";
-const char UNO_PARASPACEDEC[] = ".uno:ParaspaceDecrease";
-
namespace svx {namespace sidebar {
#define DEFAULT_VALUE 0
#define MAX_DURCH 5670
#define INDENT_STEP 706
-#define UL_STEP 58
#define MAX_SW 1709400
#define MAX_SC_SD 116220200
@@ -246,24 +242,6 @@ void ParaPropertyPanel::InitToolBoxSpacing()
mpTopDist->SetAccessibleName(mpTopDist->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();
}
@@ -405,57 +383,6 @@ IMPL_LINK_NOARG( ParaPropertyPanel, ULSpaceHdl_Impl)
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
void ParaPropertyPanel::NotifyItemUpdate(
sal_uInt16 nSID,
@@ -677,19 +604,16 @@ void ParaPropertyPanel::StateChangedULImpl( sal_uInt16 /*nSID*/, SfxItemState eS
nVal = OutputDevice::LogicToLogic( maLower, (MapUnit)(SFX_MAPUNIT_TWIP), MAP_100TH_MM );
nVal = mpBottomDist->Normalize( nVal );
mpBottomDist->SetValue( nVal, FUNIT_100TH_MM );
- mpTbxUL_IncDec->Enable();
}
else if(eState == SfxItemState::DISABLED )
{
mpTopDist->Disable();
mpBottomDist->Disable();
- mpTbxUL_IncDec->Disable();
}
else
{
mpTopDist->SetEmptyFieldValue();
mpBottomDist->SetEmptyFieldValue();
- mpTbxUL_IncDec->Disable();
}
}
@@ -821,7 +745,6 @@ ParaPropertyPanel::ParaPropertyPanel(vcl::Window* pParent,
get(mpTbxIndent_IncDec, "indent");
get(mpTbxProDemote, "promotedemote");
- get(mpTbxUL_IncDec, "paraspacing");
initial();
m_aMetricCtl.RequestUpdate();
diff --git a/svx/source/sidebar/paragraph/ParaPropertyPanel.hxx b/svx/source/sidebar/paragraph/ParaPropertyPanel.hxx
index 8d4782500ac0..c61c1c89be94 100644
--- a/svx/source/sidebar/paragraph/ParaPropertyPanel.hxx
+++ b/svx/source/sidebar/paragraph/ParaPropertyPanel.hxx
@@ -71,7 +71,6 @@ private:
ToolBox* mpTBxNumBullet;
ToolBox* mpTBxBackColor;
//Paragraph spacing
- ToolBox* mpTbxUL_IncDec;
SvxRelativeField* mpTopDist;
SvxRelativeField* mpBottomDist;
ToolBox* mpTbxIndent_IncDec;
@@ -120,7 +119,6 @@ private:
DECL_LINK(ClickIndent_IncDec_Hdl_Impl, ToolBox*);
DECL_LINK(ClickProDemote_Hdl_Impl, ToolBox*);
DECL_LINK(ULSpaceHdl_Impl, void*);
- DECL_LINK(ClickUL_IncDec_Hdl_Impl, ToolBox*);
void StateChangedIndentImpl( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState );
void StateChangedULImpl( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState );
diff --git a/svx/uiconfig/ui/sidebarparagraph.ui b/svx/uiconfig/ui/sidebarparagraph.ui
index b50ab98c5e7a..df0acc34561a 100644
--- a/svx/uiconfig/ui/sidebarparagraph.ui
+++ b/svx/uiconfig/ui/sidebarparagraph.ui
@@ -278,7 +278,7 @@
</packing>
</child>
<child>
- <object class="GtkToolbar" id="paraspacing">
+ <object class="sfxlo-SidebarToolBox" id="paraspacing">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="has_tooltip">True</property>
@@ -286,12 +286,8 @@
<property name="show_arrow">False</property>
<child>
<object class="GtkToolButton" id="paraspaceinc">
- <property name="width_request">25</property>
- <property name="height_request">25</property>
<property name="visible">True</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="use_underline">True</property>
</object>
@@ -304,8 +300,6 @@
<object class="GtkToolButton" id="paraspacedec">
<property name="visible">True</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="use_underline">True</property>
</object>
diff --git a/sw/sdi/_annotsh.sdi b/sw/sdi/_annotsh.sdi
index 15f03adf89d0..232388c69187 100644
--- a/sw/sdi/_annotsh.sdi
+++ b/sw/sdi/_annotsh.sdi
@@ -198,6 +198,17 @@ interface _Annotation
StateMethod = GetState ;
]
+ SID_PARASPACE_INCREASE
+ [
+ ExecMethod = Exec;
+ StateMethod = GetState;
+ ]
+ SID_PARASPACE_DECREASE
+ [
+ ExecMethod = Exec;
+ StateMethod = GetState;
+ ]
+
FN_INSERT_STRING
[
ExecMethod = Exec ;
diff --git a/sw/sdi/_viewsh.sdi b/sw/sdi/_viewsh.sdi
index 357894cd964e..5e35f90c7f54 100644
--- a/sw/sdi/_viewsh.sdi
+++ b/sw/sdi/_viewsh.sdi
@@ -427,6 +427,18 @@ interface BaseTextEditView
StateMethod = StateTabWin ;
]
+ SID_PARASPACE_INCREASE
+ [
+ ExecMethod = ExecTabWin;
+ StateMethod = StateTabWin;
+ ]
+
+ SID_PARASPACE_DECREASE
+ [
+ ExecMethod = ExecTabWin;
+ StateMethod = StateTabWin;
+ ]
+
SID_ATTR_PAGE_COLUMN
[
ExecMethod = ExecTabWin ;
diff --git a/sw/sdi/drwtxtsh.sdi b/sw/sdi/drwtxtsh.sdi
index 20bba4f911fc..53ed9110ef09 100644
--- a/sw/sdi/drwtxtsh.sdi
+++ b/sw/sdi/drwtxtsh.sdi
@@ -211,6 +211,18 @@ interface TextDrawText
StateMethod = GetState ;
]
+ SID_PARASPACE_INCREASE
+ [
+ ExecMethod = Execute;
+ StateMethod = GetState;
+ ]
+
+ SID_PARASPACE_DECREASE
+ [
+ ExecMethod = Execute;
+ StateMethod = GetState;
+ ]
+
SID_ATTR_PARA_LINESPACE // api:
[
ExecMethod = Execute ;
diff --git a/sw/source/uibase/shells/annotsh.cxx b/sw/source/uibase/shells/annotsh.cxx
index 250b73b1c58a..b41a6070f209 100644
--- a/sw/source/uibase/shells/annotsh.cxx
+++ b/sw/source/uibase/shells/annotsh.cxx
@@ -193,6 +193,31 @@ void SwAnnotationShell::Exec( SfxRequest &rReq )
sal_uInt16 nEEWhich = 0;
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:
{
SvxLRSpaceItem aParaMargin(static_cast<const SvxLRSpaceItem&>(rReq.
@@ -659,18 +684,31 @@ void SwAnnotationShell::GetState(SfxItemSet& rSet)
}
break;
case SID_ATTR_PARA_ULSPACE:
+ case SID_PARASPACE_INCREASE:
+ case SID_PARASPACE_DECREASE:
{
SfxItemState eState = aEditAttr.GetItemState( EE_PARA_ULSPACE );
if( eState >= SfxItemState::DEFAULT )
{
SvxULSpaceItem aULSpace = static_cast<const SvxULSpaceItem&>( aEditAttr.Get( EE_PARA_ULSPACE ) );
- aULSpace.SetWhich(SID_ATTR_PARA_ULSPACE);
- rSet.Put(aULSpace);
+ 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);
+ rSet.Put(aULSpace);
+ }
}
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_FONTHEIGHT:
case SID_ATTR_CHAR_WEIGHT:
diff --git a/sw/source/uibase/shells/drwtxtex.cxx b/sw/source/uibase/shells/drwtxtex.cxx
index 1104ea63bdb6..eb1b039f79ab 100644
--- a/sw/source/uibase/shells/drwtxtex.cxx
+++ b/sw/source/uibase/shells/drwtxtex.cxx
@@ -242,7 +242,31 @@ void SwDrawTextShell::Execute( SfxRequest &rReq )
rReq.Done();
}
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:
{
SvxLineSpacingItem aItem(SVX_LINESPACE_ONE_LINE, EE_PARA_SBL);
@@ -695,16 +719,29 @@ ASK_ADJUST:
}
break;
case SID_ATTR_PARA_ULSPACE:
+ case SID_PARASPACE_INCREASE:
+ case SID_PARASPACE_DECREASE:
{
SfxItemState eState = aEditAttr.GetItemState(EE_PARA_ULSPACE);
if( eState >= SfxItemState::DEFAULT )
{
SvxULSpaceItem aULSpace = static_cast<const SvxULSpaceItem&>( aEditAttr.Get( EE_PARA_ULSPACE ) );
- aULSpace.SetWhich(SID_ATTR_PARA_ULSPACE);
- rSet.Put(aULSpace);
+ 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);
+ rSet.Put(aULSpace);
+ }
}
else
- rSet.InvalidateItem(nSlotId);
+ {
+ rSet.DisableItem( SID_PARASPACE_INCREASE );
+ rSet.DisableItem( SID_PARASPACE_DECREASE );
+ rSet.InvalidateItem( SID_ATTR_PARA_ULSPACE );
+ }
nSlotId = 0;
}
break;
diff --git a/sw/source/uibase/uiview/viewtab.cxx b/sw/source/uibase/uiview/viewtab.cxx
index d34fd736c3d2..e8d99b1d6c7f 100644
--- a/sw/source/uibase/uiview/viewtab.cxx
+++ b/sw/source/uibase/uiview/viewtab.cxx
@@ -751,7 +751,40 @@ void SwView::ExecTabWin( SfxRequest& rReq )
rSh.SetAttrItem( aParaMargin );
}
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:
if ( pReqArgs )
@@ -1253,15 +1286,29 @@ void SwView::StateTabWin(SfxItemSet& rSet)
}
case SID_ATTR_PARA_ULSPACE:
+ case SID_PARASPACE_INCREASE:
+ case SID_PARASPACE_DECREASE:
{
SvxULSpaceItem aUL = static_cast<const SvxULSpaceItem&>(aCoreSet.Get(RES_UL_SPACE));
- aUL.SetWhich(nWhich);
-
SfxItemState e = aCoreSet.GetItemState(RES_UL_SPACE);
if( e >= SfxItemState::DEFAULT )
- rSet.Put( aUL );
+ {
+ 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 );
+ }
+ }
else
- rSet.InvalidateItem(nWhich);
+ {
+ rSet.DisableItem( SID_PARASPACE_INCREASE );
+ rSet.DisableItem( SID_PARASPACE_DECREASE );
+ rSet.InvalidateItem( SID_ATTR_PARA_ULSPACE );
+ }
}
break;