Skip to content

Commit

Permalink
qt5 a11y: Adapt loop for string construction here a bit
Browse files Browse the repository at this point in the history
Behavior should be unchanged.
This is in preparation of changing handling for empty
values in an upcoming commit.

Change-Id: If913680ea544c24fea6e418fb27ccdcb396920cd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119246
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
  • Loading branch information
michaelweghorn committed Jul 21, 2021
1 parent 0cda081 commit a440bea
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions vcl/qt5/Qt5AccessibleWidget.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -856,22 +856,29 @@ QString Qt5AccessibleWidget::attributes(int offset, int* startOffset, int* endOf
OUString aRet;
for (PropertyValue const& prop : attribs)
{
OUString sAttribute;
OUString sValue;
if (prop.Name == "CharFontName")
{
aRet += "font-family:" + *o3tl::doAccess<OUString>(prop.Value) + ";";
continue;
sAttribute = "font-family";
sValue = *o3tl::doAccess<OUString>(prop.Value);
}
if (prop.Name == "CharHeight")
else if (prop.Name == "CharHeight")
{
aRet += "font-size:" + OUString::number(*o3tl::doAccess<double>(prop.Value)) + "pt;";
continue;
sAttribute = "font-size";
sValue = OUString::number(*o3tl::doAccess<double>(prop.Value)) + "pt";
}
else if (prop.Name == "CharWeight")
{
sAttribute = "font-weight";
sValue = lcl_convertFontWeight(*o3tl::doAccess<double>(prop.Value));
}
if (prop.Name == "CharWeight")
else
{
aRet += "font-weight:" + lcl_convertFontWeight(*o3tl::doAccess<double>(prop.Value))
+ ";";
continue;
}

aRet += sAttribute + ":" + sValue + ";";
}
*startOffset = offset;
*endOffset = offset + 1;
Expand Down

0 comments on commit a440bea

Please sign in to comment.