summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2012-09-17 09:33:37 +0200
committerStephan Bergmann <sbergman@redhat.com>2012-09-17 09:33:37 +0200
commitc825a7be7e5920519b485e7a133e97c1e9d93849 (patch)
treeb1c3672bf1e9599b3d56bf6c026434506d531eaa
parentImprovement on previous commit, UCB clean up, binfilter redux (diff)
downloadbinfilter-c825a7be7e5920519b485e7a133e97c1e9d93849.tar.gz
binfilter-c825a7be7e5920519b485e7a133e97c1e9d93849.zip
-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
-rw-r--r--binfilter/bf_sc/source/filter/xml/XMLExportDDELinks.hxx5
-rw-r--r--binfilter/bf_sc/source/filter/xml/sc_XMLExportDDELinks.cxx61
2 files changed, 6 insertions, 60 deletions
diff --git a/binfilter/bf_sc/source/filter/xml/XMLExportDDELinks.hxx b/binfilter/bf_sc/source/filter/xml/XMLExportDDELinks.hxx
index f9eb72204..79f3a01bd 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 3bf9f1c1b..06ce94f53 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;
}
}