Date: prev next · Thread: first prev next last
2011 Archives by date, by thread · List index


Please find attached a partial fix for Easy Hack FDO43460,

Part I
Modules
unoControl, accessibility and avmedia

Regards
-- 
Olivier Hallot
Founder and Steering Commitee Member
The Document Foundation
From 17122a94a17eb089d9d0f43888e6192f21f62dc6 Mon Sep 17 00:00:00 2001
From: Olivier Hallot <olivier.hallot@alta.org.br>
Date: Fri, 9 Dec 2011 14:00:09 -0200
Subject: [PATCH] Fix for fdo43460, Part I, getLength to isEmpty

Part I
Modules
unoControl, accessibility and avmedia
---
 UnoControls/source/controls/framecontrol.cxx       |    2 +-
 UnoControls/source/controls/progressmonitor.cxx    |    6 +++---
 .../source/extended/accessibleiconchoicectrl.cxx   |    2 +-
 .../source/extended/textwindowaccessibility.cxx    |    2 +-
 .../standard/accessiblemenuitemcomponent.cxx       |    2 +-
 .../source/standard/vclxaccessiblebox.cxx          |    2 +-
 .../source/standard/vclxaccessibletoolboxitem.cxx  |    2 +-
 avmedia/source/framework/mediacontrol.cxx          |    8 ++++----
 avmedia/source/viewer/mediawindow.cxx              |    8 ++++----
 9 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/UnoControls/source/controls/framecontrol.cxx 
b/UnoControls/source/controls/framecontrol.cxx
index 006924c..6b29190 100644
--- a/UnoControls/source/controls/framecontrol.cxx
+++ b/UnoControls/source/controls/framecontrol.cxx
@@ -203,7 +203,7 @@ void SAL_CALL FrameControl::createPeer( const   Reference< XToolkit >&      xToo
     BaseControl::createPeer( xToolkit, xParentPeer );
     if ( impl_getPeerWindow().is() )
     {
-        if( m_sComponentURL.getLength() > 0 )
+        if( !m_sComponentURL.isEmpty() )
         {
             impl_createFrame( getPeer(), m_sComponentURL, m_seqLoaderArguments );
         }
diff --git a/UnoControls/source/controls/progressmonitor.cxx 
b/UnoControls/source/controls/progressmonitor.cxx
index 52bd71a..b3a5182 100644
--- a/UnoControls/source/controls/progressmonitor.cxx
+++ b/UnoControls/source/controls/progressmonitor.cxx
@@ -1038,11 +1038,11 @@ sal_Bool ProgressMonitor::impl_debug_checkParameter (
 ) {
     // Check "rTopic"
     if ( &rTopic        ==  NULL    ) return sal_False ;    // NULL-pointer for reference ???!!!
-    if ( rTopic.getLength ()    <   1       ) return sal_False ;    // ""
+    if ( rTopic.isEmpty()       ) return sal_False ;    // ""
 
     // Check "rText"
     if ( &rText         ==  NULL    ) return sal_False ;    // NULL-pointer for reference ???!!!
-    if ( rText.getLength () <   1       ) return sal_False ;    // ""
+    if ( rText.isEmpty()       ) return sal_False ;    // ""
 
     // "bbeforeProgress" is valid in everyway!
 
@@ -1055,7 +1055,7 @@ sal_Bool ProgressMonitor::impl_debug_checkParameter ( const OUString& rTopic, 
sa
 {
     // Check "rTopic"
     if ( &rTopic        ==  NULL    ) return sal_False ;    // NULL-pointer for reference ???!!!
-    if ( rTopic.getLength ()    <   1       ) return sal_False ;    // ""
+    if ( rTopic.isEmpty()      ) return sal_False ;    // ""
 
     // "bbeforeProgress" is valid in everyway!
 
diff --git a/accessibility/source/extended/accessibleiconchoicectrl.cxx 
b/accessibility/source/extended/accessibleiconchoicectrl.cxx
index eb47993..c7894ad 100644
--- a/accessibility/source/extended/accessibleiconchoicectrl.cxx
+++ b/accessibility/source/extended/accessibleiconchoicectrl.cxx
@@ -211,7 +211,7 @@ namespace accessibility
         ensureAlive();
 
         ::rtl::OUString sName = getCtrl()->GetAccessibleName();
-        if ( sName.getLength() == 0 )
+        if ( sName.isEmpty() )
             sName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IconChoiceControl" ) );
         return sName;
     }
diff --git a/accessibility/source/extended/textwindowaccessibility.cxx 
b/accessibility/source/extended/textwindowaccessibility.cxx
index 57c6378..39b332c 100644
--- a/accessibility/source/extended/textwindowaccessibility.cxx
+++ b/accessibility/source/extended/textwindowaccessibility.cxx
@@ -1798,7 +1798,7 @@ Document::changeParagraphText(::sal_uLong nNumber, ::sal_uInt16 nBegin, 
::sal_uI
         m_rView.DeleteSelected();
     if (bPaste)
         m_rView.Paste();
-    else if (rText.getLength() != 0)
+    else if (!rText.isEmpty())
         m_rView.InsertText(rText);
 }
 
diff --git a/accessibility/source/standard/accessiblemenuitemcomponent.cxx 
b/accessibility/source/standard/accessiblemenuitemcomponent.cxx
index ee10a60..f36dcb8 100644
--- a/accessibility/source/standard/accessiblemenuitemcomponent.cxx
+++ b/accessibility/source/standard/accessiblemenuitemcomponent.cxx
@@ -208,7 +208,7 @@ void OAccessibleMenuItemComponent::SetAccessibleName( const ::rtl::OUString& sAc
     {
         sal_uInt16 nItemId = m_pParent->GetItemId( m_nItemPos );
         sName = m_pParent->GetAccessibleName( nItemId );
-        if ( sName.getLength() == 0 )
+        if ( sName.isEmpty() )
             sName = m_pParent->GetItemText( nItemId );
         sName = OutputDevice::GetNonMnemonicString( sName );
     }
diff --git a/accessibility/source/standard/vclxaccessiblebox.cxx 
b/accessibility/source/standard/vclxaccessiblebox.cxx
index e868403..82a7677 100644
--- a/accessibility/source/standard/vclxaccessiblebox.cxx
+++ b/accessibility/source/standard/vclxaccessiblebox.cxx
@@ -156,7 +156,7 @@ void VCLXAccessibleBox::ProcessWindowEvent (const VclWindowEvent& rVclWindowEven
                 if ( xText.is() )
                 {
                     ::rtl::OUString sText = xText->getSelectedText();
-                    if ( !sText.getLength() )
+                    if ( !sText.isEmpty() )
                         sText = xText->getText();
                     pList->UpdateSelection (sText);
                 }
diff --git a/accessibility/source/standard/vclxaccessibletoolboxitem.cxx 
b/accessibility/source/standard/vclxaccessibletoolboxitem.cxx
index e1f6d94..62d9fb8 100644
--- a/accessibility/source/standard/vclxaccessibletoolboxitem.cxx
+++ b/accessibility/source/standard/vclxaccessibletoolboxitem.cxx
@@ -607,7 +607,7 @@ awt::FontDescriptor SAL_CALL VCLXAccessibleToolBoxItem::getFontMetrics( const Re
             sRet = m_pToolBox->GetHelpText( m_nItemId );
         else
             sRet = m_pToolBox->GetQuickHelpText( m_nItemId );
-        if ( !sRet.getLength() )
+        if ( !sRet.isEmpty() )
             // no help text set, so use item text
             sRet = m_pToolBox->GetItemText( m_nItemId );
     }
diff --git a/avmedia/source/framework/mediacontrol.cxx b/avmedia/source/framework/mediacontrol.cxx
index ceb375e..f128c2b 100644
--- a/avmedia/source/framework/mediacontrol.cxx
+++ b/avmedia/source/framework/mediacontrol.cxx
@@ -293,7 +293,7 @@ void MediaControl::setState( const MediaItem& rItem )
 
 void MediaControl::implUpdateToolboxes()
 {
-    const bool bValidURL = ( maItem.getURL().getLength() > 0 );
+    const bool bValidURL = ( !maItem.getURL().isEmpty());
 
     maPlayToolBox.EnableItem( AVMEDIA_TOOLBOXITEM_INSERT, bValidURL );
     maPlayToolBox.EnableItem( AVMEDIA_TOOLBOXITEM_PLAY, bValidURL );
@@ -372,7 +372,7 @@ void MediaControl::implUpdateToolboxes()
 
 void MediaControl::implUpdateTimeSlider()
 {
-    if( !maItem.getURL().getLength() || !IsEnabled() )
+    if( !maItem.getURL().isEmpty() || !IsEnabled() )
         maTimeSlider.Disable();
     else
     {
@@ -399,7 +399,7 @@ void MediaControl::implUpdateTimeSlider()
 
 void MediaControl::implUpdateVolumeSlider()
 {
-    if( !maItem.getURL().getLength() || !IsEnabled() )
+    if( !maItem.getURL().isEmpty() || !IsEnabled() )
         maVolumeSlider.Disable();
     else
     {
@@ -416,7 +416,7 @@ void MediaControl::implUpdateVolumeSlider()
 
 void MediaControl::implUpdateTimeField( double fCurTime )
 {
-    if( maItem.getURL().getLength() > 0 )
+    if( !maItem.getURL().isEmpty() )
     {
         String              aTimeString;
 
diff --git a/avmedia/source/viewer/mediawindow.cxx b/avmedia/source/viewer/mediawindow.cxx
index 713e9e9..e6c6c06 100644
--- a/avmedia/source/viewer/mediawindow.cxx
+++ b/avmedia/source/viewer/mediawindow.cxx
@@ -274,7 +274,7 @@ bool MediaWindow::executeMediaURLDialog(Window* /* pParent */,
     {
         for( sal_Int32 nIndex = 0; nIndex >= 0; )
         {
-            if( aAllTypes.getLength() )
+            if( !aAllTypes.isEmpty() )
                 aAllTypes += aSeparator;
 
             ( aAllTypes += aWildcard ) += aFilters[ i ].second.getToken( 0, ';', nIndex );
@@ -290,7 +290,7 @@ bool MediaWindow::executeMediaURLDialog(Window* /* pParent */,
 
         for( sal_Int32 nIndex = 0; nIndex >= 0; )
         {
-            if( aTypes.getLength() )
+            if( !aTypes.isEmpty() )
                 aTypes += aSeparator;
 
             ( aTypes += aWildcard ) += aFilters[ i ].second.getToken( 0, ';', nIndex );
@@ -334,10 +334,10 @@ bool MediaWindow::executeMediaURLDialog(Window* /* pParent */,
             }
         }
     }
-    else if( rURL.getLength() )
+    else if( !rURL.isEmpty() )
         rURL = ::rtl::OUString();
 
-    return( rURL.getLength() > 0 );
+    return( !rURL.isEmpty() );
 }
 
 // -------------------------------------------------------------------------
-- 
1.7.5.4


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.