[Libreoffice-commits] core.git: sc/source sfx2/source sw/source

Matteo Casalin matteo.casalin at yahoo.com
Fri Mar 17 20:14:04 UTC 2017


 sc/source/ui/docshell/docsh4.cxx          |    2 +-
 sc/source/ui/miscdlgs/instbdlg.cxx        |    3 +--
 sc/source/ui/miscdlgs/linkarea.cxx        |    3 +--
 sfx2/source/doc/objserv.cxx               |    5 ++---
 sfx2/source/doc/objstor.cxx               |    2 +-
 sfx2/source/view/viewfrm2.cxx             |    2 +-
 sw/source/ui/dbui/mmdocselectpage.cxx     |    2 +-
 sw/source/ui/misc/glossary.cxx            |    2 +-
 sw/source/uibase/app/docsh2.cxx           |   12 +++++-------
 sw/source/uibase/dbui/mailmergehelper.cxx |    2 +-
 sw/source/uibase/uiview/view2.cxx         |    6 ++++--
 11 files changed, 19 insertions(+), 22 deletions(-)

New commits:
commit b93a015f9bbed007a8800ef040ec2b6211d33858
Author: Matteo Casalin <matteo.casalin at yahoo.com>
Date:   Thu Mar 16 21:21:25 2017 +0100

    Use SfxObjectFactory::GetFactoryName/URL
    
    instead of OUString::createFromAscii( GetShortName() ), in one case
    manually added to factory URL prefix.
    
    Change-Id: I762fc1bcd6dcf7246531816faad2682caf9133fb
    Reviewed-on: https://gerrit.libreoffice.org/35371
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Matteo Casalin <matteo.casalin at yahoo.com>

diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index 53b88a7a7fb0..1ee2f8bfa646 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -729,7 +729,7 @@ void ScDocShell::Execute( SfxRequest& rReq )
                     pImpl->pRequest = new SfxRequest( rReq );
                     delete pImpl->pDocInserter;
                     pImpl->pDocInserter = new ::sfx2::DocumentInserter(
-                        OUString::createFromAscii( ScDocShell::Factory().GetShortName() ), false );
+                        ScDocShell::Factory().GetFactoryName(), false );
                     pImpl->pDocInserter->StartExecuteModal( LINK( this, ScDocShell, DialogClosedHdl ) );
                     return ;
                 }
diff --git a/sc/source/ui/miscdlgs/instbdlg.cxx b/sc/source/ui/miscdlgs/instbdlg.cxx
index 241b370ac4d9..27e6ff5f56dc 100644
--- a/sc/source/ui/miscdlgs/instbdlg.cxx
+++ b/sc/source/ui/miscdlgs/instbdlg.cxx
@@ -274,8 +274,7 @@ IMPL_LINK_NOARG(ScInsertTableDlg, ChoiceHdl_Impl, Button*, void)
 IMPL_LINK_NOARG(ScInsertTableDlg, BrowseHdl_Impl, Button*, void)
 {
     delete pDocInserter;
-    pDocInserter = new ::sfx2::DocumentInserter(
-            OUString::createFromAscii( ScDocShell::Factory().GetShortName() ) );
+    pDocInserter = new ::sfx2::DocumentInserter(ScDocShell::Factory().GetFactoryName());
     pDocInserter->StartExecuteModal( LINK( this, ScInsertTableDlg, DialogClosedHdl ) );
 }
 
diff --git a/sc/source/ui/miscdlgs/linkarea.cxx b/sc/source/ui/miscdlgs/linkarea.cxx
index 94fc4e677dff..180e089f305e 100644
--- a/sc/source/ui/miscdlgs/linkarea.cxx
+++ b/sc/source/ui/miscdlgs/linkarea.cxx
@@ -84,8 +84,7 @@ void ScLinkedAreaDlg::dispose()
 IMPL_LINK_NOARG(ScLinkedAreaDlg, BrowseHdl, Button*, void)
 {
     if ( !pDocInserter )
-        pDocInserter = new sfx2::DocumentInserter(
-            OUString::createFromAscii( ScDocShell::Factory().GetShortName() ) );
+        pDocInserter = new sfx2::DocumentInserter(ScDocShell::Factory().GetFactoryName());
     pDocInserter->StartExecuteModal( LINK( this, ScLinkedAreaDlg, DialogClosedHdl ) );
 }
 
diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
index 95048d118856..f354797da5a1 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -275,7 +275,7 @@ bool SfxObjectShell::APISaveAs_Impl(const OUString& aFileName, SfxItemSet& rItem
             const SfxStringItem* pContentTypeItem = rItemSet.GetItem<SfxStringItem>(SID_CONTENTTYPE, false);
             if ( pContentTypeItem )
             {
-                std::shared_ptr<const SfxFilter> pFilter = SfxFilterMatcher( OUString::createFromAscii(GetFactory().GetShortName()) ).GetFilter4Mime( pContentTypeItem->GetValue(), SfxFilterFlags::EXPORT );
+                std::shared_ptr<const SfxFilter> pFilter = SfxFilterMatcher( GetFactory().GetFactoryName() ).GetFilter4Mime( pContentTypeItem->GetValue(), SfxFilterFlags::EXPORT );
                 if ( pFilter )
                     aFilterName = pFilter->GetName();
             }
@@ -457,8 +457,7 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
                 }
                 else
                 {
-                    aURL = "private:factory/" + OUString::createFromAscii( GetFactory().GetShortName() );
-
+                    aURL = GetFactory().GetFactoryURL();
                     aTitle = GetTitle();
                 }
 
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 4f70a1db4068..420cb6ecd35c 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -2588,7 +2588,7 @@ bool SfxObjectShell::Save_Impl( const SfxItemSet* pSet )
         OUString aFilterName;
         std::shared_ptr<const SfxFilter> pFilter;
         if ( pFilterItem )
-            pFilter = SfxFilterMatcher( OUString::createFromAscii( GetFactory().GetShortName()) ).GetFilter4FilterName( aFilterName );
+            pFilter = SfxFilterMatcher( GetFactory().GetFactoryName() ).GetFilter4FilterName( aFilterName );
 
         SfxMedium *pMed = new SfxMedium(
             pSalvageItem->GetValue(), StreamMode::READWRITE | StreamMode::SHARE_DENYWRITE | StreamMode::TRUNC, pFilter );
diff --git a/sfx2/source/view/viewfrm2.cxx b/sfx2/source/view/viewfrm2.cxx
index 5fbe65757128..56afe2fcb781 100644
--- a/sfx2/source/view/viewfrm2.cxx
+++ b/sfx2/source/view/viewfrm2.cxx
@@ -116,7 +116,7 @@ void SfxViewFrame::UpdateTitle()
 {
 
     const SfxObjectFactory &rFact = GetObjectShell()->GetFactory();
-    m_pImpl->aFactoryName = OUString::createFromAscii(rFact.GetShortName());
+    m_pImpl->aFactoryName = rFact.GetFactoryName();
 
     SfxObjectShell *pObjSh = GetObjectShell();
     if ( !pObjSh )
diff --git a/sw/source/ui/dbui/mmdocselectpage.cxx b/sw/source/ui/dbui/mmdocselectpage.cxx
index 195e7ea7cd02..e35b8e51b0b5 100644
--- a/sw/source/ui/dbui/mmdocselectpage.cxx
+++ b/sw/source/ui/dbui/mmdocselectpage.cxx
@@ -141,7 +141,7 @@ IMPL_LINK(SwMailMergeDocSelectPage, FileSelectHdl, Button*, pButton, void)
         xFP->setDisplayDirectory( SvtPathOptions().GetWorkPath() );
 
         SfxObjectFactory &rFact = m_pWizard->GetSwView()->GetDocShell()->GetFactory();
-        SfxFilterMatcher aMatcher( OUString::createFromAscii(rFact.GetShortName()) );
+        SfxFilterMatcher aMatcher( rFact.GetFactoryName() );
         SfxFilterMatcherIter aIter( aMatcher );
         Reference<XFilterManager> xFltMgr(xFP, UNO_QUERY);
         std::shared_ptr<const SfxFilter> pFlt = aIter.First();
diff --git a/sw/source/ui/misc/glossary.cxx b/sw/source/ui/misc/glossary.cxx
index da62932dc95d..d43c566d4a20 100644
--- a/sw/source/ui/misc/glossary.cxx
+++ b/sw/source/ui/misc/glossary.cxx
@@ -580,7 +580,7 @@ IMPL_LINK( SwGlossaryDlg, MenuHdl, Menu *, pMn, bool )
         xFP->setDisplayDirectory(aPathOpt.GetWorkPath() );
 
         uno::Reference<XFilterManager> xFltMgr(xFP, UNO_QUERY);
-        SfxFilterMatcher aMatcher( OUString::createFromAscii(SwDocShell::Factory().GetShortName()) );
+        SfxFilterMatcher aMatcher( SwDocShell::Factory().GetFactoryName() );
         SfxFilterMatcherIter aIter( aMatcher );
         std::shared_ptr<const SfxFilter> pFilter = aIter.First();
         while ( pFilter )
diff --git a/sw/source/uibase/app/docsh2.cxx b/sw/source/uibase/app/docsh2.cxx
index cb60351eb8ee..1fa82477ff77 100644
--- a/sw/source/uibase/app/docsh2.cxx
+++ b/sw/source/uibase/app/docsh2.cxx
@@ -507,7 +507,7 @@ void SwDocShell::Execute(SfxRequest& rReq)
                         xFP->setDisplayDirectory( aPathOpt.GetWorkPath() );
 
                         SfxObjectFactory &rFact = GetFactory();
-                        SfxFilterMatcher aMatcher( OUString::createFromAscii(rFact.GetShortName()) );
+                        SfxFilterMatcher aMatcher( rFact.GetFactoryName() );
                         SfxFilterMatcherIter aIter( aMatcher );
                         uno::Reference<XFilterManager> xFltMgr(xFP, UNO_QUERY);
                         std::shared_ptr<const SfxFilter> pFlt = aIter.First();
@@ -1407,8 +1407,7 @@ sal_uLong SwDocShell::LoadStylesFromFile( const OUString& rURL,
     sal_uLong nErr = 0;
 
     // Set filter:
-    OUString sFactory(OUString::createFromAscii(SwDocShell::Factory().GetShortName()));
-    SfxFilterMatcher aMatcher( sFactory );
+    SfxFilterMatcher aMatcher( SwDocShell::Factory().GetFactoryName() );
 
     // search for filter in WebDocShell, too
     SfxMedium aMed( rURL, StreamMode::STD_READ );
@@ -1416,8 +1415,7 @@ sal_uLong SwDocShell::LoadStylesFromFile( const OUString& rURL,
     aMatcher.DetectFilter( aMed, pFlt );
     if(!pFlt)
     {
-        OUString sWebFactory(OUString::createFromAscii(SwWebDocShell::Factory().GetShortName()));
-        SfxFilterMatcher aWebMatcher( sWebFactory );
+        SfxFilterMatcher aWebMatcher( SwWebDocShell::Factory().GetFactoryName() );
         aWebMatcher.DetectFilter( aMed, pFlt );
     }
     // --> OD #i117339# - trigger import only for own formats
@@ -1573,8 +1571,8 @@ int SwFindDocShell( SfxObjectShellRef& xDocSh,
     if (!xMed->GetError())
     {
         SfxFilterMatcher aMatcher( rFilter == "writerglobal8"
-            ? OUString::createFromAscii(SwGlobalDocShell::Factory().GetShortName())
-            : OUString::createFromAscii(SwDocShell::Factory().GetShortName()) );
+            ? SwGlobalDocShell::Factory().GetFactoryName()
+            : SwDocShell::Factory().GetFactoryName() );
 
         // No Filter, so search for it. Else test if the one passed is a valid one
         if( !rFilter.isEmpty() )
diff --git a/sw/source/uibase/dbui/mailmergehelper.cxx b/sw/source/uibase/dbui/mailmergehelper.cxx
index 385e3eb17bb0..675a2e031543 100644
--- a/sw/source/uibase/dbui/mailmergehelper.cxx
+++ b/sw/source/uibase/dbui/mailmergehelper.cxx
@@ -56,7 +56,7 @@ OUString CallSaveAsDialog(OUString& rFilter)
 {
     ::sfx2::FileDialogHelper aDialog( ui::dialogs::TemplateDescription::FILESAVE_AUTOEXTENSION,
                 FileDialogFlags::NONE,
-                OUString::createFromAscii(SwDocShell::Factory().GetShortName()) );
+                SwDocShell::Factory().GetFactoryName() );
 
     if (aDialog.Execute()!=ERRCODE_NONE)
     {
diff --git a/sw/source/uibase/uiview/view2.cxx b/sw/source/uibase/uiview/view2.cxx
index d64523fbd6d5..6fd4a14d59a3 100644
--- a/sw/source/uibase/uiview/view2.cxx
+++ b/sw/source/uibase/uiview/view2.cxx
@@ -2146,8 +2146,10 @@ long SwView::InsertDoc( sal_uInt16 nSlotId, const OUString& rFileName, const OUS
     }
     else
     {
-        OUString sFactory = OUString::createFromAscii( pDocSh->GetFactory().GetShortName() );
-        m_pViewImpl->StartDocumentInserter( sFactory, LINK( this, SwView, DialogClosedHdl ) );
+        m_pViewImpl->StartDocumentInserter(
+            pDocSh->GetFactory().GetFactoryName(),
+            LINK( this, SwView, DialogClosedHdl )
+        );
         return -1;
     }
 


More information about the Libreoffice-commits mailing list