diff options
author | Eike Rathke <erack@redhat.com> | 2017-11-03 23:10:01 +0100 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2017-11-03 23:37:54 +0100 |
commit | 12f09377b91b6d70efb3448d098f4dbd677a67d1 (patch) | |
tree | 55d43bfa4dce95971c0eba4585a3ee991b72c7b0 /sc/source/ui/docshell | |
parent | b00c6912a4f3ba417551d98f4d2a70c4e2328718 (diff) |
SYLK import: set and evaluate col/row overflow to display dialog
Change-Id: Id997aac2fd90f53652c81884c51833c92494e32f
Diffstat (limited to 'sc/source/ui/docshell')
-rw-r--r-- | sc/source/ui/docshell/docsh.cxx | 14 | ||||
-rw-r--r-- | sc/source/ui/docshell/impex.cxx | 12 |
2 files changed, 20 insertions, 6 deletions
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx index a9faf61da2b6..f9d2cc684d91 100644 --- a/sc/source/ui/docshell/docsh.cxx +++ b/sc/source/ui/docshell/docsh.cxx @@ -1345,6 +1345,8 @@ bool ScDocShell::ConvertFrom( SfxMedium& rMedium ) else if (aFltName == pFilterSylk) { ErrCode eError = SCERR_IMPORT_UNKNOWN; + bool bOverflowRow, bOverflowCol, bOverflowCell; + bOverflowRow = bOverflowCol = bOverflowCell = false; if( !rMedium.IsStorage() ) { ScImportExport aImpEx( &aDocument ); @@ -1358,6 +1360,10 @@ bool ScDocShell::ConvertFrom( SfxMedium& rMedium ) aDocument.StartAllListeners(); sc::SetFormulaDirtyContext aCxt; aDocument.SetAllFormulasDirty(aCxt); + + bOverflowRow = aImpEx.IsOverflowRow(); + bOverflowCol = aImpEx.IsOverflowCol(); + bOverflowCell = aImpEx.IsOverflowCell(); } else { @@ -1367,6 +1373,14 @@ bool ScDocShell::ConvertFrom( SfxMedium& rMedium ) if ( eError != ERRCODE_NONE && !GetError() ) SetError(eError); + else if (!GetError() && (bOverflowRow || bOverflowCol || bOverflowCell)) + { + // precedence: row, column, cell + ErrCode nWarn = (bOverflowRow ? SCWARN_IMPORT_ROW_OVERFLOW : + (bOverflowCol ? SCWARN_IMPORT_COLUMN_OVERFLOW : + SCWARN_IMPORT_CELL_OVERFLOW)); + SetError(nWarn); + } bSetColWidths = true; bSetSimpleTextColWidths = true; bSetRowHeights = true; diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx index 911c8ea584b0..953956213faa 100644 --- a/sc/source/ui/docshell/impex.cxx +++ b/sc/source/ui/docshell/impex.cxx @@ -1764,7 +1764,7 @@ bool ScImportExport::Sylk2Doc( SvStream& rStrm ) { SAL_WARN("sc.ui","ScImportExport::Sylk2Doc - ;X invalid nCol=" << nCol); nCol = std::max<SCCOL>(0, std::min<SCCOL>(nCol, MAXCOL)); - bInvalidCol = true; + bInvalidCol = bOverflowCol = true; } break; } @@ -1776,7 +1776,7 @@ bool ScImportExport::Sylk2Doc( SvStream& rStrm ) { SAL_WARN("sc.ui","ScImportExport::Sylk2Doc - ;Y invalid nRow=" << nRow); nRow = std::max<SCROW>(0, std::min<SCROW>(nRow, MAXROW)); - bInvalidRow = true; + bInvalidRow = bOverflowRow = true; } break; } @@ -1788,7 +1788,7 @@ bool ScImportExport::Sylk2Doc( SvStream& rStrm ) { SAL_WARN("sc.ui","ScImportExport::Sylk2Doc - ;C invalid nRefCol=" << nRefCol); nRefCol = std::max<SCCOL>(0, std::min<SCCOL>(nRefCol, MAXCOL)); - bInvalidRefCol = true; + bInvalidRefCol = bOverflowCol = true; } break; } @@ -1800,7 +1800,7 @@ bool ScImportExport::Sylk2Doc( SvStream& rStrm ) { SAL_WARN("sc.ui","ScImportExport::Sylk2Doc - ;R invalid nRefRow=" << nRefRow); nRefRow = std::max<SCROW>(0, std::min<SCROW>(nRefRow, MAXROW)); - bInvalidRefRow = true; + bInvalidRefRow = bOverflowRow = true; } break; } @@ -1925,7 +1925,7 @@ bool ScImportExport::Sylk2Doc( SvStream& rStrm ) { SAL_WARN("sc.ui","ScImportExport::Sylk2Doc - ;X invalid nCol=" << nCol); nCol = std::max<SCCOL>(0, std::min<SCCOL>(nCol, MAXCOL)); - bInvalidCol = true; + bInvalidCol = bOverflowCol = true; } break; } @@ -1937,7 +1937,7 @@ bool ScImportExport::Sylk2Doc( SvStream& rStrm ) { SAL_WARN("sc.ui","ScImportExport::Sylk2Doc - ;Y invalid nRow=" << nRow); nRow = std::max<SCROW>(0, std::min<SCROW>(nRow, MAXROW)); - bInvalidRow = true; + bInvalidRow = bOverflowRow = true; } break; } |