[Libreoffice-commits] core.git: 3 commits - oox/source sc/source

Markus Mohrhard markus.mohrhard at collabora.co.uk
Mon Feb 17 16:45:03 CET 2014


 oox/source/export/vmlexport.cxx     |    5 +++++
 sc/source/filter/excel/xeescher.cxx |    5 ++++-
 sc/source/filter/excel/xepivot.cxx  |   11 ++++++-----
 sc/source/filter/inc/xepivot.hxx    |    3 ++-
 4 files changed, 17 insertions(+), 7 deletions(-)

New commits:
commit cd03b4ac54076b5471bfdddd8b3154ecb6b4e7cc
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date:   Mon Feb 17 05:39:07 2014 +0100

    fix invalid string access, related #i83611#
    
    Change-Id: I5954f78e10d99a064f83e96282c28c086c7f07f1

diff --git a/sc/source/filter/excel/xeescher.cxx b/sc/source/filter/excel/xeescher.cxx
index 4a9fb82..67ac325 100644
--- a/sc/source/filter/excel/xeescher.cxx
+++ b/sc/source/filter/excel/xeescher.cxx
@@ -691,7 +691,10 @@ XclExpTbxControlObj::XclExpTbxControlObj( XclExpObjectManager& rRoot, Reference<
     //Export description as alt text
     if( SdrObject* pSdrObj = SdrObject::getSdrObjectFromXShape( xShape ) )
     {
-        OUString  aAltTxt = pSdrObj->GetDescription().copy( 0, MSPROP_DESCRIPTION_MAX_LEN );
+        OUString aAltTxt;
+        OUString aDescrText = pSdrObj->GetDescription();
+        if(!aDescrText.isEmpty())
+            aAltTxt = aDescrText.copy( 0, std::min<sal_Int32>(MSPROP_DESCRIPTION_MAX_LEN, aDescrText.getLength()) );
         aPropOpt.AddOpt( ESCHER_Prop_wzDescription, aAltTxt );
     }
 
commit 8a5c8c251fe42f639b029f72244326cdc1b3bb7b
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date:   Sun Feb 16 22:07:20 2014 +0100

    multiple pivot tables on same sheet OOXML fix (part1), related #i83250#
    
    This just fixes the generation of the pivot table file and the
    relationship. It crashed in a dbgutil build because we tried to
    overwrite the same stream for each pivot table on one sheet.
    
    Change-Id: If2c9541e38b483ead75fff32d5f6d9e16970e702

diff --git a/sc/source/filter/excel/xepivot.cxx b/sc/source/filter/excel/xepivot.cxx
index e03cbf1..a0a00d6 100644
--- a/sc/source/filter/excel/xepivot.cxx
+++ b/sc/source/filter/excel/xepivot.cxx
@@ -1243,13 +1243,14 @@ void XclExpPTField::WriteSxvdex( XclExpStream& rStrm ) const
 
 // ============================================================================
 
-XclExpPivotTable::XclExpPivotTable( const XclExpRoot& rRoot, const ScDPObject& rDPObj, const XclExpPivotCache& rPCache ) :
+XclExpPivotTable::XclExpPivotTable( const XclExpRoot& rRoot, const ScDPObject& rDPObj, const XclExpPivotCache& rPCache, size_t nId ) :
     XclExpRoot( rRoot ),
     mrPCache( rPCache ),
     maDataOrientField( *this, EXC_SXIVD_DATA ),
     mnOutScTab( 0 ),
     mbValid( false ),
-    mbFilterBtn( false )
+    mbFilterBtn( false ),
+    mnId( nId )
 {
     const ScRange& rOutScRange = rDPObj.GetOutRange();
     if( GetAddressConverter().ConvertRange( maPTInfo.maOutXclRange, rOutScRange, true ) )
@@ -1352,8 +1353,8 @@ void XclExpPivotTable::SaveXml( XclExpXmlStream& rStrm )
     if( !mbValid )
         return;
     sax_fastparser::FSHelperPtr aPivotTableDefinition = rStrm.CreateOutputStream(
-            XclXmlUtils::GetStreamName( "xl/", "pivotTables/pivotTable", mnOutScTab+1),
-            XclXmlUtils::GetStreamName( "../", "pivotTables/pivotTable", mnOutScTab+1),
+            XclXmlUtils::GetStreamName( "xl/", "pivotTables/pivotTable", mnId + 1),
+            XclXmlUtils::GetStreamName( "../", "pivotTables/pivotTable", mnId + 1),
             rStrm.GetCurrentStream()->getOutputStream(),
             "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotTable+xml",
             "http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotTable");
@@ -1849,7 +1850,7 @@ void XclExpPivotTableManager::CreatePivotTables()
         for( size_t nDPObj = 0, nCount = pDPColl->GetCount(); nDPObj < nCount; ++nDPObj )
             if( ScDPObject* pDPObj = (*pDPColl)[ nDPObj ] )
                 if( const XclExpPivotCache* pPCache = CreatePivotCache( *pDPObj ) )
-                    maPTableList.AppendNewRecord( new XclExpPivotTable( GetRoot(), *pDPObj, *pPCache ) );
+                    maPTableList.AppendNewRecord( new XclExpPivotTable( GetRoot(), *pDPObj, *pPCache, nDPObj ) );
 }
 
 XclExpRecordRef XclExpPivotTableManager::CreatePivotCachesRecord()
diff --git a/sc/source/filter/inc/xepivot.hxx b/sc/source/filter/inc/xepivot.hxx
index efcbbab..6f5a9a4 100644
--- a/sc/source/filter/inc/xepivot.hxx
+++ b/sc/source/filter/inc/xepivot.hxx
@@ -344,7 +344,7 @@ class XclExpPivotTable : public XclExpRecordBase, protected XclExpRoot
 {
 public:
     explicit            XclExpPivotTable( const XclExpRoot& rRoot,
-                            const ScDPObject& rDPObj, const XclExpPivotCache& rPCache );
+                            const ScDPObject& rDPObj, const XclExpPivotCache& rPCache, size_t nId );
 
     /** Returns a pivot cache field. */
     const XclExpPCField* GetCacheField( sal_uInt16 nCacheIdx ) const;
@@ -422,6 +422,7 @@ private:
     SCTAB               mnOutScTab;         /// Sheet index of the output range.
     bool                mbValid;            /// true = The pivot table is valid for export.
     bool                mbFilterBtn;        /// true = DataPilot has filter button.
+    size_t              mnId;               /// Stream ID
 };
 
 // ============================================================================
commit 5ecf769266623817fa4744e022a9518120fe5072
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date:   Sun Feb 16 21:20:53 2014 +0100

    prevent invalid ooxml files during notes export, related #i83060#
    
    Change-Id: I151c14cd75477445465e0221271f9bf17385af9f

diff --git a/oox/source/export/vmlexport.cxx b/oox/source/export/vmlexport.cxx
index c0acded..0c35c45 100644
--- a/oox/source/export/vmlexport.cxx
+++ b/oox/source/export/vmlexport.cxx
@@ -1034,6 +1034,11 @@ sal_Int32 VMLExport::StartShape()
         // start of the shape
         m_pSerializer->startElementNS( XML_v, nShapeElement, XFastAttributeListRef( m_pShapeAttrList ) );
     }
+    else
+    {
+        // start of the shape
+        m_pSerializer->startElementNS( XML_v, nShapeElement, XFastAttributeListRef( m_pShapeAttrList ) );
+    }
 
     // now check if we have some text and we have a text exporter registered
     const SdrTextObj* pTxtObj = PTR_CAST(SdrTextObj, m_pSdrObject);


More information about the Libreoffice-commits mailing list