[Libreoffice-commits] core.git: 2 commits - sc/qa sc/source

Markus Mohrhard markus.mohrhard at googlemail.com
Thu Jul 28 19:20:53 UTC 2016


 sc/qa/unit/subsequent_export-test.cxx      |    5 +++++
 sc/source/filter/excel/xetable.cxx         |   27 ++++++++++++++++++++++++---
 sc/source/filter/inc/xetable.hxx           |    6 +++++-
 sc/source/filter/oox/worksheetfragment.cxx |    5 +++++
 4 files changed, 39 insertions(+), 4 deletions(-)

New commits:
commit 4b3484b1fce510e53eb8ee587616b107ad477511
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Thu Jul 28 16:57:10 2016 +0200

    use n prefix for numeric variable
    
    Change-Id: I70a7b10d46cdafc4dd59f8fc046587a6219a2218

diff --git a/sc/source/filter/excel/xetable.cxx b/sc/source/filter/excel/xetable.cxx
index d1b731e..69ef932 100644
--- a/sc/source/filter/excel/xetable.cxx
+++ b/sc/source/filter/excel/xetable.cxx
@@ -1670,7 +1670,7 @@ XclExpColinfoBuffer::XclExpColinfoBuffer( const XclExpRoot& rRoot ) :
     XclExpRoot( rRoot ),
     maDefcolwidth( rRoot ),
     maOutlineBfr( rRoot ),
-    maHighestOutlineLevel( 0 )
+    mnHighestOutlineLevel( 0 )
 {
 }
 
@@ -1680,9 +1680,9 @@ void XclExpColinfoBuffer::Initialize( SCROW nLastScRow )
     for( sal_uInt16 nScCol = 0, nLastScCol = GetMaxPos().Col(); nScCol <= nLastScCol; ++nScCol )
     {
         maColInfos.AppendNewRecord( new XclExpColinfo( GetRoot(), nScCol, nLastScRow, maOutlineBfr ) );
-        if( maOutlineBfr.GetLevel() > maHighestOutlineLevel )
+        if( maOutlineBfr.GetLevel() > mnHighestOutlineLevel )
         {
-           maHighestOutlineLevel = maOutlineBfr.GetLevel();
+           mnHighestOutlineLevel = maOutlineBfr.GetLevel();
         }
     }
 }
@@ -2102,7 +2102,7 @@ XclExpRowBuffer::XclExpRowBuffer( const XclExpRoot& rRoot ) :
     XclExpRoot( rRoot ),
     maOutlineBfr( rRoot ),
     maDimensions( rRoot ),
-    maHighestOutlineLevel( 0 )
+    mnHighestOutlineLevel( 0 )
 {
 }
 
@@ -2351,9 +2351,9 @@ XclExpRow& XclExpRowBuffer::GetOrCreateRow( sal_uInt32 nXclRow, bool bRowAlwaysE
                  ( maOutlineBfr.GetLevel() != 0 ) ||
                  ( rDoc.RowHidden(nFrom, nScTab) ) )
             {
-                if( maOutlineBfr.GetLevel() > maHighestOutlineLevel )
+                if( maOutlineBfr.GetLevel() > mnHighestOutlineLevel )
                 {
-                    maHighestOutlineLevel = maOutlineBfr.GetLevel();
+                    mnHighestOutlineLevel = maOutlineBfr.GetLevel();
                 }
                 RowRef p(new XclExpRow(GetRoot(), nFrom, maOutlineBfr, bRowAlwaysEmpty));
                 maRowMap.insert(RowMap::value_type(nFrom, p));
diff --git a/sc/source/filter/inc/xetable.hxx b/sc/source/filter/inc/xetable.hxx
index 25ad278..c932be2 100644
--- a/sc/source/filter/inc/xetable.hxx
+++ b/sc/source/filter/inc/xetable.hxx
@@ -770,7 +770,7 @@ public:
     /** Writes all COLINFO records of this buffer. */
     virtual void        Save( XclExpStream& rStrm ) override;
     virtual void        SaveXml( XclExpXmlStream& rStrm ) override;
-    sal_uInt8           GetHighestOutlineLevel() { return maHighestOutlineLevel; }
+    sal_uInt8           GetHighestOutlineLevel() { return mnHighestOutlineLevel; }
 
 private:
     typedef XclExpRecordList< XclExpColinfo >   XclExpColinfoList;
@@ -779,7 +779,7 @@ private:
     XclExpColinfoList   maColInfos;         /// List of COLINFO records.
     XclExpDefcolwidth   maDefcolwidth;      /// The DEFCOLWIDTH record.
     XclExpColOutlineBuffer maOutlineBfr;    /// Buffer for column outline groups.
-    sal_uInt8           maHighestOutlineLevel; /// Highest number of outline levels for columns in sheet.
+    sal_uInt8           mnHighestOutlineLevel; /// Highest number of outline levels for columns in sheet.
 };
 
 class XclExpRow;
@@ -931,7 +931,7 @@ public:
     virtual void        SaveXml( XclExpXmlStream& rStrm ) override;
 
     XclExpDimensions&   GetDimensions() { return maDimensions; }
-    sal_uInt8           GetHighestOutlineLevel() { return maHighestOutlineLevel; }
+    sal_uInt8           GetHighestOutlineLevel() { return mnHighestOutlineLevel; }
 
 private:
     /** Returns access to the specified ROW record. Inserts preceding missing ROW records.
@@ -946,7 +946,7 @@ private:
     RowMap              maRowMap;
     XclExpRowOutlineBuffer maOutlineBfr;    /// Buffer for row outline groups.
     XclExpDimensions    maDimensions;       /// DIMENSIONS record for used area.
-    sal_uInt8           maHighestOutlineLevel; /// Highest number of outline levels for rows in sheet.
+    sal_uInt8           mnHighestOutlineLevel; /// Highest number of outline levels for rows in sheet.
 };
 
 // Cell Table
commit ad121df71ad463bed8caf147d27f020b548f0862
Author: Bartosz Kosiorek <gang65 at poczta.onet.pl>
Date:   Tue Jul 26 18:14:30 2016 +0200

    tdf#101135 FILESAVE .xlsx Save XML_outlineLevelRow, XML_outlineLevelCol keys
    
    In .xlsx, the XML_outlineLevelRow and XML_outlineLevelCol keys
    are required for Microsoft Office365 application
    to properly displaying Outline values.
    
    Change-Id: If4184ddc4fbfaa409732ddb0fb4ca85b4a27b024

diff --git a/sc/qa/unit/subsequent_export-test.cxx b/sc/qa/unit/subsequent_export-test.cxx
index 3fca217..068d9e4e 100644
--- a/sc/qa/unit/subsequent_export-test.cxx
+++ b/sc/qa/unit/subsequent_export-test.cxx
@@ -490,6 +490,11 @@ void ScExportTest::testOutlineExportXLSX()
     xmlDocPtr pSheet = XPathHelper::parseExport(pXPathFile, m_xSFactory, "xl/worksheets/sheet1.xml");
     CPPUNIT_ASSERT(pSheet);
 
+    // Maximum Outline Row is 4 for this document
+    assertXPath(pSheet, "/x:worksheet/x:sheetFormatPr", "outlineLevelRow", "4");
+    // Maximum Outline Column is 4 for this document
+    assertXPath(pSheet, "/x:worksheet/x:sheetFormatPr", "outlineLevelCol", "4");
+
     // First XML node, creates two columns (from min=1 to max=2)
     assertXPath(pSheet, "/x:worksheet/x:cols/x:col[1]", "hidden", "false");
     assertXPath(pSheet, "/x:worksheet/x:cols/x:col[1]", "outlineLevel", "1");
diff --git a/sc/source/filter/excel/xetable.cxx b/sc/source/filter/excel/xetable.cxx
index b88021f..d1b731e 100644
--- a/sc/source/filter/excel/xetable.cxx
+++ b/sc/source/filter/excel/xetable.cxx
@@ -1669,7 +1669,8 @@ void XclExpColinfo::SaveXml( XclExpXmlStream& rStrm )
 XclExpColinfoBuffer::XclExpColinfoBuffer( const XclExpRoot& rRoot ) :
     XclExpRoot( rRoot ),
     maDefcolwidth( rRoot ),
-    maOutlineBfr( rRoot )
+    maOutlineBfr( rRoot ),
+    maHighestOutlineLevel( 0 )
 {
 }
 
@@ -1677,7 +1678,13 @@ void XclExpColinfoBuffer::Initialize( SCROW nLastScRow )
 {
 
     for( sal_uInt16 nScCol = 0, nLastScCol = GetMaxPos().Col(); nScCol <= nLastScCol; ++nScCol )
+    {
         maColInfos.AppendNewRecord( new XclExpColinfo( GetRoot(), nScCol, nLastScRow, maOutlineBfr ) );
+        if( maOutlineBfr.GetLevel() > maHighestOutlineLevel )
+        {
+           maHighestOutlineLevel = maOutlineBfr.GetLevel();
+        }
+    }
 }
 
 void XclExpColinfoBuffer::Finalize( ScfUInt16Vec& rXFIndexes )
@@ -2094,7 +2101,8 @@ void XclExpRow::SaveXml( XclExpXmlStream& rStrm )
 XclExpRowBuffer::XclExpRowBuffer( const XclExpRoot& rRoot ) :
     XclExpRoot( rRoot ),
     maOutlineBfr( rRoot ),
-    maDimensions( rRoot )
+    maDimensions( rRoot ),
+    maHighestOutlineLevel( 0 )
 {
 }
 
@@ -2343,6 +2351,10 @@ XclExpRow& XclExpRowBuffer::GetOrCreateRow( sal_uInt32 nXclRow, bool bRowAlwaysE
                  ( maOutlineBfr.GetLevel() != 0 ) ||
                  ( rDoc.RowHidden(nFrom, nScTab) ) )
             {
+                if( maOutlineBfr.GetLevel() > maHighestOutlineLevel )
+                {
+                    maHighestOutlineLevel = maOutlineBfr.GetLevel();
+                }
                 RowRef p(new XclExpRow(GetRoot(), nFrom, maOutlineBfr, bRowAlwaysEmpty));
                 maRowMap.insert(RowMap::value_type(nFrom, p));
             }
@@ -2627,7 +2639,16 @@ void XclExpCellTable::SaveXml( XclExpXmlStream& rStrm )
     XclExpDefaultRowData& rDefData = mxDefrowheight->GetDefaultData();
     sax_fastparser::FSHelperPtr& rWorksheet = rStrm.GetCurrentStream();
     rWorksheet->startElement( XML_sheetFormatPr,
-        XML_defaultRowHeight, OString::number( (double) rDefData.mnHeight / 20.0 ).getStr(), FSEND );
+        // OOXTODO: XML_baseColWidth
+        // OOXTODO: XML_defaultColWidth
+        // OOXTODO: XML_customHeight
+        // OOXTODO: XML_zeroHeight
+        // OOXTODO: XML_thickTop
+        // OOXTODO: XML_thickBottom
+        XML_defaultRowHeight, OString::number( static_cast< double> ( rDefData.mnHeight ) / 20.0 ).getStr(),
+        XML_outlineLevelRow, OString::number( maRowBfr.GetHighestOutlineLevel() ).getStr(),
+        XML_outlineLevelCol, OString::number( maColInfoBfr.GetHighestOutlineLevel() ).getStr(),
+        FSEND );
     rWorksheet->endElement( XML_sheetFormatPr );
 
     maColInfoBfr.SaveXml( rStrm );
diff --git a/sc/source/filter/inc/xetable.hxx b/sc/source/filter/inc/xetable.hxx
index e0f236a..25ad278 100644
--- a/sc/source/filter/inc/xetable.hxx
+++ b/sc/source/filter/inc/xetable.hxx
@@ -770,6 +770,7 @@ public:
     /** Writes all COLINFO records of this buffer. */
     virtual void        Save( XclExpStream& rStrm ) override;
     virtual void        SaveXml( XclExpXmlStream& rStrm ) override;
+    sal_uInt8           GetHighestOutlineLevel() { return maHighestOutlineLevel; }
 
 private:
     typedef XclExpRecordList< XclExpColinfo >   XclExpColinfoList;
@@ -778,6 +779,7 @@ private:
     XclExpColinfoList   maColInfos;         /// List of COLINFO records.
     XclExpDefcolwidth   maDefcolwidth;      /// The DEFCOLWIDTH record.
     XclExpColOutlineBuffer maOutlineBfr;    /// Buffer for column outline groups.
+    sal_uInt8           maHighestOutlineLevel; /// Highest number of outline levels for columns in sheet.
 };
 
 class XclExpRow;
@@ -928,7 +930,8 @@ public:
     virtual void        Save( XclExpStream& rStrm ) override;
     virtual void        SaveXml( XclExpXmlStream& rStrm ) override;
 
-    XclExpDimensions&   GetDimensions() { return maDimensions;}
+    XclExpDimensions&   GetDimensions() { return maDimensions; }
+    sal_uInt8           GetHighestOutlineLevel() { return maHighestOutlineLevel; }
 
 private:
     /** Returns access to the specified ROW record. Inserts preceding missing ROW records.
@@ -943,6 +946,7 @@ private:
     RowMap              maRowMap;
     XclExpRowOutlineBuffer maOutlineBfr;    /// Buffer for row outline groups.
     XclExpDimensions    maDimensions;       /// DIMENSIONS record for used area.
+    sal_uInt8           maHighestOutlineLevel; /// Highest number of outline levels for rows in sheet.
 };
 
 // Cell Table
diff --git a/sc/source/filter/oox/worksheetfragment.cxx b/sc/source/filter/oox/worksheetfragment.cxx
index 7984ae6..ad9837a 100644
--- a/sc/source/filter/oox/worksheetfragment.cxx
+++ b/sc/source/filter/oox/worksheetfragment.cxx
@@ -518,6 +518,11 @@ void WorksheetFragment::importSheetFormatPr( const AttributeList& rAttribs )
     setBaseColumnWidth( rAttribs.getInteger( XML_baseColWidth, 8 ) );
     setDefaultColumnWidth( rAttribs.getDouble( XML_defaultColWidth, 0.0 ) );
     // default row settings
+
+    // We don't need to import:
+    // XML_outlineLevelRow
+    // XML_outlineLevelCol
+    // as it will be updated during export to OOXML
     setDefaultRowSettings(
         rAttribs.getDouble( XML_defaultRowHeight, 0.0 ),
         rAttribs.getBool( XML_customHeight, false ),


More information about the Libreoffice-commits mailing list