[Libreoffice-commits] .: 3 commits - configmgr/source desktop/source sfx2/source ucb/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Wed Oct 31 10:28:01 PDT 2012
configmgr/source/configurationprovider.cxx | 20 ++------------------
desktop/source/app/main.c | 2 +-
sfx2/source/doc/docfile.cxx | 11 +++++++----
ucb/source/core/ucbstore.cxx | 11 +++++------
4 files changed, 15 insertions(+), 29 deletions(-)
New commits:
commit cba921ea0b293acc4b4e64f043f2e56d3e4cb15b
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Wed Oct 31 18:24:23 2012 +0100
Work around new calls to GetFilter()->GetMimeType() on null filter
...introduced with 75bc673b60d3eb40713868ce3d1b4f62dd6e1208 "Travelled MIME type
through UCB for CMIS UCP to use it when creating documents" and causing crashes
in sc_unoapi test. Many SfxMedium instances appear to have a null filter, so
this workaround at least fixes the crashes. No idea what a good fix should look
like, so will ask Cedric to review his commit.
Change-Id: I27180265b6c79c7ed5f459b03c9e188ff6a0f56d
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index b36a441..9be89f5 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -314,6 +314,9 @@ public:
SfxMedium_Impl( SfxMedium* pAntiImplP );
~SfxMedium_Impl();
+
+ OUString getFilterMimeType()
+ { return m_pFilter == 0 ? OUString() : m_pFilter->GetMimeType(); }
};
//------------------------------------------------------------------
@@ -2006,7 +2009,7 @@ void SfxMedium::Transfer_Impl()
try
{
- rtl::OUString aMimeType = GetFilter()->GetMimeType( );
+ rtl::OUString aMimeType = pImp->getFilterMimeType();
::ucbhelper::InsertOperation eOperation = ::ucbhelper::InsertOperation_COPY;
bool bMajor = false;
rtl::OUString sComment;
@@ -2087,7 +2090,7 @@ void SfxMedium::DoInternalBackup_Impl( const ::ucbhelper::Content& aOriginalCont
{
try
{
- rtl::OUString sMimeType = GetFilter()->GetMimeType( );
+ rtl::OUString sMimeType = pImp->getFilterMimeType();
if( aBackupCont.transferContent( aOriginalContent,
::ucbhelper::InsertOperation_COPY,
aBackupName,
@@ -2175,7 +2178,7 @@ void SfxMedium::DoBackup_Impl()
try
{
// do the transfer ( copy source file to backup dir )
- rtl::OUString sMimeType = GetFilter()->GetMimeType( );
+ rtl::OUString sMimeType = pImp->getFilterMimeType();
bSuccess = aContent.transferContent( aSourceContent,
::ucbhelper::InsertOperation_COPY,
aFileName,
@@ -3307,7 +3310,7 @@ void SfxMedium::CreateTempFile( sal_Bool bReplace )
if ( !aFileName.isEmpty() && aTmpURLObj.removeSegment() )
{
::ucbhelper::Content aTargetContent( aTmpURLObj.GetMainURL( INetURLObject::NO_DECODE ), xComEnv, comphelper::getProcessComponentContext() );
- rtl::OUString sMimeType = GetFilter()->GetMimeType( );
+ rtl::OUString sMimeType = pImp->getFilterMimeType();
if ( aTargetContent.transferContent( pImp->aContent, ::ucbhelper::InsertOperation_COPY, aFileName, NameClash::OVERWRITE, sMimeType ) )
{
SetWritableForUserOnly( aTmpURL );
commit c936fcb0f3e1048e3b7085b1564f8e1f24a44f16
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Wed Oct 31 18:24:08 2012 +0100
Some more configuration::theDefaultProvider simplifications
Change-Id: I91ded7801f4959f2dac7b5b3e4c8d1f3929f4ed9
diff --git a/configmgr/source/configurationprovider.cxx b/configmgr/source/configurationprovider.cxx
index c9043ea..db10168 100644
--- a/configmgr/source/configurationprovider.cxx
+++ b/configmgr/source/configurationprovider.cxx
@@ -25,6 +25,7 @@
#include "boost/noncopyable.hpp"
#include "com/sun/star/beans/NamedValue.hpp"
#include "com/sun/star/beans/PropertyValue.hpp"
+#include "com/sun/star/configuration/theDefaultProvider.hpp"
#include "com/sun/star/lang/EventObject.hpp"
#include "com/sun/star/lang/Locale.hpp"
#include "com/sun/star/lang/XLocalizable.hpp"
@@ -32,7 +33,6 @@
#include "com/sun/star/lang/XServiceInfo.hpp"
#include "com/sun/star/lang/XSingleComponentFactory.hpp"
#include "com/sun/star/uno/Any.hxx"
-#include "com/sun/star/uno/DeploymentException.hpp"
#include "com/sun/star/uno/Exception.hpp"
#include "com/sun/star/uno/Reference.hxx"
#include "com/sun/star/uno/RuntimeException.hpp"
@@ -432,23 +432,7 @@ Factory::createInstanceWithArgumentsAndContext(
throw (css::uno::Exception, css::uno::RuntimeException)
{
if (Arguments.getLength() == 0) {
- css::uno::Reference< css::uno::XInterface > instance;
- if (!(Context->getValueByName(
- rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM(
- "/singletons/"
- "com.sun.star.configuration.theDefaultProvider")))
- >>= instance) ||
- !instance.is())
- {
- throw css::uno::DeploymentException(
- rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM(
- "component context fails to supply singleton"
- " com.sun.star.configuration.theDefaultProvider")),
- Context);
- }
- return instance;
+ return css::configuration::theDefaultProvider::get(Context);
} else {
rtl::OUString locale;
for (sal_Int32 i = 0; i < Arguments.getLength(); ++i) {
diff --git a/ucb/source/core/ucbstore.cxx b/ucb/source/core/ucbstore.cxx
index 61a40c3..6fdffba 100644
--- a/ucb/source/core/ucbstore.cxx
+++ b/ucb/source/core/ucbstore.cxx
@@ -31,13 +31,16 @@
#include <cppuhelper/interfacecontainer.hxx>
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/beans/PropertySetInfoChange.hpp>
+#include <com/sun/star/configuration/theDefaultProvider.hpp>
#include <com/sun/star/container/XHierarchicalNameAccess.hpp>
#include <com/sun/star/container/XNameContainer.hpp>
#include <com/sun/star/container/XNameReplace.hpp>
#include <com/sun/star/util/XChangesBatch.hpp>
+#include <comphelper/processfactory.hxx>
#include "ucbstore.hxx"
using namespace com::sun::star::beans;
+using namespace com::sun::star::configuration;
using namespace com::sun::star::container;
using namespace com::sun::star::lang;
using namespace com::sun::star::ucb;
@@ -1037,12 +1040,8 @@ Reference< XMultiServiceFactory > PropertySetRegistry::getConfigProvider()
try
{
m_pImpl->m_xConfigProvider
- = Reference< XMultiServiceFactory >(
- m_xSMgr->createInstance(
- OUString(
- "com.sun.star.configuration."
- "ConfigurationProvider" ) ),
- UNO_QUERY_THROW );
+ = theDefaultProvider::get(
+ comphelper::getComponentContext( m_xSMgr ) );
}
catch (const Exception&)
{
commit 56d7afee15ccd57b6c9ed31ad4bd071a6e66f075
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Wed Oct 31 18:23:23 2012 +0100
Missing "static"
Change-Id: I8474e5da02036f065057a5610def6701db4cedc7
diff --git a/desktop/source/app/main.c b/desktop/source/app/main.c
index 663c35e..e358a38 100644
--- a/desktop/source/app/main.c
+++ b/desktop/source/app/main.c
@@ -26,7 +26,7 @@
#include <stdio.h>
#include <stdlib.h>
-int g_Exiting = 0;
+static int g_Exiting = 0;
/* HACK: detect calls to xmlCleanupParser, which causes hard to debug crashes */
__attribute__ ((visibility("default"))) void xmlCleanupParser(void)
More information about the Libreoffice-commits
mailing list