From 78c5cbc720993e9cc01fceadd73678ed1a45d37f Mon Sep 17 00:00:00 2001 From: Pallavi Jadhav Date: Mon, 3 Feb 2014 18:55:13 +0530 Subject: [PATCH] fdo#74153 : Preservation of Column Break with column_count = 0 Issue : 1] DOCX containing column break with column_count = 0 was not getting preserved after RT. 2] LO was writing column break only when column_count > 1 Implementation : 1] Removed check column_count > 1. So that if LO encounters a column break with column_count >=0, it should preserve it. 2] Added export Unit Test case. Behavior after Fix : LO is able to preserve Column Break with column_count = 0. Conflicts: sw/qa/extras/ooxmlexport/ooxmlexport.cxx Reviewed on: https://gerrit.libreoffice.org/7815 Change-Id: I29c77f27184ec5afed354be01fc68e0d3471bfee --- sw/qa/extras/ooxmlexport/data/fdo74153.docx | Bin 0 -> 11506 bytes sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 11 +++++++++++ sw/source/filter/ww8/ww8atr.cxx | 5 +---- 3 files changed, 12 insertions(+), 4 deletions(-) create mode 100644 sw/qa/extras/ooxmlexport/data/fdo74153.docx diff --git a/sw/qa/extras/ooxmlexport/data/fdo74153.docx b/sw/qa/extras/ooxmlexport/data/fdo74153.docx new file mode 100644 index 0000000000000000000000000000000000000000..4cbdd7bba94e01c0bbfba2e359b132c5dd07c0ee GIT binary patch literal 11506 zcmeHt1zTLpvi9H>+&#Fv2ZBRzf;++8ncy1S8Qh%^Ja`BY+}+&+1b4SP+2`!LvvcdDdD_%Ui2wO;uOd+x1o!3K|Ol3xEdz0AzsGf(aXK2ms(E3;=)$fQQr(v$q49 z+5z9Gx;vOU>oL38+PutzhNR5_K!V5rxBMUe0<{T)b{(u}64!}$sGtTlqaS%C^pFvP zNlePSaCn}O>W^`~%}?JjA(hl1K!`TvR2s zi}$uSPyoR5GZf(M-%OGOM9^>y)-wgL#UX)B@|}~ZjWY}L&-;H(@&B;>{qobx;@Yh` zSzibr2RsIhw_OD&BMX#NXua^&RNYqJqpatLF(-qz8RdDj34uG&X9b+ zmY{b+kfeqj-hwc5tKX?}-|Pl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s?8P<-pFPV$&lK)W9qb6&sd`~zn-zF1Pnv|iu zSyHG_>^QAlH1)-*pNR_$jVI7xs*^qx;%h?C|9^Iau?qzxZo)1`4~1Znnc#s`4PX() z@>aTaQ`CRT;rp}mkC(*h{H?Q2`nMTGTUkETUP8$Q+xo`J`SSW|Ii3?QMZuZno$*VR zM)+L?@QmMu#L0c$m45q3sa7}d^5v_6X1xWJp~|{)1Gf5V)_04NJDjOYV}UFFx9@lk zZc0=aLBnWM*%iS+XS&*lr5V%F5uY8iKK?r!s$HUdWiAakA$7|yr6FI1IJBNDlAm^{ z!#LN9@7hbMi^e$^l)+F9V+dGdFUfmSZcpIGiMe8F4gf5m$ckW63#=bw{9e}*={ zmVZbUeJlHS0e??r`xP7yJ|XxevF&%@-*bF^1=fHMtp9%*Kfg=*J@4Z$S-ap2*#F1^ z`5pfI8TnuE2XLJ62mJRF^WR1MejxIf2xTy9`mYe>7oO~Q`0p(1UvL4Of5ZRAx&Ds- zotyg$FNybW{BKO%?-Kq_QT>Gn0Q~U*fZqwL-_d`k4Sq#45dDJwlSKF({(DIGmw*wH dKfm7p26%5}VZiF~Gi?$H&<>_42 was missing after roundtrip + */ + xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + if (!pXmlDoc) + return; + assertXPath(pXmlDoc, "/w:document/w:body/w:p[3]/w:r[1]/w:br","type","column"); +} + #endif CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx index fb261f989bb7..a6f711e94227 100644 --- a/sw/source/filter/ww8/ww8atr.cxx +++ b/sw/source/filter/ww8/ww8atr.cxx @@ -3627,10 +3627,7 @@ void AttributeOutputBase::FormatBreak( const SvxFmtBreakItem& rBreak ) // no break; case SVX_BREAK_COLUMN_AFTER: case SVX_BREAK_COLUMN_BOTH: - if ( GetExport().Sections().CurrentNumberOfColumns( *GetExport().pDoc ) > 1 ) - { - nC = msword::ColumnBreak; - } + nC = msword::ColumnBreak; break; case SVX_BREAK_PAGE_BEFORE: // PageBreak