Kaydet (Commit) d21eb6bc authored tarafından Caolán McNamara's avatar Caolán McNamara

add hook to block use of markup in .ui files

Change-Id: Ia7eed5e9e1f8fba9876730e909461dabc167deb9
üst fe347327
...@@ -14,8 +14,8 @@ $ENV{LC_ALL} = "C"; ...@@ -14,8 +14,8 @@ $ENV{LC_ALL} = "C";
sub check_whitespaces($) sub check_whitespaces($)
{ {
my ($h) = @_; my ($h) = @_;
my $src_limited = "c|cpp|cxx|h|hrc|hxx|idl|inl|java|map|MK|pmk|pl|pm|sdi|sh|src|tab|xcu|xml"; my $src_limited = "c|cpp|cxx|h|hrc|hxx|idl|inl|java|map|MK|pmk|pl|pm|sdi|sh|src|tab|ui|xcu|xml";
my $src_full = "c|cpp|cxx|h|hrc|hxx|idl|inl|java|map|mk|MK|pmk|pl|pm|sdi|sh|src|tab|xcu|xml"; my $src_full = "c|cpp|cxx|h|hrc|hxx|idl|inl|java|map|mk|MK|pmk|pl|pm|sdi|sh|src|tab|ui|xcu|xml";
my $found_bad = 0; my $found_bad = 0;
my $filename; my $filename;
...@@ -80,6 +80,10 @@ sub check_whitespaces($) ...@@ -80,6 +80,10 @@ sub check_whitespaces($)
{ {
bad_line("temporary debug in commit", $_, $src_limited); bad_line("temporary debug in commit", $_, $src_limited);
} }
if (/<property name="use_markup">True<\/property>/)
{
bad_line("use font attributes instead of use-markup", $_, $src_limited);
}
} }
} }
if ( $found_bad) if ( $found_bad)
......
...@@ -1503,8 +1503,6 @@ void VclBuilder::collectProperty(xmlreader::XmlReader &reader, const OString &rI ...@@ -1503,8 +1503,6 @@ void VclBuilder::collectProperty(xmlreader::XmlReader &reader, const OString &rI
if (!sProperty.isEmpty()) if (!sProperty.isEmpty())
{ {
sProperty = sProperty.replace('_', '-'); sProperty = sProperty.replace('_', '-');
//https://live.gnome.org/GnomeGoals/RemoveMarkupInMessages
SAL_WARN_IF(sProperty == "use-markup", "vcl.layout", "Use pango attributes instead of mark-up");
rMap[sProperty] = sValue; rMap[sProperty] = sValue;
} }
} }
......
...@@ -2127,6 +2127,11 @@ bool Window::set_property(const OString &rKey, const OString &rValue) ...@@ -2127,6 +2127,11 @@ bool Window::set_property(const OString &rKey, const OString &rValue)
nBits |= WB_AUTOVSCROLL; nBits |= WB_AUTOVSCROLL;
SetStyle(nBits); SetStyle(nBits);
} }
else if (rKey.equalsL(RTL_CONSTASCII_STRINGPARAM("use-markup")))
{
//https://live.gnome.org/GnomeGoals/RemoveMarkupInMessages
SAL_WARN_IF(toBool(rValue), "vcl.layout", "Use pango attributes instead of mark-up");
}
else else
{ {
SAL_INFO("vcl.layout", "unhandled property: " << rKey.getStr()); SAL_INFO("vcl.layout", "unhandled property: " << rKey.getStr());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment