8076325
Index: source/ui/inc/output.hxx
8076325
===================================================================
8076325
RCS file: /cvs/sc/sc/source/ui/inc/output.hxx,v
8076325
retrieving revision 1.19
8076325
diff -u -r1.19 output.hxx
8076325
--- openoffice.org.orig/sc/source/ui/inc/output.hxx	26 Jun 2007 11:50:45 -0000	1.19
8076325
+++ openoffice.org/sc/source/ui/inc/output.hxx	16 Apr 2008 12:05:59 -0000
5050f39
@@ -303,6 +303,8 @@
5050f39
     void	DrawExtraShadow(sal_Bool bLeft, sal_Bool bTop, sal_Bool bRight, sal_Bool bBottom);
5050f39
     void	DrawFrame();
8076325
 
5050f39
+    bool    UseNormalClip(SCROW nCellY, const SfxItemSet* pCondSet);
5050f39
+
5050f39
                     // with logic MapMode set!
5050f39
     void	DrawEdit(sal_Bool bPixelToLogic);
8076325
 
8076325
Index: source/ui/view/output2.cxx
8076325
===================================================================
8076325
RCS file: /cvs/sc/sc/source/ui/view/output2.cxx,v
8076325
retrieving revision 1.54.216.1
8076325
diff -u -r1.54.216.1 output2.cxx
8076325
--- openoffice.org.orig/sc/source/ui/view/output2.cxx	18 Jan 2008 12:02:36 -0000	1.54.216.1
8076325
+++ openoffice.org/sc/source/ui/view/output2.cxx	16 Apr 2008 12:19:34 -0000
5050f39
@@ -2819,13 +2819,7 @@
5050f39
                 (ScMergeAttr*)&rParam.mpPattern->GetItem(ATTR_MERGE);
5050f39
         bool bMerged = pMerge->GetColMerge() > 1 || pMerge->GetRowMerge() > 1;
9af7fae
 
5050f39
-        //	Don't clip for text height when printing rows with optimal height,
5050f39
-        //	except when font size is from conditional formatting.
5050f39
-        //!	Allow clipping when vertically merged?
5050f39
-        if ( eType != OUTTYPE_PRINTER ||
5050f39
-            ( pDoc->GetRowFlags( rParam.mnCellY, nTab ) & CR_MANUALSIZE ) ||
5050f39
-            ( rParam.mpCondSet && SFX_ITEM_SET ==
5050f39
-                rParam.mpCondSet->GetItemState(ATTR_FONT_HEIGHT, true) ) )
5050f39
+        if (UseNormalClip(rParam.mnCellY, rParam.mpCondSet))
5050f39
             bClip = true;
5050f39
         else
5050f39
             bSimClip = true;
5050f39
@@ -2861,6 +2855,19 @@
5050f39
     }
5050f39
 
5050f39
     Rectangle aLogicClip;
0d33515
+    if (
0d33515
+         ((nAttrRotate == 9000) || (nAttrRotate == 27000)) &&
0d33515
+         (!(rParam.meOrient==SVX_ORIENTATION_STANDARD &&
0d33515
+            !rParam.mbAsianVertical)) &&
0d33515
+         (!(bClip || bSimClip))
0d33515
+       )
0d33515
+    {
0d33515
+        if (UseNormalClip(rParam.mnCellY, rParam.mpCondSet))
0d33515
+            bClip = true;
0d33515
+        else
0d33515
+            bSimClip = true;
0d33515
+    }
5050f39
+
5050f39
     if (bClip || bSimClip)
5050f39
     {
5050f39
         // Clip marks are already handled in GetOutputArea
5050f39
@@ -3357,13 +3364,8 @@
5050f39
                 (ScMergeAttr*)&rParam.mpPattern->GetItem(ATTR_MERGE);
5050f39
         bool bMerged = pMerge->GetColMerge() > 1 || pMerge->GetRowMerge() > 1;
8076325
 
5050f39
-        //	Don't clip for text height when printing rows with optimal height,
5050f39
-        //	except when font size is from conditional formatting.
5050f39
-        //!	Allow clipping when vertically merged?
5050f39
-        if ( eType != OUTTYPE_PRINTER ||
5050f39
-            ( pDoc->GetRowFlags( rParam.mnCellY, nTab ) & CR_MANUALSIZE ) ||
5050f39
-            ( rParam.mpCondSet && SFX_ITEM_SET ==
5050f39
-                rParam.mpCondSet->GetItemState(ATTR_FONT_HEIGHT, true) ) )
9af7fae
+
5050f39
+        if (UseNormalClip(rParam.mnCellY, rParam.mpCondSet))
5050f39
             bClip = true;
5050f39
         else
5050f39
             bSimClip = true;
5050f39
@@ -3740,13 +3742,7 @@
5050f39
                 (ScMergeAttr*)&rParam.mpPattern->GetItem(ATTR_MERGE);
5050f39
         bool bMerged = pMerge->GetColMerge() > 1 || pMerge->GetRowMerge() > 1;
5050f39
 
5050f39
-        //	Don't clip for text height when printing rows with optimal height,
5050f39
-        //	except when font size is from conditional formatting.
5050f39
-        //!	Allow clipping when vertically merged?
5050f39
-        if ( eType != OUTTYPE_PRINTER ||
5050f39
-            ( pDoc->GetRowFlags( rParam.mnCellY, nTab ) & CR_MANUALSIZE ) ||
5050f39
-            ( rParam.mpCondSet && SFX_ITEM_SET ==
5050f39
-                rParam.mpCondSet->GetItemState(ATTR_FONT_HEIGHT, true) ) )
5050f39
+        if (UseNormalClip(rParam.mnCellY, rParam.mpCondSet))
5050f39
             bClip = true;
5050f39
         else
5050f39
             bSimClip = true;
5050f39
@@ -3880,6 +3876,20 @@
5050f39
     DrawEditStandard(rParam);
5050f39
 }
5050f39
 
8076325
+bool ScOutputData::UseNormalClip(SCROW nCellY, const SfxItemSet* pCondSet)
8076325
+{
8076325
+    bool bNormalClip = false;
9af7fae
+       //      Don't clip for text height when printing rows with optimal height,
9af7fae
+       //      except when font size is from conditional formatting.
9af7fae
+       //!     Allow clipping when vertically merged?
9af7fae
+       if ( eType != OUTTYPE_PRINTER ||
9af7fae
+               ( pDoc->GetRowFlags( nCellY, nTab ) & CR_MANUALSIZE ) ||
9af7fae
+               ( pCondSet && SFX_ITEM_SET ==
0d33515
+                       pCondSet->GetItemState(ATTR_FONT_HEIGHT, sal_True) ) )
0d33515
+               bNormalClip = true;
8076325
+    return bNormalClip;
8076325
+}
8076325
+
5050f39
 void ScOutputData::DrawEdit(sal_Bool bPixelToLogic)
8076325
 {
5050f39
     ScFieldEditEngine* pEngine = NULL;
5050f39
@@ -4622,11 +4632,21 @@
9af7fae
                                     else
9af7fae
                                     {
9af7fae
                                         //	bei gedrehtem Text ist Standard zentriert
9af7fae
+                                        long nDiff = 0;
9af7fae
                                         if (eHorJust==SVX_HOR_JUSTIFY_RIGHT)
9af7fae
-                                            aLogicStart.X() += nAvailWidth - nEngineWidth;
9af7fae
+                                            nDiff = nAvailWidth - nEngineWidth;
9af7fae
                                         else if (eHorJust==SVX_HOR_JUSTIFY_CENTER ||
9af7fae
                                                  eHorJust==SVX_HOR_JUSTIFY_STANDARD)
9af7fae
-                                            aLogicStart.X() += (nAvailWidth - nEngineWidth) / 2;
9af7fae
+                                            nDiff = (nAvailWidth - nEngineWidth) / 2;
8076325
+
9af7fae
+                                        if (nEngineWidth > nAvailWidth)
9af7fae
+                                        {
8076325
+                                            if (nAttrRotate == 9000)
9af7fae
+                                               nDiff = 0;
9af7fae
+                                            else if (nAttrRotate == 27000)
9af7fae
+                                               nDiff = nAvailWidth - nEngineWidth;
9af7fae
+                                        }
9af7fae
+                                        aLogicStart.X() += nDiff;
9af7fae
                                     }
9af7fae
                                 }
8076325