sd/source/filter/html/a11yex.cxx |   17 +++++++++++++++++
 1 file changed, 17 insertions(+)

New commits:
commit 03963486baa41d68c08c6fbbcd8ee04f69d3ed95
Author:     Henry Castro <[email protected]>
AuthorDate: Tue Sep 16 06:40:18 2025 -0400
Commit:     Henry Castro <[email protected]>
CommitDate: Wed Oct 22 11:47:17 2025 +0200

    sd: generate HTML text alternatives for Drawing Objects
    
    Add a11y annotations for Drawing Objects for screen readers
    
    Change-Id: Iecfa9e973d54ea5fbb4e144bd1ab350dd67927d6
    Signed-off-by: Henry Castro <[email protected]>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191025
    Tested-by: Caolán McNamara <[email protected]>
    Reviewed-by: Caolán McNamara <[email protected]>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192793
    Tested-by: Jenkins

diff --git a/sd/source/filter/html/a11yex.cxx b/sd/source/filter/html/a11yex.cxx
index cd82003c564b..0a330a1e41bc 100644
--- a/sd/source/filter/html/a11yex.cxx
+++ b/sd/source/filter/html/a11yex.cxx
@@ -38,6 +38,18 @@ using namespace ::com::sun::star::document;
 
 using namespace sdr::table;
 
+namespace
+{
+void CreateTitleDescription(SdrObject* pObject, OUStringBuffer& rHtml)
+{
+    rHtml.append("<h2>");
+    rHtml.append(pObject->GetTitle());
+    rHtml.append("</h2>
 <p>");
+    rHtml.append(pObject->GetDescription());
+    rHtml.append("</p>
 ");
+}
+}
+
 void SdHTMLFilter::ExportPage(SdrOutliner* pOutliner, SdPage* pPage, 
OUStringBuffer& rHtml)
 {
     if (!pPage || !pOutliner)
@@ -75,6 +87,10 @@ void SdHTMLFilter::ExportPage(SdrOutliner* pOutliner, 
SdPage* pPage, OUStringBuf
                         HtmlExport::WriteOutlinerParagraph(rHtml, pOutliner,
                                                            
pObject->GetOutlinerParaObject(), false);
                     }
+                    else
+                    {
+                        CreateTitleDescription(pObject.get(), rHtml);
+                    }
                 }
             }
             break;
@@ -98,6 +114,7 @@ void SdHTMLFilter::ExportPage(SdrOutliner* pOutliner, 
SdPage* pPage, OUStringBuf
             break;
 
             default:
+                CreateTitleDescription(pObject.get(), rHtml);
                 break;
         }
     }

Reply via email to