summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBartosz Kosiorek <gang65@poczta.onet.pl>2016-08-12 14:27:40 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2016-08-18 10:02:40 +0000
commitdd99a9fd72f73c9d7c1b9ac6754f3d17568af81b (patch)
treeef87e8b497b9570a5e15c8b768329f4318fdcab0
parente2d5eec6ad49bab6aac2295a1882bf75184aa50c (diff)
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 <ci@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
-rw-r--r--sc/source/filter/excel/xepage.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/sc/source/filter/excel/xepage.cxx b/sc/source/filter/excel/xepage.cxx
index 2895819d4ff9..31c17b6d251e 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"?