[Libreoffice-commits] core.git: bin/gla11y sw/source sw/uiconfig vcl/source vcl/uiconfig
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Fri Sep 28 09:06:14 UTC 2018
bin/gla11y | 18 ++++++++++++++++++
sw/source/ui/fldui/flddb.cxx | 9 +++++++++
sw/uiconfig/swriter/ui/flddbpage.ui | 4 ----
vcl/source/window/printdlg.cxx | 4 ++++
vcl/uiconfig/ui/printdialog.ui | 8 ++++----
5 files changed, 35 insertions(+), 8 deletions(-)
New commits:
commit 458c9af2e5002893414c6fce53dd8bd558c4c7d0
Author: Jan-Marek Glogowski <glogow at fbihome.de>
AuthorDate: Thu Sep 27 17:58:55 2018 +0200
Commit: Jan-Marek Glogowski <glogow at fbihome.de>
CommitDate: Fri Sep 28 11:05:46 2018 +0200
gla11y: check element visibility
Add warnings for different visibility settings in the "label-for"
and "labelled-by" elements.
Sine LO doesn't support multiple annotations per accessibility
element, we have to switch them manually, if we change the
visibility of one element of a pair.
Change-Id: I9b3d941248b804b8435591536277677e99b77340
Reviewed-on: https://gerrit.libreoffice.org/61050
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski <glogow at fbihome.de>
diff --git a/bin/gla11y b/bin/gla11y
index f18e2f48c960..b09d259a8a87 100755
--- a/bin/gla11y
+++ b/bin/gla11y
@@ -908,6 +908,18 @@ def check_props(filename, tree, root, elm, forward):
err(filename, tree, elm, "undeclared-target", forward + " uses undeclared target '%s'" % prop.text)
return props
+def is_visible(obj):
+ visible = False
+ visible_prop = obj.findall("property[@name='visible']")
+ visible_len = len(visible_prop)
+ if visible_len:
+ visible_txt = visible_prop[visible_len - 1].text
+ if visible_txt.lower() == "true":
+ visible = True
+ elif visible_txt.lower() == "false":
+ visible = False
+ return visible
+
def check_rels(filename, tree, root, elm, forward, backward = None):
"""
Check the relations given by forward
@@ -968,6 +980,8 @@ def check_a11y_relation(filename, tree):
# Check labelled-by and its dual label-for
labelled_by = check_rels(filename, tree, root, obj, "labelled-by", "label-for")
+ visible = is_visible(obj)
+
# Should have only one label
if len(labelled_by) >= 1:
if oid in mnemonic_for_elm:
@@ -978,6 +992,10 @@ def check_a11y_relation(filename, tree):
if oid in label_for_elm:
if len(label_for_elm[oid]) > 1:
warn(filename, tree, obj, "duplicate-label-for", "is referenced by multiple label-for " + elms_names_lines(label_for_elm[oid]))
+ elif len(label_for_elm[oid]) == 1:
+ paired = label_for_elm[oid][0]
+ if visible != is_visible(paired):
+ warn(filename, tree, obj, "visibility-conflict", "visibility conflicts with paired " + paired.attrib.get('id'))
if oid in mnemonic_for_elm:
if len(mnemonic_for_elm[oid]) > 1:
warn(filename, tree, obj, "duplicate-mnemonic", "is referenced by multiple mnemonic_widget " + elms_names_lines(mnemonic_for_elm[oid]))
diff --git a/sw/source/ui/fldui/flddb.cxx b/sw/source/ui/fldui/flddb.cxx
index 7447a7708c87..3feac5488241 100644
--- a/sw/source/ui/fldui/flddb.cxx
+++ b/sw/source/ui/fldui/flddb.cxx
@@ -341,6 +341,10 @@ void SwFieldDBPage::TypeHdl( ListBox const * pBox )
m_pNumFormatLB->Show();
m_pFormatLB->Hide();
+ m_pNewFormatRB->SetAccessibleRelationLabelFor(m_pNumFormatLB);
+ m_pNumFormatLB->SetAccessibleRelationLabeledBy(m_pNewFormatRB);
+ m_pFormatLB->SetAccessibleRelationLabelFor(nullptr);
+
if (pBox) // type was changed by user
m_pDBFormatRB->Check();
@@ -376,6 +380,11 @@ void SwFieldDBPage::TypeHdl( ListBox const * pBox )
m_pNewFormatRB->Check();
m_pNumFormatLB->Hide();
m_pFormatLB->Show();
+
+ m_pNewFormatRB->SetAccessibleRelationLabelFor(m_pFormatLB);
+ m_pFormatLB->SetAccessibleRelationLabeledBy(m_pNewFormatRB);
+ m_pNumFormatLB->SetAccessibleRelationLabelFor(nullptr);
+
if( IsFieldEdit() )
{
for( sal_Int32 nI = m_pFormatLB->GetEntryCount(); nI; )
diff --git a/sw/uiconfig/swriter/ui/flddbpage.ui b/sw/uiconfig/swriter/ui/flddbpage.ui
index f1b9b0ae0507..a9b1d65f39ea 100644
--- a/sw/uiconfig/swriter/ui/flddbpage.ui
+++ b/sw/uiconfig/swriter/ui/flddbpage.ui
@@ -318,7 +318,6 @@
<property name="draw_indicator">True</property>
<property name="group">fromdatabasecb</property>
<accessibility>
- <relation type="label-for" target="format"/>
<relation type="label-for" target="numformat"/>
</accessibility>
</object>
@@ -339,9 +338,6 @@
<property name="no_show_all">True</property>
<property name="entry_text_column">0</property>
<property name="id_column">1</property>
- <accessibility>
- <relation type="labelled-by" target="userdefinedcb"/>
- </accessibility>
</object>
<packing>
<property name="expand">False</property>
diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx
index 725cba29a8d0..50726365af1e 100644
--- a/vcl/source/window/printdlg.cxx
+++ b/vcl/source/window/printdlg.cxx
@@ -1252,6 +1252,10 @@ void PrintDialog::setupOptionalUI()
maNUpPage.mpPagesBoxTitleTxt->SetText( maNUpPage.mpPagesBtn->GetText() );
maNUpPage.mpPagesBoxTitleTxt->Show();
maNUpPage.mpPagesBtn->Show( false );
+
+ maNUpPage.mpPagesBoxTitleTxt->SetAccessibleRelationLabelFor(maNUpPage.mpNupPagesBox);
+ maNUpPage.mpNupPagesBox->SetAccessibleRelationLabeledBy(maNUpPage.mpPagesBoxTitleTxt);
+ maNUpPage.mpPagesBtn->SetAccessibleRelationLabelFor(nullptr);
}
// update enable states
diff --git a/vcl/uiconfig/ui/printdialog.ui b/vcl/uiconfig/ui/printdialog.ui
index 62faa172026d..08e55202e2ba 100644
--- a/vcl/uiconfig/ui/printdialog.ui
+++ b/vcl/uiconfig/ui/printdialog.ui
@@ -1075,7 +1075,7 @@
<property name="can_focus">False</property>
<property name="model">liststore1</property>
<accessibility>
- <relation type="labelled-by" target="pagespersheettxt"/>
+ <relation type="labelled-by" target="pagespersheetbtn"/>
</accessibility>
</object>
<packing>
@@ -1099,6 +1099,9 @@
<property name="active">True</property>
<property name="draw_indicator">True</property>
<property name="group">brochure</property>
+ <accessibility>
+ <relation type="label-for" target="paperspersheetlb"/>
+ </accessibility>
</object>
<packing>
<property name="expand">False</property>
@@ -1109,9 +1112,6 @@
<child>
<object class="GtkLabel" id="pagespersheettxt">
<property name="can_focus">False</property>
- <accessibility>
- <relation type="label-for" target="paperspersheetlb"/>
- </accessibility>
</object>
<packing>
<property name="expand">False</property>
More information about the Libreoffice-commits
mailing list