import performance : do not use EditEngine anymore
Change-Id: I5849add3444cff15a201a276c8917fabc4b33262 Reviewed-on: https://gerrit.libreoffice.org/5317 Reviewed-by: Kohei Yoshida <kohei.yoshida@suse.de> Tested-by: Kohei Yoshida <kohei.yoshida@suse.de>
This commit is contained in:
committed by
Kohei Yoshida
parent
af53d7a181
commit
f807403faa
@@ -55,9 +55,11 @@ public:
|
|||||||
|
|
||||||
/// Retrieves string with paragraphs delimited by spaces
|
/// Retrieves string with paragraphs delimited by spaces
|
||||||
static OUString GetSpaceDelimitedString( const EditEngine& rEngine );
|
static OUString GetSpaceDelimitedString( const EditEngine& rEngine );
|
||||||
|
static OUString GetSpaceDelimitedString( const EditTextObject& rEdit );
|
||||||
|
|
||||||
/// Retrieves string with paragraphs delimited by new lines ('\n').
|
/// Retrieves string with paragraphs delimited by new lines ('\n').
|
||||||
static OUString GetMultilineString( const EditEngine& rEngine );
|
static OUString GetMultilineString( const EditEngine& rEngine );
|
||||||
|
static OUString GetMultilineString( const EditTextObject& rEdit );
|
||||||
|
|
||||||
/** Retrieves string with paragraphs delimited by new lines ('\n').
|
/** Retrieves string with paragraphs delimited by new lines ('\n').
|
||||||
|
|
||||||
|
@@ -72,11 +72,7 @@ const ScAutoNameAddresses& ScAutoNameCache::GetNameOccurrences( const String& rN
|
|||||||
{
|
{
|
||||||
const EditTextObject* p = aIter.getEditText();
|
const EditTextObject* p = aIter.getEditText();
|
||||||
if (p)
|
if (p)
|
||||||
{
|
aStr = ScEditUtil::GetMultilineString(*p); // string with line separators between paragraphs
|
||||||
ScFieldEditEngine& rEngine = pDoc->GetEditEngine();
|
|
||||||
rEngine.SetText(*p);
|
|
||||||
aStr = ScEditUtil::GetMultilineString(rEngine); // string with line separators between paragraphs
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case CELLTYPE_NONE:
|
case CELLTYPE_NONE:
|
||||||
|
@@ -29,7 +29,7 @@
|
|||||||
#include <editeng/flditem.hxx>
|
#include <editeng/flditem.hxx>
|
||||||
#include <editeng/numitem.hxx>
|
#include <editeng/numitem.hxx>
|
||||||
#include <editeng/justifyitem.hxx>
|
#include <editeng/justifyitem.hxx>
|
||||||
#include "editeng/editobj.hxx"
|
#include <editeng/editobj.hxx>
|
||||||
#include <vcl/svapp.hxx>
|
#include <vcl/svapp.hxx>
|
||||||
#include <vcl/outdev.hxx>
|
#include <vcl/outdev.hxx>
|
||||||
#include <svl/inethist.hxx>
|
#include <svl/inethist.hxx>
|
||||||
@@ -81,16 +81,39 @@ static OUString lcl_GetDelimitedString( const EditEngine& rEngine, const sal_Cha
|
|||||||
return aRet.makeStringAndClear();
|
return aRet.makeStringAndClear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static OUString lcl_GetDelimitedString( const EditTextObject& rEdit, const sal_Char c )
|
||||||
|
{
|
||||||
|
sal_Int32 nParCount = rEdit.GetParagraphCount();
|
||||||
|
OUStringBuffer aRet( nParCount * 80 );
|
||||||
|
for (sal_Int32 nPar=0; nPar<nParCount; nPar++)
|
||||||
|
{
|
||||||
|
if (nPar > 0)
|
||||||
|
aRet.append(c);
|
||||||
|
aRet.append( rEdit.GetText( nPar ));
|
||||||
|
}
|
||||||
|
return aRet.makeStringAndClear();
|
||||||
|
}
|
||||||
|
|
||||||
OUString ScEditUtil::GetSpaceDelimitedString( const EditEngine& rEngine )
|
OUString ScEditUtil::GetSpaceDelimitedString( const EditEngine& rEngine )
|
||||||
{
|
{
|
||||||
return lcl_GetDelimitedString(rEngine, ' ');
|
return lcl_GetDelimitedString(rEngine, ' ');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
OUString ScEditUtil::GetSpaceDelimitedString( const EditTextObject& rEdit )
|
||||||
|
{
|
||||||
|
return lcl_GetDelimitedString(rEdit, ' ');
|
||||||
|
}
|
||||||
|
|
||||||
OUString ScEditUtil::GetMultilineString( const EditEngine& rEngine )
|
OUString ScEditUtil::GetMultilineString( const EditEngine& rEngine )
|
||||||
{
|
{
|
||||||
return lcl_GetDelimitedString(rEngine, '\n');
|
return lcl_GetDelimitedString(rEngine, '\n');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
OUString ScEditUtil::GetMultilineString( const EditTextObject& rEdit )
|
||||||
|
{
|
||||||
|
return lcl_GetDelimitedString(rEdit, '\n');
|
||||||
|
}
|
||||||
|
|
||||||
OUString ScEditUtil::GetString( const EditTextObject& rEditText, const ScDocument* pDoc )
|
OUString ScEditUtil::GetString( const EditTextObject& rEditText, const ScDocument* pDoc )
|
||||||
{
|
{
|
||||||
// ScFieldEditEngine is needed to resolve field contents.
|
// ScFieldEditEngine is needed to resolve field contents.
|
||||||
|
Reference in New Issue
Block a user