[Libreoffice-commits] core.git: 4 commits - vcl/source vcl/win
Tor Lillqvist
tml at collabora.com
Mon Mar 13 17:58:33 UTC 2017
vcl/source/outdev/font.cxx | 68 ++++++++++++++++++++++-----------------------
vcl/win/gdi/salfont.cxx | 5 ---
2 files changed, 35 insertions(+), 38 deletions(-)
New commits:
commit 2e497bb94f468da77151b80d9a7b528f53ce0b40
Author: Tor Lillqvist <tml at collabora.com>
Date: Mon Mar 13 19:43:47 2017 +0200
Simplify and sanitize some OSL_DEBUG_LEVEL > 2 (!) SAL_INFO code
No point in outputting the enum class name when we know it is a value
from that enum that we are outputting.
Fix some random whitespace craziness.
No point in putting that symbolic representation of an enumeration in
double-quotes. It is not a string in any sense.
We can pass an OUString directly in SAL_INFO.
Be consistent, put a double-quote on both sides of the string (font
family name), if at all.
This is a way too verbose commit message for such a trivial change.
Change-Id: I9e3f96856a634dc16f0e24f789c1898d7ec75fd9
diff --git a/vcl/source/outdev/font.cxx b/vcl/source/outdev/font.cxx
index 18111be..847de1b 100644
--- a/vcl/source/outdev/font.cxx
+++ b/vcl/source/outdev/font.cxx
@@ -928,44 +928,44 @@ vcl::Font OutputDevice::GetDefaultFont( DefaultFontType nType, LanguageType eLan
}
#if OSL_DEBUG_LEVEL > 2
- const char* s = "DefaultFontType::SANS_UNKNOWN";
+ const char* s = "SANS_UNKNOWN";
switch ( nType )
{
- case DefaultFontType::SANS_UNICODE: s = "DefaultFontType::SANS_UNICODE"; break;
- case DefaultFontType::UI_SANS: s = "DefaultFontType::UI_SANS"; break;
-
- case DefaultFontType::SANS: s = "DefaultFontType::SANS"; break;
- case DefaultFontType::LATIN_HEADING: s = "DefaultFontType::LATIN_HEADING"; break;
- case DefaultFontType::LATIN_SPREADSHEET: s = "DefaultFontType::LATIN_SPREADSHEET"; break;
- case DefaultFontType::LATIN_DISPLAY: s = "DefaultFontType::LATIN_DISPLAY"; break;
-
- case DefaultFontType::SERIF: s = "DefaultFontType::SERIF"; break;
- case DefaultFontType::LATIN_TEXT: s = "DefaultFontType::LATIN_TEXT"; break;
- case DefaultFontType::LATIN_PRESENTATION: s = "DefaultFontType::LATIN_PRESENTATION"; break;
-
- case DefaultFontType::FIXED: s = "DefaultFontType::FIXED"; break;
- case DefaultFontType::LATIN_FIXED: s = "DefaultFontType::LATIN_FIXED"; break;
- case DefaultFontType::UI_FIXED: s = "DefaultFontType::UI_FIXED"; break;
-
- case DefaultFontType::SYMBOL: s = "DefaultFontType::SYMBOL"; break;
-
- case DefaultFontType::CJK_TEXT: s = "DefaultFontType::CJK_TEXT"; break;
- case DefaultFontType::CJK_PRESENTATION: s = "DefaultFontType::CJK_PRESENTATION"; break;
- case DefaultFontType::CJK_SPREADSHEET: s = "DefaultFontType::CJK_SPREADSHEET"; break;
- case DefaultFontType::CJK_HEADING: s = "DefaultFontType::CJK_HEADING"; break;
- case DefaultFontType::CJK_DISPLAY: s = "DefaultFontType::CJK_DISPLAY"; break;
-
- case DefaultFontType::CTL_TEXT: s = "DefaultFontType::CTL_TEXT"; break;
- case DefaultFontType::CTL_PRESENTATION: s = "DefaultFontType::CTL_PRESENTATION"; break;
- case DefaultFontType::CTL_SPREADSHEET: s = "DefaultFontType::CTL_SPREADSHEET"; break;
- case DefaultFontType::CTL_HEADING: s = "DefaultFontType::CTL_HEADING"; break;
- case DefaultFontType::CTL_DISPLAY: s = "DefaultFontType::CTL_DISPLAY"; break;
+ case DefaultFontType::SANS_UNICODE: s = "SANS_UNICODE"; break;
+ case DefaultFontType::UI_SANS: s = "UI_SANS"; break;
+
+ case DefaultFontType::SANS: s = "SANS"; break;
+ case DefaultFontType::LATIN_HEADING: s = "LATIN_HEADING"; break;
+ case DefaultFontType::LATIN_SPREADSHEET: s = "LATIN_SPREADSHEET"; break;
+ case DefaultFontType::LATIN_DISPLAY: s = "LATIN_DISPLAY"; break;
+
+ case DefaultFontType::SERIF: s = "SERIF"; break;
+ case DefaultFontType::LATIN_TEXT: s = "LATIN_TEXT"; break;
+ case DefaultFontType::LATIN_PRESENTATION: s = "LATIN_PRESENTATION"; break;
+
+ case DefaultFontType::FIXED: s = "FIXED"; break;
+ case DefaultFontType::LATIN_FIXED: s = "LATIN_FIXED"; break;
+ case DefaultFontType::UI_FIXED: s = "UI_FIXED"; break;
+
+ case DefaultFontType::SYMBOL: s = "SYMBOL"; break;
+
+ case DefaultFontType::CJK_TEXT: s = "CJK_TEXT"; break;
+ case DefaultFontType::CJK_PRESENTATION: s = "CJK_PRESENTATION"; break;
+ case DefaultFontType::CJK_SPREADSHEET: s = "CJK_SPREADSHEET"; break;
+ case DefaultFontType::CJK_HEADING: s = "CJK_HEADING"; break;
+ case DefaultFontType::CJK_DISPLAY: s = "CJK_DISPLAY"; break;
+
+ case DefaultFontType::CTL_TEXT: s = "CTL_TEXT"; break;
+ case DefaultFontType::CTL_PRESENTATION: s = "CTL_PRESENTATION"; break;
+ case DefaultFontType::CTL_SPREADSHEET: s = "CTL_SPREADSHEET"; break;
+ case DefaultFontType::CTL_HEADING: s = "CTL_HEADING"; break;
+ case DefaultFontType::CTL_DISPLAY: s = "CTL_DISPLAY"; break;
}
SAL_INFO("vcl.gdi",
- "OutputDevice::GetDefaultFont() Type=\"" << s
- << "\" lang=" << eLang
+ "OutputDevice::GetDefaultFont() Type=" << s
+ << " lang=" << eLang
<< " flags=" << static_cast<int>(nFlags)
- << " family=\"" << OUStringToOString( aFont.GetFamilyName(), RTL_TEXTENCODING_UTF8 ).getStr());
+ << " family=\"" << aFont.GetFamilyName() << "\"");
#endif
return aFont;
commit b470eb0972eae3771c3dea2d51bbcf071e493c8c
Author: Tor Lillqvist <tml at collabora.com>
Date: Mon Mar 13 19:39:51 2017 +0200
WaE: Operator precedence is difficult to get right
Fix C4806: '&': unsafe operation: no value of type 'bool' promoted to
type 'int' can equal the given constant
Change-Id: Iedd54379a67373fb3499a0a780f2cbfc83f08e84
diff --git a/vcl/win/gdi/salfont.cxx b/vcl/win/gdi/salfont.cxx
index b5ce292..65b828a 100644
--- a/vcl/win/gdi/salfont.cxx
+++ b/vcl/win/gdi/salfont.cxx
@@ -1635,7 +1635,7 @@ bool WinSalGraphics::CreateFontSubset( const OUString& rToFile,
return FALSE;
SAL_WARN_IF( (aWinMetric.tmPitchAndFamily & TMPF_DEVICE), "vcl", "cannot subset device font" );
- SAL_WARN_IF( !aWinMetric.tmPitchAndFamily & TMPF_TRUETYPE, "vcl", "can only subset TT font" );
+ SAL_WARN_IF( !(aWinMetric.tmPitchAndFamily & TMPF_TRUETYPE), "vcl", "can only subset TT font" );
#endif
OUString aSysPath;
commit 0760718be8a4355127159efc27d3b5c926402836
Author: Tor Lillqvist <tml at collabora.com>
Date: Mon Mar 13 19:29:53 2017 +0200
Fix bit-rot in OSL_DEBUG_LEVEL>2 (!) code
Change-Id: I376933a033a2dc2b5b7b59006b93d14a65463aed
diff --git a/vcl/source/outdev/font.cxx b/vcl/source/outdev/font.cxx
index 8a597f4..18111be 100644
--- a/vcl/source/outdev/font.cxx
+++ b/vcl/source/outdev/font.cxx
@@ -964,8 +964,8 @@ vcl::Font OutputDevice::GetDefaultFont( DefaultFontType nType, LanguageType eLan
SAL_INFO("vcl.gdi",
"OutputDevice::GetDefaultFont() Type=\"" << s
<< "\" lang=" << eLang
- << " flags=" << nFlags
- << " FontName=\"" << OUStringToOString( aFont.GetName(), RTL_TEXTENCODING_UTF8 ).getStr());
+ << " flags=" << static_cast<int>(nFlags)
+ << " family=\"" << OUStringToOString( aFont.GetFamilyName(), RTL_TEXTENCODING_UTF8 ).getStr());
#endif
return aFont;
commit 21a060a0ca597bce8dc6f73190ca48293164aaf7
Author: Tor Lillqvist <tml at collabora.com>
Date: Mon Mar 13 19:18:47 2017 +0200
Bin leftover debugging fprintf with reference to some mysterious 'grLog()'
Change-Id: I6b9423db247583ff1dcbd469db5dfab7f89e7457
diff --git a/vcl/win/gdi/salfont.cxx b/vcl/win/gdi/salfont.cxx
index e9bc239..b5ce292 100644
--- a/vcl/win/gdi/salfont.cxx
+++ b/vcl/win/gdi/salfont.cxx
@@ -639,9 +639,6 @@ WinFontFace::WinFontFace( const FontAttributes& rDFS,
mbAliasSymbolsHigh = true;
}
}
-#ifdef DEBUG
- fprintf(grLog(), "WinFontFace::WinFontFace() %lx\n", (unsigned long)this);
-#endif
}
WinFontFace::~WinFontFace()
More information about the Libreoffice-commits
mailing list