svx/inc/spacing.hrc                                |    6 +++++
 svx/source/sidebar/paragraph/ParaPropertyPanel.cxx |   22 +++++++++++++++++++++
 vcl/source/window/window.cxx                       |    7 ++++++
 3 files changed, 35 insertions(+)

New commits:
commit 53543126f184047d8cd5413a939ca752c0d9a029
Author:     Henry Castro <[email protected]>
AuthorDate: Wed Feb 4 09:27:59 2026 -0400
Commit:     Caolán McNamara <[email protected]>
CommitDate: Wed Feb 11 12:56:27 2026 +0100

    vcl: add custom-label and custom-label-for properties
    
    Add those custom properties to the client side so
    that the client side can adjust the container to
    include a label without interfering with the original
    UI file.
    
    Signed-off-by: Henry Castro <[email protected]>
    Change-Id: I7717b5f9b4e368885e767ab447fccd6806de0c9f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198685
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Reviewed-by: Caolán McNamara <[email protected]>

diff --git a/svx/inc/spacing.hrc b/svx/inc/spacing.hrc
index 742b499dc32c..26ada64b12a3 100644
--- a/svx/inc/spacing.hrc
+++ b/svx/inc/spacing.hrc
@@ -13,6 +13,12 @@
 
 #define NC_(Context, String) TranslateId(Context, u8##String)
 
+#define RID_ABOVE        NC_("RID_ABOVE", "Above:")
+#define RID_BELOW        NC_("RID_BELOW", "Below:")
+#define RID_BEFORE       NC_("RID_BEFORE", "Before:")
+#define RID_AFTER        NC_("RID_AFTER", "After:")
+#define RID_FIRST        NC_("RID_FIRST", "First:")
+
 struct measurement
 {
     TranslateId key;
diff --git a/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx 
b/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx
index 4e1022d3c8c9..8adc2139abcd 100644
--- a/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx
+++ b/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx
@@ -26,9 +26,12 @@
 #include <svx/dlgctrl.hxx>
 #include <svx/svxids.hrc>
 #include <svl/intitem.hxx>
+#include <svx/dialmgr.hxx>
 #include <sfx2/objsh.hxx>
 #include <svtools/unitconv.hxx>
 #include <sal/log.hxx>
+#include <rtl/ustrbuf.hxx>
+#include <spacing.hrc>
 
 #include <com/sun/star/lang/IllegalArgumentException.hpp>
 #include <utility>
@@ -560,6 +563,14 @@ FieldUnit ParaPropertyPanel::GetCurrentUnit( SfxItemState 
eState, const SfxPoolI
     return eUnit;
 }
 
+namespace {
+    OUString MakeCustomProperty(std::u16string_view sCustomLabel, 
std::u16string_view sCustomLabelFor)
+    {
+        return OUString::Concat(u"\"custom-label\":\"") + sCustomLabel + "\", 
\"custom-label-for\":\"" +
+            sCustomLabelFor + "\"";
+    }
+}
+
 ParaPropertyPanel::ParaPropertyPanel(weld::Widget* pParent,
     const css::uno::Reference<css::frame::XFrame>& rxFrame,
     SfxBindings* pBindings,
@@ -626,6 +637,17 @@ ParaPropertyPanel::ParaPropertyPanel(weld::Widget* pParent,
       mpBindings(pBindings),
       mxSidebar(std::move(xSidebar))
 {
+    std::unique_ptr<weld::Widget> xBox = 
m_xBuilder->weld_widget(u"aboveparaspacingbox"_ustr);
+    xBox->set_cargo_text(MakeCustomProperty(SvxResId(RID_ABOVE), 
u"aboveparaspacing"));
+    xBox = m_xBuilder->weld_widget(u"belowparaspacingbox"_ustr);
+    xBox->set_cargo_text(MakeCustomProperty(SvxResId(RID_BELOW), 
u"beforetextindentbox"));
+    xBox = m_xBuilder->weld_widget(u"beforetextindentbox"_ustr);
+    xBox->set_cargo_text(MakeCustomProperty(SvxResId(RID_BEFORE), 
u"beforetextindent"));
+    xBox = m_xBuilder->weld_widget(u"aftertextindentbox"_ustr);
+    xBox->set_cargo_text(MakeCustomProperty(SvxResId(RID_AFTER), 
u"aftertextindent"));
+    xBox = m_xBuilder->weld_widget(u"firstlineindentbox"_ustr);
+    xBox->set_cargo_text(MakeCustomProperty(SvxResId(RID_FIRST), 
u"firstlineindent"));
+
     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
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 4d63615a46c4..46c219feb4dd 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -3407,6 +3407,13 @@ void Window::DumpAsPropertyTree(tools::JsonWriter& 
rJsonWriter)
         }
     }
 
+    const OUString& aCargo = GetCargoText();
+    if (!aCargo.isEmpty())
+    {
+        auto node = rJsonWriter.startNode("cargo");
+        rJsonWriter.putRaw(OUStringToOString(aCargo, RTL_TEXTENCODING_UTF8));
+    }
+
     OUString sAccRole;
     sal_uInt16 nAccessibleRole = GetAccessibleRole();
     if (nAccessibleRole == css::accessibility::AccessibleRole::PAGE_TAB_LIST)

Reply via email to