[PATCH] Replace String with OUString in toolkit(vclxprinter.cxx)

Christina Roßmanith (via_Code_Review) gerrit at gerrit.libreoffice.org
Sat Mar 16 02:52:57 PDT 2013


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/2771

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/71/2771/1

Replace String with OUString in toolkit(vclxprinter.cxx)

Change-Id: I265b413923837aaba47abf242803fae7359f8ea8
---
M toolkit/inc/toolkit/awt/vclxprinter.hxx
M toolkit/source/awt/vclxprinter.cxx
2 files changed, 14 insertions(+), 14 deletions(-)



diff --git a/toolkit/inc/toolkit/awt/vclxprinter.hxx b/toolkit/inc/toolkit/awt/vclxprinter.hxx
index 03eed25..87b5bc7 100644
--- a/toolkit/inc/toolkit/awt/vclxprinter.hxx
+++ b/toolkit/inc/toolkit/awt/vclxprinter.hxx
@@ -59,7 +59,7 @@
     sal_Int16                   mnOrientation;
     sal_Bool                    mbHorizontal;
 public:
-    VCLXPrinterPropertySet( const String& rPrinterName );
+    VCLXPrinterPropertySet( const OUString& rPrinterName );
     virtual ~VCLXPrinterPropertySet();
 
     Printer*                    GetPrinter() const { return mpPrinter.get(); }
@@ -107,7 +107,7 @@
     boost::shared_ptr<vcl::OldStylePrintAdaptor>    mpListener;
     JobSetup                                        maInitJobSetup;
 public:
-                    VCLXPrinter( const String& rPrinterName );
+                    VCLXPrinter( const OUString& rPrinterName );
                     ~VCLXPrinter();
 
     // ::com::sun::star::uno::XInterface
@@ -153,7 +153,7 @@
                         public ::cppu::OWeakObject
 {
 public:
-                        VCLXInfoPrinter( const String& rPrinterName );
+                        VCLXInfoPrinter( const OUString& rPrinterName );
                         ~VCLXInfoPrinter();
 
     // ::com::sun::star::uno::XInterface
diff --git a/toolkit/source/awt/vclxprinter.cxx b/toolkit/source/awt/vclxprinter.cxx
index 56e5e83..af673d4 100644
--- a/toolkit/source/awt/vclxprinter.cxx
+++ b/toolkit/source/awt/vclxprinter.cxx
@@ -84,7 +84,7 @@
     getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XPrinterPropertySet>* ) NULL )
 IMPL_XTYPEPROVIDER_END
 
-VCLXPrinterPropertySet::VCLXPrinterPropertySet( const String& rPrinterName )
+VCLXPrinterPropertySet::VCLXPrinterPropertySet( const OUString& rPrinterName )
     : OPropertySetHelper( BrdcstHelper )
     , mpPrinter( new Printer( rPrinterName ) )
 {
@@ -222,22 +222,22 @@
     setFastPropertyValue( PROPERTY_Horizontal, aValue );
 }
 
-::com::sun::star::uno::Sequence< ::rtl::OUString > VCLXPrinterPropertySet::getFormDescriptions(  ) throw(::com::sun::star::uno::RuntimeException)
+::com::sun::star::uno::Sequence< OUString > VCLXPrinterPropertySet::getFormDescriptions(  ) throw(::com::sun::star::uno::RuntimeException)
 {
     ::osl::MutexGuard aGuard( Mutex );
 
     sal_uInt16 nPaperBinCount = GetPrinter()->GetPaperBinCount();
-    ::com::sun::star::uno::Sequence< ::rtl::OUString >  aDescriptions( nPaperBinCount );
+    ::com::sun::star::uno::Sequence< OUString >  aDescriptions( nPaperBinCount );
     for ( sal_uInt16 n = 0; n < nPaperBinCount; n++ )
     {
         // Format: <DisplayFormName;FormNameId;DisplayPaperBinName;PaperBinNameId;DisplayPaperName;PaperNameId>
-        String aDescr( RTL_CONSTASCII_USTRINGPARAM( "*;*;" ) );
-        aDescr += GetPrinter()->GetPaperBinName( n );
-        aDescr += ';';
-        aDescr += n;
-        aDescr.AppendAscii( ";*;*", 4 );
+        OUStringBuffer aDescr( "*;*;" );
+        aDescr.append(GetPrinter()->GetPaperBinName( n ));
+        aDescr.append(';');
+        aDescr.append(OUString::number(n));
+        aDescr.append(";*;*");
 
-        aDescriptions.getArray()[n] = aDescr;
+        aDescriptions.getArray()[n] = aDescr.makeStringAndClear();
     }
     return aDescriptions;
 }
@@ -282,7 +282,7 @@
 //  ----------------------------------------------------
 //  class VCLXPrinter
 //  ----------------------------------------------------
-VCLXPrinter::VCLXPrinter( const String& rPrinterName )
+VCLXPrinter::VCLXPrinter( const OUString& rPrinterName )
     : VCLXPrinterPropertySet( rPrinterName )
 {
 }
@@ -367,7 +367,7 @@
 //  class VCLXInfoPrinter
 //  ----------------------------------------------------
 
-VCLXInfoPrinter::VCLXInfoPrinter( const String& rPrinterName )
+VCLXInfoPrinter::VCLXInfoPrinter( const OUString& rPrinterName )
     : VCLXPrinterPropertySet( rPrinterName )
 {
 }

-- 
To view, visit https://gerrit.libreoffice.org/2771
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I265b413923837aaba47abf242803fae7359f8ea8
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Christina Roßmanith <ChrRossmanith at web.de>



More information about the LibreOffice mailing list