[Libreoffice-commits] core.git: 2 commits - sc/inc sc/source
Noel Grandin (via logerrit)
logerrit at kemper.freedesktop.org
Tue Jun 25 06:29:37 UTC 2019
sc/inc/document.hxx | 2 +-
sc/source/core/data/column2.cxx | 4 +---
sc/source/core/data/documen2.cxx | 5 ++---
sc/source/core/data/patattr.cxx | 12 ++++++------
sc/source/ui/Accessibility/AccessibleText.cxx | 4 ++--
sc/source/ui/unoobj/textuno.cxx | 2 +-
6 files changed, 13 insertions(+), 16 deletions(-)
New commits:
commit 2b58bb92b3d5da97290a0f273125ebc34fc5082b
Author: Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Mon Jun 24 15:03:17 2019 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Tue Jun 25 08:28:56 2019 +0200
tdf#94677 Calc is slow opening large CSV, avoid std::shared_ptr
Shaves 2s off a load time of 48s
Change-Id: I616d8b4280bee64e7c25eda8523a13cb80b121ad
Reviewed-on: https://gerrit.libreoffice.org/74640
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/sc/source/core/data/patattr.cxx b/sc/source/core/data/patattr.cxx
index bf3d1dc115e2..d3ce46ddff61 100644
--- a/sc/source/core/data/patattr.cxx
+++ b/sc/source/core/data/patattr.cxx
@@ -542,14 +542,14 @@ void ScPatternAttr::FillToEditItemSet( SfxItemSet& rEditSet, const SfxItemSet& r
{
// Read Items
- std::shared_ptr<SvxColorItem> aColorItem(std::make_shared<SvxColorItem>(EE_CHAR_COLOR)); // use item as-is
- std::shared_ptr<SvxFontItem> aFontItem(std::make_shared<SvxFontItem>(EE_CHAR_FONTINFO)); // use item as-is
- std::shared_ptr<SvxFontItem> aCjkFontItem(std::make_shared<SvxFontItem>(EE_CHAR_FONTINFO_CJK)); // use item as-is
- std::shared_ptr<SvxFontItem> aCtlFontItem(std::make_shared<SvxFontItem>(EE_CHAR_FONTINFO_CTL)); // use item as-is
+ std::unique_ptr<SvxColorItem> aColorItem(std::make_unique<SvxColorItem>(EE_CHAR_COLOR)); // use item as-is
+ std::unique_ptr<SvxFontItem> aFontItem(std::make_unique<SvxFontItem>(EE_CHAR_FONTINFO)); // use item as-is
+ std::unique_ptr<SvxFontItem> aCjkFontItem(std::make_unique<SvxFontItem>(EE_CHAR_FONTINFO_CJK)); // use item as-is
+ std::unique_ptr<SvxFontItem> aCtlFontItem(std::make_unique<SvxFontItem>(EE_CHAR_FONTINFO_CTL)); // use item as-is
long nTHeight, nCjkTHeight, nCtlTHeight; // Twips
FontWeight eWeight, eCjkWeight, eCtlWeight;
- std::shared_ptr<SvxUnderlineItem> aUnderlineItem(std::make_shared<SvxUnderlineItem>(LINESTYLE_NONE, EE_CHAR_UNDERLINE));
- std::shared_ptr<SvxOverlineItem> aOverlineItem(std::make_shared<SvxOverlineItem>(LINESTYLE_NONE, EE_CHAR_OVERLINE));
+ std::unique_ptr<SvxUnderlineItem> aUnderlineItem(std::make_unique<SvxUnderlineItem>(LINESTYLE_NONE, EE_CHAR_UNDERLINE));
+ std::unique_ptr<SvxOverlineItem> aOverlineItem(std::make_unique<SvxOverlineItem>(LINESTYLE_NONE, EE_CHAR_OVERLINE));
bool bWordLine;
FontStrikeout eStrike;
FontItalic eItalic, eCjkItalic, eCtlItalic;
commit c47d0174f2c6c3ebcb3b33276d0277e7aceac330
Author: Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Mon Jun 24 11:41:37 2019 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Tue Jun 25 08:28:49 2019 +0200
tdf#94677 Calc is slow opening large CSV, avoid reset SetUpdateMode
Avoid resetting SetUpdateMode in CreateFieldEditEngine while calculating
row height.
This takes the time from 1m25 to 49s for me.
Change-Id: If406eac1a8b031f1734d9c2376c413dfa22d89f8
Reviewed-on: https://gerrit.libreoffice.org/74630
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index bebbd4fafb9a..f47177c2bd5e 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -634,7 +634,7 @@ public:
void Clear( bool bFromDestructor = false );
- std::unique_ptr<ScFieldEditEngine> CreateFieldEditEngine();
+ std::unique_ptr<ScFieldEditEngine> CreateFieldEditEngine(bool bUpdateMode);
void DisposeFieldEditEngine(std::unique_ptr<ScFieldEditEngine>& rpEditEngine);
/**
diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx
index 0a54f877c0b1..b4dfbfac64aa 100644
--- a/sc/source/core/data/column2.cxx
+++ b/sc/source/core/data/column2.cxx
@@ -363,9 +363,8 @@ long ScColumn::GetNeededSize(
MapMode aHMMMode( MapUnit::Map100thMM, Point(), rZoomX, rZoomY );
// save in document ?
- std::unique_ptr<ScFieldEditEngine> pEngine = pDocument->CreateFieldEditEngine();
+ std::unique_ptr<ScFieldEditEngine> pEngine = pDocument->CreateFieldEditEngine(/*bUpdateMode*/false);
- pEngine->SetUpdateMode( false );
bool bTextWysiwyg = ( pDev->GetOutDevType() == OUTDEV_PRINTER );
EEControlBits nCtrl = pEngine->GetControlWord();
if ( bTextWysiwyg )
@@ -456,7 +455,6 @@ long ScColumn::GetNeededSize(
bool bEngineVertical = pEngine->IsVertical();
pEngine->SetVertical( bAsianVertical );
- pEngine->SetUpdateMode( true );
bool bEdWidth = bWidth;
if ( eOrient != SvxCellOrientation::Standard && eOrient != SvxCellOrientation::Stacked )
diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx
index b87d73a8da56..15d95a9f77b3 100644
--- a/sc/source/core/data/documen2.cxx
+++ b/sc/source/core/data/documen2.cxx
@@ -1091,7 +1091,7 @@ void ScDocument::SetChangeViewSettings(const ScChangeViewSettings& rNew)
*pChangeViewSettings=rNew;
}
-std::unique_ptr<ScFieldEditEngine> ScDocument::CreateFieldEditEngine()
+std::unique_ptr<ScFieldEditEngine> ScDocument::CreateFieldEditEngine(bool bUpdateMode)
{
std::unique_ptr<ScFieldEditEngine> pNewEditEngine;
if (!pCacheFieldEditEngine)
@@ -1105,8 +1105,7 @@ std::unique_ptr<ScFieldEditEngine> ScDocument::CreateFieldEditEngine()
{
// #i66209# previous use might not have restored update mode,
// ensure same state as for a new EditEngine (UpdateMode = true)
- if ( !pCacheFieldEditEngine->GetUpdateMode() )
- pCacheFieldEditEngine->SetUpdateMode(true);
+ pCacheFieldEditEngine->SetUpdateMode(bUpdateMode);
}
pNewEditEngine = std::move(pCacheFieldEditEngine);
diff --git a/sc/source/ui/Accessibility/AccessibleText.cxx b/sc/source/ui/Accessibility/AccessibleText.cxx
index acacc91ba421..c32edc078c31 100644
--- a/sc/source/ui/Accessibility/AccessibleText.cxx
+++ b/sc/source/ui/Accessibility/AccessibleText.cxx
@@ -1011,7 +1011,7 @@ SvxTextForwarder* ScAccessiblePreviewHeaderCellTextData::GetTextForwarder()
if ( pDocShell )
{
ScDocument& rDoc = pDocShell->GetDocument();
- pEditEngine = rDoc.CreateFieldEditEngine();
+ pEditEngine = rDoc.CreateFieldEditEngine(/*bUpdateMode*/true);
}
else
{
@@ -1228,7 +1228,7 @@ SvxTextForwarder* ScAccessibleNoteTextData::GetTextForwarder()
if ( mpDocSh )
{
ScDocument& rDoc = mpDocSh->GetDocument();
- mpEditEngine = rDoc.CreateFieldEditEngine();
+ mpEditEngine = rDoc.CreateFieldEditEngine(/*bUpdateMode*/true);
}
else
{
diff --git a/sc/source/ui/unoobj/textuno.cxx b/sc/source/ui/unoobj/textuno.cxx
index 252a0bfee513..86d304906672 100644
--- a/sc/source/ui/unoobj/textuno.cxx
+++ b/sc/source/ui/unoobj/textuno.cxx
@@ -812,7 +812,7 @@ SvxTextForwarder* ScCellTextData::GetTextForwarder()
if ( pDocShell )
{
ScDocument& rDoc = pDocShell->GetDocument();
- pEditEngine = rDoc.CreateFieldEditEngine();
+ pEditEngine = rDoc.CreateFieldEditEngine(/*bUpdateMode*/true);
}
else
{
More information about the Libreoffice-commits
mailing list