[Libreoffice-commits] .: 2 commits - vcl/generic vcl/inc vcl/source vcl/unx
Olivier Hallot
ohallot at kemper.freedesktop.org
Tue Jan 31 13:59:35 PST 2012
vcl/generic/app/gensys.cxx | 2 -
vcl/generic/glyphs/gcach_ftyp.cxx | 2 -
vcl/generic/print/common_gfx.cxx | 2 -
vcl/generic/print/printerjob.cxx | 6 +--
vcl/inc/generic/gendata.hxx | 2 -
vcl/inc/image.h | 2 -
vcl/source/app/settings.cxx | 8 ++--
vcl/source/app/unohelp.cxx | 2 -
vcl/source/control/edit.cxx | 2 -
vcl/source/control/tabctrl.cxx | 8 ++--
vcl/source/gdi/configsettings.cxx | 2 -
vcl/source/gdi/gfxlink.cxx | 2 -
vcl/source/gdi/image.cxx | 4 +-
vcl/source/gdi/impgraph.cxx | 4 +-
vcl/source/gdi/impimage.cxx | 6 +--
vcl/source/gdi/impimagetree.cxx | 6 +--
vcl/source/gdi/pdfwriter_impl.cxx | 58 ++++++++++++++---------------
vcl/source/gdi/pdfwriter_impl2.cxx | 4 +-
vcl/source/gdi/print3.cxx | 34 ++++++++---------
vcl/source/gdi/rendergraphic.cxx | 4 +-
vcl/source/gdi/rendergraphicrasterizer.cxx | 2 -
vcl/source/window/menu.cxx | 8 ++--
vcl/source/window/msgbox.cxx | 2 -
vcl/source/window/printdlg.cxx | 26 ++++++-------
vcl/source/window/status.cxx | 10 ++---
vcl/source/window/toolbox.cxx | 8 ++--
vcl/source/window/toolbox2.cxx | 2 -
vcl/source/window/window.cxx | 4 +-
vcl/unx/generic/app/saldata.cxx | 2 -
vcl/unx/generic/app/sm.cxx | 2 -
vcl/unx/generic/app/wmadaptor.cxx | 6 +--
vcl/unx/generic/dtrans/X11_selection.cxx | 6 +--
32 files changed, 119 insertions(+), 119 deletions(-)
New commits:
commit 634820b3a8604dd1ed868ddeffc2501f3a0f056f
Author: Olivier Hallot <olivier.hallot at alta.org.br>
Date: Tue Jan 31 17:53:23 2012 -0200
Fix for fdo43460 Part LVIII getLength() to isEmpty()
Part LVIII
Modules
vcl (part 2)
diff --git a/vcl/source/gdi/pdfwriter_impl2.cxx b/vcl/source/gdi/pdfwriter_impl2.cxx
index 0364a9f..71378a6 100644
--- a/vcl/source/gdi/pdfwriter_impl2.cxx
+++ b/vcl/source/gdi/pdfwriter_impl2.cxx
@@ -1214,14 +1214,14 @@ uno::Reference< beans::XMaterialHolder > PDFWriterImpl::initEncryption( const rt
)
{
uno::Reference< beans::XMaterialHolder > xResult;
- if( i_rOwnerPassword.getLength() || i_rUserPassword.getLength() )
+ if( !i_rOwnerPassword.isEmpty() || !i_rUserPassword.isEmpty() )
{
EncHashTransporter* pTransporter = new EncHashTransporter;
xResult = pTransporter;
// get padded passwords
sal_uInt8 aPadUPW[ENCRYPTED_PWD_SIZE], aPadOPW[ENCRYPTED_PWD_SIZE];
- padPassword( i_rOwnerPassword.getLength() ? i_rOwnerPassword : i_rUserPassword, aPadOPW );
+ padPassword( i_rOwnerPassword.isEmpty() ? i_rUserPassword : i_rOwnerPassword, aPadOPW );
padPassword( i_rUserPassword, aPadUPW );
sal_Int32 nKeyLength = SECUR_40BIT_KEY;
if( b128Bit )
diff --git a/vcl/source/gdi/print3.cxx b/vcl/source/gdi/print3.cxx
index 60b449e..a51b039 100644
--- a/vcl/source/gdi/print3.cxx
+++ b/vcl/source/gdi/print3.cxx
@@ -359,7 +359,7 @@ void Printer::ImplPrintJob( const boost::shared_ptr<PrinterController>& i_pContr
{
rtl::OUString aPagesVal;
pPagesVal->Value >>= aPagesVal;
- if( aPagesVal.getLength() )
+ if( !aPagesVal.isEmpty() )
{
// "Pages" attribute from API is now equivalent to "PageRange"
// AND "PrintContent" = 1 except calc where it is "PrintRange" = 1
@@ -384,7 +384,7 @@ void Printer::ImplPrintJob( const boost::shared_ptr<PrinterController>& i_pContr
rtl::OUString aRange;
if( pRangeVal )
pRangeVal->Value >>= aRange;
- if( aRange.getLength() == 0 )
+ if( aRange.isEmpty() )
{
sal_Int32 nPages = i_pController->getPageCount();
if( nPages > 0 )
@@ -442,7 +442,7 @@ void Printer::ImplPrintJob( const boost::shared_ptr<PrinterController>& i_pContr
if( aDlg.isPrintToFile() )
{
rtl::OUString aFile = queryFile( pController->getPrinter().get() );
- if( ! aFile.getLength() )
+ if( aFile.isEmpty() )
{
i_pController->abortJob();
return;
@@ -526,7 +526,7 @@ bool Printer::StartJob( const rtl::OUString& i_rJobName, boost::shared_ptr<vcl::
{
rtl::OUString aFile;
pFileValue->Value >>= aFile;
- if( aFile.getLength() )
+ if( !aFile.isEmpty() )
{
mbPrintFile = sal_True;
maPrintFile = aFile;
@@ -1336,7 +1336,7 @@ void PrinterController::setValue( const beans::PropertyValue& i_rValue )
void PrinterController::setUIOptions( const Sequence< beans::PropertyValue >& i_rOptions )
{
- DBG_ASSERT( mpImplData->maUIOptions.getLength() == 0, "setUIOptions called twice !" );
+ DBG_ASSERT( mpImplData->maUIOptions.isEmpty(), "setUIOptions called twice !" );
mpImplData->maUIOptions = i_rOptions;
@@ -1390,7 +1390,7 @@ void PrinterController::setUIOptions( const Sequence< beans::PropertyValue >& i_
{
mpImplData->maUIPropertyEnabled[ it->second ] = bIsEnabled;
}
- if( aDep.maDependsOnName.getLength() > 0 )
+ if( !aDep.maDependsOnName.isEmpty() )
mpImplData->maControlDependencies[ aPropName ] = aDep;
if( aChoicesDisabled.getLength() > 0 )
mpImplData->maChoiceDisableMap[ aPropName ] = aChoicesDisabled;
@@ -1707,15 +1707,15 @@ Any PrinterOptionsHelper::getUIControlOpt( const rtl::OUString& i_rTitle,
{
sal_Int32 nElements =
1 // ControlType
- + (i_rTitle.getLength() ? 1 : 0) // Text
+ + (i_rTitle.isEmpty() ? 0 : 1) // Text
+ (i_rHelpIds.getLength() ? 1 : 0) // HelpId
+ (i_pVal ? 1 : 0) // Property
+ i_rControlOptions.maAddProps.getLength() // additional props
- + (i_rControlOptions.maGroupHint.getLength() ? 1 : 0) // grouping
+ + (i_rControlOptions.maGroupHint.isEmpty() ? 0 : 1) // grouping
+ (i_rControlOptions.mbInternalOnly ? 1 : 0) // internal hint
+ (i_rControlOptions.mbEnabled ? 0 : 1) // enabled
;
- if( i_rControlOptions.maDependsOnName.getLength() )
+ if( !i_rControlOptions.maDependsOnName.isEmpty() )
{
nElements += 1;
if( i_rControlOptions.mnDependsOnEntry != -1 )
@@ -1726,7 +1726,7 @@ Any PrinterOptionsHelper::getUIControlOpt( const rtl::OUString& i_rTitle,
Sequence< PropertyValue > aCtrl( nElements );
sal_Int32 nUsed = 0;
- if( i_rTitle.getLength() )
+ if( !i_rTitle.isEmpty() )
{
aCtrl[nUsed ].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Text" ) );
aCtrl[nUsed++].Value = makeAny( i_rTitle );
@@ -1743,7 +1743,7 @@ Any PrinterOptionsHelper::getUIControlOpt( const rtl::OUString& i_rTitle,
aCtrl[nUsed ].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Property" ) );
aCtrl[nUsed++].Value = makeAny( *i_pVal );
}
- if( i_rControlOptions.maDependsOnName.getLength() )
+ if( !i_rControlOptions.maDependsOnName.isEmpty() )
{
aCtrl[nUsed ].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DependsOnName" ) );
aCtrl[nUsed++].Value = makeAny( i_rControlOptions.maDependsOnName );
@@ -1758,7 +1758,7 @@ Any PrinterOptionsHelper::getUIControlOpt( const rtl::OUString& i_rTitle,
aCtrl[nUsed++].Value = makeAny( i_rControlOptions.mbAttachToDependency );
}
}
- if( i_rControlOptions.maGroupHint.getLength() )
+ if( !i_rControlOptions.maGroupHint.isEmpty() )
{
aCtrl[nUsed ].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "GroupingHint" ) );
aCtrl[nUsed++].Value <<= i_rControlOptions.maGroupHint;
@@ -1786,7 +1786,7 @@ Any PrinterOptionsHelper::getUIControlOpt( const rtl::OUString& i_rTitle,
Any PrinterOptionsHelper::getGroupControlOpt( const rtl::OUString& i_rTitle, const rtl::OUString& i_rHelpId )
{
Sequence< rtl::OUString > aHelpId;
- if( i_rHelpId.getLength() > 0 )
+ if( !i_rHelpId.isEmpty() )
{
aHelpId.realloc( 1 );
*aHelpId.getArray() = i_rHelpId;
@@ -1800,7 +1800,7 @@ Any PrinterOptionsHelper::getSubgroupControlOpt( const rtl::OUString& i_rTitle,
)
{
Sequence< rtl::OUString > aHelpId;
- if( i_rHelpId.getLength() > 0 )
+ if( !i_rHelpId.isEmpty() )
{
aHelpId.realloc( 1 );
*aHelpId.getArray() = i_rHelpId;
@@ -1817,7 +1817,7 @@ Any PrinterOptionsHelper::getBoolControlOpt( const rtl::OUString& i_rTitle,
)
{
Sequence< rtl::OUString > aHelpId;
- if( i_rHelpId.getLength() > 0 )
+ if( !i_rHelpId.isEmpty() )
{
aHelpId.realloc( 1 );
*aHelpId.getArray() = i_rHelpId;
@@ -1876,7 +1876,7 @@ Any PrinterOptionsHelper::getRangeControlOpt( const rtl::OUString& i_rTitle,
}
Sequence< rtl::OUString > aHelpId;
- if( i_rHelpId.getLength() > 0 )
+ if( !i_rHelpId.isEmpty() )
{
aHelpId.realloc( 1 );
*aHelpId.getArray() = i_rHelpId;
@@ -1900,7 +1900,7 @@ Any PrinterOptionsHelper::getEditControlOpt( const rtl::OUString& i_rTitle,
)
{
Sequence< rtl::OUString > aHelpId;
- if( i_rHelpId.getLength() > 0 )
+ if( !i_rHelpId.isEmpty() )
{
aHelpId.realloc( 1 );
*aHelpId.getArray() = i_rHelpId;
diff --git a/vcl/source/gdi/rendergraphic.cxx b/vcl/source/gdi/rendergraphic.cxx
index 4f333cd..e11993f 100644
--- a/vcl/source/gdi/rendergraphic.cxx
+++ b/vcl/source/gdi/rendergraphic.cxx
@@ -66,7 +66,7 @@ RenderGraphic::RenderGraphic( const rtl::OUString& rGraphicDataMimeType,
mnGraphicDataLength( nGraphicDataLength ),
maGraphicDataMimeType( rGraphicDataMimeType )
{
- if( rGraphicDataMimeType.getLength( ) && nGraphicDataLength )
+ if( !rGraphicDataMimeType.isEmpty( ) && nGraphicDataLength )
{
maGraphicData.reset( new sal_uInt8[ nGraphicDataLength ] );
@@ -113,7 +113,7 @@ bool RenderGraphic::operator==(const RenderGraphic& rRenderGraphic ) const
bool RenderGraphic::operator!() const
{
- return( ( 0 == maGraphicDataMimeType.getLength( ) ) ||
+ return( ( maGraphicDataMimeType.isEmpty( ) ) ||
( 0 == mnGraphicDataLength ) ||
!maGraphicData.get( ) );
}
diff --git a/vcl/source/gdi/rendergraphicrasterizer.cxx b/vcl/source/gdi/rendergraphicrasterizer.cxx
index 7014570..fda87c3 100644
--- a/vcl/source/gdi/rendergraphicrasterizer.cxx
+++ b/vcl/source/gdi/rendergraphicrasterizer.cxx
@@ -243,7 +243,7 @@ void RenderGraphicRasterizer::InitializeRasterizer()
aServiceName = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( VCL_SERVICENAME_RASTERIZER_SVG ) );
}
- if( aServiceName.getLength() )
+ if( !aServiceName.isEmpty() )
{
mxRasterizer.set( xFactory->createInstance( aServiceName ), uno::UNO_QUERY );
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index 0acbdfb..11c7d04 100644
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -844,7 +844,7 @@ static sal_Bool ImplHandleHelpEvent( Window* pMenuWindow, Menu* pMenu, sal_uInt1
// use help-index
String aCommand = pMenu->GetItemCommand( nId );
rtl::OString aHelpId( pMenu->GetHelpId( nId ) );
- if( ! aHelpId.getLength() )
+ if( aHelpId.isEmpty() )
aHelpId = OOO_HELP_INDEX;
if ( aCommand.Len() )
@@ -2012,7 +2012,7 @@ const XubString& Menu::ImplGetHelpText( sal_uInt16 nItemId ) const
if ( pData )
{
if ( !pData->aHelpText.Len() &&
- (( pData->aHelpId.getLength() ) || ( pData->aCommandStr.Len() )))
+ (( !pData->aHelpId.isEmpty() ) || ( pData->aCommandStr.Len() )))
{
Help* pHelp = Application::GetHelp();
if ( pHelp )
@@ -2020,7 +2020,7 @@ const XubString& Menu::ImplGetHelpText( sal_uInt16 nItemId ) const
if ( pData->aCommandStr.Len() )
pData->aHelpText = pHelp->GetHelpText( pData->aCommandStr, NULL );
- if( !pData->aHelpText.Len() && pData->aHelpId.getLength() )
+ if( !pData->aHelpText.Len() && !pData->aHelpId.isEmpty() )
pData->aHelpText = pHelp->GetHelpText( rtl::OStringToOUString( pData->aHelpId, RTL_TEXTENCODING_UTF8 ), NULL );
}
}
@@ -2070,7 +2070,7 @@ rtl::OString Menu::GetHelpId( sal_uInt16 nItemId ) const
if ( pData )
{
- if ( pData->aHelpId.getLength() )
+ if ( !pData->aHelpId.isEmpty() )
aRet = pData->aHelpId;
else
aRet = ::rtl::OUStringToOString( pData->aCommandStr, RTL_TEXTENCODING_UTF8 );
diff --git a/vcl/source/window/msgbox.cxx b/vcl/source/window/msgbox.cxx
index 5ffc6b0..0efd972 100644
--- a/vcl/source/window/msgbox.cxx
+++ b/vcl/source/window/msgbox.cxx
@@ -222,7 +222,7 @@ MessBox::~MessBox()
void MessBox::ImplPosControls()
{
- if ( GetHelpId().getLength() )
+ if ( !GetHelpId().isEmpty() )
{
if ( !mbHelpBtn )
{
diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx
index 0609683..74d6e08 100644
--- a/vcl/source/window/printdlg.cxx
+++ b/vcl/source/window/printdlg.cxx
@@ -160,7 +160,7 @@ void PrintDialog::PrintPreviewWindow::Paint( const Rectangle& )
Point aOffset( (aSize.Width() - maPreviewSize.Width() + nTextHeight) / 2 ,
(aSize.Height() - maPreviewSize.Height() + nTextHeight) / 2 );
- if( maReplacementString.getLength() != 0 )
+ if( !maReplacementString.isEmpty() )
{
// replacement is active
Push();
@@ -266,7 +266,7 @@ void PrintDialog::PrintPreviewWindow::setPreview( const GDIMetaFile& i_rNewPrevi
String aNumText( rLocWrap.getNum( aLogicPaperSize.Width(), nDigits ) );
aBuf.append( aNumText );
aBuf.appendAscii( eUnit == MAP_MM ? "mm" : "in" );
- if( i_rPaperName.getLength() )
+ if( !i_rPaperName.isEmpty() )
{
aBuf.appendAscii( " (" );
aBuf.append( i_rPaperName );
@@ -991,7 +991,7 @@ void PrintDialog::readFromSettings()
// persistent window state
rtl::OUString aWinState( pItem->getValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintDialog" ) ),
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "WindowState" ) ) ) );
- if( aWinState.getLength() )
+ if( !aWinState.isEmpty() )
SetWindowState( rtl::OUStringToOString( aWinState, RTL_TEXTENCODING_UTF8 ) );
if( maOptionsPage.maToFileBox.IsChecked() )
@@ -1179,11 +1179,11 @@ void PrintDialog::setupOptionalUI()
}
// bUseDependencyRow should only be true if a dependency exists
- bUseDependencyRow = bUseDependencyRow && (aDependsOnName.getLength() != 0);
+ bUseDependencyRow = bUseDependencyRow && !aDependsOnName.isEmpty();
// is it necessary to switch between static and dynamic pages ?
bool bSwitchPage = false;
- if( aGroupingHint.getLength() )
+ if( !aGroupingHint.isEmpty() )
bSwitchPage = true;
else if( aCtrlType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Subgroup" ) ) || (bOnStaticPage && ! bSubgroupOnStaticPage ) )
bSwitchPage = true;
@@ -1222,7 +1222,7 @@ void PrintDialog::setupOptionalUI()
pCurParent = &maNUpPage; // set layout page as current parent
bOnStaticPage = true;
}
- else if( aGroupingHint.getLength() )
+ else if( !aGroupingHint.isEmpty() )
{
pCurColumn = boost::dynamic_pointer_cast<vcl::RowOrColumn>(maJobPage.getLayout());
pCurParent = &maJobPage; // set job page as current parent
@@ -1231,7 +1231,7 @@ void PrintDialog::setupOptionalUI()
}
if( aCtrlType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Group" ) ) ||
- ( ! pCurParent && ! (bOnStaticPage || aGroupingHint.getLength() ) ) )
+ ( ! pCurParent && ! (bOnStaticPage || !aGroupingHint.isEmpty() ) ) )
{
// add new tab page
TabPage* pNewGroup = new TabPage( &maTabCtrl );
@@ -1252,9 +1252,9 @@ void PrintDialog::setupOptionalUI()
bSubgroupOnStaticPage = false;
bOnStaticPage = false;
}
- else if( aCtrlType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Subgroup" ) ) && (pCurParent || aGroupingHint.getLength() ) )
+ else if( aCtrlType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Subgroup" ) ) && (pCurParent || !aGroupingHint.isEmpty() ) )
{
- bSubgroupOnStaticPage = (aGroupingHint.getLength() != 0);
+ bSubgroupOnStaticPage = !aGroupingHint.isEmpty();
// create group FixedLine
if( ! aGroupingHint.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "PrintRange" ) ) ||
! pCurColumn->countElements() == 0
@@ -1365,7 +1365,7 @@ void PrintDialog::setupOptionalUI()
{
sal_Int32 nCurHelpText = 0;
boost::shared_ptr<vcl::RowOrColumn> pRadioColumn( pCurColumn );
- if( aText.getLength() )
+ if( !aText.isEmpty() )
{
// add a FixedText:
FixedText* pHeading = new FixedText( pCurParent );
@@ -1432,7 +1432,7 @@ void PrintDialog::setupOptionalUI()
aPropertyToDependencyRowMap.insert( std::pair< rtl::OUString, boost::shared_ptr<vcl::RowOrColumn> >( aPropertyName, pFieldColumn ) );
vcl::LabeledElement* pLabel = NULL;
- if( aText.getLength() )
+ if( !aText.isEmpty() )
{
// add a FixedText:
FixedText* pHeading = new FixedText( pCurParent, WB_VCENTER );
@@ -1719,7 +1719,7 @@ void PrintDialog::checkOptionalControlDependencies()
{
rtl::OUString aDep( maPController->getDependency( it->second ) );
// if the dependency is at least enabled, then enable this control anyway
- if( aDep.getLength() && maPController->isUIOptionEnabled( aDep ) )
+ if( !aDep.isEmpty() && maPController->isUIOptionEnabled( aDep ) )
bShouldbeEnabled = true;
}
}
@@ -2258,7 +2258,7 @@ void PrintDialog::makeEnabled( Window* i_pWindow )
if( it != maControlToPropertyMap.end() )
{
rtl::OUString aDependency( maPController->makeEnabled( it->second ) );
- if( aDependency.getLength() )
+ if( !aDependency.isEmpty() )
updateWindowFromProperty( aDependency );
}
}
diff --git a/vcl/source/window/status.cxx b/vcl/source/window/status.cxx
index f048719..e7ffdff 100644
--- a/vcl/source/window/status.cxx
+++ b/vcl/source/window/status.cxx
@@ -873,7 +873,7 @@ void StatusBar::RequestHelp( const HelpEvent& rHEvt )
String aCommand = GetItemCommand( nItemId );
rtl::OString aHelpId( GetHelpId( nItemId ) );
- if ( aCommand.Len() || aHelpId.getLength() )
+ if ( aCommand.Len() || !aHelpId.isEmpty() )
{
// Wenn eine Hilfe existiert, dann ausloesen
Help* pHelp = Application::GetHelp();
@@ -881,7 +881,7 @@ void StatusBar::RequestHelp( const HelpEvent& rHEvt )
{
if ( aCommand.Len() )
pHelp->Start( aCommand, this );
- else if ( aHelpId.getLength() )
+ else if ( !aHelpId.isEmpty() )
pHelp->Start( rtl::OStringToOUString( aHelpId, RTL_TEXTENCODING_UTF8 ), this );
}
return;
@@ -1266,14 +1266,14 @@ const XubString& StatusBar::GetHelpText( sal_uInt16 nItemId ) const
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
{
ImplStatusItem* pItem = (*mpItemList)[ nPos ];
- if ( !pItem->maHelpText.Len() && ( pItem->maHelpId.getLength() || pItem->maCommand.Len() ))
+ if ( !pItem->maHelpText.Len() && ( !pItem->maHelpId.isEmpty() || pItem->maCommand.Len() ))
{
Help* pHelp = Application::GetHelp();
if ( pHelp )
{
if ( pItem->maCommand.Len() )
pItem->maHelpText = pHelp->GetHelpText( pItem->maCommand, this );
- if ( !pItem->maHelpText.Len() && pItem->maHelpId.getLength() )
+ if ( !pItem->maHelpText.Len() && !pItem->maHelpId.isEmpty() )
pItem->maHelpText = pHelp->GetHelpText( rtl::OStringToOUString( pItem->maHelpId, RTL_TEXTENCODING_UTF8 ), this );
}
}
@@ -1329,7 +1329,7 @@ rtl::OString StatusBar::GetHelpId( sal_uInt16 nItemId ) const
if ( nPos != STATUSBAR_ITEM_NOTFOUND )
{
ImplStatusItem* pItem = (*mpItemList)[ nPos ];
- if ( pItem->maHelpId.getLength() )
+ if ( !pItem->maHelpId.isEmpty() )
aRet = pItem->maHelpId;
else
aRet = ::rtl::OUStringToOString( pItem->maCommand, RTL_TEXTENCODING_UTF8 );
diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx
index 905f0fe..2cf7fe0 100644
--- a/vcl/source/window/toolbox.cxx
+++ b/vcl/source/window/toolbox.cxx
@@ -4578,14 +4578,14 @@ const XubString& ToolBox::ImplGetHelpText( sal_uInt16 nItemId ) const
if ( pItem )
{
- if ( !pItem->maHelpText.Len() && ( pItem->maHelpId.getLength() || pItem->maCommandStr.Len() ))
+ if ( !pItem->maHelpText.Len() && ( !pItem->maHelpId.isEmpty() || pItem->maCommandStr.Len() ))
{
Help* pHelp = Application::GetHelp();
if ( pHelp )
{
if ( pItem->maCommandStr.Len() )
pItem->maHelpText = pHelp->GetHelpText( pItem->maCommandStr, this );
- if ( !pItem->maHelpText.Len() && pItem->maHelpId.getLength() )
+ if ( !pItem->maHelpText.Len() && !pItem->maHelpId.isEmpty() )
pItem->maHelpText = pHelp->GetHelpText( rtl::OStringToOUString( pItem->maHelpId, RTL_TEXTENCODING_UTF8 ), this );
}
}
@@ -4654,7 +4654,7 @@ void ToolBox::RequestHelp( const HelpEvent& rHEvt )
String aCommand = GetItemCommand( nItemId );
rtl::OString aHelpId( GetHelpId( nItemId ) );
- if ( aCommand.Len() || aHelpId.getLength() )
+ if ( aCommand.Len() || !aHelpId.isEmpty() )
{
// If help is available then trigger it
Help* pHelp = Application::GetHelp();
@@ -4662,7 +4662,7 @@ void ToolBox::RequestHelp( const HelpEvent& rHEvt )
{
if ( aCommand.Len() )
pHelp->Start( aCommand, this );
- else if ( aHelpId.getLength() )
+ else if ( !aHelpId.isEmpty() )
pHelp->Start( rtl::OStringToOUString( aHelpId, RTL_TEXTENCODING_UTF8 ), this );
}
return;
diff --git a/vcl/source/window/toolbox2.cxx b/vcl/source/window/toolbox2.cxx
index 067156b..0925ed6 100644
--- a/vcl/source/window/toolbox2.cxx
+++ b/vcl/source/window/toolbox2.cxx
@@ -1762,7 +1762,7 @@ rtl::OString ToolBox::GetHelpId( sal_uInt16 nItemId ) const
if ( pItem )
{
- if ( pItem->maHelpId.getLength() )
+ if ( !pItem->maHelpId.isEmpty() )
aRet = pItem->maHelpId;
else
aRet = ::rtl::OUStringToOString( pItem->maCommandStr, RTL_TEXTENCODING_UTF8 );
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 06f1efc..662701b 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -8321,10 +8321,10 @@ uno::Reference< XDragSource > Window::GetDragSource()
aDropTargetAL[ 1 ] = makeAny( (sal_Size)(pEnvData->aShellWindow) );
aDropTargetAL[ 2 ] = makeAny( vcl::createBmpConverter() );
#endif
- if( aDragSourceSN.getLength() )
+ if( !aDragSourceSN.isEmpty() )
mpWindowImpl->mpFrameData->mxDragSource = uno::Reference< XDragSource > ( xFactory->createInstanceWithArguments( aDragSourceSN, aDragSourceAL ), UNO_QUERY );
- if( aDropTargetSN.getLength() )
+ if( !aDropTargetSN.isEmpty() )
mpWindowImpl->mpFrameData->mxDropTarget = uno::Reference< XDropTarget > ( xFactory->createInstanceWithArguments( aDropTargetSN, aDropTargetAL ), UNO_QUERY );
}
}
diff --git a/vcl/unx/generic/app/saldata.cxx b/vcl/unx/generic/app/saldata.cxx
index d4e8b74..d142476 100644
--- a/vcl/unx/generic/app/saldata.cxx
+++ b/vcl/unx/generic/app/saldata.cxx
@@ -449,7 +449,7 @@ void SalXLib::Init()
}
}
- if (!pDisp && !aDisplay.getLength())
+ if (!pDisp && aDisplay.isEmpty())
{
// Open $DISPLAY or default...
char *pDisplay = getenv("DISPLAY");
diff --git a/vcl/unx/generic/app/sm.cxx b/vcl/unx/generic/app/sm.cxx
index 68f1dfe..1bb290c 100644
--- a/vcl/unx/generic/app/sm.cxx
+++ b/vcl/unx/generic/app/sm.cxx
@@ -472,7 +472,7 @@ void SessionManagerClient::open()
SmcSaveCompleteProcMask |
SmcShutdownCancelledProcMask ,
&aCallbacks,
- rPrevId.getLength() ? const_cast<char*>(rPrevId.getStr()) : NULL,
+ rPrevId.isEmpty() ? NULL : const_cast<char*>(rPrevId.getStr()),
&pClientID,
sizeof( aErrBuf ),
aErrBuf );
diff --git a/vcl/unx/generic/app/wmadaptor.cxx b/vcl/unx/generic/app/wmadaptor.cxx
index 46df226..8145ef7 100644
--- a/vcl/unx/generic/app/wmadaptor.cxx
+++ b/vcl/unx/generic/app/wmadaptor.cxx
@@ -905,7 +905,7 @@ bool WMAdaptor::getWMshouldSwitchWorkspace() const
vcl::SettingsConfigItem* pItem = vcl::SettingsConfigItem::get();
rtl::OUString aSetting( pItem->getValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "WM" ) ),
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ShouldSwitchWorkspace" ) ) ) );
- if( aSetting.getLength() == 0 )
+ if( aSetting.isEmpty() )
{
if( m_aWMName.EqualsAscii( "awesome" ) )
{
@@ -1008,12 +1008,12 @@ void WMAdaptor::setWMName( X11SalFrame* pFrame, const String& rWMName ) const
::rtl::OUString aCountry( pLocale->Country );
::rtl::OUString aVariant( pLocale->Variant );
- if( aCountry.getLength() )
+ if( !aCountry.isEmpty() )
{
aLocaleString += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("_"));
aLocaleString += aCountry;
}
- if( aVariant.getLength() )
+ if( !aVariant.isEmpty() )
aLocaleString += aVariant;
aWMLocale = ::rtl::OUStringToOString( aLocaleString, RTL_TEXTENCODING_ISO_8859_1 );
}
diff --git a/vcl/unx/generic/dtrans/X11_selection.cxx b/vcl/unx/generic/dtrans/X11_selection.cxx
index 3e9da57..d557b88 100644
--- a/vcl/unx/generic/dtrans/X11_selection.cxx
+++ b/vcl/unx/generic/dtrans/X11_selection.cxx
@@ -377,7 +377,7 @@ void SelectionManager::initialize( const Sequence< Any >& arguments ) throw (::c
OString aDisplayName( OUStringToOString( aUDisplay, RTL_TEXTENCODING_ISO_8859_1 ) );
- m_pDisplay = XOpenDisplay( aDisplayName.getLength() ? aDisplayName.getStr() : NULL );
+ m_pDisplay = XOpenDisplay( aDisplayName.isEmpty() ? NULL : aDisplayName.getStr());
if( m_pDisplay )
{
@@ -611,7 +611,7 @@ OString SelectionManager::convertToCompound( const OUString& rText )
* in these encodings the directly converted text does the
* trick, also.
*/
- if( ! aRet.getLength() && rText.getLength() )
+ if( aRet.isEmpty() && !rText.isEmpty() )
aRet = OUStringToOString( rText, osl_getThreadTextEncoding() );
#endif
}
@@ -708,7 +708,7 @@ SelectionManager& SelectionManager::get( const OUString& rDisplayName )
osl::MutexGuard aGuard( *osl::Mutex::getGlobalMutex() );
OUString aDisplayName( rDisplayName );
- if( ! aDisplayName.getLength() )
+ if( aDisplayName.isEmpty() )
aDisplayName = OStringToOUString( getenv( "DISPLAY" ), RTL_TEXTENCODING_ISO_8859_1 );
SelectionManager* pInstance = NULL;
commit 0a112c96fd8077a027dac88510915eb93903748b
Author: Olivier Hallot <olivier.hallot at alta.org.br>
Date: Tue Jan 31 16:44:12 2012 -0200
Fix for fdo43460 Part LVII getLength() to isEmpty()
Part LVII
Modules
vcl (part 1)
diff --git a/vcl/generic/app/gensys.cxx b/vcl/generic/app/gensys.cxx
index ddde4a1..29b39dd 100644
--- a/vcl/generic/app/gensys.cxx
+++ b/vcl/generic/app/gensys.cxx
@@ -163,7 +163,7 @@ const char* SalGenericSystem::getFrameClassName()
rtl::Bootstrap aBootstrap( aIni );
aBootstrap.getFrom( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ProductKey" ) ), aProduct );
- if( aProduct.getLength() )
+ if( !aProduct.isEmpty() )
aClassName.append( rtl::OUStringToOString( aProduct, osl_getThreadTextEncoding() ) );
else
aClassName.append( "VCLSalFrame" );
diff --git a/vcl/generic/glyphs/gcach_ftyp.cxx b/vcl/generic/glyphs/gcach_ftyp.cxx
index 7d14ce8..93935e6 100644
--- a/vcl/generic/glyphs/gcach_ftyp.cxx
+++ b/vcl/generic/glyphs/gcach_ftyp.cxx
@@ -600,7 +600,7 @@ void FreetypeManager::AddFontFile( const rtl::OString& rNormalizedName,
int nFaceNum, sal_IntPtr nFontId, const ImplDevFontAttributes& rDevFontAttr,
const ExtraKernInfo* pExtraKernInfo )
{
- if( !rNormalizedName.getLength() )
+ if( rNormalizedName.isEmpty() )
return;
if( maFontList.find( nFontId ) != maFontList.end() )
diff --git a/vcl/generic/print/common_gfx.cxx b/vcl/generic/print/common_gfx.cxx
index 26ac567..8de0134 100644
--- a/vcl/generic/print/common_gfx.cxx
+++ b/vcl/generic/print/common_gfx.cxx
@@ -1228,7 +1228,7 @@ PrinterGfx::DrawEPS( const Rectangle& rBoundingBox, void* pPtr, sal_uInt32 nSize
}
static sal_uInt16 nEps = 0;
- if( ! aDocTitle.getLength() )
+ if( aDocTitle.isEmpty() )
aDocTitle = rtl::OString::valueOf(static_cast<sal_Int32>(nEps++));
if( fLeft != fRight && fTop != fBottom )
diff --git a/vcl/generic/print/printerjob.cxx b/vcl/generic/print/printerjob.cxx
index 35633cd..503d7af 100644
--- a/vcl/generic/print/printerjob.cxx
+++ b/vcl/generic/print/printerjob.cxx
@@ -277,7 +277,7 @@ PrinterJob::~PrinterJob ()
delete mpJobTrailer;
// XXX should really call osl::remove routines
- if( maSpoolDirName.getLength() )
+ if( !maSpoolDirName.isEmpty() )
removeSpoolDir (maSpoolDirName);
// osl::Directory::remove (maSpoolDirName);
@@ -391,7 +391,7 @@ PrinterJob::StartJob (
}
maJobTitle = aFilterWS;
- if( aTitle.getLength() )
+ if( !aTitle.isEmpty() )
{
WritePS (mpJobHeader, "%%Title: (");
WritePS (mpJobHeader, aTitle);
@@ -461,7 +461,7 @@ PrinterJob::EndJob ()
FILE* pDestFILE = NULL;
/* create a destination either as file or as a pipe */
- sal_Bool bSpoolToFile = maFileName.getLength() > 0 ? sal_True : sal_False;
+ sal_Bool bSpoolToFile = !maFileName.isEmpty();
if (bSpoolToFile)
{
const rtl::OString aFileName = rtl::OUStringToOString (maFileName,
diff --git a/vcl/inc/generic/gendata.hxx b/vcl/inc/generic/gendata.hxx
index eb45fd9..f76b70f 100644
--- a/vcl/inc/generic/gendata.hxx
+++ b/vcl/inc/generic/gendata.hxx
@@ -61,7 +61,7 @@ class VCL_DLLPUBLIC SalGenericData : public SalData
const rtl::OUString& GetHostname()
{
- if (!m_aHostname.getLength())
+ if (m_aHostname.isEmpty())
osl_getLocalHostname( &m_aHostname.pData );
return m_aHostname;
}
diff --git a/vcl/inc/image.h b/vcl/inc/image.h
index 1eab7de..1497750 100644
--- a/vcl/inc/image.h
+++ b/vcl/inc/image.h
@@ -87,7 +87,7 @@ struct ImageAryData
ImageAryData( const ImageAryData& rData );
~ImageAryData();
- bool IsLoadable() { return maBitmapEx.IsEmpty() && maName.getLength(); }
+ bool IsLoadable() { return maBitmapEx.IsEmpty() && !maName.isEmpty(); }
void Load(const rtl::OUString &rPrefix);
ImageAryData& operator=( const ImageAryData& rData );
diff --git a/vcl/source/app/settings.cxx b/vcl/source/app/settings.cxx
index d74ac36..2a3a5ca 100644
--- a/vcl/source/app/settings.cxx
+++ b/vcl/source/app/settings.cxx
@@ -735,7 +735,7 @@ sal_uLong StyleSettings::ImplNameToSymbolsStyle( const ::rtl::OUString &rName )
*/
void StyleSettings::SetPreferredSymbolsStyleName( const ::rtl::OUString &rName )
{
- if ( rName.getLength() > 0 )
+ if ( !rName.isEmpty() )
{
::rtl::OUString rNameLowCase( rName.toAsciiLowerCase() );
@@ -1776,7 +1776,7 @@ void AllSettings::SetLocale( const ::com::sun::star::lang::Locale& rLocale )
mpData->maLocale = rLocale;
- if ( !rLocale.Language.getLength() )
+ if ( rLocale.Language.isEmpty() )
mpData->meLanguage = LANGUAGE_SYSTEM;
else
mpData->meLanguage = MsLangId::convertLocaleToLanguage( rLocale );
@@ -1878,7 +1878,7 @@ sal_Bool AllSettings::GetLayoutRTL() const
const ::com::sun::star::lang::Locale& AllSettings::GetLocale() const
{
- if ( !mpData->maLocale.Language.getLength() )
+ if ( mpData->maLocale.Language.isEmpty() )
mpData->maLocale = mpData->maSysLocale.GetLocale();
return mpData->maLocale;
@@ -1889,7 +1889,7 @@ const ::com::sun::star::lang::Locale& AllSettings::GetLocale() const
const ::com::sun::star::lang::Locale& AllSettings::GetUILocale() const
{
// the UILocale is never changed
- if ( !mpData->maUILocale.Language.getLength() )
+ if ( mpData->maUILocale.Language.isEmpty() )
mpData->maUILocale = mpData->maSysLocale.GetUILocale();
return mpData->maUILocale;
diff --git a/vcl/source/app/unohelp.cxx b/vcl/source/app/unohelp.cxx
index 76014ff..ebfa511 100644
--- a/vcl/source/app/unohelp.cxx
+++ b/vcl/source/app/unohelp.cxx
@@ -109,7 +109,7 @@ uno::Reference< lang::XMultiServiceFactory > vcl::unohelper::GetMultiServiceFact
while ( aVCLComponentsArray[ nCompCount ].pLibName )
{
OUString aComponentPathString = CreateLibraryName( aVCLComponentsArray[ nCompCount ].pLibName, aVCLComponentsArray[ nCompCount ].bHasSUPD );
- if (aComponentPathString.getLength() )
+ if (!aComponentPathString.isEmpty() )
{
try
{
diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx
index a70ce3c..e69eb09 100644
--- a/vcl/source/control/edit.cxx
+++ b/vcl/source/control/edit.cxx
@@ -977,7 +977,7 @@ void Edit::ImplInsertText( const XubString& rStr, const Selection* pNewSel, sal_
// at this point now we will insert the non-empty text 'normally' some lines below...
}
- if ( aNewText.getLength() )
+ if ( !aNewText.isEmpty() )
maText.Insert( String( aNewText ), (xub_StrLen)aSelection.Min() );
if ( !pNewSel )
diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx
index 6eb2d00..f5bf19f 100644
--- a/vcl/source/control/tabctrl.cxx
+++ b/vcl/source/control/tabctrl.cxx
@@ -629,12 +629,12 @@ void TabControl::ImplChangeTabPage( sal_uInt16 nId, sal_uInt16 nOldId )
// activate page here so the conbtrols can be switched
// also set the help id of the parent window to that of the tab page
- if ( !GetHelpId().getLength() )
+ if ( GetHelpId().isEmpty() )
{
mbRestoreHelpId = sal_True;
pCtrlParent->SetHelpId( pPage->GetHelpId() );
}
- if ( !pCtrlParent->GetUniqueId().getLength() )
+ if ( pCtrlParent->GetUniqueId().isEmpty() )
{
mbRestoreUnqId = sal_True;
pCtrlParent->SetUniqueId( pPage->GetUniqueId() );
@@ -1379,7 +1379,7 @@ void TabControl::RequestHelp( const HelpEvent& rHEvt )
else if ( rHEvt.GetMode() & HELPMODE_EXTENDED )
{
rtl::OUString aHelpId( rtl::OStringToOUString( GetHelpId( nItemId ), RTL_TEXTENCODING_UTF8 ) );
- if ( aHelpId.getLength() )
+ if ( !aHelpId.isEmpty() )
{
// Wenn eine Hilfe existiert, dann ausloesen
Help* pHelp = Application::GetHelp();
@@ -2030,7 +2030,7 @@ const XubString& TabControl::GetHelpText( sal_uInt16 nPageId ) const
if ( pItem )
{
- if ( !pItem->maHelpText.Len() && pItem->maHelpId.getLength() )
+ if ( !pItem->maHelpText.Len() && !pItem->maHelpId.isEmpty() )
{
Help* pHelp = Application::GetHelp();
if ( pHelp )
diff --git a/vcl/source/gdi/configsettings.cxx b/vcl/source/gdi/configsettings.cxx
index 92cb685..c3ee3d0 100644
--- a/vcl/source/gdi/configsettings.cxx
+++ b/vcl/source/gdi/configsettings.cxx
@@ -162,7 +162,7 @@ void SettingsConfigItem::getValues()
if( pValue->getValueTypeClass() == TypeClass_STRING )
{
const OUString* pLine = (const OUString*)pValue->getValue();
- if( pLine->getLength() )
+ if( !pLine->isEmpty() )
m_aSettings[ aKeyName ][ pFrom[i] ] = *pLine;
#if OSL_DEBUG_LEVEL > 2
OSL_TRACE( " \"%s\"=\"%.30s\"\n",
diff --git a/vcl/source/gdi/gfxlink.cxx b/vcl/source/gdi/gfxlink.cxx
index dcfb571..7f7e634 100644
--- a/vcl/source/gdi/gfxlink.cxx
+++ b/vcl/source/gdi/gfxlink.cxx
@@ -399,7 +399,7 @@ ImpSwap::ImpSwap( sal_uInt8* pData, sal_uLong nDataSize ) :
::utl::TempFile aTempFile;
maURL = aTempFile.GetURL();
- if( maURL.getLength() )
+ if( !maURL.isEmpty() )
{
SvStream* pOStm = ::utl::UcbStreamHelper::CreateStream( maURL, STREAM_READWRITE | STREAM_SHARE_DENYWRITE );
if( pOStm )
diff --git a/vcl/source/gdi/image.cxx b/vcl/source/gdi/image.cxx
index 7860745..c922982 100644
--- a/vcl/source/gdi/image.cxx
+++ b/vcl/source/gdi/image.cxx
@@ -706,7 +706,7 @@ sal_uInt16 ImageList::GetImagePos( const ::rtl::OUString& rImageName ) const
{
DBG_CHKTHIS( ImageList, NULL );
- if( mpImplData && rImageName.getLength() )
+ if( mpImplData && !rImageName.isEmpty() )
{
for( sal_uInt32 i = 0; i < mpImplData->maImages.size(); i++ )
{
@@ -757,7 +757,7 @@ void ImageList::GetImageNames( ::std::vector< ::rtl::OUString >& rNames ) const
for( sal_uInt32 i = 0; i < mpImplData->maImages.size(); i++ )
{
const rtl::OUString& rName( mpImplData->maImages[ i ]->maName );
- if( rName.getLength() != 0 )
+ if( !rName.isEmpty())
rNames.push_back( rName );
}
}
diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx
index 38261b9..6776037 100644
--- a/vcl/source/gdi/impgraph.cxx
+++ b/vcl/source/gdi/impgraph.cxx
@@ -1043,7 +1043,7 @@ sal_Bool ImpGraphic::ImplReadEmbedded( SvStream& rIStm, sal_Bool bSwap )
::utl::TempFile aTempFile;
const INetURLObject aTmpURL( aTempFile.GetURL() );
- if( aTmpURL.GetMainURL( INetURLObject::NO_DECODE ).getLength() )
+ if( !aTmpURL.GetMainURL( INetURLObject::NO_DECODE ).isEmpty() )
{
SvStream* pOStm = NULL;
try
@@ -1257,7 +1257,7 @@ sal_Bool ImpGraphic::ImplSwapOut()
::utl::TempFile aTempFile;
const INetURLObject aTmpURL( aTempFile.GetURL() );
- if( aTmpURL.GetMainURL( INetURLObject::NO_DECODE ).getLength() )
+ if( !aTmpURL.GetMainURL( INetURLObject::NO_DECODE ).isEmpty() )
{
SvStream* pOStm = NULL;
try
diff --git a/vcl/source/gdi/impimage.cxx b/vcl/source/gdi/impimage.cxx
index aac03b7..3517260 100644
--- a/vcl/source/gdi/impimage.cxx
+++ b/vcl/source/gdi/impimage.cxx
@@ -95,7 +95,7 @@ ImplImageList::ImplImageList( const ImplImageList &aSrc ) :
{
ImageAryData* pAryData = new ImageAryData( **aIt );
maImages.push_back( pAryData );
- if( pAryData->maName.getLength() )
+ if( !pAryData->maName.isEmpty() )
maNameHash [ pAryData->maName ] = pAryData;
}
}
@@ -111,14 +111,14 @@ void ImplImageList::AddImage( const ::rtl::OUString &aName,
{
ImageAryData *pImg = new ImageAryData( aName, nId, aBitmapEx );
maImages.push_back( pImg );
- if( aName.getLength() )
+ if( !aName.isEmpty() )
maNameHash [ aName ] = pImg;
}
void ImplImageList::RemoveImage( sal_uInt16 nPos )
{
ImageAryData *pImg = maImages[ nPos ];
- if( pImg->maName.getLength() )
+ if( !pImg->maName.isEmpty() )
maNameHash.erase( pImg->maName );
maImages.erase( maImages.begin() + nPos );
}
diff --git a/vcl/source/gdi/impimagetree.cxx b/vcl/source/gdi/impimagetree.cxx
index ef48f92..55be540 100644
--- a/vcl/source/gdi/impimagetree.cxx
+++ b/vcl/source/gdi/impimagetree.cxx
@@ -210,13 +210,13 @@ bool ImplImageTree::doLoadImage(
css::lang::Locale const & loc =
Application::GetSettings().GetUILocale();
paths.push_back(createPath(name, pos, loc.Language));
- if (loc.Country.getLength() != 0) {
+ if (!loc.Country.isEmpty()) {
rtl::OUStringBuffer b(loc.Language);
b.append(sal_Unicode('-'));
b.append(loc.Country);
rtl::OUString p(createPath(name, pos, b.makeStringAndClear()));
paths.push_back(p);
- if (loc.Variant.getLength() != 0) {
+ if (!loc.Variant.isEmpty()) {
b.append(p);
b.append(sal_Unicode('-'));
b.append(loc.Variant);
@@ -251,7 +251,7 @@ void ImplImageTree::shutDown() {
}
void ImplImageTree::setStyle(rtl::OUString const & style) {
- OSL_ASSERT(style.getLength() != 0); // empty m_style means "not initialized"
+ OSL_ASSERT(!style.isEmpty()); // empty m_style means "not initialized"
if (style != m_style) {
m_style = style;
resetZips();
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index 508510f..79ded4b 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -777,7 +777,7 @@ void PDFWriterImpl::createWidgetFieldName( sal_Int32 i_nWidgetIndex, const PDFWr
} while( nTokenIndex != -1 );
// insert widget into its hierarchy field
- if( aDomain.getLength() )
+ if( !aDomain.isEmpty() )
{
boost::unordered_map< rtl::OString, sal_Int32, rtl::OStringHash >::const_iterator it = m_aFieldNameMap.find( aDomain );
if( it != m_aFieldNameMap.end() )
@@ -792,7 +792,7 @@ void PDFWriterImpl::createWidgetFieldName( sal_Int32 i_nWidgetIndex, const PDFWr
}
}
- if( aPartialName.getLength() == 0 )
+ if( aPartialName.isEmpty() )
{
// how funny, an empty field name
if( i_rControl.getType() == PDFWriter::RadioButton )
@@ -1098,7 +1098,7 @@ static void appendResourceMap( OStringBuffer& rBuf, const char* pPrefix, const P
int ni = 0;
for( PDFWriterImpl::ResourceMap::const_iterator it = rList.begin(); it != rList.end(); ++it )
{
- if( it->first.getLength() && it->second > 0 )
+ if( !it->first.isEmpty() && it->second > 0 )
{
rBuf.append( '/' );
rBuf.append( it->first );
@@ -2873,7 +2873,7 @@ sal_Int32 PDFWriterImpl::emitStructure( PDFStructureElement& rEle )
{
aLine.append( "/StructElem\n"
"/S/" );
- if( rEle.m_aAlias.getLength() > 0 )
+ if( !rEle.m_aAlias.isEmpty() )
aLine.append( rEle.m_aAlias );
else
aLine.append( getStructureTag( rEle.m_eType ) );
@@ -2884,13 +2884,13 @@ sal_Int32 PDFWriterImpl::emitStructure( PDFStructureElement& rEle )
"/Pg " );
aLine.append( rEle.m_nFirstPageObject );
aLine.append( " 0 R\n" );
- if( rEle.m_aActualText.getLength() )
+ if( !rEle.m_aActualText.isEmpty() )
{
aLine.append( "/ActualText" );
appendUnicodeTextStringEncrypt( rEle.m_aActualText, rEle.m_nObject, aLine );
aLine.append( "\n" );
}
- if( rEle.m_aAltText.getLength() )
+ if( !rEle.m_aAltText.isEmpty() )
{
aLine.append( "/Alt" );
appendUnicodeTextStringEncrypt( rEle.m_aAltText, rEle.m_nObject, aLine );
@@ -2900,18 +2900,18 @@ sal_Int32 PDFWriterImpl::emitStructure( PDFStructureElement& rEle )
if( ! rEle.m_aBBox.IsEmpty() || rEle.m_aAttributes.size() )
{
OString aAttribs = emitStructureAttributes( rEle );
- if( aAttribs.getLength() )
+ if( !aAttribs.isEmpty() )
{
aLine.append( "/A" );
aLine.append( aAttribs );
aLine.append( "\n" );
}
}
- if( rEle.m_aLocale.Language.getLength() > 0 )
+ if( !rEle.m_aLocale.Language.isEmpty() )
{
OUStringBuffer aLocBuf( 16 );
aLocBuf.append( rEle.m_aLocale.Language.toAsciiLowerCase() );
- if( rEle.m_aLocale.Country.getLength() > 0 )
+ if( !rEle.m_aLocale.Country.isEmpty() )
{
aLocBuf.append( sal_Unicode('-') );
aLocBuf.append( rEle.m_aLocale.Country );
@@ -4623,7 +4623,7 @@ we check in the following sequence:
if( aTargetURL.hasFinalSlash() )
m_aContext.DefaultLinkAction = PDFWriter::URIAction;
- if( aFileExtension.getLength() > 0 )
+ if( !aFileExtension.isEmpty() )
{
if( m_aContext.ConvertOOoTargetToPDFTarget )
{
@@ -4684,7 +4684,7 @@ we check in the following sequence:
// This code will permit the correct opening of application on web pages, the one that
// normally have fragments (but I may be wrong...)
// and will force the use of URI when the protocol is not file://
- if( (aFragment.getLength() > 0 && !bTargetHasPDFExtension) ||
+ if( (!aFragment.isEmpty() && !bTargetHasPDFExtension) ||
eTargetProtocol != INET_PROT_FILE )
{
aLine.append( "/URI/URI" );
@@ -4709,7 +4709,7 @@ we check in the following sequence:
INetURLObject::WAS_ENCODED,
INetURLObject::DECODE_WITH_CHARSET ) :
aURLNoMark, rLink.m_nObject, aLine, osl_getThreadTextEncoding() );
- if( aFragment.getLength() > 0 )
+ if( !aFragment.isEmpty() )
{
aLine.append("/D/");
appendDestinationName( aFragment , aLine );
@@ -4720,7 +4720,7 @@ we check in the following sequence:
// change the fragment to accomodate the bookmark (only if the file extension is PDF and
// the requested action is of the correct type)
if(m_aContext.DefaultLinkAction == PDFWriter::URIActionDestination &&
- bTargetHasPDFExtension && aFragment.getLength() > 0 )
+ bTargetHasPDFExtension && !aFragment.isEmpty() )
{
OStringBuffer aLineLoc( 1024 );
appendDestinationName( aFragment , aLineLoc );
@@ -5404,7 +5404,7 @@ bool PDFWriterImpl::emitAppearances( PDFWidget& rWidget, OStringBuffer& rAnnotDi
rAnnotDict.append( bUseSubDict ? ">>\n" : "\n" );
}
rAnnotDict.append( ">>\n" );
- if( aStandardAppearance.getLength() )
+ if( !aStandardAppearance.isEmpty() )
{
rAnnotDict.append( "/AS /" );
rAnnotDict.append( aStandardAppearance );
@@ -5459,7 +5459,7 @@ bool PDFWriterImpl::emitWidgetAnnotations()
{
aValue.append( "/" );
// check for radio group with all buttons unpressed
- if( rWidget.m_aValue.getLength() == 0 )
+ if( rWidget.m_aValue.isEmpty() )
aValue.append( "Off" );
else
appendName( rWidget.m_aValue, aValue );
@@ -5522,13 +5522,13 @@ bool PDFWriterImpl::emitWidgetAnnotations()
}
aLine.append( "]\n" );
}
- if( rWidget.m_aName.getLength() )
+ if( !rWidget.m_aName.isEmpty() )
{
aLine.append( "/T" );
appendLiteralStringEncrypt( rWidget.m_aName, rWidget.m_nObject, aLine );
aLine.append( "\n" );
}
- if( m_aContext.Version > PDFWriter::PDF_1_2 && rWidget.m_aDescription.getLength() )
+ if( m_aContext.Version > PDFWriter::PDF_1_2 && !rWidget.m_aDescription.isEmpty() )
{
// the alternate field name should be unicode able since it is
// supposed to be used in UI
@@ -5642,9 +5642,9 @@ bool PDFWriterImpl::emitWidgetAnnotations()
else
m_aErrors.insert( PDFWriter::Warning_FormAction_Omitted_PDFA );
}
- if( rWidget.m_aDAString.getLength() )
+ if( !rWidget.m_aDAString.isEmpty() )
{
- if( rWidget.m_aDRDict.getLength() )
+ if( !rWidget.m_aDRDict.isEmpty() )
{
aLine.append( "/DR<<" );
aLine.append( rWidget.m_aDRDict );
@@ -5667,7 +5667,7 @@ bool PDFWriterImpl::emitWidgetAnnotations()
// appearance charactristics for terminal fields
// which are supposed to have an appearance constructed
// by the viewer application
- if( rWidget.m_aMKDict.getLength() )
+ if( !rWidget.m_aMKDict.isEmpty() )
{
aLine.append( "/MK<<" );
aLine.append( rWidget.m_aMKDict );
@@ -5952,11 +5952,11 @@ bool PDFWriterImpl::emitCatalog()
aLine.append( nStructureDict );
aLine.append( " 0 R\n" );
}
- if( m_aContext.DocumentLocale.Language.getLength() > 0 )
+ if( !m_aContext.DocumentLocale.Language.isEmpty() )
{
OUStringBuffer aLocBuf( 16 );
aLocBuf.append( m_aContext.DocumentLocale.Language.toAsciiLowerCase() );
- if( m_aContext.DocumentLocale.Country.getLength() > 0 )
+ if( !m_aContext.DocumentLocale.Country.isEmpty() )
{
aLocBuf.append( sal_Unicode('-') );
aLocBuf.append( m_aContext.DocumentLocale.Country );
@@ -10748,7 +10748,7 @@ void PDFWriterImpl::beginStructureElementMCSeq()
OStringBuffer aLine( 128 );
sal_Int32 nMCID = m_aPages[ m_nCurrentPage ].m_aMCIDParents.size();
aLine.append( "/" );
- if( rEle.m_aAlias.getLength() > 0 )
+ if( !rEle.m_aAlias.isEmpty() )
aLine.append( rEle.m_aAlias );
else
aLine.append( getStructureTag( rEle.m_eType ) );
@@ -10870,7 +10870,7 @@ sal_Int32 PDFWriterImpl::beginStructureElement( PDFWriter::StructElement eType,
m_nCurrentStructElement = nNewId;
// handle alias names
- if( rAlias.getLength() && eType != PDFWriter::NonStructElement )
+ if( !rAlias.isEmpty() && eType != PDFWriter::NonStructElement )
{
OStringBuffer aNameBuf( rAlias.getLength() );
appendName( rAlias, aNameBuf );
@@ -10884,7 +10884,7 @@ sal_Int32 PDFWriterImpl::beginStructureElement( PDFWriter::StructElement eType,
aLine.append( m_nCurrentStructElement );
aLine.append( ": " );
aLine.append( getStructureTag( eType ) );
- if( rEle.m_aAlias.getLength() )
+ if( !rEle.m_aAlias.isEmpty() )
{
aLine.append( " aliased as \"" );
aLine.append( rEle.m_aAlias );
@@ -10928,7 +10928,7 @@ void PDFWriterImpl::endStructureElement()
aLine.append( m_nCurrentStructElement );
aLine.append( ": " );
aLine.append( getStructureTag( m_aStructure[ m_nCurrentStructElement ].m_eType ) );
- if( m_aStructure[ m_nCurrentStructElement ].m_aAlias.getLength() )
+ if( !m_aStructure[ m_nCurrentStructElement ].m_aAlias.isEmpty() )
{
aLine.append( " aliased as \"" );
aLine.append( m_aStructure[ m_nCurrentStructElement ].m_aAlias );
@@ -11066,7 +11066,7 @@ bool PDFWriterImpl::setCurrentStructureElement( sal_Int32 nEle )
aLine.append( m_nCurrentStructElement );
aLine.append( ": " );
aLine.append( getStructureTag( m_aStructure[ m_nCurrentStructElement ].m_eType ) );
- if( m_aStructure[ m_nCurrentStructElement ].m_aAlias.getLength() )
+ if( !m_aStructure[ m_nCurrentStructElement ].m_aAlias.isEmpty() )
{
aLine.append( " aliased as \"" );
aLine.append( m_aStructure[ m_nCurrentStructElement ].m_aAlias );
@@ -11621,7 +11621,7 @@ sal_Int32 PDFWriterImpl::createControl( const PDFWriter::AnyWidget& rControl, sa
TEXT_DRAW_MULTILINE | TEXT_DRAW_WORDBREAK;
rNewWidget.m_nFlags |= 0x00010000;
- if( rBtn.URL.getLength() )
+ if( !rBtn.URL.isEmpty() )
rNewWidget.m_aListEntries.push_back( rBtn.URL );
rNewWidget.m_bSubmit = rBtn.Submit;
rNewWidget.m_bSubmitGet = rBtn.SubmitGet;
@@ -11652,7 +11652,7 @@ sal_Int32 PDFWriterImpl::createControl( const PDFWriter::AnyWidget& rControl, sa
rNewWidget.m_aValue = OUString( RTL_CONSTASCII_USTRINGPARAM( "Off" ) );
rNewWidget.m_aOnValue = rBtn.OnValue;
- if( ! rRadioButton.m_aValue.getLength() && rBtn.Selected )
+ if( rRadioButton.m_aValue.isEmpty() && rBtn.Selected )
{
rNewWidget.m_aValue = rNewWidget.m_aOnValue;
rRadioButton.m_aValue = rNewWidget.m_aOnValue;
More information about the Libreoffice-commits
mailing list