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>
BIN
icon-themes/breeze/cmd/lc_hangingindent.png
Normal file
After Width: | Height: | Size: 525 B |
Before Width: | Height: | Size: 135 B After Width: | Height: | Size: 135 B |
Before Width: | Height: | Size: 245 B After Width: | Height: | Size: 245 B |
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 4.5 KiB |
Before Width: | Height: | Size: 526 B After Width: | Height: | Size: 526 B |
BIN
icon-themes/galaxy/cmd/lc_hangingindent.png
Normal file
After Width: | Height: | Size: 525 B |
Before Width: | Height: | Size: 633 B After Width: | Height: | Size: 633 B |
Before Width: | Height: | Size: 226 B After Width: | Height: | Size: 226 B |
Before Width: | Height: | Size: 416 B After Width: | Height: | Size: 416 B |
@ -78,6 +78,7 @@
|
||||
#define SID_ATTR_PARA_MODEL ( SID_SVX_START + 65 )
|
||||
#define SID_ATTR_PARA_KEEP ( SID_SVX_START + 66 )
|
||||
#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_OUTLLEVEL ( SID_SVX_START + 300 )
|
||||
#define SID_ATTR_PARA_REGISTER ( SID_SVX_START + 413 )
|
||||
|
@ -945,7 +945,6 @@
|
||||
|
||||
// sidebar-related resources
|
||||
#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_WIDTH1_ICON (RID_SVX_SIDEBAR_BEGIN + 22)
|
||||
#define BMP_WIDTH2_ICON (RID_SVX_SIDEBAR_BEGIN + 23)
|
||||
|
@ -2228,6 +2228,14 @@
|
||||
<value xml:lang="en-US">Presentation ~Object...</value>
|
||||
</prop>
|
||||
</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>
|
||||
</oor:component-data>
|
||||
|
@ -2910,6 +2910,14 @@
|
||||
<value>1</value>
|
||||
</prop>
|
||||
</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>
|
||||
</oor:component-data>
|
||||
|
@ -197,6 +197,12 @@ shell TextObjectBar
|
||||
StateMethod = GetAttrState;
|
||||
]
|
||||
|
||||
SID_HANGING_INDENT
|
||||
[
|
||||
ExecMethod = Execute ;
|
||||
StateMethod = GetAttrState;
|
||||
]
|
||||
|
||||
SID_OUTLINE_LEFT // ole : no, status : ?
|
||||
[
|
||||
ExecMethod = Execute ;
|
||||
|
@ -277,6 +277,23 @@ void TextObjectBar::Execute( SfxRequest &rReq )
|
||||
}
|
||||
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:
|
||||
{
|
||||
if (pOLV)
|
||||
|
@ -69,7 +69,6 @@ $(eval $(call gb_SrsTarget_add_files,svx/res,\
|
||||
svx/source/items/svxitems.src \
|
||||
svx/source/sidebar/area/AreaPropertyPanel.src \
|
||||
svx/source/sidebar/line/LinePropertyPanel.src \
|
||||
svx/source/sidebar/paragraph/ParaPropertyPanel.src \
|
||||
svx/source/stbctrls/stbctrls.src \
|
||||
svx/source/svdraw/svdstr.src \
|
||||
svx/source/table/table.src \
|
||||
|
@ -11955,3 +11955,21 @@ SfxUInt16Item CurrentOutlineType FN_OUTLINE_RULE_INDEX
|
||||
ToolBoxConfig = FALSE,
|
||||
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;
|
||||
]
|
@ -35,17 +35,11 @@
|
||||
using namespace css;
|
||||
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 {
|
||||
#define DEFAULT_VALUE 0
|
||||
|
||||
#define MAX_DURCH 5670
|
||||
|
||||
#define INDENT_STEP 706
|
||||
|
||||
#define MAX_SW 1709400
|
||||
#define MAX_SC_SD 116220200
|
||||
#define NEGA_MAXVALUE -10000000
|
||||
@ -155,10 +149,6 @@ void ParaPropertyPanel::InitToolBoxIndent()
|
||||
mpRightIndent->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();
|
||||
}
|
||||
@ -191,84 +181,6 @@ IMPL_LINK_NOARG( ParaPropertyPanel, ModifyIndentHdl_Impl, Edit&, void)
|
||||
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
|
||||
IMPL_LINK_NOARG( ParaPropertyPanel, ULSpaceHdl_Impl, Edit&, void)
|
||||
@ -314,11 +226,6 @@ void ParaPropertyPanel::NotifyItemUpdate(
|
||||
case SID_ATTR_PARA_ULSPACE:
|
||||
StateChangedULImpl( nSID, eState, pState );
|
||||
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;
|
||||
}
|
||||
|
||||
const sal_uInt16 nIdHangingIndent = mpTbxIndent_IncDec->GetItemId(UNO_HANGINGINDENT);
|
||||
if( pState && eState >= SfxItemState::DEFAULT )
|
||||
{
|
||||
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 );
|
||||
nfVal = (long)mpFLineIndent->Normalize( (long)nfVal );
|
||||
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 )
|
||||
{
|
||||
mpLeftIndent-> Disable();
|
||||
mpRightIndent->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
|
||||
{
|
||||
mpLeftIndent->SetEmptyFieldValue();
|
||||
mpRightIndent->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 eUnit = FUNIT_NONE;
|
||||
@ -545,7 +407,6 @@ ParaPropertyPanel::ParaPropertyPanel(vcl::Window* pParent,
|
||||
const css::uno::Reference<css::ui::XSidebar>& rxSidebar)
|
||||
: PanelLayout(pParent, "ParaPropertyPanel", "svx/ui/sidebarparagraph.ui", rxFrame),
|
||||
|
||||
maIndHang(BitmapEx(SVX_RES(BMP_INDENT_HANG))),
|
||||
maTxtLeft (0),
|
||||
maUpper (0),
|
||||
maLower (0),
|
||||
@ -555,8 +416,6 @@ ParaPropertyPanel::ParaPropertyPanel(vcl::Window* pParent,
|
||||
m_eULSpaceUnit(),
|
||||
maLRSpaceControl (SID_ATTR_PARA_LRSPACE,*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),
|
||||
maContext(),
|
||||
mpBindings(pBindings),
|
||||
@ -579,7 +438,6 @@ ParaPropertyPanel::ParaPropertyPanel(vcl::Window* pParent,
|
||||
mpRightIndent->set_width_request(mpRightIndent->get_preferred_size().Width());
|
||||
get(mpFLineIndent, "firstlineindent");
|
||||
mpFLineIndent->set_width_request(mpFLineIndent->get_preferred_size().Width());
|
||||
get(mpTbxIndent_IncDec, "indent");
|
||||
|
||||
initial();
|
||||
m_aMetricCtl.RequestUpdate();
|
||||
@ -598,15 +456,12 @@ void ParaPropertyPanel::dispose()
|
||||
mpTBxOutline.clear();
|
||||
mpTopDist.clear();
|
||||
mpBottomDist.clear();
|
||||
mpTbxIndent_IncDec.clear();
|
||||
mpLeftIndent.clear();
|
||||
mpRightIndent.clear();
|
||||
mpFLineIndent.clear();
|
||||
|
||||
maLRSpaceControl.dispose();
|
||||
maULSpaceControl.dispose();
|
||||
maDecIndentControl.dispose();
|
||||
maIncIndentControl.dispose();
|
||||
m_aMetricCtl.dispose();
|
||||
|
||||
PanelLayout::dispose();
|
||||
|
@ -83,14 +83,10 @@ private:
|
||||
//Paragraph spacing
|
||||
VclPtr<SvxRelativeField> mpTopDist;
|
||||
VclPtr<SvxRelativeField> mpBottomDist;
|
||||
VclPtr<ToolBox> mpTbxIndent_IncDec;
|
||||
VclPtr<SvxRelativeField> mpLeftIndent;
|
||||
VclPtr<SvxRelativeField> mpRightIndent;
|
||||
VclPtr<SvxRelativeField> mpFLineIndent;
|
||||
|
||||
// Resources
|
||||
Image maIndHang;
|
||||
|
||||
// Data Member
|
||||
long maTxtLeft;
|
||||
long maUpper;
|
||||
@ -103,8 +99,6 @@ private:
|
||||
// Control Items
|
||||
::sfx2::sidebar::ControllerItem maLRSpaceControl;
|
||||
::sfx2::sidebar::ControllerItem maULSpaceControl;
|
||||
::sfx2::sidebar::ControllerItem maDecIndentControl;
|
||||
::sfx2::sidebar::ControllerItem maIncIndentControl;
|
||||
::sfx2::sidebar::ControllerItem m_aMetricCtl;
|
||||
|
||||
vcl::EnumContext maContext;
|
||||
@ -112,12 +106,10 @@ private:
|
||||
css::uno::Reference<css::ui::XSidebar> mxSidebar;
|
||||
|
||||
DECL_LINK(ModifyIndentHdl_Impl, Edit&, void);
|
||||
DECL_LINK(ClickIndent_IncDec_Hdl_Impl, ToolBox*, void);
|
||||
DECL_LINK(ULSpaceHdl_Impl, Edit&, void);
|
||||
|
||||
void StateChangedIndentImpl( 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 ReSize(bool bSize);
|
||||
|
@ -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: */
|
@ -537,6 +537,12 @@ interface BaseTextEditView
|
||||
ExecMethod = ExecTabWin ;
|
||||
StateMethod = StateTabWin ;
|
||||
]
|
||||
SID_HANGING_INDENT
|
||||
[
|
||||
ExecMethod = ExecTabWin ;
|
||||
StateMethod = StateTabWin ;
|
||||
DisableFlags="SfxDisableFlags::SwOnProtectedCursor";
|
||||
]
|
||||
SID_ATTR_PAGE_ULSPACE
|
||||
[
|
||||
ExecMethod = ExecTabWin ;
|
||||
|
@ -207,6 +207,12 @@ interface TextDrawText
|
||||
DisableFlags="SfxDisableFlags::SwOnProtectedCursor";
|
||||
]
|
||||
|
||||
SID_HANGING_INDENT
|
||||
[
|
||||
ExecMethod = Execute ;
|
||||
StateMethod = GetState ;
|
||||
]
|
||||
|
||||
SID_ATTR_PARA_LRSPACE //for indent
|
||||
[
|
||||
ExecMethod = Execute ;
|
||||
|
@ -221,6 +221,22 @@ void SwDrawTextShell::Execute( SfxRequest &rReq )
|
||||
rReq.Done();
|
||||
}
|
||||
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:
|
||||
{
|
||||
SvxLineSpacingItem aLineSpace = static_cast<const SvxLineSpacingItem&>(pNewAttrs->Get(
|
||||
|
@ -654,6 +654,21 @@ void SwView::ExecTabWin( SfxRequest& rReq )
|
||||
}
|
||||
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:
|
||||
if ( pReqArgs )
|
||||
@ -1421,6 +1436,14 @@ void SwView::StateTabWin(SfxItemSet& rSet)
|
||||
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:
|
||||
case SID_ATTR_PARA_LEFTSPACE:
|
||||
|