Kaydet (Commit) 880af067 authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:unusedfields in dbaccess

Change-Id: I858fd3d0bbd91b0ee7e02969b26d80e262c63b7d
Reviewed-on: https://gerrit.libreoffice.org/68279
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst d434bd54
......@@ -1067,7 +1067,6 @@ void ORowSet::implCancelRowUpdates( bool _bNotifyModified )
m_aBookmark = m_pCache->getBookmark();
m_aCurrentRow = m_pCache->m_aMatrixIter;
m_bIsInsertRow = false;
m_aCurrentRow.setBookmark(m_aBookmark);
// notification order
// IsModified
......
......@@ -1028,7 +1028,6 @@ void ORowSetBase::setCurrentRow( bool _bMoved, bool _bDoNotify, const ORowSetRow
m_aCurrentRow = m_pCache->m_aMatrixIter;
m_bIsInsertRow = false;
OSL_ENSURE(!m_aCurrentRow.isNull(),"CurrentRow is null!");
m_aCurrentRow.setBookmark(m_aBookmark);
OSL_ENSURE(!m_aCurrentRow.isNull() && m_aCurrentRow != m_pCache->getEnd(),"Position of matrix iterator isn't valid!");
OSL_ENSURE(m_aCurrentRow->is(),"Currentrow isn't valid");
OSL_ENSURE(m_aBookmark.hasValue(),"Bookmark has no value!");
......@@ -1052,7 +1051,6 @@ void ORowSetBase::setCurrentRow( bool _bMoved, bool _bDoNotify, const ORowSetRow
m_aOldRow->clearRow();
m_aCurrentRow = m_pCache->getEnd();
m_aBookmark = Any();
m_aCurrentRow.setBookmark(m_aBookmark);
}
// TODO: can this be done before the notifications?
......@@ -1290,7 +1288,6 @@ void ORowSetBase::movementFailed()
m_bBeforeFirst = m_pCache->isBeforeFirst();
m_bAfterLast = m_pCache->isAfterLast();
m_aBookmark = Any();
m_aCurrentRow.setBookmark(m_aBookmark);
OSL_ENSURE(m_bBeforeFirst || m_bAfterLast,"BeforeFirst or AfterLast is wrong!");
SAL_INFO("dbaccess", "ORowSetBase::movementFailed() Clone = " << m_bClone);
}
......@@ -1342,7 +1339,6 @@ void ORowSetBase::onDeletedRow( const Any& _rBookmark, sal_Int32 _nPos )
m_aOldRow->clearRow();
m_aCurrentRow = m_pCache->getEnd();
m_aBookmark = Any();
m_aCurrentRow.setBookmark( m_aBookmark );
}
}
......
......@@ -73,11 +73,6 @@ bool ORowSetCacheIterator::operator !=(const ORowSetMatrix::iterator& _rRH) cons
return m_aIter->second.aIterator != _rRH;
}
void ORowSetCacheIterator::setBookmark(const css::uno::Any& _rBookmark)
{
m_aIter->second.aBookmark = _rBookmark;
}
bool ORowSetCacheIterator::isNull() const
{
bool bRet = !m_pCache || !m_pRowSet || m_aIter == m_pCache->m_aCacheIterators.end();
......
......@@ -31,7 +31,6 @@ namespace dbaccess
typedef struct
{
ORowSetMatrix::iterator aIterator;
css::uno::Any aBookmark;
ORowSetBase* pRowSet;
} ORowSetCacheIterator_Helper;
......@@ -67,8 +66,6 @@ namespace dbaccess
bool operator <(const ORowSetMatrix::iterator& _rRH) const;
bool operator !=(const ORowSetMatrix::iterator& _rRH) const;
void setBookmark(const css::uno::Any& _rBookmark);
const ORowSetCacheMap::iterator& getIter() const { return m_aIter; }
};
}
......
......@@ -49,7 +49,6 @@ namespace dbaccess
// ODsnTypeCollection
ODsnTypeCollection::ODsnTypeCollection(const css::uno::Reference< css::uno::XComponentContext >& _xContext)
:m_aDriverConfig(_xContext)
,m_xContext(_xContext)
#if OSL_DEBUG_LEVEL > 0
,m_nLivingIterators(0)
#endif
......
......@@ -104,7 +104,6 @@ class OOO_DLLPUBLIC_DBA ODsnTypeCollection final
std::vector<OUString> m_aDsnTypesDisplayNames; /// user readable names for the datasource types
std::vector<OUString> m_aDsnPrefixes; /// DSN prefixes which determine the type of a datasource
::connectivity::DriversConfig m_aDriverConfig;
css::uno::Reference< css::uno::XComponentContext > m_xContext;
#if OSL_DEBUG_LEVEL > 0
sal_Int32 m_nLivingIterators; /// just for debugging reasons, counts the living iterators
......
......@@ -91,7 +91,6 @@ sal_Int8 OApplicationIconControl::AcceptDrop( const AcceptDropEvent& _rEvt )
{
SetCursor(pEntry);
nDropOption = m_pActionListener->queryDrop( _rEvt, GetDataFlavorExVector() );
m_aMousePos = _rEvt.maPosPixel;
}
}
......
......@@ -28,7 +28,6 @@ namespace dbaui
class OApplicationIconControl :public SvtIconChoiceCtrl
,public DropTargetHelper
{
Point m_aMousePos;
IControlActionListener* m_pActionListener;
public:
......
......@@ -65,10 +65,8 @@ using namespace dbaui;
class DBContentLoader : public ::cppu::WeakImplHelper< XFrameLoader, XServiceInfo>
{
private:
OUString m_aURL;
Sequence< PropertyValue> m_aArgs;
Reference< XLoadEventListener > m_xListener;
Reference< XFrame > m_xFrame;
Reference< XComponentContext > m_xContext;
public:
explicit DBContentLoader(const Reference< XComponentContext >&);
......@@ -142,9 +140,7 @@ void SAL_CALL DBContentLoader::load(const Reference< XFrame > & rFrame, const OU
const Sequence< PropertyValue >& rArgs,
const Reference< XLoadEventListener > & rListener)
{
m_xFrame = rFrame;
m_xListener = rListener;
m_aURL = rURL;
m_aArgs = rArgs;
static const struct ServiceNameToImplName
......
......@@ -63,8 +63,6 @@ ORelationDialog::ORelationDialog( OJoinTableView* pParent,
get(m_pRB_CascDelDefault, "deldefault");
get(m_pPB_OK, "ok");
m_xConnection = pParent->getDesignView()->getController().getConnection();
// Copy connection
m_pConnData.reset( static_cast<ORelationTableConnectionData*>(pConnectionData->NewInstance()) );
m_pConnData->CopyFrom( *pConnectionData );
......
......@@ -338,7 +338,7 @@ void ODbTypeWizDialogSetup::activateDatabasePath()
case OGeneralPageWizard::eOpenExisting:
{
activatePath( static_cast<PathId>(m_pCollection->size() + 1), true );
enableButtons( WizardButtonFlags::FINISH, !m_pGeneralPage->GetSelectedDocument().sURL.isEmpty() );
enableButtons( WizardButtonFlags::FINISH, !m_pGeneralPage->GetSelectedDocumentURL().isEmpty() );
}
break;
default:
......@@ -594,7 +594,7 @@ IMPL_LINK_NOARG(ODbTypeWizDialogSetup, OnChangeCreationMode, OGeneralPageWizard&
IMPL_LINK_NOARG(ODbTypeWizDialogSetup, OnRecentDocumentSelected, OGeneralPageWizard&, void)
{
enableButtons( WizardButtonFlags::FINISH, !m_pGeneralPage->GetSelectedDocument().sURL.isEmpty() );
enableButtons( WizardButtonFlags::FINISH, !m_pGeneralPage->GetSelectedDocumentURL().isEmpty() );
}
IMPL_LINK_NOARG(ODbTypeWizDialogSetup, OnSingleDocumentChosen, OGeneralPageWizard&, void)
......@@ -974,7 +974,7 @@ bool ODbTypeWizDialogSetup::SaveDatabaseDocument()
try
{
AsyncLoader* pAsyncLoader = new AsyncLoader( getORB(), m_pGeneralPage->GetSelectedDocument().sURL );
AsyncLoader* pAsyncLoader = new AsyncLoader( getORB(), m_pGeneralPage->GetSelectedDocumentURL() );
::rtl::Reference< AsyncLoader > xKeepAlive( pAsyncLoader );
pAsyncLoader->doLoadAsync();
}
......
......@@ -651,17 +651,12 @@ namespace dbaui
return bChangedSomething;
}
OGeneralPageWizard::DocumentDescriptor OGeneralPageWizard::GetSelectedDocument() const
OUString OGeneralPageWizard::GetSelectedDocumentURL() const
{
DocumentDescriptor aDocument;
if ( !m_aBrowsedDocument.sURL.isEmpty() )
aDocument = m_aBrowsedDocument;
if ( !m_aBrowsedDocumentURL.isEmpty() )
return m_aBrowsedDocumentURL;
else
{
aDocument.sURL = m_pLB_DocumentList->GetSelectedDocumentURL();
aDocument.sFilter = m_pLB_DocumentList->GetSelectedDocumentFilter();
}
return aDocument;
return m_pLB_DocumentList->GetSelectedDocumentURL();
}
IMPL_LINK_NOARG( OGeneralPageWizard, OnCreateDatabaseModeSelected, Button*, void )
......@@ -728,8 +723,7 @@ namespace dbaui
OnSetupModeSelected( m_pRB_ConnectDatabase );
return;
}
m_aBrowsedDocument.sURL = sPath;
m_aBrowsedDocument.sFilter.clear();
m_aBrowsedDocumentURL = sPath;
m_aChooseDocumentHandler.Call( *this );
}
}
......
......@@ -129,12 +129,6 @@ namespace dbaui
eOpenExisting
};
struct DocumentDescriptor
{
OUString sURL;
OUString sFilter;
};
private:
// dialog controls
VclPtr<RadioButton> m_pRB_CreateDatabase;
......@@ -149,7 +143,7 @@ namespace dbaui
VclPtr<OpenDocumentButton> m_pPB_OpenDatabase;
// state
DocumentDescriptor m_aBrowsedDocument;
OUString m_aBrowsedDocumentURL;
CreationMode m_eOriginalCreationMode;
Link<OGeneralPageWizard&,void> m_aCreationModeHandler; /// to be called if a new type is selected
......@@ -165,7 +159,7 @@ namespace dbaui
void SetDocumentSelectionHandler( const Link<OGeneralPageWizard&,void>& _rHandler) { m_aDocumentSelectionHandler = _rHandler; }
void SetChooseDocumentHandler( const Link<OGeneralPageWizard&,void>& _rHandler) { m_aChooseDocumentHandler = _rHandler; }
DocumentDescriptor GetSelectedDocument() const;
OUString GetSelectedDocumentURL() const;
private:
virtual bool FillItemSet( SfxItemSet* _rCoreAttrs ) override;
......
......@@ -89,7 +89,6 @@ namespace dbaui
OUString m_sTextToken; ///< cell content
OUString m_sNumToken; ///< SDNUM value
OUString m_sValToken; ///< SDVAL value
TOTypeInfoSP m_pTypeInfo; ///< contains the default type
const TColumnVector* m_pColumnList;
const OTypeInfoMap* m_pInfoMap;
......
......@@ -31,7 +31,6 @@ namespace dbaui
class OFieldDescription
{
private:
css::uno::Any m_aDefaultValue; // the default value from the database
css::uno::Any m_aControlDefault; // the value which the control inserts as default
css::uno::Any m_aWidth; // sal_Int32 or void
css::uno::Any m_aRelativePosition; // sal_Int32 or void
......
......@@ -48,7 +48,6 @@ namespace dbaui
TTableConnectionData::value_type m_pConnData;
TTableConnectionData::value_type m_pOrigConnData;
css::uno::Reference< css::sdbc::XConnection > m_xConnection;
bool m_bTriedOneUpdate;
......
......@@ -50,7 +50,6 @@ namespace dbaui
class ODatabaseImportExport : public ::cppu::WeakImplHelper< css::lang::XEventListener>
{
protected:
css::lang::Locale m_aLocale;
css::uno::Sequence< css::uno::Any> m_aSelection;
bool m_bBookmarkSelection;
SvStream* m_pStream;
......
......@@ -67,8 +67,6 @@ const sal_uInt16 TYPE_BIT = 31;
public:
OUString aUIName; // the name which is the user see (a combination of resource text and aTypeName)
OUString aTypeName; // name of type in database
OUString aLiteralPrefix; // prefix for quoting
OUString aLiteralSuffix; // suffix for quoting
OUString aCreateParams; // parameter for creation
OUString aLocalTypeName;
......
......@@ -221,11 +221,9 @@ ODatabaseExport::ODatabaseExport(const SharedConnection& _rxConnection,
aValue.fill(nPos,aTypes[nPos],aNullable[nPos],xRow);
m_pTypeInfo->nPrecision = aValue;
++nPos;
aValue.fill(nPos,aTypes[nPos],aNullable[nPos],xRow);
m_pTypeInfo->aLiteralPrefix = aValue;
aValue.fill(nPos,aTypes[nPos],aNullable[nPos],xRow); //LiteralPrefix
++nPos;
aValue.fill(nPos,aTypes[nPos],aNullable[nPos],xRow);
m_pTypeInfo->aLiteralSuffix = aValue;
aValue.fill(nPos,aTypes[nPos],aNullable[nPos],xRow); //LiteralSuffix
++nPos;
aValue.fill(nPos,aTypes[nPos],aNullable[nPos],xRow);
m_pTypeInfo->aCreateParams = aValue;
......@@ -781,7 +779,6 @@ void ODatabaseExport::eraseTokens()
{
m_sTextToken.clear();
m_sNumToken.clear();
m_sValToken.clear();
}
void ODatabaseExport::ensureFormatter()
......
......@@ -286,9 +286,6 @@ void OHTMLReader::fetchOptions()
{
switch( rOption.GetToken() )
{
case HtmlOptionId::SDVAL:
m_sValToken = rOption.GetString();
break;
case HtmlOptionId::SDNUM:
m_sNumToken = rOption.GetString();
break;
......
......@@ -108,14 +108,6 @@ ODatabaseImportExport::ODatabaseImportExport( const ::dbtools::SharedConnection&
,m_bCheckOnly(false)
{
m_eDestEnc = osl_getThreadTextEncoding();
try
{
SvtSysLocale aSysLocale;
m_aLocale = aSysLocale.GetLanguageTag().getLocale();
}
catch(Exception&)
{
}
}
ODatabaseImportExport::~ODatabaseImportExport()
......@@ -211,15 +203,6 @@ void ODatabaseImportExport::impl_initFromDescriptor( const ODataAccessDescriptor
}
else
initialize();
try
{
SvtSysLocale aSysLocale;
m_aLocale = aSysLocale.GetLanguageTag().getLocale();
}
catch(Exception&)
{
}
}
void ODatabaseImportExport::initialize()
......
......@@ -460,11 +460,9 @@ void fillTypeInfo( const Reference< css::sdbc::XConnection>& _rxConnection,
aValue.fill(nPos,aTypes[nPos],aNullable[nPos],xRow);
pInfo->nPrecision = aValue;
++nPos;
aValue.fill(nPos,aTypes[nPos],aNullable[nPos],xRow);
pInfo->aLiteralPrefix = aValue;
aValue.fill(nPos,aTypes[nPos],aNullable[nPos],xRow); // LiteralPrefix
++nPos;
aValue.fill(nPos,aTypes[nPos],aNullable[nPos],xRow);
pInfo->aLiteralSuffix = aValue;
aValue.fill(nPos,aTypes[nPos],aNullable[nPos],xRow); //LiteralSuffix
++nPos;
aValue.fill(nPos,aTypes[nPos],aNullable[nPos],xRow);
pInfo->aCreateParams = aValue;
......
......@@ -56,8 +56,7 @@ OFieldDescription::OFieldDescription()
}
OFieldDescription::OFieldDescription( const OFieldDescription& rDescr )
:m_aDefaultValue(rDescr.m_aDefaultValue)
,m_aControlDefault(rDescr.m_aControlDefault)
:m_aControlDefault(rDescr.m_aControlDefault)
,m_aWidth(rDescr.m_aWidth)
,m_aRelativePosition(rDescr.m_aRelativePosition)
,m_pType(rDescr.m_pType)
......@@ -287,8 +286,6 @@ void OFieldDescription::SetDefaultValue(const Any& _rDefaultValue)
{
if ( m_xDest.is() && m_xDestInfo->hasPropertyByName(PROPERTY_DEFAULTVALUE) )
m_xDest->setPropertyValue(PROPERTY_DEFAULTVALUE, _rDefaultValue);
else
m_aDefaultValue = _rDefaultValue;
}
catch( const Exception& )
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment