dbaccess/source/sdbtools/connection/tablename.cxx |   33 ++++++++--------------
 dbaccess/source/sdbtools/connection/tablename.hxx |    8 ++---
 sfx2/source/appl/appdde.cxx                       |   22 ++++++--------
 sfx2/source/inc/appdata.hxx                       |    4 --
 4 files changed, 27 insertions(+), 40 deletions(-)

New commits:
commit c026b936404bd052fc74283d3cc2e0727ec4edb9
Author:     Noel Grandin <[email protected]>
AuthorDate: Tue Feb 28 13:52:19 2023 +0200
Commit:     Noel Grandin <[email protected]>
CommitDate: Tue Feb 28 16:57:52 2023 +0000

    no need to allocate SfxDdeDocTopics_Impl separately
    
    it is just a vector, only 2 words big
    
    Change-Id: I88ca1befea1fc3dba05f7628e4319aedb3250751
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147968
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <[email protected]>

diff --git a/sfx2/source/appl/appdde.cxx b/sfx2/source/appl/appdde.cxx
index 39b72e6eb0b3..6fe5888009dc 100644
--- a/sfx2/source/appl/appdde.cxx
+++ b/sfx2/source/appl/appdde.cxx
@@ -414,8 +414,6 @@ bool SfxApplication::InitializeDde()
     nError = pImpl->pDdeService->GetError();
     if( !nError )
     {
-        pImpl->pDocTopics.reset(new SfxDdeDocTopics_Impl);
-
         // we certainly want to support RTF!
         pImpl->pDdeService->AddFormat( SotClipboardFormatId::RTF );
         pImpl->pDdeService->AddFormat( SotClipboardFormatId::RICHTEXT );
@@ -438,7 +436,7 @@ void SfxAppData_Impl::DeInitDDE()
 {
     pTriggerTopic.reset();
     pDdeService2.reset();
-    pDocTopics.reset();
+    maDocTopics.clear();
     pDdeService.reset();
 }
 
@@ -446,15 +444,15 @@ void SfxAppData_Impl::DeInitDDE()
 void SfxApplication::AddDdeTopic( SfxObjectShell* pSh )
 {
     //OV: DDE is disconnected in server mode!
-    if( !pImpl->pDocTopics )
+    if( pImpl->maDocTopics.empty() )
         return;
 
     // prevent double submit
     OUString sShellNm;
     bool bFnd = false;
-    for (size_t n = pImpl->pDocTopics->size(); n;)
+    for (size_t n = pImpl->maDocTopics.size(); n;)
     {
-        if( (*pImpl->pDocTopics)[ --n ]->pSh == pSh )
+        if( pImpl->maDocTopics[ --n ]->pSh == pSh )
         {
             // If the document is untitled, is still a new Topic is created!
             if( !bFnd )
@@ -462,14 +460,14 @@ void SfxApplication::AddDdeTopic( SfxObjectShell* pSh )
                 bFnd = true;
                 sShellNm = 
pSh->GetTitle(SFX_TITLE_FULLNAME).toAsciiLowerCase();
             }
-            OUString sNm( (*pImpl->pDocTopics)[ n ]->GetName() );
+            OUString sNm( pImpl->maDocTopics[ n ]->GetName() );
             if( sShellNm == sNm.toAsciiLowerCase() )
                 return ;
         }
     }
 
     SfxDdeDocTopic_Impl *const pTopic = new SfxDdeDocTopic_Impl(pSh);
-    pImpl->pDocTopics->push_back(pTopic);
+    pImpl->maDocTopics.push_back(pTopic);
     pImpl->pDdeService->AddTopic( *pTopic );
 }
 #endif
@@ -478,17 +476,17 @@ void SfxApplication::RemoveDdeTopic( SfxObjectShell const 
* pSh )
 {
 #if defined(_WIN32)
     //OV: DDE is disconnected in server mode!
-    if( !pImpl->pDocTopics )
+    if( pImpl->maDocTopics.empty() )
         return;
 
-    for (size_t n = pImpl->pDocTopics->size(); n; )
+    for (size_t n = pImpl->maDocTopics.size(); n; )
     {
-        SfxDdeDocTopic_Impl *const pTopic = (*pImpl->pDocTopics)[ --n ];
+        SfxDdeDocTopic_Impl *const pTopic = pImpl->maDocTopics[ --n ];
         if (pTopic->pSh == pSh)
         {
             pImpl->pDdeService->RemoveTopic( *pTopic );
             delete pTopic;
-            pImpl->pDocTopics->erase( pImpl->pDocTopics->begin() + n );
+            pImpl->maDocTopics.erase( pImpl->maDocTopics.begin() + n );
         }
     }
 #else
diff --git a/sfx2/source/inc/appdata.hxx b/sfx2/source/inc/appdata.hxx
index 121ba43f5581..7f2c99d6332a 100644
--- a/sfx2/source/inc/appdata.hxx
+++ b/sfx2/source/inc/appdata.hxx
@@ -56,8 +56,6 @@ namespace sfx2::sidebar { class Theme; }
 
 
 
-typedef std::vector<SfxDdeDocTopic_Impl*> SfxDdeDocTopics_Impl;
-
 class SfxAppData_Impl
 {
 public:
@@ -66,7 +64,7 @@ public:
 
     // DDE stuff
     std::unique_ptr<DdeService>              pDdeService;
-    std::unique_ptr<SfxDdeDocTopics_Impl>    pDocTopics;
+    std::vector<SfxDdeDocTopic_Impl*>        maDocTopics;
     std::unique_ptr<SfxDdeTriggerTopic_Impl> pTriggerTopic;
     std::unique_ptr<DdeService>              pDdeService2;
 
commit d7182c36be4b606a02cddeacb44c1b63387bd368
Author:     Noel Grandin <[email protected]>
AuthorDate: Tue Feb 28 14:10:25 2023 +0200
Commit:     Noel Grandin <[email protected]>
CommitDate: Tue Feb 28 16:57:39 2023 +0000

    no need for pimpl in TableName
    
    Change-Id: I23ec068c5e4297a3e7451ccaa2e43ae5572f9050
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147970
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <[email protected]>

diff --git a/dbaccess/source/sdbtools/connection/tablename.cxx 
b/dbaccess/source/sdbtools/connection/tablename.cxx
index 2b275c0f31eb..f6a77dd3e91b 100644
--- a/dbaccess/source/sdbtools/connection/tablename.cxx
+++ b/dbaccess/source/sdbtools/connection/tablename.cxx
@@ -50,18 +50,9 @@ namespace sdbtools
 
     using namespace ::dbtools;
 
-    // TableName
-    struct TableName_Impl
-    {
-        OUString sCatalog;
-        OUString sSchema;
-        OUString sName;
-    };
-
     // TableName
     TableName::TableName( const Reference<XComponentContext>& _rContext, const 
Reference< XConnection >& _rxConnection )
         :ConnectionDependentComponent( _rContext )
-        ,m_pImpl( new TableName_Impl )
     {
         setWeakConnection( _rxConnection );
     }
@@ -73,43 +64,43 @@ namespace sdbtools
     OUString SAL_CALL TableName::getCatalogName()
     {
         EntryGuard aGuard( *this );
-        return m_pImpl->sCatalog;
+        return msCatalog;
     }
 
     void SAL_CALL TableName::setCatalogName( const OUString& _catalogName )
     {
         EntryGuard aGuard( *this );
-        m_pImpl->sCatalog = _catalogName;
+        msCatalog = _catalogName;
     }
 
     OUString SAL_CALL TableName::getSchemaName()
     {
         EntryGuard aGuard( *this );
-        return m_pImpl->sSchema;
+        return msSchema;
     }
 
     void SAL_CALL TableName::setSchemaName( const OUString& _schemaName )
     {
         EntryGuard aGuard( *this );
-        m_pImpl->sSchema = _schemaName;
+        msSchema = _schemaName;
     }
 
     OUString SAL_CALL TableName::getTableName()
     {
         EntryGuard aGuard( *this );
-        return m_pImpl->sName;
+        return msName;
     }
 
     void SAL_CALL TableName::setTableName( const OUString& _tableName )
     {
         EntryGuard aGuard( *this );
-        m_pImpl->sName = _tableName;
+        msName = _tableName;
     }
 
     OUString SAL_CALL TableName::getNameForSelect()
     {
         EntryGuard aGuard( *this );
-        return composeTableNameForSelect( getConnection(), m_pImpl->sCatalog, 
m_pImpl->sSchema, m_pImpl->sName );
+        return composeTableNameForSelect( getConnection(), msCatalog, 
msSchema, msName );
     }
 
     Reference< XPropertySet > SAL_CALL TableName::getTable()
@@ -157,9 +148,9 @@ namespace sdbtools
 
         try
         {
-            OSL_VERIFY( _table->getPropertyValue( PROPERTY_CATALOGNAME ) >>= 
m_pImpl->sCatalog );
-            OSL_VERIFY( _table->getPropertyValue( PROPERTY_SCHEMANAME ) >>= 
m_pImpl->sSchema );
-            OSL_VERIFY( _table->getPropertyValue( PROPERTY_NAME ) >>= 
m_pImpl->sName );
+            OSL_VERIFY( _table->getPropertyValue( PROPERTY_CATALOGNAME ) >>= 
msCatalog );
+            OSL_VERIFY( _table->getPropertyValue( PROPERTY_SCHEMANAME ) >>= 
msSchema );
+            OSL_VERIFY( _table->getPropertyValue( PROPERTY_NAME ) >>= msName );
         }
         catch( const RuntimeException& ) { throw; }
         catch( const Exception& e )
@@ -209,7 +200,7 @@ namespace sdbtools
 
         return composeTableName(
             getConnection()->getMetaData(),
-            m_pImpl->sCatalog, m_pImpl->sSchema, m_pImpl->sName, Quote,
+            msCatalog, msSchema, msName, Quote,
             lcl_translateCompositionType_throw( Type ) );
     }
 
@@ -220,7 +211,7 @@ namespace sdbtools
         qualifiedNameComponents(
             getConnection()->getMetaData(),
             ComposedName,
-            m_pImpl->sCatalog, m_pImpl->sSchema, m_pImpl->sName,
+            msCatalog, msSchema, msName,
             lcl_translateCompositionType_throw( Type ) );
     }
 
diff --git a/dbaccess/source/sdbtools/connection/tablename.hxx 
b/dbaccess/source/sdbtools/connection/tablename.hxx
index 3a7ece21a182..74abc3025f49 100644
--- a/dbaccess/source/sdbtools/connection/tablename.hxx
+++ b/dbaccess/source/sdbtools/connection/tablename.hxx
@@ -33,15 +33,11 @@ namespace sdbtools
     // TableName
     typedef ::cppu::WeakImplHelper<   css::sdb::tools::XTableName
                                   >   TableName_Base;
-    struct TableName_Impl;
     /** default implementation for XTableName
     */
     class TableName :public TableName_Base
                     ,public ConnectionDependentComponent
     {
-    private:
-        std::unique_ptr< TableName_Impl >   m_pImpl;
-
     public:
         /** constructs the instance
 
@@ -77,6 +73,10 @@ namespace sdbtools
     private:
         TableName( const TableName& ) = delete;
         TableName& operator=( const TableName& ) = delete;
+
+        OUString msCatalog;
+        OUString msSchema;
+        OUString msName;
     };
 
 } // namespace sdbtools

Reply via email to