[ooo-build-commit] .: patches/dev300

Kohei Yoshida kohei at kemper.freedesktop.org
Mon Oct 4 13:38:12 PDT 2010


 patches/dev300/apply                                   |    3 
 patches/dev300/calc-perf-xlsx-import-string-cells.diff |  131 -----------------
 2 files changed, 134 deletions(-)

New commits:
commit 7f79a646414b2c3a34456945a02fc8a017ffb8ff
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Mon Oct 4 16:37:34 2010 -0400

    Removed calc-perf-xlsx-import-string-cells.diff; moved to git.

diff --git a/patches/dev300/apply b/patches/dev300/apply
index da407de..32ccfd7 100644
--- a/patches/dev300/apply
+++ b/patches/dev300/apply
@@ -2697,9 +2697,6 @@ calc-pdf-export-allow-filtered-range-filter.diff, n#585028, kohei
 # Fix handling of DB functions.
 calc-formula-db-function-fix.diff, n#594332, n#595713, kohei
 
-# Improve performance of string cell import.
-calc-perf-xlsx-import-string-cells.diff, n#594513, kohei
-
 # Fix poor performance on saving document with hidden rows.
 # #FIXME ooo330-m4: doesn't apply in m3f
 # FIXME ooo330-m3: does not apply: calc-perf-ods-export-hidden-rows.diff, deb#582785, kohei
diff --git a/patches/dev300/calc-perf-xlsx-import-string-cells.diff b/patches/dev300/calc-perf-xlsx-import-string-cells.diff
deleted file mode 100644
index 9b04d10..0000000
--- a/patches/dev300/calc-perf-xlsx-import-string-cells.diff
+++ /dev/null
@@ -1,131 +0,0 @@
----
- oox/inc/oox/xls/richstring.hxx      |    4 ++++
- oox/source/core/contexthandler2.cxx |   22 ++++++++++++----------
- oox/source/xls/richstring.cxx       |   24 ++++++++++++++++++++++++
- 3 files changed, 40 insertions(+), 10 deletions(-)
-
-diff --git oox/inc/oox/xls/richstring.hxx oox/inc/oox/xls/richstring.hxx
-index 0eda822..2e5a4da 100644
---- oox/inc/oox/xls/richstring.hxx
-+++ oox/inc/oox/xls/richstring.hxx
-@@ -76,6 +76,10 @@ public:
-                             const ::com::sun::star::uno::Reference< ::com::sun::star::text::XText >& rxText,
-                             sal_Int32 nXfId );
- 
-+    void                writeFontProperties(
-+        const ::com::sun::star::uno::Reference< ::com::sun::star::text::XText >& rxText,
-+        sal_Int32 nXfId ) const;
-+
- private:
-     ::rtl::OUString     maText;         /// Portion text.
-     FontRef             mxFont;         /// Embedded portion font, may be empty.
-diff --git oox/source/core/contexthandler2.cxx oox/source/core/contexthandler2.cxx
-index 5267c75..80b4cb2 100644
---- oox/source/core/contexthandler2.cxx
-+++ oox/source/core/contexthandler2.cxx
-@@ -44,12 +44,13 @@ namespace core {
- /** Information about a processed context element. */
- struct ContextInfo
- {
--    OUStringBuffer      maCurrChars;        /// Collected characters from context.
--    OUStringBuffer      maFinalChars;       /// Finalized (stipped) characters.
-+    OUString            maCurrChars;        /// Collected characters from context.
-+    OUString            maFinalChars;       /// Finalized (stipped) characters.
-     sal_Int32           mnElement;          /// The element identifier.
-     bool                mbTrimSpaces;       /// True = trims leading/trailing spaces from text data.
- 
-     explicit            ContextInfo();
-+                        ContextInfo( sal_Int32 nElement ) : mnElement( nElement ) {}
- };
- 
- ContextInfo::ContextInfo() :
-@@ -115,7 +116,7 @@ void ContextHandler2Helper::implCharacters( const OUString& rChars )
- {
-     // #i76091# collect characters until context ends
-     if( !mxContextStack->empty() )
--        mxContextStack->back().maCurrChars.append( rChars );
-+        mxContextStack->back().maCurrChars += rChars;
- }
- 
- void ContextHandler2Helper::implEndCurrentContext( sal_Int32 nElement )
-@@ -127,7 +128,7 @@ void ContextHandler2Helper::implEndCurrentContext( sal_Int32 nElement )
-         // #i76091# process collected characters
-         appendCollectedChars();
-         // finalize the current context and pop context info from stack
--        onEndElement( mxContextStack->back().maFinalChars.makeStringAndClear() );
-+        onEndElement( mxContextStack->back().maFinalChars );
-         popContextInfo();
-     }
- }
-@@ -157,10 +158,9 @@ void ContextHandler2Helper::implEndRecord( sal_Int32 nRecId )
- 
- ContextInfo& ContextHandler2Helper::pushContextInfo( sal_Int32 nElement )
- {
--    mxContextStack->resize( mxContextStack->size() + 1 );
--    ContextInfo& rInfo = mxContextStack->back();
--    rInfo.mnElement = nElement;
--    return rInfo;
-+    ContextInfo aInfo( nElement );
-+    mxContextStack->push_back( aInfo );
-+    return mxContextStack->back();
- }
- 
- void ContextHandler2Helper::popContextInfo()
-@@ -176,8 +176,10 @@ void ContextHandler2Helper::appendCollectedChars()
-     ContextInfo& rInfo = mxContextStack->back();
-     if( rInfo.maCurrChars.getLength() > 0 )
-     {
--        OUString aChars = rInfo.maCurrChars.makeStringAndClear();
--        rInfo.maFinalChars.append( (mbEnableTrimSpace && rInfo.mbTrimSpaces) ? aChars.trim() : aChars );
-+        OUString aChars( rInfo.maCurrChars );
-+
-+        rInfo.maCurrChars = OUString();
-+        rInfo.maFinalChars += ( (mbEnableTrimSpace && rInfo.mbTrimSpaces) ? aChars.trim() : aChars );
-     }
- }
- 
-diff --git oox/source/xls/richstring.cxx oox/source/xls/richstring.cxx
-index b76b351..44d16e6 100644
---- oox/source/xls/richstring.cxx
-+++ oox/source/xls/richstring.cxx
-@@ -103,6 +103,20 @@ void RichStringPortion::convert( const Reference< XText >& rxText, sal_Int32 nXf
-     }
- }
- 
-+void RichStringPortion::writeFontProperties( const Reference<XText>& rxText, sal_Int32 nXfId ) const
-+{
-+    PropertySet aPropSet(rxText);
-+
-+    if (mxFont.get())
-+        mxFont->writeToPropertySet(aPropSet, FONT_PROPTYPE_TEXT);
-+
-+    if (const Font* pFont = getStyles().getFontFromCellXf(nXfId).get())
-+    {
-+        if (pFont->needsRichTextFormat())
-+            pFont->writeToPropertySet(aPropSet, FONT_PROPTYPE_TEXT);
-+    }
-+}
-+
- // ----------------------------------------------------------------------------
- 
- void FontPortionModel::read( RecordInputStream& rStrm )
-@@ -499,6 +513,16 @@ OUString RichString::getPlainText() const
- 
- void RichString::convert( const Reference< XText >& rxText, sal_Int32 nXfId ) const
- {
-+    if (maFontPortions.size() == 1)
-+    {
-+        // Set text directly to the cell when the string has only one portion.
-+        // It's much faster this way.
-+        RichStringPortion& rPtn = *maFontPortions.front();
-+        rxText->setString(rPtn.getText());
-+        rPtn.writeFontProperties(rxText, nXfId);
-+        return;
-+    }
-+
-     for( PortionVec::const_iterator aIt = maFontPortions.begin(), aEnd = maFontPortions.end(); aIt != aEnd; ++aIt )
-     {
-         (*aIt)->convert( rxText, nXfId );
--- 
-1.7.0.1
-


More information about the ooo-build-commit mailing list