[Libreoffice-commits] .: 4 commits - cui/source extensions/source filter/source offapi/com offapi/type_reference offapi/UnoApi_offapi.mk sfx2/source sw/source uui/source vbahelper/source xmlsecurity/workben

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Tue Sep 4 08:57:47 PDT 2012


 cui/source/options/optinet2.cxx                            |    7 
 extensions/source/dbpilots/groupboxwiz.cxx                 |    3 
 extensions/source/dbpilots/optiongrouplayouter.cxx         |    9 
 extensions/source/dbpilots/optiongrouplayouter.hxx         |    8 
 filter/source/graphicfilter/icgm/actimpr.cxx               |   21 -
 filter/source/pdf/impdialog.cxx                            |   14 -
 offapi/UnoApi_offapi.mk                                    |    6 
 offapi/com/sun/star/drawing/ShapeCollection.idl            |   13 -
 offapi/com/sun/star/security/DocumentDigitalSignatures.idl |   18 +
 offapi/type_reference/types.rdb                            |binary
 sfx2/source/dialog/dinfdlg.cxx                             |   35 +-
 sfx2/source/doc/docfile.cxx                                |  168 ++++++-------
 sfx2/source/doc/docmacromode.cxx                           |   23 -
 sfx2/source/doc/objmisc.cxx                                |    6 
 sfx2/source/doc/objserv.cxx                                |    9 
 sfx2/source/doc/objstor.cxx                                |   14 -
 sw/source/ui/vba/vbaselection.cxx                          |    4 
 uui/source/secmacrowarnings.cxx                            |   25 -
 uui/source/sslwarndlg.cxx                                  |    6 
 uui/source/unknownauthdlg.cxx                              |    5 
 vbahelper/source/vbahelper/vbashaperange.cxx               |    4 
 xmlsecurity/workben/signaturetest.cxx                      |   36 +-
 22 files changed, 195 insertions(+), 239 deletions(-)

New commits:
commit 31da8163ef96ed8a3bb97c52da94682e474dda55
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Sep 4 17:56:11 2012 +0200

    Some clean up of previous commit
    
    Change-Id: I75a4b2be2fbaf47a2ddb3498dd4e46b1169d47cc

diff --git a/extensions/source/dbpilots/optiongrouplayouter.cxx b/extensions/source/dbpilots/optiongrouplayouter.cxx
index f5b73a8..3ddc3b5 100644
--- a/extensions/source/dbpilots/optiongrouplayouter.cxx
+++ b/extensions/source/dbpilots/optiongrouplayouter.cxx
@@ -104,7 +104,7 @@ namespace dbp
         implAnchorShape(Reference< XPropertySet >(_rContext.xObjectShape, UNO_QUERY));
 
         // shape collection (for grouping the shapes)
-        Reference< XShapes > xButtonCollection( ShapeCollection::create(mxContext), UNO_QUERY_THROW );
+        Reference< XShapes > xButtonCollection( ShapeCollection::create(mxContext) );
         // first member : the shape of the control
         xButtonCollection->add(_rContext.xObjectShape.get());
 
diff --git a/sw/source/ui/vba/vbaselection.cxx b/sw/source/ui/vba/vbaselection.cxx
index 6416681..491a8a6 100644
--- a/sw/source/ui/vba/vbaselection.cxx
+++ b/sw/source/ui/vba/vbaselection.cxx
@@ -869,7 +869,7 @@ SwVbaSelection::ShapeRange( ) throw (uno::RuntimeException)
     if ( !xShapes.is() )
     {
         uno::Reference< drawing::XShape > xShape( mxModel->getCurrentSelection(), uno::UNO_QUERY_THROW );
-        xShapes.set( drawing::ShapeCollection::create(mxContext), uno::UNO_QUERY_THROW );
+        xShapes.set( drawing::ShapeCollection::create(mxContext) );
         xShapes->add( xShape );
     }
 
diff --git a/vbahelper/source/vbahelper/vbashaperange.cxx b/vbahelper/source/vbahelper/vbashaperange.cxx
index 87168bb..128b323 100644
--- a/vbahelper/source/vbahelper/vbashaperange.cxx
+++ b/vbahelper/source/vbahelper/vbashaperange.cxx
@@ -74,7 +74,7 @@ ScVbaShapeRange::getShapes() throw (uno::RuntimeException)
 {
     if ( !m_xShapes.is() )
     {
-        m_xShapes.set( drawing::ShapeCollection::create(mxContext), uno::UNO_QUERY_THROW );
+        m_xShapes.set( drawing::ShapeCollection::create(mxContext) );
         sal_Int32 nLen = m_xIndexAccess->getCount();
         for ( sal_Int32 index = 0; index < nLen; ++index )
             m_xShapes->add( uno::Reference< drawing::XShape >( m_xIndexAccess->getByIndex( index ), uno::UNO_QUERY_THROW ) );
commit 9738002eca0f7cba337ae856cb5bce8ba93ee293
Author: Noel Grandin <noel at peralex.com>
Date:   Tue Sep 4 13:49:59 2012 +0200

    fdo#46808, Adapt drawing::ShapeCollection UNO service to new style
    
    No client code is using the XComponent interface, so drop it.
    
    Change-Id: Id8f6da1248da641dcc0a3cb6d0a70e3bf29e5c99

diff --git a/extensions/source/dbpilots/groupboxwiz.cxx b/extensions/source/dbpilots/groupboxwiz.cxx
index 4d15d55..00d7dab 100644
--- a/extensions/source/dbpilots/groupboxwiz.cxx
+++ b/extensions/source/dbpilots/groupboxwiz.cxx
@@ -33,6 +33,7 @@
 #include <vcl/msgbox.hxx>
 #include "optiongrouplayouter.hxx"
 #include "dbpilots.hrc"
+#include <comphelper/componentcontext.hxx>
 
 #define GBW_STATE_OPTIONLIST        0
 #define GBW_STATE_DEFAULTOPTION     1
@@ -168,7 +169,7 @@ namespace dbp
     {
         try
         {
-            OOptionGroupLayouter aLayouter(getServiceFactory());
+            OOptionGroupLayouter aLayouter(comphelper::ComponentContext(getServiceFactory()).getUNOContext());
             aLayouter.doLayout(getContext(), getSettings());
         }
         catch(const Exception&)
diff --git a/extensions/source/dbpilots/optiongrouplayouter.cxx b/extensions/source/dbpilots/optiongrouplayouter.cxx
index 99b68ad..f5b73a8 100644
--- a/extensions/source/dbpilots/optiongrouplayouter.cxx
+++ b/extensions/source/dbpilots/optiongrouplayouter.cxx
@@ -31,6 +31,7 @@
 #include <com/sun/star/awt/Point.hpp>
 #include <com/sun/star/container/XIndexAccess.hpp>
 #include <com/sun/star/container/XNameAccess.hpp>
+#include <com/sun/star/drawing/ShapeCollection.hpp>
 #include <com/sun/star/drawing/XShapes.hpp>
 #include <com/sun/star/drawing/XShapeGrouper.hpp>
 #include <com/sun/star/text/TextContentAnchorType.hpp>
@@ -62,8 +63,8 @@ namespace dbp
     //= OOptionGroupLayouter
     //=====================================================================
     //---------------------------------------------------------------------
-    OOptionGroupLayouter::OOptionGroupLayouter(const Reference< XMultiServiceFactory >& _rxORB)
-        :m_xORB(_rxORB)
+    OOptionGroupLayouter::OOptionGroupLayouter(const Reference< XComponentContext >& _rxContext)
+        :mxContext(_rxContext)
     {
     }
 
@@ -103,9 +104,7 @@ namespace dbp
         implAnchorShape(Reference< XPropertySet >(_rContext.xObjectShape, UNO_QUERY));
 
         // shape collection (for grouping the shapes)
-        Reference< XShapes > xButtonCollection(m_xORB->createInstance(
-                ::rtl::OUString("com.sun.star.drawing.ShapeCollection")),
-            UNO_QUERY);
+        Reference< XShapes > xButtonCollection( ShapeCollection::create(mxContext), UNO_QUERY_THROW );
         // first member : the shape of the control
         xButtonCollection->add(_rContext.xObjectShape.get());
 
diff --git a/extensions/source/dbpilots/optiongrouplayouter.hxx b/extensions/source/dbpilots/optiongrouplayouter.hxx
index 08d36ef..0a0c870 100644
--- a/extensions/source/dbpilots/optiongrouplayouter.hxx
+++ b/extensions/source/dbpilots/optiongrouplayouter.hxx
@@ -22,7 +22,7 @@
 
 #include <com/sun/star/drawing/XDrawPage.hpp>
 #include <com/sun/star/beans/XPropertySet.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
 #include <com/sun/star/drawing/XControlShape.hpp>
 #include <com/sun/star/frame/XModel.hpp>
 #include "dbptypes.hxx"
@@ -39,12 +39,12 @@ namespace dbp
     //=====================================================================
     class OOptionGroupLayouter
     {
-        ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >
-                    m_xORB;
+        ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >
+                    mxContext;
 
     public:
         OOptionGroupLayouter(
-            const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB
+            const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext
             );
 
     public:
diff --git a/filter/source/graphicfilter/icgm/actimpr.cxx b/filter/source/graphicfilter/icgm/actimpr.cxx
index 37ab1d6..7d54127 100644
--- a/filter/source/graphicfilter/icgm/actimpr.cxx
+++ b/filter/source/graphicfilter/icgm/actimpr.cxx
@@ -42,11 +42,13 @@
 #include <com/sun/star/drawing/PointSequence.hpp>
 #include <com/sun/star/drawing/PolyPolygonBezierCoords.hpp>
 #include <com/sun/star/drawing/FlagSequence.hpp>
+#include <com/sun/star/drawing/ShapeCollection.hpp>
 #include <com/sun/star/drawing/TextAdjust.hpp>
 #include <com/sun/star/text/XText.hpp>
 #include <com/sun/star/text/XTextRange.hpp>
 #include <com/sun/star/style/HorizontalAlignment.hpp>
 
+#include <comphelper/componentcontext.hxx>
 #include <comphelper/processfactory.hxx>
 #include <toolkit/helper/vclunohelper.hxx>
 
@@ -448,21 +450,14 @@ void CGMImpressOutAct::EndGroup()
             uno::Any aAny( maXDrawPage->queryInterface( ::getCppuType(((const uno::Reference< drawing::XShapeGrouper >*)0) )));
             if( aAny >>= aXShapeGrouper )
             {
-                uno::Reference< drawing::XShapes >  aXShapes;
-                uno::Reference< drawing::XShape >  aXShapeCollection( maXServiceManagerSC->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.drawing.ShapeCollection" )) ), uno::UNO_QUERY );
-                if ( aXShapeCollection.is() )
+                uno::Reference< drawing::XShapes >  aXShapes(
+                         drawing::ShapeCollection::create(comphelper::ComponentContext(maXServiceManagerSC).getUNOContext()) );
+                for ( sal_uInt32 i = mnFirstIndex; i < mnCurrentCount; i++ )
                 {
-                    aXShapes = uno::Reference< drawing::XShapes >( aXShapeCollection, uno::UNO_QUERY );
-                    if( aXShapes.is() )
+                    uno::Reference< drawing::XShape >  aXShape = *(uno::Reference< drawing::XShape > *)maXShapes->getByIndex( i ).getValue();
+                    if (aXShape.is() )
                     {
-                        for ( sal_uInt32 i = mnFirstIndex; i < mnCurrentCount; i++ )
-                        {
-                            uno::Reference< drawing::XShape >  aXShape = *(uno::Reference< drawing::XShape > *)maXShapes->getByIndex( i ).getValue();
-                            if (aXShape.is() )
-                            {
-                                aXShapes->add( aXShape );
-                            }
-                        }
+                        aXShapes->add( aXShape );
                     }
                 }
                 uno::Reference< drawing::XShapeGroup >  aXShapeGroup = aXShapeGrouper->group( aXShapes );
diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk
index 0a97145..291699a 100644
--- a/offapi/UnoApi_offapi.mk
+++ b/offapi/UnoApi_offapi.mk
@@ -103,6 +103,7 @@ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/document,\
 	OOXMLDocumentPropertiesImporter \
 ))
 $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/drawing,\
+	ShapeCollection \
 	SlideRenderer \
 	SlideSorter \
 ))
@@ -669,7 +670,6 @@ $(eval $(call gb_UnoApi_add_idlfiles_noheader,offapi,offapi/com/sun/star/drawing
 	RotationDescriptor \
 	ShadowProperties \
 	Shape \
-	ShapeCollection \
 	Shapes \
 	Text \
 	TextProperties \
diff --git a/offapi/com/sun/star/drawing/ShapeCollection.idl b/offapi/com/sun/star/drawing/ShapeCollection.idl
index 7c80d93..b126177 100644
--- a/offapi/com/sun/star/drawing/ShapeCollection.idl
+++ b/offapi/com/sun/star/drawing/ShapeCollection.idl
@@ -20,7 +20,6 @@
 #define __com_sun_star_drawing_ShapeCollection_idl__
 
 #include <com/sun/star/drawing/Shapes.idl>
-#include <com/sun/star/lang/XComponent.idl>
 
 
 module com { module sun { module star { module drawing {
@@ -32,17 +31,7 @@ module com { module sun { module star { module drawing {
     This service is used by the view f.e. to return a collection of
     <type>Shape</type> that are selected at the ui.
 */
-published service ShapeCollection
-{
-    /** gives access to the shapes
-     */
-    interface com::sun::star::drawing::XShapes;
-
-    /** allows controlling or observing the lifetime of this collection
-     */
-    interface com::sun::star::lang::XComponent;
-
-};
+published service ShapeCollection : com::sun::star::drawing::XShapes;
 
 
 }; }; }; };
diff --git a/offapi/type_reference/types.rdb b/offapi/type_reference/types.rdb
index d36fc05..e6e1579 100644
Binary files a/offapi/type_reference/types.rdb and b/offapi/type_reference/types.rdb differ
diff --git a/sw/source/ui/vba/vbaselection.cxx b/sw/source/ui/vba/vbaselection.cxx
index df31e14..6416681 100644
--- a/sw/source/ui/vba/vbaselection.cxx
+++ b/sw/source/ui/vba/vbaselection.cxx
@@ -60,6 +60,7 @@
 #include "vbaheaderfooter.hxx"
 #include "vbaheaderfooterhelper.hxx"
 #include <vbahelper/vbashaperange.hxx>
+#include <com/sun/star/drawing/ShapeCollection.hpp>
 #include <com/sun/star/drawing/XDrawPageSupplier.hpp>
 #include <com/sun/star/drawing/XDrawPage.hpp>
 #include "vbarows.hxx"
@@ -868,8 +869,7 @@ SwVbaSelection::ShapeRange( ) throw (uno::RuntimeException)
     if ( !xShapes.is() )
     {
         uno::Reference< drawing::XShape > xShape( mxModel->getCurrentSelection(), uno::UNO_QUERY_THROW );
-        uno::Reference< lang::XMultiServiceFactory > xMSF( mxContext->getServiceManager(), uno::UNO_QUERY_THROW );
-        xShapes.set( xMSF->createInstance( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.ShapeCollection")) ), uno::UNO_QUERY_THROW );
+        xShapes.set( drawing::ShapeCollection::create(mxContext), uno::UNO_QUERY_THROW );
         xShapes->add( xShape );
     }
 
diff --git a/vbahelper/source/vbahelper/vbashaperange.cxx b/vbahelper/source/vbahelper/vbashaperange.cxx
index fb2ca53..87168bb 100644
--- a/vbahelper/source/vbahelper/vbashaperange.cxx
+++ b/vbahelper/source/vbahelper/vbashaperange.cxx
@@ -16,6 +16,7 @@
  *   except in compliance with the License. You may obtain a copy of
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
+#include <com/sun/star/drawing/ShapeCollection.hpp>
 #include <com/sun/star/drawing/XShapeGrouper.hpp>
 #include <com/sun/star/drawing/XDrawPage.hpp>
 #include<com/sun/star/view/XSelectionSupplier.hpp>
@@ -73,8 +74,7 @@ ScVbaShapeRange::getShapes() throw (uno::RuntimeException)
 {
     if ( !m_xShapes.is() )
     {
-        uno::Reference< lang::XMultiServiceFactory > xMSF( mxContext->getServiceManager(), uno::UNO_QUERY_THROW );
-        m_xShapes.set( xMSF->createInstance( rtl::OUString("com.sun.star.drawing.ShapeCollection") ), uno::UNO_QUERY_THROW );
+        m_xShapes.set( drawing::ShapeCollection::create(mxContext), uno::UNO_QUERY_THROW );
         sal_Int32 nLen = m_xIndexAccess->getCount();
         for ( sal_Int32 index = 0; index < nLen; ++index )
             m_xShapes->add( uno::Reference< drawing::XShape >( m_xIndexAccess->getByIndex( index ), uno::UNO_QUERY_THROW ) );
commit af5059d19a37c6f2dffd756c579e92d30f65bc8b
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Sep 4 17:23:18 2012 +0200

    Some clean up of previous commit
    
    Change-Id: I0ea6d6439f97fcf74162c19671483aaa17b5a6cb

diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx
index 7ef26b1..3662826 100644
--- a/filter/source/pdf/impdialog.cxx
+++ b/filter/source/pdf/impdialog.cxx
@@ -1711,7 +1711,7 @@ IMPL_LINK_NOARG( ImpPDFTabSigningPage, ClickmaPbSignCertSelect )
 
     Reference< security::XDocumentDigitalSignatures > xSigner(
         security::DocumentDigitalSignatures::createWithVersion(
-            comphelper::getProcessComponentContext(), rtl::OUString("1.2") ) );
+            comphelper::getProcessComponentContext(), "1.2" ) );
 
     maSignCertificate = xSigner->chooseCertificate();
 
diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk
index 0abad1a..0a97145 100644
--- a/offapi/UnoApi_offapi.mk
+++ b/offapi/UnoApi_offapi.mk
@@ -214,9 +214,6 @@ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/resource,\
 	StringResourceWithLocation \
 	StringResourceWithStorage \
 ))
-$(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/security,\
-	DocumentDigitalSignatures \
-))
 $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/scanner,\
 	ScannerManager \
 ))
@@ -244,6 +241,7 @@ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/sdbc,\
 ))
 $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/security,\
 	CertificateContainer \
+	DocumentDigitalSignatures \
 	SerialNumberAdapter \
 ))
 $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/sheet,\
diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
index 5046eca..443294a 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -1261,7 +1261,7 @@ uno::Sequence< security::DocumentSignatureInformation > SfxObjectShell::ImplAnal
         {
             if ( !xLocSigner.is() )
             {
-                ::rtl::OUString aVersion;
+                OUString aVersion;
                 try
                 {
                     uno::Reference < beans::XPropertySet > xPropSet( GetStorage(), uno::UNO_QUERY_THROW );
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 0534f9c..e3ffae4 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -1538,7 +1538,7 @@ sal_Bool SfxObjectShell::SaveTo_Impl
             try
             {
                 // get the ODF version of the new medium
-                ::rtl::OUString aVersion;
+                OUString aVersion;
                 try
                 {
                     uno::Reference < beans::XPropertySet > xPropSet( rMedium.GetStorage(), uno::UNO_QUERY_THROW );
diff --git a/xmlsecurity/workben/signaturetest.cxx b/xmlsecurity/workben/signaturetest.cxx
index e5e3ac5..f0c45fd 100644
--- a/xmlsecurity/workben/signaturetest.cxx
+++ b/xmlsecurity/workben/signaturetest.cxx
@@ -304,7 +304,7 @@ IMPL_LINK_NOARG(MyWin, DigitalSignaturesWithServiceHdl)
             aDocFileName, embed::ElementModes::READWRITE, comphelper::getProcessServiceFactory() );
 
     uno::Reference< security::XDocumentDigitalSignatures > xD(
-        security::DocumentDigitalSignatures::create(comphelper::getProcessComponentContext() );
+        security::DocumentDigitalSignatures::createDefault(comphelper::getProcessComponentContext() );
     xD->signDocumentContent( xStore, NULL );
 
 
@@ -318,7 +318,7 @@ IMPL_LINK_NOARG(MyWin, VerifyDigitalSignaturesHdl)
             aDocFileName, embed::ElementModes::READWRITE, comphelper::getProcessServiceFactory() );
 
     uno::Reference< security::XDocumentDigitalSignatures > xD(
-        security::DocumentDigitalSignatures::create(comphelper::getProcessComponentContext()) );
+        security::DocumentDigitalSignatures::createDefault(comphelper::getProcessComponentContext()) );
     uno::Sequence< security::DocumentSignatureInformation > aInfos = xD->verifyDocumentContentSignatures( xStore, NULL );
     int nInfos = aInfos.getLength();
     for ( int n = 0; n < nInfos; n++ )
commit 197a79e57131c976a489882479a679ba2ab61b82
Author: Noel Grandin <noel at peralex.com>
Date:   Tue Sep 4 11:42:03 2012 +0200

    fdo#46808, Adapt DocumentDigitalSignatures UNO service to new style
    
    Rename service from "Decryptor" to "DocumentDigitalSignatures" to be consistent
    with the other UNO services, and with it's own header file name.
    Add service constructor for passing in arguments.
    
    Change-Id: Iaca0c40bb2f1a1af2ef9ca29361bfd023ade2678

diff --git a/cui/source/options/optinet2.cxx b/cui/source/options/optinet2.cxx
index 859e83a..51ba595 100644
--- a/cui/source/options/optinet2.cxx
+++ b/cui/source/options/optinet2.cxx
@@ -64,7 +64,7 @@
 #include <svx/svxids.hrc> // slot ids, mostly for changetracking
 
 // for security TP
-#include <com/sun/star/security/XDocumentDigitalSignatures.hpp>
+#include <com/sun/star/security/DocumentDigitalSignatures.hpp>
 
 #ifdef UNX
 #include <sys/stat.h>
@@ -867,9 +867,8 @@ IMPL_LINK_NOARG(SvxSecurityTabPage, MacroSecPBHdl)
     try
     {
         Reference< security::XDocumentDigitalSignatures > xD(
-            comphelper::getProcessServiceFactory()->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.security.DocumentDigitalSignatures" ) ) ), UNO_QUERY );
-        if ( xD.is() )
-            xD->manageTrustedSources();
+            security::DocumentDigitalSignatures::createDefault(comphelper::getProcessComponentContext() ) );
+        xD->manageTrustedSources();
     }
     catch (const Exception& e)
     {
diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx
index d19c87e..7ef26b1 100644
--- a/filter/source/pdf/impdialog.cxx
+++ b/filter/source/pdf/impdialog.cxx
@@ -43,7 +43,7 @@
 #include "com/sun/star/container/XIndexAccess.hpp"
 #include "com/sun/star/frame/XController.hpp"
 #include "com/sun/star/view/XSelectionSupplier.hpp"
-#include "com/sun/star/security/XDocumentDigitalSignatures.hpp"
+#include "com/sun/star/security/DocumentDigitalSignatures.hpp"
 #include "com/sun/star/security/XCertificate.hpp"
 
 #include <boost/shared_ptr.hpp>
@@ -1709,17 +1709,9 @@ ImpPDFTabSigningPage::~ImpPDFTabSigningPage()
 IMPL_LINK_NOARG( ImpPDFTabSigningPage, ClickmaPbSignCertSelect )
 {
 
-    uno::Sequence< uno::Any > aArgs( 2 );
-    aArgs[0] <<= rtl::OUString("1.2");
-    aArgs[1] <<= sal_False;
-
     Reference< security::XDocumentDigitalSignatures > xSigner(
-        comphelper::getProcessServiceFactory()->createInstanceWithArguments(
-            rtl::OUString( "com.sun.star.security.DocumentDigitalSignatures"  ), aArgs ),
-        uno::UNO_QUERY );
-
-    if ( !xSigner.is() )
-        return 0;
+        security::DocumentDigitalSignatures::createWithVersion(
+            comphelper::getProcessComponentContext(), rtl::OUString("1.2") ) );
 
     maSignCertificate = xSigner->chooseCertificate();
 
diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk
index 64d1a4d..0abad1a 100644
--- a/offapi/UnoApi_offapi.mk
+++ b/offapi/UnoApi_offapi.mk
@@ -214,6 +214,9 @@ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/resource,\
 	StringResourceWithLocation \
 	StringResourceWithStorage \
 ))
+$(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/security,\
+	DocumentDigitalSignatures \
+))
 $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/scanner,\
 	ScannerManager \
 ))
@@ -1046,9 +1049,6 @@ $(eval $(call gb_UnoApi_add_idlfiles_noheader,offapi,offapi/com/sun/star/sdbcx,\
 	View \
 	ViewDescriptor \
 ))
-$(eval $(call gb_UnoApi_add_idlfiles_noheader,offapi,offapi/com/sun/star/security,\
-	DocumentDigitalSignatures \
-))
 $(eval $(call gb_UnoApi_add_idlfiles_noheader,offapi,offapi/com/sun/star/setup,\
 	ProductRegistration \
 	Setup \
diff --git a/offapi/com/sun/star/security/DocumentDigitalSignatures.idl b/offapi/com/sun/star/security/DocumentDigitalSignatures.idl
index 9eb7a9c..b406cfd 100644
--- a/offapi/com/sun/star/security/DocumentDigitalSignatures.idl
+++ b/offapi/com/sun/star/security/DocumentDigitalSignatures.idl
@@ -33,8 +33,22 @@ module com { module sun { module star { module security {
  * Service of DocumentDigitalSignatures
  */
 
-    service Decryptor {
-    interface XDocumentDigitalSignatures ;
+service DocumentDigitalSignatures : XDocumentDigitalSignatures
+{
+    /* default constructor */
+    createDefault();
+
+    /**
+        @param ODFVersion
+            the version of the signature
+     */
+    createWithVersion([in] string ODFVersion);
+
+    /**
+        @param ODFVersion
+            the version of the signature
+     */
+    createWithVersionAndValidSignature([in] string ODFVersion, [in] boolean HasValidDocumentSignature);
 };
 
 } ; } ; } ; } ;
diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx
index a8cf492..78dbfe3 100644
--- a/sfx2/source/dialog/dinfdlg.cxx
+++ b/sfx2/source/dialog/dinfdlg.cxx
@@ -33,7 +33,7 @@
 
 #include <comphelper/string.hxx>
 #include <com/sun/star/security/DocumentSignatureInformation.hpp>
-#include <com/sun/star/security/XDocumentDigitalSignatures.hpp>
+#include <com/sun/star/security/DocumentDigitalSignatures.hpp>
 #include <unotools/syslocale.hxx>
 #include <rtl/math.hxx>
 #include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
@@ -938,26 +938,23 @@ void SfxDocumentPage::ImplUpdateSignatures()
         if ( pMedium && !pMedium->GetName().isEmpty() && pMedium->GetStorage().is() )
         {
             Reference< security::XDocumentDigitalSignatures > xD(
-                comphelper::getProcessServiceFactory()->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.security.DocumentDigitalSignatures" ) ) ), uno::UNO_QUERY );
-
-            if ( xD.is() )
+                security::DocumentDigitalSignatures::createDefault(comphelper::getProcessComponentContext()) );
+
+            String s;
+            Sequence< security::DocumentSignatureInformation > aInfos;
+            aInfos = xD->verifyDocumentContentSignatures( pMedium->GetZipStorageToSign_Impl(),
+                                                            uno::Reference< io::XInputStream >() );
+            if ( aInfos.getLength() > 1 )
+                s = aMultiSignedStr;
+            else if ( aInfos.getLength() == 1 )
             {
-                String s;
-                Sequence< security::DocumentSignatureInformation > aInfos;
-                aInfos = xD->verifyDocumentContentSignatures( pMedium->GetZipStorageToSign_Impl(),
-                                                                uno::Reference< io::XInputStream >() );
-                if ( aInfos.getLength() > 1 )
-                    s = aMultiSignedStr;
-                else if ( aInfos.getLength() == 1 )
-                {
-                    rtl::OUString aCN_Id("CN");
-                    const security::DocumentSignatureInformation& rInfo = aInfos[ 0 ];
-                    s = GetDateTimeString( rInfo.SignatureDate, rInfo.SignatureTime );
-                    s.AppendAscii( ", " );
-                    s += GetContentPart( rInfo.Signer->getSubjectName(), aCN_Id );
-                }
-                aSignedValFt.SetText( s );
+                rtl::OUString aCN_Id("CN");
+                const security::DocumentSignatureInformation& rInfo = aInfos[ 0 ];
+                s = GetDateTimeString( rInfo.SignatureDate, rInfo.SignatureTime );
+                s.AppendAscii( ", " );
+                s += GetContentPart( rInfo.Signer->getSubjectName(), aCN_Id );
             }
+            aSignedValFt.SetText( s );
         }
     }
 }
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index 0996676..1a8c619 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -62,7 +62,7 @@
 #include <cppuhelper/implbase1.hxx>
 #include <com/sun/star/beans/PropertyValue.hpp>
 #include <com/sun/star/security/DocumentSignatureInformation.hpp>
-#include <com/sun/star/security/XDocumentDigitalSignatures.hpp>
+#include <com/sun/star/security/DocumentDigitalSignatures.hpp>
 #include <tools/urlobj.hxx>
 #include <unotools/tempfile.hxx>
 #include <comphelper/processfactory.hxx>
@@ -3371,105 +3371,97 @@ sal_Bool SfxMedium::SignContents_Impl( sal_Bool bScriptingContent, const ::rtl::
     {
         // The component should know if there was a valid document signature, since
         // it should show a warning in this case
-        uno::Sequence< uno::Any > aArgs( 2 );
-        aArgs[0] <<= aODFVersion;
-        aArgs[1] <<= bHasValidDocumentSignature;
-        ::com::sun::star::uno::Reference< ::com::sun::star::security::XDocumentDigitalSignatures > xSigner(
-            comphelper::getProcessServiceFactory()->createInstanceWithArguments(
-                rtl::OUString( "com.sun.star.security.DocumentDigitalSignatures"  ),
-                aArgs ),
-            ::com::sun::star::uno::UNO_QUERY );
-
-        if ( xSigner.is() )
-        {
-            uno::Reference< embed::XStorage > xWriteableZipStor;
-            if ( !IsReadOnly() )
-            {
-                // we can reuse the temporary file if there is one already
-                CreateTempFile( false );
-                GetMedium_Impl();
+        uno::Reference< security::XDocumentDigitalSignatures > xSigner(
+            security::DocumentDigitalSignatures::createWithVersionAndValidSignature(
+                comphelper::getProcessComponentContext(), aODFVersion, bHasValidDocumentSignature ) );
 
-                try
-                {
-                    if ( !pImp->xStream.is() )
-                        throw uno::RuntimeException();
+        uno::Reference< embed::XStorage > xWriteableZipStor;
+        if ( !IsReadOnly() )
+        {
+            // we can reuse the temporary file if there is one already
+            CreateTempFile( false );
+            GetMedium_Impl();
 
-                    xWriteableZipStor = ::comphelper::OStorageHelper::GetStorageOfFormatFromStream( ZIP_STORAGE_FORMAT_STRING, pImp->xStream );
-                    if ( !xWriteableZipStor.is() )
-                        throw uno::RuntimeException();
+            try
+            {
+                if ( !pImp->xStream.is() )
+                    throw uno::RuntimeException();
 
-                    uno::Reference< embed::XStorage > xMetaInf = xWriteableZipStor->openStorageElement(
-                                                    ::rtl::OUString( "META-INF"  ),
-                                                    embed::ElementModes::READWRITE );
-                    if ( !xMetaInf.is() )
-                        throw uno::RuntimeException();
+                xWriteableZipStor = ::comphelper::OStorageHelper::GetStorageOfFormatFromStream( ZIP_STORAGE_FORMAT_STRING, pImp->xStream );
+                if ( !xWriteableZipStor.is() )
+                    throw uno::RuntimeException();
 
-                    if ( bScriptingContent )
-                    {
-                        // If the signature has already the document signature it will be removed
-                        // after the scripting signature is inserted.
-                        uno::Reference< io::XStream > xStream(
-                            xMetaInf->openStreamElement( xSigner->getScriptingContentSignatureDefaultStreamName(),
-                                                         embed::ElementModes::READWRITE ),
-                            uno::UNO_SET_THROW );
-
-                        if ( xSigner->signScriptingContent( GetZipStorageToSign_Impl(), xStream ) )
-                        {
-                            // remove the document signature if any
-                            ::rtl::OUString aDocSigName = xSigner->getDocumentContentSignatureDefaultStreamName();
-                            if ( !aDocSigName.isEmpty() && xMetaInf->hasByName( aDocSigName ) )
-                                xMetaInf->removeElement( aDocSigName );
-
-                            uno::Reference< embed::XTransactedObject > xTransact( xMetaInf, uno::UNO_QUERY_THROW );
-                            xTransact->commit();
-                            xTransact.set( xWriteableZipStor, uno::UNO_QUERY_THROW );
-                            xTransact->commit();
-
-                            // the temporary file has been written, commit it to the original file
-                            Commit();
-                            bChanges = true;
-                        }
-                    }
-                    else
-                    {
-                         uno::Reference< io::XStream > xStream(
-                            xMetaInf->openStreamElement( xSigner->getDocumentContentSignatureDefaultStreamName(),
-                                                         embed::ElementModes::READWRITE ),
-                            uno::UNO_SET_THROW );
+                uno::Reference< embed::XStorage > xMetaInf = xWriteableZipStor->openStorageElement(
+                                                ::rtl::OUString( "META-INF"  ),
+                                                embed::ElementModes::READWRITE );
+                if ( !xMetaInf.is() )
+                    throw uno::RuntimeException();
 
-                        if ( xSigner->signDocumentContent( GetZipStorageToSign_Impl(), xStream ) )
-                        {
-                            uno::Reference< embed::XTransactedObject > xTransact( xMetaInf, uno::UNO_QUERY_THROW );
-                            xTransact->commit();
-                            xTransact.set( xWriteableZipStor, uno::UNO_QUERY_THROW );
-                            xTransact->commit();
-
-                            // the temporary file has been written, commit it to the original file
-                            Commit();
-                            bChanges = true;
-                        }
+                if ( bScriptingContent )
+                {
+                    // If the signature has already the document signature it will be removed
+                    // after the scripting signature is inserted.
+                    uno::Reference< io::XStream > xStream(
+                        xMetaInf->openStreamElement( xSigner->getScriptingContentSignatureDefaultStreamName(),
+                                                     embed::ElementModes::READWRITE ),
+                        uno::UNO_SET_THROW );
+
+                    if ( xSigner->signScriptingContent( GetZipStorageToSign_Impl(), xStream ) )
+                    {
+                        // remove the document signature if any
+                        ::rtl::OUString aDocSigName = xSigner->getDocumentContentSignatureDefaultStreamName();
+                        if ( !aDocSigName.isEmpty() && xMetaInf->hasByName( aDocSigName ) )
+                            xMetaInf->removeElement( aDocSigName );
+
+                        uno::Reference< embed::XTransactedObject > xTransact( xMetaInf, uno::UNO_QUERY_THROW );
+                        xTransact->commit();
+                        xTransact.set( xWriteableZipStor, uno::UNO_QUERY_THROW );
+                        xTransact->commit();
+
+                        // the temporary file has been written, commit it to the original file
+                        Commit();
+                        bChanges = true;
                     }
                 }
-                catch ( const uno::Exception& )
+                else
                 {
-                    OSL_FAIL( "Couldn't use signing functionality!\n" );
+                     uno::Reference< io::XStream > xStream(
+                        xMetaInf->openStreamElement( xSigner->getDocumentContentSignatureDefaultStreamName(),
+                                                     embed::ElementModes::READWRITE ),
+                        uno::UNO_SET_THROW );
+
+                    if ( xSigner->signDocumentContent( GetZipStorageToSign_Impl(), xStream ) )
+                    {
+                        uno::Reference< embed::XTransactedObject > xTransact( xMetaInf, uno::UNO_QUERY_THROW );
+                        xTransact->commit();
+                        xTransact.set( xWriteableZipStor, uno::UNO_QUERY_THROW );
+                        xTransact->commit();
+
+                        // the temporary file has been written, commit it to the original file
+                        Commit();
+                        bChanges = true;
+                    }
                 }
+            }
+            catch ( const uno::Exception& )
+            {
+                OSL_FAIL( "Couldn't use signing functionality!\n" );
+            }
 
-                CloseAndRelease();
+            CloseAndRelease();
+        }
+        else
+        {
+            try
+            {
+                if ( bScriptingContent )
+                    xSigner->showScriptingContentSignatures( GetZipStorageToSign_Impl(), uno::Reference< io::XInputStream >() );
+                else
+                    xSigner->showDocumentContentSignatures( GetZipStorageToSign_Impl(), uno::Reference< io::XInputStream >() );
             }
-            else
+            catch( const uno::Exception& )
             {
-                try
-                {
-                    if ( bScriptingContent )
-                        xSigner->showScriptingContentSignatures( GetZipStorageToSign_Impl(), uno::Reference< io::XInputStream >() );
-                    else
-                        xSigner->showDocumentContentSignatures( GetZipStorageToSign_Impl(), uno::Reference< io::XInputStream >() );
-                }
-                catch( const uno::Exception& )
-                {
-                    OSL_FAIL( "Couldn't use signing functionality!\n" );
-                }
+                OSL_FAIL( "Couldn't use signing functionality!\n" );
             }
         }
 
diff --git a/sfx2/source/doc/docmacromode.cxx b/sfx2/source/doc/docmacromode.cxx
index dc6395e..4754756 100644
--- a/sfx2/source/doc/docmacromode.cxx
+++ b/sfx2/source/doc/docmacromode.cxx
@@ -26,7 +26,7 @@
 #include <com/sun/star/task/ErrorCodeRequest.hpp>
 #include <com/sun/star/task/DocumentMacroConfirmationRequest.hpp>
 #include <com/sun/star/task/InteractionClassification.hpp>
-#include <com/sun/star/security/XDocumentDigitalSignatures.hpp>
+#include <com/sun/star/security/DocumentDigitalSignatures.hpp>
 #include <com/sun/star/script/XLibraryQueryExecutable.hpp>
 #include <com/sun/star/script/vba/XVBACompatibility.hpp>
 
@@ -56,6 +56,7 @@ namespace sfx2
     using ::com::sun::star::task::DocumentMacroConfirmationRequest;
     using ::com::sun::star::task::ErrorCodeRequest;
     using ::com::sun::star::uno::Exception;
+    using ::com::sun::star::security::DocumentDigitalSignatures;
     using ::com::sun::star::security::XDocumentDigitalSignatures;
     using ::com::sun::star::security::DocumentSignatureInformation;
     using ::com::sun::star::embed::XStorage;
@@ -224,20 +225,16 @@ namespace sfx2
 
             // get document location from medium name and check whether it is a trusted one
             // the service is created ohne document version, since it is not of interest here
-            ::comphelper::ComponentContext aContext( ::comphelper::getProcessServiceFactory() );
-            Reference< XDocumentDigitalSignatures > xSignatures;
-            if ( aContext.createComponent( "com.sun.star.security.DocumentDigitalSignatures", xSignatures ) )
-            {
-                INetURLObject aURLReferer( sReferrer );
+            Reference< XDocumentDigitalSignatures > xSignatures(DocumentDigitalSignatures::createDefault(::comphelper::getProcessComponentContext()));
+            INetURLObject aURLReferer( sReferrer );
 
-                ::rtl::OUString aLocation;
-                if ( aURLReferer.removeSegment() )
-                    aLocation = aURLReferer.GetMainURL( INetURLObject::NO_DECODE );
+            ::rtl::OUString aLocation;
+            if ( aURLReferer.removeSegment() )
+                aLocation = aURLReferer.GetMainURL( INetURLObject::NO_DECODE );
 
-                if ( !aLocation.isEmpty() && xSignatures->isLocationTrusted( aLocation ) )
-                {
-                    return allowMacroExecution();
-                }
+            if ( !aLocation.isEmpty() && xSignatures->isLocationTrusted( aLocation ) )
+            {
+                return allowMacroExecution();
             }
 
             // at this point it is clear that the document is not in the secure location
diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx
index 842d716..a307653 100644
--- a/sfx2/source/doc/objmisc.cxx
+++ b/sfx2/source/doc/objmisc.cxx
@@ -67,7 +67,7 @@
 #include <comphelper/processfactory.hxx>
 #include <comphelper/string.hxx>
 
-#include <com/sun/star/security/XDocumentDigitalSignatures.hpp>
+#include <com/sun/star/security/DocumentDigitalSignatures.hpp>
 #include <com/sun/star/task/DocumentMacroConfirmationRequest.hpp>
 #include <com/sun/star/task/InteractionClassification.hpp>
 #include <com/sun/star/frame/XModel.hpp>
@@ -1967,10 +1967,8 @@ sal_Bool SfxObjectShell_Impl::hasTrustedScriptingSignature( sal_Bool bAllowUIToA
         catch( uno::Exception& )
         {
         }
-        uno::Sequence< uno::Any > aArgs( 1 );
-        aArgs[0] <<= aVersion;
 
-        uno::Reference< security::XDocumentDigitalSignatures > xSigner( comphelper::getProcessServiceFactory()->createInstanceWithArguments( rtl::OUString( "com.sun.star.security.DocumentDigitalSignatures"  ), aArgs ), uno::UNO_QUERY_THROW );
+        uno::Reference< security::XDocumentDigitalSignatures > xSigner( security::DocumentDigitalSignatures::createWithVersion(comphelper::getProcessComponentContext(), aVersion) );
 
         if ( nScriptingSignatureState == SIGNATURESTATE_UNKNOWN
           || nScriptingSignatureState == SIGNATURESTATE_SIGNATURES_OK
diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
index 1bd9c9c..5046eca 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -40,7 +40,7 @@
 #include <com/sun/star/security/CertificateValidity.hpp>
 
 #include <com/sun/star/security/DocumentSignatureInformation.hpp>
-#include <com/sun/star/security/XDocumentDigitalSignatures.hpp>
+#include <com/sun/star/security/DocumentDigitalSignatures.hpp>
 #include <tools/urlobj.hxx>
 #include <svl/whiter.hxx>
 #include <vcl/msgbox.hxx>
@@ -1261,18 +1261,17 @@ uno::Sequence< security::DocumentSignatureInformation > SfxObjectShell::ImplAnal
         {
             if ( !xLocSigner.is() )
             {
-                uno::Sequence< uno::Any > aArgs( 1 );
-                aArgs[0] <<= ::rtl::OUString();
+                ::rtl::OUString aVersion;
                 try
                 {
                     uno::Reference < beans::XPropertySet > xPropSet( GetStorage(), uno::UNO_QUERY_THROW );
-                    aArgs[0] = xPropSet->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Version" ) ) );
+                    xPropSet->getPropertyValue( ::rtl::OUString( "Version"  ) ) >>= aVersion;
                 }
                 catch( uno::Exception& )
                 {
                 }
 
-                xLocSigner.set( comphelper::getProcessServiceFactory()->createInstanceWithArguments( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.security.DocumentDigitalSignatures" ) ), aArgs ), uno::UNO_QUERY_THROW );
+                xLocSigner.set( security::DocumentDigitalSignatures::createWithVersion(comphelper::getProcessComponentContext(), aVersion) );
 
             }
 
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 64eadd5..0534f9c 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -60,7 +60,7 @@
 #include <com/sun/star/embed/XEncryptionProtectedStorage.hpp>
 #include <com/sun/star/io/XTruncate.hpp>
 #include <com/sun/star/util/XModifiable.hpp>
-#include <com/sun/star/security/XDocumentDigitalSignatures.hpp>
+#include <com/sun/star/security/DocumentDigitalSignatures.hpp>
 #include <com/sun/star/xml/crypto/CipherID.hpp>
 #include <com/sun/star/xml/crypto/DigestID.hpp>
 
@@ -1538,23 +1538,17 @@ sal_Bool SfxObjectShell::SaveTo_Impl
             try
             {
                 // get the ODF version of the new medium
-                uno::Sequence< uno::Any > aArgs( 1 );
-                aArgs[0] <<= ::rtl::OUString();
+                ::rtl::OUString aVersion;
                 try
                 {
                     uno::Reference < beans::XPropertySet > xPropSet( rMedium.GetStorage(), uno::UNO_QUERY_THROW );
-                    aArgs[0] = xPropSet->getPropertyValue( ::rtl::OUString( "Version"  ) );
+                    xPropSet->getPropertyValue( ::rtl::OUString( "Version"  ) ) >>= aVersion;
                 }
                 catch( uno::Exception& )
                 {
                 }
 
-                xDDSigns = uno::Reference< security::XDocumentDigitalSignatures >(
-                    comphelper::getProcessServiceFactory()->createInstanceWithArguments(
-                        rtl::OUString(
-                            "com.sun.star.security.DocumentDigitalSignatures"  ),
-                        aArgs ),
-                    uno::UNO_QUERY_THROW );
+                xDDSigns = security::DocumentDigitalSignatures::createWithVersion(comphelper::getProcessComponentContext(), aVersion);
 
                 ::rtl::OUString aScriptSignName = xDDSigns->getScriptingContentSignatureDefaultStreamName();
 
diff --git a/uui/source/secmacrowarnings.cxx b/uui/source/secmacrowarnings.cxx
index 14e5c3d..12ff096 100644
--- a/uui/source/secmacrowarnings.cxx
+++ b/uui/source/secmacrowarnings.cxx
@@ -19,7 +19,7 @@
 
 #include <com/sun/star/xml/crypto/XSecurityEnvironment.hpp>
 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/security/XDocumentDigitalSignatures.hpp>
+#include <com/sun/star/security/DocumentDigitalSignatures.hpp>
 #include <comphelper/sequence.hxx>
 #include "comphelper/documentconstants.hxx"
 #include <comphelper/processfactory.hxx>
@@ -116,7 +116,7 @@ IMPL_LINK_NOARG(MacroWarning, ViewSignsBtnHdl)
     uno::Sequence< uno::Any > aArgs( 1 );
     aArgs[0] = uno::makeAny( maODFVersion );
     uno::Reference< security::XDocumentDigitalSignatures > xD(
-        comphelper::getProcessServiceFactory()->createInstanceWithArguments( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.security.DocumentDigitalSignatures" ) ), aArgs ), uno::UNO_QUERY );
+        security::DocumentDigitalSignatures::createDefault(comphelper::getProcessComponentContext()) );
     if( xD.is() )
     {
         if( mxCert.is() )
@@ -135,19 +135,16 @@ IMPL_LINK_NOARG(MacroWarning, EnableBtnHdl)
         uno::Sequence< uno::Any > aArgs( 1 );
         aArgs[0] = uno::makeAny( maODFVersion );
         uno::Reference< security::XDocumentDigitalSignatures > xD(
-            comphelper::getProcessServiceFactory()->createInstanceWithArguments( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.security.DocumentDigitalSignatures" ) ), aArgs ), uno::UNO_QUERY );
-        if( xD.is() )
+            security::DocumentDigitalSignatures::createDefault(comphelper::getProcessComponentContext()) );
+        if( mxCert.is() )
+            xD->addAuthorToTrustedSources( mxCert );
+        else if( mxStore.is() )
         {
-            if( mxCert.is() )
-                xD->addAuthorToTrustedSources( mxCert );
-            else if( mxStore.is() )
-            {
-                DBG_ASSERT( mpInfos, "-MacroWarning::EnableBtnHdl(): no infos, search in nirvana..." );
-
-                sal_Int32   nCnt = mpInfos->getLength();
-                for( sal_Int32 i = 0 ; i < nCnt ; ++i )
-                    xD->addAuthorToTrustedSources( (*mpInfos)[ i ].Signer );
-            }
+            DBG_ASSERT( mpInfos, "-MacroWarning::EnableBtnHdl(): no infos, search in nirvana..." );
+
+            sal_Int32   nCnt = mpInfos->getLength();
+            for( sal_Int32 i = 0 ; i < nCnt ; ++i )
+                xD->addAuthorToTrustedSources( (*mpInfos)[ i ].Signer );
         }
     }
 
diff --git a/uui/source/sslwarndlg.cxx b/uui/source/sslwarndlg.cxx
index 172b11d..eba78e1 100644
--- a/uui/source/sslwarndlg.cxx
+++ b/uui/source/sslwarndlg.cxx
@@ -23,7 +23,8 @@
 #include <sslwarndlg.hrc>
 #include <sslwarndlg.hxx>
 
-#include <com/sun/star/security/XDocumentDigitalSignatures.hpp>
+#include <comphelper/componentcontext.hxx>
+#include <com/sun/star/security/DocumentDigitalSignatures.hpp>
 
 // -----------------------------------------------------------------------
 
@@ -39,8 +40,7 @@ IMPL_LINK_NOARG(SSLWarnDialog, ViewCertHdl_Impl)
 {
     uno::Reference< ::com::sun::star::security::XDocumentDigitalSignatures > xDocumentDigitalSignatures;
 
-    xDocumentDigitalSignatures = uno::Reference< ::com::sun::star::security::XDocumentDigitalSignatures >(
-                    getServiceFactory().get()->createInstance( rtl::OUString( "com.sun.star.security.DocumentDigitalSignatures" )), uno::UNO_QUERY );
+    xDocumentDigitalSignatures = ::com::sun::star::security::DocumentDigitalSignatures::createDefault( comphelper::ComponentContext(getServiceFactory()).getUNOContext() );
 
     xDocumentDigitalSignatures.get()->showCertificate(getCert());
 
diff --git a/uui/source/unknownauthdlg.cxx b/uui/source/unknownauthdlg.cxx
index 17f1464..c53e5bb 100644
--- a/uui/source/unknownauthdlg.cxx
+++ b/uui/source/unknownauthdlg.cxx
@@ -22,8 +22,9 @@
 #include <ids.hrc>
 #include <unknownauthdlg.hrc>
 #include <unknownauthdlg.hxx>
+#include <comphelper/componentcontext.hxx>
 
-#include <com/sun/star/security/XDocumentDigitalSignatures.hpp>
+#include <com/sun/star/security/DocumentDigitalSignatures.hpp>
 
 // -----------------------------------------------------------------------
 
@@ -47,7 +48,7 @@ IMPL_LINK_NOARG(UnknownAuthDialog, ViewCertHdl_Impl)
     uno::Reference< ::com::sun::star::security::XDocumentDigitalSignatures > xDocumentDigitalSignatures;
 
     xDocumentDigitalSignatures = uno::Reference< ::com::sun::star::security::XDocumentDigitalSignatures >(
-                    getServiceFactory().get()->createInstance( rtl::OUString( "com.sun.star.security.DocumentDigitalSignatures" )), uno::UNO_QUERY );
+                    ::com::sun::star::security::DocumentDigitalSignatures::createDefault(comphelper::ComponentContext(getServiceFactory()).getUNOContext()) );
 
     xDocumentDigitalSignatures.get()->showCertificate(getCert());
 
diff --git a/xmlsecurity/workben/signaturetest.cxx b/xmlsecurity/workben/signaturetest.cxx
index 2fbce79..e5e3ac5 100644
--- a/xmlsecurity/workben/signaturetest.cxx
+++ b/xmlsecurity/workben/signaturetest.cxx
@@ -51,7 +51,7 @@
 #include <xmlsecurity/certificatechooser.hxx>
 #include <xmlsecurity/biginteger.hxx>
 
-#include <com/sun/star/security/XDocumentDigitalSignatures.hpp>
+#include <com/sun/star/security/DocumentDigitalSignatures.hpp>
 
 using namespace ::com::sun::star;
 using namespace ::com::sun::star;
@@ -304,9 +304,8 @@ IMPL_LINK_NOARG(MyWin, DigitalSignaturesWithServiceHdl)
             aDocFileName, embed::ElementModes::READWRITE, comphelper::getProcessServiceFactory() );
 
     uno::Reference< security::XDocumentDigitalSignatures > xD(
-        comphelper::getProcessServiceFactory()->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.security.DocumentDigitalSignatures" ) ) ), uno::UNO_QUERY );
-    if ( xD.is() )
-        xD->signDocumentContent( xStore, NULL );
+        security::DocumentDigitalSignatures::create(comphelper::getProcessComponentContext() );
+    xD->signDocumentContent( xStore, NULL );
 
 
     return 0;
@@ -319,26 +318,21 @@ IMPL_LINK_NOARG(MyWin, VerifyDigitalSignaturesHdl)
             aDocFileName, embed::ElementModes::READWRITE, comphelper::getProcessServiceFactory() );
 
     uno::Reference< security::XDocumentDigitalSignatures > xD(
-        comphelper::getProcessServiceFactory()->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.security.DocumentDigitalSignatures" ) ) ), uno::UNO_QUERY );
-    if ( xD.is() )
+        security::DocumentDigitalSignatures::create(comphelper::getProcessComponentContext()) );
+    uno::Sequence< security::DocumentSignatureInformation > aInfos = xD->verifyDocumentContentSignatures( xStore, NULL );
+    int nInfos = aInfos.getLength();
+    for ( int n = 0; n < nInfos; n++ )
     {
-        uno::Sequence< security::DocumentSignatureInformation > aInfos = xD->verifyDocumentContentSignatures( xStore, NULL );
-        int nInfos = aInfos.getLength();
-        for ( int n = 0; n < nInfos; n++ )
-        {
-            security::DocumentSignatureInformation& rInf = aInfos[n];
-            String aText( RTL_CONSTASCII_USTRINGPARAM( "The document is signed by\n\n  " ) );
-            aText += String( rInf.Signer->getSubjectName() );
-            aText += String( RTL_CONSTASCII_USTRINGPARAM( "\n\n The signature is " ) );
-            if ( !rInf.SignatureIsValid )
-                aText += String( RTL_CONSTASCII_USTRINGPARAM( "NOT " ) );
-            aText += String( RTL_CONSTASCII_USTRINGPARAM( "valid" ) );
-            InfoBox( this, aText ).Execute();
-        }
-
+        security::DocumentSignatureInformation& rInf = aInfos[n];
+        String aText( RTL_CONSTASCII_USTRINGPARAM( "The document is signed by\n\n  " ) );
+        aText += String( rInf.Signer->getSubjectName() );
+        aText += String( RTL_CONSTASCII_USTRINGPARAM( "\n\n The signature is " ) );
+        if ( !rInf.SignatureIsValid )
+            aText += String( RTL_CONSTASCII_USTRINGPARAM( "NOT " ) );
+        aText += String( RTL_CONSTASCII_USTRINGPARAM( "valid" ) );
+        InfoBox( this, aText ).Execute();
     }
 
-
     return 0;
 }
 


More information about the Libreoffice-commits mailing list