From 028294396260d762b7171a313092cddfad3fb6ea Mon Sep 17 00:00:00 2001 From: wp_xxyyzz Date: Thu, 22 Feb 2018 09:27:34 +0000 Subject: [PATCH] fpspreadsheet: Make ods reader skip the source table of an external reference git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6211 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- .../fpspreadsheet/source/common/fpsopendocument.pas | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/components/fpspreadsheet/source/common/fpsopendocument.pas b/components/fpspreadsheet/source/common/fpsopendocument.pas index 9cdc44634..13c35c231 100644 --- a/components/fpspreadsheet/source/common/fpsopendocument.pas +++ b/components/fpspreadsheet/source/common/fpsopendocument.pas @@ -2537,6 +2537,15 @@ begin TableNode := TableNode.NextSibling; continue; end; + + // Tables with external references contain a copy of the external table + // having the filename as sheet name - which is not valid for fps. + // Since external references are not supported ATM we skip this table. + if TableNode.FindNode('table:table-source') <> nil then begin + TableNode := TableNode.NextSibling; + Continue; + end; + FWorkSheet := FWorkbook.AddWorksheet(GetAttrValue(TableNode, 'table:name'), true); tablestyleName := GetAttrValue(TableNode, 'table:style-name'); // Read protection