diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-08-07 14:39:22 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-08-07 16:54:56 +0200 |
commit | 0e12a4055de19271e8756a323df684c0985c8e3a (patch) | |
tree | 3a0c22372af171cccaac9fc2e64f99d2acb5726f | |
parent | d1cddc4775f03a52bb8fa2229dc5624d8cc5a3ce (diff) |
tdf#126673 Auto-fit column and auto-fit row don't work with line break
Revert "tdf#94677 Calc is slow opening large CSV, avoid reset SetUpdateMode"
This reverts commit c47d0174f2c6c3ebcb3b33276d0277e7aceac330.
Change-Id: I38e065d44dfb9d08498176b8231aff14ff51d91c
Reviewed-on: https://gerrit.libreoffice.org/77109
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | sc/inc/document.hxx | 2 | ||||
-rw-r--r-- | sc/source/core/data/column2.cxx | 4 | ||||
-rw-r--r-- | sc/source/core/data/documen2.cxx | 5 | ||||
-rw-r--r-- | sc/source/ui/Accessibility/AccessibleText.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/unoobj/textuno.cxx | 2 |
5 files changed, 10 insertions, 7 deletions
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx index f47177c2bd5e..bebbd4fafb9a 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(bool bUpdateMode); + std::unique_ptr<ScFieldEditEngine> CreateFieldEditEngine(); void DisposeFieldEditEngine(std::unique_ptr<ScFieldEditEngine>& rpEditEngine); /** diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx index 4bfacdde4190..151673e278af 100644 --- a/sc/source/core/data/column2.cxx +++ b/sc/source/core/data/column2.cxx @@ -363,8 +363,9 @@ long ScColumn::GetNeededSize( MapMode aHMMMode( MapUnit::Map100thMM, Point(), rZoomX, rZoomY ); // save in document ? - std::unique_ptr<ScFieldEditEngine> pEngine = pDocument->CreateFieldEditEngine(/*bUpdateMode*/false); + std::unique_ptr<ScFieldEditEngine> pEngine = pDocument->CreateFieldEditEngine(); + pEngine->SetUpdateMode( false ); bool bTextWysiwyg = ( pDev->GetOutDevType() == OUTDEV_PRINTER ); EEControlBits nCtrl = pEngine->GetControlWord(); if ( bTextWysiwyg ) @@ -455,6 +456,7 @@ 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 15d95a9f77b3..b87d73a8da56 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(bool bUpdateMode) +std::unique_ptr<ScFieldEditEngine> ScDocument::CreateFieldEditEngine() { std::unique_ptr<ScFieldEditEngine> pNewEditEngine; if (!pCacheFieldEditEngine) @@ -1105,7 +1105,8 @@ std::unique_ptr<ScFieldEditEngine> ScDocument::CreateFieldEditEngine(bool bUpdat { // #i66209# previous use might not have restored update mode, // ensure same state as for a new EditEngine (UpdateMode = true) - pCacheFieldEditEngine->SetUpdateMode(bUpdateMode); + if ( !pCacheFieldEditEngine->GetUpdateMode() ) + pCacheFieldEditEngine->SetUpdateMode(true); } pNewEditEngine = std::move(pCacheFieldEditEngine); diff --git a/sc/source/ui/Accessibility/AccessibleText.cxx b/sc/source/ui/Accessibility/AccessibleText.cxx index c32edc078c31..acacc91ba421 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(/*bUpdateMode*/true); + pEditEngine = rDoc.CreateFieldEditEngine(); } else { @@ -1228,7 +1228,7 @@ SvxTextForwarder* ScAccessibleNoteTextData::GetTextForwarder() if ( mpDocSh ) { ScDocument& rDoc = mpDocSh->GetDocument(); - mpEditEngine = rDoc.CreateFieldEditEngine(/*bUpdateMode*/true); + mpEditEngine = rDoc.CreateFieldEditEngine(); } else { diff --git a/sc/source/ui/unoobj/textuno.cxx b/sc/source/ui/unoobj/textuno.cxx index 3ef1645d2542..c62d834a4475 100644 --- a/sc/source/ui/unoobj/textuno.cxx +++ b/sc/source/ui/unoobj/textuno.cxx @@ -802,7 +802,7 @@ SvxTextForwarder* ScCellTextData::GetTextForwarder() if ( pDocShell ) { ScDocument& rDoc = pDocShell->GetDocument(); - pEditEngine = rDoc.CreateFieldEditEngine(/*bUpdateMode*/true); + pEditEngine = rDoc.CreateFieldEditEngine(); } else { |