include/svtools/ServerDetailsControls.hxx | 4 ++ svtools/source/contnr/fileview.cxx | 5 ++- svtools/source/contnr/foldertree.cxx | 5 ++- svtools/source/dialogs/PlaceEditDialog.cxx | 2 - svtools/source/dialogs/ServerDetailsControls.cxx | 10 ++++--- svtools/source/dialogs/addresstemplate.cxx | 2 - ucb/source/ucp/cmis/auth_provider.cxx | 14 ++++++++-- ucb/source/ucp/cmis/auth_provider.hxx | 7 ++--- vcl/source/window/splitwin.cxx | 4 ++ vcl/unx/generic/app/randrwrapper.cxx | 3 -- vcl/unx/generic/app/saldisp.cxx | 2 - vcl/unx/generic/fontmanager/fontconfig.cxx | 4 +- xmloff/source/forms/elementexport.cxx | 13 +++++---- xmloff/source/text/XMLIndexBibliographyConfigurationContext.cxx | 7 ++--- 14 files changed, 51 insertions(+), 31 deletions(-)
New commits: commit 7417311fc0f888223ae05f1cfc750de1735c5c9e Author: Caolán McNamara <caol...@redhat.com> Date: Thu May 26 15:24:54 2016 +0100 Resolves: tdf#96279 set correct parents for password dialogs otherwise on Dialog::Execute before it becomes visible and a password dialog is needed the new dialog will automatically look for a parent, but will be parented by the main window because the dialog it should be a parent of is not visible yet. Change-Id: Ia34e43d7ef2b204b348f2eb5aab542ee8ffe840e diff --git a/include/svtools/ServerDetailsControls.hxx b/include/svtools/ServerDetailsControls.hxx index 181c756..b6ceaa2 100644 --- a/include/svtools/ServerDetailsControls.hxx +++ b/include/svtools/ServerDetailsControls.hxx @@ -18,6 +18,7 @@ #include <tools/urlobj.hxx> #include <vcl/builder.hxx> #include <vcl/button.hxx> +#include <vcl/dialog.hxx> #include <vcl/edit.hxx> #include <vcl/field.hxx> #include <vcl/fixed.hxx> @@ -136,9 +137,10 @@ class CmisDetailsContainer : public DetailsContainer VclPtr<FixedText> m_pFTRepository; VclPtr<ListBox> m_pLBRepository; VclPtr<Button> m_pBTRepoRefresh; + css::uno::Reference< css::awt::XWindow > m_xParentDialog; public: - CmisDetailsContainer( VclBuilderContainer* pBuilder, OUString const & sBinding ); + CmisDetailsContainer(VclBuilderContainer* pBuilder, Dialog* pParentDialog, OUString const & sBinding); virtual ~CmisDetailsContainer( ) { }; virtual void show( bool bShow = true ) override; diff --git a/svtools/source/contnr/fileview.cxx b/svtools/source/contnr/fileview.cxx index 13bf306..7ccefa5 100644 --- a/svtools/source/contnr/fileview.cxx +++ b/svtools/source/contnr/fileview.cxx @@ -29,6 +29,7 @@ #include <svtools/svtabbx.hxx> #include <svtools/svtools.hrc> #include <svtools/viewdataentry.hxx> +#include <toolkit/helper/vclunohelper.hxx> #include "fileview.hrc" #include "contentenumeration.hxx" #include <svtools/AccessibleBrowseBoxObjType.hxx> @@ -533,7 +534,7 @@ ViewTabListBox_Impl::ViewTabListBox_Impl( vcl::Window* pParentWin, Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext(); Reference< XInteractionHandler > xInteractionHandler( - InteractionHandler::createWithParent(xContext, nullptr), UNO_QUERY_THROW ); + InteractionHandler::createWithParent(xContext, VCLUnoHelper::GetInterface(GetParentDialog())), UNO_QUERY_THROW ); mxCmdEnv = new ::ucbhelper::CommandEnvironment( xInteractionHandler, Reference< XProgressHandler >() ); @@ -977,7 +978,7 @@ SvtFileView::SvtFileView( vcl::Window* pParent, WinBits nBits, Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext(); Reference< XInteractionHandler > xInteractionHandler( - InteractionHandler::createWithParent(xContext, nullptr), UNO_QUERY_THROW ); + InteractionHandler::createWithParent(xContext, VCLUnoHelper::GetInterface(GetParentDialog())), UNO_QUERY_THROW ); Reference < XCommandEnvironment > xCmdEnv = new ::ucbhelper::CommandEnvironment( xInteractionHandler, Reference< XProgressHandler >() ); mpImpl.reset( new SvtFileView_Impl( this, xCmdEnv, nFlags, bOnlyFolder ) ); diff --git a/svtools/source/contnr/foldertree.cxx b/svtools/source/contnr/foldertree.cxx index 40ed9d5..086ba62 100644 --- a/svtools/source/contnr/foldertree.cxx +++ b/svtools/source/contnr/foldertree.cxx @@ -8,7 +8,8 @@ */ #include <svtools/foldertree.hxx> - +#include <toolkit/helper/vclunohelper.hxx> +#include <vcl/dialog.hxx> #include "contentenumeration.hxx" FolderTree::FolderTree( vcl::Window* pParent, WinBits nBits ) @@ -18,7 +19,7 @@ FolderTree::FolderTree( vcl::Window* pParent, WinBits nBits ) { Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext(); Reference< XInteractionHandler > xInteractionHandler( - InteractionHandler::createWithParent( xContext, nullptr ), UNO_QUERY_THROW ); + InteractionHandler::createWithParent(xContext, VCLUnoHelper::GetInterface(GetParentDialog())), UNO_QUERY_THROW ); m_xEnv = new ::ucbhelper::CommandEnvironment( xInteractionHandler, Reference< XProgressHandler >() ); SetDefaultCollapsedEntryBmp( m_aFolderImage ); diff --git a/svtools/source/dialogs/PlaceEditDialog.cxx b/svtools/source/dialogs/PlaceEditDialog.cxx index 137cec3..c054380 100644 --- a/svtools/source/dialogs/PlaceEditDialog.cxx +++ b/svtools/source/dialogs/PlaceEditDialog.cxx @@ -184,7 +184,7 @@ void PlaceEditDialog::InitDetails( ) nPos = m_pLBServerType->InsertEntry( aTypesNamesList[i], nPos ); - std::shared_ptr<DetailsContainer> xCmisDetails(std::make_shared<CmisDetailsContainer>(this, sUrl)); + std::shared_ptr<DetailsContainer> xCmisDetails(std::make_shared<CmisDetailsContainer>(this, this, sUrl)); xCmisDetails->setChangeHdl( LINK( this, PlaceEditDialog, EditHdl ) ); m_aDetailsContainers.push_back(xCmisDetails); diff --git a/svtools/source/dialogs/ServerDetailsControls.cxx b/svtools/source/dialogs/ServerDetailsControls.cxx index be071d5..2fc608b 100644 --- a/svtools/source/dialogs/ServerDetailsControls.cxx +++ b/svtools/source/dialogs/ServerDetailsControls.cxx @@ -19,6 +19,7 @@ #include <rtl/uri.hxx> #include <ucbhelper/content.hxx> #include <ucbhelper/commandenvironment.hxx> +#include <toolkit/helper/vclunohelper.hxx> #include <svtools/PlaceEditDialog.hxx> #include <svtools/ServerDetailsControls.hxx> @@ -271,17 +272,18 @@ void SmbDetailsContainer::show( bool bShow ) m_pFTPort->Enable( !bShow ); } -CmisDetailsContainer::CmisDetailsContainer( VclBuilderContainer* pBuilder, OUString const & sBinding ) : +CmisDetailsContainer::CmisDetailsContainer(VclBuilderContainer* pBuilder, Dialog* pParentDialog, OUString const & sBinding) : DetailsContainer( pBuilder ), m_sUsername( ), m_xCmdEnv( ), m_aRepoIds( ), m_sRepoId( ), - m_sBinding( sBinding ) + m_sBinding( sBinding ), + m_xParentDialog( VCLUnoHelper::GetInterface(pParentDialog) ) { Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext(); Reference< XInteractionHandler > xGlobalInteractionHandler( - InteractionHandler::createWithParent(xContext, nullptr), UNO_QUERY ); + InteractionHandler::createWithParent(xContext, m_xParentDialog), UNO_QUERY); m_xCmdEnv = new ucbhelper::CommandEnvironment( xGlobalInteractionHandler, Reference< XProgressHandler >() ); pBuilder->get( m_pFTRepository, "repositoryLabel" ); @@ -436,7 +438,7 @@ IMPL_LINK_NOARG_TYPED( CmisDetailsContainer, RefreshReposHdl, Button*, void ) if( !sUrl.isEmpty() && !m_sUsername.isEmpty() && !m_sPassword.isEmpty() ) { Reference< XInteractionHandler > xInteractionHandler( - InteractionHandler::createWithParent( xContext, nullptr ), + InteractionHandler::createWithParent(xContext, m_xParentDialog), UNO_QUERY ); Sequence<OUString> aPasswd { m_sPassword }; diff --git a/svtools/source/dialogs/addresstemplate.cxx b/svtools/source/dialogs/addresstemplate.cxx index e6118aa..71923ad 100644 --- a/svtools/source/dialogs/addresstemplate.cxx +++ b/svtools/source/dialogs/addresstemplate.cxx @@ -798,7 +798,7 @@ void AssignmentPersistentData::ImplCommit() try { xHandler.set( - InteractionHandler::createWithParent(m_xORB, nullptr), + InteractionHandler::createWithParent(m_xORB, VCLUnoHelper::GetInterface(this)), UNO_QUERY_THROW ); } catch(const Exception&) { } commit 8cce65007b506da38ca79ee8b5cdd62a1460fddd Author: Caolán McNamara <caol...@redhat.com> Date: Thu May 26 17:02:09 2016 +0100 avoid a global uno::Reference to the current XCommandEnvironment because the Env is kept until we exit, which we get away with now. But we won't get away with it if we set the parent window property of the InteractionHandler belonging to the Env. Because we then end up trying to destroy the vcl dialog well after all the vcl, etc infrastructure is torn down and crash on exit. Here I'm assuming that its safe to use a WeakReference because we're just using this to smuggle into the c-style callbacks a Reference to a Env currently belonging to something else Change-Id: I2d6b90ae23d5a24431dc49d4316bdc3194560403 diff --git a/ucb/source/ucp/cmis/auth_provider.cxx b/ucb/source/ucp/cmis/auth_provider.cxx index 0c3e4c0..ea833b1 100644 --- a/ucb/source/ucp/cmis/auth_provider.cxx +++ b/ucb/source/ucp/cmis/auth_provider.cxx @@ -22,8 +22,6 @@ using namespace std; namespace cmis { - css::uno::Reference< css::ucb::XCommandEnvironment> - AuthProvider::sm_xEnv; bool AuthProvider::authenticationQuery( string& username, string& password ) { if ( m_xEnv.is() ) @@ -66,6 +64,18 @@ namespace cmis return false; } + css::uno::WeakReference< css::ucb::XCommandEnvironment> AuthProvider::sm_xEnv; + + void AuthProvider::setXEnv(const css::uno::Reference< css::ucb::XCommandEnvironment>& xEnv ) + { + sm_xEnv = xEnv; + } + + css::uno::Reference< css::ucb::XCommandEnvironment> AuthProvider::getXEnv() + { + return sm_xEnv; + } + char* AuthProvider::onedriveAuthCodeFallback( const char* url, const char* /*username*/, const char* /*password*/ ) diff --git a/ucb/source/ucp/cmis/auth_provider.hxx b/ucb/source/ucp/cmis/auth_provider.hxx index e633e95..c2d1e18 100644 --- a/ucb/source/ucp/cmis/auth_provider.hxx +++ b/ucb/source/ucp/cmis/auth_provider.hxx @@ -12,13 +12,14 @@ #include <libcmis/libcmis.hxx> #include <com/sun/star/ucb/XCommandEnvironment.hpp> +#include <cppuhelper/weakref.hxx> namespace cmis { class AuthProvider : public libcmis::AuthProvider { const css::uno::Reference< css::ucb::XCommandEnvironment>& m_xEnv; - static css::uno::Reference< css::ucb::XCommandEnvironment> sm_xEnv; + static css::uno::WeakReference< css::ucb::XCommandEnvironment> sm_xEnv; OUString m_sUrl; OUString m_sBindingUrl; @@ -38,9 +39,9 @@ namespace cmis const char* /*username*/, const char* /*password*/ ); - static void setXEnv( const css::uno::Reference< css::ucb::XCommandEnvironment>& xEnv ) { sm_xEnv = xEnv; } + static void setXEnv( const css::uno::Reference< css::ucb::XCommandEnvironment>& xEnv ); + static css::uno::Reference< css::ucb::XCommandEnvironment> getXEnv(); - static const css::uno::Reference< css::ucb::XCommandEnvironment>& getXEnv( ) { return sm_xEnv; } }; } commit efe57384953c2a9eeb5f8fd65c2d548759ef05f7 Author: Caolán McNamara <caol...@redhat.com> Date: Thu May 26 15:28:05 2016 +0100 cppcheck: variable scope Change-Id: I27ab82d32df984a86af1a2abda491581bff70a2c diff --git a/vcl/source/window/splitwin.cxx b/vcl/source/window/splitwin.cxx index 108251c..752e193 100644 --- a/vcl/source/window/splitwin.cxx +++ b/vcl/source/window/splitwin.cxx @@ -567,7 +567,6 @@ static void ImplCalcSet( ImplSplitSet* pSet, { nAbsItems = 0; long nSizeWinSize = 0; - long nNewSizeWinSize = 0; // first resize absolute items relative for ( i = 0; i < nItems; i++ ) @@ -584,6 +583,8 @@ static void ImplCalcSet( ImplSplitSet* pSet, // do not compensate rounding errors here if ( (nAbsItems < (sal_uInt16)(std::abs( nSizeDelta ))) && nSizeWinSize ) { + long nNewSizeWinSize = 0; + for ( i = 0; i < nItems; i++ ) { if ( !(rItems[i]->mnBits & SplitWindowItemFlags::Invisible) ) @@ -595,6 +596,7 @@ static void ImplCalcSet( ImplSplitSet* pSet, } } } + nSizeDelta -= nNewSizeWinSize-nSizeWinSize; } diff --git a/vcl/unx/generic/app/randrwrapper.cxx b/vcl/unx/generic/app/randrwrapper.cxx index 4913625..54b822f 100644 --- a/vcl/unx/generic/app/randrwrapper.cxx +++ b/vcl/unx/generic/app/randrwrapper.cxx @@ -137,11 +137,10 @@ void SalDisplay::DeInitRandR() void SalDisplay::processRandREvent( XEvent* pEvent ) { #ifdef USE_RANDR - int nRet = 0; XConfigureEvent* pCnfEvent=reinterpret_cast<XConfigureEvent*>(pEvent); if( m_bUseRandRWrapper && pWrapper && pWrapper->XRRRootToScreen(GetDisplay(),pCnfEvent->window) != -1 ) { - nRet = pWrapper->XRRUpdateConfiguration( pEvent ); + int nRet = pWrapper->XRRUpdateConfiguration( pEvent ); if( nRet == 1 && pEvent->type != ConfigureNotify) // this should then be a XRRScreenChangeNotifyEvent { // update screens diff --git a/vcl/unx/generic/app/saldisp.cxx b/vcl/unx/generic/app/saldisp.cxx index ec53250..c715ce0 100644 --- a/vcl/unx/generic/app/saldisp.cxx +++ b/vcl/unx/generic/app/saldisp.cxx @@ -2368,7 +2368,6 @@ Time SalDisplay::GetLastUserEventTime( bool i_bAlwaysReget ) const bool SalDisplay::XIfEventWithTimeout( XEvent* o_pEvent, XPointer i_pPredicateData, X_if_predicate i_pPredicate ) const { - long nTimeout = 1000; /* #i99360# ugly workaround an X11 library bug this replaces the following call: XIfEvent( GetDisplay(), o_pEvent, i_pPredicate, i_pPredicateData ); @@ -2382,6 +2381,7 @@ bool SalDisplay::XIfEventWithTimeout( XEvent* o_pEvent, XPointer i_pPredicateDat aFD.fd = ConnectionNumber(GetDisplay()); aFD.events = POLLIN; aFD.revents = 0; + long nTimeout = 1000; (void)poll(&aFD, 1, nTimeout); if( ! XCheckIfEvent( GetDisplay(), o_pEvent, i_pPredicate, i_pPredicateData ) ) { diff --git a/vcl/unx/generic/fontmanager/fontconfig.cxx b/vcl/unx/generic/fontmanager/fontconfig.cxx index 957afb14..887c3ed 100644 --- a/vcl/unx/generic/fontmanager/fontconfig.cxx +++ b/vcl/unx/generic/fontmanager/fontconfig.cxx @@ -946,8 +946,6 @@ IMPL_LINK_NOARG_TYPED(PrintFontManager, autoInstallFontLangSupport, Timer *, voi void PrintFontManager::Substitute( FontSelectPattern &rPattern, OUString& rMissingCodes ) { - bool bRet = false; - FontCfgWrapper& rWrapper = FontCfgWrapper::get(); // build pattern argument for fontconfig query @@ -1016,6 +1014,8 @@ void PrintFontManager::Substitute( FontSelectPattern &rPattern, OUString& rMissi { if( pSet->nfont > 0 ) { + bool bRet = false; + //extract the closest match FcChar8* file = nullptr; FcResult eFileRes = FcPatternGetString(pSet->fonts[0], FC_FILE, 0, &file); diff --git a/xmloff/source/forms/elementexport.cxx b/xmloff/source/forms/elementexport.cxx index b80d7b0..688c6e8 100644 --- a/xmloff/source/forms/elementexport.cxx +++ b/xmloff/source/forms/elementexport.cxx @@ -778,31 +778,34 @@ namespace xmloff // get the property names getValuePropertyNames(m_eType, m_nClassId, pCurrentValuePropertyName, pValuePropertyName); - static const sal_Char* pCurrentValueAttributeName = OAttributeMetaData::getCommonControlAttributeName(CCAFlags::CurrentValue); - static const sal_Char* pValueAttributeName = OAttributeMetaData::getCommonControlAttributeName(CCAFlags::Value); - static const sal_uInt16 nCurrentValueAttributeNamespaceKey = OAttributeMetaData::getCommonControlAttributeNamespace(CCAFlags::CurrentValue); - static const sal_uInt16 nValueAttributeNamespaceKey = OAttributeMetaData::getCommonControlAttributeNamespace(CCAFlags::Value); - // add the attributes if necessary and possible if (pCurrentValuePropertyName && (CCAFlags::CurrentValue & m_nIncludeCommon)) { + static const sal_Char* pCurrentValueAttributeName = OAttributeMetaData::getCommonControlAttributeName(CCAFlags::CurrentValue); // don't export the current-value if this value originates from a data binding // #i26944# if ( controlHasActiveDataBinding() ) exportedProperty( OUString::createFromAscii( pCurrentValuePropertyName ) ); else + { + static const sal_uInt16 nCurrentValueAttributeNamespaceKey = OAttributeMetaData::getCommonControlAttributeNamespace(CCAFlags::CurrentValue); exportGenericPropertyAttribute( nCurrentValueAttributeNamespaceKey, pCurrentValueAttributeName, pCurrentValuePropertyName ); + } } if (pValuePropertyName && (CCAFlags::Value & m_nIncludeCommon)) + { + static const sal_Char* pValueAttributeName = OAttributeMetaData::getCommonControlAttributeName(CCAFlags::Value); + static const sal_uInt16 nValueAttributeNamespaceKey = OAttributeMetaData::getCommonControlAttributeNamespace(CCAFlags::Value); exportGenericPropertyAttribute( nValueAttributeNamespaceKey, pValueAttributeName, pValuePropertyName); + } OSL_ENSURE((nullptr == pValuePropertyName) == (CCAFlags::NONE == (CCAFlags::Value & m_nIncludeCommon)), "OControlExport::exportCommonControlAttributes: no property found for the value attribute!"); diff --git a/xmloff/source/text/XMLIndexBibliographyConfigurationContext.cxx b/xmloff/source/text/XMLIndexBibliographyConfigurationContext.cxx index 8e961ea..30d2dd4 100644 --- a/xmloff/source/text/XMLIndexBibliographyConfigurationContext.cxx +++ b/xmloff/source/text/XMLIndexBibliographyConfigurationContext.cxx @@ -151,19 +151,18 @@ void XMLIndexBibliographyConfigurationContext::ProcessAttribute( } } - SvXMLImportContext *XMLIndexBibliographyConfigurationContext::CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const Reference<XAttributeList> & xAttrList ) { - OUString sKey; - bool bSort(true); - // process children here and use default context! if ( ( nPrefix == XML_NAMESPACE_TEXT ) && IsXMLToken( rLocalName, XML_SORT_KEY ) ) { + OUString sKey; + bool bSort(true); + sal_Int16 nLength = xAttrList->getLength(); for(sal_Int16 nAttr = 0; nAttr < nLength; nAttr++) {
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits