[Libreoffice-commits] core.git: 7 commits - include/svtools include/vcl vcl/inc vcl/source

Noel Grandin noel at peralex.com
Mon Jul 29 05:16:20 PDT 2013


 include/svtools/headbar.hxx   |    4 
 include/vcl/outdev.hxx        |   50 ++++++------
 include/vcl/status.hxx        |    8 -
 include/vcl/tabctrl.hxx       |    6 -
 include/vcl/toolbox.hxx       |    6 -
 include/vcl/window.hxx        |   20 ++--
 vcl/inc/outdev.h              |   24 ++---
 vcl/inc/outfont.hxx           |    4 
 vcl/inc/textlayout.hxx        |    2 
 vcl/inc/win/salmenu.h         |    4 
 vcl/inc/window.h              |   14 +--
 vcl/source/gdi/outdev3.cxx    |  170 +++++++++++++++++++++---------------------
 vcl/source/gdi/textlayout.cxx |    2 
 vcl/source/window/window.cxx  |   36 ++++----
 vcl/source/window/window2.cxx |    6 -
 15 files changed, 180 insertions(+), 176 deletions(-)

New commits:
commit d15ca2d89114b5e6636bc8646871e1333fcb54fa
Author: Noel Grandin <noel at peralex.com>
Date:   Mon Jul 29 08:41:59 2013 +0200

    convert XubString->OUString in vcl/window.hxx
    
    Change-Id: I556ad2df5cf1fb29aefb70a61a034d40a10340b1

diff --git a/include/svtools/headbar.hxx b/include/svtools/headbar.hxx
index 29bd35f..5145231 100644
--- a/include/svtools/headbar.hxx
+++ b/include/svtools/headbar.hxx
@@ -344,8 +344,8 @@ public:
 
     Size                CalcWindowSizePixel() const;
 
-    inline void             SetHelpText( const String& rText )      { Window::SetHelpText( rText ); }
-    inline const String&    GetHelpText() const                     { return Window::GetHelpText(); }
+    inline void             SetHelpText( const OUString& rText )    { Window::SetHelpText( rText ); }
+    inline const OUString&  GetHelpText() const                     { return Window::GetHelpText(); }
     inline void             SetHelpId( const OString& rId )    { Window::SetHelpId( rId ); }
     inline const OString& GetHelpId() const                    { return Window::GetHelpId(); }
 
diff --git a/include/vcl/status.hxx b/include/vcl/status.hxx
index 2363cd1..06c92b4 100644
--- a/include/vcl/status.hxx
+++ b/include/vcl/status.hxx
@@ -176,7 +176,7 @@ public:
     const XubString&    GetQuickHelpText( sal_uInt16 nItemId ) const;
 
     void                SetHelpId( sal_uInt16 nItemId, const OString& rHelpId );
-    OString        GetHelpId( sal_uInt16 nItemId ) const;
+    OString             GetHelpId( sal_uInt16 nItemId ) const;
 
     void                StartProgressMode( const XubString& rText );
     void                SetProgressValue( sal_uInt16 nPercent );
@@ -185,14 +185,14 @@ public:
 
     void                SetText( const OUString& rText );
 
-    void                SetHelpText( const XubString& rText )
+    void                SetHelpText( const OUString& rText )
                             { Window::SetHelpText( rText ); }
-    const XubString&    GetHelpText() const
+    const OUString&    GetHelpText() const
                             { return Window::GetHelpText(); }
 
     void                SetHelpId( const OString& rId )
                             { Window::SetHelpId( rId ); }
-    const OString& GetHelpId() const
+    const OString&      GetHelpId() const
                             { return Window::GetHelpId(); }
 
     Size                CalcWindowSizePixel() const;
diff --git a/include/vcl/tabctrl.hxx b/include/vcl/tabctrl.hxx
index 05b8313..8b4111a 100644
--- a/include/vcl/tabctrl.hxx
+++ b/include/vcl/tabctrl.hxx
@@ -162,14 +162,14 @@ public:
 
     void                SetPageImage( sal_uInt16 nPageId, const Image& rImage );
 
-    void                SetHelpText( const XubString& rText )
+    void                SetHelpText( const OUString& rText )
                             { Control::SetHelpText( rText ); }
-    const XubString&    GetHelpText() const
+    const OUString&     GetHelpText() const
                             { return Control::GetHelpText(); }
 
     void                SetHelpId( const OString& rId )
                             { Control::SetHelpId( rId ); }
-    const OString& GetHelpId() const
+    const OString&      GetHelpId() const
                             { return Control::GetHelpId(); }
 
     void                SetActivatePageHdl( const Link& rLink ) { maActivateHdl = rLink; }
diff --git a/include/vcl/toolbox.hxx b/include/vcl/toolbox.hxx
index eee1485..46c3b92 100644
--- a/include/vcl/toolbox.hxx
+++ b/include/vcl/toolbox.hxx
@@ -502,14 +502,14 @@ public:
     sal_Bool                IsCustomize() { return mbCustomize; }
     sal_Bool                IsInCustomizeMode() const { return mbCustomizeMode; }
 
-    void                SetHelpText( const XubString& rText )
+    void                SetHelpText( const OUString& rText )
                             { DockingWindow::SetHelpText( rText ); }
-    const XubString&    GetHelpText() const
+    const OUString&     GetHelpText() const
                             { return DockingWindow::GetHelpText(); }
 
     void                SetHelpId( const OString& rId )
                             { DockingWindow::SetHelpId( rId ); }
-    const OString& GetHelpId() const
+    const OString&      GetHelpId() const
                             { return DockingWindow::GetHelpId(); }
 
     void                SetClickHdl( const Link& rLink ) { maClickHdl = rLink; }
diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx
index d1c783b..4408adb 100644
--- a/include/vcl/window.hxx
+++ b/include/vcl/window.hxx
@@ -925,17 +925,17 @@ public:
     // this may be a child's background color (e.g. ListBox)
     virtual const Wallpaper& GetDisplayBackground() const;
 
-    void                SetHelpText( const XubString& rHelpText );
-    const XubString&    GetHelpText() const;
+    void                SetHelpText( const OUString& rHelpText );
+    const OUString&     GetHelpText() const;
 
-    void                SetQuickHelpText( const XubString& rHelpText );
-    const XubString&    GetQuickHelpText() const;
+    void                SetQuickHelpText( const OUString& rHelpText );
+    const OUString&     GetQuickHelpText() const;
 
     void                SetHelpId( const OString& );
-    const OString& GetHelpId() const;
+    const OString&      GetHelpId() const;
 
     void                SetUniqueId( const OString& );
-    const OString& GetUniqueId() const;
+    const OString&      GetUniqueId() const;
 
     Window*             FindWindow( const Point& rPos ) const;
 
@@ -1001,11 +1001,11 @@ public:
     void    SetAccessibleRole( sal_uInt16 nRole );
     sal_uInt16  GetAccessibleRole() const;
 
-    void    SetAccessibleName( const String& rName );
-    String  GetAccessibleName() const;
+    void    SetAccessibleName( const OUString& rName );
+    OUString  GetAccessibleName() const;
 
-    void    SetAccessibleDescription( const String& rDescr );
-    String  GetAccessibleDescription() const;
+    void    SetAccessibleDescription( const OUString& rDescr );
+    OUString  GetAccessibleDescription() const;
 
     void    SetAccessibleRelationLabeledBy( Window* pLabeledBy );
     Window* GetAccessibleRelationLabeledBy() const;
diff --git a/vcl/inc/window.h b/vcl/inc/window.h
index 230e1b0..092417b 100644
--- a/vcl/inc/window.h
+++ b/vcl/inc/window.h
@@ -209,8 +209,8 @@ struct ImplFrameData
 struct ImplAccessibleInfos
 {
     sal_uInt16 nAccessibleRole;
-    String* pAccessibleName;
-    String* pAccessibleDescription;
+    OUString* pAccessibleName;
+    OUString* pAccessibleDescription;
     Window* pLabeledByWindow;
     Window* pLabelForWindow;
     Window* pMemberOfWindow;
@@ -263,7 +263,7 @@ public:
     Cursor*             mpCursor;
     Pointer             maPointer;
     Fraction            maZoom;
-    XubString           maText;
+    OUString            maText;
     Font*               mpControlFont;
     Color               maControlForeground;
     Color               maControlBackground;
@@ -277,10 +277,10 @@ public:
     long                mnY;
     long                mnAbsScreenX;
     Point               maPos;
-    OString        maHelpId;
-    OString        maUniqId;
-    XubString           maHelpText;
-    XubString           maQuickHelpText;
+    OString             maHelpId;
+    OString             maUniqId;
+    OUString            maHelpText;
+    OUString            maQuickHelpText;
     InputContext        maInputContext;
     ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > mxWindowPeer;
     ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > mxAccessible;
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 2a7440a..aa3db23 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -4906,18 +4906,18 @@ void Window::RequestHelp( const HelpEvent& rHEvt )
     // with help text set
     if ( rHEvt.GetMode() & HELPMODE_BALLOON )
     {
-        const XubString* pStr = &(GetHelpText());
-        if ( !pStr->Len() )
-            pStr = &(GetQuickHelpText());
-        if ( !pStr->Len() && ImplGetParent() && !ImplIsOverlapWindow() )
+        OUString rStr = GetHelpText();
+        if ( rStr.isEmpty() )
+            rStr = GetQuickHelpText();
+        if ( rStr.isEmpty() && ImplGetParent() && !ImplIsOverlapWindow() )
             ImplGetParent()->RequestHelp( rHEvt );
         else
-            Help::ShowBalloon( this, rHEvt.GetMousePosPixel(), *pStr );
+            Help::ShowBalloon( this, rHEvt.GetMousePosPixel(), rStr );
     }
     else if ( rHEvt.GetMode() & HELPMODE_QUICK )
     {
-        const XubString* pStr = &(GetQuickHelpText());
-        if ( !pStr->Len() && ImplGetParent() && !ImplIsOverlapWindow() )
+        const OUString& rStr = GetQuickHelpText();
+        if ( rStr.isEmpty() && ImplGetParent() && !ImplIsOverlapWindow() )
             ImplGetParent()->RequestHelp( rHEvt );
         else
         {
@@ -4926,9 +4926,9 @@ void Window::RequestHelp( const HelpEvent& rHEvt )
                 aPos = ImplGetParent()->OutputToScreenPixel( aPos );
             Rectangle   aRect( aPos, GetSizePixel() );
             String      aHelpText;
-            if ( pStr->Len() )
+            if ( rStr.getLength() )
                 aHelpText = GetHelpText();
-            Help::ShowQuickHelp( this, aRect, *pStr, aHelpText, QUICKHELP_CTRLTEXT );
+            Help::ShowQuickHelp( this, aRect, rStr, aHelpText, QUICKHELP_CTRLTEXT );
         }
     }
     else
@@ -7989,14 +7989,14 @@ const Wallpaper& Window::GetDisplayBackground() const
 
 // -----------------------------------------------------------------------
 
-const XubString& Window::GetHelpText() const
+const OUString& Window::GetHelpText() const
 {
     DBG_CHKTHIS( Window, ImplDbgCheckWindow );
 
     String aStrHelpId( OStringToOUString( GetHelpId(), RTL_TEXTENCODING_UTF8 ) );
     bool bStrHelpId = (aStrHelpId.Len() > 0);
 
-    if ( !mpWindowImpl->maHelpText.Len() && bStrHelpId )
+    if ( !mpWindowImpl->maHelpText.getLength() && bStrHelpId )
     {
         if ( !IsDialog() && (mpWindowImpl->mnType != WINDOW_TABPAGE) && (mpWindowImpl->mnType != WINDOW_FLOATINGWINDOW) )
         {
@@ -8013,7 +8013,7 @@ const XubString& Window::GetHelpText() const
         static const char* pEnv = getenv( "HELP_DEBUG" );
         if( pEnv && *pEnv )
         {
-            OUStringBuffer aTxt( 64+mpWindowImpl->maHelpText.Len() );
+            OUStringBuffer aTxt( 64+mpWindowImpl->maHelpText.getLength() );
             aTxt.append( mpWindowImpl->maHelpText );
             aTxt.appendAscii( "\n------------------\n" );
             aTxt.append( OUString( aStrHelpId ) );
@@ -8925,16 +8925,16 @@ sal_uInt16 Window::GetAccessibleRole() const
     return nRole;
 }
 
-void Window::SetAccessibleName( const String& rName )
+void Window::SetAccessibleName( const OUString& rName )
 {
    if ( !mpWindowImpl->mpAccessibleInfos )
         mpWindowImpl->mpAccessibleInfos = new ImplAccessibleInfos;
 
     delete mpWindowImpl->mpAccessibleInfos->pAccessibleName;
-    mpWindowImpl->mpAccessibleInfos->pAccessibleName = new String( rName );
+    mpWindowImpl->mpAccessibleInfos->pAccessibleName = new OUString( rName );
 }
 
-String Window::GetAccessibleName() const
+OUString Window::GetAccessibleName() const
 {
     if (mpWindowImpl->mpAccessibleInfos && mpWindowImpl->mpAccessibleInfos->pAccessibleName)
         return *mpWindowImpl->mpAccessibleInfos->pAccessibleName;
@@ -8994,17 +8994,17 @@ OUString Window::getDefaultAccessibleName() const
     return GetNonMnemonicString( aAccessibleName );
 }
 
-void Window::SetAccessibleDescription( const String& rDescription )
+void Window::SetAccessibleDescription( const OUString& rDescription )
 {
    if ( ! mpWindowImpl->mpAccessibleInfos )
         mpWindowImpl->mpAccessibleInfos = new ImplAccessibleInfos;
 
     DBG_ASSERT( !mpWindowImpl->mpAccessibleInfos->pAccessibleDescription, "AccessibleDescription already set!" );
     delete mpWindowImpl->mpAccessibleInfos->pAccessibleDescription;
-    mpWindowImpl->mpAccessibleInfos->pAccessibleDescription = new String( rDescription );
+    mpWindowImpl->mpAccessibleInfos->pAccessibleDescription = new OUString( rDescription );
 }
 
-String Window::GetAccessibleDescription() const
+OUString Window::GetAccessibleDescription() const
 {
     String aAccessibleDescription;
     if ( mpWindowImpl->mpAccessibleInfos && mpWindowImpl->mpAccessibleInfos->pAccessibleDescription )
diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx
index 98d7559..aa91951 100644
--- a/vcl/source/window/window2.cxx
+++ b/vcl/source/window/window2.cxx
@@ -1653,18 +1653,18 @@ sal_Bool Window::IsZoom() const
     return mpWindowImpl->maZoom.GetNumerator() != mpWindowImpl->maZoom.GetDenominator();
 }
 
-void Window::SetHelpText( const XubString& rHelpText )
+void Window::SetHelpText( const OUString& rHelpText )
 {
     mpWindowImpl->maHelpText = rHelpText;
     mpWindowImpl->mbHelpTextDynamic = sal_True;
 }
 
-void Window::SetQuickHelpText( const XubString& rHelpText )
+void Window::SetQuickHelpText( const OUString& rHelpText )
 {
     mpWindowImpl->maQuickHelpText = rHelpText;
 }
 
-const XubString& Window::GetQuickHelpText() const
+const OUString& Window::GetQuickHelpText() const
 {
     return mpWindowImpl->maQuickHelpText;
 }
commit 6dae1199db417bb374c04e635b6bce0b382ea830
Author: Noel Grandin <noel at peralex.com>
Date:   Fri Jul 26 13:37:37 2013 +0200

    convert the rest of vcl/OutputDevice from XubString->OUString
    
    Change-Id: I97ca1bed06f4e47ea6c77cc0c2314dba555c344d

diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index bd490b4..2e5ad68 100644
--- a/include/vcl/outdev.hxx
+++ b/include/vcl/outdev.hxx
@@ -610,7 +610,7 @@ public:
         DrawText().
      */
     void                AddTextRectActions( const Rectangle& rRect,
-                                            const String&    rOrigStr,
+                                            const OUString&    rOrigStr,
                                             sal_uInt16           nStyle,
                                             GDIMetaFile&     rMtf );
     void                DrawText( const Rectangle& rRect,
@@ -634,21 +634,21 @@ public:
                             { xub_StrLen nDummy; return GetNonMnemonicString( rStr, nDummy ); }
 
     sal_Bool                GetTextBoundRect( Rectangle& rRect,
-                            const String& rStr, xub_StrLen nBase = 0, xub_StrLen nIndex = 0, xub_StrLen nLen = STRING_LEN,
+                            const OUString& rStr, xub_StrLen nBase = 0, xub_StrLen nIndex = 0, xub_StrLen nLen = STRING_LEN,
                             sal_uLong nLayoutWidth = 0, const sal_Int32* pDXArray = NULL ) const;
     sal_Bool                GetTextOutline( PolyPolygon&,
-                            const String& rStr, xub_StrLen nBase = 0, xub_StrLen nIndex = 0,
+                            const OUString& rStr, xub_StrLen nBase = 0, xub_StrLen nIndex = 0,
                             xub_StrLen nLen = STRING_LEN, sal_Bool bOptimize = sal_True,
                             sal_uLong nLayoutWidth = 0, const sal_Int32* pDXArray = NULL ) const;
     sal_Bool                GetTextOutlines( PolyPolyVector&,
-                            const String& rStr, xub_StrLen nBase = 0, xub_StrLen nIndex = 0,
+                            const OUString& rStr, xub_StrLen nBase = 0, xub_StrLen nIndex = 0,
                             xub_StrLen nLen = STRING_LEN, sal_Bool bOptimize = sal_True,
                             sal_uLong nLayoutWidth = 0, const sal_Int32* pDXArray = NULL ) const;
     sal_Bool                GetTextOutlines( ::basegfx::B2DPolyPolygonVector&,
-                            const String& rStr, xub_StrLen nBase = 0, xub_StrLen nIndex = 0,
+                            const OUString& rStr, xub_StrLen nBase = 0, xub_StrLen nIndex = 0,
                             xub_StrLen nLen = STRING_LEN, sal_Bool bOptimize = sal_True,
                             sal_uLong nLayoutWidth = 0, const sal_Int32* pDXArray = NULL ) const;
-    sal_Bool                GetGlyphBoundRects( const Point& rOrigin, const String& rStr, int nIndex,
+    sal_Bool                GetGlyphBoundRects( const Point& rOrigin, const OUString& rStr, int nIndex,
                             int nLen, int nBase, MetricVector& rVector );
 
     void                DrawPixel( const Point& rPt );
@@ -1077,19 +1077,19 @@ public:
     void                Erase();
     void                Erase( const Rectangle& rRect ) { DrawWallpaper( rRect, GetBackground() ); }
 
-    sal_Bool                AddTempDevFont( const String& rFileURL, const String& rFontName );
+    sal_Bool            AddTempDevFont( const OUString& rFileURL, const OUString& rFontName );
     int                 GetDevFontCount() const;
     FontInfo            GetDevFont( int nDevFontIndex ) const;
     int                 GetDevFontSizeCount( const Font& ) const;
     Size                GetDevFontSize( const Font& rFont, int nSizeIndex ) const;
-    sal_Bool                IsFontAvailable( const String& rFontName ) const;
+    sal_Bool            IsFontAvailable( const OUString& rFontName ) const;
 
     FontMetric          GetFontMetric() const;
     FontMetric          GetFontMetric( const Font& rFont ) const;
     sal_Bool                GetFontCharMap( FontCharMap& rFontCharMap ) const;
     bool                GetFontCapabilities( vcl::FontCapabilities& rFontCapabilities ) const;
 
-    xub_StrLen          HasGlyphs( const Font& rFont, const String& rStr,
+    xub_StrLen          HasGlyphs( const Font& rFont, const OUString& rStr,
                             xub_StrLen nIndex = 0, xub_StrLen nLen = STRING_LEN ) const;
 
     long                GetMinKashida() const;
@@ -1097,24 +1097,24 @@ public:
     // i60594
     // validate kashida positions against the current font
     // returns count of invalid kashida positions
-    xub_StrLen          ValidateKashidas ( const String& rTxt,
+    xub_StrLen          ValidateKashidas ( const OUString& rTxt,
                                             xub_StrLen nIdx, xub_StrLen nLen,
                                             xub_StrLen nKashCount, // number of suggested kashida positions (in)
                                             const xub_StrLen* pKashidaPos, // suggested kashida positions (in)
                                             xub_StrLen* pKashidaPosDropped // invalid kashida positions (out)
                                             ) const;
 
-    sal_uInt16              GetBitCount() const;
+    sal_uInt16          GetBitCount() const;
 
-    sal_Bool                GetTextIsRTL( const OUString&, sal_Int32 nIndex, sal_Int32 nLen ) const;
+    sal_Bool            GetTextIsRTL( const OUString&, sal_Int32 nIndex, sal_Int32 nLen ) const;
 
     /** Query the existence and depth of the alpha channel
 
         @return 0, if no alpha channel available, and the bit depth of
         the alpha channel otherwise.
      */
-    sal_uInt16              GetAlphaBitCount() const;
-    sal_uLong               GetColorCount() const;
+    sal_uInt16          GetAlphaBitCount() const;
+    sal_uLong           GetColorCount() const;
 
     void                Push( sal_uInt16 nFlags = PUSH_ALL );
     void                Pop();
diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx
index fff7a25..a0315ee 100644
--- a/vcl/source/gdi/outdev3.cxx
+++ b/vcl/source/gdi/outdev3.cxx
@@ -6352,13 +6352,13 @@ void OutputDevice::ImplDrawText( OutputDevice& rTargetDevice, const Rectangle& r
 }
 
 void OutputDevice::AddTextRectActions( const Rectangle& rRect,
-                                       const String&    rOrigStr,
-                                       sal_uInt16           nStyle,
+                                       const OUString&  rOrigStr,
+                                       sal_uInt16       nStyle,
                                        GDIMetaFile&     rMtf )
 {
     DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
 
-    if ( !rOrigStr.Len() || rRect.IsEmpty() )
+    if ( rOrigStr.isEmpty() || rRect.IsEmpty() )
         return;
 
     // we need a graphics
@@ -6918,7 +6918,7 @@ FontInfo OutputDevice::GetDevFont( int nDevFontIndex ) const
     return aFontInfo;
 }
 
-sal_Bool OutputDevice::AddTempDevFont( const String& rFileURL, const String& rFontName )
+sal_Bool OutputDevice::AddTempDevFont( const OUString& rFileURL, const OUString& rFontName )
 {
     DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
 
@@ -6981,7 +6981,7 @@ Size OutputDevice::GetDevFontSize( const Font& rFont, int nSizeIndex ) const
     return aSize;
 }
 
-sal_Bool OutputDevice::IsFontAvailable( const String& rFontName ) const
+sal_Bool OutputDevice::IsFontAvailable( const OUString& rFontName ) const
 {
     DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
 
@@ -7148,7 +7148,7 @@ long OutputDevice::GetMinKashida() const
     return ImplDevicePixelToLogicWidth( pMetric->mnMinKashida );
 }
 
-xub_StrLen OutputDevice::ValidateKashidas ( const String& rTxt,
+xub_StrLen OutputDevice::ValidateKashidas ( const OUString& rTxt,
                                             xub_StrLen nIdx, xub_StrLen nLen,
                                             xub_StrLen nKashCount,
                                             const xub_StrLen* pKashidaPos,
@@ -7171,7 +7171,7 @@ xub_StrLen OutputDevice::ValidateKashidas ( const String& rTxt,
     return nDropped;
 }
 
-sal_Bool OutputDevice::GetGlyphBoundRects( const Point& rOrigin, const String& rStr,
+sal_Bool OutputDevice::GetGlyphBoundRects( const Point& rOrigin, const OUString& rStr,
     int nIndex, int nLen, int nBase, MetricVector& rVector )
 {
     DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
@@ -7179,7 +7179,7 @@ sal_Bool OutputDevice::GetGlyphBoundRects( const Point& rOrigin, const String& r
     rVector.clear();
 
     if( nLen == STRING_LEN )
-        nLen = rStr.Len() - nIndex;
+        nLen = rStr.getLength() - nIndex;
 
     Rectangle aRect;
     for( int i = 0; i < nLen; i++ )
@@ -7194,7 +7194,7 @@ sal_Bool OutputDevice::GetGlyphBoundRects( const Point& rOrigin, const String& r
 }
 
 sal_Bool OutputDevice::GetTextBoundRect( Rectangle& rRect,
-    const String& rStr, xub_StrLen nBase, xub_StrLen nIndex, xub_StrLen nLen,
+    const OUString& rStr, xub_StrLen nBase, xub_StrLen nIndex, xub_StrLen nLen,
     sal_uLong nLayoutWidth, const sal_Int32* pDXAry ) const
 {
     DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
@@ -7369,7 +7369,7 @@ sal_Bool OutputDevice::GetTextBoundRect( Rectangle& rRect,
 }
 
 sal_Bool OutputDevice::GetTextOutlines( ::basegfx::B2DPolyPolygonVector& rVector,
-    const String& rStr, xub_StrLen nBase, xub_StrLen nIndex, xub_StrLen nLen,
+    const OUString& rStr, xub_StrLen nBase, xub_StrLen nIndex, xub_StrLen nLen,
     sal_Bool bOptimize, sal_uLong nTWidth, const sal_Int32* pDXArray ) const
 {
     // the fonts need to be initialized
@@ -7383,7 +7383,7 @@ sal_Bool OutputDevice::GetTextOutlines( ::basegfx::B2DPolyPolygonVector& rVector
     sal_Bool bRet = sal_False;
     rVector.clear();
     if( nLen == STRING_LEN )
-        nLen = rStr.Len() - nIndex;
+        nLen = rStr.getLength() - nIndex;
     rVector.reserve( nLen );
 
     // we want to get the Rectangle in logical units, so to
@@ -7596,7 +7596,7 @@ sal_Bool OutputDevice::GetTextOutlines( ::basegfx::B2DPolyPolygonVector& rVector
 }
 
 sal_Bool OutputDevice::GetTextOutlines( PolyPolyVector& rResultVector,
-    const String& rStr, xub_StrLen nBase, xub_StrLen nIndex,
+    const OUString& rStr, xub_StrLen nBase, xub_StrLen nIndex,
     xub_StrLen nLen, sal_Bool bOptimize, sal_uLong nTWidth, const sal_Int32* pDXArray ) const
 {
     rResultVector.clear();
@@ -7617,7 +7617,7 @@ sal_Bool OutputDevice::GetTextOutlines( PolyPolyVector& rResultVector,
 }
 
 sal_Bool OutputDevice::GetTextOutline( PolyPolygon& rPolyPoly,
-    const String& rStr, xub_StrLen nBase, xub_StrLen nIndex, xub_StrLen nLen,
+    const OUString& rStr, xub_StrLen nBase, xub_StrLen nIndex, xub_StrLen nLen,
     sal_Bool bOptimize, sal_uLong nTWidth, const sal_Int32* pDXArray ) const
 {
     rPolyPoly.Clear();
@@ -7710,17 +7710,17 @@ sal_Bool OutputDevice::GetFontCharMap( FontCharMap& rFontCharMap ) const
     return sal_True;
 }
 
-xub_StrLen OutputDevice::HasGlyphs( const Font& rTempFont, const String& rStr,
+xub_StrLen OutputDevice::HasGlyphs( const Font& rTempFont, const OUString& rStr,
     xub_StrLen nIndex, xub_StrLen nLen ) const
 {
-    if( nIndex >= rStr.Len() )
+    if( nIndex >= rStr.getLength() )
         return nIndex;
     xub_StrLen nEnd = nIndex + nLen;
-    if( (sal_uLong)nIndex+nLen > rStr.Len() )
-        nEnd = rStr.Len();
+    if( (sal_Int32)nIndex+nLen > rStr.getLength() )
+        nEnd = rStr.getLength();
 
     DBG_ASSERT( nIndex < nEnd, "StartPos >= EndPos?" );
-    DBG_ASSERT( nEnd <= rStr.Len(), "String too short" );
+    DBG_ASSERT( nEnd <= rStr.getLength(), "String too short" );
 
     // to get the map temporarily set font
     const Font aOrigFont = GetFont();
@@ -7733,9 +7733,8 @@ xub_StrLen OutputDevice::HasGlyphs( const Font& rTempFont, const String& rStr,
     if( bRet == sal_False )
         return nIndex;
 
-    const sal_Unicode* pStr = rStr.GetBuffer();
-    for( pStr += nIndex; nIndex < nEnd; ++pStr, ++nIndex )
-        if( ! aFontCharMap.HasChar( *pStr ) )
+    for( sal_Int32 i = nIndex; nIndex < nEnd; ++i, ++nIndex )
+        if( ! aFontCharMap.HasChar( rStr[i] ) )
             return nIndex;
 
     return STRING_LEN;
commit bfc58ddbf470000b329ab271cdf441f97c9d27a7
Author: Noel Grandin <noel at peralex.com>
Date:   Thu Jul 25 17:15:41 2013 +0200

    convert more XubString->OUString in OutputDevice
    
    Change-Id: I7c100614f7321c8c0527067012b47673ac6914f1

diff --git a/vcl/inc/outdev.h b/vcl/inc/outdev.h
index cf5feb0..fdeae8b 100644
--- a/vcl/inc/outdev.h
+++ b/vcl/inc/outdev.h
@@ -51,18 +51,18 @@ class GetDevSizeList;
 class ImplDevFontListData
 {
 public:
-                        ImplDevFontListData( const String& rSearchName );
+                        ImplDevFontListData( const OUString& rSearchName );
                         ~ImplDevFontListData();
 
     const OUString&     GetFamilyName() const    { return maName; }
-    const String&       GetSearchName() const    { return maSearchName; }
+    const OUString&       GetSearchName() const    { return maSearchName; }
     const OUString&     GetAliasNames() const    { return maMapNames; }
     bool                IsScalable() const       { return mpFirst->IsScalable(); }
     int                 GetMinQuality() const    { return mnMinQuality; }
 
     bool                AddFontFace( PhysicalFontFace* );
     void                InitMatchData( const utl::FontSubstConfiguration&,
-                            const String& rSearchName );
+                            const OUString& rSearchName );
     PhysicalFontFace*   FindBestFontFace( const FontSelectPattern& rFSD ) const;
 
     void                GetFontHeights( std::set<int>& rHeights ) const;
@@ -74,11 +74,11 @@ private:
 friend class ImplDevFontList; // TODO: remove soon
     PhysicalFontFace*   mpFirst;            // linked list of physical font faces
     OUString            maName;             // Fontname (original font family name)
-    String              maSearchName;       // normalized font family name
+    OUString            maSearchName;       // normalized font family name
     OUString            maMapNames;         // fontname aliases
     sal_uIntPtr         mnTypeFaces;        // Typeface Flags
     sal_uIntPtr         mnMatchType;        // MATCH - Type
-    String              maMatchFamilyName;  // MATCH - FamilyName
+    OUString            maMatchFamilyName;  // MATCH - FamilyName
     FontWeight          meMatchWeight;      // MATCH - Weight
     FontWidth           meMatchWidth;       // MATCH - Width
     FontFamily          meFamily;
@@ -112,16 +112,16 @@ public:
 class ImplGetDevSizeList
 {
 private:
-    String              maFontName;
+    OUString            maFontName;
     std::vector<int>    maSizeList;
 
 public:
-                        ImplGetDevSizeList( const String& rFontName )
+                        ImplGetDevSizeList( const OUString& rFontName )
                         : maFontName( rFontName ) { maSizeList.reserve( 32 ); }
     void                Add( int nHeight )      { maSizeList.push_back( nHeight ); }
     int                 Count() const           { return maSizeList.size(); }
     int                 Get( int nIndex ) const { return maSizeList[ nIndex ]; }
-    const String&       GetFontName() const     { return maFontName; }
+    const OUString&     GetFontName() const     { return maFontName; }
 };
 
 // ------------------------
@@ -148,8 +148,8 @@ protected:
 
 struct ImplFontSubstEntry
 {
-    String                    maName;
-    String                    maReplaceName;
+    OUString                  maName;
+    OUString                  maReplaceName;
     OUString                  maSearchName;
     OUString                  maSearchReplaceName;
     sal_uInt16                mnFlags;
@@ -164,13 +164,13 @@ private:
     typedef std::list<ImplFontSubstEntry> FontSubstList;
     FontSubstList maFontSubstList;
 public:
-    void    AddFontSubstitute( const String& rFontName, const String& rSubstName, sal_uInt16 nFlags );
+    void    AddFontSubstitute( const OUString& rFontName, const OUString& rSubstName, sal_uInt16 nFlags );
     void    RemoveFontSubstitute( int nIndex );
     int     GetFontSubstituteCount() const { return maFontSubstList.size(); };
     bool    Empty() const { return maFontSubstList.empty(); }
     void    Clear() { maFontSubstList.clear(); }
 
-    bool    FindFontSubstitute( String& rSubstName, const String& rFontName, sal_uInt16 nFlags ) const;
+    bool    FindFontSubstitute( OUString& rSubstName, const OUString& rFontName, sal_uInt16 nFlags ) const;
 };
 
 // PreMatchFontSubstitution
diff --git a/vcl/inc/outfont.hxx b/vcl/inc/outfont.hxx
index 140af38..f48d68f 100644
--- a/vcl/inc/outfont.hxx
+++ b/vcl/inc/outfont.hxx
@@ -361,9 +361,9 @@ public: // TODO: make data members private
     short               mnOrientation;      // text angle in 3600 system
     bool                mbInit;             // true if maMetric member is valid
 
-    void                AddFallbackForUnicode( sal_UCS4, FontWeight eWeight, const String& rFontName );
+    void                AddFallbackForUnicode( sal_UCS4, FontWeight eWeight, const OUString& rFontName );
     bool                GetFallbackForUnicode( sal_UCS4, FontWeight eWeight, OUString* pFontName ) const;
-    void                IgnoreFallbackForUnicode( sal_UCS4, FontWeight eWeight, const String& rFontName );
+    void                IgnoreFallbackForUnicode( sal_UCS4, FontWeight eWeight, const OUString& rFontName );
 
 private:
     // cache of Unicode characters and replacement font names
diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx
index 9f2b3c9..fff7a25 100644
--- a/vcl/source/gdi/outdev3.cxx
+++ b/vcl/source/gdi/outdev3.cxx
@@ -324,8 +324,8 @@ void OutputDevice::AddFontSubstitute( const OUString& rFontName,
     ImplGetSVData()->maGDIData.mbFontSubChanged = sal_True;
 }
 
-void ImplDirectFontSubstitution::AddFontSubstitute( const String& rFontName,
-    const String& rSubstFontName, sal_uInt16 nFlags )
+void ImplDirectFontSubstitution::AddFontSubstitute( const OUString& rFontName,
+    const OUString& rSubstFontName, sal_uInt16 nFlags )
 {
     maFontSubstList.push_back( ImplFontSubstEntry( rFontName, rSubstFontName, nFlags ) );
 }
@@ -374,8 +374,8 @@ sal_uInt16 OutputDevice::GetFontSubstituteCount()
     return (sal_uInt16)nCount;
 }
 
-bool ImplDirectFontSubstitution::FindFontSubstitute( String& rSubstName,
-    const String& rSearchName, sal_uInt16 nFlags ) const
+bool ImplDirectFontSubstitution::FindFontSubstitute( OUString& rSubstName,
+    const OUString& rSearchName, sal_uInt16 nFlags ) const
 {
     // TODO: get rid of O(N) searches
     FontSubstList::const_iterator it = maFontSubstList.begin();
@@ -402,7 +402,7 @@ static void ImplFontSubstitute( OUString& rFontName,
     DBG_ASSERT( aTempName == rFontName, "ImplFontSubstitute() called without a searchname" );
 #endif
 
-    String aSubstFontName;
+    OUString aSubstFontName;
 
     // apply user-configurable font replacement (eg, from the list in Tools->Options)
     const ImplDirectFontSubstitution* pSubst = ImplGetSVData()->maGDIData.mpDirectFontSubst;
@@ -616,34 +616,33 @@ Font OutputDevice::GetDefaultFont( sal_uInt16 nType, LanguageType eLang,
     return aFont;
 }
 
-static unsigned ImplIsCJKFont( const String& rFontName )
+static unsigned ImplIsCJKFont( const OUString& rFontName )
 {
     // Test, if Fontname includes CJK characters --> In this case we
     // mention that it is a CJK font
-    const sal_Unicode* pStr = rFontName.GetBuffer();
-    while ( *pStr )
+    for(int i = 0; i < rFontName.getLength(); i++)
     {
+        const sal_Unicode ch = rFontName[i];
         // japanese
-        if ( ((*pStr >= 0x3040) && (*pStr <= 0x30FF)) ||
-             ((*pStr >= 0x3190) && (*pStr <= 0x319F)) )
+        if ( ((ch >= 0x3040) && (ch <= 0x30FF)) ||
+             ((ch >= 0x3190) && (ch <= 0x319F)) )
             return IMPL_FONT_ATTR_CJK|IMPL_FONT_ATTR_CJK_JP;
 
         // korean
-        if ( ((*pStr >= 0xAC00) && (*pStr <= 0xD7AF)) ||
-             ((*pStr >= 0x3130) && (*pStr <= 0x318F)) ||
-             ((*pStr >= 0x1100) && (*pStr <= 0x11FF)) )
+        if ( ((ch >= 0xAC00) && (ch <= 0xD7AF)) ||
+             ((ch >= 0x3130) && (ch <= 0x318F)) ||
+             ((ch >= 0x1100) && (ch <= 0x11FF)) )
             return IMPL_FONT_ATTR_CJK|IMPL_FONT_ATTR_CJK_KR;
 
         // chinese
-        if ( ((*pStr >= 0x3400) && (*pStr <= 0x9FFF)) )
+        if ( ((ch >= 0x3400) && (ch <= 0x9FFF)) )
             return IMPL_FONT_ATTR_CJK|IMPL_FONT_ATTR_CJK_TC|IMPL_FONT_ATTR_CJK_SC;
 
         // cjk
-        if ( ((*pStr >= 0x3000) && (*pStr <= 0xD7AF)) ||
-             ((*pStr >= 0xFF00) && (*pStr <= 0xFFEE)) )
+        if ( ((ch >= 0x3000) && (ch <= 0xD7AF)) ||
+             ((ch >= 0xFF00) && (ch <= 0xFFEE)) )
             return IMPL_FONT_ATTR_CJK;
 
-        pStr++;
     }
 
     return 0;
@@ -739,7 +738,7 @@ public:
     int                 mnFaceMatch;
     int                 mnHeightMatch;
     int                 mnWidthMatch;
-    const sal_Unicode*  mpTargetStyleName;
+    const OUString*     mpTargetStyleName;
 };
 
 bool PhysicalFontFace::IsBetterMatch( const FontSelectPattern& rFSD, FontMatchStatus& rStatus ) const
@@ -751,7 +750,7 @@ bool PhysicalFontFace::IsBetterMatch( const FontSelectPattern& rFSD, FontMatchSt
         nMatch += 240000;
 
     if( rStatus.mpTargetStyleName
-    &&  GetStyleName().equalsIgnoreAsciiCase( rStatus.mpTargetStyleName ) )
+    &&  GetStyleName().equalsIgnoreAsciiCase( *rStatus.mpTargetStyleName ) )
         nMatch += 120000;
 
     if( (rFSD.GetPitch() != PITCH_DONTKNOW) && (rFSD.GetPitch() == GetPitch()) )
@@ -910,7 +909,7 @@ size_t ImplFontEntry::GFBCacheKey_Hash::operator()( const GFBCacheKey& rData ) c
     return a(rData.first) ^ b(rData.second);
 }
 
-inline void ImplFontEntry::AddFallbackForUnicode( sal_UCS4 cChar, FontWeight eWeight, const String& rFontName )
+inline void ImplFontEntry::AddFallbackForUnicode( sal_UCS4 cChar, FontWeight eWeight, const OUString& rFontName )
 {
     if( !mpUnicodeFallbackList )
         mpUnicodeFallbackList = new UnicodeFallbackList;
@@ -930,7 +929,7 @@ inline bool ImplFontEntry::GetFallbackForUnicode( sal_UCS4 cChar, FontWeight eWe
     return true;
 }
 
-inline void ImplFontEntry::IgnoreFallbackForUnicode( sal_UCS4 cChar, FontWeight eWeight, const String& rFontName )
+inline void ImplFontEntry::IgnoreFallbackForUnicode( sal_UCS4 cChar, FontWeight eWeight, const OUString& rFontName )
 {
 //  DBG_ASSERT( mpUnicodeFallbackList, "ImplFontEntry::IgnoreFallbackForUnicode no list" );
     UnicodeFallbackList::iterator it = mpUnicodeFallbackList->find( GFBCacheKey(cChar,eWeight) );
@@ -941,7 +940,7 @@ inline void ImplFontEntry::IgnoreFallbackForUnicode( sal_UCS4 cChar, FontWeight
         mpUnicodeFallbackList->erase( it );
 }
 
-ImplDevFontListData::ImplDevFontListData( const String& rSearchName )
+ImplDevFontListData::ImplDevFontListData( const OUString& rSearchName )
 :   mpFirst( NULL ),
     maSearchName( rSearchName ),
     mnTypeFaces( 0 ),
@@ -1064,7 +1063,7 @@ bool ImplDevFontListData::AddFontFace( PhysicalFontFace* pNewData )
 
 // get font attributes using the normalized font family name
 void ImplDevFontListData::InitMatchData( const utl::FontSubstConfiguration& rFontSubst,
-    const String& rSearchName )
+    const OUString& rSearchName )
 {
     OUString aShortName;
     OUString aMatchFamilyName(maMatchFamilyName);
@@ -1089,11 +1088,15 @@ PhysicalFontFace* ImplDevFontListData::FindBestFontFace( const FontSelectPattern
         return mpFirst;
 
     // FontName+StyleName should map to FamilyName+StyleName
-    const String& rSearchName = rFSD.maTargetName;
-    const sal_Unicode* pTargetStyleName = NULL;
-    if( (rSearchName.Len() > maSearchName.Len())
-    &&   rSearchName.Equals( maSearchName, 0, maSearchName.Len() ) )
-        pTargetStyleName = rSearchName.GetBuffer() + maSearchName.Len() + 1;
+    const OUString& rSearchName = rFSD.maTargetName;
+    OUString aTargetStyleName;
+    const OUString* pTargetStyleName = NULL;
+    if(    (rSearchName.getLength() > maSearchName.getLength())
+        && rSearchName.startsWith( maSearchName ) )
+    {
+        aTargetStyleName = rSearchName.copy(maSearchName.getLength() + 1);
+        pTargetStyleName = &aTargetStyleName;
+    }
 
     // TODO: linear search improve!
     PhysicalFontFace* pFontFace = mpFirst;
@@ -1731,9 +1734,9 @@ ImplDevFontListData* ImplDevFontList::ImplFindByAttributes( sal_uLong nSearchTyp
 
         // test font name substrings
         // TODO: calculate name matching score using e.g. Levenstein distance
-        if( (rSearchFamilyName.getLength() >= 4) && (pData->maMatchFamilyName.Len() >= 4)
+        if( (rSearchFamilyName.getLength() >= 4) && (pData->maMatchFamilyName.getLength() >= 4)
         &&    ((rSearchFamilyName.indexOf( pData->maMatchFamilyName ) != -1)
-            || (pData->maMatchFamilyName.Search( rSearchFamilyName ) != STRING_NOTFOUND)) )
+            || (pData->maMatchFamilyName.indexOf( rSearchFamilyName ) != -1)) )
                     nTestMatch += 5000;
 
         // test SERIF attribute
@@ -6141,7 +6144,7 @@ void OutputDevice::ImplDrawText( OutputDevice& rTargetDevice, const Rectangle& r
     TextAlign   eAlign          = rTargetDevice.GetTextAlign();
     xub_StrLen  nMnemonicPos    = STRING_NOTFOUND;
 
-    String aStr = rOrigStr;
+    OUString aStr = rOrigStr;
     if ( nStyle & TEXT_DRAW_MNEMONIC )
         aStr = GetNonMnemonicString( aStr, nMnemonicPos );
 
@@ -6151,7 +6154,7 @@ void OutputDevice::ImplDrawText( OutputDevice& rTargetDevice, const Rectangle& r
     if ( nStyle & TEXT_DRAW_MULTILINE )
     {
 
-        String                  aLastLine;
+        OUString                aLastLine;
         ImplMultiTextLineInfo   aMultiLineInfo;
         ImplTextLineInfo*       pLineInfo;
         xub_StrLen              i;
@@ -6173,14 +6176,16 @@ void OutputDevice::ImplDrawText( OutputDevice& rTargetDevice, const Rectangle& r
                     nFormatLines = nLines-1;
 
                     pLineInfo = aMultiLineInfo.GetLine( nFormatLines );
-                    aLastLine = convertLineEnd(aStr.Copy(pLineInfo->GetIndex()), LINEEND_LF);
+                    aLastLine = convertLineEnd(aStr.copy(pLineInfo->GetIndex()), LINEEND_LF);
                     // Replace all LineFeeds with Spaces
-                    xub_StrLen nLastLineLen = aLastLine.Len();
+                    OUStringBuffer aLastLineBuffer(aLastLine);
+                    xub_StrLen nLastLineLen = aLastLineBuffer.getLength();
                     for ( i = 0; i < nLastLineLen; i++ )
                     {
-                        if ( aLastLine.GetChar( i ) == '\n' )
-                            aLastLine.SetChar( i, ' ' );
+                        if ( aLastLineBuffer[ i ] == '\n' )
+                            aLastLineBuffer[ i ] = ' ';
                     }
+                    aLastLine = aLastLineBuffer.makeStringAndClear();
                     aLastLine = ImplGetEllipsisString( rTargetDevice, aLastLine, nWidth, nStyle, _rLayout );
                     nStyle &= ~(TEXT_DRAW_VCENTER | TEXT_DRAW_BOTTOM);
                     nStyle |= TEXT_DRAW_TOP;
@@ -6253,7 +6258,7 @@ void OutputDevice::ImplDrawText( OutputDevice& rTargetDevice, const Rectangle& r
 
 
             // If there still is a last line, we output it left-aligned as the line would be clipped
-            if ( aLastLine.Len() )
+            if ( !aLastLine.isEmpty() )
                 _rLayout.DrawText( aPos, aLastLine, 0, STRING_LEN, pVector, pDisplayText );
 
             // Reset clipping
@@ -6273,7 +6278,7 @@ void OutputDevice::ImplDrawText( OutputDevice& rTargetDevice, const Rectangle& r
                 aStr = ImplGetEllipsisString( rTargetDevice, aStr, nWidth, nStyle, _rLayout );
                 nStyle &= ~(TEXT_DRAW_CENTER | TEXT_DRAW_RIGHT);
                 nStyle |= TEXT_DRAW_LEFT;
-                nTextWidth = _rLayout.GetTextWidth( aStr, 0, aStr.Len() );
+                nTextWidth = _rLayout.GetTextWidth( aStr, 0, aStr.getLength() );
             }
         }
         else
@@ -6304,8 +6309,8 @@ void OutputDevice::ImplDrawText( OutputDevice& rTargetDevice, const Rectangle& r
         long nMnemonicWidth = 0;
         if ( nMnemonicPos != STRING_NOTFOUND )
         {
-            sal_Int32* pCaretXArray = (sal_Int32*) alloca( 2 * sizeof(sal_Int32) * aStr.Len() );
-            /*sal_Bool bRet =*/ _rLayout.GetCaretPositions( aStr, pCaretXArray, 0, aStr.Len() );
+            sal_Int32* pCaretXArray = (sal_Int32*) alloca( 2 * sizeof(sal_Int32) * aStr.getLength() );
+            /*sal_Bool bRet =*/ _rLayout.GetCaretPositions( aStr, pCaretXArray, 0, aStr.getLength() );
             long lc_x1 = pCaretXArray[2*(nMnemonicPos)];
             long lc_x2 = pCaretXArray[2*(nMnemonicPos)+1];
             nMnemonicWidth = rTargetDevice.ImplLogicWidthToDevicePixel( ::abs((int)(lc_x1 - lc_x2)) );
@@ -6438,7 +6443,7 @@ Rectangle OutputDevice::GetTextRect( const Rectangle& rRect,
     long                nMaxWidth;
     long                nTextHeight = GetTextHeight();
 
-    String aStr = rStr;
+    OUString aStr = rStr;
     if ( nStyle & TEXT_DRAW_MNEMONIC )
         aStr = GetNonMnemonicString( aStr );
 
@@ -6499,7 +6504,7 @@ Rectangle OutputDevice::GetTextRect( const Rectangle& rRect,
     else
     {
         nLines      = 1;
-        nMaxWidth   = _pTextLayout ? _pTextLayout->GetTextWidth( aStr, 0, aStr.Len() ) : GetTextWidth( aStr );
+        nMaxWidth   = _pTextLayout ? _pTextLayout->GetTextWidth( aStr, 0, aStr.getLength() ) : GetTextWidth( aStr );
 
         if ( pInfo )
         {
commit 7ef052646a7c8065241e694e75e2326179016db3
Author: Noel Grandin <noel at peralex.com>
Date:   Thu Jul 25 11:44:33 2013 +0200

    convert the rest of outdev.hxx from XubString to OUString
    
    Change-Id: I1305dde31106aada30534919456a4809a302afcf

diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index 761050c..bd490b4 100644
--- a/include/vcl/outdev.hxx
+++ b/include/vcl/outdev.hxx
@@ -618,19 +618,19 @@ public:
                                   MetricVector* pVector = NULL, OUString* pDisplayText = NULL,
                                   ::vcl::ITextLayout* _pTextLayout = NULL );
     Rectangle           GetTextRect( const Rectangle& rRect,
-                                     const XubString& rStr, sal_uInt16 nStyle = TEXT_DRAW_WORDBREAK,
+                                     const OUString& rStr, sal_uInt16 nStyle = TEXT_DRAW_WORDBREAK,
                                      TextRectInfo* pInfo = NULL,
                                      const ::vcl::ITextLayout* _pTextLayout = NULL ) const;
     OUString            GetEllipsisString( const OUString& rStr, long nMaxWidth,
                                            sal_uInt16 nStyle = TEXT_DRAW_ENDELLIPSIS ) const;
-    void                DrawCtrlText( const Point& rPos, const XubString& rStr,
+    void                DrawCtrlText( const Point& rPos, const OUString& rStr,
                                       xub_StrLen nIndex = 0, xub_StrLen nLen = STRING_LEN,
                                       sal_uInt16 nStyle = TEXT_DRAW_MNEMONIC, MetricVector* pVector = NULL, OUString* pDisplayText = NULL );
-    long                GetCtrlTextWidth( const XubString& rStr, xub_StrLen nIndex = 0,
+    long                GetCtrlTextWidth( const OUString& rStr, xub_StrLen nIndex = 0,
                                           xub_StrLen nLen = STRING_LEN,
                                           sal_uInt16 nStyle = TEXT_DRAW_MNEMONIC ) const;
-    static XubString    GetNonMnemonicString( const XubString& rStr, xub_StrLen& rMnemonicPos );
-    static XubString    GetNonMnemonicString( const XubString& rStr )
+    static OUString    GetNonMnemonicString( const OUString& rStr, xub_StrLen& rMnemonicPos );
+    static OUString    GetNonMnemonicString( const OUString& rStr )
                             { xub_StrLen nDummy; return GetNonMnemonicString( rStr, nDummy ); }
 
     sal_Bool                GetTextBoundRect( Rectangle& rRect,
@@ -905,7 +905,7 @@ public:
     const Font&         GetFont() const { return maFont; }
 
     SystemFontData        GetSysFontData( int nFallbacklevel ) const;
-    SystemTextLayoutData  GetSysTextLayoutData( const Point& rStartPt, const XubString& rStr,
+    SystemTextLayoutData  GetSysTextLayoutData( const Point& rStartPt, const OUString& rStr,
                                                 xub_StrLen nIndex = 0, xub_StrLen nLen = STRING_LEN,
                                                 const sal_Int32* pDXAry = NULL ) const;
 
diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx
index 55910d1..9f2b3c9 100644
--- a/vcl/source/gdi/outdev3.cxx
+++ b/vcl/source/gdi/outdev3.cxx
@@ -6151,7 +6151,7 @@ void OutputDevice::ImplDrawText( OutputDevice& rTargetDevice, const Rectangle& r
     if ( nStyle & TEXT_DRAW_MULTILINE )
     {
 
-        XubString               aLastLine;
+        String                  aLastLine;
         ImplMultiTextLineInfo   aMultiLineInfo;
         ImplTextLineInfo*       pLineInfo;
         xub_StrLen              i;
@@ -6426,7 +6426,7 @@ void OutputDevice::DrawText( const Rectangle& rRect, const OUString& rOrigStr, s
 }
 
 Rectangle OutputDevice::GetTextRect( const Rectangle& rRect,
-                                     const XubString& rStr, sal_uInt16 nStyle,
+                                     const OUString& rStr, sal_uInt16 nStyle,
                                      TextRectInfo* pInfo,
                                      const ::vcl::ITextLayout* _pTextLayout ) const
 {
@@ -6689,13 +6689,13 @@ OUString OutputDevice::ImplGetEllipsisString( const OutputDevice& rTargetDevice,
     return aStr;
 }
 
-void OutputDevice::DrawCtrlText( const Point& rPos, const XubString& rStr,
+void OutputDevice::DrawCtrlText( const Point& rPos, const OUString& rStr,
                                  xub_StrLen nIndex, xub_StrLen nLen,
                                  sal_uInt16 nStyle, MetricVector* pVector, OUString* pDisplayText )
 {
     DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
 
-    if ( !IsDeviceOutputNecessary() || (nIndex >= rStr.Len()) )
+    if ( !IsDeviceOutputNecessary() || (nIndex >= rStr.getLength()) )
         return;
 
     // better get graphics here because ImplDrawMnemonicLine() will not
@@ -6707,12 +6707,12 @@ void OutputDevice::DrawCtrlText( const Point& rPos, const XubString& rStr,
     if ( mbOutputClipped )
         return;
 
-    if( nIndex >= rStr.Len() )
+    if( nIndex >= rStr.getLength() )
         return;
-    if( (sal_uLong)nIndex+nLen >= rStr.Len() )
-        nLen = rStr.Len() - nIndex;
+    if( (sal_Int32)nIndex+nLen >= rStr.getLength() )
+        nLen = rStr.getLength() - nIndex;
 
-    XubString   aStr = rStr;
+    OUString   aStr = rStr;
     xub_StrLen  nMnemonicPos = STRING_NOTFOUND;
 
     long        nMnemonicX = 0;
@@ -6819,7 +6819,7 @@ void OutputDevice::DrawCtrlText( const Point& rPos, const XubString& rStr,
         mpAlphaVDev->DrawCtrlText( rPos, rStr, nIndex, nLen, nStyle, pVector, pDisplayText );
 }
 
-long OutputDevice::GetCtrlTextWidth( const String& rStr,
+long OutputDevice::GetCtrlTextWidth( const OUString& rStr,
                                      xub_StrLen nIndex, xub_StrLen nLen,
                                      sal_uInt16 nStyle ) const
 {
@@ -6828,7 +6828,7 @@ long OutputDevice::GetCtrlTextWidth( const String& rStr,
     if ( nStyle & TEXT_DRAW_MNEMONIC )
     {
         xub_StrLen  nMnemonicPos;
-        XubString   aStr = GetNonMnemonicString( rStr, nMnemonicPos );
+        OUString   aStr = GetNonMnemonicString( rStr, nMnemonicPos );
         if ( nMnemonicPos != STRING_NOTFOUND )
         {
             if ( nMnemonicPos < nIndex )
@@ -6843,7 +6843,7 @@ long OutputDevice::GetCtrlTextWidth( const String& rStr,
         return GetTextWidth( rStr, nIndex, nLen );
 }
 
-String OutputDevice::GetNonMnemonicString( const String& rStr, xub_StrLen& rMnemonicPos )
+OUString OutputDevice::GetNonMnemonicString( const OUString& rStr, xub_StrLen& rMnemonicPos )
 {
     String   aStr    = rStr;
     xub_StrLen  nLen    = aStr.Len();
@@ -7083,7 +7083,7 @@ SystemFontData OutputDevice::GetSysFontData(int nFallbacklevel) const
  *
  * @return SystemTextLayoutData
  **/
-SystemTextLayoutData OutputDevice::GetSysTextLayoutData(const Point& rStartPt, const XubString& rStr, xub_StrLen nIndex, xub_StrLen nLen,
+SystemTextLayoutData OutputDevice::GetSysTextLayoutData(const Point& rStartPt, const OUString& rStr, xub_StrLen nIndex, xub_StrLen nLen,
                                                         const sal_Int32* pDXAry) const
 {
     DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
commit 0c7579d5de63f569773daf894bcc0ab173223f2a
Author: Noel Grandin <noel at peralex.com>
Date:   Thu Jul 25 11:32:39 2013 +0200

    convert OutputDevice::DrawTextArray from XubString to OUString
    
    Change-Id: Ie16504ea004e39eda246a7ed170504a04a0764bb

diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index fdbffae..761050c 100644
--- a/include/vcl/outdev.hxx
+++ b/include/vcl/outdev.hxx
@@ -581,7 +581,7 @@ public:
     /// Height where any character of the current font fits; in logic coordinates.
     long                GetTextHeight() const;
     float               approximate_char_width() const;
-    void                DrawTextArray( const Point& rStartPt, const XubString& rStr,
+    void                DrawTextArray( const Point& rStartPt, const OUString& rStr,
                                        const sal_Int32* pDXAry = NULL,
                                        xub_StrLen nIndex = 0,
                                        xub_StrLen nLen = STRING_LEN );
@@ -592,7 +592,7 @@ public:
                                       sal_Int32* pDXAry = NULL, long nWidth = 0,
                                       sal_Bool bCellBreaking = sal_True ) const;
     void                DrawStretchText( const Point& rStartPt, sal_uLong nWidth,
-                                         const XubString& rStr,
+                                         const OUString& rStr,
                                          xub_StrLen nIndex = 0, xub_StrLen nLen = STRING_LEN );
     xub_StrLen          GetTextBreak( const OUString& rStr, long nTextWidth,
                                       sal_Int32 nIndex = 0, sal_Int32 nLen = -1,
diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx
index 401b25e..55910d1 100644
--- a/vcl/source/gdi/outdev3.cxx
+++ b/vcl/source/gdi/outdev3.cxx
@@ -5478,7 +5478,7 @@ float OutputDevice::approximate_char_width() const
     return GetTextWidth("aemnnxEM") / 8.0;
 }
 
-void OutputDevice::DrawTextArray( const Point& rStartPt, const String& rStr,
+void OutputDevice::DrawTextArray( const Point& rStartPt, const OUString& rStr,
                                   const sal_Int32* pDXAry,
                                   xub_StrLen nIndex, xub_StrLen nLen )
 {
@@ -5620,7 +5620,7 @@ bool OutputDevice::GetCaretPositions( const OUString& rStr, sal_Int32* pCaretXAr
 }
 
 void OutputDevice::DrawStretchText( const Point& rStartPt, sal_uLong nWidth,
-                                    const String& rStr,
+                                    const OUString& rStr,
                                     xub_StrLen nIndex, xub_StrLen nLen )
 {
     DBG_CHKTHIS( OutputDevice, ImplDbgCheckOutputDevice );
commit eb96a5296a76d25bc751177a5e785178f2497adb
Author: Noel Grandin <noel at peralex.com>
Date:   Thu Jul 25 11:24:53 2013 +0200

    convert OutputDevice::DrawText from XubString to OUString
    
    Change-Id: I5c641fff9a7b2a32658cdaf81aa5f45048263f22

diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index 688d75d..fdbffae 100644
--- a/include/vcl/outdev.hxx
+++ b/include/vcl/outdev.hxx
@@ -393,7 +393,7 @@ public:
                                                        long nMaxWidth, sal_uInt16 nStyle, const ::vcl::ITextLayout& _rLayout );
     static
     SAL_DLLPRIVATE void         ImplDrawText( OutputDevice& rTargetDevice, const Rectangle& rRect,
-                                              const String& rOrigStr, sal_uInt16 nStyle,
+                                              const OUString& rOrigStr, sal_uInt16 nStyle,
                                               MetricVector* pVector, OUString* pDisplayText, ::vcl::ITextLayout& _rLayout );
     SAL_DLLPRIVATE void         ImplDrawTextBackground( const SalLayout& );
     SAL_DLLPRIVATE void         ImplDrawTextLines( SalLayout&, FontStrikeout eStrikeout, FontUnderline eUnderline, FontUnderline eOverline, sal_Bool bWordLine, sal_Bool bUnderlineAbove );
@@ -574,7 +574,7 @@ public:
                                       FontUnderline eOverline,
                                       sal_Bool bUnderlineAbove = sal_False );
 
-    void                DrawText( const Point& rStartPt, const XubString& rStr,
+    void                DrawText( const Point& rStartPt, const OUString& rStr,
                                   xub_StrLen nIndex = 0, xub_StrLen nLen = STRING_LEN,
                                   MetricVector* pVector = NULL, OUString* pDisplayText = NULL );
     long                GetTextWidth( const OUString& rStr, sal_Int32 nIndex = 0, sal_Int32 nLen = -1 ) const;
@@ -614,7 +614,7 @@ public:
                                             sal_uInt16           nStyle,
                                             GDIMetaFile&     rMtf );
     void                DrawText( const Rectangle& rRect,
-                                  const XubString& rStr, sal_uInt16 nStyle = 0,
+                                  const OUString& rStr, sal_uInt16 nStyle = 0,
                                   MetricVector* pVector = NULL, OUString* pDisplayText = NULL,
                                   ::vcl::ITextLayout* _pTextLayout = NULL );
     Rectangle           GetTextRect( const Rectangle& rRect,
diff --git a/vcl/inc/textlayout.hxx b/vcl/inc/textlayout.hxx
index 0788a8a..2b51699 100644
--- a/vcl/inc/textlayout.hxx
+++ b/vcl/inc/textlayout.hxx
@@ -112,7 +112,7 @@ namespace vcl
         virtual ~ControlTextRenderer();
 
         Rectangle   DrawText( const Rectangle& _rRect,
-                              const XubString& _rText, sal_uInt16 _nStyle = 0,
+                              const OUString& _rText, sal_uInt16 _nStyle = 0,
                               MetricVector* _pVector = NULL, OUString* _pDisplayText = NULL );
 
     private:
diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx
index f5ef5ad..401b25e 100644
--- a/vcl/source/gdi/outdev3.cxx
+++ b/vcl/source/gdi/outdev3.cxx
@@ -5364,7 +5364,7 @@ void OutputDevice::DrawWaveLine( const Point& rStartPos, const Point& rEndPos,
         mpAlphaVDev->DrawWaveLine( rStartPos, rEndPos, nStyle );
 }
 
-void OutputDevice::DrawText( const Point& rStartPt, const String& rStr,
+void OutputDevice::DrawText( const Point& rStartPt, const OUString& rStr,
                              xub_StrLen nIndex, xub_StrLen nLen,
                              MetricVector* pVector, OUString* pDisplayText
                              )
@@ -5406,7 +5406,7 @@ void OutputDevice::DrawText( const Point& rStartPt, const String& rStr,
 
                 if( aClip.IsOver( *it ) )
                     bAppend = true;
-                else if( rStr.GetChar( nIndex ) == ' ' && bInserted )
+                else if( rStr[ nIndex ] == ' ' && bInserted )
                 {
                     MetricVector::const_iterator next = it;
                     ++next;
@@ -5418,7 +5418,7 @@ void OutputDevice::DrawText( const Point& rStartPt, const String& rStr,
                 {
                     pVector->push_back( *it );
                     if( pDisplayText )
-                        *pDisplayText += OUString(rStr.GetChar( nIndex ));
+                        *pDisplayText += OUString(rStr[ nIndex ]);
                     bInserted = true;
                 }
             }
@@ -5427,7 +5427,7 @@ void OutputDevice::DrawText( const Point& rStartPt, const String& rStr,
         {
             GetGlyphBoundRects( rStartPt, rStr, nIndex, nLen, nIndex, *pVector );
             if( pDisplayText )
-                *pDisplayText += rStr.Copy( nIndex, nLen );
+                *pDisplayText += rStr.copy( nIndex, nLen );
         }
     }
 
@@ -6084,7 +6084,7 @@ xub_StrLen OutputDevice::GetTextBreak( const OUString& rStr, long nTextWidth,
 }
 
 void OutputDevice::ImplDrawText( OutputDevice& rTargetDevice, const Rectangle& rRect,
-                                 const String& rOrigStr, sal_uInt16 nStyle,
+                                 const OUString& rOrigStr, sal_uInt16 nStyle,
                                  MetricVector* pVector, OUString* pDisplayText,
                                  ::vcl::ITextLayout& _rLayout )
 {
@@ -6380,7 +6380,7 @@ void OutputDevice::AddTextRectActions( const Rectangle& rRect,
     mpMetaFile = pMtf;
 }
 
-void OutputDevice::DrawText( const Rectangle& rRect, const String& rOrigStr, sal_uInt16 nStyle,
+void OutputDevice::DrawText( const Rectangle& rRect, const OUString& rOrigStr, sal_uInt16 nStyle,
                              MetricVector* pVector, OUString* pDisplayText,
                              ::vcl::ITextLayout* _pTextLayout )
 {
@@ -6396,7 +6396,7 @@ void OutputDevice::DrawText( const Rectangle& rRect, const String& rOrigStr, sal
     if ( mpMetaFile && !bDecomposeTextRectAction )
         mpMetaFile->AddAction( new MetaTextRectAction( rRect, rOrigStr, nStyle ) );
 
-    if ( ( !IsDeviceOutputNecessary() && !pVector && !bDecomposeTextRectAction ) || !rOrigStr.Len() || rRect.IsEmpty() )
+    if ( ( !IsDeviceOutputNecessary() && !pVector && !bDecomposeTextRectAction ) || rOrigStr.isEmpty() || rRect.IsEmpty() )
         return;
 
     // we need a graphics
diff --git a/vcl/source/gdi/textlayout.cxx b/vcl/source/gdi/textlayout.cxx
index 7be750d..ba2cfb5 100644
--- a/vcl/source/gdi/textlayout.cxx
+++ b/vcl/source/gdi/textlayout.cxx
@@ -315,7 +315,7 @@ namespace vcl
     {
     }
 
-    Rectangle ControlTextRenderer::DrawText( const Rectangle& _rRect, const XubString& _rText, sal_uInt16 _nStyle,
+    Rectangle ControlTextRenderer::DrawText( const Rectangle& _rRect, const OUString& _rText, sal_uInt16 _nStyle,
         MetricVector* _pVector, OUString* _pDisplayText )
     {
         return m_pImpl->DrawText( _rRect, _rText, _nStyle, _pVector, _pDisplayText );
commit d5ee0143082c29b9822324e9a55191379f1d163f
Author: Noel Grandin <noel at peralex.com>
Date:   Thu Jul 25 09:23:45 2013 +0200

    convert XubString->OUString in WinSalMenuItem
    
    Change-Id: Id3d135d3d7fedfca02f1b120c7ef441ef4c8a04d

diff --git a/vcl/inc/win/salmenu.h b/vcl/inc/win/salmenu.h
index 67cffcf..d8152b3 100644
--- a/vcl/inc/win/salmenu.h
+++ b/vcl/inc/win/salmenu.h
@@ -57,8 +57,8 @@ public:
 
     MENUITEMINFOW mInfo;
     void*     mpMenu;       // pointer to corresponding VCL menu
-    XubString mText;        // the item text
-    XubString mAccelText;   // the accelerator string
+    OUString  mText;        // the item text
+    OUString  mAccelText;   // the accelerator string
     Bitmap    maBitmap;     // item image
     int       mnId;         // item id
     WinSalMenu*  mpSalMenu;    // the menu where this item is inserted


More information about the Libreoffice-commits mailing list