sc/source/filter/excel/xepage.cxx |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit dd99a9fd72f73c9d7c1b9ac6754f3d17568af81b
Author: Bartosz Kosiorek <gan...@poczta.onet.pl>
Date:   Fri Aug 12 14:27:40 2016 +0200

    tdf#48767 Fix orientation issue after export to .xlsx (lo-5-2)
    
    After save to .xlsx in usePrinterDefaults was added into PageSetup.
    Due to bug in MS Excel, when usePrinterDefaults is present,
    (no matter what value), the orientation of the Page is alway "portrait".
    To resolve that issue, if usePrinterDefaults is set to default value,
    then usePrinterDefaults XML field is not added during export to .xlsx
    
    Change-Id: Ie165420420fb4bc42048c4ed90413ebf69d4152e
    Reviewed-on: https://gerrit.libreoffice.org/28084
    Tested-by: Jenkins <c...@libreoffice.org>
    Reviewed-by: Markus Mohrhard <markus.mohrh...@googlemail.com>

diff --git a/sc/source/filter/excel/xepage.cxx 
b/sc/source/filter/excel/xepage.cxx
index 2895819..31c17b6 100644
--- a/sc/source/filter/excel/xepage.cxx
+++ b/sc/source/filter/excel/xepage.cxx
@@ -102,7 +102,10 @@ void XclExpSetup::SaveXml( XclExpXmlStream& rStrm )
     pAttrList->add( XML_fitToHeight,        OString::number(  
mrData.mnFitToHeight ).getStr() );
     pAttrList->add( XML_pageOrder,          mrData.mbPrintInRows ? 
"overThenDown" : "downThenOver" );
     pAttrList->add( XML_orientation,        mrData.mbPortrait ? "portrait" : 
"landscape" );   // OOXTODO: "default"?
-    pAttrList->add( XML_usePrinterDefaults, XclXmlUtils::ToPsz( 
!mrData.mbValid ) );
+    // tdf#48767 if XML_usePrinterDefaults field is exist, then 
XML_orientation is always "portrait" in MS Excel
+    // To resolve that import issue, if XML_usePrinterDefaults has default 
value (false) then XML_usePrinterDefaults is not added.
+    if ( !mrData.mbValid )
+        pAttrList->add( XML_usePrinterDefaults, XclXmlUtils::ToPsz( 
!mrData.mbValid ) );
     pAttrList->add( XML_blackAndWhite,      XclXmlUtils::ToPsz( 
mrData.mbBlackWhite ) );
     pAttrList->add( XML_draft,              XclXmlUtils::ToPsz( 
mrData.mbDraftQuality ) );
     pAttrList->add( XML_cellComments,       mrData.mbPrintNotes ? "atEnd" : 
"none" );         // OOXTODO: "asDisplayed"?
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to