[Libreoffice-commits] .: sc/source

Kohei Yoshida kohei at kemper.freedesktop.org
Wed Nov 24 18:55:09 PST 2010


 sc/source/filter/xml/XMLStylesExportHelper.hxx |   20 ++++-------
 sc/source/filter/xml/xmlexprt.cxx              |   45 +++++++++++++++++++++++++
 2 files changed, 53 insertions(+), 12 deletions(-)

New commits:
commit 788a418aaa494b03975f7738225aaf306b11ce37
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Wed Nov 24 21:54:27 2010 -0500

    Move typedef for private members into their respective class scope.

diff --git a/sc/source/filter/xml/XMLStylesExportHelper.hxx b/sc/source/filter/xml/XMLStylesExportHelper.hxx
index a1070b2..69ad340 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 613fa45..e9326ff 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();
 


More information about the Libreoffice-commits mailing list