libreoffice/openoffice.org-3.0.0.ooo88341.sc.verticalboxes.patch

142 lines
6.3 KiB
Diff
Raw Normal View History

2012-11-29 13:35:40 +00:00
From 8208f795bb6882cf77adef940839f0c46b9befb2 Mon Sep 17 00:00:00 2001
2011-12-05 14:30:10 +00:00
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
Date: Mon, 5 Dec 2011 15:28:19 +0100
Subject: [PATCH] vertical content overflowing out of cell (#i88341#)
---
2012-11-29 13:35:40 +00:00
sc/source/ui/inc/output.hxx | 2 ++
sc/source/ui/view/output2.cxx | 66 ++++++++++++++++++++++++++++---------------
2011-12-05 14:30:10 +00:00
2 files changed, 45 insertions(+), 23 deletions(-)
diff --git a/sc/source/ui/inc/output.hxx b/sc/source/ui/inc/output.hxx
2012-11-29 13:35:40 +00:00
index 1b8d8f5..6dcbe2e 100644
2011-12-05 14:30:10 +00:00
--- a/sc/source/ui/inc/output.hxx
+++ b/sc/source/ui/inc/output.hxx
2012-11-29 13:35:40 +00:00
@@ -296,6 +296,8 @@ public:
2011-12-05 14:30:10 +00:00
void DrawExtraShadow(sal_Bool bLeft, sal_Bool bTop, sal_Bool bRight, sal_Bool bBottom);
void DrawFrame();
2010-10-09 07:39:30 +00:00
2011-04-12 11:48:59 +00:00
+ bool UseNormalClip(SCROW nCellY, const SfxItemSet* pCondSet);
+
// with logic MapMode set!
2011-12-05 14:30:10 +00:00
void DrawEdit(sal_Bool bPixelToLogic);
2010-10-09 07:39:30 +00:00
2011-12-05 14:30:10 +00:00
diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx
2012-11-29 13:35:40 +00:00
index ac6365c..141ef00 100644
2011-12-05 14:30:10 +00:00
--- a/sc/source/ui/view/output2.cxx
+++ b/sc/source/ui/view/output2.cxx
2012-11-29 13:35:40 +00:00
@@ -2905,13 +2905,7 @@ void ScOutputData::DrawEditStandard(DrawEditParam& rParam)
2011-04-12 11:48:59 +00:00
(ScMergeAttr*)&rParam.mpPattern->GetItem(ATTR_MERGE);
bool bMerged = pMerge->GetColMerge() > 1 || pMerge->GetRowMerge() > 1;
2010-10-11 13:48:01 +00:00
2011-12-05 14:30:10 +00:00
- // Don't clip for text height when printing rows with optimal height,
- // except when font size is from conditional formatting.
- //! Allow clipping when vertically merged?
2011-04-12 11:48:59 +00:00
- if ( eType != OUTTYPE_PRINTER ||
2012-11-26 09:52:19 +00:00
- ( mpDoc->GetRowFlags( rParam.mnCellY, nTab ) & CR_MANUALSIZE ) ||
2011-04-12 11:48:59 +00:00
- ( rParam.mpCondSet && SFX_ITEM_SET ==
- rParam.mpCondSet->GetItemState(ATTR_FONT_HEIGHT, true) ) )
+ if (UseNormalClip(rParam.mnCellY, rParam.mpCondSet))
bClip = true;
else
bSimClip = true;
2012-11-29 13:35:40 +00:00
@@ -2946,6 +2940,19 @@ void ScOutputData::DrawEditStandard(DrawEditParam& rParam)
2011-04-12 11:48:59 +00:00
}
Rectangle aLogicClip;
2011-04-13 12:55:52 +00:00
+ if (
+ ((nAttrRotate == 9000) || (nAttrRotate == 27000)) &&
+ (!(rParam.meOrient==SVX_ORIENTATION_STANDARD &&
+ !rParam.mbAsianVertical)) &&
+ (!(bClip || bSimClip))
+ )
+ {
+ if (UseNormalClip(rParam.mnCellY, rParam.mpCondSet))
+ bClip = true;
+ else
+ bSimClip = true;
+ }
2011-04-12 11:48:59 +00:00
+
if (bClip || bSimClip)
{
// Clip marks are already handled in GetOutputArea
2012-11-29 13:35:40 +00:00
@@ -3278,13 +3285,8 @@ void ScOutputData::DrawEditBottomTop(DrawEditParam& rParam)
2011-04-12 11:48:59 +00:00
(ScMergeAttr*)&rParam.mpPattern->GetItem(ATTR_MERGE);
bool bMerged = pMerge->GetColMerge() > 1 || pMerge->GetRowMerge() > 1;
2010-10-09 07:39:30 +00:00
2011-12-05 14:30:10 +00:00
- // Don't clip for text height when printing rows with optimal height,
- // except when font size is from conditional formatting.
- //! Allow clipping when vertically merged?
2011-04-12 11:48:59 +00:00
- if ( eType != OUTTYPE_PRINTER ||
2012-11-26 09:52:19 +00:00
- ( mpDoc->GetRowFlags( rParam.mnCellY, nTab ) & CR_MANUALSIZE ) ||
2011-04-12 11:48:59 +00:00
- ( rParam.mpCondSet && SFX_ITEM_SET ==
- rParam.mpCondSet->GetItemState(ATTR_FONT_HEIGHT, true) ) )
2010-10-11 13:48:01 +00:00
+
2011-04-12 11:48:59 +00:00
+ if (UseNormalClip(rParam.mnCellY, rParam.mpCondSet))
bClip = true;
else
bSimClip = true;
2012-11-29 13:35:40 +00:00
@@ -3650,13 +3652,7 @@ void ScOutputData::DrawEditTopBottom(DrawEditParam& rParam)
2011-04-12 11:48:59 +00:00
(ScMergeAttr*)&rParam.mpPattern->GetItem(ATTR_MERGE);
bool bMerged = pMerge->GetColMerge() > 1 || pMerge->GetRowMerge() > 1;
2011-12-05 14:30:10 +00:00
- // Don't clip for text height when printing rows with optimal height,
- // except when font size is from conditional formatting.
- //! Allow clipping when vertically merged?
2011-04-12 11:48:59 +00:00
- if ( eType != OUTTYPE_PRINTER ||
2012-11-26 09:52:19 +00:00
- ( mpDoc->GetRowFlags( rParam.mnCellY, nTab ) & CR_MANUALSIZE ) ||
2011-04-12 11:48:59 +00:00
- ( rParam.mpCondSet && SFX_ITEM_SET ==
- rParam.mpCondSet->GetItemState(ATTR_FONT_HEIGHT, true) ) )
+ if (UseNormalClip(rParam.mnCellY, rParam.mpCondSet))
bClip = true;
else
bSimClip = true;
2012-11-29 13:35:40 +00:00
@@ -4547,6 +4543,20 @@ void ScOutputData::DrawEditAsianVertical(DrawEditParam& rParam)
2012-11-26 09:52:19 +00:00
rParam.adjustForHyperlinkInPDF(aURLStart, mpDev);
2011-04-12 11:48:59 +00:00
}
2010-10-09 07:39:30 +00:00
+bool ScOutputData::UseNormalClip(SCROW nCellY, const SfxItemSet* pCondSet)
+{
+ bool bNormalClip = false;
2010-10-11 13:48:01 +00:00
+ // Don't clip for text height when printing rows with optimal height,
+ // except when font size is from conditional formatting.
+ //! Allow clipping when vertically merged?
+ if ( eType != OUTTYPE_PRINTER ||
2012-11-29 13:35:40 +00:00
+ ( mpDoc->GetRowFlags( nCellY, nTab ) & CR_MANUALSIZE ) ||
2010-10-11 13:48:01 +00:00
+ ( pCondSet && SFX_ITEM_SET ==
2011-04-13 12:55:52 +00:00
+ pCondSet->GetItemState(ATTR_FONT_HEIGHT, sal_True) ) )
+ bNormalClip = true;
2010-10-09 07:39:30 +00:00
+ return bNormalClip;
+}
+
2011-04-12 11:48:59 +00:00
void ScOutputData::DrawEdit(sal_Bool bPixelToLogic)
2010-10-09 07:39:30 +00:00
{
2011-04-12 11:48:59 +00:00
ScFieldEditEngine* pEngine = NULL;
2012-11-29 13:35:40 +00:00
@@ -5258,11 +5268,21 @@ void ScOutputData::DrawRotated(sal_Bool bPixelToLogic)
2010-10-11 13:48:01 +00:00
else
{
2011-12-05 14:30:10 +00:00
// bei gedrehtem Text ist Standard zentriert
2010-10-11 13:48:01 +00:00
+ long nDiff = 0;
if (eHorJust==SVX_HOR_JUSTIFY_RIGHT)
- aLogicStart.X() += nAvailWidth - nEngineWidth;
+ nDiff = nAvailWidth - nEngineWidth;
else if (eHorJust==SVX_HOR_JUSTIFY_CENTER ||
eHorJust==SVX_HOR_JUSTIFY_STANDARD)
- aLogicStart.X() += (nAvailWidth - nEngineWidth) / 2;
+ nDiff = (nAvailWidth - nEngineWidth) / 2;
2010-10-09 07:39:30 +00:00
+
2010-10-11 13:48:01 +00:00
+ if (nEngineWidth > nAvailWidth)
+ {
2010-10-09 07:39:30 +00:00
+ if (nAttrRotate == 9000)
2010-10-11 13:48:01 +00:00
+ nDiff = 0;
+ else if (nAttrRotate == 27000)
+ nDiff = nAvailWidth - nEngineWidth;
+ }
+ aLogicStart.X() += nDiff;
}
}
2010-10-09 07:39:30 +00:00
2011-12-05 14:30:10 +00:00
--
2012-11-29 13:35:40 +00:00
1.8.0
2011-12-05 14:30:10 +00:00