Kaydet (Commit) e1078f21 authored tarafından Bartosz Kosiorek's avatar Bartosz Kosiorek Kaydeden (comit) Markus Mohrhard

tdf#48140 Replace CellAddress uno calls with direct access

Change-Id: I4c8b36eaa29241f886810f9bff88ed9ca9d3192f
Reviewed-on: https://gerrit.libreoffice.org/30979Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarMarkus Mohrhard <markus.mohrhard@googlemail.com>
üst da7aa256
......@@ -88,14 +88,13 @@ void XMLTableShapeImportHelper::finishShape(
if (!pAnnotationContext)
{
ScDrawObjData aAnchor;
aAnchor.maStart = ScAddress(aStartCell.Column, aStartCell.Row, aStartCell.Sheet);
aAnchor.maStart = aStartCell;
awt::Point aStartPoint(rShape->getPosition());
aAnchor.maStartOffset = Point(aStartPoint.X, aStartPoint.Y);
sal_Int32 nEndX(-1);
sal_Int32 nEndY(-1);
sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
table::CellAddress aEndCell;
std::unique_ptr<OUString> xRangeList;
sal_Int16 nLayerID(-1);
for( sal_Int16 i=0; i < nAttrCount; ++i )
......@@ -112,8 +111,7 @@ void XMLTableShapeImportHelper::finishShape(
if (IsXMLToken(aLocalName, XML_END_CELL_ADDRESS))
{
sal_Int32 nOffset(0);
ScRangeStringConverter::GetAddressFromString(aEndCell, rValue, static_cast<ScXMLImport&>(mrImporter).GetDocument(), ::formula::FormulaGrammar::CONV_OOO, nOffset);
aAnchor.maEnd = ScAddress(aEndCell.Column, aEndCell.Row, aEndCell.Sheet);
ScRangeStringConverter::GetAddressFromString(aAnchor.maEnd, rValue, static_cast<ScXMLImport&>(mrImporter).GetDocument(), ::formula::FormulaGrammar::CONV_OOO, nOffset);
}
else if (IsXMLToken(aLocalName, XML_END_X))
{
......
......@@ -21,14 +21,14 @@
#define INCLUDED_SC_SOURCE_FILTER_XML_XMLTABLESHAPEIMPORTHELPER_HXX
#include <xmloff/shapeimport.hxx>
#include <com/sun/star/table/CellAddress.hpp>
#include "address.hxx"
class ScXMLImport;
class ScXMLAnnotationContext;
class XMLTableShapeImportHelper : public XMLShapeImportHelper
{
css::table::CellAddress aStartCell;
ScAddress aStartCell;
ScXMLAnnotationContext* pAnnotationContext;
bool bOnTable;
......@@ -42,7 +42,7 @@ public:
const css::uno::Reference< css::xml::sax::XAttributeList >& xAttrList,
css::uno::Reference< css::drawing::XShapes >& rShapes) override;
void SetCell (const css::table::CellAddress& rAddress) { aStartCell = rAddress; }
void SetCell (const ScAddress& rAddress) { aStartCell = rAddress; }
void SetOnTable (const bool bTempOnTable) { bOnTable = bTempOnTable; }
void SetAnnotation(ScXMLAnnotationContext* pAnnotation) { pAnnotationContext = pAnnotation; }
......
......@@ -91,7 +91,6 @@
#include <svtools/miscopt.hxx>
#include <sax/tools/converter.hxx>
#include <com/sun/star/table/CellAddress.hpp>
#include <com/sun/star/util/NumberFormat.hpp>
#include <com/sun/star/util/Date.hpp>
......@@ -710,9 +709,7 @@ SvXMLImportContext *ScXMLTableRowCellContext::CreateChildContext( sal_uInt16 nPr
XMLTableShapeImportHelper* pTableShapeImport =
static_cast< XMLTableShapeImportHelper* >( rXMLImport.GetShapeImport().get() );
pTableShapeImport->SetOnTable(false);
css::table::CellAddress aCellAddress;
ScUnoConversion::FillApiAddress( aCellAddress, aCellPos );
pTableShapeImport->SetCell(aCellAddress);
pTableShapeImport->SetCell(aCellPos);
pContext = rXMLImport.GetShapeImport()->CreateGroupChildContext(
rXMLImport, nPrefix, rLName, xAttrList, xShapes);
if (pContext)
......
......@@ -72,7 +72,7 @@ ScXMLFilterContext::ScXMLFilterContext( ScXMLImport& rImport,
sal_Int32 nOffset(0);
if (ScRangeStringConverter::GetRangeFromString( aScRange, sValue, pDoc, ::formula::FormulaGrammar::CONV_OOO, nOffset ))
{
ScUnoConversion::FillApiAddress( aOutputPosition, aScRange.aStart );
aOutputPosition = aScRange.aStart;
bCopyOutputData = true;
}
}
......@@ -144,9 +144,9 @@ void ScXMLFilterContext::EndElement()
if (bCopyOutputData)
{
mrQueryParam.nDestCol = aOutputPosition.Column;
mrQueryParam.nDestRow = aOutputPosition.Row;
mrQueryParam.nDestTab = aOutputPosition.Sheet;
mrQueryParam.nDestCol = aOutputPosition.Col();
mrQueryParam.nDestRow = aOutputPosition.Row();
mrQueryParam.nDestTab = aOutputPosition.Tab();
}
if (bConditionSourceRange)
......
......@@ -22,11 +22,8 @@
#include <xmloff/xmlictxt.hxx>
#include <xmloff/xmlimp.hxx>
#include <com/sun/star/table/CellAddress.hpp>
#include <com/sun/star/table/CellRangeAddress.hpp>
#include <com/sun/star/sheet/FilterOperator.hpp>
#include <com/sun/star/sheet/FilterOperator2.hpp>
#include <com/sun/star/sheet/TableFilterField2.hpp>
#include "xmldrani.hxx"
#include "xmldpimp.hxx"
......@@ -50,7 +47,7 @@ class ScXMLFilterContext : public ScXMLImportContext
ScQueryParam& mrQueryParam;
ScXMLDatabaseRangeContext* pDatabaseRangeContext;
css::table::CellAddress aOutputPosition;
ScAddress aOutputPosition;
css::table::CellRangeAddress aConditionSourceRangeAddress;
bool bSkipDuplicates;
bool bCopyOutputData;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment