File indexing completed on 2025-01-19 13:27:33

0001 /*
0002  * This file is part of Office 2007 Filters for Calligra
0003  *
0004  * Copyright (C) 2010 Sebastian Sauer <sebsauer@kdab.com>
0005  * Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
0006  * Copyright (C) 2010 Marijn Kruisselbrink <mkruisselbrink@kde.org>
0007  *
0008  * Contact: Suresh Chande suresh.chande@nokia.com
0009  *
0010  * This library is free software; you can redistribute it and/or
0011  * modify it under the terms of the GNU Lesser General Public License
0012  * version 2.1 as published by the Free Software Foundation.
0013  *
0014  * This library is distributed in the hope that it will be useful, but
0015  * WITHOUT ANY WARRANTY; without even the implied warranty of
0016  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
0017  * Lesser General Public License for more details.
0018  *
0019  * You should have received a copy of the GNU Lesser General Public
0020  * License along with this library; if not, write to the Free Software
0021  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
0022  * 02110-1301 USA
0023  *
0024  */
0025 #include "FormulaParser.h"
0026 #include "XlsxXmlWorksheetReader_p.h"
0027 
0028 #include <sheets/Util.h>
0029 
0030 QString MSOOXML::convertFormulaReference(Cell* referencedCell, Cell* thisCell)
0031 {
0032     if (!referencedCell->formula)
0033         return QString();
0034     Q_ASSERT(!referencedCell->formula->isShared());
0035     QString formula = static_cast<FormulaImpl*>(referencedCell->formula)->m_formula;
0036     return Calligra::Sheets::Util::adjustFormulaReference(formula, referencedCell->row, referencedCell->column, thisCell->row, thisCell->column);
0037 }