[Libreoffice-commits] .: binfilter/bf_sc
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Mon Sep 17 00:37:19 PDT 2012
binfilter/bf_sc/source/filter/xml/XMLExportDDELinks.hxx | 5 -
binfilter/bf_sc/source/filter/xml/sc_XMLExportDDELinks.cxx | 61 +------------
2 files changed, 6 insertions(+), 60 deletions(-)
New commits:
commit c825a7be7e5920519b485e7a133e97c1e9d93849
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Mon Sep 17 09:33:37 2012 +0200
-Werror,-Wuninitialized
Make the warning about uninitialized fValue go away, even if the existing code
looks like it got reduced somewhat too aggressively (cf.
<http://lists.freedesktop.org/archives/libreoffice/2012-September/038306.html>
"[libreoffice-commits] Hopefully this is the last of the cleanups for class
ScDocument for now.").
Change-Id: Ib0fbc0b96e4a5aa9a440a87b26f77be6e252d2ad
diff --git a/binfilter/bf_sc/source/filter/xml/XMLExportDDELinks.hxx b/binfilter/bf_sc/source/filter/xml/XMLExportDDELinks.hxx
index f9eb722..79f3a01 100644
--- a/binfilter/bf_sc/source/filter/xml/XMLExportDDELinks.hxx
+++ b/binfilter/bf_sc/source/filter/xml/XMLExportDDELinks.hxx
@@ -24,16 +24,13 @@
namespace binfilter {
-class String;
class ScXMLExport;
class ScXMLExportDDELinks
{
ScXMLExport& rExport;
- sal_Bool CellsEqual(const sal_Bool bPrevEmpty, const sal_Bool bPrevString, const String& sPrevValue, const double& fPrevValue,
- const sal_Bool bEmpty, const sal_Bool bString, const String& sValue, const double& fValue);
- void WriteCell(const sal_Bool bEmpty, const sal_Bool bString, const String& sValue, const double& fValue, const sal_Int32 nRepeat);
+ void WriteCell(const sal_Int32 nRepeat);
void WriteTable(const sal_Int32 nPos);
public:
ScXMLExportDDELinks(ScXMLExport& rExport);
diff --git a/binfilter/bf_sc/source/filter/xml/sc_XMLExportDDELinks.cxx b/binfilter/bf_sc/source/filter/xml/sc_XMLExportDDELinks.cxx
index 3bf9f1c..06ce94f 100644
--- a/binfilter/bf_sc/source/filter/xml/sc_XMLExportDDELinks.cxx
+++ b/binfilter/bf_sc/source/filter/xml/sc_XMLExportDDELinks.cxx
@@ -48,42 +48,11 @@ ScXMLExportDDELinks::~ScXMLExportDDELinks()
{
}
-sal_Bool ScXMLExportDDELinks::CellsEqual(const sal_Bool bPrevEmpty, const sal_Bool bPrevString, const String& sPrevValue, const double& fPrevValue,
- const sal_Bool bEmpty, const sal_Bool bString, const String& sValue, const double& fValue)
+void ScXMLExportDDELinks::WriteCell(const sal_Int32 nRepeat)
{
- if (bEmpty == bPrevEmpty)
- if (bEmpty)
- return sal_True;
- else if (bString == bPrevString)
- if (bString)
- return (sPrevValue == sValue);
- else
- return (fPrevValue == fValue);
- else
- return sal_False;
- else
- return sal_False;
-}
-
-void ScXMLExportDDELinks::WriteCell(const sal_Bool bEmpty, const sal_Bool bString, const String& sValue, const double& fValue, const sal_Int32 nRepeat)
-{
- ::rtl::OUStringBuffer sBuffer;
- if (!bEmpty)
- {
- if (bString)
- {
- rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_VALUE_TYPE, XML_STRING);
- rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_STRING_VALUE, ::rtl::OUString(sValue));
- }
- else
- {
- rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_VALUE_TYPE, XML_FLOAT);
- rExport.GetMM100UnitConverter().convertDouble(sBuffer, fValue);
- rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_VALUE, sBuffer.makeStringAndClear());
- }
- }
if (nRepeat > 1)
{
+ ::rtl::OUStringBuffer sBuffer;
rExport.GetMM100UnitConverter().convertNumber(sBuffer, nRepeat);
rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_NUMBER_COLUMNS_REPEATED, sBuffer.makeStringAndClear());
}
@@ -111,38 +80,18 @@ void ScXMLExportDDELinks::WriteTable(const sal_Int32 nPos)
{
SvXMLElementExport aElemCol(rExport, XML_NAMESPACE_TABLE, XML_TABLE_COLUMN, sal_True, sal_True);
}
- sal_Bool bPrevString(sal_True);
- sal_Bool bPrevEmpty(sal_True);
- double fPrevValue;
- String sPrevValue;
sal_Int32 nRepeatColsCount(1);
for(sal_Int32 nRow = 0; nRow < nRowCount; nRow++)
{
SvXMLElementExport aElemRow(rExport, XML_NAMESPACE_TABLE, XML_TABLE_ROW, sal_True, sal_True);
for(sal_Int32 nColumn = 0; nColumn < nColCount; nColumn++)
{
- if (nColumn == 0)
- bPrevEmpty = TRUE;
- else
+ if (nColumn != 0)
{
- double fValue;
- String sValue;
- sal_Bool bString(sal_True);
- sal_Bool bEmpty = TRUE;
- if (CellsEqual(bPrevEmpty, bPrevString, sPrevValue, fPrevValue,
- bEmpty, bString, sValue, fValue))
- nRepeatColsCount++;
- else
- {
- WriteCell(bPrevEmpty, bPrevString, sPrevValue, fPrevValue, nRepeatColsCount);
- nRepeatColsCount = 1;
- bPrevEmpty = bEmpty;
- fPrevValue = fValue;
- sPrevValue = sValue;
- }
+ nRepeatColsCount++;
}
}
- WriteCell(bPrevEmpty, bPrevString, sPrevValue, fPrevValue, nRepeatColsCount);
+ WriteCell(nRepeatColsCount);
nRepeatColsCount = 1;
}
}
More information about the Libreoffice-commits
mailing list