From d21eb6bc91748c62ed0790c8330ce242411aacbc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Fri, 26 Oct 2012 12:57:37 +0100 Subject: [PATCH] add hook to block use of markup in .ui files Change-Id: Ia7eed5e9e1f8fba9876730e909461dabc167deb9 --- .git-hooks/pre-commit | 8 ++++++-- vcl/source/window/builder.cxx | 2 -- vcl/source/window/window2.cxx | 5 +++++ 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.git-hooks/pre-commit b/.git-hooks/pre-commit index 5b752a307a11..fdd07ad94603 100755 --- a/.git-hooks/pre-commit +++ b/.git-hooks/pre-commit @@ -14,8 +14,8 @@ $ENV{LC_ALL} = "C"; sub check_whitespaces($) { 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_full = "c|cpp|cxx|h|hrc|hxx|idl|inl|java|map|mk|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|ui|xcu|xml"; my $found_bad = 0; my $filename; @@ -80,6 +80,10 @@ sub check_whitespaces($) { bad_line("temporary debug in commit", $_, $src_limited); } + if (/True<\/property>/) + { + bad_line("use font attributes instead of use-markup", $_, $src_limited); + } } } if ( $found_bad) diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx index 34238e26e5aa..abe6e277bf51 100644 --- a/vcl/source/window/builder.cxx +++ b/vcl/source/window/builder.cxx @@ -1503,8 +1503,6 @@ void VclBuilder::collectProperty(xmlreader::XmlReader &reader, const OString &rI if (!sProperty.isEmpty()) { 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; } } diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx index 0006d0febe53..ec3b9fab2628 100644 --- a/vcl/source/window/window2.cxx +++ b/vcl/source/window/window2.cxx @@ -2127,6 +2127,11 @@ bool Window::set_property(const OString &rKey, const OString &rValue) nBits |= WB_AUTOVSCROLL; 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 { SAL_INFO("vcl.layout", "unhandled property: " << rKey.getStr());