[Libreoffice-commits] core.git: sd/source sw/source

Noel Grandin noel at peralex.com
Tue Aug 11 06:02:52 PDT 2015


 sd/source/ui/table/TableDesignPane.cxx |    2 +-
 sw/source/filter/ww8/wrtww8gr.cxx      |   16 ++++++++++------
 sw/source/filter/ww8/ww8atr.cxx        |    8 ++++++--
 3 files changed, 17 insertions(+), 9 deletions(-)

New commits:
commit 78446df26f45e2a71187873726388c9d2f6ba6e5
Author: Noel Grandin <noel at peralex.com>
Date:   Tue Aug 11 15:02:05 2015 +0200

    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"
    
    Change-Id: I23eb359a40035dd40bdb60703de567b1c328e793

diff --git a/sd/source/ui/table/TableDesignPane.cxx b/sd/source/ui/table/TableDesignPane.cxx
index aac2f0f..206a08b 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 a99881e..12f3aeb 100644
--- a/sw/source/filter/ww8/wrtww8gr.cxx
+++ b/sw/source/filter/ww8/wrtww8gr.cxx
@@ -544,14 +544,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 = WW8Export::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,
@@ -562,7 +564,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:
@@ -696,13 +698,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 5a5f243..f9f7c6e 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -4064,13 +4064,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;
 


More information about the Libreoffice-commits mailing list