From a390a10269ed2aafd7dd8fcce3b057c9b4a3dd86 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 25 Sep 2012 12:45:16 +0100 Subject: move layout diagnostics to vcl.layout channel Change-Id: Ib33d91ea56219036182d30fdd3dc2159ce32a48c --- sal/inc/sal/log-areas.dox | 1 + sfx2/source/appl/sfxhelp.cxx | 8 -------- vcl/source/control/spinfld.cxx | 3 --- vcl/source/window/builder.cxx | 4 +++- vcl/source/window/dialog.cxx | 6 ++---- vcl/source/window/layout.cxx | 6 ++++-- vcl/source/window/printdlg.cxx | 5 ----- vcl/source/window/tabpage.cxx | 1 - vcl/source/window/window.cxx | 2 +- 9 files changed, 11 insertions(+), 25 deletions(-) diff --git a/sal/inc/sal/log-areas.dox b/sal/inc/sal/log-areas.dox index c30bc0bbe370..68961485329d 100644 --- a/sal/inc/sal/log-areas.dox +++ b/sal/inc/sal/log-areas.dox @@ -42,6 +42,7 @@ certain functionality. @li @c vcl.gdi - the GDI part of VCL, devices, bitmaps, etc. @li @c vcl.gtk - Gtk+ 2/3 plugin +@li @c vcl.layout - Widget layout @section Writer diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx index 7155eefb9ed4..0d896375728a 100644 --- a/sfx2/source/appl/sfxhelp.cxx +++ b/sfx2/source/appl/sfxhelp.cxx @@ -596,7 +596,6 @@ XubString SfxHelp::GetHelpText( const String& aCommandURL, const Window* pWindow { String sModuleName = GetHelpModuleName_Impl(); String sHelpText = pImp->GetHelpText( aCommandURL, sModuleName ); - fprintf(stderr, "A sHelpText %s for id %s\n", rtl::OUStringToOString(sHelpText, RTL_TEXTENCODING_UTF8).getStr(), rtl::OUStringToOString(aCommandURL, RTL_TEXTENCODING_UTF8).getStr()); rtl::OString aNewHelpId; @@ -608,7 +607,6 @@ XubString SfxHelp::GetHelpText( const String& aCommandURL, const Window* pWindow { aNewHelpId = pParent->GetHelpId(); sHelpText = pImp->GetHelpText( rtl::OStringToOUString(aNewHelpId, RTL_TEXTENCODING_UTF8), sModuleName ); - fprintf(stderr, "B sHelpText %s for id %s\n", rtl::OUStringToOString(sHelpText, RTL_TEXTENCODING_UTF8).getStr(), aNewHelpId.getStr()); if ( sHelpText.Len() > 0 ) pParent = NULL; else @@ -712,8 +710,6 @@ sal_Bool SfxHelp::Start_Impl( const String& rURL, const Window* pWindow, const S // no URL, just a HelpID (maybe empty in case of keyword search) aHelpURL = CreateHelpURL_Impl( rURL, aHelpModuleName ); - fprintf(stderr, "C aHelpURL %s\n", rtl::OUStringToOString(aHelpURL, RTL_TEXTENCODING_UTF8).getStr()); - if ( impl_hasHelpInstalled() && pWindow && SfxContentHelper::IsHelpErrorDocument( aHelpURL ) ) { // no help found -> try with parent help id. @@ -721,12 +717,9 @@ sal_Bool SfxHelp::Start_Impl( const String& rURL, const Window* pWindow, const S while ( pParent ) { rtl::OString aHelpId = pParent->GetHelpId(); - fprintf(stderr, "D helpid %s for %p\n", aHelpId.getStr(), pParent); aHelpURL = CreateHelpURL( rtl::OStringToOUString(aHelpId, RTL_TEXTENCODING_UTF8), aHelpModuleName ); - fprintf(stderr, "D aHelpURL %s\n", rtl::OUStringToOString(aHelpURL, RTL_TEXTENCODING_UTF8).getStr()); if ( !SfxContentHelper::IsHelpErrorDocument( aHelpURL ) ) { - fprintf(stderr, "found as %s\n", rtl::OUStringToOString(aHelpURL, RTL_TEXTENCODING_UTF8).getStr()); break; } else @@ -734,7 +727,6 @@ sal_Bool SfxHelp::Start_Impl( const String& rURL, const Window* pWindow, const S pParent = pParent->GetParent(); if ( !pParent ) { - fprintf(stderr, "no more parents\n"); // create help url of start page ( helpid == 0 -> start page) aHelpURL = CreateHelpURL( String(), aHelpModuleName ); } diff --git a/vcl/source/control/spinfld.cxx b/vcl/source/control/spinfld.cxx index dcd5233002fc..ecb0e51bd91f 100644 --- a/vcl/source/control/spinfld.cxx +++ b/vcl/source/control/spinfld.cxx @@ -367,7 +367,6 @@ SpinField::SpinField( Window* pParent, const ResId& rResId ) : void SpinField::take_properties(Window &rOther) { - fprintf(stderr, "SpinField::take_properties\n"); if (!GetParent()) { ImplInitSpinFieldData(); @@ -391,7 +390,6 @@ void SpinField::take_properties(Window &rOther) mbUpperIn = rOtherField.mbUpperIn; mbLowerIn = rOtherField.mbLowerIn; mbInDropDown = rOtherField.mbInDropDown; - fprintf(stderr, "SpinField::take_properties %p %d\n", this, IsVisible()); } @@ -1004,7 +1002,6 @@ Size SpinField::CalcMinimumSizeForText(const rtl::OUString &rString) const Size SpinField::CalcMinimumSize() const { - fprintf(stderr, "SpinField::CalcMinimumSize\n"); return CalcMinimumSizeForText(GetText()); } diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx index 9edf1970a56a..da2b87c45d73 100644 --- a/vcl/source/window/builder.cxx +++ b/vcl/source/window/builder.cxx @@ -605,7 +605,9 @@ Window *VclBuilder::insertObject(Window *pParent, const rtl::OString &rClass, co if (pCurrentChild->GetHelpId().isEmpty()) { pCurrentChild->SetHelpId(m_sHelpRoot + m_sID); - fprintf(stderr, "for toplevel dialog %p %s, set helpid %s\n", this, rID.getStr(), pCurrentChild->GetHelpId().getStr()); + SAL_INFO("vcl.layout", "for toplevel dialog " << this << " " << + rID.getStr() << ", set helpid " << + pCurrentChild->GetHelpId().getStr()); } } else diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx index 761ff822912c..a47f338f1002 100644 --- a/vcl/source/window/dialog.cxx +++ b/vcl/source/window/dialog.cxx @@ -552,8 +552,6 @@ VclBuilder* VclBuilderContainer::overrideResourceWithUIXML(Window *pWindow, cons appendAscii(".ui"). makeStringAndClear(); - fprintf(stderr, "path %s id %d\n", rtl::OUStringToOString(sRoot+sPath, RTL_TEXTENCODING_UTF8).getStr(), nUIid); - osl::File aUIFile(sRoot + sPath); osl::File::RC error = aUIFile.open(osl_File_OpenFlag_Read); //good, use the preferred GtkBuilder xml @@ -1212,7 +1210,7 @@ IMPL_LINK( Dialog, ImplHandleLayoutTimerHdl, void*, EMPTYARG ) { if (!isLayoutEnabled()) { - fprintf(stderr, "Dialog has become non-layout because extra children have been added directly to it!\n"); + SAL_WARN("vcl.layout", "Dialog has become non-layout because extra children have been added directly to it."); return 0; } @@ -1279,7 +1277,7 @@ bool VclBuilderContainer::replace_buildable(Window *pParent, const ResId& rResId } else { - fprintf(stderr, "%d %p not found, hiding\n", nID, &rReplacement); + SAL_WARN("vcl.layout", "widget " << nID << " " << &rReplacement << " not found, hiding"); //move "missing" elements into the action area (just to have //a known container as an owner) and hide it Window* pArbitraryParent; diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx index 6e8161631f6c..9ab95793f706 100644 --- a/vcl/source/window/layout.cxx +++ b/vcl/source/window/layout.cxx @@ -322,7 +322,9 @@ bool VclButtonBox::set_property(const rtl::OString &rKey, const rtl::OString &rV else if (rValue.equalsL(RTL_CONSTASCII_STRINGPARAM("center"))) eStyle = VCL_BUTTONBOX_CENTER; else - fprintf(stderr, "unknown layout style %s\n", rValue.getStr()); + { + SAL_WARN("vcl.layout", "unknown layout style " << rValue.getStr()); + } set_layout(eStyle); } else @@ -359,7 +361,7 @@ void VclButtonBox::setAllocation(const Size &rAllocation) case VCL_BUTTONBOX_START: break; default: - fprintf(stderr, "todo unimplemented layout style\n"); + SAL_WARN("vcl.layout", "todo unimplemented layout style"); case VCL_BUTTONBOX_DEFAULT_STYLE: case VCL_BUTTONBOX_END: setPrimaryCoordinate(aPos, nPrimaryCoordinate + nAllocPrimaryDimension diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx index ad80b51f1500..84bcb3f9db32 100644 --- a/vcl/source/window/printdlg.cxx +++ b/vcl/source/window/printdlg.cxx @@ -808,8 +808,6 @@ void PrintDialog::setupOptionalUI() const Sequence< PropertyValue >& rOptions( maPController->getUIOptions() ); for( int i = 0; i < rOptions.getLength(); i++ ) { - fprintf(stderr, "property name is %s\n", rtl::OUStringToOString(rOptions[i].Name, RTL_TEXTENCODING_UTF8).getStr()); - if (rOptions[i].Name == "OptionsUIFile") { rtl::OUString sOptionsUIFile; @@ -817,8 +815,6 @@ void PrintDialog::setupOptionalUI() Window *pCustom = get("customcontents"); - fprintf(stderr, "pcustom is %p\n", pCustom); - delete mpCustomOptionsUIBuilder; mpCustomOptionsUIBuilder = new VclBuilder(pCustom, getUIRootDir(), sOptionsUIFile); Window *pWindow = mpCustomOptionsUIBuilder->get_widget_root(); @@ -943,7 +939,6 @@ void PrintDialog::setupOptionalUI() pPage = mpCustomOptionsUIBuilder->get(aID); sal_uInt16 nPageId = mpTabCtrl->GetPageId(*pPage); - fprintf(stderr, "pCustomPage %p for %s\n", pPage, rtl::OUStringToOString(aText, RTL_TEXTENCODING_UTF8).getStr()); mpTabCtrl->SetPageText(nPageId, aText); // set help id diff --git a/vcl/source/window/tabpage.cxx b/vcl/source/window/tabpage.cxx index 85ee67db9f40..8bdd921ba362 100644 --- a/vcl/source/window/tabpage.cxx +++ b/vcl/source/window/tabpage.cxx @@ -227,7 +227,6 @@ bool TabPage::isLayoutEnabled() const Size TabPage::GetOptimalSize(WindowSizeType eType) const { - fprintf(stderr, "asked for optimalsize of tabpage %p (%d) vis is %d\n", this, isLayoutEnabled(), IsVisible()); if (eType == WINDOWSIZE_MAXIMUM) return Window::GetOptimalSize(eType); Size aSize; diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index 556cfa777708..d7e362d0c8aa 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -6518,7 +6518,7 @@ Size Window::GetSizePixel() const { if (!mpWindowImpl) { - fprintf(stderr, "WTF\n"); + SAL_WARN("vcl.layout", "WTF no windowimpl"); return Size(0,0); } -- cgit