[Libreoffice-commits] core.git: 3 commits - cui/source include/svx lotuswordpro/source svx/source vcl/inc

Caolán McNamara caolanm at redhat.com
Wed Dec 9 03:36:08 PST 2015


 cui/source/factory/dlgfact.cxx            |   19 ++++---------------
 cui/source/factory/dlgfact.hxx            |    4 +---
 include/svx/svxdlg.hxx                    |    4 +---
 lotuswordpro/source/filter/lwpidxmgr.cxx  |    5 ++++-
 lotuswordpro/source/filter/lwptabrack.cxx |    2 +-
 svx/source/dialog/hyperdlg.cxx            |    2 +-
 vcl/inc/salframe.hxx                      |   12 ++++++------
 7 files changed, 18 insertions(+), 30 deletions(-)

New commits:
commit fc943ea85a7924ce0552b08eef99ed8e02f0b965
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Dec 9 11:28:52 2015 +0000

    guard against corrupt RootData
    
    Change-Id: Iad2788a7e5e7ee3b3107eab37cde2d3d38eae005

diff --git a/lotuswordpro/source/filter/lwpidxmgr.cxx b/lotuswordpro/source/filter/lwpidxmgr.cxx
index e58d053..2e675f3 100644
--- a/lotuswordpro/source/filter/lwpidxmgr.cxx
+++ b/lotuswordpro/source/filter/lwpidxmgr.cxx
@@ -152,7 +152,10 @@ void LwpIndexManager::ReadRootData(LwpObjectStream* pObjStrm)
     sal_uInt16 KeyCount = pObjStrm->QuickReaduInt16();
     m_nLeafCount = KeyCount ? KeyCount + 1 : 0;
 
-    if(KeyCount)
+    if (m_nLeafCount > SAL_N_ELEMENTS(m_ChildIndex))
+        throw std::range_error("corrupt RootData");
+
+    if (KeyCount)
     {
         //read object keys
         LwpKey* akey = new LwpKey();
diff --git a/lotuswordpro/source/filter/lwptabrack.cxx b/lotuswordpro/source/filter/lwptabrack.cxx
index 9d284db..582b711 100644
--- a/lotuswordpro/source/filter/lwptabrack.cxx
+++ b/lotuswordpro/source/filter/lwptabrack.cxx
@@ -92,7 +92,7 @@ void LwpTabRack::Read()
 
     m_nNumTabs = m_pObjStrm->QuickReaduInt16();
     if (m_nNumTabs > MaxTabs)
-        throw std::out_of_range("corrupt LwpTabRack");
+        throw std::range_error("corrupt LwpTabRack");
     for (int i=0; i<m_nNumTabs; ++i)
     {
         m_aTabs[i].Read(m_pObjStrm);
commit ff39b78d74cfb30e2b485818b217915fd9a31b92
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Dec 9 10:48:59 2015 +0000

    unnecessary nResId argument
    
    Change-Id: Id7d3df1af42cbe7b4f951c335063d26b59e7bc10

diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx
index a27a8f1..3722d35 100644
--- a/cui/source/factory/dlgfact.cxx
+++ b/cui/source/factory/dlgfact.cxx
@@ -1231,22 +1231,11 @@ AbstractSvxMultiPathDialog * AbstractDialogFactory_Impl::CreateSvxPathSelectDial
 }
 
 AbstractSvxHpLinkDlg * AbstractDialogFactory_Impl::CreateSvxHpLinkDlg (vcl::Window* pParent,
-                                            SfxBindings* pBindings,
-                                            sal_uInt32 nResId)
+                                            SfxBindings* pBindings)
 {
-    SvxHpLinkDlg* pDlg=nullptr;
-    switch ( nResId )
-    {
-        case SID_HYPERLINK_DIALOG :
-            pDlg = VclPtr<SvxHpLinkDlg>::Create( pParent, pBindings );
-            break;
-        default:
-            break;
-    }
-
-    if ( pDlg )
-        return new AbstractSvxHpLinkDlg_Impl( pDlg );
-    return nullptr;
+    SvxHpLinkDlg* pDlg = VclPtr<SvxHpLinkDlg>::Create( pParent, pBindings );
+    fprintf(stderr, "CreateSvxHpLinkDlg\n");
+    return new AbstractSvxHpLinkDlg_Impl(pDlg);
 }
 
 AbstractFmSearchDialog*  AbstractDialogFactory_Impl::CreateFmSearchDialog(vcl::Window* pParent,
diff --git a/cui/source/factory/dlgfact.hxx b/cui/source/factory/dlgfact.hxx
index 21d8e29..482dfc8 100644
--- a/cui/source/factory/dlgfact.hxx
+++ b/cui/source/factory/dlgfact.hxx
@@ -600,9 +600,7 @@ public:
 
     virtual AbstractSvxMultiPathDialog *    CreateSvxMultiPathDialog(vcl::Window* pParent) override;
     virtual AbstractSvxMultiPathDialog *    CreateSvxPathSelectDialog(vcl::Window* pParent) override;
-    virtual AbstractSvxHpLinkDlg *          CreateSvxHpLinkDlg (vcl::Window* pParent,
-                                                SfxBindings* pBindings,
-                                                sal_uInt32 nResId) override;
+    virtual AbstractSvxHpLinkDlg *          CreateSvxHpLinkDlg(vcl::Window* pParent, SfxBindings* pBindings) override;
     virtual AbstractFmSearchDialog*         CreateFmSearchDialog(vcl::Window* pParent,
                                                         const OUString& strInitialText,
                                                         const ::std::vector< OUString >& _rContexts,
diff --git a/include/svx/svxdlg.hxx b/include/svx/svxdlg.hxx
index 79e174a..dc5240d 100644
--- a/include/svx/svxdlg.hxx
+++ b/include/svx/svxdlg.hxx
@@ -358,9 +358,7 @@ public:
 
     virtual AbstractSvxMultiPathDialog *    CreateSvxMultiPathDialog(vcl::Window* pParent) = 0 ;
     virtual AbstractSvxMultiPathDialog *    CreateSvxPathSelectDialog(vcl::Window* pParent) = 0 ;
-    virtual AbstractSvxHpLinkDlg *  CreateSvxHpLinkDlg (vcl::Window* pParent,
-                                            SfxBindings* pBindings,
-                                            sal_uInt32 nResId)=0;
+    virtual AbstractSvxHpLinkDlg *  CreateSvxHpLinkDlg(vcl::Window* pParent, SfxBindings* pBindings)=0;
     virtual AbstractFmSearchDialog* CreateFmSearchDialog(vcl::Window* pParent,
                                                         const OUString& strInitialText,
                                                         const ::std::vector< OUString >& _rContexts,
diff --git a/svx/source/dialog/hyperdlg.cxx b/svx/source/dialog/hyperdlg.cxx
index 96952c6..a276c38 100644
--- a/svx/source/dialog/hyperdlg.cxx
+++ b/svx/source/dialog/hyperdlg.cxx
@@ -42,7 +42,7 @@ SvxHlinkDlgWrapper::SvxHlinkDlgWrapper( vcl::Window* _pParent, sal_uInt16 nId,
 {
     SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
     DBG_ASSERT(pFact, "Dialog creation failed!");
-    mpDlg = pFact->CreateSvxHpLinkDlg( _pParent, pBindings, SID_HYPERLINK_DIALOG );
+    mpDlg = pFact->CreateSvxHpLinkDlg(_pParent, pBindings);
     DBG_ASSERT(mpDlg, "Dialog creation failed!");
     SetWindow( mpDlg->GetWindow() );
     SetVisible_Impl(false);
commit e21a2e7a01b7d6d63038a06b6e55d8bc5ec95aa8
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Dec 9 09:53:37 2015 +0000

    sort SalFrameStyleFlags
    
    Change-Id: I2caeda4e0a0b98ad09389d08fd6ccc6bb1e7aec2

diff --git a/vcl/inc/salframe.hxx b/vcl/inc/salframe.hxx
index 14fb2fa..8cb731c 100644
--- a/vcl/inc/salframe.hxx
+++ b/vcl/inc/salframe.hxx
@@ -70,20 +70,20 @@ enum class SalFrameStyleFlags
     OWNERDRAWDECORATION = 0x00000040,
     // dialogs
     DIALOG              = 0x00000080,
+    // the window containing the intro bitmap, aka splashscreen
+    INTRO               = 0x00000100,
     // partial fullscreen: fullscreen on one monitor of a multimonitor display
     PARTIAL_FULLSCREEN  = 0x00800000,
-    // plugged system child window
-    PLUG                = 0x10000000,
+    // floating window that needs to be focusable
+    FLOAT_FOCUSABLE     = 0x04000000,
     // system child window inside another SalFrame
     SYSTEMCHILD         = 0x08000000,
+    // plugged system child window
+    PLUG                = 0x10000000,
     // floating window
     FLOAT               = 0x20000000,
-    // floating window that needs to be focusable
-    FLOAT_FOCUSABLE     = 0x04000000,
     // toolwindows should be painted with a smaller decoration
     TOOLWINDOW          = 0x40000000,
-    // the window containing the intro bitmap, aka splashscreen
-    INTRO               = 0x00000100,
 };
 namespace o3tl {
     template<> struct typed_flags<SalFrameStyleFlags> : is_typed_flags<SalFrameStyleFlags, 0x7c8001ff> {};


More information about the Libreoffice-commits mailing list