[PATCH] dbwizsetup: Make pFinalPage a class member
Mathias Hasselmann (via Code Review)
gerrit at gerrit.libreoffice.org
Thu Mar 21 16:40:55 PDT 2013
Hi,
I have submitted a patch for review:
https://gerrit.libreoffice.org/2904
To pull it, you can do:
git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/04/2904/1
dbwizsetup: Make pFinalPage a class member
It really should not have been a global variable.
Change-Id: I26d4b0d4736a2d026eb61149ede88f6f6ead6dfa
---
M dbaccess/source/ui/dlg/dbwizsetup.cxx
M dbaccess/source/ui/inc/dbwizsetup.hxx
2 files changed, 12 insertions(+), 11 deletions(-)
diff --git a/dbaccess/source/ui/dlg/dbwizsetup.cxx b/dbaccess/source/ui/dlg/dbwizsetup.cxx
index d5f2973..5b1ba07 100644
--- a/dbaccess/source/ui/dlg/dbwizsetup.cxx
+++ b/dbaccess/source/ui/dlg/dbwizsetup.cxx
@@ -113,8 +113,6 @@
#define START_PAGE 0
#define CONNECTION_PAGE 1
-OFinalDBPageSetup* pFinalPage;
-
DBG_NAME(ODbTypeWizDialogSetup)
//=========================================================================
//= ODbTypeWizDialogSetup
@@ -150,11 +148,11 @@
, m_sWorkPath( SvtPathOptions().GetWorkPath() )
, m_pGeneralPage( NULL )
, m_pMySQLIntroPage( NULL )
+ , m_pFinalPage( NULL )
, m_pCollection( NULL )
{
DBG_CTOR(ODbTypeWizDialogSetup,NULL);
// no local resources needed anymore
- pFinalPage = NULL;
// extract the datasource type collection from the item set
DbuTypeCollectionItem* pCollectionItem = PTR_CAST(DbuTypeCollectionItem, _pItems->GetItem(DSID_TYPECOLLECTION));
if (pCollectionItem)
@@ -583,7 +581,7 @@
case PAGE_DBSETUPWIZARD_FINAL:
pPage = OFinalDBPageSetup::CreateFinalDBTabPageSetup(this,*m_pOutSet);
- pFinalPage = static_cast<OFinalDBPageSetup*> (pPage);
+ m_pFinalPage = static_cast<OFinalDBPageSetup*> (pPage);
break;
}
@@ -674,8 +672,8 @@
break;
case PAGE_DBSETUPWIZARD_FINAL:
enableButtons( WZB_FINISH, sal_True);
- if ( pFinalPage )
- pFinalPage->enableTableWizardCheckBox(m_pCollection->supportsTableCreation(m_sURL));
+ if ( m_pFinalPage )
+ m_pFinalPage->enableTableWizardCheckBox(m_pCollection->supportsTableCreation(m_sURL));
break;
}
}
@@ -754,7 +752,7 @@
::rtl::OUString sPath = m_pImpl->getDocumentUrl( *m_pOutSet );
xStore->storeAsURL( sPath, aArgs.getPropertyValues() );
- if ( !pFinalPage || pFinalPage->IsDatabaseDocumentToBeRegistered() )
+ if ( !m_pFinalPage || m_pFinalPage->IsDatabaseDocumentToBeRegistered() )
RegisterDataSourceByLocation( sPath );
return sal_True;
@@ -788,8 +786,8 @@
if ( m_pGeneralPage->GetDatabaseCreationMode() == OGeneralPage::eOpenExisting )
return sal_True;
- if ( pFinalPage != NULL )
- return pFinalPage->IsDatabaseDocumentToBeOpened();
+ if ( m_pFinalPage != NULL )
+ return m_pFinalPage->IsDatabaseDocumentToBeOpened();
return sal_True;
}
@@ -800,8 +798,8 @@
if ( m_pGeneralPage->GetDatabaseCreationMode() == OGeneralPage::eOpenExisting )
return sal_False;
- if ( pFinalPage != NULL )
- return pFinalPage->IsTableWizardToBeStarted();
+ if ( m_pFinalPage != NULL )
+ return m_pFinalPage->IsTableWizardToBeStarted();
return sal_False;
}
diff --git a/dbaccess/source/ui/inc/dbwizsetup.hxx b/dbaccess/source/ui/inc/dbwizsetup.hxx
index d04508a..5d9dd46 100644
--- a/dbaccess/source/ui/inc/dbwizsetup.hxx
+++ b/dbaccess/source/ui/inc/dbwizsetup.hxx
@@ -57,6 +57,7 @@
/** tab dialog for administrating the office wide registered data sources
*/
class OMySQLIntroPageSetup;
+class OFinalDBPageSetup;
class ODbTypeWizDialogSetup : public svt::RoadmapWizard , public IItemSetHelper, public IDatabaseSettingsDialog,public dbaui::OModuleClient
{
@@ -89,6 +90,8 @@
String m_sWorkPath;
OGeneralPage* m_pGeneralPage;
OMySQLIntroPageSetup* m_pMySQLIntroPage;
+ OFinalDBPageSetup* m_pFinalPage;
+
::dbaccess::ODsnTypeCollection*
m_pCollection; /// the DSN type collection instance
--
To view, visit https://gerrit.libreoffice.org/2904
To unsubscribe, visit https://gerrit.libreoffice.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I26d4b0d4736a2d026eb61149ede88f6f6ead6dfa
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Mathias Hasselmann <mathias at openismus.com>
More information about the LibreOffice
mailing list