[Libreoffice-commits] core.git: Branch 'libreoffice-7-2-0' - sc/source

2021-08-17 Thread Julien Nabet (via logerrit)
 sc/source/core/data/table2.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 376d9889bcd61dbfc0531b2168e2f04736d81d49
Author: Julien Nabet 
AuthorDate: Mon Aug 16 18:05:12 2021 +0200
Commit: Eike Rathke 
CommitDate: Wed Aug 18 00:50:14 2021 +0200

tdf#143896: FILESAVE XLS(X) 1001+ rows are lost after saving new file

Regression from:

https://cgit.freedesktop.org/libreoffice/core/commit/?id=2bf3e0d00e3bccb5b250642ee0d3fdbe6cae8ecc
tdf#104502 sc: skip hidden columns at printing pages
Page calculation counted the hidden columns, resulted
printing blank pages by accident.

Extend GetPrintArea() and GetTableArea() to count pages
without the hidden columns, too.

Change-Id: I77e7d6d893967a3ddac4c7c4e225769b38b44649
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120449
Tested-by: Jenkins
Reviewed-by: Christian Lohmaier 
(cherry picked from commit ab6c339faa15bf324f1161678717f02dbf8c19f6)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120450
Reviewed-by: Xisco Fauli 
Reviewed-by: Adolfo Jayme Barrientos 
Reviewed-by: Eike Rathke 
Tested-by: Eike Rathke 

diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index af36f60f0d9e..69bfec7ed100 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -1525,6 +1525,7 @@ void ScTable::CopyUpdated( const ScTable* pPosTab, 
ScTable* pDestTab ) const
 void ScTable::InvalidateTableArea()
 {
 bTableAreaValid = false;
+bTableAreaVisibleValid = false;
 }
 
 void ScTable::InvalidatePageBreaks()


[Libreoffice-commits] core.git: Branch 'libreoffice-7-2-0' - sc/source

2021-08-03 Thread Eike Rathke (via logerrit)
 sc/source/filter/oox/excelfilter.cxx |8 ++-
 sc/source/filter/xml/xmlimprt.cxx|3 +
 sc/source/ui/docshell/arealink.cxx   |3 +
 sc/source/ui/docshell/docsh.cxx  |   25 +
 sc/source/ui/docshell/docsh4.cxx |   90 +--
 sc/source/ui/inc/docsh.hxx   |1 
 6 files changed, 71 insertions(+), 59 deletions(-)

New commits:
commit 1663fd0f85a523bfbd46e836436e979344f009d3
Author: Eike Rathke 
AuthorDate: Sun Aug 1 21:40:15 2021 +0200
Commit: Caolán McNamara 
CommitDate: Tue Aug 3 12:40:30 2021 +0200

Consolidate link update handling

Have it at one central place and identical for all document
loading paths.

Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119835
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit 55abc3eb93fb8314b413453e384261cb00fde087)

 Conflicts:
sc/source/ui/docshell/docsh4.cxx

Change-Id: Ib00153a9f5831e223d0129df0538353a7e20961e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119852
Tested-by: Mike Kaganski 
Reviewed-by: Mike Kaganski 
Reviewed-by: Caolán McNamara 

diff --git a/sc/source/filter/oox/excelfilter.cxx 
b/sc/source/filter/oox/excelfilter.cxx
index b5d01215baf8..e5815200e063 100644
--- a/sc/source/filter/oox/excelfilter.cxx
+++ b/sc/source/filter/oox/excelfilter.cxx
@@ -109,14 +109,18 @@ bool ExcelFilter::importDocument()
 if (xBookGlob)
 {
 rtl::Reference xWorkbookFragment( new 
WorkbookFragment(*xBookGlob, aWorkbookPath));
+
+const WorkbookFragment* pWF = static_cast(xWorkbookFragment.get());
+const ScDocument& rDoc = pWF->getScDocument();
+if (ScDocShell* pDocSh = 
static_cast(rDoc.GetDocumentShell()))
+pDocSh->SetInitialLinkUpdate( pDocSh->GetMedium());
+
 bool bRet = importFragment( xWorkbookFragment);
 if (bRet)
 {
-const WorkbookFragment* pWF = static_cast(xWorkbookFragment.get());
 const AddressConverter& rAC = pWF->getAddressConverter();
 if (rAC.isTabOverflow() || rAC.isColOverflow() || 
rAC.isRowOverflow())
 {
-const ScDocument& rDoc = pWF->getScDocument();
 if (rDoc.IsUserInteractionEnabled())
 {
 // Show data loss warning.
diff --git a/sc/source/filter/xml/xmlimprt.cxx 
b/sc/source/filter/xml/xmlimprt.cxx
index 968ebb0cdbfe..99d33d2416db 100644
--- a/sc/source/filter/xml/xmlimprt.cxx
+++ b/sc/source/filter/xml/xmlimprt.cxx
@@ -1138,6 +1138,9 @@ void SAL_CALL ScXMLImport::setTargetDocument( const 
css::uno::Reference< css::la
 if (!pDoc)
 throw lang::IllegalArgumentException();
 
+if (ScDocShell* pDocSh = 
static_cast(pDoc->GetDocumentShell()))
+pDocSh->SetInitialLinkUpdate( pDocSh->GetMedium());
+
 mpDocImport.reset(new ScDocumentImport(*pDoc));
 mpComp.reset(new ScCompiler(*pDoc, ScAddress(), 
formula::FormulaGrammar::GRAM_ODFF));
 
diff --git a/sc/source/ui/docshell/arealink.cxx 
b/sc/source/ui/docshell/arealink.cxx
index 2b66e13e2327..e44e364c461a 100644
--- a/sc/source/ui/docshell/arealink.cxx
+++ b/sc/source/ui/docshell/arealink.cxx
@@ -226,6 +226,9 @@ bool ScAreaLink::Refresh( const OUString& rNewFile, const 
OUString& rNewFilter,
 if (rNewFile.isEmpty() || rNewFilter.isEmpty())
 return false;
 
+if (!m_pDocSh->GetEmbeddedObjectContainer().getUserAllowsLinkUpdate())
+return false;
+
 OUString aNewUrl( ScGlobal::GetAbsDocName( rNewFile, m_pDocSh ) );
 bool bNewUrlName = (aNewUrl != aFileName);
 
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index 29435d90a2f4..8e2c3c45218f 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -586,21 +586,7 @@ bool ScDocShell::Load( SfxMedium& rMedium )
 bool bRet = SfxObjectShell::Load(rMedium);
 if (bRet)
 {
-if (GetMedium())
-{
-const SfxUInt16Item* pUpdateDocItem = 
SfxItemSet::GetItem(rMedium.GetItemSet(), SID_UPDATEDOCMODE, 
false);
-m_nCanUpdate = pUpdateDocItem ? pUpdateDocItem->GetValue() : 
css::document::UpdateDocMode::NO_UPDATE;
-}
-
-// GetLinkUpdateModeState() evaluates m_nCanUpdate so that must have
-// been set first. Do not override an already forbidden LinkUpdate (the
-// default is allow).
-comphelper::EmbeddedObjectContainer& rEmbeddedObjectContainer = 
getEmbeddedObjectContainer();
-if (rEmbeddedObjectContainer.getUserAllowsLinkUpdate())
-{
-// For anything else than LM_ALWAYS we need user confirmation.
-rEmbeddedObjectContainer.setUserAllowsLinkUpdate( 
GetLinkUpdateModeState() == LM_ALWAYS);
-}
+SetInitialLinkUpdate(&rMedium);
 
 {
 //  prepare a valid document for XML