[Libreoffice-commits] core.git: 2 commits - cui/source dbaccess/source include/sfx2 reportdesign/source sc/source sfx2/source sw/inc sw/source

Noel Grandin noel at peralex.com
Tue Oct 27 06:57:13 UTC 2015


 cui/source/dialogs/linkdlg.cxx                            |   12 ++++++------
 dbaccess/source/filter/xml/xmlfilter.cxx                  |    2 +-
 include/sfx2/docfile.hxx                                  |    2 --
 include/sfx2/linkmgr.hxx                                  |    2 +-
 include/sfx2/lnkbase.hxx                                  |    2 --
 reportdesign/source/filter/xml/xmlfilter.cxx              |    2 +-
 sc/source/ui/docshell/arealink.cxx                        |    2 +-
 sfx2/source/appl/fileobj.cxx                              |    8 ++++----
 sfx2/source/appl/fileobj.hxx                              |   14 +++++++-------
 sfx2/source/appl/linkmgr2.cxx                             |   10 +++++-----
 sfx2/source/appl/linksrc.cxx                              |    8 ++++----
 sfx2/source/appl/lnkbase2.cxx                             |    4 ++--
 sw/inc/ddefld.hxx                                         |    2 +-
 sw/inc/ndgrf.hxx                                          |    4 ++--
 sw/inc/section.hxx                                        |    2 +-
 sw/source/core/doc/DocumentLinksAdministrationManager.cxx |    4 ++--
 sw/source/core/inc/SwXMLTextBlocks.hxx                    |   12 ++++++------
 sw/source/uibase/inc/swdtflvr.hxx                         |    4 ++--
 18 files changed, 46 insertions(+), 50 deletions(-)

New commits:
commit 271c6b360511760336c78e6fbbacb520bb9be911
Author: Noel Grandin <noel at peralex.com>
Date:   Tue Oct 27 08:55:31 2015 +0200

    inline SvBaseLinkRef typedef
    
    Change-Id: I0684db21c260e38d1d2e32eb5924cf7e25212b4d

diff --git a/cui/source/dialogs/linkdlg.cxx b/cui/source/dialogs/linkdlg.cxx
index 0f25cc3..ee7fb1f 100644
--- a/cui/source/dialogs/linkdlg.cxx
+++ b/cui/source/dialogs/linkdlg.cxx
@@ -297,7 +297,7 @@ IMPL_LINK_NOARG_TYPED(SvBaseLinksDlg, UpdateNowClickHdl, Button*, void)
     {
         for( size_t n = 0; n < aLnkArr.size(); ++n )
         {
-            SvBaseLinkRef xLink = aLnkArr[ n ];
+            tools::SvRef<SvBaseLink> xLink = aLnkArr[ n ];
 
             // first look for the entry in the array
             for( size_t i = 0; i < pLinkMgr->GetLinks().size(); ++i )
@@ -420,7 +420,7 @@ IMPL_LINK_NOARG_TYPED( SvBaseLinksDlg, BreakLinkClickHdl, Button*, void )
     if(m_pTbLinks->GetSelectionCount() <= 1)
     {
         sal_uLong nPos;
-        SvBaseLinkRef xLink = GetSelEntry( &nPos );
+        tools::SvRef<SvBaseLink> xLink = GetSelEntry( &nPos );
         if( !xLink.Is() )
             return;
 
@@ -472,7 +472,7 @@ IMPL_LINK_NOARG_TYPED( SvBaseLinksDlg, BreakLinkClickHdl, Button*, void )
             m_pTbLinks->RemoveSelection();
             for( sal_uLong i = 0; i < aLinkList.size(); i++ )
             {
-                SvBaseLinkRef xLink = aLinkList[i];
+                tools::SvRef<SvBaseLink> xLink = aLinkList[i];
                 // tell the link that it will be resolved!
                 xLink->Closed();
 
@@ -507,7 +507,7 @@ IMPL_LINK_NOARG_TYPED( SvBaseLinksDlg, UpdateWaitingHdl, Idle*, void )
     for( sal_uLong nPos = m_pTbLinks->GetEntryCount(); nPos; )
     {
         SvTreeListEntry* pBox = m_pTbLinks->GetEntry( --nPos );
-        SvBaseLinkRef xLink( static_cast<SvBaseLink*>(pBox->GetUserData()) );
+        tools::SvRef<SvBaseLink> xLink( static_cast<SvBaseLink*>(pBox->GetUserData()) );
         if( xLink.Is() )
         {
             OUString sCur( ImplGetStateStr( *xLink ) ),
@@ -594,7 +594,7 @@ void SvBaseLinksDlg::SetManager( LinkManager* pNewMgr )
         SvBaseLinks& rLnks = (SvBaseLinks&)pLinkMgr->GetLinks();
         for( size_t n = 0; n < rLnks.size(); ++n )
         {
-            SvBaseLinkRef* pLinkRef = rLnks[ n ];
+            tools::SvRef<SvBaseLink>* pLinkRef = rLnks[ n ];
             if( !pLinkRef->Is() )
             {
                 rLnks.erase( rLnks.begin() + n );
@@ -692,7 +692,7 @@ void SvBaseLinksDlg::SetActLink( SvBaseLink * pLink )
         sal_uLong nSelect = 0;
         for( size_t n = 0; n < rLnks.size(); ++n )
         {
-            SvBaseLinkRef* pLinkRef = rLnks[ n ];
+            tools::SvRef<SvBaseLink>* pLinkRef = rLnks[ n ];
             // #109573# only visible links have been inserted into the TreeListBox,
             // invisible ones have to be skipped here
             if( (*pLinkRef)->IsVisible() )
diff --git a/include/sfx2/linkmgr.hxx b/include/sfx2/linkmgr.hxx
index ace7f8f..f0941e2 100644
--- a/include/sfx2/linkmgr.hxx
+++ b/include/sfx2/linkmgr.hxx
@@ -44,7 +44,7 @@ namespace sfx2
     // FormatID "RegisterStatusInfoId" and a string as the data container.
     // This contains the following enum.
 
-typedef std::vector<SvBaseLinkRef*> SvBaseLinks;
+typedef std::vector<tools::SvRef<SvBaseLink>*> SvBaseLinks;
 
 typedef std::set<SvLinkSource*> SvLinkSources;
 
diff --git a/include/sfx2/lnkbase.hxx b/include/sfx2/lnkbase.hxx
index 2458c9b..438327d 100644
--- a/include/sfx2/lnkbase.hxx
+++ b/include/sfx2/lnkbase.hxx
@@ -168,8 +168,6 @@ public:
     FileDialogHelper & GetInsertFileDialog(const OUString& rFactory) const;
 };
 
-typedef tools::SvRef<SvBaseLink> SvBaseLinkRef;
-
 }
 
 #endif
diff --git a/sc/source/ui/docshell/arealink.cxx b/sc/source/ui/docshell/arealink.cxx
index 314181a..5adb210 100644
--- a/sc/source/ui/docshell/arealink.cxx
+++ b/sc/source/ui/docshell/arealink.cxx
@@ -132,7 +132,7 @@ void ScAreaLink::Edit(vcl::Window* pParent, const Link<SvBaseLink&,void>& /* rEn
             SetName( aNewLinkName );
         }
 
-        sfx2::SvBaseLinkRef const xThis(this); // keep yourself alive
+        tools::SvRef<sfx2::SvBaseLink> const xThis(this); // keep yourself alive
         Refresh( aFile, aFilter, aArea, GetRefreshDelay() );
     }
 
diff --git a/sfx2/source/appl/linkmgr2.cxx b/sfx2/source/appl/linkmgr2.cxx
index d56c276..a0f60fa 100644
--- a/sfx2/source/appl/linkmgr2.cxx
+++ b/sfx2/source/appl/linkmgr2.cxx
@@ -74,7 +74,7 @@ LinkManager::~LinkManager()
 {
     for( size_t n = 0; n < aLinkTbl.size(); ++n)
     {
-        SvBaseLinkRef* pTmp = aLinkTbl[ n ];
+        tools::SvRef<SvBaseLink>* pTmp = aLinkTbl[ n ];
         if( pTmp->Is() )
         {
             (*pTmp)->Disconnect();
@@ -111,7 +111,7 @@ void LinkManager::Remove( SvBaseLink *pLink )
     bool bFound = false;
     for( size_t n = 0; n < aLinkTbl.size(); )
     {
-        SvBaseLinkRef* pTmp = aLinkTbl[ n ];
+        tools::SvRef<SvBaseLink>* pTmp = aLinkTbl[ n ];
         if( pLink == *pTmp )
         {
             (*pTmp)->Disconnect();
@@ -143,7 +143,7 @@ void LinkManager::Remove( size_t nPos, size_t nCnt )
 
         for( size_t n = nPos; n < nPos + nCnt; ++n)
         {
-            SvBaseLinkRef* pTmp = aLinkTbl[ n ];
+            tools::SvRef<SvBaseLink>* pTmp = aLinkTbl[ n ];
             if( pTmp->Is() )
             {
                 (*pTmp)->Disconnect();
@@ -160,7 +160,7 @@ bool LinkManager::Insert( SvBaseLink* pLink )
 {
     for( size_t n = 0; n < aLinkTbl.size(); ++n )
     {
-        SvBaseLinkRef* pTmp = aLinkTbl[ n ];
+        tools::SvRef<SvBaseLink>* pTmp = aLinkTbl[ n ];
         if( !pTmp->Is() )
         {
             delete pTmp;
@@ -170,7 +170,7 @@ bool LinkManager::Insert( SvBaseLink* pLink )
             return false; // No duplicate links inserted
     }
 
-    SvBaseLinkRef* pTmp = new SvBaseLinkRef( pLink );
+    tools::SvRef<SvBaseLink>* pTmp = new tools::SvRef<SvBaseLink>( pLink );
     pLink->SetLinkManager( this );
     aLinkTbl.push_back( pTmp );
     return true;
diff --git a/sfx2/source/appl/linksrc.cxx b/sfx2/source/appl/linksrc.cxx
index fde1879..7b1359f 100644
--- a/sfx2/source/appl/linksrc.cxx
+++ b/sfx2/source/appl/linksrc.cxx
@@ -69,10 +69,10 @@ static void StartTimer( SvLinkSourceTimer ** ppTimer, SvLinkSource * pOwner,
 
 struct SvLinkSource_Entry_Impl
 {
-    SvBaseLinkRef       xSink;
-    OUString            aDataMimeType;
-    sal_uInt16          nAdviseModes;
-    bool            bIsDataSink;
+    tools::SvRef<SvBaseLink>  xSink;
+    OUString                  aDataMimeType;
+    sal_uInt16                nAdviseModes;
+    bool                      bIsDataSink;
 
     SvLinkSource_Entry_Impl( SvBaseLink* pLink, const OUString& rMimeType,
                                 sal_uInt16 nAdvMode )
diff --git a/sfx2/source/appl/lnkbase2.cxx b/sfx2/source/appl/lnkbase2.cxx
index 421abc7..b956625 100644
--- a/sfx2/source/appl/lnkbase2.cxx
+++ b/sfx2/source/appl/lnkbase2.cxx
@@ -569,7 +569,7 @@ ImplDdeItem::~ImplDdeItem()
 {
     bIsInDTOR = true;
     // So that no-one gets the idea to delete the pointer when Disconnecting!
-    SvBaseLinkRef aRef( pLink );
+    tools::SvRef<SvBaseLink> aRef( pLink );
     aRef->Disconnect();
 }
 
@@ -625,7 +625,7 @@ void ImplDdeItem::AdviseLoop( bool bOpen )
         {
             // So that no-one gets the idea to delete the pointer
             // when Disconnecting!
-            SvBaseLinkRef aRef( pLink );
+            tools::SvRef<SvBaseLink> aRef( pLink );
             aRef->Disconnect();
         }
     }
diff --git a/sw/inc/ddefld.hxx b/sw/inc/ddefld.hxx
index 492421f..0b8d206 100644
--- a/sw/inc/ddefld.hxx
+++ b/sw/inc/ddefld.hxx
@@ -31,7 +31,7 @@ class SW_DLLPUBLIC SwDDEFieldType : public SwFieldType
     OUString aName;
     OUString aExpansion;
 
-    ::sfx2::SvBaseLinkRef refLink;
+    tools::SvRef<sfx2::SvBaseLink> refLink;
     SwDoc* pDoc;
 
     sal_uInt16 nRefCnt;
diff --git a/sw/inc/ndgrf.hxx b/sw/inc/ndgrf.hxx
index 7de4410..ffaa0f9 100644
--- a/sw/inc/ndgrf.hxx
+++ b/sw/inc/ndgrf.hxx
@@ -38,7 +38,7 @@ class SW_DLLPUBLIC SwGrfNode: public SwNoTextNode
 
     GraphicObject maGrfObj;
     GraphicObject *mpReplacementGraphic;
-    ::sfx2::SvBaseLinkRef refLink;       ///< If graphics only as link then pointer is set.
+    tools::SvRef<sfx2::SvBaseLink> refLink;       ///< If graphics only as link then pointer is set.
     Size nGrfSize;
     OUString aLowResGrf;                   ///< HTML: LowRes graphics (substitute until regular HighRes graphics is loaded).
     bool bInSwapIn              :1;
@@ -181,7 +181,7 @@ public:
     bool IsGrfLink() const                  { return refLink.Is(); }
     bool IsLinkedFile() const;
     bool IsLinkedDDE() const;
-    ::sfx2::SvBaseLinkRef GetLink() const    { return refLink; }
+    tools::SvRef<sfx2::SvBaseLink> GetLink() const    { return refLink; }
     bool GetFileFilterNms( OUString* pFileNm, OUString* pFilterNm ) const;
     void ReleaseLink();
 
diff --git a/sw/inc/section.hxx b/sw/inc/section.hxx
index 0635a8d..d72ab20 100644
--- a/sw/inc/section.hxx
+++ b/sw/inc/section.hxx
@@ -150,7 +150,7 @@ private:
     mutable SwSectionData m_Data;
 
     tools::SvRef<SwServerObject> m_RefObj; // Set if DataServer.
-    ::sfx2::SvBaseLinkRef m_RefLink;
+    tools::SvRef<sfx2::SvBaseLink> m_RefLink;
 
     SAL_DLLPRIVATE void ImplSetHiddenFlag(
             bool const bHidden, bool const bCondition);
diff --git a/sw/source/core/doc/DocumentLinksAdministrationManager.cxx b/sw/source/core/doc/DocumentLinksAdministrationManager.cxx
index 0a721e9..84d346b 100644
--- a/sw/source/core/doc/DocumentLinksAdministrationManager.cxx
+++ b/sw/source/core/doc/DocumentLinksAdministrationManager.cxx
@@ -72,7 +72,7 @@ namespace
                   OBJECT_CLIENT_FILE == pLnk->GetObjType() ) &&
                   dynamic_cast<const SwBaseLink*>( pLnk) !=  nullptr )
             {
-                    ::sfx2::SvBaseLinkRef xLink = pLnk;
+                    tools::SvRef<sfx2::SvBaseLink> xLink = pLnk;
 
                     OUString sFName;
                     sfx2::LinkManager::GetDisplayNames( xLink, 0, &sFName );
@@ -400,7 +400,7 @@ bool DocumentLinksAdministrationManager::EmbedAllLinks()
         ::sfx2::SvBaseLink* pLnk = 0;
         while( 0 != (pLnk = lcl_FindNextRemovableLink( rLinks ) ) )
         {
-            ::sfx2::SvBaseLinkRef xLink = pLnk;
+            tools::SvRef<sfx2::SvBaseLink> xLink = pLnk;
             // Tell the link that it's being destroyed!
             xLink->Closed();
 
diff --git a/sw/source/uibase/inc/swdtflvr.hxx b/sw/source/uibase/inc/swdtflvr.hxx
index b2b791a..b755b7b 100644
--- a/sw/source/uibase/inc/swdtflvr.hxx
+++ b/sw/source/uibase/inc/swdtflvr.hxx
@@ -56,10 +56,10 @@ namespace nsTransferBufferType
 class SW_DLLPUBLIC SwTransferable : public TransferableHelper
 {
     friend class SwView_Impl;
-    SfxObjectShellLock             m_aDocShellRef;
+    SfxObjectShellLock              m_aDocShellRef;
     TransferableDataHelper          m_aOleData;
     TransferableObjectDescriptor    m_aObjDesc;
-    ::sfx2::SvBaseLinkRef            m_xDdeLink;
+    tools::SvRef<sfx2::SvBaseLink>  m_xDdeLink;
 
     SwWrtShell      *m_pWrtShell;
     /* #96392# Added pCreatorView to distinguish SwFrameShell from
commit c22ec49de497fd65b4dac901d6bc1f06d5a9a3c7
Author: Noel Grandin <noel at peralex.com>
Date:   Tue Oct 27 08:29:04 2015 +0200

    inline SfxMediumRef typedef
    
    Change-Id: Id6dc03a5957adf657d12db7941273593a9f7c10f

diff --git a/dbaccess/source/filter/xml/xmlfilter.cxx b/dbaccess/source/filter/xml/xmlfilter.cxx
index 194349c..14e2db1 100644
--- a/dbaccess/source/filter/xml/xmlfilter.cxx
+++ b/dbaccess/source/filter/xml/xmlfilter.cxx
@@ -295,7 +295,7 @@ bool ODBFilter::implImport( const Sequence< PropertyValue >& rDescriptor )
     {
         uno::Reference<XComponent> xCom(GetModel(),UNO_QUERY);
 
-        SfxMediumRef pMedium(0);
+        tools::SvRef<SfxMedium> pMedium(0);
         if (!xStorage.is())
         {
             OUString sStreamRelPath;
diff --git a/include/sfx2/docfile.hxx b/include/sfx2/docfile.hxx
index c19cc35..f1192b3 100644
--- a/include/sfx2/docfile.hxx
+++ b/include/sfx2/docfile.hxx
@@ -264,8 +264,6 @@ public:
     static sal_uInt32   CreatePasswordToModifyHash( const OUString& aPasswd, bool bWriter );
 };
 
-typedef tools::SvRef<SfxMedium> SfxMediumRef;
-
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/reportdesign/source/filter/xml/xmlfilter.cxx b/reportdesign/source/filter/xml/xmlfilter.cxx
index 8c86749..f75a5bdd 100644
--- a/reportdesign/source/filter/xml/xmlfilter.cxx
+++ b/reportdesign/source/filter/xml/xmlfilter.cxx
@@ -459,7 +459,7 @@ bool ORptFilter::implImport( const Sequence< PropertyValue >& rDescriptor )
     {
         uno::Reference<XComponent> xCom(GetModel(),UNO_QUERY);
 
-        SfxMediumRef pMedium = new SfxMedium(
+        tools::SvRef<SfxMedium> pMedium = new SfxMedium(
                 sFileName, ( StreamMode::READ | StreamMode::NOCREATE ) );
 
         if( pMedium )
diff --git a/sfx2/source/appl/fileobj.cxx b/sfx2/source/appl/fileobj.cxx
index 6d97ba0..70e53b2 100644
--- a/sfx2/source/appl/fileobj.cxx
+++ b/sfx2/source/appl/fileobj.cxx
@@ -96,7 +96,7 @@ bool SvFileObject::GetData( ::com::sun::star::uno::Any & rData,
     case FILETYPE_GRF:
         if( !bLoadError )
         {
-            SfxMediumRef xTmpMed;
+            tools::SvRef<SfxMedium> xTmpMed;
 
             if( SotClipboardFormatId::GDIMETAFILE == nFmt || SotClipboardFormatId::BITMAP == nFmt ||
                 SotClipboardFormatId::SVXB == nFmt )
@@ -266,7 +266,7 @@ bool SvFileObject::LoadFile_Impl()
         bLoadAgain = bDataReady = bInNewData = false;
         bWaitForData = true;
 
-        SfxMediumRef xTmpMed = xMed;
+        tools::SvRef<SfxMedium> xTmpMed = xMed;
         bInCallDownload = true;
         xMed->Download( LINK( this, SvFileObject, LoadGrfReady_Impl ) );
         bInCallDownload = false;
@@ -485,7 +485,7 @@ IMPL_LINK_NOARG_TYPED( SvFileObject, LoadGrfReady_Impl, void*, void )
         if( xMed.Is() )
         {
             xMed->SetDoneLink( Link<void*,void>() );
-            pDelMed = new SfxMediumRef(xMed);
+            pDelMed = new tools::SvRef<SfxMedium>(xMed);
             nPostUserEventId = Application::PostUserEvent(
                         LINK( this, SvFileObject, DelMedium_Impl ),
                         pDelMed);
@@ -496,7 +496,7 @@ IMPL_LINK_NOARG_TYPED( SvFileObject, LoadGrfReady_Impl, void*, void )
 
 IMPL_LINK_TYPED( SvFileObject, DelMedium_Impl, void*, p, void )
 {
-    SfxMediumRef* deleteMedium = static_cast<SfxMediumRef*>(p);
+    tools::SvRef<SfxMedium>* deleteMedium = static_cast<tools::SvRef<SfxMedium>*>(p);
     nPostUserEventId = 0;
     assert(pDelMed == deleteMedium);
     pDelMed = NULL;
diff --git a/sfx2/source/appl/fileobj.hxx b/sfx2/source/appl/fileobj.hxx
index 397bd76..bad1ddd 100644
--- a/sfx2/source/appl/fileobj.hxx
+++ b/sfx2/source/appl/fileobj.hxx
@@ -28,14 +28,14 @@ namespace sfx2 { class FileDialogHelper; }
 
 class SvFileObject : public sfx2::SvLinkSource
 {
-    OUString            sFileNm;
-    OUString            sFilter;
-    OUString            sReferer;
+    OUString                     sFileNm;
+    OUString                     sFilter;
+    OUString                     sReferer;
     Link<const OUString&, void>  aEndEditLink;
-    SfxMediumRef        xMed;
-    ImplSVEvent*        nPostUserEventId;
-    SfxMediumRef*       pDelMed;
-    VclPtr<vcl::Window> pOldParent;
+    tools::SvRef<SfxMedium>      xMed;
+    ImplSVEvent*                 nPostUserEventId;
+    tools::SvRef<SfxMedium>*     pDelMed;
+    VclPtr<vcl::Window>          pOldParent;
 
     sal_uInt8 nType;
 
diff --git a/sw/source/core/inc/SwXMLTextBlocks.hxx b/sw/source/core/inc/SwXMLTextBlocks.hxx
index 2767df6..9c7bc86 100644
--- a/sw/source/core/inc/SwXMLTextBlocks.hxx
+++ b/sw/source/core/inc/SwXMLTextBlocks.hxx
@@ -34,12 +34,12 @@ class SvxMacroTableDtor;
 class SwXMLTextBlocks : public SwImpBlocks
 {
 protected:
-    bool         bAutocorrBlock;
-    bool         bBlock;
-    SfxObjectShellRef xDocShellRef;
-    sal_uInt16       nFlags;
-    OUString aPackageName;
-    SfxMediumRef xMedium;
+    bool                    bAutocorrBlock;
+    bool                    bBlock;
+    SfxObjectShellRef       xDocShellRef;
+    sal_uInt16              nFlags;
+    OUString                aPackageName;
+    tools::SvRef<SfxMedium> xMedium;
 
     void ReadInfo();
     void WriteInfo();


More information about the Libreoffice-commits mailing list