summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-06-04 19:04:31 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-06-05 22:03:50 +0200
commitbfb807bf6cf07243a88dc1e66883dfcea872ceab (patch)
tree4b4e9fe5d7344e1b129f0e362eb0df6bda163b54
parent2c46c24e75dbd39ef1c6aa72d7c3a00d04b873e6 (diff)
tdf#133486 Revert "fix TODO"
This reverts commit 457d2a0c9373937332ad2ec7b16edc4b2c971a97. Reason for revert: <INSERT REASONING HERE> Change-Id: I4493fd0f1a309bd49ebe4ea3c14f7f558db9b90d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95551 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--sc/source/filter/xml/xmlexprt.cxx18
-rw-r--r--sc/source/filter/xml/xmlexprt.hxx3
2 files changed, 13 insertions, 8 deletions
diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx
index 5321f342c332..d2461326f36b 100644
--- a/sc/source/filter/xml/xmlexprt.cxx
+++ b/sc/source/filter/xml/xmlexprt.cxx
@@ -1982,15 +1982,17 @@ void ScXMLExport::ExportStyles_( bool bUsed )
SvXMLExport::ExportStyles_(bUsed);
}
-void ScXMLExport::AddStyleFromCells(const uno::Reference<sheet::XSheetCellRanges>& xCellRanges,
+void ScXMLExport::AddStyleFromCells(const uno::Reference<beans::XPropertySet>& xProperties,
const uno::Reference<sheet::XSpreadsheet>& xTable,
sal_Int32 nTable, const OUString* pOldName)
{
- uno::Reference<beans::XPropertySet> xProperties(xCellRanges, uno::UNO_QUERY_THROW);
css::uno::Any aAny = xProperties->getPropertyValue("FormatID");
sal_uInt64 nKey = 0;
aAny >>= nKey;
+ //! pass xCellRanges instead
+ uno::Reference<sheet::XSheetCellRanges> xCellRanges( xProperties, uno::UNO_QUERY );
+
OUString sStyleName;
sal_Int32 nNumberFormat(-1);
sal_Int32 nValidationIndex(-1);
@@ -2256,10 +2258,10 @@ void ScXMLExport::collectAutoStyles()
if (bCopySheet)
{
uno::Reference <sheet::XSpreadsheet> xTable(xIndex->getByIndex(nTable), uno::UNO_QUERY);
- uno::Reference <sheet::XSheetCellRanges> xCellRanges(
+ uno::Reference <beans::XPropertySet> xProperties(
xTable->getCellByPosition( aPos.Col(), aPos.Row() ), uno::UNO_QUERY );
- AddStyleFromCells(xCellRanges, xTable, nTable, &rCellEntry.maName);
+ AddStyleFromCells(xProperties, xTable, nTable, &rCellEntry.maName);
}
}
@@ -2514,8 +2516,12 @@ void ScXMLExport::collectAutoStyles()
uno::Reference< sheet::XSheetCellRanges> xCellRanges(xFormatRangesIndex->getByIndex(nFormatRange), uno::UNO_QUERY);
if (xCellRanges.is())
{
- AddStyleFromCells(xCellRanges, xTable, nTable, nullptr);
- IncrementProgressBar(false);
+ uno::Reference <beans::XPropertySet> xProperties (xCellRanges, uno::UNO_QUERY);
+ if (xProperties.is())
+ {
+ AddStyleFromCells(xProperties, xTable, nTable, nullptr);
+ IncrementProgressBar(false);
+ }
}
}
}
diff --git a/sc/source/filter/xml/xmlexprt.hxx b/sc/source/filter/xml/xmlexprt.hxx
index 1473dadf1317..de7402125d46 100644
--- a/sc/source/filter/xml/xmlexprt.hxx
+++ b/sc/source/filter/xml/xmlexprt.hxx
@@ -35,7 +35,6 @@ namespace com::sun::star {
namespace com::sun::star::table { class XCellRange; }
namespace com::sun::star::sheet { class XSpreadsheet; }
-namespace com::sun::star::sheet { class XSheetCellRanges; }
namespace com::sun::star::sheet { class XSpreadsheetDocument; }
namespace sc { class DataTransformation; }
@@ -207,7 +206,7 @@ class ScXMLExport : public SvXMLExport
void CollectUserDefinedNamespaces(const SfxItemPool* pPool, sal_uInt16 nAttrib);
void AddStyleFromCells(
- const css::uno::Reference< css::sheet::XSheetCellRanges >& xCellRanges,
+ const css::uno::Reference< css::beans::XPropertySet >& xProperties,
const css::uno::Reference< css::sheet::XSpreadsheet >& xTable,
sal_Int32 nTable, const OUString* pOldName );
void AddStyleFromColumn(