diff --git a/filters/libmsooxml/MsooXmlDrawingReaderTableImpl.h b/filters/libmsooxml/MsooXmlDrawingReaderTableImpl.h --- a/filters/libmsooxml/MsooXmlDrawingReaderTableImpl.h +++ b/filters/libmsooxml/MsooXmlDrawingReaderTableImpl.h @@ -55,8 +55,6 @@ m_context->import->loadAndParseDocument(&tableStyleReader, m_context->tableStylesFilePath, &tableStyleReaderContext); } - m_table = new KoTable; - m_table->setName(QLatin1String("Table") + QString::number(m_currentTableNumber + 1)); m_currentTableRowNumber = 0; m_currentTableColumnNumber = 0; @@ -77,8 +75,6 @@ m_table->saveOdf(*body, *mainStyles); - delete m_table; - m_currentTableNumber++; if (tableSetByMe) { diff --git a/filters/libmsooxml/MsooXmlDrawingReaderTableMethods.h b/filters/libmsooxml/MsooXmlDrawingReaderTableMethods.h --- a/filters/libmsooxml/MsooXmlDrawingReaderTableMethods.h +++ b/filters/libmsooxml/MsooXmlDrawingReaderTableMethods.h @@ -37,7 +37,7 @@ uint m_currentTableRowNumber; //!< row counter, from 0, initialized in read_tbl() uint m_currentTableColumnNumber; //!< column counter, from 0, initialized in read_tr() - KoTable* m_table; + ScopeKoTable m_table = ScopeKoTable(new KoTable); QString m_currentTableName; MSOOXML::DrawingTableStyle* m_tableStyle; diff --git a/filters/libmsooxml/PresetDrawingMLTables.h b/filters/libmsooxml/PresetDrawingMLTables.h --- a/filters/libmsooxml/PresetDrawingMLTables.h +++ b/filters/libmsooxml/PresetDrawingMLTables.h @@ -23,8 +23,8 @@ QString getPresetTable(const QString& reference) { -QMap presetTables; -presetTables["{2D5ABB26-0587-4C30-8999-92F81FD0307C}"] = "\ +static const QMap presetTables = { +{ QStringLiteral("{2D5ABB26-0587-4C30-8999-92F81FD0307C}"), QStringLiteral("\ \ \ \ @@ -72,8 +72,8 @@ \ \ \ -"; -presetTables["{3C2FFA5D-87B4-456A-9821-1D502468CF0F}"] = "\ +") }, +{ QStringLiteral("{3C2FFA5D-87B4-456A-9821-1D502468CF0F}"), QStringLiteral("\ \ \ \ @@ -335,8 +335,8 @@ \ \ \ -"; -presetTables["{284E427A-3D55-4303-BF80-6455036E1DE7}"] = "\ +") }, +{ QStringLiteral("{284E427A-3D55-4303-BF80-6455036E1DE7}"), QStringLiteral("\ \ \ \ @@ -598,8 +598,8 @@ \ \ \ -"; -presetTables["{69C7853C-536D-4A76-A0AE-DD22124D55A5}"] = "\ +") }, +{ QStringLiteral("{69C7853C-536D-4A76-A0AE-DD22124D55A5}"), QStringLiteral("\ \ \ \ @@ -861,8 +861,8 @@ \ \ \ -"; -presetTables["{775DCB02-9BB8-47FD-8907-85C794F793BA}"] = "\ +") }, +{ QStringLiteral("{775DCB02-9BB8-47FD-8907-85C794F793BA}"), QStringLiteral("\ \ \ \ @@ -1124,8 +1124,8 @@ \ \ \ -"; -presetTables["{35758FB7-9AC5-4552-8A53-C91805E547FA}"] = "\ +") }, +{ QStringLiteral("{35758FB7-9AC5-4552-8A53-C91805E547FA}"), QStringLiteral("\ \ \ \ @@ -1387,8 +1387,8 @@ \ \ \ -"; -presetTables["{08FB837D-C827-4EFA-A057-4D05807E0F7C}"] = "\ +") }, +{ QStringLiteral("{08FB837D-C827-4EFA-A057-4D05807E0F7C}"), QStringLiteral("\ \ \ \ @@ -1650,8 +1650,8 @@ \ \ \ -"; -presetTables["{5940675A-B579-460E-94D1-54222C63F5DA}"] = "\ +") }, +{ QStringLiteral("{5940675A-B579-460E-94D1-54222C63F5DA}"), QStringLiteral("\ \ \ \ @@ -1711,8 +1711,8 @@ \ \ \ -"; -presetTables["{D113A9D2-9D6B-4929-AA2D-F23B5EE8CBE7}"] = "\ +") }, +{ QStringLiteral("{D113A9D2-9D6B-4929-AA2D-F23B5EE8CBE7}"), QStringLiteral("\ \ \ \ @@ -1897,8 +1897,8 @@ \ \ \ -"; -presetTables["{18603FDC-E32A-4AB5-989C-0864C3EAD2B8}"] = "\ +") }, +{ QStringLiteral("{18603FDC-E32A-4AB5-989C-0864C3EAD2B8}"), QStringLiteral("\ \ \ \ @@ -2083,8 +2083,8 @@ \ \ \ -"; -presetTables["{306799F8-075E-4A3A-A7F6-7FBC6576F1A4}"] = "\ +") }, +{ QStringLiteral("{306799F8-075E-4A3A-A7F6-7FBC6576F1A4}"), QStringLiteral("\ \ \ \ @@ -2269,8 +2269,8 @@ \ \ \ -"; -presetTables["{E269D01E-BC32-4049-B463-5C60D7B0CCD2}"] = "\ +") }, +{ QStringLiteral("{E269D01E-BC32-4049-B463-5C60D7B0CCD2}"), QStringLiteral("\ \ \ \ @@ -2455,8 +2455,8 @@ \ \ \ -"; -presetTables["{327F97BB-C833-4FB7-BDE5-3F7075034690}"] = "\ +") }, +{ QStringLiteral("{327F97BB-C833-4FB7-BDE5-3F7075034690}"), QStringLiteral("\ \ \ \ @@ -2641,8 +2641,8 @@ \ \ \ -"; -presetTables["{638B1855-1B75-4FBE-930C-398BA8C253C6}"] = "\ +") }, +{ QStringLiteral("{638B1855-1B75-4FBE-930C-398BA8C253C6}"), QStringLiteral("\ \ \ \ @@ -2827,8 +2827,8 @@ \ \ \ -"; -presetTables["{9D7B26C5-4107-4FEC-AEDC-1716B250A1EF}"] = "\ +") }, +{ QStringLiteral("{9D7B26C5-4107-4FEC-AEDC-1716B250A1EF}"), QStringLiteral("\ \ \ \ @@ -2955,8 +2955,8 @@ \ \ \ -"; -presetTables["{3B4B98B0-60AC-42C2-AFA5-B58CD77FA1E5}"] = "\ +") }, +{ QStringLiteral("{3B4B98B0-60AC-42C2-AFA5-B58CD77FA1E5}"), QStringLiteral("\ \ \ \ @@ -3083,8 +3083,8 @@ \ \ \ -"; -presetTables["{0E3FDE45-AF77-4B5C-9715-49D594BDF05E}"] = "\ +") }, +{ QStringLiteral("{0E3FDE45-AF77-4B5C-9715-49D594BDF05E}"), QStringLiteral("\ \ \ \ @@ -3211,8 +3211,8 @@ \ \ \ -"; -presetTables["{C083E6E3-FA7D-4D7B-A595-EF9225AFEA82}"] = "\ +") }, +{ QStringLiteral("{C083E6E3-FA7D-4D7B-A595-EF9225AFEA82}"), QStringLiteral("\ \ \ \ @@ -3339,8 +3339,8 @@ \ \ \ -"; -presetTables["{D27102A9-8310-4765-A935-A1911B00CA55}"] = "\ +") }, +{ QStringLiteral("{D27102A9-8310-4765-A935-A1911B00CA55}"), QStringLiteral("\ \ \ \ @@ -3467,8 +3467,8 @@ \ \ \ -"; -presetTables["{5FD0F851-EC5A-4D38-B0AD-8093EC10F338}"] = "\ +") }, +{ QStringLiteral("{5FD0F851-EC5A-4D38-B0AD-8093EC10F338}"), QStringLiteral("\ \ \ \ @@ -3595,8 +3595,8 @@ \ \ \ -"; -presetTables["{68D230F3-CF80-4859-8CE7-A43EE81993B5}"] = "\ +") }, +{ QStringLiteral("{68D230F3-CF80-4859-8CE7-A43EE81993B5}"), QStringLiteral("\ \ \ \ @@ -3723,8 +3723,8 @@ \ \ \ -"; -presetTables["{7E9639D4-E3E2-4D34-9284-5A2195B3D0D7}"] = "\ +") }, +{ QStringLiteral("{7E9639D4-E3E2-4D34-9284-5A2195B3D0D7}"), QStringLiteral("\ \ \ \ @@ -3860,8 +3860,8 @@ \ \ \ -"; -presetTables["{69012ECD-51FC-41F1-AA8D-1B2483CD663E}"] = "\ +") }, +{ QStringLiteral("{69012ECD-51FC-41F1-AA8D-1B2483CD663E}"), QStringLiteral("\ \ \ \ @@ -3997,8 +3997,8 @@ \ \ \ -"; -presetTables["{72833802-FEF1-4C79-8D5D-14CF1EAF98D9}"] = "\ +") }, +{ QStringLiteral("{72833802-FEF1-4C79-8D5D-14CF1EAF98D9}"), QStringLiteral("\ \ \ \ @@ -4134,8 +4134,8 @@ \ \ \ -"; -presetTables["{F2DE63D5-997A-4646-A377-4702673A728D}"] = "\ +") }, +{ QStringLiteral("{F2DE63D5-997A-4646-A377-4702673A728D}"), QStringLiteral("\ \ \ \ @@ -4271,8 +4271,8 @@ \ \ \ -"; -presetTables["{17292A2E-F333-43FB-9621-5CBBE7FDCDCB}"] = "\ +") }, +{ QStringLiteral("{17292A2E-F333-43FB-9621-5CBBE7FDCDCB}"), QStringLiteral("\ \ \ \ @@ -4408,8 +4408,8 @@ \ \ \ -"; -presetTables["{5A111915-BE36-4E01-A7E5-04B1672EAD32}"] = "\ +") }, +{ QStringLiteral("{5A111915-BE36-4E01-A7E5-04B1672EAD32}"), QStringLiteral("\ \ \ \ @@ -4545,8 +4545,8 @@ \ \ \ -"; -presetTables["{912C8C85-51F0-491E-9774-3900AFEF0FD7}"] = "\ +") }, +{ QStringLiteral("{912C8C85-51F0-491E-9774-3900AFEF0FD7}"), QStringLiteral("\ \ \ \ @@ -4682,8 +4682,8 @@ \ \ \ -"; -presetTables["{616DA210-FB5B-4158-B5E0-FEB733F419BA}"] = "\ +") }, +{ QStringLiteral("{616DA210-FB5B-4158-B5E0-FEB733F419BA}"), QStringLiteral("\ \ \ \ @@ -4813,8 +4813,8 @@ \ \ \ -"; -presetTables["{BC89EF96-8CEA-46FF-86C4-4CE0E7609802}"] = "\ +") }, +{ QStringLiteral("{BC89EF96-8CEA-46FF-86C4-4CE0E7609802}"), QStringLiteral("\ \ \ \ @@ -4944,8 +4944,8 @@ \ \ \ -"; -presetTables["{5DA37D80-6434-44D0-A028-1B22A696006F}"] = "\ +") }, +{ QStringLiteral("{5DA37D80-6434-44D0-A028-1B22A696006F}"), QStringLiteral("\ \ \ \ @@ -5075,8 +5075,8 @@ \ \ \ -"; -presetTables["{8799B23B-EC83-4686-B30A-512413B5E67A}"] = "\ +") }, +{ QStringLiteral("{8799B23B-EC83-4686-B30A-512413B5E67A}"), QStringLiteral("\ \ \ \ @@ -5206,8 +5206,8 @@ \ \ \ -"; -presetTables["{ED083AE6-46FA-4A59-8FB0-9F97EB10719F}"] = "\ +") }, +{ QStringLiteral("{ED083AE6-46FA-4A59-8FB0-9F97EB10719F}"), QStringLiteral("\ \ \ \ @@ -5337,8 +5337,8 @@ \ \ \ -"; -presetTables["{BDBED569-4797-4DF1-A0F4-6AAB3CD982D8}"] = "\ +") }, +{ QStringLiteral("{BDBED569-4797-4DF1-A0F4-6AAB3CD982D8}"), QStringLiteral("\ \ \ \ @@ -5468,8 +5468,8 @@ \ \ \ -"; -presetTables["{E8B1032C-EA38-4F05-BA0D-38AFFFC7BED3}"] = "\ +") }, +{ QStringLiteral("{E8B1032C-EA38-4F05-BA0D-38AFFFC7BED3}"), QStringLiteral("\ \ \ \ @@ -5599,8 +5599,8 @@ \ \ \ -"; -presetTables["{793D81CF-94F2-401A-BA57-92F5A7B2D0C5}"] = "\ +") }, +{ QStringLiteral("{793D81CF-94F2-401A-BA57-92F5A7B2D0C5}"), QStringLiteral("\ \ \ \ @@ -5731,8 +5731,8 @@ \ \ \ -"; -presetTables["{B301B821-A1FF-4177-AEE7-76D212191A09}"] = "\ +") }, +{ QStringLiteral("{B301B821-A1FF-4177-AEE7-76D212191A09}"), QStringLiteral("\ \ \ \ @@ -5863,8 +5863,8 @@ \ \ \ -"; -presetTables["{9DCAF9ED-07DC-4A11-8D7F-57B35C25682E}"] = "\ +") }, +{ QStringLiteral("{9DCAF9ED-07DC-4A11-8D7F-57B35C25682E}"), QStringLiteral("\ \ \ \ @@ -5995,8 +5995,8 @@ \ \ \ -"; -presetTables["{1FECB4D8-DB02-4DC6-A0A2-4F2EBAE1DC90}"] = "\ +") }, +{ QStringLiteral("{1FECB4D8-DB02-4DC6-A0A2-4F2EBAE1DC90}"), QStringLiteral("\ \ \ \ @@ -6127,8 +6127,8 @@ \ \ \ -"; -presetTables["{1E171933-4619-4E11-9A3F-F7608DF75F80}"] = "\ +") }, +{ QStringLiteral("{1E171933-4619-4E11-9A3F-F7608DF75F80}"), QStringLiteral("\ \ \ \ @@ -6259,8 +6259,8 @@ \ \ \ -"; -presetTables["{FABFCF23-3B69-468F-B69F-88F6DE6A72F2}"] = "\ +") }, +{ QStringLiteral("{FABFCF23-3B69-468F-B69F-88F6DE6A72F2}"), QStringLiteral("\ \ \ \ @@ -6391,8 +6391,8 @@ \ \ \ -"; -presetTables["{10A1B5D5-9B99-4C35-A422-299274C87663}"] = "\ +") }, +{ QStringLiteral("{10A1B5D5-9B99-4C35-A422-299274C87663}"), QStringLiteral("\ \ \ \ @@ -6523,8 +6523,8 @@ \ \ \ -"; -presetTables["{073A0DAA-6AF3-43AB-8588-CEC1D06C72B9}"] = "\ +") }, +{ QStringLiteral("{073A0DAA-6AF3-43AB-8588-CEC1D06C72B9}"), QStringLiteral("\ \ \ \ @@ -6702,8 +6702,8 @@ \ \ \ -"; -presetTables["{5C22544A-7EE6-4342-B048-85BDC9FD1C3A}"] = "\ +") }, +{ QStringLiteral("{5C22544A-7EE6-4342-B048-85BDC9FD1C3A}"), QStringLiteral("\ \ \ \ @@ -6881,8 +6881,8 @@ \ \ \ -"; -presetTables["{21E4AEA4-8DFA-4A89-87EB-49C32662AFE0}"] = "\ +") }, +{ QStringLiteral("{21E4AEA4-8DFA-4A89-87EB-49C32662AFE0}"), QStringLiteral("\ \ \ \ @@ -7060,8 +7060,8 @@ \ \ \ -"; -presetTables["{F5AB1C69-6EDB-4FF4-983F-18BD219EF322}"] = "\ +") }, +{ QStringLiteral("{F5AB1C69-6EDB-4FF4-983F-18BD219EF322}"), QStringLiteral("\ \ \ \ @@ -7239,8 +7239,8 @@ \ \ \ -"; -presetTables["{00A15C55-8517-42AA-B614-E9B94910E393}"] = "\ +") }, +{ QStringLiteral("{00A15C55-8517-42AA-B614-E9B94910E393}"), QStringLiteral("\ \ \ \ @@ -7418,8 +7418,8 @@ \ \ \ -"; -presetTables["{7DF18680-E054-41AD-8BC1-D1AEF772440D}"] = "\ +") }, +{ QStringLiteral("{7DF18680-E054-41AD-8BC1-D1AEF772440D}"), QStringLiteral("\ \ \ \ @@ -7597,8 +7597,8 @@ \ \ \ -"; -presetTables["{93296810-A885-4BE3-A3E7-6D5BEEA58F35}"] = "\ +") }, +{ QStringLiteral("{93296810-A885-4BE3-A3E7-6D5BEEA58F35}"), QStringLiteral("\ \ \ \ @@ -7776,8 +7776,8 @@ \ \ \ -"; -presetTables["{8EC20E35-A176-4012-BC5E-935CFFF8708E}"] = "\ +") }, +{ QStringLiteral("{8EC20E35-A176-4012-BC5E-935CFFF8708E}"), QStringLiteral("\ \ \ \ @@ -7951,8 +7951,8 @@ \ \ \ -"; -presetTables["{6E25E649-3F16-4E02-A733-19D2CDBF48F0}"] = "\ +") }, +{ QStringLiteral("{6E25E649-3F16-4E02-A733-19D2CDBF48F0}"), QStringLiteral("\ \ \ \ @@ -8127,8 +8127,8 @@ \ \ \ -"; -presetTables["{85BE263C-DBD7-4A20-BB59-AAB30ACAA65A}"] = "\ +") }, +{ QStringLiteral("{85BE263C-DBD7-4A20-BB59-AAB30ACAA65A}"), QStringLiteral("\ \ \ \ @@ -8303,8 +8303,8 @@ \ \ \ -"; -presetTables["{EB344D84-9AFB-497E-A393-DC336BA19D2E}"] = "\ +") }, +{ QStringLiteral("{EB344D84-9AFB-497E-A393-DC336BA19D2E}"), QStringLiteral("\ \ \ \ @@ -8479,8 +8479,8 @@ \ \ \ -"; -presetTables["{EB9631B5-78F2-41C9-869B-9F39066F8104}"] = "\ +") }, +{ QStringLiteral("{EB9631B5-78F2-41C9-869B-9F39066F8104}"), QStringLiteral("\ \ \ \ @@ -8655,8 +8655,8 @@ \ \ \ -"; -presetTables["{74C1A8A3-306A-4EB7-A6B1-4F7E0EB9C5D6}"] = "\ +") }, +{ QStringLiteral("{74C1A8A3-306A-4EB7-A6B1-4F7E0EB9C5D6}"), QStringLiteral("\ \ \ \ @@ -8831,8 +8831,8 @@ \ \ \ -"; -presetTables["{2A488322-F2BA-4B5B-9748-0D474271808F}"] = "\ +") }, +{ QStringLiteral("{2A488322-F2BA-4B5B-9748-0D474271808F}"), QStringLiteral("\ \ \ \ @@ -9007,8 +9007,8 @@ \ \ \ -"; -presetTables["{D7AC3CCA-C797-4891-BE02-D94E43425B78}"] = "\ +") }, +{ QStringLiteral("{D7AC3CCA-C797-4891-BE02-D94E43425B78}"), QStringLiteral("\ \ \ \ @@ -9142,8 +9142,8 @@ \ \ \ -"; -presetTables["{69CF1AB2-1976-4502-BF36-3FF5EA218861}"] = "\ +") }, +{ QStringLiteral("{69CF1AB2-1976-4502-BF36-3FF5EA218861}"), QStringLiteral("\ \ \ \ @@ -9277,8 +9277,8 @@ \ \ \ -"; -presetTables["{8A107856-5554-42FB-B03E-39F5DBC370BA}"] = "\ +") }, +{ QStringLiteral("{8A107856-5554-42FB-B03E-39F5DBC370BA}"), QStringLiteral("\ \ \ \ @@ -9412,8 +9412,8 @@ \ \ \ -"; -presetTables["{0505E3EF-67EA-436B-97B2-0124C06EBD24}"] = "\ +") }, +{ QStringLiteral("{0505E3EF-67EA-436B-97B2-0124C06EBD24}"), QStringLiteral("\ \ \ \ @@ -9547,8 +9547,8 @@ \ \ \ -"; -presetTables["{C4B1156A-380E-4F78-BDF5-A606A8083BF9}"] = "\ +") }, +{ QStringLiteral("{C4B1156A-380E-4F78-BDF5-A606A8083BF9}"), QStringLiteral("\ \ \ \ @@ -9682,8 +9682,8 @@ \ \ \ -"; -presetTables["{22838BEF-8BB2-4498-84A7-C5851F593DF1}"] = "\ +") }, +{ QStringLiteral("{22838BEF-8BB2-4498-84A7-C5851F593DF1}"), QStringLiteral("\ \ \ \ @@ -9817,8 +9817,8 @@ \ \ \ -"; -presetTables["{16D9F66E-5EB9-4882-86FB-DCBF35E3C3E4}"] = "\ +") }, +{ QStringLiteral("{16D9F66E-5EB9-4882-86FB-DCBF35E3C3E4}"), QStringLiteral("\ \ \ \ @@ -9952,8 +9952,8 @@ \ \ \ -"; -presetTables["{E8034E78-7F5D-4C2E-B375-FC64B27BC917}"] = "\ +") }, +{ QStringLiteral("{E8034E78-7F5D-4C2E-B375-FC64B27BC917}"), QStringLiteral("\ \ \ \ @@ -10155,8 +10155,8 @@ \ \ \ -"; -presetTables["{125E5076-3810-47DD-B79F-674D7AD40C01}"] = "\ +") }, +{ QStringLiteral("{125E5076-3810-47DD-B79F-674D7AD40C01}"), QStringLiteral("\ \ \ \ @@ -10356,8 +10356,8 @@ \ \ \ -"; -presetTables["{37CE84F3-28C3-443E-9E96-99CF82512B78}"] = "\ +") }, +{ QStringLiteral("{37CE84F3-28C3-443E-9E96-99CF82512B78}"), QStringLiteral("\ \ \ \ @@ -10557,8 +10557,8 @@ \ \ \ -"; -presetTables["{D03447BB-5D67-496B-8E87-E561075AD55C}"] = "\ +") }, +{ QStringLiteral("{D03447BB-5D67-496B-8E87-E561075AD55C}"), QStringLiteral("\ \ \ \ @@ -10758,8 +10758,8 @@ \ \ \ -"; -presetTables["{E929F9F4-4A8F-4326-A1B4-22849713DDAB}"] = "\ +") }, +{ QStringLiteral("{E929F9F4-4A8F-4326-A1B4-22849713DDAB}"), QStringLiteral("\ \ \ \ @@ -10959,8 +10959,8 @@ \ \ \ -"; -presetTables["{8FD4443E-F989-4FC4-A0C8-D5A2AF1F390B}"] = "\ +") }, +{ QStringLiteral("{8FD4443E-F989-4FC4-A0C8-D5A2AF1F390B}"), QStringLiteral("\ \ \ \ @@ -11160,8 +11160,8 @@ \ \ \ -"; -presetTables["{AF606853-7671-496A-8E4F-DF71F8EC918B}"] = "\ +") }, +{ QStringLiteral("{AF606853-7671-496A-8E4F-DF71F8EC918B}"), QStringLiteral("\ \ \ \ @@ -11361,8 +11361,8 @@ \ \ \ -"; -presetTables["{5202B0CA-FC54-4496-8BCA-5EF66A818D29}"] = "\ +") }, +{ QStringLiteral("{5202B0CA-FC54-4496-8BCA-5EF66A818D29}"), QStringLiteral("\ \ \ \ @@ -11487,8 +11487,8 @@ \ \ \ -"; -presetTables["{0660B408-B3CF-4A94-85FC-2B1E0A45F4A2}"] = "\ +") }, +{ QStringLiteral("{0660B408-B3CF-4A94-85FC-2B1E0A45F4A2}"), QStringLiteral("\ \ \ \ @@ -11613,8 +11613,8 @@ \ \ \ -"; -presetTables["{91EBBBCC-DAD2-459C-BE2E-F6DE35CF9A28}"] = "\ +") }, +{ QStringLiteral("{91EBBBCC-DAD2-459C-BE2E-F6DE35CF9A28}"), QStringLiteral("\ \ \ \ @@ -11739,8 +11739,8 @@ \ \ \ -"; -presetTables["{46F890A9-2807-4EBB-B81D-B2AA78EC7F39}"] = "\ +") }, +{ QStringLiteral("{46F890A9-2807-4EBB-B81D-B2AA78EC7F39}"), QStringLiteral("\ \ \ \ @@ -11865,6 +11865,7 @@ \ \ \ -"; +") } +}; return presetTables.value(reference); } diff --git a/filters/libodf2/KoTable.h b/filters/libodf2/KoTable.h --- a/filters/libodf2/KoTable.h +++ b/filters/libodf2/KoTable.h @@ -32,6 +32,7 @@ #include #include #include +#include /** * \class KoTable represents a table in an ODF element. @@ -108,4 +109,6 @@ QString m_protectionAlgorithm; }; +typedef QSharedPointer ScopeKoTable; + #endif diff --git a/filters/stage/pptx/PptxXmlDocumentReader.h b/filters/stage/pptx/PptxXmlDocumentReader.h --- a/filters/stage/pptx/PptxXmlDocumentReader.h +++ b/filters/stage/pptx/PptxXmlDocumentReader.h @@ -26,6 +26,7 @@ #include #include "PptxXmlSlideReader.h" +#include class PptxImport; class PptxSlideProperties; @@ -35,8 +36,6 @@ class MsooXmlRelationships; } -class KoTable; - class PptxXmlDocumentReaderContext : public MSOOXML::MsooXmlReaderContext { public: diff --git a/filters/stage/pptx/PptxXmlSlideReader.h b/filters/stage/pptx/PptxXmlSlideReader.h --- a/filters/stage/pptx/PptxXmlSlideReader.h +++ b/filters/stage/pptx/PptxXmlSlideReader.h @@ -29,6 +29,7 @@ #include #include #include +#include class KoXmlWriter; class PptxXmlSlideReaderContext; @@ -39,8 +40,6 @@ class TableStyleList; } -class KoTable; - //! Data structure collecting information about single slide's shape (p:sp) class PptxShapeProperties { diff --git a/filters/words/docx/import/DocxXmlDocumentReader.h b/filters/words/docx/import/DocxXmlDocumentReader.h --- a/filters/words/docx/import/DocxXmlDocumentReader.h +++ b/filters/words/docx/import/DocxXmlDocumentReader.h @@ -36,6 +36,7 @@ #include #include #include +#include //#define NO_DRAWINGML_PICTURE // disables pic:pic, etc. in MsooXmlCommonReader @@ -48,8 +49,6 @@ class LocalTableStyles; } -class KoTable; - //! A class reading MSOOXML DOCX markup - document.xml part. class DocxXmlDocumentReader : public MSOOXML::MsooXmlCommonReader { @@ -256,7 +255,7 @@ // ! Used for setting up properties for border padding QMap m_textBorderPaddings; - KoTable* m_table; + ScopeKoTable m_table = ScopeKoTable(new KoTable); QString m_currentTableStyleName; KoTblStyle::Ptr m_tableMainStyle; diff --git a/filters/words/docx/import/DocxXmlDocumentReader.cpp b/filters/words/docx/import/DocxXmlDocumentReader.cpp --- a/filters/words/docx/import/DocxXmlDocumentReader.cpp +++ b/filters/words/docx/import/DocxXmlDocumentReader.cpp @@ -5443,9 +5443,6 @@ // save current state of lists processing saveState(); - KoTable table; - m_table = &table; - m_table->setName(QLatin1String("Table") + QString::number(++m_currentTableNumber)); m_currentTableRowNumber = 0; m_currentTableColumnNumber = 0; @@ -6081,7 +6078,8 @@ body = oldBody; } else if(QUALIFIED_NAME_IS(tbl)) { - KoTable* currentTable = m_table; + ScopeKoTable currentTable = m_table; + m_table = ScopeKoTable(new KoTable); int currentRow = m_currentTableRowNumber; int currentColumn = m_currentTableColumnNumber; MSOOXML::TableStyleProperties* currentDefaultCellStyle = m_currentDefaultCellStyle;