[Libreoffice-commits] .: 5 commits - cui/source l10ntools/inc l10ntools/source sd/qa sfx2/inc sfx2/source svx/inc svx/source test/inc test/source unusedcode.easy vcl/inc vcl/source vcl/unx

Caolán McNamara caolan at kemper.freedesktop.org
Tue Feb 21 06:26:15 PST 2012


 cui/source/options/optinet2.cxx        |   39 ++++++++++++++++-----------------
 l10ntools/inc/export.hxx               |    1 
 l10ntools/source/merge.cxx             |   10 --------
 sd/qa/unit/filters-test.cxx            |    6 ++---
 sfx2/inc/sfx2/mnuitem.hxx              |    2 -
 sfx2/source/menu/mnuitem.cxx           |    5 +++-
 sfx2/source/menu/thessubmenu.cxx       |    7 +++--
 sfx2/source/menu/thessubmenu.hxx       |    2 -
 svx/inc/svx/grafctrl.hxx               |    6 ++---
 svx/inc/svx/lboxctrl.hxx               |    2 -
 svx/inc/svx/tbcontrl.hxx               |    3 +-
 svx/source/tbxctrls/grafctrl.cxx       |    5 +++-
 svx/source/tbxctrls/lboxctrl.cxx       |    6 +++--
 svx/source/tbxctrls/tbcontrl.cxx       |    6 ++++-
 test/inc/test/sheet/xspreadsheets2.hxx |    1 
 test/source/sheet/xspreadsheets2.cxx   |    4 +++
 unusedcode.easy                        |    4 ---
 vcl/inc/vcl/menu.hxx                   |    2 -
 vcl/source/window/menu.cxx             |    5 ----
 vcl/unx/generic/printer/ppdparser.cxx  |    6 ++---
 20 files changed, 61 insertions(+), 61 deletions(-)

New commits:
commit 548b28a947c38454b570e42fc65997f3055924f5
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Feb 21 11:46:35 2012 +0000

    WaE: unused variable

diff --git a/cui/source/options/optinet2.cxx b/cui/source/options/optinet2.cxx
index 361ce96..c42edd7 100644
--- a/cui/source/options/optinet2.cxx
+++ b/cui/source/options/optinet2.cxx
@@ -284,15 +284,15 @@ void SvxProxyTabPage::ReadConfigData_Impl()
         }
     }
 
-    catch(container::NoSuchElementException &) {
+    catch (const container::NoSuchElementException) {
         OSL_TRACE( "SvxProxyTabPage::ReadConfigData_Impl: NoSuchElementException caught" );
     }
 
-    catch(com::sun::star::lang::WrappedTargetException &) {
+    catch (const com::sun::star::lang::WrappedTargetException &) {
         OSL_TRACE( "SvxProxyTabPage::ReadConfigData_Impl: WrappedTargetException caught" );
     }
 
-    catch(RuntimeException &) {
+    catch (const RuntimeException &) {
         OSL_TRACE( "SvxProxyTabPage::ReadConfigData_Impl: RuntimeException caught" );
     }
 
@@ -342,16 +342,16 @@ void SvxProxyTabPage::ReadConfigDefaults_Impl()
             aNoProxyForED.SetText( aStringValue );
         }
     }
-    catch(beans::UnknownPropertyException &)
+    catch (const beans::UnknownPropertyException &)
     {
         OSL_TRACE( "SvxProxyTabPage::RestoreConfigDefaults_Impl: UnknownPropertyException caught" );
     }
 
-    catch(com::sun::star::lang::WrappedTargetException &) {
+    catch (const com::sun::star::lang::WrappedTargetException &) {
         OSL_TRACE( "SvxProxyTabPage::RestoreConfigDefaults_Impl: WrappedTargetException caught" );
     }
 
-    catch(RuntimeException &)
+    catch (const RuntimeException &)
     {
         OSL_TRACE( "SvxProxyTabPage::RestoreConfigDefaults_Impl: RuntimeException caught" );
     }
@@ -376,16 +376,16 @@ void SvxProxyTabPage::RestoreConfigDefaults_Impl()
         xChangesBatch->commitChanges();
     }
 
-    catch(beans::UnknownPropertyException &)
+    catch (const beans::UnknownPropertyException &)
     {
         OSL_TRACE( "SvxProxyTabPage::RestoreConfigDefaults_Impl: UnknownPropertyException caught" );
     }
 
-    catch(com::sun::star::lang::WrappedTargetException &) {
+    catch (const com::sun::star::lang::WrappedTargetException &) {
         OSL_TRACE( "SvxProxyTabPage::RestoreConfigDefaults_Impl: WrappedTargetException caught" );
     }
 
-    catch(RuntimeException &)
+    catch (const RuntimeException &)
     {
         OSL_TRACE( "SvxProxyTabPage::RestoreConfigDefaults_Impl: RuntimeException caught" );
     }
@@ -481,23 +481,23 @@ sal_Bool SvxProxyTabPage::FillItemSet(SfxItemSet& )
         xChangesBatch->commitChanges();
     }
 
-    catch(com::sun::star::lang::IllegalArgumentException &) {
+    catch (const com::sun::star::lang::IllegalArgumentException &) {
         OSL_TRACE( "SvxProxyTabPage::FillItemSet: IllegalArgumentException caught" );
     }
 
-    catch(beans::UnknownPropertyException &) {
+    catch (const beans::UnknownPropertyException &) {
         OSL_TRACE( "SvxProxyTabPage::FillItemSet: UnknownPropertyException caught" );
     }
 
-    catch(beans::PropertyVetoException &) {
+    catch (const beans::PropertyVetoException &) {
         OSL_TRACE( "SvxProxyTabPage::FillItemSet: PropertyVetoException caught" );
     }
 
-    catch(com::sun::star::lang::WrappedTargetException &) {
+    catch (const com::sun::star::lang::WrappedTargetException &) {
         OSL_TRACE( "SvxProxyTabPage::FillItemSet: WrappedTargetException caught" );
     }
 
-    catch(RuntimeException &) {
+    catch (const RuntimeException &) {
         OSL_TRACE( "SvxProxyTabPage::FillItemSet: RuntimeException caught" );
     }
 
@@ -748,7 +748,7 @@ IMPL_LINK( SvxSecurityTabPage, SavePasswordHdl, void*, EMPTYARG )
             }
         }
     }
-    catch( Exception& )
+    catch (const Exception&)
     {
         maSavePasswordsCB.Check( !maSavePasswordsCB.IsChecked() );
     }
@@ -768,7 +768,7 @@ IMPL_LINK( SvxSecurityTabPage, MasterPasswordHdl, PushButton*, EMPTYARG )
         if ( xMasterPasswd.is() && xMasterPasswd->isPersistentStoringAllowed() )
             xMasterPasswd->changeMasterPassword( Reference< task::XInteractionHandler >() );
     }
-    catch( Exception& )
+    catch (const Exception&)
     {}
 
     return 0;
@@ -812,7 +812,7 @@ IMPL_LINK( SvxSecurityTabPage, MasterPasswordCBHdl, void*, EMPTYARG )
             }
         }
     }
-    catch( Exception& )
+    catch (const Exception&)
     {
         maSavePasswordsCB.Check( !maSavePasswordsCB.IsChecked() );
     }
@@ -835,7 +835,7 @@ IMPL_LINK( SvxSecurityTabPage, ShowPasswordsHdl, PushButton*, EMPTYARG )
             aDlg.Execute();
         }
     }
-    catch( Exception& )
+    catch (const Exception&)
     {}
     return 0;
 }
@@ -852,6 +852,7 @@ IMPL_LINK( SvxSecurityTabPage, MacroSecPBHdl, void*, EMPTYARG )
     catch (const Exception& e)
     {
         OSL_FAIL(rtl::OUStringToOString(e.Message, osl_getThreadTextEncoding()).getStr());
+        (void)e;
     }
     return 0;
 }
@@ -960,7 +961,7 @@ void SvxSecurityTabPage::InitControls()
             }
         }
     }
-    catch( Exception& )
+    catch (const Exception&)
     {
         maSavePasswordsCB.Enable( sal_False );
     }
commit e7031fb14a5d434cc74a67ddba1e3ae56f648ea6
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Feb 21 10:12:58 2012 +0000

    WaE: add virtual dtor

diff --git a/test/inc/test/sheet/xspreadsheets2.hxx b/test/inc/test/sheet/xspreadsheets2.hxx
index cb8f5c2..dc9da86 100644
--- a/test/inc/test/sheet/xspreadsheets2.hxx
+++ b/test/inc/test/sheet/xspreadsheets2.hxx
@@ -43,6 +43,7 @@ class OOO_DLLPUBLIC_TEST XSpreadsheets2
 {
 public:
     XSpreadsheets2();
+    virtual ~XSpreadsheets2();
 
     // XSpreadsheets2
     void testImportedSheetNameAndIndex();
diff --git a/test/source/sheet/xspreadsheets2.cxx b/test/source/sheet/xspreadsheets2.cxx
index 18f024b..13dea7d 100644
--- a/test/source/sheet/xspreadsheets2.cxx
+++ b/test/source/sheet/xspreadsheets2.cxx
@@ -64,6 +64,10 @@ XSpreadsheets2::XSpreadsheets2():
 {
 }
 
+XSpreadsheets2::~XSpreadsheets2()
+{
+}
+
 void XSpreadsheets2::testImportedSheetNameAndIndex()
 {
 /**
commit 42eb8d310c15e05fc224c9b7a61fdf4bf3118f70
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Feb 21 08:38:35 2012 +0000

    unwrap ifdefs with unused members

diff --git a/l10ntools/inc/export.hxx b/l10ntools/inc/export.hxx
index ff8a679..97efcd9 100644
--- a/l10ntools/inc/export.hxx
+++ b/l10ntools/inc/export.hxx
@@ -381,7 +381,6 @@ private:
 
 public:
     PFormEntrys( const rtl::OString &rPForm ) : data_( rPForm ) {};
-    rtl::OString Dump();
     void InsertEntry(const rtl::OString &rId, const rtl::OString &rText,
         const rtl::OString &rQuickHelpText, const rtl::OString &rTitle)
     {
diff --git a/l10ntools/source/merge.cxx b/l10ntools/source/merge.cxx
index 55c62d1..1388460 100644
--- a/l10ntools/source/merge.cxx
+++ b/l10ntools/source/merge.cxx
@@ -50,16 +50,6 @@ namespace
 // class PFormEntrys
 //
 
-rtl::OString PFormEntrys::Dump()
-{
-    if (sText.size())
-    {
-        rtl::OString a(RTL_CONSTASCII_STRINGPARAM("sText"));
-        Export::DumpMap(a , sText);
-    }
-    return rtl::OString(RTL_CONSTASCII_STRINGPARAM("PFormEntrys\n"));
-}
-
 sal_Bool PFormEntrys::GetTransex3Text( rtl::OString &rReturn,
     sal_uInt16 nTyp, const rtl::OString &nLangIndex, sal_Bool bDel )
 {
diff --git a/sfx2/inc/sfx2/mnuitem.hxx b/sfx2/inc/sfx2/mnuitem.hxx
index 62ebce6..88871d5 100644
--- a/sfx2/inc/sfx2/mnuitem.hxx
+++ b/sfx2/inc/sfx2/mnuitem.hxx
@@ -138,7 +138,7 @@ protected:
     DECL_LINK( Activate, Menu * );
 
 public:
-    SFX_DECL_MENU_CONTROL();
+    static SfxMenuControl* CreateImpl( sal_uInt16 nId, Menu &rMenu, SfxBindings &rBindings );
     SfxAppMenuControl_Impl( sal_uInt16 nPos, Menu& rMenu, SfxBindings& rBindings );
     ~SfxAppMenuControl_Impl();
 };
diff --git a/sfx2/source/menu/mnuitem.cxx b/sfx2/source/menu/mnuitem.cxx
index 4f6e1b4..c01f7b3 100644
--- a/sfx2/source/menu/mnuitem.cxx
+++ b/sfx2/source/menu/mnuitem.cxx
@@ -303,7 +303,10 @@ PopupMenu* SfxMenuControl::GetPopup () const
 
 long Select_Impl( void* pHdl, void* pVoid );
 
-SFX_IMPL_MENU_CONTROL( SfxAppMenuControl_Impl, SfxStringItem );
+SfxMenuControl* SfxAppMenuControl_Impl::CreateImpl( sal_uInt16 nId, Menu &rMenu, SfxBindings &rBindings )
+{
+    return new SfxAppMenuControl_Impl(nId, rMenu, rBindings);
+}
 
 SfxAppMenuControl_Impl::SfxAppMenuControl_Impl(
     sal_uInt16 nPos, Menu& rMenu, SfxBindings& rBindings )
diff --git a/sfx2/source/menu/thessubmenu.cxx b/sfx2/source/menu/thessubmenu.cxx
index 318b287..1bda672 100644
--- a/sfx2/source/menu/thessubmenu.cxx
+++ b/sfx2/source/menu/thessubmenu.cxx
@@ -53,9 +53,10 @@ using ::rtl::OUString;
 
 // STATIC DATA -----------------------------------------------------------
 
-SFX_IMPL_MENU_CONTROL(SfxThesSubMenuControl, SfxStringItem);
-
-
+SfxMenuControl* SfxThesSubMenuControl::CreateImpl( sal_uInt16 nId, Menu &rMenu, SfxBindings &rBindings )
+{
+    return new SfxThesSubMenuControl(nId, rMenu, rBindings);
+}
 
 /*
     Constructor; sets the Select-Handler for the Menu and inserts it into
diff --git a/sfx2/source/menu/thessubmenu.hxx b/sfx2/source/menu/thessubmenu.hxx
index 8ec3977..b177b11 100644
--- a/sfx2/source/menu/thessubmenu.hxx
+++ b/sfx2/source/menu/thessubmenu.hxx
@@ -57,7 +57,7 @@ public:
 
     virtual PopupMenu*  GetPopup() const;
 
-    SFX_DECL_MENU_CONTROL();
+    static SfxMenuControl* CreateImpl( sal_uInt16 nId, Menu &rMenu, SfxBindings &rBindings );
 };
 
 
diff --git a/svx/inc/svx/grafctrl.hxx b/svx/inc/svx/grafctrl.hxx
index ee5ffa0..27816f2 100644
--- a/svx/inc/svx/grafctrl.hxx
+++ b/svx/inc/svx/grafctrl.hxx
@@ -73,10 +73,10 @@ public:
 class SvxGrafToolBoxControl : public SfxToolBoxControl
 {
 public:
+    static SfxToolBoxControl* CreateImpl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox &rTbx );
 
-                        SFX_DECL_TOOLBOX_CONTROL();
-                        SvxGrafToolBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
-                        ~SvxGrafToolBoxControl();
+    SvxGrafToolBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
+    ~SvxGrafToolBoxControl();
 
     virtual void        StateChanged( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState );
     virtual Window*     CreateItemWindow( Window *pParent );
diff --git a/svx/inc/svx/lboxctrl.hxx b/svx/inc/svx/lboxctrl.hxx
index 1e50588..ce6aa8c 100644
--- a/svx/inc/svx/lboxctrl.hxx
+++ b/svx/inc/svx/lboxctrl.hxx
@@ -51,7 +51,7 @@ protected:
     DECL_LINK( SelectHdl, void * );
 
 public:
-    SFX_DECL_TOOLBOX_CONTROL();
+    static SfxToolBoxControl* CreateImpl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox &rTbx );
 
     SvxListBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx );
     virtual ~SvxListBoxControl();
diff --git a/svx/inc/svx/tbcontrl.hxx b/svx/inc/svx/tbcontrl.hxx
index 32f218d..e0f0bdd 100644
--- a/svx/inc/svx/tbcontrl.hxx
+++ b/svx/inc/svx/tbcontrl.hxx
@@ -430,7 +430,8 @@ private:
     SvxReloadControllerItem_Impl* pImpl;
 
 public:
-    SFX_DECL_TOOLBOX_CONTROL();
+    static SfxToolBoxControl* CreateImpl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox &rTbx );
+
     SvxReloadControllerItem( sal_uInt16 nSlotId,
                              sal_uInt16 nId,
                              ToolBox& rTbx );
diff --git a/svx/source/tbxctrls/grafctrl.cxx b/svx/source/tbxctrls/grafctrl.cxx
index bcadbef..5e4d300 100644
--- a/svx/source/tbxctrls/grafctrl.cxx
+++ b/svx/source/tbxctrls/grafctrl.cxx
@@ -546,7 +546,10 @@ SfxPopupWindow* SvxGrafFilterToolBoxControl::CreatePopupWindow()
 // - SvxGrafToolBoxControl -
 // -------------------------
 
-SFX_IMPL_TOOLBOX_CONTROL( SvxGrafToolBoxControl, SfxVoidItem );
+SfxToolBoxControl* SvxGrafToolBoxControl::CreateImpl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox &rTbx )
+{
+    return new SvxGrafToolBoxControl( nSlotId, nId, rTbx );
+}
 
 // -----------------------------------------------------------------------------
 
diff --git a/svx/source/tbxctrls/lboxctrl.cxx b/svx/source/tbxctrls/lboxctrl.cxx
index b16be0c..2c3bfe4 100644
--- a/svx/source/tbxctrls/lboxctrl.cxx
+++ b/svx/source/tbxctrls/lboxctrl.cxx
@@ -164,8 +164,10 @@ Window* SvxPopupWindowListBox::GetPreferredKeyInputWindow()
 
 /////////////////////////////////////////////////////////////////
 
-SFX_IMPL_TOOLBOX_CONTROL( SvxListBoxControl, SfxStringItem );
-
+SfxToolBoxControl* SvxListBoxControl::CreateImpl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox &rTbx )
+{
+    return new SvxListBoxControl( nSlotId, nId, rTbx );
+}
 
 SvxListBoxControl::SvxListBoxControl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx )
     :SfxToolBoxControl( nSlotId, nId, rTbx ),
diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index 067a0ca..6e1421e 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -127,9 +127,13 @@ SFX_IMPL_TOOLBOX_CONTROL( SvxColorToolBoxControl, SvxColorItem );
 SFX_IMPL_TOOLBOX_CONTROL( SvxFrameToolBoxControl, SvxBoxItem );
 SFX_IMPL_TOOLBOX_CONTROL( SvxFrameLineStyleToolBoxControl, SvxLineItem );
 SFX_IMPL_TOOLBOX_CONTROL( SvxFrameLineColorToolBoxControl, SvxColorItem );
-SFX_IMPL_TOOLBOX_CONTROL( SvxReloadControllerItem,  SfxBoolItem );
 SFX_IMPL_TOOLBOX_CONTROL( SvxSimpleUndoRedoController, SfxStringItem );
 
+SfxToolBoxControl* SvxReloadControllerItem::CreateImpl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox &rTbx )
+{
+    return new SvxReloadControllerItem( nSlotId, nId, rTbx );
+}
+
 //========================================================================
 // class SvxStyleBox_Impl -----------------------------------------------------
 //========================================================================
diff --git a/unusedcode.easy b/unusedcode.easy
index 21f230a..4e27d2e 100755
--- a/unusedcode.easy
+++ b/unusedcode.easy
@@ -148,7 +148,6 @@ SfxOleStringPropertyBase::SfxOleStringPropertyBase(int, int, unsigned short, Str
 SfxPartChildWnd_Impl::GetChildWindowId()
 SfxPopupWindow::LinkStubDelete(void*, void*)
 SfxRecordingFloatWrapper_Impl::GetChildWindowId()
-SfxThesSubMenuControl::RegisterControl(unsigned short, SfxModule*)
 SfxUINT32s::Insert(SfxUINT32s const*, unsigned short, unsigned short, unsigned short)
 SfxUINT32s::Remove(unsigned short, unsigned short)
 SfxUINT32s::Replace(unsigned int const&, unsigned short)
@@ -262,12 +261,10 @@ SvxDrawOutlinerViewForwarder::SetShapePos(Point const&)
 SvxDrawPage::SvxDrawPage()
 SvxEditSourceHelper::UserSpaceToEE(Rectangle const&, Size const&, bool)
 SvxFrameDirectionItem::SvxFrameDirectionItem(unsigned short)
-SvxGrafToolBoxControl::RegisterControl(unsigned short, SfxModule*)
 SvxIMapDlg::GetTargetList() const
 SvxInsertStatusBarControl::GetDefItemWidth(StatusBar const&)
 SvxJustifyMethodItem::SvxJustifyMethodItem(unsigned short)
 SvxLanguageBox::SvxLanguageBox(Window*, long, unsigned char)
-SvxListBoxControl::RegisterControl(unsigned short, SfxModule*)
 SvxMSDffManager::GetAutoForm(MSO_SPT) const
 SvxMSDffManager::ImportFontWork(SvStream&, SfxItemSet&, Rectangle&) const
 SvxMSDffManager::Scale(PolyPolygon&) const
@@ -287,7 +284,6 @@ SvxPluginFileDlg::IsAvailable(unsigned short)
 SvxPopupWindowListBox::StartSelection()
 SvxRectCtlAccessibleContext::CommitChange(com::sun::star::accessibility::AccessibleEventObject const&)
 SvxRelativeField::SvxRelativeField(Window*, long)
-SvxReloadControllerItem::RegisterControl(unsigned short, SfxModule*)
 SvxRubyChildWindow::GetChildWindowId()
 SvxRuler::GetDefTabDist() const
 SvxSelectionModeControl::GetDefItemWidth(StatusBar const&)
diff --git a/vcl/inc/vcl/menu.hxx b/vcl/inc/vcl/menu.hxx
index dd7f5c1..c2d1047 100644
--- a/vcl/inc/vcl/menu.hxx
+++ b/vcl/inc/vcl/menu.hxx
@@ -207,7 +207,7 @@ protected:
     SAL_DLLPRIVATE void                ImplRemoveDel( ImplMenuDelData &rDel );
 public:
     SAL_DLLPRIVATE void             ImplKillLayoutData() const;
-    SAL_DLLPRIVATE Menu*            ImplGetStartedFrom() const;
+    SAL_DLLPRIVATE Menu*            ImplGetStartedFrom() const { return pStartedFrom; }
 
                             Menu();
                             Menu( sal_Bool bMenuBar );
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index fb8557d..1f104f4 100644
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -977,11 +977,6 @@ void Menu::ImplInit()
     mpSalMenu = ImplGetSVData()->mpDefInst->CreateMenu( bIsMenuBar, this );
 }
 
-Menu* Menu::ImplGetStartedFrom() const
-{
-    return pStartedFrom;
-}
-
 void Menu::ImplLoadRes( const ResId& rResId )
 {
     ResMgr* pMgr = rResId.GetResMgr();
commit 4bb264574a9136ae39e5557b080d3f49a853ce6e
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Feb 21 08:36:13 2012 +0000

    ByteString->rtl::OString

diff --git a/vcl/unx/generic/printer/ppdparser.cxx b/vcl/unx/generic/printer/ppdparser.cxx
index ab428d3..0c62235 100644
--- a/vcl/unx/generic/printer/ppdparser.cxx
+++ b/vcl/unx/generic/printer/ppdparser.cxx
@@ -567,15 +567,15 @@ String PPDParser::getPPDFile( const String& rFile )
     String aRet;
     if( aStream.IsOpen() )
     {
-        ByteString aLine = aStream.ReadLine();
-        if( aLine.Search( "*PPD-Adobe" ) == 0 )
+        rtl::OString aLine = aStream.ReadLine();
+        if (aLine.indexOfL(RTL_CONSTASCII_STRINGPARAM("*PPD-Adobe")) == 0)
             aRet = aStream.GetFileName();
         else
         {
             // our *Include hack does usually not begin
             // with *PPD-Adobe, so try some lines for *Include
             int nLines = 10;
-            while( aLine.Search( "*Include" ) != 0 && --nLines )
+            while (aLine.indexOfL(RTL_CONSTASCII_STRINGPARAM("*Include")) != 0 && --nLines)
                 aLine = aStream.ReadLine();
             if( nLines )
                 aRet = aStream.GetFileName();
commit b4d3e2f99cf8208dcda279ee8d9a45557b806ff9
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Feb 20 12:39:56 2012 +0000

    WaE: pFmt may be uninitialized

diff --git a/sd/qa/unit/filters-test.cxx b/sd/qa/unit/filters-test.cxx
index 441be8e..1936280 100644
--- a/sd/qa/unit/filters-test.cxx
+++ b/sd/qa/unit/filters-test.cxx
@@ -95,15 +95,15 @@ FileFormat aFileFormats[] = {
 
 ::sd::DrawDocShellRef SdFiltersTest::loadURL( const rtl::OUString &rURL )
 {
-    FileFormat *pFmt;
+    FileFormat *pFmt = NULL;
 
     for (size_t i = 0; i < SAL_N_ELEMENTS (aFileFormats); i++)
     {
         pFmt = aFileFormats + i;
-        if (pFmt->pName &&  rURL.endsWithIgnoreAsciiCaseAsciiL (pFmt->pName, strlen (pFmt->pName)))
+        if (pFmt->pName && rURL.endsWithIgnoreAsciiCaseAsciiL (pFmt->pName, strlen (pFmt->pName)))
             break;
     }
-    CPPUNIT_ASSERT_MESSAGE( "missing filter info", pFmt->pName != NULL );
+    CPPUNIT_ASSERT_MESSAGE( "missing filter info", pFmt && pFmt->pName != NULL );
 
     sal_uInt32 nFormat = 0;
     if (pFmt->nFormatType)


More information about the Libreoffice-commits mailing list