diff options
author | Noel Grandin <noel@peralex.com> | 2015-08-11 15:02:05 +0200 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-08-13 10:04:09 +0000 |
commit | 8f1d6909f519526312d9c9384b715a4db730eafc (patch) | |
tree | 4634461d163d53484f3b35b4b56d5771f2ef5f11 | |
parent | 6071bab93bae55cf037d1c31c63879cab66ad0d9 (diff) |
tdf#92885 - Incorrect cell border drawing in DOC file after saving in 5.0
caused by commit 4b66829390b286010b37b37ec1537a320d8cea8f
"convert BOX_LINE and BOXINFO_LINE to enum class"
(cherry picked from commit 78446df26f45e2a71187873726388c9d2f6ba6e5)
Conflicts:
sw/source/filter/ww8/wrtww8gr.cxx
Change-Id: I23eb359a40035dd40bdb60703de567b1c328e793
Reviewed-on: https://gerrit.libreoffice.org/17691
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | sd/source/ui/table/TableDesignPane.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/wrtww8gr.cxx | 16 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8atr.cxx | 8 |
3 files changed, 17 insertions, 9 deletions
diff --git a/sd/source/ui/table/TableDesignPane.cxx b/sd/source/ui/table/TableDesignPane.cxx index aac2f0f4add7..206a08bb0993 100644 --- a/sd/source/ui/table/TableDesignPane.cxx +++ b/sd/source/ui/table/TableDesignPane.cxx @@ -710,7 +710,7 @@ const Bitmap CreateDesignPreview( const Reference< XIndexAccess >& xTableStyle, boost::shared_ptr< CellInfo > xBorderInfo( aMatrix[nBorderCol][nBorderRow] ); if( xBorderInfo.get() ) { - const ::editeng::SvxBorderLine* pBorderLine2 = xBorderInfo->maBorder.GetLine(static_cast<SvxBoxItemLine>(static_cast<int>(nLine)^1^1)); + const ::editeng::SvxBorderLine* pBorderLine2 = xBorderInfo->maBorder.GetLine(static_cast<SvxBoxItemLine>(static_cast<int>(nLine)^1)); if( pBorderLine2 && pBorderLine2->HasPriority(*pBorderLine) ) continue; // other border line wins } diff --git a/sw/source/filter/ww8/wrtww8gr.cxx b/sw/source/filter/ww8/wrtww8gr.cxx index dcd32771a12b..f7b31e654b51 100644 --- a/sw/source/filter/ww8/wrtww8gr.cxx +++ b/sw/source/filter/ww8/wrtww8gr.cxx @@ -570,14 +570,16 @@ void SwWW8WrGrf::WritePICFHeader(SvStream& rStrm, const sw::Frame &rFly, (pSI->GetWidth() != 0); } - for( SvxBoxItemLine i : o3tl::enumrange<SvxBoxItemLine>() ) + static const SvxBoxItemLine aLnArr[4] = { SvxBoxItemLine::TOP, SvxBoxItemLine::LEFT, + SvxBoxItemLine::BOTTOM, SvxBoxItemLine::RIGHT }; + for( sal_uInt8 i = 0; i < 4; ++i ) { - const ::editeng::SvxBorderLine* pLn = pBox->GetLine( i ); + const ::editeng::SvxBorderLine* pLn = pBox->GetLine( aLnArr[i] ); WW8_BRC aBrc; if (pLn) { WW8_BRCVer9 aBrc90 = rWrt.TranslateBorderLine( *pLn, - pBox->GetDistance( i ), bShadow ); + pBox->GetDistance( aLnArr[i] ), bShadow ); sal_uInt8 ico = msfilter::util::TransColToIco(msfilter::util::BGRToRGB( aBrc90.cv())); aBrc = WW8_BRC(aBrc90.dptLineWidth(), aBrc90.brcType(), ico, @@ -588,7 +590,7 @@ void SwWW8WrGrf::WritePICFHeader(SvStream& rStrm, const sw::Frame &rFly, // border will really be in word and adjust accordingly short nSpacing; short nThick = aBrc.DetermineBorderProperties(&nSpacing); - switch (i) + switch (aLnArr[i]) { case SvxBoxItemLine::TOP: case SvxBoxItemLine::BOTTOM: @@ -758,13 +760,15 @@ void SwWW8WrGrf::WritePICBulletFHeader(SvStream& rStrm, const Graphic &rGrf, sal_uInt8* pArr = aArr + 0x2E; //Do borders first - for( SvxBoxItemLine i : o3tl::enumrange<SvxBoxItemLine>() ) + static const SvxBoxItemLine aLnArr[4] = { SvxBoxItemLine::TOP, SvxBoxItemLine::LEFT, + SvxBoxItemLine::BOTTOM, SvxBoxItemLine::RIGHT }; + for( sal_uInt8 i = 0; i < 4; ++i ) { WW8_BRC aBrc; short nSpacing; short nThick = aBrc.DetermineBorderProperties(&nSpacing); - switch (i) + switch (aLnArr[i]) { case SvxBoxItemLine::TOP: case SvxBoxItemLine::BOTTOM: diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx index c5354b71ca5e..3ac52bb10eac 100644 --- a/sw/source/filter/ww8/ww8atr.cxx +++ b/sw/source/filter/ww8/ww8atr.cxx @@ -4466,13 +4466,17 @@ void WW8Export::Out_SwFormatBox(const SvxBoxItem& rBox, bool bShadow) void WW8Export::Out_SwFormatTableBox( ww::bytes& rO, const SvxBoxItem * pBox ) { // moeglich und vielleicht besser waere 0xffff + static const SvxBoxItemLine aBorders[] = + { + SvxBoxItemLine::TOP, SvxBoxItemLine::LEFT, SvxBoxItemLine::BOTTOM, SvxBoxItemLine::RIGHT + }; static const SvxBorderLine aBorderLine; - for( SvxBoxItemLine i : o3tl::enumrange<SvxBoxItemLine>() ) + for( int i = 0; i < 4; ++i ) { const SvxBorderLine* pLn; if (pBox != NULL) - pLn = pBox->GetLine( i ); + pLn = pBox->GetLine( aBorders[i] ); else pLn = & aBorderLine; |