[Libreoffice-commits] core.git: basic/source include/basic sfx2/source

Noel Grandin noelgrandin at gmail.com
Mon Feb 8 12:31:32 UTC 2016


 basic/source/basmgr/basmgr.cxx       |    7 +++----
 basic/source/uno/modsizeexceeded.cxx |    4 ++--
 basic/source/uno/scriptcont.cxx      |    2 +-
 include/basic/basmgr.hxx             |    2 +-
 include/basic/modsizeexceeded.hxx    |    3 ++-
 sfx2/source/appl/appbaslib.cxx       |    2 +-
 sfx2/source/doc/objstor.cxx          |    2 +-
 sfx2/source/inc/appbaslib.hxx        |    3 ++-
 8 files changed, 13 insertions(+), 12 deletions(-)

New commits:
commit 4c411636d9f3e8be085ca02af6fad448838834b1
Author: Noel Grandin <noelgrandin at gmail.com>
Date:   Sat Feb 6 16:06:48 2016 +0200

    sequence->vector in basic
    
    Change-Id: Ic42f7218bda81effe870d950f666ba7653d60c66
    Reviewed-on: https://gerrit.libreoffice.org/22177
    Reviewed-by: Noel Grandin <noelgrandin at gmail.com>
    Tested-by: Noel Grandin <noelgrandin at gmail.com>

diff --git a/basic/source/basmgr/basmgr.cxx b/basic/source/basmgr/basmgr.cxx
index fce79ca..c558e8b 100644
--- a/basic/source/basmgr/basmgr.cxx
+++ b/basic/source/basmgr/basmgr.cxx
@@ -1508,7 +1508,7 @@ uno::Any BasicManager::SetGlobalUNOConstant( const sal_Char* _pAsciiName, const
     return aOldValue;
 }
 
-bool BasicManager::LegacyPsswdBinaryLimitExceeded( uno::Sequence< OUString >& _out_rModuleNames )
+bool BasicManager::LegacyPsswdBinaryLimitExceeded( std::vector< OUString >& _out_rModuleNames )
 {
     try
     {
@@ -1531,7 +1531,7 @@ bool BasicManager::LegacyPsswdBinaryLimitExceeded( uno::Sequence< OUString >& _o
             uno::Sequence< OUString > aElementNames( xScriptLibrary->getElementNames() );
             sal_Int32 nLen = aElementNames.getLength();
 
-            uno::Sequence< OUString > aBigModules( nLen );
+            std::vector< OUString > aBigModules( nLen );
             sal_Int32 nBigModules = 0;
 
             const OUString* pElementNames = aElementNames.getConstArray();
@@ -1545,8 +1545,7 @@ bool BasicManager::LegacyPsswdBinaryLimitExceeded( uno::Sequence< OUString >& _o
 
             if ( nBigModules )
             {
-                aBigModules.realloc( nBigModules );
-                _out_rModuleNames = aBigModules;
+                 _out_rModuleNames.swap(aBigModules);
                 return true;
             }
         }
diff --git a/basic/source/uno/modsizeexceeded.cxx b/basic/source/uno/modsizeexceeded.cxx
index 3723511..a0cf139 100644
--- a/basic/source/uno/modsizeexceeded.cxx
+++ b/basic/source/uno/modsizeexceeded.cxx
@@ -26,10 +26,10 @@ using namespace com::sun::star;
 using namespace cppu;
 using namespace osl;
 
-ModuleSizeExceeded::ModuleSizeExceeded( const uno::Sequence< OUString >& sModules )
+ModuleSizeExceeded::ModuleSizeExceeded( const std::vector< OUString >& sModules )
 {
     script::ModuleSizeExceededRequest aReq;
-    aReq.Names = sModules;
+    aReq.Names = comphelper::containerToSequence(sModules);
 
     m_aRequest <<= aReq;
 
diff --git a/basic/source/uno/scriptcont.cxx b/basic/source/uno/scriptcont.cxx
index f548c0a..ab49180 100644
--- a/basic/source/uno/scriptcont.cxx
+++ b/basic/source/uno/scriptcont.cxx
@@ -574,7 +574,7 @@ bool SfxScriptLibraryContainer::implStorePasswordLibrary( SfxLibrary* pLib, cons
     // Only need to handle the export case here,
     // save/saveas etc are handled in sfxbasemodel::storeSelf &
     // sfxbasemodel::impl_store
-    uno::Sequence<OUString> aNames;
+    std::vector<OUString> aNames;
     if ( bExport && pBasicMgr->LegacyPsswdBinaryLimitExceeded(aNames) )
     {
         if ( xHandler.is() )
diff --git a/include/basic/basmgr.hxx b/include/basic/basmgr.hxx
index d64259a..c9227ee 100644
--- a/include/basic/basmgr.hxx
+++ b/include/basic/basmgr.hxx
@@ -194,7 +194,7 @@ public:
         @param _out_rModuleNames
             takes the names of modules whose size exceeds the legacy limit
     */
-    bool            LegacyPsswdBinaryLimitExceeded( css::uno::Sequence< OUString >& _out_rModuleNames );
+    bool            LegacyPsswdBinaryLimitExceeded( std::vector< OUString >& _out_rModuleNames );
     bool HasExeCode( const OUString& );
     /// determines whether the Basic Manager has a given macro, given by fully qualified name
     bool            HasMacro( OUString const& i_fullyQualifiedName ) const;
diff --git a/include/basic/modsizeexceeded.hxx b/include/basic/modsizeexceeded.hxx
index 1ddec37..5f9cc18 100644
--- a/include/basic/modsizeexceeded.hxx
+++ b/include/basic/modsizeexceeded.hxx
@@ -23,12 +23,13 @@
 #include <com/sun/star/task/XInteractionHandler.hpp>
 #include <cppuhelper/implbase1.hxx>
 #include <basic/basicdllapi.h>
+#include <vector>
 
 class BASIC_DLLPUBLIC ModuleSizeExceeded : public ::cppu::WeakImplHelper1< css::task::XInteractionRequest >
 {
 // C++ interface
 public:
-    ModuleSizeExceeded( const css::uno::Sequence<OUString>& sModules );
+    ModuleSizeExceeded( const std::vector<OUString>& sModules );
 
     bool isAbort() const;
     bool isApprove() const;
diff --git a/sfx2/source/appl/appbaslib.cxx b/sfx2/source/appl/appbaslib.cxx
index 78e0def..a49aa7d 100644
--- a/sfx2/source/appl/appbaslib.cxx
+++ b/sfx2/source/appl/appbaslib.cxx
@@ -156,7 +156,7 @@ void SfxBasicManagerHolder::impl_releaseContainers()
     mxDialogContainer.clear();
 }
 
-bool SfxBasicManagerHolder::LegacyPsswdBinaryLimitExceeded( Sequence< OUString >& sModules )
+bool SfxBasicManagerHolder::LegacyPsswdBinaryLimitExceeded( std::vector< OUString >& sModules )
 {
 #if !HAVE_FEATURE_SCRIPTING
     (void) sModules;
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 8751873..fe4b461 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -3610,7 +3610,7 @@ bool SfxObjectShell::QuerySaveSizeExceededModules_Impl( const uno::Reference< ta
 
     if ( !pImp->aBasicManager.isValid() )
         GetBasicManager();
-    uno::Sequence< OUString > sModules;
+    std::vector< OUString > sModules;
     if ( xHandler.is() )
     {
         if( pImp->aBasicManager.LegacyPsswdBinaryLimitExceeded( sModules ) )
diff --git a/sfx2/source/inc/appbaslib.hxx b/sfx2/source/inc/appbaslib.hxx
index f905904..9c07c66 100644
--- a/sfx2/source/inc/appbaslib.hxx
+++ b/sfx2/source/inc/appbaslib.hxx
@@ -25,6 +25,7 @@
 #include <com/sun/star/uno/Sequence.hxx>
 #include <com/sun/star/script/XStorageBasedLibraryContainer.hpp>
 #include <com/sun/star/embed/XStorage.hpp>
+#include <vector>
 
 class BasicManager;
 
@@ -85,7 +86,7 @@ public:
     /** checks if any modules in the SfxLibraryContainer exceed the binary
         limits.
     */
-    bool LegacyPsswdBinaryLimitExceeded( css::uno::Sequence< OUString >& sModules );
+    bool LegacyPsswdBinaryLimitExceeded( std::vector< OUString >& sModules );
 
     virtual void Notify(SfxBroadcaster& rBC, SfxHint const& rHint) override;
 


More information about the Libreoffice-commits mailing list