[Libreoffice-commits] core.git: 2 commits - sc/CppunitTest_sc_filters_test.mk svx/source writerfilter/qa
Noel Grandin
noel at peralex.com
Tue May 21 01:20:03 PDT 2013
sc/CppunitTest_sc_filters_test.mk | 1
svx/source/core/graphichelper.cxx | 26 +++++++++------------
writerfilter/qa/cppunittests/doctok/testdoctok.cxx | 18 +++-----------
3 files changed, 17 insertions(+), 28 deletions(-)
New commits:
commit 895c1bcc811813ba32d865974b7172cb288074dc
Author: Noel Grandin <noel at peralex.com>
Date: Tue May 21 10:12:31 2013 +0200
fdo#46808, fix unit test
...after my PrimitiveFactory2D changes
Change-Id: I994d2dd0aebed67643f749dc43bcd4e744601885
diff --git a/sc/CppunitTest_sc_filters_test.mk b/sc/CppunitTest_sc_filters_test.mk
index 28c56e6..56eb345 100644
--- a/sc/CppunitTest_sc_filters_test.mk
+++ b/sc/CppunitTest_sc_filters_test.mk
@@ -101,6 +101,7 @@ $(eval $(call gb_CppunitTest_use_components,sc_filters_test,\
sfx2/util/sfx \
sot/util/sot \
svl/util/svl \
+ svx/util/svx \
svtools/util/svt \
toolkit/util/tk \
ucb/source/core/ucb1 \
commit d5ac8a01b286051d417eb998f3d1b90b0bf492f6
Author: Noel Grandin <noel at peralex.com>
Date: Tue May 21 09:58:13 2013 +0200
fdo#46808, Use service constructors
Change-Id: Ib428bb78751e9707c89dcf311b8ab86ad8184775
diff --git a/svx/source/core/graphichelper.cxx b/svx/source/core/graphichelper.cxx
index ff5bd61..fc8c2e4 100644
--- a/svx/source/core/graphichelper.cxx
+++ b/svx/source/core/graphichelper.cxx
@@ -31,19 +31,20 @@
#include <comphelper/anytostring.hxx>
#include <comphelper/processfactory.hxx>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/lang/XComponent.hpp>
-#include <com/sun/star/graphic/XGraphicProvider.hpp>
-#include <com/sun/star/graphic/GraphicType.hpp>
-#include <com/sun/star/ucb/XSimpleFileAccess2.hpp>
#include <com/sun/star/beans/PropertyValues.hpp>
#include <com/sun/star/beans/PropertyValue.hpp>
+#include <com/sun/star/document/XExporter.hpp>
+#include <com/sun/star/document/XFilter.hpp>
+#include <com/sun/star/drawing/GraphicExportFilter.hpp>
+#include <com/sun/star/graphic/XGraphicProvider.hpp>
+#include <com/sun/star/graphic/GraphicType.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/io/XInputStream.hpp>
+#include <com/sun/star/ucb/SimpleFileAccess.hpp>
#include <com/sun/star/ui/dialogs/XFilePicker.hpp>
#include <com/sun/star/ui/dialogs/XFilterManager.hpp>
#include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
-#include <com/sun/star/document/XExporter.hpp>
-#include <com/sun/star/document/XFilter.hpp>
using namespace css::uno;
using namespace css::lang;
@@ -202,7 +203,7 @@ void GraphicHelper::SaveShapeAsGraphic( const Reference< drawing::XShape >& xSha
{
try
{
- Reference< XMultiServiceFactory > xServiceFactory( ::comphelper::getProcessServiceFactory(), UNO_QUERY_THROW );
+ Reference< XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
Reference< XPropertySet > xShapeSet( xShape, UNO_QUERY_THROW );
OUString aMimeType;
@@ -274,15 +275,12 @@ void GraphicHelper::SaveShapeAsGraphic( const Reference< drawing::XShape >& xSha
if( xGraphStream.is() )
{
- OUString aSimpleFileAccessFilter( "com.sun.star.ucb.SimpleFileAccess" );
- Reference<XSimpleFileAccess2> xFileAccess( xServiceFactory->createInstance( aSimpleFileAccessFilter ), UNO_QUERY_THROW );
+ Reference<XSimpleFileAccess3> xFileAccess = SimpleFileAccess::create( xContext );
xFileAccess->writeFile( sPath, xGraphStream );
}
else
{
- OUString aGraphicExportFilter("com.sun.star.drawing.GraphicExportFilter");
- Reference<XExporter> xGraphicExporter( xServiceFactory->createInstance( aGraphicExportFilter ), UNO_QUERY_THROW );
- Reference<XFilter> xFilter( xGraphicExporter, UNO_QUERY_THROW );
+ Reference<css::drawing::XGraphicExportFilter> xGraphicExporter = css::drawing::GraphicExportFilter::create( xContext );
Sequence<PropertyValue> aDescriptor( 2 );
aDescriptor[0].Name = OUString("MediaType");
@@ -294,7 +292,7 @@ void GraphicHelper::SaveShapeAsGraphic( const Reference< drawing::XShape >& xSha
if ( xSourceDocument.is() )
{
xGraphicExporter->setSourceDocument( xSourceDocument );
- xFilter->filter( aDescriptor );
+ xGraphicExporter->filter( aDescriptor );
}
}
}
diff --git a/writerfilter/qa/cppunittests/doctok/testdoctok.cxx b/writerfilter/qa/cppunittests/doctok/testdoctok.cxx
index 837128b..e4a04f7 100644
--- a/writerfilter/qa/cppunittests/doctok/testdoctok.cxx
+++ b/writerfilter/qa/cppunittests/doctok/testdoctok.cxx
@@ -27,7 +27,7 @@
#include "cppunit/TestFixture.h"
#include "cppunit/extensions/HelperMacros.h"
#include "cppunit/plugin/TestPlugIn.h"
-#include <com/sun/star/ucb/XSimpleFileAccess.hpp>
+#include <com/sun/star/ucb/SimpleFileAccess.hpp>
#include <com/sun/star/io/XInputStream.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/lang/XMultiComponentFactory.hpp>
@@ -49,7 +49,7 @@ namespace testdoctok
uno::Reference<io::XInputStream> xStream;
uno::Reference<uno::XComponentContext> xContext;
WW8Document::Pointer_t pDocument;
- uno::Reference< ::com::sun::star::ucb::XSimpleFileAccess > xSimpleFileAccess;
+ uno::Reference< ::com::sun::star::ucb::XSimpleFileAccess3 > xSimpleFileAccess;
class test : public CppUnit::TestFixture
{
@@ -97,18 +97,8 @@ namespace testdoctok
OSL_ASSERT(bRet);
if (bRet)
{
- uno::Reference< ::com::sun::star::ucb::XSimpleFileAccess >
- xNameContainer(xFactory->createInstanceWithContext
- (OUString::createFromAscii
- ("com.sun.star.ucb.SimpleFileAccess" ),
- xComponentContext), uno::UNO_QUERY );
-
- if (xNameContainer.is())
- {
- xSimpleFileAccess = xNameContainer;
-
- bResult = true;
- }
+ xSimpleFileAccess = ucb::SimpleFileAccess::create(xComponentContext);
+ bResult = true;
}
}
More information about the Libreoffice-commits
mailing list