summaryrefslogtreecommitdiff
path: root/sc/source/ui
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/ui')
-rw-r--r--sc/source/ui/app/inputwin.cxx20
-rw-r--r--sc/source/ui/dbgui/sfiltdlg.cxx19
-rw-r--r--sc/source/ui/docshell/docfunc.cxx11
-rw-r--r--sc/source/ui/navipi/content.cxx20
-rw-r--r--sc/source/ui/unoobj/cellsuno.cxx31
-rw-r--r--sc/source/ui/unoobj/listenercalls.cxx33
-rw-r--r--sc/source/ui/view/gridwin2.cxx2
7 files changed, 56 insertions, 80 deletions
diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index 71abccec99a4..d7f51e0c7b7b 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -1882,14 +1882,11 @@ void ScPosWnd::FillRangeNames()
ScRange aDummy;
std::set<OUString> aSet;
ScRangeName* pRangeNames = rDoc.GetRangeName();
- if (!pRangeNames->empty())
+ ScRangeName::const_iterator itrBeg = pRangeNames->begin(), itrEnd = pRangeNames->end();
+ for (ScRangeName::const_iterator itr = itrBeg; itr != itrEnd; ++itr)
{
- ScRangeName::const_iterator itrBeg = pRangeNames->begin(), itrEnd = pRangeNames->end();
- for (ScRangeName::const_iterator itr = itrBeg; itr != itrEnd; ++itr)
- {
- if (itr->second->IsValidReference(aDummy))
- aSet.insert(itr->second->GetName());
- }
+ if (itr->second->IsValidReference(aDummy))
+ aSet.insert(itr->second->GetName());
}
for (SCTAB i = 0; i < rDoc.GetTableCount(); ++i)
{
@@ -1906,13 +1903,10 @@ void ScPosWnd::FillRangeNames()
}
}
- if (!aSet.empty())
+ for (std::set<OUString>::iterator itr = aSet.begin();
+ itr != aSet.end(); ++itr)
{
- for (std::set<OUString>::iterator itr = aSet.begin();
- itr != aSet.end(); ++itr)
- {
- InsertEntry(*itr);
- }
+ InsertEntry(*itr);
}
}
SetText(aPosStr);
diff --git a/sc/source/ui/dbgui/sfiltdlg.cxx b/sc/source/ui/dbgui/sfiltdlg.cxx
index 33010a009833..583b5d61517c 100644
--- a/sc/source/ui/dbgui/sfiltdlg.cxx
+++ b/sc/source/ui/dbgui/sfiltdlg.cxx
@@ -163,19 +163,16 @@ void ScSpecialFilterDlg::Init( const SfxItemSet& rArgSet )
pLbFilterArea->Clear();
pLbFilterArea->InsertEntry( aStrUndefined, 0 );
- if (!pRangeNames->empty())
+ ScRangeName::const_iterator itr = pRangeNames->begin(), itrEnd = pRangeNames->end();
+ for (; itr != itrEnd; ++itr)
{
- ScRangeName::const_iterator itr = pRangeNames->begin(), itrEnd = pRangeNames->end();
- for (; itr != itrEnd; ++itr)
- {
- if (!itr->second->HasType(ScRangeData::Type::Criteria))
- continue;
+ if (!itr->second->HasType(ScRangeData::Type::Criteria))
+ continue;
- const sal_Int32 nInsert = pLbFilterArea->InsertEntry(itr->second->GetName());
- OUString aSymbol;
- itr->second->GetSymbol(aSymbol);
- pLbFilterArea->SetEntryData(nInsert, new OUString(aSymbol));
- }
+ const sal_Int32 nInsert = pLbFilterArea->InsertEntry(itr->second->GetName());
+ OUString aSymbol;
+ itr->second->GetSymbol(aSymbol);
+ pLbFilterArea->SetEntryData(nInsert, new OUString(aSymbol));
}
// is there a stored source range?
diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx
index 2a0f21fa5299..d3622d2c6f1e 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -1099,14 +1099,11 @@ void ScDocFunc::PutData( const ScAddress& rPos, ScEditEngineDefaulter& rEngine,
bRet = SetEditCell(rPos, *pNewData, !bApi);
// Set the paragraph attributes back to the EditEngine.
- if (!aRememberItems.empty())
+ ScMyRememberItemVector::iterator aItr = aRememberItems.begin();
+ while (aItr != aRememberItems.end())
{
- ScMyRememberItemVector::iterator aItr = aRememberItems.begin();
- while (aItr != aRememberItems.end())
- {
- rEngine.SetParaAttribs((*aItr)->nIndex, (*aItr)->aItemSet);
- ++aItr;
- }
+ rEngine.SetParaAttribs((*aItr)->nIndex, (*aItr)->aItemSet);
+ ++aItr;
}
// #i61702# if the content isn't accessed, there's no need to set the UpdateMode again
diff --git a/sc/source/ui/navipi/content.cxx b/sc/source/ui/navipi/content.cxx
index cd1f340dea28..cca7461fea0b 100644
--- a/sc/source/ui/navipi/content.cxx
+++ b/sc/source/ui/navipi/content.cxx
@@ -891,14 +891,11 @@ void ScContentTree::GetAreaNames()
ScRange aDummy;
std::set<OUString> aSet;
ScRangeName* pRangeNames = pDoc->GetRangeName();
- if (!pRangeNames->empty())
+ ScRangeName::const_iterator itrBeg = pRangeNames->begin(), itrEnd = pRangeNames->end();
+ for (ScRangeName::const_iterator itr = itrBeg; itr != itrEnd; ++itr)
{
- ScRangeName::const_iterator itrBeg = pRangeNames->begin(), itrEnd = pRangeNames->end();
- for (ScRangeName::const_iterator itr = itrBeg; itr != itrEnd; ++itr)
- {
- if (itr->second->IsValidReference(aDummy))
- aSet.insert(itr->second->GetName());
- }
+ if (itr->second->IsValidReference(aDummy))
+ aSet.insert(itr->second->GetName());
}
for (SCTAB i = 0; i < pDoc->GetTableCount(); ++i)
{
@@ -915,13 +912,10 @@ void ScContentTree::GetAreaNames()
}
}
- if (!aSet.empty())
+ for (std::set<OUString>::iterator itr = aSet.begin();
+ itr != aSet.end(); ++itr)
{
- for (std::set<OUString>::iterator itr = aSet.begin();
- itr != aSet.end(); ++itr)
- {
- InsertContent(ScContentId::RANGENAME, *itr);
- }
+ InsertContent(ScContentId::RANGENAME, *itr);
}
}
diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx
index d9537c86acf7..956b0ee64bc1 100644
--- a/sc/source/ui/unoobj/cellsuno.cxx
+++ b/sc/source/ui/unoobj/cellsuno.cxx
@@ -4438,24 +4438,21 @@ static bool lcl_FindRangeOrEntry( const ScNamedEntryArr_Impl& rNamedEntries,
// named entry in this object?
- if ( !rNamedEntries.empty() )
- {
- for (const auto & rNamedEntry : rNamedEntries)
- if ( rNamedEntry.GetName() == rName )
- {
- // test if named entry is contained in rRanges
+ for (const auto & rNamedEntry : rNamedEntries)
+ if ( rNamedEntry.GetName() == rName )
+ {
+ // test if named entry is contained in rRanges
- const ScRange& rComp = rNamedEntry.GetRange();
- ScMarkData aMarkData;
- aMarkData.MarkFromRangeList( rRanges, false );
- aMarkData.MarkToMulti(); // needed for IsAllMarked
- if ( aMarkData.IsAllMarked( rComp ) )
- {
- rFound = rComp;
- return true;
- }
+ const ScRange& rComp = rNamedEntry.GetRange();
+ ScMarkData aMarkData;
+ aMarkData.MarkFromRangeList( rRanges, false );
+ aMarkData.MarkToMulti(); // needed for IsAllMarked
+ if ( aMarkData.IsAllMarked( rComp ) )
+ {
+ rFound = rComp;
+ return true;
}
- }
+ }
return false; // not found
}
@@ -4483,7 +4480,7 @@ void SAL_CALL ScCellRangesObj::removeByName( const OUString& aName )
ScRangeList aDiff;
bool bValid = ( aDiff.Parse( aName, &pDocSh->GetDocument() ) & ScRefFlags::VALID )
== ScRefFlags::VALID;
- if (!bValid && !m_pImpl->m_aNamedEntries.empty())
+ if (!bValid)
{
sal_uInt16 nCount = m_pImpl->m_aNamedEntries.size();
for (sal_uInt16 n=0; n<nCount && !bValid; n++)
diff --git a/sc/source/ui/unoobj/listenercalls.cxx b/sc/source/ui/unoobj/listenercalls.cxx
index c7e30f314913..d05938d85101 100644
--- a/sc/source/ui/unoobj/listenercalls.cxx
+++ b/sc/source/ui/unoobj/listenercalls.cxx
@@ -46,28 +46,25 @@ void ScUnoListenerCalls::ExecuteAndClear()
// During each modified() call, Add may be called again.
// These new calls are executed here, too.
- if (!aEntries.empty())
+ std::vector<ScUnoListenerEntry>::iterator aItr(aEntries.begin());
+ while (aItr != aEntries.end())
{
- std::vector<ScUnoListenerEntry>::iterator aItr(aEntries.begin());
- while (aItr != aEntries.end())
+ ScUnoListenerEntry aEntry = *aItr;
+ try
{
- ScUnoListenerEntry aEntry = *aItr;
- try
- {
- aEntry.xListener->modified( aEntry.aEvent );
- }
- catch ( const uno::RuntimeException& )
- {
- // the listener is an external object and may throw a RuntimeException
- // for reasons we don't know
- }
+ aEntry.xListener->modified( aEntry.aEvent );
+ }
+ catch ( const uno::RuntimeException& )
+ {
+ // the listener is an external object and may throw a RuntimeException
+ // for reasons we don't know
+ }
- // New calls that are added during the modified() call are appended to the end
- // of aEntries, so the loop will catch them, too (as long as erase happens
- // after modified).
+ // New calls that are added during the modified() call are appended to the end
+ // of aEntries, so the loop will catch them, too (as long as erase happens
+ // after modified).
- aItr = aEntries.erase(aItr);
- }
+ aItr = aEntries.erase(aItr);
}
}
diff --git a/sc/source/ui/view/gridwin2.cxx b/sc/source/ui/view/gridwin2.cxx
index 3864714bb752..8f3ae51260de 100644
--- a/sc/source/ui/view/gridwin2.cxx
+++ b/sc/source/ui/view/gridwin2.cxx
@@ -515,7 +515,7 @@ void ScGridWindow::DPLaunchFieldPopupMenu(const Point& rScrPos, const Size& rScr
ScMenuFloatingWindow* pSubMenu = mpDPFieldPopup->addSubMenuItem(
ScResId(STR_MENU_SORT_CUSTOM), !aUserSortNames.empty());
- if (pSubMenu && !aUserSortNames.empty())
+ if (pSubMenu)
{
size_t n = aUserSortNames.size();
for (size_t i = 0; i < n; ++i)