icon-themes/breeze/cmd/lc_hangingindent.png                              
|binary
 icon-themes/galaxy/cmd/lc_hangingindent.png                              
|binary
 include/editeng/editids.hrc                                              |    
1 
 include/svx/dialogs.hrc                                                  |    
1 
 officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu |    
8 
 officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu      |    
8 
 sd/sdi/drtxtob.sdi                                                       |    
6 
 sd/source/ui/view/drtxtob1.cxx                                           |   
17 +
 svx/AllLangResTarget_svx.mk                                              |    
1 
 svx/sdi/svx.sdi                                                          |   
18 +
 svx/source/sidebar/paragraph/ParaPropertyPanel.cxx                       |  
145 ----------
 svx/source/sidebar/paragraph/ParaPropertyPanel.hxx                       |    
8 
 svx/source/sidebar/paragraph/ParaPropertyPanel.src                       |   
28 -
 sw/sdi/_viewsh.sdi                                                       |    
6 
 sw/sdi/drwtxtsh.sdi                                                      |    
6 
 sw/source/uibase/shells/drwtxtex.cxx                                     |   
16 +
 sw/source/uibase/uiview/viewtab.cxx                                      |   
23 +
 17 files changed, 109 insertions(+), 183 deletions(-)

New commits:
commit c1351a7b1363dac4349f37ac8876fdf950e62b97
Author: Szymon Kłos <eszka...@gmail.com>
Date:   Thu Mar 30 23:45:44 2017 +0200

    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 <c...@libreoffice.org>
    Reviewed-by: Samuel Mehrbrodt <samuel.mehrbr...@cib.de>

diff --git a/icon-themes/breeze/cmd/lc_hangingindent.png 
b/icon-themes/breeze/cmd/lc_hangingindent.png
new file mode 100644
index 000000000000..2adc4628a732
Binary files /dev/null and b/icon-themes/breeze/cmd/lc_hangingindent.png differ
diff --git a/icon-themes/breeze/svx/res/symphony/Indent_Hanging.png 
b/icon-themes/breeze/cmd/sc_hangingindent.png
similarity index 100%
rename from icon-themes/breeze/svx/res/symphony/Indent_Hanging.png
rename to icon-themes/breeze/cmd/sc_hangingindent.png
diff --git a/icon-themes/breeze_dark/svx/res/symphony/Indent_Hanging.png 
b/icon-themes/breeze_dark/cmd/sc_hangingindent.png
similarity index 100%
rename from icon-themes/breeze_dark/svx/res/symphony/Indent_Hanging.png
rename to icon-themes/breeze_dark/cmd/sc_hangingindent.png
diff --git a/icon-themes/breeze_svg/svx/res/symphony/Indent_Hanging.svg 
b/icon-themes/breeze_svg/cmd/sc_hangingindent.svg
similarity index 100%
rename from icon-themes/breeze_svg/svx/res/symphony/Indent_Hanging.svg
rename to icon-themes/breeze_svg/cmd/sc_hangingindent.svg
diff --git a/icon-themes/elementary/svx/res/symphony/Indent_Hanging.png 
b/icon-themes/elementary/cmd/sc_hangingindent.png
similarity index 100%
rename from icon-themes/elementary/svx/res/symphony/Indent_Hanging.png
rename to icon-themes/elementary/cmd/sc_hangingindent.png
diff --git a/icon-themes/galaxy/cmd/lc_hangingindent.png 
b/icon-themes/galaxy/cmd/lc_hangingindent.png
new file mode 100644
index 000000000000..2adc4628a732
Binary files /dev/null and b/icon-themes/galaxy/cmd/lc_hangingindent.png differ
diff --git a/icon-themes/galaxy/svx/res/symphony/Indent_Hanging.png 
b/icon-themes/galaxy/cmd/sc_hangingindent.png
similarity index 100%
rename from icon-themes/galaxy/svx/res/symphony/Indent_Hanging.png
rename to icon-themes/galaxy/cmd/sc_hangingindent.png
diff --git a/icon-themes/sifr/svx/res/symphony/Indent_Hanging.png 
b/icon-themes/sifr/cmd/sc_hangingindent.png
similarity index 100%
rename from icon-themes/sifr/svx/res/symphony/Indent_Hanging.png
rename to icon-themes/sifr/cmd/sc_hangingindent.png
diff --git a/icon-themes/tango/svx/res/symphony/Indent_Hanging.png 
b/icon-themes/tango/cmd/sc_hangingindent.png
similarity index 100%
rename from icon-themes/tango/svx/res/symphony/Indent_Hanging.png
rename to icon-themes/tango/cmd/sc_hangingindent.png
diff --git a/include/editeng/editids.hrc b/include/editeng/editids.hrc
index 94099c8943a5..c99144a397bd 100644
--- a/include/editeng/editids.hrc
+++ b/include/editeng/editids.hrc
@@ -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 )
diff --git a/include/svx/dialogs.hrc b/include/svx/dialogs.hrc
index 481fe81ef813..f92402b9446b 100644
--- a/include/svx/dialogs.hrc
+++ b/include/svx/dialogs.hrc
@@ -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)
diff --git 
a/officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu 
b/officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu
index 39f2a72216a8..409a3d32e9af 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu
@@ -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>
diff --git 
a/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu 
b/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
index 368ba7413781..d4c6586567f0 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
@@ -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>
diff --git a/sd/sdi/drtxtob.sdi b/sd/sdi/drtxtob.sdi
index 88e2d7e5bc3e..325e03b0c663 100644
--- a/sd/sdi/drtxtob.sdi
+++ b/sd/sdi/drtxtob.sdi
@@ -197,6 +197,12 @@ shell TextObjectBar
         StateMethod = GetAttrState;
     ]
 
+    SID_HANGING_INDENT
+    [
+        ExecMethod = Execute ;
+        StateMethod = GetAttrState;
+    ]
+
     SID_OUTLINE_LEFT // ole : no, status : ?
     [
         ExecMethod = Execute ;
diff --git a/sd/source/ui/view/drtxtob1.cxx b/sd/source/ui/view/drtxtob1.cxx
index e1b797dcdc53..6f88b159c6ac 100644
--- a/sd/source/ui/view/drtxtob1.cxx
+++ b/sd/source/ui/view/drtxtob1.cxx
@@ -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)
diff --git a/svx/AllLangResTarget_svx.mk b/svx/AllLangResTarget_svx.mk
index b847e58a7801..3696d0acef21 100644
--- a/svx/AllLangResTarget_svx.mk
+++ b/svx/AllLangResTarget_svx.mk
@@ -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 \
diff --git a/svx/sdi/svx.sdi b/svx/sdi/svx.sdi
index 3356f768c946..61ee39618df3 100644
--- a/svx/sdi/svx.sdi
+++ b/svx/sdi/svx.sdi
@@ -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;
+]
\ No newline at end of file
diff --git a/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx 
b/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx
index 2e290a1ea4e9..f56ecb10073a 100644
--- a/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx
+++ b/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx
@@ -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();
diff --git a/svx/source/sidebar/paragraph/ParaPropertyPanel.hxx 
b/svx/source/sidebar/paragraph/ParaPropertyPanel.hxx
index 04ba3d0ec395..98ce983c4ed7 100644
--- a/svx/source/sidebar/paragraph/ParaPropertyPanel.hxx
+++ b/svx/source/sidebar/paragraph/ParaPropertyPanel.hxx
@@ -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);
diff --git a/svx/source/sidebar/paragraph/ParaPropertyPanel.src 
b/svx/source/sidebar/paragraph/ParaPropertyPanel.src
deleted file mode 100644
index 854b376894b2..000000000000
--- a/svx/source/sidebar/paragraph/ParaPropertyPanel.src
+++ /dev/null
@@ -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: */
diff --git a/sw/sdi/_viewsh.sdi b/sw/sdi/_viewsh.sdi
index bc40a4dd8940..97e5c6eab343 100644
--- a/sw/sdi/_viewsh.sdi
+++ b/sw/sdi/_viewsh.sdi
@@ -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 ;
diff --git a/sw/sdi/drwtxtsh.sdi b/sw/sdi/drwtxtsh.sdi
index c2898fb066e0..2705712edb93 100644
--- a/sw/sdi/drwtxtsh.sdi
+++ b/sw/sdi/drwtxtsh.sdi
@@ -207,6 +207,12 @@ interface TextDrawText
         DisableFlags="SfxDisableFlags::SwOnProtectedCursor";
     ]
 
+    SID_HANGING_INDENT
+    [
+        ExecMethod = Execute ;
+        StateMethod = GetState ;
+    ]
+
     SID_ATTR_PARA_LRSPACE  //for indent
     [
         ExecMethod = Execute ;
diff --git a/sw/source/uibase/shells/drwtxtex.cxx 
b/sw/source/uibase/shells/drwtxtex.cxx
index 04e1b6738a46..186ab8fcc0e1 100644
--- a/sw/source/uibase/shells/drwtxtex.cxx
+++ b/sw/source/uibase/shells/drwtxtex.cxx
@@ -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(
diff --git a/sw/source/uibase/uiview/viewtab.cxx 
b/sw/source/uibase/uiview/viewtab.cxx
index d30dbdb9be68..25ed16527b75 100644
--- a/sw/source/uibase/uiview/viewtab.cxx
+++ b/sw/source/uibase/uiview/viewtab.cxx
@@ -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:
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to