summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKohei Yoshida <kyoshida@novell.com>2010-11-24 21:54:27 -0500
committerKohei Yoshida <kyoshida@novell.com>2010-11-24 21:54:27 -0500
commit788a418aaa494b03975f7738225aaf306b11ce37 (patch)
tree84a63be5917b73fdf70448e2b82712478f000f14
parentf4169cc6cc22b25f26989247d425bebd0f7ab3cf (diff)
Move typedef for private members into their respective class scope.
-rw-r--r--sc/source/filter/xml/XMLStylesExportHelper.hxx20
-rw-r--r--sc/source/filter/xml/xmlexprt.cxx45
2 files changed, 53 insertions, 12 deletions
diff --git a/sc/source/filter/xml/XMLStylesExportHelper.hxx b/sc/source/filter/xml/XMLStylesExportHelper.hxx
index a1070b2c1..69ad34059 100644
--- a/sc/source/filter/xml/XMLStylesExportHelper.hxx
+++ b/sc/source/filter/xml/XMLStylesExportHelper.hxx
@@ -156,10 +156,9 @@ struct ScMyRowFormatRange
sal_Bool operator<(const ScMyRowFormatRange& rRange) const;
};
-typedef std::list<ScMyRowFormatRange> ScMyRowFormatRangesList;
-
class ScRowFormatRanges
{
+ typedef std::list<ScMyRowFormatRange> ScMyRowFormatRangesList;
ScMyRowFormatRangesList aRowFormatRanges;
const ScMyDefaultStyleList* pRowDefaults;
const ScMyDefaultStyleList* pColDefaults;
@@ -197,11 +196,11 @@ struct ScMyFormatRange
sal_Bool operator< (const ScMyFormatRange& rRange) const;
};
-typedef std::list<ScMyFormatRange> ScMyFormatRangeAddresses;
-typedef std::vector<ScMyFormatRangeAddresses*> ScMyFormatRangeListVec;
-
class ScFormatRangeStyles
{
+ typedef std::list<ScMyFormatRange> ScMyFormatRangeAddresses;
+ typedef std::vector<ScMyFormatRangeAddresses*> ScMyFormatRangeListVec;
+
ScMyFormatRangeListVec aTables;
ScMyOUStringVec aStyleNames;
ScMyOUStringVec aAutoStyleNames;
@@ -254,12 +253,10 @@ struct ScColumnStyle
ScColumnStyle() : nIndex(-1), bIsVisible(sal_True) {}
};
-
-typedef std::vector<ScColumnStyle> ScMyColumnStyleVec;
-typedef std::vector<ScMyColumnStyleVec> ScMyColumnVectorVec;
-
class ScColumnStyles : public ScColumnRowStylesBase
{
+ typedef std::vector<ScColumnStyle> ScMyColumnStyleVec;
+ typedef std::vector<ScMyColumnStyleVec> ScMyColumnVectorVec;
ScMyColumnVectorVec aTables;
public:
@@ -273,11 +270,10 @@ public:
virtual rtl::OUString* GetStyleName(const sal_Int32 nTable, const sal_Int32 nField);
};
-typedef std::vector<sal_Int32> ScMysalInt32Vec;
-typedef std::vector<ScMysalInt32Vec> ScMyRowVectorVec;
-
class ScRowStyles : public ScColumnRowStylesBase
{
+ typedef std::vector<sal_Int32> ScMysalInt32Vec;
+ typedef std::vector<ScMysalInt32Vec> ScMyRowVectorVec;
ScMyRowVectorVec aTables;
public:
diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx
index 613fa45fd..e9326fffa 100644
--- a/sc/source/filter/xml/xmlexprt.cxx
+++ b/sc/source/filter/xml/xmlexprt.cxx
@@ -170,6 +170,48 @@ using ::rtl::OUStringBuffer;
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::UNO_QUERY;
+#include <stdio.h>
+#include <string>
+#include <sys/time.h>
+
+namespace {
+
+class StackPrinter
+{
+public:
+ explicit StackPrinter(const char* msg) :
+ msMsg(msg)
+ {
+ fprintf(stdout, "%s: --begin\n", msMsg.c_str());
+ mfStartTime = getTime();
+ }
+
+ ~StackPrinter()
+ {
+ double fEndTime = getTime();
+ fprintf(stdout, "%s: --end (duration: %g sec)\n", msMsg.c_str(), (fEndTime-mfStartTime));
+ }
+
+ void printTime(int line) const
+ {
+ double fEndTime = getTime();
+ fprintf(stdout, "%s: --(%d) (duration: %g sec)\n", msMsg.c_str(), line, (fEndTime-mfStartTime));
+ }
+
+private:
+ double getTime() const
+ {
+ timeval tv;
+ gettimeofday(&tv, NULL);
+ return tv.tv_sec + tv.tv_usec / 1000000.0;
+ }
+
+ ::std::string msMsg;
+ double mfStartTime;
+};
+
+}
+
//----------------------------------------------------------------------------
namespace
@@ -2242,6 +2284,8 @@ void ScXMLExport::_ExportAutoStyles()
if (getExportFlags() & EXPORT_CONTENT)
{
+ StackPrinter __stack_printer__("ScXMLExport::_ExportAutoStyles");
+
// re-create automatic styles with old names from stored data
ScSheetSaveData* pSheetData = ScModelObj::getImplementation(xSpreadDoc)->GetSheetSaveData();
if (pSheetData && pDoc)
@@ -2519,6 +2563,7 @@ void ScXMLExport::_ExportAutoStyles()
CollectShapesAutoStyles(nTableCount);
for (sal_Int32 nTable = 0; nTable < nTableCount; ++nTable, IncrementProgressBar(sal_False))
{
+ fprintf(stdout, "ScXMLExport::_ExportAutoStyles: table = %ld\n", nTable);
bool bUseStream = pSheetData && pDoc && pDoc->IsStreamValid((SCTAB)nTable) &&
pSheetData->HasStreamPos(nTable) && xSourceStream.is();