[Libreoffice-commits] .: basctl/source

August Sodora augsod at kemper.freedesktop.org
Thu Dec 8 21:50:55 PST 2011


 basctl/source/basicide/basides1.cxx |    2 -
 basctl/source/basicide/bastype2.cxx |    2 -
 basctl/source/basicide/bastype3.cxx |    2 -
 basctl/source/basicide/bastypes.cxx |   40 ++++++++++++++++++------------------
 basctl/source/basicide/moduldl2.cxx |    6 ++---
 basctl/source/basicide/moduldlg.cxx |    2 -
 basctl/source/inc/bastypes.hxx      |   12 +++++-----
 7 files changed, 33 insertions(+), 33 deletions(-)

New commits:
commit 9c2f9c79aca1e1dc0670d6443fd7865b8dc1ee63
Author: August Sodora <augsod at gmail.com>
Date:   Fri Dec 9 00:50:03 2011 -0500

    String->OUString

diff --git a/basctl/source/basicide/basides1.cxx b/basctl/source/basicide/basides1.cxx
index 9846e6c..b9245db 100644
--- a/basctl/source/basicide/basides1.cxx
+++ b/basctl/source/basicide/basides1.cxx
@@ -550,7 +550,7 @@ void BasicIDEShell::ExecuteGlobal( SfxRequest& rReq )
                     Reference< script::XLibraryContainerPassword > xPasswd( xModLibContainer, UNO_QUERY );
                     if ( xPasswd.is() && xPasswd->isLibraryPasswordProtected( aLibName ) && !xPasswd->isLibraryPasswordVerified( aLibName ) )
                     {
-                        String aPassword;
+                        ::rtl::OUString aPassword;
                         bOK = QueryPassword( xModLibContainer, aLibName, aPassword );
                     }
                 }
diff --git a/basctl/source/basicide/bastype2.cxx b/basctl/source/basicide/bastype2.cxx
index 15ce341..c3ce38a 100644
--- a/basctl/source/basicide/bastype2.cxx
+++ b/basctl/source/basicide/bastype2.cxx
@@ -661,7 +661,7 @@ long BasicTreeListBox::ExpandingHdl()
                     Reference< script::XLibraryContainerPassword > xPasswd( xModLibContainer, UNO_QUERY );
                     if ( xPasswd.is() && xPasswd->isLibraryPasswordProtected( aLibName ) && !xPasswd->isLibraryPasswordVerified( aLibName ) )
                     {
-                        String aPassword;
+                        ::rtl::OUString aPassword;
                         bOK = QueryPassword( xModLibContainer, aLibName, aPassword );
                     }
                 }
diff --git a/basctl/source/basicide/bastype3.cxx b/basctl/source/basicide/bastype3.cxx
index 0edbddc..9f41a7a 100644
--- a/basctl/source/basicide/bastype3.cxx
+++ b/basctl/source/basicide/bastype3.cxx
@@ -78,7 +78,7 @@ void BasicTreeListBox::RequestingChildren( SvLBoxEntry* pEntry )
             Reference< script::XLibraryContainerPassword > xPasswd( xModLibContainer, UNO_QUERY );
             if ( xPasswd.is() && xPasswd->isLibraryPasswordProtected( aOULibName ) && !xPasswd->isLibraryPasswordVerified( aOULibName ) )
             {
-                String aPassword;
+                ::rtl::OUString aPassword;
                 bOK = QueryPassword( xModLibContainer, aLibName, aPassword );
             }
         }
diff --git a/basctl/source/basicide/bastypes.cxx b/basctl/source/basicide/bastypes.cxx
index ca6b97a..c019142 100644
--- a/basctl/source/basicide/bastypes.cxx
+++ b/basctl/source/basicide/bastypes.cxx
@@ -38,6 +38,7 @@
 #include <basic/basmgr.hxx>
 #include <com/sun/star/script/ModuleType.hpp>
 #include <com/sun/star/script/XLibraryContainerPassword.hpp>
+#include <comphelper/string.hxx>
 #include <sfx2/dispatch.hxx>
 #include <sfx2/passwd.hxx>
 #include <sfx2/viewfrm.hxx>
@@ -756,43 +757,43 @@ LibInfoItem* LibInfos::GetInfo( const LibInfoKey& rKey )
     return pItem;
 }
 
-bool QueryDel( const String& rName, const ResId& rId, Window* pParent )
+bool QueryDel( const ::rtl::OUString& rName, const ResId& rId, Window* pParent )
 {
-    String aQuery( rId );
-    String aName( rName );
-    aName += '\'';
-    aName.Insert( '\'', 0 );
-    aQuery.SearchAndReplace( String( RTL_CONSTASCII_USTRINGPARAM( "XX" ) ), aName );
+    ::rtl::OUString aQuery( ResId::toString(rId) );
+    ::rtl::OUStringBuffer aNameBuf( rName );
+    aNameBuf.append('\'');
+    aNameBuf.insert(0, '\'');
+    aQuery = ::comphelper::string::replace(aQuery, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "XX")), aNameBuf.makeStringAndClear());
     QueryBox aQueryBox( pParent, WB_YES_NO | WB_DEF_YES, aQuery );
     return ( aQueryBox.Execute() == RET_YES );
 }
 
-bool QueryDelMacro( const String& rName, Window* pParent )
+bool QueryDelMacro( const ::rtl::OUString& rName, Window* pParent )
 {
     return QueryDel( rName, IDEResId( RID_STR_QUERYDELMACRO ), pParent );
 }
 
-bool QueryReplaceMacro( const String& rName, Window* pParent )
+bool QueryReplaceMacro( const ::rtl::OUString& rName, Window* pParent )
 {
     return QueryDel( rName, IDEResId( RID_STR_QUERYREPLACEMACRO ), pParent );
 }
 
-bool QueryDelDialog( const String& rName, Window* pParent )
+bool QueryDelDialog( const ::rtl::OUString& rName, Window* pParent )
 {
     return QueryDel( rName, IDEResId( RID_STR_QUERYDELDIALOG ), pParent );
 }
 
-bool QueryDelLib( const String& rName, bool bRef, Window* pParent )
+bool QueryDelLib( const ::rtl::OUString& rName, bool bRef, Window* pParent )
 {
     return QueryDel( rName, IDEResId( bRef ? RID_STR_QUERYDELLIBREF : RID_STR_QUERYDELLIB ), pParent );
 }
 
-bool QueryDelModule( const String& rName, Window* pParent )
+bool QueryDelModule( const ::rtl::OUString& rName, Window* pParent )
 {
     return QueryDel( rName, IDEResId( RID_STR_QUERYDELMODULE ), pParent );
 }
 
-bool QueryPassword( const Reference< script::XLibraryContainer >& xLibContainer, const String& rLibName, String& rPassword, bool bRepeat, bool bNewTitle )
+bool QueryPassword( const Reference< script::XLibraryContainer >& xLibContainer, const ::rtl::OUString& rLibName, ::rtl::OUString& rPassword, bool bRepeat, bool bNewTitle )
 {
     bool bOK = false;
     sal_uInt16 nRet = 0;
@@ -806,8 +807,8 @@ bool QueryPassword( const Reference< script::XLibraryContainer >& xLibContainer,
         // set new title
         if ( bNewTitle )
         {
-            String aTitle( IDEResId( RID_STR_ENTERPASSWORD ) );
-            aTitle.SearchAndReplace( String( RTL_CONSTASCII_USTRINGPARAM( "XX" ) ), rLibName );
+            ::rtl::OUString aTitle(ResId::toString(IDEResId(RID_STR_ENTERPASSWORD)));
+            aTitle = ::comphelper::string::replace(aTitle, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("XX")), rLibName);
             pDlg->SetText( aTitle );
         }
 
@@ -817,19 +818,18 @@ bool QueryPassword( const Reference< script::XLibraryContainer >& xLibContainer,
         // verify password
         if ( nRet == RET_OK )
         {
-            ::rtl::OUString aOULibName( rLibName );
-            if ( xLibContainer.is() && xLibContainer->hasByName( aOULibName ) )
+            if ( xLibContainer.is() && xLibContainer->hasByName( rLibName ) )
             {
                 Reference< script::XLibraryContainerPassword > xPasswd( xLibContainer, UNO_QUERY );
-                if ( xPasswd.is() && xPasswd->isLibraryPasswordProtected( aOULibName ) && !xPasswd->isLibraryPasswordVerified( aOULibName ) )
+                if ( xPasswd.is() && xPasswd->isLibraryPasswordProtected( rLibName ) && !xPasswd->isLibraryPasswordVerified( rLibName ) )
                 {
                     rPassword = pDlg->GetPassword();
-                    ::rtl::OUString aOUPassword( rPassword );
-                    bOK = xPasswd->verifyLibraryPassword( aOULibName, aOUPassword );
+                    //                    ::rtl::OUString aOUPassword( rPassword );
+                    bOK = xPasswd->verifyLibraryPassword( rLibName, rPassword );
 
                     if ( !bOK )
                     {
-                        ErrorBox aErrorBox( Application::GetDefDialogParent(), WB_OK, String( IDEResId( RID_STR_WRONGPASSWORD ) ) );
+                        ErrorBox aErrorBox( Application::GetDefDialogParent(), WB_OK, ResId::toString( IDEResId( RID_STR_WRONGPASSWORD ) ) );
                         aErrorBox.Execute();
                     }
                 }
diff --git a/basctl/source/basicide/moduldl2.cxx b/basctl/source/basicide/moduldl2.cxx
index 5777fe8..ebc662c 100644
--- a/basctl/source/basicide/moduldl2.cxx
+++ b/basctl/source/basicide/moduldl2.cxx
@@ -313,7 +313,7 @@ sal_Bool BasicCheckBox::EditingEntry( SvLBoxEntry* pEntry, Selection& )
         Reference< script::XLibraryContainerPassword > xPasswd( xModLibContainer, UNO_QUERY );
         if ( xPasswd.is() && xPasswd->isLibraryPasswordProtected( aOULibName ) && !xPasswd->isLibraryPasswordVerified( aOULibName ) )
         {
-            String aPassword;
+            ::rtl::OUString aPassword;
             Reference< script::XLibraryContainer > xModLibContainer1( xModLibContainer, UNO_QUERY );
             bOK = QueryPassword( xModLibContainer1, aLibName, aPassword );
         }
@@ -1006,7 +1006,7 @@ void LibPage::InsertLib()
 
                             // check, if the library is password protected
                             sal_Bool bOK = sal_False;
-                            String aPassword;
+                            ::rtl::OUString aPassword;
                             if ( xModLibContImport.is() && xModLibContImport->hasByName( aOULibName ) )
                             {
                                 Reference< script::XLibraryContainerPassword > xPasswd( xModLibContImport, UNO_QUERY );
@@ -1200,7 +1200,7 @@ void LibPage::Export( void )
         Reference< script::XLibraryContainerPassword > xPasswd( xModLibContainer, UNO_QUERY );
         if ( xPasswd.is() && xPasswd->isLibraryPasswordProtected( aOULibName ) && !xPasswd->isLibraryPasswordVerified( aOULibName ) )
         {
-            String aPassword;
+            ::rtl::OUString aPassword;
             Reference< script::XLibraryContainer > xModLibContainer1( xModLibContainer, UNO_QUERY );
             bOK = QueryPassword( xModLibContainer1, aLibName, aPassword );
         }
diff --git a/basctl/source/basicide/moduldlg.cxx b/basctl/source/basicide/moduldlg.cxx
index c63e6a6..0c66258 100644
--- a/basctl/source/basicide/moduldlg.cxx
+++ b/basctl/source/basicide/moduldlg.cxx
@@ -771,7 +771,7 @@ bool ObjectPage::GetSelection( ScriptDocument& rDocument, String& rLibName )
         Reference< script::XLibraryContainerPassword > xPasswd( xModLibContainer, UNO_QUERY );
         if ( xPasswd.is() && xPasswd->isLibraryPasswordProtected( aOULibName ) && !xPasswd->isLibraryPasswordVerified( aOULibName ) )
         {
-            String aPassword;
+            ::rtl::OUString aPassword;
             bOK = QueryPassword( xModLibContainer, rLibName, aPassword );
         }
 
diff --git a/basctl/source/inc/bastypes.hxx b/basctl/source/inc/bastypes.hxx
index f65d1d6..7b177a9 100644
--- a/basctl/source/inc/bastypes.hxx
+++ b/basctl/source/inc/bastypes.hxx
@@ -274,12 +274,12 @@ void            CutLines( ::rtl::OUString& rStr, sal_Int32 nStartLine, sal_Int32
 String          CreateMgrAndLibStr( const String& rMgrName, const String& rLibName );
 sal_uLong           CalcLineCount( SvStream& rStream );
 
-bool QueryReplaceMacro( const String& rName, Window* pParent = 0 );
-bool QueryDelMacro( const String& rName, Window* pParent = 0 );
-bool QueryDelDialog( const String& rName, Window* pParent = 0 );
-bool QueryDelModule( const String& rName, Window* pParent = 0 );
-bool QueryDelLib( const String& rName, bool bRef = sal_False, Window* pParent = 0 );
-bool QueryPassword( const ::com::sun::star::uno::Reference< ::com::sun::star::script::XLibraryContainer >& xLibContainer, const String& rLibName, String& rPassword, bool bRepeat = false, bool bNewTitle = false );
+bool QueryReplaceMacro( const ::rtl::OUString& rName, Window* pParent = 0 );
+bool QueryDelMacro( const ::rtl::OUString& rName, Window* pParent = 0 );
+bool QueryDelDialog( const ::rtl::OUString& rName, Window* pParent = 0 );
+bool QueryDelModule( const ::rtl::OUString& rName, Window* pParent = 0 );
+bool QueryDelLib( const ::rtl::OUString& rName, bool bRef = false, Window* pParent = 0 );
+bool QueryPassword( const ::com::sun::star::uno::Reference< ::com::sun::star::script::XLibraryContainer >& xLibContainer, const ::rtl::OUString& rLibName, ::rtl::OUString& rPassword, bool bRepeat = false, bool bNewTitle = false );
 
 class ModuleInfoHelper
 {


More information about the Libreoffice-commits mailing list