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

Markus Mohrhard markus.mohrhard at googlemail.com
Sat Nov 30 07:45:46 PST 2013


 sc/source/filter/excel/excdoc.cxx   |   14 +++++++++-----
 sc/source/filter/excel/excrecds.cxx |    2 +-
 sc/source/filter/excel/xestyle.cxx  |   12 ++++++------
 3 files changed, 16 insertions(+), 12 deletions(-)

New commits:
commit 9a339aedc84d75b7a5e0c2ec2ece0ba9bc344086
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sat Nov 30 18:40:39 2013 +0100

    make the validation tool happy
    
    This is just fucking awesome. The MSO implementers notes mention this
    attribute and point to some extended information that is either missing
    or does not mention this attribute. To make it more funny the MSO
    validation complains about invalid values in this attribute for our
    export.
    
    Change-Id: Iacf1a6666f9f6124106952ae19ae5d5866bc8cf1

diff --git a/sc/source/filter/excel/excrecds.cxx b/sc/source/filter/excel/excrecds.cxx
index 01b2432a..9be9bfe 100644
--- a/sc/source/filter/excel/excrecds.cxx
+++ b/sc/source/filter/excel/excrecds.cxx
@@ -519,7 +519,7 @@ void XclExpSheetProtection::SaveXml( XclExpXmlStream& rStrm )
         sax_fastparser::FSHelperPtr& rWorksheet = rStrm.GetCurrentStream();
         rWorksheet->singleElement( XML_sheetProtection,
             XML_sheet,  XclXmlUtils::ToPsz( true ),
-            XML_password, sHash.getStr(),
+            XML_password, sHash.isEmpty()? NULL : sHash.getStr(),
             XML_objects, pTabProtect->isOptionEnabled( ScTableProtection::OBJECTS ) ? NULL : XclXmlUtils::ToPsz( true ),
             XML_scenarios, pTabProtect->isOptionEnabled( ScTableProtection::SCENARIOS ) ? NULL : XclXmlUtils::ToPsz( true ),
             XML_formatCells, pTabProtect->isOptionEnabled( ScTableProtection::FORMAT_CELLS ) ? XclXmlUtils::ToPsz( false ) : NULL,
commit e361f6b81b09919c77995a85250c70b099389915
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sat Nov 30 18:19:40 2013 +0100

    more OOXML export validation fixes, fdo#71971
    
    Change-Id: Ic322d58817986887bbcd666ac3abc416609adf5c

diff --git a/sc/source/filter/excel/excdoc.cxx b/sc/source/filter/excel/excdoc.cxx
index 574dcbb..a8bfbf7 100644
--- a/sc/source/filter/excel/excdoc.cxx
+++ b/sc/source/filter/excel/excdoc.cxx
@@ -561,6 +561,7 @@ void ExcTable::FillAsXmlTable( SCTAB nCodeNameIdx )
     aRecList.AppendRecord( mxCellTable );
 
     // label ranges
+    // missing SaveXML
     Add( new XclExpLabelranges( GetRoot() ) );
 
     // DFF not needed in MSOOXML export
@@ -572,15 +573,23 @@ void ExcTable::FillAsXmlTable( SCTAB nCodeNameIdx )
 //    Add( rR.pObjRecs );
 
     // pivot tables
+    // not in the worksheet file
     aRecList.AppendRecord( GetPivotTableManager().CreatePivotTablesRecord( mnScTab ) );
 
     // list of NOTE records, generated by the cell table
+    // not in the worksheet file
     if( mxNoteList != 0 && !mxNoteList->IsEmpty() )
         aRecList.AppendNewRecord( new XclExpComments( mnScTab, *mxNoteList ) );
 
     // web queries
+    // missing SaveXML implementation
     Add( new XclExpWebQueryBuffer( GetRoot() ) );
 
+    ScDocument& rDoc = GetDoc();
+    const ScTableProtection* pTabProtect = rDoc.GetTabProtection(mnScTab);
+    if (pTabProtect && pTabProtect->isProtected())
+        Add( new XclExpSheetProtection(true, mnScTab) );
+
     lcl_AddScenariosAndFilters( aRecList, GetRoot(), mnScTab );
 
     // MERGEDCELLS record, generated by the cell table
@@ -589,11 +598,6 @@ void ExcTable::FillAsXmlTable( SCTAB nCodeNameIdx )
     // conditional formats
     Add( new XclExpCondFormatBuffer( GetRoot(), xExtLst ) );
 
-    ScDocument& rDoc = GetDoc();
-    const ScTableProtection* pTabProtect = rDoc.GetTabProtection(mnScTab);
-    if (pTabProtect && pTabProtect->isProtected())
-        Add( new XclExpSheetProtection(true, mnScTab) );
-
     if( HasVbaStorage() )
         if( nCodeNameIdx < GetExtDocOptions().GetCodeNameCount() )
             Add( new XclCodename( GetExtDocOptions().GetCodeName( nCodeNameIdx ) ) );
commit 7415fc31f5cdf7ff3f78dd304b9576b931a82aeb
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sat Nov 30 06:50:50 2013 +0100

    write valid dxf record, related fdo#71971
    
    Change-Id: I99f4dfca78cc0fd5d9b947000a99f8414c2a899b

diff --git a/sc/source/filter/excel/xestyle.cxx b/sc/source/filter/excel/xestyle.cxx
index 0769ea3..59603eb 100644
--- a/sc/source/filter/excel/xestyle.cxx
+++ b/sc/source/filter/excel/xestyle.cxx
@@ -3021,18 +3021,18 @@ void XclExpDxf::SaveXml( XclExpXmlStream& rStrm )
     sax_fastparser::FSHelperPtr& rStyleSheet = rStrm.GetCurrentStream();
     rStyleSheet->startElement( XML_dxf, FSEND );
 
-    if (mpAlign)
-        mpAlign->SaveXml(rStrm);
-    if (mpBorder)
-        mpBorder->SaveXml(rStrm);
     if (mpFont)
         mpFont->SaveXml(rStrm);
     if (mpNumberFmt)
         mpNumberFmt->SaveXml(rStrm);
-    if (mpProt)
-        mpProt->SaveXml(rStrm);
     if (mpColor)
         mpColor->SaveXml(rStrm);
+    if (mpAlign)
+        mpAlign->SaveXml(rStrm);
+    if (mpBorder)
+        mpBorder->SaveXml(rStrm);
+    if (mpProt)
+        mpProt->SaveXml(rStrm);
     rStyleSheet->endElement( XML_dxf );
 }
 


More information about the Libreoffice-commits mailing list