From 9753031300bb9bd61bbba2f617900422cdbde1ff Mon Sep 17 00:00:00 2001 From: "Ocke.Janssen@oracle.com" Date: Tue, 6 Dec 2011 01:28:00 +0100 Subject: [PATCH] impress210: #i105310# set tooltip for items and some refactoring # HG changeset patch # User Ocke.Janssen@oracle.com # Date 1297164555 -3600 # Node ID 902597eed5414555107034f62583c4ccc2cdfd4b # Parent 2f0f385e8b25938777bb9fed6a86a2ff43e0b7cd impress210: #i105310# set tooltip for items and some refactoring --- sd/source/core/CustomAnimationPreset.cxx | 4 ++-- .../ui/animations/CustomAnimationPane.cxx | 2 +- sd/source/ui/dlg/SpellDialogChildWindow.cxx | 2 +- sd/source/ui/dlg/dlgass.cxx | 4 ++-- .../ConfigurationControllerBroadcaster.cxx | 4 ++-- .../ui/framework/configuration/ResourceId.cxx | 12 +++++----- .../framework/factories/BasicViewFactory.cxx | 2 +- .../ui/slidesorter/controller/SlsAnimator.cxx | 2 +- .../ui/toolpanel/controls/DocumentHelper.cxx | 2 +- sd/source/ui/view/ViewTabBar.cxx | 2 +- svx/inc/galtheme.hrc | 2 +- svx/inc/svx/gallery.hxx | 2 +- svx/source/form/fmshimp.cxx | 6 ++--- svx/source/gallery2/galbrws1.cxx | 23 +++++++++---------- svx/source/gallery2/galbrws1.hxx | 2 +- svx/source/gallery2/galctrl.cxx | 2 +- svx/source/gallery2/gallery1.cxx | 23 +++++++++++-------- svx/source/gallery2/galtheme.cxx | 15 ++++-------- svx/source/sdr/contact/objectcontact.cxx | 2 +- svx/source/sdr/contact/viewcontact.cxx | 4 ++-- svx/source/sdr/event/eventhandler.cxx | 4 ++-- svx/source/sdr/overlay/overlayobjectlist.cxx | 6 ++--- svx/source/svdraw/svddrgmt.cxx | 6 ++--- svx/source/svdraw/svdoashp.cxx | 2 +- svx/source/svdraw/svdobj.cxx | 4 ++-- .../svdraw/svdotextpathdecomposition.cxx | 8 +++---- svx/source/svdraw/svdpntv.cxx | 2 +- svx/source/tbxctrls/tbcontrl.cxx | 2 +- svx/source/unodraw/UnoGraphicExporter.cxx | 2 +- 29 files changed, 75 insertions(+), 78 deletions(-) diff --git a/sd/source/core/CustomAnimationPreset.cxx b/sd/source/core/CustomAnimationPreset.cxx index 21aae84e8ccb..feab1338853c 100644 --- a/sd/source/core/CustomAnimationPreset.cxx +++ b/sd/source/core/CustomAnimationPreset.cxx @@ -630,7 +630,7 @@ Reference< XAnimationNode > CustomAnimationPresets::getRandomPreset( sal_Int16 n sal_Int32 nCategory = (rand() * pCategoryList->size() / RAND_MAX); PresetCategoryPtr pCategory = (*pCategoryList)[nCategory]; - if( pCategory.get() && pCategory->maEffects.size() ) + if( pCategory.get() && !pCategory->maEffects.empty() ) { sal_Int32 nDescriptor = (rand() * pCategory->maEffects.size() / RAND_MAX); CustomAnimationPresetPtr pPreset = pCategory->maEffects[nDescriptor]; @@ -639,7 +639,7 @@ Reference< XAnimationNode > CustomAnimationPresets::getRandomPreset( sal_Int16 n UStringList aSubTypes = pPreset->getSubTypes(); OUString aSubType; - if( aSubTypes.size() ) + if( !aSubTypes.empty() ) { sal_Int32 nSubType = (rand() * aSubTypes.size() / RAND_MAX); aSubType = aSubTypes[nSubType]; diff --git a/sd/source/ui/animations/CustomAnimationPane.cxx b/sd/source/ui/animations/CustomAnimationPane.cxx index 7dd2966d7b5e..bb166818a77f 100644 --- a/sd/source/ui/animations/CustomAnimationPane.cxx +++ b/sd/source/ui/animations/CustomAnimationPane.cxx @@ -2036,7 +2036,7 @@ void CustomAnimationPane::createPath( PathKind eKind, std::vector< Any >& rTarge void CustomAnimationPane::onRemove() { - if( maListSelection.size() ) + if( !maListSelection.empty() ) { addUndo(); diff --git a/sd/source/ui/dlg/SpellDialogChildWindow.cxx b/sd/source/ui/dlg/SpellDialogChildWindow.cxx index 5616a501d6cb..0d984d5d916f 100644 --- a/sd/source/ui/dlg/SpellDialogChildWindow.cxx +++ b/sd/source/ui/dlg/SpellDialogChildWindow.cxx @@ -107,7 +107,7 @@ void SpellDialogChildWindow::InvalidateSpellDialog (void) // Close the spell check dialog when there are no more sentences to // check. - if (aResult.size() == 0) + if (aResult.empty()) { SfxBoolItem aItem (SID_SPELL_DIALOG, sal_False); GetBindings().GetDispatcher()->Execute( diff --git a/sd/source/ui/dlg/dlgass.cxx b/sd/source/ui/dlg/dlgass.cxx index eb885b64fc0e..3c0c3e3abe00 100644 --- a/sd/source/ui/dlg/dlgass.cxx +++ b/sd/source/ui/dlg/dlgass.cxx @@ -902,7 +902,7 @@ void AssistentDlgImpl::TemplateScanDone ( // HACK! presnt directory is always initially selected. // We have to look at the first entry to get a URL. - if (pDir->maEntries.size() > 0) + if (!pDir->maEntries.empty() ) { TemplateEntry* pEntry = pDir->maEntries.front(); if (pEntry != NULL) @@ -927,7 +927,7 @@ void AssistentDlgImpl::TemplateScanDone ( // HACK! layout directory is always initially selected. // We have to look at the first entry to get a URL. - if (pDir->maEntries.size() > 0) + if (!pDir->maEntries.empty() ) { TemplateEntry* pEntry = pDir->maEntries.front(); if (pEntry != NULL) diff --git a/sd/source/ui/framework/configuration/ConfigurationControllerBroadcaster.cxx b/sd/source/ui/framework/configuration/ConfigurationControllerBroadcaster.cxx index 6e2610643e9f..ec03006920b3 100644 --- a/sd/source/ui/framework/configuration/ConfigurationControllerBroadcaster.cxx +++ b/sd/source/ui/framework/configuration/ConfigurationControllerBroadcaster.cxx @@ -184,14 +184,14 @@ void ConfigurationControllerBroadcaster::DisposeAndClear (void) { lang::EventObject aEvent; aEvent.Source = mxConfigurationController; - while (maListenerMap.size() > 0) + while (!maListenerMap.empty()) { ListenerMap::iterator iMap (maListenerMap.begin()); if (iMap == maListenerMap.end()) break; // When the first vector is empty then remove it from the map. - if (iMap->second.size() == 0) + if (iMap->second.empty()) { maListenerMap.erase(iMap); continue; diff --git a/sd/source/ui/framework/configuration/ResourceId.cxx b/sd/source/ui/framework/configuration/ResourceId.cxx index deb46b036e70..2957dfae7671 100644 --- a/sd/source/ui/framework/configuration/ResourceId.cxx +++ b/sd/source/ui/framework/configuration/ResourceId.cxx @@ -183,7 +183,7 @@ OUString SAL_CALL ResourceId::getResourceURL (void) throw(com::sun::star::uno::RuntimeException) { - if (maResourceURLs.size() > 0) + if (!maResourceURLs.empty()) return maResourceURLs[0]; else return OUString(); @@ -200,7 +200,7 @@ util::URL SAL_CALL return *mpURL; Reference xURLTransformer (mxURLTransformerWeak); - if (xURLTransformer.is() && maResourceURLs.size() > 0) + if (xURLTransformer.is() && !maResourceURLs.empty() ) { mpURL.reset(new util::URL); mpURL->Complete = maResourceURLs[0]; @@ -209,7 +209,7 @@ util::URL SAL_CALL } util::URL aURL; - if (maResourceURLs.size() > 0) + if (!maResourceURLs.empty()) aURL.Complete = maResourceURLs[0]; return aURL; } @@ -268,7 +268,7 @@ OUString SAL_CALL ResourceId::getResourceTypePrefix (void) throw (RuntimeException) { - if (maResourceURLs.size() > 0) + if (!maResourceURLs.empty() ) { // Return the "private:resource//" prefix. @@ -298,7 +298,7 @@ sal_Int16 SAL_CALL if ( ! rxResourceId.is()) { // The empty reference is interpreted as empty resource id object. - if (maResourceURLs.size() > 0) + if (!maResourceURLs.empty()) nResult = +1; else nResult = 0; @@ -610,7 +610,7 @@ void ResourceId::ParseResourceURL (void) Reference(xURLTransformer,UNO_QUERY)); } - if (xURLTransformer.is() && maResourceURLs.size() > 0) + if (xURLTransformer.is() && !maResourceURLs.empty() ) { mpURL.reset(new util::URL); mpURL->Complete = maResourceURLs[0]; diff --git a/sd/source/ui/framework/factories/BasicViewFactory.cxx b/sd/source/ui/framework/factories/BasicViewFactory.cxx index 830e226a62db..3159e6bcce66 100644 --- a/sd/source/ui/framework/factories/BasicViewFactory.cxx +++ b/sd/source/ui/framework/factories/BasicViewFactory.cxx @@ -524,7 +524,7 @@ bool BasicViewFactory::IsCacheable (const ::boost::shared_ptr& r if (xResource.is()) { static ::std::vector > maCacheableResources; - if (maCacheableResources.size() == 0) + if (maCacheableResources.empty() ) { ::boost::shared_ptr pHelper (FrameworkHelper::Instance(*mpBase)); diff --git a/sd/source/ui/slidesorter/controller/SlsAnimator.cxx b/sd/source/ui/slidesorter/controller/SlsAnimator.cxx index 164ed23dfa5e..47a1d173312f 100644 --- a/sd/source/ui/slidesorter/controller/SlsAnimator.cxx +++ b/sd/source/ui/slidesorter/controller/SlsAnimator.cxx @@ -273,7 +273,7 @@ IMPL_LINK(Animator, TimeoutHandler, Timer*, EMPTYARG) // Unlock the draw lock. This should lead to a repaint. mpDrawLock.reset(); - if (maAnimations.size() > 0) + if (!maAnimations.empty()) RequestNextFrame(); return 0; diff --git a/sd/source/ui/toolpanel/controls/DocumentHelper.cxx b/sd/source/ui/toolpanel/controls/DocumentHelper.cxx index 74dd8d4cedb1..25c60ebf92de 100644 --- a/sd/source/ui/toolpanel/controls/DocumentHelper.cxx +++ b/sd/source/ui/toolpanel/controls/DocumentHelper.cxx @@ -335,7 +335,7 @@ void DocumentHelper::AssignMasterPageToPageList ( aCleanedList.push_back(*iPage); } } - if (aCleanedList.size() == 0) + if (aCleanedList.empty() ) return; ::svl::IUndoManager* pUndoMgr = rTargetDocument.GetDocSh()->GetUndoManager(); diff --git a/sd/source/ui/view/ViewTabBar.cxx b/sd/source/ui/view/ViewTabBar.cxx index 384f021aa26a..082c78939e37 100644 --- a/sd/source/ui/view/ViewTabBar.cxx +++ b/sd/source/ui/view/ViewTabBar.cxx @@ -481,7 +481,7 @@ int ViewTabBar::GetHeight (void) { int nHeight (0); - if (maTabBarButtons.size() > 0) + if (!maTabBarButtons.empty()) { TabPage* pActivePage (mpTabControl->GetTabPage( mpTabControl->GetCurPageId())); diff --git a/svx/inc/galtheme.hrc b/svx/inc/galtheme.hrc index 90b05abffe2b..3567e0cdebed 100755 --- a/svx/inc/galtheme.hrc +++ b/svx/inc/galtheme.hrc @@ -43,7 +43,7 @@ #define RID_GALLERYSTR_THEME_MAPS (RID_GALLERYSTR_THEME_START + 12) #define RID_GALLERYSTR_THEME_PEOPLE (RID_GALLERYSTR_THEME_START + 13) #define RID_GALLERYSTR_THEME_SURFACES (RID_GALLERYSTR_THEME_START + 14) -#define RID_GALLERYSTR_THEME_HTMLBUTTONS (RID_GALLERYSTR_THEME_START + 15) +// free #define RID_GALLERYSTR_THEME_POWERPOINT (RID_GALLERYSTR_THEME_START + 16) #define RID_GALLERYSTR_THEME_RULERS (RID_GALLERYSTR_THEME_START + 17) #define RID_GALLERYSTR_THEME_SOUNDS (RID_GALLERYSTR_THEME_START + 18) diff --git a/svx/inc/svx/gallery.hxx b/svx/inc/svx/gallery.hxx index c8ca0218d770..05b78ad54bf4 100644 --- a/svx/inc/svx/gallery.hxx +++ b/svx/inc/svx/gallery.hxx @@ -64,7 +64,7 @@ #define GALLERY_THEME_MAPS 12 #define GALLERY_THEME_PEOPLE 13 #define GALLERY_THEME_SURFACES 14 -#define GALLERY_THEME_HTMLBUTTONS 15 +// free #define GALLERY_THEME_POWERPOINT 16 #define GALLERY_THEME_RULERS 17 #define GALLERY_THEME_SOUNDS 18 diff --git a/svx/source/form/fmshimp.cxx b/svx/source/form/fmshimp.cxx index 6dc3395ee153..6aea3ed8f127 100644 --- a/svx/source/form/fmshimp.cxx +++ b/svx/source/form/fmshimp.cxx @@ -1559,7 +1559,7 @@ void FmXFormShell::ExecuteSearch() aContextNames.swap( aValidContexts ); } - if (m_aSearchForms.size() == 0) + if (m_aSearchForms.empty() ) { // es gibt keine Controls, die alle Bedingungen fuer eine Suche erfuellen ErrorBox(NULL, WB_OK, SVX_RESSTR(RID_STR_NODATACONTROLS)).Execute(); return; @@ -2566,7 +2566,7 @@ IMPL_LINK(FmXFormShell, OnSearchContextRequest, FmSearchContext*, pfmscContextIn strFieldList.EraseTrailingChars(';'); sFieldDisplayNames.EraseTrailingChars(';'); - if (!pfmscContextInfo->arrFields.size()) + if (pfmscContextInfo->arrFields.empty()) { pfmscContextInfo->arrFields.clear(); pfmscContextInfo->xCursor = NULL; @@ -3670,7 +3670,7 @@ void FmXFormShell::viewDeactivated( FmFormView& _rCurrentView, sal_Bool _bDeacti // move all events from our queue to a new one, omit the events for the deactivated // page ::std::queue< FmLoadAction > aNewEvents; - while ( m_aLoadingPages.size() ) + while ( !m_aLoadingPages.empty() ) { FmLoadAction aAction = m_aLoadingPages.front(); m_aLoadingPages.pop(); diff --git a/svx/source/gallery2/galbrws1.cxx b/svx/source/gallery2/galbrws1.cxx index 4c50608b0369..fc20022bcf93 100644 --- a/svx/source/gallery2/galbrws1.cxx +++ b/svx/source/gallery2/galbrws1.cxx @@ -256,9 +256,8 @@ void GalleryBrowser1::ImplFillExchangeData( const GalleryTheme* pThm, ExchangeDa // ----------------------------------------------------------------------------- -::std::vector< sal_uInt16 > GalleryBrowser1::ImplGetExecuteVector() +void GalleryBrowser1::ImplGetExecuteVector(::std::vector< sal_uInt16 >& o_aExec) { - ::std::vector< sal_uInt16 > aExecVector; GalleryTheme* pTheme = mpGallery->AcquireTheme( GetSelectedTheme(), *this ); if( pTheme ) @@ -282,23 +281,21 @@ void GalleryBrowser1::ImplFillExchangeData( const GalleryTheme* pThm, ExchangeDa bUpdateAllowed = bRenameAllowed = bRemoveAllowed = sal_True; if( bUpdateAllowed && pTheme->GetObjectCount() ) - aExecVector.push_back( MN_ACTUALIZE ); + o_aExec.push_back( MN_ACTUALIZE ); if( bRenameAllowed ) - aExecVector.push_back( MN_RENAME ); + o_aExec.push_back( MN_RENAME ); if( bRemoveAllowed ) - aExecVector.push_back( MN_DELETE ); + o_aExec.push_back( MN_DELETE ); if( bIdDialog && !pTheme->IsReadOnly() && !pTheme->IsImported() ) - aExecVector.push_back( MN_ASSIGN_ID ); + o_aExec.push_back( MN_ASSIGN_ID ); - aExecVector.push_back( MN_PROPERTIES ); + o_aExec.push_back( MN_PROPERTIES ); mpGallery->ReleaseTheme( pTheme, *this ); } - - return aExecVector; } // ----------------------------------------------------------------------------- @@ -585,7 +582,8 @@ sal_Bool GalleryBrowser1::KeyInput( const KeyEvent& rKEvt, Window* pWindow ) if( !bRet ) { - ::std::vector< sal_uInt16 > aExecVector( ImplGetExecuteVector() ); + ::std::vector< sal_uInt16 > aExecVector; + ImplGetExecuteVector(aExecVector); sal_uInt16 nExecuteId = 0; sal_Bool bMod1 = rKEvt.GetKeyCode().IsMod1(); @@ -649,9 +647,10 @@ sal_Bool GalleryBrowser1::KeyInput( const KeyEvent& rKEvt, Window* pWindow ) IMPL_LINK( GalleryBrowser1, ShowContextMenuHdl, void*, EMPTYARG ) { - ::std::vector< sal_uInt16 > aExecVector( ImplGetExecuteVector() ); + ::std::vector< sal_uInt16 > aExecVector; + ImplGetExecuteVector(aExecVector); - if( aExecVector.size() ) + if( !aExecVector.empty() ) { PopupMenu aMenu( GAL_RESID( RID_SVXMN_GALLERY1 ) ); diff --git a/svx/source/gallery2/galbrws1.hxx b/svx/source/gallery2/galbrws1.hxx index 10b7606de2cc..5441b1fc6cf7 100644 --- a/svx/source/gallery2/galbrws1.hxx +++ b/svx/source/gallery2/galbrws1.hxx @@ -102,7 +102,7 @@ private: void ImplAdjustControls(); sal_uIntPtr ImplInsertThemeEntry( const GalleryThemeEntry* pEntry ); void ImplFillExchangeData( const GalleryTheme* pThm, ExchangeData& rData ); - ::std::vector< sal_uInt16 > ImplGetExecuteVector(); + void ImplGetExecuteVector(::std::vector< sal_uInt16 >& o_aExec); void ImplExecute( sal_uInt16 nId ); void ImplGalleryThemeProperties( const String & rThemeName, bool bCreateNew ); void ImplEndGalleryThemeProperties( VclAbstractDialog2* pDialog, bool bCreateNew ); diff --git a/svx/source/gallery2/galctrl.cxx b/svx/source/gallery2/galctrl.cxx index 84b27b76127d..72a481e67691 100644 --- a/svx/source/gallery2/galctrl.cxx +++ b/svx/source/gallery2/galctrl.cxx @@ -401,7 +401,7 @@ void GalleryIconView::UserDraw( const UserDrawEvent& rUDEvt ) aGraphic.Draw( pDev, aPos, aSize ); } - SetItemText( nId, GalleryBrowser2::GetItemText( *mpTheme, *pObj, GALLERY_ITEM_THEMENAME | GALLERY_ITEM_TITLE | GALLERY_ITEM_PATH ) ); + SetItemText( nId, GalleryBrowser2::GetItemText( *mpTheme, *pObj, GALLERY_ITEM_TITLE) ); mpTheme->ReleaseObject( pObj ); } } diff --git a/svx/source/gallery2/gallery1.cxx b/svx/source/gallery2/gallery1.cxx index 773a03e43a06..4c10186cac9b 100644 --- a/svx/source/gallery2/gallery1.cxx +++ b/svx/source/gallery2/gallery1.cxx @@ -326,16 +326,19 @@ void Gallery::ImplLoadSubDirs( const INetURLObject& rBaseURL, sal_Bool& rbDirIsR if( xContentAccess.is() ) { + static const ::rtl::OUString s_sTitle(RTL_CONSTASCII_USTRINGPARAM("Title")); + static const ::rtl::OUString s_sIsReadOnly(RTL_CONSTASCII_USTRINGPARAM("IsReadOnly")); + static const ::rtl::OUString s_sSDG_EXT(RTL_CONSTASCII_USTRINGPARAM("sdg")); + static const ::rtl::OUString s_sSDV_EXT(RTL_CONSTASCII_USTRINGPARAM("sdv")); + while( xResultSet->next() ) { INetURLObject aThmURL( xContentAccess->queryContentIdentifierString() ); if(aThmURL.GetExtension().equalsIgnoreAsciiCaseAscii("thm")) { - INetURLObject aSdgURL( aThmURL); aSdgURL.SetExtension( OUString(RTL_CONSTASCII_USTRINGPARAM("sdg")) ); - INetURLObject aSdvURL( aThmURL ); aSdvURL.SetExtension( OUString(RTL_CONSTASCII_USTRINGPARAM("sdv")) ); - const OUString aTitleProp( RTL_CONSTASCII_USTRINGPARAM("Title") ); - const OUString aReadOnlyProp( RTL_CONSTASCII_USTRINGPARAM("IsReadOnly") ); + INetURLObject aSdgURL( aThmURL); aSdgURL.SetExtension( s_sSDG_EXT ); + INetURLObject aSdvURL( aThmURL ); aSdvURL.SetExtension( s_sSDV_EXT ); OUString aTitle; sal_Bool bReadOnly = sal_False; @@ -347,7 +350,7 @@ void Gallery::ImplLoadSubDirs( const INetURLObject& rBaseURL, sal_Bool& rbDirIsR try { - aThmCnt.getPropertyValue( aTitleProp ) >>= aTitle; + aThmCnt.getPropertyValue( s_sTitle ) >>= aTitle; } catch( const uno::RuntimeException& ) { @@ -360,7 +363,7 @@ void Gallery::ImplLoadSubDirs( const INetURLObject& rBaseURL, sal_Bool& rbDirIsR { try { - aThmCnt.getPropertyValue( aReadOnlyProp ) >>= bReadOnly; + aThmCnt.getPropertyValue( s_sIsReadOnly ) >>= bReadOnly; } catch( const uno::RuntimeException& ) { @@ -373,7 +376,7 @@ void Gallery::ImplLoadSubDirs( const INetURLObject& rBaseURL, sal_Bool& rbDirIsR { try { - aSdgCnt.getPropertyValue( aTitleProp ) >>= aTitle; + aSdgCnt.getPropertyValue( s_sTitle ) >>= aTitle; } catch( const ::com::sun::star::uno::RuntimeException& ) { @@ -386,7 +389,7 @@ void Gallery::ImplLoadSubDirs( const INetURLObject& rBaseURL, sal_Bool& rbDirIsR { try { - aSdgCnt.getPropertyValue( aReadOnlyProp ) >>= bReadOnly; + aSdgCnt.getPropertyValue( s_sIsReadOnly ) >>= bReadOnly; } catch( const uno::RuntimeException& ) { @@ -401,7 +404,7 @@ void Gallery::ImplLoadSubDirs( const INetURLObject& rBaseURL, sal_Bool& rbDirIsR { try { - aSdvCnt.getPropertyValue( aTitleProp ) >>= aTitle; + aSdvCnt.getPropertyValue( s_sTitle ) >>= aTitle; } catch( const ::com::sun::star::uno::RuntimeException& ) { @@ -414,7 +417,7 @@ void Gallery::ImplLoadSubDirs( const INetURLObject& rBaseURL, sal_Bool& rbDirIsR { try { - aSdvCnt.getPropertyValue( aReadOnlyProp ) >>= bReadOnly; + aSdvCnt.getPropertyValue( s_sIsReadOnly ) >>= bReadOnly; } catch( const uno::RuntimeException& ) { diff --git a/svx/source/gallery2/galtheme.cxx b/svx/source/gallery2/galtheme.cxx index 8741d5adb7ee..12f1e6d257ab 100644 --- a/svx/source/gallery2/galtheme.cxx +++ b/svx/source/gallery2/galtheme.cxx @@ -1191,18 +1191,13 @@ sal_Bool GalleryTheme::InsertFileOrDirURL( const INetURLObject& rFileOrDirURL, s uno::Sequence< OUString > aProps( 1 ); aProps.getArray()[ 0 ] = OUString(RTL_CONSTASCII_USTRINGPARAM("Url")); uno::Reference< sdbc::XResultSet > xResultSet( aCnt.createCursor( aProps, ::ucbhelper::INCLUDE_DOCUMENTS_ONLY ) ); - - if( xResultSet.is() ) + uno::Reference< ucb::XContentAccess > xContentAccess( xResultSet, uno::UNO_QUERY ); + if( xContentAccess.is() ) { - uno::Reference< ucb::XContentAccess > xContentAccess( xResultSet, uno::UNO_QUERY ); - - if( xContentAccess.is() ) + while( xResultSet->next() ) { - while( xResultSet->next() ) - { - aURL.SetSmartURL( xContentAccess->queryContentIdentifierString() ); - aURLVector.push_back( aURL ); - } + aURL.SetSmartURL( xContentAccess->queryContentIdentifierString() ); + aURLVector.push_back( aURL ); } } } diff --git a/svx/source/sdr/contact/objectcontact.cxx b/svx/source/sdr/contact/objectcontact.cxx index edf2fcaaa336..9c891a5f2a40 100644 --- a/svx/source/sdr/contact/objectcontact.cxx +++ b/svx/source/sdr/contact/objectcontact.cxx @@ -65,7 +65,7 @@ namespace sdr std::vector< ViewObjectContact* > aLocalVOCList(maViewObjectContactVector); maViewObjectContactVector.clear(); - while(aLocalVOCList.size()) + while(!aLocalVOCList.empty()) { ViewObjectContact* pCandidate = aLocalVOCList.back(); aLocalVOCList.pop_back(); diff --git a/svx/source/sdr/contact/viewcontact.cxx b/svx/source/sdr/contact/viewcontact.cxx index d7e2eff6b4f4..499c6aaf7f6c 100644 --- a/svx/source/sdr/contact/viewcontact.cxx +++ b/svx/source/sdr/contact/viewcontact.cxx @@ -81,7 +81,7 @@ namespace sdr std::vector< ViewObjectContact* > aLocalVOCList(maViewObjectContactVector); maViewObjectContactVector.clear(); - while(aLocalVOCList.size()) + while(!aLocalVOCList.empty()) { ViewObjectContact* pCandidate = aLocalVOCList.back(); aLocalVOCList.pop_back(); @@ -146,7 +146,7 @@ namespace sdr { maViewObjectContactVector.erase(aFindResult); - if(0 == maViewObjectContactVector.size()) + if(maViewObjectContactVector.empty()) { // This may need to get asynchron later since it eventually triggers // deletes of OCs where the VOC is still added. diff --git a/svx/source/sdr/event/eventhandler.cxx b/svx/source/sdr/event/eventhandler.cxx index a2d36302f768..8fffdb88aa83 100644 --- a/svx/source/sdr/event/eventhandler.cxx +++ b/svx/source/sdr/event/eventhandler.cxx @@ -82,7 +82,7 @@ namespace sdr BaseEvent* EventHandler::GetEvent() { - if(maVector.size()) + if(!maVector.empty()) { // get the last event, that one is fastest to be removed return maVector.back(); @@ -99,7 +99,7 @@ namespace sdr EventHandler::~EventHandler() { - while(maVector.size()) + while(!maVector.empty()) { delete GetEvent(); } diff --git a/svx/source/sdr/overlay/overlayobjectlist.cxx b/svx/source/sdr/overlay/overlayobjectlist.cxx index fed4b7593434..a4f5a0b45d5f 100644 --- a/svx/source/sdr/overlay/overlayobjectlist.cxx +++ b/svx/source/sdr/overlay/overlayobjectlist.cxx @@ -82,7 +82,7 @@ namespace sdr bool OverlayObjectList::isHitLogic(const basegfx::B2DPoint& rLogicPosition, double fLogicTolerance) const { - if(maVector.size()) + if(!maVector.empty()) { OverlayObjectVector::const_iterator aStart(maVector.begin()); sdr::overlay::OverlayObject* pFirst = *aStart; @@ -133,7 +133,7 @@ namespace sdr bool OverlayObjectList::isHitPixel(const Point& rDiscretePosition, sal_uInt32 nDiscreteTolerance) const { - if(maVector.size()) + if(!maVector.empty()) { OverlayObjectVector::const_iterator aStart(maVector.begin()); sdr::overlay::OverlayObject* pCandidate = *aStart; @@ -163,7 +163,7 @@ namespace sdr { basegfx::B2DRange aRetval; - if(maVector.size()) + if(!maVector.empty()) { OverlayObjectVector::const_iterator aStart(maVector.begin()); diff --git a/svx/source/svdraw/svddrgmt.cxx b/svx/source/svdraw/svddrgmt.cxx index b3f5d5c12673..85e87411723b 100644 --- a/svx/source/svdraw/svddrgmt.cxx +++ b/svx/source/svdraw/svddrgmt.cxx @@ -246,7 +246,7 @@ drawinglayer::primitive2d::Primitive2DSequence SdrDragEntryPointGlueDrag::create { drawinglayer::primitive2d::Primitive2DSequence aRetval; - if(maPositions.size()) + if(!maPositions.empty()) { basegfx::B2DPolygon aPolygon; sal_uInt32 a(0); @@ -666,14 +666,14 @@ void SdrDragMethod::CancelSdrDrag() void SdrDragMethod::CreateOverlayGeometry(sdr::overlay::OverlayManager& rOverlayManager) { // create SdrDragEntries on demand - if(!maSdrDragEntries.size()) + if(maSdrDragEntries.empty()) { createSdrDragEntries(); } // if there are entries, derive OverlayObjects from the entries, including // modification from current interactive state - if(maSdrDragEntries.size()) + if(!maSdrDragEntries.empty()) { drawinglayer::primitive2d::Primitive2DSequence aResult; drawinglayer::primitive2d::Primitive2DSequence aResultTransparent; diff --git a/svx/source/svdraw/svdoashp.cxx b/svx/source/svdraw/svdoashp.cxx index 5e7c53ba8aeb..f8df28b792b8 100644 --- a/svx/source/svdraw/svdoashp.cxx +++ b/svx/source/svdraw/svdoashp.cxx @@ -2146,7 +2146,7 @@ void SdrObjCustomShape::DragCreateObject( SdrDragStat& rStat ) aRect1 = Rectangle( rStat.GetNow(), Size( nDefaultObjectSizeWidth, nDefaultObjectSizeHeight ) ); // subtracting the horizontal difference of the latest handle from shape position - if ( aInteractionHandles.size() ) + if ( !aInteractionHandles.empty() ) { sal_Int32 nHandlePos = aInteractionHandles[ aInteractionHandles.size() - 1 ].xInteraction->getPosition().X; aRect1.Move( aRect.Left() - nHandlePos, 0 ); diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx index 2956b03cc13e..5a11ca6fc1cd 100644 --- a/svx/source/svdraw/svdobj.cxx +++ b/svx/source/svdraw/svdobj.cxx @@ -2311,7 +2311,7 @@ SdrObject* SdrObject::ImpConvertToContourObj(SdrObject* pRet, sal_Bool bForceLin // #i102241# check for line results const std::vector< basegfx::B2DPolygon >& rHairlineVector = aExtractor.getExtractedHairlines(); - if(rHairlineVector.size()) + if(!rHairlineVector.empty()) { // for SdrObject creation, just copy all to a single Hairline-PolyPolygon for(sal_uInt32 a(0); a < rHairlineVector.size(); a++) @@ -2323,7 +2323,7 @@ SdrObject* SdrObject::ImpConvertToContourObj(SdrObject* pRet, sal_Bool bForceLin // #i102241# check for fill rsults const std::vector< basegfx::B2DPolyPolygon >& rLineFillVector(aExtractor.getExtractedLineFills()); - if(rLineFillVector.size()) + if(!rLineFillVector.empty()) { // merge to a single PolyPolygon (OR) aMergedLineFillPolyPolygon = basegfx::tools::mergeToSinglePolyPolygon(rLineFillVector); diff --git a/svx/source/svdraw/svdotextpathdecomposition.cxx b/svx/source/svdraw/svdotextpathdecomposition.cxx index afc16c35a07d..558ee612981d 100644 --- a/svx/source/svdraw/svdotextpathdecomposition.cxx +++ b/svx/source/svdraw/svdotextpathdecomposition.cxx @@ -199,7 +199,7 @@ namespace mrOutliner.SetDrawPortionHdl(LINK(this, impTextBreakupHandler, decompositionPathTextPrimitive)); mrOutliner.StripPortions(); - if(maPathTextPortions.size()) + if(!maPathTextPortions.empty()) { // sort portions by paragraph, x and y ::std::sort(maPathTextPortions.begin(), maPathTextPortions.end()); @@ -626,7 +626,7 @@ namespace // get text outlines and their object transformation pTextCandidate->getTextOutlinesAndTransformation(aB2DPolyPolyVector, aPolygonTransform); - if(aB2DPolyPolyVector.size()) + if(!aB2DPolyPolyVector.empty()) { // create stroke primitives std::vector< drawinglayer::primitive2d::BasePrimitive2D* > aStrokePrimitives; @@ -711,7 +711,7 @@ void SdrTextObj::impDecomposePathTextPrimitive( impTextBreakupHandler aConverter(rOutliner); const ::std::vector< impPathTextPortion > rPathTextPortions = aConverter.decompositionPathTextPrimitive(); - if(rPathTextPortions.size()) + if(!rPathTextPortions.empty()) { // get FormText and polygon values const drawinglayer::attribute::SdrFormTextAttribute& rFormTextAttribute = rSdrPathTextPrimitive.getSdrFormTextAttribute(); @@ -752,7 +752,7 @@ void SdrTextObj::impDecomposePathTextPrimitive( } // handle data pair polygon/ParagraphTextPortions - if(aParagraphTextPortions.size()) + if(!aParagraphTextPortions.empty()) { aPolygonParagraphHandler.HandlePair(rPathPolyPolygon.getB2DPolygon(a), aParagraphTextPortions); } diff --git a/svx/source/svdraw/svdpntv.cxx b/svx/source/svdraw/svdpntv.cxx index 1c9e6a01cfad..331354b50621 100644 --- a/svx/source/svdraw/svdpntv.cxx +++ b/svx/source/svdraw/svdpntv.cxx @@ -247,7 +247,7 @@ SdrPaintView::~SdrPaintView() #endif // delete existing SdrPaintWindows - while(maPaintWindows.size()) + while(!maPaintWindows.empty()) { delete maPaintWindows.back(); maPaintWindows.pop_back(); diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx index 9135fdcda37d..b5c50a52036e 100644 --- a/svx/source/tbxctrls/tbcontrl.cxx +++ b/svx/source/tbxctrls/tbcontrl.cxx @@ -2014,7 +2014,7 @@ Window* SvxStyleToolBoxControl::CreateItemWindow( Window *pParent ) pImpl->aClearForm, pImpl->aMore, pImpl->bSpecModeWriter || pImpl->bSpecModeCalc ); - if( pImpl->aDefaultStyles.size()) + if( !pImpl->aDefaultStyles.empty()) pBox->SetDefaultStyle( pImpl->aDefaultStyles[0] ); // Set visibility listener to bind/unbind controller pBox->SetVisibilityListener( LINK( this, SvxStyleToolBoxControl, VisibilityNotification )); diff --git a/svx/source/unodraw/UnoGraphicExporter.cxx b/svx/source/unodraw/UnoGraphicExporter.cxx index 225e655830a7..f4475fcb691e 100644 --- a/svx/source/unodraw/UnoGraphicExporter.cxx +++ b/svx/source/unodraw/UnoGraphicExporter.cxx @@ -809,7 +809,7 @@ bool GraphicExporter::GetGraphic( ExportSettings& rSettings, Graphic& aGraphic, bRet = false; } - if( bRet && aShapes.size() ) + if( bRet && !aShapes.empty() ) { // special treatment for only one SdrGrafObj that has text sal_Bool bSingleGraphic = sal_False;