summaryrefslogtreecommitdiff
path: root/editeng
diff options
context:
space:
mode:
authorTakeshi Abe <tabe@fixedpoint.jp>2015-05-18 14:17:06 +0900
committerMichael Stahl <mstahl@redhat.com>2015-05-21 10:09:09 +0000
commit7fa3d4db1db47a7a62fdd66485a286d331a3587f (patch)
tree8e270888ffea54adfcf8917151f224ad840f73d6 /editeng
parent6e01306e2094e0e0ae731aed7162bb3371f274bc (diff)
editeng: simplify code by std::none_of
Change-Id: I6fb427b4e3d1179cf9291daa7204f3892a8e271f Reviewed-on: https://gerrit.libreoffice.org/15838 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'editeng')
-rw-r--r--editeng/source/accessibility/AccessibleStaticTextBase.cxx4
-rw-r--r--editeng/source/editeng/editobj.cxx15
2 files changed, 7 insertions, 12 deletions
diff --git a/editeng/source/accessibility/AccessibleStaticTextBase.cxx b/editeng/source/accessibility/AccessibleStaticTextBase.cxx
index 6a1c21c362c5..4f1c07f01365 100644
--- a/editeng/source/accessibility/AccessibleStaticTextBase.cxx
+++ b/editeng/source/accessibility/AccessibleStaticTextBase.cxx
@@ -981,8 +981,8 @@ namespace accessibility
{
const beans::PropertyValue* pItr = aIntersectionSeq.getConstArray();
const beans::PropertyValue* pEnd = pItr + aIntersectionSeq.getLength();
- const beans::PropertyValue* pFind = ::std::find_if( pItr, pEnd, ::std::bind2nd( PropertyValueEqualFunctor(), boost::cref( pDefAttr[i] ) ) );
- if ( pFind == pEnd && pDefAttr[i].Handle != 0)
+ bool bNone = ::std::none_of( pItr, pEnd, ::std::bind2nd( PropertyValueEqualFunctor(), boost::cref( pDefAttr[i] ) ) );
+ if ( bNone && pDefAttr[i].Handle != 0)
{
aDiffVec.push_back( pDefAttr[i] );
}
diff --git a/editeng/source/editeng/editobj.cxx b/editeng/source/editeng/editobj.cxx
index ecee5b62ef22..c9cce3d29bf9 100644
--- a/editeng/source/editeng/editobj.cxx
+++ b/editeng/source/editeng/editobj.cxx
@@ -49,6 +49,7 @@
#include <tools/tenccvt.hxx>
#include <libxml/xmlwriter.h>
+#include <algorithm>
#if DEBUG_EDIT_ENGINE
#include <iostream>
@@ -1191,11 +1192,8 @@ void EditTextObjectImpl::StoreData( SvStream& rOStream ) const
for ( sal_uInt16 nChar = 0; nChar < rC.GetText().getLength(); nChar++ )
{
const ContentInfo::XEditAttributesType& rAttribs = rC.aAttribs;
- ContentInfo::XEditAttributesType::const_iterator it =
- std::find_if(rAttribs.begin(), rAttribs.end(),
- FindAttribByChar(EE_CHAR_FONTINFO, nChar));
-
- if (it == rAttribs.end())
+ if ( std::none_of(rAttribs.begin(), rAttribs.end(),
+ FindAttribByChar(EE_CHAR_FONTINFO, nChar)) )
{
sal_Unicode cOld = rC.GetText()[ nChar ];
char cConv = OUStringToOString(OUString(ConvertFontToSubsFontChar(hConv, cOld)), RTL_TEXTENCODING_SYMBOL).toChar();
@@ -1454,11 +1452,8 @@ void EditTextObjectImpl::CreateData( SvStream& rIStream )
for ( sal_uInt16 nChar = 0; nChar < pC->GetText().getLength(); nChar++ )
{
const ContentInfo::XEditAttributesType& rAttribs = pC->aAttribs;
- ContentInfo::XEditAttributesType::const_iterator it =
- std::find_if(rAttribs.begin(), rAttribs.end(),
- FindAttribByChar(EE_CHAR_FONTINFO, nChar));
-
- if (it == rAttribs.end())
+ if ( std::none_of(rAttribs.begin(), rAttribs.end(),
+ FindAttribByChar(EE_CHAR_FONTINFO, nChar)) )
{
sal_Unicode cOld = pC->GetText()[ nChar ];
DBG_ASSERT( cOld >= 0xF000, "cOld not converted?!" );