Make HangingIndent a command

New command .uno:HangingIndent.
Code moved from the sidebar to slots.

Change-Id: Ib389f9fb3368409a90cf90ad8b19f1be322fa120
Reviewed-on: https://gerrit.libreoffice.org/35930
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
This commit is contained in:
Szymon Kłos
2017-03-30 23:45:44 +02:00
committed by Samuel Mehrbrodt
parent 387cdc35d7
commit c1351a7b13
24 changed files with 109 additions and 183 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 525 B

View File

Before

Width:  |  Height:  |  Size: 135 B

After

Width:  |  Height:  |  Size: 135 B

View File

Before

Width:  |  Height:  |  Size: 245 B

After

Width:  |  Height:  |  Size: 245 B

View File

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 4.5 KiB

View File

Before

Width:  |  Height:  |  Size: 526 B

After

Width:  |  Height:  |  Size: 526 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 525 B

View File

Before

Width:  |  Height:  |  Size: 633 B

After

Width:  |  Height:  |  Size: 633 B

View File

Before

Width:  |  Height:  |  Size: 226 B

After

Width:  |  Height:  |  Size: 226 B

View File

Before

Width:  |  Height:  |  Size: 416 B

After

Width:  |  Height:  |  Size: 416 B

View File

@@ -78,6 +78,7 @@
#define SID_ATTR_PARA_MODEL ( SID_SVX_START + 65 ) #define SID_ATTR_PARA_MODEL ( SID_SVX_START + 65 )
#define SID_ATTR_PARA_KEEP ( SID_SVX_START + 66 ) #define SID_ATTR_PARA_KEEP ( SID_SVX_START + 66 )
#define SID_ATTR_CHAR_AUTOKERN ( SID_SVX_START + 67 ) #define SID_ATTR_CHAR_AUTOKERN ( SID_SVX_START + 67 )
#define SID_HANGING_INDENT ( SID_SVX_START + 68 )
#define SID_ATTR_PARA_BULLET ( SID_SVX_START + 250 ) #define SID_ATTR_PARA_BULLET ( SID_SVX_START + 250 )
#define SID_ATTR_PARA_OUTLLEVEL ( SID_SVX_START + 300 ) #define SID_ATTR_PARA_OUTLLEVEL ( SID_SVX_START + 300 )
#define SID_ATTR_PARA_REGISTER ( SID_SVX_START + 413 ) #define SID_ATTR_PARA_REGISTER ( SID_SVX_START + 413 )

View File

@@ -945,7 +945,6 @@
// sidebar-related resources // sidebar-related resources
#define RID_SVX_SIDEBAR_BEGIN (RID_SVX_START + 1242) #define RID_SVX_SIDEBAR_BEGIN (RID_SVX_START + 1242)
#define BMP_INDENT_HANG (RID_SVX_SIDEBAR_BEGIN + 1)
#define BMP_NONE_ICON (RID_SVX_SIDEBAR_BEGIN + 21) #define BMP_NONE_ICON (RID_SVX_SIDEBAR_BEGIN + 21)
#define BMP_WIDTH1_ICON (RID_SVX_SIDEBAR_BEGIN + 22) #define BMP_WIDTH1_ICON (RID_SVX_SIDEBAR_BEGIN + 22)
#define BMP_WIDTH2_ICON (RID_SVX_SIDEBAR_BEGIN + 23) #define BMP_WIDTH2_ICON (RID_SVX_SIDEBAR_BEGIN + 23)

View File

@@ -2228,6 +2228,14 @@
<value xml:lang="en-US">Presentation ~Object...</value> <value xml:lang="en-US">Presentation ~Object...</value>
</prop> </prop>
</node> </node>
<node oor:name=".uno:HangingIndent" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">Hanging Indent</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
<value>1</value>
</prop>
</node>
</node> </node>
</node> </node>
</oor:component-data> </oor:component-data>

View File

@@ -2910,6 +2910,14 @@
<value>1</value> <value>1</value>
</prop> </prop>
</node> </node>
<node oor:name=".uno:HangingIndent" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">Hanging Indent</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
<value>1</value>
</prop>
</node>
</node> </node>
</node> </node>
</oor:component-data> </oor:component-data>

View File

@@ -197,6 +197,12 @@ shell TextObjectBar
StateMethod = GetAttrState; StateMethod = GetAttrState;
] ]
SID_HANGING_INDENT
[
ExecMethod = Execute ;
StateMethod = GetAttrState;
]
SID_OUTLINE_LEFT // ole : no, status : ? SID_OUTLINE_LEFT // ole : no, status : ?
[ [
ExecMethod = Execute ; ExecMethod = Execute ;

View File

@@ -277,6 +277,23 @@ void TextObjectBar::Execute( SfxRequest &rReq )
} }
break; break;
case SID_HANGING_INDENT:
{
SfxItemSet aLRSpaceSet( GetPool(), EE_PARA_LRSPACE, EE_PARA_LRSPACE );
mpView->GetAttributes( aLRSpaceSet );
SvxLRSpaceItem aParaMargin( static_cast<const SvxLRSpaceItem&>( aLRSpaceSet.Get( EE_PARA_LRSPACE ) ) );
SvxLRSpaceItem aNewMargin( EE_PARA_LRSPACE );
aNewMargin.SetTextLeft( aParaMargin.GetTextLeft() + aParaMargin.GetTextFirstLineOfst() );
aNewMargin.SetRight( aParaMargin.GetRight() );
aNewMargin.SetTextFirstLineOfst( ( aParaMargin.GetTextFirstLineOfst() ) * (-1) );
aLRSpaceSet.Put( aNewMargin );
mpView->SetAttributes( aLRSpaceSet );
Invalidate(SID_ATTR_PARA_LRSPACE);
}
break;
case SID_OUTLINE_UP: case SID_OUTLINE_UP:
{ {
if (pOLV) if (pOLV)

View File

@@ -69,7 +69,6 @@ $(eval $(call gb_SrsTarget_add_files,svx/res,\
svx/source/items/svxitems.src \ svx/source/items/svxitems.src \
svx/source/sidebar/area/AreaPropertyPanel.src \ svx/source/sidebar/area/AreaPropertyPanel.src \
svx/source/sidebar/line/LinePropertyPanel.src \ svx/source/sidebar/line/LinePropertyPanel.src \
svx/source/sidebar/paragraph/ParaPropertyPanel.src \
svx/source/stbctrls/stbctrls.src \ svx/source/stbctrls/stbctrls.src \
svx/source/svdraw/svdstr.src \ svx/source/svdraw/svdstr.src \
svx/source/table/table.src \ svx/source/table/table.src \

View File

@@ -11955,3 +11955,21 @@ SfxUInt16Item CurrentOutlineType FN_OUTLINE_RULE_INDEX
ToolBoxConfig = FALSE, ToolBoxConfig = FALSE,
GroupId = GID_ENUMERATION; GroupId = GID_ENUMERATION;
] ]
SfxVoidItem HangingIndent SID_HANGING_INDENT
[
AutoUpdate = FALSE,
FastCall = TRUE,
ReadOnlyDoc = FALSE,
Toggle = FALSE,
Container = FALSE,
RecordAbsolute = FALSE,
RecordPerSet;
AccelConfig = FALSE,
MenuConfig = FALSE,
ToolBoxConfig = TRUE,
GroupId = GID_FORMAT;
]

View File

@@ -35,17 +35,11 @@
using namespace css; using namespace css;
using namespace css::uno; using namespace css::uno;
const char UNO_INCREMENTINDENT[] = ".uno:IncrementIndent";
const char UNO_DECREMENTINDENT[] = ".uno:DecrementIndent";
const char UNO_HANGINGINDENT[] = ".uno:HangingIndent";
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 MAX_SW 1709400 #define MAX_SW 1709400
#define MAX_SC_SD 116220200 #define MAX_SC_SD 116220200
#define NEGA_MAXVALUE -10000000 #define NEGA_MAXVALUE -10000000
@@ -155,10 +149,6 @@ void ParaPropertyPanel::InitToolBoxIndent()
mpRightIndent->SetModifyHdl( aLink ); mpRightIndent->SetModifyHdl( aLink );
mpFLineIndent->SetModifyHdl( aLink ); mpFLineIndent->SetModifyHdl( aLink );
const sal_uInt16 nIdHanging = mpTbxIndent_IncDec->GetItemId(UNO_HANGINGINDENT);
mpTbxIndent_IncDec->SetItemImage(nIdHanging, maIndHang);
mpTbxIndent_IncDec->SetSelectHdl(LINK( this, ParaPropertyPanel, ClickIndent_IncDec_Hdl_Impl ));
m_eLRSpaceUnit = maLRSpaceControl.GetCoreMetric(); m_eLRSpaceUnit = maLRSpaceControl.GetCoreMetric();
m_eLRSpaceUnit = maLRSpaceControl.GetCoreMetric(); m_eLRSpaceUnit = maLRSpaceControl.GetCoreMetric();
} }
@@ -191,84 +181,6 @@ IMPL_LINK_NOARG( ParaPropertyPanel, ModifyIndentHdl_Impl, Edit&, void)
SID_ATTR_PARA_LRSPACE, SfxCallMode::RECORD, { &aMargin }); SID_ATTR_PARA_LRSPACE, SfxCallMode::RECORD, { &aMargin });
} }
IMPL_LINK(ParaPropertyPanel, ClickIndent_IncDec_Hdl_Impl, ToolBox *, pControl, void)
{
const OUString aCommand(pControl->GetItemCommand(pControl->GetCurItemId()));
if (aCommand == UNO_INCREMENTINDENT)
{
switch (maContext.GetCombinedContext_DI())
{
case CombinedEnumContext(Application::WriterVariants, Context::Default):
case CombinedEnumContext(Application::WriterVariants, Context::Text):
case CombinedEnumContext(Application::WriterVariants, Context::Table):
{
SfxBoolItem aMargin( SID_INC_INDENT, true );
GetBindings()->GetDispatcher()->ExecuteList(
SID_INC_INDENT, SfxCallMode::RECORD, { &aMargin });
}
break;
default:
{
SvxLRSpaceItem aMargin( SID_ATTR_PARA_LRSPACE );
maTxtLeft += INDENT_STEP;
sal_Int64 nVal = OutputDevice::LogicToLogic( maTxtLeft, MapUnit::MapTwip, MapUnit::Map100thMM );
nVal = OutputDevice::LogicToLogic( (long)nVal, MapUnit::Map100thMM, m_eLRSpaceUnit );
aMargin.SetTextLeft( (const long)nVal );
aMargin.SetRight( (const long)GetCoreValue( *mpRightIndent, m_eLRSpaceUnit ) );
aMargin.SetTextFirstLineOfst( (const short)GetCoreValue( *mpFLineIndent, m_eLRSpaceUnit ) );
GetBindings()->GetDispatcher()->ExecuteList(
SID_ATTR_PARA_LRSPACE, SfxCallMode::RECORD, { &aMargin });
}
}
}
else if (aCommand == UNO_DECREMENTINDENT)
{
switch (maContext.GetCombinedContext_DI())
{
case CombinedEnumContext(Application::WriterVariants, Context::Default):
case CombinedEnumContext(Application::WriterVariants, Context::Text):
case CombinedEnumContext(Application::WriterVariants, Context::Table):
{
SfxBoolItem aMargin( SID_DEC_INDENT, true );
GetBindings()->GetDispatcher()->ExecuteList(
SID_DEC_INDENT, SfxCallMode::RECORD, { &aMargin });
}
break;
default:
{
if((maTxtLeft - INDENT_STEP) < 0)
maTxtLeft = DEFAULT_VALUE;
else
maTxtLeft -= INDENT_STEP;
SvxLRSpaceItem aMargin( SID_ATTR_PARA_LRSPACE );
sal_Int64 nVal = OutputDevice::LogicToLogic( maTxtLeft, MapUnit::MapTwip, MapUnit::Map100thMM );
nVal = OutputDevice::LogicToLogic( (long)nVal, MapUnit::Map100thMM, m_eLRSpaceUnit );
aMargin.SetTextLeft( (const long)nVal );
aMargin.SetRight( (const long)GetCoreValue( *mpRightIndent, m_eLRSpaceUnit ) );
aMargin.SetTextFirstLineOfst( (const short)GetCoreValue( *mpFLineIndent, m_eLRSpaceUnit ) );
GetBindings()->GetDispatcher()->ExecuteList(
SID_ATTR_PARA_LRSPACE, SfxCallMode::RECORD, { &aMargin });
}
}
}
else if (aCommand == UNO_HANGINGINDENT)
{
SvxLRSpaceItem aMargin( SID_ATTR_PARA_LRSPACE );
aMargin.SetTextLeft( (const long)GetCoreValue( *mpLeftIndent, m_eLRSpaceUnit ) + (const short)GetCoreValue( *mpFLineIndent, m_eLRSpaceUnit ) );
aMargin.SetRight( (const long)GetCoreValue( *mpRightIndent, m_eLRSpaceUnit ) );
aMargin.SetTextFirstLineOfst( ((const short)GetCoreValue( *mpFLineIndent, m_eLRSpaceUnit ))*(-1) );
GetBindings()->GetDispatcher()->ExecuteList(
SID_ATTR_PARA_LRSPACE, SfxCallMode::RECORD, { &aMargin });
}
}
// for Paragraph Spacing // for Paragraph Spacing
IMPL_LINK_NOARG( ParaPropertyPanel, ULSpaceHdl_Impl, Edit&, void) IMPL_LINK_NOARG( ParaPropertyPanel, ULSpaceHdl_Impl, Edit&, void)
@@ -314,11 +226,6 @@ void ParaPropertyPanel::NotifyItemUpdate(
case SID_ATTR_PARA_ULSPACE: case SID_ATTR_PARA_ULSPACE:
StateChangedULImpl( nSID, eState, pState ); StateChangedULImpl( nSID, eState, pState );
break; break;
case SID_INC_INDENT:
case SID_DEC_INDENT:
StateChangeIncDecImpl( nSID, eState, pState );
break;
} }
} }
@@ -352,7 +259,6 @@ void ParaPropertyPanel::StateChangedIndentImpl( sal_uInt16 /*nSID*/, SfxItemStat
break; break;
} }
const sal_uInt16 nIdHangingIndent = mpTbxIndent_IncDec->GetItemId(UNO_HANGINGINDENT);
if( pState && eState >= SfxItemState::DEFAULT ) if( pState && eState >= SfxItemState::DEFAULT )
{ {
const SvxLRSpaceItem* pSpace = static_cast<const SvxLRSpaceItem*>(pState); const SvxLRSpaceItem* pSpace = static_cast<const SvxLRSpaceItem*>(pState);
@@ -412,44 +318,18 @@ void ParaPropertyPanel::StateChangedIndentImpl( sal_uInt16 /*nSID*/, SfxItemStat
long nfVal = OutputDevice::LogicToLogic( aTxtFirstLineOfst, MapUnit::MapTwip, MapUnit::Map100thMM ); long nfVal = OutputDevice::LogicToLogic( aTxtFirstLineOfst, MapUnit::MapTwip, MapUnit::Map100thMM );
nfVal = (long)mpFLineIndent->Normalize( (long)nfVal ); nfVal = (long)mpFLineIndent->Normalize( (long)nfVal );
mpFLineIndent->SetValue( nfVal, FUNIT_100TH_MM ); mpFLineIndent->SetValue( nfVal, FUNIT_100TH_MM );
mpTbxIndent_IncDec->Enable();
const sal_uInt16 nIdIncrIndent = mpTbxIndent_IncDec->GetItemId(UNO_INCREMENTINDENT);
const sal_uInt16 nIdDecrIndent = mpTbxIndent_IncDec->GetItemId(UNO_DECREMENTINDENT);
mpTbxIndent_IncDec->EnableItem(nIdHangingIndent);
if ( maContext.GetCombinedContext_DI() != CombinedEnumContext(Application::WriterVariants, Context::Text)
&& maContext.GetCombinedContext_DI() != CombinedEnumContext(Application::WriterVariants, Context::Default)
&& maContext.GetCombinedContext_DI() != CombinedEnumContext(Application::WriterVariants, Context::Table) )
{
mpTbxIndent_IncDec->EnableItem(nIdIncrIndent);
mpTbxIndent_IncDec->EnableItem(nIdDecrIndent);
}
} }
else if( eState == SfxItemState::DISABLED ) else if( eState == SfxItemState::DISABLED )
{ {
mpLeftIndent-> Disable(); mpLeftIndent-> Disable();
mpRightIndent->Disable(); mpRightIndent->Disable();
mpFLineIndent->Disable(); mpFLineIndent->Disable();
if( maContext.GetCombinedContext_DI() != CombinedEnumContext(Application::WriterVariants, Context::Text) &&
maContext.GetCombinedContext_DI() != CombinedEnumContext(Application::WriterVariants, Context::Default) &&
maContext.GetCombinedContext_DI() != CombinedEnumContext(Application::WriterVariants, Context::Table) )
mpTbxIndent_IncDec->Disable();
else
mpTbxIndent_IncDec->EnableItem(nIdHangingIndent, false);
} }
else else
{ {
mpLeftIndent->SetEmptyFieldValue(); mpLeftIndent->SetEmptyFieldValue();
mpRightIndent->SetEmptyFieldValue(); mpRightIndent->SetEmptyFieldValue();
mpFLineIndent->SetEmptyFieldValue(); mpFLineIndent->SetEmptyFieldValue();
if( maContext.GetCombinedContext_DI() != CombinedEnumContext(Application::WriterVariants, Context::Text) &&
maContext.GetCombinedContext_DI() != CombinedEnumContext(Application::WriterVariants, Context::Default) &&
maContext.GetCombinedContext_DI() != CombinedEnumContext(Application::WriterVariants, Context::Table) )
mpTbxIndent_IncDec->Disable();
else
mpTbxIndent_IncDec->EnableItem(nIdHangingIndent, false);
} }
} }
@@ -490,24 +370,6 @@ void ParaPropertyPanel::StateChangedULImpl( sal_uInt16 /*nSID*/, SfxItemState eS
} }
} }
void ParaPropertyPanel::StateChangeIncDecImpl( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState )
{
if ( ( maContext.GetCombinedContext_DI() == CombinedEnumContext(Application::WriterVariants, Context::Text)
|| maContext.GetCombinedContext_DI() == CombinedEnumContext(Application::WriterVariants, Context::Default)
|| maContext.GetCombinedContext_DI() == CombinedEnumContext(Application::WriterVariants, Context::Table) )
&& ( nSID == SID_INC_INDENT || nSID == SID_DEC_INDENT ) )
{
// Writer's text shell is the only one which provides reasonable states for Slots SID_INC_INDENT and SID_DEC_INDENT
// - namely SfxItemState::UNKNOWN and SfxItemState::DISABLED
const sal_uInt16 nIdIncrIndent = mpTbxIndent_IncDec->GetItemId(UNO_INCREMENTINDENT);
const sal_uInt16 nIdDecrIndent = mpTbxIndent_IncDec->GetItemId(UNO_DECREMENTINDENT);
mpTbxIndent_IncDec->EnableItem(
nSID == SID_INC_INDENT ? nIdIncrIndent : nIdDecrIndent,
pState && eState == SfxItemState::UNKNOWN );
}
}
FieldUnit ParaPropertyPanel::GetCurrentUnit( SfxItemState eState, const SfxPoolItem* pState ) FieldUnit ParaPropertyPanel::GetCurrentUnit( SfxItemState eState, const SfxPoolItem* pState )
{ {
FieldUnit eUnit = FUNIT_NONE; FieldUnit eUnit = FUNIT_NONE;
@@ -545,7 +407,6 @@ ParaPropertyPanel::ParaPropertyPanel(vcl::Window* pParent,
const css::uno::Reference<css::ui::XSidebar>& rxSidebar) const css::uno::Reference<css::ui::XSidebar>& rxSidebar)
: PanelLayout(pParent, "ParaPropertyPanel", "svx/ui/sidebarparagraph.ui", rxFrame), : PanelLayout(pParent, "ParaPropertyPanel", "svx/ui/sidebarparagraph.ui", rxFrame),
maIndHang(BitmapEx(SVX_RES(BMP_INDENT_HANG))),
maTxtLeft (0), maTxtLeft (0),
maUpper (0), maUpper (0),
maLower (0), maLower (0),
@@ -555,8 +416,6 @@ ParaPropertyPanel::ParaPropertyPanel(vcl::Window* pParent,
m_eULSpaceUnit(), m_eULSpaceUnit(),
maLRSpaceControl (SID_ATTR_PARA_LRSPACE,*pBindings,*this), maLRSpaceControl (SID_ATTR_PARA_LRSPACE,*pBindings,*this),
maULSpaceControl (SID_ATTR_PARA_ULSPACE, *pBindings,*this), maULSpaceControl (SID_ATTR_PARA_ULSPACE, *pBindings,*this),
maDecIndentControl(SID_DEC_INDENT, *pBindings,*this, "DecrementIndent", rxFrame),
maIncIndentControl(SID_INC_INDENT, *pBindings,*this, "IncrementIndent", rxFrame),
m_aMetricCtl (SID_ATTR_METRIC, *pBindings,*this), m_aMetricCtl (SID_ATTR_METRIC, *pBindings,*this),
maContext(), maContext(),
mpBindings(pBindings), mpBindings(pBindings),
@@ -579,7 +438,6 @@ ParaPropertyPanel::ParaPropertyPanel(vcl::Window* pParent,
mpRightIndent->set_width_request(mpRightIndent->get_preferred_size().Width()); mpRightIndent->set_width_request(mpRightIndent->get_preferred_size().Width());
get(mpFLineIndent, "firstlineindent"); get(mpFLineIndent, "firstlineindent");
mpFLineIndent->set_width_request(mpFLineIndent->get_preferred_size().Width()); mpFLineIndent->set_width_request(mpFLineIndent->get_preferred_size().Width());
get(mpTbxIndent_IncDec, "indent");
initial(); initial();
m_aMetricCtl.RequestUpdate(); m_aMetricCtl.RequestUpdate();
@@ -598,15 +456,12 @@ void ParaPropertyPanel::dispose()
mpTBxOutline.clear(); mpTBxOutline.clear();
mpTopDist.clear(); mpTopDist.clear();
mpBottomDist.clear(); mpBottomDist.clear();
mpTbxIndent_IncDec.clear();
mpLeftIndent.clear(); mpLeftIndent.clear();
mpRightIndent.clear(); mpRightIndent.clear();
mpFLineIndent.clear(); mpFLineIndent.clear();
maLRSpaceControl.dispose(); maLRSpaceControl.dispose();
maULSpaceControl.dispose(); maULSpaceControl.dispose();
maDecIndentControl.dispose();
maIncIndentControl.dispose();
m_aMetricCtl.dispose(); m_aMetricCtl.dispose();
PanelLayout::dispose(); PanelLayout::dispose();

View File

@@ -83,14 +83,10 @@ private:
//Paragraph spacing //Paragraph spacing
VclPtr<SvxRelativeField> mpTopDist; VclPtr<SvxRelativeField> mpTopDist;
VclPtr<SvxRelativeField> mpBottomDist; VclPtr<SvxRelativeField> mpBottomDist;
VclPtr<ToolBox> mpTbxIndent_IncDec;
VclPtr<SvxRelativeField> mpLeftIndent; VclPtr<SvxRelativeField> mpLeftIndent;
VclPtr<SvxRelativeField> mpRightIndent; VclPtr<SvxRelativeField> mpRightIndent;
VclPtr<SvxRelativeField> mpFLineIndent; VclPtr<SvxRelativeField> mpFLineIndent;
// Resources
Image maIndHang;
// Data Member // Data Member
long maTxtLeft; long maTxtLeft;
long maUpper; long maUpper;
@@ -103,8 +99,6 @@ private:
// Control Items // Control Items
::sfx2::sidebar::ControllerItem maLRSpaceControl; ::sfx2::sidebar::ControllerItem maLRSpaceControl;
::sfx2::sidebar::ControllerItem maULSpaceControl; ::sfx2::sidebar::ControllerItem maULSpaceControl;
::sfx2::sidebar::ControllerItem maDecIndentControl;
::sfx2::sidebar::ControllerItem maIncIndentControl;
::sfx2::sidebar::ControllerItem m_aMetricCtl; ::sfx2::sidebar::ControllerItem m_aMetricCtl;
vcl::EnumContext maContext; vcl::EnumContext maContext;
@@ -112,12 +106,10 @@ private:
css::uno::Reference<css::ui::XSidebar> mxSidebar; css::uno::Reference<css::ui::XSidebar> mxSidebar;
DECL_LINK(ModifyIndentHdl_Impl, Edit&, void); DECL_LINK(ModifyIndentHdl_Impl, Edit&, void);
DECL_LINK(ClickIndent_IncDec_Hdl_Impl, ToolBox*, void);
DECL_LINK(ULSpaceHdl_Impl, Edit&, void); DECL_LINK(ULSpaceHdl_Impl, Edit&, void);
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 );
void StateChangeIncDecImpl( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState );
void initial(); void initial();
void ReSize(bool bSize); void ReSize(bool bSize);

View File

@@ -1,28 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include "helpid.hrc"
#include <svx/dialogs.hrc>
Bitmap BMP_INDENT_HANG
{
File = "symphony/Indent_Hanging.png";
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@@ -537,6 +537,12 @@ interface BaseTextEditView
ExecMethod = ExecTabWin ; ExecMethod = ExecTabWin ;
StateMethod = StateTabWin ; StateMethod = StateTabWin ;
] ]
SID_HANGING_INDENT
[
ExecMethod = ExecTabWin ;
StateMethod = StateTabWin ;
DisableFlags="SfxDisableFlags::SwOnProtectedCursor";
]
SID_ATTR_PAGE_ULSPACE SID_ATTR_PAGE_ULSPACE
[ [
ExecMethod = ExecTabWin ; ExecMethod = ExecTabWin ;

View File

@@ -207,6 +207,12 @@ interface TextDrawText
DisableFlags="SfxDisableFlags::SwOnProtectedCursor"; DisableFlags="SfxDisableFlags::SwOnProtectedCursor";
] ]
SID_HANGING_INDENT
[
ExecMethod = Execute ;
StateMethod = GetState ;
]
SID_ATTR_PARA_LRSPACE //for indent SID_ATTR_PARA_LRSPACE //for indent
[ [
ExecMethod = Execute ; ExecMethod = Execute ;

View File

@@ -221,6 +221,22 @@ void SwDrawTextShell::Execute( SfxRequest &rReq )
rReq.Done(); rReq.Done();
} }
break; break;
case SID_HANGING_INDENT:
{
SfxItemState eState = aEditAttr.GetItemState( EE_PARA_LRSPACE );
if( eState >= SfxItemState::DEFAULT )
{
SvxLRSpaceItem aParaMargin = static_cast<const SvxLRSpaceItem&>( aEditAttr.Get( EE_PARA_LRSPACE ) );
aParaMargin.SetWhich( EE_PARA_LRSPACE );
short int nFirstLineOffset = aParaMargin.GetTextFirstLineOfst();
aParaMargin.SetTextLeft( aParaMargin.GetTextLeft() + nFirstLineOffset );
aParaMargin.SetRight( aParaMargin.GetRight() );
aParaMargin.SetTextFirstLineOfst( nFirstLineOffset * (-1) );
aNewAttr.Put(aParaMargin);
rReq.Done();
}
}
break;
case SID_ATTR_PARA_LINESPACE: case SID_ATTR_PARA_LINESPACE:
{ {
SvxLineSpacingItem aLineSpace = static_cast<const SvxLineSpacingItem&>(pNewAttrs->Get( SvxLineSpacingItem aLineSpace = static_cast<const SvxLineSpacingItem&>(pNewAttrs->Get(

View File

@@ -654,6 +654,21 @@ void SwView::ExecTabWin( SfxRequest& rReq )
} }
break; break;
case SID_HANGING_INDENT:
{
SfxItemSet aLRSpaceSet( GetPool(), RES_LR_SPACE, RES_LR_SPACE );
rSh.GetCurAttr( aLRSpaceSet );
SvxLRSpaceItem aParaMargin( static_cast<const SvxLRSpaceItem&>( aLRSpaceSet.Get( RES_LR_SPACE ) ) );
SvxLRSpaceItem aNewMargin( RES_LR_SPACE );
aNewMargin.SetTextLeft( aParaMargin.GetTextLeft() + aParaMargin.GetTextFirstLineOfst() );
aNewMargin.SetRight( aParaMargin.GetRight() );
aNewMargin.SetTextFirstLineOfst( (aParaMargin.GetTextFirstLineOfst()) * (-1) );
rSh.SetAttrItem( aNewMargin );
break;
}
case SID_ATTR_PARA_LRSPACE_VERTICAL: case SID_ATTR_PARA_LRSPACE_VERTICAL:
case SID_ATTR_PARA_LRSPACE: case SID_ATTR_PARA_LRSPACE:
if ( pReqArgs ) if ( pReqArgs )
@@ -1421,6 +1436,14 @@ void SwView::StateTabWin(SfxItemSet& rSet)
break; break;
} }
case SID_HANGING_INDENT:
{
SfxItemState e = aCoreSet.GetItemState(RES_LR_SPACE);
if( e == SfxItemState::DISABLED )
rSet.DisableItem(nWhich);
break;
}
case SID_ATTR_PARA_LRSPACE_VERTICAL: case SID_ATTR_PARA_LRSPACE_VERTICAL:
case SID_ATTR_PARA_LRSPACE: case SID_ATTR_PARA_LRSPACE:
case SID_ATTR_PARA_LEFTSPACE: case SID_ATTR_PARA_LEFTSPACE: