[Libreoffice-commits] core.git: include/sfx2 sfx2/source

Noel Grandin noel.grandin at collabora.co.uk
Thu Oct 27 12:44:11 UTC 2016


 include/sfx2/dinfdlg.hxx              |    9 ------
 include/sfx2/docfile.hxx              |    1 
 include/sfx2/frmdescr.hxx             |    1 
 include/sfx2/objsh.hxx                |    5 ---
 include/sfx2/opengrf.hxx              |    1 
 include/sfx2/passwd.hxx               |    4 --
 include/sfx2/tbxctrl.hxx              |    3 --
 include/sfx2/thumbnailview.hxx        |    1 
 include/sfx2/titledockwin.hxx         |    6 ----
 include/sfx2/viewfrm.hxx              |    1 
 sfx2/source/appl/opengrf.cxx          |    7 ----
 sfx2/source/control/thumbnailview.cxx |   32 ++++++++-------------
 sfx2/source/dialog/dinfdlg.cxx        |    6 ++--
 sfx2/source/dialog/filedlghelper.cxx  |    9 +-----
 sfx2/source/dialog/filedlgimpl.hxx    |    5 +--
 sfx2/source/dialog/passwd.cxx         |    2 -
 sfx2/source/dialog/templdlg.cxx       |   23 ++++++---------
 sfx2/source/dialog/titledockwin.cxx   |   11 ++-----
 sfx2/source/doc/Metadatable.cxx       |   10 ------
 sfx2/source/doc/docfile.cxx           |   20 +++++--------
 sfx2/source/doc/docundomanager.cxx    |    4 --
 sfx2/source/doc/frmdescr.cxx          |    7 ----
 sfx2/source/doc/objmisc.cxx           |    7 ----
 sfx2/source/doc/objxtor.cxx           |   11 ++-----
 sfx2/source/doc/sfxbasemodel.cxx      |   51 ++++++++++++----------------------
 sfx2/source/doc/sfxmodelfactory.cxx   |   11 -------
 sfx2/source/inc/templdgi.hxx          |    1 
 sfx2/source/toolbox/tbxitem.cxx       |   24 ++++------------
 sfx2/source/view/viewfrm.cxx          |    7 ----
 29 files changed, 75 insertions(+), 205 deletions(-)

New commits:
commit 337e19bf469c0a7a10fabd07fa6ae13f77075e36
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Thu Oct 27 12:07:39 2016 +0200

    loplugin:expandablemethods in sfx2
    
    Change-Id: I5dcc9e6e7fef210f85a01057ddf59f8de14b847d
    Reviewed-on: https://gerrit.libreoffice.org/30320
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
    Tested-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/include/sfx2/dinfdlg.hxx b/include/sfx2/dinfdlg.hxx
index 1972b91..9ffbb33 100644
--- a/include/sfx2/dinfdlg.hxx
+++ b/include/sfx2/dinfdlg.hxx
@@ -115,24 +115,15 @@ public:
 
     const css::util::DateTime&
                 getCreationDate() const { return m_CreationDate; }
-    void        setCreationDate(const css::util::DateTime& i_val) {
-                    m_CreationDate = i_val;
-                }
     const OUString& getModifiedBy() const { return m_ModifiedBy; }
     void        setModifiedBy(const OUString& i_val) { m_ModifiedBy = i_val; }
 
     const css::util::DateTime&
                 getModificationDate() const { return m_ModificationDate; }
-    void        setModificationDate(const css::util::DateTime& i_val) {
-                    m_ModificationDate = i_val;
-                }
     const OUString& getPrintedBy() const { return m_PrintedBy; }
     void        setPrintedBy(const OUString& i_val) { m_PrintedBy = i_val; }
     const css::util::DateTime&
                 getPrintDate() const { return m_PrintDate; }
-    void        setPrintDate(const css::util::DateTime& i_val) {
-                    m_PrintDate = i_val;
-                }
     sal_Int16   getEditingCycles() const { return m_EditingCycles; }
     void        setEditingCycles(sal_Int16 i_val) { m_EditingCycles = i_val; }
     sal_Int32   getEditingDuration() const { return m_EditingDuration; }
diff --git a/include/sfx2/docfile.hxx b/include/sfx2/docfile.hxx
index 6738786..07cfbe1 100644
--- a/include/sfx2/docfile.hxx
+++ b/include/sfx2/docfile.hxx
@@ -223,7 +223,6 @@ public:
     SAL_DLLPRIVATE SvKeyValueIterator* GetHeaderAttributes_Impl();
 
     SAL_DLLPRIVATE void Init_Impl();
-    SAL_DLLPRIVATE void ForceSynchronStream_Impl();
 
     SAL_DLLPRIVATE void GetLockingStream_Impl();
     SAL_DLLPRIVATE void GetMedium_Impl();
diff --git a/include/sfx2/frmdescr.hxx b/include/sfx2/frmdescr.hxx
index 1a792bf..4f09680 100644
--- a/include/sfx2/frmdescr.hxx
+++ b/include/sfx2/frmdescr.hxx
@@ -79,7 +79,6 @@ public:
     const INetURLObject&    GetURL() const
                             { return aURL; }
     void                    SetURL( const OUString& rURL );
-    void                    SetActualURL( const INetURLObject& rURL );
     void                    SetActualURL( const OUString& rURL );
     void                    SetReadOnly( bool bSet ) { bReadOnly = bSet;}
     void                    SetEditable( bool bSet );
diff --git a/include/sfx2/objsh.hxx b/include/sfx2/objsh.hxx
index 0c4d5b3..20ec6e3 100644
--- a/include/sfx2/objsh.hxx
+++ b/include/sfx2/objsh.hxx
@@ -227,10 +227,6 @@ protected:
     void                        ModifyChanged();
     virtual bool                Close() override;
 
-    /** declares the document to have capabilities to contain basic/dialog libraries
-    */
-    void                        SetHasNoBasic();
-
     /// template method, called by FlushDocInfo; this implementation is empty
     virtual void                DoFlushDocInfo();
 
@@ -294,7 +290,6 @@ public:
     bool                        IsDocShared() const;
     OUString                    GetSharedFileURL() const;
     bool                        SwitchToShared( bool bShared, bool bSave );
-    SAL_DLLPRIVATE void         FreeSharedFile();
     SAL_DLLPRIVATE void         FreeSharedFile( const OUString& aTempFileURL );
     SAL_DLLPRIVATE void         DoNotCleanShareControlFile();
     void                        SetSharedXMLFlag( bool bFlag ) const;
diff --git a/include/sfx2/opengrf.hxx b/include/sfx2/opengrf.hxx
index bde7adb..9533a86 100644
--- a/include/sfx2/opengrf.hxx
+++ b/include/sfx2/opengrf.hxx
@@ -33,7 +33,6 @@ public:
 
     short                   Execute();
 
-    void                    SetPath( const OUString& rPath );
     void                    SetPath( const OUString& rPath, bool bLinkState );
     OUString                GetPath() const;
 
diff --git a/include/sfx2/passwd.hxx b/include/sfx2/passwd.hxx
index 0a256e7..1c8984f 100644
--- a/include/sfx2/passwd.hxx
+++ b/include/sfx2/passwd.hxx
@@ -103,10 +103,6 @@ public:
     {
         return mpPassword2ED->GetText();
     }
-    OUString GetConfirm2() const
-    {
-        return mpConfirm2ED->GetText();
-    }
     void SetGroup2Text(const OUString& i_rText)
     {
         mpPassword2Box->set_label(i_rText);
diff --git a/include/sfx2/tbxctrl.hxx b/include/sfx2/tbxctrl.hxx
index 151b4a2..dfb4021 100644
--- a/include/sfx2/tbxctrl.hxx
+++ b/include/sfx2/tbxctrl.hxx
@@ -77,8 +77,6 @@ friend class SfxFrameStatusListener;
     css::uno::Reference< css::lang::XComponent >           m_xStatusListener;
 
 private:
-    void                    GetOrCreateStatusListener();
-
     SfxPopupWindow(SfxPopupWindow &) = delete;
     void operator =(SfxPopupWindow &) = delete;
     void Delete();
@@ -86,7 +84,6 @@ private:
 protected:
     virtual void            PopupModeEnd() override;
     virtual bool            Close() override;
-    void                    DeleteFloatingWindow();
 
     sal_uInt16              GetId() const { return m_nId; }
     const css::uno::Reference< css::frame::XFrame >& GetFrame() const { return m_xFrame; }
diff --git a/include/sfx2/thumbnailview.hxx b/include/sfx2/thumbnailview.hxx
index d118782..17bab08 100644
--- a/include/sfx2/thumbnailview.hxx
+++ b/include/sfx2/thumbnailview.hxx
@@ -279,7 +279,6 @@ protected:
 
     virtual void ApplySettings(vcl::RenderContext& rRenderContext) override;
 
-    SFX2_DLLPRIVATE void         ImplInitScrollBar();
     SFX2_DLLPRIVATE void         ImplDeleteItems();
     SFX2_DLLPRIVATE size_t       ImplGetItem( const Point& rPoint ) const;
     SFX2_DLLPRIVATE ThumbnailViewItem*    ImplGetItem( size_t nPos );
diff --git a/include/sfx2/titledockwin.hxx b/include/sfx2/titledockwin.hxx
index 1ecf42f..a83de30 100644
--- a/include/sfx2/titledockwin.hxx
+++ b/include/sfx2/titledockwin.hxx
@@ -72,12 +72,6 @@ namespace sfx2
         */
         void    impl_resetToolBox();
 
-        /** returns the current title.
-
-            If no title has been set via SetTitle, then the window text (Window::GetText) is returned.
-        */
-        OUString  impl_getTitle() const;
-
     private:
         DECL_LINK( OnToolboxItemSelected, ToolBox*, void );
 
diff --git a/include/sfx2/viewfrm.hxx b/include/sfx2/viewfrm.hxx
index 67fdadf..99f5fbc 100644
--- a/include/sfx2/viewfrm.hxx
+++ b/include/sfx2/viewfrm.hxx
@@ -197,7 +197,6 @@ public:
     SAL_DLLPRIVATE void LockObjectShell_Impl();
 
     SAL_DLLPRIVATE void MakeActive_Impl( bool bActivate );
-    SAL_DLLPRIVATE void SetQuietMode_Impl( bool );
     SAL_DLLPRIVATE const Size& GetMargin_Impl() const;
     SAL_DLLPRIVATE void SetActiveChildFrame_Impl( SfxViewFrame* );
     SAL_DLLPRIVATE SfxViewFrame* GetActiveChildFrame_Impl() const;
diff --git a/sfx2/source/appl/opengrf.cxx b/sfx2/source/appl/opengrf.cxx
index 2bbe180..70670fe 100644
--- a/sfx2/source/appl/opengrf.cxx
+++ b/sfx2/source/appl/opengrf.cxx
@@ -177,14 +177,9 @@ short SvxOpenGraphicDialog::Execute()
 }
 
 
-void SvxOpenGraphicDialog::SetPath( const OUString& rPath )
-{
-    mpImpl->aFileDlg.SetDisplayDirectory(rPath);
-}
-
 void SvxOpenGraphicDialog::SetPath( const OUString& rPath, bool bLinkState )
 {
-    SetPath(rPath);
+    mpImpl->aFileDlg.SetDisplayDirectory(rPath);
     AsLink(bLinkState);
 }
 
diff --git a/sfx2/source/control/thumbnailview.cxx b/sfx2/source/control/thumbnailview.cxx
index 6bcb281..9397c2a 100644
--- a/sfx2/source/control/thumbnailview.cxx
+++ b/sfx2/source/control/thumbnailview.cxx
@@ -215,24 +215,6 @@ void ThumbnailView::ApplySettings(vcl::RenderContext& rRenderContext)
     mpItemAttrs->nMaxTextLength = 0;
 }
 
-void ThumbnailView::ImplInitScrollBar()
-{
-    if ( GetStyle() & WB_VSCROLL )
-    {
-        if ( !mpScrBar )
-        {
-            mpScrBar = VclPtr<ScrollBar>::Create( this, WB_VSCROLL | WB_DRAG );
-            mpScrBar->SetScrollHdl( LINK( this, ThumbnailView, ImplScrollHdl ) );
-        }
-        else
-        {
-            // adapt the width because of the changed settings
-            long nScrBarWidth = GetSettings().GetStyleSettings().GetScrollBarSize();
-            mpScrBar->setPosSizePixel( 0, 0, nScrBarWidth, 0, PosSizeFlags::Width );
-        }
-    }
-}
-
 void ThumbnailView::DrawItem(ThumbnailViewItem *pItem)
 {
     if (pItem->isVisible())
@@ -265,7 +247,19 @@ void ThumbnailView::CalculateItemPositions (bool bScrollBarUsed)
 
     // consider the scrolling
     if ( nStyle & WB_VSCROLL )
-        ImplInitScrollBar();
+    {
+        if ( !mpScrBar )
+        {
+            mpScrBar = VclPtr<ScrollBar>::Create( this, WB_VSCROLL | WB_DRAG );
+            mpScrBar->SetScrollHdl( LINK( this, ThumbnailView, ImplScrollHdl ) );
+        }
+        else
+        {
+            // adapt the width because of the changed settings
+            long nScrBarWidth = GetSettings().GetStyleSettings().GetScrollBarSize();
+            mpScrBar->setPosSizePixel( 0, 0, nScrBarWidth, 0, PosSizeFlags::Width );
+        }
+    }
     else
     {
         if ( mpScrBar )
diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx
index 3242135..446e94d 100644
--- a/sfx2/source/dialog/dinfdlg.cxx
+++ b/sfx2/source/dialog/dinfdlg.cxx
@@ -345,11 +345,11 @@ void SfxDocumentInfoItem::resetUserData(const OUString & i_rAuthor)
 {
     setAuthor(i_rAuthor);
     DateTime now( DateTime::SYSTEM );
-    setCreationDate( now.GetUNODateTime() );
+    m_CreationDate = now.GetUNODateTime();
     setModifiedBy(OUString());
     setPrintedBy(OUString());
-    setModificationDate(util::DateTime());
-    setPrintDate(util::DateTime());
+    m_ModificationDate = util::DateTime();
+    m_PrintDate = util::DateTime();
     setEditingDuration(0);
     setEditingCycles(1);
 }
diff --git a/sfx2/source/dialog/filedlghelper.cxx b/sfx2/source/dialog/filedlghelper.cxx
index c976b8d..7771124 100644
--- a/sfx2/source/dialog/filedlghelper.cxx
+++ b/sfx2/source/dialog/filedlghelper.cxx
@@ -348,17 +348,12 @@ void FileDialogHelper_Impl::LoadLastUsedFilter( const OUString& _rContextIdentif
     }
 }
 
-void FileDialogHelper_Impl::SaveLastUsedFilter( const OUString& _rContextIdentifier )
-{
-    SvtViewOptions( E_DIALOG, IODLG_CONFIGNAME ).SetUserItem( _rContextIdentifier,
-                        makeAny( getFilterWithExtension( getFilter() ) ) );
-}
-
 void FileDialogHelper_Impl::SaveLastUsedFilter()
 {
     const OUString* pConfigId = GetLastFilterConfigId( meContext );
     if( pConfigId )
-        SaveLastUsedFilter( *pConfigId );
+        SvtViewOptions( E_DIALOG, IODLG_CONFIGNAME ).SetUserItem( *pConfigId,
+                            makeAny( getFilterWithExtension( getFilter() ) ) );
 }
 
 std::shared_ptr<const SfxFilter> FileDialogHelper_Impl::getCurentSfxFilter()
diff --git a/sfx2/source/dialog/filedlgimpl.hxx b/sfx2/source/dialog/filedlgimpl.hxx
index 3ddfe25..2f500c0 100644
--- a/sfx2/source/dialog/filedlgimpl.hxx
+++ b/sfx2/source/dialog/filedlgimpl.hxx
@@ -128,13 +128,12 @@ namespace sfx2
 
         void                    setControlHelpIds( const sal_Int16* _pControlId, const char** _pHelpId );
 
-        bool                CheckFilterOptionsCapability( const std::shared_ptr<const SfxFilter>& _pFilter );
+        bool                    CheckFilterOptionsCapability( const std::shared_ptr<const SfxFilter>& _pFilter );
 
-        bool                isInOpenMode() const;
+        bool                    isInOpenMode() const;
         OUString                getCurrentFilterUIName() const;
 
         void                    LoadLastUsedFilter( const OUString& _rContextIdentifier );
-        void                    SaveLastUsedFilter( const OUString& _rContextIdentifier );
         void                    SaveLastUsedFilter();
 
         void                    implInitializeFileName( );
diff --git a/sfx2/source/dialog/passwd.cxx b/sfx2/source/dialog/passwd.cxx
index 5bf8fc4..5b3b7bd 100644
--- a/sfx2/source/dialog/passwd.cxx
+++ b/sfx2/source/dialog/passwd.cxx
@@ -67,7 +67,7 @@ IMPL_LINK_NOARG(SfxPasswordDialog, OKHdl, Button*, void)
 {
     bool bConfirmFailed = bool( mnExtras & SfxShowExtras::CONFIRM ) &&
                           ( GetConfirm() != GetPassword() );
-    if( ( mnExtras & SfxShowExtras::CONFIRM2 ) && ( GetConfirm2() != GetPassword2() ) )
+    if( ( mnExtras & SfxShowExtras::CONFIRM2 ) && ( mpConfirm2ED->GetText() != GetPassword2() ) )
         bConfirmFailed = true;
     if ( bConfirmFailed )
     {
diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx
index 025e5e0..99fadc1 100644
--- a/sfx2/source/dialog/templdlg.cxx
+++ b/sfx2/source/dialog/templdlg.cxx
@@ -2018,19 +2018,6 @@ void SfxCommonTemplateDialog_Impl::EnableDelete()
     }
 }
 
-// After selecting a focused item if possible again on the app window
-void SfxCommonTemplateDialog_Impl::ResetFocus()
-{
-    if ( dynamic_cast< const SfxTemplateDialog_Impl* >(this) !=  nullptr )
-    {
-        SfxViewFrame *pViewFrame = pBindings->GetDispatcher_Impl()->GetFrame();
-        SfxViewShell *pVu = pViewFrame->GetViewShell();
-        vcl::Window *pAppWin = pVu ? pVu->GetWindow(): nullptr;
-        if(pAppWin)
-            pAppWin->GrabFocus();
-    }
-}
-
 IMPL_LINK_NOARG( SfxCommonTemplateDialog_Impl, TreeListApplyHdl, SvTreeListBox *, bool )
 {
     ApplyHdl(nullptr);
@@ -2050,7 +2037,15 @@ IMPL_LINK_NOARG( SfxCommonTemplateDialog_Impl, ApplyHdl, LinkParamNone*, void )
                      ( sal_uInt16 )GetFamilyItem_Impl()->GetFamily(),
                      0, nullptr, &nModifier );
     }
-    ResetFocus();
+    // After selecting a focused item if possible again on the app window
+    if ( dynamic_cast< const SfxTemplateDialog_Impl* >(this) !=  nullptr )
+    {
+        SfxViewFrame *pViewFrame = pBindings->GetDispatcher_Impl()->GetFrame();
+        SfxViewShell *pVu = pViewFrame->GetViewShell();
+        vcl::Window *pAppWin = pVu ? pVu->GetWindow(): nullptr;
+        if(pAppWin)
+            pAppWin->GrabFocus();
+    }
 }
 
 IMPL_LINK_NOARG( SfxCommonTemplateDialog_Impl, PreviewHdl, Button*, void)
diff --git a/sfx2/source/dialog/titledockwin.cxx b/sfx2/source/dialog/titledockwin.cxx
index 58057ac..c084cbc 100644
--- a/sfx2/source/dialog/titledockwin.cxx
+++ b/sfx2/source/dialog/titledockwin.cxx
@@ -200,20 +200,15 @@ namespace sfx2
         // Paint title bar text.
         rRenderContext.SetLineColor(rStyleSettings.GetActiveTextColor());
         aTitleBarBox.Left() += 3;
-        rRenderContext.DrawText(aTitleBarBox, impl_getTitle(),
-                               DrawTextFlags::Left | DrawTextFlags::VCenter | DrawTextFlags::MultiLine | DrawTextFlags::WordBreak);
+        rRenderContext.DrawText(aTitleBarBox,
+                                !m_sTitle.isEmpty() ? m_sTitle : GetText(),
+                                DrawTextFlags::Left | DrawTextFlags::VCenter | DrawTextFlags::MultiLine | DrawTextFlags::WordBreak);
 
         // Restore original values of the output device.
         rRenderContext.Pop();
     }
 
 
-    OUString TitledDockingWindow::impl_getTitle() const
-    {
-        return !m_sTitle.isEmpty() ? m_sTitle : GetText();
-    }
-
-
     void TitledDockingWindow::impl_resetToolBox()
     {
         m_aToolbox->Clear();
diff --git a/sfx2/source/doc/Metadatable.cxx b/sfx2/source/doc/Metadatable.cxx
index 52d7eac..45775b4 100644
--- a/sfx2/source/doc/Metadatable.cxx
+++ b/sfx2/source/doc/Metadatable.cxx
@@ -933,14 +933,6 @@ struct XmlIdRegistryClipboard::XmlIdRegistry_Impl
     Metadatable* const* LookupEntry(const OUString & i_rStreamName,
         const OUString & i_rIdref) const;
 
-    Metadatable*      * LookupEntry(const OUString & i_rStreamName,
-        const OUString & i_rIdref)
-    {
-        return const_cast<Metadatable**>(
-            const_cast<const XmlIdRegistry_Impl*>(this)
-                ->LookupEntry(i_rStreamName, i_rIdref));
-    }
-
     ClipboardXmlIdMap_t m_XmlIdMap;
     ClipboardXmlIdReverseMap_t m_XmlIdReverseMap;
 };
@@ -1036,7 +1028,7 @@ XmlIdRegistryClipboard::XmlIdRegistry_Impl::TryInsertMetadatable(
     OSL_ENSURE(isContentFile(i_rStreamName) || isStylesFile(i_rStreamName),
         "invalid stream");
 
-    Metadatable ** ppEntry = LookupEntry(i_rStreamName, i_rIdref);
+    Metadatable ** ppEntry = const_cast<Metadatable**>(LookupEntry(i_rStreamName, i_rIdref));
     if (ppEntry)
     {
         if (*ppEntry)
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index 2f0455c..a948316 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -649,7 +649,14 @@ const OUString& SfxMedium::GetPhysicalName() const
 
 void SfxMedium::CreateFileStream()
 {
-    ForceSynchronStream_Impl();
+    // force synchron
+    if( pImpl->m_pInStream )
+    {
+        SvLockBytes* pBytes = pImpl->m_pInStream->GetLockBytes();
+        if( pBytes )
+            pBytes->SetSynchronMode();
+    }
+
     GetInStream();
     if( pImpl->m_pInStream )
     {
@@ -3117,17 +3124,6 @@ bool SfxMedium::IsExpired() const
 }
 
 
-void SfxMedium::ForceSynchronStream_Impl()
-{
-    if( pImpl->m_pInStream )
-    {
-        SvLockBytes* pBytes = pImpl->m_pInStream->GetLockBytes();
-        if( pBytes )
-            pBytes->SetSynchronMode();
-    }
-}
-
-
 SfxFrame* SfxMedium::GetLoadTargetFrame() const
 {
     return pImpl->wLoadTargetFrame;
diff --git a/sfx2/source/doc/docundomanager.cxx b/sfx2/source/doc/docundomanager.cxx
index f37a120..290b861 100644
--- a/sfx2/source/doc/docundomanager.cxx
+++ b/sfx2/source/doc/docundomanager.cxx
@@ -79,8 +79,6 @@ namespace sfx2
         {
         };
 
-              SfxObjectShell* getObjectShell()       { return rAntiImpl.getBaseModel().GetObjectShell(); }
-
         // IUndoManagerImplementation
         virtual ::svl::IUndoManager&        getImplUndoManager() override;
         virtual Reference< XUndoManager >   getThis() override;
@@ -134,7 +132,7 @@ namespace sfx2
     {
         SfxModelGuard aGuard( rAntiImpl );
 
-        const SfxObjectShell* pDocShell = getObjectShell();
+        const SfxObjectShell* pDocShell = rAntiImpl.getBaseModel().GetObjectShell();
         ENSURE_OR_THROW( pDocShell != nullptr, "lcl_invalidateUndo: no access to the doc shell!" );
         SfxViewFrame* pViewFrame = SfxViewFrame::GetFirst( pDocShell );
         while ( pViewFrame )
diff --git a/sfx2/source/doc/frmdescr.cxx b/sfx2/source/doc/frmdescr.cxx
index 50e851c..c2f217b 100644
--- a/sfx2/source/doc/frmdescr.cxx
+++ b/sfx2/source/doc/frmdescr.cxx
@@ -64,7 +64,7 @@ SfxItemSet* SfxFrameDescriptor::GetArgs()
 void SfxFrameDescriptor::SetURL( const OUString& rURL )
 {
     aURL = INetURLObject(rURL);
-    SetActualURL( aURL );
+    SetActualURL(aURL.GetMainURL( INetURLObject::DECODE_TO_IURI ));
 }
 
 void SfxFrameDescriptor::SetActualURL( const OUString& rURL )
@@ -74,11 +74,6 @@ void SfxFrameDescriptor::SetActualURL( const OUString& rURL )
         pImpl->pArgs->ClearItem();
 }
 
-void SfxFrameDescriptor::SetActualURL( const INetURLObject& rURL )
-{
-    SetActualURL(rURL.GetMainURL( INetURLObject::DECODE_TO_IURI ));
-}
-
 void SfxFrameDescriptor::SetEditable( bool bSet )
 {
     pImpl->bEditable = bSet;
diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx
index 3e8ee22..473176c 100644
--- a/sfx2/source/doc/objmisc.cxx
+++ b/sfx2/source/doc/objmisc.cxx
@@ -587,13 +587,6 @@ bool SfxObjectShell::SwitchToShared( bool bShared, bool bSave )
 }
 
 
-void SfxObjectShell::FreeSharedFile()
-{
-    if ( pMedium )
-        FreeSharedFile( pMedium->GetURLObject().GetMainURL( INetURLObject::NO_DECODE ) );
-}
-
-
 void SfxObjectShell::FreeSharedFile( const OUString& aTempFileURL )
 {
     SetSharedXMLFlag( false );
diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx
index 9150ef6..d6a8a5a 100644
--- a/sfx2/source/doc/objxtor.cxx
+++ b/sfx2/source/doc/objxtor.cxx
@@ -289,7 +289,7 @@ SfxObjectShell::SfxObjectShell( const SfxModelFlags i_nCreationFlags )
 
     const bool bScriptSupport = ( i_nCreationFlags & SfxModelFlags::DISABLE_EMBEDDED_SCRIPTS ) == SfxModelFlags::NONE;
     if ( !bScriptSupport )
-        SetHasNoBasic();
+        pImpl->m_bNoBasicCapabilities = true;
 
     const bool bDocRecovery = ( i_nCreationFlags & SfxModelFlags::DISABLE_DOCUMENT_RECOVERY ) == SfxModelFlags::NONE;
     if ( !bDocRecovery )
@@ -357,8 +357,8 @@ SfxObjectShell::~SfxObjectShell()
         pMedium->CloseAndReleaseStreams_Impl();
 
 #if HAVE_FEATURE_MULTIUSER_ENVIRONMENT
-        if ( IsDocShared() )
-            FreeSharedFile();
+        if ( IsDocShared() && pMedium )
+            FreeSharedFile( pMedium->GetURLObject().GetMainURL( INetURLObject::NO_DECODE ) );
 #endif
         DELETEX( SfxMedium, pMedium );
     }
@@ -683,11 +683,6 @@ BasicManager* SfxObjectShell::GetBasicManager() const
     return pBasMgr;
 }
 
-void SfxObjectShell::SetHasNoBasic()
-{
-    pImpl->m_bNoBasicCapabilities = true;
-}
-
 bool SfxObjectShell::HasBasic() const
 {
 #if !HAVE_FEATURE_SCRIPTING
diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx
index 27e79f8..4dadf7f 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -347,7 +347,6 @@ class SfxOwnFramesLocker
 public:
     explicit SfxOwnFramesLocker( SfxObjectShell* ObjechShell );
     ~SfxOwnFramesLocker();
-    void UnlockFrames();
 };
 
 SfxOwnFramesLocker::SfxOwnFramesLocker( SfxObjectShell* pObjectShell )
@@ -395,25 +394,6 @@ SfxOwnFramesLocker::SfxOwnFramesLocker( SfxObjectShell* pObjectShell )
 
 SfxOwnFramesLocker::~SfxOwnFramesLocker()
 {
-    UnlockFrames();
-}
-
-vcl::Window* SfxOwnFramesLocker::GetVCLWindow( const Reference< frame::XFrame >& xFrame )
-{
-    vcl::Window* pWindow = nullptr;
-
-    if ( xFrame.is() )
-    {
-        Reference< awt::XWindow > xWindow = xFrame->getContainerWindow();
-        if ( xWindow.is() )
-               pWindow = VCLUnoHelper::GetWindow( xWindow );
-    }
-
-    return pWindow;
-}
-
-void SfxOwnFramesLocker::UnlockFrames()
-{
     for ( sal_Int32 nInd = 0; nInd < m_aLockedFrames.getLength(); nInd++ )
     {
         try
@@ -437,6 +417,20 @@ void SfxOwnFramesLocker::UnlockFrames()
     }
 }
 
+vcl::Window* SfxOwnFramesLocker::GetVCLWindow( const Reference< frame::XFrame >& xFrame )
+{
+    vcl::Window* pWindow = nullptr;
+
+    if ( xFrame.is() )
+    {
+        Reference< awt::XWindow > xWindow = xFrame->getContainerWindow();
+        if ( xWindow.is() )
+               pWindow = VCLUnoHelper::GetWindow( xWindow );
+    }
+
+    return pWindow;
+}
+
 // SfxSaveGuard ====================================================================================
 class SfxSaveGuard
 {
@@ -4124,8 +4118,11 @@ namespace sfx { namespace intern {
 
         ~ViewCreationGuard()
         {
-            if ( !m_bSuccess )
-                impl_closeAll();
+            if ( !m_bSuccess && m_aWeakFrame && !m_aWeakFrame->GetCurrentDocument() )
+            {
+                m_aWeakFrame->SetFrameInterface_Impl( nullptr );
+                m_aWeakFrame->DoClose();
+            }
         }
 
         void takeFrameOwnership( SfxFrame* i_pFrame )
@@ -4141,16 +4138,6 @@ namespace sfx { namespace intern {
         }
 
     private:
-        void impl_closeAll()
-        {
-            if ( m_aWeakFrame && !m_aWeakFrame->GetCurrentDocument() )
-            {
-                m_aWeakFrame->SetFrameInterface_Impl( nullptr );
-                m_aWeakFrame->DoClose();
-            }
-        }
-
-    private:
         bool             m_bSuccess;
         SfxFrameWeakRef  m_aWeakFrame;
     };
diff --git a/sfx2/source/doc/sfxmodelfactory.cxx b/sfx2/source/doc/sfxmodelfactory.cxx
index 60f7249..21a30bf 100644
--- a/sfx2/source/doc/sfxmodelfactory.cxx
+++ b/sfx2/source/doc/sfxmodelfactory.cxx
@@ -87,9 +87,6 @@ namespace sfx2
         virtual ~SfxModelFactory() override;
 
     private:
-        Reference< XInterface > impl_createInstance( const SfxModelFlags _nCreationFlags ) const;
-
-    private:
         const Reference< XMultiServiceFactory >     m_xServiceFactory;
         const OUString                       m_sImplementationName;
         const Sequence< OUString >           m_aServiceNames;
@@ -116,12 +113,6 @@ namespace sfx2
     }
 
 
-    Reference< XInterface > SfxModelFactory::impl_createInstance( const SfxModelFlags _nCreationFlags ) const
-    {
-        return (*m_pComponentFactoryFunc)( m_xServiceFactory, _nCreationFlags );
-    }
-
-
     Reference< XInterface > SAL_CALL SfxModelFactory::createInstance(  ) throw (Exception, RuntimeException, std::exception)
     {
         return createInstanceWithArguments( Sequence< Any >() );
@@ -163,7 +154,7 @@ namespace sfx2
             |   ( bScriptSupport ? SfxModelFlags::NONE : SfxModelFlags::DISABLE_EMBEDDED_SCRIPTS )
             |   ( bDocRecoverySupport ? SfxModelFlags::NONE : SfxModelFlags::DISABLE_DOCUMENT_RECOVERY );
 
-        Reference< XInterface > xInstance( impl_createInstance( nCreationFlags ) );
+        Reference< XInterface > xInstance( (*m_pComponentFactoryFunc)( m_xServiceFactory, nCreationFlags ) );
 
         // to mimic the bahaviour of the default factory's createInstanceWithArguments, we initialize
         // the object with the given arguments, stripped by the three special ones
diff --git a/sfx2/source/inc/templdgi.hxx b/sfx2/source/inc/templdgi.hxx
index d49cf8c..d24373c 100644
--- a/sfx2/source/inc/templdgi.hxx
+++ b/sfx2/source/inc/templdgi.hxx
@@ -249,7 +249,6 @@ protected:
     {
         return nActFamily != 0xffff;
     }
-    void ResetFocus();
     void EnableDelete();
     void Initialize();
     void EnableHierarchical(bool);
diff --git a/sfx2/source/toolbox/tbxitem.cxx b/sfx2/source/toolbox/tbxitem.cxx
index 7dc46f8..ff68c1f 100644
--- a/sfx2/source/toolbox/tbxitem.cxx
+++ b/sfx2/source/toolbox/tbxitem.cxx
@@ -842,7 +842,7 @@ void SfxPopupWindow::dispose()
 }
 
 
-void SfxPopupWindow::GetOrCreateStatusListener()
+void SfxPopupWindow::AddStatusListener( const OUString& rCommandURL )
 {
     if ( !m_xStatusListener.is() )
     {
@@ -852,12 +852,6 @@ void SfxPopupWindow::GetOrCreateStatusListener()
                                     this );
         m_xStatusListener.set( static_cast< cppu::OWeakObject* >( m_pStatusListener ), UNO_QUERY );
     }
-}
-
-
-void SfxPopupWindow::AddStatusListener( const OUString& rCommandURL )
-{
-    GetOrCreateStatusListener();
     if ( m_xStatusListener.is() )
         m_pStatusListener->addStatusListener( rCommandURL );
 }
@@ -881,7 +875,11 @@ void SfxPopupWindow::PopupModeEnd()
     if ( IsVisible() )
     {
         // was teared-off
-        DeleteFloatingWindow();
+        if ( m_bFloating )
+        {
+            Hide();
+            Delete();
+        }
         m_bFloating = true;
     }
     else
@@ -889,16 +887,6 @@ void SfxPopupWindow::PopupModeEnd()
 }
 
 
-void SfxPopupWindow::DeleteFloatingWindow()
-{
-    if ( m_bFloating )
-    {
-        Hide();
-        Delete();
-    }
-}
-
-
 void SfxPopupWindow::MouseMove( const ::MouseEvent& rMEvt )
 {
     if ( !m_bCascading )
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index da20f40..2d698db 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -1286,7 +1286,7 @@ void SfxViewFrame::Construct_Impl( SfxObjectShell *pObjSh )
 
     m_xObjSh = pObjSh;
     if ( m_xObjSh.Is() && m_xObjSh->IsPreview() )
-        SetQuietMode_Impl( true );
+        GetDispatcher()->SetQuietMode_Impl( true );
 
     if ( pObjSh )
     {
@@ -1631,11 +1631,6 @@ void SfxViewFrame::MakeActive_Impl( bool bGrabFocus )
     }
 }
 
-void SfxViewFrame::SetQuietMode_Impl( bool bOn )
-{
-    GetDispatcher()->SetQuietMode_Impl( bOn );
-}
-
 SfxObjectShell* SfxViewFrame::GetObjectShell()
 {
     return m_xObjSh.get();


More information about the Libreoffice-commits mailing list