Bug 138970 - Maximum columns exceeded warning is shown while opening an MS Excel file via the SDK
Summary: Maximum columns exceeded warning is shown while opening an MS Excel file via ...
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: sdk (show other bugs)
Version:
(earliest affected)
6.3.3.2 release
Hardware: x86-64 (AMD64) Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-12-16 11:13 UTC by Tobias Köneke
Modified: 2022-08-19 14:13 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
MS EXcel file with more than 1024 columns (8.51 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2020-12-16 11:14 UTC, Tobias Köneke
Details
MWE for demonstrating the behaviour (2.90 KB, text/plain)
2020-12-16 11:15 UTC, Tobias Köneke
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tobias Köneke 2020-12-16 11:13:40 UTC
Description:
While opening an MS Excel file, with more than 1024 columns (AMJ), 
via the API, a warning is shown (maximum columns exceeded warning, SCWARN_IMPORT_COLUMN_OVERFLOW). LibreOffice has been opened in "hidden" mode through the API, the warning is the only visible part of LibreOffice and has to be dismissed/acknowledged by user interaction (pressing the only button "OK").

I've attached a test document created in MS Excel with the value "Test" written in cell 1:AMK (1:1025). I also attached an MWE using the API's C++ binding.

From what I've found so far, this seems to be an error related to not calling ScExternalRefManager::ApiGuard::ApiGuard. The warning is only shown if rDoc.IsUserInteractionEnabled() returns true in sc/source/filter/oox/excelfilter.cxx. ScExternalRefManager::ApiGuard::ApiGuard sets the mbUserInteractionEnabled variable to false in the SCDocument.

My current knowledge of the LibreOffice source code is a bit short, therefore I can't provide a fix right now. I will try to provide one, if you consider the displaying of the warning (while in API mode) an unwanted behaviour.

I've tested this on Windows 10 using LibreOffice 6.3.3.2, 6.4.7.2 and 7.0.3.1. All of them are affected. I also suspect this affects all operating systems and likely earlier versions too.

Steps to Reproduce:
1. Start an instance of LibreOffice via the API.
2. Open an Excel file with more than 1024 columns calling com::sun::star::frame::XDesktop2::loadComponentFromUrl(). Open the document in hidden mode.


Actual Results:
The warning "maximum columns exceeded" is shown before com::sun::star::frame::XDesktop2::loadComponentFromUrl() returns. This warning is the only visible part of LibreOffice.

Expected Results:
The warning shouldn't be shown, since LibreOffice has been opened via the API and no user interaction is to be expected.


Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 7.0.3.1 (x64)
Build ID: d7547858d014d4cf69878db179d326fc3483e082
CPU threads: 16; OS: Windows 10.0 Build 19041; UI render: Skia/Vulkan; VCL: win
Locale: de-DE (de_DE); UI: de-DE
Calc: threaded
Comment 1 Tobias Köneke 2020-12-16 11:14:35 UTC
Created attachment 168219 [details]
MS EXcel file with more than 1024 columns
Comment 2 Tobias Köneke 2020-12-16 11:15:37 UTC
Created attachment 168220 [details]
MWE for demonstrating the behaviour
Comment 3 Roman Kuznetsov 2022-04-05 20:21:19 UTC
I think, today, when we already have support for more than 1024 columns in current 7.4 master builds , this report can be closed as WFM

Tobias, could you please test current development build by link https://dev-builds.libreoffice.org/daily/master/current.html
Comment 4 Tobias Köneke 2022-08-19 14:13:26 UTC
LibreOffice 7.4 solves this problem. We no longer get a warning about exceeding columns.
This ticket can be closed.