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

loplugin:unusedfields in extensions

Change-Id: I9d23d64f67f3f4490cbcddd1cd07ab267d5e3e95
Reviewed-on: https://gerrit.libreoffice.org/68229
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst cd383000
......@@ -291,11 +291,8 @@
#define RID_UPDATE_STR_DOWNLOAD_UNAVAIL NC_("RID_UPDATE_STR_DOWNLOAD_UNAVAIL", "The automatic download of the update is currently not available.\n\nClick 'Download...' to download %PRODUCTNAME %NEXTVERSION manually from the web site.")
#define RID_UPDATE_STR_DOWNLOADING NC_("RID_UPDATE_STR_DOWNLOADING", "Downloading %PRODUCTNAME %NEXTVERSION...")
#define RID_UPDATE_STR_READY_INSTALL NC_("RID_UPDATE_STR_READY_INSTALL", "Download of %PRODUCTNAME %NEXTVERSION completed. Ready for installation.")
#define RID_UPDATE_STR_CANCEL_TITLE NC_("RID_UPDATE_STR_CANCEL_TITLE", "%PRODUCTNAME %PRODUCTVERSION")
#define RID_UPDATE_STR_CANCEL_DOWNLOAD NC_("RID_UPDATE_STR_CANCEL_DOWNLOAD", "Do you really want to cancel the download?")
#define RID_UPDATE_STR_BEGIN_INSTALL NC_("RID_UPDATE_STR_BEGIN_INSTALL", "To install the update, %PRODUCTNAME %PRODUCTVERSION needs to be closed. Do you want to install the update now?")
#define RID_UPDATE_STR_INSTALL_NOW NC_("RID_UPDATE_STR_INSTALL_NOW", "Install ~now")
#define RID_UPDATE_STR_INSTALL_LATER NC_("RID_UPDATE_STR_INSTALL_LATER", "Install ~later")
#define RID_UPDATE_STR_INSTALL_ERROR NC_("RID_UPDATE_STR_INSTALL_ERROR", "Could not run the installer application, please run %FILE_NAME in %DOWNLOAD_PATH manually.")
#define RID_UPDATE_STR_OVERWRITE_WARNING NC_("RID_UPDATE_STR_OVERWRITE_WARNING", "A file with that name already exists! Do you want to overwrite the existing file?")
#define RID_UPDATE_STR_RELOAD_WARNING NC_("RID_UPDATE_STR_RELOAD_WARNING", "A file with the name '%FILENAME' already exists in '%DOWNLOAD_PATH'! Do you want to continue with the download or delete and reload the file?")
......
......@@ -114,7 +114,6 @@ namespace bib
pGeneralPage->RemoveListeners();
pGeneralPage.disposeAndClear();
m_xGeneralPage = nullptr;
BibWindow::dispose();
}
......@@ -128,11 +127,9 @@ namespace bib
m_pGeneralPage->Hide();
m_pGeneralPage->RemoveListeners();
m_pGeneralPage.disposeAndClear();
m_xGeneralPage = nullptr;
}
m_pGeneralPage = VclPtr<BibGeneralPage>::Create( this, m_pDatMan );
m_xGeneralPage = m_pGeneralPage->GetFocusListener().get();
m_pGeneralPage->Show();
if( HasFocus() )
......
......@@ -58,7 +58,6 @@ namespace bib
private:
BibDataManager* m_pDatMan;
css::uno::Reference< css::form::XLoadable> m_xDatMan;
css::uno::Reference< css::awt::XFocusListener> m_xGeneralPage;
VclPtr<BibGeneralPage> m_pGeneralPage;
BibViewFormControlContainer m_aFormControlContainer;
......
......@@ -571,7 +571,6 @@ void SAL_CALL BibInterceptorHelper::setMasterDispatchProvider( const css::uno::R
}
#define STR_UID "uid"
OUString const gGridName("theGrid");
OUString const gViewName("theView");
OUString const gGlobalName("theGlobals");
......@@ -596,7 +595,6 @@ BibDataManager::~BibDataManager()
{
Reference< XComponent > xConnection;
xPrSet->getPropertyValue("ActiveConnection") >>= xConnection;
RemoveMeAsUidListener();
if (xLoad.is())
xLoad->unload();
if (xComp.is())
......@@ -1068,7 +1066,6 @@ void SAL_CALL BibDataManager::load( )
if ( xFormAsLoadable.is() )
{
xFormAsLoadable->load();
SetMeAsUidListener();
EventObject aEvt( static_cast< XWeak* >( this ) );
m_aLoadListeners.notifyEach( &XLoadListener::loaded, aEvt );
......@@ -1092,7 +1089,6 @@ void SAL_CALL BibDataManager::unload( )
m_aLoadListeners.notifyEach( &XLoadListener::unloading, aEvt );
}
RemoveMeAsUidListener();
xFormAsLoadable->unload();
{
......@@ -1357,106 +1353,6 @@ Reference< awt::XControlModel > BibDataManager::loadControlModel(
return xModel;
}
void BibDataManager::disposing( const EventObject& /*Source*/ )
{
// not interested in
}
void BibDataManager::propertyChange(const beans::PropertyChangeEvent& evt)
{
try
{
if(evt.PropertyName == FM_PROP_VALUE)
{
if( evt.NewValue.getValueType() == cppu::UnoType<io::XInputStream>::get())
{
Reference< io::XDataInputStream > xStream(
evt.NewValue, UNO_QUERY );
aUID <<= xStream->readUTF();
}
else
aUID = evt.NewValue;
}
}
catch (const Exception&)
{
OSL_FAIL("::propertyChange: something went wrong !");
}
}
void BibDataManager::SetMeAsUidListener()
{
try
{
Reference< XNameAccess > xFields = getColumns( m_xForm );
if (!xFields.is())
return;
OUString theFieldName;
for( const OUString& rName : xFields->getElementNames() )
{
if (rName.equalsIgnoreAsciiCase(STR_UID))
{
theFieldName=rName;
break;
}
}
if(!theFieldName.isEmpty())
{
Any aElement;
aElement = xFields->getByName(theFieldName);
auto xPropSet = o3tl::doAccess<Reference<XPropertySet>>(aElement);
(*xPropSet)->addPropertyChangeListener(FM_PROP_VALUE, this);
}
}
catch (const Exception&)
{
OSL_FAIL("Exception in BibDataManager::SetMeAsUidListener");
}
}
void BibDataManager::RemoveMeAsUidListener()
{
try
{
Reference< XNameAccess > xFields = getColumns( m_xForm );
if (!xFields.is())
return;
OUString theFieldName;
for(const OUString& rName : xFields->getElementNames() )
{
if (rName.equalsIgnoreAsciiCase(STR_UID))
{
theFieldName=rName;
break;
}
}
if(!theFieldName.isEmpty())
{
Any aElement;
aElement = xFields->getByName(theFieldName);
auto xPropSet = o3tl::doAccess<Reference<XPropertySet>>(aElement);
(*xPropSet)->removePropertyChangeListener(FM_PROP_VALUE, this);
}
}
catch (const Exception&)
{
OSL_FAIL("Exception in BibDataManager::RemoveMeAsUidListener");
}
}
void BibDataManager::CreateMappingDialog(vcl::Window* pParent)
{
VclPtrInstance< MappingDialog_Impl > pDlg(pParent, this);
......
......@@ -73,8 +73,7 @@ public:
virtual void SAL_CALL setMasterDispatchProvider( const css::uno::Reference< css::frame::XDispatchProvider >& xNewMasterDispatchProvider ) override;
};
typedef cppu::WeakComponentImplHelper < css::beans::XPropertyChangeListener
, css::form::XLoadable
typedef cppu::WeakComponentImplHelper < css::form::XLoadable
> BibDataManager_Base;
class BibDataManager final
:public ::comphelper::OMutexAndBroadcastHelper
......@@ -91,7 +90,6 @@ private:
OUString aActiveDataTable;
OUString aDataSourceURL;
OUString aQuoteChar;
css::uno::Any aUID;
::comphelper::OInterfaceContainerHelper2 m_aLoadListeners;
......@@ -101,8 +99,6 @@ private:
OUString sIdentifierMapping;
void InsertFields(const css::uno::Reference< css::form::XFormComponent > & xGrid);
void SetMeAsUidListener();
void RemoveMeAsUidListener();
css::uno::Reference< css::awt::XControlModel > const &
updateGridModel(const css::uno::Reference< css::form::XForm > & xDbForm);
......@@ -124,10 +120,6 @@ public:
BibDataManager();
virtual ~BibDataManager() override;
virtual void SAL_CALL propertyChange(const css::beans::PropertyChangeEvent& evt) override;
virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override;
css::uno::Reference< css::form::XForm > createDatabaseForm( BibDBDescriptor& aDesc);
css::uno::Reference< css::awt::XControlModel > updateGridModel();
......
......@@ -628,11 +628,8 @@ void UpdateHandler::loadStrings()
msDownloadNotAvail = loadString( loc, RID_UPDATE_STR_DOWNLOAD_UNAVAIL );
msDownloading = loadString( loc, RID_UPDATE_STR_DOWNLOADING );
msReady2Install = loadString( loc, RID_UPDATE_STR_READY_INSTALL );
msCancelTitle = loadString( loc, RID_UPDATE_STR_CANCEL_TITLE );
msCancelMessage = loadString( loc, RID_UPDATE_STR_CANCEL_DOWNLOAD );
msInstallMessage = loadString( loc, RID_UPDATE_STR_BEGIN_INSTALL );
msInstallNow = loadString( loc, RID_UPDATE_STR_INSTALL_NOW );
msInstallLater = loadString( loc, RID_UPDATE_STR_INSTALL_LATER );
msInstallError = loadString( loc, RID_UPDATE_STR_INSTALL_ERROR );
msOverwriteWarning = loadString( loc, RID_UPDATE_STR_OVERWRITE_WARNING );
msPercent = loadString( loc, RID_UPDATE_STR_PERCENT );
......
......@@ -105,11 +105,8 @@ private:
OUString msDownloadNotAvail; // RID_UPDATE_STR_DOWNLOAD_UNAVAIL
OUString msDownloading; // RID_UPDATE_STR_DOWNLOADING
OUString msReady2Install; // RID_UPDATE_STR_READY_INSTALL
OUString msCancelTitle; // RID_UPDATE_STR_CANCEL_TITLE
OUString msCancelMessage; // RID_UPDATE_STR_CANCEL_DOWNLOAD
OUString msInstallMessage; // RID_UPDATE_STR_BEGIN_INSTALL
OUString msInstallNow; // RID_UPDATE_STR_INSTALL_NOW
OUString msInstallLater; // RID_UPDATE_STR_INSTALL_LATER
OUString msInstallError; // RID_UPDATE_STR_INSTALL_ERROR
OUString msOverwriteWarning; // RID_UPDATE_STR_OVERWRITE_WARNING
OUString msPercent; // RID_UPDATE_STR_PERCENT
......
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