extensions/source/abpilot/datasourcehandling.cxx                               
               |    4 -
 extensions/source/bibliography/datman.cxx                                      
               |    2 
 extensions/source/bibliography/general.cxx                                     
               |    3 -
 extensions/source/dbpilots/commonpagesdbp.cxx                                  
               |    4 -
 extensions/source/dbpilots/controlwizard.cxx                                   
               |    2 
 extensions/source/dbpilots/optiongrouplayouter.cxx                             
               |    2 
 extensions/source/propctrlr/formlinkdialog.cxx                                 
               |   28 ++++------
 extensions/source/propctrlr/propcontroller.cxx                                 
               |   10 +--
 extensions/source/propctrlr/xsddatatypes.cxx                                   
               |    4 -
 extensions/source/propctrlr/xsdvalidationhelper.cxx                            
               |    6 +-
 scripting/java/com/sun/star/script/framework/container/ScriptMetaData.java     
               |    9 +++
 
scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptEditorForBeanShell.java
 |    2 
 12 files changed, 39 insertions(+), 37 deletions(-)

New commits:
commit 1223bede826d9b237a6015bfcfb8df08913a02e8
Author:     Andreas Heinisch <andreas.heini...@yahoo.de>
AuthorDate: Thu Jul 18 17:07:58 2019 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Fri Jul 19 18:30:06 2019 +0200

    tdf#123587 Beanshell editor: Show current file name as window title
    
    Change-Id: I7a817d19cfadc46b1f35a4e42e5a6177c1910a4b
    Reviewed-on: https://gerrit.libreoffice.org/75869
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git 
a/scripting/java/com/sun/star/script/framework/container/ScriptMetaData.java 
b/scripting/java/com/sun/star/script/framework/container/ScriptMetaData.java
index 6341b51d4e4a..de51b1247af5 100644
--- a/scripting/java/com/sun/star/script/framework/container/ScriptMetaData.java
+++ b/scripting/java/com/sun/star/script/framework/container/ScriptMetaData.java
@@ -102,6 +102,15 @@ public class ScriptMetaData extends ScriptEntry {
 
     private static final String UNO_SHARED_PACKAGES2 = SHARE + "/uno_packages";
 
+    public static String getFileName(URL url) {
+        String fileName = url.toExternalForm();
+        if (fileName.lastIndexOf(UCBStreamHandler.separator) != -1) {
+            fileName = fileName.substring(0, 
fileName.lastIndexOf(UCBStreamHandler.separator));
+            fileName = fileName.substring(fileName.lastIndexOf("/") + 1);
+        }
+        return fileName;
+    }
+
     public static String getLocationPlaceHolder(String url, String pkgname) {
         String result = "Unknown";
 
diff --git 
a/scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptEditorForBeanShell.java
 
b/scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptEditorForBeanShell.java
index 279e75fb3584..9ba128b42669 100644
--- 
a/scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptEditorForBeanShell.java
+++ 
b/scripting/java/com/sun/star/script/framework/provider/beanshell/ScriptEditorForBeanShell.java
@@ -228,7 +228,7 @@ public class ScriptEditorForBeanShell implements 
ScriptEditor, ActionListener {
         this.context   = context;
         this.scriptURL = url;
         this.model     = new ScriptSourceModel(url);
-        this.filename  = url.getFile();
+        this.filename  = ScriptMetaData.getFileName(url);
         this.cl = cl;
 
         try {
commit 8c26800ff823525df46d2bdc42af52ab75285cda
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Fri Jul 19 15:31:54 2019 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Fri Jul 19 18:29:48 2019 +0200

    loplugin:referencecasting in extensions
    
    Change-Id: Ib03be019b2fedc67b3114c107162722eabce0218
    Reviewed-on: https://gerrit.libreoffice.org/75955
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/extensions/source/abpilot/datasourcehandling.cxx 
b/extensions/source/abpilot/datasourcehandling.cxx
index 8371d97b61b0..fdcf218f4826 100644
--- a/extensions/source/abpilot/datasourcehandling.cxx
+++ b/extensions/source/abpilot/datasourcehandling.cxx
@@ -521,9 +521,7 @@ namespace abp
         Reference< XInteractionHandler > xInteractions;
         try
         {
-            xInteractions.set(
-                InteractionHandler::createWithParent(m_pImpl->xORB, nullptr),
-                UNO_QUERY);
+            xInteractions = 
InteractionHandler::createWithParent(m_pImpl->xORB, nullptr);
         }
         catch(const Exception&)
         {
diff --git a/extensions/source/bibliography/datman.cxx 
b/extensions/source/bibliography/datman.cxx
index 0345049a9238..aaaff07f1b6e 100644
--- a/extensions/source/bibliography/datman.cxx
+++ b/extensions/source/bibliography/datman.cxx
@@ -901,7 +901,7 @@ void BibDataManager::setActiveDataSource(const OUString& 
rURL)
             aPropertySet->setPropertyValue("FetchSize", aVal);
             OUString aString("SELECT * FROM ");
             // quote the table name which may contain catalog.schema.table
-            Reference<XDatabaseMetaData> 
xMetaData(xConnection->getMetaData(),UNO_QUERY);
+            Reference<XDatabaseMetaData> xMetaData = 
xConnection->getMetaData();
             aQuoteChar = xMetaData->getIdentifierQuoteString();
 
             OUString sCatalog, sSchema, sName;
diff --git a/extensions/source/bibliography/general.cxx 
b/extensions/source/bibliography/general.cxx
index de447c4a59f0..11163a1227be 100644
--- a/extensions/source/bibliography/general.cxx
+++ b/extensions/source/bibliography/general.cxx
@@ -398,8 +398,7 @@ void BibGeneralPage::RemoveListeners()
     {
         if(aControl.is())
         {
-            uno::Reference< awt::XWindow > xCtrWin(aControl, uno::UNO_QUERY );
-            xCtrWin->removeFocusListener( mxBibGeneralPageFocusListener.get() 
);
+            aControl->removeFocusListener( mxBibGeneralPageFocusListener.get() 
);
             aControl = nullptr;
         }
     }
diff --git a/extensions/source/dbpilots/commonpagesdbp.cxx 
b/extensions/source/dbpilots/commonpagesdbp.cxx
index 760999d6e3f0..92d441902de8 100644
--- a/extensions/source/dbpilots/commonpagesdbp.cxx
+++ b/extensions/source/dbpilots/commonpagesdbp.cxx
@@ -324,7 +324,7 @@ namespace dbp
                 Reference< XTablesSupplier > xSupplTables(xConn, UNO_QUERY);
                 if ( xSupplTables.is() )
                 {
-                    Reference< XNameAccess > 
xTables(xSupplTables->getTables(), UNO_QUERY);
+                    Reference< XNameAccess > xTables = 
xSupplTables->getTables();
                     if (xTables.is())
                         aTableNames = xTables->getElementNames();
                 }
@@ -333,7 +333,7 @@ namespace dbp
                 Reference< XQueriesSupplier > xSuppQueries( xConn, UNO_QUERY );
                 if ( xSuppQueries.is() )
                 {
-                    Reference< XNameAccess > xQueries( 
xSuppQueries->getQueries(), UNO_QUERY );
+                    Reference< XNameAccess > xQueries = 
xSuppQueries->getQueries();
                     if ( xQueries.is() )
                         aQueryNames = xQueries->getElementNames();
                 }
diff --git a/extensions/source/dbpilots/controlwizard.cxx 
b/extensions/source/dbpilots/controlwizard.cxx
index 1e8494f73f13..9852fe1d9bc2 100644
--- a/extensions/source/dbpilots/controlwizard.cxx
+++ b/extensions/source/dbpilots/controlwizard.cxx
@@ -281,7 +281,7 @@ namespace dbp
 
     void OControlWizard::implDetermineShape()
     {
-        Reference< XIndexAccess > xPageObjects(m_aContext.xDrawPage, 
UNO_QUERY);
+        Reference< XIndexAccess > xPageObjects = m_aContext.xDrawPage;
         DBG_ASSERT(xPageObjects.is(), "OControlWizard::implDetermineShape: 
invalid page!");
 
         // for comparing the model
diff --git a/extensions/source/dbpilots/optiongrouplayouter.cxx 
b/extensions/source/dbpilots/optiongrouplayouter.cxx
index b05fe7d377cb..9b72a92f6938 100644
--- a/extensions/source/dbpilots/optiongrouplayouter.cxx
+++ b/extensions/source/dbpilots/optiongrouplayouter.cxx
@@ -59,7 +59,7 @@ namespace dbp
 
     void OOptionGroupLayouter::doLayout(const OControlWizardContext& 
_rContext, const OOptionGroupSettings& _rSettings)
     {
-        Reference< XShapes > xPageShapes(_rContext.xDrawPage, UNO_QUERY);
+        Reference< XShapes > xPageShapes = _rContext.xDrawPage;
         if (!xPageShapes.is())
         {
             OSL_FAIL("OOptionGroupLayouter::OOptionGroupLayouter: missing the 
XShapes interface for the page!");
diff --git a/extensions/source/propctrlr/formlinkdialog.cxx 
b/extensions/source/propctrlr/formlinkdialog.cxx
index 72d7de9fd4c4..4928562c793a 100644
--- a/extensions/source/propctrlr/formlinkdialog.cxx
+++ b/extensions/source/propctrlr/formlinkdialog.cxx
@@ -209,11 +209,10 @@ namespace pcr
         // and set as property values
         try
         {
-            Reference< XPropertySet > xDetailFormProps( m_xDetailForm, 
UNO_QUERY );
-            if ( xDetailFormProps.is() )
+            if ( m_xDetailForm.is() )
             {
-                xDetailFormProps->setPropertyValue( PROPERTY_DETAILFIELDS, 
makeAny( Sequence< OUString >( aDetailFields.data(), aDetailFields.size() ) ) );
-                xDetailFormProps->setPropertyValue( PROPERTY_MASTERFIELDS, 
makeAny( Sequence< OUString >( aMasterFields.data(), aMasterFields.size() ) ) );
+                m_xDetailForm->setPropertyValue( PROPERTY_DETAILFIELDS, 
makeAny( Sequence< OUString >( aDetailFields.data(), aDetailFields.size() ) ) );
+                m_xDetailForm->setPropertyValue( PROPERTY_MASTERFIELDS, 
makeAny( Sequence< OUString >( aMasterFields.data(), aMasterFields.size() ) ) );
             }
         }
         catch( const Exception& )
@@ -303,11 +302,10 @@ namespace pcr
             Sequence< OUString > aDetailFields;
             Sequence< OUString > aMasterFields;
 
-            Reference< XPropertySet > xDetailFormProps( m_xDetailForm, 
UNO_QUERY );
-            if ( xDetailFormProps.is() )
+            if ( m_xDetailForm.is() )
             {
-                xDetailFormProps->getPropertyValue( PROPERTY_DETAILFIELDS ) 
>>= aDetailFields;
-                xDetailFormProps->getPropertyValue( PROPERTY_MASTERFIELDS ) 
>>= aMasterFields;
+                m_xDetailForm->getPropertyValue( PROPERTY_DETAILFIELDS ) >>= 
aDetailFields;
+                m_xDetailForm->getPropertyValue( PROPERTY_MASTERFIELDS ) >>= 
aMasterFields;
             }
 
             std::vector< OUString > aDetailFields1;
@@ -543,24 +541,22 @@ namespace pcr
 
     void FormLinkDialog::initializeSuggest()
     {
-        Reference< XPropertySet > xDetailFormProps( m_xDetailForm, UNO_QUERY );
-        Reference< XPropertySet > xMasterFormProps( m_xMasterForm, UNO_QUERY );
-        if ( !xDetailFormProps.is() || !xMasterFormProps.is() )
+        if ( !m_xDetailForm.is() || !m_xMasterForm.is() )
             return;
 
         try
         {
             // only show the button when both forms are based on the same data 
source
             OUString sMasterDS, sDetailDS;
-            xMasterFormProps->getPropertyValue( PROPERTY_DATASOURCE ) >>= 
sMasterDS;
-            xDetailFormProps->getPropertyValue( PROPERTY_DATASOURCE ) >>= 
sDetailDS;
+            m_xMasterForm->getPropertyValue( PROPERTY_DATASOURCE ) >>= 
sMasterDS;
+            m_xDetailForm->getPropertyValue( PROPERTY_DATASOURCE ) >>= 
sDetailDS;
             bool bEnable = ( sMasterDS == sDetailDS );
 
             // only show the button when the connection supports relations
             if ( bEnable )
             {
                 Reference< XDatabaseMetaData > xMeta;
-                getConnectionMetaData( xDetailFormProps, xMeta );
+                getConnectionMetaData( m_xDetailForm, xMeta );
                 OSL_ENSURE( xMeta.is(), "FormLinkDialog::initializeSuggest: 
unable to retrieve the meta data for the connection!" );
                 try
                 {
@@ -576,8 +572,8 @@ namespace pcr
             Reference< XPropertySet > xDetailTable, xMasterTable;
             if ( bEnable )
             {
-                xDetailTable = getCanonicUnderlyingTable( xDetailFormProps );
-                xMasterTable = getCanonicUnderlyingTable( xMasterFormProps );
+                xDetailTable = getCanonicUnderlyingTable( m_xDetailForm );
+                xMasterTable = getCanonicUnderlyingTable( m_xMasterForm );
                 bEnable = xDetailTable.is() && xMasterTable.is();
             }
 
diff --git a/extensions/source/propctrlr/propcontroller.cxx 
b/extensions/source/propctrlr/propcontroller.cxx
index 238eaf937f3b..50cd32f0d12b 100644
--- a/extensions/source/propctrlr/propcontroller.cxx
+++ b/extensions/source/propctrlr/propcontroller.cxx
@@ -510,9 +510,8 @@ namespace pcr
         // don't delete explicitly (this is done by the frame we reside in)
         m_pView = nullptr;
 
-        Reference< XComponent > xViewAsComp( m_xView, UNO_QUERY );
-        if ( xViewAsComp.is() )
-            xViewAsComp->removeEventListener( static_cast< 
XPropertyChangeListener* >( this ) );
+        if ( m_xView.is() )
+            m_xView->removeEventListener( static_cast< 
XPropertyChangeListener* >( this ) );
         m_xView.clear( );
 
         m_aInspectedObjects.clear();
@@ -672,9 +671,8 @@ namespace pcr
         // and this disposal _deletes_ the view, so it would be deadly if we 
use our m_pView member
         // after that
         m_xView = VCLUnoHelper::GetInterface(m_pView);
-        Reference< XComponent > xViewAsComp(m_xView, UNO_QUERY);
-        if (xViewAsComp.is())
-            xViewAsComp->addEventListener( static_cast< 
XPropertyChangeListener* >( this ) );
+        if (m_xView.is())
+            m_xView->addEventListener( static_cast< XPropertyChangeListener* 
>( this ) );
 
         getPropertyBox().SetLineListener(this);
         getPropertyBox().SetControlObserver(this);
diff --git a/extensions/source/propctrlr/xsddatatypes.cxx 
b/extensions/source/propctrlr/xsddatatypes.cxx
index 9403117e685f..7a0fb3ac718a 100644
--- a/extensions/source/propctrlr/xsddatatypes.cxx
+++ b/extensions/source/propctrlr/xsddatatypes.cxx
@@ -168,8 +168,8 @@ namespace pcr
 
         try
         {
-            Reference< XPropertySet > xSource( _pSourceType->getUnoDataType(), 
UNO_QUERY );
-            Reference< XPropertySet > xDest( getUnoDataType(), UNO_QUERY );
+            Reference< XPropertySet > xSource = _pSourceType->getUnoDataType();
+            Reference< XPropertySet > xDest = getUnoDataType();
             lcl_copyProperties( xSource, xDest );
         }
         catch( const Exception& )
diff --git a/extensions/source/propctrlr/xsdvalidationhelper.cxx 
b/extensions/source/propctrlr/xsdvalidationhelper.cxx
index 52c6378d6e09..5f34cad5415b 100644
--- a/extensions/source/propctrlr/xsdvalidationhelper.cxx
+++ b/extensions/source/propctrlr/xsdvalidationhelper.cxx
@@ -250,13 +250,15 @@ namespace pcr
                 OUString sOldDataTypeName;
                 OSL_VERIFY( xBinding->getPropertyValue( PROPERTY_XSD_DATA_TYPE 
) >>= sOldDataTypeName );
                 Reference< XPropertySet > xOldType;
-                try { xOldType.set(getDataType( sOldDataTypeName ), 
css::uno::UNO_QUERY); } catch( const Exception& ) { }
+                try {
+                    xOldType = getDataType( sOldDataTypeName );
+                } catch( const Exception& ) { }
 
                 // set the new data type name
                 xBinding->setPropertyValue( PROPERTY_XSD_DATA_TYPE, makeAny( 
_rName ) );
 
                 // retrieve the new data type object
-                Reference< XPropertySet > xNewType( getDataType( _rName ), 
UNO_QUERY );
+                Reference< XPropertySet > xNewType = getDataType( _rName );
 
                 // fire any changes in the properties which result from this 
new type
                 std::set< OUString > aFilter; aFilter.insert( PROPERTY_NAME );
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to