[Libreoffice-commits] core.git: 6 commits - basctl/source basic/source cui/source offapi/com offapi/UnoApi_offapi.mk sw/inc sw/source xmloff/source

Noel Grandin noel at peralex.com
Tue May 14 23:27:22 PDT 2013


 basctl/source/dlged/dlged.cxx                              |    9 -
 basic/source/uno/dlgcont.cxx                               |   47 ---------
 cui/source/customize/cfgutil.cxx                           |    5 -
 cui/source/customize/selector.cxx                          |    4 
 cui/source/dialogs/hyphen.cxx                              |   10 --
 cui/source/dialogs/scriptdlg.cxx                           |    6 -
 cui/source/inc/optlingu.hxx                                |    3 
 cui/source/options/optgdlg.cxx                             |    8 -
 cui/source/options/optlingu.cxx                            |    2 
 cui/source/options/treeopt.cxx                             |   10 --
 offapi/UnoApi_offapi.mk                                    |    5 -
 offapi/com/sun/star/chart2/RegressionEquation.idl          |   35 +++++++
 offapi/com/sun/star/script/browse/BrowseNodeFactory.idl    |    1 
 offapi/com/sun/star/script/browse/theBrowseNodeFactory.idl |    7 -
 sw/inc/swtypes.hxx                                         |    3 
 sw/source/core/bastyp/swtypes.cxx                          |    2 
 sw/source/core/doc/docedt.cxx                              |    1 
 sw/source/core/edit/edlingu.cxx                            |    1 
 sw/source/core/txtnode/txtedt.cxx                          |    2 
 sw/source/ui/lingu/hyp.cxx                                 |    6 -
 sw/source/ui/uiview/view0.cxx                              |    5 -
 sw/source/ui/uiview/viewling.cxx                           |   14 +-
 xmloff/source/chart/SchXMLPlotAreaContext.cxx              |   64 +++++--------
 xmloff/source/draw/animationimport.cxx                     |   11 +-
 xmloff/source/draw/shapeexport.cxx                         |    7 -
 xmloff/source/transform/OOo2Oasis.cxx                      |   24 ++--
 26 files changed, 131 insertions(+), 161 deletions(-)

New commits:
commit 3e563377333881efa60aaa93d2feeaf647cf19ff
Author: Noel Grandin <noel at peralex.com>
Date:   Tue May 14 15:54:42 2013 +0200

    fdo#46808, More LinguProperties fun
    
    Change-Id: Ia3173e980370f532fcabc8f1c7a913e5d66d6d8a

diff --git a/cui/source/dialogs/hyphen.cxx b/cui/source/dialogs/hyphen.cxx
index e7bfc03..7e4e724 100644
--- a/cui/source/dialogs/hyphen.cxx
+++ b/cui/source/dialogs/hyphen.cxx
@@ -360,19 +360,15 @@ IMPL_LINK( SvxHyphenWordDialog, HyphenateAllHdl_Impl, Button *, EMPTYARG /*pButt
     {
         try
         {
-            uno::Reference< beans::XPropertySet >  xProp( SvxGetLinguPropertySet() );
-            const OUString aName( "IsHyphAuto" );
-            uno::Any aAny;
+            uno::Reference< linguistic2::XLinguProperties >  xProp( SvxGetLinguPropertySet() );
 
-            aAny <<= sal_True;
-            xProp->setPropertyValue( aName, aAny );
+            xProp->setIsHyphAuto( sal_True );
 
             bBusy = sal_True;
             ContinueHyph_Impl( /*nHyphPos*/nOldPos );
             bBusy = sal_False;
 
-            aAny <<= sal_False;
-            xProp->setPropertyValue( aName, aAny );
+            xProp->setIsHyphAuto( sal_False );
         }
         catch (uno::Exception &e)
         {
diff --git a/cui/source/inc/optlingu.hxx b/cui/source/inc/optlingu.hxx
index abafc39..ee6c51c 100644
--- a/cui/source/inc/optlingu.hxx
+++ b/cui/source/inc/optlingu.hxx
@@ -38,6 +38,7 @@ namespace beans{
 namespace linguistic2{
     class XDictionary;
     class XDictionaryList;
+    class XLinguProperties;
 }}}}
 
 class SvTreeListEntry;
@@ -123,7 +124,7 @@ private:
     String              sHyphSpecial;
 
     com::sun::star::uno::Reference<
-        com::sun::star::beans::XPropertySet >   xProp;
+        com::sun::star::linguistic2::XLinguProperties >     xProp;
 
     com::sun::star::uno::Reference<
         com::sun::star::linguistic2::XDictionaryList >      xDicList;
diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx
index 86e6f48..7a3a9e3 100644
--- a/cui/source/options/optgdlg.cxx
+++ b/cui/source/options/optgdlg.cxx
@@ -1349,7 +1349,7 @@ sal_Bool OfaLanguagesTabPage::FillItemSet( SfxItemSet& rSet )
         pLangConfig->aSysLocaleOptions.SetDatePatternsConfigString( aDatePatternsED.GetText());
 
     SfxObjectShell* pCurrentDocShell = SfxObjectShell::Current();
-    Reference< XPropertySet > xLinguProp( LinguMgr::GetLinguPropertySet(), UNO_QUERY );
+    Reference< css::linguistic2::XLinguProperties > xLinguProp = LinguMgr::GetLinguPropertySet();
     sal_Bool bCurrentDocCBChecked = aCurrentDocCB.IsChecked();
     if(aCurrentDocCB.IsEnabled())
         bLanguageCurrentDoc_Impl = bCurrentDocCBChecked;
@@ -1367,7 +1367,7 @@ sal_Bool OfaLanguagesTabPage::FillItemSet( SfxItemSet& rSet )
             OUString aPropName( "DefaultLocale" );
             pLangConfig->aLinguConfig.SetProperty( aPropName, aValue );
             if (xLinguProp.is())
-                xLinguProp->setPropertyValue( aPropName, aValue );
+                xLinguProp->setDefaultLocale( aLocale );
         }
         if(pCurrentDocShell)
         {
@@ -1387,7 +1387,7 @@ sal_Bool OfaLanguagesTabPage::FillItemSet( SfxItemSet& rSet )
             OUString aPropName( "DefaultLocale_CJK" );
             pLangConfig->aLinguConfig.SetProperty( aPropName, aValue );
             if (xLinguProp.is())
-                xLinguProp->setPropertyValue( aPropName, aValue );
+                xLinguProp->setDefaultLocale_CJK( aLocale );
         }
         if(pCurrentDocShell)
         {
@@ -1407,7 +1407,7 @@ sal_Bool OfaLanguagesTabPage::FillItemSet( SfxItemSet& rSet )
             OUString aPropName( "DefaultLocale_CTL" );
             pLangConfig->aLinguConfig.SetProperty( aPropName, aValue );
             if (xLinguProp.is())
-                xLinguProp->setPropertyValue( aPropName, aValue );
+                xLinguProp->setDefaultLocale_CTL( aLocale );
         }
         if(pCurrentDocShell)
         {
diff --git a/cui/source/options/optlingu.cxx b/cui/source/options/optlingu.cxx
index 75fd722..303a89f 100644
--- a/cui/source/options/optlingu.cxx
+++ b/cui/source/options/optlingu.cxx
@@ -1117,7 +1117,7 @@ SvxLinguTabPage::SvxLinguTabPage( Window* pParent,
     aLinguDicsEditPB.SetAccessibleName(sAccessibleNameDicsEdit);
     aLinguOptionsEditPB.SetAccessibleName(sAccessibleNameOptionEdit);
 
-    xProp = uno::Reference< XPropertySet >( SvxGetLinguPropertySet(), UNO_QUERY );
+    xProp = SvxGetLinguPropertySet();
     xDicList = uno::Reference< XDictionaryList >( SvxGetDictionaryList(), UNO_QUERY );
     if (xDicList.is())
     {
diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx
index 6d31b46..ac4ab97 100644
--- a/cui/source/options/treeopt.cxx
+++ b/cui/source/options/treeopt.cxx
@@ -1203,7 +1203,7 @@ OfaPageResource::OfaPageResource() :
 
 SfxItemSet* OfaTreeOptionsDialog::CreateItemSet( sal_uInt16 nId )
 {
-    Reference< XPropertySet >  xProp( SvxGetLinguPropertySet() );
+    Reference< XLinguProperties >  xProp( SvxGetLinguPropertySet() );
     SfxItemSet* pRet = 0;
     switch(nId)
     {
@@ -1267,10 +1267,8 @@ SfxItemSet* OfaTreeOptionsDialog::CreateItemSet( sal_uInt16 nId )
                         nMinTrail = 2;
             if (xProp.is())
             {
-                xProp->getPropertyValue( OUString(
-                        UPN_HYPH_MIN_LEADING) ) >>= nMinLead;
-                xProp->getPropertyValue( OUString(
-                        UPN_HYPH_MIN_TRAILING) ) >>= nMinTrail;
+                nMinLead = xProp->getHyphMinLeading();
+                nMinTrail = xProp->getHyphMinTrailing();
             }
             aHyphen.GetMinLead()  = (sal_uInt8)nMinLead;
             aHyphen.GetMinTrail() = (sal_uInt8)nMinTrail;
@@ -1300,7 +1298,7 @@ SfxItemSet* OfaTreeOptionsDialog::CreateItemSet( sal_uInt16 nId )
                         sal_Bool bVal = sal_False;
                         if (xProp.is())
                         {
-                            xProp->getPropertyValue( OUString( UPN_IS_SPELL_AUTO) ) >>= bVal;
+                            bVal = xProp->getIsSpellAuto();
                         }
 
                         pRet->Put(SfxBoolItem(SID_AUTOSPELL_CHECK, bVal));
diff --git a/sw/inc/swtypes.hxx b/sw/inc/swtypes.hxx
index 4b41e45..98c1567 100644
--- a/sw/inc/swtypes.hxx
+++ b/sw/inc/swtypes.hxx
@@ -30,6 +30,7 @@
 namespace com { namespace sun { namespace star {
     namespace linguistic2{
         class XDictionaryList;
+        class XLinguProperties;
         class XSpellChecker1;
         class XHyphenator;
         class XThesaurus;
@@ -161,7 +162,7 @@ extern ResMgr* pSwResMgr;           // Is in swapp0.cxx.
 ::com::sun::star::uno::Reference<
     ::com::sun::star::linguistic2::XThesaurus >     GetThesaurus();
 ::com::sun::star::uno::Reference<
-    ::com::sun::star::beans::XPropertySet >         GetLinguPropertySet();
+    ::com::sun::star::linguistic2::XLinguProperties > GetLinguPropertySet();
 
 // Returns the twip size of this graphic.
 SW_DLLPUBLIC Size GetGraphicSizeTwip( const Graphic&, OutputDevice* pOutDev );
diff --git a/sw/source/core/bastyp/swtypes.cxx b/sw/source/core/bastyp/swtypes.cxx
index d4a49a9..9f559d3 100644
--- a/sw/source/core/bastyp/swtypes.cxx
+++ b/sw/source/core/bastyp/swtypes.cxx
@@ -114,7 +114,7 @@ uno::Reference< linguistic2::XThesaurus >  GetThesaurus()
     return LinguMgr::GetThesaurus();
 }
 
-uno::Reference< beans::XPropertySet >  GetLinguPropertySet()
+uno::Reference< linguistic2::XLinguProperties >  GetLinguPropertySet()
 {
     return LinguMgr::GetLinguPropertySet();
 }
diff --git a/sw/source/core/doc/docedt.cxx b/sw/source/core/doc/docedt.cxx
index 8833323..1f36b91 100644
--- a/sw/source/core/doc/docedt.cxx
+++ b/sw/source/core/doc/docedt.cxx
@@ -1823,7 +1823,6 @@ uno::Any SwDoc::Spell( SwPaM& rPaM,
                     SwConversionArgs *pConvArgs  ) const
 {
     SwPosition* pSttPos = rPaM.Start(), *pEndPos = rPaM.End();
-    uno::Reference< beans::XPropertySet >  xProp( ::GetLinguPropertySet() );
 
     SwSpellArgs      *pSpellArgs = 0;
     if (pConvArgs)
diff --git a/sw/source/core/edit/edlingu.cxx b/sw/source/core/edit/edlingu.cxx
index 6bd017e..4a77c70 100644
--- a/sw/source/core/edit/edlingu.cxx
+++ b/sw/source/core/edit/edlingu.cxx
@@ -313,7 +313,6 @@ void SwSpellIter::Start( SwEditShell *pShell, SwDocPositions eStart,
     if( GetSh() )
         return;
 
-     uno::Reference< beans::XPropertySet >  xProp( ::GetLinguPropertySet() );
     xSpeller = ::GetSpellChecker();
     if ( xSpeller.is() )
         _Start( pShell, eStart, eEnd );
diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx
index 3ae2f43..45f5c72 100644
--- a/sw/source/core/txtnode/txtedt.cxx
+++ b/sw/source/core/txtnode/txtedt.cxx
@@ -871,8 +871,6 @@ sal_uInt16 SwTxtNode::Spell(SwSpellArgs* pArgs)
     // Die Aehnlichkeiten zu SwTxtFrm::_AutoSpell sind beabsichtigt ...
     // ACHTUNG: Ev. Bugs in beiden Routinen fixen!
 
-    uno::Reference<beans::XPropertySet> xProp( GetLinguPropertySet() );
-
     xub_StrLen nBegin, nEnd;
 
     // modify string according to redline information and hidden text
diff --git a/sw/source/ui/lingu/hyp.cxx b/sw/source/ui/lingu/hyp.cxx
index 82b5e9f..814e49a 100644
--- a/sw/source/ui/lingu/hyp.cxx
+++ b/sw/source/ui/lingu/hyp.cxx
@@ -27,6 +27,7 @@
 #include <vcl/wrkwin.hxx>
 #include <linguistic/lngprops.hxx>
 #include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/linguistic2/XLinguProperties.hpp>
 #include <swwait.hxx>
 
 #include "hyp.hxx"
@@ -54,9 +55,8 @@ SwHyphWrapper::SwHyphWrapper( SwView* pVw,
     bInSelection( bSelect ),
     bInfoBox( sal_False )
 {
-    uno::Reference< beans::XPropertySet >  xProp( GetLinguPropertySet() );
-    bAutomatic = xProp.is() ?
-            *(sal_Bool*)xProp->getPropertyValue(UPN_IS_HYPH_AUTO).getValue() : sal_False;
+    uno::Reference< linguistic2::XLinguProperties >  xProp( GetLinguPropertySet() );
+    bAutomatic = xProp.is() ? xProp->getIsHyphAuto() : sal_False;
     SetHyphen();
 }
 
diff --git a/sw/source/ui/uiview/view0.cxx b/sw/source/ui/uiview/view0.cxx
index 6863ced8..671ccb3 100644
--- a/sw/source/ui/uiview/view0.cxx
+++ b/sw/source/ui/uiview/view0.cxx
@@ -39,6 +39,7 @@
 #include <uivwimp.hxx>
 #include <avmedia/mediaplayer.hxx>
 #include <swmodule.hxx>
+#include <com/sun/star/linguistic2/XLinguProperties.hpp>
 
 #include <sfx2/objface.hxx>
 #include <navipi.hxx>
@@ -356,7 +357,7 @@ void SwView::ExecViewOptions(SfxRequest &rReq)
     }
 
     sal_Bool bFlag = STATE_ON == eState;
-    uno::Reference< beans::XPropertySet >  xLngProp( ::GetLinguPropertySet() );
+    uno::Reference< linguistic2::XLinguProperties >  xLngProp( ::GetLinguPropertySet() );
 
     switch ( nSlot )
     {
@@ -503,7 +504,7 @@ void SwView::ExecViewOptions(SfxRequest &rReq)
                 aCfg.SetProperty( aPropName, aVal );
 
                 if (xLngProp.is())
-                    xLngProp->setPropertyValue( aPropName, aVal );
+                    xLngProp->setIsSpellAuto( bSet );
 
                 // for the time being we do not have a specific option for grammarchecking.
                 // thus we'll use the one for spell checking...
diff --git a/sw/source/ui/uiview/viewling.cxx b/sw/source/ui/uiview/viewling.cxx
index 1e524c3..98d0dfc 100644
--- a/sw/source/ui/uiview/viewling.cxx
+++ b/sw/source/ui/uiview/viewling.cxx
@@ -270,9 +270,8 @@ void SwView::SpellStart( SvxSpellArea eWhich,
         bool bStartDone, bool bEndDone,
         SwConversionArgs *pConvArgs )
 {
-    Reference< beans::XPropertySet >  xProp( ::GetLinguPropertySet() );
-    sal_Bool bIsWrapReverse = (!pConvArgs && xProp.is()) ?
-            *(sal_Bool*)xProp->getPropertyValue( UPN_IS_WRAP_REVERSE ).getValue() : sal_False;
+    Reference< XLinguProperties >  xProp = ::GetLinguPropertySet();
+    sal_Bool bIsWrapReverse = (!pConvArgs && xProp.is()) ? xProp->getIsWrapReverse() : sal_False;
 
     SwDocPositions eStart = DOCPOS_START;
     SwDocPositions eEnde  = DOCPOS_END;
@@ -451,13 +450,12 @@ void SwView::HyphenateDocument()
         sal_Bool bOldIdle = pVOpt->IsIdle();
         pVOpt->SetIdle( sal_False );
 
-        Reference< beans::XPropertySet >  xProp( ::GetLinguPropertySet() );
+        Reference< XLinguProperties >  xProp( ::GetLinguPropertySet() );
 
 
         m_pWrtShell->StartUndo(UNDO_INSATTR);         // spaeter gueltig
 
-        sal_Bool bHyphSpecial = xProp.is() ?
-                *(sal_Bool*)xProp->getPropertyValue( UPN_IS_HYPH_SPECIAL ).getValue() : sal_False;
+        sal_Bool bHyphSpecial = xProp.is() ? xProp->getIsHyphSpecial() : sal_False;
         sal_Bool bSelection = ((SwCrsrShell*)m_pWrtShell)->HasSelection() ||
             m_pWrtShell->GetCrsr() != m_pWrtShell->GetCrsr()->GetNext();
         sal_Bool bOther = m_pWrtShell->HasOtherCnt() && bHyphSpecial && !bSelection;
@@ -473,9 +471,7 @@ void SwView::HyphenateDocument()
                 bOther = sal_True;
                 if (xProp.is())
                 {
-                    sal_Bool bTrue = sal_True;
-                    Any aTmp(&bTrue, ::getBooleanCppuType());
-                    xProp->setPropertyValue( UPN_IS_HYPH_SPECIAL, aTmp );
+                    xProp->setIsHyphSpecial( sal_True );
                 }
             }
             else
commit 6f2a33332d401ef5d9f08dd9c079383283cd8910
Author: Noel Grandin <noel at peralex.com>
Date:   Tue May 14 14:27:49 2013 +0200

    fdo#46808, Use service constructors
    
    Change-Id: I34a41cde5d40e14803859116648c8da9f50c4b07

diff --git a/basic/source/uno/dlgcont.cxx b/basic/source/uno/dlgcont.cxx
index 1193756..a9b28ce 100644
--- a/basic/source/uno/dlgcont.cxx
+++ b/basic/source/uno/dlgcont.cxx
@@ -28,8 +28,8 @@
 #include <com/sun/star/io/XActiveDataSource.hpp>
 #include <com/sun/star/xml/sax/XDocumentHandler.hpp>
 #include <com/sun/star/xml/sax/XExtendedDocumentHandler.hpp>
-#include <com/sun/star/resource/XStringResourceWithStorage.hpp>
-#include <com/sun/star/resource/XStringResourceWithLocation.hpp>
+#include <com/sun/star/resource/StringResourceWithStorage.hpp>
+#include <com/sun/star/resource/StringResourceWithLocation.hpp>
 #include <com/sun/star/document/GraphicObjectResolver.hpp>
 #include "dlgcont.hxx"
 #include "sbmodule.hxx"
@@ -368,17 +368,6 @@ Reference< ::com::sun::star::resource::XStringResourcePersistence >
     sal_Bool bStorage = mxStorage.is();
     if( bStorage )
     {
-        Sequence<Any> aArgs( 5 );
-        aArgs[1] <<= bReadOnly;
-        aArgs[2] <<= aLocale;
-        aArgs[3] <<= OUString(aResourceFileNameBase);
-        aArgs[4] <<= aComment;
-
-        // TODO: Ctor
-        xRet = Reference< resource::XStringResourcePersistence >(
-             mxContext->getServiceManager()->createInstanceWithContext("com.sun.star.resource.StringResourceWithStorage", mxContext),
-             UNO_QUERY );
-
         uno::Reference< embed::XStorage > xLibrariesStor;
         uno::Reference< embed::XStorage > xLibraryStor;
         try {
@@ -391,8 +380,6 @@ Reference< ::com::sun::star::resource::XStringResourcePersistence >
                 // TODO: Should be READWRITE with new storage concept using store() instead of storeTo()
             if ( !xLibraryStor.is() )
                 throw uno::RuntimeException();
-
-            aArgs[0] <<= xLibraryStor;
         }
         catch(const uno::Exception& )
         {
@@ -400,41 +387,15 @@ Reference< ::com::sun::star::resource::XStringResourcePersistence >
             return xRet;
         }
 
-        // TODO: Ctor
-        if( xRet.is() )
-        {
-            Reference< XInitialization > xInit( xRet, UNO_QUERY );
-            if( xInit.is() )
-                xInit->initialize( aArgs );
-        }
+        xRet = resource::StringResourceWithStorage::create(mxContext, xLibraryStor, bReadOnly, aLocale, OUString(aResourceFileNameBase), aComment);
     }
     else
     {
-        Sequence<Any> aArgs( 6 );
-
         OUString aLocation = createAppLibraryFolder( pDialogLibrary, aLibName );
-        aArgs[0] <<= aLocation;
-        aArgs[1] <<= bReadOnly;
-        aArgs[2] <<= aLocale;
-        aArgs[3] <<= OUString(aResourceFileNameBase);
-        aArgs[4] <<= aComment;
-
         // TODO: Real handler?
         Reference< task::XInteractionHandler > xDummyHandler;
-        aArgs[5] <<= xDummyHandler;
-
-        // TODO: Ctor
-        xRet = Reference< resource::XStringResourcePersistence >(
-             mxContext->getServiceManager()->createInstanceWithContext("com.sun.star.resource.StringResourceWithLocation", mxContext),
-             UNO_QUERY );
 
-        // TODO: Ctor
-        if( xRet.is() )
-        {
-            Reference< XInitialization > xInit( xRet, UNO_QUERY );
-            if( xInit.is() )
-                xInit->initialize( aArgs );
-        }
+        xRet = resource::StringResourceWithLocation::create(mxContext, aLocation, bReadOnly, aLocale, OUString(aResourceFileNameBase), aComment, xDummyHandler);
     }
 
     return xRet;
commit be1833cbc497080af531a207f216a4f560c0b9e9
Author: Noel Grandin <noel at peralex.com>
Date:   Tue May 14 14:19:58 2013 +0200

    fdo#46808, Convert singleton theBrowseNodeFactory to new style
    
    Change-Id: I68fa7f5dde1928e895575bc602b54de83279fb7c

diff --git a/cui/source/customize/cfgutil.cxx b/cui/source/customize/cfgutil.cxx
index 98bec2a..174a3fd 100644
--- a/cui/source/customize/cfgutil.cxx
+++ b/cui/source/customize/cfgutil.cxx
@@ -29,7 +29,7 @@
 #include <com/sun/star/frame/XDispatchInformationProvider.hpp>
 #include <com/sun/star/script/browse/XBrowseNode.hpp>
 #include <com/sun/star/script/browse/BrowseNodeTypes.hpp>
-#include <com/sun/star/script/browse/XBrowseNodeFactory.hpp>
+#include <com/sun/star/script/browse/theBrowseNodeFactory.hpp>
 #include <com/sun/star/script/browse/BrowseNodeFactoryViewTypes.hpp>
 #include <com/sun/star/script/provider/XScriptProviderSupplier.hpp>
 #include <com/sun/star/script/provider/XScriptProvider.hpp>
@@ -567,8 +567,7 @@ void SfxConfigGroupListBox_Impl::Init(const css::uno::Reference< css::uno::XComp
         comphelper::getProcessComponentContext() );
     try
     {
-        Reference< browse::XBrowseNodeFactory > xFac( xCtx->getValueByName(
-           OUString( "/singletons/com.sun.star.script.browse.theBrowseNodeFactory") ), UNO_QUERY_THROW );
+        Reference< browse::XBrowseNodeFactory > xFac = browse::theBrowseNodeFactory::get( xCtx );
         rootNode.set( xFac->createView( browse::BrowseNodeFactoryViewTypes::MACROSELECTOR ) );
     }
     catch( Exception& e )
diff --git a/cui/source/customize/selector.cxx b/cui/source/customize/selector.cxx
index 89d0a76..1f2105c 100644
--- a/cui/source/customize/selector.cxx
+++ b/cui/source/customize/selector.cxx
@@ -49,6 +49,7 @@
 #include <com/sun/star/frame/UICommandDescription.hpp>
 #include <com/sun/star/script/provider/XScriptProviderSupplier.hpp>
 #include <com/sun/star/script/provider/XScriptProvider.hpp>
+#include <com/sun/star/script/browse/theBrowseNodeFactory.hpp>
 #include <com/sun/star/script/browse/XBrowseNode.hpp>
 #include <com/sun/star/script/browse/BrowseNodeTypes.hpp>
 #include <com/sun/star/script/browse/XBrowseNodeFactory.hpp>
@@ -484,8 +485,7 @@ void SvxConfigGroupListBox::Init(bool bShowSlots, const Reference< frame::XFrame
 
     try
     {
-        Reference< browse::XBrowseNodeFactory > xFac( xContext->getValueByName(
-                                                          OUString( "/singletons/com.sun.star.script.browse.theBrowseNodeFactory") ), UNO_QUERY_THROW );
+        Reference< browse::XBrowseNodeFactory > xFac = browse::theBrowseNodeFactory::get( xContext );
         rootNode.set( xFac->createView( browse::BrowseNodeFactoryViewTypes::MACROSELECTOR ) );
     }
     catch( const Exception& )
diff --git a/cui/source/dialogs/scriptdlg.cxx b/cui/source/dialogs/scriptdlg.cxx
index cc3bcc0..672ff5e 100644
--- a/cui/source/dialogs/scriptdlg.cxx
+++ b/cui/source/dialogs/scriptdlg.cxx
@@ -37,6 +37,7 @@
 #include <com/sun/star/script/browse/BrowseNodeTypes.hpp>
 #include <com/sun/star/script/browse/XBrowseNodeFactory.hpp>
 #include <com/sun/star/script/browse/BrowseNodeFactoryViewTypes.hpp>
+#include <com/sun/star/script/browse/theBrowseNodeFactory.hpp>
 #include <com/sun/star/script/provider/ScriptErrorRaisedException.hpp>
 #include <com/sun/star/script/provider/ScriptExceptionRaisedException.hpp>
 #include <com/sun/star/script/provider/ScriptFrameworkErrorType.hpp>
@@ -166,12 +167,9 @@ void SFTreeListBox::Init( const OUString& language  )
     OUString userStr("user");
     OUString shareStr("share");
 
-    OUString singleton("/singletons/com.sun.star.script.browse.theBrowseNodeFactory");
-
     try
     {
-        Reference< browse::XBrowseNodeFactory > xFac(
-            xCtx->getValueByName( singleton ), UNO_QUERY_THROW );
+        Reference< browse::XBrowseNodeFactory > xFac = browse::theBrowseNodeFactory::get(xCtx);
 
         rootNode.set( xFac->createView(
             browse::BrowseNodeFactoryViewTypes::MACROORGANIZER ) );
diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk
index 79130aa..b73b86a 100644
--- a/offapi/UnoApi_offapi.mk
+++ b/offapi/UnoApi_offapi.mk
@@ -305,6 +305,9 @@ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/script,\
 	DocumentDialogLibraryContainer \
 	DocumentScriptLibraryContainer \
 ))
+$(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/script/browse,\
+	theBrowseNodeFactory \
+))
 $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/script/provider,\
 	theMasterScriptProviderFactory \
 	MasterScriptProviderFactory \
@@ -1030,7 +1033,6 @@ $(eval $(call gb_UnoApi_add_idlfiles_noheader,offapi,offapi/com/sun/star/report/
 $(eval $(call gb_UnoApi_add_idlfiles_noheader,offapi,offapi/com/sun/star/script/browse,\
 	BrowseNode \
 	BrowseNodeFactory \
-	theBrowseNodeFactory \
 ))
 $(eval $(call gb_UnoApi_add_idlfiles_noheader,offapi,offapi/com/sun/star/script/provider,\
 	LanguageScriptProvider \
diff --git a/offapi/com/sun/star/script/browse/BrowseNodeFactory.idl b/offapi/com/sun/star/script/browse/BrowseNodeFactory.idl
index 72d2cab..a600b6a 100644
--- a/offapi/com/sun/star/script/browse/BrowseNodeFactory.idl
+++ b/offapi/com/sun/star/script/browse/BrowseNodeFactory.idl
@@ -28,6 +28,7 @@ module com { module sun { module star { module script { module browse {
     This service is used to create Root XBrowseNodes.
 
     @since OOo 2.0
+    @deprecated use the singleton theBrowseNodeFactory
 */
 service BrowseNodeFactory
 {
diff --git a/offapi/com/sun/star/script/browse/theBrowseNodeFactory.idl b/offapi/com/sun/star/script/browse/theBrowseNodeFactory.idl
index 9cedab8..e07cc11 100644
--- a/offapi/com/sun/star/script/browse/theBrowseNodeFactory.idl
+++ b/offapi/com/sun/star/script/browse/theBrowseNodeFactory.idl
@@ -20,7 +20,7 @@
 #ifndef __com_sun_star_script_browse_theBrowseNodeFactory_idl__
 #define __com_sun_star_script_browse_theBrowseNodeFactory_idl__
 
-#include <com/sun/star/script/browse/BrowseNodeFactory.idl>
+#include <com/sun/star/script/browse/XBrowseNodeFactory.idl>
 
 module com { module sun { module star { module script { module browse {
 
@@ -34,10 +34,7 @@ module com { module sun { module star { module script { module browse {
 
     @since OOo 2.0
 */
-singleton theBrowseNodeFactory
-{
-    service BrowseNodeFactory;
-};
+singleton theBrowseNodeFactory : XBrowseNodeFactory;
 
 }; }; }; }; };
 
commit bae42fd6dac1d6fa8330eeede66ec22cddb82311
Author: Noel Grandin <noel at peralex.com>
Date:   Tue May 14 14:09:29 2013 +0200

    fdo#46808, Convert chart2::RegressionEquation service to new style
    
    The service already existed, it just needed an IDL file
    
    Change-Id: I56b7079b098a7615dfb24598d15fe7d57691f317

diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk
index 90a54de..79130aa 100644
--- a/offapi/UnoApi_offapi.mk
+++ b/offapi/UnoApi_offapi.mk
@@ -81,6 +81,7 @@ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/chart2,\
 	FormattedString \
 	PolarCoordinateSystem2d \
 	PolarCoordinateSystem3d \
+	RegressionEquation \
 ))
 $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/chart2/data,\
 	DatabaseDataProvider \
diff --git a/offapi/com/sun/star/chart2/RegressionEquation.idl b/offapi/com/sun/star/chart2/RegressionEquation.idl
new file mode 100644
index 0000000..9fc7ac9
--- /dev/null
+++ b/offapi/com/sun/star/chart2/RegressionEquation.idl
@@ -0,0 +1,35 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ *   Licensed to the Apache Software Foundation (ASF) under one or more
+ *   contributor license agreements. See the NOTICE file distributed
+ *   with this work for additional information regarding copyright
+ *   ownership. The ASF licenses this file to you under the Apache
+ *   License, Version 2.0 (the "License"); you may not use this file
+ *   except in compliance with the License. You may obtain a copy of
+ *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef com_sun_star_chart2_RegressionCurveEquation_idl
+#define com_sun_star_chart2_RegressionCurveEquation_idl
+
+#include <com/sun/star/beans/XPropertySet.idl>
+
+module com { module sun { module star { module chart2 {
+
+/**
+    @since LibreOffice 4.1
+*/
+service RegressionEquation : com::sun::star::beans::XPropertySet;
+
+}; }; }; };
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/xmloff/source/chart/SchXMLPlotAreaContext.cxx b/xmloff/source/chart/SchXMLPlotAreaContext.cxx
index a8663f5..d8b56b2 100644
--- a/xmloff/source/chart/SchXMLPlotAreaContext.cxx
+++ b/xmloff/source/chart/SchXMLPlotAreaContext.cxx
@@ -39,7 +39,6 @@
 
 #include <com/sun/star/awt/Point.hpp>
 #include <com/sun/star/awt/Size.hpp>
-
 #include <com/sun/star/chart/ChartDataRowSource.hpp>
 #include <com/sun/star/chart/ChartErrorCategory.hpp>
 #include <com/sun/star/chart/ChartErrorIndicatorType.hpp>
@@ -47,14 +46,13 @@
 #include <com/sun/star/chart/X3DDisplay.hpp>
 #include <com/sun/star/chart/XStatisticDisplay.hpp>
 #include <com/sun/star/chart/XDiagramPositioning.hpp>
-
+#include <com/sun/star/chart2/RegressionEquation.hpp>
+#include <com/sun/star/chart2/RelativePosition.hpp>
+#include <com/sun/star/chart2/XChartTypeContainer.hpp>
+#include <com/sun/star/chart2/XDataSeriesContainer.hpp>
 #include <com/sun/star/chart2/data/XDataSink.hpp>
 #include <com/sun/star/chart2/data/XRangeXMLConversion.hpp>
 #include <com/sun/star/chart2/data/LabeledDataSequence.hpp>
-#include <com/sun/star/chart2/XChartTypeContainer.hpp>
-#include <com/sun/star/chart2/XDataSeriesContainer.hpp>
-#include <com/sun/star/chart2/RelativePosition.hpp>
-
 #include <com/sun/star/drawing/CameraGeometry.hpp>
 #include <com/sun/star/drawing/FillStyle.hpp>
 #include <com/sun/star/lang/XServiceInfo.hpp>
@@ -1316,42 +1314,36 @@ void SchXMLEquationContext::StartElement( const uno::Reference< xml::sax::XAttri
 
     if( !sAutoStyleName.isEmpty() || bShowEquation || bShowRSquare )
     {
-        uno::Reference< beans::XPropertySet > xEqProp;
-        uno::Reference< lang::XMultiServiceFactory > xFact( comphelper::getProcessServiceFactory(), uno::UNO_QUERY );
-        if( xFact.is())
-            xEqProp.set( xFact->createInstance(
-                             OUString(  "com.sun.star.chart2.RegressionEquation" )), uno::UNO_QUERY );
-        if( xEqProp.is())
+        uno::Reference< beans::XPropertySet > xEqProp = chart2::RegressionEquation::create( comphelper::getProcessComponentContext() );
+
+        if( !sAutoStyleName.isEmpty() )
         {
-            if( !sAutoStyleName.isEmpty() )
+            const SvXMLStylesContext* pStylesCtxt = mrImportHelper.GetAutoStylesContext();
+            if( pStylesCtxt )
             {
-                const SvXMLStylesContext* pStylesCtxt = mrImportHelper.GetAutoStylesContext();
-                if( pStylesCtxt )
-                {
-                    const SvXMLStyleContext* pStyle = pStylesCtxt->FindStyleChildContext(
-                        mrImportHelper.GetChartFamilyID(), sAutoStyleName );
-                    // note: SvXMLStyleContext::FillPropertySet is not const
-                    XMLPropStyleContext * pPropStyleContext =
-                        const_cast< XMLPropStyleContext * >( dynamic_cast< const XMLPropStyleContext * >( pStyle ));
+                const SvXMLStyleContext* pStyle = pStylesCtxt->FindStyleChildContext(
+                    mrImportHelper.GetChartFamilyID(), sAutoStyleName );
+                // note: SvXMLStyleContext::FillPropertySet is not const
+                XMLPropStyleContext * pPropStyleContext =
+                    const_cast< XMLPropStyleContext * >( dynamic_cast< const XMLPropStyleContext * >( pStyle ));
 
-                    if( pPropStyleContext )
-                        pPropStyleContext->FillPropertySet( xEqProp );
-                }
+                if( pPropStyleContext )
+                    pPropStyleContext->FillPropertySet( xEqProp );
             }
-            xEqProp->setPropertyValue( OUString( "ShowEquation"), uno::makeAny( bShowEquation ));
-            xEqProp->setPropertyValue( OUString( "ShowCorrelationCoefficient"), uno::makeAny( bShowRSquare ));
+        }
+        xEqProp->setPropertyValue( OUString( "ShowEquation"), uno::makeAny( bShowEquation ));
+        xEqProp->setPropertyValue( OUString( "ShowCorrelationCoefficient"), uno::makeAny( bShowRSquare ));
 
-            if( bHasXPos && bHasYPos )
-            {
-                chart2::RelativePosition aRelPos;
-                aRelPos.Primary = static_cast< double >( aPosition.X ) / static_cast< double >( maChartSize.Width );
-                aRelPos.Secondary = static_cast< double >( aPosition.Y ) / static_cast< double >( maChartSize.Height );
-                xEqProp->setPropertyValue( OUString(  "RelativePosition" ),
-                                           uno::makeAny( aRelPos ));
-            }
-            SAL_WARN_IF( mrRegressionStyle.meType != DataRowPointStyle::REGRESSION, "xmloff.chart", "mrRegressionStyle.meType != DataRowPointStyle::REGRESSION" );
-            mrRegressionStyle.m_xEquationProperties.set( xEqProp );
+        if( bHasXPos && bHasYPos )
+        {
+            chart2::RelativePosition aRelPos;
+            aRelPos.Primary = static_cast< double >( aPosition.X ) / static_cast< double >( maChartSize.Width );
+            aRelPos.Secondary = static_cast< double >( aPosition.Y ) / static_cast< double >( maChartSize.Height );
+            xEqProp->setPropertyValue( OUString(  "RelativePosition" ),
+                                       uno::makeAny( aRelPos ));
         }
+        SAL_WARN_IF( mrRegressionStyle.meType != DataRowPointStyle::REGRESSION, "xmloff.chart", "mrRegressionStyle.meType != DataRowPointStyle::REGRESSION" );
+        mrRegressionStyle.m_xEquationProperties.set( xEqProp );
     }
 }
 
commit b12dab7bd204e65323079cc6809417c9b5dcb656
Author: Noel Grandin <noel at peralex.com>
Date:   Tue May 14 13:58:40 2013 +0200

    fdo#46808, Convert some XMultiServiceFactory to XComponentContext
    
    Change-Id: I2e3480bf4f616231ee50a83f440d9bb0955e4ce6

diff --git a/xmloff/source/draw/animationimport.cxx b/xmloff/source/draw/animationimport.cxx
index 035fe7e..12f587e 100644
--- a/xmloff/source/draw/animationimport.cxx
+++ b/xmloff/source/draw/animationimport.cxx
@@ -644,8 +644,6 @@ AnimationNodeContext::AnimationNodeContext(
         }
         else
         {
-            Reference< XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() );
-
             sal_Int16 nPresetClass = EffectPresetClass::CUSTOM;
 
             const sal_Char* pServiceName = 0;
@@ -698,10 +696,13 @@ AnimationNodeContext::AnimationNodeContext(
                 pServiceName = 0;
             }
 
-            if( pServiceName && xFactory.is() )
+            if( pServiceName )
             {
-                mxNode = Reference< XAnimationNode >( xFactory->createInstance(
-                    OUString::createFromAscii(pServiceName) ), UNO_QUERY_THROW );
+                Reference< XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
+
+                mxNode = Reference< XAnimationNode >(
+                    xContext->getServiceManager()->createInstanceWithContext(OUString::createFromAscii(pServiceName), xContext),
+                    UNO_QUERY_THROW );
 
                 if( nPresetClass != EffectPresetClass::CUSTOM )
                 {
diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx
index 33d60de..14ec5c8 100644
--- a/xmloff/source/draw/shapeexport.cxx
+++ b/xmloff/source/draw/shapeexport.cxx
@@ -149,9 +149,9 @@ uno::Reference< drawing::XShape > XMLShapeExport::checkForCustomShapeReplacement
                 {
                     aEngine = "com.sun.star.drawing.EnhancedCustomShapeEngine";
                 }
-                uno::Reference< lang::XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() );
+                uno::Reference< uno::XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
 
-                if ( !aEngine.isEmpty() && xFactory.is() )
+                if ( !aEngine.isEmpty() )
                 {
                     uno::Sequence< uno::Any > aArgument( 1 );
                     uno::Sequence< beans::PropertyValue > aPropValues( 2 );
@@ -161,7 +161,8 @@ uno::Reference< drawing::XShape > XMLShapeExport::checkForCustomShapeReplacement
                     aPropValues[ 1 ].Name = OUString( "ForceGroupWithText" );
                     aPropValues[ 1 ].Value <<= bForceGroupWithText;
                     aArgument[ 0 ] <<= aPropValues;
-                    uno::Reference< uno::XInterface > xInterface( xFactory->createInstanceWithArguments( aEngine, aArgument ) );
+                    uno::Reference< uno::XInterface > xInterface(
+                        xContext->getServiceManager()->createInstanceWithArgumentsAndContext(aEngine, aArgument, xContext) );
                     if ( xInterface.is() )
                     {
                         uno::Reference< drawing::XCustomShapeEngine > xCustomShapeEngine(
diff --git a/xmloff/source/transform/OOo2Oasis.cxx b/xmloff/source/transform/OOo2Oasis.cxx
index b4ac5ca..b219f63 100644
--- a/xmloff/source/transform/OOo2Oasis.cxx
+++ b/xmloff/source/transform/OOo2Oasis.cxx
@@ -1970,21 +1970,17 @@ void SAL_CALL OOo2OasisTransformer::Initialize(
     Reference< XDocumentHandler > xDocHandler;
     if( !m_aSubServiceName.isEmpty() )
     {
-        Reference< XMultiServiceFactory > xFactory =
-            comphelper::getProcessServiceFactory();
-        if( xFactory.is() )
+        Reference< XComponentContext > xContext =
+            comphelper::getProcessComponentContext();
+        try
+        {
+            // get filter component
+            xDocHandler = Reference< XDocumentHandler >(
+                    xContext->getServiceManager()->createInstanceWithArgumentsAndContext(m_aSubServiceName, rArguments, xContext),
+                    UNO_QUERY);
+        }
+        catch( Exception& )
         {
-            try
-            {
-                // get filter component
-                xDocHandler = Reference< XDocumentHandler >(
-                        xFactory->createInstanceWithArguments( m_aSubServiceName,
-                                                               rArguments ),
-                        UNO_QUERY);
-            }
-            catch( Exception& )
-            {
-            }
         }
     }
 
commit 33b4dc22f84e8f950b73daceb7339cfecf7fab81
Author: Noel Grandin <noel at peralex.com>
Date:   Tue May 14 13:51:41 2013 +0200

    fdo#46808, Use service constructor
    
    Change-Id: I31a812dfd84a33e3b5f6f44bbd786e14a465886e

diff --git a/basctl/source/dlged/dlged.cxx b/basctl/source/dlged/dlged.cxx
index 1e1b927..935dcfd 100644
--- a/basctl/source/dlged/dlged.cxx
+++ b/basctl/source/dlged/dlged.cxx
@@ -33,7 +33,7 @@
 #include "baside3.hxx"
 
 #include <com/sun/star/awt/XDialog.hpp>
-#include <com/sun/star/resource/XStringResourcePersistence.hpp>
+#include <com/sun/star/resource/StringResource.hpp>
 #include <com/sun/star/util/XCloneable.hpp>
 #include <com/sun/star/util/NumberFormatsSupplier.hpp>
 #include <comphelper/types.hxx>
@@ -932,11 +932,8 @@ void DlgEditor::Paste()
                     Reference< resource::XStringResourcePersistence > xStringResourcePersistence;
                     if( nCtrls > 0 && bSourceIsLocalized )
                     {
-                        Reference< lang::XMultiServiceFactory > xSMgr = getProcessServiceFactory();
-                        xStringResourcePersistence = Reference< resource::XStringResourcePersistence >( xSMgr->createInstance
-                            ( "com.sun.star.resource.StringResource" ), UNO_QUERY );
-                        if( xStringResourcePersistence.is() )
-                            xStringResourcePersistence->importBinary( aResData );
+                        xStringResourcePersistence = css::resource::StringResource::create( getProcessComponentContext() );
+                        xStringResourcePersistence->importBinary( aResData );
                     }
                     for( sal_uInt32 n = 0; n < nCtrls; n++ )
                     {


More information about the Libreoffice-commits mailing list