Commits

tora committed ee188f8 Merge

tora01: #i86769#: Fixed by implementing coordinate conversion; resync with DEV300_m100

Comments (0)

Files changed (2)

sw/source/filter/ww8/wrtw8esh.cxx

             SwWW8Writer::WriteLong(*rWrt.pTableStrm, aIter->mnShapeId);
 
             SwTwips nLeft = aRect.Left() + nThick;
+            SwTwips nTop = aRect.Top() + nThick;        // #i86769#
             SwTwips nRight = aRect.Right() - nThick;
+            SwTwips nBottom = aRect.Bottom() - nThick;  // #i86769#
 
             //Nasty swap for bidi if neccessary
             rWrt.MiserableRTLFrmFmtHack(nLeft, nRight, rFrmFmt);
 
+            // --> #i86769#
+            // In case of vertical writing, a coordinate of Writer is converted into that of WW8
+            if ( rWrt.GetCurrentPageDirection() )
+            {
+                Rectangle r(nLeft, nTop, nRight, nBottom);
+                nLeft   = r.Left() - r.Top() - r.Right();
+                nTop    = r.Left();
+                nRight  = 0 - r.Top();
+                nBottom = r.Bottom() - r.Top() + r.Left();
+            }
+            // <-- #i86769#
+
             //xaLeft/yaTop/xaRight/yaBottom - rel. to anchor
             //(most of) the border is outside the graphic is word, so
             //change dimensions to fit
             SwWW8Writer::WriteLong(*rWrt.pTableStrm, nLeft);
-            SwWW8Writer::WriteLong(*rWrt.pTableStrm,aRect.Top() + nThick);
+            SwWW8Writer::WriteLong(*rWrt.pTableStrm, nTop);    // #i86769#
             SwWW8Writer::WriteLong(*rWrt.pTableStrm, nRight);
-            SwWW8Writer::WriteLong(*rWrt.pTableStrm,aRect.Bottom() - nThick);
+            SwWW8Writer::WriteLong(*rWrt.pTableStrm, nBottom); // #i86769#
 
             //fHdr/bx/by/wr/wrk/fRcaSimple/fBelowText/fAnchorLock
             sal_uInt16 nFlags=0;

sw/source/filter/ww8/ww8graf.cxx

     if (!pMSDffManager->GetModel())
          pMSDffManager->SetModel(pDrawModel, 1440);
 
+    // --> #i86769#
+    // In case of vertical writing, a coordinate of WW8 is converted into that of Writer
+    if ( maSectionManager.CurrentSectionIsVertical() )
+    {
+        Rectangle r(pF->nXaLeft, pF->nYaTop, pF->nXaRight, pF->nYaBottom);
+        pF->nXaLeft   = r.Top();
+        pF->nYaTop    = 0 - r.Right();
+        pF->nXaRight  = r.Right() + r.Top() - r.Left();
+        pF->nYaBottom = r.Bottom() - r.Top() - r.Right();
+    }
+    // <-- #i86769#
 
     Rectangle aRect(pF->nXaLeft,  pF->nYaTop, pF->nXaRight, pF->nYaBottom);
     SvxMSDffImportData aData( aRect );