svx/source/sidebar/paragraph/ParaPropertyPanel.cxx |   35 +++------------------
 svx/source/sidebar/paragraph/ParaPropertyPanel.hxx |   10 ------
 svx/uiconfig/ui/sidebarparagraph.ui                |    5 +--
 vcl/source/outdev/text.cxx                         |    2 -
 4 files changed, 11 insertions(+), 41 deletions(-)

New commits:
commit 5c16380a550ae41ac1120fe96b1bb11927bde12a
Author:     Caolán McNamara <[email protected]>
AuthorDate: Mon Aug 19 17:09:29 2024 +0100
Commit:     Caolán McNamara <[email protected]>
CommitDate: Mon Aug 19 20:57:41 2024 +0200

    GtkBox does not have a child property called left-attach
    
    Change-Id: Ifefc2394747edbbf19601d8bdb9beac418571962
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172048
    Tested-by: Caolán McNamara <[email protected]>
    Reviewed-by: Caolán McNamara <[email protected]>

diff --git a/svx/uiconfig/ui/sidebarparagraph.ui 
b/svx/uiconfig/ui/sidebarparagraph.ui
index 51d3b7987114..13d988297df8 100644
--- a/svx/uiconfig/ui/sidebarparagraph.ui
+++ b/svx/uiconfig/ui/sidebarparagraph.ui
@@ -794,8 +794,9 @@
                   </child>
                 </object>
                 <packing>
-                  <property name="left-attach">0</property>
-                  <property name="top-attach">3</property>
+                  <property name="expand">False</property>
+                  <property name="fill">True</property>
+                  <property name="position">0</property>
                 </packing>
               </child>
           </object>
commit 0b67a633bb6f109bce93b330fb3bbf3972ea40be
Author:     Mike Kaganski <[email protected]>
AuthorDate: Mon Aug 19 18:34:00 2024 +0200
Commit:     Mike Kaganski <[email protected]>
CommitDate: Mon Aug 19 20:57:36 2024 +0200

    Don't fix already correct data
    
    Change-Id: I3e9798507cb9ed04797449e790078e5c2809a1ab
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171989
    Reviewed-by: Mike Kaganski <[email protected]>
    Tested-by: Jenkins

diff --git a/vcl/source/outdev/text.cxx b/vcl/source/outdev/text.cxx
index 8bbd12160bd1..d1528fb68101 100644
--- a/vcl/source/outdev/text.cxx
+++ b/vcl/source/outdev/text.cxx
@@ -556,7 +556,7 @@ void OutputDevice::DrawText( const Point& rStartPt, const 
OUString& rStr,
 {
     assert(!is_double_buffered_window());
 
-    if( (nLen < 0) || (nIndex + nLen >= rStr.getLength()))
+    if( (nLen < 0) || (nIndex + nLen > rStr.getLength()))
     {
         nLen = rStr.getLength() - nIndex;
     }
commit 52ca0dd6ccdda4df3860d8b9e24f2f5eedd9a482
Author:     Caolán McNamara <[email protected]>
AuthorDate: Mon Aug 19 17:06:57 2024 +0100
Commit:     Caolán McNamara <[email protected]>
CommitDate: Mon Aug 19 20:57:29 2024 +0200

    invalid cast from 'GtkToggleToolButton' to 'GtkToggleButton'
    
    These are toolbar items, and not GtkToggleButton's so use the toolbar
    api here instead.
    
    The "ToolbarUnoDispatcher" thing is to auto dispatch uno:whatver when
    the toolbar items have names like that, these ones have custom handlers
    so that doens't really fit here.
    
    Change-Id: I93fc11bf364ba7ae145ff52bc78a1544c9bae412
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172047
    Tested-by: Caolán McNamara <[email protected]>
    Reviewed-by: Caolán McNamara <[email protected]>

diff --git a/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx 
b/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx
index 1b92f136fd29..b7c70389aa1f 100644
--- a/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx
+++ b/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx
@@ -211,21 +211,6 @@ void ParaPropertyPanel::InitToolBoxHyphenation()
     mxWordLength->connect_value_changed(aLink);
     mxZone->connect_value_changed(aLink);
     m_eHyphenZoneUnit = m_aZoneControl.GetCoreMetric();
-    Link<weld::Toggleable&,void> aLinkToggled = LINK( this, ParaPropertyPanel, 
HyphenationToggleButtonHdl_Impl );
-    if ( mxHyphenateCapsBtn )
-        mxHyphenateCapsBtn->connect_toggled(aLinkToggled);
-    if ( mxHyphenateLastWordBtn )
-        mxHyphenateLastWordBtn->connect_toggled(aLinkToggled);
-    if ( mxHyphenateLastFullLineBtn )
-         mxHyphenateLastFullLineBtn->connect_toggled(aLinkToggled);
-    if ( mxHyphenateColumnBtn )
-        mxHyphenateColumnBtn->connect_toggled(aLinkToggled);
-    if ( mxHyphenatePageBtn )
-        mxHyphenatePageBtn->connect_toggled(aLinkToggled);
-    if ( mxHyphenateSpreadBtn )
-        mxHyphenateSpreadBtn->connect_toggled(aLinkToggled);
-    if ( mxHyphenateBtn )
-        mxHyphenateBtn->connect_toggled(aLinkToggled);
 }
 
 void ParaPropertyPanel::initial()
@@ -295,7 +280,7 @@ IMPL_LINK_NOARG( ParaPropertyPanel, HyphenationHdl_Impl, 
weld::MetricSpinButton&
 }
 
 // for hyphenation toggle buttons
-IMPL_LINK( ParaPropertyPanel, HyphenationToggleButtonHdl_Impl, 
weld::Toggleable&, rBtn, void)
+IMPL_LINK( ParaPropertyPanel, HyphenationToggleButtonHdl_Impl, const 
OUString&, rBtn, void)
 {
     if ( mbUpdatingHyphenateButtons )
         return;
@@ -307,22 +292,22 @@ IMPL_LINK( ParaPropertyPanel, 
HyphenationToggleButtonHdl_Impl, weld::Toggleable&
     sal_Int16 nButton = 0;
     bool bEnabled = false;
     // get the correct getKeepType(), if clicked on one of the Hyphenate 
Across icons
-    if( &rBtn == mxHyphenateSpreadBtn.get() )
+    if(  rBtn == "HyphenateSpread" )
     {
         nButton = 4;
         bEnabled = mxTBxHyphenation->get_item_active("HyphenateSpread");
     }
-    else if( &rBtn == mxHyphenatePageBtn.get() )
+    else if( rBtn == "HyphenatePage" )
     {
         nButton = 3;
         bEnabled = mxTBxHyphenation->get_item_active("HyphenatePage");
     }
-    else if( &rBtn == mxHyphenateColumnBtn.get() )
+    else if( rBtn == "HyphenateColumn" )
     {
         nButton = 2;
         bEnabled = mxTBxHyphenation->get_item_active("HyphenateColumn");
     }
-    else if( &rBtn == mxHyphenateLastFullLineBtn.get() )
+    else if( rBtn == "HyphenateLastFullLine" )
     {
         nButton = 1;
         bEnabled = mxTBxHyphenation->get_item_active("HyphenateLastFullLine");
@@ -601,7 +586,6 @@ ParaPropertyPanel::ParaPropertyPanel(weld::Widget* pParent,
       mxIndentDispatch(new ToolbarUnoDispatcher(*mxTBxIndent, *m_xBuilder, 
rxFrame)),
       //Hyphenation
       mxTBxHyphenation(m_xBuilder->weld_toolbar(u"hyphenation"_ustr)),
-      mxHyphenationDispatch(new ToolbarUnoDispatcher(*mxTBxHyphenation, 
*m_xBuilder, rxFrame)),
       //Paragraph spacing
       mxTopDist(m_xBuilder->weld_metric_spin_button(u"aboveparaspacing"_ustr, 
FieldUnit::CM)),
       
mxBottomDist(m_xBuilder->weld_metric_spin_button(u"belowparaspacing"_ustr, 
FieldUnit::CM)),
@@ -622,13 +606,6 @@ ParaPropertyPanel::ParaPropertyPanel(weld::Widget* pParent,
       mxWordLength(m_xBuilder->weld_metric_spin_button(u"wordlength"_ustr, 
FieldUnit::CHAR)),
       mxZone(m_xBuilder->weld_metric_spin_button(u"zone"_ustr, FieldUnit::CM)),
       mbUpdatingHyphenateButtons(false),
-      
mxHyphenateCapsBtn(m_xBuilder->weld_toggle_button(u"HyphenateCaps"_ustr)),
-      
mxHyphenateLastWordBtn(m_xBuilder->weld_toggle_button(u"HyphenateLastWord"_ustr)),
-      
mxHyphenateLastFullLineBtn(m_xBuilder->weld_toggle_button(u"HyphenateLastFullLine"_ustr)),
-      
mxHyphenateColumnBtn(m_xBuilder->weld_toggle_button(u"HyphenateColumn"_ustr)),
-      
mxHyphenatePageBtn(m_xBuilder->weld_toggle_button(u"HyphenatePage"_ustr)),
-      
mxHyphenateSpreadBtn(m_xBuilder->weld_toggle_button(u"HyphenateSpread"_ustr)),
-      mxHyphenateBtn(m_xBuilder->weld_toggle_button(u"Hyphenate"_ustr)),
       maTxtLeft (0),
       maUpper (0),
       maLower (0),
@@ -650,6 +627,7 @@ ParaPropertyPanel::ParaPropertyPanel(weld::Widget* pParent,
       mpBindings(pBindings),
       mxSidebar(std::move(xSidebar))
 {
+    mxTBxHyphenation->connect_clicked(LINK( this, ParaPropertyPanel, 
HyphenationToggleButtonHdl_Impl));
     // tdf#130197 We want to give this toolbar a width as if it had 5 entries
     // (the parent grid has homogeneous width set so both columns will have the
     // same width).  This ParaPropertyPanel is a default panel in writer, so
@@ -695,7 +673,6 @@ ParaPropertyPanel::~ParaPropertyPanel()
     mxIndentDispatch.reset();
     mxTBxIndent.reset();
 
-    mxHyphenationDispatch.reset();
     mxTBxHyphenation.reset();
 
     mxTopDist.reset();
diff --git a/svx/source/sidebar/paragraph/ParaPropertyPanel.hxx 
b/svx/source/sidebar/paragraph/ParaPropertyPanel.hxx
index 1dad57b4bb29..aadce3f71b3d 100644
--- a/svx/source/sidebar/paragraph/ParaPropertyPanel.hxx
+++ b/svx/source/sidebar/paragraph/ParaPropertyPanel.hxx
@@ -93,7 +93,6 @@ private:
     std::unique_ptr<weld::Toolbar> mxTBxIndent;
     std::unique_ptr<ToolbarUnoDispatcher> mxIndentDispatch;
     std::unique_ptr<weld::Toolbar> mxTBxHyphenation;
-    std::unique_ptr<ToolbarUnoDispatcher> mxHyphenationDispatch;
 
     //Paragraph spacing
     std::optional<SvxRelativeField> mxTopDist;
@@ -117,13 +116,6 @@ private:
     std::optional<SvxRelativeField> mxWordLength;
     std::optional<SvxRelativeField> mxZone;
     bool mbUpdatingHyphenateButtons;
-    std::unique_ptr<weld::ToggleButton> mxHyphenateCapsBtn;
-    std::unique_ptr<weld::ToggleButton> mxHyphenateLastWordBtn;
-    std::unique_ptr<weld::ToggleButton> mxHyphenateLastFullLineBtn;
-    std::unique_ptr<weld::ToggleButton> mxHyphenateColumnBtn;
-    std::unique_ptr<weld::ToggleButton> mxHyphenatePageBtn;
-    std::unique_ptr<weld::ToggleButton> mxHyphenateSpreadBtn;
-    std::unique_ptr<weld::ToggleButton> mxHyphenateBtn;
 
     // Data Member
     tools::Long                maTxtLeft;
@@ -154,7 +146,7 @@ private:
     DECL_LINK(ModifyIndentHdl_Impl, weld::MetricSpinButton&, void);
     DECL_LINK(ULSpaceHdl_Impl, weld::MetricSpinButton&, void);
     DECL_LINK(HyphenationHdl_Impl, weld::MetricSpinButton&, void);
-    DECL_LINK(HyphenationToggleButtonHdl_Impl, weld::Toggleable&, void);
+    DECL_LINK(HyphenationToggleButtonHdl_Impl, const OUString&, void);
 
     void StateChangedIndentImpl( SfxItemState eState, const SfxPoolItem* 
pState );
     void StateChangedULImpl( SfxItemState eState, const SfxPoolItem* pState );

Reply via email to