diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-06-23 11:47:53 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-06-23 14:38:14 +0200 |
commit | 5e028ad5dccc6ff1a9250baf2196f7a2f235e314 (patch) | |
tree | 6c6992e6fccf43b60141fb6ae32a6ad8e37cb84d /vcl | |
parent | f905d6056606234ba53a26a3e4105ad3560d4b7b (diff) |
simplify some string handling in tracing calls
Change-Id: I0fb76562429e691400a02216019c7f96791cf9b3
Reviewed-on: https://gerrit.libreoffice.org/39159
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/gdi/bitmapex.cxx | 11 | ||||
-rw-r--r-- | vcl/source/gdi/svmconverter.cxx | 9 | ||||
-rw-r--r-- | vcl/source/window/builder.cxx | 8 | ||||
-rw-r--r-- | vcl/source/window/dialog.cxx | 6 | ||||
-rw-r--r-- | vcl/source/window/errinf.cxx | 12 | ||||
-rw-r--r-- | vcl/source/window/layout.cxx | 8 | ||||
-rw-r--r-- | vcl/source/window/printdlg.cxx | 6 | ||||
-rw-r--r-- | vcl/source/window/window.cxx | 15 | ||||
-rw-r--r-- | vcl/unx/generic/print/genpspgraphics.cxx | 4 |
9 files changed, 21 insertions, 58 deletions
diff --git a/vcl/source/gdi/bitmapex.cxx b/vcl/source/gdi/bitmapex.cxx index 62c571ebe855..50229734c508 100644 --- a/vcl/source/gdi/bitmapex.cxx +++ b/vcl/source/gdi/bitmapex.cxx @@ -109,16 +109,7 @@ void BitmapEx::loadFromIconTheme( const OUString& rIconName ) bSuccess = false; } - if (!bSuccess) - { -#ifdef DBG_UTIL - OStringBuffer aErrorStr( - "BitmapEx::BitmapEx(): could not load image <"); - aErrorStr.append(OUStringToOString(rIconName, RTL_TEXTENCODING_ASCII_US)).append("> via icon theme "); - aErrorStr.append(OUStringToOString(aIconTheme, RTL_TEXTENCODING_ASCII_US)).append('.'); - OSL_FAIL(aErrorStr.getStr()); -#endif - } + SAL_WARN_IF( !bSuccess, "vcl", "BitmapEx::BitmapEx(): could not load image " << rIconName << " via icon theme " << aIconTheme); } BitmapEx::BitmapEx( const Bitmap& rBmp ) : diff --git a/vcl/source/gdi/svmconverter.cxx b/vcl/source/gdi/svmconverter.cxx index 049479961bef..56fa5330b363 100644 --- a/vcl/source/gdi/svmconverter.cxx +++ b/vcl/source/gdi/svmconverter.cxx @@ -2573,14 +2573,7 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf, break; default: -#ifdef DBG_UTIL - { - OStringBuffer aStr("Missing implementation for Action#: "); - aStr.append(static_cast<sal_Int32>(pAction->GetType())); - aStr.append('!'); - OSL_FAIL(aStr.getStr()); - } -#endif + SAL_WARN( "vcl", "Missing implementation for Action#: " << static_cast<sal_Int32>(pAction->GetType()) ); break; } } diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx index da3435510a7e..9d8c448970ec 100644 --- a/vcl/source/window/builder.cxx +++ b/vcl/source/window/builder.cxx @@ -779,7 +779,7 @@ namespace return VclResId(SV_BUTTONTEXT_YES); else if (rType == "gtk-no") return VclResId(SV_BUTTONTEXT_NO); - SAL_WARN("vcl.layout", "unknown stock type: " << rType.getStr()); + SAL_WARN("vcl.layout", "unknown stock type: " << rType); return OUString(); } @@ -1461,20 +1461,20 @@ VclPtr<vcl::Window> VclBuilder::makeObject(vcl::Window *pParent, const OString & if (sPattern == "hh:mm") { connectTimeFormatterAdjustment(id, sAdjustment); - SAL_INFO("vcl.layout", "making time field for " << name << " " << sUnit.getStr()); + SAL_INFO("vcl.layout", "making time field for " << name << " " << sUnit); xWindow = VclPtr<TimeField>::Create(pParent, nBits); } else if (sPattern == "yy:mm:dd") { connectDateFormatterAdjustment(id, sAdjustment); - SAL_INFO("vcl.layout", "making date field for " << name << " " << sUnit.getStr()); + SAL_INFO("vcl.layout", "making date field for " << name << " " << sUnit); xWindow = VclPtr<DateField>::Create(pParent, nBits); } else { connectNumericFormatterAdjustment(id, sAdjustment); FieldUnit eUnit = detectMetricUnit(sUnit); - SAL_INFO("vcl.layout", "making metric field for " << name << " " << sUnit.getStr()); + SAL_INFO("vcl.layout", "making metric field for " << name << " " << sUnit); VclPtrInstance<MetricField> xField(pParent, nBits); xField->SetUnit(eUnit); if (eUnit == FUNIT_CUSTOM) diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx index 6847fb2d5d76..0cb24e9cdef9 100644 --- a/vcl/source/window/dialog.cxx +++ b/vcl/source/window/dialog.cxx @@ -751,10 +751,8 @@ bool Dialog::ImplStartExecuteModal() if ( mbInExecute ) { #ifdef DBG_UTIL - OStringBuffer aErrorStr; - aErrorStr.append("Dialog::StartExecuteModal() is called in Dialog::StartExecuteModal(): "); - aErrorStr.append(ImplGetDialogText(this)); - OSL_FAIL(aErrorStr.getStr()); + SAL_WARN( "vcl", "Dialog::StartExecuteModal() is called in Dialog::StartExecuteModal(): " + << ImplGetDialogText(this) ); #endif return false; } diff --git a/vcl/source/window/errinf.cxx b/vcl/source/window/errinf.cxx index 7815e67bb11a..8eba53584b5c 100644 --- a/vcl/source/window/errinf.cxx +++ b/vcl/source/window/errinf.cxx @@ -70,11 +70,7 @@ void ErrorRegistry::RegisterDisplay(WindowDisplayErrorFunc *aDsp) static void aDspFunc(const OUString &rErr, const OUString &rAction) { - OStringBuffer aErr("Action: "); - aErr.append(OUStringToOString(rAction, RTL_TEXTENCODING_ASCII_US)); - aErr.append(" Error: "); - aErr.append(OUStringToOString(rErr, RTL_TEXTENCODING_ASCII_US)); - OSL_FAIL(aErr.getStr()); + SAL_WARN("vcl", "Action: " << rAction << " Error: " << rErr); } ErrorHandler::ErrorHandler() @@ -156,11 +152,7 @@ DialogMask ErrorHandler::HandleError(ErrCode nErrCodeId, DialogMask nFlags) { if(!rData.pDsp) { - OStringBuffer aStr("Action: "); - aStr.append(OUStringToOString(aAction, RTL_TEXTENCODING_ASCII_US)); - aStr.append("\nError: "); - aStr.append(OUStringToOString(aErr, RTL_TEXTENCODING_ASCII_US)); - OSL_FAIL(aStr.getStr()); + SAL_WARN( "vcl", "Action: " << aAction << "Error: " << aErr); } else { diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx index 4dab791301f4..32643162d110 100644 --- a/vcl/source/window/layout.cxx +++ b/vcl/source/window/layout.cxx @@ -723,7 +723,7 @@ bool VclButtonBox::set_property(const OString &rKey, const OUString &rValue) eStyle = VclButtonBoxStyle::Center; else { - SAL_WARN("vcl.layout", "unknown layout style " << rValue.getStr()); + SAL_WARN("vcl.layout", "unknown layout style " << rValue); } m_eLayoutStyle = eStyle; } @@ -2139,7 +2139,7 @@ bool VclSizeGroup::set_property(const OString &rKey, const OUString &rValue) eMode = VclSizeGroupMode::Both; else { - SAL_WARN("vcl.layout", "unknown size group mode" << rValue.getStr()); + SAL_WARN("vcl.layout", "unknown size group mode" << rValue); } set_mode(eMode); } @@ -2465,7 +2465,7 @@ bool MessageDialog::set_property(const OString &rKey, const OUString &rValue) eMode = VclMessageType::Error; else { - SAL_WARN("vcl.layout", "unknown message type mode" << rValue.getStr()); + SAL_WARN("vcl.layout", "unknown message type mode" << rValue); } m_eMessageType = eMode; } @@ -2486,7 +2486,7 @@ bool MessageDialog::set_property(const OString &rKey, const OUString &rValue) eMode = VclButtonsType::OkCancel; else { - SAL_WARN("vcl.layout", "unknown buttons type mode" << rValue.getStr()); + SAL_WARN("vcl.layout", "unknown buttons type mode" << rValue); } m_eButtonsType = eMode; } diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx index 6aef0dbafd69..07c26f5c24ab 100644 --- a/vcl/source/window/printdlg.cxx +++ b/vcl/source/window/printdlg.cxx @@ -1164,11 +1164,7 @@ void PrintDialog::setupOptionalUI() } else { - OStringBuffer sMessage; - sMessage.append("Unsupported UI option: \""); - sMessage.append(OUStringToOString(aCtrlType, RTL_TEXTENCODING_UTF8)); - sMessage.append('"'); - OSL_FAIL( sMessage.getStr() ); + SAL_WARN( "vcl", "Unsupported UI option: \"" << aCtrlType << '"'); } } diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index 19fcebba9c48..12bd3c0a03aa 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -376,10 +376,7 @@ void Window::dispose() } else { - OStringBuffer aTempStr("Window ("); - aTempStr.append(OUStringToOString(GetText(), RTL_TEXTENCODING_UTF8)); - aTempStr.append(") not found in TaskPanelList!"); - OSL_FAIL( aTempStr.getStr() ); + SAL_WARN( "vcl", "Window (" << GetText() << ") not found in TaskPanelList"); } } @@ -417,12 +414,10 @@ void Window::dispose() // #122232#, this must not happen and is an application bug ! but we try some cleanup to hopefully avoid crashes, see below bHasFocussedChild = true; #if OSL_DEBUG_LEVEL > 0 - OStringBuffer aTempStr("Window ("); - aTempStr.append(OUStringToOString(GetText(), - RTL_TEXTENCODING_UTF8)). - append(") with focussed child window destroyed ! THIS WILL LEAD TO CRASHES AND MUST BE FIXED !"); - OSL_FAIL( aTempStr.getStr() ); - Application::Abort(OStringToOUString(aTempStr.makeStringAndClear(), RTL_TEXTENCODING_UTF8 )); // abort in debug build version, this must be fixed! + OUString aTempStr = "Window (" + GetText() + + ") with focussed child window destroyed ! THIS WILL LEAD TO CRASHES AND MUST BE FIXED !"; + SAL_WARN( "vcl", aTempStr ); + Application::Abort(aTempStr); // abort in debug build version, this must be fixed! #endif } diff --git a/vcl/unx/generic/print/genpspgraphics.cxx b/vcl/unx/generic/print/genpspgraphics.cxx index 6e30a1da8591..ce451fc139c7 100644 --- a/vcl/unx/generic/print/genpspgraphics.cxx +++ b/vcl/unx/generic/print/genpspgraphics.cxx @@ -859,9 +859,7 @@ FontAttributes GenPspGraphics::Info2FontAttributes( const psp::FastPrintFontInfo #if OSL_DEBUG_LEVEL > 2 if( aDFA.HasMapNames() ) { - OString aOrigName(OUStringToOString(aDFA.GetFamilyName(), osl_getThreadTextEncoding())); - OString aAliasNames(OUStringToOString(aDFA.GetAliasNames(), osl_getThreadTextEncoding())); - SAL_INFO( "vcl.fonts", "using alias names " << aAliasNames.getStr() << " for font family " << aOrigName.getStr() ); + SAL_INFO( "vcl.fonts", "using alias names " << aDFA.GetAliasNames() << " for font family " << aDFA.GetFamilyName() ); } #endif |